diff --git a/vim/bundle/jedi-vim/pythonx/jedi/.coveragerc b/vim/bundle/jedi-vim/pythonx/jedi/.coveragerc new file mode 100644 index 0000000..005e74f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/.coveragerc @@ -0,0 +1,13 @@ +[run] +omit = + jedi/_compatibility.py + jedi/evaluate/compiled/subprocess/__main__.py + jedi/__main__.py + # For now this is not being used. + jedi/refactoring.py + +[report] +# Regexes for lines to exclude from consideration +exclude_lines = + # Don't complain about missing debug-only code: + def __repr__ diff --git a/vim/bundle/jedi-vim/pythonx/jedi/.travis.yml b/vim/bundle/jedi-vim/pythonx/jedi/.travis.yml new file mode 100644 index 0000000..c99573f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/.travis.yml @@ -0,0 +1,68 @@ +dist: xenial +language: python +python: + - 2.7 + - 3.4 + - 3.5 + - 3.6 + - 3.7 + +env: + - JEDI_TEST_ENVIRONMENT=27 + - JEDI_TEST_ENVIRONMENT=34 + - JEDI_TEST_ENVIRONMENT=35 + - JEDI_TEST_ENVIRONMENT=36 + - JEDI_TEST_ENVIRONMENT=37 + +matrix: + include: + - python: 3.6 + env: + - TOXENV=cov + - JEDI_TEST_ENVIRONMENT=36 + # For now ignore pypy, there are so many issues that we don't really need + # to run it. + #- python: pypy + - python: 3.8-dev + env: + - JEDI_TEST_ENVIRONMENT=38 +install: + - pip install --quiet tox-travis +script: + - | + # Setup/install Python for $JEDI_TEST_ENVIRONMENT. + set -ex + test_env_version=${JEDI_TEST_ENVIRONMENT:0:1}.${JEDI_TEST_ENVIRONMENT:1:1} + if [ "$TRAVIS_PYTHON_VERSION" != "$test_env_version" ]; then + python_bin=python$test_env_version + python_path="$(which $python_bin || true)" + if [ -z "$python_path" ]; then + # Only required for JEDI_TEST_ENVIRONMENT=34. + download_name=python-$test_env_version + wget https://s3.amazonaws.com/travis-python-archives/binaries/ubuntu/16.04/x86_64/$download_name.tar.bz2 + sudo tar xjf $download_name.tar.bz2 --directory / opt/python + ln -s "/opt/python/${test_env_version}/bin/python" /home/travis/bin/$python_bin + elif [ "${python_path#/opt/pyenv/shims}" != "$python_path" ]; then + # Activate pyenv version (required with JEDI_TEST_ENVIRONMENT=36). + pyenv_bin="$(pyenv whence --path "$python_bin" | head -n1)" + ln -s "$pyenv_bin" /home/travis/bin/$python_bin + fi + $python_bin --version + python_ver=$($python_bin -c 'import sys; print("%d%d" % sys.version_info[0:2])') + if [ "$JEDI_TEST_ENVIRONMENT" != "$python_ver" ]; then + echo "Unexpected Python version for $JEDI_TEST_ENVIRONMENT: $python_ver" + set +ex + exit 2 + fi + fi + set +ex + - tox +after_script: + - | + if [ $TOXENV == "cov" ]; then + pip install --quiet codecov coveralls + coverage xml + coverage report -m + coveralls + bash <(curl -s https://codecov.io/bash) -X gcov -X coveragepy -X search -X fix -X xcode -f coverage.xml + fi diff --git a/vim/bundle/jedi-vim/pythonx/jedi/AUTHORS.txt b/vim/bundle/jedi-vim/pythonx/jedi/AUTHORS.txt new file mode 100644 index 0000000..3b740ac --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/AUTHORS.txt @@ -0,0 +1,57 @@ +Main Authors +============ + +David Halter (@davidhalter) +Takafumi Arakaki (@tkf) + +Code Contributors +================= + +Danilo Bargen (@dbrgn) +Laurens Van Houtven (@lvh) <_@lvh.cc> +Aldo Stracquadanio (@Astrac) +Jean-Louis Fuchs (@ganwell) +tek (@tek) +Yasha Borevich (@jjay) +Aaron Griffin +andviro (@andviro) +Mike Gilbert (@floppym) +Aaron Meurer (@asmeurer) +Lubos Trilety +Akinori Hattori (@hattya) +srusskih (@srusskih) +Steven Silvester (@blink1073) +Colin Duquesnoy (@ColinDuquesnoy) +Jorgen Schaefer (@jorgenschaefer) +Fredrik Bergroth (@fbergroth) +Mathias Fußenegger (@mfussenegger) +Syohei Yoshida (@syohex) +ppalucky (@ppalucky) +immerrr (@immerrr) immerrr@gmail.com +Albertas Agejevas (@alga) +Savor d'Isavano (@KenetJervet) +Phillip Berndt (@phillipberndt) +Ian Lee (@IanLee1521) +Farkhad Khatamov (@hatamov) +Kevin Kelley (@kelleyk) +Sid Shanker (@squidarth) +Reinoud Elhorst (@reinhrst) +Guido van Rossum (@gvanrossum) +Dmytro Sadovnychyi (@sadovnychyi) +Cristi Burcă (@scribu) +bstaint (@bstaint) +Mathias Rav (@Mortal) +Daniel Fiterman (@dfit99) +Simon Ruggier (@sruggier) +Élie Gouzien (@ElieGouzien) +Robin Roth (@robinro) +Malte Plath (@langsamer) +Anton Zub (@zabulazza) +Maksim Novikov (@m-novikov) +Tobias Rzepka (@TobiasRzepka) +micbou (@micbou) +Dima Gerasimov (@karlicoss) +Max Woerner Chase (@mwchase) +Johannes Maria Frank (@jmfrank63) + +Note: (@user) means a github user name. diff --git a/vim/bundle/jedi-vim/pythonx/jedi/CHANGELOG.rst b/vim/bundle/jedi-vim/pythonx/jedi/CHANGELOG.rst new file mode 100644 index 0000000..d1263e7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/CHANGELOG.rst @@ -0,0 +1,182 @@ +.. :changelog: + +Changelog +--------- + +0.15.1 (2019-08-13) ++++++++++++++++++++ + +- Small bugfix and removal of a print statement + +0.15.0 (2019-08-11) ++++++++++++++++++++ + +- Added file path completions, there's a **new ``Completion.type``** ``path``, + now. Example: ``'/ho`` -> ``'/home/`` +- ``*args``/``**kwargs`` resolving. If possible Jedi replaces the parameters + with the actual alternatives. +- Better support for enums/dataclasses +- When using Interpreter, properties are now executed, since a lot of people + have complained about this. Discussion in #1299, #1347. + +New APIs: + +- ``Definition.get_signatures() -> List[Signature]``. Signatures are similar to + ``CallSignature``. ``Definition.params`` is therefore deprecated. +- ``Signature.to_string()`` to format call signatures. +- ``Signature.params -> List[ParamDefinition]``, ParamDefinition has the + following additional attributes ``infer_default()``, ``infer_annotation()``, + ``to_string()``, and ``kind``. +- ``Definition.execute() -> List[Definition]``, makes it possible to infer + return values of functions. + + +0.14.1 (2019-07-13) ++++++++++++++++++++ + +- CallSignature.index should now be working a lot better +- A couple of smaller bugfixes + +0.14.0 (2019-06-20) ++++++++++++++++++++ + +- Added ``goto_*(prefer_stubs=True)`` as well as ``goto_*(prefer_stubs=True)`` +- Stubs are used now for type inference +- Typeshed is used for better type inference +- Reworked Definition.full_name, should have more correct return values + +0.13.3 (2019-02-24) ++++++++++++++++++++ + +- Fixed an issue with embedded Python, see https://github.com/davidhalter/jedi-vim/issues/870 + +0.13.2 (2018-12-15) ++++++++++++++++++++ + +- Fixed a bug that led to Jedi spawning a lot of subprocesses. + +0.13.1 (2018-10-02) ++++++++++++++++++++ + +- Bugfixes, because tensorflow completions were still slow. + +0.13.0 (2018-10-02) ++++++++++++++++++++ + +- A small release. Some bug fixes. +- Remove Python 3.3 support. Python 3.3 support has been dropped by the Python + foundation. +- Default environments are now using the same Python version as the Python + process. In 0.12.x, we used to load the latest Python version on the system. +- Added ``include_builtins`` as a parameter to usages. +- ``goto_assignments`` has a new ``follow_builtin_imports`` parameter that + changes the previous behavior slightly. + +0.12.1 (2018-06-30) ++++++++++++++++++++ + +- This release forces you to upgrade parso. If you don't, nothing will work + anymore. Otherwise changes should be limited to bug fixes. Unfortunately Jedi + still uses a few internals of parso that make it hard to keep compatibility + over multiple releases. Parso >=0.3.0 is going to be needed. + +0.12.0 (2018-04-15) ++++++++++++++++++++ + +- Virtualenv/Environment support +- F-String Completion/Goto Support +- Cannot crash with segfaults anymore +- Cleaned up import logic +- Understand async/await and autocomplete it (including async generators) +- Better namespace completions +- Passing tests for Windows (including CI for Windows) +- Remove Python 2.6 support + +0.11.1 (2017-12-14) ++++++++++++++++++++ + +- Parso update - the caching layer was broken +- Better usages - a lot of internal code was ripped out and improved. + +0.11.0 (2017-09-20) ++++++++++++++++++++ + +- Split Jedi's parser into a separate project called ``parso``. +- Avoiding side effects in REPL completion. +- Numpy docstring support should be much better. +- Moved the `settings.*recursion*` away, they are no longer usable. + +0.10.2 (2017-04-05) ++++++++++++++++++++ + +- Python Packaging sucks. Some files were not included in 0.10.1. + +0.10.1 (2017-04-05) ++++++++++++++++++++ + +- Fixed a few very annoying bugs. +- Prepared the parser to be factored out of Jedi. + +0.10.0 (2017-02-03) ++++++++++++++++++++ + +- Actual semantic completions for the complete Python syntax. +- Basic type inference for ``yield from`` PEP 380. +- PEP 484 support (most of the important features of it). Thanks Claude! (@reinhrst) +- Added ``get_line_code`` to ``Definition`` and ``Completion`` objects. +- Completely rewritten the type inference engine. +- A new and better parser for (fast) parsing diffs of Python code. + +0.9.0 (2015-04-10) +++++++++++++++++++ + +- The import logic has been rewritten to look more like Python's. There is now + an ``Evaluator.modules`` import cache, which resembles ``sys.modules``. +- Integrated the parser of 2to3. This will make refactoring possible. It will + also be possible to check for error messages (like compiling an AST would give) + in the future. +- With the new parser, the evaluation also completely changed. It's now simpler + and more readable. +- Completely rewritten REPL completion. +- Added ``jedi.names``, a command to do static analysis. Thanks to that + sourcegraph guys for sponsoring this! +- Alpha version of the linter. + + +0.8.1 (2014-07-23) ++++++++++++++++++++ + +- Bugfix release, the last release forgot to include files that improve + autocompletion for builtin libraries. Fixed. + +0.8.0 (2014-05-05) ++++++++++++++++++++ + +- Memory Consumption for compiled modules (e.g. builtins, sys) has been reduced + drastically. Loading times are down as well (it takes basically as long as an + import). +- REPL completion is starting to become usable. +- Various small API changes. Generally this release focuses on stability and + refactoring of internal APIs. +- Introducing operator precedence, which makes calculating correct Array + indices and ``__getattr__`` strings possible. + +0.7.0 (2013-08-09) +++++++++++++++++++ + +- Switched from LGPL to MIT license. +- Added an Interpreter class to the API to make autocompletion in REPL + possible. +- Added autocompletion support for namespace packages. +- Add sith.py, a new random testing method. + +0.6.0 (2013-05-14) +++++++++++++++++++ + +- Much faster parser with builtin part caching. +- A test suite, thanks @tkf. + +0.5 versions (2012) ++++++++++++++++++++ + +- Initial development. diff --git a/vim/bundle/jedi-vim/pythonx/jedi/CONTRIBUTING.md b/vim/bundle/jedi-vim/pythonx/jedi/CONTRIBUTING.md new file mode 100644 index 0000000..d791bae --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/CONTRIBUTING.md @@ -0,0 +1,8 @@ +Pull Requests are great. + + 1. Fork the Repo on github. + 2. If you are adding functionality or fixing a bug, please add a test! + 3. Add your name to AUTHORS.txt + 4. Push to your fork and submit a pull request. + +**Try to use the PEP8 style guide** (and it's ok to have a line length of 100 characters). diff --git a/vim/bundle/jedi-vim/pythonx/jedi/LICENSE.txt b/vim/bundle/jedi-vim/pythonx/jedi/LICENSE.txt new file mode 100644 index 0000000..94f9545 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/LICENSE.txt @@ -0,0 +1,24 @@ +All contributions towards Jedi are MIT licensed. + +------------------------------------------------------------------------------- +The MIT License (MIT) + +Copyright (c) <2013> + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vim/bundle/jedi-vim/pythonx/jedi/MANIFEST.in b/vim/bundle/jedi-vim/pythonx/jedi/MANIFEST.in new file mode 100644 index 0000000..9486962 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/MANIFEST.in @@ -0,0 +1,17 @@ +include README.rst +include CHANGELOG.rst +include LICENSE.txt +include AUTHORS.txt +include .coveragerc +include sith.py +include conftest.py +include pytest.ini +include tox.ini +include requirements.txt +include jedi/parser/python/grammar*.txt +recursive-include jedi/third_party *.pyi +include jedi/third_party/typeshed/LICENSE +include jedi/third_party/typeshed/README +recursive-include test * +recursive-include docs * +recursive-exclude * *.pyc diff --git a/vim/bundle/jedi-vim/pythonx/jedi/README.rst b/vim/bundle/jedi-vim/pythonx/jedi/README.rst new file mode 100644 index 0000000..7c90f8b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/README.rst @@ -0,0 +1,224 @@ +################################################################### +Jedi - an awesome autocompletion/static analysis library for Python +################################################################### + +.. image:: https://img.shields.io/pypi/v/jedi.svg?style=flat + :target: https://pypi.python.org/pypi/jedi + :alt: PyPI version + +.. image:: https://img.shields.io/pypi/pyversions/jedi.svg + :target: https://pypi.python.org/pypi/jedi + :alt: Supported Python versions + +.. image:: https://travis-ci.org/davidhalter/jedi.svg?branch=master + :target: https://travis-ci.org/davidhalter/jedi + :alt: Linux Tests + +.. image:: https://ci.appveyor.com/api/projects/status/mgva3bbawyma1new/branch/master?svg=true + :target: https://ci.appveyor.com/project/davidhalter/jedi/branch/master + :alt: Windows Tests + +.. image:: https://coveralls.io/repos/davidhalter/jedi/badge.svg?branch=master + :target: https://coveralls.io/r/davidhalter/jedi + :alt: Coverage status + + +*If you have specific questions, please add an issue or ask on* `Stack Overflow +`_ *with the label* ``python-jedi``. + + +Jedi is a static analysis tool for Python that can be used in IDEs/editors. +Jedi has a focus on autocompletion and goto functionality. Jedi is fast and is +very well tested. It understands Python and stubs on a deep level. + +Jedi has support for different goto functions. It's possible to search for +usages and list names in a Python file to get information about them. + +Jedi uses a very simple API to connect with IDE's. There's a reference +implementation as a `VIM-Plugin `_, +which uses Jedi's autocompletion. We encourage you to use Jedi in your IDEs. +Autocompletion in your REPL is also possible, IPython uses it natively and for +the CPython REPL you have to install it. + +Jedi can currently be used with the following editors/projects: + +- Vim (jedi-vim_, YouCompleteMe_, deoplete-jedi_, completor.vim_) +- Emacs (Jedi.el_, company-mode_, elpy_, anaconda-mode_, ycmd_) +- Sublime Text (SublimeJEDI_ [ST2 + ST3], anaconda_ [only ST3]) +- TextMate_ (Not sure if it's actually working) +- Kate_ version 4.13+ supports it natively, you have to enable it, though. [`proof + `_] +- Atom_ (autocomplete-python-jedi_) +- `GNOME Builder`_ (with support for GObject Introspection) +- `Visual Studio Code`_ (via `Python Extension `_) +- Gedit (gedi_) +- wdb_ - Web Debugger +- `Eric IDE`_ (Available as a plugin) +- `IPython 6.0.0+ `_ + +and many more! + + +Here are some pictures taken from jedi-vim_: + +.. image:: https://github.com/davidhalter/jedi/raw/master/docs/_screenshots/screenshot_complete.png + +Completion for almost anything (Ctrl+Space). + +.. image:: https://github.com/davidhalter/jedi/raw/master/docs/_screenshots/screenshot_function.png + +Display of function/class bodies, docstrings. + +.. image:: https://github.com/davidhalter/jedi/raw/master/docs/_screenshots/screenshot_pydoc.png + +Pydoc support (Shift+k). + +There is also support for goto and renaming. + +Get the latest version from `github `_ +(master branch should always be kind of stable/working). + +Docs are available at `https://jedi.readthedocs.org/en/latest/ +`_. Pull requests with documentation +enhancements and/or fixes are awesome and most welcome. Jedi uses `semantic +versioning `_. + +If you want to stay up-to-date (News / RFCs), please subscribe to this `github +thread `_.: + + + +Installation +============ + + pip install jedi + +Note: This just installs the Jedi library, not the editor plugins. For +information about how to make it work with your editor, refer to the +corresponding documentation. + +You don't want to use ``pip``? Please refer to the `manual +`_. + + +Feature Support and Caveats +=========================== + +Jedi really understands your Python code. For a comprehensive list what Jedi +understands, see: `Features +`_. A list of +caveats can be found on the same page. + +You can run Jedi on CPython 2.7 or 3.4+ but it should also +understand/parse code older than those versions. Additionally you should be able +to use `Virtualenvs `_ +very well. + +Tips on how to use Jedi efficiently can be found `here +`_. + +API +--- + +You can find the documentation for the `API here `_. + + +Autocompletion / Goto / Pydoc +----------------------------- + +Please check the API for a good explanation. There are the following commands: + +- ``jedi.Script.goto_assignments`` +- ``jedi.Script.completions`` +- ``jedi.Script.usages`` + +The returned objects are very powerful and really all you might need. + + +Autocompletion in your REPL (IPython, etc.) +------------------------------------------- + +Starting with IPython `6.0.0` Jedi is a dependency of IPython. Autocompletion +in IPython is therefore possible without additional configuration. + +It's possible to have Jedi autocompletion in REPL modes - `example video `_. +This means that in Python you can enable tab completion in a `REPL +`_. + + +Static Analysis +------------------------ + +To do all forms of static analysis, please try to use ``jedi.names``. It will +return a list of names that you can use to infer types and so on. + + +Refactoring +----------- + +Jedi's parser would support refactoring, but there's no API to use it right +now. If you're interested in helping out here, let me know. With the latest +parser changes, it should be very easy to actually make it work. + + +Development +=========== + +There's a pretty good and extensive `development documentation +`_. + + +Testing +======= + +The test suite depends on ``tox`` and ``pytest``:: + + pip install tox pytest + +To run the tests for all supported Python versions:: + + tox + +If you want to test only a specific Python version (e.g. Python 2.7), it's as +easy as :: + + tox -e py27 + +Tests are also run automatically on `Travis CI +`_. + +For more detailed information visit the `testing documentation +`_. + + +Acknowledgements +================ + +- Takafumi Arakaki (@tkf) for creating a solid test environment and a lot of + other things. +- Danilo Bargen (@dbrgn) for general housekeeping and being a good friend :). +- Guido van Rossum (@gvanrossum) for creating the parser generator pgen2 + (originally used in lib2to3). + + + +.. _jedi-vim: https://github.com/davidhalter/jedi-vim +.. _youcompleteme: https://github.com/ycm-core/YouCompleteMe +.. _deoplete-jedi: https://github.com/zchee/deoplete-jedi +.. _completor.vim: https://github.com/maralla/completor.vim +.. _Jedi.el: https://github.com/tkf/emacs-jedi +.. _company-mode: https://github.com/syohex/emacs-company-jedi +.. _elpy: https://github.com/jorgenschaefer/elpy +.. _anaconda-mode: https://github.com/proofit404/anaconda-mode +.. _ycmd: https://github.com/abingham/emacs-ycmd +.. _sublimejedi: https://github.com/srusskih/SublimeJEDI +.. _anaconda: https://github.com/DamnWidget/anaconda +.. _wdb: https://github.com/Kozea/wdb +.. _TextMate: https://github.com/lawrenceakka/python-jedi.tmbundle +.. _Kate: https://kate-editor.org +.. _Atom: https://atom.io/ +.. _autocomplete-python-jedi: https://atom.io/packages/autocomplete-python-jedi +.. _GNOME Builder: https://wiki.gnome.org/Apps/Builder +.. _Visual Studio Code: https://code.visualstudio.com/ +.. _gedi: https://github.com/isamert/gedi +.. _Eric IDE: https://eric-ide.python-projects.org diff --git a/vim/bundle/jedi-vim/pythonx/jedi/appveyor.yml b/vim/bundle/jedi-vim/pythonx/jedi/appveyor.yml new file mode 100644 index 0000000..c1a246e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/appveyor.yml @@ -0,0 +1,87 @@ +environment: + matrix: + - TOXENV: py27 + PYTHON_PATH: C:\Python27 + JEDI_TEST_ENVIRONMENT: 27 + - TOXENV: py27 + PYTHON_PATH: C:\Python27 + JEDI_TEST_ENVIRONMENT: 34 + - TOXENV: py27 + PYTHON_PATH: C:\Python27 + JEDI_TEST_ENVIRONMENT: 35 + - TOXENV: py27 + PYTHON_PATH: C:\Python27 + JEDI_TEST_ENVIRONMENT: 36 + - TOXENV: py27 + PYTHON_PATH: C:\Python27 + JEDI_TEST_ENVIRONMENT: 37 + + - TOXENV: py34 + PYTHON_PATH: C:\Python34 + JEDI_TEST_ENVIRONMENT: 27 + - TOXENV: py34 + PYTHON_PATH: C:\Python34 + JEDI_TEST_ENVIRONMENT: 34 + - TOXENV: py34 + PYTHON_PATH: C:\Python34 + JEDI_TEST_ENVIRONMENT: 35 + - TOXENV: py34 + PYTHON_PATH: C:\Python34 + JEDI_TEST_ENVIRONMENT: 36 + - TOXENV: py34 + PYTHON_PATH: C:\Python34 + JEDI_TEST_ENVIRONMENT: 37 + + - TOXENV: py35 + PYTHON_PATH: C:\Python35 + JEDI_TEST_ENVIRONMENT: 27 + - TOXENV: py35 + PYTHON_PATH: C:\Python35 + JEDI_TEST_ENVIRONMENT: 34 + - TOXENV: py35 + PYTHON_PATH: C:\Python35 + JEDI_TEST_ENVIRONMENT: 35 + - TOXENV: py35 + PYTHON_PATH: C:\Python35 + JEDI_TEST_ENVIRONMENT: 36 + - TOXENV: py35 + PYTHON_PATH: C:\Python35 + JEDI_TEST_ENVIRONMENT: 37 + + - TOXENV: py36 + PYTHON_PATH: C:\Python36 + JEDI_TEST_ENVIRONMENT: 27 + - TOXENV: py36 + PYTHON_PATH: C:\Python36 + JEDI_TEST_ENVIRONMENT: 34 + - TOXENV: py36 + PYTHON_PATH: C:\Python36 + JEDI_TEST_ENVIRONMENT: 35 + - TOXENV: py36 + PYTHON_PATH: C:\Python36 + JEDI_TEST_ENVIRONMENT: 36 + - TOXENV: py36 + PYTHON_PATH: C:\Python36 + JEDI_TEST_ENVIRONMENT: 37 + + - TOXENV: py37 + PYTHON_PATH: C:\Python37 + JEDI_TEST_ENVIRONMENT: 27 + - TOXENV: py37 + PYTHON_PATH: C:\Python37 + JEDI_TEST_ENVIRONMENT: 34 + - TOXENV: py37 + PYTHON_PATH: C:\Python37 + JEDI_TEST_ENVIRONMENT: 35 + - TOXENV: py37 + PYTHON_PATH: C:\Python37 + JEDI_TEST_ENVIRONMENT: 36 + - TOXENV: py37 + PYTHON_PATH: C:\Python37 + JEDI_TEST_ENVIRONMENT: 37 +install: + - git submodule update --init --recursive + - set PATH=%PYTHON_PATH%;%PYTHON_PATH%\Scripts;%PATH% + - pip install tox +build_script: + - tox diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/__init__.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/__init__.py new file mode 100644 index 0000000..28cb035 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/__init__.py @@ -0,0 +1,47 @@ +""" +Jedi is a static analysis tool for Python that can be used in IDEs/editors. +Jedi has a focus on autocompletion and goto functionality. Jedi is fast and is +very well tested. It understands Python and stubs on a deep level. + +Jedi has support for different goto functions. It's possible to search for +usages and list names in a Python file to get information about them. + +Jedi uses a very simple API to connect with IDE's. There's a reference +implementation as a `VIM-Plugin `_, +which uses Jedi's autocompletion. We encourage you to use Jedi in your IDEs. +Autocompletion in your REPL is also possible, IPython uses it natively and for +the CPython REPL you have to install it. + +Here's a simple example of the autocompletion feature: + +>>> import jedi +>>> source = ''' +... import json +... json.lo''' +>>> script = jedi.Script(source, 3, len('json.lo'), 'example.py') +>>> script + +>>> completions = script.completions() +>>> completions +[, ] +>>> print(completions[0].complete) +ad +>>> print(completions[0].name) +load + +As you see Jedi is pretty simple and allows you to concentrate on writing a +good text editor, while still having very good IDE features for Python. +""" + +__version__ = '0.15.1' + +from jedi.api import Script, Interpreter, set_debug_function, \ + preload_module, names +from jedi import settings +from jedi.api.environment import find_virtualenvs, find_system_environments, \ + get_default_environment, InvalidPythonEnvironment, create_environment, \ + get_system_environment +from jedi.api.exceptions import InternalError +# Finally load the internal plugins. This is only internal. +from jedi.plugins import registry +del registry diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/__main__.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/__main__.py new file mode 100644 index 0000000..f2ee047 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/__main__.py @@ -0,0 +1,48 @@ +import sys +from os.path import join, dirname, abspath, isdir + + +def _start_linter(): + """ + This is a pre-alpha API. You're not supposed to use it at all, except for + testing. It will very likely change. + """ + import jedi + + if '--debug' in sys.argv: + jedi.set_debug_function() + + for path in sys.argv[2:]: + if path.startswith('--'): + continue + if isdir(path): + import fnmatch + import os + + paths = [] + for root, dirnames, filenames in os.walk(path): + for filename in fnmatch.filter(filenames, '*.py'): + paths.append(os.path.join(root, filename)) + else: + paths = [path] + + try: + for path in paths: + for error in jedi.Script(path=path)._analysis(): + print(error) + except Exception: + if '--pdb' in sys.argv: + import traceback + traceback.print_exc() + import pdb + pdb.post_mortem() + else: + raise + + +if len(sys.argv) == 2 and sys.argv[1] == 'repl': + # don't want to use __main__ only for repl yet, maybe we want to use it for + # something else. So just use the keyword ``repl`` for now. + print(join(dirname(abspath(__file__)), 'api', 'replstartup.py')) +elif len(sys.argv) > 1 and sys.argv[1] == 'linter': + _start_linter() diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/_compatibility.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/_compatibility.py new file mode 100644 index 0000000..28e23b0 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/_compatibility.py @@ -0,0 +1,665 @@ +""" +To ensure compatibility from Python ``2.7`` - ``3.x``, a module has been +created. Clearly there is huge need to use conforming syntax. +""" +from __future__ import print_function +import atexit +import errno +import functools +import sys +import os +import re +import pkgutil +import warnings +import inspect +import subprocess +import weakref +try: + import importlib +except ImportError: + pass +from zipimport import zipimporter + +from jedi.file_io import KnownContentFileIO, ZipFileIO + +is_py3 = sys.version_info[0] >= 3 +is_py35 = is_py3 and sys.version_info[1] >= 5 +py_version = int(str(sys.version_info[0]) + str(sys.version_info[1])) + + +class DummyFile(object): + def __init__(self, loader, string): + self.loader = loader + self.string = string + + def read(self): + return self.loader.get_source(self.string) + + def close(self): + del self.loader + + +def find_module_py34(string, path=None, full_name=None, is_global_search=True): + spec = None + loader = None + + for finder in sys.meta_path: + if is_global_search and finder != importlib.machinery.PathFinder: + p = None + else: + p = path + try: + find_spec = finder.find_spec + except AttributeError: + # These are old-school clases that still have a different API, just + # ignore those. + continue + + spec = find_spec(string, p) + if spec is not None: + loader = spec.loader + if loader is None and not spec.has_location: + # This is a namespace package. + full_name = string if not path else full_name + implicit_ns_info = ImplicitNSInfo(full_name, spec.submodule_search_locations._path) + return implicit_ns_info, True + break + + return find_module_py33(string, path, loader) + + +def find_module_py33(string, path=None, loader=None, full_name=None, is_global_search=True): + loader = loader or importlib.machinery.PathFinder.find_module(string, path) + + if loader is None and path is None: # Fallback to find builtins + try: + with warnings.catch_warnings(record=True): + # Mute "DeprecationWarning: Use importlib.util.find_spec() + # instead." While we should replace that in the future, it's + # probably good to wait until we deprecate Python 3.3, since + # it was added in Python 3.4 and find_loader hasn't been + # removed in 3.6. + loader = importlib.find_loader(string) + except ValueError as e: + # See #491. Importlib might raise a ValueError, to avoid this, we + # just raise an ImportError to fix the issue. + raise ImportError("Originally " + repr(e)) + + if loader is None: + raise ImportError("Couldn't find a loader for {}".format(string)) + + return _from_loader(loader, string) + + +def _from_loader(loader, string): + is_package = loader.is_package(string) + try: + get_filename = loader.get_filename + except AttributeError: + return None, is_package + else: + module_path = cast_path(get_filename(string)) + + # To avoid unicode and read bytes, "overwrite" loader.get_source if + # possible. + f = type(loader).get_source + if is_py3 and f is not importlib.machinery.SourceFileLoader.get_source: + # Unfortunately we are reading unicode here, not bytes. + # It seems hard to get bytes, because the zip importer + # logic just unpacks the zip file and returns a file descriptor + # that we cannot as easily access. Therefore we just read it as + # a string in the cases where get_source was overwritten. + code = loader.get_source(string) + else: + code = _get_source(loader, string) + + if code is None: + return None, is_package + if isinstance(loader, zipimporter): + return ZipFileIO(module_path, code, cast_path(loader.archive)), is_package + + return KnownContentFileIO(module_path, code), is_package + + +def _get_source(loader, fullname): + """ + This method is here as a replacement for SourceLoader.get_source. That + method returns unicode, but we prefer bytes. + """ + path = loader.get_filename(fullname) + try: + return loader.get_data(path) + except OSError: + raise ImportError('source not available through get_data()', + name=fullname) + + +def find_module_pre_py3(string, path=None, full_name=None, is_global_search=True): + # This import is here, because in other places it will raise a + # DeprecationWarning. + import imp + try: + module_file, module_path, description = imp.find_module(string, path) + module_type = description[2] + is_package = module_type is imp.PKG_DIRECTORY + if is_package: + # In Python 2 directory package imports are returned as folder + # paths, not __init__.py paths. + p = os.path.join(module_path, '__init__.py') + try: + module_file = open(p) + module_path = p + except FileNotFoundError: + pass + elif module_type != imp.PY_SOURCE: + if module_file is not None: + module_file.close() + module_file = None + + if module_file is None: + code = None + return None, is_package + + with module_file: + code = module_file.read() + return KnownContentFileIO(cast_path(module_path), code), is_package + except ImportError: + pass + + if path is None: + path = sys.path + for item in path: + loader = pkgutil.get_importer(item) + if loader: + loader = loader.find_module(string) + if loader is not None: + return _from_loader(loader, string) + raise ImportError("No module named {}".format(string)) + + +find_module = find_module_py34 if is_py3 else find_module_pre_py3 +find_module.__doc__ = """ +Provides information about a module. + +This function isolates the differences in importing libraries introduced with +python 3.3 on; it gets a module name and optionally a path. It will return a +tuple containin an open file for the module (if not builtin), the filename +or the name of the module if it is a builtin one and a boolean indicating +if the module is contained in a package. +""" + + +def _iter_modules(paths, prefix=''): + # Copy of pkgutil.iter_modules adapted to work with namespaces + + for path in paths: + importer = pkgutil.get_importer(path) + + if not isinstance(importer, importlib.machinery.FileFinder): + # We're only modifying the case for FileFinder. All the other cases + # still need to be checked (like zip-importing). Do this by just + # calling the pkgutil version. + for mod_info in pkgutil.iter_modules([path], prefix): + yield mod_info + continue + + # START COPY OF pkutils._iter_file_finder_modules. + if importer.path is None or not os.path.isdir(importer.path): + return + + yielded = {} + + try: + filenames = os.listdir(importer.path) + except OSError: + # ignore unreadable directories like import does + filenames = [] + filenames.sort() # handle packages before same-named modules + + for fn in filenames: + modname = inspect.getmodulename(fn) + if modname == '__init__' or modname in yielded: + continue + + # jedi addition: Avoid traversing special directories + if fn.startswith('.') or fn == '__pycache__': + continue + + path = os.path.join(importer.path, fn) + ispkg = False + + if not modname and os.path.isdir(path) and '.' not in fn: + modname = fn + # A few jedi modifications: Don't check if there's an + # __init__.py + try: + os.listdir(path) + except OSError: + # ignore unreadable directories like import does + continue + ispkg = True + + if modname and '.' not in modname: + yielded[modname] = 1 + yield importer, prefix + modname, ispkg + # END COPY + + +iter_modules = _iter_modules if py_version >= 34 else pkgutil.iter_modules + + +class ImplicitNSInfo(object): + """Stores information returned from an implicit namespace spec""" + def __init__(self, name, paths): + self.name = name + self.paths = paths + + +if is_py3: + all_suffixes = importlib.machinery.all_suffixes +else: + def all_suffixes(): + # Is deprecated and raises a warning in Python 3.6. + import imp + return [suffix for suffix, _, _ in imp.get_suffixes()] + + +# unicode function +try: + unicode = unicode +except NameError: + unicode = str + + +# re-raise function +if is_py3: + def reraise(exception, traceback): + raise exception.with_traceback(traceback) +else: + eval(compile(""" +def reraise(exception, traceback): + raise exception, None, traceback +""", 'blub', 'exec')) + +reraise.__doc__ = """ +Re-raise `exception` with a `traceback` object. + +Usage:: + + reraise(Exception, sys.exc_info()[2]) + +""" + + +def use_metaclass(meta, *bases): + """ Create a class with a metaclass. """ + if not bases: + bases = (object,) + return meta("Py2CompatibilityMetaClass", bases, {}) + + +try: + encoding = sys.stdout.encoding + if encoding is None: + encoding = 'utf-8' +except AttributeError: + encoding = 'ascii' + + +def u(string, errors='strict'): + """Cast to unicode DAMMIT! + Written because Python2 repr always implicitly casts to a string, so we + have to cast back to a unicode (and we now that we always deal with valid + unicode, because we check that in the beginning). + """ + if isinstance(string, bytes): + return unicode(string, encoding='UTF-8', errors=errors) + return string + + +def cast_path(obj): + """ + Take a bytes or str path and cast it to unicode. + + Apparently it is perfectly fine to pass both byte and unicode objects into + the sys.path. This probably means that byte paths are normal at other + places as well. + + Since this just really complicates everything and Python 2.7 will be EOL + soon anyway, just go with always strings. + """ + return u(obj, errors='replace') + + +def force_unicode(obj): + # Intentionally don't mix those two up, because those two code paths might + # be different in the future (maybe windows?). + return cast_path(obj) + + +try: + import builtins # module name in python 3 +except ImportError: + import __builtin__ as builtins # noqa: F401 + + +import ast # noqa: F401 + + +def literal_eval(string): + return ast.literal_eval(string) + + +try: + from itertools import zip_longest +except ImportError: + from itertools import izip_longest as zip_longest # Python 2 # noqa: F401 + +try: + FileNotFoundError = FileNotFoundError +except NameError: + FileNotFoundError = IOError + +try: + IsADirectoryError = IsADirectoryError +except NameError: + IsADirectoryError = IOError + +try: + PermissionError = PermissionError +except NameError: + PermissionError = IOError + + +def no_unicode_pprint(dct): + """ + Python 2/3 dict __repr__ may be different, because of unicode differens + (with or without a `u` prefix). Normally in doctests we could use `pprint` + to sort dicts and check for equality, but here we have to write a separate + function to do that. + """ + import pprint + s = pprint.pformat(dct) + print(re.sub("u'", "'", s)) + + +def utf8_repr(func): + """ + ``__repr__`` methods in Python 2 don't allow unicode objects to be + returned. Therefore cast them to utf-8 bytes in this decorator. + """ + def wrapper(self): + result = func(self) + if isinstance(result, unicode): + return result.encode('utf-8') + else: + return result + + if is_py3: + return func + else: + return wrapper + + +if is_py3: + import queue +else: + import Queue as queue # noqa: F401 + +try: + # Attempt to load the C implementation of pickle on Python 2 as it is way + # faster. + import cPickle as pickle +except ImportError: + import pickle +if sys.version_info[:2] == (3, 3): + """ + Monkeypatch the unpickler in Python 3.3. This is needed, because the + argument `encoding='bytes'` is not supported in 3.3, but badly needed to + communicate with Python 2. + """ + + class NewUnpickler(pickle._Unpickler): + dispatch = dict(pickle._Unpickler.dispatch) + + def _decode_string(self, value): + # Used to allow strings from Python 2 to be decoded either as + # bytes or Unicode strings. This should be used only with the + # STRING, BINSTRING and SHORT_BINSTRING opcodes. + if self.encoding == "bytes": + return value + else: + return value.decode(self.encoding, self.errors) + + def load_string(self): + data = self.readline()[:-1] + # Strip outermost quotes + if len(data) >= 2 and data[0] == data[-1] and data[0] in b'"\'': + data = data[1:-1] + else: + raise pickle.UnpicklingError("the STRING opcode argument must be quoted") + self.append(self._decode_string(pickle.codecs.escape_decode(data)[0])) + dispatch[pickle.STRING[0]] = load_string + + def load_binstring(self): + # Deprecated BINSTRING uses signed 32-bit length + len, = pickle.struct.unpack('' % ( + self.__class__.__name__, + repr(self._orig_path), + self._evaluator.environment, + ) + + def completions(self): + """ + Return :class:`classes.Completion` objects. Those objects contain + information about the completions, more than just names. + + :return: Completion objects, sorted by name and __ comes last. + :rtype: list of :class:`classes.Completion` + """ + with debug.increase_indent_cm('completions'): + completion = Completion( + self._evaluator, self._get_module(), self._code_lines, + self._pos, self.call_signatures + ) + return completion.completions() + + def goto_definitions(self, **kwargs): + """ + Return the definitions of a the path under the cursor. goto function! + This follows complicated paths and returns the end, not the first + definition. The big difference between :meth:`goto_assignments` and + :meth:`goto_definitions` is that :meth:`goto_assignments` doesn't + follow imports and statements. Multiple objects may be returned, + because Python itself is a dynamic language, which means depending on + an option you can have two different versions of a function. + + :param only_stubs: Only return stubs for this goto call. + :param prefer_stubs: Prefer stubs to Python objects for this type + inference call. + :rtype: list of :class:`classes.Definition` + """ + with debug.increase_indent_cm('goto_definitions'): + return self._goto_definitions(**kwargs) + + def _goto_definitions(self, only_stubs=False, prefer_stubs=False): + leaf = self._module_node.get_name_of_position(self._pos) + if leaf is None: + leaf = self._module_node.get_leaf_for_position(self._pos) + if leaf is None: + return [] + + context = self._evaluator.create_context(self._get_module(), leaf) + + contexts = helpers.evaluate_goto_definition(self._evaluator, context, leaf) + contexts = convert_contexts( + contexts, + only_stubs=only_stubs, + prefer_stubs=prefer_stubs, + ) + + defs = [classes.Definition(self._evaluator, c.name) for c in contexts] + # The additional set here allows the definitions to become unique in an + # API sense. In the internals we want to separate more things than in + # the API. + return helpers.sorted_definitions(set(defs)) + + def goto_assignments(self, follow_imports=False, follow_builtin_imports=False, **kwargs): + """ + Return the first definition found, while optionally following imports. + Multiple objects may be returned, because Python itself is a + dynamic language, which means depending on an option you can have two + different versions of a function. + + .. note:: It is deprecated to use follow_imports and follow_builtin_imports as + positional arguments. Will be a keyword argument in 0.16.0. + + :param follow_imports: The goto call will follow imports. + :param follow_builtin_imports: If follow_imports is True will decide if + it follow builtin imports. + :param only_stubs: Only return stubs for this goto call. + :param prefer_stubs: Prefer stubs to Python objects for this goto call. + :rtype: list of :class:`classes.Definition` + """ + with debug.increase_indent_cm('goto_assignments'): + return self._goto_assignments(follow_imports, follow_builtin_imports, **kwargs) + + def _goto_assignments(self, follow_imports, follow_builtin_imports, + only_stubs=False, prefer_stubs=False): + def filter_follow_imports(names, check): + for name in names: + if check(name): + new_names = list(filter_follow_imports(name.goto(), check)) + found_builtin = False + if follow_builtin_imports: + for new_name in new_names: + if new_name.start_pos is None: + found_builtin = True + + if found_builtin: + yield name + else: + for new_name in new_names: + yield new_name + else: + yield name + + tree_name = self._module_node.get_name_of_position(self._pos) + if tree_name is None: + # Without a name we really just want to jump to the result e.g. + # executed by `foo()`, if we the cursor is after `)`. + return self.goto_definitions(only_stubs=only_stubs, prefer_stubs=prefer_stubs) + context = self._evaluator.create_context(self._get_module(), tree_name) + names = list(self._evaluator.goto(context, tree_name)) + + if follow_imports: + names = filter_follow_imports(names, lambda name: name.is_import()) + names = convert_names( + names, + only_stubs=only_stubs, + prefer_stubs=prefer_stubs, + ) + + defs = [classes.Definition(self._evaluator, d) for d in set(names)] + return helpers.sorted_definitions(defs) + + def usages(self, additional_module_paths=(), **kwargs): + """ + Return :class:`classes.Definition` objects, which contain all + names that point to the definition of the name under the cursor. This + is very useful for refactoring (renaming), or to show all usages of a + variable. + + .. todo:: Implement additional_module_paths + + :param additional_module_paths: Deprecated, never ever worked. + :param include_builtins: Default True, checks if a usage is a builtin + (e.g. ``sys``) and in that case does not return it. + :rtype: list of :class:`classes.Definition` + """ + if additional_module_paths: + warnings.warn( + "Deprecated since version 0.12.0. This never even worked, just ignore it.", + DeprecationWarning, + stacklevel=2 + ) + + def _usages(include_builtins=True): + tree_name = self._module_node.get_name_of_position(self._pos) + if tree_name is None: + # Must be syntax + return [] + + names = usages.usages(self._get_module(), tree_name) + + definitions = [classes.Definition(self._evaluator, n) for n in names] + if not include_builtins: + definitions = [d for d in definitions if not d.in_builtin_module()] + return helpers.sorted_definitions(definitions) + return _usages(**kwargs) + + def call_signatures(self): + """ + Return the function object of the call you're currently in. + + E.g. if the cursor is here:: + + abs(# <-- cursor is here + + This would return the ``abs`` function. On the other hand:: + + abs()# <-- cursor is here + + This would return an empty list.. + + :rtype: list of :class:`classes.CallSignature` + """ + call_details = helpers.get_call_signature_details(self._module_node, self._pos) + if call_details is None: + return [] + + context = self._evaluator.create_context( + self._get_module(), + call_details.bracket_leaf + ) + definitions = helpers.cache_call_signatures( + self._evaluator, + context, + call_details.bracket_leaf, + self._code_lines, + self._pos + ) + debug.speed('func_call followed') + + # TODO here we use stubs instead of the actual contexts. We should use + # the signatures from stubs, but the actual contexts, probably?! + return [classes.CallSignature(self._evaluator, signature, call_details) + for signature in definitions.get_signatures()] + + def _analysis(self): + self._evaluator.is_analysis = True + self._evaluator.analysis_modules = [self._module_node] + module = self._get_module() + try: + for node in get_executable_nodes(self._module_node): + context = module.create_context(node) + if node.type in ('funcdef', 'classdef'): + # Resolve the decorators. + tree_name_to_contexts(self._evaluator, context, node.children[1]) + elif isinstance(node, tree.Import): + import_names = set(node.get_defined_names()) + if node.is_nested(): + import_names |= set(path[-1] for path in node.get_paths()) + for n in import_names: + imports.infer_import(context, n) + elif node.type == 'expr_stmt': + types = context.eval_node(node) + for testlist in node.children[:-1:2]: + # Iterate tuples. + unpack_tuple_to_dict(context, types, testlist) + else: + if node.type == 'name': + defs = self._evaluator.goto_definitions(context, node) + else: + defs = evaluate_call_of_leaf(context, node) + try_iter_content(defs) + self._evaluator.reset_recursion_limitations() + + ana = [a for a in self._evaluator.analysis if self.path == a.path] + return sorted(set(ana), key=lambda x: x.line) + finally: + self._evaluator.is_analysis = False + + +class Interpreter(Script): + """ + Jedi API for Python REPLs. + + In addition to completion of simple attribute access, Jedi + supports code completion based on static code analysis. + Jedi can complete attributes of object which is not initialized + yet. + + >>> from os.path import join + >>> namespace = locals() + >>> script = Interpreter('join("").up', [namespace]) + >>> print(script.completions()[0].name) + upper + """ + _allow_descriptor_getattr_default = True + + def __init__(self, source, namespaces, **kwds): + """ + Parse `source` and mixin interpreted Python objects from `namespaces`. + + :type source: str + :arg source: Code to parse. + :type namespaces: list of dict + :arg namespaces: a list of namespace dictionaries such as the one + returned by :func:`locals`. + + Other optional arguments are same as the ones for :class:`Script`. + If `line` and `column` are None, they are assumed be at the end of + `source`. + """ + try: + namespaces = [dict(n) for n in namespaces] + except Exception: + raise TypeError("namespaces must be a non-empty list of dicts.") + + environment = kwds.get('environment', None) + if environment is None: + environment = InterpreterEnvironment() + else: + if not isinstance(environment, InterpreterEnvironment): + raise TypeError("The environment needs to be an InterpreterEnvironment subclass.") + + super(Interpreter, self).__init__(source, environment=environment, + _project=Project(os.getcwd()), **kwds) + self.namespaces = namespaces + self._evaluator.allow_descriptor_getattr = self._allow_descriptor_getattr_default + + def _get_module(self): + return interpreter.MixedModuleContext( + self._evaluator, + self._module_node, + self.namespaces, + file_io=KnownContentFileIO(self.path, self._code), + code_lines=self._code_lines, + ) + + +def names(source=None, path=None, encoding='utf-8', all_scopes=False, + definitions=True, references=False, environment=None): + """ + Returns a list of `Definition` objects, containing name parts. + This means you can call ``Definition.goto_assignments()`` and get the + reference of a name. + The parameters are the same as in :py:class:`Script`, except or the + following ones: + + :param all_scopes: If True lists the names of all scopes instead of only + the module namespace. + :param definitions: If True lists the names that have been defined by a + class, function or a statement (``a = b`` returns ``a``). + :param references: If True lists all the names that are not listed by + ``definitions=True``. E.g. ``a = b`` returns ``b``. + """ + def def_ref_filter(_def): + is_def = _def._name.tree_name.is_definition() + return definitions and is_def or references and not is_def + + def create_name(name): + if name.parent.type == 'param': + cls = ParamName + else: + cls = TreeNameDefinition + return cls( + module_context.create_context(name), + name + ) + + # Set line/column to a random position, because they don't matter. + script = Script(source, line=1, column=0, path=path, encoding=encoding, environment=environment) + module_context = script._get_module() + defs = [ + classes.Definition( + script._evaluator, + create_name(name) + ) for name in get_module_names(script._module_node, all_scopes) + ] + return sorted(filter(def_ref_filter, defs), key=lambda x: (x.line, x.column)) + + +def preload_module(*modules): + """ + Preloading modules tells Jedi to load a module now, instead of lazy parsing + of modules. Usful for IDEs, to control which modules to load on startup. + + :param modules: different module names, list of string. + """ + for m in modules: + s = "import %s as x; x." % m + Script(s, 1, len(s), None).completions() + + +def set_debug_function(func_cb=debug.print_to_stdout, warnings=True, + notices=True, speed=True): + """ + Define a callback debug function to get all the debug messages. + + If you don't specify any arguments, debug messages will be printed to stdout. + + :param func_cb: The callback function for debug messages, with n params. + """ + debug.debug_function = func_cb + debug.enable_warning = warnings + debug.enable_notice = notices + debug.enable_speed = speed diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/api/classes.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/api/classes.py new file mode 100644 index 0000000..c393ca6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/api/classes.py @@ -0,0 +1,768 @@ +""" +The :mod:`jedi.api.classes` module contains the return classes of the API. +These classes are the much bigger part of the whole API, because they contain +the interesting information about completion and goto operations. +""" +import re +import sys +import warnings + +from jedi import settings +from jedi import debug +from jedi.evaluate.utils import unite +from jedi.cache import memoize_method +from jedi.evaluate import imports +from jedi.evaluate import compiled +from jedi.evaluate.imports import ImportName +from jedi.evaluate.context import FunctionExecutionContext +from jedi.evaluate.gradual.typeshed import StubModuleContext +from jedi.evaluate.gradual.conversion import convert_names, convert_contexts +from jedi.evaluate.base_context import ContextSet +from jedi.api.keywords import KeywordName + + +def _sort_names_by_start_pos(names): + return sorted(names, key=lambda s: s.start_pos or (0, 0)) + + +def defined_names(evaluator, context): + """ + List sub-definitions (e.g., methods in class). + + :type scope: Scope + :rtype: list of Definition + """ + filter = next(context.get_filters(search_global=True)) + names = [name for name in filter.values()] + return [Definition(evaluator, n) for n in _sort_names_by_start_pos(names)] + + +def _contexts_to_definitions(contexts): + return [Definition(c.evaluator, c.name) for c in contexts] + + +class BaseDefinition(object): + _mapping = { + 'posixpath': 'os.path', + 'riscospath': 'os.path', + 'ntpath': 'os.path', + 'os2emxpath': 'os.path', + 'macpath': 'os.path', + 'genericpath': 'os.path', + 'posix': 'os', + '_io': 'io', + '_functools': 'functools', + '_collections': 'collections', + '_socket': 'socket', + '_sqlite3': 'sqlite3', + '__builtin__': 'builtins', + } + + _tuple_mapping = dict((tuple(k.split('.')), v) for (k, v) in { + 'argparse._ActionsContainer': 'argparse.ArgumentParser', + }.items()) + + def __init__(self, evaluator, name): + self._evaluator = evaluator + self._name = name + """ + An instance of :class:`parso.python.tree.Name` subclass. + """ + self.is_keyword = isinstance(self._name, KeywordName) + + @memoize_method + def _get_module(self): + # This can take a while to complete, because in the worst case of + # imports (consider `import a` completions), we need to load all + # modules starting with a first. + return self._name.get_root_context() + + @property + def module_path(self): + """Shows the file path of a module. e.g. ``/usr/lib/python2.7/os.py``""" + module = self._get_module() + if module.is_stub() or not module.is_compiled(): + # Compiled modules should not return a module path even if they + # have one. + return self._get_module().py__file__() + + return None + + @property + def name(self): + """ + Name of variable/function/class/module. + + For example, for ``x = None`` it returns ``'x'``. + + :rtype: str or None + """ + return self._name.string_name + + @property + def type(self): + """ + The type of the definition. + + Here is an example of the value of this attribute. Let's consider + the following source. As what is in ``variable`` is unambiguous + to Jedi, :meth:`jedi.Script.goto_definitions` should return a list of + definition for ``sys``, ``f``, ``C`` and ``x``. + + >>> from jedi._compatibility import no_unicode_pprint + >>> from jedi import Script + >>> source = ''' + ... import keyword + ... + ... class C: + ... pass + ... + ... class D: + ... pass + ... + ... x = D() + ... + ... def f(): + ... pass + ... + ... for variable in [keyword, f, C, x]: + ... variable''' + + >>> script = Script(source) + >>> defs = script.goto_definitions() + + Before showing what is in ``defs``, let's sort it by :attr:`line` + so that it is easy to relate the result to the source code. + + >>> defs = sorted(defs, key=lambda d: d.line) + >>> no_unicode_pprint(defs) # doctest: +NORMALIZE_WHITESPACE + [, + , + , + ] + + Finally, here is what you can get from :attr:`type`: + + >>> defs = [str(d.type) for d in defs] # It's unicode and in Py2 has u before it. + >>> defs[0] + 'module' + >>> defs[1] + 'class' + >>> defs[2] + 'instance' + >>> defs[3] + 'function' + + Valid values for are ``module``, ``class``, ``instance``, ``function``, + ``param``, ``path`` and ``keyword``. + + """ + tree_name = self._name.tree_name + resolve = False + if tree_name is not None: + # TODO move this to their respective names. + definition = tree_name.get_definition() + if definition is not None and definition.type == 'import_from' and \ + tree_name.is_definition(): + resolve = True + + if isinstance(self._name, imports.SubModuleName) or resolve: + for context in self._name.infer(): + return context.api_type + return self._name.api_type + + @property + def module_name(self): + """ + The module name. + + >>> from jedi import Script + >>> source = 'import json' + >>> script = Script(source, path='example.py') + >>> d = script.goto_definitions()[0] + >>> print(d.module_name) # doctest: +ELLIPSIS + json + """ + return self._get_module().name.string_name + + def in_builtin_module(self): + """Whether this is a builtin module.""" + if isinstance(self._get_module(), StubModuleContext): + return any(isinstance(context, compiled.CompiledObject) + for context in self._get_module().non_stub_context_set) + return isinstance(self._get_module(), compiled.CompiledObject) + + @property + def line(self): + """The line where the definition occurs (starting with 1).""" + start_pos = self._name.start_pos + if start_pos is None: + return None + return start_pos[0] + + @property + def column(self): + """The column where the definition occurs (starting with 0).""" + start_pos = self._name.start_pos + if start_pos is None: + return None + return start_pos[1] + + def docstring(self, raw=False, fast=True): + r""" + Return a document string for this completion object. + + Example: + + >>> from jedi import Script + >>> source = '''\ + ... def f(a, b=1): + ... "Document for function f." + ... ''' + >>> script = Script(source, 1, len('def f'), 'example.py') + >>> doc = script.goto_definitions()[0].docstring() + >>> print(doc) + f(a, b=1) + + Document for function f. + + Notice that useful extra information is added to the actual + docstring. For function, it is call signature. If you need + actual docstring, use ``raw=True`` instead. + + >>> print(script.goto_definitions()[0].docstring(raw=True)) + Document for function f. + + :param fast: Don't follow imports that are only one level deep like + ``import foo``, but follow ``from foo import bar``. This makes + sense for speed reasons. Completing `import a` is slow if you use + the ``foo.docstring(fast=False)`` on every object, because it + parses all libraries starting with ``a``. + """ + return _Help(self._name).docstring(fast=fast, raw=raw) + + @property + def description(self): + """A textual description of the object.""" + return self._name.string_name + + @property + def full_name(self): + """ + Dot-separated path of this object. + + It is in the form of ``[.[...]][.]``. + It is useful when you want to look up Python manual of the + object at hand. + + Example: + + >>> from jedi import Script + >>> source = ''' + ... import os + ... os.path.join''' + >>> script = Script(source, 3, len('os.path.join'), 'example.py') + >>> print(script.goto_definitions()[0].full_name) + os.path.join + + Notice that it returns ``'os.path.join'`` instead of (for example) + ``'posixpath.join'``. This is not correct, since the modules name would + be `````. However most users find the latter + more practical. + """ + if not self._name.is_context_name: + return None + + names = self._name.get_qualified_names(include_module_names=True) + if names is None: + return names + + names = list(names) + try: + names[0] = self._mapping[names[0]] + except KeyError: + pass + + return '.'.join(names) + + def is_stub(self): + if not self._name.is_context_name: + return False + + return self._name.get_root_context().is_stub() + + def goto_assignments(self, **kwargs): # Python 2... + with debug.increase_indent_cm('goto for %s' % self._name): + return self._goto_assignments(**kwargs) + + def _goto_assignments(self, only_stubs=False, prefer_stubs=False): + assert not (only_stubs and prefer_stubs) + + if not self._name.is_context_name: + return [] + + names = convert_names( + self._name.goto(), + only_stubs=only_stubs, + prefer_stubs=prefer_stubs, + ) + return [self if n == self._name else Definition(self._evaluator, n) + for n in names] + + def infer(self, **kwargs): # Python 2... + with debug.increase_indent_cm('infer for %s' % self._name): + return self._infer(**kwargs) + + def _infer(self, only_stubs=False, prefer_stubs=False): + assert not (only_stubs and prefer_stubs) + + if not self._name.is_context_name: + return [] + + # First we need to make sure that we have stub names (if possible) that + # we can follow. If we don't do that, we can end up with the inferred + # results of Python objects instead of stubs. + names = convert_names([self._name], prefer_stubs=True) + contexts = convert_contexts( + ContextSet.from_sets(n.infer() for n in names), + only_stubs=only_stubs, + prefer_stubs=prefer_stubs, + ) + resulting_names = [c.name for c in contexts] + return [self if n == self._name else Definition(self._evaluator, n) + for n in resulting_names] + + @property + @memoize_method + def params(self): + """ + Deprecated! Will raise a warning soon. Use get_signatures()[...].params. + + Raises an ``AttributeError`` if the definition is not callable. + Otherwise returns a list of `Definition` that represents the params. + """ + # Only return the first one. There might be multiple one, especially + # with overloading. + for context in self._name.infer(): + for signature in context.get_signatures(): + return [ + Definition(self._evaluator, n) + for n in signature.get_param_names(resolve_stars=True) + ] + + if self.type == 'function' or self.type == 'class': + # Fallback, if no signatures were defined (which is probably by + # itself a bug). + return [] + raise AttributeError('There are no params defined on this.') + + def parent(self): + if not self._name.is_context_name: + return None + + context = self._name.parent_context + if context is None: + return None + + if isinstance(context, FunctionExecutionContext): + context = context.function_context + return Definition(self._evaluator, context.name) + + def __repr__(self): + return "<%s %sname=%r, description=%r>" % ( + self.__class__.__name__, + 'full_' if self.full_name else '', + self.full_name or self.name, + self.description, + ) + + def get_line_code(self, before=0, after=0): + """ + Returns the line of code where this object was defined. + + :param before: Add n lines before the current line to the output. + :param after: Add n lines after the current line to the output. + + :return str: Returns the line(s) of code or an empty string if it's a + builtin. + """ + if not self._name.is_context_name or self.in_builtin_module(): + return '' + + lines = self._name.get_root_context().code_lines + + index = self._name.start_pos[0] - 1 + start_index = max(index - before, 0) + return ''.join(lines[start_index:index + after + 1]) + + def get_signatures(self): + return [Signature(self._evaluator, s) for s in self._name.infer().get_signatures()] + + def execute(self): + return _contexts_to_definitions(self._name.infer().execute_evaluated()) + + +class Completion(BaseDefinition): + """ + `Completion` objects are returned from :meth:`api.Script.completions`. They + provide additional information about a completion. + """ + def __init__(self, evaluator, name, stack, like_name_length): + super(Completion, self).__init__(evaluator, name) + + self._like_name_length = like_name_length + self._stack = stack + + # Completion objects with the same Completion name (which means + # duplicate items in the completion) + self._same_name_completions = [] + + def _complete(self, like_name): + append = '' + if settings.add_bracket_after_function \ + and self.type == 'function': + append = '(' + + if self._name.api_type == 'param' and self._stack is not None: + nonterminals = [stack_node.nonterminal for stack_node in self._stack] + if 'trailer' in nonterminals and 'argument' not in nonterminals: + # TODO this doesn't work for nested calls. + append += '=' + + name = self._name.string_name + if like_name: + name = name[self._like_name_length:] + return name + append + + @property + def complete(self): + """ + Return the rest of the word, e.g. completing ``isinstance``:: + + isinstan# <-- Cursor is here + + would return the string 'ce'. It also adds additional stuff, depending + on your `settings.py`. + + Assuming the following function definition:: + + def foo(param=0): + pass + + completing ``foo(par`` would give a ``Completion`` which `complete` + would be `am=` + + + """ + return self._complete(True) + + @property + def name_with_symbols(self): + """ + Similar to :attr:`name`, but like :attr:`name` returns also the + symbols, for example assuming the following function definition:: + + def foo(param=0): + pass + + completing ``foo(`` would give a ``Completion`` which + ``name_with_symbols`` would be "param=". + + """ + return self._complete(False) + + def docstring(self, raw=False, fast=True): + if self._like_name_length >= 3: + # In this case we can just resolve the like name, because we + # wouldn't load like > 100 Python modules anymore. + fast = False + return super(Completion, self).docstring(raw=raw, fast=fast) + + @property + def description(self): + """Provide a description of the completion object.""" + # TODO improve the class structure. + return Definition.description.__get__(self) + + def __repr__(self): + return '<%s: %s>' % (type(self).__name__, self._name.string_name) + + @memoize_method + def follow_definition(self): + """ + Deprecated! + + Return the original definitions. I strongly recommend not using it for + your completions, because it might slow down |jedi|. If you want to + read only a few objects (<=20), it might be useful, especially to get + the original docstrings. The basic problem of this function is that it + follows all results. This means with 1000 completions (e.g. numpy), + it's just PITA-slow. + """ + warnings.warn( + "Deprecated since version 0.14.0. Use .infer.", + DeprecationWarning, + stacklevel=2 + ) + return self.infer() + + +class Definition(BaseDefinition): + """ + *Definition* objects are returned from :meth:`api.Script.goto_assignments` + or :meth:`api.Script.goto_definitions`. + """ + def __init__(self, evaluator, definition): + super(Definition, self).__init__(evaluator, definition) + + @property + def description(self): + """ + A description of the :class:`.Definition` object, which is heavily used + in testing. e.g. for ``isinstance`` it returns ``def isinstance``. + + Example: + + >>> from jedi._compatibility import no_unicode_pprint + >>> from jedi import Script + >>> source = ''' + ... def f(): + ... pass + ... + ... class C: + ... pass + ... + ... variable = f if random.choice([0,1]) else C''' + >>> script = Script(source, column=3) # line is maximum by default + >>> defs = script.goto_definitions() + >>> defs = sorted(defs, key=lambda d: d.line) + >>> no_unicode_pprint(defs) # doctest: +NORMALIZE_WHITESPACE + [, + ] + >>> str(defs[0].description) # strip literals in python2 + 'def f' + >>> str(defs[1].description) + 'class C' + + """ + typ = self.type + tree_name = self._name.tree_name + if typ == 'param': + return typ + ' ' + self._name.to_string() + if typ in ('function', 'class', 'module', 'instance') or tree_name is None: + if typ == 'function': + # For the description we want a short and a pythonic way. + typ = 'def' + return typ + ' ' + self._name.string_name + + definition = tree_name.get_definition() or tree_name + # Remove the prefix, because that's not what we want for get_code + # here. + txt = definition.get_code(include_prefix=False) + # Delete comments: + txt = re.sub(r'#[^\n]+\n', ' ', txt) + # Delete multi spaces/newlines + txt = re.sub(r'\s+', ' ', txt).strip() + return txt + + @property + def desc_with_module(self): + """ + In addition to the definition, also return the module. + + .. warning:: Don't use this function yet, its behaviour may change. If + you really need it, talk to me. + + .. todo:: Add full path. This function is should return a + `module.class.function` path. + """ + position = '' if self.in_builtin_module else '@%s' % self.line + return "%s:%s%s" % (self.module_name, self.description, position) + + @memoize_method + def defined_names(self): + """ + List sub-definitions (e.g., methods in class). + + :rtype: list of Definition + """ + defs = self._name.infer() + return sorted( + unite(defined_names(self._evaluator, d) for d in defs), + key=lambda s: s._name.start_pos or (0, 0) + ) + + def is_definition(self): + """ + Returns True, if defined as a name in a statement, function or class. + Returns False, if it's a reference to such a definition. + """ + if self._name.tree_name is None: + return True + else: + return self._name.tree_name.is_definition() + + def __eq__(self, other): + return self._name.start_pos == other._name.start_pos \ + and self.module_path == other.module_path \ + and self.name == other.name \ + and self._evaluator == other._evaluator + + def __ne__(self, other): + return not self.__eq__(other) + + def __hash__(self): + return hash((self._name.start_pos, self.module_path, self.name, self._evaluator)) + + +class Signature(Definition): + """ + `Signature` objects is the return value of `Script.function_definition`. + It knows what functions you are currently in. e.g. `isinstance(` would + return the `isinstance` function. without `(` it would return nothing. + """ + def __init__(self, evaluator, signature): + super(Signature, self).__init__(evaluator, signature.name) + self._signature = signature + + @property + def params(self): + """ + :return list of ParamDefinition: + """ + return [ParamDefinition(self._evaluator, n) + for n in self._signature.get_param_names(resolve_stars=True)] + + def to_string(self): + return self._signature.to_string() + + +class CallSignature(Signature): + """ + `CallSignature` objects is the return value of `Script.call_signatures`. + It knows what functions you are currently in. e.g. `isinstance(` would + return the `isinstance` function with its params. Without `(` it would + return nothing. + """ + def __init__(self, evaluator, signature, call_details): + super(CallSignature, self).__init__(evaluator, signature) + self._call_details = call_details + self._signature = signature + + @property + def index(self): + """ + The Param index of the current call. + Returns None if the index cannot be found in the curent call. + """ + return self._call_details.calculate_index( + self._signature.get_param_names(resolve_stars=True) + ) + + @property + def bracket_start(self): + """ + The line/column of the bracket that is responsible for the last + function call. + """ + return self._call_details.bracket_leaf.start_pos + + def __repr__(self): + return '<%s: index=%r %s>' % ( + type(self).__name__, + self.index, + self._signature.to_string(), + ) + + +class ParamDefinition(Definition): + def infer_default(self): + """ + :return list of Definition: + """ + return _contexts_to_definitions(self._name.infer_default()) + + def infer_annotation(self, **kwargs): + """ + :return list of Definition: + + :param execute_annotation: If False, the values are not executed and + you get classes instead of instances. + """ + return _contexts_to_definitions(self._name.infer_annotation(**kwargs)) + + def to_string(self): + return self._name.to_string() + + @property + def kind(self): + """ + Returns an enum instance. Returns the same values as the builtin + :py:attr:`inspect.Parameter.kind`. + + No support for Python < 3.4 anymore. + """ + if sys.version_info < (3, 5): + raise NotImplementedError( + 'Python 2 is end-of-life, the new feature is not available for it' + ) + return self._name.get_kind() + + +def _format_signatures(context): + return '\n'.join( + signature.to_string() + for signature in context.get_signatures() + ) + + +class _Help(object): + """ + Temporary implementation, will be used as `Script.help() or something in + the future. + """ + def __init__(self, definition): + self._name = definition + + @memoize_method + def _get_contexts(self, fast): + if isinstance(self._name, ImportName) and fast: + return {} + + if self._name.api_type == 'statement': + return {} + + return self._name.infer() + + def docstring(self, fast=True, raw=True): + """ + The docstring ``__doc__`` for any object. + + See :attr:`doc` for example. + """ + full_doc = '' + # Using the first docstring that we see. + for context in self._get_contexts(fast=fast): + if full_doc: + # In case we have multiple contexts, just return all of them + # separated by a few dashes. + full_doc += '\n' + '-' * 30 + '\n' + + doc = context.py__doc__() + + signature_text = '' + if self._name.is_context_name: + if not raw: + signature_text = _format_signatures(context) + if not doc and context.is_stub(): + for c in convert_contexts(ContextSet({context}), ignore_compiled=False): + doc = c.py__doc__() + if doc: + break + + if signature_text and doc: + full_doc += signature_text + '\n\n' + doc + else: + full_doc += signature_text + doc + + return full_doc diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/api/completion.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/api/completion.py new file mode 100644 index 0000000..aa5be0a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/api/completion.py @@ -0,0 +1,326 @@ +import re + +from parso.python.token import PythonTokenTypes +from parso.python import tree +from parso.tree import search_ancestor, Leaf + +from jedi._compatibility import Parameter +from jedi import debug +from jedi import settings +from jedi.api import classes +from jedi.api import helpers +from jedi.api import keywords +from jedi.api.file_name import file_name_completions +from jedi.evaluate import imports +from jedi.evaluate.helpers import evaluate_call_of_leaf, parse_dotted_names +from jedi.evaluate.filters import get_global_filters +from jedi.evaluate.gradual.conversion import convert_contexts +from jedi.parser_utils import get_statement_of_position, cut_value_at_position + + +def get_call_signature_param_names(call_signatures): + # add named params + for call_sig in call_signatures: + for p in call_sig.params: + # Allow protected access, because it's a public API. + if p._name.get_kind() in (Parameter.POSITIONAL_OR_KEYWORD, + Parameter.KEYWORD_ONLY): + yield p._name + + +def filter_names(evaluator, completion_names, stack, like_name): + comp_dct = {} + if settings.case_insensitive_completion: + like_name = like_name.lower() + for name in completion_names: + string = name.string_name + if settings.case_insensitive_completion: + string = string.lower() + + if string.startswith(like_name): + new = classes.Completion( + evaluator, + name, + stack, + len(like_name) + ) + k = (new.name, new.complete) # key + if k in comp_dct and settings.no_completion_duplicates: + comp_dct[k]._same_name_completions.append(new) + else: + comp_dct[k] = new + yield new + + +def get_user_scope(module_context, position): + """ + Returns the scope in which the user resides. This includes flows. + """ + user_stmt = get_statement_of_position(module_context.tree_node, position) + if user_stmt is None: + def scan(scope): + for s in scope.children: + if s.start_pos <= position <= s.end_pos: + if isinstance(s, (tree.Scope, tree.Flow)) \ + or s.type in ('async_stmt', 'async_funcdef'): + return scan(s) or s + elif s.type in ('suite', 'decorated'): + return scan(s) + return None + + scanned_node = scan(module_context.tree_node) + if scanned_node: + return module_context.create_context(scanned_node, node_is_context=True) + return module_context + else: + return module_context.create_context(user_stmt) + + +def get_flow_scope_node(module_node, position): + node = module_node.get_leaf_for_position(position, include_prefixes=True) + while not isinstance(node, (tree.Scope, tree.Flow)): + node = node.parent + + return node + + +class Completion: + def __init__(self, evaluator, module, code_lines, position, call_signatures_callback): + self._evaluator = evaluator + self._module_context = module + self._module_node = module.tree_node + self._code_lines = code_lines + + # The first step of completions is to get the name + self._like_name = helpers.get_on_completion_name(self._module_node, code_lines, position) + # The actual cursor position is not what we need to calculate + # everything. We want the start of the name we're on. + self._original_position = position + self._position = position[0], position[1] - len(self._like_name) + self._call_signatures_callback = call_signatures_callback + + def completions(self): + leaf = self._module_node.get_leaf_for_position(self._position, include_prefixes=True) + string, start_leaf = _extract_string_while_in_string(leaf, self._position) + if string is not None: + completions = list(file_name_completions( + self._evaluator, self._module_context, start_leaf, string, + self._like_name, self._call_signatures_callback, + self._code_lines, self._original_position + )) + if completions: + return completions + + completion_names = self._get_context_completions(leaf) + + completions = filter_names(self._evaluator, completion_names, + self.stack, self._like_name) + + return sorted(completions, key=lambda x: (x.name.startswith('__'), + x.name.startswith('_'), + x.name.lower())) + + def _get_context_completions(self, leaf): + """ + Analyzes the context that a completion is made in and decides what to + return. + + Technically this works by generating a parser stack and analysing the + current stack for possible grammar nodes. + + Possible enhancements: + - global/nonlocal search global + - yield from / raise from <- could be only exceptions/generators + - In args: */**: no completion + - In params (also lambda): no completion before = + """ + + grammar = self._evaluator.grammar + self.stack = stack = None + + try: + self.stack = stack = helpers.get_stack_at_position( + grammar, self._code_lines, leaf, self._position + ) + except helpers.OnErrorLeaf as e: + value = e.error_leaf.value + if value == '.': + # After ErrorLeaf's that are dots, we will not do any + # completions since this probably just confuses the user. + return [] + + # If we don't have a context, just use global completion. + return self._global_completions() + + allowed_transitions = \ + list(stack._allowed_transition_names_and_token_types()) + + if 'if' in allowed_transitions: + leaf = self._module_node.get_leaf_for_position(self._position, include_prefixes=True) + previous_leaf = leaf.get_previous_leaf() + + indent = self._position[1] + if not (leaf.start_pos <= self._position <= leaf.end_pos): + indent = leaf.start_pos[1] + + if previous_leaf is not None: + stmt = previous_leaf + while True: + stmt = search_ancestor( + stmt, 'if_stmt', 'for_stmt', 'while_stmt', 'try_stmt', + 'error_node', + ) + if stmt is None: + break + + type_ = stmt.type + if type_ == 'error_node': + first = stmt.children[0] + if isinstance(first, Leaf): + type_ = first.value + '_stmt' + # Compare indents + if stmt.start_pos[1] == indent: + if type_ == 'if_stmt': + allowed_transitions += ['elif', 'else'] + elif type_ == 'try_stmt': + allowed_transitions += ['except', 'finally', 'else'] + elif type_ == 'for_stmt': + allowed_transitions.append('else') + + completion_names = [] + current_line = self._code_lines[self._position[0] - 1][:self._position[1]] + if not current_line or current_line[-1] in ' \t.;': + completion_names += self._get_keyword_completion_names(allowed_transitions) + + if any(t in allowed_transitions for t in (PythonTokenTypes.NAME, + PythonTokenTypes.INDENT)): + # This means that we actually have to do type inference. + + nonterminals = [stack_node.nonterminal for stack_node in stack] + + nodes = [] + for stack_node in stack: + if stack_node.dfa.from_rule == 'small_stmt': + nodes = [] + else: + nodes += stack_node.nodes + + if nodes and nodes[-1] in ('as', 'def', 'class'): + # No completions for ``with x as foo`` and ``import x as foo``. + # Also true for defining names as a class or function. + return list(self._get_class_context_completions(is_function=True)) + elif "import_stmt" in nonterminals: + level, names = parse_dotted_names(nodes, "import_from" in nonterminals) + + only_modules = not ("import_from" in nonterminals and 'import' in nodes) + completion_names += self._get_importer_names( + names, + level, + only_modules=only_modules, + ) + elif nonterminals[-1] in ('trailer', 'dotted_name') and nodes[-1] == '.': + dot = self._module_node.get_leaf_for_position(self._position) + completion_names += self._trailer_completions(dot.get_previous_leaf()) + else: + completion_names += self._global_completions() + completion_names += self._get_class_context_completions(is_function=False) + + if 'trailer' in nonterminals: + call_signatures = self._call_signatures_callback() + completion_names += get_call_signature_param_names(call_signatures) + + return completion_names + + def _get_keyword_completion_names(self, allowed_transitions): + for k in allowed_transitions: + if isinstance(k, str) and k.isalpha(): + yield keywords.KeywordName(self._evaluator, k) + + def _global_completions(self): + context = get_user_scope(self._module_context, self._position) + debug.dbg('global completion scope: %s', context) + flow_scope_node = get_flow_scope_node(self._module_node, self._position) + filters = get_global_filters( + self._evaluator, + context, + self._position, + origin_scope=flow_scope_node + ) + completion_names = [] + for filter in filters: + completion_names += filter.values() + return completion_names + + def _trailer_completions(self, previous_leaf): + user_context = get_user_scope(self._module_context, self._position) + evaluation_context = self._evaluator.create_context( + self._module_context, previous_leaf + ) + contexts = evaluate_call_of_leaf(evaluation_context, previous_leaf) + completion_names = [] + debug.dbg('trailer completion contexts: %s', contexts, color='MAGENTA') + for context in contexts: + for filter in context.get_filters( + search_global=False, + origin_scope=user_context.tree_node): + completion_names += filter.values() + + python_contexts = convert_contexts(contexts) + for c in python_contexts: + if c not in contexts: + for filter in c.get_filters( + search_global=False, + origin_scope=user_context.tree_node): + completion_names += filter.values() + return completion_names + + def _get_importer_names(self, names, level=0, only_modules=True): + names = [n.value for n in names] + i = imports.Importer(self._evaluator, names, self._module_context, level) + return i.completion_names(self._evaluator, only_modules=only_modules) + + def _get_class_context_completions(self, is_function=True): + """ + Autocomplete inherited methods when overriding in child class. + """ + leaf = self._module_node.get_leaf_for_position(self._position, include_prefixes=True) + cls = tree.search_ancestor(leaf, 'classdef') + if isinstance(cls, (tree.Class, tree.Function)): + # Complete the methods that are defined in the super classes. + random_context = self._module_context.create_context( + cls, + node_is_context=True + ) + else: + return + + if cls.start_pos[1] >= leaf.start_pos[1]: + return + + filters = random_context.get_filters(search_global=False, is_instance=True) + # The first dict is the dictionary of class itself. + next(filters) + for filter in filters: + for name in filter.values(): + # TODO we should probably check here for properties + if (name.api_type == 'function') == is_function: + yield name + + +def _extract_string_while_in_string(leaf, position): + if leaf.type == 'string': + match = re.match(r'^\w*(\'{3}|"{3}|\'|")', leaf.value) + quote = match.group(1) + if leaf.line == position[0] and position[1] < leaf.column + match.end(): + return None, None + if leaf.end_pos[0] == position[0] and position[1] > leaf.end_pos[1] - len(quote): + return None, None + return cut_value_at_position(leaf, position)[match.end():], leaf + + leaves = [] + while leaf is not None and leaf.line == position[0]: + if leaf.type == 'error_leaf' and ('"' in leaf.value or "'" in leaf.value): + return ''.join(l.get_code() for l in leaves), leaf + leaves.insert(0, leaf) + leaf = leaf.get_previous_leaf() + return None, None diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/api/environment.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/api/environment.py new file mode 100644 index 0000000..e57f548 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/api/environment.py @@ -0,0 +1,458 @@ +""" +Environments are a way to activate different Python versions or Virtualenvs for +static analysis. The Python binary in that environment is going to be executed. +""" +import os +import sys +import hashlib +import filecmp +from collections import namedtuple + +from jedi._compatibility import highest_pickle_protocol, which +from jedi.cache import memoize_method, time_cache +from jedi.evaluate.compiled.subprocess import CompiledSubprocess, \ + EvaluatorSameProcess, EvaluatorSubprocess + +import parso + +_VersionInfo = namedtuple('VersionInfo', 'major minor micro') + +_SUPPORTED_PYTHONS = ['3.8', '3.7', '3.6', '3.5', '3.4', '2.7'] +_SAFE_PATHS = ['/usr/bin', '/usr/local/bin'] +_CURRENT_VERSION = '%s.%s' % (sys.version_info.major, sys.version_info.minor) + + +class InvalidPythonEnvironment(Exception): + """ + If you see this exception, the Python executable or Virtualenv you have + been trying to use is probably not a correct Python version. + """ + + +class _BaseEnvironment(object): + @memoize_method + def get_grammar(self): + version_string = '%s.%s' % (self.version_info.major, self.version_info.minor) + return parso.load_grammar(version=version_string) + + @property + def _sha256(self): + try: + return self._hash + except AttributeError: + self._hash = _calculate_sha256_for_file(self.executable) + return self._hash + + +def _get_info(): + return ( + sys.executable, + sys.prefix, + sys.version_info[:3], + ) + + +class Environment(_BaseEnvironment): + """ + This class is supposed to be created by internal Jedi architecture. You + should not create it directly. Please use create_environment or the other + functions instead. It is then returned by that function. + """ + _subprocess = None + + def __init__(self, executable): + self._start_executable = executable + # Initialize the environment + self._get_subprocess() + + def _get_subprocess(self): + if self._subprocess is not None and not self._subprocess.is_crashed: + return self._subprocess + + try: + self._subprocess = CompiledSubprocess(self._start_executable) + info = self._subprocess._send(None, _get_info) + except Exception as exc: + raise InvalidPythonEnvironment( + "Could not get version information for %r: %r" % ( + self._start_executable, + exc)) + + # Since it could change and might not be the same(?) as the one given, + # set it here. + self.executable = info[0] + """ + The Python executable, matches ``sys.executable``. + """ + self.path = info[1] + """ + The path to an environment, matches ``sys.prefix``. + """ + self.version_info = _VersionInfo(*info[2]) + """ + Like ``sys.version_info``. A tuple to show the current Environment's + Python version. + """ + + # py2 sends bytes via pickle apparently?! + if self.version_info.major == 2: + self.executable = self.executable.decode() + self.path = self.path.decode() + + # Adjust pickle protocol according to host and client version. + self._subprocess._pickle_protocol = highest_pickle_protocol([ + sys.version_info, self.version_info]) + + return self._subprocess + + def __repr__(self): + version = '.'.join(str(i) for i in self.version_info) + return '<%s: %s in %s>' % (self.__class__.__name__, version, self.path) + + def get_evaluator_subprocess(self, evaluator): + return EvaluatorSubprocess(evaluator, self._get_subprocess()) + + @memoize_method + def get_sys_path(self): + """ + The sys path for this environment. Does not include potential + modifications like ``sys.path.append``. + + :returns: list of str + """ + # It's pretty much impossible to generate the sys path without actually + # executing Python. The sys path (when starting with -S) itself depends + # on how the Python version was compiled (ENV variables). + # If you omit -S when starting Python (normal case), additionally + # site.py gets executed. + return self._get_subprocess().get_sys_path() + + +class _SameEnvironmentMixin(object): + def __init__(self): + self._start_executable = self.executable = sys.executable + self.path = sys.prefix + self.version_info = _VersionInfo(*sys.version_info[:3]) + + +class SameEnvironment(_SameEnvironmentMixin, Environment): + pass + + +class InterpreterEnvironment(_SameEnvironmentMixin, _BaseEnvironment): + def get_evaluator_subprocess(self, evaluator): + return EvaluatorSameProcess(evaluator) + + def get_sys_path(self): + return sys.path + + +def _get_virtual_env_from_var(): + """Get virtualenv environment from VIRTUAL_ENV environment variable. + + It uses `safe=False` with ``create_environment``, because the environment + variable is considered to be safe / controlled by the user solely. + """ + var = os.environ.get('VIRTUAL_ENV') + if var: + # Under macOS in some cases - notably when using Pipenv - the + # sys.prefix of the virtualenv is /path/to/env/bin/.. instead of + # /path/to/env so we need to fully resolve the paths in order to + # compare them. + if os.path.realpath(var) == os.path.realpath(sys.prefix): + return _try_get_same_env() + + try: + return create_environment(var, safe=False) + except InvalidPythonEnvironment: + pass + + +def _calculate_sha256_for_file(path): + sha256 = hashlib.sha256() + with open(path, 'rb') as f: + for block in iter(lambda: f.read(filecmp.BUFSIZE), b''): + sha256.update(block) + return sha256.hexdigest() + + +def get_default_environment(): + """ + Tries to return an active Virtualenv. If there is no VIRTUAL_ENV variable + set it will return the latest Python version installed on the system. This + makes it possible to use as many new Python features as possible when using + autocompletion and other functionality. + + :returns: :class:`Environment` + """ + virtual_env = _get_virtual_env_from_var() + if virtual_env is not None: + return virtual_env + + return _try_get_same_env() + + +def _try_get_same_env(): + env = SameEnvironment() + if not os.path.basename(env.executable).lower().startswith('python'): + # This tries to counter issues with embedding. In some cases (e.g. + # VIM's Python Mac/Windows, sys.executable is /foo/bar/vim. This + # happens, because for Mac a function called `_NSGetExecutablePath` is + # used and for Windows `GetModuleFileNameW`. These are both platform + # specific functions. For all other systems sys.executable should be + # alright. However here we try to generalize: + # + # 1. Check if the executable looks like python (heuristic) + # 2. In case it's not try to find the executable + # 3. In case we don't find it use an interpreter environment. + # + # The last option will always work, but leads to potential crashes of + # Jedi - which is ok, because it happens very rarely and even less, + # because the code below should work for most cases. + if os.name == 'nt': + # The first case would be a virtualenv and the second a normal + # Python installation. + checks = (r'Scripts\python.exe', 'python.exe') + else: + # For unix it looks like Python is always in a bin folder. + checks = ( + 'bin/python%s.%s' % (sys.version_info[0], sys.version[1]), + 'bin/python%s' % (sys.version_info[0]), + 'bin/python', + ) + for check in checks: + guess = os.path.join(sys.exec_prefix, check) + if os.path.isfile(guess): + # Bingo - We think we have our Python. + return Environment(guess) + # It looks like there is no reasonable Python to be found. + return InterpreterEnvironment() + # If no virtualenv is found, use the environment we're already + # using. + return env + + +def get_cached_default_environment(): + var = os.environ.get('VIRTUAL_ENV') + environment = _get_cached_default_environment() + + # Under macOS in some cases - notably when using Pipenv - the + # sys.prefix of the virtualenv is /path/to/env/bin/.. instead of + # /path/to/env so we need to fully resolve the paths in order to + # compare them. + if var and os.path.realpath(var) != os.path.realpath(environment.path): + _get_cached_default_environment.clear_cache() + return _get_cached_default_environment() + return environment + + +@time_cache(seconds=10 * 60) # 10 Minutes +def _get_cached_default_environment(): + return get_default_environment() + + +def find_virtualenvs(paths=None, **kwargs): + """ + :param paths: A list of paths in your file system to be scanned for + Virtualenvs. It will search in these paths and potentially execute the + Python binaries. Also the VIRTUAL_ENV variable will be checked if it + contains a valid Virtualenv. + :param safe: Default True. In case this is False, it will allow this + function to execute potential `python` environments. An attacker might + be able to drop an executable in a path this function is searching by + default. If the executable has not been installed by root, it will not + be executed. + + :yields: :class:`Environment` + """ + def py27_comp(paths=None, safe=True): + if paths is None: + paths = [] + + _used_paths = set() + + # Using this variable should be safe, because attackers might be able + # to drop files (via git) but not environment variables. + virtual_env = _get_virtual_env_from_var() + if virtual_env is not None: + yield virtual_env + _used_paths.add(virtual_env.path) + + for directory in paths: + if not os.path.isdir(directory): + continue + + directory = os.path.abspath(directory) + for path in os.listdir(directory): + path = os.path.join(directory, path) + if path in _used_paths: + # A path shouldn't be evaluated twice. + continue + _used_paths.add(path) + + try: + executable = _get_executable_path(path, safe=safe) + yield Environment(executable) + except InvalidPythonEnvironment: + pass + + return py27_comp(paths, **kwargs) + + +def find_system_environments(): + """ + Ignores virtualenvs and returns the Python versions that were installed on + your system. This might return nothing, if you're running Python e.g. from + a portable version. + + The environments are sorted from latest to oldest Python version. + + :yields: :class:`Environment` + """ + for version_string in _SUPPORTED_PYTHONS: + try: + yield get_system_environment(version_string) + except InvalidPythonEnvironment: + pass + + +# TODO: this function should probably return a list of environments since +# multiple Python installations can be found on a system for the same version. +def get_system_environment(version): + """ + Return the first Python environment found for a string of the form 'X.Y' + where X and Y are the major and minor versions of Python. + + :raises: :exc:`.InvalidPythonEnvironment` + :returns: :class:`Environment` + """ + exe = which('python' + version) + if exe: + if exe == sys.executable: + return SameEnvironment() + return Environment(exe) + + if os.name == 'nt': + for exe in _get_executables_from_windows_registry(version): + try: + return Environment(exe) + except InvalidPythonEnvironment: + pass + raise InvalidPythonEnvironment("Cannot find executable python%s." % version) + + +def create_environment(path, safe=True): + """ + Make it possible to manually create an Environment object by specifying a + Virtualenv path or an executable path. + + :raises: :exc:`.InvalidPythonEnvironment` + :returns: :class:`Environment` + """ + if os.path.isfile(path): + _assert_safe(path, safe) + return Environment(path) + return Environment(_get_executable_path(path, safe=safe)) + + +def _get_executable_path(path, safe=True): + """ + Returns None if it's not actually a virtual env. + """ + + if os.name == 'nt': + python = os.path.join(path, 'Scripts', 'python.exe') + else: + python = os.path.join(path, 'bin', 'python') + if not os.path.exists(python): + raise InvalidPythonEnvironment("%s seems to be missing." % python) + + _assert_safe(python, safe) + return python + + +def _get_executables_from_windows_registry(version): + # The winreg module is named _winreg on Python 2. + try: + import winreg + except ImportError: + import _winreg as winreg + + # TODO: support Python Anaconda. + sub_keys = [ + r'SOFTWARE\Python\PythonCore\{version}\InstallPath', + r'SOFTWARE\Wow6432Node\Python\PythonCore\{version}\InstallPath', + r'SOFTWARE\Python\PythonCore\{version}-32\InstallPath', + r'SOFTWARE\Wow6432Node\Python\PythonCore\{version}-32\InstallPath' + ] + for root_key in [winreg.HKEY_CURRENT_USER, winreg.HKEY_LOCAL_MACHINE]: + for sub_key in sub_keys: + sub_key = sub_key.format(version=version) + try: + with winreg.OpenKey(root_key, sub_key) as key: + prefix = winreg.QueryValueEx(key, '')[0] + exe = os.path.join(prefix, 'python.exe') + if os.path.isfile(exe): + yield exe + except WindowsError: + pass + + +def _assert_safe(executable_path, safe): + if safe and not _is_safe(executable_path): + raise InvalidPythonEnvironment( + "The python binary is potentially unsafe.") + + +def _is_safe(executable_path): + # Resolve sym links. A venv typically is a symlink to a known Python + # binary. Only virtualenvs copy symlinks around. + real_path = os.path.realpath(executable_path) + + if _is_unix_safe_simple(real_path): + return True + + # Just check the list of known Python versions. If it's not in there, + # it's likely an attacker or some Python that was not properly + # installed in the system. + for environment in find_system_environments(): + if environment.executable == real_path: + return True + + # If the versions don't match, just compare the binary files. If we + # don't do that, only venvs will be working and not virtualenvs. + # venvs are symlinks while virtualenvs are actual copies of the + # Python files. + # This still means that if the system Python is updated and the + # virtualenv's Python is not (which is probably never going to get + # upgraded), it will not work with Jedi. IMO that's fine, because + # people should just be using venv. ~ dave + if environment._sha256 == _calculate_sha256_for_file(real_path): + return True + return False + + +def _is_unix_safe_simple(real_path): + if _is_unix_admin(): + # In case we are root, just be conservative and + # only execute known paths. + return any(real_path.startswith(p) for p in _SAFE_PATHS) + + uid = os.stat(real_path).st_uid + # The interpreter needs to be owned by root. This means that it wasn't + # written by a user and therefore attacking Jedi is not as simple. + # The attack could look like the following: + # 1. A user clones a repository. + # 2. The repository has an innocent looking folder called foobar. jedi + # searches for the folder and executes foobar/bin/python --version if + # there's also a foobar/bin/activate. + # 3. The bin/python is obviously not a python script but a bash script or + # whatever the attacker wants. + return uid == 0 + + +def _is_unix_admin(): + try: + return os.getuid() == 0 + except AttributeError: + return False # Windows diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/api/exceptions.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/api/exceptions.py new file mode 100644 index 0000000..99cebdb --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/api/exceptions.py @@ -0,0 +1,10 @@ +class _JediError(Exception): + pass + + +class InternalError(_JediError): + pass + + +class WrongVersion(_JediError): + pass diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/api/file_name.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/api/file_name.py new file mode 100644 index 0000000..2a2c4e6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/api/file_name.py @@ -0,0 +1,161 @@ +import os + +from jedi._compatibility import FileNotFoundError, force_unicode +from jedi.evaluate.names import AbstractArbitraryName +from jedi.api import classes +from jedi.evaluate.helpers import get_str_or_none +from jedi.parser_utils import get_string_quote + + +def file_name_completions(evaluator, module_context, start_leaf, string, + like_name, call_signatures_callback, code_lines, position): + # First we want to find out what can actually be changed as a name. + like_name_length = len(os.path.basename(string) + like_name) + + addition = _get_string_additions(module_context, start_leaf) + if addition is None: + return + string = addition + string + + # Here we use basename again, because if strings are added like + # `'foo' + 'bar`, it should complete to `foobar/`. + must_start_with = os.path.basename(string) + like_name + string = os.path.dirname(string) + + sigs = call_signatures_callback() + is_in_os_path_join = sigs and all(s.full_name == 'os.path.join' for s in sigs) + if is_in_os_path_join: + to_be_added = _add_os_path_join(module_context, start_leaf, sigs[0].bracket_start) + if to_be_added is None: + is_in_os_path_join = False + else: + string = to_be_added + string + base_path = os.path.join(evaluator.project._path, string) + try: + listed = os.listdir(base_path) + except FileNotFoundError: + return + for name in listed: + if name.startswith(must_start_with): + path_for_name = os.path.join(base_path, name) + if is_in_os_path_join or not os.path.isdir(path_for_name): + if start_leaf.type == 'string': + quote = get_string_quote(start_leaf) + else: + assert start_leaf.type == 'error_leaf' + quote = start_leaf.value + potential_other_quote = \ + code_lines[position[0] - 1][position[1]:position[1] + len(quote)] + # Add a quote if it's not already there. + if quote != potential_other_quote: + name += quote + else: + name += os.path.sep + + yield classes.Completion( + evaluator, + FileName(evaluator, name[len(must_start_with) - like_name_length:]), + stack=None, + like_name_length=like_name_length + ) + + +def _get_string_additions(module_context, start_leaf): + def iterate_nodes(): + node = addition.parent + was_addition = True + for child_node in reversed(node.children[:node.children.index(addition)]): + if was_addition: + was_addition = False + yield child_node + continue + + if child_node != '+': + break + was_addition = True + + addition = start_leaf.get_previous_leaf() + if addition != '+': + return '' + context = module_context.create_context(start_leaf) + return _add_strings(context, reversed(list(iterate_nodes()))) + + +def _add_strings(context, nodes, add_slash=False): + string = '' + first = True + for child_node in nodes: + contexts = context.eval_node(child_node) + if len(contexts) != 1: + return None + c, = contexts + s = get_str_or_none(c) + if s is None: + return None + if not first and add_slash: + string += os.path.sep + string += force_unicode(s) + first = False + return string + + +class FileName(AbstractArbitraryName): + api_type = u'path' + is_context_name = False + + +def _add_os_path_join(module_context, start_leaf, bracket_start): + def check(maybe_bracket, nodes): + if maybe_bracket.start_pos != bracket_start: + return None + + if not nodes: + return '' + context = module_context.create_context(nodes[0]) + return _add_strings(context, nodes, add_slash=True) or '' + + if start_leaf.type == 'error_leaf': + # Unfinished string literal, like `join('` + context_node = start_leaf.parent + index = context_node.children.index(start_leaf) + if index > 0: + error_node = context_node.children[index - 1] + if error_node.type == 'error_node' and len(error_node.children) >= 2: + index = -2 + if error_node.children[-1].type == 'arglist': + arglist_nodes = error_node.children[-1].children + index -= 1 + else: + arglist_nodes = [] + + return check(error_node.children[index + 1], arglist_nodes[::2]) + return None + + # Maybe an arglist or some weird error case. Therefore checked below. + searched_node_child = start_leaf + while searched_node_child.parent is not None \ + and searched_node_child.parent.type not in ('arglist', 'trailer', 'error_node'): + searched_node_child = searched_node_child.parent + + if searched_node_child.get_first_leaf() is not start_leaf: + return None + searched_node = searched_node_child.parent + if searched_node is None: + return None + + index = searched_node.children.index(searched_node_child) + arglist_nodes = searched_node.children[:index] + if searched_node.type == 'arglist': + trailer = searched_node.parent + if trailer.type == 'error_node': + trailer_index = trailer.children.index(searched_node) + assert trailer_index >= 2 + assert trailer.children[trailer_index - 1] == '(' + return check(trailer.children[trailer_index - 1], arglist_nodes[::2]) + elif trailer.type == 'trailer': + return check(trailer.children[0], arglist_nodes[::2]) + elif searched_node.type == 'trailer': + return check(searched_node.children[0], []) + elif searched_node.type == 'error_node': + # Stuff like `join(""` + return check(arglist_nodes[-1], []) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/api/helpers.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/api/helpers.py new file mode 100644 index 0000000..6fafb11 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/api/helpers.py @@ -0,0 +1,397 @@ +""" +Helpers for the API +""" +import re +from collections import namedtuple +from textwrap import dedent + +from parso.python.parser import Parser +from parso.python import tree + +from jedi._compatibility import u, Parameter +from jedi.evaluate.base_context import NO_CONTEXTS +from jedi.evaluate.syntax_tree import eval_atom +from jedi.evaluate.helpers import evaluate_call_of_leaf +from jedi.evaluate.compiled import get_string_context_set +from jedi.cache import call_signature_time_cache + + +CompletionParts = namedtuple('CompletionParts', ['path', 'has_dot', 'name']) + + +def sorted_definitions(defs): + # Note: `or ''` below is required because `module_path` could be + return sorted(defs, key=lambda x: (x.module_path or '', x.line or 0, x.column or 0, x.name)) + + +def get_on_completion_name(module_node, lines, position): + leaf = module_node.get_leaf_for_position(position) + if leaf is None or leaf.type in ('string', 'error_leaf'): + # Completions inside strings are a bit special, we need to parse the + # string. The same is true for comments and error_leafs. + line = lines[position[0] - 1] + # The first step of completions is to get the name + return re.search(r'(?!\d)\w+$|$', line[:position[1]]).group(0) + elif leaf.type not in ('name', 'keyword'): + return '' + + return leaf.value[:position[1] - leaf.start_pos[1]] + + +def _get_code(code_lines, start_pos, end_pos): + # Get relevant lines. + lines = code_lines[start_pos[0] - 1:end_pos[0]] + # Remove the parts at the end of the line. + lines[-1] = lines[-1][:end_pos[1]] + # Remove first line indentation. + lines[0] = lines[0][start_pos[1]:] + return ''.join(lines) + + +class OnErrorLeaf(Exception): + @property + def error_leaf(self): + return self.args[0] + + +def _get_code_for_stack(code_lines, leaf, position): + # It might happen that we're on whitespace or on a comment. This means + # that we would not get the right leaf. + if leaf.start_pos >= position: + # If we're not on a comment simply get the previous leaf and proceed. + leaf = leaf.get_previous_leaf() + if leaf is None: + return u('') # At the beginning of the file. + + is_after_newline = leaf.type == 'newline' + while leaf.type == 'newline': + leaf = leaf.get_previous_leaf() + if leaf is None: + return u('') + + if leaf.type == 'error_leaf' or leaf.type == 'string': + if leaf.start_pos[0] < position[0]: + # On a different line, we just begin anew. + return u('') + + # Error leafs cannot be parsed, completion in strings is also + # impossible. + raise OnErrorLeaf(leaf) + else: + user_stmt = leaf + while True: + if user_stmt.parent.type in ('file_input', 'suite', 'simple_stmt'): + break + user_stmt = user_stmt.parent + + if is_after_newline: + if user_stmt.start_pos[1] > position[1]: + # This means that it's actually a dedent and that means that we + # start without context (part of a suite). + return u('') + + # This is basically getting the relevant lines. + return _get_code(code_lines, user_stmt.get_start_pos_of_prefix(), position) + + +def get_stack_at_position(grammar, code_lines, leaf, pos): + """ + Returns the possible node names (e.g. import_from, xor_test or yield_stmt). + """ + class EndMarkerReached(Exception): + pass + + def tokenize_without_endmarker(code): + # TODO This is for now not an official parso API that exists purely + # for Jedi. + tokens = grammar._tokenize(code) + for token in tokens: + if token.string == safeword: + raise EndMarkerReached() + elif token.prefix.endswith(safeword): + # This happens with comments. + raise EndMarkerReached() + elif token.string.endswith(safeword): + yield token # Probably an f-string literal that was not finished. + raise EndMarkerReached() + else: + yield token + + # The code might be indedented, just remove it. + code = dedent(_get_code_for_stack(code_lines, leaf, pos)) + # We use a word to tell Jedi when we have reached the start of the + # completion. + # Use Z as a prefix because it's not part of a number suffix. + safeword = 'ZZZ_USER_WANTS_TO_COMPLETE_HERE_WITH_JEDI' + code = code + ' ' + safeword + + p = Parser(grammar._pgen_grammar, error_recovery=True) + try: + p.parse(tokens=tokenize_without_endmarker(code)) + except EndMarkerReached: + return p.stack + raise SystemError( + "This really shouldn't happen. There's a bug in Jedi:\n%s" + % list(tokenize_without_endmarker(code)) + ) + + +def evaluate_goto_definition(evaluator, context, leaf): + if leaf.type == 'name': + # In case of a name we can just use goto_definition which does all the + # magic itself. + return evaluator.goto_definitions(context, leaf) + + parent = leaf.parent + definitions = NO_CONTEXTS + if parent.type == 'atom': + # e.g. `(a + b)` + definitions = context.eval_node(leaf.parent) + elif parent.type == 'trailer': + # e.g. `a()` + definitions = evaluate_call_of_leaf(context, leaf) + elif isinstance(leaf, tree.Literal): + # e.g. `"foo"` or `1.0` + return eval_atom(context, leaf) + elif leaf.type in ('fstring_string', 'fstring_start', 'fstring_end'): + return get_string_context_set(evaluator) + return definitions + + +class CallDetails(object): + def __init__(self, bracket_leaf, children, position): + ['bracket_leaf', 'call_index', 'keyword_name_str'] + self.bracket_leaf = bracket_leaf + self._children = children + self._position = position + + @property + def index(self): + return _get_index_and_key(self._children, self._position)[0] + + @property + def keyword_name_str(self): + return _get_index_and_key(self._children, self._position)[1] + + def calculate_index(self, param_names): + positional_count = 0 + used_names = set() + star_count = -1 + args = list(_iter_arguments(self._children, self._position)) + if not args: + if param_names: + return 0 + else: + return None + + is_kwarg = False + for i, (star_count, key_start, had_equal) in enumerate(args): + is_kwarg |= had_equal | (star_count == 2) + if star_count: + pass # For now do nothing, we don't know what's in there here. + else: + if i + 1 != len(args): # Not last + if had_equal: + used_names.add(key_start) + else: + positional_count += 1 + + for i, param_name in enumerate(param_names): + kind = param_name.get_kind() + + if not is_kwarg: + if kind == Parameter.VAR_POSITIONAL: + return i + if kind in (Parameter.POSITIONAL_OR_KEYWORD, Parameter.POSITIONAL_ONLY): + if i == positional_count: + return i + + if key_start is not None and not star_count == 1 or star_count == 2: + if param_name.string_name not in used_names \ + and (kind == Parameter.KEYWORD_ONLY + or kind == Parameter.POSITIONAL_OR_KEYWORD + and positional_count <= i): + if star_count: + return i + if had_equal: + if param_name.string_name == key_start: + return i + else: + if param_name.string_name.startswith(key_start): + return i + + if kind == Parameter.VAR_KEYWORD: + return i + return None + + +def _iter_arguments(nodes, position): + def remove_after_pos(name): + if name.type != 'name': + return None + return name.value[:position[1] - name.start_pos[1]] + + # Returns Generator[Tuple[star_count, Optional[key_start: str], had_equal]] + nodes_before = [c for c in nodes if c.start_pos < position] + if nodes_before[-1].type == 'arglist': + for x in _iter_arguments(nodes_before[-1].children, position): + yield x # Python 2 :( + return + + previous_node_yielded = False + stars_seen = 0 + for i, node in enumerate(nodes_before): + if node.type == 'argument': + previous_node_yielded = True + first = node.children[0] + second = node.children[1] + if second == '=': + if second.start_pos < position: + yield 0, first.value, True + else: + yield 0, remove_after_pos(first), False + elif first in ('*', '**'): + yield len(first.value), remove_after_pos(second), False + else: + # Must be a Comprehension + first_leaf = node.get_first_leaf() + if first_leaf.type == 'name' and first_leaf.start_pos >= position: + yield 0, remove_after_pos(first_leaf), False + else: + yield 0, None, False + stars_seen = 0 + elif node.type in ('testlist', 'testlist_star_expr'): # testlist is Python 2 + for n in node.children[::2]: + if n.type == 'star_expr': + stars_seen = 1 + n = n.children[1] + yield stars_seen, remove_after_pos(n), False + stars_seen = 0 + # The count of children is even if there's a comma at the end. + previous_node_yielded = bool(len(node.children) % 2) + elif isinstance(node, tree.PythonLeaf) and node.value == ',': + if not previous_node_yielded: + yield stars_seen, '', False + stars_seen = 0 + previous_node_yielded = False + elif isinstance(node, tree.PythonLeaf) and node.value in ('*', '**'): + stars_seen = len(node.value) + elif node == '=' and nodes_before[-1]: + previous_node_yielded = True + before = nodes_before[i - 1] + if before.type == 'name': + yield 0, before.value, True + else: + yield 0, None, False + # Just ignore the star that is probably a syntax error. + stars_seen = 0 + + if not previous_node_yielded: + if nodes_before[-1].type == 'name': + yield stars_seen, remove_after_pos(nodes_before[-1]), False + else: + yield stars_seen, '', False + + +def _get_index_and_key(nodes, position): + """ + Returns the amount of commas and the keyword argument string. + """ + nodes_before = [c for c in nodes if c.start_pos < position] + if nodes_before[-1].type == 'arglist': + return _get_index_and_key(nodes_before[-1].children, position) + + key_str = None + + last = nodes_before[-1] + if last.type == 'argument' and last.children[1] == '=' \ + and last.children[1].end_pos <= position: + # Checked if the argument + key_str = last.children[0].value + elif last == '=': + key_str = nodes_before[-2].value + + return nodes_before.count(','), key_str + + +def _get_call_signature_details_from_error_node(node, additional_children, position): + for index, element in reversed(list(enumerate(node.children))): + # `index > 0` means that it's a trailer and not an atom. + if element == '(' and element.end_pos <= position and index > 0: + # It's an error node, we don't want to match too much, just + # until the parentheses is enough. + children = node.children[index:] + name = element.get_previous_leaf() + if name is None: + continue + if name.type == 'name' or name.parent.type in ('trailer', 'atom'): + return CallDetails(element, children + additional_children, position) + + +def get_call_signature_details(module, position): + leaf = module.get_leaf_for_position(position, include_prefixes=True) + if leaf.start_pos >= position: + # Whitespace / comments after the leaf count towards the previous leaf. + leaf = leaf.get_previous_leaf() + if leaf is None: + return None + + if leaf == ')': + # TODO is this ok? + if leaf.end_pos == position: + leaf = leaf.get_next_leaf() + + # Now that we know where we are in the syntax tree, we start to look at + # parents for possible function definitions. + node = leaf.parent + while node is not None: + if node.type in ('funcdef', 'classdef'): + # Don't show call signatures if there's stuff before it that just + # makes it feel strange to have a call signature. + return None + + additional_children = [] + for n in reversed(node.children): + if n.start_pos < position: + if n.type == 'error_node': + result = _get_call_signature_details_from_error_node( + n, additional_children, position + ) + if result is not None: + return result + + additional_children[0:0] = n.children + continue + additional_children.insert(0, n) + + if node.type == 'trailer' and node.children[0] == '(': + leaf = node.get_previous_leaf() + if leaf is None: + return None + return CallDetails(node.children[0], node.children, position) + + node = node.parent + + return None + + +@call_signature_time_cache("call_signatures_validity") +def cache_call_signatures(evaluator, context, bracket_leaf, code_lines, user_pos): + """This function calculates the cache key.""" + line_index = user_pos[0] - 1 + + before_cursor = code_lines[line_index][:user_pos[1]] + other_lines = code_lines[bracket_leaf.start_pos[0]:line_index] + whole = ''.join(other_lines + [before_cursor]) + before_bracket = re.match(r'.*\(', whole, re.DOTALL) + + module_path = context.get_root_context().py__file__() + if module_path is None: + yield None # Don't cache! + else: + yield (module_path, before_bracket, bracket_leaf.start_pos) + yield evaluate_goto_definition( + evaluator, + context, + bracket_leaf.get_previous_leaf(), + ) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/api/interpreter.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/api/interpreter.py new file mode 100644 index 0000000..515e007 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/api/interpreter.py @@ -0,0 +1,47 @@ +""" +TODO Some parts of this module are still not well documented. +""" + +from jedi.evaluate.context import ModuleContext +from jedi.evaluate import compiled +from jedi.evaluate.compiled import mixed +from jedi.evaluate.compiled.access import create_access_path +from jedi.evaluate.base_context import ContextWrapper + + +def _create(evaluator, obj): + return compiled.create_from_access_path( + evaluator, create_access_path(evaluator, obj) + ) + + +class NamespaceObject(object): + def __init__(self, dct): + self.__dict__ = dct + + +class MixedModuleContext(ContextWrapper): + type = 'mixed_module' + + def __init__(self, evaluator, tree_module, namespaces, file_io, code_lines): + module_context = ModuleContext( + evaluator, tree_module, + file_io=file_io, + string_names=('__main__',), + code_lines=code_lines + ) + super(MixedModuleContext, self).__init__(module_context) + self._namespace_objects = [NamespaceObject(n) for n in namespaces] + + def get_filters(self, *args, **kwargs): + for filter in self._wrapped_context.get_filters(*args, **kwargs): + yield filter + + for namespace_obj in self._namespace_objects: + compiled_object = _create(self.evaluator, namespace_obj) + mixed_object = mixed.MixedObject( + compiled_object=compiled_object, + tree_context=self._wrapped_context + ) + for filter in mixed_object.get_filters(*args, **kwargs): + yield filter diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/api/keywords.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/api/keywords.py new file mode 100644 index 0000000..cc301b8 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/api/keywords.py @@ -0,0 +1,85 @@ +import pydoc + +from jedi.evaluate.utils import ignored +from jedi.evaluate.names import AbstractArbitraryName + +try: + from pydoc_data import topics as pydoc_topics +except ImportError: + # Python 2 + try: + import pydoc_topics + except ImportError: + # This is for Python 3 embeddable version, which dont have + # pydoc_data module in its file python3x.zip. + pydoc_topics = None + + +def get_operator(evaluator, string, pos): + return Keyword(evaluator, string, pos) + + +class KeywordName(AbstractArbitraryName): + api_type = u'keyword' + + def infer(self): + return [Keyword(self.evaluator, self.string_name, (0, 0))] + + +class Keyword(object): + api_type = u'keyword' + + def __init__(self, evaluator, name, pos): + self.name = KeywordName(evaluator, name) + self.start_pos = pos + self.parent = evaluator.builtins_module + + @property + def names(self): + """ For a `parsing.Name` like comparision """ + return [self.name] + + def py__doc__(self): + return imitate_pydoc(self.name.string_name) + + def get_signatures(self): + # TODO this makes no sense, I think Keyword should somehow merge with + # Context to make it easier for the api/classes.py to deal with all + # of it. + return [] + + def __repr__(self): + return '<%s: %s>' % (type(self).__name__, self.name) + + +def imitate_pydoc(string): + """ + It's not possible to get the pydoc's without starting the annoying pager + stuff. + """ + if pydoc_topics is None: + return '' + + # str needed because of possible unicode stuff in py2k (pydoc doesn't work + # with unicode strings) + string = str(string) + h = pydoc.help + with ignored(KeyError): + # try to access symbols + string = h.symbols[string] + string, _, related = string.partition(' ') + + get_target = lambda s: h.topics.get(s, h.keywords.get(s)) + while isinstance(string, str): + string = get_target(string) + + try: + # is a tuple now + label, related = string + except TypeError: + return '' + + try: + return pydoc_topics.topics[label].strip() if pydoc_topics else '' + except KeyError: + return '' diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/api/project.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/api/project.py new file mode 100644 index 0000000..63ee2b8 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/api/project.py @@ -0,0 +1,197 @@ +import os +import json + +from jedi._compatibility import FileNotFoundError, PermissionError, IsADirectoryError +from jedi.api.environment import SameEnvironment, \ + get_cached_default_environment +from jedi.api.exceptions import WrongVersion +from jedi._compatibility import force_unicode +from jedi.evaluate.sys_path import discover_buildout_paths +from jedi.evaluate.cache import evaluator_as_method_param_cache +from jedi.common.utils import traverse_parents + +_CONFIG_FOLDER = '.jedi' +_CONTAINS_POTENTIAL_PROJECT = 'setup.py', '.git', '.hg', 'requirements.txt', 'MANIFEST.in' + +_SERIALIZER_VERSION = 1 + + +def _remove_duplicates_from_path(path): + used = set() + for p in path: + if p in used: + continue + used.add(p) + yield p + + +def _force_unicode_list(lst): + return list(map(force_unicode, lst)) + + +class Project(object): + # TODO serialize environment + _serializer_ignore_attributes = ('_environment',) + _environment = None + + @staticmethod + def _get_json_path(base_path): + return os.path.join(base_path, _CONFIG_FOLDER, 'project.json') + + @classmethod + def load(cls, path): + """ + :param path: The path of the directory you want to use as a project. + """ + with open(cls._get_json_path(path)) as f: + version, data = json.load(f) + + if version == 1: + self = cls.__new__() + self.__dict__.update(data) + return self + else: + raise WrongVersion( + "The Jedi version of this project seems newer than what we can handle." + ) + + def __init__(self, path, **kwargs): + """ + :param path: The base path for this project. + :param sys_path: list of str. You can override the sys path if you + want. By default the ``sys.path.`` is generated from the + environment (virtualenvs, etc). + :param smart_sys_path: If this is enabled (default), adds paths from + local directories. Otherwise you will have to rely on your packages + being properly configured on the ``sys.path``. + """ + def py2_comp(path, environment=None, sys_path=None, + smart_sys_path=True, _django=False): + self._path = os.path.abspath(path) + if isinstance(environment, SameEnvironment): + self._environment = environment + + self._sys_path = sys_path + self._smart_sys_path = smart_sys_path + self._django = _django + + py2_comp(path, **kwargs) + + @evaluator_as_method_param_cache() + def _get_base_sys_path(self, evaluator, environment=None): + if self._sys_path is not None: + return self._sys_path + + # The sys path has not been set explicitly. + if environment is None: + environment = self.get_environment() + + sys_path = list(environment.get_sys_path()) + try: + sys_path.remove('') + except ValueError: + pass + return sys_path + + @evaluator_as_method_param_cache() + def _get_sys_path(self, evaluator, environment=None, add_parent_paths=True): + """ + Keep this method private for all users of jedi. However internally this + one is used like a public method. + """ + suffixed = [] + prefixed = [] + + sys_path = list(self._get_base_sys_path(evaluator, environment)) + if self._smart_sys_path: + prefixed.append(self._path) + + if evaluator.script_path is not None: + suffixed += discover_buildout_paths(evaluator, evaluator.script_path) + + if add_parent_paths: + traversed = list(traverse_parents(evaluator.script_path)) + + # AFAIK some libraries have imports like `foo.foo.bar`, which + # leads to the conclusion to by default prefer longer paths + # rather than shorter ones by default. + suffixed += reversed(traversed) + + if self._django: + prefixed.append(self._path) + + path = prefixed + sys_path + suffixed + return list(_force_unicode_list(_remove_duplicates_from_path(path))) + + def save(self): + data = dict(self.__dict__) + for attribute in self._serializer_ignore_attributes: + data.pop(attribute, None) + + with open(self._get_json_path(self._path), 'wb') as f: + return json.dump((_SERIALIZER_VERSION, data), f) + + def get_environment(self): + if self._environment is None: + return get_cached_default_environment() + + return self._environment + + def __repr__(self): + return '<%s: %s>' % (self.__class__.__name__, self._path) + + +def _is_potential_project(path): + for name in _CONTAINS_POTENTIAL_PROJECT: + if os.path.exists(os.path.join(path, name)): + return True + return False + + +def _is_django_path(directory): + """ Detects the path of the very well known Django library (if used) """ + try: + with open(os.path.join(directory, 'manage.py'), 'rb') as f: + return b"DJANGO_SETTINGS_MODULE" in f.read() + except (FileNotFoundError, IsADirectoryError, PermissionError): + return False + + return False + + +def get_default_project(path=None): + if path is None: + path = os.getcwd() + + check = os.path.realpath(path) + probable_path = None + first_no_init_file = None + for dir in traverse_parents(check, include_current=True): + try: + return Project.load(dir) + except (FileNotFoundError, IsADirectoryError, PermissionError): + pass + + if first_no_init_file is None: + if os.path.exists(os.path.join(dir, '__init__.py')): + # In the case that a __init__.py exists, it's in 99% just a + # Python package and the project sits at least one level above. + continue + else: + first_no_init_file = dir + + if _is_django_path(dir): + return Project(dir, _django=True) + + if probable_path is None and _is_potential_project(dir): + probable_path = dir + + if probable_path is not None: + # TODO search for setup.py etc + return Project(probable_path) + + if first_no_init_file is not None: + return Project(first_no_init_file) + + curdir = path if os.path.isdir(path) else os.path.dirname(path) + return Project(curdir) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/api/replstartup.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/api/replstartup.py new file mode 100644 index 0000000..3ac8470 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/api/replstartup.py @@ -0,0 +1,29 @@ +""" +To use Jedi completion in Python interpreter, add the following in your shell +setup (e.g., ``.bashrc``). This works only on Linux/Mac, because readline is +not available on Windows. If you still want Jedi autocompletion in your REPL, +just use IPython instead:: + + export PYTHONSTARTUP="$(python -m jedi repl)" + +Then you will be able to use Jedi completer in your Python interpreter:: + + $ python + Python 2.7.2+ (default, Jul 20 2012, 22:15:08) + [GCC 4.6.1] on linux2 + Type "help", "copyright", "credits" or "license" for more information. + >>> import os + >>> os.path.join('a', 'b').split().in # doctest: +SKIP + ..dex ..sert + +""" +import jedi.utils +from jedi import __version__ as __jedi_version__ + +print('REPL completion using Jedi %s' % __jedi_version__) +jedi.utils.setup_readline() + +del jedi + +# Note: try not to do many things here, as it will contaminate global +# namespace of the interpreter. diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/cache.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/cache.py new file mode 100644 index 0000000..93e2bd7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/cache.py @@ -0,0 +1,146 @@ +""" +This caching is very important for speed and memory optimizations. There's +nothing really spectacular, just some decorators. The following cache types are +available: + +- ``time_cache`` can be used to cache something for just a limited time span, + which can be useful if there's user interaction and the user cannot react + faster than a certain time. + +This module is one of the reasons why |jedi| is not thread-safe. As you can see +there are global variables, which are holding the cache information. Some of +these variables are being cleaned after every API usage. +""" +import time +from functools import wraps + +from jedi import settings +from parso.cache import parser_cache + +_time_caches = {} + + +def underscore_memoization(func): + """ + Decorator for methods:: + + class A(object): + def x(self): + if self._x: + self._x = 10 + return self._x + + Becomes:: + + class A(object): + @underscore_memoization + def x(self): + return 10 + + A now has an attribute ``_x`` written by this decorator. + """ + name = '_' + func.__name__ + + def wrapper(self): + try: + return getattr(self, name) + except AttributeError: + result = func(self) + setattr(self, name, result) + return result + + return wrapper + + +def clear_time_caches(delete_all=False): + """ Jedi caches many things, that should be completed after each completion + finishes. + + :param delete_all: Deletes also the cache that is normally not deleted, + like parser cache, which is important for faster parsing. + """ + global _time_caches + + if delete_all: + for cache in _time_caches.values(): + cache.clear() + parser_cache.clear() + else: + # normally just kill the expired entries, not all + for tc in _time_caches.values(): + # check time_cache for expired entries + for key, (t, value) in list(tc.items()): + if t < time.time(): + # delete expired entries + del tc[key] + + +def call_signature_time_cache(time_add_setting): + """ + This decorator works as follows: Call it with a setting and after that + use the function with a callable that returns the key. + But: This function is only called if the key is not available. After a + certain amount of time (`time_add_setting`) the cache is invalid. + + If the given key is None, the function will not be cached. + """ + def _temp(key_func): + dct = {} + _time_caches[time_add_setting] = dct + + def wrapper(*args, **kwargs): + generator = key_func(*args, **kwargs) + key = next(generator) + try: + expiry, value = dct[key] + if expiry > time.time(): + return value + except KeyError: + pass + + value = next(generator) + time_add = getattr(settings, time_add_setting) + if key is not None: + dct[key] = time.time() + time_add, value + return value + return wrapper + return _temp + + +def time_cache(seconds): + def decorator(func): + cache = {} + + @wraps(func) + def wrapper(*args, **kwargs): + key = (args, frozenset(kwargs.items())) + try: + created, result = cache[key] + if time.time() < created + seconds: + return result + except KeyError: + pass + result = func(*args, **kwargs) + cache[key] = time.time(), result + return result + + wrapper.clear_cache = lambda: cache.clear() + return wrapper + + return decorator + + +def memoize_method(method): + """A normal memoize function.""" + @wraps(method) + def wrapper(self, *args, **kwargs): + cache_dict = self.__dict__.setdefault('_memoize_method_dct', {}) + dct = cache_dict.setdefault(method, {}) + key = (args, frozenset(kwargs.items())) + try: + return dct[key] + except KeyError: + result = method(self, *args, **kwargs) + dct[key] = result + return result + return wrapper diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/common/__init__.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/common/__init__.py new file mode 100644 index 0000000..702a5e6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/common/__init__.py @@ -0,0 +1 @@ +from jedi.common.context import BaseContextSet, BaseContext diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/common/context.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/common/context.py new file mode 100644 index 0000000..92a5fe0 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/common/context.py @@ -0,0 +1,73 @@ +class BaseContext(object): + def __init__(self, evaluator, parent_context=None): + self.evaluator = evaluator + self.parent_context = parent_context + + def get_root_context(self): + context = self + while True: + if context.parent_context is None: + return context + context = context.parent_context + + +class BaseContextSet(object): + def __init__(self, iterable): + self._set = frozenset(iterable) + for context in iterable: + assert not isinstance(context, BaseContextSet) + + @classmethod + def _from_frozen_set(cls, frozenset_): + self = cls.__new__(cls) + self._set = frozenset_ + return self + + @classmethod + def from_sets(cls, sets): + """ + Used to work with an iterable of set. + """ + aggregated = set() + for set_ in sets: + if isinstance(set_, BaseContextSet): + aggregated |= set_._set + else: + aggregated |= frozenset(set_) + return cls._from_frozen_set(frozenset(aggregated)) + + def __or__(self, other): + return self._from_frozen_set(self._set | other._set) + + def __and__(self, other): + return self._from_frozen_set(self._set & other._set) + + def __iter__(self): + for element in self._set: + yield element + + def __bool__(self): + return bool(self._set) + + def __len__(self): + return len(self._set) + + def __repr__(self): + return 'S{%s}' % (', '.join(str(s) for s in self._set)) + + def filter(self, filter_func): + return self.__class__(filter(filter_func, self._set)) + + def __getattr__(self, name): + def mapper(*args, **kwargs): + return self.from_sets( + getattr(context, name)(*args, **kwargs) + for context in self._set + ) + return mapper + + def __eq__(self, other): + return self._set == other._set + + def __hash__(self): + return hash(self._set) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/common/utils.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/common/utils.py new file mode 100644 index 0000000..92ff52e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/common/utils.py @@ -0,0 +1,26 @@ +import os +from contextlib import contextmanager + + +def traverse_parents(path, include_current=False): + if not include_current: + path = os.path.dirname(path) + + previous = None + while previous != path: + yield path + previous = path + path = os.path.dirname(path) + + +@contextmanager +def monkeypatch(obj, attribute_name, new_value): + """ + Like pytest's monkeypatch, but as a context manager. + """ + old_value = getattr(obj, attribute_name) + try: + setattr(obj, attribute_name, new_value) + yield + finally: + setattr(obj, attribute_name, old_value) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/debug.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/debug.py new file mode 100644 index 0000000..4136acf --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/debug.py @@ -0,0 +1,143 @@ +import os +import time +from contextlib import contextmanager + +from jedi._compatibility import encoding, is_py3, u + +_inited = False + + +def _lazy_colorama_init(): + """ + Lazily init colorama if necessary, not to screw up stdout if debugging is + not enabled. + + This version of the function does nothing. + """ + + +try: + if os.name == 'nt': + # Does not work on Windows, as pyreadline and colorama interfere + raise ImportError + else: + # Use colorama for nicer console output. + from colorama import Fore, init + from colorama import initialise + + def _lazy_colorama_init(): # noqa: F811 + """ + Lazily init colorama if necessary, not to screw up stdout is + debug not enabled. + + This version of the function does init colorama. + """ + global _inited + if not _inited: + # pytest resets the stream at the end - causes troubles. Since + # after every output the stream is reset automatically we don't + # need this. + initialise.atexit_done = True + try: + init(strip=False) + except Exception: + # Colorama fails with initializing under vim and is buggy in + # version 0.3.6. + pass + _inited = True + +except ImportError: + class Fore(object): + RED = '' + GREEN = '' + YELLOW = '' + MAGENTA = '' + RESET = '' + BLUE = '' + +NOTICE = object() +WARNING = object() +SPEED = object() + +enable_speed = False +enable_warning = False +enable_notice = False + +# callback, interface: level, str +debug_function = None +_debug_indent = 0 +_start_time = time.time() + + +def reset_time(): + global _start_time, _debug_indent + _start_time = time.time() + _debug_indent = 0 + + +def increase_indent(func): + """Decorator for makin """ + def wrapper(*args, **kwargs): + with increase_indent_cm(): + return func(*args, **kwargs) + return wrapper + + +@contextmanager +def increase_indent_cm(title=None): + global _debug_indent + if title: + dbg('Start: ' + title, color='MAGENTA') + _debug_indent += 1 + try: + yield + finally: + _debug_indent -= 1 + if title: + dbg('End: ' + title, color='MAGENTA') + + +def dbg(message, *args, **kwargs): + """ Looks at the stack, to see if a debug message should be printed. """ + # Python 2 compatibility, because it doesn't understand default args + color = kwargs.pop('color', 'GREEN') + assert color + + if debug_function and enable_notice: + i = ' ' * _debug_indent + _lazy_colorama_init() + debug_function(color, i + 'dbg: ' + message % tuple(u(repr(a)) for a in args)) + + +def warning(message, *args, **kwargs): + format = kwargs.pop('format', True) + assert not kwargs + + if debug_function and enable_warning: + i = ' ' * _debug_indent + if format: + message = message % tuple(u(repr(a)) for a in args) + debug_function('RED', i + 'warning: ' + message) + + +def speed(name): + if debug_function and enable_speed: + now = time.time() + i = ' ' * _debug_indent + debug_function('YELLOW', i + 'speed: ' + '%s %s' % (name, now - _start_time)) + + +def print_to_stdout(color, str_out): + """ + The default debug function that prints to standard out. + + :param str color: A string that is an attribute of ``colorama.Fore``. + """ + col = getattr(Fore, color) + _lazy_colorama_init() + if not is_py3: + str_out = str_out.encode(encoding, 'replace') + print(col + str_out + Fore.RESET) + + +# debug_function = print_to_stdout diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/__init__.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/__init__.py new file mode 100644 index 0000000..a4f7e90 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/__init__.py @@ -0,0 +1,443 @@ +""" +Evaluation of Python code in |jedi| is based on three assumptions: + +* The code uses as least side effects as possible. Jedi understands certain + list/tuple/set modifications, but there's no guarantee that Jedi detects + everything (list.append in different modules for example). +* No magic is being used: + + - metaclasses + - ``setattr()`` / ``__import__()`` + - writing to ``globals()``, ``locals()``, ``object.__dict__`` +* The programmer is not a total dick, e.g. like `this + `_ :-) + +The actual algorithm is based on a principle called lazy evaluation. That +said, the typical entry point for static analysis is calling +``eval_expr_stmt``. There's separate logic for autocompletion in the API, the +evaluator is all about evaluating an expression. + +TODO this paragraph is not what jedi does anymore, it's similar, but not the +same. + +Now you need to understand what follows after ``eval_expr_stmt``. Let's +make an example:: + + import datetime + datetime.date.toda# <-- cursor here + +First of all, this module doesn't care about completion. It really just cares +about ``datetime.date``. At the end of the procedure ``eval_expr_stmt`` will +return the ``date`` class. + +To *visualize* this (simplified): + +- ``Evaluator.eval_expr_stmt`` doesn't do much, because there's no assignment. +- ``Context.eval_node`` cares for resolving the dotted path +- ``Evaluator.find_types`` searches for global definitions of datetime, which + it finds in the definition of an import, by scanning the syntax tree. +- Using the import logic, the datetime module is found. +- Now ``find_types`` is called again by ``eval_node`` to find ``date`` + inside the datetime module. + +Now what would happen if we wanted ``datetime.date.foo.bar``? Two more +calls to ``find_types``. However the second call would be ignored, because the +first one would return nothing (there's no foo attribute in ``date``). + +What if the import would contain another ``ExprStmt`` like this:: + + from foo import bar + Date = bar.baz + +Well... You get it. Just another ``eval_expr_stmt`` recursion. It's really +easy. Python can obviously get way more complicated then this. To understand +tuple assignments, list comprehensions and everything else, a lot more code had +to be written. + +Jedi has been tested very well, so you can just start modifying code. It's best +to write your own test first for your "new" feature. Don't be scared of +breaking stuff. As long as the tests pass, you're most likely to be fine. + +I need to mention now that lazy evaluation is really good because it +only *evaluates* what needs to be *evaluated*. All the statements and modules +that are not used are just being ignored. +""" +from parso.python import tree +import parso +from parso import python_bytes_to_unicode +from jedi.file_io import FileIO + +from jedi import debug +from jedi import parser_utils +from jedi.evaluate.utils import unite +from jedi.evaluate import imports +from jedi.evaluate import recursion +from jedi.evaluate.cache import evaluator_function_cache +from jedi.evaluate import helpers +from jedi.evaluate.names import TreeNameDefinition, ParamName +from jedi.evaluate.base_context import ContextualizedName, ContextualizedNode, \ + ContextSet, NO_CONTEXTS, iterate_contexts +from jedi.evaluate.context import ClassContext, FunctionContext, \ + AnonymousInstance, BoundMethod +from jedi.evaluate.context.iterable import CompForContext +from jedi.evaluate.syntax_tree import eval_trailer, eval_expr_stmt, \ + eval_node, check_tuple_assignments +from jedi.plugins import plugin_manager + + +class Evaluator(object): + def __init__(self, project, environment=None, script_path=None): + if environment is None: + environment = project.get_environment() + self.environment = environment + self.script_path = script_path + self.compiled_subprocess = environment.get_evaluator_subprocess(self) + self.grammar = environment.get_grammar() + + self.latest_grammar = parso.load_grammar(version='3.7') + self.memoize_cache = {} # for memoize decorators + self.module_cache = imports.ModuleCache() # does the job of `sys.modules`. + self.stub_module_cache = {} # Dict[Tuple[str, ...], Optional[ModuleContext]] + self.compiled_cache = {} # see `evaluate.compiled.create()` + self.inferred_element_counts = {} + self.mixed_cache = {} # see `evaluate.compiled.mixed._create()` + self.analysis = [] + self.dynamic_params_depth = 0 + self.is_analysis = False + self.project = project + self.access_cache = {} + self.allow_descriptor_getattr = False + + self.reset_recursion_limitations() + self.allow_different_encoding = True + + def import_module(self, import_names, parent_module_context=None, + sys_path=None, prefer_stubs=True): + if sys_path is None: + sys_path = self.get_sys_path() + return imports.import_module(self, import_names, parent_module_context, + sys_path, prefer_stubs=prefer_stubs) + + @staticmethod + @plugin_manager.decorate() + def execute(context, arguments): + debug.dbg('execute: %s %s', context, arguments) + with debug.increase_indent_cm(): + context_set = context.py__call__(arguments=arguments) + debug.dbg('execute result: %s in %s', context_set, context) + return context_set + + @property + @evaluator_function_cache() + def builtins_module(self): + module_name = u'builtins' + if self.environment.version_info.major == 2: + module_name = u'__builtin__' + builtins_module, = self.import_module((module_name,), sys_path=()) + return builtins_module + + @property + @evaluator_function_cache() + def typing_module(self): + typing_module, = self.import_module((u'typing',)) + return typing_module + + def reset_recursion_limitations(self): + self.recursion_detector = recursion.RecursionDetector() + self.execution_recursion_detector = recursion.ExecutionRecursionDetector(self) + + def get_sys_path(self, **kwargs): + """Convenience function""" + return self.project._get_sys_path(self, environment=self.environment, **kwargs) + + def eval_element(self, context, element): + if isinstance(context, CompForContext): + return eval_node(context, element) + + if_stmt = element + while if_stmt is not None: + if_stmt = if_stmt.parent + if if_stmt.type in ('if_stmt', 'for_stmt'): + break + if parser_utils.is_scope(if_stmt): + if_stmt = None + break + predefined_if_name_dict = context.predefined_names.get(if_stmt) + # TODO there's a lot of issues with this one. We actually should do + # this in a different way. Caching should only be active in certain + # cases and this all sucks. + if predefined_if_name_dict is None and if_stmt \ + and if_stmt.type == 'if_stmt' and self.is_analysis: + if_stmt_test = if_stmt.children[1] + name_dicts = [{}] + # If we already did a check, we don't want to do it again -> If + # context.predefined_names is filled, we stop. + # We don't want to check the if stmt itself, it's just about + # the content. + if element.start_pos > if_stmt_test.end_pos: + # Now we need to check if the names in the if_stmt match the + # names in the suite. + if_names = helpers.get_names_of_node(if_stmt_test) + element_names = helpers.get_names_of_node(element) + str_element_names = [e.value for e in element_names] + if any(i.value in str_element_names for i in if_names): + for if_name in if_names: + definitions = self.goto_definitions(context, if_name) + # Every name that has multiple different definitions + # causes the complexity to rise. The complexity should + # never fall below 1. + if len(definitions) > 1: + if len(name_dicts) * len(definitions) > 16: + debug.dbg('Too many options for if branch evaluation %s.', if_stmt) + # There's only a certain amount of branches + # Jedi can evaluate, otherwise it will take to + # long. + name_dicts = [{}] + break + + original_name_dicts = list(name_dicts) + name_dicts = [] + for definition in definitions: + new_name_dicts = list(original_name_dicts) + for i, name_dict in enumerate(new_name_dicts): + new_name_dicts[i] = name_dict.copy() + new_name_dicts[i][if_name.value] = ContextSet([definition]) + + name_dicts += new_name_dicts + else: + for name_dict in name_dicts: + name_dict[if_name.value] = definitions + if len(name_dicts) > 1: + result = NO_CONTEXTS + for name_dict in name_dicts: + with helpers.predefine_names(context, if_stmt, name_dict): + result |= eval_node(context, element) + return result + else: + return self._eval_element_if_evaluated(context, element) + else: + if predefined_if_name_dict: + return eval_node(context, element) + else: + return self._eval_element_if_evaluated(context, element) + + def _eval_element_if_evaluated(self, context, element): + """ + TODO This function is temporary: Merge with eval_element. + """ + parent = element + while parent is not None: + parent = parent.parent + predefined_if_name_dict = context.predefined_names.get(parent) + if predefined_if_name_dict is not None: + return eval_node(context, element) + return self._eval_element_cached(context, element) + + @evaluator_function_cache(default=NO_CONTEXTS) + def _eval_element_cached(self, context, element): + return eval_node(context, element) + + def goto_definitions(self, context, name): + def_ = name.get_definition(import_name_always=True) + if def_ is not None: + type_ = def_.type + is_classdef = type_ == 'classdef' + if is_classdef or type_ == 'funcdef': + if is_classdef: + c = ClassContext(self, context, name.parent) + else: + c = FunctionContext.from_context(context, name.parent) + return ContextSet([c]) + + if type_ == 'expr_stmt': + is_simple_name = name.parent.type not in ('power', 'trailer') + if is_simple_name: + return eval_expr_stmt(context, def_, name) + if type_ == 'for_stmt': + container_types = context.eval_node(def_.children[3]) + cn = ContextualizedNode(context, def_.children[3]) + for_types = iterate_contexts(container_types, cn) + c_node = ContextualizedName(context, name) + return check_tuple_assignments(self, c_node, for_types) + if type_ in ('import_from', 'import_name'): + return imports.infer_import(context, name) + else: + result = self._follow_error_node_imports_if_possible(context, name) + if result is not None: + return result + + return helpers.evaluate_call_of_leaf(context, name) + + def _follow_error_node_imports_if_possible(self, context, name): + error_node = tree.search_ancestor(name, 'error_node') + if error_node is not None: + # Get the first command start of a started simple_stmt. The error + # node is sometimes a small_stmt and sometimes a simple_stmt. Check + # for ; leaves that start a new statements. + start_index = 0 + for index, n in enumerate(error_node.children): + if n.start_pos > name.start_pos: + break + if n == ';': + start_index = index + 1 + nodes = error_node.children[start_index:] + first_name = nodes[0].get_first_leaf().value + + # Make it possible to infer stuff like `import foo.` or + # `from foo.bar`. + if first_name in ('from', 'import'): + is_import_from = first_name == 'from' + level, names = helpers.parse_dotted_names( + nodes, + is_import_from=is_import_from, + until_node=name, + ) + return imports.Importer(self, names, context.get_root_context(), level).follow() + return None + + def goto(self, context, name): + definition = name.get_definition(import_name_always=True) + if definition is not None: + type_ = definition.type + if type_ == 'expr_stmt': + # Only take the parent, because if it's more complicated than just + # a name it's something you can "goto" again. + is_simple_name = name.parent.type not in ('power', 'trailer') + if is_simple_name: + return [TreeNameDefinition(context, name)] + elif type_ == 'param': + return [ParamName(context, name)] + elif type_ in ('import_from', 'import_name'): + module_names = imports.infer_import(context, name, is_goto=True) + return module_names + else: + return [TreeNameDefinition(context, name)] + else: + contexts = self._follow_error_node_imports_if_possible(context, name) + if contexts is not None: + return [context.name for context in contexts] + + par = name.parent + node_type = par.type + if node_type == 'argument' and par.children[1] == '=' and par.children[0] == name: + # Named param goto. + trailer = par.parent + if trailer.type == 'arglist': + trailer = trailer.parent + if trailer.type != 'classdef': + if trailer.type == 'decorator': + context_set = context.eval_node(trailer.children[1]) + else: + i = trailer.parent.children.index(trailer) + to_evaluate = trailer.parent.children[:i] + if to_evaluate[0] == 'await': + to_evaluate.pop(0) + context_set = context.eval_node(to_evaluate[0]) + for trailer in to_evaluate[1:]: + context_set = eval_trailer(context, context_set, trailer) + param_names = [] + for context in context_set: + for signature in context.get_signatures(): + for param_name in signature.get_param_names(): + if param_name.string_name == name.value: + param_names.append(param_name) + return param_names + elif node_type == 'dotted_name': # Is a decorator. + index = par.children.index(name) + if index > 0: + new_dotted = helpers.deep_ast_copy(par) + new_dotted.children[index - 1:] = [] + values = context.eval_node(new_dotted) + return unite( + value.py__getattribute__(name, name_context=context, is_goto=True) + for value in values + ) + + if node_type == 'trailer' and par.children[0] == '.': + values = helpers.evaluate_call_of_leaf(context, name, cut_own_trailer=True) + return values.py__getattribute__(name, name_context=context, is_goto=True) + else: + stmt = tree.search_ancestor( + name, 'expr_stmt', 'lambdef' + ) or name + if stmt.type == 'lambdef': + stmt = name + return context.py__getattribute__( + name, + position=stmt.start_pos, + search_global=True, is_goto=True + ) + + def create_context(self, base_context, node, node_is_context=False, node_is_object=False): + def parent_scope(node): + while True: + node = node.parent + + if parser_utils.is_scope(node): + return node + elif node.type in ('argument', 'testlist_comp'): + if node.children[1].type in ('comp_for', 'sync_comp_for'): + return node.children[1] + elif node.type == 'dictorsetmaker': + for n in node.children[1:4]: + # In dictionaries it can be pretty much anything. + if n.type in ('comp_for', 'sync_comp_for'): + return n + + def from_scope_node(scope_node, is_nested=True, node_is_object=False): + if scope_node == base_node: + return base_context + + is_funcdef = scope_node.type in ('funcdef', 'lambdef') + parent_scope = parser_utils.get_parent_scope(scope_node) + parent_context = from_scope_node(parent_scope) + + if is_funcdef: + func = FunctionContext.from_context(parent_context, scope_node) + if parent_context.is_class(): + instance = AnonymousInstance( + self, parent_context.parent_context, parent_context) + func = BoundMethod( + instance=instance, + function=func + ) + + if is_nested and not node_is_object: + return func.get_function_execution() + return func + elif scope_node.type == 'classdef': + return ClassContext(self, parent_context, scope_node) + elif scope_node.type in ('comp_for', 'sync_comp_for'): + if node.start_pos >= scope_node.children[-1].start_pos: + return parent_context + return CompForContext.from_comp_for(parent_context, scope_node) + raise Exception("There's a scope that was not managed.") + + base_node = base_context.tree_node + + if node_is_context and parser_utils.is_scope(node): + scope_node = node + else: + scope_node = parent_scope(node) + if scope_node.type in ('funcdef', 'classdef'): + colon = scope_node.children[scope_node.children.index(':')] + if node.start_pos < colon.start_pos: + parent = node.parent + if not (parent.type == 'param' and parent.name == node): + scope_node = parent_scope(scope_node) + return from_scope_node(scope_node, is_nested=True, node_is_object=node_is_object) + + def parse_and_get_code(self, code=None, path=None, encoding='utf-8', + use_latest_grammar=False, file_io=None, **kwargs): + if self.allow_different_encoding: + if code is None: + if file_io is None: + file_io = FileIO(path) + code = file_io.read() + code = python_bytes_to_unicode(code, encoding=encoding, errors='replace') + + grammar = self.latest_grammar if use_latest_grammar else self.grammar + return grammar.parse(code=code, path=path, file_io=file_io, **kwargs), code + + def parse(self, *args, **kwargs): + return self.parse_and_get_code(*args, **kwargs)[0] diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/analysis.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/analysis.py new file mode 100644 index 0000000..47f1bbd --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/analysis.py @@ -0,0 +1,224 @@ +""" +Module for statical analysis. +""" +from parso.python import tree + +from jedi._compatibility import force_unicode +from jedi import debug +from jedi.evaluate.helpers import is_string + + +CODES = { + 'attribute-error': (1, AttributeError, 'Potential AttributeError.'), + 'name-error': (2, NameError, 'Potential NameError.'), + 'import-error': (3, ImportError, 'Potential ImportError.'), + 'type-error-too-many-arguments': (4, TypeError, None), + 'type-error-too-few-arguments': (5, TypeError, None), + 'type-error-keyword-argument': (6, TypeError, None), + 'type-error-multiple-values': (7, TypeError, None), + 'type-error-star-star': (8, TypeError, None), + 'type-error-star': (9, TypeError, None), + 'type-error-operation': (10, TypeError, None), + 'type-error-not-iterable': (11, TypeError, None), + 'type-error-isinstance': (12, TypeError, None), + 'type-error-not-subscriptable': (13, TypeError, None), + 'value-error-too-many-values': (14, ValueError, None), + 'value-error-too-few-values': (15, ValueError, None), +} + + +class Error(object): + def __init__(self, name, module_path, start_pos, message=None): + self.path = module_path + self._start_pos = start_pos + self.name = name + if message is None: + message = CODES[self.name][2] + self.message = message + + @property + def line(self): + return self._start_pos[0] + + @property + def column(self): + return self._start_pos[1] + + @property + def code(self): + # The class name start + first = self.__class__.__name__[0] + return first + str(CODES[self.name][0]) + + def __unicode__(self): + return '%s:%s:%s: %s %s' % (self.path, self.line, self.column, + self.code, self.message) + + def __str__(self): + return self.__unicode__() + + def __eq__(self, other): + return (self.path == other.path and self.name == other.name and + self._start_pos == other._start_pos) + + def __ne__(self, other): + return not self.__eq__(other) + + def __hash__(self): + return hash((self.path, self._start_pos, self.name)) + + def __repr__(self): + return '<%s %s: %s@%s,%s>' % (self.__class__.__name__, + self.name, self.path, + self._start_pos[0], self._start_pos[1]) + + +class Warning(Error): + pass + + +def add(node_context, error_name, node, message=None, typ=Error, payload=None): + exception = CODES[error_name][1] + if _check_for_exception_catch(node_context, node, exception, payload): + return + + # TODO this path is probably not right + module_context = node_context.get_root_context() + module_path = module_context.py__file__() + issue_instance = typ(error_name, module_path, node.start_pos, message) + debug.warning(str(issue_instance), format=False) + node_context.evaluator.analysis.append(issue_instance) + return issue_instance + + +def _check_for_setattr(instance): + """ + Check if there's any setattr method inside an instance. If so, return True. + """ + module = instance.get_root_context() + node = module.tree_node + if node is None: + # If it's a compiled module or doesn't have a tree_node + return False + + try: + stmt_names = node.get_used_names()['setattr'] + except KeyError: + return False + + return any(node.start_pos < n.start_pos < node.end_pos + # Check if it's a function called setattr. + and not (n.parent.type == 'funcdef' and n.parent.name == n) + for n in stmt_names) + + +def add_attribute_error(name_context, lookup_context, name): + message = ('AttributeError: %s has no attribute %s.' % (lookup_context, name)) + from jedi.evaluate.context.instance import CompiledInstanceName + # Check for __getattr__/__getattribute__ existance and issue a warning + # instead of an error, if that happens. + typ = Error + if lookup_context.is_instance() and not lookup_context.is_compiled(): + slot_names = lookup_context.get_function_slot_names(u'__getattr__') + \ + lookup_context.get_function_slot_names(u'__getattribute__') + for n in slot_names: + # TODO do we even get here? + if isinstance(name, CompiledInstanceName) and \ + n.parent_context.obj == object: + typ = Warning + break + + if _check_for_setattr(lookup_context): + typ = Warning + + payload = lookup_context, name + add(name_context, 'attribute-error', name, message, typ, payload) + + +def _check_for_exception_catch(node_context, jedi_name, exception, payload=None): + """ + Checks if a jedi object (e.g. `Statement`) sits inside a try/catch and + doesn't count as an error (if equal to `exception`). + Also checks `hasattr` for AttributeErrors and uses the `payload` to compare + it. + Returns True if the exception was catched. + """ + def check_match(cls, exception): + if not cls.is_class(): + return False + + for python_cls in exception.mro(): + if cls.py__name__() == python_cls.__name__ \ + and cls.parent_context == cls.evaluator.builtins_module: + return True + return False + + def check_try_for_except(obj, exception): + # Only nodes in try + iterator = iter(obj.children) + for branch_type in iterator: + colon = next(iterator) + suite = next(iterator) + if branch_type == 'try' \ + and not (branch_type.start_pos < jedi_name.start_pos <= suite.end_pos): + return False + + for node in obj.get_except_clause_tests(): + if node is None: + return True # An exception block that catches everything. + else: + except_classes = node_context.eval_node(node) + for cls in except_classes: + from jedi.evaluate.context import iterable + if isinstance(cls, iterable.Sequence) and \ + cls.array_type == 'tuple': + # multiple exceptions + for lazy_context in cls.py__iter__(): + for typ in lazy_context.infer(): + if check_match(typ, exception): + return True + else: + if check_match(cls, exception): + return True + + def check_hasattr(node, suite): + try: + assert suite.start_pos <= jedi_name.start_pos < suite.end_pos + assert node.type in ('power', 'atom_expr') + base = node.children[0] + assert base.type == 'name' and base.value == 'hasattr' + trailer = node.children[1] + assert trailer.type == 'trailer' + arglist = trailer.children[1] + assert arglist.type == 'arglist' + from jedi.evaluate.arguments import TreeArguments + args = list(TreeArguments(node_context.evaluator, node_context, arglist).unpack()) + # Arguments should be very simple + assert len(args) == 2 + + # Check name + key, lazy_context = args[1] + names = list(lazy_context.infer()) + assert len(names) == 1 and is_string(names[0]) + assert force_unicode(names[0].get_safe_value()) == payload[1].value + + # Check objects + key, lazy_context = args[0] + objects = lazy_context.infer() + return payload[0] in objects + except AssertionError: + return False + + obj = jedi_name + while obj is not None and not isinstance(obj, (tree.Function, tree.Class)): + if isinstance(obj, tree.Flow): + # try/except catch check + if obj.type == 'try_stmt' and check_try_for_except(obj, exception): + return True + # hasattr check + if exception == AttributeError and obj.type in ('if_stmt', 'while_stmt'): + if check_hasattr(obj.children[1], obj.children[3]): + return True + obj = obj.parent + + return False diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/arguments.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/arguments.py new file mode 100644 index 0000000..4e32653 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/arguments.py @@ -0,0 +1,382 @@ +import re + +from parso.python import tree + +from jedi._compatibility import zip_longest +from jedi import debug +from jedi.evaluate.utils import PushBackIterator +from jedi.evaluate import analysis +from jedi.evaluate.lazy_context import LazyKnownContext, LazyKnownContexts, \ + LazyTreeContext, get_merged_lazy_context +from jedi.evaluate.names import ParamName, TreeNameDefinition +from jedi.evaluate.base_context import NO_CONTEXTS, ContextSet, ContextualizedNode +from jedi.evaluate.context import iterable +from jedi.evaluate.cache import evaluator_as_method_param_cache +from jedi.evaluate.param import get_executed_params_and_issues, ExecutedParam + + +def try_iter_content(types, depth=0): + """Helper method for static analysis.""" + if depth > 10: + # It's possible that a loop has references on itself (especially with + # CompiledObject). Therefore don't loop infinitely. + return + + for typ in types: + try: + f = typ.py__iter__ + except AttributeError: + pass + else: + for lazy_context in f(): + try_iter_content(lazy_context.infer(), depth + 1) + + +class ParamIssue(Exception): + pass + + +def repack_with_argument_clinic(string, keep_arguments_param=False, keep_callback_param=False): + """ + Transforms a function or method with arguments to the signature that is + given as an argument clinic notation. + + Argument clinic is part of CPython and used for all the functions that are + implemented in C (Python 3.7): + + str.split.__text_signature__ + # Results in: '($self, /, sep=None, maxsplit=-1)' + """ + clinic_args = list(_parse_argument_clinic(string)) + + def decorator(func): + def wrapper(context, *args, **kwargs): + if keep_arguments_param: + arguments = kwargs['arguments'] + else: + arguments = kwargs.pop('arguments') + if not keep_arguments_param: + kwargs.pop('callback', None) + try: + args += tuple(_iterate_argument_clinic( + context.evaluator, + arguments, + clinic_args + )) + except ParamIssue: + return NO_CONTEXTS + else: + return func(context, *args, **kwargs) + + return wrapper + return decorator + + +def _iterate_argument_clinic(evaluator, arguments, parameters): + """Uses a list with argument clinic information (see PEP 436).""" + iterator = PushBackIterator(arguments.unpack()) + for i, (name, optional, allow_kwargs, stars) in enumerate(parameters): + if stars == 1: + lazy_contexts = [] + for key, argument in iterator: + if key is not None: + iterator.push_back((key, argument)) + break + + lazy_contexts.append(argument) + yield ContextSet([iterable.FakeSequence(evaluator, u'tuple', lazy_contexts)]) + lazy_contexts + continue + elif stars == 2: + raise NotImplementedError() + key, argument = next(iterator, (None, None)) + if key is not None: + debug.warning('Keyword arguments in argument clinic are currently not supported.') + raise ParamIssue + if argument is None and not optional: + debug.warning('TypeError: %s expected at least %s arguments, got %s', + name, len(parameters), i) + raise ParamIssue + + context_set = NO_CONTEXTS if argument is None else argument.infer() + + if not context_set and not optional: + # For the stdlib we always want values. If we don't get them, + # that's ok, maybe something is too hard to resolve, however, + # we will not proceed with the evaluation of that function. + debug.warning('argument_clinic "%s" not resolvable.', name) + raise ParamIssue + yield context_set + + +def _parse_argument_clinic(string): + allow_kwargs = False + optional = False + while string: + # Optional arguments have to begin with a bracket. And should always be + # at the end of the arguments. This is therefore not a proper argument + # clinic implementation. `range()` for exmple allows an optional start + # value at the beginning. + match = re.match(r'(?:(?:(\[),? ?|, ?|)(\**\w+)|, ?/)\]*', string) + string = string[len(match.group(0)):] + if not match.group(2): # A slash -> allow named arguments + allow_kwargs = True + continue + optional = optional or bool(match.group(1)) + word = match.group(2) + stars = word.count('*') + word = word[stars:] + yield (word, optional, allow_kwargs, stars) + if stars: + allow_kwargs = True + + +class _AbstractArgumentsMixin(object): + def eval_all(self, funcdef=None): + """ + Evaluates all arguments as a support for static analysis + (normally Jedi). + """ + for key, lazy_context in self.unpack(): + types = lazy_context.infer() + try_iter_content(types) + + def unpack(self, funcdef=None): + raise NotImplementedError + + def get_executed_params_and_issues(self, execution_context): + return get_executed_params_and_issues(execution_context, self) + + def get_calling_nodes(self): + return [] + + +class AbstractArguments(_AbstractArgumentsMixin): + context = None + argument_node = None + trailer = None + + +class AnonymousArguments(AbstractArguments): + def get_executed_params_and_issues(self, execution_context): + from jedi.evaluate.dynamic import search_params + return search_params( + execution_context.evaluator, + execution_context, + execution_context.tree_node + ), [] + + def __repr__(self): + return '%s()' % self.__class__.__name__ + + +def unpack_arglist(arglist): + if arglist is None: + return + + # Allow testlist here as well for Python2's class inheritance + # definitions. + if not (arglist.type in ('arglist', 'testlist') or ( + # in python 3.5 **arg is an argument, not arglist + (arglist.type == 'argument') and + arglist.children[0] in ('*', '**'))): + yield 0, arglist + return + + iterator = iter(arglist.children) + for child in iterator: + if child == ',': + continue + elif child in ('*', '**'): + yield len(child.value), next(iterator) + elif child.type == 'argument' and \ + child.children[0] in ('*', '**'): + assert len(child.children) == 2 + yield len(child.children[0].value), child.children[1] + else: + yield 0, child + + +class TreeArguments(AbstractArguments): + def __init__(self, evaluator, context, argument_node, trailer=None): + """ + The argument_node is either a parser node or a list of evaluated + objects. Those evaluated objects may be lists of evaluated objects + themselves (one list for the first argument, one for the second, etc). + + :param argument_node: May be an argument_node or a list of nodes. + """ + self.argument_node = argument_node + self.context = context + self._evaluator = evaluator + self.trailer = trailer # Can be None, e.g. in a class definition. + + @classmethod + @evaluator_as_method_param_cache() + def create_cached(cls, *args, **kwargs): + return cls(*args, **kwargs) + + def unpack(self, funcdef=None): + named_args = [] + for star_count, el in unpack_arglist(self.argument_node): + if star_count == 1: + arrays = self.context.eval_node(el) + iterators = [_iterate_star_args(self.context, a, el, funcdef) + for a in arrays] + for values in list(zip_longest(*iterators)): + # TODO zip_longest yields None, that means this would raise + # an exception? + yield None, get_merged_lazy_context( + [v for v in values if v is not None] + ) + elif star_count == 2: + arrays = self.context.eval_node(el) + for dct in arrays: + for key, values in _star_star_dict(self.context, dct, el, funcdef): + yield key, values + else: + if el.type == 'argument': + c = el.children + if len(c) == 3: # Keyword argument. + named_args.append((c[0].value, LazyTreeContext(self.context, c[2]),)) + else: # Generator comprehension. + # Include the brackets with the parent. + sync_comp_for = el.children[1] + if sync_comp_for.type == 'comp_for': + sync_comp_for = sync_comp_for.children[1] + comp = iterable.GeneratorComprehension( + self._evaluator, + defining_context=self.context, + sync_comp_for_node=sync_comp_for, + entry_node=el.children[0], + ) + yield None, LazyKnownContext(comp) + else: + yield None, LazyTreeContext(self.context, el) + + # Reordering arguments is necessary, because star args sometimes appear + # after named argument, but in the actual order it's prepended. + for named_arg in named_args: + yield named_arg + + def _as_tree_tuple_objects(self): + for star_count, argument in unpack_arglist(self.argument_node): + default = None + if argument.type == 'argument': + if len(argument.children) == 3: # Keyword argument. + argument, default = argument.children[::2] + yield argument, default, star_count + + def iter_calling_names_with_star(self): + for name, default, star_count in self._as_tree_tuple_objects(): + # TODO this function is a bit strange. probably refactor? + if not star_count or not isinstance(name, tree.Name): + continue + + yield TreeNameDefinition(self.context, name) + + def __repr__(self): + return '<%s: %s>' % (self.__class__.__name__, self.argument_node) + + def get_calling_nodes(self): + from jedi.evaluate.dynamic import DynamicExecutedParams + old_arguments_list = [] + arguments = self + + while arguments not in old_arguments_list: + if not isinstance(arguments, TreeArguments): + break + + old_arguments_list.append(arguments) + for calling_name in reversed(list(arguments.iter_calling_names_with_star())): + names = calling_name.goto() + if len(names) != 1: + break + if not isinstance(names[0], ParamName): + break + param = names[0].get_param() + if isinstance(param, DynamicExecutedParams): + # For dynamic searches we don't even want to see errors. + return [] + if not isinstance(param, ExecutedParam): + break + if param.var_args is None: + break + arguments = param.var_args + break + + if arguments.argument_node is not None: + return [ContextualizedNode(arguments.context, arguments.argument_node)] + if arguments.trailer is not None: + return [ContextualizedNode(arguments.context, arguments.trailer)] + return [] + + +class ValuesArguments(AbstractArguments): + def __init__(self, values_list): + self._values_list = values_list + + def unpack(self, funcdef=None): + for values in self._values_list: + yield None, LazyKnownContexts(values) + + def __repr__(self): + return '<%s: %s>' % (self.__class__.__name__, self._values_list) + + +class TreeArgumentsWrapper(_AbstractArgumentsMixin): + def __init__(self, arguments): + self._wrapped_arguments = arguments + + @property + def context(self): + return self._wrapped_arguments.context + + @property + def argument_node(self): + return self._wrapped_arguments.argument_node + + @property + def trailer(self): + return self._wrapped_arguments.trailer + + def unpack(self, func=None): + raise NotImplementedError + + def get_calling_nodes(self): + return self._wrapped_arguments.get_calling_nodes() + + def __repr__(self): + return '<%s: %s>' % (self.__class__.__name__, self._wrapped_arguments) + + +def _iterate_star_args(context, array, input_node, funcdef=None): + if not array.py__getattribute__('__iter__'): + if funcdef is not None: + # TODO this funcdef should not be needed. + m = "TypeError: %s() argument after * must be a sequence, not %s" \ + % (funcdef.name.value, array) + analysis.add(context, 'type-error-star', input_node, message=m) + try: + iter_ = array.py__iter__ + except AttributeError: + pass + else: + for lazy_context in iter_(): + yield lazy_context + + +def _star_star_dict(context, array, input_node, funcdef): + from jedi.evaluate.context.instance import CompiledInstance + if isinstance(array, CompiledInstance) and array.name.string_name == 'dict': + # For now ignore this case. In the future add proper iterators and just + # make one call without crazy isinstance checks. + return {} + elif isinstance(array, iterable.Sequence) and array.array_type == 'dict': + return array.exact_key_items() + else: + if funcdef is not None: + m = "TypeError: %s argument after ** must be a mapping, not %s" \ + % (funcdef.name.value, array) + analysis.add(context, 'type-error-star-star', input_node, message=m) + return {} diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/base_context.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/base_context.py new file mode 100644 index 0000000..8a03248 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/base_context.py @@ -0,0 +1,436 @@ +""" +Contexts are the "values" that Python would return. However Contexts are at the +same time also the "contexts" that a user is currently sitting in. + +A ContextSet is typically used to specify the return of a function or any other +static analysis operation. In jedi there are always multiple returns and not +just one. +""" +from functools import reduce +from operator import add +from parso.python.tree import ExprStmt, SyncCompFor + +from jedi import debug +from jedi._compatibility import zip_longest, unicode +from jedi.parser_utils import clean_scope_docstring +from jedi.common import BaseContextSet, BaseContext +from jedi.evaluate.helpers import SimpleGetItemNotFound +from jedi.evaluate.utils import safe_property +from jedi.evaluate.cache import evaluator_as_method_param_cache +from jedi.cache import memoize_method + +_sentinel = object() + + +class HelperContextMixin(object): + def get_root_context(self): + context = self + while True: + if context.parent_context is None: + return context + context = context.parent_context + + @classmethod + @evaluator_as_method_param_cache() + def create_cached(cls, *args, **kwargs): + return cls(*args, **kwargs) + + def execute(self, arguments): + return self.evaluator.execute(self, arguments=arguments) + + def execute_evaluated(self, *value_list): + from jedi.evaluate.arguments import ValuesArguments + arguments = ValuesArguments([ContextSet([value]) for value in value_list]) + return self.evaluator.execute(self, arguments) + + def execute_annotation(self): + return self.execute_evaluated() + + def gather_annotation_classes(self): + return ContextSet([self]) + + def merge_types_of_iterate(self, contextualized_node=None, is_async=False): + return ContextSet.from_sets( + lazy_context.infer() + for lazy_context in self.iterate(contextualized_node, is_async) + ) + + def py__getattribute__(self, name_or_str, name_context=None, position=None, + search_global=False, is_goto=False, + analysis_errors=True): + """ + :param position: Position of the last statement -> tuple of line, column + """ + if name_context is None: + name_context = self + from jedi.evaluate import finder + f = finder.NameFinder(self.evaluator, self, name_context, name_or_str, + position, analysis_errors=analysis_errors) + filters = f.get_filters(search_global) + if is_goto: + return f.filter_name(filters) + return f.find(filters, attribute_lookup=not search_global) + + def py__await__(self): + await_context_set = self.py__getattribute__(u"__await__") + if not await_context_set: + debug.warning('Tried to run __await__ on context %s', self) + return await_context_set.execute_evaluated() + + def eval_node(self, node): + return self.evaluator.eval_element(self, node) + + def create_context(self, node, node_is_context=False, node_is_object=False): + return self.evaluator.create_context(self, node, node_is_context, node_is_object) + + def iterate(self, contextualized_node=None, is_async=False): + debug.dbg('iterate %s', self) + if is_async: + from jedi.evaluate.lazy_context import LazyKnownContexts + # TODO if no __aiter__ contexts are there, error should be: + # TypeError: 'async for' requires an object with __aiter__ method, got int + return iter([ + LazyKnownContexts( + self.py__getattribute__('__aiter__').execute_evaluated() + .py__getattribute__('__anext__').execute_evaluated() + .py__getattribute__('__await__').execute_evaluated() + .py__stop_iteration_returns() + ) # noqa + ]) + return self.py__iter__(contextualized_node) + + def is_sub_class_of(self, class_context): + for cls in self.py__mro__(): + if cls.is_same_class(class_context): + return True + return False + + def is_same_class(self, class2): + # Class matching should prefer comparisons that are not this function. + if type(class2).is_same_class != HelperContextMixin.is_same_class: + return class2.is_same_class(self) + return self == class2 + + +class Context(HelperContextMixin, BaseContext): + """ + Should be defined, otherwise the API returns empty types. + """ + predefined_names = {} + """ + To be defined by subclasses. + """ + tree_node = None + + @property + def api_type(self): + # By default just lower name of the class. Can and should be + # overwritten. + return self.__class__.__name__.lower() + + def py__getitem__(self, index_context_set, contextualized_node): + from jedi.evaluate import analysis + # TODO this context is probably not right. + analysis.add( + contextualized_node.context, + 'type-error-not-subscriptable', + contextualized_node.node, + message="TypeError: '%s' object is not subscriptable" % self + ) + return NO_CONTEXTS + + def py__iter__(self, contextualized_node=None): + if contextualized_node is not None: + from jedi.evaluate import analysis + analysis.add( + contextualized_node.context, + 'type-error-not-iterable', + contextualized_node.node, + message="TypeError: '%s' object is not iterable" % self) + return iter([]) + + def get_signatures(self): + return [] + + def is_class(self): + return False + + def is_instance(self): + return False + + def is_function(self): + return False + + def is_module(self): + return False + + def is_namespace(self): + return False + + def is_compiled(self): + return False + + def is_bound_method(self): + return False + + def py__bool__(self): + """ + Since Wrapper is a super class for classes, functions and modules, + the return value will always be true. + """ + return True + + def py__doc__(self): + try: + self.tree_node.get_doc_node + except AttributeError: + return '' + else: + return clean_scope_docstring(self.tree_node) + return None + + def get_safe_value(self, default=_sentinel): + if default is _sentinel: + raise ValueError("There exists no safe value for context %s" % self) + return default + + def py__call__(self, arguments): + debug.warning("no execution possible %s", self) + return NO_CONTEXTS + + def py__stop_iteration_returns(self): + debug.warning("Not possible to return the stop iterations of %s", self) + return NO_CONTEXTS + + def get_qualified_names(self): + # Returns Optional[Tuple[str, ...]] + return None + + def is_stub(self): + # The root context knows if it's a stub or not. + return self.parent_context.is_stub() + + +def iterate_contexts(contexts, contextualized_node=None, is_async=False): + """ + Calls `iterate`, on all contexts but ignores the ordering and just returns + all contexts that the iterate functions yield. + """ + return ContextSet.from_sets( + lazy_context.infer() + for lazy_context in contexts.iterate(contextualized_node, is_async=is_async) + ) + + +class _ContextWrapperBase(HelperContextMixin): + predefined_names = {} + + @safe_property + def name(self): + from jedi.evaluate.names import ContextName + wrapped_name = self._wrapped_context.name + if wrapped_name.tree_name is not None: + return ContextName(self, wrapped_name.tree_name) + else: + from jedi.evaluate.compiled import CompiledContextName + return CompiledContextName(self, wrapped_name.string_name) + + @classmethod + @evaluator_as_method_param_cache() + def create_cached(cls, evaluator, *args, **kwargs): + return cls(*args, **kwargs) + + def __getattr__(self, name): + assert name != '_wrapped_context', 'Problem with _get_wrapped_context' + return getattr(self._wrapped_context, name) + + +class LazyContextWrapper(_ContextWrapperBase): + @safe_property + @memoize_method + def _wrapped_context(self): + with debug.increase_indent_cm('Resolve lazy context wrapper'): + return self._get_wrapped_context() + + def __repr__(self): + return '<%s>' % (self.__class__.__name__) + + def _get_wrapped_context(self): + raise NotImplementedError + + +class ContextWrapper(_ContextWrapperBase): + def __init__(self, wrapped_context): + self._wrapped_context = wrapped_context + + def __repr__(self): + return '%s(%s)' % (self.__class__.__name__, self._wrapped_context) + + +class TreeContext(Context): + def __init__(self, evaluator, parent_context, tree_node): + super(TreeContext, self).__init__(evaluator, parent_context) + self.predefined_names = {} + self.tree_node = tree_node + + def __repr__(self): + return '<%s: %s>' % (self.__class__.__name__, self.tree_node) + + +class ContextualizedNode(object): + def __init__(self, context, node): + self.context = context + self.node = node + + def get_root_context(self): + return self.context.get_root_context() + + def infer(self): + return self.context.eval_node(self.node) + + def __repr__(self): + return '<%s: %s in %s>' % (self.__class__.__name__, self.node, self.context) + + +class ContextualizedName(ContextualizedNode): + # TODO merge with TreeNameDefinition?! + @property + def name(self): + return self.node + + def assignment_indexes(self): + """ + Returns an array of tuple(int, node) of the indexes that are used in + tuple assignments. + + For example if the name is ``y`` in the following code:: + + x, (y, z) = 2, '' + + would result in ``[(1, xyz_node), (0, yz_node)]``. + + When searching for b in the case ``a, *b, c = [...]`` it will return:: + + [(slice(1, -1), abc_node)] + """ + indexes = [] + is_star_expr = False + node = self.node.parent + compare = self.node + while node is not None: + if node.type in ('testlist', 'testlist_comp', 'testlist_star_expr', 'exprlist'): + for i, child in enumerate(node.children): + if child == compare: + index = int(i / 2) + if is_star_expr: + from_end = int((len(node.children) - i) / 2) + index = slice(index, -from_end) + indexes.insert(0, (index, node)) + break + else: + raise LookupError("Couldn't find the assignment.") + is_star_expr = False + elif node.type == 'star_expr': + is_star_expr = True + elif isinstance(node, (ExprStmt, SyncCompFor)): + break + + compare = node + node = node.parent + return indexes + + +def _getitem(context, index_contexts, contextualized_node): + from jedi.evaluate.context.iterable import Slice + + # The actual getitem call. + simple_getitem = getattr(context, 'py__simple_getitem__', None) + + result = NO_CONTEXTS + unused_contexts = set() + for index_context in index_contexts: + if simple_getitem is not None: + index = index_context + if isinstance(index_context, Slice): + index = index.obj + + try: + method = index.get_safe_value + except AttributeError: + pass + else: + index = method(default=None) + + if type(index) in (float, int, str, unicode, slice, bytes): + try: + result |= simple_getitem(index) + continue + except SimpleGetItemNotFound: + pass + + unused_contexts.add(index_context) + + # The index was somehow not good enough or simply a wrong type. + # Therefore we now iterate through all the contexts and just take + # all results. + if unused_contexts or not index_contexts: + result |= context.py__getitem__( + ContextSet(unused_contexts), + contextualized_node + ) + debug.dbg('py__getitem__ result: %s', result) + return result + + +class ContextSet(BaseContextSet): + def py__class__(self): + return ContextSet(c.py__class__() for c in self._set) + + def iterate(self, contextualized_node=None, is_async=False): + from jedi.evaluate.lazy_context import get_merged_lazy_context + type_iters = [c.iterate(contextualized_node, is_async=is_async) for c in self._set] + for lazy_contexts in zip_longest(*type_iters): + yield get_merged_lazy_context( + [l for l in lazy_contexts if l is not None] + ) + + def execute(self, arguments): + return ContextSet.from_sets(c.evaluator.execute(c, arguments) for c in self._set) + + def execute_evaluated(self, *args, **kwargs): + return ContextSet.from_sets(c.execute_evaluated(*args, **kwargs) for c in self._set) + + def py__getattribute__(self, *args, **kwargs): + if kwargs.get('is_goto'): + return reduce(add, [c.py__getattribute__(*args, **kwargs) for c in self._set], []) + return ContextSet.from_sets(c.py__getattribute__(*args, **kwargs) for c in self._set) + + def get_item(self, *args, **kwargs): + return ContextSet.from_sets(_getitem(c, *args, **kwargs) for c in self._set) + + def try_merge(self, function_name): + context_set = self.__class__([]) + for c in self._set: + try: + method = getattr(c, function_name) + except AttributeError: + pass + else: + context_set |= method() + return context_set + + def gather_annotation_classes(self): + return ContextSet.from_sets([c.gather_annotation_classes() for c in self._set]) + + def get_signatures(self): + return [sig for c in self._set for sig in c.get_signatures()] + + +NO_CONTEXTS = ContextSet([]) + + +def iterator_to_context_set(func): + def wrapper(*args, **kwargs): + return ContextSet(func(*args, **kwargs)) + + return wrapper diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/cache.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/cache.py new file mode 100644 index 0000000..e865a0d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/cache.py @@ -0,0 +1,123 @@ +""" +- the popular ``_memoize_default`` works like a typical memoize and returns the + default otherwise. +- ``CachedMetaClass`` uses ``_memoize_default`` to do the same with classes. +""" + +from jedi import debug + +_NO_DEFAULT = object() +_RECURSION_SENTINEL = object() + + +def _memoize_default(default=_NO_DEFAULT, evaluator_is_first_arg=False, second_arg_is_evaluator=False): + """ This is a typical memoization decorator, BUT there is one difference: + To prevent recursion it sets defaults. + + Preventing recursion is in this case the much bigger use than speed. I + don't think, that there is a big speed difference, but there are many cases + where recursion could happen (think about a = b; b = a). + """ + def func(function): + def wrapper(obj, *args, **kwargs): + # TODO These checks are kind of ugly and slow. + if evaluator_is_first_arg: + cache = obj.memoize_cache + elif second_arg_is_evaluator: + cache = args[0].memoize_cache # needed for meta classes + else: + cache = obj.evaluator.memoize_cache + + try: + memo = cache[function] + except KeyError: + cache[function] = memo = {} + + key = (obj, args, frozenset(kwargs.items())) + if key in memo: + return memo[key] + else: + if default is not _NO_DEFAULT: + memo[key] = default + rv = function(obj, *args, **kwargs) + memo[key] = rv + return rv + return wrapper + + return func + + +def evaluator_function_cache(default=_NO_DEFAULT): + def decorator(func): + return _memoize_default(default=default, evaluator_is_first_arg=True)(func) + + return decorator + + +def evaluator_method_cache(default=_NO_DEFAULT): + def decorator(func): + return _memoize_default(default=default)(func) + + return decorator + + +def evaluator_as_method_param_cache(): + def decorator(call): + return _memoize_default(second_arg_is_evaluator=True)(call) + + return decorator + + +class CachedMetaClass(type): + """ + This is basically almost the same than the decorator above, it just caches + class initializations. Either you do it this way or with decorators, but + with decorators you lose class access (isinstance, etc). + """ + @evaluator_as_method_param_cache() + def __call__(self, *args, **kwargs): + return super(CachedMetaClass, self).__call__(*args, **kwargs) + + +def evaluator_method_generator_cache(): + """ + This is a special memoizer. It memoizes generators and also checks for + recursion errors and returns no further iterator elemends in that case. + """ + def func(function): + def wrapper(obj, *args, **kwargs): + cache = obj.evaluator.memoize_cache + try: + memo = cache[function] + except KeyError: + cache[function] = memo = {} + + key = (obj, args, frozenset(kwargs.items())) + + if key in memo: + actual_generator, cached_lst = memo[key] + else: + actual_generator = function(obj, *args, **kwargs) + cached_lst = [] + memo[key] = actual_generator, cached_lst + + i = 0 + while True: + try: + next_element = cached_lst[i] + if next_element is _RECURSION_SENTINEL: + debug.warning('Found a generator recursion for %s' % obj) + # This means we have hit a recursion. + return + except IndexError: + cached_lst.append(_RECURSION_SENTINEL) + next_element = next(actual_generator, None) + if next_element is None: + cached_lst.pop() + return + cached_lst[-1] = next_element + yield next_element + i += 1 + return wrapper + + return func diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/compiled/__init__.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/compiled/__init__.py new file mode 100644 index 0000000..cfda727 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/compiled/__init__.py @@ -0,0 +1,64 @@ +from jedi._compatibility import unicode +from jedi.evaluate.compiled.context import CompiledObject, CompiledName, \ + CompiledObjectFilter, CompiledContextName, create_from_access_path +from jedi.evaluate.base_context import ContextWrapper, LazyContextWrapper + + +def builtin_from_name(evaluator, string): + typing_builtins_module = evaluator.builtins_module + if string in ('None', 'True', 'False'): + builtins, = typing_builtins_module.non_stub_context_set + filter_ = next(builtins.get_filters()) + else: + filter_ = next(typing_builtins_module.get_filters()) + name, = filter_.get(string) + context, = name.infer() + return context + + +class CompiledValue(LazyContextWrapper): + def __init__(self, compiled_obj): + self.evaluator = compiled_obj.evaluator + self._compiled_obj = compiled_obj + + def __getattribute__(self, name): + if name in ('get_safe_value', 'execute_operation', 'access_handle', + 'negate', 'py__bool__', 'is_compiled'): + return getattr(self._compiled_obj, name) + return super(CompiledValue, self).__getattribute__(name) + + def _get_wrapped_context(self): + instance, = builtin_from_name( + self.evaluator, self._compiled_obj.name.string_name).execute_evaluated() + return instance + + def __repr__(self): + return '<%s: %s>' % (self.__class__.__name__, self._compiled_obj) + + +def create_simple_object(evaluator, obj): + """ + Only allows creations of objects that are easily picklable across Python + versions. + """ + assert type(obj) in (int, float, str, bytes, unicode, slice, complex, bool), obj + compiled_obj = create_from_access_path( + evaluator, + evaluator.compiled_subprocess.create_simple_object(obj) + ) + return CompiledValue(compiled_obj) + + +def get_string_context_set(evaluator): + return builtin_from_name(evaluator, u'str').execute_evaluated() + + +def load_module(evaluator, dotted_name, **kwargs): + # Temporary, some tensorflow builtins cannot be loaded, so it's tried again + # and again and it's really slow. + if dotted_name.startswith('tensorflow.'): + return None + access_path = evaluator.compiled_subprocess.load_module(dotted_name=dotted_name, **kwargs) + if access_path is None: + return None + return create_from_access_path(evaluator, access_path) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/compiled/access.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/compiled/access.py new file mode 100644 index 0000000..18aacf5 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/compiled/access.py @@ -0,0 +1,497 @@ +from __future__ import print_function +import inspect +import types +import sys +import operator as op +from collections import namedtuple + +from jedi._compatibility import unicode, is_py3, builtins, \ + py_version, force_unicode +from jedi.evaluate.compiled.getattr_static import getattr_static + +ALLOWED_GETITEM_TYPES = (str, list, tuple, unicode, bytes, bytearray, dict) + +MethodDescriptorType = type(str.replace) +# These are not considered classes and access is granted even though they have +# a __class__ attribute. +NOT_CLASS_TYPES = ( + types.BuiltinFunctionType, + types.CodeType, + types.FrameType, + types.FunctionType, + types.GeneratorType, + types.GetSetDescriptorType, + types.LambdaType, + types.MemberDescriptorType, + types.MethodType, + types.ModuleType, + types.TracebackType, + MethodDescriptorType +) + +if is_py3: + NOT_CLASS_TYPES += ( + types.MappingProxyType, + types.SimpleNamespace, + types.DynamicClassAttribute, + ) + + +# Those types don't exist in typing. +MethodDescriptorType = type(str.replace) +WrapperDescriptorType = type(set.__iter__) +# `object.__subclasshook__` is an already executed descriptor. +object_class_dict = type.__dict__["__dict__"].__get__(object) +ClassMethodDescriptorType = type(object_class_dict['__subclasshook__']) + +_sentinel = object() + +# Maps Python syntax to the operator module. +COMPARISON_OPERATORS = { + '==': op.eq, + '!=': op.ne, + 'is': op.is_, + 'is not': op.is_not, + '<': op.lt, + '<=': op.le, + '>': op.gt, + '>=': op.ge, +} + +_OPERATORS = { + '+': op.add, + '-': op.sub, +} +_OPERATORS.update(COMPARISON_OPERATORS) + +ALLOWED_DESCRIPTOR_ACCESS = ( + types.FunctionType, + types.GetSetDescriptorType, + types.MemberDescriptorType, + MethodDescriptorType, + WrapperDescriptorType, + ClassMethodDescriptorType, + staticmethod, + classmethod, +) + + +def safe_getattr(obj, name, default=_sentinel): + try: + attr, is_get_descriptor = getattr_static(obj, name) + except AttributeError: + if default is _sentinel: + raise + return default + else: + if isinstance(attr, ALLOWED_DESCRIPTOR_ACCESS): + # In case of descriptors that have get methods we cannot return + # it's value, because that would mean code execution. + # Since it's an isinstance call, code execution is still possible, + # but this is not really a security feature, but much more of a + # safety feature. Code execution is basically always possible when + # a module is imported. This is here so people don't shoot + # themselves in the foot. + return getattr(obj, name) + return attr + + +SignatureParam = namedtuple( + 'SignatureParam', + 'name has_default default default_string has_annotation annotation annotation_string kind_name' +) + + +def compiled_objects_cache(attribute_name): + def decorator(func): + """ + This decorator caches just the ids, oopposed to caching the object itself. + Caching the id has the advantage that an object doesn't need to be + hashable. + """ + def wrapper(evaluator, obj, parent_context=None): + cache = getattr(evaluator, attribute_name) + # Do a very cheap form of caching here. + key = id(obj) + try: + cache[key] + return cache[key][0] + except KeyError: + # TODO wuaaaarrghhhhhhhh + if attribute_name == 'mixed_cache': + result = func(evaluator, obj, parent_context) + else: + result = func(evaluator, obj) + # Need to cache all of them, otherwise the id could be overwritten. + cache[key] = result, obj, parent_context + return result + return wrapper + + return decorator + + +def create_access(evaluator, obj): + return evaluator.compiled_subprocess.get_or_create_access_handle(obj) + + +def load_module(evaluator, dotted_name, sys_path): + temp, sys.path = sys.path, sys_path + try: + __import__(dotted_name) + except ImportError: + # If a module is "corrupt" or not really a Python module or whatever. + print('Module %s not importable in path %s.' % (dotted_name, sys_path), file=sys.stderr) + return None + except Exception: + # Since __import__ pretty much makes code execution possible, just + # catch any error here and print it. + import traceback + print("Cannot import:\n%s" % traceback.format_exc(), file=sys.stderr) + return None + finally: + sys.path = temp + + # Just access the cache after import, because of #59 as well as the very + # complicated import structure of Python. + module = sys.modules[dotted_name] + return create_access_path(evaluator, module) + + +class AccessPath(object): + def __init__(self, accesses): + self.accesses = accesses + + # Writing both of these methods here looks a bit ridiculous. However with + # the differences of Python 2/3 it's actually necessary, because we will + # otherwise have a accesses attribute that is bytes instead of unicode. + def __getstate__(self): + return self.accesses + + def __setstate__(self, value): + self.accesses = value + + +def create_access_path(evaluator, obj): + access = create_access(evaluator, obj) + return AccessPath(access.get_access_path_tuples()) + + +def _force_unicode_decorator(func): + return lambda *args, **kwargs: force_unicode(func(*args, **kwargs)) + + +def get_api_type(obj): + if inspect.isclass(obj): + return u'class' + elif inspect.ismodule(obj): + return u'module' + elif inspect.isbuiltin(obj) or inspect.ismethod(obj) \ + or inspect.ismethoddescriptor(obj) or inspect.isfunction(obj): + return u'function' + # Everything else... + return u'instance' + + +class DirectObjectAccess(object): + def __init__(self, evaluator, obj): + self._evaluator = evaluator + self._obj = obj + + def __repr__(self): + return '%s(%s)' % (self.__class__.__name__, self.get_repr()) + + def _create_access(self, obj): + return create_access(self._evaluator, obj) + + def _create_access_path(self, obj): + return create_access_path(self._evaluator, obj) + + def py__bool__(self): + return bool(self._obj) + + def py__file__(self): + try: + return self._obj.__file__ + except AttributeError: + return None + + def py__doc__(self): + return force_unicode(inspect.getdoc(self._obj)) or u'' + + def py__name__(self): + if not _is_class_instance(self._obj) or \ + inspect.ismethoddescriptor(self._obj): # slots + cls = self._obj + else: + try: + cls = self._obj.__class__ + except AttributeError: + # happens with numpy.core.umath._UFUNC_API (you get it + # automatically by doing `import numpy`. + return None + + try: + return force_unicode(cls.__name__) + except AttributeError: + return None + + def py__mro__accesses(self): + return tuple(self._create_access_path(cls) for cls in self._obj.__mro__[1:]) + + def py__getitem__all_values(self): + if isinstance(self._obj, dict): + return [self._create_access_path(v) for v in self._obj.values()] + return self.py__iter__list() + + def py__simple_getitem__(self, index): + if type(self._obj) not in ALLOWED_GETITEM_TYPES: + # Get rid of side effects, we won't call custom `__getitem__`s. + return None + + return self._create_access_path(self._obj[index]) + + def py__iter__list(self): + if not hasattr(self._obj, '__getitem__'): + return None + + if type(self._obj) not in ALLOWED_GETITEM_TYPES: + # Get rid of side effects, we won't call custom `__getitem__`s. + return [] + + lst = [] + for i, part in enumerate(self._obj): + if i > 20: + # Should not go crazy with large iterators + break + lst.append(self._create_access_path(part)) + return lst + + def py__class__(self): + return self._create_access_path(self._obj.__class__) + + def py__bases__(self): + return [self._create_access_path(base) for base in self._obj.__bases__] + + def py__path__(self): + return self._obj.__path__ + + @_force_unicode_decorator + def get_repr(self): + builtins = 'builtins', '__builtin__' + + if inspect.ismodule(self._obj): + return repr(self._obj) + # Try to avoid execution of the property. + if safe_getattr(self._obj, '__module__', default='') in builtins: + return repr(self._obj) + + type_ = type(self._obj) + if type_ == type: + return type.__repr__(self._obj) + + if safe_getattr(type_, '__module__', default='') in builtins: + # Allow direct execution of repr for builtins. + return repr(self._obj) + return object.__repr__(self._obj) + + def is_class(self): + return inspect.isclass(self._obj) + + def is_module(self): + return inspect.ismodule(self._obj) + + def is_instance(self): + return _is_class_instance(self._obj) + + def ismethoddescriptor(self): + return inspect.ismethoddescriptor(self._obj) + + def get_qualified_names(self): + def try_to_get_name(obj): + return getattr(obj, '__qualname__', getattr(obj, '__name__', None)) + + if self.is_module(): + return () + name = try_to_get_name(self._obj) + if name is None: + name = try_to_get_name(type(self._obj)) + if name is None: + return () + return tuple(name.split('.')) + + def dir(self): + return list(map(force_unicode, dir(self._obj))) + + def has_iter(self): + try: + iter(self._obj) + return True + except TypeError: + return False + + def is_allowed_getattr(self, name): + # TODO this API is ugly. + try: + attr, is_get_descriptor = getattr_static(self._obj, name) + except AttributeError: + return False, False + else: + if is_get_descriptor and type(attr) not in ALLOWED_DESCRIPTOR_ACCESS: + # In case of descriptors that have get methods we cannot return + # it's value, because that would mean code execution. + return True, True + return True, False + + def getattr_paths(self, name, default=_sentinel): + try: + return_obj = getattr(self._obj, name) + except Exception as e: + if default is _sentinel: + if isinstance(e, AttributeError): + # Happens e.g. in properties of + # PyQt4.QtGui.QStyleOptionComboBox.currentText + # -> just set it to None + raise + # Just in case anything happens, return an AttributeError. It + # should not crash. + raise AttributeError + return_obj = default + access = self._create_access(return_obj) + if inspect.ismodule(return_obj): + return [access] + + module = inspect.getmodule(return_obj) + if module is None: + module = inspect.getmodule(type(return_obj)) + if module is None: + module = builtins + return [self._create_access(module), access] + + def get_safe_value(self): + if type(self._obj) in (bool, bytes, float, int, str, unicode, slice): + return self._obj + raise ValueError("Object is type %s and not simple" % type(self._obj)) + + def get_api_type(self): + return get_api_type(self._obj) + + def get_access_path_tuples(self): + accesses = [create_access(self._evaluator, o) for o in self._get_objects_path()] + return [(access.py__name__(), access) for access in accesses] + + def _get_objects_path(self): + def get(): + obj = self._obj + yield obj + try: + obj = obj.__objclass__ + except AttributeError: + pass + else: + yield obj + + try: + # Returns a dotted string path. + imp_plz = obj.__module__ + except AttributeError: + # Unfortunately in some cases like `int` there's no __module__ + if not inspect.ismodule(obj): + yield builtins + else: + if imp_plz is None: + # Happens for example in `(_ for _ in []).send.__module__`. + yield builtins + else: + try: + yield sys.modules[imp_plz] + except KeyError: + # __module__ can be something arbitrary that doesn't exist. + yield builtins + + return list(reversed(list(get()))) + + def execute_operation(self, other_access_handle, operator): + other_access = other_access_handle.access + op = _OPERATORS[operator] + return self._create_access_path(op(self._obj, other_access._obj)) + + def needs_type_completions(self): + return inspect.isclass(self._obj) and self._obj != type + + def get_signature_params(self): + return [ + SignatureParam( + name=p.name, + has_default=p.default is not p.empty, + default=self._create_access_path(p.default), + default_string=repr(p.default), + has_annotation=p.annotation is not p.empty, + annotation=self._create_access_path(p.annotation), + annotation_string=str(p.default), + kind_name=str(p.kind) + ) for p in self._get_signature().parameters.values() + ] + + def _get_signature(self): + obj = self._obj + if py_version < 33: + raise ValueError("inspect.signature was introduced in 3.3") + if py_version == 34: + # In 3.4 inspect.signature are wrong for str and int. This has + # been fixed in 3.5. The signature of object is returned, + # because no signature was found for str. Here we imitate 3.5 + # logic and just ignore the signature if the magic methods + # don't match object. + # 3.3 doesn't even have the logic and returns nothing for str + # and classes that inherit from object. + user_def = inspect._signature_get_user_defined_method + if (inspect.isclass(obj) + and not user_def(type(obj), '__init__') + and not user_def(type(obj), '__new__') + and (obj.__init__ != object.__init__ + or obj.__new__ != object.__new__)): + raise ValueError + + try: + return inspect.signature(obj) + except (RuntimeError, TypeError): + # Reading the code of the function in Python 3.6 implies there are + # at least these errors that might occur if something is wrong with + # the signature. In that case we just want a simple escape for now. + raise ValueError + + def get_return_annotation(self): + try: + o = self._obj.__annotations__.get('return') + except AttributeError: + return None + + if o is None: + return None + + return self._create_access_path(o) + + def negate(self): + return self._create_access_path(-self._obj) + + def get_dir_infos(self): + """ + Used to return a couple of infos that are needed when accessing the sub + objects of an objects + """ + # TODO is_allowed_getattr might raise an AttributeError + tuples = dict( + (force_unicode(name), self.is_allowed_getattr(name)) + for name in self.dir() + ) + return self.needs_type_completions(), tuples + + +def _is_class_instance(obj): + """Like inspect.* methods.""" + try: + cls = obj.__class__ + except AttributeError: + return False + else: + return cls != type and not issubclass(cls, NOT_CLASS_TYPES) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/compiled/context.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/compiled/context.py new file mode 100644 index 0000000..731fce0 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/compiled/context.py @@ -0,0 +1,541 @@ +""" +Imitate the parser representation. +""" +import re +from functools import partial + +from jedi import debug +from jedi.evaluate.utils import to_list +from jedi._compatibility import force_unicode, Parameter, cast_path +from jedi.cache import underscore_memoization, memoize_method +from jedi.evaluate.filters import AbstractFilter +from jedi.evaluate.names import AbstractNameDefinition, ContextNameMixin, \ + ParamNameInterface +from jedi.evaluate.base_context import Context, ContextSet, NO_CONTEXTS +from jedi.evaluate.lazy_context import LazyKnownContext +from jedi.evaluate.compiled.access import _sentinel +from jedi.evaluate.cache import evaluator_function_cache +from jedi.evaluate.helpers import reraise_getitem_errors +from jedi.evaluate.signature import BuiltinSignature + + +class CheckAttribute(object): + """Raises an AttributeError if the attribute X isn't available.""" + def __init__(self, check_name=None): + # Remove the py in front of e.g. py__call__. + self.check_name = check_name + + def __call__(self, func): + self.func = func + if self.check_name is None: + self.check_name = force_unicode(func.__name__[2:]) + return self + + def __get__(self, instance, owner): + if instance is None: + return self + + # This might raise an AttributeError. That's wanted. + instance.access_handle.getattr_paths(self.check_name) + return partial(self.func, instance) + + +class CompiledObject(Context): + def __init__(self, evaluator, access_handle, parent_context=None): + super(CompiledObject, self).__init__(evaluator, parent_context) + self.access_handle = access_handle + + def py__call__(self, arguments): + return_annotation = self.access_handle.get_return_annotation() + if return_annotation is not None: + # TODO the return annotation may also be a string. + return create_from_access_path(self.evaluator, return_annotation).execute_annotation() + + try: + self.access_handle.getattr_paths(u'__call__') + except AttributeError: + return super(CompiledObject, self).py__call__(arguments) + else: + if self.access_handle.is_class(): + from jedi.evaluate.context import CompiledInstance + return ContextSet([ + CompiledInstance(self.evaluator, self.parent_context, self, arguments) + ]) + else: + return ContextSet(self._execute_function(arguments)) + + @CheckAttribute() + def py__class__(self): + return create_from_access_path(self.evaluator, self.access_handle.py__class__()) + + @CheckAttribute() + def py__mro__(self): + return (self,) + tuple( + create_from_access_path(self.evaluator, access) + for access in self.access_handle.py__mro__accesses() + ) + + @CheckAttribute() + def py__bases__(self): + return tuple( + create_from_access_path(self.evaluator, access) + for access in self.access_handle.py__bases__() + ) + + @CheckAttribute() + def py__path__(self): + return map(cast_path, self.access_handle.py__path__()) + + @property + def string_names(self): + # For modules + name = self.py__name__() + if name is None: + return () + return tuple(name.split('.')) + + def get_qualified_names(self): + return self.access_handle.get_qualified_names() + + def py__bool__(self): + return self.access_handle.py__bool__() + + def py__file__(self): + return cast_path(self.access_handle.py__file__()) + + def is_class(self): + return self.access_handle.is_class() + + def is_module(self): + return self.access_handle.is_module() + + def is_compiled(self): + return True + + def is_stub(self): + return False + + def is_instance(self): + return self.access_handle.is_instance() + + def py__doc__(self): + return self.access_handle.py__doc__() + + @to_list + def get_param_names(self): + try: + signature_params = self.access_handle.get_signature_params() + except ValueError: # Has no signature + params_str, ret = self._parse_function_doc() + if not params_str: + tokens = [] + else: + tokens = params_str.split(',') + if self.access_handle.ismethoddescriptor(): + tokens.insert(0, 'self') + for p in tokens: + name, _, default = p.strip().partition('=') + yield UnresolvableParamName(self, name, default) + else: + for signature_param in signature_params: + yield SignatureParamName(self, signature_param) + + def get_signatures(self): + _, return_string = self._parse_function_doc() + return [BuiltinSignature(self, return_string)] + + def __repr__(self): + return '<%s: %s>' % (self.__class__.__name__, self.access_handle.get_repr()) + + @underscore_memoization + def _parse_function_doc(self): + doc = self.py__doc__() + if doc is None: + return '', '' + + return _parse_function_doc(doc) + + @property + def api_type(self): + return self.access_handle.get_api_type() + + @underscore_memoization + def _cls(self): + """ + We used to limit the lookups for instantiated objects like list(), but + this is not the case anymore. Python itself + """ + # Ensures that a CompiledObject is returned that is not an instance (like list) + return self + + def get_filters(self, search_global=False, is_instance=False, + until_position=None, origin_scope=None): + yield self._ensure_one_filter(is_instance) + + @memoize_method + def _ensure_one_filter(self, is_instance): + """ + search_global shouldn't change the fact that there's one dict, this way + there's only one `object`. + """ + return CompiledObjectFilter(self.evaluator, self, is_instance) + + @CheckAttribute(u'__getitem__') + def py__simple_getitem__(self, index): + with reraise_getitem_errors(IndexError, KeyError, TypeError): + access = self.access_handle.py__simple_getitem__(index) + if access is None: + return NO_CONTEXTS + + return ContextSet([create_from_access_path(self.evaluator, access)]) + + def py__getitem__(self, index_context_set, contextualized_node): + all_access_paths = self.access_handle.py__getitem__all_values() + if all_access_paths is None: + # This means basically that no __getitem__ has been defined on this + # object. + return super(CompiledObject, self).py__getitem__(index_context_set, contextualized_node) + return ContextSet( + create_from_access_path(self.evaluator, access) + for access in all_access_paths + ) + + def py__iter__(self, contextualized_node=None): + # Python iterators are a bit strange, because there's no need for + # the __iter__ function as long as __getitem__ is defined (it will + # just start with __getitem__(0). This is especially true for + # Python 2 strings, where `str.__iter__` is not even defined. + if not self.access_handle.has_iter(): + for x in super(CompiledObject, self).py__iter__(contextualized_node): + yield x + + access_path_list = self.access_handle.py__iter__list() + if access_path_list is None: + # There is no __iter__ method on this object. + return + + for access in access_path_list: + yield LazyKnownContext(create_from_access_path(self.evaluator, access)) + + def py__name__(self): + return self.access_handle.py__name__() + + @property + def name(self): + name = self.py__name__() + if name is None: + name = self.access_handle.get_repr() + return CompiledContextName(self, name) + + def _execute_function(self, params): + from jedi.evaluate import docstrings + from jedi.evaluate.compiled import builtin_from_name + if self.api_type != 'function': + return + + for name in self._parse_function_doc()[1].split(): + try: + # TODO wtf is this? this is exactly the same as the thing + # below. It uses getattr as well. + self.evaluator.builtins_module.access_handle.getattr_paths(name) + except AttributeError: + continue + else: + bltn_obj = builtin_from_name(self.evaluator, name) + for result in self.evaluator.execute(bltn_obj, params): + yield result + for type_ in docstrings.infer_return_types(self): + yield type_ + + def get_safe_value(self, default=_sentinel): + try: + return self.access_handle.get_safe_value() + except ValueError: + if default == _sentinel: + raise + return default + + def execute_operation(self, other, operator): + return create_from_access_path( + self.evaluator, + self.access_handle.execute_operation(other.access_handle, operator) + ) + + def negate(self): + return create_from_access_path(self.evaluator, self.access_handle.negate()) + + def get_metaclasses(self): + return NO_CONTEXTS + + +class CompiledName(AbstractNameDefinition): + def __init__(self, evaluator, parent_context, name): + self._evaluator = evaluator + self.parent_context = parent_context + self.string_name = name + + def _get_qualified_names(self): + parent_qualified_names = self.parent_context.get_qualified_names() + return parent_qualified_names + (self.string_name,) + + def __repr__(self): + try: + name = self.parent_context.name # __name__ is not defined all the time + except AttributeError: + name = None + return '<%s: (%s).%s>' % (self.__class__.__name__, name, self.string_name) + + @property + def api_type(self): + api = self.infer() + # If we can't find the type, assume it is an instance variable + if not api: + return "instance" + return next(iter(api)).api_type + + @underscore_memoization + def infer(self): + return ContextSet([_create_from_name( + self._evaluator, self.parent_context, self.string_name + )]) + + +class SignatureParamName(ParamNameInterface, AbstractNameDefinition): + def __init__(self, compiled_obj, signature_param): + self.parent_context = compiled_obj.parent_context + self._signature_param = signature_param + + @property + def string_name(self): + return self._signature_param.name + + def to_string(self): + s = self._kind_string() + self.string_name + if self._signature_param.has_annotation: + s += ': ' + self._signature_param.annotation_string + if self._signature_param.has_default: + s += '=' + self._signature_param.default_string + return s + + def get_kind(self): + return getattr(Parameter, self._signature_param.kind_name) + + def infer(self): + p = self._signature_param + evaluator = self.parent_context.evaluator + contexts = NO_CONTEXTS + if p.has_default: + contexts = ContextSet([create_from_access_path(evaluator, p.default)]) + if p.has_annotation: + annotation = create_from_access_path(evaluator, p.annotation) + contexts |= annotation.execute_evaluated() + return contexts + + +class UnresolvableParamName(ParamNameInterface, AbstractNameDefinition): + def __init__(self, compiled_obj, name, default): + self.parent_context = compiled_obj.parent_context + self.string_name = name + self._default = default + + def get_kind(self): + return Parameter.POSITIONAL_ONLY + + def to_string(self): + string = self.string_name + if self._default: + string += '=' + self._default + return string + + def infer(self): + return NO_CONTEXTS + + +class CompiledContextName(ContextNameMixin, AbstractNameDefinition): + def __init__(self, context, name): + self.string_name = name + self._context = context + self.parent_context = context.parent_context + + +class EmptyCompiledName(AbstractNameDefinition): + """ + Accessing some names will raise an exception. To avoid not having any + completions, just give Jedi the option to return this object. It infers to + nothing. + """ + def __init__(self, evaluator, name): + self.parent_context = evaluator.builtins_module + self.string_name = name + + def infer(self): + return NO_CONTEXTS + + +class CompiledObjectFilter(AbstractFilter): + name_class = CompiledName + + def __init__(self, evaluator, compiled_object, is_instance=False): + self._evaluator = evaluator + self.compiled_object = compiled_object + self.is_instance = is_instance + + def get(self, name): + return self._get( + name, + lambda: self.compiled_object.access_handle.is_allowed_getattr(name), + lambda: self.compiled_object.access_handle.dir(), + check_has_attribute=True + ) + + def _get(self, name, allowed_getattr_callback, dir_callback, check_has_attribute=False): + """ + To remove quite a few access calls we introduced the callback here. + """ + has_attribute, is_descriptor = allowed_getattr_callback() + if check_has_attribute and not has_attribute: + return [] + + # Always use unicode objects in Python 2 from here. + name = force_unicode(name) + + if (is_descriptor and not self._evaluator.allow_descriptor_getattr) or not has_attribute: + return [self._get_cached_name(name, is_empty=True)] + + if self.is_instance and name not in dir_callback(): + return [] + return [self._get_cached_name(name)] + + @memoize_method + def _get_cached_name(self, name, is_empty=False): + if is_empty: + return EmptyCompiledName(self._evaluator, name) + else: + return self._create_name(name) + + def values(self): + from jedi.evaluate.compiled import builtin_from_name + names = [] + needs_type_completions, dir_infos = self.compiled_object.access_handle.get_dir_infos() + for name in dir_infos: + names += self._get( + name, + lambda: dir_infos[name], + lambda: dir_infos.keys(), + ) + + # ``dir`` doesn't include the type names. + if not self.is_instance and needs_type_completions: + for filter in builtin_from_name(self._evaluator, u'type').get_filters(): + names += filter.values() + return names + + def _create_name(self, name): + return self.name_class(self._evaluator, self.compiled_object, name) + + def __repr__(self): + return "<%s: %s>" % (self.__class__.__name__, self.compiled_object) + + +docstr_defaults = { + 'floating point number': u'float', + 'character': u'str', + 'integer': u'int', + 'dictionary': u'dict', + 'string': u'str', +} + + +def _parse_function_doc(doc): + """ + Takes a function and returns the params and return value as a tuple. + This is nothing more than a docstring parser. + + TODO docstrings like utime(path, (atime, mtime)) and a(b [, b]) -> None + TODO docstrings like 'tuple of integers' + """ + doc = force_unicode(doc) + # parse round parentheses: def func(a, (b,c)) + try: + count = 0 + start = doc.index('(') + for i, s in enumerate(doc[start:]): + if s == '(': + count += 1 + elif s == ')': + count -= 1 + if count == 0: + end = start + i + break + param_str = doc[start + 1:end] + except (ValueError, UnboundLocalError): + # ValueError for doc.index + # UnboundLocalError for undefined end in last line + debug.dbg('no brackets found - no param') + end = 0 + param_str = u'' + else: + # remove square brackets, that show an optional param ( = None) + def change_options(m): + args = m.group(1).split(',') + for i, a in enumerate(args): + if a and '=' not in a: + args[i] += '=None' + return ','.join(args) + + while True: + param_str, changes = re.subn(r' ?\[([^\[\]]+)\]', + change_options, param_str) + if changes == 0: + break + param_str = param_str.replace('-', '_') # see: isinstance.__doc__ + + # parse return value + r = re.search(u'-[>-]* ', doc[end:end + 7]) + if r is None: + ret = u'' + else: + index = end + r.end() + # get result type, which can contain newlines + pattern = re.compile(r'(,\n|[^\n-])+') + ret_str = pattern.match(doc, index).group(0).strip() + # New object -> object() + ret_str = re.sub(r'[nN]ew (.*)', r'\1()', ret_str) + + ret = docstr_defaults.get(ret_str, ret_str) + + return param_str, ret + + +def _create_from_name(evaluator, compiled_object, name): + access_paths = compiled_object.access_handle.getattr_paths(name, default=None) + parent_context = compiled_object + if parent_context.is_class(): + parent_context = parent_context.parent_context + + context = None + for access_path in access_paths: + context = create_cached_compiled_object( + evaluator, access_path, parent_context=context + ) + return context + + +def _normalize_create_args(func): + """The cache doesn't care about keyword vs. normal args.""" + def wrapper(evaluator, obj, parent_context=None): + return func(evaluator, obj, parent_context) + return wrapper + + +def create_from_access_path(evaluator, access_path): + parent_context = None + for name, access in access_path.accesses: + parent_context = create_cached_compiled_object(evaluator, access, parent_context) + return parent_context + + +@_normalize_create_args +@evaluator_function_cache() +def create_cached_compiled_object(evaluator, access_handle, parent_context): + return CompiledObject(evaluator, access_handle, parent_context) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/compiled/getattr_static.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/compiled/getattr_static.py new file mode 100644 index 0000000..946ac09 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/compiled/getattr_static.py @@ -0,0 +1,176 @@ +""" +A static version of getattr. +This is a backport of the Python 3 code with a little bit of additional +information returned to enable Jedi to make decisions. +""" + +import types + +from jedi._compatibility import py_version + +_sentinel = object() + + +def _check_instance(obj, attr): + instance_dict = {} + try: + instance_dict = object.__getattribute__(obj, "__dict__") + except AttributeError: + pass + return dict.get(instance_dict, attr, _sentinel) + + +def _check_class(klass, attr): + for entry in _static_getmro(klass): + if _shadowed_dict(type(entry)) is _sentinel: + try: + return entry.__dict__[attr] + except KeyError: + pass + return _sentinel + + +def _is_type(obj): + try: + _static_getmro(obj) + except TypeError: + return False + return True + + +def _shadowed_dict_newstyle(klass): + dict_attr = type.__dict__["__dict__"] + for entry in _static_getmro(klass): + try: + class_dict = dict_attr.__get__(entry)["__dict__"] + except KeyError: + pass + else: + if not (type(class_dict) is types.GetSetDescriptorType and + class_dict.__name__ == "__dict__" and + class_dict.__objclass__ is entry): + return class_dict + return _sentinel + + +def _static_getmro_newstyle(klass): + return type.__dict__['__mro__'].__get__(klass) + + +if py_version >= 30: + _shadowed_dict = _shadowed_dict_newstyle + _get_type = type + _static_getmro = _static_getmro_newstyle +else: + def _shadowed_dict(klass): + """ + In Python 2 __dict__ is not overwritable: + + class Foo(object): pass + setattr(Foo, '__dict__', 4) + + Traceback (most recent call last): + File "", line 1, in + TypeError: __dict__ must be a dictionary object + + It applies to both newstyle and oldstyle classes: + + class Foo(object): pass + setattr(Foo, '__dict__', 4) + Traceback (most recent call last): + File "", line 1, in + AttributeError: attribute '__dict__' of 'type' objects is not writable + + It also applies to instances of those objects. However to keep things + straight forward, newstyle classes always use the complicated way of + accessing it while oldstyle classes just use getattr. + """ + if type(klass) is _oldstyle_class_type: + return getattr(klass, '__dict__', _sentinel) + return _shadowed_dict_newstyle(klass) + + class _OldStyleClass: + pass + + _oldstyle_instance_type = type(_OldStyleClass()) + _oldstyle_class_type = type(_OldStyleClass) + + def _get_type(obj): + type_ = object.__getattribute__(obj, '__class__') + if type_ is _oldstyle_instance_type: + # Somehow for old style classes we need to access it directly. + return obj.__class__ + return type_ + + def _static_getmro(klass): + if type(klass) is _oldstyle_class_type: + def oldstyle_mro(klass): + """ + Oldstyle mro is a really simplistic way of look up mro: + https://stackoverflow.com/questions/54867/what-is-the-difference-between-old-style-and-new-style-classes-in-python + """ + yield klass + for base in klass.__bases__: + for yield_from in oldstyle_mro(base): + yield yield_from + + return oldstyle_mro(klass) + + return _static_getmro_newstyle(klass) + + +def _safe_hasattr(obj, name): + return _check_class(_get_type(obj), name) is not _sentinel + + +def _safe_is_data_descriptor(obj): + return _safe_hasattr(obj, '__set__') or _safe_hasattr(obj, '__delete__') + + +def getattr_static(obj, attr, default=_sentinel): + """Retrieve attributes without triggering dynamic lookup via the + descriptor protocol, __getattr__ or __getattribute__. + + Note: this function may not be able to retrieve all attributes + that getattr can fetch (like dynamically created attributes) + and may find attributes that getattr can't (like descriptors + that raise AttributeError). It can also return descriptor objects + instead of instance members in some cases. See the + documentation for details. + + Returns a tuple `(attr, is_get_descriptor)`. is_get_descripter means that + the attribute is a descriptor that has a `__get__` attribute. + """ + instance_result = _sentinel + if not _is_type(obj): + klass = _get_type(obj) + dict_attr = _shadowed_dict(klass) + if (dict_attr is _sentinel or type(dict_attr) is types.MemberDescriptorType): + instance_result = _check_instance(obj, attr) + else: + klass = obj + + klass_result = _check_class(klass, attr) + + if instance_result is not _sentinel and klass_result is not _sentinel: + if _safe_hasattr(klass_result, '__get__') \ + and _safe_is_data_descriptor(klass_result): + # A get/set descriptor has priority over everything. + return klass_result, True + + if instance_result is not _sentinel: + return instance_result, False + if klass_result is not _sentinel: + return klass_result, _safe_hasattr(klass_result, '__get__') + + if obj is klass: + # for types we check the metaclass too + for entry in _static_getmro(type(klass)): + if _shadowed_dict(type(entry)) is _sentinel: + try: + return entry.__dict__[attr], False + except KeyError: + pass + if default is not _sentinel: + return default, False + raise AttributeError(attr) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/compiled/mixed.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/compiled/mixed.py new file mode 100644 index 0000000..37d9fbe --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/compiled/mixed.py @@ -0,0 +1,291 @@ +""" +Used only for REPL Completion. +""" + +import inspect +import os +import sys + +from jedi.parser_utils import get_cached_code_lines + +from jedi import settings +from jedi.evaluate import compiled +from jedi.cache import underscore_memoization +from jedi.file_io import FileIO +from jedi.evaluate.base_context import ContextSet, ContextWrapper +from jedi.evaluate.helpers import SimpleGetItemNotFound +from jedi.evaluate.context import ModuleContext +from jedi.evaluate.cache import evaluator_function_cache +from jedi.evaluate.compiled.getattr_static import getattr_static +from jedi.evaluate.compiled.access import compiled_objects_cache, \ + ALLOWED_GETITEM_TYPES, get_api_type +from jedi.evaluate.compiled.context import create_cached_compiled_object +from jedi.evaluate.gradual.conversion import to_stub + +_sentinel = object() + + +class MixedObject(ContextWrapper): + """ + A ``MixedObject`` is used in two ways: + + 1. It uses the default logic of ``parser.python.tree`` objects, + 2. except for getattr calls. The names dicts are generated in a fashion + like ``CompiledObject``. + + This combined logic makes it possible to provide more powerful REPL + completion. It allows side effects that are not noticable with the default + parser structure to still be completeable. + + The biggest difference from CompiledObject to MixedObject is that we are + generally dealing with Python code and not with C code. This will generate + fewer special cases, because we in Python you don't have the same freedoms + to modify the runtime. + """ + def __init__(self, compiled_object, tree_context): + super(MixedObject, self).__init__(tree_context) + self.compiled_object = compiled_object + self.access_handle = compiled_object.access_handle + + def get_filters(self, *args, **kwargs): + yield MixedObjectFilter(self.evaluator, self) + + def get_signatures(self): + # Prefer `inspect.signature` over somehow analyzing Python code. It + # should be very precise, especially for stuff like `partial`. + return self.compiled_object.get_signatures() + + def py__call__(self, arguments): + return (to_stub(self._wrapped_context) or self._wrapped_context).py__call__(arguments) + + def get_safe_value(self, default=_sentinel): + if default is _sentinel: + return self.compiled_object.get_safe_value() + else: + return self.compiled_object.get_safe_value(default) + + def py__simple_getitem__(self, index): + python_object = self.compiled_object.access_handle.access._obj + if type(python_object) in ALLOWED_GETITEM_TYPES: + return self.compiled_object.py__simple_getitem__(index) + raise SimpleGetItemNotFound + + def __repr__(self): + return '<%s: %s>' % ( + type(self).__name__, + self.access_handle.get_repr() + ) + + +class MixedName(compiled.CompiledName): + """ + The ``CompiledName._compiled_object`` is our MixedObject. + """ + @property + def start_pos(self): + contexts = list(self.infer()) + if not contexts: + # This means a start_pos that doesn't exist (compiled objects). + return 0, 0 + return contexts[0].name.start_pos + + @start_pos.setter + def start_pos(self, value): + # Ignore the __init__'s start_pos setter call. + pass + + @underscore_memoization + def infer(self): + # TODO use logic from compiled.CompiledObjectFilter + access_paths = self.parent_context.access_handle.getattr_paths( + self.string_name, + default=None + ) + assert len(access_paths) + contexts = [None] + for access in access_paths: + contexts = ContextSet.from_sets( + _create(self._evaluator, access, parent_context=c) + if c is None or isinstance(c, MixedObject) + else ContextSet({create_cached_compiled_object(c.evaluator, access, c)}) + for c in contexts + ) + return contexts + + @property + def api_type(self): + return next(iter(self.infer())).api_type + + +class MixedObjectFilter(compiled.CompiledObjectFilter): + name_class = MixedName + + +@evaluator_function_cache() +def _load_module(evaluator, path): + module_node = evaluator.parse( + path=path, + cache=True, + diff_cache=settings.fast_parser, + cache_path=settings.cache_directory + ).get_root_node() + # python_module = inspect.getmodule(python_object) + # TODO we should actually make something like this possible. + #evaluator.modules[python_module.__name__] = module_node + return module_node + + +def _get_object_to_check(python_object): + """Check if inspect.getfile has a chance to find the source.""" + if sys.version_info[0] > 2: + python_object = inspect.unwrap(python_object) + + if (inspect.ismodule(python_object) or + inspect.isclass(python_object) or + inspect.ismethod(python_object) or + inspect.isfunction(python_object) or + inspect.istraceback(python_object) or + inspect.isframe(python_object) or + inspect.iscode(python_object)): + return python_object + + try: + return python_object.__class__ + except AttributeError: + raise TypeError # Prevents computation of `repr` within inspect. + + +def _find_syntax_node_name(evaluator, python_object): + original_object = python_object + try: + python_object = _get_object_to_check(python_object) + path = inspect.getsourcefile(python_object) + except TypeError: + # The type might not be known (e.g. class_with_dict.__weakref__) + return None + if path is None or not os.path.exists(path): + # The path might not exist or be e.g. . + return None + + file_io = FileIO(path) + module_node = _load_module(evaluator, path) + + if inspect.ismodule(python_object): + # We don't need to check names for modules, because there's not really + # a way to write a module in a module in Python (and also __name__ can + # be something like ``email.utils``). + code_lines = get_cached_code_lines(evaluator.grammar, path) + return module_node, module_node, file_io, code_lines + + try: + name_str = python_object.__name__ + except AttributeError: + # Stuff like python_function.__code__. + return None + + if name_str == '': + return None # It's too hard to find lambdas. + + # Doesn't always work (e.g. os.stat_result) + names = module_node.get_used_names().get(name_str, []) + # Only functions and classes are relevant. If a name e.g. points to an + # import, it's probably a builtin (like collections.deque) and needs to be + # ignored. + names = [ + n for n in names + if n.parent.type in ('funcdef', 'classdef') and n.parent.name == n + ] + if not names: + return None + + try: + code = python_object.__code__ + # By using the line number of a code object we make the lookup in a + # file pretty easy. There's still a possibility of people defining + # stuff like ``a = 3; foo(a); a = 4`` on the same line, but if people + # do so we just don't care. + line_nr = code.co_firstlineno + except AttributeError: + pass + else: + line_names = [name for name in names if name.start_pos[0] == line_nr] + # There's a chance that the object is not available anymore, because + # the code has changed in the background. + if line_names: + names = line_names + + code_lines = get_cached_code_lines(evaluator.grammar, path) + # It's really hard to actually get the right definition, here as a last + # resort we just return the last one. This chance might lead to odd + # completions at some points but will lead to mostly correct type + # inference, because people tend to define a public name in a module only + # once. + tree_node = names[-1].parent + if tree_node.type == 'funcdef' and get_api_type(original_object) == 'instance': + # If an instance is given and we're landing on a function (e.g. + # partial in 3.5), something is completely wrong and we should not + # return that. + return None + return module_node, tree_node, file_io, code_lines + + +@compiled_objects_cache('mixed_cache') +def _create(evaluator, access_handle, parent_context, *args): + compiled_object = create_cached_compiled_object( + evaluator, + access_handle, + parent_context=parent_context and parent_context.compiled_object + ) + + # TODO accessing this is bad, but it probably doesn't matter that much, + # because we're working with interpreteters only here. + python_object = access_handle.access._obj + result = _find_syntax_node_name(evaluator, python_object) + if result is None: + # TODO Care about generics from stuff like `[1]` and don't return like this. + if type(python_object) in (dict, list, tuple): + return ContextSet({compiled_object}) + + tree_contexts = to_stub(compiled_object) + if not tree_contexts: + return ContextSet({compiled_object}) + else: + module_node, tree_node, file_io, code_lines = result + + if parent_context is None: + # TODO this __name__ is probably wrong. + name = compiled_object.get_root_context().py__name__() + string_names = tuple(name.split('.')) + module_context = ModuleContext( + evaluator, module_node, + file_io=file_io, + string_names=string_names, + code_lines=code_lines, + is_package=hasattr(compiled_object, 'py__path__'), + ) + if name is not None: + evaluator.module_cache.add(string_names, ContextSet([module_context])) + else: + if parent_context.tree_node.get_root_node() != module_node: + # This happens e.g. when __module__ is wrong, or when using + # TypeVar('foo'), where Jedi uses 'foo' as the name and + # Python's TypeVar('foo').__module__ will be typing. + return ContextSet({compiled_object}) + module_context = parent_context.get_root_context() + + tree_contexts = ContextSet({ + module_context.create_context( + tree_node, + node_is_context=True, + node_is_object=True + ) + }) + if tree_node.type == 'classdef': + if not access_handle.is_class(): + # Is an instance, not a class. + tree_contexts = tree_contexts.execute_evaluated() + + return ContextSet( + MixedObject(compiled_object, tree_context=tree_context) + for tree_context in tree_contexts + ) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/compiled/subprocess/__init__.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/compiled/subprocess/__init__.py new file mode 100644 index 0000000..dea2f66 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/compiled/subprocess/__init__.py @@ -0,0 +1,406 @@ +""" +Makes it possible to do the compiled analysis in a subprocess. This has two +goals: + +1. Making it safer - Segfaults and RuntimeErrors as well as stdout/stderr can + be ignored and dealt with. +2. Make it possible to handle different Python versions as well as virtualenvs. +""" + +import os +import sys +import subprocess +import socket +import errno +import traceback +from functools import partial +from threading import Thread +try: + from queue import Queue, Empty +except ImportError: + from Queue import Queue, Empty # python 2.7 + +from jedi._compatibility import queue, is_py3, force_unicode, \ + pickle_dump, pickle_load, GeneralizedPopen, weakref +from jedi import debug +from jedi.cache import memoize_method +from jedi.evaluate.compiled.subprocess import functions +from jedi.evaluate.compiled.access import DirectObjectAccess, AccessPath, \ + SignatureParam +from jedi.api.exceptions import InternalError + + +_MAIN_PATH = os.path.join(os.path.dirname(__file__), '__main__.py') + + +def _enqueue_output(out, queue): + for line in iter(out.readline, b''): + queue.put(line) + + +def _add_stderr_to_debug(stderr_queue): + while True: + # Try to do some error reporting from the subprocess and print its + # stderr contents. + try: + line = stderr_queue.get_nowait() + line = line.decode('utf-8', 'replace') + debug.warning('stderr output: %s' % line.rstrip('\n')) + except Empty: + break + + +def _get_function(name): + return getattr(functions, name) + + +def _cleanup_process(process, thread): + try: + process.kill() + process.wait() + except OSError: + # Raised if the process is already killed. + pass + thread.join() + for stream in [process.stdin, process.stdout, process.stderr]: + try: + stream.close() + except OSError: + # Raised if the stream is broken. + pass + + +class _EvaluatorProcess(object): + def __init__(self, evaluator): + self._evaluator_weakref = weakref.ref(evaluator) + self._evaluator_id = id(evaluator) + self._handles = {} + + def get_or_create_access_handle(self, obj): + id_ = id(obj) + try: + return self.get_access_handle(id_) + except KeyError: + access = DirectObjectAccess(self._evaluator_weakref(), obj) + handle = AccessHandle(self, access, id_) + self.set_access_handle(handle) + return handle + + def get_access_handle(self, id_): + return self._handles[id_] + + def set_access_handle(self, handle): + self._handles[handle.id] = handle + + +class EvaluatorSameProcess(_EvaluatorProcess): + """ + Basically just an easy access to functions.py. It has the same API + as EvaluatorSubprocess and does the same thing without using a subprocess. + This is necessary for the Interpreter process. + """ + def __getattr__(self, name): + return partial(_get_function(name), self._evaluator_weakref()) + + +class EvaluatorSubprocess(_EvaluatorProcess): + def __init__(self, evaluator, compiled_subprocess): + super(EvaluatorSubprocess, self).__init__(evaluator) + self._used = False + self._compiled_subprocess = compiled_subprocess + + def __getattr__(self, name): + func = _get_function(name) + + def wrapper(*args, **kwargs): + self._used = True + + result = self._compiled_subprocess.run( + self._evaluator_weakref(), + func, + args=args, + kwargs=kwargs, + ) + # IMO it should be possible to create a hook in pickle.load to + # mess with the loaded objects. However it's extremely complicated + # to work around this so just do it with this call. ~ dave + return self._convert_access_handles(result) + + return wrapper + + def _convert_access_handles(self, obj): + if isinstance(obj, SignatureParam): + return SignatureParam(*self._convert_access_handles(tuple(obj))) + elif isinstance(obj, tuple): + return tuple(self._convert_access_handles(o) for o in obj) + elif isinstance(obj, list): + return [self._convert_access_handles(o) for o in obj] + elif isinstance(obj, AccessHandle): + try: + # Rewrite the access handle to one we're already having. + obj = self.get_access_handle(obj.id) + except KeyError: + obj.add_subprocess(self) + self.set_access_handle(obj) + elif isinstance(obj, AccessPath): + return AccessPath(self._convert_access_handles(obj.accesses)) + return obj + + def __del__(self): + if self._used and not self._compiled_subprocess.is_crashed: + self._compiled_subprocess.delete_evaluator(self._evaluator_id) + + +class CompiledSubprocess(object): + is_crashed = False + # Start with 2, gets set after _get_info. + _pickle_protocol = 2 + + def __init__(self, executable): + self._executable = executable + self._evaluator_deletion_queue = queue.deque() + self._cleanup_callable = lambda: None + + def __repr__(self): + pid = os.getpid() + return '<%s _executable=%r, _pickle_protocol=%r, is_crashed=%r, pid=%r>' % ( + self.__class__.__name__, + self._executable, + self._pickle_protocol, + self.is_crashed, + pid, + ) + + @memoize_method + def _get_process(self): + debug.dbg('Start environment subprocess %s', self._executable) + parso_path = sys.modules['parso'].__file__ + args = ( + self._executable, + _MAIN_PATH, + os.path.dirname(os.path.dirname(parso_path)), + '.'.join(str(x) for x in sys.version_info[:3]), + ) + process = GeneralizedPopen( + args, + stdin=subprocess.PIPE, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + # Use system default buffering on Python 2 to improve performance + # (this is already the case on Python 3). + bufsize=-1 + ) + self._stderr_queue = Queue() + self._stderr_thread = t = Thread( + target=_enqueue_output, + args=(process.stderr, self._stderr_queue) + ) + t.daemon = True + t.start() + # Ensure the subprocess is properly cleaned up when the object + # is garbage collected. + self._cleanup_callable = weakref.finalize(self, + _cleanup_process, + process, + t) + return process + + def run(self, evaluator, function, args=(), kwargs={}): + # Delete old evaluators. + while True: + try: + evaluator_id = self._evaluator_deletion_queue.pop() + except IndexError: + break + else: + self._send(evaluator_id, None) + + assert callable(function) + return self._send(id(evaluator), function, args, kwargs) + + def get_sys_path(self): + return self._send(None, functions.get_sys_path, (), {}) + + def _kill(self): + self.is_crashed = True + self._cleanup_callable() + + def _send(self, evaluator_id, function, args=(), kwargs={}): + if self.is_crashed: + raise InternalError("The subprocess %s has crashed." % self._executable) + + if not is_py3: + # Python 2 compatibility + kwargs = {force_unicode(key): value for key, value in kwargs.items()} + + data = evaluator_id, function, args, kwargs + try: + pickle_dump(data, self._get_process().stdin, self._pickle_protocol) + except (socket.error, IOError) as e: + # Once Python2 will be removed we can just use `BrokenPipeError`. + # Also, somehow in windows it returns EINVAL instead of EPIPE if + # the subprocess dies. + if e.errno not in (errno.EPIPE, errno.EINVAL): + # Not a broken pipe + raise + self._kill() + raise InternalError("The subprocess %s was killed. Maybe out of memory?" + % self._executable) + + try: + is_exception, traceback, result = pickle_load(self._get_process().stdout) + except EOFError as eof_error: + try: + stderr = self._get_process().stderr.read().decode('utf-8', 'replace') + except Exception as exc: + stderr = '' % exc + self._kill() + _add_stderr_to_debug(self._stderr_queue) + raise InternalError( + "The subprocess %s has crashed (%r, stderr=%s)." % ( + self._executable, + eof_error, + stderr, + )) + + _add_stderr_to_debug(self._stderr_queue) + + if is_exception: + # Replace the attribute error message with a the traceback. It's + # way more informative. + result.args = (traceback,) + raise result + return result + + def delete_evaluator(self, evaluator_id): + """ + Currently we are not deleting evalutors instantly. They only get + deleted once the subprocess is used again. It would probably a better + solution to move all of this into a thread. However, the memory usage + of a single evaluator shouldn't be that high. + """ + # With an argument - the evaluator gets deleted. + self._evaluator_deletion_queue.append(evaluator_id) + + +class Listener(object): + def __init__(self, pickle_protocol): + self._evaluators = {} + # TODO refactor so we don't need to process anymore just handle + # controlling. + self._process = _EvaluatorProcess(Listener) + self._pickle_protocol = pickle_protocol + + def _get_evaluator(self, function, evaluator_id): + from jedi.evaluate import Evaluator + + try: + evaluator = self._evaluators[evaluator_id] + except KeyError: + from jedi.api.environment import InterpreterEnvironment + evaluator = Evaluator( + # The project is not actually needed. Nothing should need to + # access it. + project=None, + environment=InterpreterEnvironment() + ) + self._evaluators[evaluator_id] = evaluator + return evaluator + + def _run(self, evaluator_id, function, args, kwargs): + if evaluator_id is None: + return function(*args, **kwargs) + elif function is None: + del self._evaluators[evaluator_id] + else: + evaluator = self._get_evaluator(function, evaluator_id) + + # Exchange all handles + args = list(args) + for i, arg in enumerate(args): + if isinstance(arg, AccessHandle): + args[i] = evaluator.compiled_subprocess.get_access_handle(arg.id) + for key, value in kwargs.items(): + if isinstance(value, AccessHandle): + kwargs[key] = evaluator.compiled_subprocess.get_access_handle(value.id) + + return function(evaluator, *args, **kwargs) + + def listen(self): + stdout = sys.stdout + # Mute stdout. Nobody should actually be able to write to it, + # because stdout is used for IPC. + sys.stdout = open(os.devnull, 'w') + stdin = sys.stdin + if sys.version_info[0] > 2: + stdout = stdout.buffer + stdin = stdin.buffer + # Python 2 opens streams in text mode on Windows. Set stdout and stdin + # to binary mode. + elif sys.platform == 'win32': + import msvcrt + msvcrt.setmode(stdout.fileno(), os.O_BINARY) + msvcrt.setmode(stdin.fileno(), os.O_BINARY) + + while True: + try: + payload = pickle_load(stdin) + except EOFError: + # It looks like the parent process closed. + # Don't make a big fuss here and just exit. + exit(0) + try: + result = False, None, self._run(*payload) + except Exception as e: + result = True, traceback.format_exc(), e + + pickle_dump(result, stdout, self._pickle_protocol) + + +class AccessHandle(object): + def __init__(self, subprocess, access, id_): + self.access = access + self._subprocess = subprocess + self.id = id_ + + def add_subprocess(self, subprocess): + self._subprocess = subprocess + + def __repr__(self): + try: + detail = self.access + except AttributeError: + detail = '#' + str(self.id) + return '<%s of %s>' % (self.__class__.__name__, detail) + + def __getstate__(self): + return self.id + + def __setstate__(self, state): + self.id = state + + def __getattr__(self, name): + if name in ('id', 'access') or name.startswith('_'): + raise AttributeError("Something went wrong with unpickling") + + #if not is_py3: print >> sys.stderr, name + #print('getattr', name, file=sys.stderr) + return partial(self._workaround, force_unicode(name)) + + def _workaround(self, name, *args, **kwargs): + """ + TODO Currently we're passing slice objects around. This should not + happen. They are also the only unhashable objects that we're passing + around. + """ + if args and isinstance(args[0], slice): + return self._subprocess.get_compiled_method_return(self.id, name, *args, **kwargs) + return self._cached_results(name, *args, **kwargs) + + @memoize_method + def _cached_results(self, name, *args, **kwargs): + #if type(self._subprocess) == EvaluatorSubprocess: + #print(name, args, kwargs, + #self._subprocess.get_compiled_method_return(self.id, name, *args, **kwargs) + #) + return self._subprocess.get_compiled_method_return(self.id, name, *args, **kwargs) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/compiled/subprocess/__main__.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/compiled/subprocess/__main__.py new file mode 100644 index 0000000..4be2820 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/compiled/subprocess/__main__.py @@ -0,0 +1,55 @@ +import os +import sys + + +def _get_paths(): + # Get the path to jedi. + _d = os.path.dirname + _jedi_path = _d(_d(_d(_d(_d(__file__))))) + _parso_path = sys.argv[1] + # The paths are the directory that jedi and parso lie in. + return {'jedi': _jedi_path, 'parso': _parso_path} + + +# Remove the first entry, because it's simply a directory entry that equals +# this directory. +del sys.path[0] + +if sys.version_info > (3, 4): + from importlib.machinery import PathFinder + + class _ExactImporter(object): + def __init__(self, path_dct): + self._path_dct = path_dct + + def find_module(self, fullname, path=None): + if path is None and fullname in self._path_dct: + p = self._path_dct[fullname] + loader = PathFinder.find_module(fullname, path=[p]) + return loader + return None + + # Try to import jedi/parso. + sys.meta_path.insert(0, _ExactImporter(_get_paths())) + from jedi.evaluate.compiled import subprocess # NOQA + sys.meta_path.pop(0) +else: + import imp + + def load(name): + paths = list(_get_paths().values()) + fp, pathname, description = imp.find_module(name, paths) + return imp.load_module(name, fp, pathname, description) + + load('parso') + load('jedi') + from jedi.evaluate.compiled import subprocess # NOQA + +from jedi._compatibility import highest_pickle_protocol # noqa: E402 + + +# Retrieve the pickle protocol. +host_sys_version = [int(x) for x in sys.argv[2].split('.')] +pickle_protocol = highest_pickle_protocol([sys.version_info, host_sys_version]) +# And finally start the client. +subprocess.Listener(pickle_protocol=pickle_protocol).listen() diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/compiled/subprocess/functions.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/compiled/subprocess/functions.py new file mode 100644 index 0000000..b3fdac0 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/compiled/subprocess/functions.py @@ -0,0 +1,86 @@ +from __future__ import print_function +import sys +import os + +from jedi._compatibility import find_module, cast_path, force_unicode, \ + iter_modules, all_suffixes +from jedi.evaluate.compiled import access +from jedi import parser_utils + + +def get_sys_path(): + return list(map(cast_path, sys.path)) + + +def load_module(evaluator, **kwargs): + return access.load_module(evaluator, **kwargs) + + +def get_compiled_method_return(evaluator, id, attribute, *args, **kwargs): + handle = evaluator.compiled_subprocess.get_access_handle(id) + return getattr(handle.access, attribute)(*args, **kwargs) + + +def create_simple_object(evaluator, obj): + return access.create_access_path(evaluator, obj) + + +def get_module_info(evaluator, sys_path=None, full_name=None, **kwargs): + """ + Returns Tuple[Union[NamespaceInfo, FileIO, None], Optional[bool]] + """ + if sys_path is not None: + sys.path, temp = sys_path, sys.path + try: + return find_module(full_name=full_name, **kwargs) + except ImportError: + return None, None + finally: + if sys_path is not None: + sys.path = temp + + +def list_module_names(evaluator, search_path): + return [ + force_unicode(name) + for module_loader, name, is_pkg in iter_modules(search_path) + ] + + +def get_builtin_module_names(evaluator): + return list(map(force_unicode, sys.builtin_module_names)) + + +def _test_raise_error(evaluator, exception_type): + """ + Raise an error to simulate certain problems for unit tests. + """ + raise exception_type + + +def _test_print(evaluator, stderr=None, stdout=None): + """ + Force some prints in the subprocesses. This exists for unit tests. + """ + if stderr is not None: + print(stderr, file=sys.stderr) + sys.stderr.flush() + if stdout is not None: + print(stdout) + sys.stdout.flush() + + +def _get_init_path(directory_path): + """ + The __init__ file can be searched in a directory. If found return it, else + None. + """ + for suffix in all_suffixes(): + path = os.path.join(directory_path, '__init__' + suffix) + if os.path.exists(path): + return path + return None + + +def safe_literal_eval(evaluator, value): + return parser_utils.safe_literal_eval(value) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/context/__init__.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/context/__init__.py new file mode 100644 index 0000000..56f6495 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/context/__init__.py @@ -0,0 +1,6 @@ +from jedi.evaluate.context.module import ModuleContext +from jedi.evaluate.context.klass import ClassContext +from jedi.evaluate.context.function import FunctionContext, \ + MethodContext, FunctionExecutionContext +from jedi.evaluate.context.instance import AnonymousInstance, BoundMethod, \ + CompiledInstance, AbstractInstanceContext, TreeInstance diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/context/decorator.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/context/decorator.py new file mode 100644 index 0000000..317c5f4 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/context/decorator.py @@ -0,0 +1,15 @@ +''' +Decorators are not really contexts, however we need some wrappers to improve +docstrings and other things around decorators. +''' + +from jedi.evaluate.base_context import ContextWrapper + + +class Decoratee(ContextWrapper): + def __init__(self, wrapped_context, original_context): + self._wrapped_context = wrapped_context + self._original_context = original_context + + def py__doc__(self): + return self._original_context.py__doc__() diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/context/function.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/context/function.py new file mode 100644 index 0000000..203dcf0 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/context/function.py @@ -0,0 +1,444 @@ +from parso.python import tree + +from jedi._compatibility import use_metaclass +from jedi import debug +from jedi.evaluate.cache import evaluator_method_cache, CachedMetaClass +from jedi.evaluate import compiled +from jedi.evaluate import recursion +from jedi.evaluate import docstrings +from jedi.evaluate import flow_analysis +from jedi.evaluate import helpers +from jedi.evaluate.signature import TreeSignature +from jedi.evaluate.arguments import AnonymousArguments +from jedi.evaluate.filters import ParserTreeFilter, FunctionExecutionFilter +from jedi.evaluate.names import ContextName, AbstractNameDefinition, ParamName +from jedi.evaluate.base_context import ContextualizedNode, NO_CONTEXTS, \ + ContextSet, TreeContext, ContextWrapper +from jedi.evaluate.lazy_context import LazyKnownContexts, LazyKnownContext, \ + LazyTreeContext +from jedi.evaluate.context import iterable +from jedi import parser_utils +from jedi.evaluate.parser_cache import get_yield_exprs +from jedi.evaluate.helpers import contexts_from_qualified_names + + +class LambdaName(AbstractNameDefinition): + string_name = '' + api_type = u'function' + + def __init__(self, lambda_context): + self._lambda_context = lambda_context + self.parent_context = lambda_context.parent_context + + @property + def start_pos(self): + return self._lambda_context.tree_node.start_pos + + def infer(self): + return ContextSet([self._lambda_context]) + + +class FunctionAndClassBase(TreeContext): + def get_qualified_names(self): + if self.parent_context.is_class(): + n = self.parent_context.get_qualified_names() + if n is None: + # This means that the parent class lives within a function. + return None + return n + (self.py__name__(),) + elif self.parent_context.is_module(): + return (self.py__name__(),) + else: + return None + + +class FunctionMixin(object): + api_type = u'function' + + def get_filters(self, search_global=False, until_position=None, origin_scope=None): + if search_global: + yield ParserTreeFilter( + self.evaluator, + context=self, + until_position=until_position, + origin_scope=origin_scope + ) + else: + cls = self.py__class__() + for instance in cls.execute_evaluated(): + for filter in instance.get_filters(search_global=False, origin_scope=origin_scope): + yield filter + + def py__get__(self, instance, class_context): + from jedi.evaluate.context.instance import BoundMethod + if instance is None: + # Calling the Foo.bar results in the original bar function. + return ContextSet([self]) + return ContextSet([BoundMethod(instance, self)]) + + def get_param_names(self): + function_execution = self.get_function_execution() + return [ParamName(function_execution, param.name) + for param in self.tree_node.get_params()] + + @property + def name(self): + if self.tree_node.type == 'lambdef': + return LambdaName(self) + return ContextName(self, self.tree_node.name) + + def py__name__(self): + return self.name.string_name + + def py__call__(self, arguments): + function_execution = self.get_function_execution(arguments) + return function_execution.infer() + + def get_function_execution(self, arguments=None): + if arguments is None: + arguments = AnonymousArguments() + + return FunctionExecutionContext(self.evaluator, self.parent_context, self, arguments) + + def get_signatures(self): + return [TreeSignature(f) for f in self.get_signature_functions()] + + +class FunctionContext(use_metaclass(CachedMetaClass, FunctionMixin, FunctionAndClassBase)): + """ + Needed because of decorators. Decorators are evaluated here. + """ + def is_function(self): + return True + + @classmethod + def from_context(cls, context, tree_node): + def create(tree_node): + if context.is_class(): + return MethodContext( + context.evaluator, + context, + parent_context=parent_context, + tree_node=tree_node + ) + else: + return cls( + context.evaluator, + parent_context=parent_context, + tree_node=tree_node + ) + + overloaded_funcs = list(_find_overload_functions(context, tree_node)) + + parent_context = context + while parent_context.is_class() or parent_context.is_instance(): + parent_context = parent_context.parent_context + + function = create(tree_node) + + if overloaded_funcs: + return OverloadedFunctionContext( + function, + [create(f) for f in overloaded_funcs] + ) + return function + + def py__class__(self): + c, = contexts_from_qualified_names(self.evaluator, u'types', u'FunctionType') + return c + + def get_default_param_context(self): + return self.parent_context + + def get_signature_functions(self): + return [self] + + +class MethodContext(FunctionContext): + def __init__(self, evaluator, class_context, *args, **kwargs): + super(MethodContext, self).__init__(evaluator, *args, **kwargs) + self.class_context = class_context + + def get_default_param_context(self): + return self.class_context + + def get_qualified_names(self): + # Need to implement this, because the parent context of a method + # context is not the class context but the module. + names = self.class_context.get_qualified_names() + if names is None: + return None + return names + (self.py__name__(),) + + +class FunctionExecutionContext(TreeContext): + """ + This class is used to evaluate functions and their returns. + + This is the most complicated class, because it contains the logic to + transfer parameters. It is even more complicated, because there may be + multiple calls to functions and recursion has to be avoided. But this is + responsibility of the decorators. + """ + function_execution_filter = FunctionExecutionFilter + + def __init__(self, evaluator, parent_context, function_context, var_args): + super(FunctionExecutionContext, self).__init__( + evaluator, + parent_context, + function_context.tree_node, + ) + self.function_context = function_context + self.var_args = var_args + + @evaluator_method_cache(default=NO_CONTEXTS) + @recursion.execution_recursion_decorator() + def get_return_values(self, check_yields=False): + funcdef = self.tree_node + if funcdef.type == 'lambdef': + return self.eval_node(funcdef.children[-1]) + + if check_yields: + context_set = NO_CONTEXTS + returns = get_yield_exprs(self.evaluator, funcdef) + else: + returns = funcdef.iter_return_stmts() + from jedi.evaluate.gradual.annotation import infer_return_types + context_set = infer_return_types(self) + if context_set: + # If there are annotations, prefer them over anything else. + # This will make it faster. + return context_set + context_set |= docstrings.infer_return_types(self.function_context) + + for r in returns: + check = flow_analysis.reachability_check(self, funcdef, r) + if check is flow_analysis.UNREACHABLE: + debug.dbg('Return unreachable: %s', r) + else: + if check_yields: + context_set |= ContextSet.from_sets( + lazy_context.infer() + for lazy_context in self._get_yield_lazy_context(r) + ) + else: + try: + children = r.children + except AttributeError: + ctx = compiled.builtin_from_name(self.evaluator, u'None') + context_set |= ContextSet([ctx]) + else: + context_set |= self.eval_node(children[1]) + if check is flow_analysis.REACHABLE: + debug.dbg('Return reachable: %s', r) + break + return context_set + + def _get_yield_lazy_context(self, yield_expr): + if yield_expr.type == 'keyword': + # `yield` just yields None. + ctx = compiled.builtin_from_name(self.evaluator, u'None') + yield LazyKnownContext(ctx) + return + + node = yield_expr.children[1] + if node.type == 'yield_arg': # It must be a yield from. + cn = ContextualizedNode(self, node.children[1]) + for lazy_context in cn.infer().iterate(cn): + yield lazy_context + else: + yield LazyTreeContext(self, node) + + @recursion.execution_recursion_decorator(default=iter([])) + def get_yield_lazy_contexts(self, is_async=False): + # TODO: if is_async, wrap yield statements in Awaitable/async_generator_asend + for_parents = [(y, tree.search_ancestor(y, 'for_stmt', 'funcdef', + 'while_stmt', 'if_stmt')) + for y in get_yield_exprs(self.evaluator, self.tree_node)] + + # Calculate if the yields are placed within the same for loop. + yields_order = [] + last_for_stmt = None + for yield_, for_stmt in for_parents: + # For really simple for loops we can predict the order. Otherwise + # we just ignore it. + parent = for_stmt.parent + if parent.type == 'suite': + parent = parent.parent + if for_stmt.type == 'for_stmt' and parent == self.tree_node \ + and parser_utils.for_stmt_defines_one_name(for_stmt): # Simplicity for now. + if for_stmt == last_for_stmt: + yields_order[-1][1].append(yield_) + else: + yields_order.append((for_stmt, [yield_])) + elif for_stmt == self.tree_node: + yields_order.append((None, [yield_])) + else: + types = self.get_return_values(check_yields=True) + if types: + yield LazyKnownContexts(types) + return + last_for_stmt = for_stmt + + for for_stmt, yields in yields_order: + if for_stmt is None: + # No for_stmt, just normal yields. + for yield_ in yields: + for result in self._get_yield_lazy_context(yield_): + yield result + else: + input_node = for_stmt.get_testlist() + cn = ContextualizedNode(self, input_node) + ordered = cn.infer().iterate(cn) + ordered = list(ordered) + for lazy_context in ordered: + dct = {str(for_stmt.children[1].value): lazy_context.infer()} + with helpers.predefine_names(self, for_stmt, dct): + for yield_in_same_for_stmt in yields: + for result in self._get_yield_lazy_context(yield_in_same_for_stmt): + yield result + + def merge_yield_contexts(self, is_async=False): + return ContextSet.from_sets( + lazy_context.infer() + for lazy_context in self.get_yield_lazy_contexts() + ) + + def get_filters(self, search_global=False, until_position=None, origin_scope=None): + yield self.function_execution_filter(self.evaluator, self, + until_position=until_position, + origin_scope=origin_scope) + + @evaluator_method_cache() + def get_executed_params_and_issues(self): + return self.var_args.get_executed_params_and_issues(self) + + def matches_signature(self): + executed_params, issues = self.get_executed_params_and_issues() + if issues: + return False + + matches = all(executed_param.matches_signature() + for executed_param in executed_params) + if debug.enable_notice: + signature = parser_utils.get_call_signature(self.tree_node) + if matches: + debug.dbg("Overloading match: %s@%s (%s)", + signature, self.tree_node.start_pos[0], self.var_args, color='BLUE') + else: + debug.dbg("Overloading no match: %s@%s (%s)", + signature, self.tree_node.start_pos[0], self.var_args, color='BLUE') + return matches + + def infer(self): + """ + Created to be used by inheritance. + """ + evaluator = self.evaluator + is_coroutine = self.tree_node.parent.type in ('async_stmt', 'async_funcdef') + is_generator = bool(get_yield_exprs(evaluator, self.tree_node)) + from jedi.evaluate.gradual.typing import GenericClass + + if is_coroutine: + if is_generator: + if evaluator.environment.version_info < (3, 6): + return NO_CONTEXTS + async_generator_classes = evaluator.typing_module \ + .py__getattribute__('AsyncGenerator') + + yield_contexts = self.merge_yield_contexts(is_async=True) + # The contravariant doesn't seem to be defined. + generics = (yield_contexts.py__class__(), NO_CONTEXTS) + return ContextSet( + # In Python 3.6 AsyncGenerator is still a class. + GenericClass(c, generics) + for c in async_generator_classes + ).execute_annotation() + else: + if evaluator.environment.version_info < (3, 5): + return NO_CONTEXTS + async_classes = evaluator.typing_module.py__getattribute__('Coroutine') + return_contexts = self.get_return_values() + # Only the first generic is relevant. + generics = (return_contexts.py__class__(), NO_CONTEXTS, NO_CONTEXTS) + return ContextSet( + GenericClass(c, generics) for c in async_classes + ).execute_annotation() + else: + if is_generator: + return ContextSet([iterable.Generator(evaluator, self)]) + else: + return self.get_return_values() + + +class OverloadedFunctionContext(FunctionMixin, ContextWrapper): + def __init__(self, function, overloaded_functions): + super(OverloadedFunctionContext, self).__init__(function) + self._overloaded_functions = overloaded_functions + + def py__call__(self, arguments): + debug.dbg("Execute overloaded function %s", self._wrapped_context, color='BLUE') + function_executions = [] + context_set = NO_CONTEXTS + matched = False + for f in self._overloaded_functions: + function_execution = f.get_function_execution(arguments) + function_executions.append(function_execution) + if function_execution.matches_signature(): + matched = True + return function_execution.infer() + + if matched: + return context_set + + if self.evaluator.is_analysis: + # In this case we want precision. + return NO_CONTEXTS + return ContextSet.from_sets(fe.infer() for fe in function_executions) + + def get_signature_functions(self): + return self._overloaded_functions + + +def _find_overload_functions(context, tree_node): + def _is_overload_decorated(funcdef): + if funcdef.parent.type == 'decorated': + decorators = funcdef.parent.children[0] + if decorators.type == 'decorator': + decorators = [decorators] + else: + decorators = decorators.children + for decorator in decorators: + dotted_name = decorator.children[1] + if dotted_name.type == 'name' and dotted_name.value == 'overload': + # TODO check with contexts if it's the right overload + return True + return False + + if tree_node.type == 'lambdef': + return + + if _is_overload_decorated(tree_node): + yield tree_node + + while True: + filter = ParserTreeFilter( + context.evaluator, + context, + until_position=tree_node.start_pos + ) + names = filter.get(tree_node.name.value) + assert isinstance(names, list) + if not names: + break + + found = False + for name in names: + funcdef = name.tree_name.parent + if funcdef.type == 'funcdef' and _is_overload_decorated(funcdef): + tree_node = funcdef + found = True + yield funcdef + + if not found: + break diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/context/instance.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/context/instance.py new file mode 100644 index 0000000..e00ff03 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/context/instance.py @@ -0,0 +1,531 @@ +from abc import abstractproperty + +from jedi import debug +from jedi import settings +from jedi.evaluate import compiled +from jedi.evaluate.compiled.context import CompiledObjectFilter +from jedi.evaluate.helpers import contexts_from_qualified_names +from jedi.evaluate.filters import AbstractFilter +from jedi.evaluate.names import ContextName, TreeNameDefinition +from jedi.evaluate.base_context import Context, NO_CONTEXTS, ContextSet, \ + iterator_to_context_set, ContextWrapper +from jedi.evaluate.lazy_context import LazyKnownContext, LazyKnownContexts +from jedi.evaluate.cache import evaluator_method_cache +from jedi.evaluate.arguments import AnonymousArguments, \ + ValuesArguments, TreeArgumentsWrapper +from jedi.evaluate.context.function import \ + FunctionContext, FunctionMixin, OverloadedFunctionContext +from jedi.evaluate.context.klass import ClassContext, apply_py__get__, \ + ClassFilter +from jedi.evaluate.context import iterable +from jedi.parser_utils import get_parent_scope + + +class InstanceExecutedParam(object): + def __init__(self, instance, tree_param): + self._instance = instance + self._tree_param = tree_param + self.string_name = self._tree_param.name.value + + def infer(self): + return ContextSet([self._instance]) + + def matches_signature(self): + return True + + +class AnonymousInstanceArguments(AnonymousArguments): + def __init__(self, instance): + self._instance = instance + + def get_executed_params_and_issues(self, execution_context): + from jedi.evaluate.dynamic import search_params + tree_params = execution_context.tree_node.get_params() + if not tree_params: + return [], [] + + self_param = InstanceExecutedParam(self._instance, tree_params[0]) + if len(tree_params) == 1: + # If the only param is self, we don't need to try to find + # executions of this function, we have all the params already. + return [self_param], [] + executed_params = list(search_params( + execution_context.evaluator, + execution_context, + execution_context.tree_node + )) + executed_params[0] = self_param + return executed_params, [] + + +class AbstractInstanceContext(Context): + """ + This class is used to evaluate instances. + """ + api_type = u'instance' + + def __init__(self, evaluator, parent_context, class_context, var_args): + super(AbstractInstanceContext, self).__init__(evaluator, parent_context) + # Generated instances are classes that are just generated by self + # (No var_args) used. + self.class_context = class_context + self.var_args = var_args + + def is_instance(self): + return True + + def get_qualified_names(self): + return self.class_context.get_qualified_names() + + def get_annotated_class_object(self): + return self.class_context # This is the default. + + def py__call__(self, arguments): + names = self.get_function_slot_names(u'__call__') + if not names: + # Means the Instance is not callable. + return super(AbstractInstanceContext, self).py__call__(arguments) + + return ContextSet.from_sets(name.infer().execute(arguments) for name in names) + + def py__class__(self): + return self.class_context + + def py__bool__(self): + # Signalize that we don't know about the bool type. + return None + + def get_function_slot_names(self, name): + # Python classes don't look at the dictionary of the instance when + # looking up `__call__`. This is something that has to do with Python's + # internal slot system (note: not __slots__, but C slots). + for filter in self.get_filters(include_self_names=False): + names = filter.get(name) + if names: + return names + return [] + + def execute_function_slots(self, names, *evaluated_args): + return ContextSet.from_sets( + name.infer().execute_evaluated(*evaluated_args) + for name in names + ) + + def py__get__(self, obj, class_context): + """ + obj may be None. + """ + # Arguments in __get__ descriptors are obj, class. + # `method` is the new parent of the array, don't know if that's good. + names = self.get_function_slot_names(u'__get__') + if names: + if obj is None: + obj = compiled.builtin_from_name(self.evaluator, u'None') + return self.execute_function_slots(names, obj, class_context) + else: + return ContextSet([self]) + + def get_filters(self, search_global=None, until_position=None, + origin_scope=None, include_self_names=True): + class_context = self.get_annotated_class_object() + if include_self_names: + for cls in class_context.py__mro__(): + if not isinstance(cls, compiled.CompiledObject) \ + or cls.tree_node is not None: + # In this case we're excluding compiled objects that are + # not fake objects. It doesn't make sense for normal + # compiled objects to search for self variables. + yield SelfAttributeFilter(self.evaluator, self, cls, origin_scope) + + class_filters = class_context.get_filters( + search_global=False, + origin_scope=origin_scope, + is_instance=True, + ) + for f in class_filters: + if isinstance(f, ClassFilter): + yield InstanceClassFilter(self.evaluator, self, f) + elif isinstance(f, CompiledObjectFilter): + yield CompiledInstanceClassFilter(self.evaluator, self, f) + else: + # Propably from the metaclass. + yield f + + def py__getitem__(self, index_context_set, contextualized_node): + names = self.get_function_slot_names(u'__getitem__') + if not names: + return super(AbstractInstanceContext, self).py__getitem__( + index_context_set, + contextualized_node, + ) + + args = ValuesArguments([index_context_set]) + return ContextSet.from_sets(name.infer().execute(args) for name in names) + + def py__iter__(self, contextualized_node=None): + iter_slot_names = self.get_function_slot_names(u'__iter__') + if not iter_slot_names: + return super(AbstractInstanceContext, self).py__iter__(contextualized_node) + + def iterate(): + for generator in self.execute_function_slots(iter_slot_names): + if generator.is_instance() and not generator.is_compiled(): + # `__next__` logic. + if self.evaluator.environment.version_info.major == 2: + name = u'next' + else: + name = u'__next__' + next_slot_names = generator.get_function_slot_names(name) + if next_slot_names: + yield LazyKnownContexts( + generator.execute_function_slots(next_slot_names) + ) + else: + debug.warning('Instance has no __next__ function in %s.', generator) + else: + for lazy_context in generator.py__iter__(): + yield lazy_context + return iterate() + + @abstractproperty + def name(self): + pass + + def create_init_executions(self): + for name in self.get_function_slot_names(u'__init__'): + # TODO is this correct? I think we need to check for functions. + if isinstance(name, LazyInstanceClassName): + function = FunctionContext.from_context( + self.parent_context, + name.tree_name.parent + ) + bound_method = BoundMethod(self, function) + yield bound_method.get_function_execution(self.var_args) + + @evaluator_method_cache() + def create_instance_context(self, class_context, node): + if node.parent.type in ('funcdef', 'classdef'): + node = node.parent + scope = get_parent_scope(node) + if scope == class_context.tree_node: + return class_context + else: + parent_context = self.create_instance_context(class_context, scope) + if scope.type == 'funcdef': + func = FunctionContext.from_context( + parent_context, + scope, + ) + bound_method = BoundMethod(self, func) + if scope.name.value == '__init__' and parent_context == class_context: + return bound_method.get_function_execution(self.var_args) + else: + return bound_method.get_function_execution() + elif scope.type == 'classdef': + class_context = ClassContext(self.evaluator, parent_context, scope) + return class_context + elif scope.type in ('comp_for', 'sync_comp_for'): + # Comprehensions currently don't have a special scope in Jedi. + return self.create_instance_context(class_context, scope) + else: + raise NotImplementedError + return class_context + + def get_signatures(self): + call_funcs = self.py__getattribute__('__call__').py__get__(self, self.class_context) + return [s.bind(self) for s in call_funcs.get_signatures()] + + def __repr__(self): + return "<%s of %s(%s)>" % (self.__class__.__name__, self.class_context, + self.var_args) + + +class CompiledInstance(AbstractInstanceContext): + def __init__(self, evaluator, parent_context, class_context, var_args): + self._original_var_args = var_args + super(CompiledInstance, self).__init__(evaluator, parent_context, class_context, var_args) + + @property + def name(self): + return compiled.CompiledContextName(self, self.class_context.name.string_name) + + def get_first_non_keyword_argument_contexts(self): + key, lazy_context = next(self._original_var_args.unpack(), ('', None)) + if key is not None: + return NO_CONTEXTS + + return lazy_context.infer() + + def is_stub(self): + return False + + +class TreeInstance(AbstractInstanceContext): + def __init__(self, evaluator, parent_context, class_context, var_args): + # I don't think that dynamic append lookups should happen here. That + # sounds more like something that should go to py__iter__. + if class_context.py__name__() in ['list', 'set'] \ + and parent_context.get_root_context() == evaluator.builtins_module: + # compare the module path with the builtin name. + if settings.dynamic_array_additions: + var_args = iterable.get_dynamic_array_instance(self, var_args) + + super(TreeInstance, self).__init__(evaluator, parent_context, + class_context, var_args) + self.tree_node = class_context.tree_node + + @property + def name(self): + return ContextName(self, self.class_context.name.tree_name) + + # This can recurse, if the initialization of the class includes a reference + # to itself. + @evaluator_method_cache(default=None) + def _get_annotated_class_object(self): + from jedi.evaluate.gradual.annotation import py__annotations__, \ + infer_type_vars_for_execution + + for func in self._get_annotation_init_functions(): + # Just take the first result, it should always be one, because we + # control the typeshed code. + bound = BoundMethod(self, func) + execution = bound.get_function_execution(self.var_args) + if not execution.matches_signature(): + # First check if the signature even matches, if not we don't + # need to infer anything. + continue + + all_annotations = py__annotations__(execution.tree_node) + defined, = self.class_context.define_generics( + infer_type_vars_for_execution(execution, all_annotations), + ) + debug.dbg('Inferred instance context as %s', defined, color='BLUE') + return defined + return None + + def get_annotated_class_object(self): + return self._get_annotated_class_object() or self.class_context + + def _get_annotation_init_functions(self): + filter = next(self.class_context.get_filters()) + for init_name in filter.get('__init__'): + for init in init_name.infer(): + if init.is_function(): + for signature in init.get_signatures(): + yield signature.context + + +class AnonymousInstance(TreeInstance): + def __init__(self, evaluator, parent_context, class_context): + super(AnonymousInstance, self).__init__( + evaluator, + parent_context, + class_context, + var_args=AnonymousInstanceArguments(self), + ) + + def get_annotated_class_object(self): + return self.class_context # This is the default. + + +class CompiledInstanceName(compiled.CompiledName): + + def __init__(self, evaluator, instance, klass, name): + super(CompiledInstanceName, self).__init__( + evaluator, + klass.parent_context, + name.string_name + ) + self._instance = instance + self._class_member_name = name + + @iterator_to_context_set + def infer(self): + for result_context in self._class_member_name.infer(): + if result_context.api_type == 'function': + yield CompiledBoundMethod(result_context) + else: + yield result_context + + +class CompiledInstanceClassFilter(AbstractFilter): + name_class = CompiledInstanceName + + def __init__(self, evaluator, instance, f): + self._evaluator = evaluator + self._instance = instance + self._class_filter = f + + def get(self, name): + return self._convert(self._class_filter.get(name)) + + def values(self): + return self._convert(self._class_filter.values()) + + def _convert(self, names): + klass = self._class_filter.compiled_object + return [ + CompiledInstanceName(self._evaluator, self._instance, klass, n) + for n in names + ] + + +class BoundMethod(FunctionMixin, ContextWrapper): + def __init__(self, instance, function): + super(BoundMethod, self).__init__(function) + self.instance = instance + + def is_bound_method(self): + return True + + def py__class__(self): + c, = contexts_from_qualified_names(self.evaluator, u'types', u'MethodType') + return c + + def _get_arguments(self, arguments): + if arguments is None: + arguments = AnonymousInstanceArguments(self.instance) + + return InstanceArguments(self.instance, arguments) + + def get_function_execution(self, arguments=None): + arguments = self._get_arguments(arguments) + return super(BoundMethod, self).get_function_execution(arguments) + + def py__call__(self, arguments): + if isinstance(self._wrapped_context, OverloadedFunctionContext): + return self._wrapped_context.py__call__(self._get_arguments(arguments)) + + function_execution = self.get_function_execution(arguments) + return function_execution.infer() + + def get_signature_functions(self): + return [ + BoundMethod(self.instance, f) + for f in self._wrapped_context.get_signature_functions() + ] + + def get_signatures(self): + return [sig.bind(self) for sig in super(BoundMethod, self).get_signatures()] + + def __repr__(self): + return '<%s: %s>' % (self.__class__.__name__, self._wrapped_context) + + +class CompiledBoundMethod(ContextWrapper): + def is_bound_method(self): + return True + + def get_signatures(self): + return [sig.bind(self) for sig in self._wrapped_context.get_signatures()] + + +class SelfName(TreeNameDefinition): + """ + This name calculates the parent_context lazily. + """ + def __init__(self, instance, class_context, tree_name): + self._instance = instance + self.class_context = class_context + self.tree_name = tree_name + + @property + def parent_context(self): + return self._instance.create_instance_context(self.class_context, self.tree_name) + + +class LazyInstanceClassName(object): + def __init__(self, instance, class_context, class_member_name): + self._instance = instance + self.class_context = class_context + self._class_member_name = class_member_name + + @iterator_to_context_set + def infer(self): + for result_context in self._class_member_name.infer(): + for c in apply_py__get__(result_context, self._instance, self.class_context): + yield c + + def __getattr__(self, name): + return getattr(self._class_member_name, name) + + def __repr__(self): + return '<%s: %s>' % (self.__class__.__name__, self._class_member_name) + + +class InstanceClassFilter(AbstractFilter): + """ + This filter is special in that it uses the class filter and wraps the + resulting names in LazyINstanceClassName. The idea is that the class name + filtering can be very flexible and always be reflected in instances. + """ + def __init__(self, evaluator, instance, class_filter): + self._instance = instance + self._class_filter = class_filter + + def get(self, name): + return self._convert(self._class_filter.get(name, from_instance=True)) + + def values(self): + return self._convert(self._class_filter.values(from_instance=True)) + + def _convert(self, names): + return [LazyInstanceClassName(self._instance, self._class_filter.context, n) for n in names] + + def __repr__(self): + return '<%s for %s>' % (self.__class__.__name__, self._class_filter.context) + + +class SelfAttributeFilter(ClassFilter): + """ + This class basically filters all the use cases where `self.*` was assigned. + """ + name_class = SelfName + + def __init__(self, evaluator, context, class_context, origin_scope): + super(SelfAttributeFilter, self).__init__( + evaluator=evaluator, + context=context, + node_context=class_context, + origin_scope=origin_scope, + is_instance=True, + ) + self._class_context = class_context + + def _filter(self, names): + names = self._filter_self_names(names) + start, end = self._parser_scope.start_pos, self._parser_scope.end_pos + return [n for n in names if start < n.start_pos < end] + + def _filter_self_names(self, names): + for name in names: + trailer = name.parent + if trailer.type == 'trailer' \ + and len(trailer.parent.children) == 2 \ + and trailer.children[0] == '.': + if name.is_definition() and self._access_possible(name, from_instance=True): + # TODO filter non-self assignments. + yield name + + def _convert_names(self, names): + return [self.name_class(self.context, self._class_context, name) for name in names] + + def _check_flows(self, names): + return names + + +class InstanceArguments(TreeArgumentsWrapper): + def __init__(self, instance, arguments): + super(InstanceArguments, self).__init__(arguments) + self.instance = instance + + def unpack(self, func=None): + yield None, LazyKnownContext(self.instance) + for values in self._wrapped_arguments.unpack(func): + yield values + + def get_executed_params_and_issues(self, execution_context): + if isinstance(self._wrapped_arguments, AnonymousInstanceArguments): + return self._wrapped_arguments.get_executed_params_and_issues(execution_context) + + return super(InstanceArguments, self).get_executed_params_and_issues(execution_context) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/context/iterable.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/context/iterable.py new file mode 100644 index 0000000..bf69bde --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/context/iterable.py @@ -0,0 +1,821 @@ +""" +Contains all classes and functions to deal with lists, dicts, generators and +iterators in general. + +Array modifications +******************* + +If the content of an array (``set``/``list``) is requested somewhere, the +current module will be checked for appearances of ``arr.append``, +``arr.insert``, etc. If the ``arr`` name points to an actual array, the +content will be added + +This can be really cpu intensive, as you can imagine. Because |jedi| has to +follow **every** ``append`` and check wheter it's the right array. However this +works pretty good, because in *slow* cases, the recursion detector and other +settings will stop this process. + +It is important to note that: + +1. Array modfications work only in the current module. +2. Jedi only checks Array additions; ``list.pop``, etc are ignored. +""" +import sys + +from jedi import debug +from jedi import settings +from jedi._compatibility import force_unicode, is_py3 +from jedi.evaluate import compiled +from jedi.evaluate import analysis +from jedi.evaluate import recursion +from jedi.evaluate.lazy_context import LazyKnownContext, LazyKnownContexts, \ + LazyTreeContext +from jedi.evaluate.helpers import get_int_or_none, is_string, \ + predefine_names, evaluate_call_of_leaf, reraise_getitem_errors, \ + SimpleGetItemNotFound +from jedi.evaluate.utils import safe_property, to_list +from jedi.evaluate.cache import evaluator_method_cache +from jedi.evaluate.filters import ParserTreeFilter, LazyAttributeOverwrite, \ + publish_method +from jedi.evaluate.base_context import ContextSet, Context, NO_CONTEXTS, \ + TreeContext, ContextualizedNode, iterate_contexts, HelperContextMixin, _sentinel +from jedi.parser_utils import get_sync_comp_fors + + +class IterableMixin(object): + def py__stop_iteration_returns(self): + return ContextSet([compiled.builtin_from_name(self.evaluator, u'None')]) + + # At the moment, safe values are simple values like "foo", 1 and not + # lists/dicts. Therefore as a small speed optimization we can just do the + # default instead of resolving the lazy wrapped contexts, that are just + # doing this in the end as well. + # This mostly speeds up patterns like `sys.version_info >= (3, 0)` in + # typeshed. + if sys.version_info[0] == 2: + # Python 2........... + def get_safe_value(self, default=_sentinel): + if default is _sentinel: + raise ValueError("There exists no safe value for context %s" % self) + return default + else: + get_safe_value = Context.get_safe_value + + +class GeneratorBase(LazyAttributeOverwrite, IterableMixin): + array_type = None + + def _get_wrapped_context(self): + generator, = self.evaluator.typing_module \ + .py__getattribute__('Generator') \ + .execute_annotation() + return generator + + def is_instance(self): + return False + + def py__bool__(self): + return True + + @publish_method('__iter__') + def py__iter__(self, contextualized_node=None): + return ContextSet([self]) + + @publish_method('send') + @publish_method('next', python_version_match=2) + @publish_method('__next__', python_version_match=3) + def py__next__(self): + return ContextSet.from_sets(lazy_context.infer() for lazy_context in self.py__iter__()) + + def py__stop_iteration_returns(self): + return ContextSet([compiled.builtin_from_name(self.evaluator, u'None')]) + + @property + def name(self): + return compiled.CompiledContextName(self, 'Generator') + + +class Generator(GeneratorBase): + """Handling of `yield` functions.""" + def __init__(self, evaluator, func_execution_context): + super(Generator, self).__init__(evaluator) + self._func_execution_context = func_execution_context + + def py__iter__(self, contextualized_node=None): + return self._func_execution_context.get_yield_lazy_contexts() + + def py__stop_iteration_returns(self): + return self._func_execution_context.get_return_values() + + def __repr__(self): + return "<%s of %s>" % (type(self).__name__, self._func_execution_context) + + +class CompForContext(TreeContext): + @classmethod + def from_comp_for(cls, parent_context, comp_for): + return cls(parent_context.evaluator, parent_context, comp_for) + + def get_filters(self, search_global=False, until_position=None, origin_scope=None): + yield ParserTreeFilter(self.evaluator, self) + + +def comprehension_from_atom(evaluator, context, atom): + bracket = atom.children[0] + test_list_comp = atom.children[1] + + if bracket == '{': + if atom.children[1].children[1] == ':': + sync_comp_for = test_list_comp.children[3] + if sync_comp_for.type == 'comp_for': + sync_comp_for = sync_comp_for.children[1] + + return DictComprehension( + evaluator, + context, + sync_comp_for_node=sync_comp_for, + key_node=test_list_comp.children[0], + value_node=test_list_comp.children[2], + ) + else: + cls = SetComprehension + elif bracket == '(': + cls = GeneratorComprehension + elif bracket == '[': + cls = ListComprehension + + sync_comp_for = test_list_comp.children[1] + if sync_comp_for.type == 'comp_for': + sync_comp_for = sync_comp_for.children[1] + + return cls( + evaluator, + defining_context=context, + sync_comp_for_node=sync_comp_for, + entry_node=test_list_comp.children[0], + ) + + +class ComprehensionMixin(object): + @evaluator_method_cache() + def _get_comp_for_context(self, parent_context, comp_for): + return CompForContext.from_comp_for(parent_context, comp_for) + + def _nested(self, comp_fors, parent_context=None): + comp_for = comp_fors[0] + + is_async = comp_for.parent.type == 'comp_for' + + input_node = comp_for.children[3] + parent_context = parent_context or self._defining_context + input_types = parent_context.eval_node(input_node) + # TODO: simulate await if self.is_async + + cn = ContextualizedNode(parent_context, input_node) + iterated = input_types.iterate(cn, is_async=is_async) + exprlist = comp_for.children[1] + for i, lazy_context in enumerate(iterated): + types = lazy_context.infer() + dct = unpack_tuple_to_dict(parent_context, types, exprlist) + context_ = self._get_comp_for_context( + parent_context, + comp_for, + ) + with predefine_names(context_, comp_for, dct): + try: + for result in self._nested(comp_fors[1:], context_): + yield result + except IndexError: + iterated = context_.eval_node(self._entry_node) + if self.array_type == 'dict': + yield iterated, context_.eval_node(self._value_node) + else: + yield iterated + + @evaluator_method_cache(default=[]) + @to_list + def _iterate(self): + comp_fors = tuple(get_sync_comp_fors(self._sync_comp_for_node)) + for result in self._nested(comp_fors): + yield result + + def py__iter__(self, contextualized_node=None): + for set_ in self._iterate(): + yield LazyKnownContexts(set_) + + def __repr__(self): + return "<%s of %s>" % (type(self).__name__, self._sync_comp_for_node) + + +class _DictMixin(object): + def _get_generics(self): + return tuple(c_set.py__class__() for c_set in self.get_mapping_item_contexts()) + + +class Sequence(LazyAttributeOverwrite, IterableMixin): + api_type = u'instance' + + @property + def name(self): + return compiled.CompiledContextName(self, self.array_type) + + def _get_generics(self): + return (self.merge_types_of_iterate().py__class__(),) + + def _get_wrapped_context(self): + from jedi.evaluate.gradual.typing import GenericClass + klass = compiled.builtin_from_name(self.evaluator, self.array_type) + c, = GenericClass(klass, self._get_generics()).execute_annotation() + return c + + def py__bool__(self): + return None # We don't know the length, because of appends. + + def py__class__(self): + return compiled.builtin_from_name(self.evaluator, self.array_type) + + @safe_property + def parent(self): + return self.evaluator.builtins_module + + def py__getitem__(self, index_context_set, contextualized_node): + if self.array_type == 'dict': + return self._dict_values() + return iterate_contexts(ContextSet([self])) + + +class _BaseComprehension(ComprehensionMixin): + def __init__(self, evaluator, defining_context, sync_comp_for_node, entry_node): + assert sync_comp_for_node.type == 'sync_comp_for' + super(_BaseComprehension, self).__init__(evaluator) + self._defining_context = defining_context + self._sync_comp_for_node = sync_comp_for_node + self._entry_node = entry_node + + +class ListComprehension(_BaseComprehension, Sequence): + array_type = u'list' + + def py__simple_getitem__(self, index): + if isinstance(index, slice): + return ContextSet([self]) + + all_types = list(self.py__iter__()) + with reraise_getitem_errors(IndexError, TypeError): + lazy_context = all_types[index] + return lazy_context.infer() + + +class SetComprehension(_BaseComprehension, Sequence): + array_type = u'set' + + +class GeneratorComprehension(_BaseComprehension, GeneratorBase): + pass + + +class DictComprehension(ComprehensionMixin, Sequence): + array_type = u'dict' + + def __init__(self, evaluator, defining_context, sync_comp_for_node, key_node, value_node): + assert sync_comp_for_node.type == 'sync_comp_for' + super(DictComprehension, self).__init__(evaluator) + self._defining_context = defining_context + self._sync_comp_for_node = sync_comp_for_node + self._entry_node = key_node + self._value_node = value_node + + def py__iter__(self, contextualized_node=None): + for keys, values in self._iterate(): + yield LazyKnownContexts(keys) + + def py__simple_getitem__(self, index): + for keys, values in self._iterate(): + for k in keys: + if isinstance(k, compiled.CompiledObject): + # Be careful in the future if refactoring, index could be a + # slice. + if k.get_safe_value(default=object()) == index: + return values + raise SimpleGetItemNotFound() + + def _dict_keys(self): + return ContextSet.from_sets(keys for keys, values in self._iterate()) + + def _dict_values(self): + return ContextSet.from_sets(values for keys, values in self._iterate()) + + @publish_method('values') + def _imitate_values(self): + lazy_context = LazyKnownContexts(self._dict_values()) + return ContextSet([FakeSequence(self.evaluator, u'list', [lazy_context])]) + + @publish_method('items') + def _imitate_items(self): + lazy_contexts = [ + LazyKnownContext( + FakeSequence( + self.evaluator, + u'tuple', + [LazyKnownContexts(key), + LazyKnownContexts(value)] + ) + ) + for key, value in self._iterate() + ] + + return ContextSet([FakeSequence(self.evaluator, u'list', lazy_contexts)]) + + def get_mapping_item_contexts(self): + return self._dict_keys(), self._dict_values() + + def exact_key_items(self): + # NOTE: A smarter thing can probably done here to achieve better + # completions, but at least like this jedi doesn't crash + return [] + + +class SequenceLiteralContext(Sequence): + _TUPLE_LIKE = 'testlist_star_expr', 'testlist', 'subscriptlist' + mapping = {'(': u'tuple', + '[': u'list', + '{': u'set'} + + def __init__(self, evaluator, defining_context, atom): + super(SequenceLiteralContext, self).__init__(evaluator) + self.atom = atom + self._defining_context = defining_context + + if self.atom.type in self._TUPLE_LIKE: + self.array_type = u'tuple' + else: + self.array_type = SequenceLiteralContext.mapping[atom.children[0]] + """The builtin name of the array (list, set, tuple or dict).""" + + def py__simple_getitem__(self, index): + """Here the index is an int/str. Raises IndexError/KeyError.""" + if self.array_type == u'dict': + compiled_obj_index = compiled.create_simple_object(self.evaluator, index) + for key, value in self.get_tree_entries(): + for k in self._defining_context.eval_node(key): + try: + method = k.execute_operation + except AttributeError: + pass + else: + if method(compiled_obj_index, u'==').get_safe_value(): + return self._defining_context.eval_node(value) + raise SimpleGetItemNotFound('No key found in dictionary %s.' % self) + + if isinstance(index, slice): + return ContextSet([self]) + else: + with reraise_getitem_errors(TypeError, KeyError, IndexError): + node = self.get_tree_entries()[index] + return self._defining_context.eval_node(node) + + def py__iter__(self, contextualized_node=None): + """ + While values returns the possible values for any array field, this + function returns the value for a certain index. + """ + if self.array_type == u'dict': + # Get keys. + types = NO_CONTEXTS + for k, _ in self.get_tree_entries(): + types |= self._defining_context.eval_node(k) + # We don't know which dict index comes first, therefore always + # yield all the types. + for _ in types: + yield LazyKnownContexts(types) + else: + for node in self.get_tree_entries(): + if node == ':' or node.type == 'subscript': + # TODO this should probably use at least part of the code + # of eval_subscript_list. + yield LazyKnownContext(Slice(self._defining_context, None, None, None)) + else: + yield LazyTreeContext(self._defining_context, node) + for addition in check_array_additions(self._defining_context, self): + yield addition + + def py__len__(self): + # This function is not really used often. It's more of a try. + return len(self.get_tree_entries()) + + def _dict_values(self): + return ContextSet.from_sets( + self._defining_context.eval_node(v) + for k, v in self.get_tree_entries() + ) + + def get_tree_entries(self): + c = self.atom.children + + if self.atom.type in self._TUPLE_LIKE: + return c[::2] + + array_node = c[1] + if array_node in (']', '}', ')'): + return [] # Direct closing bracket, doesn't contain items. + + if array_node.type == 'testlist_comp': + # filter out (for now) pep 448 single-star unpacking + return [value for value in array_node.children[::2] + if value.type != "star_expr"] + elif array_node.type == 'dictorsetmaker': + kv = [] + iterator = iter(array_node.children) + for key in iterator: + if key == "**": + # dict with pep 448 double-star unpacking + # for now ignoring the values imported by ** + next(iterator) + next(iterator, None) # Possible comma. + else: + op = next(iterator, None) + if op is None or op == ',': + if key.type == "star_expr": + # pep 448 single-star unpacking + # for now ignoring values imported by * + pass + else: + kv.append(key) # A set. + else: + assert op == ':' # A dict. + kv.append((key, next(iterator))) + next(iterator, None) # Possible comma. + return kv + else: + if array_node.type == "star_expr": + # pep 448 single-star unpacking + # for now ignoring values imported by * + return [] + else: + return [array_node] + + def exact_key_items(self): + """ + Returns a generator of tuples like dict.items(), where the key is + resolved (as a string) and the values are still lazy contexts. + """ + for key_node, value in self.get_tree_entries(): + for key in self._defining_context.eval_node(key_node): + if is_string(key): + yield key.get_safe_value(), LazyTreeContext(self._defining_context, value) + + def __repr__(self): + return "<%s of %s>" % (self.__class__.__name__, self.atom) + + +class DictLiteralContext(_DictMixin, SequenceLiteralContext): + array_type = u'dict' + + def __init__(self, evaluator, defining_context, atom): + super(SequenceLiteralContext, self).__init__(evaluator) + self._defining_context = defining_context + self.atom = atom + + @publish_method('values') + def _imitate_values(self): + lazy_context = LazyKnownContexts(self._dict_values()) + return ContextSet([FakeSequence(self.evaluator, u'list', [lazy_context])]) + + @publish_method('items') + def _imitate_items(self): + lazy_contexts = [ + LazyKnownContext(FakeSequence( + self.evaluator, u'tuple', + (LazyTreeContext(self._defining_context, key_node), + LazyTreeContext(self._defining_context, value_node)) + )) for key_node, value_node in self.get_tree_entries() + ] + + return ContextSet([FakeSequence(self.evaluator, u'list', lazy_contexts)]) + + def _dict_keys(self): + return ContextSet.from_sets( + self._defining_context.eval_node(k) + for k, v in self.get_tree_entries() + ) + + def get_mapping_item_contexts(self): + return self._dict_keys(), self._dict_values() + + +class _FakeArray(SequenceLiteralContext): + def __init__(self, evaluator, container, type): + super(SequenceLiteralContext, self).__init__(evaluator) + self.array_type = type + self.atom = container + # TODO is this class really needed? + + +class FakeSequence(_FakeArray): + def __init__(self, evaluator, array_type, lazy_context_list): + """ + type should be one of "tuple", "list" + """ + super(FakeSequence, self).__init__(evaluator, None, array_type) + self._lazy_context_list = lazy_context_list + + def py__simple_getitem__(self, index): + if isinstance(index, slice): + return ContextSet([self]) + + with reraise_getitem_errors(IndexError, TypeError): + lazy_context = self._lazy_context_list[index] + return lazy_context.infer() + + def py__iter__(self, contextualized_node=None): + return self._lazy_context_list + + def py__bool__(self): + return bool(len(self._lazy_context_list)) + + def __repr__(self): + return "<%s of %s>" % (type(self).__name__, self._lazy_context_list) + + +class FakeDict(_DictMixin, _FakeArray): + def __init__(self, evaluator, dct): + super(FakeDict, self).__init__(evaluator, dct, u'dict') + self._dct = dct + + def py__iter__(self, contextualized_node=None): + for key in self._dct: + yield LazyKnownContext(compiled.create_simple_object(self.evaluator, key)) + + def py__simple_getitem__(self, index): + if is_py3 and self.evaluator.environment.version_info.major == 2: + # In Python 2 bytes and unicode compare. + if isinstance(index, bytes): + index_unicode = force_unicode(index) + try: + return self._dct[index_unicode].infer() + except KeyError: + pass + elif isinstance(index, str): + index_bytes = index.encode('utf-8') + try: + return self._dct[index_bytes].infer() + except KeyError: + pass + + with reraise_getitem_errors(KeyError, TypeError): + lazy_context = self._dct[index] + return lazy_context.infer() + + @publish_method('values') + def _values(self): + return ContextSet([FakeSequence( + self.evaluator, u'tuple', + [LazyKnownContexts(self._dict_values())] + )]) + + def _dict_values(self): + return ContextSet.from_sets(lazy_context.infer() for lazy_context in self._dct.values()) + + def _dict_keys(self): + return ContextSet.from_sets(lazy_context.infer() for lazy_context in self.py__iter__()) + + def get_mapping_item_contexts(self): + return self._dict_keys(), self._dict_values() + + def exact_key_items(self): + return self._dct.items() + + +class MergedArray(_FakeArray): + def __init__(self, evaluator, arrays): + super(MergedArray, self).__init__(evaluator, arrays, arrays[-1].array_type) + self._arrays = arrays + + def py__iter__(self, contextualized_node=None): + for array in self._arrays: + for lazy_context in array.py__iter__(): + yield lazy_context + + def py__simple_getitem__(self, index): + return ContextSet.from_sets(lazy_context.infer() for lazy_context in self.py__iter__()) + + def get_tree_entries(self): + for array in self._arrays: + for a in array.get_tree_entries(): + yield a + + def __len__(self): + return sum(len(a) for a in self._arrays) + + +def unpack_tuple_to_dict(context, types, exprlist): + """ + Unpacking tuple assignments in for statements and expr_stmts. + """ + if exprlist.type == 'name': + return {exprlist.value: types} + elif exprlist.type == 'atom' and exprlist.children[0] in ('(', '['): + return unpack_tuple_to_dict(context, types, exprlist.children[1]) + elif exprlist.type in ('testlist', 'testlist_comp', 'exprlist', + 'testlist_star_expr'): + dct = {} + parts = iter(exprlist.children[::2]) + n = 0 + for lazy_context in types.iterate(exprlist): + n += 1 + try: + part = next(parts) + except StopIteration: + # TODO this context is probably not right. + analysis.add(context, 'value-error-too-many-values', part, + message="ValueError: too many values to unpack (expected %s)" % n) + else: + dct.update(unpack_tuple_to_dict(context, lazy_context.infer(), part)) + has_parts = next(parts, None) + if types and has_parts is not None: + # TODO this context is probably not right. + analysis.add(context, 'value-error-too-few-values', has_parts, + message="ValueError: need more than %s values to unpack" % n) + return dct + elif exprlist.type == 'power' or exprlist.type == 'atom_expr': + # Something like ``arr[x], var = ...``. + # This is something that is not yet supported, would also be difficult + # to write into a dict. + return {} + elif exprlist.type == 'star_expr': # `a, *b, c = x` type unpackings + # Currently we're not supporting them. + return {} + raise NotImplementedError + + +def check_array_additions(context, sequence): + """ Just a mapper function for the internal _check_array_additions """ + if sequence.array_type not in ('list', 'set'): + # TODO also check for dict updates + return NO_CONTEXTS + + return _check_array_additions(context, sequence) + + +@evaluator_method_cache(default=NO_CONTEXTS) +@debug.increase_indent +def _check_array_additions(context, sequence): + """ + Checks if a `Array` has "add" (append, insert, extend) statements: + + >>> a = [""] + >>> a.append(1) + """ + from jedi.evaluate import arguments + + debug.dbg('Dynamic array search for %s' % sequence, color='MAGENTA') + module_context = context.get_root_context() + if not settings.dynamic_array_additions or isinstance(module_context, compiled.CompiledObject): + debug.dbg('Dynamic array search aborted.', color='MAGENTA') + return NO_CONTEXTS + + def find_additions(context, arglist, add_name): + params = list(arguments.TreeArguments(context.evaluator, context, arglist).unpack()) + result = set() + if add_name in ['insert']: + params = params[1:] + if add_name in ['append', 'add', 'insert']: + for key, lazy_context in params: + result.add(lazy_context) + elif add_name in ['extend', 'update']: + for key, lazy_context in params: + result |= set(lazy_context.infer().iterate()) + return result + + temp_param_add, settings.dynamic_params_for_other_modules = \ + settings.dynamic_params_for_other_modules, False + + is_list = sequence.name.string_name == 'list' + search_names = (['append', 'extend', 'insert'] if is_list else ['add', 'update']) + + added_types = set() + for add_name in search_names: + try: + possible_names = module_context.tree_node.get_used_names()[add_name] + except KeyError: + continue + else: + for name in possible_names: + context_node = context.tree_node + if not (context_node.start_pos < name.start_pos < context_node.end_pos): + continue + trailer = name.parent + power = trailer.parent + trailer_pos = power.children.index(trailer) + try: + execution_trailer = power.children[trailer_pos + 1] + except IndexError: + continue + else: + if execution_trailer.type != 'trailer' \ + or execution_trailer.children[0] != '(' \ + or execution_trailer.children[1] == ')': + continue + + random_context = context.create_context(name) + + with recursion.execution_allowed(context.evaluator, power) as allowed: + if allowed: + found = evaluate_call_of_leaf( + random_context, + name, + cut_own_trailer=True + ) + if sequence in found: + # The arrays match. Now add the results + added_types |= find_additions( + random_context, + execution_trailer.children[1], + add_name + ) + + # reset settings + settings.dynamic_params_for_other_modules = temp_param_add + debug.dbg('Dynamic array result %s' % added_types, color='MAGENTA') + return added_types + + +def get_dynamic_array_instance(instance, arguments): + """Used for set() and list() instances.""" + ai = _ArrayInstance(instance, arguments) + from jedi.evaluate import arguments + return arguments.ValuesArguments([ContextSet([ai])]) + + +class _ArrayInstance(HelperContextMixin): + """ + Used for the usage of set() and list(). + This is definitely a hack, but a good one :-) + It makes it possible to use set/list conversions. + """ + def __init__(self, instance, var_args): + self.instance = instance + self.var_args = var_args + + def py__class__(self): + tuple_, = self.instance.evaluator.builtins_module.py__getattribute__('tuple') + return tuple_ + + def py__iter__(self, contextualized_node=None): + var_args = self.var_args + try: + _, lazy_context = next(var_args.unpack()) + except StopIteration: + pass + else: + for lazy in lazy_context.infer().iterate(): + yield lazy + + from jedi.evaluate import arguments + if isinstance(var_args, arguments.TreeArguments): + additions = _check_array_additions(var_args.context, self.instance) + for addition in additions: + yield addition + + def iterate(self, contextualized_node=None, is_async=False): + return self.py__iter__(contextualized_node) + + +class Slice(object): + def __init__(self, context, start, stop, step): + self._context = context + self._slice_object = None + # All of them are either a Precedence or None. + self._start = start + self._stop = stop + self._step = step + + def __getattr__(self, name): + if self._slice_object is None: + context = compiled.builtin_from_name(self._context.evaluator, 'slice') + self._slice_object, = context.execute_evaluated() + return getattr(self._slice_object, name) + + @property + def obj(self): + """ + Imitate CompiledObject.obj behavior and return a ``builtin.slice()`` + object. + """ + def get(element): + if element is None: + return None + + result = self._context.eval_node(element) + if len(result) != 1: + # For simplicity, we want slices to be clear defined with just + # one type. Otherwise we will return an empty slice object. + raise IndexError + + context, = result + return get_int_or_none(context) + + try: + return slice(get(self._start), get(self._stop), get(self._step)) + except IndexError: + return slice(None, None, None) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/context/klass.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/context/klass.py new file mode 100644 index 0000000..b587c6e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/context/klass.py @@ -0,0 +1,344 @@ +""" +Like described in the :mod:`parso.python.tree` module, +there's a need for an ast like module to represent the states of parsed +modules. + +But now there are also structures in Python that need a little bit more than +that. An ``Instance`` for example is only a ``Class`` before it is +instantiated. This class represents these cases. + +So, why is there also a ``Class`` class here? Well, there are decorators and +they change classes in Python 3. + +Representation modules also define "magic methods". Those methods look like +``py__foo__`` and are typically mappable to the Python equivalents ``__call__`` +and others. Here's a list: + +====================================== ======================================== +**Method** **Description** +-------------------------------------- ---------------------------------------- +py__call__(arguments: Array) On callable objects, returns types. +py__bool__() Returns True/False/None; None means that + there's no certainty. +py__bases__() Returns a list of base classes. +py__iter__() Returns a generator of a set of types. +py__class__() Returns the class of an instance. +py__simple_getitem__(index: int/str) Returns a a set of types of the index. + Can raise an IndexError/KeyError. +py__getitem__(indexes: ContextSet) Returns a a set of types of the index. +py__file__() Only on modules. Returns None if does + not exist. +py__package__() -> List[str] Only on modules. For the import system. +py__path__() Only on modules. For the import system. +py__get__(call_object) Only on instances. Simulates + descriptors. +py__doc__() Returns the docstring for a context. +====================================== ======================================== + +""" +from jedi import debug +from jedi._compatibility import use_metaclass +from jedi.parser_utils import get_cached_parent_scope +from jedi.evaluate.cache import evaluator_method_cache, CachedMetaClass, \ + evaluator_method_generator_cache +from jedi.evaluate import compiled +from jedi.evaluate.lazy_context import LazyKnownContexts +from jedi.evaluate.filters import ParserTreeFilter +from jedi.evaluate.names import TreeNameDefinition, ContextName +from jedi.evaluate.arguments import unpack_arglist, ValuesArguments +from jedi.evaluate.base_context import ContextSet, iterator_to_context_set, \ + NO_CONTEXTS +from jedi.evaluate.context.function import FunctionAndClassBase +from jedi.plugins import plugin_manager + + +def apply_py__get__(context, instance, class_context): + try: + method = context.py__get__ + except AttributeError: + yield context + else: + for descriptor_context in method(instance, class_context): + yield descriptor_context + + +class ClassName(TreeNameDefinition): + def __init__(self, parent_context, tree_name, name_context, apply_decorators): + super(ClassName, self).__init__(parent_context, tree_name) + self._name_context = name_context + self._apply_decorators = apply_decorators + + @iterator_to_context_set + def infer(self): + # We're using a different context to infer, so we cannot call super(). + from jedi.evaluate.syntax_tree import tree_name_to_contexts + inferred = tree_name_to_contexts( + self.parent_context.evaluator, self._name_context, self.tree_name) + + for result_context in inferred: + if self._apply_decorators: + for c in apply_py__get__(result_context, + instance=None, + class_context=self.parent_context): + yield c + else: + yield result_context + + +class ClassFilter(ParserTreeFilter): + name_class = ClassName + + def __init__(self, *args, **kwargs): + self._is_instance = kwargs.pop('is_instance') # Python 2 :/ + super(ClassFilter, self).__init__(*args, **kwargs) + + def _convert_names(self, names): + return [ + self.name_class( + parent_context=self.context, + tree_name=name, + name_context=self._node_context, + apply_decorators=not self._is_instance, + ) for name in names + ] + + def _equals_origin_scope(self): + node = self._origin_scope + while node is not None: + if node == self._parser_scope or node == self.context: + return True + node = get_cached_parent_scope(self._used_names, node) + return False + + def _access_possible(self, name, from_instance=False): + # Filter for ClassVar variables + # TODO this is not properly done, yet. It just checks for the string + # ClassVar in the annotation, which can be quite imprecise. If we + # wanted to do this correct, we would have to resolve the ClassVar. + if not from_instance: + expr_stmt = name.get_definition() + if expr_stmt is not None and expr_stmt.type == 'expr_stmt': + annassign = expr_stmt.children[1] + if annassign.type == 'annassign': + # TODO this is not proper matching + if 'ClassVar' not in annassign.children[1].get_code(): + return False + + # Filter for name mangling of private variables like __foo + return not name.value.startswith('__') or name.value.endswith('__') \ + or self._equals_origin_scope() + + def _filter(self, names, from_instance=False): + names = super(ClassFilter, self)._filter(names) + return [name for name in names if self._access_possible(name, from_instance)] + + +class ClassMixin(object): + def is_class(self): + return True + + def py__call__(self, arguments=None): + from jedi.evaluate.context import TreeInstance + if arguments is None: + arguments = ValuesArguments([]) + return ContextSet([TreeInstance(self.evaluator, self.parent_context, self, arguments)]) + + def py__class__(self): + return compiled.builtin_from_name(self.evaluator, u'type') + + @property + def name(self): + return ContextName(self, self.tree_node.name) + + def py__name__(self): + return self.name.string_name + + def get_param_names(self): + for context_ in self.py__getattribute__(u'__init__'): + if context_.is_function(): + return list(context_.get_param_names())[1:] + return [] + + @evaluator_method_generator_cache() + def py__mro__(self): + mro = [self] + yield self + # TODO Do a proper mro resolution. Currently we are just listing + # classes. However, it's a complicated algorithm. + for lazy_cls in self.py__bases__(): + # TODO there's multiple different mro paths possible if this yields + # multiple possibilities. Could be changed to be more correct. + for cls in lazy_cls.infer(): + # TODO detect for TypeError: duplicate base class str, + # e.g. `class X(str, str): pass` + try: + mro_method = cls.py__mro__ + except AttributeError: + # TODO add a TypeError like: + """ + >>> class Y(lambda: test): pass + Traceback (most recent call last): + File "", line 1, in + TypeError: function() argument 1 must be code, not str + >>> class Y(1): pass + Traceback (most recent call last): + File "", line 1, in + TypeError: int() takes at most 2 arguments (3 given) + """ + debug.warning('Super class of %s is not a class: %s', self, cls) + else: + for cls_new in mro_method(): + if cls_new not in mro: + mro.append(cls_new) + yield cls_new + + def get_filters(self, search_global=False, until_position=None, + origin_scope=None, is_instance=False): + metaclasses = self.get_metaclasses() + if metaclasses: + for f in self.get_metaclass_filters(metaclasses): + yield f + + if search_global: + yield self.get_global_filter(until_position, origin_scope) + else: + for cls in self.py__mro__(): + if isinstance(cls, compiled.CompiledObject): + for filter in cls.get_filters(is_instance=is_instance): + yield filter + else: + yield ClassFilter( + self.evaluator, self, node_context=cls, + origin_scope=origin_scope, + is_instance=is_instance + ) + if not is_instance: + from jedi.evaluate.compiled import builtin_from_name + type_ = builtin_from_name(self.evaluator, u'type') + assert isinstance(type_, ClassContext) + if type_ != self: + for instance in type_.py__call__(): + instance_filters = instance.get_filters() + # Filter out self filters + next(instance_filters) + next(instance_filters) + yield next(instance_filters) + + def get_signatures(self): + init_funcs = self.py__call__().py__getattribute__('__init__') + return [sig.bind(self) for sig in init_funcs.get_signatures()] + + def get_global_filter(self, until_position=None, origin_scope=None): + return ParserTreeFilter( + self.evaluator, + context=self, + until_position=until_position, + origin_scope=origin_scope + ) + + +class ClassContext(use_metaclass(CachedMetaClass, ClassMixin, FunctionAndClassBase)): + """ + This class is not only important to extend `tree.Class`, it is also a + important for descriptors (if the descriptor methods are evaluated or not). + """ + api_type = u'class' + + @evaluator_method_cache() + def list_type_vars(self): + found = [] + arglist = self.tree_node.get_super_arglist() + if arglist is None: + return [] + + for stars, node in unpack_arglist(arglist): + if stars: + continue # These are not relevant for this search. + + from jedi.evaluate.gradual.annotation import find_unknown_type_vars + for type_var in find_unknown_type_vars(self.parent_context, node): + if type_var not in found: + # The order matters and it's therefore a list. + found.append(type_var) + return found + + def _get_bases_arguments(self): + arglist = self.tree_node.get_super_arglist() + if arglist: + from jedi.evaluate import arguments + return arguments.TreeArguments(self.evaluator, self.parent_context, arglist) + return None + + @evaluator_method_cache(default=()) + def py__bases__(self): + args = self._get_bases_arguments() + if args is not None: + lst = [value for key, value in args.unpack() if key is None] + if lst: + return lst + + if self.py__name__() == 'object' \ + and self.parent_context == self.evaluator.builtins_module: + return [] + return [LazyKnownContexts( + self.evaluator.builtins_module.py__getattribute__('object') + )] + + def py__getitem__(self, index_context_set, contextualized_node): + from jedi.evaluate.gradual.typing import LazyGenericClass + if not index_context_set: + return ContextSet([self]) + return ContextSet( + LazyGenericClass( + self, + index_context, + context_of_index=contextualized_node.context, + ) + for index_context in index_context_set + ) + + def define_generics(self, type_var_dict): + from jedi.evaluate.gradual.typing import GenericClass + + def remap_type_vars(): + """ + The TypeVars in the resulting classes have sometimes different names + and we need to check for that, e.g. a signature can be: + + def iter(iterable: Iterable[_T]) -> Iterator[_T]: ... + + However, the iterator is defined as Iterator[_T_co], which means it has + a different type var name. + """ + for type_var in self.list_type_vars(): + yield type_var_dict.get(type_var.py__name__(), NO_CONTEXTS) + + if type_var_dict: + return ContextSet([GenericClass( + self, + generics=tuple(remap_type_vars()) + )]) + return ContextSet({self}) + + @plugin_manager.decorate() + def get_metaclass_filters(self, metaclass): + debug.dbg('Unprocessed metaclass %s', metaclass) + return [] + + @evaluator_method_cache(default=NO_CONTEXTS) + def get_metaclasses(self): + args = self._get_bases_arguments() + if args is not None: + m = [value for key, value in args.unpack() if key == 'metaclass'] + metaclasses = ContextSet.from_sets(lazy_context.infer() for lazy_context in m) + metaclasses = ContextSet(m for m in metaclasses if m.is_class()) + if metaclasses: + return metaclasses + + for lazy_base in self.py__bases__(): + for context in lazy_base.infer(): + if context.is_class(): + contexts = context.get_metaclasses() + if contexts: + return contexts + return NO_CONTEXTS diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/context/module.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/context/module.py new file mode 100644 index 0000000..28f92f3 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/context/module.py @@ -0,0 +1,283 @@ +import re +import os + +from jedi import debug +from jedi.evaluate.cache import evaluator_method_cache +from jedi.evaluate.names import ContextNameMixin, AbstractNameDefinition +from jedi.evaluate.filters import GlobalNameFilter, ParserTreeFilter, DictFilter, MergedFilter +from jedi.evaluate import compiled +from jedi.evaluate.base_context import TreeContext +from jedi.evaluate.names import SubModuleName +from jedi.evaluate.helpers import contexts_from_qualified_names +from jedi.evaluate.compiled import create_simple_object +from jedi.evaluate.base_context import ContextSet + + +class _ModuleAttributeName(AbstractNameDefinition): + """ + For module attributes like __file__, __str__ and so on. + """ + api_type = u'instance' + + def __init__(self, parent_module, string_name, string_value=None): + self.parent_context = parent_module + self.string_name = string_name + self._string_value = string_value + + def infer(self): + if self._string_value is not None: + s = self._string_value + if self.parent_context.evaluator.environment.version_info.major == 2 \ + and not isinstance(s, bytes): + s = s.encode('utf-8') + return ContextSet([ + create_simple_object(self.parent_context.evaluator, s) + ]) + return compiled.get_string_context_set(self.parent_context.evaluator) + + +class ModuleName(ContextNameMixin, AbstractNameDefinition): + start_pos = 1, 0 + + def __init__(self, context, name): + self._context = context + self._name = name + + @property + def string_name(self): + return self._name + + +def iter_module_names(evaluator, paths): + # Python modules/packages + for n in evaluator.compiled_subprocess.list_module_names(paths): + yield n + + for path in paths: + try: + dirs = os.listdir(path) + except OSError: + # The file might not exist or reading it might lead to an error. + debug.warning("Not possible to list directory: %s", path) + continue + for name in dirs: + # Namespaces + if os.path.isdir(os.path.join(path, name)): + # pycache is obviously not an interestin namespace. Also the + # name must be a valid identifier. + # TODO use str.isidentifier, once Python 2 is removed + if name != '__pycache__' and not re.search(r'\W|^\d', name): + yield name + # Stub files + if name.endswith('.pyi'): + if name != '__init__.pyi': + yield name[:-4] + + +class SubModuleDictMixin(object): + @evaluator_method_cache() + def sub_modules_dict(self): + """ + Lists modules in the directory of this module (if this module is a + package). + """ + names = {} + try: + method = self.py__path__ + except AttributeError: + pass + else: + mods = iter_module_names(self.evaluator, method()) + for name in mods: + # It's obviously a relative import to the current module. + names[name] = SubModuleName(self, name) + + # In the case of an import like `from x.` we don't need to + # add all the variables, this is only about submodules. + return names + + +class ModuleMixin(SubModuleDictMixin): + def get_filters(self, search_global=False, until_position=None, origin_scope=None): + yield MergedFilter( + ParserTreeFilter( + self.evaluator, + context=self, + until_position=until_position, + origin_scope=origin_scope + ), + GlobalNameFilter(self, self.tree_node), + ) + yield DictFilter(self.sub_modules_dict()) + yield DictFilter(self._module_attributes_dict()) + for star_filter in self.iter_star_filters(): + yield star_filter + + def py__class__(self): + c, = contexts_from_qualified_names(self.evaluator, u'types', u'ModuleType') + return c + + def is_module(self): + return True + + def is_stub(self): + return False + + @property + @evaluator_method_cache() + def name(self): + return ModuleName(self, self._string_name) + + @property + def _string_name(self): + """ This is used for the goto functions. """ + # TODO It's ugly that we even use this, the name is usually well known + # ahead so just pass it when create a ModuleContext. + if self._path is None: + return '' # no path -> empty name + else: + sep = (re.escape(os.path.sep),) * 2 + r = re.search(r'([^%s]*?)(%s__init__)?(\.pyi?|\.so)?$' % sep, self._path) + # Remove PEP 3149 names + return re.sub(r'\.[a-z]+-\d{2}[mud]{0,3}$', '', r.group(1)) + + @evaluator_method_cache() + def _module_attributes_dict(self): + names = ['__package__', '__doc__', '__name__'] + # All the additional module attributes are strings. + dct = dict((n, _ModuleAttributeName(self, n)) for n in names) + file = self.py__file__() + if file is not None: + dct['__file__'] = _ModuleAttributeName(self, '__file__', file) + return dct + + def iter_star_filters(self, search_global=False): + for star_module in self.star_imports(): + yield next(star_module.get_filters(search_global)) + + # I'm not sure if the star import cache is really that effective anymore + # with all the other really fast import caches. Recheck. Also we would need + # to push the star imports into Evaluator.module_cache, if we reenable this. + @evaluator_method_cache([]) + def star_imports(self): + from jedi.evaluate.imports import Importer + + modules = [] + for i in self.tree_node.iter_imports(): + if i.is_star_import(): + new = Importer( + self.evaluator, + import_path=i.get_paths()[-1], + module_context=self, + level=i.level + ).follow() + + for module in new: + if isinstance(module, ModuleContext): + modules += module.star_imports() + modules += new + return modules + + def get_qualified_names(self): + """ + A module doesn't have a qualified name, but it's important to note that + it's reachable and not `None`. With this information we can add + qualified names on top for all context children. + """ + return () + + +class ModuleContext(ModuleMixin, TreeContext): + api_type = u'module' + parent_context = None + + def __init__(self, evaluator, module_node, file_io, string_names, code_lines, is_package=False): + super(ModuleContext, self).__init__( + evaluator, + parent_context=None, + tree_node=module_node + ) + self.file_io = file_io + if file_io is None: + self._path = None + else: + self._path = file_io.path + self.string_names = string_names # Optional[Tuple[str, ...]] + self.code_lines = code_lines + self.is_package = is_package + + def is_stub(self): + if self._path is not None and self._path.endswith('.pyi'): + # Currently this is the way how we identify stubs when e.g. goto is + # used in them. This could be changed if stubs would be identified + # sooner and used as StubModuleContext. + return True + return super(ModuleContext, self).is_stub() + + def py__name__(self): + if self.string_names is None: + return None + return '.'.join(self.string_names) + + def py__file__(self): + """ + In contrast to Python's __file__ can be None. + """ + if self._path is None: + return None + + return os.path.abspath(self._path) + + def py__package__(self): + if self.is_package: + return self.string_names + return self.string_names[:-1] + + def _py__path__(self): + # A namespace package is typically auto generated and ~10 lines long. + first_few_lines = ''.join(self.code_lines[:50]) + # these are strings that need to be used for namespace packages, + # the first one is ``pkgutil``, the second ``pkg_resources``. + options = ('declare_namespace(__name__)', 'extend_path(__path__') + if options[0] in first_few_lines or options[1] in first_few_lines: + # It is a namespace, now try to find the rest of the + # modules on sys_path or whatever the search_path is. + paths = set() + for s in self.evaluator.get_sys_path(): + other = os.path.join(s, self.name.string_name) + if os.path.isdir(other): + paths.add(other) + if paths: + return list(paths) + # Nested namespace packages will not be supported. Nobody ever + # asked for it and in Python 3 they are there without using all the + # crap above. + + # Default to the of this file. + file = self.py__file__() + assert file is not None # Shouldn't be a package in the first place. + return [os.path.dirname(file)] + + @property + def py__path__(self): + """ + Not seen here, since it's a property. The callback actually uses a + variable, so use it like:: + + foo.py__path__(sys_path) + + In case of a package, this returns Python's __path__ attribute, which + is a list of paths (strings). + Raises an AttributeError if the module is not a package. + """ + if self.is_package: + return self._py__path__ + else: + raise AttributeError('Only packages have __path__ attributes.') + + def __repr__(self): + return "<%s: %s@%s-%s is_stub=%s>" % ( + self.__class__.__name__, self._string_name, + self.tree_node.start_pos[0], self.tree_node.end_pos[0], + self.is_stub() + ) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/context/namespace.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/context/namespace.py new file mode 100644 index 0000000..12c8b3a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/context/namespace.py @@ -0,0 +1,64 @@ +from jedi.evaluate.cache import evaluator_method_cache +from jedi.evaluate.filters import DictFilter +from jedi.evaluate.names import ContextNameMixin, AbstractNameDefinition +from jedi.evaluate.base_context import Context +from jedi.evaluate.context.module import SubModuleDictMixin + + +class ImplicitNSName(ContextNameMixin, AbstractNameDefinition): + """ + Accessing names for implicit namespace packages should infer to nothing. + This object will prevent Jedi from raising exceptions + """ + def __init__(self, implicit_ns_context, string_name): + self._context = implicit_ns_context + self.string_name = string_name + + +class ImplicitNamespaceContext(Context, SubModuleDictMixin): + """ + Provides support for implicit namespace packages + """ + # Is a module like every other module, because if you import an empty + # folder foobar it will be available as an object: + # . + api_type = u'module' + parent_context = None + + def __init__(self, evaluator, fullname, paths): + super(ImplicitNamespaceContext, self).__init__(evaluator, parent_context=None) + self.evaluator = evaluator + self._fullname = fullname + self._paths = paths + + def get_filters(self, search_global=False, until_position=None, origin_scope=None): + yield DictFilter(self.sub_modules_dict()) + + @property + @evaluator_method_cache() + def name(self): + string_name = self.py__package__()[-1] + return ImplicitNSName(self, string_name) + + def py__file__(self): + return None + + def py__package__(self): + """Return the fullname + """ + return self._fullname.split('.') + + def py__path__(self): + return self._paths + + def py__name__(self): + return self._fullname + + def is_namespace(self): + return True + + def is_stub(self): + return False + + def __repr__(self): + return '<%s: %s>' % (self.__class__.__name__, self._fullname) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/docstrings.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/docstrings.py new file mode 100644 index 0000000..d38dbf1 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/docstrings.py @@ -0,0 +1,311 @@ +""" +Docstrings are another source of information for functions and classes. +:mod:`jedi.evaluate.dynamic` tries to find all executions of functions, while +the docstring parsing is much easier. There are three different types of +docstrings that |jedi| understands: + +- `Sphinx `_ +- `Epydoc `_ +- `Numpydoc `_ + +For example, the sphinx annotation ``:type foo: str`` clearly states that the +type of ``foo`` is ``str``. + +As an addition to parameter searching, this module also provides return +annotations. +""" + +import re +import warnings +from textwrap import dedent + +from parso import parse, ParserSyntaxError + +from jedi._compatibility import u +from jedi import debug +from jedi.evaluate.utils import indent_block +from jedi.evaluate.cache import evaluator_method_cache +from jedi.evaluate.base_context import iterator_to_context_set, ContextSet, \ + NO_CONTEXTS +from jedi.evaluate.lazy_context import LazyKnownContexts + + +DOCSTRING_PARAM_PATTERNS = [ + r'\s*:type\s+%s:\s*([^\n]+)', # Sphinx + r'\s*:param\s+(\w+)\s+%s:[^\n]*', # Sphinx param with type + r'\s*@type\s+%s:\s*([^\n]+)', # Epydoc +] + +DOCSTRING_RETURN_PATTERNS = [ + re.compile(r'\s*:rtype:\s*([^\n]+)', re.M), # Sphinx + re.compile(r'\s*@rtype:\s*([^\n]+)', re.M), # Epydoc +] + +REST_ROLE_PATTERN = re.compile(r':[^`]+:`([^`]+)`') + + +_numpy_doc_string_cache = None + + +def _get_numpy_doc_string_cls(): + global _numpy_doc_string_cache + if isinstance(_numpy_doc_string_cache, (ImportError, SyntaxError)): + raise _numpy_doc_string_cache + from numpydoc.docscrape import NumpyDocString + _numpy_doc_string_cache = NumpyDocString + return _numpy_doc_string_cache + + +def _search_param_in_numpydocstr(docstr, param_str): + """Search `docstr` (in numpydoc format) for type(-s) of `param_str`.""" + with warnings.catch_warnings(): + warnings.simplefilter("ignore") + try: + # This is a non-public API. If it ever changes we should be + # prepared and return gracefully. + params = _get_numpy_doc_string_cls()(docstr)._parsed_data['Parameters'] + except Exception: + return [] + for p_name, p_type, p_descr in params: + if p_name == param_str: + m = re.match(r'([^,]+(,[^,]+)*?)(,[ ]*optional)?$', p_type) + if m: + p_type = m.group(1) + return list(_expand_typestr(p_type)) + return [] + + +def _search_return_in_numpydocstr(docstr): + """ + Search `docstr` (in numpydoc format) for type(-s) of function returns. + """ + with warnings.catch_warnings(): + warnings.simplefilter("ignore") + try: + doc = _get_numpy_doc_string_cls()(docstr) + except Exception: + return + try: + # This is a non-public API. If it ever changes we should be + # prepared and return gracefully. + returns = doc._parsed_data['Returns'] + returns += doc._parsed_data['Yields'] + except Exception: + return + for r_name, r_type, r_descr in returns: + # Return names are optional and if so the type is in the name + if not r_type: + r_type = r_name + for type_ in _expand_typestr(r_type): + yield type_ + + +def _expand_typestr(type_str): + """ + Attempts to interpret the possible types in `type_str` + """ + # Check if alternative types are specified with 'or' + if re.search(r'\bor\b', type_str): + for t in type_str.split('or'): + yield t.split('of')[0].strip() + # Check if like "list of `type`" and set type to list + elif re.search(r'\bof\b', type_str): + yield type_str.split('of')[0] + # Check if type has is a set of valid literal values eg: {'C', 'F', 'A'} + elif type_str.startswith('{'): + node = parse(type_str, version='3.7').children[0] + if node.type == 'atom': + for leaf in node.children[1].children: + if leaf.type == 'number': + if '.' in leaf.value: + yield 'float' + else: + yield 'int' + elif leaf.type == 'string': + if 'b' in leaf.string_prefix.lower(): + yield 'bytes' + else: + yield 'str' + # Ignore everything else. + + # Otherwise just work with what we have. + else: + yield type_str + + +def _search_param_in_docstr(docstr, param_str): + """ + Search `docstr` for type(-s) of `param_str`. + + >>> _search_param_in_docstr(':type param: int', 'param') + ['int'] + >>> _search_param_in_docstr('@type param: int', 'param') + ['int'] + >>> _search_param_in_docstr( + ... ':type param: :class:`threading.Thread`', 'param') + ['threading.Thread'] + >>> bool(_search_param_in_docstr('no document', 'param')) + False + >>> _search_param_in_docstr(':param int param: some description', 'param') + ['int'] + + """ + # look at #40 to see definitions of those params + patterns = [re.compile(p % re.escape(param_str)) + for p in DOCSTRING_PARAM_PATTERNS] + for pattern in patterns: + match = pattern.search(docstr) + if match: + return [_strip_rst_role(match.group(1))] + + return _search_param_in_numpydocstr(docstr, param_str) + + +def _strip_rst_role(type_str): + """ + Strip off the part looks like a ReST role in `type_str`. + + >>> _strip_rst_role(':class:`ClassName`') # strip off :class: + 'ClassName' + >>> _strip_rst_role(':py:obj:`module.Object`') # works with domain + 'module.Object' + >>> _strip_rst_role('ClassName') # do nothing when not ReST role + 'ClassName' + + See also: + http://sphinx-doc.org/domains.html#cross-referencing-python-objects + + """ + match = REST_ROLE_PATTERN.match(type_str) + if match: + return match.group(1) + else: + return type_str + + +def _evaluate_for_statement_string(module_context, string): + code = dedent(u(""" + def pseudo_docstring_stuff(): + ''' + Create a pseudo function for docstring statements. + Need this docstring so that if the below part is not valid Python this + is still a function. + ''' + {} + """)) + if string is None: + return [] + + for element in re.findall(r'((?:\w+\.)*\w+)\.', string): + # Try to import module part in dotted name. + # (e.g., 'threading' in 'threading.Thread'). + string = 'import %s\n' % element + string + + # Take the default grammar here, if we load the Python 2.7 grammar here, it + # will be impossible to use `...` (Ellipsis) as a token. Docstring types + # don't need to conform with the current grammar. + debug.dbg('Parse docstring code %s', string, color='BLUE') + grammar = module_context.evaluator.latest_grammar + try: + module = grammar.parse(code.format(indent_block(string)), error_recovery=False) + except ParserSyntaxError: + return [] + try: + funcdef = next(module.iter_funcdefs()) + # First pick suite, then simple_stmt and then the node, + # which is also not the last item, because there's a newline. + stmt = funcdef.children[-1].children[-1].children[-2] + except (AttributeError, IndexError): + return [] + + if stmt.type not in ('name', 'atom', 'atom_expr'): + return [] + + from jedi.evaluate.context import FunctionContext + function_context = FunctionContext( + module_context.evaluator, + module_context, + funcdef + ) + func_execution_context = function_context.get_function_execution() + # Use the module of the param. + # TODO this module is not the module of the param in case of a function + # call. In that case it's the module of the function call. + # stuffed with content from a function call. + return list(_execute_types_in_stmt(func_execution_context, stmt)) + + +def _execute_types_in_stmt(module_context, stmt): + """ + Executing all types or general elements that we find in a statement. This + doesn't include tuple, list and dict literals, because the stuff they + contain is executed. (Used as type information). + """ + definitions = module_context.eval_node(stmt) + return ContextSet.from_sets( + _execute_array_values(module_context.evaluator, d) + for d in definitions + ) + + +def _execute_array_values(evaluator, array): + """ + Tuples indicate that there's not just one return value, but the listed + ones. `(str, int)` means that it returns a tuple with both types. + """ + from jedi.evaluate.context.iterable import SequenceLiteralContext, FakeSequence + if isinstance(array, SequenceLiteralContext): + values = [] + for lazy_context in array.py__iter__(): + objects = ContextSet.from_sets( + _execute_array_values(evaluator, typ) + for typ in lazy_context.infer() + ) + values.append(LazyKnownContexts(objects)) + return {FakeSequence(evaluator, array.array_type, values)} + else: + return array.execute_annotation() + + +@evaluator_method_cache() +def infer_param(execution_context, param): + from jedi.evaluate.context.instance import InstanceArguments + from jedi.evaluate.context import FunctionExecutionContext + + def eval_docstring(docstring): + return ContextSet( + p + for param_str in _search_param_in_docstr(docstring, param.name.value) + for p in _evaluate_for_statement_string(module_context, param_str) + ) + module_context = execution_context.get_root_context() + func = param.get_parent_function() + if func.type == 'lambdef': + return NO_CONTEXTS + + types = eval_docstring(execution_context.py__doc__()) + if isinstance(execution_context, FunctionExecutionContext) \ + and isinstance(execution_context.var_args, InstanceArguments) \ + and execution_context.function_context.py__name__() == '__init__': + class_context = execution_context.var_args.instance.class_context + types |= eval_docstring(class_context.py__doc__()) + + debug.dbg('Found param types for docstring: %s', types, color='BLUE') + return types + + +@evaluator_method_cache() +@iterator_to_context_set +def infer_return_types(function_context): + def search_return_in_docstr(code): + for p in DOCSTRING_RETURN_PATTERNS: + match = p.search(code) + if match: + yield _strip_rst_role(match.group(1)) + # Check for numpy style return hint + for type_ in _search_return_in_numpydocstr(code): + yield type_ + + for type_str in search_return_in_docstr(function_context.py__doc__()): + for type_eval in _evaluate_for_statement_string(function_context.get_root_context(), type_str): + yield type_eval diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/dynamic.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/dynamic.py new file mode 100644 index 0000000..fc3b19f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/dynamic.py @@ -0,0 +1,231 @@ +""" +One of the really important features of |jedi| is to have an option to +understand code like this:: + + def foo(bar): + bar. # completion here + foo(1) + +There's no doubt wheter bar is an ``int`` or not, but if there's also a call +like ``foo('str')``, what would happen? Well, we'll just show both. Because +that's what a human would expect. + +It works as follows: + +- |Jedi| sees a param +- search for function calls named ``foo`` +- execute these calls and check the input. +""" + +from jedi import settings +from jedi import debug +from jedi.evaluate.cache import evaluator_function_cache +from jedi.evaluate import imports +from jedi.evaluate.arguments import TreeArguments +from jedi.evaluate.param import create_default_params +from jedi.evaluate.helpers import is_stdlib_path +from jedi.evaluate.utils import to_list +from jedi.parser_utils import get_parent_scope +from jedi.evaluate.context import ModuleContext, instance +from jedi.evaluate.base_context import ContextSet, NO_CONTEXTS +from jedi.evaluate import recursion + + +MAX_PARAM_SEARCHES = 20 + + +class DynamicExecutedParams(object): + """ + Simulates being a parameter while actually just being multiple params. + """ + + def __init__(self, evaluator, executed_params): + self.evaluator = evaluator + self._executed_params = executed_params + + def infer(self): + with recursion.execution_allowed(self.evaluator, self) as allowed: + # We need to catch recursions that may occur, because an + # anonymous functions can create an anonymous parameter that is + # more or less self referencing. + if allowed: + return ContextSet.from_sets(p.infer() for p in self._executed_params) + return NO_CONTEXTS + + +@debug.increase_indent +def search_params(evaluator, execution_context, funcdef): + """ + A dynamic search for param values. If you try to complete a type: + + >>> def func(foo): + ... foo + >>> func(1) + >>> func("") + + It is not known what the type ``foo`` without analysing the whole code. You + have to look for all calls to ``func`` to find out what ``foo`` possibly + is. + """ + if not settings.dynamic_params: + return create_default_params(execution_context, funcdef) + + evaluator.dynamic_params_depth += 1 + try: + path = execution_context.get_root_context().py__file__() + if path is not None and is_stdlib_path(path): + # We don't want to search for usages in the stdlib. Usually people + # don't work with it (except if you are a core maintainer, sorry). + # This makes everything slower. Just disable it and run the tests, + # you will see the slowdown, especially in 3.6. + return create_default_params(execution_context, funcdef) + + if funcdef.type == 'lambdef': + string_name = _get_lambda_name(funcdef) + if string_name is None: + return create_default_params(execution_context, funcdef) + else: + string_name = funcdef.name.value + debug.dbg('Dynamic param search in %s.', string_name, color='MAGENTA') + + try: + module_context = execution_context.get_root_context() + function_executions = _search_function_executions( + evaluator, + module_context, + funcdef, + string_name=string_name, + ) + if function_executions: + zipped_params = zip(*list( + function_execution.get_executed_params_and_issues()[0] + for function_execution in function_executions + )) + params = [DynamicExecutedParams(evaluator, executed_params) + for executed_params in zipped_params] + # Evaluate the ExecutedParams to types. + else: + return create_default_params(execution_context, funcdef) + finally: + debug.dbg('Dynamic param result finished', color='MAGENTA') + return params + finally: + evaluator.dynamic_params_depth -= 1 + + +@evaluator_function_cache(default=None) +@to_list +def _search_function_executions(evaluator, module_context, funcdef, string_name): + """ + Returns a list of param names. + """ + compare_node = funcdef + if string_name == '__init__': + cls = get_parent_scope(funcdef) + if cls.type == 'classdef': + string_name = cls.name.value + compare_node = cls + + found_executions = False + i = 0 + for for_mod_context in imports.get_modules_containing_name( + evaluator, [module_context], string_name): + if not isinstance(module_context, ModuleContext): + return + for name, trailer in _get_possible_nodes(for_mod_context, string_name): + i += 1 + + # This is a simple way to stop Jedi's dynamic param recursion + # from going wild: The deeper Jedi's in the recursion, the less + # code should be evaluated. + if i * evaluator.dynamic_params_depth > MAX_PARAM_SEARCHES: + return + + random_context = evaluator.create_context(for_mod_context, name) + for function_execution in _check_name_for_execution( + evaluator, random_context, compare_node, name, trailer): + found_executions = True + yield function_execution + + # If there are results after processing a module, we're probably + # good to process. This is a speed optimization. + if found_executions: + return + + +def _get_lambda_name(node): + stmt = node.parent + if stmt.type == 'expr_stmt': + first_operator = next(stmt.yield_operators(), None) + if first_operator == '=': + first = stmt.children[0] + if first.type == 'name': + return first.value + + return None + + +def _get_possible_nodes(module_context, func_string_name): + try: + names = module_context.tree_node.get_used_names()[func_string_name] + except KeyError: + return + + for name in names: + bracket = name.get_next_leaf() + trailer = bracket.parent + if trailer.type == 'trailer' and bracket == '(': + yield name, trailer + + +def _check_name_for_execution(evaluator, context, compare_node, name, trailer): + from jedi.evaluate.context.function import FunctionExecutionContext + + def create_func_excs(): + arglist = trailer.children[1] + if arglist == ')': + arglist = None + args = TreeArguments(evaluator, context, arglist, trailer) + if value_node.type == 'classdef': + created_instance = instance.TreeInstance( + evaluator, + value.parent_context, + value, + args + ) + for execution in created_instance.create_init_executions(): + yield execution + else: + yield value.get_function_execution(args) + + for value in evaluator.goto_definitions(context, name): + value_node = value.tree_node + if compare_node == value_node: + for func_execution in create_func_excs(): + yield func_execution + elif isinstance(value.parent_context, FunctionExecutionContext) and \ + compare_node.type == 'funcdef': + # Here we're trying to find decorators by checking the first + # parameter. It's not very generic though. Should find a better + # solution that also applies to nested decorators. + params, _ = value.parent_context.get_executed_params_and_issues() + if len(params) != 1: + continue + values = params[0].infer() + nodes = [v.tree_node for v in values] + if nodes == [compare_node]: + # Found a decorator. + module_context = context.get_root_context() + execution_context = next(create_func_excs()) + for name, trailer in _get_possible_nodes(module_context, params[0].string_name): + if value_node.start_pos < name.start_pos < value_node.end_pos: + random_context = evaluator.create_context(execution_context, name) + iterator = _check_name_for_execution( + evaluator, + random_context, + compare_node, + name, + trailer + ) + for function_execution in iterator: + yield function_execution diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/filters.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/filters.py new file mode 100644 index 0000000..0b758ea --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/filters.py @@ -0,0 +1,412 @@ +""" +Filters are objects that you can use to filter names in different scopes. They +are needed for name resolution. +""" +from abc import abstractmethod +import weakref + +from parso.tree import search_ancestor + +from jedi._compatibility import use_metaclass +from jedi.evaluate import flow_analysis +from jedi.evaluate.base_context import ContextSet, Context, ContextWrapper, \ + LazyContextWrapper +from jedi.parser_utils import get_cached_parent_scope +from jedi.evaluate.utils import to_list +from jedi.evaluate.names import TreeNameDefinition, ParamName, AbstractNameDefinition + +_definition_name_cache = weakref.WeakKeyDictionary() + + +class AbstractFilter(object): + _until_position = None + + def _filter(self, names): + if self._until_position is not None: + return [n for n in names if n.start_pos < self._until_position] + return names + + @abstractmethod + def get(self, name): + raise NotImplementedError + + @abstractmethod + def values(self): + raise NotImplementedError + + +class FilterWrapper(object): + name_wrapper_class = None + + def __init__(self, wrapped_filter): + self._wrapped_filter = wrapped_filter + + def wrap_names(self, names): + return [self.name_wrapper_class(name) for name in names] + + def get(self, name): + return self.wrap_names(self._wrapped_filter.get(name)) + + def values(self): + return self.wrap_names(self._wrapped_filter.values()) + + +def _get_definition_names(used_names, name_key): + try: + for_module = _definition_name_cache[used_names] + except KeyError: + for_module = _definition_name_cache[used_names] = {} + + try: + return for_module[name_key] + except KeyError: + names = used_names.get(name_key, ()) + result = for_module[name_key] = tuple(name for name in names if name.is_definition()) + return result + + +class AbstractUsedNamesFilter(AbstractFilter): + name_class = TreeNameDefinition + + def __init__(self, context, parser_scope): + self._parser_scope = parser_scope + self._module_node = self._parser_scope.get_root_node() + self._used_names = self._module_node.get_used_names() + self.context = context + + def get(self, name, **filter_kwargs): + return self._convert_names(self._filter( + _get_definition_names(self._used_names, name), + **filter_kwargs + )) + + def _convert_names(self, names): + return [self.name_class(self.context, name) for name in names] + + def values(self, **filter_kwargs): + return self._convert_names( + name + for name_key in self._used_names + for name in self._filter( + _get_definition_names(self._used_names, name_key), + **filter_kwargs + ) + ) + + def __repr__(self): + return '<%s: %s>' % (self.__class__.__name__, self.context) + + +class ParserTreeFilter(AbstractUsedNamesFilter): + # TODO remove evaluator as an argument, it's not used. + def __init__(self, evaluator, context, node_context=None, until_position=None, + origin_scope=None): + """ + node_context is an option to specify a second context for use cases + like the class mro where the parent class of a new name would be the + context, but for some type inference it's important to have a local + context of the other classes. + """ + if node_context is None: + node_context = context + super(ParserTreeFilter, self).__init__(context, node_context.tree_node) + self._node_context = node_context + self._origin_scope = origin_scope + self._until_position = until_position + + def _filter(self, names): + names = super(ParserTreeFilter, self)._filter(names) + names = [n for n in names if self._is_name_reachable(n)] + return list(self._check_flows(names)) + + def _is_name_reachable(self, name): + parent = name.parent + if parent.type == 'trailer': + return False + base_node = parent if parent.type in ('classdef', 'funcdef') else name + return get_cached_parent_scope(self._used_names, base_node) == self._parser_scope + + def _check_flows(self, names): + for name in sorted(names, key=lambda name: name.start_pos, reverse=True): + check = flow_analysis.reachability_check( + context=self._node_context, + context_scope=self._parser_scope, + node=name, + origin_scope=self._origin_scope + ) + if check is not flow_analysis.UNREACHABLE: + yield name + + if check is flow_analysis.REACHABLE: + break + + +class FunctionExecutionFilter(ParserTreeFilter): + param_name = ParamName + + def __init__(self, evaluator, context, node_context=None, + until_position=None, origin_scope=None): + super(FunctionExecutionFilter, self).__init__( + evaluator, + context, + node_context, + until_position, + origin_scope + ) + + @to_list + def _convert_names(self, names): + for name in names: + param = search_ancestor(name, 'param') + if param: + yield self.param_name(self.context, name) + else: + yield TreeNameDefinition(self.context, name) + + +class GlobalNameFilter(AbstractUsedNamesFilter): + def __init__(self, context, parser_scope): + super(GlobalNameFilter, self).__init__(context, parser_scope) + + def get(self, name): + try: + names = self._used_names[name] + except KeyError: + return [] + return self._convert_names(self._filter(names)) + + @to_list + def _filter(self, names): + for name in names: + if name.parent.type == 'global_stmt': + yield name + + def values(self): + return self._convert_names( + name for name_list in self._used_names.values() + for name in self._filter(name_list) + ) + + +class DictFilter(AbstractFilter): + def __init__(self, dct): + self._dct = dct + + def get(self, name): + try: + value = self._convert(name, self._dct[name]) + except KeyError: + return [] + else: + return list(self._filter([value])) + + def values(self): + def yielder(): + for item in self._dct.items(): + try: + yield self._convert(*item) + except KeyError: + pass + return self._filter(yielder()) + + def _convert(self, name, value): + return value + + def __repr__(self): + keys = ', '.join(self._dct.keys()) + return '<%s: for {%s}>' % (self.__class__.__name__, keys) + + +class MergedFilter(object): + def __init__(self, *filters): + self._filters = filters + + def get(self, name): + return [n for filter in self._filters for n in filter.get(name)] + + def values(self): + return [n for filter in self._filters for n in filter.values()] + + def __repr__(self): + return '%s(%s)' % (self.__class__.__name__, ', '.join(str(f) for f in self._filters)) + + +class _BuiltinMappedMethod(Context): + """``Generator.__next__`` ``dict.values`` methods and so on.""" + api_type = u'function' + + def __init__(self, builtin_context, method, builtin_func): + super(_BuiltinMappedMethod, self).__init__( + builtin_context.evaluator, + parent_context=builtin_context + ) + self._method = method + self._builtin_func = builtin_func + + def py__call__(self, arguments): + # TODO add TypeError if params are given/or not correct. + return self._method(self.parent_context) + + def __getattr__(self, name): + return getattr(self._builtin_func, name) + + +class SpecialMethodFilter(DictFilter): + """ + A filter for methods that are defined in this module on the corresponding + classes like Generator (for __next__, etc). + """ + class SpecialMethodName(AbstractNameDefinition): + api_type = u'function' + + def __init__(self, parent_context, string_name, value, builtin_context): + callable_, python_version = value + if python_version is not None and \ + python_version != parent_context.evaluator.environment.version_info.major: + raise KeyError + + self.parent_context = parent_context + self.string_name = string_name + self._callable = callable_ + self._builtin_context = builtin_context + + def infer(self): + for filter in self._builtin_context.get_filters(): + # We can take the first index, because on builtin methods there's + # always only going to be one name. The same is true for the + # inferred values. + for name in filter.get(self.string_name): + builtin_func = next(iter(name.infer())) + break + else: + continue + break + return ContextSet([ + _BuiltinMappedMethod(self.parent_context, self._callable, builtin_func) + ]) + + def __init__(self, context, dct, builtin_context): + super(SpecialMethodFilter, self).__init__(dct) + self.context = context + self._builtin_context = builtin_context + """ + This context is what will be used to introspect the name, where as the + other context will be used to execute the function. + + We distinguish, because we have to. + """ + + def _convert(self, name, value): + return self.SpecialMethodName(self.context, name, value, self._builtin_context) + + +class _OverwriteMeta(type): + def __init__(cls, name, bases, dct): + super(_OverwriteMeta, cls).__init__(name, bases, dct) + + base_dct = {} + for base_cls in reversed(cls.__bases__): + try: + base_dct.update(base_cls.overwritten_methods) + except AttributeError: + pass + + for func in cls.__dict__.values(): + try: + base_dct.update(func.registered_overwritten_methods) + except AttributeError: + pass + cls.overwritten_methods = base_dct + + +class _AttributeOverwriteMixin(object): + def get_filters(self, search_global=False, *args, **kwargs): + yield SpecialMethodFilter(self, self.overwritten_methods, self._wrapped_context) + + for filter in self._wrapped_context.get_filters(search_global): + yield filter + + +class LazyAttributeOverwrite(use_metaclass(_OverwriteMeta, _AttributeOverwriteMixin, + LazyContextWrapper)): + def __init__(self, evaluator): + self.evaluator = evaluator + + +class AttributeOverwrite(use_metaclass(_OverwriteMeta, _AttributeOverwriteMixin, + ContextWrapper)): + pass + + +def publish_method(method_name, python_version_match=None): + def decorator(func): + dct = func.__dict__.setdefault('registered_overwritten_methods', {}) + dct[method_name] = func, python_version_match + return func + return decorator + + +def get_global_filters(evaluator, context, until_position, origin_scope): + """ + Returns all filters in order of priority for name resolution. + + For global name lookups. The filters will handle name resolution + themselves, but here we gather possible filters downwards. + + >>> from jedi._compatibility import u, no_unicode_pprint + >>> from jedi import Script + >>> script = Script(u(''' + ... x = ['a', 'b', 'c'] + ... def func(): + ... y = None + ... ''')) + >>> module_node = script._module_node + >>> scope = next(module_node.iter_funcdefs()) + >>> scope + + >>> context = script._get_module().create_context(scope) + >>> filters = list(get_global_filters(context.evaluator, context, (4, 0), None)) + + First we get the names from the function scope. + + >>> no_unicode_pprint(filters[0]) # doctest: +ELLIPSIS + MergedFilter(, ) + >>> sorted(str(n) for n in filters[0].values()) # doctest: +NORMALIZE_WHITESPACE + ['', + ''] + >>> filters[0]._filters[0]._until_position + (4, 0) + >>> filters[0]._filters[1]._until_position + + Then it yields the names from one level "lower". In this example, this is + the module scope (including globals). + As a side note, you can see, that the position in the filter is None on the + globals filter, because there the whole module is searched. + + >>> list(filters[1].values()) # package modules -> Also empty. + [] + >>> sorted(name.string_name for name in filters[2].values()) # Module attributes + ['__doc__', '__name__', '__package__'] + + Finally, it yields the builtin filter, if `include_builtin` is + true (default). + + >>> list(filters[3].values()) # doctest: +ELLIPSIS + [...] + """ + from jedi.evaluate.context.function import FunctionExecutionContext + while context is not None: + # Names in methods cannot be resolved within the class. + for filter in context.get_filters( + search_global=True, + until_position=until_position, + origin_scope=origin_scope): + yield filter + if isinstance(context, FunctionExecutionContext): + # The position should be reset if the current scope is a function. + until_position = None + + context = context.parent_context + + # Add builtins to the global scope. + yield next(evaluator.builtins_module.get_filters()) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/finder.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/finder.py new file mode 100644 index 0000000..7b8b001 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/finder.py @@ -0,0 +1,290 @@ +""" +Searching for names with given scope and name. This is very central in Jedi and +Python. The name resolution is quite complicated with descripter, +``__getattribute__``, ``__getattr__``, ``global``, etc. + +If you want to understand name resolution, please read the first few chapters +in http://blog.ionelmc.ro/2015/02/09/understanding-python-metaclasses/. + +Flow checks ++++++++++++ + +Flow checks are not really mature. There's only a check for ``isinstance``. It +would check whether a flow has the form of ``if isinstance(a, type_or_tuple)``. +Unfortunately every other thing is being ignored (e.g. a == '' would be easy to +check for -> a is a string). There's big potential in these checks. +""" + +from parso.python import tree +from parso.tree import search_ancestor +from jedi import debug +from jedi import settings +from jedi.evaluate import compiled +from jedi.evaluate import analysis +from jedi.evaluate import flow_analysis +from jedi.evaluate.arguments import TreeArguments +from jedi.evaluate import helpers +from jedi.evaluate.context import iterable +from jedi.evaluate.filters import get_global_filters +from jedi.evaluate.names import TreeNameDefinition +from jedi.evaluate.base_context import ContextSet, NO_CONTEXTS +from jedi.parser_utils import is_scope, get_parent_scope +from jedi.evaluate.gradual.conversion import convert_contexts + + +class NameFinder(object): + def __init__(self, evaluator, context, name_context, name_or_str, + position=None, analysis_errors=True): + self._evaluator = evaluator + # Make sure that it's not just a syntax tree node. + self._context = context + self._name_context = name_context + self._name = name_or_str + if isinstance(name_or_str, tree.Name): + self._string_name = name_or_str.value + else: + self._string_name = name_or_str + self._position = position + self._found_predefined_types = None + self._analysis_errors = analysis_errors + + def find(self, filters, attribute_lookup): + """ + :params bool attribute_lookup: Tell to logic if we're accessing the + attribute or the contents of e.g. a function. + """ + names = self.filter_name(filters) + if self._found_predefined_types is not None and names: + check = flow_analysis.reachability_check( + context=self._context, + context_scope=self._context.tree_node, + node=self._name, + ) + if check is flow_analysis.UNREACHABLE: + return NO_CONTEXTS + return self._found_predefined_types + + types = self._names_to_types(names, attribute_lookup) + + if not names and self._analysis_errors and not types \ + and not (isinstance(self._name, tree.Name) and + isinstance(self._name.parent.parent, tree.Param)): + if isinstance(self._name, tree.Name): + if attribute_lookup: + analysis.add_attribute_error( + self._name_context, self._context, self._name) + else: + message = ("NameError: name '%s' is not defined." + % self._string_name) + analysis.add(self._name_context, 'name-error', self._name, message) + + return types + + def _get_origin_scope(self): + if isinstance(self._name, tree.Name): + scope = self._name + while scope.parent is not None: + # TODO why if classes? + if not isinstance(scope, tree.Scope): + break + scope = scope.parent + return scope + else: + return None + + def get_filters(self, search_global=False): + origin_scope = self._get_origin_scope() + if search_global: + position = self._position + + # For functions and classes the defaults don't belong to the + # function and get evaluated in the context before the function. So + # make sure to exclude the function/class name. + if origin_scope is not None: + ancestor = search_ancestor(origin_scope, 'funcdef', 'classdef', 'lambdef') + lambdef = None + if ancestor == 'lambdef': + # For lambdas it's even more complicated since parts will + # be evaluated later. + lambdef = ancestor + ancestor = search_ancestor(origin_scope, 'funcdef', 'classdef') + if ancestor is not None: + colon = ancestor.children[-2] + if position is not None and position < colon.start_pos: + if lambdef is None or position < lambdef.children[-2].start_pos: + position = ancestor.start_pos + + return get_global_filters(self._evaluator, self._context, position, origin_scope) + else: + return self._get_context_filters(origin_scope) + + def _get_context_filters(self, origin_scope): + for f in self._context.get_filters(False, self._position, origin_scope=origin_scope): + yield f + # This covers the case where a stub files are incomplete. + if self._context.is_stub(): + for c in convert_contexts(ContextSet({self._context})): + for f in c.get_filters(): + yield f + + def filter_name(self, filters): + """ + Searches names that are defined in a scope (the different + ``filters``), until a name fits. + """ + names = [] + # This paragraph is currently needed for proper branch evaluation + # (static analysis). + if self._context.predefined_names and isinstance(self._name, tree.Name): + node = self._name + while node is not None and not is_scope(node): + node = node.parent + if node.type in ("if_stmt", "for_stmt", "comp_for", 'sync_comp_for'): + try: + name_dict = self._context.predefined_names[node] + types = name_dict[self._string_name] + except KeyError: + continue + else: + self._found_predefined_types = types + break + + for filter in filters: + names = filter.get(self._string_name) + if names: + if len(names) == 1: + n, = names + if isinstance(n, TreeNameDefinition): + # Something somewhere went terribly wrong. This + # typically happens when using goto on an import in an + # __init__ file. I think we need a better solution, but + # it's kind of hard, because for Jedi it's not clear + # that that name has not been defined, yet. + if n.tree_name == self._name: + def_ = self._name.get_definition() + if def_ is not None and def_.type == 'import_from': + continue + break + + debug.dbg('finder.filter_name %s in (%s): %s@%s', + self._string_name, self._context, names, self._position) + return list(names) + + def _check_getattr(self, inst): + """Checks for both __getattr__ and __getattribute__ methods""" + # str is important, because it shouldn't be `Name`! + name = compiled.create_simple_object(self._evaluator, self._string_name) + + # This is a little bit special. `__getattribute__` is in Python + # executed before `__getattr__`. But: I know no use case, where + # this could be practical and where Jedi would return wrong types. + # If you ever find something, let me know! + # We are inversing this, because a hand-crafted `__getattribute__` + # could still call another hand-crafted `__getattr__`, but not the + # other way around. + names = (inst.get_function_slot_names(u'__getattr__') or + inst.get_function_slot_names(u'__getattribute__')) + return inst.execute_function_slots(names, name) + + def _names_to_types(self, names, attribute_lookup): + contexts = ContextSet.from_sets(name.infer() for name in names) + + debug.dbg('finder._names_to_types: %s -> %s', names, contexts) + if not names and self._context.is_instance() and not self._context.is_compiled(): + # handling __getattr__ / __getattribute__ + return self._check_getattr(self._context) + + # Add isinstance and other if/assert knowledge. + if not contexts and isinstance(self._name, tree.Name) and \ + not self._name_context.is_instance() and not self._context.is_compiled(): + flow_scope = self._name + base_nodes = [self._name_context.tree_node] + + if any(b.type in ('comp_for', 'sync_comp_for') for b in base_nodes): + return contexts + while True: + flow_scope = get_parent_scope(flow_scope, include_flows=True) + n = _check_flow_information(self._name_context, flow_scope, + self._name, self._position) + if n is not None: + return n + if flow_scope in base_nodes: + break + return contexts + + +def _check_flow_information(context, flow, search_name, pos): + """ Try to find out the type of a variable just with the information that + is given by the flows: e.g. It is also responsible for assert checks.:: + + if isinstance(k, str): + k. # <- completion here + + ensures that `k` is a string. + """ + if not settings.dynamic_flow_information: + return None + + result = None + if is_scope(flow): + # Check for asserts. + module_node = flow.get_root_node() + try: + names = module_node.get_used_names()[search_name.value] + except KeyError: + return None + names = reversed([ + n for n in names + if flow.start_pos <= n.start_pos < (pos or flow.end_pos) + ]) + + for name in names: + ass = search_ancestor(name, 'assert_stmt') + if ass is not None: + result = _check_isinstance_type(context, ass.assertion, search_name) + if result is not None: + return result + + if flow.type in ('if_stmt', 'while_stmt'): + potential_ifs = [c for c in flow.children[1::4] if c != ':'] + for if_test in reversed(potential_ifs): + if search_name.start_pos > if_test.end_pos: + return _check_isinstance_type(context, if_test, search_name) + return result + + +def _check_isinstance_type(context, element, search_name): + try: + assert element.type in ('power', 'atom_expr') + # this might be removed if we analyze and, etc + assert len(element.children) == 2 + first, trailer = element.children + assert first.type == 'name' and first.value == 'isinstance' + assert trailer.type == 'trailer' and trailer.children[0] == '(' + assert len(trailer.children) == 3 + + # arglist stuff + arglist = trailer.children[1] + args = TreeArguments(context.evaluator, context, arglist, trailer) + param_list = list(args.unpack()) + # Disallow keyword arguments + assert len(param_list) == 2 + (key1, lazy_context_object), (key2, lazy_context_cls) = param_list + assert key1 is None and key2 is None + call = helpers.call_of_leaf(search_name) + is_instance_call = helpers.call_of_leaf(lazy_context_object.data) + # Do a simple get_code comparison. They should just have the same code, + # and everything will be all right. + normalize = context.evaluator.grammar._normalize + assert normalize(is_instance_call) == normalize(call) + except AssertionError: + return None + + context_set = NO_CONTEXTS + for cls_or_tup in lazy_context_cls.infer(): + if isinstance(cls_or_tup, iterable.Sequence) and cls_or_tup.array_type == 'tuple': + for lazy_context in cls_or_tup.py__iter__(): + context_set |= lazy_context.infer().execute_evaluated() + else: + context_set |= cls_or_tup.execute_evaluated() + return context_set diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/flow_analysis.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/flow_analysis.py new file mode 100644 index 0000000..474071f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/flow_analysis.py @@ -0,0 +1,118 @@ +from jedi.parser_utils import get_flow_branch_keyword, is_scope, get_parent_scope +from jedi.evaluate.recursion import execution_allowed + + +class Status(object): + lookup_table = {} + + def __init__(self, value, name): + self._value = value + self._name = name + Status.lookup_table[value] = self + + def invert(self): + if self is REACHABLE: + return UNREACHABLE + elif self is UNREACHABLE: + return REACHABLE + else: + return UNSURE + + def __and__(self, other): + if UNSURE in (self, other): + return UNSURE + else: + return REACHABLE if self._value and other._value else UNREACHABLE + + def __repr__(self): + return '<%s: %s>' % (type(self).__name__, self._name) + + +REACHABLE = Status(True, 'reachable') +UNREACHABLE = Status(False, 'unreachable') +UNSURE = Status(None, 'unsure') + + +def _get_flow_scopes(node): + while True: + node = get_parent_scope(node, include_flows=True) + if node is None or is_scope(node): + return + yield node + + +def reachability_check(context, context_scope, node, origin_scope=None): + first_flow_scope = get_parent_scope(node, include_flows=True) + if origin_scope is not None: + origin_flow_scopes = list(_get_flow_scopes(origin_scope)) + node_flow_scopes = list(_get_flow_scopes(node)) + + branch_matches = True + for flow_scope in origin_flow_scopes: + if flow_scope in node_flow_scopes: + node_keyword = get_flow_branch_keyword(flow_scope, node) + origin_keyword = get_flow_branch_keyword(flow_scope, origin_scope) + branch_matches = node_keyword == origin_keyword + if flow_scope.type == 'if_stmt': + if not branch_matches: + return UNREACHABLE + elif flow_scope.type == 'try_stmt': + if not branch_matches and origin_keyword == 'else' \ + and node_keyword == 'except': + return UNREACHABLE + if branch_matches: + break + + # Direct parents get resolved, we filter scopes that are separate + # branches. This makes sense for autocompletion and static analysis. + # For actual Python it doesn't matter, because we're talking about + # potentially unreachable code. + # e.g. `if 0:` would cause all name lookup within the flow make + # unaccessible. This is not a "problem" in Python, because the code is + # never called. In Jedi though, we still want to infer types. + while origin_scope is not None: + if first_flow_scope == origin_scope and branch_matches: + return REACHABLE + origin_scope = origin_scope.parent + + return _break_check(context, context_scope, first_flow_scope, node) + + +def _break_check(context, context_scope, flow_scope, node): + reachable = REACHABLE + if flow_scope.type == 'if_stmt': + if flow_scope.is_node_after_else(node): + for check_node in flow_scope.get_test_nodes(): + reachable = _check_if(context, check_node) + if reachable in (REACHABLE, UNSURE): + break + reachable = reachable.invert() + else: + flow_node = flow_scope.get_corresponding_test_node(node) + if flow_node is not None: + reachable = _check_if(context, flow_node) + elif flow_scope.type in ('try_stmt', 'while_stmt'): + return UNSURE + + # Only reachable branches need to be examined further. + if reachable in (UNREACHABLE, UNSURE): + return reachable + + if context_scope != flow_scope and context_scope != flow_scope.parent: + flow_scope = get_parent_scope(flow_scope, include_flows=True) + return reachable & _break_check(context, context_scope, flow_scope, node) + else: + return reachable + + +def _check_if(context, node): + with execution_allowed(context.evaluator, node) as allowed: + if not allowed: + return UNSURE + + types = context.eval_node(node) + values = set(x.py__bool__() for x in types) + if len(values) == 1: + return Status.lookup_table[values.pop()] + else: + return UNSURE diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/gradual/__init__.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/gradual/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/gradual/annotation.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/gradual/annotation.py new file mode 100644 index 0000000..c014512 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/gradual/annotation.py @@ -0,0 +1,405 @@ +""" +PEP 0484 ( https://www.python.org/dev/peps/pep-0484/ ) describes type hints +through function annotations. There is a strong suggestion in this document +that only the type of type hinting defined in PEP0484 should be allowed +as annotations in future python versions. +""" + +import re + +from parso import ParserSyntaxError, parse + +from jedi._compatibility import force_unicode +from jedi.evaluate.cache import evaluator_method_cache +from jedi.evaluate.base_context import ContextSet, NO_CONTEXTS +from jedi.evaluate.gradual.typing import TypeVar, LazyGenericClass, \ + AbstractAnnotatedClass +from jedi.evaluate.gradual.typing import GenericClass +from jedi.evaluate.helpers import is_string +from jedi.evaluate.compiled import builtin_from_name +from jedi import debug +from jedi import parser_utils + + +def eval_annotation(context, annotation): + """ + Evaluates an annotation node. This means that it evaluates the part of + `int` here: + + foo: int = 3 + + Also checks for forward references (strings) + """ + context_set = context.eval_node(annotation) + if len(context_set) != 1: + debug.warning("Eval'ed typing index %s should lead to 1 object, " + " not %s" % (annotation, context_set)) + return context_set + + evaled_context = list(context_set)[0] + if is_string(evaled_context): + result = _get_forward_reference_node(context, evaled_context.get_safe_value()) + if result is not None: + return context.eval_node(result) + return context_set + + +def _evaluate_annotation_string(context, string, index=None): + node = _get_forward_reference_node(context, string) + if node is None: + return NO_CONTEXTS + + context_set = context.eval_node(node) + if index is not None: + context_set = context_set.filter( + lambda context: context.array_type == u'tuple' # noqa + and len(list(context.py__iter__())) >= index + ).py__simple_getitem__(index) + return context_set + + +def _get_forward_reference_node(context, string): + try: + new_node = context.evaluator.grammar.parse( + force_unicode(string), + start_symbol='eval_input', + error_recovery=False + ) + except ParserSyntaxError: + debug.warning('Annotation not parsed: %s' % string) + return None + else: + module = context.tree_node.get_root_node() + parser_utils.move(new_node, module.end_pos[0]) + new_node.parent = context.tree_node + return new_node + + +def _split_comment_param_declaration(decl_text): + """ + Split decl_text on commas, but group generic expressions + together. + + For example, given "foo, Bar[baz, biz]" we return + ['foo', 'Bar[baz, biz]']. + + """ + try: + node = parse(decl_text, error_recovery=False).children[0] + except ParserSyntaxError: + debug.warning('Comment annotation is not valid Python: %s' % decl_text) + return [] + + if node.type == 'name': + return [node.get_code().strip()] + + params = [] + try: + children = node.children + except AttributeError: + return [] + else: + for child in children: + if child.type in ['name', 'atom_expr', 'power']: + params.append(child.get_code().strip()) + + return params + + +@evaluator_method_cache() +def infer_param(execution_context, param): + contexts = _infer_param(execution_context, param) + evaluator = execution_context.evaluator + if param.star_count == 1: + tuple_ = builtin_from_name(evaluator, 'tuple') + return ContextSet([GenericClass( + tuple_, + generics=(contexts,), + ) for c in contexts]) + elif param.star_count == 2: + dct = builtin_from_name(evaluator, 'dict') + return ContextSet([GenericClass( + dct, + generics=(ContextSet([builtin_from_name(evaluator, 'str')]), contexts), + ) for c in contexts]) + pass + return contexts + + +def _infer_param(execution_context, param): + """ + Infers the type of a function parameter, using type annotations. + """ + annotation = param.annotation + if annotation is None: + # If no Python 3-style annotation, look for a Python 2-style comment + # annotation. + # Identify parameters to function in the same sequence as they would + # appear in a type comment. + all_params = [child for child in param.parent.children + if child.type == 'param'] + + node = param.parent.parent + comment = parser_utils.get_following_comment_same_line(node) + if comment is None: + return NO_CONTEXTS + + match = re.match(r"^#\s*type:\s*\(([^#]*)\)\s*->", comment) + if not match: + return NO_CONTEXTS + params_comments = _split_comment_param_declaration(match.group(1)) + + # Find the specific param being investigated + index = all_params.index(param) + # If the number of parameters doesn't match length of type comment, + # ignore first parameter (assume it's self). + if len(params_comments) != len(all_params): + debug.warning( + "Comments length != Params length %s %s", + params_comments, all_params + ) + from jedi.evaluate.context.instance import InstanceArguments + if isinstance(execution_context.var_args, InstanceArguments): + if index == 0: + # Assume it's self, which is already handled + return NO_CONTEXTS + index -= 1 + if index >= len(params_comments): + return NO_CONTEXTS + + param_comment = params_comments[index] + return _evaluate_annotation_string( + execution_context.function_context.get_default_param_context(), + param_comment + ) + # Annotations are like default params and resolve in the same way. + context = execution_context.function_context.get_default_param_context() + return eval_annotation(context, annotation) + + +def py__annotations__(funcdef): + dct = {} + for function_param in funcdef.get_params(): + param_annotation = function_param.annotation + if param_annotation is not None: + dct[function_param.name.value] = param_annotation + + return_annotation = funcdef.annotation + if return_annotation: + dct['return'] = return_annotation + return dct + + +@evaluator_method_cache() +def infer_return_types(function_execution_context): + """ + Infers the type of a function's return value, + according to type annotations. + """ + all_annotations = py__annotations__(function_execution_context.tree_node) + annotation = all_annotations.get("return", None) + if annotation is None: + # If there is no Python 3-type annotation, look for a Python 2-type annotation + node = function_execution_context.tree_node + comment = parser_utils.get_following_comment_same_line(node) + if comment is None: + return NO_CONTEXTS + + match = re.match(r"^#\s*type:\s*\([^#]*\)\s*->\s*([^#]*)", comment) + if not match: + return NO_CONTEXTS + + return _evaluate_annotation_string( + function_execution_context.function_context.get_default_param_context(), + match.group(1).strip() + ).execute_annotation() + if annotation is None: + return NO_CONTEXTS + + context = function_execution_context.function_context.get_default_param_context() + unknown_type_vars = list(find_unknown_type_vars(context, annotation)) + annotation_contexts = eval_annotation(context, annotation) + if not unknown_type_vars: + return annotation_contexts.execute_annotation() + + type_var_dict = infer_type_vars_for_execution(function_execution_context, all_annotations) + + return ContextSet.from_sets( + ann.define_generics(type_var_dict) + if isinstance(ann, (AbstractAnnotatedClass, TypeVar)) else ContextSet({ann}) + for ann in annotation_contexts + ).execute_annotation() + + +def infer_type_vars_for_execution(execution_context, annotation_dict): + """ + Some functions use type vars that are not defined by the class, but rather + only defined in the function. See for example `iter`. In those cases we + want to: + + 1. Search for undefined type vars. + 2. Infer type vars with the execution state we have. + 3. Return the union of all type vars that have been found. + """ + context = execution_context.function_context.get_default_param_context() + + annotation_variable_results = {} + executed_params, _ = execution_context.get_executed_params_and_issues() + for executed_param in executed_params: + try: + annotation_node = annotation_dict[executed_param.string_name] + except KeyError: + continue + + annotation_variables = find_unknown_type_vars(context, annotation_node) + if annotation_variables: + # Infer unknown type var + annotation_context_set = context.eval_node(annotation_node) + star_count = executed_param._param_node.star_count + actual_context_set = executed_param.infer(use_hints=False) + if star_count == 1: + actual_context_set = actual_context_set.merge_types_of_iterate() + elif star_count == 2: + # TODO _dict_values is not public. + actual_context_set = actual_context_set.try_merge('_dict_values') + for ann in annotation_context_set: + _merge_type_var_dicts( + annotation_variable_results, + _infer_type_vars(ann, actual_context_set), + ) + + return annotation_variable_results + + +def _merge_type_var_dicts(base_dict, new_dict): + for type_var_name, contexts in new_dict.items(): + try: + base_dict[type_var_name] |= contexts + except KeyError: + base_dict[type_var_name] = contexts + + +def _infer_type_vars(annotation_context, context_set): + """ + This function tries to find information about undefined type vars and + returns a dict from type var name to context set. + + This is for example important to understand what `iter([1])` returns. + According to typeshed, `iter` returns an `Iterator[_T]`: + + def iter(iterable: Iterable[_T]) -> Iterator[_T]: ... + + This functions would generate `int` for `_T` in this case, because it + unpacks the `Iterable`. + """ + type_var_dict = {} + if isinstance(annotation_context, TypeVar): + return {annotation_context.py__name__(): context_set.py__class__()} + elif isinstance(annotation_context, LazyGenericClass): + name = annotation_context.py__name__() + if name == 'Iterable': + given = annotation_context.get_generics() + if given: + for nested_annotation_context in given[0]: + _merge_type_var_dicts( + type_var_dict, + _infer_type_vars( + nested_annotation_context, + context_set.merge_types_of_iterate() + ) + ) + elif name == 'Mapping': + given = annotation_context.get_generics() + if len(given) == 2: + for context in context_set: + try: + method = context.get_mapping_item_contexts + except AttributeError: + continue + key_contexts, value_contexts = method() + + for nested_annotation_context in given[0]: + _merge_type_var_dicts( + type_var_dict, + _infer_type_vars( + nested_annotation_context, + key_contexts, + ) + ) + for nested_annotation_context in given[1]: + _merge_type_var_dicts( + type_var_dict, + _infer_type_vars( + nested_annotation_context, + value_contexts, + ) + ) + return type_var_dict + + +def find_type_from_comment_hint_for(context, node, name): + return _find_type_from_comment_hint(context, node, node.children[1], name) + + +def find_type_from_comment_hint_with(context, node, name): + assert len(node.children[1].children) == 3, \ + "Can only be here when children[1] is 'foo() as f'" + varlist = node.children[1].children[2] + return _find_type_from_comment_hint(context, node, varlist, name) + + +def find_type_from_comment_hint_assign(context, node, name): + return _find_type_from_comment_hint(context, node, node.children[0], name) + + +def _find_type_from_comment_hint(context, node, varlist, name): + index = None + if varlist.type in ("testlist_star_expr", "exprlist", "testlist"): + # something like "a, b = 1, 2" + index = 0 + for child in varlist.children: + if child == name: + break + if child.type == "operator": + continue + index += 1 + else: + return [] + + comment = parser_utils.get_following_comment_same_line(node) + if comment is None: + return [] + match = re.match(r"^#\s*type:\s*([^#]*)", comment) + if match is None: + return [] + return _evaluate_annotation_string( + context, match.group(1).strip(), index + ).execute_annotation() + + +def find_unknown_type_vars(context, node): + def check_node(node): + if node.type in ('atom_expr', 'power'): + trailer = node.children[-1] + if trailer.type == 'trailer' and trailer.children[0] == '[': + for subscript_node in _unpack_subscriptlist(trailer.children[1]): + check_node(subscript_node) + else: + type_var_set = context.eval_node(node) + for type_var in type_var_set: + if isinstance(type_var, TypeVar) and type_var not in found: + found.append(type_var) + + found = [] # We're not using a set, because the order matters. + check_node(node) + return found + + +def _unpack_subscriptlist(subscriptlist): + if subscriptlist.type == 'subscriptlist': + for subscript in subscriptlist.children[::2]: + if subscript.type != 'subscript': + yield subscript + else: + if subscriptlist.type != 'subscript': + yield subscriptlist diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/gradual/conversion.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/gradual/conversion.py new file mode 100644 index 0000000..88f4942 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/gradual/conversion.py @@ -0,0 +1,199 @@ +from jedi import debug +from jedi.evaluate.base_context import ContextSet, \ + NO_CONTEXTS +from jedi.evaluate.utils import to_list +from jedi.evaluate.gradual.stub_context import StubModuleContext + + +def _stub_to_python_context_set(stub_context, ignore_compiled=False): + stub_module = stub_context.get_root_context() + if not stub_module.is_stub(): + return ContextSet([stub_context]) + + was_instance = stub_context.is_instance() + if was_instance: + stub_context = stub_context.py__class__() + + qualified_names = stub_context.get_qualified_names() + if qualified_names is None: + return NO_CONTEXTS + + was_bound_method = stub_context.is_bound_method() + if was_bound_method: + # Infer the object first. We can infer the method later. + method_name = qualified_names[-1] + qualified_names = qualified_names[:-1] + was_instance = True + + contexts = _infer_from_stub(stub_module, qualified_names, ignore_compiled) + if was_instance: + contexts = ContextSet.from_sets( + c.execute_evaluated() + for c in contexts + if c.is_class() + ) + if was_bound_method: + # Now that the instance has been properly created, we can simply get + # the method. + contexts = contexts.py__getattribute__(method_name) + return contexts + + +def _infer_from_stub(stub_module, qualified_names, ignore_compiled): + from jedi.evaluate.compiled.mixed import MixedObject + assert isinstance(stub_module, (StubModuleContext, MixedObject)), stub_module + non_stubs = stub_module.non_stub_context_set + if ignore_compiled: + non_stubs = non_stubs.filter(lambda c: not c.is_compiled()) + for name in qualified_names: + non_stubs = non_stubs.py__getattribute__(name) + return non_stubs + + +@to_list +def _try_stub_to_python_names(names, prefer_stub_to_compiled=False): + for name in names: + module = name.get_root_context() + if not module.is_stub(): + yield name + continue + + name_list = name.get_qualified_names() + if name_list is None: + contexts = NO_CONTEXTS + else: + contexts = _infer_from_stub( + module, + name_list[:-1], + ignore_compiled=prefer_stub_to_compiled, + ) + if contexts and name_list: + new_names = contexts.py__getattribute__(name_list[-1], is_goto=True) + for new_name in new_names: + yield new_name + if new_names: + continue + elif contexts: + for c in contexts: + yield c.name + continue + # This is the part where if we haven't found anything, just return the + # stub name. + yield name + + +def _load_stub_module(module): + if module.is_stub(): + return module + from jedi.evaluate.gradual.typeshed import _try_to_load_stub_cached + return _try_to_load_stub_cached( + module.evaluator, + import_names=module.string_names, + python_context_set=ContextSet([module]), + parent_module_context=None, + sys_path=module.evaluator.get_sys_path(), + ) + + +@to_list +def _python_to_stub_names(names, fallback_to_python=False): + for name in names: + module = name.get_root_context() + if module.is_stub(): + yield name + continue + + if name.is_import(): + for new_name in name.goto(): + # Imports don't need to be converted, because they are already + # stubs if possible. + if fallback_to_python or new_name.is_stub(): + yield new_name + continue + + name_list = name.get_qualified_names() + stubs = NO_CONTEXTS + if name_list is not None: + stub_module = _load_stub_module(module) + if stub_module is not None: + stubs = ContextSet({stub_module}) + for name in name_list[:-1]: + stubs = stubs.py__getattribute__(name) + if stubs and name_list: + new_names = stubs.py__getattribute__(name_list[-1], is_goto=True) + for new_name in new_names: + yield new_name + if new_names: + continue + elif stubs: + for c in stubs: + yield c.name + continue + if fallback_to_python: + # This is the part where if we haven't found anything, just return + # the stub name. + yield name + + +def convert_names(names, only_stubs=False, prefer_stubs=False): + assert not (only_stubs and prefer_stubs) + with debug.increase_indent_cm('convert names'): + if only_stubs or prefer_stubs: + return _python_to_stub_names(names, fallback_to_python=prefer_stubs) + else: + return _try_stub_to_python_names(names, prefer_stub_to_compiled=True) + + +def convert_contexts(contexts, only_stubs=False, prefer_stubs=False, ignore_compiled=True): + assert not (only_stubs and prefer_stubs) + with debug.increase_indent_cm('convert contexts'): + if only_stubs or prefer_stubs: + return ContextSet.from_sets( + to_stub(context) + or (ContextSet({context}) if prefer_stubs else NO_CONTEXTS) + for context in contexts + ) + else: + return ContextSet.from_sets( + _stub_to_python_context_set(stub_context, ignore_compiled=ignore_compiled) + or ContextSet({stub_context}) + for stub_context in contexts + ) + + +# TODO merge with _python_to_stub_names? +def to_stub(context): + if context.is_stub(): + return ContextSet([context]) + + was_instance = context.is_instance() + if was_instance: + context = context.py__class__() + + qualified_names = context.get_qualified_names() + stub_module = _load_stub_module(context.get_root_context()) + if stub_module is None or qualified_names is None: + return NO_CONTEXTS + + was_bound_method = context.is_bound_method() + if was_bound_method: + # Infer the object first. We can infer the method later. + method_name = qualified_names[-1] + qualified_names = qualified_names[:-1] + was_instance = True + + stub_contexts = ContextSet([stub_module]) + for name in qualified_names: + stub_contexts = stub_contexts.py__getattribute__(name) + + if was_instance: + stub_contexts = ContextSet.from_sets( + c.execute_evaluated() + for c in stub_contexts + if c.is_class() + ) + if was_bound_method: + # Now that the instance has been properly created, we can simply get + # the method. + stub_contexts = stub_contexts.py__getattribute__(method_name) + return stub_contexts diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/gradual/stub_context.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/gradual/stub_context.py new file mode 100644 index 0000000..94090c1 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/gradual/stub_context.py @@ -0,0 +1,105 @@ +from jedi.evaluate.base_context import ContextWrapper +from jedi.evaluate.context.module import ModuleContext +from jedi.evaluate.filters import ParserTreeFilter, \ + TreeNameDefinition +from jedi.evaluate.gradual.typing import TypingModuleFilterWrapper + + +class StubModuleContext(ModuleContext): + def __init__(self, non_stub_context_set, *args, **kwargs): + super(StubModuleContext, self).__init__(*args, **kwargs) + self.non_stub_context_set = non_stub_context_set + + def is_stub(self): + return True + + def sub_modules_dict(self): + """ + We have to overwrite this, because it's possible to have stubs that + don't have code for all the child modules. At the time of writing this + there are for example no stubs for `json.tool`. + """ + names = {} + for context in self.non_stub_context_set: + try: + method = context.sub_modules_dict + except AttributeError: + pass + else: + names.update(method()) + names.update(super(StubModuleContext, self).sub_modules_dict()) + return names + + def _get_first_non_stub_filters(self): + for context in self.non_stub_context_set: + yield next(context.get_filters(search_global=False)) + + def _get_stub_filters(self, search_global, **filter_kwargs): + return [StubFilter( + self.evaluator, + context=self, + search_global=search_global, + **filter_kwargs + )] + list(self.iter_star_filters(search_global=search_global)) + + def get_filters(self, search_global=False, until_position=None, + origin_scope=None, **kwargs): + filters = super(StubModuleContext, self).get_filters( + search_global, until_position, origin_scope, **kwargs + ) + next(filters) # Ignore the first filter and replace it with our own + stub_filters = self._get_stub_filters( + search_global=search_global, + until_position=until_position, + origin_scope=origin_scope, + ) + for f in stub_filters: + yield f + + for f in filters: + yield f + + +class TypingModuleWrapper(StubModuleContext): + def get_filters(self, *args, **kwargs): + filters = super(TypingModuleWrapper, self).get_filters(*args, **kwargs) + yield TypingModuleFilterWrapper(next(filters)) + for f in filters: + yield f + + +# From here on down we make looking up the sys.version_info fast. +class _StubName(TreeNameDefinition): + def infer(self): + inferred = super(_StubName, self).infer() + if self.string_name == 'version_info' and self.get_root_context().py__name__() == 'sys': + return [VersionInfo(c) for c in inferred] + return inferred + + +class StubFilter(ParserTreeFilter): + name_class = _StubName + + def __init__(self, *args, **kwargs): + self._search_global = kwargs.pop('search_global') # Python 2 :/ + super(StubFilter, self).__init__(*args, **kwargs) + + def _is_name_reachable(self, name): + if not super(StubFilter, self)._is_name_reachable(name): + return False + + if not self._search_global: + # Imports in stub files are only public if they have an "as" + # export. + definition = name.get_definition() + if definition.type in ('import_from', 'import_name'): + if name.parent.type not in ('import_as_name', 'dotted_as_name'): + return False + n = name.value + if n.startswith('_') and not (n.startswith('__') and n.endswith('__')): + return False + return True + + +class VersionInfo(ContextWrapper): + pass diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/gradual/typeshed.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/gradual/typeshed.py new file mode 100644 index 0000000..5a386c0 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/gradual/typeshed.py @@ -0,0 +1,289 @@ +import os +import re +from functools import wraps + +from jedi.file_io import FileIO +from jedi._compatibility import FileNotFoundError, cast_path +from jedi.parser_utils import get_cached_code_lines +from jedi.evaluate.base_context import ContextSet, NO_CONTEXTS +from jedi.evaluate.gradual.stub_context import TypingModuleWrapper, StubModuleContext + +_jedi_path = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) +TYPESHED_PATH = os.path.join(_jedi_path, 'third_party', 'typeshed') + +_IMPORT_MAP = dict( + _collections='collections', + _socket='socket', +) + + +def _merge_create_stub_map(directories): + map_ = {} + for directory in directories: + map_.update(_create_stub_map(directory)) + return map_ + + +def _create_stub_map(directory): + """ + Create a mapping of an importable name in Python to a stub file. + """ + def generate(): + try: + listed = os.listdir(directory) + except (FileNotFoundError, OSError): + # OSError is Python 2 + return + + for entry in listed: + entry = cast_path(entry) + path = os.path.join(directory, entry) + if os.path.isdir(path): + init = os.path.join(path, '__init__.pyi') + if os.path.isfile(init): + yield entry, init + elif entry.endswith('.pyi') and os.path.isfile(path): + name = entry.rstrip('.pyi') + if name != '__init__': + yield name, path + + # Create a dictionary from the tuple generator. + return dict(generate()) + + +def _get_typeshed_directories(version_info): + check_version_list = ['2and3', str(version_info.major)] + for base in ['stdlib', 'third_party']: + base = os.path.join(TYPESHED_PATH, base) + base_list = os.listdir(base) + for base_list_entry in base_list: + match = re.match(r'(\d+)\.(\d+)$', base_list_entry) + if match is not None: + if int(match.group(1)) == version_info.major \ + and int(match.group(2)) <= version_info.minor: + check_version_list.append(base_list_entry) + + for check_version in check_version_list: + yield os.path.join(base, check_version) + + +_version_cache = {} + + +def _cache_stub_file_map(version_info): + """ + Returns a map of an importable name in Python to a stub file. + """ + # TODO this caches the stub files indefinitely, maybe use a time cache + # for that? + version = version_info[:2] + try: + return _version_cache[version] + except KeyError: + pass + + _version_cache[version] = file_set = \ + _merge_create_stub_map(_get_typeshed_directories(version_info)) + return file_set + + +def import_module_decorator(func): + @wraps(func) + def wrapper(evaluator, import_names, parent_module_context, sys_path, prefer_stubs): + try: + python_context_set = evaluator.module_cache.get(import_names) + except KeyError: + if parent_module_context is not None and parent_module_context.is_stub(): + parent_module_contexts = parent_module_context.non_stub_context_set + else: + parent_module_contexts = [parent_module_context] + if import_names == ('os', 'path'): + # This is a huge exception, we follow a nested import + # ``os.path``, because it's a very important one in Python + # that is being achieved by messing with ``sys.modules`` in + # ``os``. + python_parent = next(iter(parent_module_contexts)) + if python_parent is None: + python_parent, = evaluator.import_module(('os',), prefer_stubs=False) + python_context_set = python_parent.py__getattribute__('path') + else: + python_context_set = ContextSet.from_sets( + func(evaluator, import_names, p, sys_path,) + for p in parent_module_contexts + ) + evaluator.module_cache.add(import_names, python_context_set) + + if not prefer_stubs: + return python_context_set + + stub = _try_to_load_stub_cached(evaluator, import_names, python_context_set, + parent_module_context, sys_path) + if stub is not None: + return ContextSet([stub]) + return python_context_set + + return wrapper + + +def _try_to_load_stub_cached(evaluator, import_names, *args, **kwargs): + try: + return evaluator.stub_module_cache[import_names] + except KeyError: + pass + + # TODO is this needed? where are the exceptions coming from that make this + # necessary? Just remove this line. + evaluator.stub_module_cache[import_names] = None + evaluator.stub_module_cache[import_names] = result = \ + _try_to_load_stub(evaluator, import_names, *args, **kwargs) + return result + + +def _try_to_load_stub(evaluator, import_names, python_context_set, + parent_module_context, sys_path): + """ + Trying to load a stub for a set of import_names. + + This is modelled to work like "PEP 561 -- Distributing and Packaging Type + Information", see https://www.python.org/dev/peps/pep-0561. + """ + if parent_module_context is None and len(import_names) > 1: + try: + parent_module_context = _try_to_load_stub_cached( + evaluator, import_names[:-1], NO_CONTEXTS, + parent_module_context=None, sys_path=sys_path) + except KeyError: + pass + + # 1. Try to load foo-stubs folders on path for import name foo. + if len(import_names) == 1: + # foo-stubs + for p in sys_path: + init = os.path.join(p, *import_names) + '-stubs' + os.path.sep + '__init__.pyi' + m = _try_to_load_stub_from_file( + evaluator, + python_context_set, + file_io=FileIO(init), + import_names=import_names, + ) + if m is not None: + return m + + # 2. Try to load pyi files next to py files. + for c in python_context_set: + try: + method = c.py__file__ + except AttributeError: + pass + else: + file_path = method() + file_paths = [] + if c.is_namespace(): + file_paths = [os.path.join(p, '__init__.pyi') for p in c.py__path__()] + elif file_path is not None and file_path.endswith('.py'): + file_paths = [file_path + 'i'] + + for file_path in file_paths: + m = _try_to_load_stub_from_file( + evaluator, + python_context_set, + # The file path should end with .pyi + file_io=FileIO(file_path), + import_names=import_names, + ) + if m is not None: + return m + + # 3. Try to load typeshed + m = _load_from_typeshed(evaluator, python_context_set, parent_module_context, import_names) + if m is not None: + return m + + # 4. Try to load pyi file somewhere if python_context_set was not defined. + if not python_context_set: + if parent_module_context is not None: + try: + method = parent_module_context.py__path__ + except AttributeError: + check_path = [] + else: + check_path = method() + # In case import_names + names_for_path = (import_names[-1],) + else: + check_path = sys_path + names_for_path = import_names + + for p in check_path: + m = _try_to_load_stub_from_file( + evaluator, + python_context_set, + file_io=FileIO(os.path.join(p, *names_for_path) + '.pyi'), + import_names=import_names, + ) + if m is not None: + return m + + # If no stub is found, that's fine, the calling function has to deal with + # it. + return None + + +def _load_from_typeshed(evaluator, python_context_set, parent_module_context, import_names): + import_name = import_names[-1] + map_ = None + if len(import_names) == 1: + map_ = _cache_stub_file_map(evaluator.grammar.version_info) + import_name = _IMPORT_MAP.get(import_name, import_name) + elif isinstance(parent_module_context, StubModuleContext): + if not parent_module_context.is_package: + # Only if it's a package (= a folder) something can be + # imported. + return None + path = parent_module_context.py__path__() + map_ = _merge_create_stub_map(path) + + if map_ is not None: + path = map_.get(import_name) + if path is not None: + return _try_to_load_stub_from_file( + evaluator, + python_context_set, + file_io=FileIO(path), + import_names=import_names, + ) + + +def _try_to_load_stub_from_file(evaluator, python_context_set, file_io, import_names): + try: + stub_module_node = evaluator.parse( + file_io=file_io, + cache=True, + use_latest_grammar=True + ) + except (OSError, IOError): # IOError is Python 2 only + # The file that you're looking for doesn't exist (anymore). + return None + else: + return create_stub_module( + evaluator, python_context_set, stub_module_node, file_io, + import_names + ) + + +def create_stub_module(evaluator, python_context_set, stub_module_node, file_io, import_names): + if import_names == ('typing',): + module_cls = TypingModuleWrapper + else: + module_cls = StubModuleContext + file_name = os.path.basename(file_io.path) + stub_module_context = module_cls( + python_context_set, evaluator, stub_module_node, + file_io=file_io, + string_names=import_names, + # The code was loaded with latest_grammar, so use + # that. + code_lines=get_cached_code_lines(evaluator.latest_grammar, file_io.path), + is_package=file_name == '__init__.pyi', + ) + return stub_module_context diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/gradual/typing.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/gradual/typing.py new file mode 100644 index 0000000..20f2321 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/gradual/typing.py @@ -0,0 +1,707 @@ +""" +We need to somehow work with the typing objects. Since the typing objects are +pretty bare we need to add all the Jedi customizations to make them work as +contexts. + +This file deals with all the typing.py cases. +""" +from jedi._compatibility import unicode, force_unicode +from jedi import debug +from jedi.evaluate.cache import evaluator_method_cache +from jedi.evaluate.compiled import builtin_from_name +from jedi.evaluate.base_context import ContextSet, NO_CONTEXTS, Context, \ + iterator_to_context_set, ContextWrapper, LazyContextWrapper +from jedi.evaluate.lazy_context import LazyKnownContexts +from jedi.evaluate.context.iterable import SequenceLiteralContext +from jedi.evaluate.arguments import repack_with_argument_clinic +from jedi.evaluate.utils import to_list +from jedi.evaluate.filters import FilterWrapper +from jedi.evaluate.names import NameWrapper, AbstractTreeName, \ + AbstractNameDefinition, ContextName +from jedi.evaluate.helpers import is_string +from jedi.evaluate.context.klass import ClassMixin, ClassFilter + +_PROXY_CLASS_TYPES = 'Tuple Generic Protocol Callable Type'.split() +_TYPE_ALIAS_TYPES = { + 'List': 'builtins.list', + 'Dict': 'builtins.dict', + 'Set': 'builtins.set', + 'FrozenSet': 'builtins.frozenset', + 'ChainMap': 'collections.ChainMap', + 'Counter': 'collections.Counter', + 'DefaultDict': 'collections.defaultdict', + 'Deque': 'collections.deque', +} +_PROXY_TYPES = 'Optional Union ClassVar'.split() + + +class TypingName(AbstractTreeName): + def __init__(self, context, other_name): + super(TypingName, self).__init__(context.parent_context, other_name.tree_name) + self._context = context + + def infer(self): + return ContextSet([self._context]) + + +class _BaseTypingContext(Context): + def __init__(self, evaluator, parent_context, tree_name): + super(_BaseTypingContext, self).__init__(evaluator, parent_context) + self._tree_name = tree_name + + @property + def tree_node(self): + return self._tree_name + + def get_filters(self, *args, **kwargs): + # TODO this is obviously wrong. Is it though? + class EmptyFilter(ClassFilter): + def __init__(self): + pass + + def get(self, name, **kwargs): + return [] + + def values(self, **kwargs): + return [] + + yield EmptyFilter() + + def py__class__(self): + # TODO this is obviously not correct, but at least gives us a class if + # we have none. Some of these objects don't really have a base class in + # typeshed. + return builtin_from_name(self.evaluator, u'object') + + @property + def name(self): + return ContextName(self, self._tree_name) + + def __repr__(self): + return '%s(%s)' % (self.__class__.__name__, self._tree_name.value) + + +class TypingModuleName(NameWrapper): + def infer(self): + return ContextSet(self._remap()) + + def _remap(self): + name = self.string_name + evaluator = self.parent_context.evaluator + try: + actual = _TYPE_ALIAS_TYPES[name] + except KeyError: + pass + else: + yield TypeAlias.create_cached(evaluator, self.parent_context, self.tree_name, actual) + return + + if name in _PROXY_CLASS_TYPES: + yield TypingClassContext.create_cached(evaluator, self.parent_context, self.tree_name) + elif name in _PROXY_TYPES: + yield TypingContext.create_cached(evaluator, self.parent_context, self.tree_name) + elif name == 'runtime': + # We don't want anything here, not sure what this function is + # supposed to do, since it just appears in the stubs and shouldn't + # have any effects there (because it's never executed). + return + elif name == 'TypeVar': + yield TypeVarClass.create_cached(evaluator, self.parent_context, self.tree_name) + elif name == 'Any': + yield Any.create_cached(evaluator, self.parent_context, self.tree_name) + elif name == 'TYPE_CHECKING': + # This is needed for e.g. imports that are only available for type + # checking or are in cycles. The user can then check this variable. + yield builtin_from_name(evaluator, u'True') + elif name == 'overload': + yield OverloadFunction.create_cached(evaluator, self.parent_context, self.tree_name) + elif name == 'NewType': + yield NewTypeFunction.create_cached(evaluator, self.parent_context, self.tree_name) + elif name == 'cast': + # TODO implement cast + yield CastFunction.create_cached(evaluator, self.parent_context, self.tree_name) + elif name == 'TypedDict': + # TODO doesn't even exist in typeshed/typing.py, yet. But will be + # added soon. + pass + elif name in ('no_type_check', 'no_type_check_decorator'): + # This is not necessary, as long as we are not doing type checking. + for c in self._wrapped_name.infer(): # Fuck my life Python 2 + yield c + else: + # Everything else shouldn't be relevant for type checking. + for c in self._wrapped_name.infer(): # Fuck my life Python 2 + yield c + + +class TypingModuleFilterWrapper(FilterWrapper): + name_wrapper_class = TypingModuleName + + +class _WithIndexBase(_BaseTypingContext): + def __init__(self, evaluator, parent_context, name, index_context, context_of_index): + super(_WithIndexBase, self).__init__(evaluator, parent_context, name) + self._index_context = index_context + self._context_of_index = context_of_index + + def __repr__(self): + return '<%s: %s[%s]>' % ( + self.__class__.__name__, + self._tree_name.value, + self._index_context, + ) + + +class TypingContextWithIndex(_WithIndexBase): + def execute_annotation(self): + string_name = self._tree_name.value + + if string_name == 'Union': + # This is kind of a special case, because we have Unions (in Jedi + # ContextSets). + return self.gather_annotation_classes().execute_annotation() + elif string_name == 'Optional': + # Optional is basically just saying it's either None or the actual + # type. + return self.gather_annotation_classes().execute_annotation() \ + | ContextSet([builtin_from_name(self.evaluator, u'None')]) + elif string_name == 'Type': + # The type is actually already given in the index_context + return ContextSet([self._index_context]) + elif string_name == 'ClassVar': + # For now don't do anything here, ClassVars are always used. + return self._index_context.execute_annotation() + + cls = globals()[string_name] + return ContextSet([cls( + self.evaluator, + self.parent_context, + self._tree_name, + self._index_context, + self._context_of_index + )]) + + def gather_annotation_classes(self): + return ContextSet.from_sets( + _iter_over_arguments(self._index_context, self._context_of_index) + ) + + +class TypingContext(_BaseTypingContext): + index_class = TypingContextWithIndex + py__simple_getitem__ = None + + def py__getitem__(self, index_context_set, contextualized_node): + return ContextSet( + self.index_class.create_cached( + self.evaluator, + self.parent_context, + self._tree_name, + index_context, + context_of_index=contextualized_node.context) + for index_context in index_context_set + ) + + +class _TypingClassMixin(object): + def py__bases__(self): + return [LazyKnownContexts( + self.evaluator.builtins_module.py__getattribute__('object') + )] + + def get_metaclasses(self): + return [] + + +class TypingClassContextWithIndex(_TypingClassMixin, TypingContextWithIndex, ClassMixin): + pass + + +class TypingClassContext(_TypingClassMixin, TypingContext, ClassMixin): + index_class = TypingClassContextWithIndex + + +def _iter_over_arguments(maybe_tuple_context, defining_context): + def iterate(): + if isinstance(maybe_tuple_context, SequenceLiteralContext): + for lazy_context in maybe_tuple_context.py__iter__(contextualized_node=None): + yield lazy_context.infer() + else: + yield ContextSet([maybe_tuple_context]) + + def resolve_forward_references(context_set): + for context in context_set: + if is_string(context): + from jedi.evaluate.gradual.annotation import _get_forward_reference_node + node = _get_forward_reference_node(defining_context, context.get_safe_value()) + if node is not None: + for c in defining_context.eval_node(node): + yield c + else: + yield context + + for context_set in iterate(): + yield ContextSet(resolve_forward_references(context_set)) + + +class TypeAlias(LazyContextWrapper): + def __init__(self, parent_context, origin_tree_name, actual): + self.evaluator = parent_context.evaluator + self.parent_context = parent_context + self._origin_tree_name = origin_tree_name + self._actual = actual # e.g. builtins.list + + @property + def name(self): + return ContextName(self, self._origin_tree_name) + + def py__name__(self): + return self.name.string_name + + def __repr__(self): + return '<%s: %s>' % (self.__class__.__name__, self._actual) + + def _get_wrapped_context(self): + module_name, class_name = self._actual.split('.') + if self.evaluator.environment.version_info.major == 2 and module_name == 'builtins': + module_name = '__builtin__' + + # TODO use evaluator.import_module? + from jedi.evaluate.imports import Importer + module, = Importer( + self.evaluator, [module_name], self.evaluator.builtins_module + ).follow() + classes = module.py__getattribute__(class_name) + # There should only be one, because it's code that we control. + assert len(classes) == 1, classes + cls = next(iter(classes)) + return cls + + +class _ContainerBase(_WithIndexBase): + def _get_getitem_contexts(self, index): + args = _iter_over_arguments(self._index_context, self._context_of_index) + for i, contexts in enumerate(args): + if i == index: + return contexts + + debug.warning('No param #%s found for annotation %s', index, self._index_context) + return NO_CONTEXTS + + +class Callable(_ContainerBase): + def py__call__(self, arguments): + # The 0th index are the arguments. + return self._get_getitem_contexts(1).execute_annotation() + + +class Tuple(_ContainerBase): + def _is_homogenous(self): + # To specify a variable-length tuple of homogeneous type, Tuple[T, ...] + # is used. + if isinstance(self._index_context, SequenceLiteralContext): + entries = self._index_context.get_tree_entries() + if len(entries) == 2 and entries[1] == '...': + return True + return False + + def py__simple_getitem__(self, index): + if self._is_homogenous(): + return self._get_getitem_contexts(0).execute_annotation() + else: + if isinstance(index, int): + return self._get_getitem_contexts(index).execute_annotation() + + debug.dbg('The getitem type on Tuple was %s' % index) + return NO_CONTEXTS + + def py__iter__(self, contextualized_node=None): + if self._is_homogenous(): + yield LazyKnownContexts(self._get_getitem_contexts(0).execute_annotation()) + else: + if isinstance(self._index_context, SequenceLiteralContext): + for i in range(self._index_context.py__len__()): + yield LazyKnownContexts(self._get_getitem_contexts(i).execute_annotation()) + + def py__getitem__(self, index_context_set, contextualized_node): + if self._is_homogenous(): + return self._get_getitem_contexts(0).execute_annotation() + + return ContextSet.from_sets( + _iter_over_arguments(self._index_context, self._context_of_index) + ).execute_annotation() + + +class Generic(_ContainerBase): + pass + + +class Protocol(_ContainerBase): + pass + + +class Any(_BaseTypingContext): + def execute_annotation(self): + debug.warning('Used Any - returned no results') + return NO_CONTEXTS + + +class TypeVarClass(_BaseTypingContext): + def py__call__(self, arguments): + unpacked = arguments.unpack() + + key, lazy_context = next(unpacked, (None, None)) + var_name = self._find_string_name(lazy_context) + # The name must be given, otherwise it's useless. + if var_name is None or key is not None: + debug.warning('Found a variable without a name %s', arguments) + return NO_CONTEXTS + + return ContextSet([TypeVar.create_cached( + self.evaluator, + self.parent_context, + self._tree_name, + var_name, + unpacked + )]) + + def _find_string_name(self, lazy_context): + if lazy_context is None: + return None + + context_set = lazy_context.infer() + if not context_set: + return None + if len(context_set) > 1: + debug.warning('Found multiple contexts for a type variable: %s', context_set) + + name_context = next(iter(context_set)) + try: + method = name_context.get_safe_value + except AttributeError: + return None + else: + safe_value = method(default=None) + if self.evaluator.environment.version_info.major == 2: + if isinstance(safe_value, bytes): + return force_unicode(safe_value) + if isinstance(safe_value, (str, unicode)): + return safe_value + return None + + +class TypeVar(_BaseTypingContext): + def __init__(self, evaluator, parent_context, tree_name, var_name, unpacked_args): + super(TypeVar, self).__init__(evaluator, parent_context, tree_name) + self._var_name = var_name + + self._constraints_lazy_contexts = [] + self._bound_lazy_context = None + self._covariant_lazy_context = None + self._contravariant_lazy_context = None + for key, lazy_context in unpacked_args: + if key is None: + self._constraints_lazy_contexts.append(lazy_context) + else: + if key == 'bound': + self._bound_lazy_context = lazy_context + elif key == 'covariant': + self._covariant_lazy_context = lazy_context + elif key == 'contravariant': + self._contra_variant_lazy_context = lazy_context + else: + debug.warning('Invalid TypeVar param name %s', key) + + def py__name__(self): + return self._var_name + + def get_filters(self, *args, **kwargs): + return iter([]) + + def _get_classes(self): + if self._bound_lazy_context is not None: + return self._bound_lazy_context.infer() + if self._constraints_lazy_contexts: + return self.constraints + debug.warning('Tried to infer the TypeVar %s without a given type', self._var_name) + return NO_CONTEXTS + + def is_same_class(self, other): + # Everything can match an undefined type var. + return True + + @property + def constraints(self): + return ContextSet.from_sets( + lazy.infer() for lazy in self._constraints_lazy_contexts + ) + + def define_generics(self, type_var_dict): + try: + found = type_var_dict[self.py__name__()] + except KeyError: + pass + else: + if found: + return found + return self._get_classes() or ContextSet({self}) + + def execute_annotation(self): + return self._get_classes().execute_annotation() + + def __repr__(self): + return '<%s: %s>' % (self.__class__.__name__, self.py__name__()) + + +class OverloadFunction(_BaseTypingContext): + @repack_with_argument_clinic('func, /') + def py__call__(self, func_context_set): + # Just pass arguments through. + return func_context_set + + +class NewTypeFunction(_BaseTypingContext): + def py__call__(self, arguments): + ordered_args = arguments.unpack() + next(ordered_args, (None, None)) + _, second_arg = next(ordered_args, (None, None)) + if second_arg is None: + return NO_CONTEXTS + return ContextSet( + NewType( + self.evaluator, + contextualized_node.context, + contextualized_node.node, + second_arg.infer(), + ) for contextualized_node in arguments.get_calling_nodes()) + + +class NewType(Context): + def __init__(self, evaluator, parent_context, tree_node, type_context_set): + super(NewType, self).__init__(evaluator, parent_context) + self._type_context_set = type_context_set + self.tree_node = tree_node + + def py__call__(self, arguments): + return self._type_context_set.execute_annotation() + + +class CastFunction(_BaseTypingContext): + @repack_with_argument_clinic('type, object, /') + def py__call__(self, type_context_set, object_context_set): + return type_context_set.execute_annotation() + + +class BoundTypeVarName(AbstractNameDefinition): + """ + This type var was bound to a certain type, e.g. int. + """ + def __init__(self, type_var, context_set): + self._type_var = type_var + self.parent_context = type_var.parent_context + self._context_set = context_set + + def infer(self): + def iter_(): + for context in self._context_set: + # Replace any with the constraints if they are there. + if isinstance(context, Any): + for constraint in self._type_var.constraints: + yield constraint + else: + yield context + return ContextSet(iter_()) + + def py__name__(self): + return self._type_var.py__name__() + + def __repr__(self): + return '<%s %s -> %s>' % (self.__class__.__name__, self.py__name__(), self._context_set) + + +class TypeVarFilter(object): + """ + A filter for all given variables in a class. + + A = TypeVar('A') + B = TypeVar('B') + class Foo(Mapping[A, B]): + ... + + In this example we would have two type vars given: A and B + """ + def __init__(self, generics, type_vars): + self._generics = generics + self._type_vars = type_vars + + def get(self, name): + for i, type_var in enumerate(self._type_vars): + if type_var.py__name__() == name: + try: + return [BoundTypeVarName(type_var, self._generics[i])] + except IndexError: + return [type_var.name] + return [] + + def values(self): + # The values are not relevant. If it's not searched exactly, the type + # vars are just global and should be looked up as that. + return [] + + +class AbstractAnnotatedClass(ClassMixin, ContextWrapper): + def get_type_var_filter(self): + return TypeVarFilter(self.get_generics(), self.list_type_vars()) + + def get_filters(self, search_global=False, *args, **kwargs): + filters = super(AbstractAnnotatedClass, self).get_filters( + search_global, + *args, **kwargs + ) + for f in filters: + yield f + + if search_global: + # The type vars can only be looked up if it's a global search and + # not a direct lookup on the class. + yield self.get_type_var_filter() + + def is_same_class(self, other): + if not isinstance(other, AbstractAnnotatedClass): + return False + + if self.tree_node != other.tree_node: + # TODO not sure if this is nice. + return False + given_params1 = self.get_generics() + given_params2 = other.get_generics() + + if len(given_params1) != len(given_params2): + # If the amount of type vars doesn't match, the class doesn't + # match. + return False + + # Now compare generics + return all( + any( + # TODO why is this ordering the correct one? + cls2.is_same_class(cls1) + for cls1 in class_set1 + for cls2 in class_set2 + ) for class_set1, class_set2 in zip(given_params1, given_params2) + ) + + def py__call__(self, arguments): + instance, = super(AbstractAnnotatedClass, self).py__call__(arguments) + return ContextSet([InstanceWrapper(instance)]) + + def get_generics(self): + raise NotImplementedError + + def define_generics(self, type_var_dict): + changed = False + new_generics = [] + for generic_set in self.get_generics(): + contexts = NO_CONTEXTS + for generic in generic_set: + if isinstance(generic, (AbstractAnnotatedClass, TypeVar)): + result = generic.define_generics(type_var_dict) + contexts |= result + if result != ContextSet({generic}): + changed = True + else: + contexts |= ContextSet([generic]) + new_generics.append(contexts) + + if not changed: + # There might not be any type vars that change. In that case just + # return itself, because it does not make sense to potentially lose + # cached results. + return ContextSet([self]) + + return ContextSet([GenericClass( + self._wrapped_context, + generics=tuple(new_generics) + )]) + + def __repr__(self): + return '<%s: %s%s>' % ( + self.__class__.__name__, + self._wrapped_context, + list(self.get_generics()), + ) + + @to_list + def py__bases__(self): + for base in self._wrapped_context.py__bases__(): + yield LazyAnnotatedBaseClass(self, base) + + +class LazyGenericClass(AbstractAnnotatedClass): + def __init__(self, class_context, index_context, context_of_index): + super(LazyGenericClass, self).__init__(class_context) + self._index_context = index_context + self._context_of_index = context_of_index + + @evaluator_method_cache() + def get_generics(self): + return list(_iter_over_arguments(self._index_context, self._context_of_index)) + + +class GenericClass(AbstractAnnotatedClass): + def __init__(self, class_context, generics): + super(GenericClass, self).__init__(class_context) + self._generics = generics + + def get_generics(self): + return self._generics + + +class LazyAnnotatedBaseClass(object): + def __init__(self, class_context, lazy_base_class): + self._class_context = class_context + self._lazy_base_class = lazy_base_class + + @iterator_to_context_set + def infer(self): + for base in self._lazy_base_class.infer(): + if isinstance(base, AbstractAnnotatedClass): + # Here we have to recalculate the given types. + yield GenericClass.create_cached( + base.evaluator, + base._wrapped_context, + tuple(self._remap_type_vars(base)), + ) + else: + yield base + + def _remap_type_vars(self, base): + filter = self._class_context.get_type_var_filter() + for type_var_set in base.get_generics(): + new = NO_CONTEXTS + for type_var in type_var_set: + if isinstance(type_var, TypeVar): + names = filter.get(type_var.py__name__()) + new |= ContextSet.from_sets( + name.infer() for name in names + ) + else: + # Mostly will be type vars, except if in some cases + # a concrete type will already be there. In that + # case just add it to the context set. + new |= ContextSet([type_var]) + yield new + + +class InstanceWrapper(ContextWrapper): + def py__stop_iteration_returns(self): + for cls in self._wrapped_context.class_context.py__mro__(): + if cls.py__name__() == 'Generator': + generics = cls.get_generics() + try: + return generics[2].execute_annotation() + except IndexError: + pass + elif cls.py__name__() == 'Iterator': + return ContextSet([builtin_from_name(self.evaluator, u'None')]) + return self._wrapped_context.py__stop_iteration_returns() diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/gradual/utils.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/gradual/utils.py new file mode 100644 index 0000000..6bc60e6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/gradual/utils.py @@ -0,0 +1,32 @@ +import os + +from jedi.evaluate.gradual.typeshed import TYPESHED_PATH, create_stub_module + + +def load_proper_stub_module(evaluator, file_io, import_names, module_node): + """ + This function is given a random .pyi file and should return the proper + module. + """ + path = file_io.path + assert path.endswith('.pyi') + if path.startswith(TYPESHED_PATH): + # /foo/stdlib/3/os/__init__.pyi -> stdlib/3/os/__init__ + rest = path[len(TYPESHED_PATH) + 1: -4] + split_paths = tuple(rest.split(os.path.sep)) + # Remove the stdlib/3 or third_party/3.5 part + import_names = split_paths[2:] + if import_names[-1] == '__init__': + import_names = import_names[:-1] + + if import_names is not None: + actual_context_set = evaluator.import_module(import_names, prefer_stubs=False) + if not actual_context_set: + return None + + stub = create_stub_module( + evaluator, actual_context_set, module_node, file_io, import_names + ) + evaluator.stub_module_cache[import_names] = stub + return stub + return None diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/helpers.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/helpers.py new file mode 100644 index 0000000..78d2a7f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/helpers.py @@ -0,0 +1,269 @@ +import copy +import sys +import re +import os +from itertools import chain +from contextlib import contextmanager + +from parso.python import tree + +from jedi._compatibility import unicode +from jedi.parser_utils import get_parent_scope + + +def is_stdlib_path(path): + # Python standard library paths look like this: + # /usr/lib/python3.5/... + # TODO The implementation below is probably incorrect and not complete. + if 'dist-packages' in path or 'site-packages' in path: + return False + + base_path = os.path.join(sys.prefix, 'lib', 'python') + return bool(re.match(re.escape(base_path) + r'\d.\d', path)) + + +def deep_ast_copy(obj): + """ + Much, much faster than copy.deepcopy, but just for parser tree nodes. + """ + # If it's already in the cache, just return it. + new_obj = copy.copy(obj) + + # Copy children + new_children = [] + for child in obj.children: + if isinstance(child, tree.Leaf): + new_child = copy.copy(child) + new_child.parent = new_obj + else: + new_child = deep_ast_copy(child) + new_child.parent = new_obj + new_children.append(new_child) + new_obj.children = new_children + + return new_obj + + +def evaluate_call_of_leaf(context, leaf, cut_own_trailer=False): + """ + Creates a "call" node that consist of all ``trailer`` and ``power`` + objects. E.g. if you call it with ``append``:: + + list([]).append(3) or None + + You would get a node with the content ``list([]).append`` back. + + This generates a copy of the original ast node. + + If you're using the leaf, e.g. the bracket `)` it will return ``list([])``. + + We use this function for two purposes. Given an expression ``bar.foo``, + we may want to + - infer the type of ``foo`` to offer completions after foo + - infer the type of ``bar`` to be able to jump to the definition of foo + The option ``cut_own_trailer`` must be set to true for the second purpose. + """ + trailer = leaf.parent + if trailer.type == 'fstring': + from jedi.evaluate import compiled + return compiled.get_string_context_set(context.evaluator) + + # The leaf may not be the last or first child, because there exist three + # different trailers: `( x )`, `[ x ]` and `.x`. In the first two examples + # we should not match anything more than x. + if trailer.type != 'trailer' or leaf not in (trailer.children[0], trailer.children[-1]): + if trailer.type == 'atom': + return context.eval_node(trailer) + return context.eval_node(leaf) + + power = trailer.parent + index = power.children.index(trailer) + if cut_own_trailer: + cut = index + else: + cut = index + 1 + + if power.type == 'error_node': + start = index + while True: + start -= 1 + base = power.children[start] + if base.type != 'trailer': + break + trailers = power.children[start + 1: index + 1] + else: + base = power.children[0] + trailers = power.children[1:cut] + + if base == 'await': + base = trailers[0] + trailers = trailers[1:] + + values = context.eval_node(base) + from jedi.evaluate.syntax_tree import eval_trailer + for trailer in trailers: + values = eval_trailer(context, values, trailer) + return values + + +def call_of_leaf(leaf): + """ + Creates a "call" node that consist of all ``trailer`` and ``power`` + objects. E.g. if you call it with ``append``:: + + list([]).append(3) or None + + You would get a node with the content ``list([]).append`` back. + + This generates a copy of the original ast node. + + If you're using the leaf, e.g. the bracket `)` it will return ``list([])``. + """ + # TODO this is the old version of this call. Try to remove it. + trailer = leaf.parent + # The leaf may not be the last or first child, because there exist three + # different trailers: `( x )`, `[ x ]` and `.x`. In the first two examples + # we should not match anything more than x. + if trailer.type != 'trailer' or leaf not in (trailer.children[0], trailer.children[-1]): + if trailer.type == 'atom': + return trailer + return leaf + + power = trailer.parent + index = power.children.index(trailer) + + new_power = copy.copy(power) + new_power.children = list(new_power.children) + new_power.children[index + 1:] = [] + + if power.type == 'error_node': + start = index + while True: + start -= 1 + if power.children[start].type != 'trailer': + break + transformed = tree.Node('power', power.children[start:]) + transformed.parent = power.parent + return transformed + + return power + + +def get_names_of_node(node): + try: + children = node.children + except AttributeError: + if node.type == 'name': + return [node] + else: + return [] + else: + return list(chain.from_iterable(get_names_of_node(c) for c in children)) + + +def get_module_names(module, all_scopes): + """ + Returns a dictionary with name parts as keys and their call paths as + values. + """ + names = list(chain.from_iterable(module.get_used_names().values())) + if not all_scopes: + # We have to filter all the names that don't have the module as a + # parent_scope. There's None as a parent, because nodes in the module + # node have the parent module and not suite as all the others. + # Therefore it's important to catch that case. + + def is_module_scope_name(name): + parent_scope = get_parent_scope(name) + # async functions have an extra wrapper. Strip it. + if parent_scope and parent_scope.type == 'async_stmt': + parent_scope = parent_scope.parent + return parent_scope in (module, None) + + names = [n for n in names if is_module_scope_name(n)] + return names + + +@contextmanager +def predefine_names(context, flow_scope, dct): + predefined = context.predefined_names + predefined[flow_scope] = dct + try: + yield + finally: + del predefined[flow_scope] + + +def is_string(context): + if context.evaluator.environment.version_info.major == 2: + str_classes = (unicode, bytes) + else: + str_classes = (unicode,) + return context.is_compiled() and isinstance(context.get_safe_value(default=None), str_classes) + + +def is_literal(context): + return is_number(context) or is_string(context) + + +def _get_safe_value_or_none(context, accept): + value = context.get_safe_value(default=None) + if isinstance(value, accept): + return value + + +def get_int_or_none(context): + return _get_safe_value_or_none(context, int) + + +def get_str_or_none(context): + return _get_safe_value_or_none(context, (bytes, unicode)) + + +def is_number(context): + return _get_safe_value_or_none(context, (int, float)) is not None + + +class SimpleGetItemNotFound(Exception): + pass + + +@contextmanager +def reraise_getitem_errors(*exception_classes): + try: + yield + except exception_classes as e: + raise SimpleGetItemNotFound(e) + + +def parse_dotted_names(nodes, is_import_from, until_node=None): + level = 0 + names = [] + for node in nodes[1:]: + if node in ('.', '...'): + if not names: + level += len(node.value) + elif node.type == 'dotted_name': + for n in node.children[::2]: + names.append(n) + if n is until_node: + break + else: + continue + break + elif node.type == 'name': + names.append(node) + if node is until_node: + break + elif node == ',': + if not is_import_from: + names = [] + else: + # Here if the keyword `import` comes along it stops checking + # for names. + break + return level, names + + +def contexts_from_qualified_names(evaluator, *names): + return evaluator.import_module(names[:-1]).py__getattribute__(names[-1]) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/imports.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/imports.py new file mode 100644 index 0000000..f7ec8c3 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/imports.py @@ -0,0 +1,568 @@ +""" +:mod:`jedi.evaluate.imports` is here to resolve import statements and return +the modules/classes/functions/whatever, which they stand for. However there's +not any actual importing done. This module is about finding modules in the +filesystem. This can be quite tricky sometimes, because Python imports are not +always that simple. + +This module uses imp for python up to 3.2 and importlib for python 3.3 on; the +correct implementation is delegated to _compatibility. + +This module also supports import autocompletion, which means to complete +statements like ``from datetim`` (cursor at the end would return ``datetime``). +""" +import os + +from parso.python import tree +from parso.tree import search_ancestor +from parso import python_bytes_to_unicode + +from jedi._compatibility import (FileNotFoundError, ImplicitNSInfo, + force_unicode, unicode) +from jedi import debug +from jedi import settings +from jedi.file_io import KnownContentFileIO, FileIO +from jedi.parser_utils import get_cached_code_lines +from jedi.evaluate import sys_path +from jedi.evaluate import helpers +from jedi.evaluate import compiled +from jedi.evaluate import analysis +from jedi.evaluate.utils import unite +from jedi.evaluate.cache import evaluator_method_cache +from jedi.evaluate.names import ImportName, SubModuleName +from jedi.evaluate.base_context import ContextSet, NO_CONTEXTS +from jedi.evaluate.gradual.typeshed import import_module_decorator +from jedi.evaluate.context.module import iter_module_names +from jedi.plugins import plugin_manager + + +class ModuleCache(object): + def __init__(self): + self._path_cache = {} + self._name_cache = {} + + def add(self, string_names, context_set): + #path = module.py__file__() + #self._path_cache[path] = context_set + if string_names is not None: + self._name_cache[string_names] = context_set + + def get(self, string_names): + return self._name_cache[string_names] + + def get_from_path(self, path): + return self._path_cache[path] + + +# This memoization is needed, because otherwise we will infinitely loop on +# certain imports. +@evaluator_method_cache(default=NO_CONTEXTS) +def infer_import(context, tree_name, is_goto=False): + module_context = context.get_root_context() + import_node = search_ancestor(tree_name, 'import_name', 'import_from') + import_path = import_node.get_path_for_name(tree_name) + from_import_name = None + evaluator = context.evaluator + try: + from_names = import_node.get_from_names() + except AttributeError: + # Is an import_name + pass + else: + if len(from_names) + 1 == len(import_path): + # We have to fetch the from_names part first and then check + # if from_names exists in the modules. + from_import_name = import_path[-1] + import_path = from_names + + importer = Importer(evaluator, tuple(import_path), + module_context, import_node.level) + + types = importer.follow() + + #if import_node.is_nested() and not self.nested_resolve: + # scopes = [NestedImportModule(module, import_node)] + + if not types: + return NO_CONTEXTS + + if from_import_name is not None: + types = unite( + t.py__getattribute__( + from_import_name, + name_context=context, + is_goto=is_goto, + analysis_errors=False + ) + for t in types + ) + if not is_goto: + types = ContextSet(types) + + if not types: + path = import_path + [from_import_name] + importer = Importer(evaluator, tuple(path), + module_context, import_node.level) + types = importer.follow() + # goto only accepts `Name` + if is_goto: + types = set(s.name for s in types) + else: + # goto only accepts `Name` + if is_goto: + types = set(s.name for s in types) + + debug.dbg('after import: %s', types) + return types + + +class NestedImportModule(tree.Module): + """ + TODO while there's no use case for nested import module right now, we might + be able to use them for static analysis checks later on. + """ + def __init__(self, module, nested_import): + self._module = module + self._nested_import = nested_import + + def _get_nested_import_name(self): + """ + Generates an Import statement, that can be used to fake nested imports. + """ + i = self._nested_import + # This is not an existing Import statement. Therefore, set position to + # 0 (0 is not a valid line number). + zero = (0, 0) + names = [unicode(name) for name in i.namespace_names[1:]] + name = helpers.FakeName(names, self._nested_import) + new = tree.Import(i._sub_module, zero, zero, name) + new.parent = self._module + debug.dbg('Generated a nested import: %s', new) + return helpers.FakeName(str(i.namespace_names[1]), new) + + def __getattr__(self, name): + return getattr(self._module, name) + + def __repr__(self): + return "<%s: %s of %s>" % (self.__class__.__name__, self._module, + self._nested_import) + + +def _add_error(context, name, message): + if hasattr(name, 'parent') and context is not None: + analysis.add(context, 'import-error', name, message) + else: + debug.warning('ImportError without origin: ' + message) + + +def _level_to_base_import_path(project_path, directory, level): + """ + In case the level is outside of the currently known package (something like + import .....foo), we can still try our best to help the user for + completions. + """ + for i in range(level - 1): + old = directory + directory = os.path.dirname(directory) + if old == directory: + return None, None + + d = directory + level_import_paths = [] + # Now that we are on the level that the user wants to be, calculate the + # import path for it. + while True: + if d == project_path: + return level_import_paths, d + dir_name = os.path.basename(d) + if dir_name: + level_import_paths.insert(0, dir_name) + d = os.path.dirname(d) + else: + return None, directory + + +class Importer(object): + def __init__(self, evaluator, import_path, module_context, level=0): + """ + An implementation similar to ``__import__``. Use `follow` + to actually follow the imports. + + *level* specifies whether to use absolute or relative imports. 0 (the + default) means only perform absolute imports. Positive values for level + indicate the number of parent directories to search relative to the + directory of the module calling ``__import__()`` (see PEP 328 for the + details). + + :param import_path: List of namespaces (strings or Names). + """ + debug.speed('import %s %s' % (import_path, module_context)) + self._evaluator = evaluator + self.level = level + self.module_context = module_context + + self._fixed_sys_path = None + self._inference_possible = True + if level: + base = module_context.py__package__() + # We need to care for two cases, the first one is if it's a valid + # Python import. This import has a properly defined module name + # chain like `foo.bar.baz` and an import in baz is made for + # `..lala.` It can then resolve to `foo.bar.lala`. + # The else here is a heuristic for all other cases, if for example + # in `foo` you search for `...bar`, it's obviously out of scope. + # However since Jedi tries to just do it's best, we help the user + # here, because he might have specified something wrong in his + # project. + if level <= len(base): + # Here we basically rewrite the level to 0. + base = tuple(base) + if level > 1: + base = base[:-level + 1] + import_path = base + tuple(import_path) + else: + path = module_context.py__file__() + import_path = list(import_path) + if path is None: + # If no path is defined, our best guess is that the current + # file is edited by a user on the current working + # directory. We need to add an initial path, because it + # will get removed as the name of the current file. + directory = os.getcwd() + else: + directory = os.path.dirname(path) + + base_import_path, base_directory = _level_to_base_import_path( + self._evaluator.project._path, directory, level, + ) + if base_directory is None: + # Everything is lost, the relative import does point + # somewhere out of the filesystem. + self._inference_possible = False + else: + self._fixed_sys_path = [force_unicode(base_directory)] + + if base_import_path is None: + if import_path: + _add_error( + module_context, import_path[0], + message='Attempted relative import beyond top-level package.' + ) + else: + import_path = base_import_path + import_path + self.import_path = import_path + + @property + def _str_import_path(self): + """Returns the import path as pure strings instead of `Name`.""" + return tuple( + name.value if isinstance(name, tree.Name) else name + for name in self.import_path + ) + + def _sys_path_with_modifications(self): + if self._fixed_sys_path is not None: + return self._fixed_sys_path + + sys_path_mod = ( + self._evaluator.get_sys_path() + + sys_path.check_sys_path_modifications(self.module_context) + ) + + if self._evaluator.environment.version_info.major == 2: + file_path = self.module_context.py__file__() + if file_path is not None: + # Python2 uses an old strange way of importing relative imports. + sys_path_mod.append(force_unicode(os.path.dirname(file_path))) + + return sys_path_mod + + def follow(self): + if not self.import_path or not self._inference_possible: + return NO_CONTEXTS + + import_names = tuple( + force_unicode(i.value if isinstance(i, tree.Name) else i) + for i in self.import_path + ) + sys_path = self._sys_path_with_modifications() + + context_set = [None] + for i, name in enumerate(self.import_path): + context_set = ContextSet.from_sets([ + self._evaluator.import_module( + import_names[:i+1], + parent_module_context, + sys_path + ) for parent_module_context in context_set + ]) + if not context_set: + message = 'No module named ' + '.'.join(import_names) + _add_error(self.module_context, name, message) + return NO_CONTEXTS + return context_set + + def _get_module_names(self, search_path=None, in_module=None): + """ + Get the names of all modules in the search_path. This means file names + and not names defined in the files. + """ + names = [] + # add builtin module names + if search_path is None and in_module is None: + names += [ImportName(self.module_context, name) + for name in self._evaluator.compiled_subprocess.get_builtin_module_names()] + + if search_path is None: + search_path = self._sys_path_with_modifications() + + for name in iter_module_names(self._evaluator, search_path): + if in_module is None: + n = ImportName(self.module_context, name) + else: + n = SubModuleName(in_module, name) + names.append(n) + return names + + def completion_names(self, evaluator, only_modules=False): + """ + :param only_modules: Indicates wheter it's possible to import a + definition that is not defined in a module. + """ + if not self._inference_possible: + return [] + + names = [] + if self.import_path: + # flask + if self._str_import_path == ('flask', 'ext'): + # List Flask extensions like ``flask_foo`` + for mod in self._get_module_names(): + modname = mod.string_name + if modname.startswith('flask_'): + extname = modname[len('flask_'):] + names.append(ImportName(self.module_context, extname)) + # Now the old style: ``flaskext.foo`` + for dir in self._sys_path_with_modifications(): + flaskext = os.path.join(dir, 'flaskext') + if os.path.isdir(flaskext): + names += self._get_module_names([flaskext]) + + contexts = self.follow() + for context in contexts: + # Non-modules are not completable. + if context.api_type != 'module': # not a module + continue + names += context.sub_modules_dict().values() + + if not only_modules: + from jedi.evaluate.gradual.conversion import convert_contexts + + both_contexts = contexts | convert_contexts(contexts) + for c in both_contexts: + for filter in c.get_filters(search_global=False): + names += filter.values() + else: + if self.level: + # We only get here if the level cannot be properly calculated. + names += self._get_module_names(self._fixed_sys_path) + else: + # This is just the list of global imports. + names += self._get_module_names() + return names + + +@plugin_manager.decorate() +@import_module_decorator +def import_module(evaluator, import_names, parent_module_context, sys_path): + """ + This method is very similar to importlib's `_gcd_import`. + """ + if import_names[0] in settings.auto_import_modules: + module = _load_builtin_module(evaluator, import_names, sys_path) + if module is None: + return NO_CONTEXTS + return ContextSet([module]) + + module_name = '.'.join(import_names) + if parent_module_context is None: + # Override the sys.path. It works only good that way. + # Injecting the path directly into `find_module` did not work. + file_io_or_ns, is_pkg = evaluator.compiled_subprocess.get_module_info( + string=import_names[-1], + full_name=module_name, + sys_path=sys_path, + is_global_search=True, + ) + if is_pkg is None: + return NO_CONTEXTS + else: + try: + method = parent_module_context.py__path__ + except AttributeError: + # The module is not a package. + return NO_CONTEXTS + else: + paths = method() + for path in paths: + # At the moment we are only using one path. So this is + # not important to be correct. + if not isinstance(path, list): + path = [path] + file_io_or_ns, is_pkg = evaluator.compiled_subprocess.get_module_info( + string=import_names[-1], + path=path, + full_name=module_name, + is_global_search=False, + ) + if is_pkg is not None: + break + else: + return NO_CONTEXTS + + if isinstance(file_io_or_ns, ImplicitNSInfo): + from jedi.evaluate.context.namespace import ImplicitNamespaceContext + module = ImplicitNamespaceContext( + evaluator, + fullname=file_io_or_ns.name, + paths=file_io_or_ns.paths, + ) + elif file_io_or_ns is None: + module = _load_builtin_module(evaluator, import_names, sys_path) + if module is None: + return NO_CONTEXTS + else: + module = _load_python_module( + evaluator, file_io_or_ns, sys_path, + import_names=import_names, + is_package=is_pkg, + ) + + if parent_module_context is None: + debug.dbg('global search_module %s: %s', import_names[-1], module) + else: + debug.dbg('search_module %s in paths %s: %s', module_name, paths, module) + return ContextSet([module]) + + +def _load_python_module(evaluator, file_io, sys_path=None, + import_names=None, is_package=False): + try: + return evaluator.module_cache.get_from_path(file_io.path) + except KeyError: + pass + + module_node = evaluator.parse( + file_io=file_io, + cache=True, + diff_cache=settings.fast_parser, + cache_path=settings.cache_directory + ) + + from jedi.evaluate.context import ModuleContext + return ModuleContext( + evaluator, module_node, + file_io=file_io, + string_names=import_names, + code_lines=get_cached_code_lines(evaluator.grammar, file_io.path), + is_package=is_package, + ) + + +def _load_builtin_module(evaluator, import_names=None, sys_path=None): + if sys_path is None: + sys_path = evaluator.get_sys_path() + + dotted_name = '.'.join(import_names) + assert dotted_name is not None + module = compiled.load_module(evaluator, dotted_name=dotted_name, sys_path=sys_path) + if module is None: + # The file might raise an ImportError e.g. and therefore not be + # importable. + return None + return module + + +def _load_module_from_path(evaluator, file_io, base_names): + """ + This should pretty much only be used for get_modules_containing_name. It's + here to ensure that a random path is still properly loaded into the Jedi + module structure. + """ + e_sys_path = evaluator.get_sys_path() + path = file_io.path + if base_names: + module_name = os.path.basename(path) + module_name = sys_path.remove_python_path_suffix(module_name) + is_package = module_name == '__init__' + if is_package: + import_names = base_names + else: + import_names = base_names + (module_name,) + else: + import_names, is_package = sys_path.transform_path_to_dotted(e_sys_path, path) + + module = _load_python_module( + evaluator, file_io, + sys_path=e_sys_path, + import_names=import_names, + is_package=is_package, + ) + evaluator.module_cache.add(import_names, ContextSet([module])) + return module + + +def get_modules_containing_name(evaluator, modules, name): + """ + Search a name in the directories of modules. + """ + def check_directory(folder_io): + for file_name in folder_io.list(): + if file_name.endswith('.py'): + yield folder_io.get_file_io(file_name) + + def check_fs(file_io, base_names): + try: + code = file_io.read() + except FileNotFoundError: + return None + code = python_bytes_to_unicode(code, errors='replace') + if name not in code: + return None + new_file_io = KnownContentFileIO(file_io.path, code) + m = _load_module_from_path(evaluator, new_file_io, base_names) + if isinstance(m, compiled.CompiledObject): + return None + return m + + # skip non python modules + used_mod_paths = set() + folders_with_names_to_be_checked = [] + for m in modules: + if m.file_io is not None: + path = m.file_io.path + if path not in used_mod_paths: + used_mod_paths.add(path) + folders_with_names_to_be_checked.append(( + m.file_io.get_parent_folder(), + m.py__package__() + )) + yield m + + if not settings.dynamic_params_for_other_modules: + return + + def get_file_ios_to_check(): + for folder_io, base_names in folders_with_names_to_be_checked: + for file_io in check_directory(folder_io): + yield file_io, base_names + + for p in settings.additional_dynamic_modules: + p = os.path.abspath(p) + if p not in used_mod_paths: + yield FileIO(p), None + + for file_io, base_names in get_file_ios_to_check(): + m = check_fs(file_io, base_names) + if m is not None: + yield m diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/lazy_context.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/lazy_context.py new file mode 100644 index 0000000..0501d3b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/lazy_context.py @@ -0,0 +1,59 @@ +from jedi.evaluate.base_context import ContextSet, NO_CONTEXTS +from jedi.common.utils import monkeypatch + + +class AbstractLazyContext(object): + def __init__(self, data): + self.data = data + + def __repr__(self): + return '<%s: %s>' % (self.__class__.__name__, self.data) + + def infer(self): + raise NotImplementedError + + +class LazyKnownContext(AbstractLazyContext): + """data is a context.""" + def infer(self): + return ContextSet([self.data]) + + +class LazyKnownContexts(AbstractLazyContext): + """data is a ContextSet.""" + def infer(self): + return self.data + + +class LazyUnknownContext(AbstractLazyContext): + def __init__(self): + super(LazyUnknownContext, self).__init__(None) + + def infer(self): + return NO_CONTEXTS + + +class LazyTreeContext(AbstractLazyContext): + def __init__(self, context, node): + super(LazyTreeContext, self).__init__(node) + self.context = context + # We need to save the predefined names. It's an unfortunate side effect + # that needs to be tracked otherwise results will be wrong. + self._predefined_names = dict(context.predefined_names) + + def infer(self): + with monkeypatch(self.context, 'predefined_names', self._predefined_names): + return self.context.eval_node(self.data) + + +def get_merged_lazy_context(lazy_contexts): + if len(lazy_contexts) > 1: + return MergedLazyContexts(lazy_contexts) + else: + return lazy_contexts[0] + + +class MergedLazyContexts(AbstractLazyContext): + """data is a list of lazy contexts.""" + def infer(self): + return ContextSet.from_sets(l.infer() for l in self.data) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/names.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/names.py new file mode 100644 index 0000000..b1c2d40 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/names.py @@ -0,0 +1,375 @@ +from abc import abstractmethod + +from parso.tree import search_ancestor + +from jedi._compatibility import Parameter +from jedi.evaluate.base_context import ContextSet, NO_CONTEXTS +from jedi.cache import memoize_method + + +class AbstractNameDefinition(object): + start_pos = None + string_name = None + parent_context = None + tree_name = None + is_context_name = True + """ + Used for the Jedi API to know if it's a keyword or an actual name. + """ + + @abstractmethod + def infer(self): + raise NotImplementedError + + @abstractmethod + def goto(self): + # Typically names are already definitions and therefore a goto on that + # name will always result on itself. + return {self} + + def get_qualified_names(self, include_module_names=False): + qualified_names = self._get_qualified_names() + if qualified_names is None or not include_module_names: + return qualified_names + + module_names = self.get_root_context().string_names + if module_names is None: + return None + return module_names + qualified_names + + def _get_qualified_names(self): + # By default, a name has no qualified names. + return None + + def get_root_context(self): + return self.parent_context.get_root_context() + + def __repr__(self): + if self.start_pos is None: + return '<%s: string_name=%s>' % (self.__class__.__name__, self.string_name) + return '<%s: string_name=%s start_pos=%s>' % (self.__class__.__name__, + self.string_name, self.start_pos) + + def is_import(self): + return False + + @property + def api_type(self): + return self.parent_context.api_type + + +class AbstractArbitraryName(AbstractNameDefinition): + """ + When you e.g. want to complete dicts keys, you probably want to complete + string literals, which is not really a name, but for Jedi we use this + concept of Name for completions as well. + """ + is_context_name = False + + def __init__(self, evaluator, string): + self.evaluator = evaluator + self.string_name = string + self.parent_context = evaluator.builtins_module + + def infer(self): + return NO_CONTEXTS + + +class AbstractTreeName(AbstractNameDefinition): + def __init__(self, parent_context, tree_name): + self.parent_context = parent_context + self.tree_name = tree_name + + def get_qualified_names(self, include_module_names=False): + import_node = search_ancestor(self.tree_name, 'import_name', 'import_from') + # For import nodes we cannot just have names, because it's very unclear + # how they would look like. For now we just ignore them in most cases. + # In case of level == 1, it works always, because it's like a submodule + # lookup. + if import_node is not None and not (import_node.level == 1 + and self.get_root_context().is_package): + # TODO improve the situation for when level is present. + if include_module_names and not import_node.level: + return tuple(n.value for n in import_node.get_path_for_name(self.tree_name)) + else: + return None + + return super(AbstractTreeName, self).get_qualified_names(include_module_names) + + def _get_qualified_names(self): + parent_names = self.parent_context.get_qualified_names() + if parent_names is None: + return None + return parent_names + (self.tree_name.value,) + + def goto(self, **kwargs): + return self.parent_context.evaluator.goto(self.parent_context, self.tree_name, **kwargs) + + def is_import(self): + imp = search_ancestor(self.tree_name, 'import_from', 'import_name') + return imp is not None + + @property + def string_name(self): + return self.tree_name.value + + @property + def start_pos(self): + return self.tree_name.start_pos + + +class ContextNameMixin(object): + def infer(self): + return ContextSet([self._context]) + + def _get_qualified_names(self): + return self._context.get_qualified_names() + + def get_root_context(self): + if self.parent_context is None: # A module + return self._context + return super(ContextNameMixin, self).get_root_context() + + @property + def api_type(self): + return self._context.api_type + + +class ContextName(ContextNameMixin, AbstractTreeName): + def __init__(self, context, tree_name): + super(ContextName, self).__init__(context.parent_context, tree_name) + self._context = context + + def goto(self): + return ContextSet([self._context.name]) + + +class TreeNameDefinition(AbstractTreeName): + _API_TYPES = dict( + import_name='module', + import_from='module', + funcdef='function', + param='param', + classdef='class', + ) + + def infer(self): + # Refactor this, should probably be here. + from jedi.evaluate.syntax_tree import tree_name_to_contexts + parent = self.parent_context + return tree_name_to_contexts(parent.evaluator, parent, self.tree_name) + + @property + def api_type(self): + definition = self.tree_name.get_definition(import_name_always=True) + if definition is None: + return 'statement' + return self._API_TYPES.get(definition.type, 'statement') + + +class _ParamMixin(object): + def maybe_positional_argument(self, include_star=True): + options = [Parameter.POSITIONAL_ONLY, Parameter.POSITIONAL_OR_KEYWORD] + if include_star: + options.append(Parameter.VAR_POSITIONAL) + return self.get_kind() in options + + def maybe_keyword_argument(self, include_stars=True): + options = [Parameter.KEYWORD_ONLY, Parameter.POSITIONAL_OR_KEYWORD] + if include_stars: + options.append(Parameter.VAR_KEYWORD) + return self.get_kind() in options + + def _kind_string(self): + kind = self.get_kind() + if kind == Parameter.VAR_POSITIONAL: # *args + return '*' + if kind == Parameter.VAR_KEYWORD: # **kwargs + return '**' + return '' + + +class ParamNameInterface(_ParamMixin): + api_type = u'param' + + def get_kind(self): + raise NotImplementedError + + def to_string(self): + raise NotImplementedError + + def get_param(self): + # TODO document better where this is used and when. Currently it has + # very limited use, but is still in use. It's currently not even + # clear what values would be allowed. + return None + + @property + def star_count(self): + kind = self.get_kind() + if kind == Parameter.VAR_POSITIONAL: + return 1 + if kind == Parameter.VAR_KEYWORD: + return 2 + return 0 + + +class BaseTreeParamName(ParamNameInterface, AbstractTreeName): + annotation_node = None + default_node = None + + def to_string(self): + output = self._kind_string() + self.string_name + annotation = self.annotation_node + default = self.default_node + if annotation is not None: + output += ': ' + annotation.get_code(include_prefix=False) + if default is not None: + output += '=' + default.get_code(include_prefix=False) + return output + + +class ParamName(BaseTreeParamName): + def _get_param_node(self): + return search_ancestor(self.tree_name, 'param') + + @property + def annotation_node(self): + return self._get_param_node().annotation + + def infer_annotation(self, execute_annotation=True): + node = self.annotation_node + if node is None: + return NO_CONTEXTS + contexts = self.parent_context.parent_context.eval_node(node) + if execute_annotation: + contexts = contexts.execute_annotation() + return contexts + + def infer_default(self): + node = self.default_node + if node is None: + return NO_CONTEXTS + return self.parent_context.parent_context.eval_node(node) + + @property + def default_node(self): + return self._get_param_node().default + + @property + def string_name(self): + name = self.tree_name.value + if name.startswith('__'): + # Params starting with __ are an equivalent to positional only + # variables in typeshed. + name = name[2:] + return name + + def get_kind(self): + tree_param = self._get_param_node() + if tree_param.star_count == 1: # *args + return Parameter.VAR_POSITIONAL + if tree_param.star_count == 2: # **kwargs + return Parameter.VAR_KEYWORD + + # Params starting with __ are an equivalent to positional only + # variables in typeshed. + if tree_param.name.value.startswith('__'): + return Parameter.POSITIONAL_ONLY + + parent = tree_param.parent + param_appeared = False + for p in parent.children: + if param_appeared: + if p == '/': + return Parameter.POSITIONAL_ONLY + else: + if p == '*': + return Parameter.KEYWORD_ONLY + if p.type == 'param': + if p.star_count: + return Parameter.KEYWORD_ONLY + if p == tree_param: + param_appeared = True + return Parameter.POSITIONAL_OR_KEYWORD + + def infer(self): + return self.get_param().infer() + + def get_param(self): + params, _ = self.parent_context.get_executed_params_and_issues() + param_node = search_ancestor(self.tree_name, 'param') + return params[param_node.position_index] + + +class ParamNameWrapper(_ParamMixin): + def __init__(self, param_name): + self._wrapped_param_name = param_name + + def __getattr__(self, name): + return getattr(self._wrapped_param_name, name) + + def __repr__(self): + return '<%s: %s>' % (self.__class__.__name__, self._wrapped_param_name) + + +class ImportName(AbstractNameDefinition): + start_pos = (1, 0) + _level = 0 + + def __init__(self, parent_context, string_name): + self._from_module_context = parent_context + self.string_name = string_name + + def get_qualified_names(self, include_module_names=False): + if include_module_names: + if self._level: + assert self._level == 1, "Everything else is not supported for now" + module_names = self._from_module_context.string_names + if module_names is None: + return module_names + return module_names + (self.string_name,) + return (self.string_name,) + return () + + @property + def parent_context(self): + m = self._from_module_context + import_contexts = self.infer() + if not import_contexts: + return m + # It's almost always possible to find the import or to not find it. The + # importing returns only one context, pretty much always. + return next(iter(import_contexts)) + + @memoize_method + def infer(self): + from jedi.evaluate.imports import Importer + m = self._from_module_context + return Importer(m.evaluator, [self.string_name], m, level=self._level).follow() + + def goto(self): + return [m.name for m in self.infer()] + + @property + def api_type(self): + return 'module' + + +class SubModuleName(ImportName): + _level = 1 + + +class NameWrapper(object): + def __init__(self, wrapped_name): + self._wrapped_name = wrapped_name + + @abstractmethod + def infer(self): + raise NotImplementedError + + def __getattr__(self, name): + return getattr(self._wrapped_name, name) + + def __repr__(self): + return '%s(%s)' % (self.__class__.__name__, self._wrapped_name) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/param.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/param.py new file mode 100644 index 0000000..ffec77e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/param.py @@ -0,0 +1,253 @@ +from collections import defaultdict + +from jedi import debug +from jedi.evaluate.utils import PushBackIterator +from jedi.evaluate import analysis +from jedi.evaluate.lazy_context import LazyKnownContext, \ + LazyTreeContext, LazyUnknownContext +from jedi.evaluate import docstrings +from jedi.evaluate.context import iterable + + +def _add_argument_issue(error_name, lazy_context, message): + if isinstance(lazy_context, LazyTreeContext): + node = lazy_context.data + if node.parent.type == 'argument': + node = node.parent + return analysis.add(lazy_context.context, error_name, node, message) + + +class ExecutedParam(object): + """Fake a param and give it values.""" + def __init__(self, execution_context, param_node, lazy_context, is_default=False): + self._execution_context = execution_context + self._param_node = param_node + self._lazy_context = lazy_context + self.string_name = param_node.name.value + self._is_default = is_default + + def infer_annotations(self): + from jedi.evaluate.gradual.annotation import infer_param + return infer_param(self._execution_context, self._param_node) + + def infer(self, use_hints=True): + if use_hints: + doc_params = docstrings.infer_param(self._execution_context, self._param_node) + ann = self.infer_annotations().execute_annotation() + if ann or doc_params: + return ann | doc_params + + return self._lazy_context.infer() + + def matches_signature(self): + if self._is_default: + return True + argument_contexts = self.infer(use_hints=False).py__class__() + if self._param_node.star_count: + return True + annotations = self.infer_annotations() + if not annotations: + # If we cannot infer annotations - or there aren't any - pretend + # that the signature matches. + return True + matches = any(c1.is_sub_class_of(c2) + for c1 in argument_contexts + for c2 in annotations.gather_annotation_classes()) + debug.dbg("signature compare %s: %s <=> %s", + matches, argument_contexts, annotations, color='BLUE') + return matches + + @property + def var_args(self): + return self._execution_context.var_args + + def __repr__(self): + return '<%s: %s>' % (self.__class__.__name__, self.string_name) + + +def get_executed_params_and_issues(execution_context, arguments): + def too_many_args(argument): + m = _error_argument_count(funcdef, len(unpacked_va)) + # Just report an error for the first param that is not needed (like + # cPython). + if arguments.get_calling_nodes(): + # There might not be a valid calling node so check for that first. + issues.append( + _add_argument_issue( + 'type-error-too-many-arguments', + argument, + message=m + ) + ) + else: + issues.append(None) + + issues = [] # List[Optional[analysis issue]] + result_params = [] + param_dict = {} + funcdef = execution_context.tree_node + # Default params are part of the context where the function was defined. + # This means that they might have access on class variables that the + # function itself doesn't have. + default_param_context = execution_context.function_context.get_default_param_context() + + for param in funcdef.get_params(): + param_dict[param.name.value] = param + unpacked_va = list(arguments.unpack(funcdef)) + var_arg_iterator = PushBackIterator(iter(unpacked_va)) + + non_matching_keys = defaultdict(lambda: []) + keys_used = {} + keys_only = False + had_multiple_value_error = False + for param in funcdef.get_params(): + # The value and key can both be null. There, the defaults apply. + # args / kwargs will just be empty arrays / dicts, respectively. + # Wrong value count is just ignored. If you try to test cases that are + # not allowed in Python, Jedi will maybe not show any completions. + is_default = False + key, argument = next(var_arg_iterator, (None, None)) + while key is not None: + keys_only = True + try: + key_param = param_dict[key] + except KeyError: + non_matching_keys[key] = argument + else: + if key in keys_used: + had_multiple_value_error = True + m = ("TypeError: %s() got multiple values for keyword argument '%s'." + % (funcdef.name, key)) + for contextualized_node in arguments.get_calling_nodes(): + issues.append( + analysis.add(contextualized_node.context, + 'type-error-multiple-values', + contextualized_node.node, message=m) + ) + else: + keys_used[key] = ExecutedParam(execution_context, key_param, argument) + key, argument = next(var_arg_iterator, (None, None)) + + try: + result_params.append(keys_used[param.name.value]) + continue + except KeyError: + pass + + if param.star_count == 1: + # *args param + lazy_context_list = [] + if argument is not None: + lazy_context_list.append(argument) + for key, argument in var_arg_iterator: + # Iterate until a key argument is found. + if key: + var_arg_iterator.push_back((key, argument)) + break + lazy_context_list.append(argument) + seq = iterable.FakeSequence(execution_context.evaluator, u'tuple', lazy_context_list) + result_arg = LazyKnownContext(seq) + elif param.star_count == 2: + if argument is not None: + too_many_args(argument) + # **kwargs param + dct = iterable.FakeDict(execution_context.evaluator, dict(non_matching_keys)) + result_arg = LazyKnownContext(dct) + non_matching_keys = {} + else: + # normal param + if argument is None: + # No value: Return an empty container + if param.default is None: + result_arg = LazyUnknownContext() + if not keys_only: + for contextualized_node in arguments.get_calling_nodes(): + m = _error_argument_count(funcdef, len(unpacked_va)) + issues.append( + analysis.add( + contextualized_node.context, + 'type-error-too-few-arguments', + contextualized_node.node, + message=m, + ) + ) + else: + result_arg = LazyTreeContext(default_param_context, param.default) + is_default = True + else: + result_arg = argument + + result_params.append(ExecutedParam( + execution_context, param, result_arg, + is_default=is_default + )) + if not isinstance(result_arg, LazyUnknownContext): + keys_used[param.name.value] = result_params[-1] + + if keys_only: + # All arguments should be handed over to the next function. It's not + # about the values inside, it's about the names. Jedi needs to now that + # there's nothing to find for certain names. + for k in set(param_dict) - set(keys_used): + param = param_dict[k] + + if not (non_matching_keys or had_multiple_value_error or + param.star_count or param.default): + # add a warning only if there's not another one. + for contextualized_node in arguments.get_calling_nodes(): + m = _error_argument_count(funcdef, len(unpacked_va)) + issues.append( + analysis.add(contextualized_node.context, + 'type-error-too-few-arguments', + contextualized_node.node, message=m) + ) + + for key, lazy_context in non_matching_keys.items(): + m = "TypeError: %s() got an unexpected keyword argument '%s'." \ + % (funcdef.name, key) + issues.append( + _add_argument_issue( + 'type-error-keyword-argument', + lazy_context, + message=m + ) + ) + + remaining_arguments = list(var_arg_iterator) + if remaining_arguments: + first_key, lazy_context = remaining_arguments[0] + too_many_args(lazy_context) + return result_params, issues + + +def _error_argument_count(funcdef, actual_count): + params = funcdef.get_params() + default_arguments = sum(1 for p in params if p.default or p.star_count) + + if default_arguments == 0: + before = 'exactly ' + else: + before = 'from %s to ' % (len(params) - default_arguments) + return ('TypeError: %s() takes %s%s arguments (%s given).' + % (funcdef.name, before, len(params), actual_count)) + + +def _create_default_param(execution_context, param): + if param.star_count == 1: + result_arg = LazyKnownContext( + iterable.FakeSequence(execution_context.evaluator, u'tuple', []) + ) + elif param.star_count == 2: + result_arg = LazyKnownContext( + iterable.FakeDict(execution_context.evaluator, {}) + ) + elif param.default is None: + result_arg = LazyUnknownContext() + else: + result_arg = LazyTreeContext(execution_context.parent_context, param.default) + return ExecutedParam(execution_context, param, result_arg) + + +def create_default_params(execution_context, funcdef): + return [_create_default_param(execution_context, p) + for p in funcdef.get_params()] diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/parser_cache.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/parser_cache.py new file mode 100644 index 0000000..84fe52d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/parser_cache.py @@ -0,0 +1,6 @@ +from jedi.evaluate.cache import evaluator_function_cache + + +@evaluator_function_cache() +def get_yield_exprs(evaluator, funcdef): + return list(funcdef.iter_yield_exprs()) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/recursion.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/recursion.py new file mode 100644 index 0000000..f86deda --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/recursion.py @@ -0,0 +1,153 @@ +""" +Recursions are the recipe of |jedi| to conquer Python code. However, someone +must stop recursions going mad. Some settings are here to make |jedi| stop at +the right time. You can read more about them :ref:`here `. + +Next to :mod:`jedi.evaluate.cache` this module also makes |jedi| not +thread-safe. Why? ``execution_recursion_decorator`` uses class variables to +count the function calls. + +.. _settings-recursion: + +Settings +~~~~~~~~~~ + +Recursion settings are important if you don't want extremly +recursive python code to go absolutely crazy. + +The default values are based on experiments while completing the |jedi| library +itself (inception!). But I don't think there's any other Python library that +uses recursion in a similarly extreme way. Completion should also be fast and +therefore the quality might not always be maximal. + +.. autodata:: recursion_limit +.. autodata:: total_function_execution_limit +.. autodata:: per_function_execution_limit +.. autodata:: per_function_recursion_limit +""" + +from contextlib import contextmanager + +from jedi import debug +from jedi.evaluate.base_context import NO_CONTEXTS + + +recursion_limit = 15 +""" +Like ``sys.getrecursionlimit()``, just for |jedi|. +""" +total_function_execution_limit = 200 +""" +This is a hard limit of how many non-builtin functions can be executed. +""" +per_function_execution_limit = 6 +""" +The maximal amount of times a specific function may be executed. +""" +per_function_recursion_limit = 2 +""" +A function may not be executed more than this number of times recursively. +""" + + +class RecursionDetector(object): + def __init__(self): + self.pushed_nodes = [] + + +@contextmanager +def execution_allowed(evaluator, node): + """ + A decorator to detect recursions in statements. In a recursion a statement + at the same place, in the same module may not be executed two times. + """ + pushed_nodes = evaluator.recursion_detector.pushed_nodes + + if node in pushed_nodes: + debug.warning('catched stmt recursion: %s @%s', node, + getattr(node, 'start_pos', None)) + yield False + else: + try: + pushed_nodes.append(node) + yield True + finally: + pushed_nodes.pop() + + +def execution_recursion_decorator(default=NO_CONTEXTS): + def decorator(func): + def wrapper(self, **kwargs): + detector = self.evaluator.execution_recursion_detector + limit_reached = detector.push_execution(self) + try: + if limit_reached: + result = default + else: + result = func(self, **kwargs) + finally: + detector.pop_execution() + return result + return wrapper + return decorator + + +class ExecutionRecursionDetector(object): + """ + Catches recursions of executions. + """ + def __init__(self, evaluator): + self._evaluator = evaluator + + self._recursion_level = 0 + self._parent_execution_funcs = [] + self._funcdef_execution_counts = {} + self._execution_count = 0 + + def pop_execution(self): + self._parent_execution_funcs.pop() + self._recursion_level -= 1 + + def push_execution(self, execution): + funcdef = execution.tree_node + + # These two will be undone in pop_execution. + self._recursion_level += 1 + self._parent_execution_funcs.append(funcdef) + + module = execution.get_root_context() + + if module == self._evaluator.builtins_module: + # We have control over builtins so we know they are not recursing + # like crazy. Therefore we just let them execute always, because + # they usually just help a lot with getting good results. + return False + + if self._recursion_level > recursion_limit: + debug.warning('Recursion limit (%s) reached', recursion_limit) + return True + + if self._execution_count >= total_function_execution_limit: + debug.warning('Function execution limit (%s) reached', total_function_execution_limit) + return True + self._execution_count += 1 + + if self._funcdef_execution_counts.setdefault(funcdef, 0) >= per_function_execution_limit: + if module.py__name__() in ('builtins', 'typing'): + return False + debug.warning( + 'Per function execution limit (%s) reached: %s', + per_function_execution_limit, + funcdef + ) + return True + self._funcdef_execution_counts[funcdef] += 1 + + if self._parent_execution_funcs.count(funcdef) > per_function_recursion_limit: + debug.warning( + 'Per function recursion limit (%s) reached: %s', + per_function_recursion_limit, + funcdef + ) + return True + return False diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/signature.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/signature.py new file mode 100644 index 0000000..43d3d5d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/signature.py @@ -0,0 +1,116 @@ +from jedi._compatibility import Parameter +from jedi.cache import memoize_method + + +class _SignatureMixin(object): + def to_string(self): + def param_strings(): + is_positional = False + is_kw_only = False + for n in self.get_param_names(resolve_stars=True): + kind = n.get_kind() + is_positional |= kind == Parameter.POSITIONAL_ONLY + if is_positional and kind != Parameter.POSITIONAL_ONLY: + yield '/' + is_positional = False + + if kind == Parameter.VAR_POSITIONAL: + is_kw_only = True + elif kind == Parameter.KEYWORD_ONLY and not is_kw_only: + yield '*' + is_kw_only = True + + yield n.to_string() + + if is_positional: + yield '/' + + s = self.name.string_name + '(' + ', '.join(param_strings()) + ')' + annotation = self.annotation_string + if annotation: + s += ' -> ' + annotation + return s + + +class AbstractSignature(_SignatureMixin): + def __init__(self, context, is_bound=False): + self.context = context + self.is_bound = is_bound + + @property + def name(self): + return self.context.name + + @property + def annotation_string(self): + return '' + + def get_param_names(self, resolve_stars=False): + param_names = self._function_context.get_param_names() + if self.is_bound: + return param_names[1:] + return param_names + + def bind(self, context): + raise NotImplementedError + + def __repr__(self): + return '<%s: %s, %s>' % (self.__class__.__name__, self.context, self._function_context) + + +class TreeSignature(AbstractSignature): + def __init__(self, context, function_context=None, is_bound=False): + super(TreeSignature, self).__init__(context, is_bound) + self._function_context = function_context or context + + def bind(self, context): + return TreeSignature(context, self._function_context, is_bound=True) + + @property + def _annotation(self): + # Classes don't need annotations, even if __init__ has one. They always + # return themselves. + if self.context.is_class(): + return None + return self._function_context.tree_node.annotation + + @property + def annotation_string(self): + a = self._annotation + if a is None: + return '' + return a.get_code(include_prefix=False) + + @memoize_method + def get_param_names(self, resolve_stars=False): + params = super(TreeSignature, self).get_param_names(resolve_stars=False) + if resolve_stars: + from jedi.evaluate.star_args import process_params + params = process_params(params) + return params + + +class BuiltinSignature(AbstractSignature): + def __init__(self, context, return_string, is_bound=False): + super(BuiltinSignature, self).__init__(context, is_bound) + self._return_string = return_string + + @property + def annotation_string(self): + return self._return_string + + @property + def _function_context(self): + return self.context + + def bind(self, context): + assert not self.is_bound + return BuiltinSignature(context, self._return_string, is_bound=True) + + +class SignatureWrapper(_SignatureMixin): + def __init__(self, wrapped_signature): + self._wrapped_signature = wrapped_signature + + def __getattr__(self, name): + return getattr(self._wrapped_signature, name) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/star_args.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/star_args.py new file mode 100644 index 0000000..2008a85 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/star_args.py @@ -0,0 +1,206 @@ +""" +This module is responsible for evaluating *args and **kwargs for signatures. + +This means for example in this case:: + + def foo(a, b, c): ... + + def bar(*args): + return foo(1, *args) + +The signature here for bar should be `bar(b, c)` instead of bar(*args). +""" + +from jedi._compatibility import Parameter +from jedi.evaluate.utils import to_list +from jedi.evaluate.names import ParamNameWrapper + + +def _iter_nodes_for_param(param_name): + from parso.python.tree import search_ancestor + from jedi.evaluate.arguments import TreeArguments + + execution_context = param_name.parent_context + function_node = execution_context.tree_node + module_node = function_node.get_root_node() + start = function_node.children[-1].start_pos + end = function_node.children[-1].end_pos + for name in module_node.get_used_names().get(param_name.string_name): + if start <= name.start_pos < end: + # Is used in the function + argument = name.parent + if argument.type == 'argument' \ + and argument.children[0] == '*' * param_name.star_count: + # No support for Python <= 3.4 here, but they are end-of-life + # anyway + trailer = search_ancestor(argument, 'trailer') + if trailer is not None: # Make sure we're in a function + context = execution_context.create_context(trailer) + if _goes_to_param_name(param_name, context, name): + contexts = _to_callables(context, trailer) + + args = TreeArguments.create_cached( + execution_context.evaluator, + context=context, + argument_node=trailer.children[1], + trailer=trailer, + ) + for c in contexts: + yield c, args + else: + assert False + + +def _goes_to_param_name(param_name, context, potential_name): + if potential_name.type != 'name': + return False + from jedi.evaluate.names import TreeNameDefinition + found = TreeNameDefinition(context, potential_name).goto() + return any(param_name.parent_context == p.parent_context + and param_name.start_pos == p.start_pos + for p in found) + + +def _to_callables(context, trailer): + from jedi.evaluate.syntax_tree import eval_trailer + + atom_expr = trailer.parent + index = atom_expr.children[0] == 'await' + # Eval atom first + contexts = context.eval_node(atom_expr.children[index]) + for trailer2 in atom_expr.children[index + 1:]: + if trailer == trailer2: + break + contexts = eval_trailer(context, contexts, trailer2) + return contexts + + +def _remove_given_params(arguments, param_names): + count = 0 + used_keys = set() + for key, _ in arguments.unpack(): + if key is None: + count += 1 + else: + used_keys.add(key) + + for p in param_names: + if count and p.maybe_positional_argument(): + count -= 1 + continue + if p.string_name in used_keys and p.maybe_keyword_argument(): + continue + yield p + + +@to_list +def process_params(param_names, star_count=3): # default means both * and ** + used_names = set() + arg_callables = [] + kwarg_callables = [] + + kw_only_names = [] + kwarg_names = [] + arg_names = [] + original_arg_name = None + original_kwarg_name = None + for p in param_names: + kind = p.get_kind() + if kind == Parameter.VAR_POSITIONAL: + if star_count & 1: + arg_callables = _iter_nodes_for_param(p) + original_arg_name = p + elif p.get_kind() == Parameter.VAR_KEYWORD: + if star_count & 2: + kwarg_callables = list(_iter_nodes_for_param(p)) + original_kwarg_name = p + elif kind == Parameter.KEYWORD_ONLY: + if star_count & 2: + kw_only_names.append(p) + elif kind == Parameter.POSITIONAL_ONLY: + if star_count & 1: + yield p + else: + if star_count == 1: + yield ParamNameFixedKind(p, Parameter.POSITIONAL_ONLY) + elif star_count == 2: + kw_only_names.append(ParamNameFixedKind(p, Parameter.KEYWORD_ONLY)) + else: + used_names.add(p.string_name) + yield p + + longest_param_names = () + found_arg_signature = False + found_kwarg_signature = False + for func_and_argument in arg_callables: + func, arguments = func_and_argument + new_star_count = star_count + if func_and_argument in kwarg_callables: + kwarg_callables.remove(func_and_argument) + else: + new_star_count = 1 + + for signature in func.get_signatures(): + found_arg_signature = True + if new_star_count == 3: + found_kwarg_signature = True + args_for_this_func = [] + for p in process_params( + list(_remove_given_params( + arguments, + signature.get_param_names(resolve_stars=False) + )), new_star_count): + if p.get_kind() == Parameter.VAR_KEYWORD: + kwarg_names.append(p) + elif p.get_kind() == Parameter.VAR_POSITIONAL: + arg_names.append(p) + elif p.get_kind() == Parameter.KEYWORD_ONLY: + kw_only_names.append(p) + else: + args_for_this_func.append(p) + if len(args_for_this_func) > len(longest_param_names): + longest_param_names = args_for_this_func + + for p in longest_param_names: + if star_count == 1 and p.get_kind() != Parameter.VAR_POSITIONAL: + yield ParamNameFixedKind(p, Parameter.POSITIONAL_ONLY) + else: + if p.get_kind() == Parameter.POSITIONAL_OR_KEYWORD: + used_names.add(p.string_name) + yield p + + if not found_arg_signature and original_arg_name is not None: + yield original_arg_name + elif arg_names: + yield arg_names[0] + + for p in kw_only_names: + if p.string_name in used_names: + continue + yield p + used_names.add(p.string_name) + + for func, arguments in kwarg_callables: + for signature in func.get_signatures(): + found_kwarg_signature = True + for p in process_params( + list(_remove_given_params( + arguments, + signature.get_param_names(resolve_stars=False) + )), star_count=2): + if p.get_kind() != Parameter.KEYWORD_ONLY or not kwarg_names: + yield p + + if not found_kwarg_signature and original_kwarg_name is not None: + yield original_kwarg_name + elif kwarg_names: + yield kwarg_names[0] + + +class ParamNameFixedKind(ParamNameWrapper): + def __init__(self, param_name, new_kind): + super(ParamNameFixedKind, self).__init__(param_name) + self._new_kind = new_kind + + def get_kind(self): + return self._new_kind diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/syntax_tree.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/syntax_tree.py new file mode 100644 index 0000000..89c51d3 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/syntax_tree.py @@ -0,0 +1,730 @@ +""" +Functions evaluating the syntax tree. +""" +import copy + +from parso.python import tree + +from jedi._compatibility import force_unicode, unicode +from jedi import debug +from jedi import parser_utils +from jedi.evaluate.base_context import ContextSet, NO_CONTEXTS, ContextualizedNode, \ + ContextualizedName, iterator_to_context_set, iterate_contexts +from jedi.evaluate.lazy_context import LazyTreeContext +from jedi.evaluate import compiled +from jedi.evaluate import recursion +from jedi.evaluate import helpers +from jedi.evaluate import analysis +from jedi.evaluate import imports +from jedi.evaluate import arguments +from jedi.evaluate.context import ClassContext, FunctionContext +from jedi.evaluate.context import iterable +from jedi.evaluate.context import TreeInstance +from jedi.evaluate.finder import NameFinder +from jedi.evaluate.helpers import is_string, is_literal, is_number +from jedi.evaluate.compiled.access import COMPARISON_OPERATORS +from jedi.evaluate.cache import evaluator_method_cache +from jedi.evaluate.gradual.stub_context import VersionInfo +from jedi.evaluate.gradual import annotation +from jedi.evaluate.context.decorator import Decoratee +from jedi.plugins import plugin_manager + + +def _limit_context_infers(func): + """ + This is for now the way how we limit type inference going wild. There are + other ways to ensure recursion limits as well. This is mostly necessary + because of instance (self) access that can be quite tricky to limit. + + I'm still not sure this is the way to go, but it looks okay for now and we + can still go anther way in the future. Tests are there. ~ dave + """ + def wrapper(context, *args, **kwargs): + n = context.tree_node + evaluator = context.evaluator + try: + evaluator.inferred_element_counts[n] += 1 + if evaluator.inferred_element_counts[n] > 300: + debug.warning('In context %s there were too many inferences.', n) + return NO_CONTEXTS + except KeyError: + evaluator.inferred_element_counts[n] = 1 + return func(context, *args, **kwargs) + + return wrapper + + +def _py__stop_iteration_returns(generators): + results = NO_CONTEXTS + for generator in generators: + try: + method = generator.py__stop_iteration_returns + except AttributeError: + debug.warning('%s is not actually a generator', generator) + else: + results |= method() + return results + + +@debug.increase_indent +@_limit_context_infers +def eval_node(context, element): + debug.dbg('eval_node %s@%s in %s', element, element.start_pos, context) + evaluator = context.evaluator + typ = element.type + if typ in ('name', 'number', 'string', 'atom', 'strings', 'keyword', 'fstring'): + return eval_atom(context, element) + elif typ == 'lambdef': + return ContextSet([FunctionContext.from_context(context, element)]) + elif typ == 'expr_stmt': + return eval_expr_stmt(context, element) + elif typ in ('power', 'atom_expr'): + first_child = element.children[0] + children = element.children[1:] + had_await = False + if first_child.type == 'keyword' and first_child.value == 'await': + had_await = True + first_child = children.pop(0) + + context_set = context.eval_node(first_child) + for (i, trailer) in enumerate(children): + if trailer == '**': # has a power operation. + right = context.eval_node(children[i + 1]) + context_set = _eval_comparison( + evaluator, + context, + context_set, + trailer, + right + ) + break + context_set = eval_trailer(context, context_set, trailer) + + if had_await: + return context_set.py__await__().py__stop_iteration_returns() + return context_set + elif typ in ('testlist_star_expr', 'testlist',): + # The implicit tuple in statements. + return ContextSet([iterable.SequenceLiteralContext(evaluator, context, element)]) + elif typ in ('not_test', 'factor'): + context_set = context.eval_node(element.children[-1]) + for operator in element.children[:-1]: + context_set = eval_factor(context_set, operator) + return context_set + elif typ == 'test': + # `x if foo else y` case. + return (context.eval_node(element.children[0]) | + context.eval_node(element.children[-1])) + elif typ == 'operator': + # Must be an ellipsis, other operators are not evaluated. + # In Python 2 ellipsis is coded as three single dot tokens, not + # as one token 3 dot token. + if element.value not in ('.', '...'): + origin = element.parent + raise AssertionError("unhandled operator %s in %s " % (repr(element.value), origin)) + return ContextSet([compiled.builtin_from_name(evaluator, u'Ellipsis')]) + elif typ == 'dotted_name': + context_set = eval_atom(context, element.children[0]) + for next_name in element.children[2::2]: + # TODO add search_global=True? + context_set = context_set.py__getattribute__(next_name, name_context=context) + return context_set + elif typ == 'eval_input': + return eval_node(context, element.children[0]) + elif typ == 'annassign': + return annotation.eval_annotation(context, element.children[1]) \ + .execute_annotation() + elif typ == 'yield_expr': + if len(element.children) and element.children[1].type == 'yield_arg': + # Implies that it's a yield from. + element = element.children[1].children[1] + generators = context.eval_node(element) \ + .py__getattribute__('__iter__').execute_evaluated() + return generators.py__stop_iteration_returns() + + # Generator.send() is not implemented. + return NO_CONTEXTS + elif typ == 'namedexpr_test': + return eval_node(context, element.children[2]) + else: + return eval_or_test(context, element) + + +def eval_trailer(context, atom_contexts, trailer): + trailer_op, node = trailer.children[:2] + if node == ')': # `arglist` is optional. + node = None + + if trailer_op == '[': + trailer_op, node, _ = trailer.children + return atom_contexts.get_item( + eval_subscript_list(context.evaluator, context, node), + ContextualizedNode(context, trailer) + ) + else: + debug.dbg('eval_trailer: %s in %s', trailer, atom_contexts) + if trailer_op == '.': + return atom_contexts.py__getattribute__( + name_context=context, + name_or_str=node + ) + else: + assert trailer_op == '(', 'trailer_op is actually %s' % trailer_op + args = arguments.TreeArguments(context.evaluator, context, node, trailer) + return atom_contexts.execute(args) + + +def eval_atom(context, atom): + """ + Basically to process ``atom`` nodes. The parser sometimes doesn't + generate the node (because it has just one child). In that case an atom + might be a name or a literal as well. + """ + if atom.type == 'name': + if atom.value in ('True', 'False', 'None'): + # Python 2... + return ContextSet([compiled.builtin_from_name(context.evaluator, atom.value)]) + + # This is the first global lookup. + stmt = tree.search_ancestor( + atom, 'expr_stmt', 'lambdef' + ) or atom + if stmt.type == 'lambdef': + stmt = atom + position = stmt.start_pos + if _is_annotation_name(atom): + # Since Python 3.7 (with from __future__ import annotations), + # annotations are essentially strings and can reference objects + # that are defined further down in code. Therefore just set the + # position to None, so the finder will not try to stop at a certain + # position in the module. + position = None + return context.py__getattribute__( + name_or_str=atom, + position=position, + search_global=True + ) + elif atom.type == 'keyword': + # For False/True/None + if atom.value in ('False', 'True', 'None'): + return ContextSet([compiled.builtin_from_name(context.evaluator, atom.value)]) + elif atom.value == 'print': + # print e.g. could be evaluated like this in Python 2.7 + return NO_CONTEXTS + elif atom.value == 'yield': + # Contrary to yield from, yield can just appear alone to return a + # value when used with `.send()`. + return NO_CONTEXTS + assert False, 'Cannot evaluate the keyword %s' % atom + + elif isinstance(atom, tree.Literal): + string = context.evaluator.compiled_subprocess.safe_literal_eval(atom.value) + return ContextSet([compiled.create_simple_object(context.evaluator, string)]) + elif atom.type == 'strings': + # Will be multiple string. + context_set = eval_atom(context, atom.children[0]) + for string in atom.children[1:]: + right = eval_atom(context, string) + context_set = _eval_comparison(context.evaluator, context, context_set, u'+', right) + return context_set + elif atom.type == 'fstring': + return compiled.get_string_context_set(context.evaluator) + else: + c = atom.children + # Parentheses without commas are not tuples. + if c[0] == '(' and not len(c) == 2 \ + and not(c[1].type == 'testlist_comp' and + len(c[1].children) > 1): + return context.eval_node(c[1]) + + try: + comp_for = c[1].children[1] + except (IndexError, AttributeError): + pass + else: + if comp_for == ':': + # Dict comprehensions have a colon at the 3rd index. + try: + comp_for = c[1].children[3] + except IndexError: + pass + + if comp_for.type in ('comp_for', 'sync_comp_for'): + return ContextSet([iterable.comprehension_from_atom( + context.evaluator, context, atom + )]) + + # It's a dict/list/tuple literal. + array_node = c[1] + try: + array_node_c = array_node.children + except AttributeError: + array_node_c = [] + if c[0] == '{' and (array_node == '}' or ':' in array_node_c or + '**' in array_node_c): + context = iterable.DictLiteralContext(context.evaluator, context, atom) + else: + context = iterable.SequenceLiteralContext(context.evaluator, context, atom) + return ContextSet([context]) + + +@_limit_context_infers +def eval_expr_stmt(context, stmt, seek_name=None): + with recursion.execution_allowed(context.evaluator, stmt) as allowed: + # Here we allow list/set to recurse under certain conditions. To make + # it possible to resolve stuff like list(set(list(x))), this is + # necessary. + if not allowed and context.get_root_context() == context.evaluator.builtins_module: + try: + instance = context.var_args.instance + except AttributeError: + pass + else: + if instance.name.string_name in ('list', 'set'): + c = instance.get_first_non_keyword_argument_contexts() + if instance not in c: + allowed = True + + if allowed: + return _eval_expr_stmt(context, stmt, seek_name) + return NO_CONTEXTS + + +@debug.increase_indent +def _eval_expr_stmt(context, stmt, seek_name=None): + """ + The starting point of the completion. A statement always owns a call + list, which are the calls, that a statement does. In case multiple + names are defined in the statement, `seek_name` returns the result for + this name. + + :param stmt: A `tree.ExprStmt`. + """ + debug.dbg('eval_expr_stmt %s (%s)', stmt, seek_name) + rhs = stmt.get_rhs() + context_set = context.eval_node(rhs) + + if seek_name: + c_node = ContextualizedName(context, seek_name) + context_set = check_tuple_assignments(context.evaluator, c_node, context_set) + + first_operator = next(stmt.yield_operators(), None) + if first_operator not in ('=', None) and first_operator.type == 'operator': + # `=` is always the last character in aug assignments -> -1 + operator = copy.copy(first_operator) + operator.value = operator.value[:-1] + name = stmt.get_defined_names()[0].value + left = context.py__getattribute__( + name, position=stmt.start_pos, search_global=True) + + for_stmt = tree.search_ancestor(stmt, 'for_stmt') + if for_stmt is not None and for_stmt.type == 'for_stmt' and context_set \ + and parser_utils.for_stmt_defines_one_name(for_stmt): + # Iterate through result and add the values, that's possible + # only in for loops without clutter, because they are + # predictable. Also only do it, if the variable is not a tuple. + node = for_stmt.get_testlist() + cn = ContextualizedNode(context, node) + ordered = list(cn.infer().iterate(cn)) + + for lazy_context in ordered: + dct = {for_stmt.children[1].value: lazy_context.infer()} + with helpers.predefine_names(context, for_stmt, dct): + t = context.eval_node(rhs) + left = _eval_comparison(context.evaluator, context, left, operator, t) + context_set = left + else: + context_set = _eval_comparison(context.evaluator, context, left, operator, context_set) + debug.dbg('eval_expr_stmt result %s', context_set) + return context_set + + +def eval_or_test(context, or_test): + iterator = iter(or_test.children) + types = context.eval_node(next(iterator)) + for operator in iterator: + right = next(iterator) + if operator.type == 'comp_op': # not in / is not + operator = ' '.join(c.value for c in operator.children) + + # handle lazy evaluation of and/or here. + if operator in ('and', 'or'): + left_bools = set(left.py__bool__() for left in types) + if left_bools == {True}: + if operator == 'and': + types = context.eval_node(right) + elif left_bools == {False}: + if operator != 'and': + types = context.eval_node(right) + # Otherwise continue, because of uncertainty. + else: + types = _eval_comparison(context.evaluator, context, types, operator, + context.eval_node(right)) + debug.dbg('eval_or_test types %s', types) + return types + + +@iterator_to_context_set +def eval_factor(context_set, operator): + """ + Calculates `+`, `-`, `~` and `not` prefixes. + """ + for context in context_set: + if operator == '-': + if is_number(context): + yield context.negate() + elif operator == 'not': + value = context.py__bool__() + if value is None: # Uncertainty. + return + yield compiled.create_simple_object(context.evaluator, not value) + else: + yield context + + +def _literals_to_types(evaluator, result): + # Changes literals ('a', 1, 1.0, etc) to its type instances (str(), + # int(), float(), etc). + new_result = NO_CONTEXTS + for typ in result: + if is_literal(typ): + # Literals are only valid as long as the operations are + # correct. Otherwise add a value-free instance. + cls = compiled.builtin_from_name(evaluator, typ.name.string_name) + new_result |= cls.execute_evaluated() + else: + new_result |= ContextSet([typ]) + return new_result + + +def _eval_comparison(evaluator, context, left_contexts, operator, right_contexts): + if not left_contexts or not right_contexts: + # illegal slices e.g. cause left/right_result to be None + result = (left_contexts or NO_CONTEXTS) | (right_contexts or NO_CONTEXTS) + return _literals_to_types(evaluator, result) + else: + # I don't think there's a reasonable chance that a string + # operation is still correct, once we pass something like six + # objects. + if len(left_contexts) * len(right_contexts) > 6: + return _literals_to_types(evaluator, left_contexts | right_contexts) + else: + return ContextSet.from_sets( + _eval_comparison_part(evaluator, context, left, operator, right) + for left in left_contexts + for right in right_contexts + ) + + +def _is_annotation_name(name): + ancestor = tree.search_ancestor(name, 'param', 'funcdef', 'expr_stmt') + if ancestor is None: + return False + + if ancestor.type in ('param', 'funcdef'): + ann = ancestor.annotation + if ann is not None: + return ann.start_pos <= name.start_pos < ann.end_pos + elif ancestor.type == 'expr_stmt': + c = ancestor.children + if len(c) > 1 and c[1].type == 'annassign': + return c[1].start_pos <= name.start_pos < c[1].end_pos + return False + + +def _is_tuple(context): + return isinstance(context, iterable.Sequence) and context.array_type == 'tuple' + + +def _is_list(context): + return isinstance(context, iterable.Sequence) and context.array_type == 'list' + + +def _bool_to_context(evaluator, bool_): + return compiled.builtin_from_name(evaluator, force_unicode(str(bool_))) + + +def _get_tuple_ints(context): + if not isinstance(context, iterable.SequenceLiteralContext): + return None + numbers = [] + for lazy_context in context.py__iter__(): + if not isinstance(lazy_context, LazyTreeContext): + return None + node = lazy_context.data + if node.type != 'number': + return None + try: + numbers.append(int(node.value)) + except ValueError: + return None + return numbers + + +def _eval_comparison_part(evaluator, context, left, operator, right): + l_is_num = is_number(left) + r_is_num = is_number(right) + if isinstance(operator, unicode): + str_operator = operator + else: + str_operator = force_unicode(str(operator.value)) + + if str_operator == '*': + # for iterables, ignore * operations + if isinstance(left, iterable.Sequence) or is_string(left): + return ContextSet([left]) + elif isinstance(right, iterable.Sequence) or is_string(right): + return ContextSet([right]) + elif str_operator == '+': + if l_is_num and r_is_num or is_string(left) and is_string(right): + return ContextSet([left.execute_operation(right, str_operator)]) + elif _is_tuple(left) and _is_tuple(right) or _is_list(left) and _is_list(right): + return ContextSet([iterable.MergedArray(evaluator, (left, right))]) + elif str_operator == '-': + if l_is_num and r_is_num: + return ContextSet([left.execute_operation(right, str_operator)]) + elif str_operator == '%': + # With strings and numbers the left type typically remains. Except for + # `int() % float()`. + return ContextSet([left]) + elif str_operator in COMPARISON_OPERATORS: + if left.is_compiled() and right.is_compiled(): + # Possible, because the return is not an option. Just compare. + try: + return ContextSet([left.execute_operation(right, str_operator)]) + except TypeError: + # Could be True or False. + pass + else: + if str_operator in ('is', '!=', '==', 'is not'): + operation = COMPARISON_OPERATORS[str_operator] + bool_ = operation(left, right) + return ContextSet([_bool_to_context(evaluator, bool_)]) + + if isinstance(left, VersionInfo): + version_info = _get_tuple_ints(right) + if version_info is not None: + bool_result = compiled.access.COMPARISON_OPERATORS[operator]( + evaluator.environment.version_info, + tuple(version_info) + ) + return ContextSet([_bool_to_context(evaluator, bool_result)]) + + return ContextSet([_bool_to_context(evaluator, True), _bool_to_context(evaluator, False)]) + elif str_operator == 'in': + return NO_CONTEXTS + + def check(obj): + """Checks if a Jedi object is either a float or an int.""" + return isinstance(obj, TreeInstance) and \ + obj.name.string_name in ('int', 'float') + + # Static analysis, one is a number, the other one is not. + if str_operator in ('+', '-') and l_is_num != r_is_num \ + and not (check(left) or check(right)): + message = "TypeError: unsupported operand type(s) for +: %s and %s" + analysis.add(context, 'type-error-operation', operator, + message % (left, right)) + + result = ContextSet([left, right]) + debug.dbg('Used operator %s resulting in %s', operator, result) + return result + + +def _remove_statements(evaluator, context, stmt, name): + """ + This is the part where statements are being stripped. + + Due to lazy evaluation, statements like a = func; b = a; b() have to be + evaluated. + """ + pep0484_contexts = \ + annotation.find_type_from_comment_hint_assign(context, stmt, name) + if pep0484_contexts: + return pep0484_contexts + + return eval_expr_stmt(context, stmt, seek_name=name) + + +@plugin_manager.decorate() +def tree_name_to_contexts(evaluator, context, tree_name): + context_set = NO_CONTEXTS + module_node = context.get_root_context().tree_node + # First check for annotations, like: `foo: int = 3` + if module_node is not None: + names = module_node.get_used_names().get(tree_name.value, []) + for name in names: + expr_stmt = name.parent + + if expr_stmt.type == "expr_stmt" and expr_stmt.children[1].type == "annassign": + correct_scope = parser_utils.get_parent_scope(name) == context.tree_node + if correct_scope: + context_set |= annotation.eval_annotation( + context, expr_stmt.children[1].children[1] + ).execute_annotation() + if context_set: + return context_set + + types = [] + node = tree_name.get_definition(import_name_always=True) + if node is None: + node = tree_name.parent + if node.type == 'global_stmt': + context = evaluator.create_context(context, tree_name) + finder = NameFinder(evaluator, context, context, tree_name.value) + filters = finder.get_filters(search_global=True) + # For global_stmt lookups, we only need the first possible scope, + # which means the function itself. + filters = [next(filters)] + return finder.find(filters, attribute_lookup=False) + elif node.type not in ('import_from', 'import_name'): + context = evaluator.create_context(context, tree_name) + return eval_atom(context, tree_name) + + typ = node.type + if typ == 'for_stmt': + types = annotation.find_type_from_comment_hint_for(context, node, tree_name) + if types: + return types + if typ == 'with_stmt': + types = annotation.find_type_from_comment_hint_with(context, node, tree_name) + if types: + return types + + if typ in ('for_stmt', 'comp_for', 'sync_comp_for'): + try: + types = context.predefined_names[node][tree_name.value] + except KeyError: + cn = ContextualizedNode(context, node.children[3]) + for_types = iterate_contexts( + cn.infer(), + contextualized_node=cn, + is_async=node.parent.type == 'async_stmt', + ) + c_node = ContextualizedName(context, tree_name) + types = check_tuple_assignments(evaluator, c_node, for_types) + elif typ == 'expr_stmt': + types = _remove_statements(evaluator, context, node, tree_name) + elif typ == 'with_stmt': + context_managers = context.eval_node(node.get_test_node_from_name(tree_name)) + enter_methods = context_managers.py__getattribute__(u'__enter__') + return enter_methods.execute_evaluated() + elif typ in ('import_from', 'import_name'): + types = imports.infer_import(context, tree_name) + elif typ in ('funcdef', 'classdef'): + types = _apply_decorators(context, node) + elif typ == 'try_stmt': + # TODO an exception can also be a tuple. Check for those. + # TODO check for types that are not classes and add it to + # the static analysis report. + exceptions = context.eval_node(tree_name.get_previous_sibling().get_previous_sibling()) + types = exceptions.execute_evaluated() + elif node.type == 'param': + types = NO_CONTEXTS + else: + raise ValueError("Should not happen. type: %s" % typ) + return types + + +# We don't want to have functions/classes that are created by the same +# tree_node. +@evaluator_method_cache() +def _apply_decorators(context, node): + """ + Returns the function, that should to be executed in the end. + This is also the places where the decorators are processed. + """ + if node.type == 'classdef': + decoratee_context = ClassContext( + context.evaluator, + parent_context=context, + tree_node=node + ) + else: + decoratee_context = FunctionContext.from_context(context, node) + initial = values = ContextSet([decoratee_context]) + for dec in reversed(node.get_decorators()): + debug.dbg('decorator: %s %s', dec, values, color="MAGENTA") + with debug.increase_indent_cm(): + dec_values = context.eval_node(dec.children[1]) + trailer_nodes = dec.children[2:-1] + if trailer_nodes: + # Create a trailer and evaluate it. + trailer = tree.PythonNode('trailer', trailer_nodes) + trailer.parent = dec + dec_values = eval_trailer(context, dec_values, trailer) + + if not len(dec_values): + code = dec.get_code(include_prefix=False) + # For the short future, we don't want to hear about the runtime + # decorator in typing that was intentionally omitted. This is not + # "correct", but helps with debugging. + if code != '@runtime\n': + debug.warning('decorator not found: %s on %s', dec, node) + return initial + + values = dec_values.execute(arguments.ValuesArguments([values])) + if not len(values): + debug.warning('not possible to resolve wrappers found %s', node) + return initial + + debug.dbg('decorator end %s', values, color="MAGENTA") + if values != initial: + return ContextSet([Decoratee(c, decoratee_context) for c in values]) + return values + + +def check_tuple_assignments(evaluator, contextualized_name, context_set): + """ + Checks if tuples are assigned. + """ + lazy_context = None + for index, node in contextualized_name.assignment_indexes(): + cn = ContextualizedNode(contextualized_name.context, node) + iterated = context_set.iterate(cn) + if isinstance(index, slice): + # For no star unpacking is not possible. + return NO_CONTEXTS + for _ in range(index + 1): + try: + lazy_context = next(iterated) + except StopIteration: + # We could do this with the default param in next. But this + # would allow this loop to run for a very long time if the + # index number is high. Therefore break if the loop is + # finished. + return NO_CONTEXTS + context_set = lazy_context.infer() + return context_set + + +def eval_subscript_list(evaluator, context, index): + """ + Handles slices in subscript nodes. + """ + if index == ':': + # Like array[:] + return ContextSet([iterable.Slice(context, None, None, None)]) + + elif index.type == 'subscript' and not index.children[0] == '.': + # subscript basically implies a slice operation, except for Python 2's + # Ellipsis. + # e.g. array[:3] + result = [] + for el in index.children: + if el == ':': + if not result: + result.append(None) + elif el.type == 'sliceop': + if len(el.children) == 2: + result.append(el.children[1]) + else: + result.append(el) + result += [None] * (3 - len(result)) + + return ContextSet([iterable.Slice(context, *result)]) + elif index.type == 'subscriptlist': + return ContextSet([iterable.SequenceLiteralContext(evaluator, context, index)]) + + # No slices + return context.eval_node(index) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/sys_path.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/sys_path.py new file mode 100644 index 0000000..8dea434 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/sys_path.py @@ -0,0 +1,261 @@ +import os + +from jedi._compatibility import unicode, force_unicode, all_suffixes +from jedi.evaluate.cache import evaluator_method_cache +from jedi.evaluate.base_context import ContextualizedNode +from jedi.evaluate.helpers import is_string +from jedi.common.utils import traverse_parents +from jedi.parser_utils import get_cached_code_lines +from jedi.file_io import FileIO +from jedi import settings +from jedi import debug + + +def _abs_path(module_context, path): + if os.path.isabs(path): + return path + + module_path = module_context.py__file__() + if module_path is None: + # In this case we have no idea where we actually are in the file + # system. + return None + + base_dir = os.path.dirname(module_path) + path = force_unicode(path) + return os.path.abspath(os.path.join(base_dir, path)) + + +def _paths_from_assignment(module_context, expr_stmt): + """ + Extracts the assigned strings from an assignment that looks as follows:: + + sys.path[0:0] = ['module/path', 'another/module/path'] + + This function is in general pretty tolerant (and therefore 'buggy'). + However, it's not a big issue usually to add more paths to Jedi's sys_path, + because it will only affect Jedi in very random situations and by adding + more paths than necessary, it usually benefits the general user. + """ + for assignee, operator in zip(expr_stmt.children[::2], expr_stmt.children[1::2]): + try: + assert operator in ['=', '+='] + assert assignee.type in ('power', 'atom_expr') and \ + len(assignee.children) > 1 + c = assignee.children + assert c[0].type == 'name' and c[0].value == 'sys' + trailer = c[1] + assert trailer.children[0] == '.' and trailer.children[1].value == 'path' + # TODO Essentially we're not checking details on sys.path + # manipulation. Both assigment of the sys.path and changing/adding + # parts of the sys.path are the same: They get added to the end of + # the current sys.path. + """ + execution = c[2] + assert execution.children[0] == '[' + subscript = execution.children[1] + assert subscript.type == 'subscript' + assert ':' in subscript.children + """ + except AssertionError: + continue + + cn = ContextualizedNode(module_context.create_context(expr_stmt), expr_stmt) + for lazy_context in cn.infer().iterate(cn): + for context in lazy_context.infer(): + if is_string(context): + abs_path = _abs_path(module_context, context.get_safe_value()) + if abs_path is not None: + yield abs_path + + +def _paths_from_list_modifications(module_context, trailer1, trailer2): + """ extract the path from either "sys.path.append" or "sys.path.insert" """ + # Guarantee that both are trailers, the first one a name and the second one + # a function execution with at least one param. + if not (trailer1.type == 'trailer' and trailer1.children[0] == '.' + and trailer2.type == 'trailer' and trailer2.children[0] == '(' + and len(trailer2.children) == 3): + return + + name = trailer1.children[1].value + if name not in ['insert', 'append']: + return + arg = trailer2.children[1] + if name == 'insert' and len(arg.children) in (3, 4): # Possible trailing comma. + arg = arg.children[2] + + for context in module_context.create_context(arg).eval_node(arg): + if is_string(context): + abs_path = _abs_path(module_context, context.get_safe_value()) + if abs_path is not None: + yield abs_path + + +@evaluator_method_cache(default=[]) +def check_sys_path_modifications(module_context): + """ + Detect sys.path modifications within module. + """ + def get_sys_path_powers(names): + for name in names: + power = name.parent.parent + if power is not None and power.type in ('power', 'atom_expr'): + c = power.children + if c[0].type == 'name' and c[0].value == 'sys' \ + and c[1].type == 'trailer': + n = c[1].children[1] + if n.type == 'name' and n.value == 'path': + yield name, power + + if module_context.tree_node is None: + return [] + + added = [] + try: + possible_names = module_context.tree_node.get_used_names()['path'] + except KeyError: + pass + else: + for name, power in get_sys_path_powers(possible_names): + expr_stmt = power.parent + if len(power.children) >= 4: + added.extend( + _paths_from_list_modifications( + module_context, *power.children[2:4] + ) + ) + elif expr_stmt is not None and expr_stmt.type == 'expr_stmt': + added.extend(_paths_from_assignment(module_context, expr_stmt)) + return added + + +def discover_buildout_paths(evaluator, script_path): + buildout_script_paths = set() + + for buildout_script_path in _get_buildout_script_paths(script_path): + for path in _get_paths_from_buildout_script(evaluator, buildout_script_path): + buildout_script_paths.add(path) + + return buildout_script_paths + + +def _get_paths_from_buildout_script(evaluator, buildout_script_path): + file_io = FileIO(buildout_script_path) + try: + module_node = evaluator.parse( + file_io=file_io, + cache=True, + cache_path=settings.cache_directory + ) + except IOError: + debug.warning('Error trying to read buildout_script: %s', buildout_script_path) + return + + from jedi.evaluate.context import ModuleContext + module = ModuleContext( + evaluator, module_node, file_io, + string_names=None, + code_lines=get_cached_code_lines(evaluator.grammar, buildout_script_path), + ) + for path in check_sys_path_modifications(module): + yield path + + +def _get_parent_dir_with_file(path, filename): + for parent in traverse_parents(path): + if os.path.isfile(os.path.join(parent, filename)): + return parent + return None + + +def _get_buildout_script_paths(search_path): + """ + if there is a 'buildout.cfg' file in one of the parent directories of the + given module it will return a list of all files in the buildout bin + directory that look like python files. + + :param search_path: absolute path to the module. + :type search_path: str + """ + project_root = _get_parent_dir_with_file(search_path, 'buildout.cfg') + if not project_root: + return + bin_path = os.path.join(project_root, 'bin') + if not os.path.exists(bin_path): + return + + for filename in os.listdir(bin_path): + try: + filepath = os.path.join(bin_path, filename) + with open(filepath, 'r') as f: + firstline = f.readline() + if firstline.startswith('#!') and 'python' in firstline: + yield filepath + except (UnicodeDecodeError, IOError) as e: + # Probably a binary file; permission error or race cond. because + # file got deleted. Ignore it. + debug.warning(unicode(e)) + continue + + +def remove_python_path_suffix(path): + for suffix in all_suffixes(): + if path.endswith(suffix): + path = path[:-len(suffix)] + break + return path + + +def transform_path_to_dotted(sys_path, module_path): + """ + Returns the dotted path inside a sys.path as a list of names. e.g. + + >>> from os.path import abspath + >>> transform_path_to_dotted([abspath("/foo")], abspath('/foo/bar/baz.py')) + (('bar', 'baz'), False) + + Returns (None, False) if the path doesn't really resolve to anything. + The second return part is if it is a package. + """ + # First remove the suffix. + module_path = remove_python_path_suffix(module_path) + + # Once the suffix was removed we are using the files as we know them. This + # means that if someone uses an ending like .vim for a Python file, .vim + # will be part of the returned dotted part. + + is_package = module_path.endswith(os.path.sep + '__init__') + if is_package: + # -1 to remove the separator + module_path = module_path[:-len('__init__') - 1] + + def iter_potential_solutions(): + for p in sys_path: + if module_path.startswith(p): + # Strip the trailing slash/backslash + rest = module_path[len(p):] + # On Windows a path can also use a slash. + if rest.startswith(os.path.sep) or rest.startswith('/'): + # Remove a slash in cases it's still there. + rest = rest[1:] + + if rest: + split = rest.split(os.path.sep) + if not all(split): + # This means that part of the file path was empty, this + # is very strange and is probably a file that is called + # `.py`. + return + yield tuple(split) + + potential_solutions = tuple(iter_potential_solutions()) + if not potential_solutions: + return None, False + # Try to find the shortest path, this makes more sense usually, because the + # user usually has venvs somewhere. This means that a path like + # .tox/py37/lib/python3.7/os.py can be normal for a file. However in that + # case we definitely want to return ['os'] as a path and not a crazy + # ['.tox', 'py37', 'lib', 'python3.7', 'os']. Keep in mind that this is a + # heuristic and there's now ay to "always" do it right. + return sorted(potential_solutions, key=lambda p: len(p))[0], is_package diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/usages.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/usages.py new file mode 100644 index 0000000..9c8d265 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/usages.py @@ -0,0 +1,61 @@ +from jedi.evaluate import imports +from jedi.evaluate.names import TreeNameDefinition + + +def _resolve_names(definition_names, avoid_names=()): + for name in definition_names: + if name in avoid_names: + # Avoiding recursions here, because goto on a module name lands + # on the same module. + continue + + if not isinstance(name, imports.SubModuleName): + # SubModuleNames are not actually existing names but created + # names when importing something like `import foo.bar.baz`. + yield name + + if name.api_type == 'module': + for name in _resolve_names(name.goto(), definition_names): + yield name + + +def _dictionarize(names): + return dict( + (n if n.tree_name is None else n.tree_name, n) + for n in names + ) + + +def _find_names(module_context, tree_name): + context = module_context.create_context(tree_name) + name = TreeNameDefinition(context, tree_name) + found_names = set(name.goto()) + found_names.add(name) + return _dictionarize(_resolve_names(found_names)) + + +def usages(module_context, tree_name): + search_name = tree_name.value + found_names = _find_names(module_context, tree_name) + modules = set(d.get_root_context() for d in found_names.values()) + modules = set(m for m in modules if m.is_module() and not m.is_compiled()) + + non_matching_usage_maps = {} + for m in imports.get_modules_containing_name(module_context.evaluator, modules, search_name): + for name_leaf in m.tree_node.get_used_names().get(search_name, []): + new = _find_names(m, name_leaf) + if any(tree_name in found_names for tree_name in new): + found_names.update(new) + for tree_name in new: + for dct in non_matching_usage_maps.get(tree_name, []): + # A usage that was previously searched for matches with + # a now found name. Merge. + found_names.update(dct) + try: + del non_matching_usage_maps[tree_name] + except KeyError: + pass + else: + for name in new: + non_matching_usage_maps.setdefault(name, []).append(new) + return found_names.values() diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/utils.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/utils.py new file mode 100644 index 0000000..990a995 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/evaluate/utils.py @@ -0,0 +1,119 @@ +""" A universal module with functions / classes without dependencies. """ +import sys +import contextlib +import functools +import re +import os + +from jedi._compatibility import reraise + + +_sep = os.path.sep +if os.path.altsep is not None: + _sep += os.path.altsep +_path_re = re.compile(r'(?:\.[^{0}]+|[{0}]__init__\.py)$'.format(re.escape(_sep))) +del _sep + + +def to_list(func): + def wrapper(*args, **kwargs): + return list(func(*args, **kwargs)) + return wrapper + + +def unite(iterable): + """Turns a two dimensional array into a one dimensional.""" + return set(typ for types in iterable for typ in types) + + +class UncaughtAttributeError(Exception): + """ + Important, because `__getattr__` and `hasattr` catch AttributeErrors + implicitly. This is really evil (mainly because of `__getattr__`). + `hasattr` in Python 2 is even more evil, because it catches ALL exceptions. + Therefore this class originally had to be derived from `BaseException` + instead of `Exception`. But because I removed relevant `hasattr` from + the code base, we can now switch back to `Exception`. + + :param base: return values of sys.exc_info(). + """ + + +def safe_property(func): + return property(reraise_uncaught(func)) + + +def reraise_uncaught(func): + """ + Re-throw uncaught `AttributeError`. + + Usage: Put ``@rethrow_uncaught`` in front of the function + which does **not** suppose to raise `AttributeError`. + + AttributeError is easily get caught by `hasattr` and another + ``except AttributeError`` clause. This becomes problem when you use + a lot of "dynamic" attributes (e.g., using ``@property``) because you + can't distinguish if the property does not exist for real or some code + inside of the "dynamic" attribute through that error. In a well + written code, such error should not exist but getting there is very + difficult. This decorator is to help us getting there by changing + `AttributeError` to `UncaughtAttributeError` to avoid unexpected catch. + This helps us noticing bugs earlier and facilitates debugging. + + .. note:: Treating StopIteration here is easy. + Add that feature when needed. + """ + @functools.wraps(func) + def wrapper(*args, **kwds): + try: + return func(*args, **kwds) + except AttributeError: + exc_info = sys.exc_info() + reraise(UncaughtAttributeError(exc_info[1]), exc_info[2]) + return wrapper + + +class PushBackIterator(object): + def __init__(self, iterator): + self.pushes = [] + self.iterator = iterator + self.current = None + + def push_back(self, value): + self.pushes.append(value) + + def __iter__(self): + return self + + def next(self): + """ Python 2 Compatibility """ + return self.__next__() + + def __next__(self): + if self.pushes: + self.current = self.pushes.pop() + else: + self.current = next(self.iterator) + return self.current + + +@contextlib.contextmanager +def ignored(*exceptions): + """ + Context manager that ignores all of the specified exceptions. This will + be in the standard library starting with Python 3.4. + """ + try: + yield + except exceptions: + pass + + +def indent_block(text, indention=' '): + """This function indents a text block with a default of four spaces.""" + temp = '' + while text and text[-1] == '\n': + temp += text[-1] + text = text[:-1] + lines = text.split('\n') + return '\n'.join(map(lambda s: indention + s, lines)) + temp diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/file_io.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/file_io.py new file mode 100644 index 0000000..37d958e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/file_io.py @@ -0,0 +1,48 @@ +import os + +from parso import file_io + + +class AbstractFolderIO(object): + def __init__(self, path): + self.path = path + + def list(self): + raise NotImplementedError + + def get_file_io(self, name): + raise NotImplementedError + + +class FolderIO(AbstractFolderIO): + def list(self): + return os.listdir(self.path) + + def get_file_io(self, name): + return FileIO(os.path.join(self.path, name)) + + +class FileIOFolderMixin(object): + def get_parent_folder(self): + return FolderIO(os.path.dirname(self.path)) + + +class ZipFileIO(file_io.KnownContentFileIO, FileIOFolderMixin): + """For .zip and .egg archives""" + def __init__(self, path, code, zip_path): + super(ZipFileIO, self).__init__(path, code) + self._zip_path = zip_path + + def get_last_modified(self): + try: + return os.path.getmtime(self._zip_path) + except OSError: # Python 3 would probably only need FileNotFoundError + return None + + +class FileIO(file_io.FileIO, FileIOFolderMixin): + pass + + +class KnownContentFileIO(file_io.KnownContentFileIO, FileIOFolderMixin): + pass diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/parser_utils.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/parser_utils.py new file mode 100644 index 0000000..99d7a96 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/parser_utils.py @@ -0,0 +1,297 @@ +import re +import textwrap +from inspect import cleandoc +from weakref import WeakKeyDictionary + +from parso.python import tree +from parso.cache import parser_cache +from parso import split_lines + +from jedi._compatibility import literal_eval, force_unicode + +_EXECUTE_NODES = {'funcdef', 'classdef', 'import_from', 'import_name', 'test', + 'or_test', 'and_test', 'not_test', 'comparison', 'expr', + 'xor_expr', 'and_expr', 'shift_expr', 'arith_expr', + 'atom_expr', 'term', 'factor', 'power', 'atom'} + +_FLOW_KEYWORDS = ( + 'try', 'except', 'finally', 'else', 'if', 'elif', 'with', 'for', 'while' +) + + +def get_executable_nodes(node, last_added=False): + """ + For static analysis. + """ + result = [] + typ = node.type + if typ == 'name': + next_leaf = node.get_next_leaf() + if last_added is False and node.parent.type != 'param' and next_leaf != '=': + result.append(node) + elif typ == 'expr_stmt': + # I think evaluating the statement (and possibly returned arrays), + # should be enough for static analysis. + result.append(node) + for child in node.children: + result += get_executable_nodes(child, last_added=True) + elif typ == 'decorator': + # decorator + if node.children[-2] == ')': + node = node.children[-3] + if node != '(': + result += get_executable_nodes(node) + else: + try: + children = node.children + except AttributeError: + pass + else: + if node.type in _EXECUTE_NODES and not last_added: + result.append(node) + + for child in children: + result += get_executable_nodes(child, last_added) + + return result + + +def get_sync_comp_fors(comp_for): + yield comp_for + last = comp_for.children[-1] + while True: + if last.type == 'comp_for': + yield last.children[1] # Ignore the async. + elif last.type == 'sync_comp_for': + yield last + elif not last.type == 'comp_if': + break + last = last.children[-1] + + +def for_stmt_defines_one_name(for_stmt): + """ + Returns True if only one name is returned: ``for x in y``. + Returns False if the for loop is more complicated: ``for x, z in y``. + + :returns: bool + """ + return for_stmt.children[1].type == 'name' + + +def get_flow_branch_keyword(flow_node, node): + start_pos = node.start_pos + if not (flow_node.start_pos < start_pos <= flow_node.end_pos): + raise ValueError('The node is not part of the flow.') + + keyword = None + for i, child in enumerate(flow_node.children): + if start_pos < child.start_pos: + return keyword + first_leaf = child.get_first_leaf() + if first_leaf in _FLOW_KEYWORDS: + keyword = first_leaf + return 0 + + +def get_statement_of_position(node, pos): + for c in node.children: + if c.start_pos <= pos <= c.end_pos: + if c.type not in ('decorated', 'simple_stmt', 'suite', + 'async_stmt', 'async_funcdef') \ + and not isinstance(c, (tree.Flow, tree.ClassOrFunc)): + return c + else: + try: + return get_statement_of_position(c, pos) + except AttributeError: + pass # Must be a non-scope + return None + + +def clean_scope_docstring(scope_node): + """ Returns a cleaned version of the docstring token. """ + node = scope_node.get_doc_node() + if node is not None: + # TODO We have to check next leaves until there are no new + # leaves anymore that might be part of the docstring. A + # docstring can also look like this: ``'foo' 'bar' + # Returns a literal cleaned version of the ``Token``. + cleaned = cleandoc(safe_literal_eval(node.value)) + # Since we want the docstr output to be always unicode, just + # force it. + return force_unicode(cleaned) + return '' + + +def safe_literal_eval(value): + first_two = value[:2].lower() + if first_two[0] == 'f' or first_two in ('fr', 'rf'): + # literal_eval is not able to resovle f literals. We have to do that + # manually, but that's right now not implemented. + return '' + + try: + return literal_eval(value) + except SyntaxError: + # It's possible to create syntax errors with literals like rb'' in + # Python 2. This should not be possible and in that case just return an + # empty string. + # Before Python 3.3 there was a more strict definition in which order + # you could define literals. + return '' + + +def get_call_signature(funcdef, width=72, call_string=None, + omit_first_param=False, omit_return_annotation=False): + """ + Generate call signature of this function. + + :param width: Fold lines if a line is longer than this value. + :type width: int + :arg func_name: Override function name when given. + :type func_name: str + + :rtype: str + """ + # Lambdas have no name. + if call_string is None: + if funcdef.type == 'lambdef': + call_string = '' + else: + call_string = funcdef.name.value + params = funcdef.get_params() + if omit_first_param: + params = params[1:] + p = '(' + ''.join(param.get_code() for param in params).strip() + ')' + # TODO this is pretty bad, we should probably just normalize. + p = re.sub(r'\s+', ' ', p) + if funcdef.annotation and not omit_return_annotation: + rtype = " ->" + funcdef.annotation.get_code() + else: + rtype = "" + code = call_string + p + rtype + + return '\n'.join(textwrap.wrap(code, width)) + + +def move(node, line_offset): + """ + Move the `Node` start_pos. + """ + try: + children = node.children + except AttributeError: + node.line += line_offset + else: + for c in children: + move(c, line_offset) + + +def get_following_comment_same_line(node): + """ + returns (as string) any comment that appears on the same line, + after the node, including the # + """ + try: + if node.type == 'for_stmt': + whitespace = node.children[5].get_first_leaf().prefix + elif node.type == 'with_stmt': + whitespace = node.children[3].get_first_leaf().prefix + elif node.type == 'funcdef': + # actually on the next line + whitespace = node.children[4].get_first_leaf().get_next_leaf().prefix + else: + whitespace = node.get_last_leaf().get_next_leaf().prefix + except AttributeError: + return None + except ValueError: + # TODO in some particular cases, the tree doesn't seem to be linked + # correctly + return None + if "#" not in whitespace: + return None + comment = whitespace[whitespace.index("#"):] + if "\r" in comment: + comment = comment[:comment.index("\r")] + if "\n" in comment: + comment = comment[:comment.index("\n")] + return comment + + +def is_scope(node): + t = node.type + if t == 'comp_for': + # Starting with Python 3.8, async is outside of the statement. + return node.children[1].type != 'sync_comp_for' + + return t in ('file_input', 'classdef', 'funcdef', 'lambdef', 'sync_comp_for') + + +def _get_parent_scope_cache(func): + cache = WeakKeyDictionary() + + def wrapper(used_names, node, include_flows=False): + try: + for_module = cache[used_names] + except KeyError: + for_module = cache[used_names] = {} + + try: + return for_module[node] + except KeyError: + result = for_module[node] = func(node, include_flows) + return result + return wrapper + + +def get_parent_scope(node, include_flows=False): + """ + Returns the underlying scope. + """ + scope = node.parent + if scope is None: + return None # It's a module already. + + while True: + if is_scope(scope) or include_flows and isinstance(scope, tree.Flow): + if scope.type in ('classdef', 'funcdef', 'lambdef'): + index = scope.children.index(':') + if scope.children[index].start_pos >= node.start_pos: + if node.parent.type == 'param' and node.parent.name == node: + pass + elif node.parent.type == 'tfpdef' and node.parent.children[0] == node: + pass + else: + scope = scope.parent + continue + return scope + scope = scope.parent + return scope + + +get_cached_parent_scope = _get_parent_scope_cache(get_parent_scope) + + +def get_cached_code_lines(grammar, path): + """ + Basically access the cached code lines in parso. This is not the nicest way + to do this, but we avoid splitting all the lines again. + """ + return parser_cache[grammar._hashed][path].lines + + +def cut_value_at_position(leaf, position): + """ + Cuts of the value of the leaf at position + """ + lines = split_lines(leaf.value, keepends=True)[:position[0] - leaf.line + 1] + column = position[1] + if leaf.line == position[0]: + column -= leaf.column + lines[-1] = lines[-1][:column] + return ''.join(lines) + + +def get_string_quote(leaf): + return re.match('\w*("""|\'{3}|"|\')', leaf.value).group(1) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/plugins/__init__.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/plugins/__init__.py new file mode 100644 index 0000000..df106cf --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/plugins/__init__.py @@ -0,0 +1,47 @@ +from functools import wraps + + +class _PluginManager(object): + def __init__(self): + self._registered_plugins = [] + self._cached_base_callbacks = {} + self._built_functions = {} + + def register(self, *plugins): + """ + Makes it possible to register your plugin. + """ + self._registered_plugins.extend(plugins) + self._build_functions() + + def decorate(self): + def decorator(callback): + @wraps(callback) + def wrapper(*args, **kwargs): + return built_functions[name](*args, **kwargs) + + name = callback.__name__ + + assert name not in self._built_functions + built_functions = self._built_functions + built_functions[name] = callback + self._cached_base_callbacks[name] = callback + + return wrapper + + return decorator + + def _build_functions(self): + for name, callback in self._cached_base_callbacks.items(): + for plugin in reversed(self._registered_plugins): + # Need to reverse so the first plugin is run first. + try: + func = getattr(plugin, name) + except AttributeError: + pass + else: + callback = func(callback) + self._built_functions[name] = callback + + +plugin_manager = _PluginManager() diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/plugins/flask.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/plugins/flask.py new file mode 100644 index 0000000..7cbb106 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/plugins/flask.py @@ -0,0 +1,21 @@ +def import_module(callback): + """ + Handle "magic" Flask extension imports: + ``flask.ext.foo`` is really ``flask_foo`` or ``flaskext.foo``. + """ + def wrapper(evaluator, import_names, module_context, *args, **kwargs): + if len(import_names) == 3 and import_names[:2] == ('flask', 'ext'): + # New style. + ipath = (u'flask_' + import_names[2]), + context_set = callback(evaluator, ipath, None, *args, **kwargs) + if context_set: + return context_set + context_set = callback(evaluator, (u'flaskext',), None, *args, **kwargs) + return callback( + evaluator, + (u'flaskext', import_names[2]), + next(iter(context_set)), + *args, **kwargs + ) + return callback(evaluator, import_names, module_context, *args, **kwargs) + return wrapper diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/plugins/registry.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/plugins/registry.py new file mode 100644 index 0000000..2391324 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/plugins/registry.py @@ -0,0 +1,10 @@ +""" +This is not a plugin, this is just the place were plugins are registered. +""" + +from jedi.plugins import stdlib +from jedi.plugins import flask +from jedi.plugins import plugin_manager + + +plugin_manager.register(stdlib, flask) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/plugins/stdlib.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/plugins/stdlib.py new file mode 100644 index 0000000..2f2608f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/plugins/stdlib.py @@ -0,0 +1,835 @@ +""" +Implementations of standard library functions, because it's not possible to +understand them with Jedi. + +To add a new implementation, create a function and add it to the +``_implemented`` dict at the bottom of this module. + +Note that this module exists only to implement very specific functionality in +the standard library. The usual way to understand the standard library is the +compiled module that returns the types for C-builtins. +""" +import parso +import os + +from jedi._compatibility import force_unicode, Parameter +from jedi import debug +from jedi.evaluate.utils import safe_property +from jedi.evaluate.helpers import get_str_or_none +from jedi.evaluate.arguments import ValuesArguments, \ + repack_with_argument_clinic, AbstractArguments, TreeArgumentsWrapper +from jedi.evaluate import analysis +from jedi.evaluate import compiled +from jedi.evaluate.context.instance import BoundMethod, InstanceArguments +from jedi.evaluate.base_context import ContextualizedNode, \ + NO_CONTEXTS, ContextSet, ContextWrapper, LazyContextWrapper +from jedi.evaluate.context import ClassContext, ModuleContext, \ + FunctionExecutionContext +from jedi.evaluate.context.klass import ClassMixin +from jedi.evaluate.context.function import FunctionMixin +from jedi.evaluate.context import iterable +from jedi.evaluate.lazy_context import LazyTreeContext, LazyKnownContext, \ + LazyKnownContexts +from jedi.evaluate.names import ContextName, BaseTreeParamName +from jedi.evaluate.syntax_tree import is_string +from jedi.evaluate.filters import AttributeOverwrite, publish_method, \ + ParserTreeFilter, DictFilter +from jedi.evaluate.signature import AbstractSignature, SignatureWrapper + + +# Copied from Python 3.6's stdlib. +_NAMEDTUPLE_CLASS_TEMPLATE = """\ +_property = property +_tuple = tuple +from operator import itemgetter as _itemgetter +from collections import OrderedDict + +class {typename}(tuple): + '{typename}({arg_list})' + + __slots__ = () + + _fields = {field_names!r} + + def __new__(_cls, {arg_list}): + 'Create new instance of {typename}({arg_list})' + return _tuple.__new__(_cls, ({arg_list})) + + @classmethod + def _make(cls, iterable, new=tuple.__new__, len=len): + 'Make a new {typename} object from a sequence or iterable' + result = new(cls, iterable) + if len(result) != {num_fields:d}: + raise TypeError('Expected {num_fields:d} arguments, got %d' % len(result)) + return result + + def _replace(_self, **kwds): + 'Return a new {typename} object replacing specified fields with new values' + result = _self._make(map(kwds.pop, {field_names!r}, _self)) + if kwds: + raise ValueError('Got unexpected field names: %r' % list(kwds)) + return result + + def __repr__(self): + 'Return a nicely formatted representation string' + return self.__class__.__name__ + '({repr_fmt})' % self + + def _asdict(self): + 'Return a new OrderedDict which maps field names to their values.' + return OrderedDict(zip(self._fields, self)) + + def __getnewargs__(self): + 'Return self as a plain tuple. Used by copy and pickle.' + return tuple(self) + + # These methods were added by Jedi. + # __new__ doesn't really work with Jedi. So adding this to nametuples seems + # like the easiest way. + def __init__(_cls, {arg_list}): + 'A helper function for namedtuple.' + self.__iterable = ({arg_list}) + + def __iter__(self): + for i in self.__iterable: + yield i + + def __getitem__(self, y): + return self.__iterable[y] + +{field_defs} +""" + +_NAMEDTUPLE_FIELD_TEMPLATE = '''\ + {name} = _property(_itemgetter({index:d}), doc='Alias for field number {index:d}') +''' + + +def execute(callback): + def wrapper(context, arguments): + def call(): + return callback(context, arguments=arguments) + + try: + obj_name = context.name.string_name + except AttributeError: + pass + else: + if context.parent_context == context.evaluator.builtins_module: + module_name = 'builtins' + elif context.parent_context is not None and context.parent_context.is_module(): + module_name = context.parent_context.py__name__() + else: + return call() + + if isinstance(context, BoundMethod): + if module_name == 'builtins': + if context.py__name__() == '__get__': + if context.class_context.py__name__() == 'property': + return builtins_property( + context, + arguments=arguments, + callback=call, + ) + elif context.py__name__() in ('deleter', 'getter', 'setter'): + if context.class_context.py__name__() == 'property': + return ContextSet([context.instance]) + + return call() + + # for now we just support builtin functions. + try: + func = _implemented[module_name][obj_name] + except KeyError: + pass + else: + return func(context, arguments=arguments, callback=call) + return call() + + return wrapper + + +def _follow_param(evaluator, arguments, index): + try: + key, lazy_context = list(arguments.unpack())[index] + except IndexError: + return NO_CONTEXTS + else: + return lazy_context.infer() + + +def argument_clinic(string, want_obj=False, want_context=False, + want_arguments=False, want_evaluator=False, + want_callback=False): + """ + Works like Argument Clinic (PEP 436), to validate function params. + """ + + def f(func): + @repack_with_argument_clinic(string, keep_arguments_param=True, + keep_callback_param=True) + def wrapper(obj, *args, **kwargs): + arguments = kwargs.pop('arguments') + callback = kwargs.pop('callback') + assert not kwargs # Python 2... + debug.dbg('builtin start %s' % obj, color='MAGENTA') + result = NO_CONTEXTS + if want_context: + kwargs['context'] = arguments.context + if want_obj: + kwargs['obj'] = obj + if want_evaluator: + kwargs['evaluator'] = obj.evaluator + if want_arguments: + kwargs['arguments'] = arguments + if want_callback: + kwargs['callback'] = callback + result = func(*args, **kwargs) + debug.dbg('builtin end: %s', result, color='MAGENTA') + return result + + return wrapper + return f + + +@argument_clinic('obj, type, /', want_obj=True, want_arguments=True) +def builtins_property(objects, types, obj, arguments): + property_args = obj.instance.var_args.unpack() + key, lazy_context = next(property_args, (None, None)) + if key is not None or lazy_context is None: + debug.warning('property expected a first param, not %s', arguments) + return NO_CONTEXTS + + return lazy_context.infer().py__call__(arguments=ValuesArguments([objects])) + + +@argument_clinic('iterator[, default], /', want_evaluator=True) +def builtins_next(iterators, defaults, evaluator): + if evaluator.environment.version_info.major == 2: + name = 'next' + else: + name = '__next__' + + # TODO theoretically we have to check here if something is an iterator. + # That is probably done by checking if it's not a class. + return defaults | iterators.py__getattribute__(name).execute_evaluated() + + +@argument_clinic('iterator[, default], /') +def builtins_iter(iterators_or_callables, defaults): + # TODO implement this if it's a callable. + return iterators_or_callables.py__getattribute__('__iter__').execute_evaluated() + + +@argument_clinic('object, name[, default], /') +def builtins_getattr(objects, names, defaults=None): + # follow the first param + for obj in objects: + for name in names: + string = get_str_or_none(name) + if string is None: + debug.warning('getattr called without str') + continue + else: + return obj.py__getattribute__(force_unicode(string)) + return NO_CONTEXTS + + +@argument_clinic('object[, bases, dict], /') +def builtins_type(objects, bases, dicts): + if bases or dicts: + # It's a type creation... maybe someday... + return NO_CONTEXTS + else: + return objects.py__class__() + + +class SuperInstance(LazyContextWrapper): + """To be used like the object ``super`` returns.""" + def __init__(self, evaluator, instance): + self.evaluator = evaluator + self._instance = instance # Corresponds to super().__self__ + + def _get_bases(self): + return self._instance.py__class__().py__bases__() + + def _get_wrapped_context(self): + objs = self._get_bases()[0].infer().execute_evaluated() + if not objs: + # This is just a fallback and will only be used, if it's not + # possible to find a class + return self._instance + return next(iter(objs)) + + def get_filters(self, search_global=False, until_position=None, origin_scope=None): + for b in self._get_bases(): + for obj in b.infer().execute_evaluated(): + for f in obj.get_filters(): + yield f + + +@argument_clinic('[type[, obj]], /', want_context=True) +def builtins_super(types, objects, context): + if isinstance(context, FunctionExecutionContext): + if isinstance(context.var_args, InstanceArguments): + instance = context.var_args.instance + # TODO if a class is given it doesn't have to be the direct super + # class, it can be an anecestor from long ago. + return ContextSet({SuperInstance(instance.evaluator, instance)}) + + return NO_CONTEXTS + + +class ReversedObject(AttributeOverwrite): + def __init__(self, reversed_obj, iter_list): + super(ReversedObject, self).__init__(reversed_obj) + self._iter_list = iter_list + + @publish_method('__iter__') + def py__iter__(self, contextualized_node=None): + return self._iter_list + + @publish_method('next', python_version_match=2) + @publish_method('__next__', python_version_match=3) + def py__next__(self): + return ContextSet.from_sets( + lazy_context.infer() for lazy_context in self._iter_list + ) + + +@argument_clinic('sequence, /', want_obj=True, want_arguments=True) +def builtins_reversed(sequences, obj, arguments): + # While we could do without this variable (just by using sequences), we + # want static analysis to work well. Therefore we need to generated the + # values again. + key, lazy_context = next(arguments.unpack()) + cn = None + if isinstance(lazy_context, LazyTreeContext): + # TODO access private + cn = ContextualizedNode(lazy_context.context, lazy_context.data) + ordered = list(sequences.iterate(cn)) + + # Repack iterator values and then run it the normal way. This is + # necessary, because `reversed` is a function and autocompletion + # would fail in certain cases like `reversed(x).__iter__` if we + # just returned the result directly. + seq, = obj.evaluator.typing_module.py__getattribute__('Iterator').execute_evaluated() + return ContextSet([ReversedObject(seq, list(reversed(ordered)))]) + + +@argument_clinic('obj, type, /', want_arguments=True, want_evaluator=True) +def builtins_isinstance(objects, types, arguments, evaluator): + bool_results = set() + for o in objects: + cls = o.py__class__() + try: + cls.py__bases__ + except AttributeError: + # This is temporary. Everything should have a class attribute in + # Python?! Maybe we'll leave it here, because some numpy objects or + # whatever might not. + bool_results = set([True, False]) + break + + mro = list(cls.py__mro__()) + + for cls_or_tup in types: + if cls_or_tup.is_class(): + bool_results.add(cls_or_tup in mro) + elif cls_or_tup.name.string_name == 'tuple' \ + and cls_or_tup.get_root_context() == evaluator.builtins_module: + # Check for tuples. + classes = ContextSet.from_sets( + lazy_context.infer() + for lazy_context in cls_or_tup.iterate() + ) + bool_results.add(any(cls in mro for cls in classes)) + else: + _, lazy_context = list(arguments.unpack())[1] + if isinstance(lazy_context, LazyTreeContext): + node = lazy_context.data + message = 'TypeError: isinstance() arg 2 must be a ' \ + 'class, type, or tuple of classes and types, ' \ + 'not %s.' % cls_or_tup + analysis.add(lazy_context.context, 'type-error-isinstance', node, message) + + return ContextSet( + compiled.builtin_from_name(evaluator, force_unicode(str(b))) + for b in bool_results + ) + + +class StaticMethodObject(AttributeOverwrite, ContextWrapper): + def get_object(self): + return self._wrapped_context + + def py__get__(self, instance, klass): + return ContextSet([self._wrapped_context]) + + +@argument_clinic('sequence, /') +def builtins_staticmethod(functions): + return ContextSet(StaticMethodObject(f) for f in functions) + + +class ClassMethodObject(AttributeOverwrite, ContextWrapper): + def __init__(self, class_method_obj, function): + super(ClassMethodObject, self).__init__(class_method_obj) + self._function = function + + def get_object(self): + return self._wrapped_context + + def py__get__(self, obj, class_context): + return ContextSet([ + ClassMethodGet(__get__, class_context, self._function) + for __get__ in self._wrapped_context.py__getattribute__('__get__') + ]) + + +class ClassMethodGet(AttributeOverwrite, ContextWrapper): + def __init__(self, get_method, klass, function): + super(ClassMethodGet, self).__init__(get_method) + self._class = klass + self._function = function + + def get_signatures(self): + return self._function.get_signatures() + + def get_object(self): + return self._wrapped_context + + def py__call__(self, arguments): + return self._function.execute(ClassMethodArguments(self._class, arguments)) + + +class ClassMethodArguments(TreeArgumentsWrapper): + def __init__(self, klass, arguments): + super(ClassMethodArguments, self).__init__(arguments) + self._class = klass + + def unpack(self, func=None): + yield None, LazyKnownContext(self._class) + for values in self._wrapped_arguments.unpack(func): + yield values + + +@argument_clinic('sequence, /', want_obj=True, want_arguments=True) +def builtins_classmethod(functions, obj, arguments): + return ContextSet( + ClassMethodObject(class_method_object, function) + for class_method_object in obj.py__call__(arguments=arguments) + for function in functions + ) + + +def collections_namedtuple(obj, arguments, callback): + """ + Implementation of the namedtuple function. + + This has to be done by processing the namedtuple class template and + evaluating the result. + + """ + evaluator = obj.evaluator + + # Process arguments + name = u'jedi_unknown_namedtuple' + for c in _follow_param(evaluator, arguments, 0): + x = get_str_or_none(c) + if x is not None: + name = force_unicode(x) + break + + # TODO here we only use one of the types, we should use all. + param_contexts = _follow_param(evaluator, arguments, 1) + if not param_contexts: + return NO_CONTEXTS + _fields = list(param_contexts)[0] + string = get_str_or_none(_fields) + if string is not None: + fields = force_unicode(string).replace(',', ' ').split() + elif isinstance(_fields, iterable.Sequence): + fields = [ + force_unicode(get_str_or_none(v)) + for lazy_context in _fields.py__iter__() + for v in lazy_context.infer() + ] + fields = [f for f in fields if f is not None] + else: + return NO_CONTEXTS + + # Build source code + code = _NAMEDTUPLE_CLASS_TEMPLATE.format( + typename=name, + field_names=tuple(fields), + num_fields=len(fields), + arg_list=repr(tuple(fields)).replace("u'", "").replace("'", "")[1:-1], + repr_fmt='', + field_defs='\n'.join(_NAMEDTUPLE_FIELD_TEMPLATE.format(index=index, name=name) + for index, name in enumerate(fields)) + ) + + # Parse source code + module = evaluator.grammar.parse(code) + generated_class = next(module.iter_classdefs()) + parent_context = ModuleContext( + evaluator, module, + file_io=None, + string_names=None, + code_lines=parso.split_lines(code, keepends=True), + ) + + return ContextSet([ClassContext(evaluator, parent_context, generated_class)]) + + +class PartialObject(object): + def __init__(self, actual_context, arguments): + self._actual_context = actual_context + self._arguments = arguments + + def __getattr__(self, name): + return getattr(self._actual_context, name) + + def _get_function(self, unpacked_arguments): + key, lazy_context = next(unpacked_arguments, (None, None)) + if key is not None or lazy_context is None: + debug.warning("Partial should have a proper function %s", self._arguments) + return None + return lazy_context.infer() + + def get_signatures(self): + unpacked_arguments = self._arguments.unpack() + func = self._get_function(unpacked_arguments) + if func is None: + return [] + + arg_count = 0 + keys = set() + for key, _ in unpacked_arguments: + if key is None: + arg_count += 1 + else: + keys.add(key) + return [PartialSignature(s, arg_count, keys) for s in func.get_signatures()] + + def py__call__(self, arguments): + func = self._get_function(self._arguments.unpack()) + if func is None: + return NO_CONTEXTS + + return func.execute( + MergedPartialArguments(self._arguments, arguments) + ) + + +class PartialSignature(SignatureWrapper): + def __init__(self, wrapped_signature, skipped_arg_count, skipped_arg_set): + super(PartialSignature, self).__init__(wrapped_signature) + self._skipped_arg_count = skipped_arg_count + self._skipped_arg_set = skipped_arg_set + + def get_param_names(self, resolve_stars=False): + names = self._wrapped_signature.get_param_names()[self._skipped_arg_count:] + return [n for n in names if n.string_name not in self._skipped_arg_set] + + +class MergedPartialArguments(AbstractArguments): + def __init__(self, partial_arguments, call_arguments): + self._partial_arguments = partial_arguments + self._call_arguments = call_arguments + + def unpack(self, funcdef=None): + unpacked = self._partial_arguments.unpack(funcdef) + # Ignore this one, it's the function. It was checked before that it's + # there. + next(unpacked) + for key_lazy_context in unpacked: + yield key_lazy_context + for key_lazy_context in self._call_arguments.unpack(funcdef): + yield key_lazy_context + + +def functools_partial(obj, arguments, callback): + return ContextSet( + PartialObject(instance, arguments) + for instance in obj.py__call__(arguments) + ) + + +@argument_clinic('first, /') +def _return_first_param(firsts): + return firsts + + +@argument_clinic('seq') +def _random_choice(sequences): + return ContextSet.from_sets( + lazy_context.infer() + for sequence in sequences + for lazy_context in sequence.py__iter__() + ) + + +def _dataclass(obj, arguments, callback): + for c in _follow_param(obj.evaluator, arguments, 0): + if c.is_class(): + return ContextSet([DataclassWrapper(c)]) + else: + return ContextSet([obj]) + return NO_CONTEXTS + + +class DataclassWrapper(ContextWrapper, ClassMixin): + def get_signatures(self): + param_names = [] + for cls in reversed(list(self.py__mro__())): + if isinstance(cls, DataclassWrapper): + filter_ = cls.get_global_filter() + # .values ordering is not guaranteed, at least not in + # Python < 3.6, when dicts where not ordered, which is an + # implementation detail anyway. + for name in sorted(filter_.values(), key=lambda name: name.start_pos): + d = name.tree_name.get_definition() + annassign = d.children[1] + if d.type == 'expr_stmt' and annassign.type == 'annassign': + if len(annassign.children) < 4: + default = None + else: + default = annassign.children[3] + param_names.append(DataclassParamName( + parent_context=cls.parent_context, + tree_name=name.tree_name, + annotation_node=annassign.children[1], + default_node=default, + )) + return [DataclassSignature(cls, param_names)] + + +class DataclassSignature(AbstractSignature): + def __init__(self, context, param_names): + super(DataclassSignature, self).__init__(context) + self._param_names = param_names + + def get_param_names(self, resolve_stars=False): + return self._param_names + + +class DataclassParamName(BaseTreeParamName): + def __init__(self, parent_context, tree_name, annotation_node, default_node): + super(DataclassParamName, self).__init__(parent_context, tree_name) + self.annotation_node = annotation_node + self.default_node = default_node + + def get_kind(self): + return Parameter.POSITIONAL_OR_KEYWORD + + def infer(self): + if self.annotation_node is None: + return NO_CONTEXTS + else: + return self.parent_context.eval_node(self.annotation_node) + + +class ItemGetterCallable(ContextWrapper): + def __init__(self, instance, args_context_set): + super(ItemGetterCallable, self).__init__(instance) + self._args_context_set = args_context_set + + @repack_with_argument_clinic('item, /') + def py__call__(self, item_context_set): + context_set = NO_CONTEXTS + for args_context in self._args_context_set: + lazy_contexts = list(args_context.py__iter__()) + if len(lazy_contexts) == 1: + # TODO we need to add the contextualized context. + context_set |= item_context_set.get_item(lazy_contexts[0].infer(), None) + else: + context_set |= ContextSet([iterable.FakeSequence( + self._wrapped_context.evaluator, + 'list', + [ + LazyKnownContexts(item_context_set.get_item(lazy_context.infer(), None)) + for lazy_context in lazy_contexts + ], + )]) + return context_set + + +@argument_clinic('func, /') +def _functools_wraps(funcs): + return ContextSet(WrapsCallable(func) for func in funcs) + + +class WrapsCallable(ContextWrapper): + # XXX this is not the correct wrapped context, it should be a weird + # partials object, but it doesn't matter, because it's always used as a + # decorator anyway. + @repack_with_argument_clinic('func, /') + def py__call__(self, funcs): + return ContextSet({Wrapped(func, self._wrapped_context) for func in funcs}) + + +class Wrapped(ContextWrapper, FunctionMixin): + def __init__(self, func, original_function): + super(Wrapped, self).__init__(func) + self._original_function = original_function + + @property + def name(self): + return self._original_function.name + + def get_signature_functions(self): + return [self] + + +@argument_clinic('*args, /', want_obj=True, want_arguments=True) +def _operator_itemgetter(args_context_set, obj, arguments): + return ContextSet([ + ItemGetterCallable(instance, args_context_set) + for instance in obj.py__call__(arguments) + ]) + + +def _create_string_input_function(func): + @argument_clinic('string, /', want_obj=True, want_arguments=True) + def wrapper(strings, obj, arguments): + def iterate(): + for context in strings: + s = get_str_or_none(context) + if s is not None: + s = func(s) + yield compiled.create_simple_object(context.evaluator, s) + contexts = ContextSet(iterate()) + if contexts: + return contexts + return obj.py__call__(arguments) + return wrapper + + +@argument_clinic('*args, /', want_callback=True) +def _os_path_join(args_set, callback): + if len(args_set) == 1: + string = u'' + sequence, = args_set + is_first = True + for lazy_context in sequence.py__iter__(): + string_contexts = lazy_context.infer() + if len(string_contexts) != 1: + break + s = get_str_or_none(next(iter(string_contexts))) + if s is None: + break + if not is_first: + string += os.path.sep + string += force_unicode(s) + is_first = False + else: + return ContextSet([compiled.create_simple_object(sequence.evaluator, string)]) + return callback() + + +_implemented = { + 'builtins': { + 'getattr': builtins_getattr, + 'type': builtins_type, + 'super': builtins_super, + 'reversed': builtins_reversed, + 'isinstance': builtins_isinstance, + 'next': builtins_next, + 'iter': builtins_iter, + 'staticmethod': builtins_staticmethod, + 'classmethod': builtins_classmethod, + }, + 'copy': { + 'copy': _return_first_param, + 'deepcopy': _return_first_param, + }, + 'json': { + 'load': lambda obj, arguments, callback: NO_CONTEXTS, + 'loads': lambda obj, arguments, callback: NO_CONTEXTS, + }, + 'collections': { + 'namedtuple': collections_namedtuple, + }, + 'functools': { + 'partial': functools_partial, + 'wraps': _functools_wraps, + }, + '_weakref': { + 'proxy': _return_first_param, + }, + 'random': { + 'choice': _random_choice, + }, + 'operator': { + 'itemgetter': _operator_itemgetter, + }, + 'abc': { + # Not sure if this is necessary, but it's used a lot in typeshed and + # it's for now easier to just pass the function. + 'abstractmethod': _return_first_param, + }, + 'typing': { + # The _alias function just leads to some annoying type inference. + # Therefore, just make it return nothing, which leads to the stubs + # being used instead. This only matters for 3.7+. + '_alias': lambda obj, arguments, callback: NO_CONTEXTS, + }, + 'dataclasses': { + # For now this works at least better than Jedi trying to understand it. + 'dataclass': _dataclass + }, + 'os.path': { + 'dirname': _create_string_input_function(os.path.dirname), + 'abspath': _create_string_input_function(os.path.abspath), + 'relpath': _create_string_input_function(os.path.relpath), + 'join': _os_path_join, + } +} + + +def get_metaclass_filters(func): + def wrapper(cls, metaclasses): + for metaclass in metaclasses: + if metaclass.py__name__() == 'EnumMeta' \ + and metaclass.get_root_context().py__name__() == 'enum': + filter_ = ParserTreeFilter(cls.evaluator, context=cls) + return [DictFilter({ + name.string_name: EnumInstance(cls, name).name for name in filter_.values() + })] + return func(cls, metaclasses) + return wrapper + + +class EnumInstance(LazyContextWrapper): + def __init__(self, cls, name): + self.evaluator = cls.evaluator + self._cls = cls # Corresponds to super().__self__ + self._name = name + self.tree_node = self._name.tree_name + + @safe_property + def name(self): + return ContextName(self, self._name.tree_name) + + def _get_wrapped_context(self): + obj, = self._cls.execute_evaluated() + return obj + + def get_filters(self, search_global=False, position=None, origin_scope=None): + yield DictFilter(dict( + name=compiled.create_simple_object(self.evaluator, self._name.string_name).name, + value=self._name, + )) + for f in self._get_wrapped_context().get_filters(): + yield f + + +def tree_name_to_contexts(func): + def wrapper(evaluator, context, tree_name): + if tree_name.value == 'sep' and context.is_module() and context.py__name__() == 'os.path': + return ContextSet({ + compiled.create_simple_object(evaluator, os.path.sep), + }) + return func(evaluator, context, tree_name) + return wrapper diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/refactoring.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/refactoring.py new file mode 100644 index 0000000..6c1d74d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/refactoring.py @@ -0,0 +1,203 @@ +""" +THIS is not in active development, please check +https://github.com/davidhalter/jedi/issues/667 first before editing. + +Introduce some basic refactoring functions to |jedi|. This module is still in a +very early development stage and needs much testing and improvement. + +.. warning:: I won't do too much here, but if anyone wants to step in, please + do. Refactoring is none of my priorities + +It uses the |jedi| `API `_ and supports currently the +following functions (sometimes bug-prone): + +- rename +- extract variable +- inline variable +""" +import difflib + +from parso import python_bytes_to_unicode, split_lines +from jedi.evaluate import helpers + + +class Refactoring(object): + def __init__(self, change_dct): + """ + :param change_dct: dict(old_path=(new_path, old_lines, new_lines)) + """ + self.change_dct = change_dct + + def old_files(self): + dct = {} + for old_path, (new_path, old_l, new_l) in self.change_dct.items(): + dct[old_path] = '\n'.join(old_l) + return dct + + def new_files(self): + dct = {} + for old_path, (new_path, old_l, new_l) in self.change_dct.items(): + dct[new_path] = '\n'.join(new_l) + return dct + + def diff(self): + texts = [] + for old_path, (new_path, old_l, new_l) in self.change_dct.items(): + if old_path: + udiff = difflib.unified_diff(old_l, new_l) + else: + udiff = difflib.unified_diff(old_l, new_l, old_path, new_path) + texts.append('\n'.join(udiff)) + return '\n'.join(texts) + + +def rename(script, new_name): + """ The `args` / `kwargs` params are the same as in `api.Script`. + :param new_name: The new name of the script. + :param script: The source Script object. + :return: list of changed lines/changed files + """ + return Refactoring(_rename(script.usages(), new_name)) + + +def _rename(names, replace_str): + """ For both rename and inline. """ + order = sorted(names, key=lambda x: (x.module_path, x.line, x.column), + reverse=True) + + def process(path, old_lines, new_lines): + if new_lines is not None: # goto next file, save last + dct[path] = path, old_lines, new_lines + + dct = {} + current_path = object() + new_lines = old_lines = None + for name in order: + if name.in_builtin_module(): + continue + if current_path != name.module_path: + current_path = name.module_path + + process(current_path, old_lines, new_lines) + if current_path is not None: + # None means take the source that is a normal param. + with open(current_path) as f: + source = f.read() + + new_lines = split_lines(python_bytes_to_unicode(source)) + old_lines = new_lines[:] + + nr, indent = name.line, name.column + line = new_lines[nr - 1] + new_lines[nr - 1] = line[:indent] + replace_str + \ + line[indent + len(name.name):] + process(current_path, old_lines, new_lines) + return dct + + +def extract(script, new_name): + """ The `args` / `kwargs` params are the same as in `api.Script`. + :param operation: The refactoring operation to execute. + :type operation: str + :type source: str + :return: list of changed lines/changed files + """ + new_lines = split_lines(python_bytes_to_unicode(script.source)) + old_lines = new_lines[:] + + user_stmt = script._parser.user_stmt() + + # TODO care for multi-line extracts + dct = {} + if user_stmt: + pos = script._pos + line_index = pos[0] - 1 + # Be careful here. 'array_for_pos' does not exist in 'helpers'. + arr, index = helpers.array_for_pos(user_stmt, pos) + if arr is not None: + start_pos = arr[index].start_pos + end_pos = arr[index].end_pos + + # take full line if the start line is different from end line + e = end_pos[1] if end_pos[0] == start_pos[0] else None + start_line = new_lines[start_pos[0] - 1] + text = start_line[start_pos[1]:e] + for l in range(start_pos[0], end_pos[0] - 1): + text += '\n' + str(l) + if e is None: + end_line = new_lines[end_pos[0] - 1] + text += '\n' + end_line[:end_pos[1]] + + # remove code from new lines + t = text.lstrip() + del_start = start_pos[1] + len(text) - len(t) + + text = t.rstrip() + del_end = len(t) - len(text) + if e is None: + new_lines[end_pos[0] - 1] = end_line[end_pos[1] - del_end:] + e = len(start_line) + else: + e = e - del_end + start_line = start_line[:del_start] + new_name + start_line[e:] + new_lines[start_pos[0] - 1] = start_line + new_lines[start_pos[0]:end_pos[0] - 1] = [] + + # add parentheses in multi-line case + open_brackets = ['(', '[', '{'] + close_brackets = [')', ']', '}'] + if '\n' in text and not (text[0] in open_brackets and text[-1] == + close_brackets[open_brackets.index(text[0])]): + text = '(%s)' % text + + # add new line before statement + indent = user_stmt.start_pos[1] + new = "%s%s = %s" % (' ' * indent, new_name, text) + new_lines.insert(line_index, new) + dct[script.path] = script.path, old_lines, new_lines + return Refactoring(dct) + + +def inline(script): + """ + :type script: api.Script + """ + new_lines = split_lines(python_bytes_to_unicode(script.source)) + + dct = {} + + definitions = script.goto_assignments() + assert len(definitions) == 1 + stmt = definitions[0]._definition + usages = script.usages() + inlines = [r for r in usages + if not stmt.start_pos <= (r.line, r.column) <= stmt.end_pos] + inlines = sorted(inlines, key=lambda x: (x.module_path, x.line, x.column), + reverse=True) + expression_list = stmt.expression_list() + # don't allow multi-line refactorings for now. + assert stmt.start_pos[0] == stmt.end_pos[0] + index = stmt.start_pos[0] - 1 + + line = new_lines[index] + replace_str = line[expression_list[0].start_pos[1]:stmt.end_pos[1] + 1] + replace_str = replace_str.strip() + # tuples need parentheses + if expression_list and isinstance(expression_list[0], pr.Array): + arr = expression_list[0] + if replace_str[0] not in ['(', '[', '{'] and len(arr) > 1: + replace_str = '(%s)' % replace_str + + # if it's the only assignment, remove the statement + if len(stmt.get_defined_names()) == 1: + line = line[:stmt.start_pos[1]] + line[stmt.end_pos[1]:] + + dct = _rename(inlines, replace_str) + # remove the empty line + new_lines = dct[script.path][2] + if line.strip(): + new_lines[index] = line + else: + new_lines.pop(index) + + return Refactoring(dct) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/settings.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/settings.py new file mode 100644 index 0000000..7b7de1b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/settings.py @@ -0,0 +1,163 @@ +""" +This module contains variables with global |jedi| settings. To change the +behavior of |jedi|, change the variables defined in :mod:`jedi.settings`. + +Plugins should expose an interface so that the user can adjust the +configuration. + + +Example usage:: + + from jedi import settings + settings.case_insensitive_completion = True + + +Completion output +~~~~~~~~~~~~~~~~~ + +.. autodata:: case_insensitive_completion +.. autodata:: add_bracket_after_function +.. autodata:: no_completion_duplicates + + +Filesystem cache +~~~~~~~~~~~~~~~~ + +.. autodata:: cache_directory +.. autodata:: use_filesystem_cache + + +Parser +~~~~~~ + +.. autodata:: fast_parser + + +Dynamic stuff +~~~~~~~~~~~~~ + +.. autodata:: dynamic_array_additions +.. autodata:: dynamic_params +.. autodata:: dynamic_params_for_other_modules +.. autodata:: additional_dynamic_modules +.. autodata:: auto_import_modules + + +Caching +~~~~~~~ + +.. autodata:: call_signatures_validity + + +""" +import os +import platform + +# ---------------- +# completion output settings +# ---------------- + +case_insensitive_completion = True +""" +The completion is by default case insensitive. +""" + +add_bracket_after_function = False +""" +Adds an opening bracket after a function, because that's normal behaviour. +Removed it again, because in VIM that is not very practical. +""" + +no_completion_duplicates = True +""" +If set, completions with the same name don't appear in the output anymore, +but are in the `same_name_completions` attribute. +""" + +# ---------------- +# Filesystem cache +# ---------------- + +use_filesystem_cache = True +""" +Use filesystem cache to save once parsed files with pickle. +""" + +if platform.system().lower() == 'windows': + _cache_directory = os.path.join(os.getenv('APPDATA') or '~', 'Jedi', + 'Jedi') +elif platform.system().lower() == 'darwin': + _cache_directory = os.path.join('~', 'Library', 'Caches', 'Jedi') +else: + _cache_directory = os.path.join(os.getenv('XDG_CACHE_HOME') or '~/.cache', + 'jedi') +cache_directory = os.path.expanduser(_cache_directory) +""" +The path where the cache is stored. + +On Linux, this defaults to ``~/.cache/jedi/``, on OS X to +``~/Library/Caches/Jedi/`` and on Windows to ``%APPDATA%\\Jedi\\Jedi\\``. +On Linux, if environment variable ``$XDG_CACHE_HOME`` is set, +``$XDG_CACHE_HOME/jedi`` is used instead of the default one. +""" + +# ---------------- +# parser +# ---------------- + +fast_parser = True +""" +Use the fast parser. This means that reparsing is only being done if +something has been changed e.g. to a function. If this happens, only the +function is being reparsed. +""" + +# ---------------- +# dynamic stuff +# ---------------- + +dynamic_array_additions = True +""" +check for `append`, etc. on arrays: [], {}, () as well as list/set calls. +""" + +dynamic_params = True +""" +A dynamic param completion, finds the callees of the function, which define +the params of a function. +""" + +dynamic_params_for_other_modules = True +""" +Do the same for other modules. +""" + +additional_dynamic_modules = [] +""" +Additional modules in which |jedi| checks if statements are to be found. This +is practical for IDEs, that want to administrate their modules themselves. +""" + +dynamic_flow_information = True +""" +Check for `isinstance` and other information to infer a type. +""" + +auto_import_modules = [ + 'gi', # This third-party repository (GTK stuff) doesn't really work with jedi +] +""" +Modules that are not analyzed but imported, although they contain Python code. +This improves autocompletion for libraries that use ``setattr`` or +``globals()`` modifications a lot. +""" + +# ---------------- +# caching validity (time) +# ---------------- + +call_signatures_validity = 3.0 +""" +Finding function calls might be slow (0.1-0.5s). This is not acceptible for +normal writing. Therefore cache it for a short time. +""" diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/LICENSE b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/LICENSE new file mode 100644 index 0000000..e5833ae --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/LICENSE @@ -0,0 +1,238 @@ +The "typeshed" project is licensed under the terms of the Apache license, as +reproduced below. + += = = = = + +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + 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. + += = = = = + +Parts of typeshed are licensed under different licenses (like the MIT +license), reproduced below. + += = = = = + +The MIT License + +Copyright (c) 2015 Jukka Lehtosalo and contributors + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + += = = = = + diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/BaseHTTPServer.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/BaseHTTPServer.pyi new file mode 100644 index 0000000..1f9d2ce --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/BaseHTTPServer.pyi @@ -0,0 +1,47 @@ +# Stubs for BaseHTTPServer (Python 2.7) + +from typing import Any, BinaryIO, Mapping, Optional, Tuple, Union +import SocketServer +import mimetools + +class HTTPServer(SocketServer.TCPServer): + server_name: str + server_port: int + def __init__(self, server_address: Tuple[str, int], + RequestHandlerClass: type) -> None: ... + +class BaseHTTPRequestHandler: + client_address: Tuple[str, int] + server: SocketServer.BaseServer + close_connection: bool + command: str + path: str + request_version: str + headers: mimetools.Message + rfile: BinaryIO + wfile: BinaryIO + server_version: str + sys_version: str + error_message_format: str + error_content_type: str + protocol_version: str + MessageClass: type + responses: Mapping[int, Tuple[str, str]] + def __init__(self, request: bytes, client_address: Tuple[str, int], + server: SocketServer.BaseServer) -> None: ... + def handle(self) -> None: ... + def handle_one_request(self) -> None: ... + def send_error(self, code: int, message: Optional[str] = ...) -> None: ... + def send_response(self, code: int, + message: Optional[str] = ...) -> None: ... + def send_header(self, keyword: str, value: str) -> None: ... + def end_headers(self) -> None: ... + def flush_headers(self) -> None: ... + def log_request(self, code: Union[int, str] = ..., + size: Union[int, str] = ...) -> None: ... + def log_error(self, format: str, *args: Any) -> None: ... + def log_message(self, format: str, *args: Any) -> None: ... + def version_string(self) -> str: ... + def date_time_string(self, timestamp: Optional[int] = ...) -> str: ... + def log_date_time_string(self) -> str: ... + def address_string(self) -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/ConfigParser.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/ConfigParser.pyi new file mode 100644 index 0000000..5d86811 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/ConfigParser.pyi @@ -0,0 +1,97 @@ +from typing import Any, IO, Sequence, Tuple, Union, List, Dict, Protocol, Optional + +DEFAULTSECT: str +MAX_INTERPOLATION_DEPTH: int + +class Error(Exception): + message: Any + def __init__(self, msg: str = ...) -> None: ... + def _get_message(self) -> None: ... + def _set_message(self, value: str) -> None: ... + def __repr__(self) -> str: ... + def __str__(self) -> str: ... + +class NoSectionError(Error): + section: str + def __init__(self, section: str) -> None: ... + +class DuplicateSectionError(Error): + section: str + def __init__(self, section: str) -> None: ... + +class NoOptionError(Error): + section: str + option: str + def __init__(self, option: str, section: str) -> None: ... + +class InterpolationError(Error): + section: str + option: str + msg: str + def __init__(self, option: str, section: str, msg: str) -> None: ... + +class InterpolationMissingOptionError(InterpolationError): + reference: str + def __init__(self, option: str, section: str, rawval: str, reference: str) -> None: ... + +class InterpolationSyntaxError(InterpolationError): ... + +class InterpolationDepthError(InterpolationError): + def __init__(self, option: str, section: str, rawval: str) -> None: ... + +class ParsingError(Error): + filename: str + errors: List[Tuple[Any, Any]] + def __init__(self, filename: str) -> None: ... + def append(self, lineno: Any, line: Any) -> None: ... + +class MissingSectionHeaderError(ParsingError): + lineno: Any + line: Any + def __init__(self, filename: str, lineno: Any, line: Any) -> None: ... + +class _Readable(Protocol): + def readline(self) -> str: ... + +class RawConfigParser: + _dict: Any + _sections: dict + _defaults: dict + _optcre: Any + SECTCRE: Any + OPTCRE: Any + OPTCRE_NV: Any + def __init__(self, defaults: Dict[Any, Any] = ..., dict_type: Any = ..., allow_no_value: bool = ...) -> None: ... + def defaults(self) -> Dict[Any, Any]: ... + def sections(self) -> List[str]: ... + def add_section(self, section: str) -> None: ... + def has_section(self, section: str) -> bool: ... + def options(self, section: str) -> List[str]: ... + def read(self, filenames: Union[str, Sequence[str]]) -> List[str]: ... + def readfp(self, fp: _Readable, filename: str = ...) -> None: ... + def get(self, section: str, option: str) -> str: ... + def items(self, section: str) -> List[Tuple[Any, Any]]: ... + def _get(self, section: str, conv: type, option: str) -> Any: ... + def getint(self, section: str, option: str) -> int: ... + def getfloat(self, section: str, option: str) -> float: ... + _boolean_states: Dict[str, bool] + def getboolean(self, section: str, option: str) -> bool: ... + def optionxform(self, optionstr: str) -> str: ... + def has_option(self, section: str, option: str) -> bool: ... + def set(self, section: str, option: str, value: Any = ...) -> None: ... + def write(self, fp: IO[str]) -> None: ... + def remove_option(self, section: str, option: Any) -> bool: ... + def remove_section(self, section: str) -> bool: ... + def _read(self, fp: IO[str], fpname: str) -> None: ... + +class ConfigParser(RawConfigParser): + _KEYCRE: Any + def get(self, section: str, option: str, raw: bool = ..., vars: Optional[dict] = ...) -> Any: ... + def items(self, section: str, raw: bool = ..., vars: Optional[dict] = ...) -> List[Tuple[str, Any]]: ... + def _interpolate(self, section: str, option: str, rawval: Any, vars: Any) -> str: ... + def _interpolation_replace(self, match: Any) -> str: ... + +class SafeConfigParser(ConfigParser): + _interpvar_re: Any + def _interpolate(self, section: str, option: str, rawval: Any, vars: Any) -> str: ... + def _interpolate_some(self, option: str, accum: list, rest: str, section: str, map: dict, depth: int) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/Cookie.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/Cookie.pyi new file mode 100644 index 0000000..79a7a81 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/Cookie.pyi @@ -0,0 +1,40 @@ +from typing import Any, Optional + +class CookieError(Exception): ... + +class Morsel(dict): + key: Any + def __init__(self): ... + def __setitem__(self, K, V): ... + def isReservedKey(self, K): ... + value: Any + coded_value: Any + def set(self, key, val, coded_val, LegalChars=..., idmap=..., translate=...): ... + def output(self, attrs: Optional[Any] = ..., header=...): ... + def js_output(self, attrs: Optional[Any] = ...): ... + def OutputString(self, attrs: Optional[Any] = ...): ... + +class BaseCookie(dict): + def value_decode(self, val): ... + def value_encode(self, val): ... + def __init__(self, input: Optional[Any] = ...): ... + def __setitem__(self, key, value): ... + def output(self, attrs: Optional[Any] = ..., header=..., sep=...): ... + def js_output(self, attrs: Optional[Any] = ...): ... + def load(self, rawdata): ... + +class SimpleCookie(BaseCookie): + def value_decode(self, val): ... + def value_encode(self, val): ... + +class SerialCookie(BaseCookie): + def __init__(self, input: Optional[Any] = ...): ... + def value_decode(self, val): ... + def value_encode(self, val): ... + +class SmartCookie(BaseCookie): + def __init__(self, input: Optional[Any] = ...): ... + def value_decode(self, val): ... + def value_encode(self, val): ... + +Cookie: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/HTMLParser.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/HTMLParser.pyi new file mode 100644 index 0000000..0f6c7e3 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/HTMLParser.pyi @@ -0,0 +1,31 @@ +from typing import List, Tuple, AnyStr +from markupbase import ParserBase + +class HTMLParser(ParserBase): + def __init__(self) -> None: ... + def feed(self, feed: AnyStr) -> None: ... + def close(self) -> None: ... + def reset(self) -> None: ... + + def get_starttag_text(self) -> AnyStr: ... + def set_cdata_mode(self, AnyStr) -> None: ... + def clear_cdata_mode(self) -> None: ... + + def handle_startendtag(self, tag: AnyStr, attrs: List[Tuple[AnyStr, AnyStr]]): ... + def handle_starttag(self, tag: AnyStr, attrs: List[Tuple[AnyStr, AnyStr]]): ... + def handle_endtag(self, tag: AnyStr): ... + def handle_charref(self, name: AnyStr): ... + def handle_entityref(self, name: AnyStr): ... + def handle_data(self, data: AnyStr): ... + def handle_comment(self, data: AnyStr): ... + def handle_decl(self, decl: AnyStr): ... + def handle_pi(self, data: AnyStr): ... + + def unknown_decl(self, data: AnyStr): ... + + def unescape(self, s: AnyStr) -> AnyStr: ... + +class HTMLParseError(Exception): + msg: str + lineno: int + offset: int diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/Queue.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/Queue.pyi new file mode 100644 index 0000000..11b01ed --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/Queue.pyi @@ -0,0 +1,31 @@ +# Stubs for Queue (Python 2) + +from collections import deque +from typing import Any, TypeVar, Generic, Optional + +_T = TypeVar('_T') + +class Empty(Exception): ... +class Full(Exception): ... + +class Queue(Generic[_T]): + maxsize: Any + mutex: Any + not_empty: Any + not_full: Any + all_tasks_done: Any + unfinished_tasks: Any + queue: deque # undocumented + def __init__(self, maxsize: int = ...) -> None: ... + def task_done(self) -> None: ... + def join(self) -> None: ... + def qsize(self) -> int: ... + def empty(self) -> bool: ... + def full(self) -> bool: ... + def put(self, item: _T, block: bool = ..., timeout: Optional[float] = ...) -> None: ... + def put_nowait(self, item: _T) -> None: ... + def get(self, block: bool = ..., timeout: Optional[float] = ...) -> _T: ... + def get_nowait(self) -> _T: ... + +class PriorityQueue(Queue): ... +class LifoQueue(Queue): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/SimpleHTTPServer.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/SimpleHTTPServer.pyi new file mode 100644 index 0000000..be22b88 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/SimpleHTTPServer.pyi @@ -0,0 +1,16 @@ +# Stubs for SimpleHTTPServer (Python 2) + +from typing import Any, AnyStr, IO, Mapping, Optional, Union +import BaseHTTPServer +from StringIO import StringIO + +class SimpleHTTPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler): + server_version: str + def do_GET(self) -> None: ... + def do_HEAD(self) -> None: ... + def send_head(self) -> Optional[IO[str]]: ... + def list_directory(self, path: Union[str, unicode]) -> Optional[StringIO]: ... + def translate_path(self, path: AnyStr) -> AnyStr: ... + def copyfile(self, source: IO[AnyStr], outputfile: IO[AnyStr]): ... + def guess_type(self, path: Union[str, unicode]) -> str: ... + extensions_map: Mapping[str, str] diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/SocketServer.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/SocketServer.pyi new file mode 100644 index 0000000..d485b8b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/SocketServer.pyi @@ -0,0 +1,99 @@ +# NB: SocketServer.pyi and socketserver.pyi must remain consistent! +# Stubs for socketserver + +from typing import Any, BinaryIO, Optional, Tuple, Type +from socket import SocketType +import sys +import types + +class BaseServer: + address_family: int + RequestHandlerClass: type + server_address: Tuple[str, int] + socket: SocketType + allow_reuse_address: bool + request_queue_size: int + socket_type: int + timeout: Optional[float] + def __init__(self, server_address: Tuple[str, int], + RequestHandlerClass: type) -> None: ... + def fileno(self) -> int: ... + def handle_request(self) -> None: ... + def serve_forever(self, poll_interval: float = ...) -> None: ... + def shutdown(self) -> None: ... + def server_close(self) -> None: ... + def finish_request(self, request: bytes, + client_address: Tuple[str, int]) -> None: ... + def get_request(self) -> None: ... + def handle_error(self, request: bytes, + client_address: Tuple[str, int]) -> None: ... + def handle_timeout(self) -> None: ... + def process_request(self, request: bytes, + client_address: Tuple[str, int]) -> None: ... + def server_activate(self) -> None: ... + def server_bind(self) -> None: ... + def verify_request(self, request: bytes, + client_address: Tuple[str, int]) -> bool: ... + if sys.version_info >= (3, 6): + def __enter__(self) -> BaseServer: ... + def __exit__(self, exc_type: Optional[Type[BaseException]], + exc_val: Optional[BaseException], + exc_tb: Optional[types.TracebackType]) -> bool: ... + if sys.version_info >= (3, 3): + def service_actions(self) -> None: ... + +class TCPServer(BaseServer): + def __init__(self, server_address: Tuple[str, int], + RequestHandlerClass: type, + bind_and_activate: bool = ...) -> None: ... + +class UDPServer(BaseServer): + def __init__(self, server_address: Tuple[str, int], + RequestHandlerClass: type, + bind_and_activate: bool = ...) -> None: ... + +if sys.platform != 'win32': + class UnixStreamServer(BaseServer): + def __init__(self, server_address: Tuple[str, int], + RequestHandlerClass: type, + bind_and_activate: bool = ...) -> None: ... + + class UnixDatagramServer(BaseServer): + def __init__(self, server_address: Tuple[str, int], + RequestHandlerClass: type, + bind_and_activate: bool = ...) -> None: ... + +class ForkingMixIn: ... +class ThreadingMixIn: ... + +class ForkingTCPServer(ForkingMixIn, TCPServer): ... +class ForkingUDPServer(ForkingMixIn, UDPServer): ... +class ThreadingTCPServer(ThreadingMixIn, TCPServer): ... +class ThreadingUDPServer(ThreadingMixIn, UDPServer): ... +if sys.platform != 'win32': + class ThreadingUnixStreamServer(ThreadingMixIn, UnixStreamServer): ... + class ThreadingUnixDatagramServer(ThreadingMixIn, UnixDatagramServer): ... + + +class BaseRequestHandler: + # Those are technically of types, respectively: + # * Union[SocketType, Tuple[bytes, SocketType]] + # * Union[Tuple[str, int], str] + # But there are some concerns that having unions here would cause + # too much inconvenience to people using it (see + # https://github.com/python/typeshed/pull/384#issuecomment-234649696) + request: Any + client_address: Any + + server: BaseServer + def setup(self) -> None: ... + def handle(self) -> None: ... + def finish(self) -> None: ... + +class StreamRequestHandler(BaseRequestHandler): + rfile: BinaryIO + wfile: BinaryIO + +class DatagramRequestHandler(BaseRequestHandler): + rfile: BinaryIO + wfile: BinaryIO diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/StringIO.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/StringIO.pyi new file mode 100644 index 0000000..de17f6a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/StringIO.pyi @@ -0,0 +1,30 @@ +# Stubs for StringIO (Python 2) + +from typing import Any, IO, AnyStr, Iterator, Iterable, Generic, List, Optional + +class StringIO(IO[AnyStr], Generic[AnyStr]): + closed: bool + softspace: int + len: int + name: str + def __init__(self, buf: AnyStr = ...) -> None: ... + def __iter__(self) -> Iterator[AnyStr]: ... + def next(self) -> AnyStr: ... + def close(self) -> None: ... + def isatty(self) -> bool: ... + def seek(self, pos: int, mode: int = ...) -> int: ... + def tell(self) -> int: ... + def read(self, n: int = ...) -> AnyStr: ... + def readline(self, length: int = ...) -> AnyStr: ... + def readlines(self, sizehint: int = ...) -> List[AnyStr]: ... + def truncate(self, size: Optional[int] = ...) -> int: ... + def write(self, s: AnyStr) -> int: ... + def writelines(self, iterable: Iterable[AnyStr]) -> None: ... + def flush(self) -> None: ... + def getvalue(self) -> AnyStr: ... + def __enter__(self) -> Any: ... + def __exit__(self, type: Any, value: Any, traceback: Any) -> Any: ... + def fileno(self) -> int: ... + def readable(self) -> bool: ... + def seekable(self) -> bool: ... + def writable(self) -> bool: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/UserDict.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/UserDict.pyi new file mode 100644 index 0000000..965e88e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/UserDict.pyi @@ -0,0 +1,44 @@ +from typing import (Any, Container, Dict, Generic, Iterable, Iterator, List, + Mapping, Optional, Sized, Tuple, TypeVar, Union, overload) + +_KT = TypeVar('_KT') +_VT = TypeVar('_VT') +_T = TypeVar('_T') + +class UserDict(Dict[_KT, _VT], Generic[_KT, _VT]): + data: Mapping[_KT, _VT] + + def __init__(self, initialdata: Mapping[_KT, _VT] = ...) -> None: ... + + # TODO: __iter__ is not available for UserDict + +class IterableUserDict(UserDict[_KT, _VT], Generic[_KT, _VT]): + ... + +class DictMixin(Iterable[_KT], Container[_KT], Sized, Generic[_KT, _VT]): + def has_key(self, key: _KT) -> bool: ... + def __len__(self) -> int: ... + def __iter__(self) -> Iterator[_KT]: ... + + # From typing.Mapping[_KT, _VT] + # (can't inherit because of keys()) + @overload + def get(self, k: _KT) -> Optional[_VT]: ... + @overload + def get(self, k: _KT, default: Union[_VT, _T]) -> Union[_VT, _T]: ... + def values(self) -> List[_VT]: ... + def items(self) -> List[Tuple[_KT, _VT]]: ... + def iterkeys(self) -> Iterator[_KT]: ... + def itervalues(self) -> Iterator[_VT]: ... + def iteritems(self) -> Iterator[Tuple[_KT, _VT]]: ... + def __contains__(self, o: Any) -> bool: ... + + # From typing.MutableMapping[_KT, _VT] + def clear(self) -> None: ... + def pop(self, k: _KT, default: _VT = ...) -> _VT: ... + def popitem(self) -> Tuple[_KT, _VT]: ... + def setdefault(self, k: _KT, default: _VT = ...) -> _VT: ... + @overload + def update(self, m: Mapping[_KT, _VT], **kwargs: _VT) -> None: ... + @overload + def update(self, m: Iterable[Tuple[_KT, _VT]], **kwargs: _VT) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/UserList.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/UserList.pyi new file mode 100644 index 0000000..b8466ee --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/UserList.pyi @@ -0,0 +1,18 @@ +from typing import Iterable, MutableSequence, TypeVar, Union, overload + +_T = TypeVar("_T") +_ULT = TypeVar("_ULT", bound=UserList) + +class UserList(MutableSequence[_T]): + def insert(self, index: int, object: _T) -> None: ... + @overload + def __setitem__(self, i: int, o: _T) -> None: ... + @overload + def __setitem__(self, s: slice, o: Iterable[_T]) -> None: ... + def __delitem__(self, i: Union[int, slice]) -> None: ... + def __len__(self) -> int: ... + @overload + def __getitem__(self, i: int) -> _T: ... + @overload + def __getitem__(self: _ULT, s: slice) -> _ULT: ... + def sort(self) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/UserString.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/UserString.pyi new file mode 100644 index 0000000..8cbbfc1 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/UserString.pyi @@ -0,0 +1,75 @@ +import collections +from typing import Any, Iterable, List, MutableSequence, Sequence, Optional, overload, Text, TypeVar, Tuple, Union + +_UST = TypeVar("_UST", bound=UserString) +_MST = TypeVar("_MST", bound=MutableString) + +class UserString(Sequence[UserString]): + data: unicode + def __init__(self, seq: object) -> None: ... + def __int__(self) -> int: ... + def __long__(self) -> long: ... + def __float__(self) -> float: ... + def __complex__(self) -> complex: ... + def __hash__(self) -> int: ... + def __len__(self) -> int: ... + @overload + def __getitem__(self: _UST, i: int) -> _UST: ... + @overload + def __getitem__(self: _UST, s: slice) -> _UST: ... + def __add__(self: _UST, other: Any) -> _UST: ... + def __radd__(self: _UST, other: Any) -> _UST: ... + def __mul__(self: _UST, other: int) -> _UST: ... + def __rmul__(self: _UST, other: int) -> _UST: ... + def __mod__(self: _UST, args: Any) -> _UST: ... + def capitalize(self: _UST) -> _UST: ... + def center(self: _UST, width: int, *args: Any) -> _UST: ... + def count(self, sub: int, start: int = ..., end: int = ...) -> int: ... + def decode(self: _UST, encoding: Optional[str] = ..., errors: Optional[str] = ...) -> _UST: ... + def encode(self: _UST, encoding: Optional[str] = ..., errors: Optional[str] = ...) -> _UST: ... + def endswith(self, suffix: Text, start: int = ..., end: int = ...) -> bool: ... + def expandtabs(self: _UST, tabsize: int = ...) -> _UST: ... + def find(self, sub: Text, start: int = ..., end: int = ...) -> int: ... + def index(self, sub: Text, start: int = ..., end: int = ...) -> int: ... + def isalpha(self) -> bool: ... + def isalnum(self) -> bool: ... + def isdecimal(self) -> bool: ... + def isdigit(self) -> bool: ... + def islower(self) -> bool: ... + def isnumeric(self) -> bool: ... + def isspace(self) -> bool: ... + def istitle(self) -> bool: ... + def isupper(self) -> bool: ... + def join(self, seq: Iterable[Text]) -> Text: ... + def ljust(self: _UST, width: int, *args: Any) -> _UST: ... + def lower(self: _UST) -> _UST: ... + def lstrip(self: _UST, chars: Optional[Text] = ...) -> _UST: ... + def partition(self, sep: Text) -> Tuple[Text, Text, Text]: ... + def replace(self: _UST, old: Text, new: Text, maxsplit: int = ...) -> _UST: ... + def rfind(self, sub: Text, start: int = ..., end: int = ...) -> int: ... + def rindex(self, sub: Text, start: int = ..., end: int = ...) -> int: ... + def rjust(self: _UST, width: int, *args: Any) -> _UST: ... + def rpartition(self, sep: Text) -> Tuple[Text, Text, Text]: ... + def rstrip(self: _UST, chars: Optional[Text] = ...) -> _UST: ... + def split(self, sep: Optional[Text] = ..., maxsplit: int = ...) -> List[Text]: ... + def rsplit(self, sep: Optional[Text] = ..., maxsplit: int = ...) -> List[Text]: ... + def splitlines(self, keepends: int = ...) -> List[Text]: ... + def startswith(self, suffix: Text, start: int = ..., end: int = ...) -> bool: ... + def strip(self: _UST, chars: Optional[Text] = ...) -> _UST: ... + def swapcase(self: _UST) -> _UST: ... + def title(self: _UST) -> _UST: ... + def translate(self: _UST, *args: Any) -> _UST: ... + def upper(self: _UST) -> _UST: ... + def zfill(self: _UST, width: int) -> _UST: ... + +class MutableString(UserString, MutableSequence[MutableString]): # type: ignore + @overload + def __getitem__(self: _MST, i: int) -> _MST: ... + @overload + def __getitem__(self: _MST, s: slice) -> _MST: ... + def __setitem__(self, index: Union[int, slice], sub: Any) -> None: ... + def __delitem__(self, index: Union[int, slice]) -> None: ... + def immutable(self) -> UserString: ... + def __iadd__(self: _MST, other: Any) -> _MST: ... + def __imul__(self, n: int) -> _MST: ... + def insert(self, index: int, value: Any) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/__builtin__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/__builtin__.pyi new file mode 100644 index 0000000..cca0e4f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/__builtin__.pyi @@ -0,0 +1,1622 @@ +# True and False are deliberately omitted because they are keywords in +# Python 3, and stub files conform to Python 3 syntax. + +from typing import ( + TypeVar, Iterator, Iterable, NoReturn, overload, Container, + Sequence, MutableSequence, Mapping, MutableMapping, Tuple, List, Any, Dict, Callable, Generic, + Set, AbstractSet, FrozenSet, MutableSet, Sized, Reversible, SupportsInt, SupportsFloat, SupportsAbs, + SupportsComplex, IO, BinaryIO, Union, + ItemsView, KeysView, ValuesView, ByteString, Optional, AnyStr, Type, Text, + Protocol, +) +from abc import abstractmethod, ABCMeta +from ast import mod, AST +from types import TracebackType, CodeType +import sys + +if sys.version_info >= (3,): + from typing import SupportsBytes, SupportsRound + +_T = TypeVar('_T') +_T_co = TypeVar('_T_co', covariant=True) +_KT = TypeVar('_KT') +_VT = TypeVar('_VT') +_S = TypeVar('_S') +_T1 = TypeVar('_T1') +_T2 = TypeVar('_T2') +_T3 = TypeVar('_T3') +_T4 = TypeVar('_T4') +_T5 = TypeVar('_T5') +_TT = TypeVar('_TT', bound='type') + +class object: + __doc__: Optional[str] + __dict__: Dict[str, Any] + __slots__: Union[Text, Iterable[Text]] + __module__: str + if sys.version_info >= (3, 6): + __annotations__: Dict[str, Any] + + @property + def __class__(self: _T) -> Type[_T]: ... + @__class__.setter + def __class__(self, __type: Type[object]) -> None: ... + def __init__(self) -> None: ... + def __new__(cls) -> Any: ... + def __setattr__(self, name: str, value: Any) -> None: ... + def __eq__(self, o: object) -> bool: ... + def __ne__(self, o: object) -> bool: ... + def __str__(self) -> str: ... + def __repr__(self) -> str: ... + def __hash__(self) -> int: ... + def __format__(self, format_spec: str) -> str: ... + def __getattribute__(self, name: str) -> Any: ... + def __delattr__(self, name: str) -> None: ... + def __sizeof__(self) -> int: ... + def __reduce__(self) -> tuple: ... + def __reduce_ex__(self, protocol: int) -> tuple: ... + if sys.version_info >= (3,): + def __dir__(self) -> Iterable[str]: ... + if sys.version_info >= (3, 6): + def __init_subclass__(cls) -> None: ... + +class staticmethod(object): # Special, only valid as a decorator. + __func__: Callable + if sys.version_info >= (3,): + __isabstractmethod__: bool + + def __init__(self, f: Callable) -> None: ... + def __new__(cls: Type[_T], *args: Any, **kwargs: Any) -> _T: ... + def __get__(self, obj: _T, type: Optional[Type[_T]] = ...) -> Callable: ... + +class classmethod(object): # Special, only valid as a decorator. + __func__: Callable + if sys.version_info >= (3,): + __isabstractmethod__: bool + + def __init__(self, f: Callable) -> None: ... + def __new__(cls: Type[_T], *args: Any, **kwargs: Any) -> _T: ... + def __get__(self, obj: _T, type: Optional[Type[_T]] = ...) -> Callable: ... + +class type(object): + __base__: type + __bases__: Tuple[type, ...] + __basicsize__: int + __dict__: Dict[str, Any] + __dictoffset__: int + __flags__: int + __itemsize__: int + __module__: str + __mro__: Tuple[type, ...] + __name__: str + if sys.version_info >= (3,): + __qualname__: str + __text_signature__: Optional[str] + __weakrefoffset__: int + + @overload + def __init__(self, o: object) -> None: ... + @overload + def __init__(self, name: str, bases: Tuple[type, ...], dict: Dict[str, Any]) -> None: ... + @overload + def __new__(cls, o: object) -> type: ... + @overload + def __new__(cls, name: str, bases: Tuple[type, ...], namespace: Dict[str, Any]) -> type: ... + def __call__(self, *args: Any, **kwds: Any) -> Any: ... + def __subclasses__(self: _TT) -> List[_TT]: ... + # Note: the documentation doesnt specify what the return type is, the standard + # implementation seems to be returning a list. + def mro(self) -> List[type]: ... + def __instancecheck__(self, instance: Any) -> bool: ... + def __subclasscheck__(self, subclass: type) -> bool: ... + if sys.version_info >= (3,): + @classmethod + def __prepare__(metacls, __name: str, __bases: Tuple[type, ...], **kwds: Any) -> Mapping[str, Any]: ... + +class super(object): + if sys.version_info >= (3,): + @overload + def __init__(self, t: Any, obj: Any) -> None: ... + @overload + def __init__(self, t: Any) -> None: ... + @overload + def __init__(self) -> None: ... + else: + @overload + def __init__(self, t: Any, obj: Any) -> None: ... + @overload + def __init__(self, t: Any) -> None: ... + +class int: + @overload + def __init__(self, x: Union[Text, bytes, SupportsInt] = ...) -> None: ... + @overload + def __init__(self, x: Union[Text, bytes, bytearray], base: int) -> None: ... + + @property + def real(self) -> int: ... + @property + def imag(self) -> int: ... + @property + def numerator(self) -> int: ... + @property + def denominator(self) -> int: ... + def conjugate(self) -> int: ... + + def bit_length(self) -> int: ... + if sys.version_info >= (3,): + def to_bytes(self, length: int, byteorder: str, *, signed: bool = ...) -> bytes: ... + @classmethod + def from_bytes(cls, bytes: Sequence[int], byteorder: str, *, + signed: bool = ...) -> int: ... # TODO buffer object argument + + def __add__(self, x: int) -> int: ... + def __sub__(self, x: int) -> int: ... + def __mul__(self, x: int) -> int: ... + def __floordiv__(self, x: int) -> int: ... + if sys.version_info < (3,): + def __div__(self, x: int) -> int: ... + def __truediv__(self, x: int) -> float: ... + def __mod__(self, x: int) -> int: ... + def __divmod__(self, x: int) -> Tuple[int, int]: ... + def __radd__(self, x: int) -> int: ... + def __rsub__(self, x: int) -> int: ... + def __rmul__(self, x: int) -> int: ... + def __rfloordiv__(self, x: int) -> int: ... + if sys.version_info < (3,): + def __rdiv__(self, x: int) -> int: ... + def __rtruediv__(self, x: int) -> float: ... + def __rmod__(self, x: int) -> int: ... + def __rdivmod__(self, x: int) -> Tuple[int, int]: ... + def __pow__(self, x: int) -> Any: ... # Return type can be int or float, depending on x. + def __rpow__(self, x: int) -> Any: ... + def __and__(self, n: int) -> int: ... + def __or__(self, n: int) -> int: ... + def __xor__(self, n: int) -> int: ... + def __lshift__(self, n: int) -> int: ... + def __rshift__(self, n: int) -> int: ... + def __rand__(self, n: int) -> int: ... + def __ror__(self, n: int) -> int: ... + def __rxor__(self, n: int) -> int: ... + def __rlshift__(self, n: int) -> int: ... + def __rrshift__(self, n: int) -> int: ... + def __neg__(self) -> int: ... + def __pos__(self) -> int: ... + def __invert__(self) -> int: ... + if sys.version_info >= (3,): + def __round__(self, ndigits: Optional[int] = ...) -> int: ... + def __getnewargs__(self) -> Tuple[int]: ... + + def __eq__(self, x: object) -> bool: ... + def __ne__(self, x: object) -> bool: ... + def __lt__(self, x: int) -> bool: ... + def __le__(self, x: int) -> bool: ... + def __gt__(self, x: int) -> bool: ... + def __ge__(self, x: int) -> bool: ... + + def __str__(self) -> str: ... + def __float__(self) -> float: ... + def __int__(self) -> int: ... + def __abs__(self) -> int: ... + def __hash__(self) -> int: ... + if sys.version_info >= (3,): + def __bool__(self) -> bool: ... + else: + def __nonzero__(self) -> bool: ... + def __index__(self) -> int: ... + +class float: + def __init__(self, x: Union[SupportsFloat, Text, bytes, bytearray] = ...) -> None: ... + def as_integer_ratio(self) -> Tuple[int, int]: ... + def hex(self) -> str: ... + def is_integer(self) -> bool: ... + @classmethod + def fromhex(cls, s: str) -> float: ... + + @property + def real(self) -> float: ... + @property + def imag(self) -> float: ... + def conjugate(self) -> float: ... + + def __add__(self, x: float) -> float: ... + def __sub__(self, x: float) -> float: ... + def __mul__(self, x: float) -> float: ... + def __floordiv__(self, x: float) -> float: ... + if sys.version_info < (3,): + def __div__(self, x: float) -> float: ... + def __truediv__(self, x: float) -> float: ... + def __mod__(self, x: float) -> float: ... + def __divmod__(self, x: float) -> Tuple[float, float]: ... + def __pow__(self, x: float) -> float: ... # In Python 3, returns complex if self is negative and x is not whole + def __radd__(self, x: float) -> float: ... + def __rsub__(self, x: float) -> float: ... + def __rmul__(self, x: float) -> float: ... + def __rfloordiv__(self, x: float) -> float: ... + if sys.version_info < (3,): + def __rdiv__(self, x: float) -> float: ... + def __rtruediv__(self, x: float) -> float: ... + def __rmod__(self, x: float) -> float: ... + def __rdivmod__(self, x: float) -> Tuple[float, float]: ... + def __rpow__(self, x: float) -> float: ... + def __getnewargs__(self) -> Tuple[float]: ... + if sys.version_info >= (3,): + @overload + def __round__(self) -> int: ... + @overload + def __round__(self, ndigits: None) -> int: ... + @overload + def __round__(self, ndigits: int) -> float: ... + + def __eq__(self, x: object) -> bool: ... + def __ne__(self, x: object) -> bool: ... + def __lt__(self, x: float) -> bool: ... + def __le__(self, x: float) -> bool: ... + def __gt__(self, x: float) -> bool: ... + def __ge__(self, x: float) -> bool: ... + def __neg__(self) -> float: ... + def __pos__(self) -> float: ... + + def __str__(self) -> str: ... + def __int__(self) -> int: ... + def __float__(self) -> float: ... + def __abs__(self) -> float: ... + def __hash__(self) -> int: ... + if sys.version_info >= (3,): + def __bool__(self) -> bool: ... + else: + def __nonzero__(self) -> bool: ... + +class complex: + @overload + def __init__(self, re: float = ..., im: float = ...) -> None: ... + @overload + def __init__(self, s: str) -> None: ... + @overload + def __init__(self, s: SupportsComplex) -> None: ... + + @property + def real(self) -> float: ... + @property + def imag(self) -> float: ... + + def conjugate(self) -> complex: ... + + def __add__(self, x: complex) -> complex: ... + def __sub__(self, x: complex) -> complex: ... + def __mul__(self, x: complex) -> complex: ... + def __pow__(self, x: complex) -> complex: ... + if sys.version_info < (3,): + def __div__(self, x: complex) -> complex: ... + def __truediv__(self, x: complex) -> complex: ... + def __radd__(self, x: complex) -> complex: ... + def __rsub__(self, x: complex) -> complex: ... + def __rmul__(self, x: complex) -> complex: ... + def __rpow__(self, x: complex) -> complex: ... + if sys.version_info < (3,): + def __rdiv__(self, x: complex) -> complex: ... + def __rtruediv__(self, x: complex) -> complex: ... + + def __eq__(self, x: object) -> bool: ... + def __ne__(self, x: object) -> bool: ... + def __neg__(self) -> complex: ... + def __pos__(self) -> complex: ... + + def __str__(self) -> str: ... + def __complex__(self) -> complex: ... + def __abs__(self) -> float: ... + def __hash__(self) -> int: ... + if sys.version_info >= (3,): + def __bool__(self) -> bool: ... + else: + def __nonzero__(self) -> bool: ... + +if sys.version_info >= (3,): + _str_base = object +else: + class basestring(metaclass=ABCMeta): ... + + class unicode(basestring, Sequence[unicode]): + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, o: object) -> None: ... + @overload + def __init__(self, o: str, encoding: unicode = ..., errors: unicode = ...) -> None: ... + def capitalize(self) -> unicode: ... + def center(self, width: int, fillchar: unicode = ...) -> unicode: ... + def count(self, x: unicode) -> int: ... + def decode(self, encoding: unicode = ..., errors: unicode = ...) -> unicode: ... + def encode(self, encoding: unicode = ..., errors: unicode = ...) -> str: ... + def endswith(self, suffix: Union[unicode, Tuple[unicode, ...]], start: int = ..., + end: int = ...) -> bool: ... + def expandtabs(self, tabsize: int = ...) -> unicode: ... + def find(self, sub: unicode, start: int = ..., end: int = ...) -> int: ... + def format(self, *args: Any, **kwargs: Any) -> unicode: ... + def index(self, sub: unicode, start: int = ..., end: int = ...) -> int: ... + def isalnum(self) -> bool: ... + def isalpha(self) -> bool: ... + def isdecimal(self) -> bool: ... + def isdigit(self) -> bool: ... + def isidentifier(self) -> bool: ... + def islower(self) -> bool: ... + def isnumeric(self) -> bool: ... + def isprintable(self) -> bool: ... + def isspace(self) -> bool: ... + def istitle(self) -> bool: ... + def isupper(self) -> bool: ... + def join(self, iterable: Iterable[unicode]) -> unicode: ... + def ljust(self, width: int, fillchar: unicode = ...) -> unicode: ... + def lower(self) -> unicode: ... + def lstrip(self, chars: unicode = ...) -> unicode: ... + def partition(self, sep: unicode) -> Tuple[unicode, unicode, unicode]: ... + def replace(self, old: unicode, new: unicode, count: int = ...) -> unicode: ... + def rfind(self, sub: unicode, start: int = ..., end: int = ...) -> int: ... + def rindex(self, sub: unicode, start: int = ..., end: int = ...) -> int: ... + def rjust(self, width: int, fillchar: unicode = ...) -> unicode: ... + def rpartition(self, sep: unicode) -> Tuple[unicode, unicode, unicode]: ... + def rsplit(self, sep: Optional[unicode] = ..., maxsplit: int = ...) -> List[unicode]: ... + def rstrip(self, chars: unicode = ...) -> unicode: ... + def split(self, sep: Optional[unicode] = ..., maxsplit: int = ...) -> List[unicode]: ... + def splitlines(self, keepends: bool = ...) -> List[unicode]: ... + def startswith(self, prefix: Union[unicode, Tuple[unicode, ...]], start: int = ..., + end: int = ...) -> bool: ... + def strip(self, chars: unicode = ...) -> unicode: ... + def swapcase(self) -> unicode: ... + def title(self) -> unicode: ... + def translate(self, table: Union[Dict[int, Any], unicode]) -> unicode: ... + def upper(self) -> unicode: ... + def zfill(self, width: int) -> unicode: ... + + @overload + def __getitem__(self, i: int) -> unicode: ... + @overload + def __getitem__(self, s: slice) -> unicode: ... + def __getslice__(self, start: int, stop: int) -> unicode: ... + def __add__(self, s: unicode) -> unicode: ... + def __mul__(self, n: int) -> unicode: ... + def __rmul__(self, n: int) -> unicode: ... + def __mod__(self, x: Any) -> unicode: ... + def __eq__(self, x: object) -> bool: ... + def __ne__(self, x: object) -> bool: ... + def __lt__(self, x: unicode) -> bool: ... + def __le__(self, x: unicode) -> bool: ... + def __gt__(self, x: unicode) -> bool: ... + def __ge__(self, x: unicode) -> bool: ... + + def __len__(self) -> int: ... + # The argument type is incompatible with Sequence + def __contains__(self, s: Union[unicode, bytes]) -> bool: ... # type: ignore + def __iter__(self) -> Iterator[unicode]: ... + def __str__(self) -> str: ... + def __repr__(self) -> str: ... + def __int__(self) -> int: ... + def __float__(self) -> float: ... + def __hash__(self) -> int: ... + def __getnewargs__(self) -> Tuple[unicode]: ... + + _str_base = basestring + +class str(Sequence[str], _str_base): + if sys.version_info >= (3,): + @overload + def __init__(self, o: object = ...) -> None: ... + @overload + def __init__(self, o: bytes, encoding: str = ..., errors: str = ...) -> None: ... + else: + def __init__(self, o: object = ...) -> None: ... + + def capitalize(self) -> str: ... + if sys.version_info >= (3, 3): + def casefold(self) -> str: ... + def center(self, width: int, fillchar: str = ...) -> str: ... + def count(self, x: Text, __start: Optional[int] = ..., __end: Optional[int] = ...) -> int: ... + if sys.version_info < (3,): + def decode(self, encoding: Text = ..., errors: Text = ...) -> unicode: ... + def encode(self, encoding: Text = ..., errors: Text = ...) -> bytes: ... + if sys.version_info >= (3,): + def endswith(self, suffix: Union[Text, Tuple[Text, ...]], start: Optional[int] = ..., + end: Optional[int] = ...) -> bool: ... + else: + def endswith(self, suffix: Union[Text, Tuple[Text, ...]]) -> bool: ... + def expandtabs(self, tabsize: int = ...) -> str: ... + def find(self, sub: Text, __start: Optional[int] = ..., __end: Optional[int] = ...) -> int: ... + def format(self, *args: Any, **kwargs: Any) -> str: ... + if sys.version_info >= (3,): + def format_map(self, map: Mapping[str, Any]) -> str: ... + def index(self, sub: Text, __start: Optional[int] = ..., __end: Optional[int] = ...) -> int: ... + def isalnum(self) -> bool: ... + def isalpha(self) -> bool: ... + if sys.version_info >= (3, 7): + def isascii(self) -> bool: ... + if sys.version_info >= (3,): + def isdecimal(self) -> bool: ... + def isdigit(self) -> bool: ... + if sys.version_info >= (3,): + def isidentifier(self) -> bool: ... + def islower(self) -> bool: ... + if sys.version_info >= (3,): + def isnumeric(self) -> bool: ... + def isprintable(self) -> bool: ... + def isspace(self) -> bool: ... + def istitle(self) -> bool: ... + def isupper(self) -> bool: ... + if sys.version_info >= (3,): + def join(self, iterable: Iterable[str]) -> str: ... + else: + def join(self, iterable: Iterable[AnyStr]) -> AnyStr: ... + def ljust(self, width: int, fillchar: str = ...) -> str: ... + def lower(self) -> str: ... + if sys.version_info >= (3,): + def lstrip(self, chars: Optional[str] = ...) -> str: ... + def partition(self, sep: str) -> Tuple[str, str, str]: ... + def replace(self, old: str, new: str, count: int = ...) -> str: ... + else: + @overload + def lstrip(self, chars: str = ...) -> str: ... + @overload + def lstrip(self, chars: unicode) -> unicode: ... + @overload + def partition(self, sep: bytearray) -> Tuple[str, bytearray, str]: ... + @overload + def partition(self, sep: str) -> Tuple[str, str, str]: ... + @overload + def partition(self, sep: unicode) -> Tuple[unicode, unicode, unicode]: ... + def replace(self, old: AnyStr, new: AnyStr, count: int = ...) -> AnyStr: ... + def rfind(self, sub: Text, __start: Optional[int] = ..., __end: Optional[int] = ...) -> int: ... + def rindex(self, sub: Text, __start: Optional[int] = ..., __end: Optional[int] = ...) -> int: ... + def rjust(self, width: int, fillchar: str = ...) -> str: ... + if sys.version_info >= (3,): + def rpartition(self, sep: str) -> Tuple[str, str, str]: ... + def rsplit(self, sep: Optional[str] = ..., maxsplit: int = ...) -> List[str]: ... + def rstrip(self, chars: Optional[str] = ...) -> str: ... + def split(self, sep: Optional[str] = ..., maxsplit: int = ...) -> List[str]: ... + else: + @overload + def rpartition(self, sep: bytearray) -> Tuple[str, bytearray, str]: ... + @overload + def rpartition(self, sep: str) -> Tuple[str, str, str]: ... + @overload + def rpartition(self, sep: unicode) -> Tuple[unicode, unicode, unicode]: ... + @overload + def rsplit(self, sep: Optional[str] = ..., maxsplit: int = ...) -> List[str]: ... + @overload + def rsplit(self, sep: unicode, maxsplit: int = ...) -> List[unicode]: ... + @overload + def rstrip(self, chars: str = ...) -> str: ... + @overload + def rstrip(self, chars: unicode) -> unicode: ... + @overload + def split(self, sep: Optional[str] = ..., maxsplit: int = ...) -> List[str]: ... + @overload + def split(self, sep: unicode, maxsplit: int = ...) -> List[unicode]: ... + def splitlines(self, keepends: bool = ...) -> List[str]: ... + if sys.version_info >= (3,): + def startswith(self, prefix: Union[Text, Tuple[Text, ...]], start: Optional[int] = ..., + end: Optional[int] = ...) -> bool: ... + def strip(self, chars: Optional[str] = ...) -> str: ... + else: + def startswith(self, prefix: Union[Text, Tuple[Text, ...]]) -> bool: ... + @overload + def strip(self, chars: str = ...) -> str: ... + @overload + def strip(self, chars: unicode) -> unicode: ... + def swapcase(self) -> str: ... + def title(self) -> str: ... + if sys.version_info >= (3,): + def translate(self, table: Union[Mapping[int, Union[int, str, None]], Sequence[Union[int, str, None]]]) -> str: ... + else: + def translate(self, table: Optional[AnyStr], deletechars: AnyStr = ...) -> AnyStr: ... + def upper(self) -> str: ... + def zfill(self, width: int) -> str: ... + if sys.version_info >= (3,): + @staticmethod + @overload + def maketrans(x: Union[Dict[int, _T], Dict[str, _T], Dict[Union[str, int], _T]]) -> Dict[int, _T]: ... + @staticmethod + @overload + def maketrans(x: str, y: str, z: str = ...) -> Dict[int, Union[int, None]]: ... + + if sys.version_info >= (3,): + def __add__(self, s: str) -> str: ... + else: + def __add__(self, s: AnyStr) -> AnyStr: ... + # Incompatible with Sequence.__contains__ + def __contains__(self, o: Union[str, Text]) -> bool: ... # type: ignore + def __eq__(self, x: object) -> bool: ... + def __ge__(self, x: Text) -> bool: ... + def __getitem__(self, i: Union[int, slice]) -> str: ... + def __gt__(self, x: Text) -> bool: ... + def __hash__(self) -> int: ... + def __iter__(self) -> Iterator[str]: ... + def __le__(self, x: Text) -> bool: ... + def __len__(self) -> int: ... + def __lt__(self, x: Text) -> bool: ... + def __mod__(self, x: Any) -> str: ... + def __mul__(self, n: int) -> str: ... + def __ne__(self, x: object) -> bool: ... + def __repr__(self) -> str: ... + def __rmul__(self, n: int) -> str: ... + def __str__(self) -> str: ... + def __getnewargs__(self) -> Tuple[str]: ... + + if sys.version_info < (3,): + def __getslice__(self, start: int, stop: int) -> str: ... + def __float__(self) -> float: ... + def __int__(self) -> int: ... + +if sys.version_info >= (3,): + class bytes(ByteString): + @overload + def __init__(self, ints: Iterable[int]) -> None: ... + @overload + def __init__(self, string: str, encoding: str, + errors: str = ...) -> None: ... + @overload + def __init__(self, length: int) -> None: ... + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, o: SupportsBytes) -> None: ... + def capitalize(self) -> bytes: ... + def center(self, width: int, fillchar: bytes = ...) -> bytes: ... + def count(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... + def decode(self, encoding: str = ..., errors: str = ...) -> str: ... + def endswith(self, suffix: Union[bytes, Tuple[bytes, ...]]) -> bool: ... + def expandtabs(self, tabsize: int = ...) -> bytes: ... + def find(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... + if sys.version_info >= (3, 5): + def hex(self) -> str: ... + def index(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... + def isalnum(self) -> bool: ... + def isalpha(self) -> bool: ... + if sys.version_info >= (3, 7): + def isascii(self) -> bool: ... + def isdigit(self) -> bool: ... + def islower(self) -> bool: ... + def isspace(self) -> bool: ... + def istitle(self) -> bool: ... + def isupper(self) -> bool: ... + def join(self, iterable: Iterable[Union[ByteString, memoryview]]) -> bytes: ... + def ljust(self, width: int, fillchar: bytes = ...) -> bytes: ... + def lower(self) -> bytes: ... + def lstrip(self, chars: Optional[bytes] = ...) -> bytes: ... + def partition(self, sep: bytes) -> Tuple[bytes, bytes, bytes]: ... + def replace(self, old: bytes, new: bytes, count: int = ...) -> bytes: ... + def rfind(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... + def rindex(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... + def rjust(self, width: int, fillchar: bytes = ...) -> bytes: ... + def rpartition(self, sep: bytes) -> Tuple[bytes, bytes, bytes]: ... + def rsplit(self, sep: Optional[bytes] = ..., maxsplit: int = ...) -> List[bytes]: ... + def rstrip(self, chars: Optional[bytes] = ...) -> bytes: ... + def split(self, sep: Optional[bytes] = ..., maxsplit: int = ...) -> List[bytes]: ... + def splitlines(self, keepends: bool = ...) -> List[bytes]: ... + def startswith( + self, + prefix: Union[bytes, Tuple[bytes, ...]], + start: Optional[int] = ..., + end: Optional[int] = ..., + ) -> bool: ... + def strip(self, chars: Optional[bytes] = ...) -> bytes: ... + def swapcase(self) -> bytes: ... + def title(self) -> bytes: ... + def translate(self, table: Optional[bytes], delete: bytes = ...) -> bytes: ... + def upper(self) -> bytes: ... + def zfill(self, width: int) -> bytes: ... + @classmethod + def fromhex(cls, s: str) -> bytes: ... + @classmethod + def maketrans(cls, frm: bytes, to: bytes) -> bytes: ... + + def __len__(self) -> int: ... + def __iter__(self) -> Iterator[int]: ... + def __str__(self) -> str: ... + def __repr__(self) -> str: ... + def __int__(self) -> int: ... + def __float__(self) -> float: ... + def __hash__(self) -> int: ... + @overload + def __getitem__(self, i: int) -> int: ... + @overload + def __getitem__(self, s: slice) -> bytes: ... + def __add__(self, s: bytes) -> bytes: ... + def __mul__(self, n: int) -> bytes: ... + def __rmul__(self, n: int) -> bytes: ... + if sys.version_info >= (3, 5): + def __mod__(self, value: Any) -> bytes: ... + # Incompatible with Sequence.__contains__ + def __contains__(self, o: Union[int, bytes]) -> bool: ... # type: ignore + def __eq__(self, x: object) -> bool: ... + def __ne__(self, x: object) -> bool: ... + def __lt__(self, x: bytes) -> bool: ... + def __le__(self, x: bytes) -> bool: ... + def __gt__(self, x: bytes) -> bool: ... + def __ge__(self, x: bytes) -> bool: ... + def __getnewargs__(self) -> Tuple[bytes]: ... +else: + bytes = str + +class bytearray(MutableSequence[int], ByteString): + if sys.version_info >= (3,): + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, ints: Iterable[int]) -> None: ... + @overload + def __init__(self, string: Text, encoding: Text, errors: Text = ...) -> None: ... + @overload + def __init__(self, length: int) -> None: ... + else: + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, ints: Iterable[int]) -> None: ... + @overload + def __init__(self, string: str) -> None: ... + @overload + def __init__(self, string: Text, encoding: Text, errors: Text = ...) -> None: ... + @overload + def __init__(self, length: int) -> None: ... + def capitalize(self) -> bytearray: ... + def center(self, width: int, fillchar: bytes = ...) -> bytearray: ... + if sys.version_info >= (3,): + def count(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... + def copy(self) -> bytearray: ... + else: + def count(self, x: str) -> int: ... + def decode(self, encoding: Text = ..., errors: Text = ...) -> str: ... + def endswith(self, suffix: Union[bytes, Tuple[bytes, ...]]) -> bool: ... + def expandtabs(self, tabsize: int = ...) -> bytearray: ... + if sys.version_info >= (3,): + def find(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... + if sys.version_info >= (3, 5): + def hex(self) -> str: ... + def index(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... + else: + def find(self, sub: str, start: int = ..., end: int = ...) -> int: ... + def index(self, sub: str, start: int = ..., end: int = ...) -> int: ... + def insert(self, index: int, object: int) -> None: ... + def isalnum(self) -> bool: ... + def isalpha(self) -> bool: ... + if sys.version_info >= (3, 7): + def isascii(self) -> bool: ... + def isdigit(self) -> bool: ... + def islower(self) -> bool: ... + def isspace(self) -> bool: ... + def istitle(self) -> bool: ... + def isupper(self) -> bool: ... + if sys.version_info >= (3,): + def join(self, iterable: Iterable[Union[ByteString, memoryview]]) -> bytearray: ... + def ljust(self, width: int, fillchar: bytes = ...) -> bytearray: ... + else: + def join(self, iterable: Iterable[str]) -> bytearray: ... + def ljust(self, width: int, fillchar: str = ...) -> bytearray: ... + def lower(self) -> bytearray: ... + def lstrip(self, chars: Optional[bytes] = ...) -> bytearray: ... + def partition(self, sep: bytes) -> Tuple[bytearray, bytearray, bytearray]: ... + def replace(self, old: bytes, new: bytes, count: int = ...) -> bytearray: ... + if sys.version_info >= (3,): + def rfind(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... + def rindex(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... + else: + def rfind(self, sub: bytes, start: int = ..., end: int = ...) -> int: ... + def rindex(self, sub: bytes, start: int = ..., end: int = ...) -> int: ... + def rjust(self, width: int, fillchar: bytes = ...) -> bytearray: ... + def rpartition(self, sep: bytes) -> Tuple[bytearray, bytearray, bytearray]: ... + def rsplit(self, sep: Optional[bytes] = ..., maxsplit: int = ...) -> List[bytearray]: ... + def rstrip(self, chars: Optional[bytes] = ...) -> bytearray: ... + def split(self, sep: Optional[bytes] = ..., maxsplit: int = ...) -> List[bytearray]: ... + def splitlines(self, keepends: bool = ...) -> List[bytearray]: ... + def startswith( + self, + prefix: Union[bytes, Tuple[bytes, ...]], + start: Optional[int] = ..., + end: Optional[int] = ..., + ) -> bool: ... + def strip(self, chars: Optional[bytes] = ...) -> bytearray: ... + def swapcase(self) -> bytearray: ... + def title(self) -> bytearray: ... + if sys.version_info >= (3,): + def translate(self, table: Optional[bytes], delete: bytes = ...) -> bytearray: ... + else: + def translate(self, table: str) -> bytearray: ... + def upper(self) -> bytearray: ... + def zfill(self, width: int) -> bytearray: ... + @staticmethod + def fromhex(s: str) -> bytearray: ... + if sys.version_info >= (3,): + @classmethod + def maketrans(cls, frm: bytes, to: bytes) -> bytes: ... + + def __len__(self) -> int: ... + def __iter__(self) -> Iterator[int]: ... + def __str__(self) -> str: ... + def __repr__(self) -> str: ... + def __int__(self) -> int: ... + def __float__(self) -> float: ... + def __hash__(self) -> int: ... + @overload + def __getitem__(self, i: int) -> int: ... + @overload + def __getitem__(self, s: slice) -> bytearray: ... + @overload + def __setitem__(self, i: int, x: int) -> None: ... + @overload + def __setitem__(self, s: slice, x: Union[Iterable[int], bytes]) -> None: ... + def __delitem__(self, i: Union[int, slice]) -> None: ... + if sys.version_info < (3,): + def __getslice__(self, start: int, stop: int) -> bytearray: ... + def __setslice__(self, start: int, stop: int, x: Union[Sequence[int], str]) -> None: ... + def __delslice__(self, start: int, stop: int) -> None: ... + def __add__(self, s: bytes) -> bytearray: ... + if sys.version_info >= (3,): + def __iadd__(self, s: Iterable[int]) -> bytearray: ... + def __mul__(self, n: int) -> bytearray: ... + if sys.version_info >= (3,): + def __rmul__(self, n: int) -> bytearray: ... + def __imul__(self, n: int) -> bytearray: ... + if sys.version_info >= (3, 5): + def __mod__(self, value: Any) -> bytes: ... + # Incompatible with Sequence.__contains__ + def __contains__(self, o: Union[int, bytes]) -> bool: ... # type: ignore + def __eq__(self, x: object) -> bool: ... + def __ne__(self, x: object) -> bool: ... + def __lt__(self, x: bytes) -> bool: ... + def __le__(self, x: bytes) -> bool: ... + def __gt__(self, x: bytes) -> bool: ... + def __ge__(self, x: bytes) -> bool: ... + +if sys.version_info >= (3,): + _mv_container_type = int +else: + _mv_container_type = str + +class memoryview(Sized, Container[_mv_container_type]): + format: str + itemsize: int + shape: Optional[Tuple[int, ...]] + strides: Optional[Tuple[int, ...]] + suboffsets: Optional[Tuple[int, ...]] + readonly: bool + ndim: int + + if sys.version_info >= (3,): + c_contiguous: bool + f_contiguous: bool + contiguous: bool + def __init__(self, obj: Union[bytes, bytearray, memoryview]) -> None: ... + def __enter__(self) -> memoryview: ... + def __exit__(self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType]) -> bool: ... + else: + def __init__(self, obj: Union[bytes, bytearray, buffer, memoryview]) -> None: ... + + @overload + def __getitem__(self, i: int) -> _mv_container_type: ... + @overload + def __getitem__(self, s: slice) -> memoryview: ... + + def __contains__(self, x: object) -> bool: ... + def __iter__(self) -> Iterator[_mv_container_type]: ... + def __len__(self) -> int: ... + + @overload + def __setitem__(self, i: int, o: bytes) -> None: ... + @overload + def __setitem__(self, s: slice, o: Sequence[bytes]) -> None: ... + @overload + def __setitem__(self, s: slice, o: memoryview) -> None: ... + + def tobytes(self) -> bytes: ... + def tolist(self) -> List[int]: ... + + if sys.version_info >= (3, 5): + def hex(self) -> str: ... + +class bool(int): + def __init__(self, o: object = ...) -> None: ... + @overload + def __and__(self, x: bool) -> bool: ... + @overload + def __and__(self, x: int) -> int: ... + @overload + def __or__(self, x: bool) -> bool: ... + @overload + def __or__(self, x: int) -> int: ... + @overload + def __xor__(self, x: bool) -> bool: ... + @overload + def __xor__(self, x: int) -> int: ... + @overload + def __rand__(self, x: bool) -> bool: ... + @overload + def __rand__(self, x: int) -> int: ... + @overload + def __ror__(self, x: bool) -> bool: ... + @overload + def __ror__(self, x: int) -> int: ... + @overload + def __rxor__(self, x: bool) -> bool: ... + @overload + def __rxor__(self, x: int) -> int: ... + def __getnewargs__(self) -> Tuple[int]: ... + +class slice(object): + start: Optional[int] + step: Optional[int] + stop: Optional[int] + @overload + def __init__(self, stop: Optional[int]) -> None: ... + @overload + def __init__(self, start: Optional[int], stop: Optional[int], step: Optional[int] = ...) -> None: ... + def indices(self, len: int) -> Tuple[int, int, int]: ... + +class tuple(Sequence[_T_co], Generic[_T_co]): + def __new__(cls: Type[_T], iterable: Iterable[_T_co] = ...) -> _T: ... + def __init__(self, iterable: Iterable[_T_co] = ...): ... + def __len__(self) -> int: ... + def __contains__(self, x: object) -> bool: ... + @overload + def __getitem__(self, x: int) -> _T_co: ... + @overload + def __getitem__(self, x: slice) -> Tuple[_T_co, ...]: ... + def __iter__(self) -> Iterator[_T_co]: ... + def __lt__(self, x: Tuple[_T_co, ...]) -> bool: ... + def __le__(self, x: Tuple[_T_co, ...]) -> bool: ... + def __gt__(self, x: Tuple[_T_co, ...]) -> bool: ... + def __ge__(self, x: Tuple[_T_co, ...]) -> bool: ... + def __add__(self, x: Tuple[_T_co, ...]) -> Tuple[_T_co, ...]: ... + def __mul__(self, n: int) -> Tuple[_T_co, ...]: ... + def __rmul__(self, n: int) -> Tuple[_T_co, ...]: ... + def count(self, x: Any) -> int: ... + if sys.version_info >= (3, 5): + def index(self, x: Any, start: int = ..., end: int = ...) -> int: ... + else: + def index(self, x: Any) -> int: ... + +class list(MutableSequence[_T], Generic[_T]): + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, iterable: Iterable[_T]) -> None: ... + if sys.version_info >= (3,): + def clear(self) -> None: ... + def copy(self) -> List[_T]: ... + def append(self, object: _T) -> None: ... + def extend(self, iterable: Iterable[_T]) -> None: ... + def pop(self, index: int = ...) -> _T: ... + def index(self, object: _T, start: int = ..., stop: int = ...) -> int: ... + def count(self, object: _T) -> int: ... + def insert(self, index: int, object: _T) -> None: ... + def remove(self, object: _T) -> None: ... + def reverse(self) -> None: ... + if sys.version_info >= (3,): + def sort(self, *, key: Optional[Callable[[_T], Any]] = ..., reverse: bool = ...) -> None: ... + else: + def sort(self, cmp: Callable[[_T, _T], Any] = ..., key: Callable[[_T], Any] = ..., reverse: bool = ...) -> None: ... + + def __len__(self) -> int: ... + def __iter__(self) -> Iterator[_T]: ... + def __str__(self) -> str: ... + def __hash__(self) -> int: ... + @overload + def __getitem__(self, i: int) -> _T: ... + @overload + def __getitem__(self, s: slice) -> List[_T]: ... + @overload + def __setitem__(self, i: int, o: _T) -> None: ... + @overload + def __setitem__(self, s: slice, o: Iterable[_T]) -> None: ... + def __delitem__(self, i: Union[int, slice]) -> None: ... + if sys.version_info < (3,): + def __getslice__(self, start: int, stop: int) -> List[_T]: ... + def __setslice__(self, start: int, stop: int, o: Sequence[_T]) -> None: ... + def __delslice__(self, start: int, stop: int) -> None: ... + def __add__(self, x: List[_T]) -> List[_T]: ... + def __iadd__(self: _S, x: Iterable[_T]) -> _S: ... + def __mul__(self, n: int) -> List[_T]: ... + def __rmul__(self, n: int) -> List[_T]: ... + if sys.version_info >= (3,): + def __imul__(self: _S, n: int) -> _S: ... + def __contains__(self, o: object) -> bool: ... + def __reversed__(self) -> Iterator[_T]: ... + def __gt__(self, x: List[_T]) -> bool: ... + def __ge__(self, x: List[_T]) -> bool: ... + def __lt__(self, x: List[_T]) -> bool: ... + def __le__(self, x: List[_T]) -> bool: ... + +class dict(MutableMapping[_KT, _VT], Generic[_KT, _VT]): + # NOTE: Keyword arguments are special. If they are used, _KT must include + # str, but we have no way of enforcing it here. + @overload + def __init__(self, **kwargs: _VT) -> None: ... + @overload + def __init__(self, map: Mapping[_KT, _VT], **kwargs: _VT) -> None: ... + @overload + def __init__(self, iterable: Iterable[Tuple[_KT, _VT]], **kwargs: _VT) -> None: ... + + def __new__(cls: Type[_T1], *args: Any, **kwargs: Any) -> _T1: ... + + if sys.version_info < (3,): + def has_key(self, k: _KT) -> bool: ... + def clear(self) -> None: ... + def copy(self) -> Dict[_KT, _VT]: ... + def popitem(self) -> Tuple[_KT, _VT]: ... + def setdefault(self, k: _KT, default: _VT = ...) -> _VT: ... + @overload + def update(self, __m: Mapping[_KT, _VT], **kwargs: _VT) -> None: ... + @overload + def update(self, __m: Iterable[Tuple[_KT, _VT]], **kwargs: _VT) -> None: ... + @overload + def update(self, **kwargs: _VT) -> None: ... + if sys.version_info >= (3,): + def keys(self) -> KeysView[_KT]: ... + def values(self) -> ValuesView[_VT]: ... + def items(self) -> ItemsView[_KT, _VT]: ... + else: + def iterkeys(self) -> Iterator[_KT]: ... + def itervalues(self) -> Iterator[_VT]: ... + def iteritems(self) -> Iterator[Tuple[_KT, _VT]]: ... + def viewkeys(self) -> KeysView[_KT]: ... + def viewvalues(self) -> ValuesView[_VT]: ... + def viewitems(self) -> ItemsView[_KT, _VT]: ... + @staticmethod + @overload + def fromkeys(seq: Iterable[_T]) -> Dict[_T, Any]: ... # TODO: Actually a class method (mypy/issues#328) + @staticmethod + @overload + def fromkeys(seq: Iterable[_T], value: _S) -> Dict[_T, _S]: ... + def __len__(self) -> int: ... + def __getitem__(self, k: _KT) -> _VT: ... + def __setitem__(self, k: _KT, v: _VT) -> None: ... + def __delitem__(self, v: _KT) -> None: ... + def __iter__(self) -> Iterator[_KT]: ... + def __str__(self) -> str: ... + +class set(MutableSet[_T], Generic[_T]): + def __init__(self, iterable: Iterable[_T] = ...) -> None: ... + def add(self, element: _T) -> None: ... + def clear(self) -> None: ... + def copy(self) -> Set[_T]: ... + def difference(self, *s: Iterable[Any]) -> Set[_T]: ... + def difference_update(self, *s: Iterable[Any]) -> None: ... + def discard(self, element: _T) -> None: ... + def intersection(self, *s: Iterable[Any]) -> Set[_T]: ... + def intersection_update(self, *s: Iterable[Any]) -> None: ... + def isdisjoint(self, s: Iterable[Any]) -> bool: ... + def issubset(self, s: Iterable[Any]) -> bool: ... + def issuperset(self, s: Iterable[Any]) -> bool: ... + def pop(self) -> _T: ... + def remove(self, element: _T) -> None: ... + def symmetric_difference(self, s: Iterable[_T]) -> Set[_T]: ... + def symmetric_difference_update(self, s: Iterable[_T]) -> None: ... + def union(self, *s: Iterable[_T]) -> Set[_T]: ... + def update(self, *s: Iterable[_T]) -> None: ... + def __len__(self) -> int: ... + def __contains__(self, o: object) -> bool: ... + def __iter__(self) -> Iterator[_T]: ... + def __str__(self) -> str: ... + def __and__(self, s: AbstractSet[object]) -> Set[_T]: ... + def __iand__(self, s: AbstractSet[object]) -> Set[_T]: ... + def __or__(self, s: AbstractSet[_S]) -> Set[Union[_T, _S]]: ... + def __ior__(self, s: AbstractSet[_S]) -> Set[Union[_T, _S]]: ... + def __sub__(self, s: AbstractSet[object]) -> Set[_T]: ... + def __isub__(self, s: AbstractSet[object]) -> Set[_T]: ... + def __xor__(self, s: AbstractSet[_S]) -> Set[Union[_T, _S]]: ... + def __ixor__(self, s: AbstractSet[_S]) -> Set[Union[_T, _S]]: ... + def __le__(self, s: AbstractSet[object]) -> bool: ... + def __lt__(self, s: AbstractSet[object]) -> bool: ... + def __ge__(self, s: AbstractSet[object]) -> bool: ... + def __gt__(self, s: AbstractSet[object]) -> bool: ... + +class frozenset(AbstractSet[_T], Generic[_T]): + def __init__(self, iterable: Iterable[_T] = ...) -> None: ... + def copy(self) -> FrozenSet[_T]: ... + def difference(self, *s: Iterable[object]) -> FrozenSet[_T]: ... + def intersection(self, *s: Iterable[object]) -> FrozenSet[_T]: ... + def isdisjoint(self, s: Iterable[_T]) -> bool: ... + def issubset(self, s: Iterable[object]) -> bool: ... + def issuperset(self, s: Iterable[object]) -> bool: ... + def symmetric_difference(self, s: Iterable[_T]) -> FrozenSet[_T]: ... + def union(self, *s: Iterable[_T]) -> FrozenSet[_T]: ... + def __len__(self) -> int: ... + def __contains__(self, o: object) -> bool: ... + def __iter__(self) -> Iterator[_T]: ... + def __str__(self) -> str: ... + def __and__(self, s: AbstractSet[_T]) -> FrozenSet[_T]: ... + def __or__(self, s: AbstractSet[_S]) -> FrozenSet[Union[_T, _S]]: ... + def __sub__(self, s: AbstractSet[_T]) -> FrozenSet[_T]: ... + def __xor__(self, s: AbstractSet[_S]) -> FrozenSet[Union[_T, _S]]: ... + def __le__(self, s: AbstractSet[object]) -> bool: ... + def __lt__(self, s: AbstractSet[object]) -> bool: ... + def __ge__(self, s: AbstractSet[object]) -> bool: ... + def __gt__(self, s: AbstractSet[object]) -> bool: ... + +class enumerate(Iterator[Tuple[int, _T]], Generic[_T]): + def __init__(self, iterable: Iterable[_T], start: int = ...) -> None: ... + def __iter__(self) -> Iterator[Tuple[int, _T]]: ... + if sys.version_info >= (3,): + def __next__(self) -> Tuple[int, _T]: ... + else: + def next(self) -> Tuple[int, _T]: ... + +if sys.version_info >= (3,): + class range(Sequence[int]): + start: int + stop: int + step: int + @overload + def __init__(self, stop: int) -> None: ... + @overload + def __init__(self, start: int, stop: int, step: int = ...) -> None: ... + def count(self, value: int) -> int: ... + def index(self, value: int, start: int = ..., stop: Optional[int] = ...) -> int: ... + def __len__(self) -> int: ... + def __contains__(self, o: object) -> bool: ... + def __iter__(self) -> Iterator[int]: ... + @overload + def __getitem__(self, i: int) -> int: ... + @overload + def __getitem__(self, s: slice) -> range: ... + def __repr__(self) -> str: ... + def __reversed__(self) -> Iterator[int]: ... +else: + class xrange(Sized, Iterable[int], Reversible[int]): + @overload + def __init__(self, stop: int) -> None: ... + @overload + def __init__(self, start: int, stop: int, step: int = ...) -> None: ... + def __len__(self) -> int: ... + def __iter__(self) -> Iterator[int]: ... + def __getitem__(self, i: int) -> int: ... + def __reversed__(self) -> Iterator[int]: ... + +class property(object): + def __init__(self, fget: Optional[Callable[[Any], Any]] = ..., + fset: Optional[Callable[[Any, Any], None]] = ..., + fdel: Optional[Callable[[Any], None]] = ..., + doc: Optional[str] = ...) -> None: ... + def getter(self, fget: Callable[[Any], Any]) -> property: ... + def setter(self, fset: Callable[[Any, Any], None]) -> property: ... + def deleter(self, fdel: Callable[[Any], None]) -> property: ... + def __get__(self, obj: Any, type: Optional[type] = ...) -> Any: ... + def __set__(self, obj: Any, value: Any) -> None: ... + def __delete__(self, obj: Any) -> None: ... + def fget(self) -> Any: ... + def fset(self, value: Any) -> None: ... + def fdel(self) -> None: ... + +if sys.version_info < (3,): + long = int + +NotImplemented: Any + +def abs(__n: SupportsAbs[_T]) -> _T: ... +def all(__i: Iterable[object]) -> bool: ... +def any(__i: Iterable[object]) -> bool: ... +if sys.version_info < (3,): + def apply(__func: Callable[..., _T], __args: Optional[Sequence[Any]] = ..., __kwds: Optional[Mapping[str, Any]] = ...) -> _T: ... +if sys.version_info >= (3,): + def ascii(__o: object) -> str: ... + +class _SupportsIndex(Protocol): + def __index__(self) -> int: ... +def bin(__number: Union[int, _SupportsIndex]) -> str: ... + +if sys.version_info >= (3, 7): + def breakpoint(*args: Any, **kws: Any) -> None: ... +def callable(__o: object) -> bool: ... +def chr(__code: int) -> str: ... +if sys.version_info < (3,): + def cmp(__x: Any, __y: Any) -> int: ... + _N1 = TypeVar('_N1', bool, int, float, complex) + def coerce(__x: _N1, __y: _N1) -> Tuple[_N1, _N1]: ... +if sys.version_info >= (3, 6): + # This class is to be exported as PathLike from os, + # but we define it here as _PathLike to avoid import cycle issues. + # See https://github.com/python/typeshed/pull/991#issuecomment-288160993 + class _PathLike(Generic[AnyStr]): + def __fspath__(self) -> AnyStr: ... + def compile(source: Union[str, bytes, mod, AST], filename: Union[str, bytes, _PathLike], mode: str, flags: int = ..., dont_inherit: int = ..., optimize: int = ...) -> Any: ... +elif sys.version_info >= (3,): + def compile(source: Union[str, bytes, mod, AST], filename: Union[str, bytes], mode: str, flags: int = ..., dont_inherit: int = ..., optimize: int = ...) -> Any: ... +else: + def compile(source: Union[Text, mod], filename: Text, mode: Text, flags: int = ..., dont_inherit: int = ...) -> Any: ... +if sys.version_info >= (3,): + def copyright() -> None: ... + def credits() -> None: ... +def delattr(__o: Any, __name: Text) -> None: ... +def dir(__o: object = ...) -> List[str]: ... +_N2 = TypeVar('_N2', int, float) +def divmod(__a: _N2, __b: _N2) -> Tuple[_N2, _N2]: ... +def eval(__source: Union[Text, bytes, CodeType], __globals: Optional[Dict[str, Any]] = ..., __locals: Optional[Mapping[str, Any]] = ...) -> Any: ... +if sys.version_info >= (3,): + def exec(__object: Union[str, bytes, CodeType], __globals: Optional[Dict[str, Any]] = ..., __locals: Optional[Mapping[str, Any]] = ...) -> Any: ... +else: + def execfile(__filename: str, __globals: Optional[Dict[str, Any]] = ..., __locals: Optional[Dict[str, Any]] = ...) -> None: ... +def exit(code: object = ...) -> NoReturn: ... +if sys.version_info >= (3,): + @overload + def filter(__function: None, __iterable: Iterable[Optional[_T]]) -> Iterator[_T]: ... + @overload + def filter(__function: Callable[[_T], Any], __iterable: Iterable[_T]) -> Iterator[_T]: ... +else: + @overload + def filter(__function: Callable[[AnyStr], Any], # type: ignore + __iterable: AnyStr) -> AnyStr: ... + @overload + def filter(__function: None, # type: ignore + __iterable: Tuple[Optional[_T], ...]) -> Tuple[_T, ...]: ... + @overload + def filter(__function: Callable[[_T], Any], # type: ignore + __iterable: Tuple[_T, ...]) -> Tuple[_T, ...]: ... + @overload + def filter(__function: None, + __iterable: Iterable[Optional[_T]]) -> List[_T]: ... + @overload + def filter(__function: Callable[[_T], Any], + __iterable: Iterable[_T]) -> List[_T]: ... +def format(__o: object, __format_spec: str = ...) -> str: ... # TODO unicode +def getattr(__o: Any, name: Text, __default: Any = ...) -> Any: ... +def globals() -> Dict[str, Any]: ... +def hasattr(__o: Any, __name: Text) -> bool: ... +def hash(__o: object) -> int: ... +if sys.version_info >= (3,): + def help(*args: Any, **kwds: Any) -> None: ... +def hex(__i: Union[int, _SupportsIndex]) -> str: ... +def id(__o: object) -> int: ... +if sys.version_info >= (3,): + def input(__prompt: Any = ...) -> str: ... +else: + def input(__prompt: Any = ...) -> Any: ... + def intern(__string: str) -> str: ... +@overload +def iter(__iterable: Iterable[_T]) -> Iterator[_T]: ... +@overload +def iter(__function: Callable[[], _T], __sentinel: _T) -> Iterator[_T]: ... +def isinstance(__o: object, __t: Union[type, Tuple[Union[type, Tuple], ...]]) -> bool: ... +def issubclass(__cls: type, __classinfo: Union[type, Tuple[Union[type, Tuple], ...]]) -> bool: ... +def len(__o: Sized) -> int: ... +if sys.version_info >= (3,): + def license() -> None: ... +def locals() -> Dict[str, Any]: ... +if sys.version_info >= (3,): + @overload + def map(__func: Callable[[_T1], _S], __iter1: Iterable[_T1]) -> Iterator[_S]: ... + @overload + def map(__func: Callable[[_T1, _T2], _S], __iter1: Iterable[_T1], + __iter2: Iterable[_T2]) -> Iterator[_S]: ... + @overload + def map(__func: Callable[[_T1, _T2, _T3], _S], + __iter1: Iterable[_T1], + __iter2: Iterable[_T2], + __iter3: Iterable[_T3]) -> Iterator[_S]: ... + @overload + def map(__func: Callable[[_T1, _T2, _T3, _T4], _S], + __iter1: Iterable[_T1], + __iter2: Iterable[_T2], + __iter3: Iterable[_T3], + __iter4: Iterable[_T4]) -> Iterator[_S]: ... + @overload + def map(__func: Callable[[_T1, _T2, _T3, _T4, _T5], _S], + __iter1: Iterable[_T1], + __iter2: Iterable[_T2], + __iter3: Iterable[_T3], + __iter4: Iterable[_T4], + __iter5: Iterable[_T5]) -> Iterator[_S]: ... + @overload + def map(__func: Callable[..., _S], + __iter1: Iterable[Any], + __iter2: Iterable[Any], + __iter3: Iterable[Any], + __iter4: Iterable[Any], + __iter5: Iterable[Any], + __iter6: Iterable[Any], + *iterables: Iterable[Any]) -> Iterator[_S]: ... +else: + @overload + def map(__func: None, __iter1: Iterable[_T1]) -> List[_T1]: ... + @overload + def map(__func: None, + __iter1: Iterable[_T1], + __iter2: Iterable[_T2]) -> List[Tuple[_T1, _T2]]: ... + @overload + def map(__func: None, + __iter1: Iterable[_T1], + __iter2: Iterable[_T2], + __iter3: Iterable[_T3]) -> List[Tuple[_T1, _T2, _T3]]: ... + @overload + def map(__func: None, + __iter1: Iterable[_T1], + __iter2: Iterable[_T2], + __iter3: Iterable[_T3], + __iter4: Iterable[_T4]) -> List[Tuple[_T1, _T2, _T3, _T4]]: ... + @overload + def map(__func: None, + __iter1: Iterable[_T1], + __iter2: Iterable[_T2], + __iter3: Iterable[_T3], + __iter4: Iterable[_T4], + __iter5: Iterable[_T5]) -> List[Tuple[_T1, _T2, _T3, _T4, _T5]]: ... + @overload + def map(__func: None, + __iter1: Iterable[Any], + __iter2: Iterable[Any], + __iter3: Iterable[Any], + __iter4: Iterable[Any], + __iter5: Iterable[Any], + __iter6: Iterable[Any], + *iterables: Iterable[Any]) -> List[Tuple[Any, ...]]: ... + @overload + def map(__func: Callable[[_T1], _S], __iter1: Iterable[_T1]) -> List[_S]: ... + @overload + def map(__func: Callable[[_T1, _T2], _S], + __iter1: Iterable[_T1], + __iter2: Iterable[_T2]) -> List[_S]: ... + @overload + def map(__func: Callable[[_T1, _T2, _T3], _S], + __iter1: Iterable[_T1], + __iter2: Iterable[_T2], + __iter3: Iterable[_T3]) -> List[_S]: ... + @overload + def map(__func: Callable[[_T1, _T2, _T3, _T4], _S], + __iter1: Iterable[_T1], + __iter2: Iterable[_T2], + __iter3: Iterable[_T3], + __iter4: Iterable[_T4]) -> List[_S]: ... + @overload + def map(__func: Callable[[_T1, _T2, _T3, _T4, _T5], _S], + __iter1: Iterable[_T1], + __iter2: Iterable[_T2], + __iter3: Iterable[_T3], + __iter4: Iterable[_T4], + __iter5: Iterable[_T5]) -> List[_S]: ... + @overload + def map(__func: Callable[..., _S], + __iter1: Iterable[Any], + __iter2: Iterable[Any], + __iter3: Iterable[Any], + __iter4: Iterable[Any], + __iter5: Iterable[Any], + __iter6: Iterable[Any], + *iterables: Iterable[Any]) -> List[_S]: ... +if sys.version_info >= (3,): + @overload + def max(__arg1: _T, __arg2: _T, *_args: _T, key: Callable[[_T], Any] = ...) -> _T: ... + @overload + def max(__iterable: Iterable[_T], *, key: Callable[[_T], Any] = ...) -> _T: ... + @overload + def max(__iterable: Iterable[_T], *, key: Callable[[_T], Any] = ..., default: _VT) -> Union[_T, _VT]: ... +else: + @overload + def max(__arg1: _T, __arg2: _T, *_args: _T, key: Callable[[_T], Any] = ...) -> _T: ... + @overload + def max(__iterable: Iterable[_T], *, key: Callable[[_T], Any] = ...) -> _T: ... +if sys.version_info >= (3,): + @overload + def min(__arg1: _T, __arg2: _T, *_args: _T, key: Callable[[_T], Any] = ...) -> _T: ... + @overload + def min(__iterable: Iterable[_T], *, key: Callable[[_T], Any] = ...) -> _T: ... + @overload + def min(__iterable: Iterable[_T], *, key: Callable[[_T], Any] = ..., default: _VT) -> Union[_T, _VT]: ... +else: + @overload + def min(__arg1: _T, __arg2: _T, *_args: _T, key: Callable[[_T], Any] = ...) -> _T: ... + @overload + def min(__iterable: Iterable[_T], *, key: Callable[[_T], Any] = ...) -> _T: ... +@overload +def next(__i: Iterator[_T]) -> _T: ... +@overload +def next(__i: Iterator[_T], default: _VT) -> Union[_T, _VT]: ... +def oct(__i: Union[int, _SupportsIndex]) -> str: ... + +if sys.version_info >= (3, 6): + def open(file: Union[str, bytes, int, _PathLike], mode: str = ..., buffering: int = ..., encoding: Optional[str] = ..., + errors: Optional[str] = ..., newline: Optional[str] = ..., closefd: bool = ..., + opener: Optional[Callable[[str, int], int]] = ...) -> IO[Any]: ... +elif sys.version_info >= (3,): + def open(file: Union[str, bytes, int], mode: str = ..., buffering: int = ..., encoding: Optional[str] = ..., + errors: Optional[str] = ..., newline: Optional[str] = ..., closefd: bool = ..., + opener: Optional[Callable[[str, int], int]] = ...) -> IO[Any]: ... +else: + def open(name: Union[unicode, int], mode: unicode = ..., buffering: int = ...) -> BinaryIO: ... + +def ord(__c: Union[Text, bytes]) -> int: ... +if sys.version_info >= (3,): + class _Writer(Protocol): + def write(self, __s: str) -> Any: ... + def print(*values: object, sep: Text = ..., end: Text = ..., file: Optional[_Writer] = ..., flush: bool = ...) -> None: ... +else: + class _Writer(Protocol): + def write(self, __s: Any) -> Any: ... + # This is only available after from __future__ import print_function. + def print(*values: object, sep: Text = ..., end: Text = ..., file: Optional[_Writer] = ...) -> None: ... +@overload +def pow(__x: int, __y: int) -> Any: ... # The return type can be int or float, depending on y +@overload +def pow(__x: int, __y: int, __z: int) -> Any: ... +@overload +def pow(__x: float, __y: float) -> float: ... +@overload +def pow(__x: float, __y: float, __z: float) -> float: ... +def quit(code: object = ...) -> NoReturn: ... +if sys.version_info < (3,): + def range(__x: int, __y: int = ..., __step: int = ...) -> List[int]: ... + def raw_input(__prompt: Any = ...) -> str: ... + @overload + def reduce(__function: Callable[[_T, _S], _T], __iterable: Iterable[_S], __initializer: _T) -> _T: ... + @overload + def reduce(__function: Callable[[_T, _T], _T], __iterable: Iterable[_T]) -> _T: ... + def reload(__module: Any) -> Any: ... +@overload +def reversed(__object: Sequence[_T]) -> Iterator[_T]: ... +@overload +def reversed(__object: Reversible[_T]) -> Iterator[_T]: ... +def repr(__o: object) -> str: ... +if sys.version_info >= (3,): + @overload + def round(number: float) -> int: ... + @overload + def round(number: float, ndigits: None) -> int: ... + @overload + def round(number: float, ndigits: int) -> float: ... + @overload + def round(number: SupportsRound[_T]) -> int: ... + @overload + def round(number: SupportsRound[_T], ndigits: None) -> int: ... # type: ignore + @overload + def round(number: SupportsRound[_T], ndigits: int) -> _T: ... +else: + @overload + def round(number: float) -> float: ... + @overload + def round(number: float, ndigits: int) -> float: ... + @overload + def round(number: SupportsFloat) -> float: ... + @overload + def round(number: SupportsFloat, ndigits: int) -> float: ... +def setattr(__object: Any, __name: Text, __value: Any) -> None: ... +if sys.version_info >= (3,): + def sorted(__iterable: Iterable[_T], *, + key: Optional[Callable[[_T], Any]] = ..., + reverse: bool = ...) -> List[_T]: ... +else: + def sorted(__iterable: Iterable[_T], *, + cmp: Callable[[_T, _T], int] = ..., + key: Callable[[_T], Any] = ..., + reverse: bool = ...) -> List[_T]: ... +@overload +def sum(__iterable: Iterable[_T]) -> Union[_T, int]: ... +@overload +def sum(__iterable: Iterable[_T], __start: _S) -> Union[_T, _S]: ... +if sys.version_info < (3,): + def unichr(__i: int) -> unicode: ... +def vars(__object: Any = ...) -> Dict[str, Any]: ... +if sys.version_info >= (3,): + @overload + def zip(__iter1: Iterable[_T1]) -> Iterator[Tuple[_T1]]: ... + @overload + def zip(__iter1: Iterable[_T1], __iter2: Iterable[_T2]) -> Iterator[Tuple[_T1, _T2]]: ... + @overload + def zip(__iter1: Iterable[_T1], __iter2: Iterable[_T2], + __iter3: Iterable[_T3]) -> Iterator[Tuple[_T1, _T2, _T3]]: ... + @overload + def zip(__iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3], + __iter4: Iterable[_T4]) -> Iterator[Tuple[_T1, _T2, _T3, _T4]]: ... + @overload + def zip(__iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3], + __iter4: Iterable[_T4], __iter5: Iterable[_T5]) -> Iterator[Tuple[_T1, _T2, _T3, _T4, _T5]]: ... + @overload + def zip(__iter1: Iterable[Any], __iter2: Iterable[Any], __iter3: Iterable[Any], + __iter4: Iterable[Any], __iter5: Iterable[Any], __iter6: Iterable[Any], + *iterables: Iterable[Any]) -> Iterator[Tuple[Any, ...]]: ... +else: + @overload + def zip(__iter1: Iterable[_T1]) -> List[Tuple[_T1]]: ... + @overload + def zip(__iter1: Iterable[_T1], + __iter2: Iterable[_T2]) -> List[Tuple[_T1, _T2]]: ... + @overload + def zip(__iter1: Iterable[_T1], __iter2: Iterable[_T2], + __iter3: Iterable[_T3]) -> List[Tuple[_T1, _T2, _T3]]: ... + @overload + def zip(__iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3], + __iter4: Iterable[_T4]) -> List[Tuple[_T1, _T2, _T3, _T4]]: ... + @overload + def zip(__iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3], + __iter4: Iterable[_T4], __iter5: Iterable[_T5]) -> List[Tuple[_T1, _T2, _T3, _T4, _T5]]: ... + @overload + def zip(__iter1: Iterable[Any], __iter2: Iterable[Any], __iter3: Iterable[Any], + __iter4: Iterable[Any], __iter5: Iterable[Any], __iter6: Iterable[Any], + *iterables: Iterable[Any]) -> List[Tuple[Any, ...]]: ... +def __import__(name: Text, globals: Dict[str, Any] = ..., locals: Dict[str, Any] = ..., + fromlist: List[str] = ..., level: int = ...) -> Any: ... + +# Actually the type of Ellipsis is , but since it's +# not exposed anywhere under that name, we make it private here. +class ellipsis: ... +Ellipsis: ellipsis + +if sys.version_info < (3,): + # TODO: buffer support is incomplete; e.g. some_string.startswith(some_buffer) doesn't type check. + _AnyBuffer = TypeVar('_AnyBuffer', str, unicode, bytearray, buffer) + + class buffer(Sized): + def __init__(self, object: _AnyBuffer, offset: int = ..., size: int = ...) -> None: ... + def __add__(self, other: _AnyBuffer) -> str: ... + def __cmp__(self, other: _AnyBuffer) -> bool: ... + def __getitem__(self, key: Union[int, slice]) -> str: ... + def __getslice__(self, i: int, j: int) -> str: ... + def __len__(self) -> int: ... + def __mul__(self, x: int) -> str: ... + +class BaseException(object): + args: Tuple[Any, ...] + if sys.version_info < (3,): + message: Any + if sys.version_info >= (3,): + __cause__: Optional[BaseException] + __context__: Optional[BaseException] + __suppress_context__: bool + __traceback__: Optional[TracebackType] + def __init__(self, *args: object) -> None: ... + if sys.version_info < (3,): + def __getitem__(self, i: int) -> Any: ... + def __getslice__(self, start: int, stop: int) -> Tuple[Any, ...]: ... + if sys.version_info >= (3,): + def with_traceback(self, tb: Optional[TracebackType]) -> BaseException: ... + +class GeneratorExit(BaseException): ... +class KeyboardInterrupt(BaseException): ... +class SystemExit(BaseException): + code: int +class Exception(BaseException): ... +class StopIteration(Exception): + if sys.version_info >= (3,): + value: Any +if sys.version_info >= (3,): + _StandardError = Exception + class OSError(Exception): + errno: int + strerror: str + # filename, filename2 are actually Union[str, bytes, None] + filename: Any + filename2: Any + EnvironmentError = OSError + IOError = OSError +else: + class StandardError(Exception): ... + _StandardError = StandardError + class EnvironmentError(StandardError): + errno: int + strerror: str + # TODO can this be unicode? + filename: str + class OSError(EnvironmentError): ... + class IOError(EnvironmentError): ... + +class ArithmeticError(_StandardError): ... +class AssertionError(_StandardError): ... +class AttributeError(_StandardError): ... +class BufferError(_StandardError): ... +class EOFError(_StandardError): ... +class ImportError(_StandardError): + if sys.version_info >= (3,): + name: str + path: str +class LookupError(_StandardError): ... +class MemoryError(_StandardError): ... +class NameError(_StandardError): ... +class ReferenceError(_StandardError): ... +class RuntimeError(_StandardError): ... +if sys.version_info >= (3, 5): + class StopAsyncIteration(Exception): + value: Any +class SyntaxError(_StandardError): + msg: str + lineno: int + offset: Optional[int] + text: str + filename: str +class SystemError(_StandardError): ... +class TypeError(_StandardError): ... +class ValueError(_StandardError): ... + +class FloatingPointError(ArithmeticError): ... +class OverflowError(ArithmeticError): ... +class ZeroDivisionError(ArithmeticError): ... + +if sys.version_info >= (3, 6): + class ModuleNotFoundError(ImportError): ... + +class IndexError(LookupError): ... +class KeyError(LookupError): ... + +class UnboundLocalError(NameError): ... + +class WindowsError(OSError): + winerror: int +if sys.version_info >= (3,): + class BlockingIOError(OSError): + characters_written: int + class ChildProcessError(OSError): ... + class ConnectionError(OSError): ... + class BrokenPipeError(ConnectionError): ... + class ConnectionAbortedError(ConnectionError): ... + class ConnectionRefusedError(ConnectionError): ... + class ConnectionResetError(ConnectionError): ... + class FileExistsError(OSError): ... + class FileNotFoundError(OSError): ... + class InterruptedError(OSError): ... + class IsADirectoryError(OSError): ... + class NotADirectoryError(OSError): ... + class PermissionError(OSError): ... + class ProcessLookupError(OSError): ... + class TimeoutError(OSError): ... + +class NotImplementedError(RuntimeError): ... +if sys.version_info >= (3, 5): + class RecursionError(RuntimeError): ... + +class IndentationError(SyntaxError): ... +class TabError(IndentationError): ... + +class UnicodeError(ValueError): ... +class UnicodeDecodeError(UnicodeError): + encoding: str + object: bytes + start: int + end: int + reason: str + def __init__(self, __encoding: str, __object: bytes, __start: int, __end: int, + __reason: str) -> None: ... +class UnicodeEncodeError(UnicodeError): + encoding: str + object: Text + start: int + end: int + reason: str + def __init__(self, __encoding: str, __object: Text, __start: int, __end: int, + __reason: str) -> None: ... +class UnicodeTranslateError(UnicodeError): ... + +class Warning(Exception): ... +class UserWarning(Warning): ... +class DeprecationWarning(Warning): ... +class SyntaxWarning(Warning): ... +class RuntimeWarning(Warning): ... +class FutureWarning(Warning): ... +class PendingDeprecationWarning(Warning): ... +class ImportWarning(Warning): ... +class UnicodeWarning(Warning): ... +class BytesWarning(Warning): ... +if sys.version_info >= (3, 2): + class ResourceWarning(Warning): ... + +if sys.version_info < (3,): + class file(BinaryIO): + @overload + def __init__(self, file: str, mode: str = ..., buffering: int = ...) -> None: ... + @overload + def __init__(self, file: unicode, mode: str = ..., buffering: int = ...) -> None: ... + @overload + def __init__(self, file: int, mode: str = ..., buffering: int = ...) -> None: ... + def __iter__(self) -> Iterator[str]: ... + def next(self) -> str: ... + def read(self, n: int = ...) -> str: ... + def __enter__(self) -> BinaryIO: ... + def __exit__(self, t: Optional[type] = ..., exc: Optional[BaseException] = ..., tb: Optional[Any] = ...) -> bool: ... + def flush(self) -> None: ... + def fileno(self) -> int: ... + def isatty(self) -> bool: ... + def close(self) -> None: ... + + def readable(self) -> bool: ... + def writable(self) -> bool: ... + def seekable(self) -> bool: ... + def seek(self, offset: int, whence: int = ...) -> int: ... + def tell(self) -> int: ... + def readline(self, limit: int = ...) -> str: ... + def readlines(self, hint: int = ...) -> List[str]: ... + def write(self, data: str) -> int: ... + def writelines(self, data: Iterable[str]) -> None: ... + def truncate(self, pos: Optional[int] = ...) -> int: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/_ast.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/_ast.pyi new file mode 100644 index 0000000..c461bb4 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/_ast.pyi @@ -0,0 +1,330 @@ +import typing +from typing import Optional + +__version__: str +PyCF_ONLY_AST: int +_identifier = str + +class AST: + _attributes: typing.Tuple[str, ...] + _fields: typing.Tuple[str, ...] + def __init__(self, *args, **kwargs) -> None: ... + +class mod(AST): + ... + +class Module(mod): + body: typing.List[stmt] + +class Interactive(mod): + body: typing.List[stmt] + +class Expression(mod): + body: expr + +class Suite(mod): + body: typing.List[stmt] + + +class stmt(AST): + lineno: int + col_offset: int + +class FunctionDef(stmt): + name: _identifier + args: arguments + body: typing.List[stmt] + decorator_list: typing.List[expr] + +class ClassDef(stmt): + name: _identifier + bases: typing.List[expr] + body: typing.List[stmt] + decorator_list: typing.List[expr] + +class Return(stmt): + value: Optional[expr] + +class Delete(stmt): + targets: typing.List[expr] + +class Assign(stmt): + targets: typing.List[expr] + value: expr + +class AugAssign(stmt): + target: expr + op: operator + value: expr + +class Print(stmt): + dest: Optional[expr] + values: typing.List[expr] + nl: bool + +class For(stmt): + target: expr + iter: expr + body: typing.List[stmt] + orelse: typing.List[stmt] + +class While(stmt): + test: expr + body: typing.List[stmt] + orelse: typing.List[stmt] + +class If(stmt): + test: expr + body: typing.List[stmt] + orelse: typing.List[stmt] + +class With(stmt): + context_expr: expr + optional_vars: Optional[expr] + body: typing.List[stmt] + +class Raise(stmt): + type: Optional[expr] + inst: Optional[expr] + tback: Optional[expr] + +class TryExcept(stmt): + body: typing.List[stmt] + handlers: typing.List[ExceptHandler] + orelse: typing.List[stmt] + +class TryFinally(stmt): + body: typing.List[stmt] + finalbody: typing.List[stmt] + +class Assert(stmt): + test: expr + msg: Optional[expr] + +class Import(stmt): + names: typing.List[alias] + +class ImportFrom(stmt): + module: Optional[_identifier] + names: typing.List[alias] + level: Optional[int] + +class Exec(stmt): + body: expr + globals: Optional[expr] + locals: Optional[expr] + +class Global(stmt): + names: typing.List[_identifier] + +class Expr(stmt): + value: expr + +class Pass(stmt): ... +class Break(stmt): ... +class Continue(stmt): ... + + +class slice(AST): + ... + +_slice = slice # this lets us type the variable named 'slice' below + +class Slice(slice): + lower: Optional[expr] + upper: Optional[expr] + step: Optional[expr] + +class ExtSlice(slice): + dims: typing.List[slice] + +class Index(slice): + value: expr + +class Ellipsis(slice): ... + + +class expr(AST): + lineno: int + col_offset: int + +class BoolOp(expr): + op: boolop + values: typing.List[expr] + +class BinOp(expr): + left: expr + op: operator + right: expr + +class UnaryOp(expr): + op: unaryop + operand: expr + +class Lambda(expr): + args: arguments + body: expr + +class IfExp(expr): + test: expr + body: expr + orelse: expr + +class Dict(expr): + keys: typing.List[expr] + values: typing.List[expr] + +class Set(expr): + elts: typing.List[expr] + +class ListComp(expr): + elt: expr + generators: typing.List[comprehension] + +class SetComp(expr): + elt: expr + generators: typing.List[comprehension] + +class DictComp(expr): + key: expr + value: expr + generators: typing.List[comprehension] + +class GeneratorExp(expr): + elt: expr + generators: typing.List[comprehension] + +class Yield(expr): + value: Optional[expr] + +class Compare(expr): + left: expr + ops: typing.List[cmpop] + comparators: typing.List[expr] + +class Call(expr): + func: expr + args: typing.List[expr] + keywords: typing.List[keyword] + starargs: Optional[expr] + kwargs: Optional[expr] + +class Repr(expr): + value: expr + +class Num(expr): + n: float + +class Str(expr): + s: str + +class Attribute(expr): + value: expr + attr: _identifier + ctx: expr_context + +class Subscript(expr): + value: expr + slice: _slice + ctx: expr_context + +class Name(expr): + id: _identifier + ctx: expr_context + +class List(expr): + elts: typing.List[expr] + ctx: expr_context + +class Tuple(expr): + elts: typing.List[expr] + ctx: expr_context + + +class expr_context(AST): + ... + +class AugLoad(expr_context): ... +class AugStore(expr_context): ... +class Del(expr_context): ... +class Load(expr_context): ... +class Param(expr_context): ... +class Store(expr_context): ... + + +class boolop(AST): + ... + +class And(boolop): ... +class Or(boolop): ... + +class operator(AST): + ... + +class Add(operator): ... +class BitAnd(operator): ... +class BitOr(operator): ... +class BitXor(operator): ... +class Div(operator): ... +class FloorDiv(operator): ... +class LShift(operator): ... +class Mod(operator): ... +class Mult(operator): ... +class Pow(operator): ... +class RShift(operator): ... +class Sub(operator): ... + +class unaryop(AST): + ... + +class Invert(unaryop): ... +class Not(unaryop): ... +class UAdd(unaryop): ... +class USub(unaryop): ... + +class cmpop(AST): + ... + +class Eq(cmpop): ... +class Gt(cmpop): ... +class GtE(cmpop): ... +class In(cmpop): ... +class Is(cmpop): ... +class IsNot(cmpop): ... +class Lt(cmpop): ... +class LtE(cmpop): ... +class NotEq(cmpop): ... +class NotIn(cmpop): ... + + +class comprehension(AST): + target: expr + iter: expr + ifs: typing.List[expr] + + +class excepthandler(AST): + ... + + +class ExceptHandler(excepthandler): + type: Optional[expr] + name: Optional[expr] + body: typing.List[stmt] + lineno: int + col_offset: int + + +class arguments(AST): + args: typing.List[expr] + vararg: Optional[_identifier] + kwarg: Optional[_identifier] + defaults: typing.List[expr] + +class keyword(AST): + arg: _identifier + value: expr + +class alias(AST): + name: _identifier + asname: Optional[_identifier] diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/_collections.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/_collections.pyi new file mode 100644 index 0000000..e24d405 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/_collections.pyi @@ -0,0 +1,41 @@ +"""Stub file for the '_collections' module.""" + +from typing import Any, Generic, Iterator, TypeVar, Optional, Union + +class defaultdict(dict): + default_factory: None + def __init__(self, default: Any = ..., init: Any = ...) -> None: ... + def __missing__(self, key) -> Any: + raise KeyError() + def __copy__(self) -> defaultdict: ... + def copy(self) -> defaultdict: ... + +_T = TypeVar('_T') +_T2 = TypeVar('_T2') + +class deque(Generic[_T]): + maxlen: Optional[int] + def __init__(self, iterable: Iterator[_T] = ..., maxlen: int = ...) -> None: ... + def append(self, x: _T) -> None: ... + def appendleft(self, x: _T) -> None: ... + def clear(self) -> None: ... + def count(self, x: Any) -> int: ... + def extend(self, iterable: Iterator[_T]) -> None: ... + def extendleft(self, iterable: Iterator[_T]) -> None: ... + def pop(self) -> _T: + raise IndexError() + def popleft(self) -> _T: + raise IndexError() + def remove(self, value: _T) -> None: + raise IndexError() + def reverse(self) -> None: ... + def rotate(self, n: int = ...) -> None: ... + def __contains__(self, o: Any) -> bool: ... + def __copy__(self) -> deque[_T]: ... + def __getitem__(self, i: int) -> _T: + raise IndexError() + def __iadd__(self, other: deque[_T2]) -> deque[Union[_T, _T2]]: ... + def __iter__(self) -> Iterator[_T]: ... + def __len__(self) -> int: ... + def __reversed__(self) -> Iterator[_T]: ... + def __setitem__(self, i: int, x: _T) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/_functools.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/_functools.pyi new file mode 100644 index 0000000..0641885 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/_functools.pyi @@ -0,0 +1,87 @@ +"""Stub file for the '_functools' module.""" + +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Tuple, overload + +_T = TypeVar("_T") +_T2 = TypeVar("_T2") +_T3 = TypeVar("_T3") +_T4 = TypeVar("_T4") +_T5 = TypeVar("_T5") +_S = TypeVar("_S") + +@overload +def reduce(function: Callable[[_T, _T], _T], + sequence: Iterable[_T]) -> _T: ... +@overload +def reduce(function: Callable[[_T, _S], _T], + sequence: Iterable[_S], initial: _T) -> _T: ... + +@overload +def partial(__func: Callable[[_T], _S], __arg: _T) -> Callable[[], _S]: ... +@overload +def partial(__func: Callable[[_T, _T2], _S], __arg: _T) -> Callable[[_T2], _S]: ... +@overload +def partial(__func: Callable[[_T, _T2, _T3], _S], __arg: _T) -> Callable[[_T2, _T3], _S]: ... +@overload +def partial(__func: Callable[[_T, _T2, _T3, _T4], _S], __arg: _T) -> Callable[[_T2, _T3, _T4], _S]: ... +@overload +def partial(__func: Callable[[_T, _T2, _T3, _T4, _T5], _S], __arg: _T) -> Callable[[_T2, _T3, _T4, _T5], _S]: ... + +@overload +def partial(__func: Callable[[_T, _T2], _S], + __arg1: _T, + __arg2: _T2) -> Callable[[], _S]: ... +@overload +def partial(__func: Callable[[_T, _T2, _T3], _S], + __arg1: _T, + __arg2: _T2) -> Callable[[_T3], _S]: ... +@overload +def partial(__func: Callable[[_T, _T2, _T3, _T4], _S], + __arg1: _T, + __arg2: _T2) -> Callable[[_T3, _T4], _S]: ... +@overload +def partial(__func: Callable[[_T, _T2, _T3, _T4, _T5], _S], + __arg1: _T, + __arg2: _T2) -> Callable[[_T3, _T4, _T5], _S]: ... + +@overload +def partial(__func: Callable[[_T, _T2, _T3], _S], + __arg1: _T, + __arg2: _T2, + __arg3: _T3) -> Callable[[], _S]: ... +@overload +def partial(__func: Callable[[_T, _T2, _T3, _T4], _S], + __arg1: _T, + __arg2: _T2, + __arg3: _T3) -> Callable[[_T4], _S]: ... +@overload +def partial(__func: Callable[[_T, _T2, _T3, _T4, _T5], _S], + __arg1: _T, + __arg2: _T2, + __arg3: _T3) -> Callable[[_T4, _T5], _S]: ... + +@overload +def partial(__func: Callable[[_T, _T2, _T3, _T4], _S], + __arg1: _T, + __arg2: _T2, + __arg3: _T3, + __arg4: _T4) -> Callable[[], _S]: ... +@overload +def partial(__func: Callable[[_T, _T2, _T3, _T4, _T5], _S], + __arg1: _T, + __arg2: _T2, + __arg3: _T3, + __arg4: _T4) -> Callable[[_T5], _S]: ... + +@overload +def partial(__func: Callable[[_T, _T2, _T3, _T4, _T5], _S], + __arg1: _T, + __arg2: _T2, + __arg3: _T3, + __arg4: _T4, + __arg5: _T5) -> Callable[[], _S]: ... + +@overload +def partial(__func: Callable[..., _S], + *args: Any, + **kwargs: Any) -> Callable[..., _S]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/_hotshot.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/_hotshot.pyi new file mode 100644 index 0000000..8a9c8d7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/_hotshot.pyi @@ -0,0 +1,34 @@ +"""Stub file for the '_hotshot' module.""" +# This is an autogenerated file. It serves as a starting point +# for a more precise manual annotation of this module. +# Feel free to edit the source below, but remove this header when you do. + +from typing import Any, List, Tuple, Dict, Generic + +def coverage(a: str) -> Any: ... + +def logreader(a: str) -> LogReaderType: + raise IOError() + raise RuntimeError() + +def profiler(a: str, *args, **kwargs) -> Any: + raise IOError() + +def resolution() -> tuple: ... + + +class LogReaderType(object): + def close(self) -> None: ... + def fileno(self) -> int: + raise ValueError() + +class ProfilerType(object): + def addinfo(self, a: str, b: str) -> None: ... + def close(self) -> None: ... + def fileno(self) -> int: + raise ValueError() + def runcall(self, *args, **kwargs) -> Any: ... + def runcode(self, a, b, *args, **kwargs) -> Any: + raise TypeError() + def start(self) -> None: ... + def stop(self) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/_io.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/_io.pyi new file mode 100644 index 0000000..e4e15cb --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/_io.pyi @@ -0,0 +1,183 @@ +from typing import Any, AnyStr, BinaryIO, IO, Text, TextIO, Iterable, Iterator, List, Optional, Type, Tuple, TypeVar, Union +from mmap import mmap +from types import TracebackType + +_bytearray_like = Union[bytearray, mmap] + +DEFAULT_BUFFER_SIZE: int + +class BlockingIOError(IOError): + characters_written: int + +class UnsupportedOperation(ValueError, IOError): ... + +_T = TypeVar("_T") + +class _IOBase(BinaryIO): + @property + def closed(self) -> bool: ... + def _checkClosed(self) -> None: ... + def _checkReadable(self) -> None: ... + def _checkSeekable(self) -> None: ... + def _checkWritable(self) -> None: ... + # All these methods are concrete here (you can instantiate this) + def close(self) -> None: ... + def fileno(self) -> int: ... + def flush(self) -> None: ... + def isatty(self) -> bool: ... + def readable(self) -> bool: ... + def seek(self, offset: int, whence: int = ...) -> int: ... + def seekable(self) -> bool: ... + def tell(self) -> int: ... + def truncate(self, size: Optional[int] = ...) -> int: ... + def writable(self) -> bool: ... + def __enter__(self: _T) -> _T: ... + def __exit__(self, t: Optional[Type[BaseException]], value: Optional[BaseException], traceback: Optional[Any]) -> bool: ... + def __iter__(self: _T) -> _T: ... + # The parameter type of writelines[s]() is determined by that of write(): + def writelines(self, lines: Iterable[bytes]) -> None: ... + # The return type of readline[s]() and next() is determined by that of read(): + def readline(self, limit: int = ...) -> bytes: ... + def readlines(self, hint: int = ...) -> List[bytes]: ... + def next(self) -> bytes: ... + # These don't actually exist but we need to pretend that it does + # so that this class is concrete. + def write(self, s: bytes) -> int: ... + def read(self, n: int = ...) -> bytes: ... + +class _BufferedIOBase(_IOBase): + def read1(self, n: int) -> bytes: ... + def read(self, size: int = ...) -> bytes: ... + def readinto(self, buffer: _bytearray_like) -> int: ... + def write(self, s: bytes) -> int: ... + def detach(self) -> _IOBase: ... + +class BufferedRWPair(_BufferedIOBase): + def __init__(self, reader: _RawIOBase, writer: _RawIOBase, + buffer_size: int = ..., max_buffer_size: int = ...) -> None: ... + def peek(self, n: int = ...) -> bytes: ... + def __enter__(self) -> BufferedRWPair: ... + +class BufferedRandom(_BufferedIOBase): + mode: str + name: str + raw: _IOBase + def __init__(self, raw: _IOBase, + buffer_size: int = ..., + max_buffer_size: int = ...) -> None: ... + def peek(self, n: int = ...) -> bytes: ... + +class BufferedReader(_BufferedIOBase): + mode: str + name: str + raw: _IOBase + def __init__(self, raw: _IOBase, buffer_size: int = ...) -> None: ... + def peek(self, n: int = ...) -> bytes: ... + +class BufferedWriter(_BufferedIOBase): + name: str + raw: _IOBase + mode: str + def __init__(self, raw: _IOBase, + buffer_size: int = ..., + max_buffer_size: int = ...) -> None: ... + +class BytesIO(_BufferedIOBase): + def __init__(self, initial_bytes: bytes = ...) -> None: ... + def __setstate__(self, tuple) -> None: ... + def __getstate__(self) -> tuple: ... + # BytesIO does not contain a "name" field. This workaround is necessary + # to allow BytesIO sub-classes to add this field, as it is defined + # as a read-only property on IO[]. + name: Any + def getvalue(self) -> bytes: ... + def write(self, s: bytes) -> int: ... + def writelines(self, lines: Iterable[bytes]) -> None: ... + def read1(self, size: int) -> bytes: ... + def next(self) -> bytes: ... + +class _RawIOBase(_IOBase): + def readall(self) -> str: ... + def read(self, n: int = ...) -> str: ... + +class FileIO(_RawIOBase, BytesIO): + mode: str + closefd: bool + def __init__(self, file: Union[str, int], mode: str = ..., closefd: bool = ...) -> None: ... + def readinto(self, buffer: _bytearray_like) -> int: ... + def write(self, pbuf: str) -> int: ... + +class IncrementalNewlineDecoder(object): + newlines: Union[str, unicode] + def __init__(self, decoder, translate, z=...) -> None: ... + def decode(self, input, final) -> Any: ... + def getstate(self) -> Tuple[Any, int]: ... + def setstate(self, state: Tuple[Any, int]) -> None: ... + def reset(self) -> None: ... + + +# Note: In the actual _io.py, _TextIOBase inherits from _IOBase. +class _TextIOBase(TextIO): + errors: Optional[str] + # TODO: On _TextIOBase, this is always None. But it's unicode/bytes in subclasses. + newlines: Union[None, unicode, bytes] + encoding: str + @property + def closed(self) -> bool: ... + def _checkClosed(self) -> None: ... + def _checkReadable(self) -> None: ... + def _checkSeekable(self) -> None: ... + def _checkWritable(self) -> None: ... + def close(self) -> None: ... + def detach(self) -> IO: ... + def fileno(self) -> int: ... + def flush(self) -> None: ... + def isatty(self) -> bool: ... + def next(self) -> unicode: ... + def read(self, size: int = ...) -> unicode: ... + def readable(self) -> bool: ... + def readline(self, limit: int = ...) -> unicode: ... + def readlines(self, hint: int = ...) -> list[unicode]: ... + def seek(self, offset: int, whence: int = ...) -> int: ... + def seekable(self) -> bool: ... + def tell(self) -> int: ... + def truncate(self, size: Optional[int] = ...) -> int: ... + def writable(self) -> bool: ... + def write(self, pbuf: unicode) -> int: ... + def writelines(self, lines: Iterable[unicode]) -> None: ... + def __enter__(self: _T) -> _T: ... + def __exit__(self, t: Optional[Type[BaseException]], value: Optional[BaseException], traceback: Optional[Any]) -> bool: ... + def __iter__(self: _T) -> _T: ... + +class StringIO(_TextIOBase): + line_buffering: bool + def __init__(self, + initial_value: Optional[unicode] = ..., + newline: Optional[unicode] = ...) -> None: ... + def __setstate__(self, state: tuple) -> None: ... + def __getstate__(self) -> tuple: ... + # StringIO does not contain a "name" field. This workaround is necessary + # to allow StringIO sub-classes to add this field, as it is defined + # as a read-only property on IO[]. + name: Any + def getvalue(self) -> unicode: ... + +class TextIOWrapper(_TextIOBase): + name: str + line_buffering: bool + buffer: BinaryIO + _CHUNK_SIZE: int + def __init__(self, buffer: IO, + encoding: Optional[Text] = ..., + errors: Optional[Text] = ..., + newline: Optional[Text] = ..., + line_buffering: bool = ..., + write_through: bool = ...) -> None: ... + +def open(file: Union[str, unicode, int], + mode: Text = ..., + buffering: int = ..., + encoding: Optional[Text] = ..., + errors: Optional[Text] = ..., + newline: Optional[Text] = ..., + closefd: bool = ...) -> IO[Any]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/_json.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/_json.pyi new file mode 100644 index 0000000..028b7b2 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/_json.pyi @@ -0,0 +1,17 @@ +"""Stub file for the '_json' module.""" +# This is an autogenerated file. It serves as a starting point +# for a more precise manual annotation of this module. +# Feel free to edit the source below, but remove this header when you do. + +from typing import Any, List, Tuple, Dict, Generic + +def encode_basestring_ascii(*args, **kwargs) -> str: + raise TypeError() + +def scanstring(a, b, *args, **kwargs) -> tuple: + raise TypeError() + + +class Encoder(object): ... + +class Scanner(object): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/_md5.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/_md5.pyi new file mode 100644 index 0000000..96111b7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/_md5.pyi @@ -0,0 +1,13 @@ +blocksize: int +digest_size: int + +class MD5Type(object): + name: str + block_size: int + digest_size: int + def copy(self) -> MD5Type: ... + def digest(self) -> str: ... + def hexdigest(self) -> str: ... + def update(self, arg: str) -> None: ... + +def new(arg: str = ...) -> MD5Type: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/_sha.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/_sha.pyi new file mode 100644 index 0000000..7c47256 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/_sha.pyi @@ -0,0 +1,15 @@ +blocksize: int +block_size: int +digest_size: int + +class sha(object): # not actually exposed + name: str + block_size: int + digest_size: int + digestsize: int + def copy(self) -> sha: ... + def digest(self) -> str: ... + def hexdigest(self) -> str: ... + def update(self, arg: str) -> None: ... + +def new(arg: str = ...) -> sha: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/_sha256.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/_sha256.pyi new file mode 100644 index 0000000..b6eb47d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/_sha256.pyi @@ -0,0 +1,23 @@ +from typing import Optional + +class sha224(object): + name: str + block_size: int + digest_size: int + digestsize: int + def __init__(self, init: Optional[str]) -> None: ... + def copy(self) -> sha224: ... + def digest(self) -> str: ... + def hexdigest(self) -> str: ... + def update(self, arg: str) -> None: ... + +class sha256(object): + name: str + block_size: int + digest_size: int + digestsize: int + def __init__(self, init: Optional[str]) -> None: ... + def copy(self) -> sha256: ... + def digest(self) -> str: ... + def hexdigest(self) -> str: ... + def update(self, arg: str) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/_sha512.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/_sha512.pyi new file mode 100644 index 0000000..b1ca9ae --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/_sha512.pyi @@ -0,0 +1,23 @@ +from typing import Optional + +class sha384(object): + name: str + block_size: int + digest_size: int + digestsize: int + def __init__(self, init: Optional[str]) -> None: ... + def copy(self) -> sha384: ... + def digest(self) -> str: ... + def hexdigest(self) -> str: ... + def update(self, arg: str) -> None: ... + +class sha512(object): + name: str + block_size: int + digest_size: int + digestsize: int + def __init__(self, init: Optional[str]) -> None: ... + def copy(self) -> sha512: ... + def digest(self) -> str: ... + def hexdigest(self) -> str: ... + def update(self, arg: str) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/_socket.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/_socket.pyi new file mode 100644 index 0000000..8d02bde --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/_socket.pyi @@ -0,0 +1,287 @@ +from typing import Tuple, Union, IO, Any, Optional, overload + +AF_APPLETALK: int +AF_ASH: int +AF_ATMPVC: int +AF_ATMSVC: int +AF_AX25: int +AF_BLUETOOTH: int +AF_BRIDGE: int +AF_DECnet: int +AF_ECONET: int +AF_INET: int +AF_INET6: int +AF_IPX: int +AF_IRDA: int +AF_KEY: int +AF_LLC: int +AF_NETBEUI: int +AF_NETLINK: int +AF_NETROM: int +AF_PACKET: int +AF_PPPOX: int +AF_ROSE: int +AF_ROUTE: int +AF_SECURITY: int +AF_SNA: int +AF_TIPC: int +AF_UNIX: int +AF_UNSPEC: int +AF_WANPIPE: int +AF_X25: int +AI_ADDRCONFIG: int +AI_ALL: int +AI_CANONNAME: int +AI_NUMERICHOST: int +AI_NUMERICSERV: int +AI_PASSIVE: int +AI_V4MAPPED: int +BDADDR_ANY: str +BDADDR_LOCAL: str +BTPROTO_HCI: int +BTPROTO_L2CAP: int +BTPROTO_RFCOMM: int +BTPROTO_SCO: int +EAI_ADDRFAMILY: int +EAI_AGAIN: int +EAI_BADFLAGS: int +EAI_FAIL: int +EAI_FAMILY: int +EAI_MEMORY: int +EAI_NODATA: int +EAI_NONAME: int +EAI_OVERFLOW: int +EAI_SERVICE: int +EAI_SOCKTYPE: int +EAI_SYSTEM: int +EBADF: int +EINTR: int +HCI_DATA_DIR: int +HCI_FILTER: int +HCI_TIME_STAMP: int +INADDR_ALLHOSTS_GROUP: int +INADDR_ANY: int +INADDR_BROADCAST: int +INADDR_LOOPBACK: int +INADDR_MAX_LOCAL_GROUP: int +INADDR_NONE: int +INADDR_UNSPEC_GROUP: int +IPPORT_RESERVED: int +IPPORT_USERRESERVED: int +IPPROTO_AH: int +IPPROTO_DSTOPTS: int +IPPROTO_EGP: int +IPPROTO_ESP: int +IPPROTO_FRAGMENT: int +IPPROTO_GRE: int +IPPROTO_HOPOPTS: int +IPPROTO_ICMP: int +IPPROTO_ICMPV6: int +IPPROTO_IDP: int +IPPROTO_IGMP: int +IPPROTO_IP: int +IPPROTO_IPIP: int +IPPROTO_IPV6: int +IPPROTO_NONE: int +IPPROTO_PIM: int +IPPROTO_PUP: int +IPPROTO_RAW: int +IPPROTO_ROUTING: int +IPPROTO_RSVP: int +IPPROTO_TCP: int +IPPROTO_TP: int +IPPROTO_UDP: int +IPV6_CHECKSUM: int +IPV6_DSTOPTS: int +IPV6_HOPLIMIT: int +IPV6_HOPOPTS: int +IPV6_JOIN_GROUP: int +IPV6_LEAVE_GROUP: int +IPV6_MULTICAST_HOPS: int +IPV6_MULTICAST_IF: int +IPV6_MULTICAST_LOOP: int +IPV6_NEXTHOP: int +IPV6_PKTINFO: int +IPV6_RECVDSTOPTS: int +IPV6_RECVHOPLIMIT: int +IPV6_RECVHOPOPTS: int +IPV6_RECVPKTINFO: int +IPV6_RECVRTHDR: int +IPV6_RECVTCLASS: int +IPV6_RTHDR: int +IPV6_RTHDRDSTOPTS: int +IPV6_RTHDR_TYPE_0: int +IPV6_TCLASS: int +IPV6_UNICAST_HOPS: int +IPV6_V6ONLY: int +IP_ADD_MEMBERSHIP: int +IP_DEFAULT_MULTICAST_LOOP: int +IP_DEFAULT_MULTICAST_TTL: int +IP_DROP_MEMBERSHIP: int +IP_HDRINCL: int +IP_MAX_MEMBERSHIPS: int +IP_MULTICAST_IF: int +IP_MULTICAST_LOOP: int +IP_MULTICAST_TTL: int +IP_OPTIONS: int +IP_RECVOPTS: int +IP_RECVRETOPTS: int +IP_RETOPTS: int +IP_TOS: int +IP_TTL: int +MSG_CTRUNC: int +MSG_DONTROUTE: int +MSG_DONTWAIT: int +MSG_EOR: int +MSG_OOB: int +MSG_PEEK: int +MSG_TRUNC: int +MSG_WAITALL: int +MethodType: type +NETLINK_DNRTMSG: int +NETLINK_FIREWALL: int +NETLINK_IP6_FW: int +NETLINK_NFLOG: int +NETLINK_ROUTE: int +NETLINK_USERSOCK: int +NETLINK_XFRM: int +NI_DGRAM: int +NI_MAXHOST: int +NI_MAXSERV: int +NI_NAMEREQD: int +NI_NOFQDN: int +NI_NUMERICHOST: int +NI_NUMERICSERV: int +PACKET_BROADCAST: int +PACKET_FASTROUTE: int +PACKET_HOST: int +PACKET_LOOPBACK: int +PACKET_MULTICAST: int +PACKET_OTHERHOST: int +PACKET_OUTGOING: int +PF_PACKET: int +SHUT_RD: int +SHUT_RDWR: int +SHUT_WR: int +SOCK_DGRAM: int +SOCK_RAW: int +SOCK_RDM: int +SOCK_SEQPACKET: int +SOCK_STREAM: int +SOL_HCI: int +SOL_IP: int +SOL_SOCKET: int +SOL_TCP: int +SOL_TIPC: int +SOL_UDP: int +SOMAXCONN: int +SO_ACCEPTCONN: int +SO_BROADCAST: int +SO_DEBUG: int +SO_DONTROUTE: int +SO_ERROR: int +SO_KEEPALIVE: int +SO_LINGER: int +SO_OOBINLINE: int +SO_RCVBUF: int +SO_RCVLOWAT: int +SO_RCVTIMEO: int +SO_REUSEADDR: int +SO_REUSEPORT: int +SO_SNDBUF: int +SO_SNDLOWAT: int +SO_SNDTIMEO: int +SO_TYPE: int +SSL_ERROR_EOF: int +SSL_ERROR_INVALID_ERROR_CODE: int +SSL_ERROR_SSL: int +SSL_ERROR_SYSCALL: int +SSL_ERROR_WANT_CONNECT: int +SSL_ERROR_WANT_READ: int +SSL_ERROR_WANT_WRITE: int +SSL_ERROR_WANT_X509_LOOKUP: int +SSL_ERROR_ZERO_RETURN: int +TCP_CORK: int +TCP_DEFER_ACCEPT: int +TCP_INFO: int +TCP_KEEPCNT: int +TCP_KEEPIDLE: int +TCP_KEEPINTVL: int +TCP_LINGER2: int +TCP_MAXSEG: int +TCP_NODELAY: int +TCP_QUICKACK: int +TCP_SYNCNT: int +TCP_WINDOW_CLAMP: int +TIPC_ADDR_ID: int +TIPC_ADDR_NAME: int +TIPC_ADDR_NAMESEQ: int +TIPC_CFG_SRV: int +TIPC_CLUSTER_SCOPE: int +TIPC_CONN_TIMEOUT: int +TIPC_CRITICAL_IMPORTANCE: int +TIPC_DEST_DROPPABLE: int +TIPC_HIGH_IMPORTANCE: int +TIPC_IMPORTANCE: int +TIPC_LOW_IMPORTANCE: int +TIPC_MEDIUM_IMPORTANCE: int +TIPC_NODE_SCOPE: int +TIPC_PUBLISHED: int +TIPC_SRC_DROPPABLE: int +TIPC_SUBSCR_TIMEOUT: int +TIPC_SUB_CANCEL: int +TIPC_SUB_PORTS: int +TIPC_SUB_SERVICE: int +TIPC_TOP_SRV: int +TIPC_WAIT_FOREVER: int +TIPC_WITHDRAWN: int +TIPC_ZONE_SCOPE: int + +# PyCapsule +CAPI: Any + +has_ipv6: bool + +class error(IOError): ... +class gaierror(error): ... +class timeout(error): ... + +class SocketType(object): + family: int + type: int + proto: int + timeout: float + + def __init__(self, family: int = ..., type: int = ..., proto: int = ...) -> None: ... + def accept(self) -> Tuple[SocketType, tuple]: ... + def bind(self, address: tuple) -> None: ... + def close(self) -> None: ... + def connect(self, address: tuple) -> None: + raise gaierror + raise timeout + def connect_ex(self, address: tuple) -> int: ... + def dup(self) -> SocketType: ... + def fileno(self) -> int: ... + def getpeername(self) -> tuple: ... + def getsockname(self) -> tuple: ... + def getsockopt(self, level: int, option: int, buffersize: int = ...) -> str: ... + def gettimeout(self) -> float: ... + def listen(self, backlog: int) -> None: + raise error + def makefile(self, mode: str = ..., buffersize: int = ...) -> IO[Any]: ... + def recv(self, buffersize: int, flags: int = ...) -> str: ... + def recv_into(self, buffer: bytearray, nbytes: int = ..., flags: int = ...) -> int: ... + def recvfrom(self, buffersize: int, flags: int = ...) -> tuple: + raise error + def recvfrom_into(self, buffer: bytearray, nbytes: int = ..., + flags: int = ...) -> int: ... + def send(self, data: str, flags: int = ...) -> int: ... + def sendall(self, data: str, flags: int = ...) -> None: ... + @overload + def sendto(self, data: str, address: tuple) -> int: ... + @overload + def sendto(self, data: str, flags: int, address: tuple) -> int: ... + def setblocking(self, flag: bool) -> None: ... + def setsockopt(self, level: int, option: int, value: Union[int, str]) -> None: ... + def settimeout(self, value: Optional[float]) -> None: ... + def shutdown(self, flag: int) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/_sre.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/_sre.pyi new file mode 100644 index 0000000..0692b4c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/_sre.pyi @@ -0,0 +1,53 @@ +"""Stub file for the '_sre' module.""" + +from typing import Any, Union, Iterable, Optional, Mapping, Sequence, Dict, List, Tuple, overload + +CODESIZE: int +MAGIC: int +MAXREPEAT: long +copyright: str + +class SRE_Match(object): + def start(self, group: int = ...) -> int: + raise IndexError() + def end(self, group: int = ...) -> int: + raise IndexError() + def expand(self, s: str) -> Any: ... + @overload + def group(self) -> str: ... + @overload + def group(self, group: int = ...) -> Optional[str]: ... + def groupdict(self) -> Dict[int, Optional[str]]: ... + def groups(self) -> Tuple[Optional[str], ...]: ... + def span(self) -> Tuple[int, int]: + raise IndexError() + +class SRE_Scanner(object): + pattern: str + def match(self) -> SRE_Match: ... + def search(self) -> SRE_Match: ... + +class SRE_Pattern(object): + pattern: str + flags: int + groups: int + groupindex: Mapping[str, int] + indexgroup: Sequence[int] + def findall(self, source: str, pos: int = ..., endpos: int = ...) -> List[Union[tuple, str]]: ... + def finditer(self, source: str, pos: int = ..., endpos: int = ...) -> Iterable[Union[tuple, str]]: ... + def match(self, pattern, pos: int = ..., endpos: int = ...) -> SRE_Match: ... + def scanner(self, s: str, start: int = ..., end: int = ...) -> SRE_Scanner: ... + def search(self, pattern, pos: int = ..., endpos: int = ...) -> SRE_Match: ... + def split(self, source: str, maxsplit: int = ...) -> List[Optional[str]]: ... + def sub(self, repl: str, string: str, count: int = ...) -> tuple: ... + def subn(self, repl: str, string: str, count: int = ...) -> tuple: ... + +def compile(pattern: str, flags: int, code: List[int], + groups: int = ..., + groupindex: Mapping[str, int] = ..., + indexgroup: Sequence[int] = ...) -> SRE_Pattern: + raise OverflowError() + +def getcodesize() -> int: ... + +def getlower(a: int, b: int) -> int: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/_struct.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/_struct.pyi new file mode 100644 index 0000000..49f44f2 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/_struct.pyi @@ -0,0 +1,22 @@ +"""Stub file for the '_struct' module.""" + +from typing import Any, AnyStr, Tuple + +class error(Exception): ... + +class Struct(object): + size: int + format: str + + def __init__(self, fmt: str) -> None: ... + def pack_into(self, buffer: bytearray, offset: int, obj: Any) -> None: ... + def pack(self, *args) -> str: ... + def unpack(self, s: str) -> Tuple[Any, ...]: ... + def unpack_from(self, buffer: bytearray, offset: int = ...) -> Tuple[Any, ...]: ... + +def _clearcache() -> None: ... +def calcsize(fmt: str) -> int: ... +def pack(fmt: AnyStr, obj: Any) -> str: ... +def pack_into(fmt: AnyStr, buffer: bytearray, offset: int, obj: Any) -> None: ... +def unpack(fmt: AnyStr, data: str) -> Tuple[Any, ...]: ... +def unpack_from(fmt: AnyStr, buffer: bytearray, offset: int = ...) -> Tuple[Any, ...]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/_symtable.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/_symtable.pyi new file mode 100644 index 0000000..fbf5424 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/_symtable.pyi @@ -0,0 +1,39 @@ +from typing import List, Dict + +CELL: int +DEF_BOUND: int +DEF_FREE: int +DEF_FREE_CLASS: int +DEF_GLOBAL: int +DEF_IMPORT: int +DEF_LOCAL: int +DEF_PARAM: int +FREE: int +GLOBAL_EXPLICIT: int +GLOBAL_IMPLICIT: int +LOCAL: int +OPT_BARE_EXEC: int +OPT_EXEC: int +OPT_IMPORT_STAR: int +SCOPE_MASK: int +SCOPE_OFF: int +TYPE_CLASS: int +TYPE_FUNCTION: int +TYPE_MODULE: int +USE: int + +class _symtable_entry(object): + ... + +class symtable(object): + children: List[_symtable_entry] + id: int + lineno: int + name: str + nested: int + optimized: int + symbols: Dict[str, int] + type: int + varnames: List[str] + + def __init__(self, src: str, filename: str, startstr: str) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/_threading_local.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/_threading_local.pyi new file mode 100644 index 0000000..512bf58 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/_threading_local.pyi @@ -0,0 +1,14 @@ +# Source: https://hg.python.org/cpython/file/2.7/Lib/_threading_local.py +from typing import Any, List + +__all__: List[str] + +class _localbase(object): ... + +class local(_localbase): + def __getattribute__(self, name: str) -> Any: ... + def __setattr__(self, name: str, value: Any) -> None: ... + def __delattr__(self, name: str) -> None: ... + def __del__(self) -> None: ... + +def _patch(self: local) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/_warnings.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/_warnings.pyi new file mode 100644 index 0000000..9609faa --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/_warnings.pyi @@ -0,0 +1,11 @@ +from typing import Any, List, Optional, Type + +default_action: str +filters: List[tuple] +once_registry: dict + +def warn(message: Warning, category: Optional[Type[Warning]] = ..., stacklevel: int = ...) -> None: ... +def warn_explicit(message: Warning, category: Optional[Type[Warning]], + filename: str, lineno: int, + module: Any = ..., registry: dict = ..., + module_globals: dict = ...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/abc.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/abc.pyi new file mode 100644 index 0000000..746f530 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/abc.pyi @@ -0,0 +1,29 @@ +from typing import Any, Dict, Set, Tuple, Type +import _weakrefset + +# NOTE: mypy has special processing for ABCMeta and abstractmethod. + +def abstractmethod(funcobj: Any) -> Any: ... + +class ABCMeta(type): + # TODO: FrozenSet + __abstractmethods__: Set[Any] + _abc_cache: _weakrefset.WeakSet + _abc_invalidation_counter: int + _abc_negative_cache: _weakrefset.WeakSet + _abc_negative_cache_version: int + _abc_registry: _weakrefset.WeakSet + def __init__(self, name: str, bases: Tuple[type, ...], namespace: Dict[Any, Any]) -> None: ... + def __instancecheck__(cls: ABCMeta, instance: Any) -> Any: ... + def __subclasscheck__(cls: ABCMeta, subclass: Any) -> Any: ... + def _dump_registry(cls: ABCMeta, *args: Any, **kwargs: Any) -> None: ... + def register(cls: ABCMeta, subclass: Type[Any]) -> None: ... + +# TODO: The real abc.abstractproperty inherits from "property". +class abstractproperty(object): + def __new__(cls, func: Any) -> Any: ... + __isabstractmethod__: bool + doc: Any + fdel: Any + fget: Any + fset: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/ast.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/ast.pyi new file mode 100644 index 0000000..c5ffd65 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/ast.pyi @@ -0,0 +1,28 @@ +# Python 2.7 ast + +# Rename typing to _typing, as not to conflict with typing imported +# from _ast below when loaded in an unorthodox way by the Dropbox +# internal Bazel integration. +import typing as _typing +from typing import Any, Iterator, Optional, Union + +from _ast import * +from _ast import AST, Module + +def parse(source: Union[str, unicode], filename: Union[str, unicode] = ..., mode: Union[str, unicode] = ...) -> Module: ... +def copy_location(new_node: AST, old_node: AST) -> AST: ... +def dump(node: AST, annotate_fields: bool = ..., include_attributes: bool = ...) -> str: ... +def fix_missing_locations(node: AST) -> AST: ... +def get_docstring(node: AST, clean: bool = ...) -> str: ... +def increment_lineno(node: AST, n: int = ...) -> AST: ... +def iter_child_nodes(node: AST) -> Iterator[AST]: ... +def iter_fields(node: AST) -> Iterator[_typing.Tuple[str, Any]]: ... +def literal_eval(node_or_string: Union[str, unicode, AST]) -> Any: ... +def walk(node: AST) -> Iterator[AST]: ... + +class NodeVisitor(): + def visit(self, node: AST) -> Any: ... + def generic_visit(self, node: AST) -> Any: ... + +class NodeTransformer(NodeVisitor): + def generic_visit(self, node: AST) -> Optional[AST]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/atexit.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/atexit.pyi new file mode 100644 index 0000000..13d2602 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/atexit.pyi @@ -0,0 +1,5 @@ +from typing import TypeVar, Any + +_FT = TypeVar('_FT') + +def register(func: _FT, *args: Any, **kargs: Any) -> _FT: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/cPickle.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/cPickle.pyi new file mode 100644 index 0000000..0421c50 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/cPickle.pyi @@ -0,0 +1,32 @@ +from typing import Any, IO, List + +HIGHEST_PROTOCOL: int +compatible_formats: List[str] +format_version: str + +class Pickler: + def __init__(self, file: IO[str], protocol: int = ...) -> None: ... + + def dump(self, obj: Any) -> None: ... + + def clear_memo(self) -> None: ... + + +class Unpickler: + def __init__(self, file: IO[str]) -> None: ... + + def load(self) -> Any: ... + + def noload(self) -> Any: ... + + +def dump(obj: Any, file: IO[str], protocol: int = ...) -> None: ... +def dumps(obj: Any, protocol: int = ...) -> str: ... +def load(file: IO[str]) -> Any: ... +def loads(str: str) -> Any: ... + +class PickleError(Exception): ... +class UnpicklingError(PickleError): ... +class BadPickleGet(UnpicklingError): ... +class PicklingError(PickleError): ... +class UnpickleableError(PicklingError): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/cStringIO.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/cStringIO.pyi new file mode 100644 index 0000000..380e3a4 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/cStringIO.pyi @@ -0,0 +1,54 @@ +# Stubs for cStringIO (Python 2.7) +# See https://docs.python.org/2/library/stringio.html + +from abc import ABCMeta +from typing import overload, IO, List, Iterable, Iterator, Optional, Union +from types import TracebackType + +# TODO the typing.IO[] generics should be split into input and output. + +# This class isn't actually abstract, but you can't instantiate it +# directly, so we might as well treat it as abstract in the stub. +class InputType(IO[str], Iterator[str], metaclass=ABCMeta): + def getvalue(self) -> str: ... + def close(self) -> None: ... + @property + def closed(self) -> bool: ... + def flush(self) -> None: ... + def isatty(self) -> bool: ... + def read(self, size: int = ...) -> str: ... + def readline(self, size: int = ...) -> str: ... + def readlines(self, hint: int = ...) -> List[str]: ... + def seek(self, offset: int, whence: int = ...) -> int: ... + def tell(self) -> int: ... + def truncate(self, size: Optional[int] = ...) -> int: ... + def __iter__(self) -> InputType: ... + def next(self) -> str: ... + def reset(self) -> None: ... + + +class OutputType(IO[str], Iterator[str], metaclass=ABCMeta): + @property + def softspace(self) -> int: ... + def getvalue(self) -> str: ... + def close(self) -> None: ... + @property + def closed(self) -> bool: ... + def flush(self) -> None: ... + def isatty(self) -> bool: ... + def read(self, size: int = ...) -> str: ... + def readline(self, size: int = ...) -> str: ... + def readlines(self, hint: int = ...) -> List[str]: ... + def seek(self, offset: int, whence: int = ...) -> int: ... + def tell(self) -> int: ... + def truncate(self, size: Optional[int] = ...) -> int: ... + def __iter__(self) -> OutputType: ... + def next(self) -> str: ... + def reset(self) -> None: ... + def write(self, b: Union[str, unicode]) -> int: ... + def writelines(self, lines: Iterable[Union[str, unicode]]) -> None: ... + +@overload +def StringIO() -> OutputType: ... +@overload +def StringIO(s: str) -> InputType: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/collections.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/collections.pyi new file mode 100644 index 0000000..0daa118 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/collections.pyi @@ -0,0 +1,126 @@ +# These are not exported. +from typing import Dict, Generic, TypeVar, Tuple, overload, Type, Optional, List, Union, Reversible + +# These are exported. +from typing import ( + Callable as Callable, + Container as Container, + Hashable as Hashable, + ItemsView as ItemsView, + Iterable as Iterable, + Iterator as Iterator, + KeysView as KeysView, + Mapping as Mapping, + MappingView as MappingView, + MutableMapping as MutableMapping, + MutableSequence as MutableSequence, + MutableSet as MutableSet, + Sequence as Sequence, + AbstractSet as Set, + Sized as Sized, + ValuesView as ValuesView, +) + +_S = TypeVar('_S') +_T = TypeVar('_T') +_KT = TypeVar('_KT') +_VT = TypeVar('_VT') + +# namedtuple is special-cased in the type checker; the initializer is ignored. +def namedtuple(typename: Union[str, unicode], field_names: Union[str, unicode, Iterable[Union[str, unicode]]], + verbose: bool = ..., rename: bool = ...) -> Type[tuple]: ... + +class deque(Sized, Iterable[_T], Reversible[_T], Generic[_T]): + def __init__(self, iterable: Iterable[_T] = ..., + maxlen: int = ...) -> None: ... + @property + def maxlen(self) -> Optional[int]: ... + def append(self, x: _T) -> None: ... + def appendleft(self, x: _T) -> None: ... + def clear(self) -> None: ... + def count(self, x: _T) -> int: ... + def extend(self, iterable: Iterable[_T]) -> None: ... + def extendleft(self, iterable: Iterable[_T]) -> None: ... + def pop(self) -> _T: ... + def popleft(self) -> _T: ... + def remove(self, value: _T) -> None: ... + def reverse(self) -> None: ... + def rotate(self, n: int) -> None: ... + def __len__(self) -> int: ... + def __iter__(self) -> Iterator[_T]: ... + def __str__(self) -> str: ... + def __hash__(self) -> int: ... + def __getitem__(self, i: int) -> _T: ... + def __setitem__(self, i: int, x: _T) -> None: ... + def __contains__(self, o: _T) -> bool: ... + def __reversed__(self) -> Iterator[_T]: ... + def __iadd__(self: _S, iterable: Iterable[_T]) -> _S: ... + +_CounterT = TypeVar('_CounterT', bound=Counter) + +class Counter(Dict[_T, int], Generic[_T]): + @overload + def __init__(self, **kwargs: int) -> None: ... + @overload + def __init__(self, mapping: Mapping[_T, int]) -> None: ... + @overload + def __init__(self, iterable: Iterable[_T]) -> None: ... + def copy(self: _CounterT) -> _CounterT: ... + def elements(self) -> Iterator[_T]: ... + def most_common(self, n: Optional[int] = ...) -> List[Tuple[_T, int]]: ... + @overload + def subtract(self, __mapping: Mapping[_T, int]) -> None: ... + @overload + def subtract(self, iterable: Iterable[_T]) -> None: ... + # The Iterable[Tuple[...]] argument type is not actually desirable + # (the tuples will be added as keys, breaking type safety) but + # it's included so that the signature is compatible with + # Dict.update. Not sure if we should use '# type: ignore' instead + # and omit the type from the union. + @overload + def update(self, __m: Mapping[_T, int], **kwargs: int) -> None: ... + @overload + def update(self, __m: Union[Iterable[_T], Iterable[Tuple[_T, int]]], **kwargs: int) -> None: ... + @overload + def update(self, **kwargs: int) -> None: ... + + def __add__(self, other: Counter[_T]) -> Counter[_T]: ... + def __sub__(self, other: Counter[_T]) -> Counter[_T]: ... + def __and__(self, other: Counter[_T]) -> Counter[_T]: ... + def __or__(self, other: Counter[_T]) -> Counter[_T]: ... + def __iadd__(self, other: Counter[_T]) -> Counter[_T]: ... + def __isub__(self, other: Counter[_T]) -> Counter[_T]: ... + def __iand__(self, other: Counter[_T]) -> Counter[_T]: ... + def __ior__(self, other: Counter[_T]) -> Counter[_T]: ... + +_OrderedDictT = TypeVar('_OrderedDictT', bound=OrderedDict) + +class OrderedDict(Dict[_KT, _VT], Reversible[_KT], Generic[_KT, _VT]): + def popitem(self, last: bool = ...) -> Tuple[_KT, _VT]: ... + def copy(self: _OrderedDictT) -> _OrderedDictT: ... + def __reversed__(self) -> Iterator[_KT]: ... + +_DefaultDictT = TypeVar('_DefaultDictT', bound=defaultdict) + +class defaultdict(Dict[_KT, _VT], Generic[_KT, _VT]): + default_factory: Callable[[], _VT] + @overload + def __init__(self, **kwargs: _VT) -> None: ... + @overload + def __init__(self, default_factory: Optional[Callable[[], _VT]]) -> None: ... + @overload + def __init__(self, default_factory: Optional[Callable[[], _VT]], **kwargs: _VT) -> None: ... + @overload + def __init__(self, default_factory: Optional[Callable[[], _VT]], + map: Mapping[_KT, _VT]) -> None: ... + @overload + def __init__(self, default_factory: Optional[Callable[[], _VT]], + map: Mapping[_KT, _VT], **kwargs: _VT) -> None: ... + @overload + def __init__(self, default_factory: Optional[Callable[[], _VT]], + iterable: Iterable[Tuple[_KT, _VT]]) -> None: ... + @overload + def __init__(self, default_factory: Optional[Callable[[], _VT]], + iterable: Iterable[Tuple[_KT, _VT]], **kwargs: _VT) -> None: ... + def __missing__(self, key: _KT) -> _VT: ... + def copy(self: _DefaultDictT) -> _DefaultDictT: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/commands.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/commands.pyi new file mode 100644 index 0000000..e321f08 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/commands.pyi @@ -0,0 +1,12 @@ +from typing import overload, AnyStr, Text, Tuple + +def getstatus(file: Text) -> str: ... +def getoutput(cmd: Text) -> str: ... +def getstatusoutput(cmd: Text) -> Tuple[int, str]: ... + +@overload +def mk2arg(head: bytes, x: bytes) -> bytes: ... +@overload +def mk2arg(head: Text, x: Text) -> Text: ... + +def mkarg(x: AnyStr) -> AnyStr: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/compileall.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/compileall.pyi new file mode 100644 index 0000000..c3e861e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/compileall.pyi @@ -0,0 +1,10 @@ +# Stubs for compileall (Python 2) + +from typing import Optional, Pattern, Union + +_Path = Union[str, bytes] + +# rx can be any object with a 'search' method; once we have Protocols we can change the type +def compile_dir(dir: _Path, maxlevels: int = ..., ddir: Optional[_Path] = ..., force: bool = ..., rx: Optional[Pattern] = ..., quiet: int = ...) -> int: ... +def compile_file(fullname: _Path, ddir: Optional[_Path] = ..., force: bool = ..., rx: Optional[Pattern] = ..., quiet: int = ...) -> int: ... +def compile_path(skip_curdir: bool = ..., maxlevels: int = ..., force: bool = ..., quiet: int = ...) -> int: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/cookielib.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/cookielib.pyi new file mode 100644 index 0000000..5bc4781 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/cookielib.pyi @@ -0,0 +1,110 @@ +from typing import Any, Optional + +class Cookie: + version: Any + name: Any + value: Any + port: Any + port_specified: Any + domain: Any + domain_specified: Any + domain_initial_dot: Any + path: Any + path_specified: Any + secure: Any + expires: Any + discard: Any + comment: Any + comment_url: Any + rfc2109: Any + def __init__(self, version, name, value, port, port_specified, domain, domain_specified, domain_initial_dot, path, + path_specified, secure, expires, discard, comment, comment_url, rest, rfc2109: bool = ...): ... + def has_nonstandard_attr(self, name): ... + def get_nonstandard_attr(self, name, default: Optional[Any] = ...): ... + def set_nonstandard_attr(self, name, value): ... + def is_expired(self, now: Optional[Any] = ...): ... + +class CookiePolicy: + def set_ok(self, cookie, request): ... + def return_ok(self, cookie, request): ... + def domain_return_ok(self, domain, request): ... + def path_return_ok(self, path, request): ... + +class DefaultCookiePolicy(CookiePolicy): + DomainStrictNoDots: Any + DomainStrictNonDomain: Any + DomainRFC2965Match: Any + DomainLiberal: Any + DomainStrict: Any + netscape: Any + rfc2965: Any + rfc2109_as_netscape: Any + hide_cookie2: Any + strict_domain: Any + strict_rfc2965_unverifiable: Any + strict_ns_unverifiable: Any + strict_ns_domain: Any + strict_ns_set_initial_dollar: Any + strict_ns_set_path: Any + def __init__(self, blocked_domains: Optional[Any] = ..., allowed_domains: Optional[Any] = ..., netscape: bool = ..., + rfc2965: bool = ..., rfc2109_as_netscape: Optional[Any] = ..., hide_cookie2: bool = ..., + strict_domain: bool = ..., strict_rfc2965_unverifiable: bool = ..., strict_ns_unverifiable: bool = ..., + strict_ns_domain=..., strict_ns_set_initial_dollar: bool = ..., strict_ns_set_path: bool = ...): ... + def blocked_domains(self): ... + def set_blocked_domains(self, blocked_domains): ... + def is_blocked(self, domain): ... + def allowed_domains(self): ... + def set_allowed_domains(self, allowed_domains): ... + def is_not_allowed(self, domain): ... + def set_ok(self, cookie, request): ... + def set_ok_version(self, cookie, request): ... + def set_ok_verifiability(self, cookie, request): ... + def set_ok_name(self, cookie, request): ... + def set_ok_path(self, cookie, request): ... + def set_ok_domain(self, cookie, request): ... + def set_ok_port(self, cookie, request): ... + def return_ok(self, cookie, request): ... + def return_ok_version(self, cookie, request): ... + def return_ok_verifiability(self, cookie, request): ... + def return_ok_secure(self, cookie, request): ... + def return_ok_expires(self, cookie, request): ... + def return_ok_port(self, cookie, request): ... + def return_ok_domain(self, cookie, request): ... + def domain_return_ok(self, domain, request): ... + def path_return_ok(self, path, request): ... + +class Absent: ... + +class CookieJar: + non_word_re: Any + quote_re: Any + strict_domain_re: Any + domain_re: Any + dots_re: Any + magic_re: Any + def __init__(self, policy: Optional[Any] = ...): ... + def set_policy(self, policy): ... + def add_cookie_header(self, request): ... + def make_cookies(self, response, request): ... + def set_cookie_if_ok(self, cookie, request): ... + def set_cookie(self, cookie): ... + def extract_cookies(self, response, request): ... + def clear(self, domain: Optional[Any] = ..., path: Optional[Any] = ..., name: Optional[Any] = ...): ... + def clear_session_cookies(self): ... + def clear_expired_cookies(self): ... + def __iter__(self): ... + def __len__(self): ... + +class LoadError(IOError): ... + +class FileCookieJar(CookieJar): + filename: Any + delayload: Any + def __init__(self, filename: Optional[Any] = ..., delayload: bool = ..., policy: Optional[Any] = ...): ... + def save(self, filename: Optional[Any] = ..., ignore_discard: bool = ..., ignore_expires: bool = ...): ... + def load(self, filename: Optional[Any] = ..., ignore_discard: bool = ..., ignore_expires: bool = ...): ... + def revert(self, filename: Optional[Any] = ..., ignore_discard: bool = ..., ignore_expires: bool = ...): ... + +MozillaCookieJar = FileCookieJar +LWPCookieJar = FileCookieJar +def lwp_cookie_str(cookie: Cookie) -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/dircache.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/dircache.pyi new file mode 100644 index 0000000..ac6732b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/dircache.pyi @@ -0,0 +1,10 @@ +# Source: https://hg.python.org/cpython/file/2.7/Lib/dircache.py + +from typing import List, MutableSequence, Text, Union + +def reset() -> None: ... +def listdir(path: Text) -> List[str]: ... + +opendir = listdir + +def annotate(head: Text, list: Union[MutableSequence[str], MutableSequence[Text], MutableSequence[Union[str, Text]]]) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/distutils/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/distutils/__init__.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/distutils/emxccompiler.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/distutils/emxccompiler.pyi new file mode 100644 index 0000000..97e4a29 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/distutils/emxccompiler.pyi @@ -0,0 +1,5 @@ +# Stubs for emxccompiler + +from distutils.unixccompiler import UnixCCompiler + +class EMXCCompiler(UnixCCompiler): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/dummy_thread.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/dummy_thread.pyi new file mode 100644 index 0000000..2804100 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/dummy_thread.pyi @@ -0,0 +1,21 @@ +from typing import Any, Callable, Dict, NoReturn, Optional, Tuple + +class error(Exception): + def __init__(self, *args: Any) -> None: ... + +def start_new_thread(function: Callable[..., Any], args: Tuple[Any, ...], kwargs: Dict[str, Any] = ...) -> None: ... +def exit() -> NoReturn: ... +def get_ident() -> int: ... +def allocate_lock() -> LockType: ... +def stack_size(size: Optional[int] = ...) -> int: ... + +class LockType(object): + locked_status: bool + def __init__(self) -> None: ... + def acquire(self, waitflag: Optional[bool] = ...) -> bool: ... + def __enter__(self, waitflag: Optional[bool] = ...) -> bool: ... + def __exit__(self, typ: Any, val: Any, tb: Any) -> None: ... + def release(self) -> bool: ... + def locked(self) -> bool: ... + +def interrupt_main() -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/email/MIMEText.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/email/MIMEText.pyi new file mode 100644 index 0000000..3b05977 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/email/MIMEText.pyi @@ -0,0 +1,4 @@ +from email.mime.nonmultipart import MIMENonMultipart + +class MIMEText(MIMENonMultipart): + def __init__(self, _text, _subtype=..., _charset=...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/email/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/email/__init__.pyi new file mode 100644 index 0000000..384d956 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/email/__init__.pyi @@ -0,0 +1,6 @@ +from typing import IO, Any, AnyStr + +def message_from_string(s: AnyStr, *args, **kwargs): ... +def message_from_bytes(s: str, *args, **kwargs): ... +def message_from_file(fp: IO[AnyStr], *args, **kwargs): ... +def message_from_binary_file(fp: IO[str], *args, **kwargs): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/email/_parseaddr.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/email/_parseaddr.pyi new file mode 100644 index 0000000..424ade7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/email/_parseaddr.pyi @@ -0,0 +1,40 @@ +from typing import Any, Optional + +def parsedate_tz(data): ... +def parsedate(data): ... +def mktime_tz(data): ... +def quote(str): ... + +class AddrlistClass: + specials: Any + pos: Any + LWS: Any + CR: Any + FWS: Any + atomends: Any + phraseends: Any + field: Any + commentlist: Any + def __init__(self, field): ... + def gotonext(self): ... + def getaddrlist(self): ... + def getaddress(self): ... + def getrouteaddr(self): ... + def getaddrspec(self): ... + def getdomain(self): ... + def getdelimited(self, beginchar, endchars, allowcomments: bool = ...): ... + def getquote(self): ... + def getcomment(self): ... + def getdomainliteral(self): ... + def getatom(self, atomends: Optional[Any] = ...): ... + def getphraselist(self): ... + +class AddressList(AddrlistClass): + addresslist: Any + def __init__(self, field): ... + def __len__(self): ... + def __add__(self, other): ... + def __iadd__(self, other): ... + def __sub__(self, other): ... + def __isub__(self, other): ... + def __getitem__(self, index): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/email/base64mime.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/email/base64mime.pyi new file mode 100644 index 0000000..f05003b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/email/base64mime.pyi @@ -0,0 +1,8 @@ +def base64_len(s: bytes) -> int: ... +def header_encode(header, charset=..., keep_eols=..., maxlinelen=..., eol=...): ... +def encode(s, binary=..., maxlinelen=..., eol=...): ... +body_encode = encode +encodestring = encode +def decode(s, convert_eols=...): ... +body_decode = decode +decodestring = decode diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/email/charset.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/email/charset.pyi new file mode 100644 index 0000000..88b5f88 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/email/charset.pyi @@ -0,0 +1,26 @@ +def add_charset(charset, header_enc=..., body_enc=..., output_charset=...) -> None: ... +def add_alias(alias, canonical) -> None: ... +def add_codec(charset, codecname) -> None: ... + +QP: int # undocumented +BASE64: int # undocumented +SHORTEST: int # undocumented + +class Charset: + input_charset = ... + header_encoding = ... + body_encoding = ... + output_charset = ... + input_codec = ... + output_codec = ... + def __init__(self, input_charset=...) -> None: ... + def __eq__(self, other): ... + def __ne__(self, other): ... + def get_body_encoding(self): ... + def convert(self, s): ... + def to_splittable(self, s): ... + def from_splittable(self, ustr, to_output: bool = ...): ... + def get_output_charset(self): ... + def encoded_header_len(self, s): ... + def header_encode(self, s, convert: bool = ...): ... + def body_encode(self, s, convert: bool = ...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/email/encoders.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/email/encoders.pyi new file mode 100644 index 0000000..5670cba --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/email/encoders.pyi @@ -0,0 +1,4 @@ +def encode_base64(msg) -> None: ... +def encode_quopri(msg) -> None: ... +def encode_7or8bit(msg) -> None: ... +def encode_noop(msg) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/email/feedparser.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/email/feedparser.pyi new file mode 100644 index 0000000..51f8259 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/email/feedparser.pyi @@ -0,0 +1,18 @@ +class BufferedSubFile: + def __init__(self) -> None: ... + def push_eof_matcher(self, pred) -> None: ... + def pop_eof_matcher(self): ... + def close(self) -> None: ... + def readline(self): ... + def unreadline(self, line) -> None: ... + def push(self, data): ... + def pushlines(self, lines) -> None: ... + def is_closed(self): ... + def __iter__(self): ... + def next(self): ... + + +class FeedParser: + def __init__(self, _factory=...) -> None: ... + def feed(self, data) -> None: ... + def close(self): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/email/generator.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/email/generator.pyi new file mode 100644 index 0000000..96cfe2d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/email/generator.pyi @@ -0,0 +1,9 @@ +class Generator: + def __init__(self, outfp, mangle_from_: bool = ..., maxheaderlen: int = ...) -> None: ... + def write(self, s) -> None: ... + def flatten(self, msg, unixfrom: bool = ...) -> None: ... + def clone(self, fp): ... + + +class DecodedGenerator(Generator): + def __init__(self, outfp, mangle_from_: bool = ..., maxheaderlen: int = ..., fmt=...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/email/header.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/email/header.pyi new file mode 100644 index 0000000..69c9363 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/email/header.pyi @@ -0,0 +1,11 @@ +def decode_header(header): ... +def make_header(decoded_seq, maxlinelen=..., header_name=..., continuation_ws=...): ... + +class Header: + def __init__(self, s=..., charset=..., maxlinelen=..., header_name=..., continuation_ws=..., + errors=...) -> None: ... + def __unicode__(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + def append(self, s, charset=..., errors=...) -> None: ... + def encode(self, splitchars=...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/email/iterators.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/email/iterators.pyi new file mode 100644 index 0000000..48aaf06 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/email/iterators.pyi @@ -0,0 +1,5 @@ +from typing import Generator + +def walk(self) -> Generator: ... +def body_line_iterator(msg, decode: bool = ...) -> Generator: ... +def typed_subpart_iterator(msg, maintype=..., subtype=...) -> Generator: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/email/message.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/email/message.pyi new file mode 100644 index 0000000..bd3c622 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/email/message.pyi @@ -0,0 +1,45 @@ +from typing import Generator + +class Message: + preamble = ... + epilogue = ... + defects = ... + def __init__(self): ... + def as_string(self, unixfrom=...): ... + def is_multipart(self) -> bool: ... + def set_unixfrom(self, unixfrom) -> None: ... + def get_unixfrom(self): ... + def attach(self, payload) -> None: ... + def get_payload(self, i=..., decode: bool = ...): ... + def set_payload(self, payload, charset=...) -> None: ... + def set_charset(self, charset): ... + def get_charset(self): ... + def __len__(self): ... + def __getitem__(self, name): ... + def __setitem__(self, name, val) -> None: ... + def __delitem__(self, name) -> None: ... + def __contains__(self, name): ... + def has_key(self, name) -> bool: ... + def keys(self): ... + def values(self): ... + def items(self): ... + def get(self, name, failobj=...): ... + def get_all(self, name, failobj=...): ... + def add_header(self, _name, _value, **_params) -> None: ... + def replace_header(self, _name, _value) -> None: ... + def get_content_type(self): ... + def get_content_maintype(self): ... + def get_content_subtype(self): ... + def get_default_type(self): ... + def set_default_type(self, ctype) -> None: ... + def get_params(self, failobj=..., header=..., unquote: bool = ...): ... + def get_param(self, param, failobj=..., header=..., unquote: bool = ...): ... + def set_param(self, param, value, header=..., requote: bool = ..., charset=..., language=...) -> None: ... + def del_param(self, param, header=..., requote: bool = ...): ... + def set_type(self, type, header=..., requote: bool = ...): ... + def get_filename(self, failobj=...): ... + def get_boundary(self, failobj=...): ... + def set_boundary(self, boundary) -> None: ... + def get_content_charset(self, failobj=...): ... + def get_charsets(self, failobj=...): ... + def walk(self) -> Generator: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/email/mime/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/email/mime/__init__.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/email/mime/application.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/email/mime/application.pyi new file mode 100644 index 0000000..99da672 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/email/mime/application.pyi @@ -0,0 +1,11 @@ +# Stubs for email.mime.application + +from typing import Callable, Optional, Tuple, Union +from email.mime.nonmultipart import MIMENonMultipart + +_ParamsType = Union[str, None, Tuple[str, Optional[str], str]] + +class MIMEApplication(MIMENonMultipart): + def __init__(self, _data: bytes, _subtype: str = ..., + _encoder: Callable[[MIMEApplication], None] = ..., + **_params: _ParamsType) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/email/mime/audio.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/email/mime/audio.pyi new file mode 100644 index 0000000..406ade1 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/email/mime/audio.pyi @@ -0,0 +1,5 @@ +from email.mime.nonmultipart import MIMENonMultipart + + +class MIMEAudio(MIMENonMultipart): + def __init__(self, _audiodata, _subtype=..., _encoder=..., **_params) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/email/mime/base.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/email/mime/base.pyi new file mode 100644 index 0000000..4bde4f0 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/email/mime/base.pyi @@ -0,0 +1,4 @@ +from email import message + +class MIMEBase(message.Message): + def __init__(self, _maintype, _subtype, **_params) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/email/mime/image.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/email/mime/image.pyi new file mode 100644 index 0000000..2dfb098 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/email/mime/image.pyi @@ -0,0 +1,5 @@ +from email.mime.nonmultipart import MIMENonMultipart + + +class MIMEImage(MIMENonMultipart): + def __init__(self, _imagedata, _subtype=..., _encoder=..., **_params) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/email/mime/message.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/email/mime/message.pyi new file mode 100644 index 0000000..33552fa --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/email/mime/message.pyi @@ -0,0 +1,5 @@ +from email.mime.nonmultipart import MIMENonMultipart + + +class MIMEMessage(MIMENonMultipart): + def __init__(self, _msg, _subtype=...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/email/mime/multipart.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/email/mime/multipart.pyi new file mode 100644 index 0000000..0a7d3fa --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/email/mime/multipart.pyi @@ -0,0 +1,4 @@ +from email.mime.base import MIMEBase + +class MIMEMultipart(MIMEBase): + def __init__(self, _subtype=..., boundary=..., _subparts=..., **_params) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/email/mime/nonmultipart.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/email/mime/nonmultipart.pyi new file mode 100644 index 0000000..04d130e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/email/mime/nonmultipart.pyi @@ -0,0 +1,4 @@ +from email.mime.base import MIMEBase + +class MIMENonMultipart(MIMEBase): + def attach(self, payload): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/email/mime/text.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/email/mime/text.pyi new file mode 100644 index 0000000..3b05977 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/email/mime/text.pyi @@ -0,0 +1,4 @@ +from email.mime.nonmultipart import MIMENonMultipart + +class MIMEText(MIMENonMultipart): + def __init__(self, _text, _subtype=..., _charset=...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/email/parser.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/email/parser.pyi new file mode 100644 index 0000000..4f22828 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/email/parser.pyi @@ -0,0 +1,10 @@ +from .feedparser import FeedParser as FeedParser # not in __all__ but listed in documentation + +class Parser: + def __init__(self, *args, **kws) -> None: ... + def parse(self, fp, headersonly: bool = ...): ... + def parsestr(self, text, headersonly: bool = ...): ... + +class HeaderParser(Parser): + def parse(self, fp, headersonly: bool = ...): ... + def parsestr(self, text, headersonly: bool = ...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/email/quoprimime.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/email/quoprimime.pyi new file mode 100644 index 0000000..3f2963c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/email/quoprimime.pyi @@ -0,0 +1,18 @@ +def header_quopri_check(c): ... +def body_quopri_check(c): ... +def header_quopri_len(s): ... +def body_quopri_len(str): ... +def unquote(s): ... +def quote(c): ... +def header_encode(header, charset: str = ..., keep_eols: bool = ..., maxlinelen: int = ..., eol=...): ... +def encode(body, binary: bool = ..., maxlinelen: int = ..., eol=...): ... + +body_encode = encode +encodestring = encode + +def decode(encoded, eol=...): ... + +body_decode = decode +decodestring = decode + +def header_decode(s): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/email/utils.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/email/utils.pyi new file mode 100644 index 0000000..7b868ef --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/email/utils.pyi @@ -0,0 +1,19 @@ +from email._parseaddr import AddressList as _AddressList +from email._parseaddr import mktime_tz as mktime_tz +from email._parseaddr import parsedate as _parsedate +from email._parseaddr import parsedate_tz as _parsedate_tz +from quopri import decodestring as _qdecode +from typing import Optional, Any + +def formataddr(pair): ... +def getaddresses(fieldvalues): ... +def formatdate(timeval: Optional[Any] = ..., localtime: bool = ..., usegmt: bool = ...): ... +def make_msgid(idstring: Optional[Any] = ...): ... +def parsedate(data): ... +def parsedate_tz(data): ... +def parseaddr(addr): ... +def unquote(str): ... +def decode_rfc2231(s): ... +def encode_rfc2231(s, charset: Optional[Any] = ..., language: Optional[Any] = ...): ... +def decode_params(params): ... +def collapse_rfc2231_value(value, errors=..., fallback_charset=...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/encodings/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/encodings/__init__.pyi new file mode 100644 index 0000000..2ae6c0a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/encodings/__init__.pyi @@ -0,0 +1,6 @@ +import codecs + +import typing + +def search_function(encoding: str) -> codecs.CodecInfo: + ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/encodings/utf_8.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/encodings/utf_8.pyi new file mode 100644 index 0000000..d38bd58 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/encodings/utf_8.pyi @@ -0,0 +1,15 @@ +import codecs +from typing import Text, Tuple + +class IncrementalEncoder(codecs.IncrementalEncoder): + def encode(self, input: Text, final: bool = ...) -> bytes: ... + +class IncrementalDecoder(codecs.BufferedIncrementalDecoder): + def _buffer_decode(self, input: bytes, errors: str, final: bool) -> Tuple[Text, int]: ... + +class StreamWriter(codecs.StreamWriter): ... +class StreamReader(codecs.StreamReader): ... + +def getregentry() -> codecs.CodecInfo: ... +def encode(input: Text, errors: Text = ...) -> bytes: ... +def decode(input: bytes, errors: Text = ...) -> Text: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/exceptions.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/exceptions.pyi new file mode 100644 index 0000000..6e4bafc --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/exceptions.pyi @@ -0,0 +1,48 @@ +from __builtin__ import ArithmeticError as ArithmeticError +from __builtin__ import AssertionError as AssertionError +from __builtin__ import AttributeError as AttributeError +from __builtin__ import BaseException as BaseException +from __builtin__ import BufferError as BufferError +from __builtin__ import BytesWarning as BytesWarning +from __builtin__ import DeprecationWarning as DeprecationWarning +from __builtin__ import EOFError as EOFError +from __builtin__ import EnvironmentError as EnvironmentError +from __builtin__ import Exception as Exception +from __builtin__ import FloatingPointError as FloatingPointError +from __builtin__ import FutureWarning as FutureWarning +from __builtin__ import GeneratorExit as GeneratorExit +from __builtin__ import IOError as IOError +from __builtin__ import ImportError as ImportError +from __builtin__ import ImportWarning as ImportWarning +from __builtin__ import IndentationError as IndentationError +from __builtin__ import IndexError as IndexError +from __builtin__ import KeyError as KeyError +from __builtin__ import KeyboardInterrupt as KeyboardInterrupt +from __builtin__ import LookupError as LookupError +from __builtin__ import MemoryError as MemoryError +from __builtin__ import NameError as NameError +from __builtin__ import NotImplementedError as NotImplementedError +from __builtin__ import OSError as OSError +from __builtin__ import OverflowError as OverflowError +from __builtin__ import PendingDeprecationWarning as PendingDeprecationWarning +from __builtin__ import ReferenceError as ReferenceError +from __builtin__ import RuntimeError as RuntimeError +from __builtin__ import RuntimeWarning as RuntimeWarning +from __builtin__ import StandardError as StandardError +from __builtin__ import StopIteration as StopIteration +from __builtin__ import SyntaxError as SyntaxError +from __builtin__ import SyntaxWarning as SyntaxWarning +from __builtin__ import SystemError as SystemError +from __builtin__ import SystemExit as SystemExit +from __builtin__ import TabError as TabError +from __builtin__ import TypeError as TypeError +from __builtin__ import UnboundLocalError as UnboundLocalError +from __builtin__ import UnicodeError as UnicodeError +from __builtin__ import UnicodeDecodeError as UnicodeDecodeError +from __builtin__ import UnicodeEncodeError as UnicodeEncodeError +from __builtin__ import UnicodeTranslateError as UnicodeTranslateError +from __builtin__ import UnicodeWarning as UnicodeWarning +from __builtin__ import UserWarning as UserWarning +from __builtin__ import ValueError as ValueError +from __builtin__ import Warning as Warning +from __builtin__ import ZeroDivisionError as ZeroDivisionError diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/fcntl.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/fcntl.pyi new file mode 100644 index 0000000..5ba64ae --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/fcntl.pyi @@ -0,0 +1,87 @@ +from typing import Any, Union, IO +import io + +FASYNC: int +FD_CLOEXEC: int + +DN_ACCESS: int +DN_ATTRIB: int +DN_CREATE: int +DN_DELETE: int +DN_MODIFY: int +DN_MULTISHOT: int +DN_RENAME: int +F_DUPFD: int +F_EXLCK: int +F_GETFD: int +F_GETFL: int +F_GETLEASE: int +F_GETLK: int +F_GETLK64: int +F_GETOWN: int +F_GETSIG: int +F_NOTIFY: int +F_RDLCK: int +F_SETFD: int +F_SETFL: int +F_SETLEASE: int +F_SETLK: int +F_SETLK64: int +F_SETLKW: int +F_SETLKW64: int +F_SETOWN: int +F_SETSIG: int +F_SHLCK: int +F_UNLCK: int +F_WRLCK: int +I_ATMARK: int +I_CANPUT: int +I_CKBAND: int +I_FDINSERT: int +I_FIND: int +I_FLUSH: int +I_FLUSHBAND: int +I_GETBAND: int +I_GETCLTIME: int +I_GETSIG: int +I_GRDOPT: int +I_GWROPT: int +I_LINK: int +I_LIST: int +I_LOOK: int +I_NREAD: int +I_PEEK: int +I_PLINK: int +I_POP: int +I_PUNLINK: int +I_PUSH: int +I_RECVFD: int +I_SENDFD: int +I_SETCLTIME: int +I_SETSIG: int +I_SRDOPT: int +I_STR: int +I_SWROPT: int +I_UNLINK: int +LOCK_EX: int +LOCK_MAND: int +LOCK_NB: int +LOCK_READ: int +LOCK_RW: int +LOCK_SH: int +LOCK_UN: int +LOCK_WRITE: int + +_ANYFILE = Union[int, IO] + +# TODO All these return either int or bytes depending on the value of +# cmd (not on the type of arg). +def fcntl(fd: _ANYFILE, op: int, arg: Union[int, bytes] = ...) -> Any: ... + +# TODO: arg: int or read-only buffer interface or read-write buffer interface +def ioctl(fd: _ANYFILE, op: int, arg: Union[int, bytes] = ..., + mutate_flag: bool = ...) -> Any: ... + +def flock(fd: _ANYFILE, op: int) -> None: ... +def lockf(fd: _ANYFILE, op: int, length: int = ..., start: int = ..., + whence: int = ...) -> Any: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/fnmatch.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/fnmatch.pyi new file mode 100644 index 0000000..e933b7b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/fnmatch.pyi @@ -0,0 +1,8 @@ +from typing import AnyStr, Iterable, List, Union + +_EitherStr = Union[str, unicode] + +def fnmatch(filename: _EitherStr, pattern: _EitherStr) -> bool: ... +def fnmatchcase(filename: _EitherStr, pattern: _EitherStr) -> bool: ... +def filter(names: Iterable[AnyStr], pattern: _EitherStr) -> List[AnyStr]: ... +def translate(pattern: AnyStr) -> AnyStr: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/functools.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/functools.pyi new file mode 100644 index 0000000..c12af8f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/functools.pyi @@ -0,0 +1,101 @@ +# Stubs for functools (Python 2.7) + +# NOTE: These are incomplete! + +from abc import ABCMeta, abstractmethod +from typing import Any, Callable, Generic, Dict, Iterable, Optional, Sequence, Tuple, TypeVar, overload +from collections import namedtuple + +_AnyCallable = Callable[..., Any] + +_T = TypeVar("_T") +_T2 = TypeVar("_T2") +_T3 = TypeVar("_T3") +_T4 = TypeVar("_T4") +_T5 = TypeVar("_T5") +_S = TypeVar("_S") +@overload +def reduce(function: Callable[[_T, _T], _T], + sequence: Iterable[_T]) -> _T: ... +@overload +def reduce(function: Callable[[_T, _S], _T], + sequence: Iterable[_S], initial: _T) -> _T: ... + +WRAPPER_ASSIGNMENTS: Sequence[str] +WRAPPER_UPDATES: Sequence[str] + +def update_wrapper(wrapper: _AnyCallable, wrapped: _AnyCallable, assigned: Sequence[str] = ..., + updated: Sequence[str] = ...) -> _AnyCallable: ... +def wraps(wrapped: _AnyCallable, assigned: Sequence[str] = ..., updated: Sequence[str] = ...) -> Callable[[_AnyCallable], _AnyCallable]: ... +def total_ordering(cls: type) -> type: ... +def cmp_to_key(mycmp: Callable[[_T, _T], int]) -> Callable[[_T], Any]: ... + +@overload +def partial(__func: Callable[[_T], _S], __arg: _T) -> Callable[[], _S]: ... +@overload +def partial(__func: Callable[[_T, _T2], _S], __arg: _T) -> Callable[[_T2], _S]: ... +@overload +def partial(__func: Callable[[_T, _T2, _T3], _S], __arg: _T) -> Callable[[_T2, _T3], _S]: ... +@overload +def partial(__func: Callable[[_T, _T2, _T3, _T4], _S], __arg: _T) -> Callable[[_T2, _T3, _T4], _S]: ... +@overload +def partial(__func: Callable[[_T, _T2, _T3, _T4, _T5], _S], __arg: _T) -> Callable[[_T2, _T3, _T4, _T5], _S]: ... + +@overload +def partial(__func: Callable[[_T, _T2], _S], + __arg1: _T, + __arg2: _T2) -> Callable[[], _S]: ... +@overload +def partial(__func: Callable[[_T, _T2, _T3], _S], + __arg1: _T, + __arg2: _T2) -> Callable[[_T3], _S]: ... +@overload +def partial(__func: Callable[[_T, _T2, _T3, _T4], _S], + __arg1: _T, + __arg2: _T2) -> Callable[[_T3, _T4], _S]: ... +@overload +def partial(__func: Callable[[_T, _T2, _T3, _T4, _T5], _S], + __arg1: _T, + __arg2: _T2) -> Callable[[_T3, _T4, _T5], _S]: ... + +@overload +def partial(__func: Callable[[_T, _T2, _T3], _S], + __arg1: _T, + __arg2: _T2, + __arg3: _T3) -> Callable[[], _S]: ... +@overload +def partial(__func: Callable[[_T, _T2, _T3, _T4], _S], + __arg1: _T, + __arg2: _T2, + __arg3: _T3) -> Callable[[_T4], _S]: ... +@overload +def partial(__func: Callable[[_T, _T2, _T3, _T4, _T5], _S], + __arg1: _T, + __arg2: _T2, + __arg3: _T3) -> Callable[[_T4, _T5], _S]: ... + +@overload +def partial(__func: Callable[[_T, _T2, _T3, _T4], _S], + __arg1: _T, + __arg2: _T2, + __arg3: _T3, + __arg4: _T4) -> Callable[[], _S]: ... +@overload +def partial(__func: Callable[[_T, _T2, _T3, _T4, _T5], _S], + __arg1: _T, + __arg2: _T2, + __arg3: _T3, + __arg4: _T4) -> Callable[[_T5], _S]: ... + +@overload +def partial(__func: Callable[[_T, _T2, _T3, _T4, _T5], _S], + __arg1: _T, + __arg2: _T2, + __arg3: _T3, + __arg4: _T4, + __arg5: _T5) -> Callable[[], _S]: ... + +@overload +def partial(__func: Callable[..., _S], + *args: Any, + **kwargs: Any) -> Callable[..., _S]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/future_builtins.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/future_builtins.pyi new file mode 100644 index 0000000..a9b25b2 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/future_builtins.pyi @@ -0,0 +1,14 @@ +from typing import Any + +from itertools import ifilter as filter +from itertools import imap as map +from itertools import izip as zip + + +def ascii(obj: Any) -> str: ... + + +def hex(x: int) -> str: ... + + +def oct(x: int) -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/gc.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/gc.pyi new file mode 100644 index 0000000..cdfae74 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/gc.pyi @@ -0,0 +1,29 @@ +# Stubs for gc + +from typing import Any, List, Tuple + + +def enable() -> None: ... +def disable() -> None: ... +def isenabled() -> bool: ... +def collect(generation: int = ...) -> int: ... +def set_debug(flags: int) -> None: ... +def get_debug() -> int: ... +def get_objects() -> List[Any]: ... +def set_threshold(threshold0: int, threshold1: int = ..., + threshold2: int = ...) -> None: ... +def get_count() -> Tuple[int, int, int]: ... +def get_threshold() -> Tuple[int, int, int]: ... +def get_referrers(*objs: Any) -> List[Any]: ... +def get_referents(*objs: Any) -> List[Any]: ... +def is_tracked(obj: Any) -> bool: ... + +garbage: List[Any] + +DEBUG_STATS: int +DEBUG_COLLECTABLE: int +DEBUG_UNCOLLECTABLE: int +DEBUG_INSTANCES: int +DEBUG_OBJECTS: int +DEBUG_SAVEALL: int +DEBUG_LEAK: int diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/getopt.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/getopt.pyi new file mode 100644 index 0000000..370d4d5 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/getopt.pyi @@ -0,0 +1,12 @@ +from typing import List, Tuple + +class GetoptError(Exception): + opt: str + msg: str + def __init__(self, msg: str, opt: str = ...) -> None: ... + def __str__(self) -> str: ... + +error = GetoptError + +def getopt(args: List[str], shortopts: str, longopts: List[str] = ...) -> Tuple[List[Tuple[str, str]], List[str]]: ... +def gnu_getopt(args: List[str], shortopts: str, longopts: List[str] = ...) -> Tuple[List[Tuple[str, str]], List[str]]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/getpass.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/getpass.pyi new file mode 100644 index 0000000..011fc8e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/getpass.pyi @@ -0,0 +1,8 @@ +# Stubs for getpass (Python 2) + +from typing import Any, IO + +class GetPassWarning(UserWarning): ... + +def getpass(prompt: str = ..., stream: IO[Any] = ...) -> str: ... +def getuser() -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/gettext.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/gettext.pyi new file mode 100644 index 0000000..c7bfceb --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/gettext.pyi @@ -0,0 +1,41 @@ +from typing import Any, Container, Dict, IO, List, Optional, Sequence, Type, Union + +def bindtextdomain(domain: str, localedir: str = ...) -> str: ... +def bind_textdomain_codeset(domain: str, codeset: str = ...) -> str: ... +def textdomain(domain: str = ...) -> str: ... +def gettext(message: str) -> str: ... +def lgettext(message: str) -> str: ... +def dgettext(domain: str, message: str) -> str: ... +def ldgettext(domain: str, message: str) -> str: ... +def ngettext(singular: str, plural: str, n: int) -> str: ... +def lngettext(singular: str, plural: str, n: int) -> str: ... +def dngettext(domain: str, singular: str, plural: str, n: int) -> str: ... +def ldngettext(domain: str, singular: str, plural: str, n: int) -> str: ... + +class NullTranslations(object): + def __init__(self, fp: IO[str] = ...) -> None: ... + def _parse(self, fp: IO[str]) -> None: ... + def add_fallback(self, fallback: NullTranslations) -> None: ... + def gettext(self, message: str) -> str: ... + def lgettext(self, message: str) -> str: ... + def ugettext(self, message: Union[str, unicode]) -> unicode: ... + def ngettext(self, singular: str, plural: str, n: int) -> str: ... + def lngettext(self, singular: str, plural: str, n: int) -> str: ... + def ungettext(self, singular: Union[str, unicode], plural: Union[str, unicode], n: int) -> unicode: ... + def info(self) -> Dict[str, str]: ... + def charset(self) -> Optional[str]: ... + def output_charset(self) -> Optional[str]: ... + def set_output_charset(self, charset: Optional[str]) -> None: ... + def install(self, unicode: bool = ..., names: Container[str] = ...) -> None: ... + +class GNUTranslations(NullTranslations): + LE_MAGIC: int + BE_MAGIC: int + +def find(domain: str, localedir: Optional[str] = ..., languages: Optional[Sequence[str]] = ..., + all: Any = ...) -> Optional[Union[str, List[str]]]: ... + +def translation(domain: str, localedir: Optional[str] = ..., languages: Optional[Sequence[str]] = ..., + class_: Optional[Type[NullTranslations]] = ..., fallback: bool = ..., codeset: Optional[str] = ...) -> NullTranslations: ... +def install(domain: str, localedir: Optional[str] = ..., unicode: bool = ..., codeset: Optional[str] = ..., + names: Container[str] = ...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/glob.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/glob.pyi new file mode 100644 index 0000000..5caa166 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/glob.pyi @@ -0,0 +1,7 @@ +from typing import List, Iterator, Union, AnyStr + +def glob(pathname: AnyStr) -> List[AnyStr]: ... +def iglob(pathname: AnyStr) -> Iterator[AnyStr]: ... +def glob1(dirname: Union[str, unicode], pattern: AnyStr) -> List[AnyStr]: ... +def glob0(dirname: Union[str, unicode], basename: AnyStr) -> List[AnyStr]: ... +def has_magic(s: Union[str, unicode]) -> bool: ... # undocumented diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/gzip.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/gzip.pyi new file mode 100644 index 0000000..50c38e4 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/gzip.pyi @@ -0,0 +1,37 @@ +from typing import Any, IO, Text +import io + +class GzipFile(io.BufferedIOBase): + myfileobj: Any + max_read_chunk: Any + mode: Any + extrabuf: Any + extrasize: Any + extrastart: Any + name: Any + min_readsize: Any + compress: Any + fileobj: Any + offset: Any + mtime: Any + def __init__(self, filename: str = ..., mode: Text = ..., compresslevel: int = ..., + fileobj: IO[str] = ..., mtime: float = ...) -> None: ... + @property + def filename(self): ... + size: Any + crc: Any + def write(self, data): ... + def read(self, size=...): ... + @property + def closed(self): ... + def close(self): ... + def flush(self, zlib_mode=...): ... + def fileno(self): ... + def rewind(self): ... + def readable(self): ... + def writable(self): ... + def seekable(self): ... + def seek(self, offset, whence=...): ... + def readline(self, size=...): ... + +def open(filename: str, mode: Text = ..., compresslevel: int = ...) -> GzipFile: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/hashlib.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/hashlib.pyi new file mode 100644 index 0000000..2228820 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/hashlib.pyi @@ -0,0 +1,31 @@ +# Stubs for hashlib (Python 2) + +from typing import Tuple, Union + +_DataType = Union[str, unicode, bytearray, buffer, memoryview] + +class _hash(object): # This is not actually in the module namespace. + name: str + block_size = 0 + digest_size = 0 + digestsize = 0 + def __init__(self, arg: _DataType = ...) -> None: ... + def update(self, arg: _DataType) -> None: ... + def digest(self) -> str: ... + def hexdigest(self) -> str: ... + def copy(self) -> _hash: ... + +def new(name: str, data: str = ...) -> _hash: ... + +def md5(s: _DataType = ...) -> _hash: ... +def sha1(s: _DataType = ...) -> _hash: ... +def sha224(s: _DataType = ...) -> _hash: ... +def sha256(s: _DataType = ...) -> _hash: ... +def sha384(s: _DataType = ...) -> _hash: ... +def sha512(s: _DataType = ...) -> _hash: ... + +algorithms: Tuple[str, ...] +algorithms_guaranteed: Tuple[str, ...] +algorithms_available: Tuple[str, ...] + +def pbkdf2_hmac(name: str, password: str, salt: str, rounds: int, dklen: int = ...) -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/heapq.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/heapq.pyi new file mode 100644 index 0000000..00abb31 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/heapq.pyi @@ -0,0 +1,16 @@ +from typing import TypeVar, List, Iterable, Any, Callable, Optional + +_T = TypeVar('_T') + +def cmp_lt(x, y) -> bool: ... +def heappush(heap: List[_T], item: _T) -> None: ... +def heappop(heap: List[_T]) -> _T: + raise IndexError() # if heap is empty +def heappushpop(heap: List[_T], item: _T) -> _T: ... +def heapify(x: List[_T]) -> None: ... +def heapreplace(heap: List[_T], item: _T) -> _T: + raise IndexError() # if heap is empty +def merge(*iterables: Iterable[_T]) -> Iterable[_T]: ... +def nlargest(n: int, iterable: Iterable[_T], + key: Optional[Callable[[_T], Any]] = ...) -> List[_T]: ... +def nsmallest(n: int, iterable: Iterable[_T]) -> List[_T]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/htmlentitydefs.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/htmlentitydefs.pyi new file mode 100644 index 0000000..6ae88e7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/htmlentitydefs.pyi @@ -0,0 +1,5 @@ +from typing import Any, Mapping + +name2codepoint: Mapping[str, int] +codepoint2name: Mapping[int, str] +entitydefs: Mapping[str, str] diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/httplib.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/httplib.pyi new file mode 100644 index 0000000..4e3843c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/httplib.pyi @@ -0,0 +1,205 @@ +# Stubs for httplib (Python 2) +# +# Generated by stubgen and manually massaged a bit. +# Needs lots more work! + +from typing import Any, Dict, Optional, Protocol +import mimetools +import ssl + +class HTTPMessage(mimetools.Message): + def addcontinue(self, key: str, more: str) -> None: ... + dict: Dict[str, str] + def addheader(self, key: str, value: str) -> None: ... + unixfrom: str + headers: Any + status: str + seekable: bool + def readheaders(self) -> None: ... + +class HTTPResponse: + fp: Any + debuglevel: Any + strict: Any + msg: Any + version: Any + status: Any + reason: Any + chunked: Any + chunk_left: Any + length: Any + will_close: Any + def __init__(self, sock, debuglevel: int = ..., strict: int = ..., method: Optional[Any] = ..., + buffering: bool = ...) -> None: ... + def begin(self): ... + def close(self): ... + def isclosed(self): ... + def read(self, amt: Optional[Any] = ...): ... + def fileno(self): ... + def getheader(self, name, default: Optional[Any] = ...): ... + def getheaders(self): ... + +# This is an API stub only for HTTPConnection and HTTPSConnection, as used in +# urllib2.AbstractHTTPHandler.do_open, which takes either the class +# HTTPConnection or the class HTTPSConnection, *not* an instance of either +# class. do_open does not use all of the parameters of HTTPConnection.__init__ +# or HTTPSConnection.__init__, so HTTPConnectionProtocol only implements the +# parameters that do_open does use. +class HTTPConnectionProtocol(Protocol): + def __call__(self, host: str, timeout: int = ..., **http_con_args: Any) -> HTTPConnection: ... + +class HTTPConnection: + response_class: Any + default_port: Any + auto_open: Any + debuglevel: Any + strict: Any + timeout: Any + source_address: Any + sock: Any + host: str = ... + port: int = ... + def __init__(self, host, port: Optional[Any] = ..., strict: Optional[Any] = ..., timeout=..., + source_address: Optional[Any] = ...) -> None: ... + def set_tunnel(self, host, port: Optional[Any] = ..., headers: Optional[Any] = ...): ... + def set_debuglevel(self, level): ... + def connect(self): ... + def close(self): ... + def send(self, data): ... + def putrequest(self, method, url, skip_host: int = ..., skip_accept_encoding: int = ...): ... + def putheader(self, header, *values): ... + def endheaders(self, message_body: Optional[Any] = ...): ... + def request(self, method, url, body: Optional[Any] = ..., headers=...): ... + def getresponse(self, buffering: bool = ...): ... + +class HTTP: + debuglevel: Any + def __init__(self, host: str = ..., port: Optional[Any] = ..., strict: Optional[Any] = ...) -> None: ... + def connect(self, host: Optional[Any] = ..., port: Optional[Any] = ...): ... + def getfile(self): ... + file: Any + headers: Any + def getreply(self, buffering: bool = ...): ... + def close(self): ... + +class HTTPSConnection(HTTPConnection): + default_port: Any + key_file: Any + cert_file: Any + def __init__(self, host, port: Optional[Any] = ..., key_file: Optional[Any] = ..., cert_file: Optional[Any] = ..., + strict: Optional[Any] = ..., timeout=..., source_address: Optional[Any] = ..., + context: Optional[Any] = ...) -> None: ... + sock: Any + def connect(self): ... + +class HTTPS(HTTP): + key_file: Any + cert_file: Any + def __init__(self, host: str = ..., port: Optional[Any] = ..., key_file: Optional[Any] = ..., cert_file: Optional[Any] = ..., strict: Optional[Any] = ..., context: Optional[Any] = ...) -> None: ... + +class HTTPException(Exception): ... +class NotConnected(HTTPException): ... +class InvalidURL(HTTPException): ... + +class UnknownProtocol(HTTPException): + args: Any + version: Any + def __init__(self, version) -> None: ... + +class UnknownTransferEncoding(HTTPException): ... +class UnimplementedFileMode(HTTPException): ... + +class IncompleteRead(HTTPException): + args: Any + partial: Any + expected: Any + def __init__(self, partial, expected: Optional[Any] = ...) -> None: ... + +class ImproperConnectionState(HTTPException): ... +class CannotSendRequest(ImproperConnectionState): ... +class CannotSendHeader(ImproperConnectionState): ... +class ResponseNotReady(ImproperConnectionState): ... + +class BadStatusLine(HTTPException): + args: Any + line: Any + def __init__(self, line) -> None: ... + +class LineTooLong(HTTPException): + def __init__(self, line_type) -> None: ... + +error: Any + +class LineAndFileWrapper: + def __init__(self, line, file) -> None: ... + def __getattr__(self, attr): ... + def read(self, amt: Optional[Any] = ...): ... + def readline(self): ... + def readlines(self, size: Optional[Any] = ...): ... + +# Constants + +responses: Dict[int, str] + +HTTP_PORT: int +HTTPS_PORT: int + +# status codes +# informational +CONTINUE: int +SWITCHING_PROTOCOLS: int +PROCESSING: int + +# successful +OK: int +CREATED: int +ACCEPTED: int +NON_AUTHORITATIVE_INFORMATION: int +NO_CONTENT: int +RESET_CONTENT: int +PARTIAL_CONTENT: int +MULTI_STATUS: int +IM_USED: int + +# redirection +MULTIPLE_CHOICES: int +MOVED_PERMANENTLY: int +FOUND: int +SEE_OTHER: int +NOT_MODIFIED: int +USE_PROXY: int +TEMPORARY_REDIRECT: int + +# client error +BAD_REQUEST: int +UNAUTHORIZED: int +PAYMENT_REQUIRED: int +FORBIDDEN: int +NOT_FOUND: int +METHOD_NOT_ALLOWED: int +NOT_ACCEPTABLE: int +PROXY_AUTHENTICATION_REQUIRED: int +REQUEST_TIMEOUT: int +CONFLICT: int +GONE: int +LENGTH_REQUIRED: int +PRECONDITION_FAILED: int +REQUEST_ENTITY_TOO_LARGE: int +REQUEST_URI_TOO_LONG: int +UNSUPPORTED_MEDIA_TYPE: int +REQUESTED_RANGE_NOT_SATISFIABLE: int +EXPECTATION_FAILED: int +UNPROCESSABLE_ENTITY: int +LOCKED: int +FAILED_DEPENDENCY: int +UPGRADE_REQUIRED: int + +# server error +INTERNAL_SERVER_ERROR: int +NOT_IMPLEMENTED: int +BAD_GATEWAY: int +SERVICE_UNAVAILABLE: int +GATEWAY_TIMEOUT: int +HTTP_VERSION_NOT_SUPPORTED: int +INSUFFICIENT_STORAGE: int +NOT_EXTENDED: int diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/imp.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/imp.pyi new file mode 100644 index 0000000..409fecb --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/imp.pyi @@ -0,0 +1,35 @@ +"""Stubs for the 'imp' module.""" + +from typing import List, Optional, Tuple, Iterable, IO, Any +import types + +C_BUILTIN: int +C_EXTENSION: int +IMP_HOOK: int +PKG_DIRECTORY: int +PY_CODERESOURCE: int +PY_COMPILED: int +PY_FROZEN: int +PY_RESOURCE: int +PY_SOURCE: int +SEARCH_ERROR: int + +def acquire_lock() -> None: ... +def find_module(name: str, path: Iterable[str] = ...) -> Optional[Tuple[str, str, Tuple[str, str, int]]]: ... +def get_magic() -> str: ... +def get_suffixes() -> List[Tuple[str, str, int]]: ... +def init_builtin(name: str) -> types.ModuleType: ... +def init_frozen(name: str) -> types.ModuleType: ... +def is_builtin(name: str) -> int: ... +def is_frozen(name: str) -> bool: ... +def load_compiled(name: str, pathname: str, file: IO[Any] = ...) -> types.ModuleType: ... +def load_dynamic(name: str, pathname: str, file: IO[Any] = ...) -> types.ModuleType: ... +def load_module(name: str, file: str, pathname: str, description: Tuple[str, str, int]) -> types.ModuleType: ... +def load_source(name: str, pathname: str, file: IO[Any] = ...) -> types.ModuleType: ... +def lock_held() -> bool: ... +def new_module(name: str) -> types.ModuleType: ... +def release_lock() -> None: ... + +class NullImporter: + def __init__(self, path_string: str) -> None: ... + def find_module(self, fullname: str, path: str = ...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/importlib.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/importlib.pyi new file mode 100644 index 0000000..8bb179a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/importlib.pyi @@ -0,0 +1,4 @@ +import types +from typing import Optional, Text + +def import_module(name: Text, package: Optional[Text] = ...) -> types.ModuleType: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/inspect.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/inspect.pyi new file mode 100644 index 0000000..8bc2eac --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/inspect.pyi @@ -0,0 +1,135 @@ +from types import CodeType, TracebackType, FrameType, ModuleType +from typing import Any, Dict, Callable, List, NamedTuple, Optional, Sequence, Tuple, Type, Union + +# Types and members +class EndOfBlock(Exception): ... + +class BlockFinder: + indent: int + islambda: bool + started: bool + passline: bool + last: int + def tokeneater(self, type: int, token: str, srow_scol: Tuple[int, int], + erow_ecol: Tuple[int, int], line: str) -> None: ... + +CO_GENERATOR: int +CO_NESTED: int +CO_NEWLOCALS: int +CO_NOFREE: int +CO_OPTIMIZED: int +CO_VARARGS: int +CO_VARKEYWORDS: int +TPFLAGS_IS_ABSTRACT: int + +ModuleInfo = NamedTuple('ModuleInfo', [('name', str), + ('suffix', str), + ('mode', str), + ('module_type', int), + ]) +def getmembers( + object: object, + predicate: Optional[Callable[[Any], bool]] = ... +) -> List[Tuple[str, Any]]: ... +def getmoduleinfo(path: str) -> Optional[ModuleInfo]: ... +def getmodulename(path: str) -> Optional[str]: ... + +def ismodule(object: object) -> bool: ... +def isclass(object: object) -> bool: ... +def ismethod(object: object) -> bool: ... +def isfunction(object: object) -> bool: ... +def isgeneratorfunction(object: object) -> bool: ... +def isgenerator(object: object) -> bool: ... +def istraceback(object: object) -> bool: ... +def isframe(object: object) -> bool: ... +def iscode(object: object) -> bool: ... +def isbuiltin(object: object) -> bool: ... +def isroutine(object: object) -> bool: ... +def isabstract(object: object) -> bool: ... +def ismethoddescriptor(object: object) -> bool: ... +def isdatadescriptor(object: object) -> bool: ... +def isgetsetdescriptor(object: object) -> bool: ... +def ismemberdescriptor(object: object) -> bool: ... + +# Retrieving source code +def findsource(object: object) -> Tuple[List[str], int]: ... +def getabsfile(object: object) -> str: ... +def getblock(lines: Sequence[str]) -> Sequence[str]: ... +def getdoc(object: object) -> str: ... +def getcomments(object: object) -> str: ... +def getfile(object: object) -> str: ... +def getmodule(object: object) -> ModuleType: ... +def getsourcefile(object: object) -> str: ... +# TODO restrict to "module, class, method, function, traceback, frame, +# or code object" +def getsourcelines(object: object) -> Tuple[List[str], int]: ... +# TODO restrict to "a module, class, method, function, traceback, frame, +# or code object" +def getsource(object: object) -> str: ... +def cleandoc(doc: str) -> str: ... +def indentsize(line: str) -> int: ... + +# Classes and functions +def getclasstree(classes: List[type], unique: bool = ...) -> List[ + Union[Tuple[type, Tuple[type, ...]], list]]: ... + +ArgSpec = NamedTuple('ArgSpec', [('args', List[str]), + ('varargs', Optional[str]), + ('keywords', Optional[str]), + ('defaults', tuple), + ]) + +ArgInfo = NamedTuple('ArgInfo', [('args', List[str]), + ('varargs', Optional[str]), + ('keywords', Optional[str]), + ('locals', Dict[str, Any]), + ]) + +Arguments = NamedTuple('Arguments', [('args', List[Union[str, List[Any]]]), + ('varargs', Optional[str]), + ('keywords', Optional[str]), + ]) + +def getargs(co: CodeType) -> Arguments: ... +def getargspec(func: object) -> ArgSpec: ... +def getargvalues(frame: FrameType) -> ArgInfo: ... +def formatargspec(args, varargs=..., varkw=..., defaults=..., + formatarg=..., formatvarargs=..., formatvarkw=..., formatvalue=..., + join=...) -> str: ... +def formatargvalues(args, varargs=..., varkw=..., defaults=..., + formatarg=..., formatvarargs=..., formatvarkw=..., formatvalue=..., + join=...) -> str: ... +def getmro(cls: type) -> Tuple[type, ...]: ... +def getcallargs(func, *args, **kwds) -> Dict[str, Any]: ... + +# The interpreter stack + +Traceback = NamedTuple( + 'Traceback', + [ + ('filename', str), + ('lineno', int), + ('function', str), + ('code_context', List[str]), + ('index', int), + ] +) + +_FrameInfo = Tuple[FrameType, str, int, str, List[str], int] + +def getouterframes(frame: FrameType, context: int = ...) -> List[_FrameInfo]: ... +def getframeinfo(frame: Union[FrameType, TracebackType], context: int = ...) -> Traceback: ... +def getinnerframes(traceback: TracebackType, context: int = ...) -> List[_FrameInfo]: ... +def getlineno(frame: FrameType) -> int: ... + +def currentframe(depth: int = ...) -> FrameType: ... +def stack(context: int = ...) -> List[_FrameInfo]: ... +def trace(context: int = ...) -> List[_FrameInfo]: ... + +Attribute = NamedTuple('Attribute', [('name', str), + ('kind', str), + ('defining_class', type), + ('object', object), + ]) + +def classify_class_attrs(cls: type) -> List[Attribute]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/io.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/io.pyi new file mode 100644 index 0000000..1ab6b90 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/io.pyi @@ -0,0 +1,42 @@ +# Stubs for io + +# Based on https://docs.python.org/2/library/io.html + +# Only a subset of functionality is included. + +from typing import List, BinaryIO, TextIO, IO, overload, Iterator, Iterable, Any, Union, Optional +import _io + +from _io import BlockingIOError as BlockingIOError +from _io import BufferedRWPair as BufferedRWPair +from _io import BufferedRandom as BufferedRandom +from _io import BufferedReader as BufferedReader +from _io import BufferedWriter as BufferedWriter +from _io import BytesIO as BytesIO +from _io import DEFAULT_BUFFER_SIZE as DEFAULT_BUFFER_SIZE +from _io import FileIO as FileIO +from _io import IncrementalNewlineDecoder as IncrementalNewlineDecoder +from _io import StringIO as StringIO +from _io import TextIOWrapper as TextIOWrapper +from _io import UnsupportedOperation as UnsupportedOperation +from _io import open as open + +def _OpenWrapper(file: Union[str, unicode, int], + mode: unicode = ..., buffering: int = ..., encoding: unicode = ..., + errors: unicode = ..., newline: unicode = ..., + closefd: bool = ...) -> IO[Any]: ... + +SEEK_SET: int +SEEK_CUR: int +SEEK_END: int + + +class IOBase(_io._IOBase): ... + +class RawIOBase(_io._RawIOBase, IOBase): ... + +class BufferedIOBase(_io._BufferedIOBase, IOBase): ... + +# Note: In the actual io.py, TextIOBase subclasses IOBase. +# (Which we don't do here because we don't want to subclass both TextIO and BinaryIO.) +class TextIOBase(_io._TextIOBase): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/itertools.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/itertools.pyi new file mode 100644 index 0000000..1c8522c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/itertools.pyi @@ -0,0 +1,165 @@ +# Stubs for itertools + +# Based on https://docs.python.org/2/library/itertools.html + +from typing import (Iterator, TypeVar, Iterable, overload, Any, Callable, Tuple, + Union, Sequence, Generic, Optional) + +_T = TypeVar('_T') +_S = TypeVar('_S') + +def count(start: int = ..., + step: int = ...) -> Iterator[int]: ... # more general types? +def cycle(iterable: Iterable[_T]) -> Iterator[_T]: ... + +def repeat(object: _T, times: int = ...) -> Iterator[_T]: ... + +def accumulate(iterable: Iterable[_T]) -> Iterator[_T]: ... + +class chain(Iterator[_T], Generic[_T]): + def __init__(self, *iterables: Iterable[_T]) -> None: ... + def next(self) -> _T: ... + def __iter__(self) -> Iterator[_T]: ... + @staticmethod + def from_iterable(iterable: Iterable[Iterable[_S]]) -> Iterator[_S]: ... + +def compress(data: Iterable[_T], selectors: Iterable[Any]) -> Iterator[_T]: ... +def dropwhile(predicate: Callable[[_T], Any], + iterable: Iterable[_T]) -> Iterator[_T]: ... +def ifilter(predicate: Optional[Callable[[_T], Any]], + iterable: Iterable[_T]) -> Iterator[_T]: ... +def ifilterfalse(predicate: Optional[Callable[[_T], Any]], + iterable: Iterable[_T]) -> Iterator[_T]: ... + +@overload +def groupby(iterable: Iterable[_T], key: None = ...) -> Iterator[Tuple[_T, Iterator[_T]]]: ... +@overload +def groupby(iterable: Iterable[_T], key: Callable[[_T], _S]) -> Iterator[Tuple[_S, Iterator[_T]]]: ... + +@overload +def islice(iterable: Iterable[_T], stop: Optional[int]) -> Iterator[_T]: ... +@overload +def islice(iterable: Iterable[_T], start: Optional[int], stop: Optional[int], + step: Optional[int] = ...) -> Iterator[_T]: ... + +_T1 = TypeVar('_T1') +_T2 = TypeVar('_T2') +_T3 = TypeVar('_T3') +_T4 = TypeVar('_T4') +_T5 = TypeVar('_T5') +_T6 = TypeVar('_T6') + +@overload +def imap(func: Callable[[_T1], _S], iter1: Iterable[_T1]) -> Iterator[_S]: ... +@overload +def imap(func: Callable[[_T1, _T2], _S], + iter1: Iterable[_T1], + iter2: Iterable[_T2]) -> Iterator[_S]: ... +@overload +def imap(func: Callable[[_T1, _T2, _T3], _S], + iter1: Iterable[_T1], iter2: Iterable[_T2], + iter3: Iterable[_T3]) -> Iterator[_S]: ... + +@overload +def imap(func: Callable[[_T1, _T2, _T3, _T4], _S], + iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], + iter4: Iterable[_T4]) -> Iterator[_S]: ... + +@overload +def imap(func: Callable[[_T1, _T2, _T3, _T4, _T5], _S], + iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], + iter4: Iterable[_T4], iter5: Iterable[_T5]) -> Iterator[_S]: ... + +@overload +def imap(func: Callable[[_T1, _T2, _T3, _T4, _T5, _T6], _S], + iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], + iter4: Iterable[_T4], iter5: Iterable[_T5], + iter6: Iterable[_T6]) -> Iterator[_S]: ... + +@overload +def imap(func: Callable[..., _S], + iter1: Iterable[Any], iter2: Iterable[Any], iter3: Iterable[Any], + iter4: Iterable[Any], iter5: Iterable[Any], iter6: Iterable[Any], + iter7: Iterable[Any], *iterables: Iterable[Any]) -> Iterator[_S]: ... + +def starmap(func: Any, iterable: Iterable[Any]) -> Iterator[Any]: ... +def takewhile(predicate: Callable[[_T], Any], + iterable: Iterable[_T]) -> Iterator[_T]: ... +def tee(iterable: Iterable[_T], n: int = ...) -> Tuple[Iterator[_T], ...]: ... + +@overload +def izip(iter1: Iterable[_T1]) -> Iterator[Tuple[_T1]]: ... +@overload +def izip(iter1: Iterable[_T1], + iter2: Iterable[_T2]) -> Iterator[Tuple[_T1, _T2]]: ... +@overload +def izip(iter1: Iterable[_T1], iter2: Iterable[_T2], + iter3: Iterable[_T3]) -> Iterator[Tuple[_T1, _T2, _T3]]: ... +@overload +def izip(iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], + iter4: Iterable[_T4]) -> Iterator[Tuple[_T1, _T2, + _T3, _T4]]: ... +@overload +def izip(iter1: Iterable[_T1], iter2: Iterable[_T2], + iter3: Iterable[_T3], iter4: Iterable[_T4], + iter5: Iterable[_T5]) -> Iterator[Tuple[_T1, _T2, + _T3, _T4, _T5]]: ... +@overload +def izip(iter1: Iterable[_T1], iter2: Iterable[_T2], + iter3: Iterable[_T3], iter4: Iterable[_T4], + iter5: Iterable[_T5], iter6: Iterable[_T6]) -> Iterator[Tuple[_T1, _T2, _T3, + _T4, _T5, _T6]]: ... +@overload +def izip(iter1: Iterable[Any], iter2: Iterable[Any], + iter3: Iterable[Any], iter4: Iterable[Any], + iter5: Iterable[Any], iter6: Iterable[Any], + iter7: Iterable[Any], *iterables: Iterable[Any]) -> Iterator[Tuple[Any, ...]]: ... + +def izip_longest(*p: Iterable[Any], + fillvalue: Any = ...) -> Iterator[Any]: ... + +@overload +def product(iter1: Iterable[_T1]) -> Iterator[Tuple[_T1]]: ... +@overload +def product(iter1: Iterable[_T1], + iter2: Iterable[_T2]) -> Iterator[Tuple[_T1, _T2]]: ... +@overload +def product(iter1: Iterable[_T1], + iter2: Iterable[_T2], + iter3: Iterable[_T3]) -> Iterator[Tuple[_T1, _T2, _T3]]: ... +@overload +def product(iter1: Iterable[_T1], + iter2: Iterable[_T2], + iter3: Iterable[_T3], + iter4: Iterable[_T4]) -> Iterator[Tuple[_T1, _T2, _T3, _T4]]: ... +@overload +def product(iter1: Iterable[_T1], + iter2: Iterable[_T2], + iter3: Iterable[_T3], + iter4: Iterable[_T4], + iter5: Iterable[_T5]) -> Iterator[Tuple[_T1, _T2, _T3, _T4, _T5]]: ... +@overload +def product(iter1: Iterable[_T1], + iter2: Iterable[_T2], + iter3: Iterable[_T3], + iter4: Iterable[_T4], + iter5: Iterable[_T5], + iter6: Iterable[_T6]) -> Iterator[Tuple[_T1, _T2, _T3, _T4, _T5, _T6]]: ... +@overload +def product(iter1: Iterable[Any], + iter2: Iterable[Any], + iter3: Iterable[Any], + iter4: Iterable[Any], + iter5: Iterable[Any], + iter6: Iterable[Any], + iter7: Iterable[Any], + *iterables: Iterable[Any]) -> Iterator[Tuple[Any, ...]]: ... +@overload +def product(*iterables: Iterable[Any], repeat: int) -> Iterator[Tuple[Any, ...]]: ... + +def permutations(iterable: Iterable[_T], + r: int = ...) -> Iterator[Sequence[_T]]: ... +def combinations(iterable: Iterable[_T], + r: int) -> Iterator[Sequence[_T]]: ... +def combinations_with_replacement(iterable: Iterable[_T], + r: int) -> Iterator[Sequence[_T]]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/json.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/json.pyi new file mode 100644 index 0000000..9cc151b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/json.pyi @@ -0,0 +1,96 @@ +from typing import Any, IO, Optional, Tuple, Callable, Dict, List, Union, Text, Protocol + +class JSONDecodeError(ValueError): + def dumps(self, obj: Any) -> str: ... + def dump(self, obj: Any, fp: IO[str], *args: Any, **kwds: Any) -> None: ... + def loads(self, s: str) -> Any: ... + def load(self, fp: IO[str]) -> Any: ... + +def dumps(obj: Any, + skipkeys: bool = ..., + ensure_ascii: bool = ..., + check_circular: bool = ..., + allow_nan: bool = ..., + cls: Any = ..., + indent: Optional[int] = ..., + separators: Optional[Tuple[str, str]] = ..., + encoding: str = ..., + default: Optional[Callable[[Any], Any]] = ..., + sort_keys: bool = ..., + **kwds: Any) -> str: ... + +def dump(obj: Any, + fp: Union[IO[str], IO[Text]], + skipkeys: bool = ..., + ensure_ascii: bool = ..., + check_circular: bool = ..., + allow_nan: bool = ..., + cls: Any = ..., + indent: Optional[int] = ..., + separators: Optional[Tuple[str, str]] = ..., + encoding: str = ..., + default: Optional[Callable[[Any], Any]] = ..., + sort_keys: bool = ..., + **kwds: Any) -> None: ... + +def loads(s: Union[Text, bytes], + encoding: Any = ..., + cls: Any = ..., + object_hook: Optional[Callable[[Dict], Any]] = ..., + parse_float: Optional[Callable[[str], Any]] = ..., + parse_int: Optional[Callable[[str], Any]] = ..., + parse_constant: Optional[Callable[[str], Any]] = ..., + object_pairs_hook: Optional[Callable[[List[Tuple[Any, Any]]], Any]] = ..., + **kwds: Any) -> Any: ... + +class _Reader(Protocol): + def read(self) -> Union[Text, bytes]: ... + +def load(fp: _Reader, + encoding: Optional[str] = ..., + cls: Any = ..., + object_hook: Optional[Callable[[Dict], Any]] = ..., + parse_float: Optional[Callable[[str], Any]] = ..., + parse_int: Optional[Callable[[str], Any]] = ..., + parse_constant: Optional[Callable[[str], Any]] = ..., + object_pairs_hook: Optional[Callable[[List[Tuple[Any, Any]]], Any]] = ..., + **kwds: Any) -> Any: ... + +class JSONDecoder(object): + def __init__(self, + encoding: Union[Text, bytes] = ..., + object_hook: Callable[..., Any] = ..., + parse_float: Callable[[str], float] = ..., + parse_int: Callable[[str], int] = ..., + parse_constant: Callable[[str], Any] = ..., + strict: bool = ..., + object_pairs_hook: Callable[..., Any] = ...) -> None: ... + def decode(self, s: Union[Text, bytes], _w: Any = ...) -> Any: ... + def raw_decode(self, s: Union[Text, bytes], idx: int = ...) -> Tuple[Any, Any]: ... + +class JSONEncoder(object): + item_separator: str + key_separator: str + skipkeys: bool + ensure_ascii: bool + check_circular: bool + allow_nan: bool + sort_keys: bool + indent: Optional[int] + + def __init__(self, + skipkeys: bool = ..., + ensure_ascii: bool = ..., + check_circular: bool = ..., + allow_nan: bool = ..., + sort_keys: bool = ..., + indent: Optional[int] = ..., + separators: Tuple[Union[Text, bytes], Union[Text, bytes]] = ..., + encoding: Union[Text, bytes] = ..., + default: Callable[..., Any] = ...) -> None: ... + + def default(self, o: Any) -> Any: ... + + def encode(self, o: Any) -> str: ... + + def iterencode(self, o: Any, _one_shot: bool = ...) -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/markupbase.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/markupbase.pyi new file mode 100644 index 0000000..358ba16 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/markupbase.pyi @@ -0,0 +1,9 @@ +from typing import Tuple + +class ParserBase(object): + def __init__(self) -> None: ... + def error(self, message: str) -> None: ... + def reset(self) -> None: ... + def getpos(self) -> Tuple[int, int]: ... + + def unknown_decl(self, data: str) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/md5.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/md5.pyi new file mode 100644 index 0000000..fe6ad71 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/md5.pyi @@ -0,0 +1,6 @@ +# Stubs for Python 2.7 md5 stdlib module + +from hashlib import md5 as md5, md5 as new + +blocksize = 0 +digest_size = 0 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/mimetools.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/mimetools.pyi new file mode 100644 index 0000000..f565202 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/mimetools.pyi @@ -0,0 +1,27 @@ +from typing import Any +import rfc822 + +class Message(rfc822.Message): + encodingheader: Any + typeheader: Any + def __init__(self, fp, seekable: int = ...): ... + plisttext: Any + type: Any + maintype: Any + subtype: Any + def parsetype(self): ... + plist: Any + def parseplist(self): ... + def getplist(self): ... + def getparam(self, name): ... + def getparamnames(self): ... + def getencoding(self): ... + def gettype(self): ... + def getmaintype(self): ... + def getsubtype(self): ... + +def choose_boundary(): ... +def decode(input, output, encoding): ... +def encode(input, output, encoding): ... +def copyliteral(input, output): ... +def copybinary(input, output): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/multiprocessing/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/multiprocessing/__init__.pyi new file mode 100644 index 0000000..fb00b24 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/multiprocessing/__init__.pyi @@ -0,0 +1,50 @@ +from typing import Any, Callable, Optional, TypeVar, Iterable + +from multiprocessing import pool +from multiprocessing.process import Process as Process, current_process as current_process, active_children as active_children +from multiprocessing.util import SUBDEBUG as SUBDEBUG, SUBWARNING as SUBWARNING +from Queue import Queue as _BaseQueue + +class ProcessError(Exception): ... +class BufferTooShort(ProcessError): ... +class TimeoutError(ProcessError): ... +class AuthenticationError(ProcessError): ... + +_T = TypeVar('_T') + +class Queue(_BaseQueue[_T]): + def __init__(self, maxsize: int = ...) -> None: ... + def get(self, block: bool = ..., timeout: Optional[float] = ...) -> _T: ... + def put(self, item: _T, block: bool = ..., timeout: Optional[float] = ...) -> None: ... + def qsize(self) -> int: ... + def empty(self) -> bool: ... + def full(self) -> bool: ... + def put_nowait(self, item: _T) -> None: ... + def get_nowait(self) -> _T: ... + def close(self) -> None: ... + def join_thread(self) -> None: ... + def cancel_join_thread(self) -> None: ... + +def Manager(): ... +def Pipe(duplex: bool = ...): ... +def cpu_count() -> int: ... +def freeze_support(): ... +def get_logger(): ... +def log_to_stderr(level: Optional[Any] = ...): ... +def allow_connection_pickling(): ... +def Lock(): ... +def RLock(): ... +def Condition(lock: Optional[Any] = ...): ... +def Semaphore(value: int = ...): ... +def BoundedSemaphore(value: int = ...): ... +def Event(): ... +def JoinableQueue(maxsize: int = ...): ... +def RawValue(typecode_or_type, *args): ... +def RawArray(typecode_or_type, size_or_initializer): ... +def Value(typecode_or_type, *args, **kwds): ... +def Array(typecode_or_type, size_or_initializer, **kwds): ... + +def Pool(processes: Optional[int] = ..., + initializer: Optional[Callable[..., Any]] = ..., + initargs: Iterable[Any] = ..., + maxtasksperchild: Optional[int] = ...) -> pool.Pool: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/multiprocessing/dummy/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/multiprocessing/dummy/__init__.pyi new file mode 100644 index 0000000..e8e02eb --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/multiprocessing/dummy/__init__.pyi @@ -0,0 +1,51 @@ +from typing import Any, Optional, List, Type + +import threading +import sys +import weakref +import array +import itertools + +from multiprocessing import TimeoutError, cpu_count +from multiprocessing.dummy.connection import Pipe +from threading import Lock, RLock, Semaphore, BoundedSemaphore +from threading import Event +from Queue import Queue + + +class DummyProcess(threading.Thread): + _children: weakref.WeakKeyDictionary + _parent: threading.Thread + _pid: None + _start_called: bool + def __init__(self, group=..., target=..., name=..., args=..., kwargs=...) -> None: ... + @property + def exitcode(self) -> Optional[int]: ... + + +Process = DummyProcess + +# This should be threading._Condition but threading.pyi exports it as Condition +class Condition(threading.Condition): + notify_all: Any + +class Namespace(object): + def __init__(self, **kwds) -> None: ... + +class Value(object): + _typecode: Any + _value: Any + value: Any + def __init__(self, typecode, value, lock=...) -> None: ... + def _get(self) -> Any: ... + def _set(self, value) -> None: ... + +JoinableQueue = Queue + +def Array(typecode, sequence, lock=...) -> array.array: ... +def Manager() -> Any: ... +def Pool(processes=..., initializer=..., initargs=...) -> Any: ... +def active_children() -> List: ... +def current_process() -> threading.Thread: ... +def freeze_support() -> None: ... +def shutdown() -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/multiprocessing/dummy/connection.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/multiprocessing/dummy/connection.pyi new file mode 100644 index 0000000..a7a4f99 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/multiprocessing/dummy/connection.pyi @@ -0,0 +1,26 @@ +from Queue import Queue +from typing import Any, List, Optional, Tuple, Type + +families: List[None] + +class Connection(object): + _in: Any + _out: Any + recv: Any + recv_bytes: Any + send: Any + send_bytes: Any + def __init__(self, _in, _out) -> None: ... + def close(self) -> None: ... + def poll(self, timeout=...) -> Any: ... + +class Listener(object): + _backlog_queue: Optional[Queue] + address: Any + def __init__(self, address=..., family=..., backlog=...) -> None: ... + def accept(self) -> Connection: ... + def close(self) -> None: ... + + +def Client(address) -> Connection: ... +def Pipe(duplex=...) -> Tuple[Connection, Connection]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/multiprocessing/pool.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/multiprocessing/pool.pyi new file mode 100644 index 0000000..4001a5a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/multiprocessing/pool.pyi @@ -0,0 +1,59 @@ +from typing import ( + Any, Callable, ContextManager, Iterable, Optional, Dict, List, + TypeVar, Iterator, +) + +_T = TypeVar('_T', bound=Pool) + +class AsyncResult(): + def get(self, timeout: Optional[float] = ...) -> Any: ... + def wait(self, timeout: Optional[float] = ...) -> None: ... + def ready(self) -> bool: ... + def successful(self) -> bool: ... + +class IMapIterator(Iterator[Any]): + def __iter__(self) -> Iterator[Any]: ... + def next(self, timeout: Optional[float] = ...) -> Any: ... + +class IMapUnorderedIterator(IMapIterator): ... + +class Pool(ContextManager[Pool]): + def __init__(self, processes: Optional[int] = ..., + initializer: Optional[Callable[..., None]] = ..., + initargs: Iterable[Any] = ..., + maxtasksperchild: Optional[int] = ...) -> None: ... + def apply(self, + func: Callable[..., Any], + args: Iterable[Any] = ..., + kwds: Dict[str, Any] = ...) -> Any: ... + def apply_async(self, + func: Callable[..., Any], + args: Iterable[Any] = ..., + kwds: Dict[str, Any] = ..., + callback: Optional[Callable[..., None]] = ...) -> AsyncResult: ... + def map(self, + func: Callable[..., Any], + iterable: Iterable[Any] = ..., + chunksize: Optional[int] = ...) -> List[Any]: ... + def map_async(self, func: Callable[..., Any], + iterable: Iterable[Any] = ..., + chunksize: Optional[int] = ..., + callback: Optional[Callable[..., None]] = ...) -> AsyncResult: ... + def imap(self, + func: Callable[..., Any], + iterable: Iterable[Any] = ..., + chunksize: Optional[int] = ...) -> IMapIterator: ... + def imap_unordered(self, + func: Callable[..., Any], + iterable: Iterable[Any] = ..., + chunksize: Optional[int] = ...) -> IMapIterator: ... + def close(self) -> None: ... + def terminate(self) -> None: ... + def join(self) -> None: ... + def __enter__(self: _T) -> _T: ... + +class ThreadPool(Pool, ContextManager[ThreadPool]): + + def __init__(self, processes: Optional[int] = ..., + initializer: Optional[Callable[..., Any]] = ..., + initargs: Iterable[Any] = ...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/multiprocessing/process.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/multiprocessing/process.pyi new file mode 100644 index 0000000..476b403 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/multiprocessing/process.pyi @@ -0,0 +1,36 @@ +from typing import Any, Optional + +def current_process(): ... +def active_children(): ... + +class Process: + def __init__(self, group: Optional[Any] = ..., target: Optional[Any] = ..., name: Optional[Any] = ..., args=..., + kwargs=...): ... + def run(self): ... + def start(self): ... + def terminate(self): ... + def join(self, timeout: Optional[Any] = ...): ... + def is_alive(self): ... + @property + def name(self): ... + @name.setter + def name(self, name): ... + @property + def daemon(self): ... + @daemon.setter + def daemon(self, daemonic): ... + @property + def authkey(self): ... + @authkey.setter + def authkey(self, authkey): ... + @property + def exitcode(self): ... + @property + def ident(self): ... + pid: Any + +class AuthenticationString(bytes): + def __reduce__(self): ... + +class _MainProcess(Process): + def __init__(self): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/multiprocessing/util.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/multiprocessing/util.pyi new file mode 100644 index 0000000..14d44f6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/multiprocessing/util.pyi @@ -0,0 +1,29 @@ +from typing import Any, Optional +import threading + +SUBDEBUG: Any +SUBWARNING: Any + +def sub_debug(msg, *args): ... +def debug(msg, *args): ... +def info(msg, *args): ... +def sub_warning(msg, *args): ... +def get_logger(): ... +def log_to_stderr(level: Optional[Any] = ...): ... +def get_temp_dir(): ... +def register_after_fork(obj, func): ... + +class Finalize: + def __init__(self, obj, callback, args=..., kwargs: Optional[Any] = ..., exitpriority: Optional[Any] = ...): ... + def __call__(self, wr: Optional[Any] = ...): ... + def cancel(self): ... + def still_active(self): ... + +def is_exiting(): ... + +class ForkAwareThreadLock: + def __init__(self): ... + +class ForkAwareLocal(threading.local): + def __init__(self): ... + def __reduce__(self): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/mutex.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/mutex.pyi new file mode 100644 index 0000000..8da8bfb --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/mutex.pyi @@ -0,0 +1,15 @@ +# Source: https://hg.python.org/cpython/file/2.7/Lib/mutex.py + +from collections import deque +from typing import Any, Callable, TypeVar + +_ArgType = TypeVar('_ArgType') + +class mutex: + locked: bool + queue: deque + def __init__(self) -> None: ... + def test(self) -> bool: ... + def testandset(self) -> bool: ... + def lock(self, function: Callable[[_ArgType], Any], argument: _ArgType) -> None: ... + def unlock(self) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/nturl2path.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/nturl2path.pyi new file mode 100644 index 0000000..b87b008 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/nturl2path.pyi @@ -0,0 +1,4 @@ +from typing import AnyStr + +def url2pathname(url: AnyStr) -> AnyStr: ... +def pathname2url(p: AnyStr) -> AnyStr: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/os/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/os/__init__.pyi new file mode 100644 index 0000000..2c66dc7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/os/__init__.pyi @@ -0,0 +1,369 @@ +# Stubs for os +# Ron Murawski + +from builtins import OSError as error +from io import TextIOWrapper as _TextIOWrapper +from posix import stat_result as stat_result # TODO: use this, see https://github.com/python/mypy/issues/3078 +import sys +from typing import ( + Mapping, MutableMapping, Dict, List, Any, Tuple, Iterator, overload, Union, AnyStr, + Optional, Generic, Set, Callable, Text, Sequence, IO, NamedTuple, NoReturn, TypeVar +) +from . import path as path + +_T = TypeVar('_T') + +# ----- os variables ----- + +if sys.version_info >= (3, 2): + supports_bytes_environ: bool + +if sys.version_info >= (3, 3): + supports_dir_fd: Set[Callable[..., Any]] + supports_fd: Set[Callable[..., Any]] + supports_effective_ids: Set[Callable[..., Any]] + supports_follow_symlinks: Set[Callable[..., Any]] + +SEEK_SET: int +SEEK_CUR: int +SEEK_END: int + +O_RDONLY: int +O_WRONLY: int +O_RDWR: int +O_APPEND: int +O_CREAT: int +O_EXCL: int +O_TRUNC: int +# We don't use sys.platform for O_* flags to denote platform-dependent APIs because some codes, +# including tests for mypy, use a more finer way than sys.platform before using these APIs +# See https://github.com/python/typeshed/pull/2286 for discussions +O_DSYNC: int # Unix only +O_RSYNC: int # Unix only +O_SYNC: int # Unix only +O_NDELAY: int # Unix only +O_NONBLOCK: int # Unix only +O_NOCTTY: int # Unix only +O_SHLOCK: int # Unix only +O_EXLOCK: int # Unix only +O_BINARY: int # Windows only +O_NOINHERIT: int # Windows only +O_SHORT_LIVED: int # Windows only +O_TEMPORARY: int # Windows only +O_RANDOM: int # Windows only +O_SEQUENTIAL: int # Windows only +O_TEXT: int # Windows only +O_ASYNC: int # Gnu extension if in C library +O_DIRECT: int # Gnu extension if in C library +O_DIRECTORY: int # Gnu extension if in C library +O_NOFOLLOW: int # Gnu extension if in C library +O_NOATIME: int # Gnu extension if in C library +O_LARGEFILE: int # Gnu extension if in C library + +curdir: str +pardir: str +sep: str +if sys.platform == 'win32': + altsep: str +else: + altsep: Optional[str] +extsep: str +pathsep: str +defpath: str +linesep: str +devnull: str +name: str + +F_OK: int +R_OK: int +W_OK: int +X_OK: int + +class _Environ(MutableMapping[AnyStr, AnyStr], Generic[AnyStr]): + def copy(self) -> Dict[AnyStr, AnyStr]: ... + def __delitem__(self, key: AnyStr) -> None: ... + def __getitem__(self, key: AnyStr) -> AnyStr: ... + def __setitem__(self, key: AnyStr, value: AnyStr) -> None: ... + def __iter__(self) -> Iterator[AnyStr]: ... + def __len__(self) -> int: ... + +environ: _Environ[str] +if sys.version_info >= (3, 2): + environb: _Environ[bytes] + +if sys.platform != 'win32': + # Unix only + confstr_names: Dict[str, int] + pathconf_names: Dict[str, int] + sysconf_names: Dict[str, int] + + EX_OK: int + EX_USAGE: int + EX_DATAERR: int + EX_NOINPUT: int + EX_NOUSER: int + EX_NOHOST: int + EX_UNAVAILABLE: int + EX_SOFTWARE: int + EX_OSERR: int + EX_OSFILE: int + EX_CANTCREAT: int + EX_IOERR: int + EX_TEMPFAIL: int + EX_PROTOCOL: int + EX_NOPERM: int + EX_CONFIG: int + EX_NOTFOUND: int + +P_NOWAIT: int +P_NOWAITO: int +P_WAIT: int +if sys.platform == 'win32': + P_DETACH: int + P_OVERLAY: int + +# wait()/waitpid() options +if sys.platform != 'win32': + WNOHANG: int # Unix only + WCONTINUED: int # some Unix systems + WUNTRACED: int # Unix only + +TMP_MAX: int # Undocumented, but used by tempfile + +# ----- os classes (structures) ----- +if sys.version_info >= (3, 6): + from builtins import _PathLike as PathLike # See comment in builtins + +_PathType = path._PathType + +_StatVFS = NamedTuple('_StatVFS', [('f_bsize', int), ('f_frsize', int), ('f_blocks', int), + ('f_bfree', int), ('f_bavail', int), ('f_files', int), + ('f_ffree', int), ('f_favail', int), ('f_flag', int), + ('f_namemax', int)]) + +def getlogin() -> str: ... +def getpid() -> int: ... +def getppid() -> int: ... +def strerror(code: int) -> str: ... +def umask(mask: int) -> int: ... + +if sys.platform != 'win32': + def ctermid() -> str: ... + def getegid() -> int: ... + def geteuid() -> int: ... + def getgid() -> int: ... + def getgroups() -> List[int]: ... # Unix only, behaves differently on Mac + def initgroups(username: str, gid: int) -> None: ... + def getpgid(pid: int) -> int: ... + def getpgrp() -> int: ... + def getresuid() -> Tuple[int, int, int]: ... + def getresgid() -> Tuple[int, int, int]: ... + def getuid() -> int: ... + def setegid(egid: int) -> None: ... + def seteuid(euid: int) -> None: ... + def setgid(gid: int) -> None: ... + def setgroups(groups: Sequence[int]) -> None: ... + def setpgrp() -> None: ... + def setpgid(pid: int, pgrp: int) -> None: ... + def setregid(rgid: int, egid: int) -> None: ... + def setresgid(rgid: int, egid: int, sgid: int) -> None: ... + def setresuid(ruid: int, euid: int, suid: int) -> None: ... + def setreuid(ruid: int, euid: int) -> None: ... + def getsid(pid: int) -> int: ... + def setsid() -> None: ... + def setuid(uid: int) -> None: ... + def uname() -> Tuple[str, str, str, str, str]: ... + +@overload +def getenv(key: Text) -> Optional[str]: ... +@overload +def getenv(key: Text, default: _T) -> Union[str, _T]: ... +def putenv(key: Union[bytes, Text], value: Union[bytes, Text]) -> None: ... +def unsetenv(key: Union[bytes, Text]) -> None: ... + +def fdopen(fd: int, *args, **kwargs) -> IO[Any]: ... +def close(fd: int) -> None: ... +def closerange(fd_low: int, fd_high: int) -> None: ... +def dup(fd: int) -> int: ... +def dup2(fd: int, fd2: int) -> None: ... +def fstat(fd: int) -> Any: ... +def fsync(fd: int) -> None: ... +def lseek(fd: int, pos: int, how: int) -> int: ... +def open(file: _PathType, flags: int, mode: int = ...) -> int: ... +def pipe() -> Tuple[int, int]: ... +def read(fd: int, n: int) -> bytes: ... +def write(fd: int, string: bytes) -> int: ... +def access(path: _PathType, mode: int) -> bool: ... +def chdir(path: _PathType) -> None: ... +def fchdir(fd: int) -> None: ... +def getcwd() -> str: ... +def getcwdu() -> unicode: ... +def chmod(path: _PathType, mode: int) -> None: ... +def link(src: _PathType, link_name: _PathType) -> None: ... +def listdir(path: AnyStr) -> List[AnyStr]: ... +def lstat(path: _PathType) -> Any: ... +def mknod(filename: _PathType, mode: int = ..., device: int = ...) -> None: ... +def major(device: int) -> int: ... +def minor(device: int) -> int: ... +def makedev(major: int, minor: int) -> int: ... +def mkdir(path: _PathType, mode: int = ...) -> None: ... +def makedirs(path: _PathType, mode: int = ...) -> None: ... +def readlink(path: AnyStr) -> AnyStr: ... +def remove(path: _PathType) -> None: ... +def removedirs(path: _PathType) -> None: ... +def rename(src: _PathType, dst: _PathType) -> None: ... +def renames(old: _PathType, new: _PathType) -> None: ... +def rmdir(path: _PathType) -> None: ... +def stat(path: _PathType) -> Any: ... +@overload +def stat_float_times() -> bool: ... +@overload +def stat_float_times(newvalue: bool) -> None: ... +def symlink(source: _PathType, link_name: _PathType) -> None: ... +def unlink(path: _PathType) -> None: ... +# TODO: add ns, dir_fd, follow_symlinks argument +if sys.version_info >= (3, 0): + def utime(path: _PathType, times: Optional[Tuple[float, float]] = ...) -> None: ... +else: + def utime(path: _PathType, times: Optional[Tuple[float, float]]) -> None: ... + +if sys.platform != 'win32': + # Unix only + def fchmod(fd: int, mode: int) -> None: ... + def fchown(fd: int, uid: int, gid: int) -> None: ... + if sys.platform != 'darwin': + def fdatasync(fd: int) -> None: ... # Unix only, not Mac + def fpathconf(fd: int, name: Union[str, int]) -> int: ... + def fstatvfs(fd: int) -> _StatVFS: ... + def ftruncate(fd: int, length: int) -> None: ... + def isatty(fd: int) -> bool: ... + def openpty() -> Tuple[int, int]: ... # some flavors of Unix + def tcgetpgrp(fd: int) -> int: ... + def tcsetpgrp(fd: int, pg: int) -> None: ... + def ttyname(fd: int) -> str: ... + def chflags(path: _PathType, flags: int) -> None: ... + def chroot(path: _PathType) -> None: ... + def chown(path: _PathType, uid: int, gid: int) -> None: ... + def lchflags(path: _PathType, flags: int) -> None: ... + def lchmod(path: _PathType, mode: int) -> None: ... + def lchown(path: _PathType, uid: int, gid: int) -> None: ... + def mkfifo(path: _PathType, mode: int = ...) -> None: ... + def pathconf(path: _PathType, name: Union[str, int]) -> int: ... + def statvfs(path: _PathType) -> _StatVFS: ... + +if sys.version_info >= (3, 6): + def walk(top: Union[AnyStr, PathLike[AnyStr]], topdown: bool = ..., + onerror: Optional[Callable[[OSError], Any]] = ..., + followlinks: bool = ...) -> Iterator[Tuple[AnyStr, List[AnyStr], + List[AnyStr]]]: ... +else: + def walk(top: AnyStr, topdown: bool = ..., onerror: Optional[Callable[[OSError], Any]] = ..., + followlinks: bool = ...) -> Iterator[Tuple[AnyStr, List[AnyStr], + List[AnyStr]]]: ... + +def abort() -> NoReturn: ... +# These are defined as execl(file, *args) but the first *arg is mandatory. +def execl(file: _PathType, __arg0: Union[bytes, Text], *args: Union[bytes, Text]) -> NoReturn: ... +def execlp(file: _PathType, __arg0: Union[bytes, Text], *args: Union[bytes, Text]) -> NoReturn: ... + +# These are: execle(file, *args, env) but env is pulled from the last element of the args. +def execle(file: _PathType, __arg0: Union[bytes, Text], *args: Any) -> NoReturn: ... +def execlpe(file: _PathType, __arg0: Union[bytes, Text], *args: Any) -> NoReturn: ... + +# The docs say `args: tuple or list of strings` +# The implementation enforces tuple or list so we can't use Sequence. +_ExecVArgs = Union[Tuple[Union[bytes, Text], ...], List[bytes], List[Text], List[Union[bytes, Text]]] +def execv(path: _PathType, args: _ExecVArgs) -> NoReturn: ... +def execve(path: _PathType, args: _ExecVArgs, env: Mapping[str, str]) -> NoReturn: ... +def execvp(file: _PathType, args: _ExecVArgs) -> NoReturn: ... +def execvpe(file: _PathType, args: _ExecVArgs, env: Mapping[str, str]) -> NoReturn: ... + +def _exit(n: int) -> NoReturn: ... +def kill(pid: int, sig: int) -> None: ... + +if sys.platform != 'win32': + # Unix only + def fork() -> int: ... + def forkpty() -> Tuple[int, int]: ... # some flavors of Unix + def killpg(pgid: int, sig: int) -> None: ... + def nice(increment: int) -> int: ... + def plock(op: int) -> None: ... # ???op is int? + +if sys.version_info >= (3, 0): + class popen(_TextIOWrapper): + # TODO 'b' modes or bytes command not accepted? + def __init__(self, command: str, mode: str = ..., + bufsize: int = ...) -> None: ... + def close(self) -> Any: ... # may return int +else: + def popen(command: str, *args, **kwargs) -> IO[Any]: ... + def popen2(cmd: str, *args, **kwargs) -> Tuple[IO[Any], IO[Any]]: ... + def popen3(cmd: str, *args, **kwargs) -> Tuple[IO[Any], IO[Any], IO[Any]]: ... + def popen4(cmd: str, *args, **kwargs) -> Tuple[IO[Any], IO[Any]]: ... + +def spawnl(mode: int, path: _PathType, arg0: Union[bytes, Text], *args: Union[bytes, Text]) -> int: ... +def spawnle(mode: int, path: _PathType, arg0: Union[bytes, Text], + *args: Any) -> int: ... # Imprecise sig +def spawnv(mode: int, path: _PathType, args: List[Union[bytes, Text]]) -> int: ... +def spawnve(mode: int, path: _PathType, args: List[Union[bytes, Text]], + env: Mapping[str, str]) -> int: ... +def system(command: _PathType) -> int: ... +def times() -> Tuple[float, float, float, float, float]: ... +def waitpid(pid: int, options: int) -> Tuple[int, int]: ... +def urandom(n: int) -> bytes: ... + +if sys.platform == 'win32': + def startfile(path: _PathType, operation: Optional[str] = ...) -> None: ... +else: + # Unix only + def spawnlp(mode: int, file: _PathType, arg0: Union[bytes, Text], *args: Union[bytes, Text]) -> int: ... + def spawnlpe(mode: int, file: _PathType, arg0: Union[bytes, Text], *args: Any) -> int: ... # Imprecise signature + def spawnvp(mode: int, file: _PathType, args: List[Union[bytes, Text]]) -> int: ... + def spawnvpe(mode: int, file: _PathType, args: List[Union[bytes, Text]], env: Mapping[str, str]) -> int: ... + def wait() -> Tuple[int, int]: ... + def wait3(options: int) -> Tuple[int, int, Any]: ... + def wait4(pid: int, options: int) -> Tuple[int, int, Any]: ... + def WCOREDUMP(status: int) -> bool: ... + def WIFCONTINUED(status: int) -> bool: ... + def WIFSTOPPED(status: int) -> bool: ... + def WIFSIGNALED(status: int) -> bool: ... + def WIFEXITED(status: int) -> bool: ... + def WEXITSTATUS(status: int) -> int: ... + def WSTOPSIG(status: int) -> int: ... + def WTERMSIG(status: int) -> int: ... + def confstr(name: Union[str, int]) -> Optional[str]: ... + def getloadavg() -> Tuple[float, float, float]: ... + def sysconf(name: Union[str, int]) -> int: ... + +if sys.version_info >= (3, 0): + def sched_getaffinity(id: int) -> Set[int]: ... +if sys.version_info >= (3, 3): + class waitresult: + si_pid: int + def waitid(idtype: int, id: int, options: int) -> waitresult: ... + +if sys.version_info < (3, 0): + def tmpfile() -> IO[Any]: ... + def tmpnam() -> str: ... + def tempnam(dir: str = ..., prefix: str = ...) -> str: ... + +P_ALL: int +WEXITED: int +WNOWAIT: int + +if sys.version_info >= (3, 3): + if sys.platform != 'win32': + # Unix only + def sync() -> None: ... + + def truncate(path: Union[_PathType, int], length: int) -> None: ... # Unix only up to version 3.4 + + def fwalk(top: AnyStr = ..., topdown: bool = ..., + onerror: Callable = ..., *, follow_symlinks: bool = ..., + dir_fd: int = ...) -> Iterator[Tuple[AnyStr, List[AnyStr], List[AnyStr], int]]: ... + + terminal_size = NamedTuple('terminal_size', [('columns', int), ('lines', int)]) + def get_terminal_size(fd: int = ...) -> terminal_size: ... + +if sys.version_info >= (3, 4): + def cpu_count() -> Optional[int]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/os/path.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/os/path.pyi new file mode 100644 index 0000000..c0bf576 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/os/path.pyi @@ -0,0 +1,180 @@ +# NB: path.pyi and stdlib/2 and stdlib/3 must remain consistent! +# Stubs for os.path +# Ron Murawski + +import os +import sys +from typing import ( + overload, List, Any, AnyStr, Sequence, Tuple, BinaryIO, TextIO, + TypeVar, Union, Text, Callable, Optional +) + +_T = TypeVar('_T') + +if sys.version_info >= (3, 6): + from builtins import _PathLike + _PathType = Union[bytes, Text, _PathLike] + _StrPath = Union[Text, _PathLike[Text]] + _BytesPath = Union[bytes, _PathLike[bytes]] +else: + _PathType = Union[bytes, Text] + _StrPath = Text + _BytesPath = bytes + +# ----- os.path variables ----- +supports_unicode_filenames: bool +# aliases (also in os) +curdir: str +pardir: str +sep: str +if sys.platform == 'win32': + altsep: str +else: + altsep: Optional[str] +extsep: str +pathsep: str +defpath: str +devnull: str + +# ----- os.path function stubs ----- +if sys.version_info >= (3, 6): + # Overloads are necessary to work around python/mypy#3644. + @overload + def abspath(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def abspath(path: AnyStr) -> AnyStr: ... + @overload + def basename(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def basename(path: AnyStr) -> AnyStr: ... + @overload + def dirname(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def dirname(path: AnyStr) -> AnyStr: ... + @overload + def expanduser(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def expanduser(path: AnyStr) -> AnyStr: ... + @overload + def expandvars(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def expandvars(path: AnyStr) -> AnyStr: ... + @overload + def normcase(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def normcase(path: AnyStr) -> AnyStr: ... + @overload + def normpath(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def normpath(path: AnyStr) -> AnyStr: ... + if sys.platform == 'win32': + @overload + def realpath(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def realpath(path: AnyStr) -> AnyStr: ... + else: + @overload + def realpath(filename: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def realpath(filename: AnyStr) -> AnyStr: ... + +else: + def abspath(path: AnyStr) -> AnyStr: ... + def basename(path: AnyStr) -> AnyStr: ... + def dirname(path: AnyStr) -> AnyStr: ... + def expanduser(path: AnyStr) -> AnyStr: ... + def expandvars(path: AnyStr) -> AnyStr: ... + def normcase(path: AnyStr) -> AnyStr: ... + def normpath(path: AnyStr) -> AnyStr: ... + if sys.platform == 'win32': + def realpath(path: AnyStr) -> AnyStr: ... + else: + def realpath(filename: AnyStr) -> AnyStr: ... + +if sys.version_info >= (3, 6): + # In reality it returns str for sequences of _StrPath and bytes for sequences + # of _BytesPath, but mypy does not accept such a signature. + def commonpath(paths: Sequence[_PathType]) -> Any: ... +elif sys.version_info >= (3, 5): + def commonpath(paths: Sequence[AnyStr]) -> AnyStr: ... + +# NOTE: Empty lists results in '' (str) regardless of contained type. +# Also, in Python 2 mixed sequences of Text and bytes results in either Text or bytes +# So, fall back to Any +def commonprefix(list: Sequence[_PathType]) -> Any: ... + +if sys.version_info >= (3, 3): + def exists(path: Union[_PathType, int]) -> bool: ... +else: + def exists(path: _PathType) -> bool: ... +def lexists(path: _PathType) -> bool: ... + +# These return float if os.stat_float_times() == True, +# but int is a subclass of float. +def getatime(path: _PathType) -> float: ... +def getmtime(path: _PathType) -> float: ... +def getctime(path: _PathType) -> float: ... + +def getsize(path: _PathType) -> int: ... +def isabs(path: _PathType) -> bool: ... +def isfile(path: _PathType) -> bool: ... +def isdir(path: _PathType) -> bool: ... +def islink(path: _PathType) -> bool: ... +def ismount(path: _PathType) -> bool: ... + +if sys.version_info < (3, 0): + # Make sure signatures are disjunct, and allow combinations of bytes and unicode. + # (Since Python 2 allows that, too) + # Note that e.g. os.path.join("a", "b", "c", "d", u"e") will still result in + # a type error. + @overload + def join(__p1: bytes, *p: bytes) -> bytes: ... + @overload + def join(__p1: bytes, __p2: bytes, __p3: bytes, __p4: Text, *p: _PathType) -> Text: ... + @overload + def join(__p1: bytes, __p2: bytes, __p3: Text, *p: _PathType) -> Text: ... + @overload + def join(__p1: bytes, __p2: Text, *p: _PathType) -> Text: ... + @overload + def join(__p1: Text, *p: _PathType) -> Text: ... +elif sys.version_info >= (3, 6): + # Mypy complains that the signatures overlap (same for relpath below), but things seem to behave correctly anyway. + @overload + def join(path: _StrPath, *paths: _StrPath) -> Text: ... + @overload + def join(path: _BytesPath, *paths: _BytesPath) -> bytes: ... +else: + def join(path: AnyStr, *paths: AnyStr) -> AnyStr: ... + +@overload +def relpath(path: _BytesPath, start: Optional[_BytesPath] = ...) -> bytes: ... +@overload +def relpath(path: _StrPath, start: Optional[_StrPath] = ...) -> Text: ... + +def samefile(path1: _PathType, path2: _PathType) -> bool: ... +def sameopenfile(fp1: int, fp2: int) -> bool: ... +def samestat(stat1: os.stat_result, stat2: os.stat_result) -> bool: ... + +if sys.version_info >= (3, 6): + @overload + def split(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... + @overload + def split(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitdrive(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitdrive(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitext(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitext(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... +else: + def split(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + def splitdrive(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + def splitext(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + +if sys.platform == 'win32': + def splitunc(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... # deprecated + +if sys.version_info < (3,): + def walk(path: AnyStr, visit: Callable[[_T, AnyStr, List[AnyStr]], Any], arg: _T) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/os2emxpath.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/os2emxpath.pyi new file mode 100644 index 0000000..c0bf576 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/os2emxpath.pyi @@ -0,0 +1,180 @@ +# NB: path.pyi and stdlib/2 and stdlib/3 must remain consistent! +# Stubs for os.path +# Ron Murawski + +import os +import sys +from typing import ( + overload, List, Any, AnyStr, Sequence, Tuple, BinaryIO, TextIO, + TypeVar, Union, Text, Callable, Optional +) + +_T = TypeVar('_T') + +if sys.version_info >= (3, 6): + from builtins import _PathLike + _PathType = Union[bytes, Text, _PathLike] + _StrPath = Union[Text, _PathLike[Text]] + _BytesPath = Union[bytes, _PathLike[bytes]] +else: + _PathType = Union[bytes, Text] + _StrPath = Text + _BytesPath = bytes + +# ----- os.path variables ----- +supports_unicode_filenames: bool +# aliases (also in os) +curdir: str +pardir: str +sep: str +if sys.platform == 'win32': + altsep: str +else: + altsep: Optional[str] +extsep: str +pathsep: str +defpath: str +devnull: str + +# ----- os.path function stubs ----- +if sys.version_info >= (3, 6): + # Overloads are necessary to work around python/mypy#3644. + @overload + def abspath(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def abspath(path: AnyStr) -> AnyStr: ... + @overload + def basename(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def basename(path: AnyStr) -> AnyStr: ... + @overload + def dirname(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def dirname(path: AnyStr) -> AnyStr: ... + @overload + def expanduser(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def expanduser(path: AnyStr) -> AnyStr: ... + @overload + def expandvars(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def expandvars(path: AnyStr) -> AnyStr: ... + @overload + def normcase(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def normcase(path: AnyStr) -> AnyStr: ... + @overload + def normpath(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def normpath(path: AnyStr) -> AnyStr: ... + if sys.platform == 'win32': + @overload + def realpath(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def realpath(path: AnyStr) -> AnyStr: ... + else: + @overload + def realpath(filename: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def realpath(filename: AnyStr) -> AnyStr: ... + +else: + def abspath(path: AnyStr) -> AnyStr: ... + def basename(path: AnyStr) -> AnyStr: ... + def dirname(path: AnyStr) -> AnyStr: ... + def expanduser(path: AnyStr) -> AnyStr: ... + def expandvars(path: AnyStr) -> AnyStr: ... + def normcase(path: AnyStr) -> AnyStr: ... + def normpath(path: AnyStr) -> AnyStr: ... + if sys.platform == 'win32': + def realpath(path: AnyStr) -> AnyStr: ... + else: + def realpath(filename: AnyStr) -> AnyStr: ... + +if sys.version_info >= (3, 6): + # In reality it returns str for sequences of _StrPath and bytes for sequences + # of _BytesPath, but mypy does not accept such a signature. + def commonpath(paths: Sequence[_PathType]) -> Any: ... +elif sys.version_info >= (3, 5): + def commonpath(paths: Sequence[AnyStr]) -> AnyStr: ... + +# NOTE: Empty lists results in '' (str) regardless of contained type. +# Also, in Python 2 mixed sequences of Text and bytes results in either Text or bytes +# So, fall back to Any +def commonprefix(list: Sequence[_PathType]) -> Any: ... + +if sys.version_info >= (3, 3): + def exists(path: Union[_PathType, int]) -> bool: ... +else: + def exists(path: _PathType) -> bool: ... +def lexists(path: _PathType) -> bool: ... + +# These return float if os.stat_float_times() == True, +# but int is a subclass of float. +def getatime(path: _PathType) -> float: ... +def getmtime(path: _PathType) -> float: ... +def getctime(path: _PathType) -> float: ... + +def getsize(path: _PathType) -> int: ... +def isabs(path: _PathType) -> bool: ... +def isfile(path: _PathType) -> bool: ... +def isdir(path: _PathType) -> bool: ... +def islink(path: _PathType) -> bool: ... +def ismount(path: _PathType) -> bool: ... + +if sys.version_info < (3, 0): + # Make sure signatures are disjunct, and allow combinations of bytes and unicode. + # (Since Python 2 allows that, too) + # Note that e.g. os.path.join("a", "b", "c", "d", u"e") will still result in + # a type error. + @overload + def join(__p1: bytes, *p: bytes) -> bytes: ... + @overload + def join(__p1: bytes, __p2: bytes, __p3: bytes, __p4: Text, *p: _PathType) -> Text: ... + @overload + def join(__p1: bytes, __p2: bytes, __p3: Text, *p: _PathType) -> Text: ... + @overload + def join(__p1: bytes, __p2: Text, *p: _PathType) -> Text: ... + @overload + def join(__p1: Text, *p: _PathType) -> Text: ... +elif sys.version_info >= (3, 6): + # Mypy complains that the signatures overlap (same for relpath below), but things seem to behave correctly anyway. + @overload + def join(path: _StrPath, *paths: _StrPath) -> Text: ... + @overload + def join(path: _BytesPath, *paths: _BytesPath) -> bytes: ... +else: + def join(path: AnyStr, *paths: AnyStr) -> AnyStr: ... + +@overload +def relpath(path: _BytesPath, start: Optional[_BytesPath] = ...) -> bytes: ... +@overload +def relpath(path: _StrPath, start: Optional[_StrPath] = ...) -> Text: ... + +def samefile(path1: _PathType, path2: _PathType) -> bool: ... +def sameopenfile(fp1: int, fp2: int) -> bool: ... +def samestat(stat1: os.stat_result, stat2: os.stat_result) -> bool: ... + +if sys.version_info >= (3, 6): + @overload + def split(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... + @overload + def split(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitdrive(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitdrive(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitext(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitext(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... +else: + def split(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + def splitdrive(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + def splitext(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + +if sys.platform == 'win32': + def splitunc(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... # deprecated + +if sys.version_info < (3,): + def walk(path: AnyStr, visit: Callable[[_T, AnyStr, List[AnyStr]], Any], arg: _T) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/pipes.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/pipes.pyi new file mode 100644 index 0000000..d5f5291 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/pipes.pyi @@ -0,0 +1,13 @@ +from typing import Any, IO + +class Template: + def __init__(self) -> None: ... + def reset(self) -> None: ... + def clone(self) -> Template: ... + def debug(self, flag: bool) -> None: ... + def append(self, cmd: str, kind: str) -> None: ... + def prepend(self, cmd: str, kind: str) -> None: ... + def open(self, file: str, mode: str) -> IO[Any]: ... + def copy(self, infile: str, outfile: str) -> None: ... + +def quote(s: str) -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/platform.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/platform.pyi new file mode 100644 index 0000000..e6e0378 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/platform.pyi @@ -0,0 +1,45 @@ +# Stubs for platform (Python 2) +# +# Based on stub generated by stubgen. + +from typing import Any, Optional, Tuple + +__copyright__: Any +DEV_NULL: Any + +def libc_ver(executable=..., lib=..., version=..., chunksize: int = ...): ... +def linux_distribution(distname=..., version=..., id=..., supported_dists=..., full_distribution_name: int = ...): ... +def dist(distname=..., version=..., id=..., supported_dists=...): ... + +class _popen: + tmpfile: Any + pipe: Any + bufsize: Any + mode: Any + def __init__(self, cmd, mode=..., bufsize: Optional[Any] = ...): ... + def read(self): ... + def readlines(self): ... + def close(self, remove=..., error=...): ... + __del__: Any + +def popen(cmd, mode=..., bufsize: Optional[Any] = ...): ... +def win32_ver(release=..., version=..., csd=..., ptype=...): ... +def mac_ver(release=..., versioninfo=..., machine=...): ... +def java_ver(release=..., vendor=..., vminfo=..., osinfo=...): ... +def system_alias(system, release, version): ... +def architecture(executable=..., bits=..., linkage=...) -> Tuple[str, str]: ... +def uname() -> Tuple[str, str, str, str, str, str]: ... +def system() -> str: ... +def node() -> str: ... +def release() -> str: ... +def version() -> str: ... +def machine() -> str: ... +def processor() -> str: ... +def python_implementation() -> str: ... +def python_version() -> str: ... +def python_version_tuple() -> Tuple[str, str, str]: ... +def python_branch() -> str: ... +def python_revision() -> str: ... +def python_build() -> Tuple[str, str]: ... +def python_compiler() -> str: ... +def platform(aliased: int = ..., terse: int = ...) -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/popen2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/popen2.pyi new file mode 100644 index 0000000..23435b3 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/popen2.pyi @@ -0,0 +1,28 @@ +from typing import Any, Iterable, List, Optional, Union, TextIO, Tuple, TypeVar + +_T = TypeVar('_T') + + +class Popen3: + sts: int + cmd: Iterable + pid: int + tochild: TextIO + fromchild: TextIO + childerr: Optional[TextIO] + def __init__(self, cmd: Iterable = ..., capturestderr: bool = ..., bufsize: int = ...) -> None: ... + def __del__(self) -> None: ... + def poll(self, _deadstate: _T = ...) -> Union[int, _T]: ... + def wait(self) -> int: ... + +class Popen4(Popen3): + childerr: None + cmd: Iterable + pid: int + tochild: TextIO + fromchild: TextIO + def __init__(self, cmd: Iterable = ..., bufsize: int = ...) -> None: ... + +def popen2(cmd: Iterable = ..., bufsize: int = ..., mode: str = ...) -> Tuple[TextIO, TextIO]: ... +def popen3(cmd: Iterable = ..., bufsize: int = ..., mode: str = ...) -> Tuple[TextIO, TextIO, TextIO]: ... +def popen4(cmd: Iterable = ..., bufsize: int = ..., mode: str = ...) -> Tuple[TextIO, TextIO]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/posix.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/posix.pyi new file mode 100644 index 0000000..fcd4a66 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/posix.pyi @@ -0,0 +1,205 @@ +from typing import Dict, List, Mapping, Tuple, Union, Sequence, IO, Optional, TypeVar + +error = OSError + +confstr_names: Dict[str, int] +environ: Dict[str, str] +pathconf_names: Dict[str, int] +sysconf_names: Dict[str, int] + +EX_CANTCREAT: int +EX_CONFIG: int +EX_DATAERR: int +EX_IOERR: int +EX_NOHOST: int +EX_NOINPUT: int +EX_NOPERM: int +EX_NOUSER: int +EX_OK: int +EX_OSERR: int +EX_OSFILE: int +EX_PROTOCOL: int +EX_SOFTWARE: int +EX_TEMPFAIL: int +EX_UNAVAILABLE: int +EX_USAGE: int +F_OK: int +NGROUPS_MAX: int +O_APPEND: int +O_ASYNC: int +O_CREAT: int +O_DIRECT: int +O_DIRECTORY: int +O_DSYNC: int +O_EXCL: int +O_LARGEFILE: int +O_NDELAY: int +O_NOATIME: int +O_NOCTTY: int +O_NOFOLLOW: int +O_NONBLOCK: int +O_RDONLY: int +O_RDWR: int +O_RSYNC: int +O_SYNC: int +O_TRUNC: int +O_WRONLY: int +R_OK: int +TMP_MAX: int +WCONTINUED: int +WNOHANG: int +WUNTRACED: int +W_OK: int +X_OK: int + +def WCOREDUMP(status: int) -> bool: ... +def WEXITSTATUS(status: int) -> bool: ... +def WIFCONTINUED(status: int) -> bool: ... +def WIFEXITED(status: int) -> bool: ... +def WIFSIGNALED(status: int) -> bool: ... +def WIFSTOPPED(status: int) -> bool: ... +def WSTOPSIG(status: int) -> bool: ... +def WTERMSIG(status: int) -> bool: ... + +class stat_result(object): + n_fields: int + n_sequence_fields: int + n_unnamed_fields: int + st_mode: int + st_ino: int + st_dev: int + st_nlink: int + st_uid: int + st_gid: int + st_size: int + st_atime: int + st_mtime: int + st_ctime: int + +class statvfs_result(object): + n_fields: int + n_sequence_fields: int + n_unnamed_fields: int + f_bsize: int + f_frsize: int + f_blocks: int + f_bfree: int + f_bavail: int + f_files: int + f_ffree: int + f_favail: int + f_flag: int + f_namemax: int + +def _exit(status: int) -> None: ... +def abort() -> None: ... +def access(path: unicode, mode: int) -> bool: ... +def chdir(path: unicode) -> None: ... +def chmod(path: unicode, mode: int) -> None: ... +def chown(path: unicode, uid: int, gid: int) -> None: ... +def chroot(path: unicode) -> None: ... +def close(fd: int) -> None: ... +def closerange(fd_low: int, fd_high: int) -> None: ... +def confstr(name: Union[str, int]) -> str: ... +def ctermid() -> str: ... +def dup(fd: int) -> int: ... +def dup2(fd: int, fd2: int) -> None: ... +def execv(path: str, args: Sequence[str], env: Mapping[str, str]) -> None: ... +def execve(path: str, args: Sequence[str], env: Mapping[str, str]) -> None: ... +def fchdir(fd: int) -> None: ... +def fchmod(fd: int, mode: int) -> None: ... +def fchown(fd: int, uid: int, gid: int) -> None: ... +def fdatasync(fd: int) -> None: ... +def fdopen(fd: int, mode: str = ..., bufsize: int = ...) -> IO[str]: ... +def fork() -> int: + raise OSError() +def forkpty() -> Tuple[int, int]: + raise OSError() +def fpathconf(fd: int, name: str) -> None: ... +def fstat(fd: int) -> stat_result: ... +def fstatvfs(fd: int) -> statvfs_result: ... +def fsync(fd: int) -> None: ... +def ftruncate(fd: int, length: int) -> None: ... +def getcwd() -> str: ... +def getcwdu() -> unicode: ... +def getegid() -> int: ... +def geteuid() -> int: ... +def getgid() -> int: ... +def getgroups() -> List[int]: ... +def getloadavg() -> Tuple[float, float, float]: + raise OSError() +def getlogin() -> str: ... +def getpgid(pid: int) -> int: ... +def getpgrp() -> int: ... +def getpid() -> int: ... +def getppid() -> int: ... +def getresgid() -> Tuple[int, int, int]: ... +def getresuid() -> Tuple[int, int, int]: ... +def getsid(pid: int) -> int: ... +def getuid() -> int: ... +def initgroups(username: str, gid: int) -> None: ... +def isatty(fd: int) -> bool: ... +def kill(pid: int, sig: int) -> None: ... +def killpg(pgid: int, sig: int) -> None: ... +def lchown(path: unicode, uid: int, gid: int) -> None: ... +def link(source: unicode, link_name: str) -> None: ... +_T = TypeVar("_T") +def listdir(path: _T) -> List[_T]: ... +def lseek(fd: int, pos: int, how: int) -> None: ... +def lstat(path: unicode) -> stat_result: ... +def major(device: int) -> int: ... +def makedev(major: int, minor: int) -> int: ... +def minor(device: int) -> int: ... +def mkdir(path: unicode, mode: int = ...) -> None: ... +def mkfifo(path: unicode, mode: int = ...) -> None: ... +def mknod(filename: unicode, mode: int = ..., device: int = ...) -> None: ... +def nice(increment: int) -> int: ... +def open(file: unicode, flags: int, mode: int = ...) -> int: ... +def openpty() -> Tuple[int, int]: ... +def pathconf(path: unicode, name: str) -> str: ... +def pipe() -> Tuple[int, int]: ... +def popen(command: str, mode: str = ..., bufsize: int = ...) -> IO[str]: ... +def putenv(varname: str, value: str) -> None: ... +def read(fd: int, n: int) -> str: ... +def readlink(path: _T) -> _T: ... +def remove(path: unicode) -> None: ... +def rename(src: unicode, dst: unicode) -> None: ... +def rmdir(path: unicode) -> None: ... +def setegid(egid: int) -> None: ... +def seteuid(euid: int) -> None: ... +def setgid(gid: int) -> None: ... +def setgroups(groups: Sequence[int]) -> None: ... +def setpgid(pid: int, pgrp: int) -> None: ... +def setpgrp() -> None: ... +def setregid(rgid: int, egid: int) -> None: ... +def setresgid(rgid: int, egid: int, sgid: int) -> None: ... +def setresuid(ruid: int, euid: int, suid: int) -> None: ... +def setreuid(ruid: int, euid: int) -> None: ... +def setsid() -> None: ... +def setuid(pid: int) -> None: ... +def stat(path: unicode) -> stat_result: ... +def statvfs(path: unicode) -> statvfs_result: ... +def stat_float_times(fd: int) -> None: ... +def strerror(code: int) -> str: ... +def symlink(source: unicode, link_name: unicode) -> None: ... +def sysconf(name: Union[str, int]) -> int: ... +def system(command: unicode) -> int: ... +def tcgetpgrp(fd: int) -> int: ... +def tcsetpgrp(fd: int, pg: int) -> None: ... +def times() -> Tuple[float, float, float, float, float]: ... +def tmpfile() -> IO[str]: ... +def ttyname(fd: int) -> str: ... +def umask(mask: int) -> int: ... +def uname() -> Tuple[str, str, str, str, str]: ... +def unlink(path: unicode) -> None: ... +def unsetenv(varname: str) -> None: ... +def urandom(n: int) -> str: ... +def utime(path: unicode, times: Optional[Tuple[int, int]]) -> None: + raise OSError +def wait() -> int: ... +_r = Tuple[float, float, int, int, int, int, int, int, int, int, int, int, int, int, int, int] +def wait3(options: int) -> Tuple[int, int, _r]: ... +def wait4(pid: int, options: int) -> Tuple[int, int, _r]: ... +def waitpid(pid: int, options: int) -> int: + raise OSError() +def write(fd: int, str: str) -> int: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/random.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/random.pyi new file mode 100644 index 0000000..3292db8 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/random.pyi @@ -0,0 +1,75 @@ +# Stubs for random +# Ron Murawski +# Updated by Jukka Lehtosalo + +# based on https://docs.python.org/2/library/random.html + +# ----- random classes ----- + +import _random +from typing import ( + Any, TypeVar, Sequence, List, Callable, AbstractSet, Union, + overload +) + +_T = TypeVar('_T') + +class Random(_random.Random): + def __init__(self, x: object = ...) -> None: ... + def seed(self, x: object = ...) -> None: ... + def getstate(self) -> _random._State: ... + def setstate(self, state: _random._State) -> None: ... + def jumpahead(self, n: int) -> None: ... + def getrandbits(self, k: int) -> int: ... + @overload + def randrange(self, stop: int) -> int: ... + @overload + def randrange(self, start: int, stop: int, step: int = ...) -> int: ... + def randint(self, a: int, b: int) -> int: ... + def choice(self, seq: Sequence[_T]) -> _T: ... + def shuffle(self, x: List[Any], random: Callable[[], None] = ...) -> None: ... + def sample(self, population: Union[Sequence[_T], AbstractSet[_T]], k: int) -> List[_T]: ... + def random(self) -> float: ... + def uniform(self, a: float, b: float) -> float: ... + def triangular(self, low: float = ..., high: float = ..., mode: float = ...) -> float: ... + def betavariate(self, alpha: float, beta: float) -> float: ... + def expovariate(self, lambd: float) -> float: ... + def gammavariate(self, alpha: float, beta: float) -> float: ... + def gauss(self, mu: float, sigma: float) -> float: ... + def lognormvariate(self, mu: float, sigma: float) -> float: ... + def normalvariate(self, mu: float, sigma: float) -> float: ... + def vonmisesvariate(self, mu: float, kappa: float) -> float: ... + def paretovariate(self, alpha: float) -> float: ... + def weibullvariate(self, alpha: float, beta: float) -> float: ... + +# SystemRandom is not implemented for all OS's; good on Windows & Linux +class SystemRandom(Random): + ... + +# ----- random function stubs ----- +def seed(x: object = ...) -> None: ... +def getstate() -> object: ... +def setstate(state: object) -> None: ... +def jumpahead(n: int) -> None: ... +def getrandbits(k: int) -> int: ... +@overload +def randrange(stop: int) -> int: ... +@overload +def randrange(start: int, stop: int, step: int = ...) -> int: ... +def randint(a: int, b: int) -> int: ... +def choice(seq: Sequence[_T]) -> _T: ... +def shuffle(x: List[Any], random: Callable[[], float] = ...) -> None: ... +def sample(population: Union[Sequence[_T], AbstractSet[_T]], k: int) -> List[_T]: ... +def random() -> float: ... +def uniform(a: float, b: float) -> float: ... +def triangular(low: float = ..., high: float = ..., + mode: float = ...) -> float: ... +def betavariate(alpha: float, beta: float) -> float: ... +def expovariate(lambd: float) -> float: ... +def gammavariate(alpha: float, beta: float) -> float: ... +def gauss(mu: float, sigma: float) -> float: ... +def lognormvariate(mu: float, sigma: float) -> float: ... +def normalvariate(mu: float, sigma: float) -> float: ... +def vonmisesvariate(mu: float, kappa: float) -> float: ... +def paretovariate(alpha: float) -> float: ... +def weibullvariate(alpha: float, beta: float) -> float: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/re.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/re.pyi new file mode 100644 index 0000000..2a2c2cb --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/re.pyi @@ -0,0 +1,100 @@ +# Stubs for re +# Ron Murawski +# 'bytes' support added by Jukka Lehtosalo + +# based on: http: //docs.python.org/2.7/library/re.html + +from typing import ( + List, Iterator, overload, Callable, Tuple, Sequence, Dict, + Generic, AnyStr, Match, Pattern, Any, Optional, Union +) + +# ----- re variables and constants ----- +DEBUG = 0 +I = 0 +IGNORECASE = 0 +L = 0 +LOCALE = 0 +M = 0 +MULTILINE = 0 +S = 0 +DOTALL = 0 +X = 0 +VERBOSE = 0 +U = 0 +UNICODE = 0 +T = 0 +TEMPLATE = 0 + +class error(Exception): ... + +@overload +def compile(pattern: AnyStr, flags: int = ...) -> Pattern[AnyStr]: ... +@overload +def compile(pattern: Pattern[AnyStr], flags: int = ...) -> Pattern[AnyStr]: ... + +@overload +def search(pattern: Union[str, unicode], string: AnyStr, flags: int = ...) -> Optional[Match[AnyStr]]: ... +@overload +def search(pattern: Union[Pattern[str], Pattern[unicode]], string: AnyStr, flags: int = ...) -> Optional[Match[AnyStr]]: ... + +@overload +def match(pattern: Union[str, unicode], string: AnyStr, flags: int = ...) -> Optional[Match[AnyStr]]: ... +@overload +def match(pattern: Union[Pattern[str], Pattern[unicode]], string: AnyStr, flags: int = ...) -> Optional[Match[AnyStr]]: ... + +@overload +def split(pattern: Union[str, unicode], string: AnyStr, + maxsplit: int = ..., flags: int = ...) -> List[AnyStr]: ... +@overload +def split(pattern: Union[Pattern[str], Pattern[unicode]], string: AnyStr, + maxsplit: int = ..., flags: int = ...) -> List[AnyStr]: ... + +@overload +def findall(pattern: Union[str, unicode], string: AnyStr, flags: int = ...) -> List[Any]: ... +@overload +def findall(pattern: Union[Pattern[str], Pattern[unicode]], string: AnyStr, flags: int = ...) -> List[Any]: ... + +# Return an iterator yielding match objects over all non-overlapping matches +# for the RE pattern in string. The string is scanned left-to-right, and +# matches are returned in the order found. Empty matches are included in the +# result unless they touch the beginning of another match. +@overload +def finditer(pattern: Union[str, unicode], string: AnyStr, + flags: int = ...) -> Iterator[Match[AnyStr]]: ... +@overload +def finditer(pattern: Union[Pattern[str], Pattern[unicode]], string: AnyStr, + flags: int = ...) -> Iterator[Match[AnyStr]]: ... + +@overload +def sub(pattern: Union[str, unicode], repl: AnyStr, string: AnyStr, count: int = ..., + flags: int = ...) -> AnyStr: ... +@overload +def sub(pattern: Union[str, unicode], repl: Callable[[Match[AnyStr]], AnyStr], + string: AnyStr, count: int = ..., flags: int = ...) -> AnyStr: ... +@overload +def sub(pattern: Union[Pattern[str], Pattern[unicode]], repl: AnyStr, string: AnyStr, count: int = ..., + flags: int = ...) -> AnyStr: ... +@overload +def sub(pattern: Union[Pattern[str], Pattern[unicode]], repl: Callable[[Match[AnyStr]], AnyStr], + string: AnyStr, count: int = ..., flags: int = ...) -> AnyStr: ... + +@overload +def subn(pattern: Union[str, unicode], repl: AnyStr, string: AnyStr, count: int = ..., + flags: int = ...) -> Tuple[AnyStr, int]: ... +@overload +def subn(pattern: Union[str, unicode], repl: Callable[[Match[AnyStr]], AnyStr], + string: AnyStr, count: int = ..., + flags: int = ...) -> Tuple[AnyStr, int]: ... +@overload +def subn(pattern: Union[Pattern[str], Pattern[unicode]], repl: AnyStr, string: AnyStr, count: int = ..., + flags: int = ...) -> Tuple[AnyStr, int]: ... +@overload +def subn(pattern: Union[Pattern[str], Pattern[unicode]], repl: Callable[[Match[AnyStr]], AnyStr], + string: AnyStr, count: int = ..., + flags: int = ...) -> Tuple[AnyStr, int]: ... + +def escape(string: AnyStr) -> AnyStr: ... + +def purge() -> None: ... +def template(pattern: Union[AnyStr, Pattern[AnyStr]], flags: int = ...) -> Pattern[AnyStr]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/repr.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/repr.pyi new file mode 100644 index 0000000..ad89789 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/repr.pyi @@ -0,0 +1,31 @@ +class Repr: + maxarray: int + maxdeque: int + maxdict: int + maxfrozenset: int + maxlevel: int + maxlist: int + maxlong: int + maxother: int + maxset: int + maxstring: int + maxtuple: int + def __init__(self) -> None: ... + def _repr_iterable(self, x, level: complex, left, right, maxiter, trail=...) -> str: ... + def repr(self, x) -> str: ... + def repr1(self, x, level: complex) -> str: ... + def repr_array(self, x, level: complex) -> str: ... + def repr_deque(self, x, level: complex) -> str: ... + def repr_dict(self, x, level: complex) -> str: ... + def repr_frozenset(self, x, level: complex) -> str: ... + def repr_instance(self, x, level: complex) -> str: ... + def repr_list(self, x, level: complex) -> str: ... + def repr_long(self, x, level: complex) -> str: ... + def repr_set(self, x, level: complex) -> str: ... + def repr_str(self, x, level: complex) -> str: ... + def repr_tuple(self, x, level: complex) -> str: ... + +def _possibly_sorted(x) -> list: ... + +aRepr: Repr +def repr(x) -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/resource.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/resource.pyi new file mode 100644 index 0000000..2a6c694 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/resource.pyi @@ -0,0 +1,33 @@ +from typing import Tuple, NamedTuple + +class error(Exception): ... + +RLIM_INFINITY: int +def getrlimit(resource: int) -> Tuple[int, int]: ... +def setrlimit(resource: int, limits: Tuple[int, int]) -> None: ... + +RLIMIT_CORE: int +RLIMIT_CPU: int +RLIMIT_FSIZE: int +RLIMIT_DATA: int +RLIMIT_STACK: int +RLIMIT_RSS: int +RLIMIT_NPROC: int +RLIMIT_NOFILE: int +RLIMIT_OFILE: int +RLIMIT_MEMLOCK: int +RLIMIT_VMEM: int +RLIMIT_AS: int + +_RUsage = NamedTuple('_RUsage', [('ru_utime', float), ('ru_stime', float), ('ru_maxrss', int), + ('ru_ixrss', int), ('ru_idrss', int), ('ru_isrss', int), + ('ru_minflt', int), ('ru_majflt', int), ('ru_nswap', int), + ('ru_inblock', int), ('ru_oublock', int), ('ru_msgsnd', int), + ('ru_msgrcv', int), ('ru_nsignals', int), ('ru_nvcsw', int), + ('ru_nivcsw', int)]) +def getrusage(who: int) -> _RUsage: ... +def getpagesize() -> int: ... + +RUSAGE_SELF: int +RUSAGE_CHILDREN: int +RUSAGE_BOTH: int diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/rfc822.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/rfc822.pyi new file mode 100644 index 0000000..20cd1d6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/rfc822.pyi @@ -0,0 +1,79 @@ +# Stubs for rfc822 (Python 2) +# +# Based on stub generated by stubgen. + +from typing import Any, Optional + +class Message: + fp: Any + seekable: Any + startofheaders: Any + startofbody: Any + def __init__(self, fp, seekable: int = ...): ... + def rewindbody(self): ... + dict: Any + unixfrom: Any + headers: Any + status: Any + def readheaders(self): ... + def isheader(self, line): ... + def islast(self, line): ... + def iscomment(self, line): ... + def getallmatchingheaders(self, name): ... + def getfirstmatchingheader(self, name): ... + def getrawheader(self, name): ... + def getheader(self, name, default: Optional[Any] = ...): ... + get: Any + def getheaders(self, name): ... + def getaddr(self, name): ... + def getaddrlist(self, name): ... + def getdate(self, name): ... + def getdate_tz(self, name): ... + def __len__(self): ... + def __getitem__(self, name): ... + def __setitem__(self, name, value): ... + def __delitem__(self, name): ... + def setdefault(self, name, default=...): ... + def has_key(self, name): ... + def __contains__(self, name): ... + def __iter__(self): ... + def keys(self): ... + def values(self): ... + def items(self): ... + +class AddrlistClass: + specials: Any + pos: Any + LWS: Any + CR: Any + atomends: Any + phraseends: Any + field: Any + commentlist: Any + def __init__(self, field): ... + def gotonext(self): ... + def getaddrlist(self): ... + def getaddress(self): ... + def getrouteaddr(self): ... + def getaddrspec(self): ... + def getdomain(self): ... + def getdelimited(self, beginchar, endchars, allowcomments: int = ...): ... + def getquote(self): ... + def getcomment(self): ... + def getdomainliteral(self): ... + def getatom(self, atomends: Optional[Any] = ...): ... + def getphraselist(self): ... + +class AddressList(AddrlistClass): + addresslist: Any + def __init__(self, field): ... + def __len__(self): ... + def __add__(self, other): ... + def __iadd__(self, other): ... + def __sub__(self, other): ... + def __isub__(self, other): ... + def __getitem__(self, index): ... + +def parsedate_tz(data): ... +def parsedate(data): ... +def mktime_tz(data): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/robotparser.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/robotparser.pyi new file mode 100644 index 0000000..403039a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/robotparser.pyi @@ -0,0 +1,7 @@ +class RobotFileParser: + def set_url(self, url: str): ... + def read(self): ... + def parse(self, lines: str): ... + def can_fetch(self, user_agent: str, url: str): ... + def mtime(self): ... + def modified(self): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/runpy.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/runpy.pyi new file mode 100644 index 0000000..6674af0 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/runpy.pyi @@ -0,0 +1,17 @@ +from typing import Any, Optional + +class _TempModule: + mod_name: Any + module: Any + def __init__(self, mod_name): ... + def __enter__(self): ... + def __exit__(self, *args): ... + +class _ModifiedArgv0: + value: Any + def __init__(self, value): ... + def __enter__(self): ... + def __exit__(self, *args): ... + +def run_module(mod_name, init_globals: Optional[Any] = ..., run_name: Optional[Any] = ..., alter_sys: bool = ...): ... +def run_path(path_name, init_globals: Optional[Any] = ..., run_name: Optional[Any] = ...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/sets.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/sets.pyi new file mode 100644 index 0000000..a68994f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/sets.pyi @@ -0,0 +1,61 @@ +# Stubs for sets (Python 2) +from typing import Any, Callable, Hashable, Iterable, Iterator, MutableMapping, Optional, TypeVar, Union + +_T = TypeVar('_T') +_Setlike = Union[BaseSet[_T], Iterable[_T]] +_SelfT = TypeVar('_SelfT', bound=BaseSet) + +class BaseSet(Iterable[_T]): + def __init__(self) -> None: ... + def __len__(self) -> int: ... + def __repr__(self) -> str: ... + def __str__(self) -> str: ... + def __iter__(self) -> Iterator[_T]: ... + def __cmp__(self, other: Any) -> int: ... + def __eq__(self, other: Any) -> bool: ... + def __ne__(self, other: Any) -> bool: ... + def copy(self: _SelfT) -> _SelfT: ... + def __copy__(self: _SelfT) -> _SelfT: ... + def __deepcopy__(self: _SelfT, memo: MutableMapping[int, BaseSet[_T]]) -> _SelfT: ... + def __or__(self: _SelfT, other: BaseSet[_T]) -> _SelfT: ... + def union(self: _SelfT, other: _Setlike) -> _SelfT: ... + def __and__(self: _SelfT, other: BaseSet[_T]) -> _SelfT: ... + def intersection(self: _SelfT, other: _Setlike) -> _SelfT: ... + def __xor__(self: _SelfT, other: BaseSet[_T]) -> _SelfT: ... + def symmetric_difference(self: _SelfT, other: _Setlike) -> _SelfT: ... + def __sub__(self: _SelfT, other: BaseSet[_T]) -> _SelfT: ... + def difference(self: _SelfT, other: _Setlike) -> _SelfT: ... + def __contains__(self, element: Any) -> bool: ... + def issubset(self, other: BaseSet[_T]) -> bool: ... + def issuperset(self, other: BaseSet[_T]) -> bool: ... + def __le__(self, other: BaseSet[_T]) -> bool: ... + def __ge__(self, other: BaseSet[_T]) -> bool: ... + def __lt__(self, other: BaseSet[_T]) -> bool: ... + def __gt__(self, other: BaseSet[_T]) -> bool: ... + +class ImmutableSet(BaseSet[_T], Hashable): + def __init__(self, iterable: Optional[_Setlike] = ...) -> None: ... + def __hash__(self) -> int: ... + +class Set(BaseSet[_T]): + def __init__(self, iterable: Optional[_Setlike] = ...) -> None: ... + def __ior__(self, other: BaseSet[_T]) -> Set: ... + def union_update(self, other: _Setlike) -> None: ... + def __iand__(self, other: BaseSet[_T]) -> Set: ... + def intersection_update(self, other: _Setlike) -> None: ... + def __ixor__(self, other: BaseSet[_T]) -> Set: ... + def symmetric_difference_update(self, other: _Setlike) -> None: ... + def __isub__(self, other: BaseSet[_T]) -> Set: ... + def difference_update(self, other: _Setlike) -> None: ... + def update(self, iterable: _Setlike) -> None: ... + def clear(self) -> None: ... + def add(self, element: _T) -> None: ... + def remove(self, element: _T) -> None: ... + def discard(self, element: _T) -> None: ... + def pop(self) -> _T: ... + def __as_immutable__(self) -> ImmutableSet[_T]: ... + def __as_temporarily_immutable__(self) -> _TemporarilyImmutableSet[_T]: ... + +class _TemporarilyImmutableSet(BaseSet[_T]): + def __init__(self, set: BaseSet[_T]) -> None: ... + def __hash__(self) -> int: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/sha.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/sha.pyi new file mode 100644 index 0000000..f1606fa --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/sha.pyi @@ -0,0 +1,11 @@ +# Stubs for Python 2.7 sha stdlib module + +class sha(object): + def update(self, arg: str) -> None: ... + def digest(self) -> str: ... + def hexdigest(self) -> str: ... + def copy(self) -> sha: ... + +def new(string: str = ...) -> sha: ... +blocksize = 0 +digest_size = 0 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/shelve.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/shelve.pyi new file mode 100644 index 0000000..d7d9b8c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/shelve.pyi @@ -0,0 +1,33 @@ +from typing import Any, Dict, Iterator, List, Optional, Tuple +import collections + + +class Shelf(collections.MutableMapping): + def __init__(self, dict: Dict[Any, Any], protocol: Optional[int] = ..., writeback: bool = ..., keyencoding: str = ...) -> None: ... + def __iter__(self) -> Iterator[str]: ... + def keys(self) -> List[Any]: ... + def __len__(self) -> int: ... + def has_key(self, key: Any) -> bool: ... + def __contains__(self, key: Any) -> bool: ... + def get(self, key: Any, default: Any = ...) -> Any: ... + def __getitem__(self, key: Any) -> Any: ... + def __setitem__(self, key: Any, value: Any) -> None: ... + def __delitem__(self, key: Any) -> None: ... + def __enter__(self) -> Shelf: ... + def __exit__(self, type: Any, value: Any, traceback: Any) -> None: ... + def close(self) -> None: ... + def __del__(self) -> None: ... + def sync(self) -> None: ... + +class BsdDbShelf(Shelf): + def __init__(self, dict: Dict[Any, Any], protocol: Optional[int] = ..., writeback: bool = ..., keyencoding: str = ...) -> None: ... + def set_location(self, key: Any) -> Tuple[str, Any]: ... + def next(self) -> Tuple[str, Any]: ... + def previous(self) -> Tuple[str, Any]: ... + def first(self) -> Tuple[str, Any]: ... + def last(self) -> Tuple[str, Any]: ... + +class DbfilenameShelf(Shelf): + def __init__(self, filename: str, flag: str = ..., protocol: Optional[int] = ..., writeback: bool = ...) -> None: ... + +def open(filename: str, flag: str = ..., protocol: Optional[int] = ..., writeback: bool = ...) -> DbfilenameShelf: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/shlex.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/shlex.pyi new file mode 100644 index 0000000..5bf6fcc --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/shlex.pyi @@ -0,0 +1,30 @@ +from typing import Any, IO, List, Optional, TypeVar + +def split(s: Optional[str], comments: bool = ..., posix: bool = ...) -> List[str]: ... + +_SLT = TypeVar('_SLT', bound=shlex) + +class shlex: + def __init__(self, instream: IO[Any] = ..., infile: IO[Any] = ..., posix: bool = ...) -> None: ... + def __iter__(self: _SLT) -> _SLT: ... + def get_token(self) -> Optional[str]: ... + def push_token(self, _str: str) -> None: ... + def read_token(self) -> str: ... + def sourcehook(self, filename: str) -> None: ... + def push_source(self, stream: IO[Any], filename: str = ...) -> None: ... + def pop_source(self) -> IO[Any]: ... + def error_leader(self, file: str = ..., line: int = ...) -> str: ... + + commenters: str + wordchars: str + whitespace: str + escape: str + quotes: str + escapedquotes: str + whitespace_split: bool + infile: IO[Any] + source: Optional[str] + debug: int + lineno: int + token: Any + eof: Optional[str] diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/signal.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/signal.pyi new file mode 100644 index 0000000..cda4c65 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/signal.pyi @@ -0,0 +1,71 @@ +from typing import Callable, Any, Tuple, Union +from types import FrameType + +SIG_DFL: int = ... +SIG_IGN: int = ... + +ITIMER_REAL: int = ... +ITIMER_VIRTUAL: int = ... +ITIMER_PROF: int = ... + +NSIG: int = ... + +SIGABRT: int = ... +SIGALRM: int = ... +SIGBREAK: int = ... # Windows +SIGBUS: int = ... +SIGCHLD: int = ... +SIGCLD: int = ... +SIGCONT: int = ... +SIGEMT: int = ... +SIGFPE: int = ... +SIGHUP: int = ... +SIGILL: int = ... +SIGINFO: int = ... +SIGINT: int = ... +SIGIO: int = ... +SIGIOT: int = ... +SIGKILL: int = ... +SIGPIPE: int = ... +SIGPOLL: int = ... +SIGPROF: int = ... +SIGPWR: int = ... +SIGQUIT: int = ... +SIGRTMAX: int = ... +SIGRTMIN: int = ... +SIGSEGV: int = ... +SIGSTOP: int = ... +SIGSYS: int = ... +SIGTERM: int = ... +SIGTRAP: int = ... +SIGTSTP: int = ... +SIGTTIN: int = ... +SIGTTOU: int = ... +SIGURG: int = ... +SIGUSR1: int = ... +SIGUSR2: int = ... +SIGVTALRM: int = ... +SIGWINCH: int = ... +SIGXCPU: int = ... +SIGXFSZ: int = ... + +# Windows +CTRL_C_EVENT: int = ... +CTRL_BREAK_EVENT: int = ... + +class ItimerError(IOError): ... + +_HANDLER = Union[Callable[[int, FrameType], None], int, None] + +def alarm(time: int) -> int: ... +def getsignal(signalnum: int) -> _HANDLER: ... +def pause() -> None: ... +def setitimer(which: int, seconds: float, interval: float = ...) -> Tuple[float, float]: ... +def getitimer(which: int) -> Tuple[float, float]: ... +def set_wakeup_fd(fd: int) -> int: ... +def siginterrupt(signalnum: int, flag: bool) -> None: + raise RuntimeError() +def signal(signalnum: int, handler: _HANDLER) -> _HANDLER: + raise RuntimeError() +def default_int_handler(signum: int, frame: FrameType) -> None: + raise KeyboardInterrupt() diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/smtplib.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/smtplib.pyi new file mode 100644 index 0000000..438221a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/smtplib.pyi @@ -0,0 +1,86 @@ +from typing import Any + +class SMTPException(Exception): ... +class SMTPServerDisconnected(SMTPException): ... + +class SMTPResponseException(SMTPException): + smtp_code: Any + smtp_error: Any + args: Any + def __init__(self, code, msg) -> None: ... + +class SMTPSenderRefused(SMTPResponseException): + smtp_code: Any + smtp_error: Any + sender: Any + args: Any + def __init__(self, code, msg, sender) -> None: ... + +class SMTPRecipientsRefused(SMTPException): + recipients: Any + args: Any + def __init__(self, recipients) -> None: ... + +class SMTPDataError(SMTPResponseException): ... +class SMTPConnectError(SMTPResponseException): ... +class SMTPHeloError(SMTPResponseException): ... +class SMTPAuthenticationError(SMTPResponseException): ... + +def quoteaddr(addr): ... +def quotedata(data): ... + +class SSLFakeFile: + sslobj: Any + def __init__(self, sslobj) -> None: ... + def readline(self, size=...): ... + def close(self): ... + +class SMTP: + debuglevel: Any + file: Any + helo_resp: Any + ehlo_msg: Any + ehlo_resp: Any + does_esmtp: Any + default_port: Any + timeout: Any + esmtp_features: Any + local_hostname: Any + def __init__(self, host: str = ..., port: int = ..., local_hostname=..., timeout=...) -> None: ... + def set_debuglevel(self, debuglevel): ... + sock: Any + def connect(self, host=..., port=...): ... + def send(self, str): ... + def putcmd(self, cmd, args=...): ... + def getreply(self): ... + def docmd(self, cmd, args=...): ... + def helo(self, name=...): ... + def ehlo(self, name=...): ... + def has_extn(self, opt): ... + def help(self, args=...): ... + def rset(self): ... + def noop(self): ... + def mail(self, sender, options=...): ... + def rcpt(self, recip, options=...): ... + def data(self, msg): ... + def verify(self, address): ... + vrfy: Any + def expn(self, address): ... + def ehlo_or_helo_if_needed(self): ... + def login(self, user, password): ... + def starttls(self, keyfile=..., certfile=...): ... + def sendmail(self, from_addr, to_addrs, msg, mail_options=..., rcpt_options=...): ... + def close(self): ... + def quit(self): ... + +class SMTP_SSL(SMTP): + default_port: Any + keyfile: Any + certfile: Any + def __init__(self, host=..., port=..., local_hostname=..., keyfile=..., certfile=..., timeout=...) -> None: ... + +class LMTP(SMTP): + ehlo_msg: Any + def __init__(self, host=..., port=..., local_hostname=...) -> None: ... + sock: Any + def connect(self, host=..., port=...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/spwd.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/spwd.pyi new file mode 100644 index 0000000..1d58990 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/spwd.pyi @@ -0,0 +1,14 @@ +from typing import List, NamedTuple + +struct_spwd = NamedTuple("struct_spwd", [("sp_nam", str), + ("sp_pwd", str), + ("sp_lstchg", int), + ("sp_min", int), + ("sp_max", int), + ("sp_warn", int), + ("sp_inact", int), + ("sp_expire", int), + ("sp_flag", int)]) + +def getspall() -> List[struct_spwd]: ... +def getspnam(name: str) -> struct_spwd: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/sre_constants.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/sre_constants.pyi new file mode 100644 index 0000000..89d453e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/sre_constants.pyi @@ -0,0 +1,94 @@ +# Source: https://hg.python.org/cpython/file/2.7/Lib/sre_constants.py + +from typing import Dict, List, TypeVar + +MAGIC: int +MAXREPEAT: int + +class error(Exception): ... + +FAILURE: str +SUCCESS: str +ANY: str +ANY_ALL: str +ASSERT: str +ASSERT_NOT: str +AT: str +BIGCHARSET: str +BRANCH: str +CALL: str +CATEGORY: str +CHARSET: str +GROUPREF: str +GROUPREF_IGNORE: str +GROUPREF_EXISTS: str +IN: str +IN_IGNORE: str +INFO: str +JUMP: str +LITERAL: str +LITERAL_IGNORE: str +MARK: str +MAX_REPEAT: str +MAX_UNTIL: str +MIN_REPEAT: str +MIN_UNTIL: str +NEGATE: str +NOT_LITERAL: str +NOT_LITERAL_IGNORE: str +RANGE: str +REPEAT: str +REPEAT_ONE: str +SUBPATTERN: str +MIN_REPEAT_ONE: str +AT_BEGINNING: str +AT_BEGINNING_LINE: str +AT_BEGINNING_STRING: str +AT_BOUNDARY: str +AT_NON_BOUNDARY: str +AT_END: str +AT_END_LINE: str +AT_END_STRING: str +AT_LOC_BOUNDARY: str +AT_LOC_NON_BOUNDARY: str +AT_UNI_BOUNDARY: str +AT_UNI_NON_BOUNDARY: str +CATEGORY_DIGIT: str +CATEGORY_NOT_DIGIT: str +CATEGORY_SPACE: str +CATEGORY_NOT_SPACE: str +CATEGORY_WORD: str +CATEGORY_NOT_WORD: str +CATEGORY_LINEBREAK: str +CATEGORY_NOT_LINEBREAK: str +CATEGORY_LOC_WORD: str +CATEGORY_LOC_NOT_WORD: str +CATEGORY_UNI_DIGIT: str +CATEGORY_UNI_NOT_DIGIT: str +CATEGORY_UNI_SPACE: str +CATEGORY_UNI_NOT_SPACE: str +CATEGORY_UNI_WORD: str +CATEGORY_UNI_NOT_WORD: str +CATEGORY_UNI_LINEBREAK: str +CATEGORY_UNI_NOT_LINEBREAK: str + +_T = TypeVar('_T') +def makedict(list: List[_T]) -> Dict[_T, int]: ... + +OP_IGNORE: Dict[str, str] +AT_MULTILINE: Dict[str, str] +AT_LOCALE: Dict[str, str] +AT_UNICODE: Dict[str, str] +CH_LOCALE: Dict[str, str] +CH_UNICODE: Dict[str, str] +SRE_FLAG_TEMPLATE: int +SRE_FLAG_IGNORECASE: int +SRE_FLAG_LOCALE: int +SRE_FLAG_MULTILINE: int +SRE_FLAG_DOTALL: int +SRE_FLAG_UNICODE: int +SRE_FLAG_VERBOSE: int +SRE_FLAG_DEBUG: int +SRE_INFO_PREFIX: int +SRE_INFO_LITERAL: int +SRE_INFO_CHARSET: int diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/sre_parse.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/sre_parse.pyi new file mode 100644 index 0000000..beabb40 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/sre_parse.pyi @@ -0,0 +1,63 @@ +# Source: https://hg.python.org/cpython/file/2.7/Lib/sre_parse.py + +from typing import Any, Dict, Iterable, List, Match, Optional, Pattern as _Pattern, Set, Tuple, Union + +SPECIAL_CHARS: str +REPEAT_CHARS: str +DIGITS: Set +OCTDIGITS: Set +HEXDIGITS: Set +WHITESPACE: Set +ESCAPES: Dict[str, Tuple[str, int]] +CATEGORIES: Dict[str, Union[Tuple[str, str], Tuple[str, List[Tuple[str, str]]]]] +FLAGS: Dict[str, int] + +class Pattern: + flags: int + open: List[int] + groups: int + groupdict: Dict[str, int] + lookbehind: int + def __init__(self) -> None: ... + def opengroup(self, name: str = ...) -> int: ... + def closegroup(self, gid: int) -> None: ... + def checkgroup(self, gid: int) -> bool: ... + + +_OpSubpatternType = Tuple[Optional[int], int, int, SubPattern] +_OpGroupRefExistsType = Tuple[int, SubPattern, SubPattern] +_OpInType = List[Tuple[str, int]] +_OpBranchType = Tuple[None, List[SubPattern]] +_AvType = Union[_OpInType, _OpBranchType, Iterable[SubPattern], _OpGroupRefExistsType, _OpSubpatternType] +_CodeType = Union[str, _AvType] + +class SubPattern: + pattern: str + data: List[_CodeType] + width: Optional[int] + def __init__(self, pattern, data: List[_CodeType] = ...) -> None: ... + def dump(self, level: int = ...) -> None: ... + def __len__(self) -> int: ... + def __delitem__(self, index: Union[int, slice]) -> None: ... + def __getitem__(self, index: Union[int, slice]) -> Union[SubPattern, _CodeType]: ... + def __setitem__(self, index: Union[int, slice], code: _CodeType): ... + def insert(self, index, code: _CodeType) -> None: ... + def append(self, code: _CodeType) -> None: ... + def getwidth(self) -> int: ... + +class Tokenizer: + string: str + index: int + def __init__(self, string: str) -> None: ... + def match(self, char: str, skip: int = ...) -> int: ... + def get(self) -> Optional[str]: ... + def tell(self) -> Tuple[int, Optional[str]]: ... + def seek(self, index: int) -> None: ... + +def isident(char: str) -> bool: ... +def isdigit(char: str) -> bool: ... +def isname(name: str) -> bool: ... +def parse(str: str, flags: int = ..., pattern: Pattern = ...) -> SubPattern: ... +_Template = Tuple[List[Tuple[int, int]], List[Optional[int]]] +def parse_template(source: str, pattern: _Pattern) -> _Template: ... +def expand_template(template: _Template, match: Match) -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/stat.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/stat.pyi new file mode 100644 index 0000000..dd3418d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/stat.pyi @@ -0,0 +1,59 @@ +def S_ISDIR(mode: int) -> bool: ... +def S_ISCHR(mode: int) -> bool: ... +def S_ISBLK(mode: int) -> bool: ... +def S_ISREG(mode: int) -> bool: ... +def S_ISFIFO(mode: int) -> bool: ... +def S_ISLNK(mode: int) -> bool: ... +def S_ISSOCK(mode: int) -> bool: ... + +def S_IMODE(mode: int) -> int: ... +def S_IFMT(mode: int) -> int: ... + +ST_MODE = 0 +ST_INO = 0 +ST_DEV = 0 +ST_NLINK = 0 +ST_UID = 0 +ST_GID = 0 +ST_SIZE = 0 +ST_ATIME = 0 +ST_MTIME = 0 +ST_CTIME = 0 +S_IFSOCK = 0 +S_IFLNK = 0 +S_IFREG = 0 +S_IFBLK = 0 +S_IFDIR = 0 +S_IFCHR = 0 +S_IFIFO = 0 +S_ISUID = 0 +S_ISGID = 0 +S_ISVTX = 0 +S_IRWXU = 0 +S_IRUSR = 0 +S_IWUSR = 0 +S_IXUSR = 0 +S_IRWXG = 0 +S_IRGRP = 0 +S_IWGRP = 0 +S_IXGRP = 0 +S_IRWXO = 0 +S_IROTH = 0 +S_IWOTH = 0 +S_IXOTH = 0 +S_ENFMT = 0 +S_IREAD = 0 +S_IWRITE = 0 +S_IEXEC = 0 +UF_NODUMP = 0 +UF_IMMUTABLE = 0 +UF_APPEND = 0 +UF_OPAQUE = 0 +UF_NOUNLINK = 0 +UF_COMPRESSED = 0 +UF_HIDDEN = 0 +SF_ARCHIVED = 0 +SF_IMMUTABLE = 0 +SF_APPEND = 0 +SF_NOUNLINK = 0 +SF_SNAPSHOT = 0 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/string.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/string.pyi new file mode 100644 index 0000000..624f092 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/string.pyi @@ -0,0 +1,78 @@ +# Stubs for string + +# Based on http://docs.python.org/3.2/library/string.html + +from typing import Any, AnyStr, Iterable, List, Mapping, Optional, overload, Sequence, Text, Tuple, Union + +ascii_letters: str +ascii_lowercase: str +ascii_uppercase: str +digits: str +hexdigits: str +letters: str +lowercase: str +octdigits: str +punctuation: str +printable: str +uppercase: str +whitespace: str + +def capwords(s: AnyStr, sep: AnyStr = ...) -> AnyStr: ... +# TODO: originally named 'from' +def maketrans(_from: str, to: str) -> str: ... +def atof(s: unicode) -> float: ... +def atoi(s: unicode, base: int = ...) -> int: ... +def atol(s: unicode, base: int = ...) -> int: ... +def capitalize(word: AnyStr) -> AnyStr: ... +def find(s: unicode, sub: unicode, start: int = ..., end: int = ...) -> int: ... +def rfind(s: unicode, sub: unicode, start: int = ..., end: int = ...) -> int: ... +def index(s: unicode, sub: unicode, start: int = ..., end: int = ...) -> int: ... +def rindex(s: unicode, sub: unicode, start: int = ..., end: int = ...) -> int: ... +def count(s: unicode, sub: unicode, start: int = ..., end: int = ...) -> int: ... +def lower(s: AnyStr) -> AnyStr: ... +def split(s: AnyStr, sep: AnyStr = ..., maxsplit: int = ...) -> List[AnyStr]: ... +def rsplit(s: AnyStr, sep: AnyStr = ..., maxsplit: int = ...) -> List[AnyStr]: ... +def splitfields(s: AnyStr, sep: AnyStr = ..., maxsplit: int = ...) -> List[AnyStr]: ... +def join(words: Iterable[AnyStr], sep: AnyStr = ...) -> AnyStr: ... +def joinfields(word: Iterable[AnyStr], sep: AnyStr = ...) -> AnyStr: ... +def lstrip(s: AnyStr, chars: AnyStr = ...) -> AnyStr: ... +def rstrip(s: AnyStr, chars: AnyStr = ...) -> AnyStr: ... +def strip(s: AnyStr, chars: AnyStr = ...) -> AnyStr: ... +def swapcase(s: AnyStr) -> AnyStr: ... +def translate(s: str, table: str, deletechars: str = ...) -> str: ... +def upper(s: AnyStr) -> AnyStr: ... +def ljust(s: AnyStr, width: int, fillchar: AnyStr = ...) -> AnyStr: ... +def rjust(s: AnyStr, width: int, fillchar: AnyStr = ...) -> AnyStr: ... +def center(s: AnyStr, width: int, fillchar: AnyStr = ...) -> AnyStr: ... +def zfill(s: AnyStr, width: int) -> AnyStr: ... +def replace(s: AnyStr, old: AnyStr, new: AnyStr, maxreplace: int = ...) -> AnyStr: ... + +class Template: + template: Text + + def __init__(self, template: Text) -> None: ... + @overload + def substitute(self, mapping: Union[Mapping[str, str], Mapping[unicode, str]] = ..., **kwds: str) -> str: ... + @overload + def substitute(self, mapping: Union[Mapping[str, Text], Mapping[unicode, Text]] = ..., **kwds: Text) -> Text: ... + @overload + def safe_substitute(self, mapping: Union[Mapping[str, str], Mapping[unicode, str]] = ..., **kwds: str) -> str: ... + @overload + def safe_substitute(self, mapping: Union[Mapping[str, Text], Mapping[unicode, Text]], **kwds: Text) -> Text: ... + +# TODO(MichalPokorny): This is probably badly and/or loosely typed. +class Formatter(object): + def format(self, format_string: str, *args, **kwargs) -> str: ... + def vformat(self, format_string: str, args: Sequence[Any], + kwargs: Mapping[str, Any]) -> str: ... + def parse(self, format_string: str) -> Iterable[Tuple[str, str, str, str]]: ... + def get_field(self, field_name: str, args: Sequence[Any], + kwargs: Mapping[str, Any]) -> Any: ... + def get_value(self, key: Union[int, str], args: Sequence[Any], + kwargs: Mapping[str, Any]) -> Any: + raise IndexError() + raise KeyError() + def check_unused_args(self, used_args: Sequence[Union[int, str]], args: Sequence[Any], + kwargs: Mapping[str, Any]) -> None: ... + def format_field(self, value: Any, format_spec: str) -> Any: ... + def convert_field(self, value: Any, conversion: str) -> Any: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/stringold.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/stringold.pyi new file mode 100644 index 0000000..ab3e764 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/stringold.pyi @@ -0,0 +1,46 @@ +# Source: https://hg.python.org/cpython/file/2.7/Lib/stringold.py +from typing import AnyStr, Iterable, List, Optional, Type + +whitespace: str +lowercase: str +uppercase: str +letters: str +digits: str +hexdigits: str +octdigits: str +_idmap: str +_idmapL: Optional[List[str]] +index_error = ValueError +atoi_error = ValueError +atof_error = ValueError +atol_error = ValueError + + +def lower(s: AnyStr) -> AnyStr: ... +def upper(s: AnyStr) -> AnyStr: ... +def swapcase(s: AnyStr) -> AnyStr: ... +def strip(s: AnyStr) -> AnyStr: ... +def lstrip(s: AnyStr) -> AnyStr: ... +def rstrip(s: AnyStr) -> AnyStr: ... +def split(s: AnyStr, sep: AnyStr = ..., maxsplit: int = ...) -> List[AnyStr]: ... +def splitfields(s: AnyStr, sep: AnyStr = ..., maxsplit: int = ...) -> List[AnyStr]: ... +def join(words: Iterable[AnyStr], sep: AnyStr = ...) -> AnyStr: ... +def joinfields(words: Iterable[AnyStr], sep: AnyStr = ...) -> AnyStr: ... +def index(s: unicode, sub: unicode, start: int = ..., end: int = ...) -> int: ... +def rindex(s: unicode, sub: unicode, start: int = ..., end: int = ...) -> int: ... +def count(s: unicode, sub: unicode, start: int = ..., end: int = ...) -> int: ... +def find(s: unicode, sub: unicode, start: int = ..., end: int = ...) -> int: ... +def rfind(s: unicode, sub: unicode, start: int = ..., end: int = ...) -> int: ... +def atof(s: unicode) -> float: ... +def atoi(s: unicode, base: int = ...) -> int: ... +def atol(s: unicode, base: int = ...) -> long: ... +def ljust(s: AnyStr, width: int, fillchar: AnyStr = ...) -> AnyStr: ... +def rjust(s: AnyStr, width: int, fillchar: AnyStr = ...) -> AnyStr: ... +def center(s: AnyStr, width: int, fillchar: AnyStr = ...) -> AnyStr: ... +def zfill(s: AnyStr, width: int) -> AnyStr: ... +def expandtabs(s: AnyStr, tabsize: int = ...) -> AnyStr: ... +def translate(s: str, table: str, deletions: str = ...) -> str: ... +def capitalize(s: AnyStr) -> AnyStr: ... +def capwords(s: AnyStr, sep: AnyStr = ...) -> AnyStr: ... +def maketrans(fromstr: str, tostr: str) -> str: ... +def replace(s: AnyStr, old: AnyStr, new: AnyStr, maxreplace: int = ...) -> AnyStr: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/strop.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/strop.pyi new file mode 100644 index 0000000..e1a098f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/strop.pyi @@ -0,0 +1,72 @@ +"""Stub file for the 'strop' module.""" + +from typing import List, Sequence + +lowercase: str +uppercase: str +whitespace: str + +def atof(a: str) -> float: + raise DeprecationWarning() + +def atoi(a: str, base: int = ...) -> int: + raise DeprecationWarning() + +def atol(a: str, base: int = ...) -> long: + raise DeprecationWarning() + +def capitalize(s: str) -> str: + raise DeprecationWarning() + +def count(s: str, sub: str, start: int = ..., end: int = ...) -> int: + raise DeprecationWarning() + +def expandtabs(string: str, tabsize: int = ...) -> str: + raise DeprecationWarning() + raise OverflowError() + +def find(s: str, sub: str, start: int = ..., end: int = ...) -> int: + raise DeprecationWarning() + +def join(list: Sequence[str], sep: str = ...) -> str: + raise DeprecationWarning() + raise OverflowError() + +def joinfields(list: Sequence[str], sep: str = ...) -> str: + raise DeprecationWarning() + raise OverflowError() + +def lower(s: str) -> str: + raise DeprecationWarning() + +def lstrip(s: str) -> str: + raise DeprecationWarning() + +def maketrans(frm: str, to: str) -> str: ... + +def replace(s: str, old: str, new: str, maxsplit: int = ...) -> str: + raise DeprecationWarning() + +def rfind(s: str, sub: str, start: int = ..., end: int = ...) -> int: + raise DeprecationWarning() + +def rstrip(s: str) -> str: + raise DeprecationWarning() + +def split(s: str, sep: str, maxsplit: int = ...) -> List[str]: + raise DeprecationWarning() + +def splitfields(s: str, sep: str, maxsplit: int = ...) -> List[str]: + raise DeprecationWarning() + +def strip(s: str) -> str: + raise DeprecationWarning() + +def swapcase(s: str) -> str: + raise DeprecationWarning() + +def translate(s: str, table: str, deletechars: str = ...) -> str: + raise DeprecationWarning() + +def upper(s: str) -> str: + raise DeprecationWarning() diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/subprocess.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/subprocess.pyi new file mode 100644 index 0000000..b60e89e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/subprocess.pyi @@ -0,0 +1,117 @@ +# Stubs for subprocess + +# Based on http://docs.python.org/2/library/subprocess.html and Python 3 stub + +from typing import Sequence, Any, Mapping, Callable, Tuple, IO, Union, Optional, List, Text + +_FILE = Union[None, int, IO[Any]] +_TXT = Union[bytes, Text] +_CMD = Union[_TXT, Sequence[_TXT]] +_ENV = Union[Mapping[bytes, _TXT], Mapping[Text, _TXT]] + +# Same args as Popen.__init__ +def call(args: _CMD, + bufsize: int = ..., + executable: _TXT = ..., + stdin: _FILE = ..., + stdout: _FILE = ..., + stderr: _FILE = ..., + preexec_fn: Callable[[], Any] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: _TXT = ..., + env: _ENV = ..., + universal_newlines: bool = ..., + startupinfo: Any = ..., + creationflags: int = ...) -> int: ... + +def check_call(args: _CMD, + bufsize: int = ..., + executable: _TXT = ..., + stdin: _FILE = ..., + stdout: _FILE = ..., + stderr: _FILE = ..., + preexec_fn: Callable[[], Any] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: _TXT = ..., + env: _ENV = ..., + universal_newlines: bool = ..., + startupinfo: Any = ..., + creationflags: int = ...) -> int: ... + +# Same args as Popen.__init__ except for stdout +def check_output(args: _CMD, + bufsize: int = ..., + executable: _TXT = ..., + stdin: _FILE = ..., + stderr: _FILE = ..., + preexec_fn: Callable[[], Any] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: _TXT = ..., + env: _ENV = ..., + universal_newlines: bool = ..., + startupinfo: Any = ..., + creationflags: int = ...) -> bytes: ... + +PIPE: int +STDOUT: int + +class CalledProcessError(Exception): + returncode = 0 + # morally: _CMD + cmd: Any + # morally: Optional[bytes] + output: Any + + def __init__(self, + returncode: int, + cmd: _CMD, + output: Optional[bytes] = ...) -> None: ... + +class Popen: + stdin: Optional[IO[Any]] + stdout: Optional[IO[Any]] + stderr: Optional[IO[Any]] + pid = 0 + returncode = 0 + + def __init__(self, + args: _CMD, + bufsize: int = ..., + executable: Optional[_TXT] = ..., + stdin: Optional[_FILE] = ..., + stdout: Optional[_FILE] = ..., + stderr: Optional[_FILE] = ..., + preexec_fn: Optional[Callable[[], Any]] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[_TXT] = ..., + env: Optional[_ENV] = ..., + universal_newlines: bool = ..., + startupinfo: Optional[Any] = ..., + creationflags: int = ...) -> None: ... + + def poll(self) -> int: ... + def wait(self) -> int: ... + # morally: -> Tuple[Optional[bytes], Optional[bytes]] + def communicate(self, input: Optional[_TXT] = ...) -> Tuple[Any, Any]: ... + def send_signal(self, signal: int) -> None: ... + def terminate(self) -> None: ... + def kill(self) -> None: ... + def __enter__(self) -> Popen: ... + def __exit__(self, type, value, traceback) -> bool: ... + +def list2cmdline(seq: Sequence[str]) -> str: ... # undocumented + +# Windows-only: STARTUPINFO etc. + +STD_INPUT_HANDLE: Any +STD_OUTPUT_HANDLE: Any +STD_ERROR_HANDLE: Any +SW_HIDE: Any +STARTF_USESTDHANDLES: Any +STARTF_USESHOWWINDOW: Any +CREATE_NEW_CONSOLE: Any +CREATE_NEW_PROCESS_GROUP: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/symbol.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/symbol.pyi new file mode 100644 index 0000000..55d25a6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/symbol.pyi @@ -0,0 +1,91 @@ +# Stubs for symbol (Python 2) + +from typing import Dict + +single_input: int +file_input: int +eval_input: int +decorator: int +decorators: int +decorated: int +funcdef: int +parameters: int +varargslist: int +fpdef: int +fplist: int +stmt: int +simple_stmt: int +small_stmt: int +expr_stmt: int +augassign: int +print_stmt: int +del_stmt: int +pass_stmt: int +flow_stmt: int +break_stmt: int +continue_stmt: int +return_stmt: int +yield_stmt: int +raise_stmt: int +import_stmt: int +import_name: int +import_from: int +import_as_name: int +dotted_as_name: int +import_as_names: int +dotted_as_names: int +dotted_name: int +global_stmt: int +exec_stmt: int +assert_stmt: int +compound_stmt: int +if_stmt: int +while_stmt: int +for_stmt: int +try_stmt: int +with_stmt: int +with_item: int +except_clause: int +suite: int +testlist_safe: int +old_test: int +old_lambdef: int +test: int +or_test: int +and_test: int +not_test: int +comparison: int +comp_op: int +expr: int +xor_expr: int +and_expr: int +shift_expr: int +arith_expr: int +term: int +factor: int +power: int +atom: int +listmaker: int +testlist_comp: int +lambdef: int +trailer: int +subscriptlist: int +subscript: int +sliceop: int +exprlist: int +testlist: int +dictorsetmaker: int +classdef: int +arglist: int +argument: int +list_iter: int +list_for: int +list_if: int +comp_iter: int +comp_for: int +comp_if: int +testlist1: int +encoding_decl: int +yield_expr: int + +sym_name: Dict[int, str] diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/sys.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/sys.pyi new file mode 100644 index 0000000..e67b263 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/sys.pyi @@ -0,0 +1,138 @@ +"""Stubs for the 'sys' module.""" + +from typing import ( + IO, NoReturn, Union, List, Sequence, Any, Dict, Tuple, BinaryIO, Optional, + Callable, overload, Text, Type, +) +from types import FrameType, ModuleType, TracebackType, ClassType + +# The following type alias are stub-only and do not exist during runtime +_ExcInfo = Tuple[Type[BaseException], BaseException, TracebackType] +_OptExcInfo = Tuple[Optional[Type[BaseException]], Optional[BaseException], Optional[TracebackType]] + +class _flags: + bytes_warning: int + debug: int + division_new: int + division_warning: int + dont_write_bytecode: int + hash_randomization: int + ignore_environment: int + inspect: int + interactive: int + no_site: int + no_user_site: int + optimize: int + py3k_warning: int + tabcheck: int + unicode: int + verbose: int + +class _float_info: + max: float + max_exp: int + max_10_exp: int + min: float + min_exp: int + min_10_exp: int + dig: int + mant_dig: int + epsilon: float + radix: int + rounds: int + +class _version_info(Tuple[int, int, int, str, int]): + major = 0 + minor = 0 + micro = 0 + releaselevel: str + serial = 0 + +_mercurial: Tuple[str, str, str] +api_version: int +argv: List[str] +builtin_module_names: Tuple[str, ...] +byteorder: str +copyright: str +dont_write_bytecode: bool +exec_prefix: str +executable: str +flags: _flags +float_repr_style: str +hexversion: int +long_info: object +maxint: int +maxsize: int +maxunicode: int +modules: Dict[str, Any] +path: List[str] +platform: str +prefix: str +py3kwarning: bool +__stderr__: IO[str] +__stdin__: IO[str] +__stdout__: IO[str] +stderr: IO[str] +stdin: IO[str] +stdout: IO[str] +subversion: Tuple[str, str, str] +version: str +warnoptions: object +float_info: _float_info +version_info: _version_info +ps1: str +ps2: str +last_type: type +last_value: BaseException +last_traceback: TracebackType +# TODO precise types +meta_path: List[Any] +path_hooks: List[Any] +path_importer_cache: Dict[str, Any] +displayhook: Optional[Callable[[int], None]] +excepthook: Optional[Callable[[type, BaseException, TracebackType], None]] +exc_type: Optional[type] +exc_value: Union[BaseException, ClassType] +exc_traceback: TracebackType + +class _WindowsVersionType: + major: Any + minor: Any + build: Any + platform: Any + service_pack: Any + service_pack_major: Any + service_pack_minor: Any + suite_mask: Any + product_type: Any + +def getwindowsversion() -> _WindowsVersionType: ... + +def _clear_type_cache() -> None: ... +def _current_frames() -> Dict[int, FrameType]: ... +def _getframe(depth: int = ...) -> FrameType: ... +def call_tracing(fn: Any, args: Any) -> Any: ... +def __displayhook__(value: int) -> None: ... +def __excepthook__(type_: type, value: BaseException, traceback: TracebackType) -> None: ... +def exc_clear() -> None: + raise DeprecationWarning() +def exc_info() -> _OptExcInfo: ... + +# sys.exit() accepts an optional argument of anything printable +def exit(arg: Any = ...) -> NoReturn: + raise SystemExit() +def getcheckinterval() -> int: ... # deprecated +def getdefaultencoding() -> str: ... +def getdlopenflags() -> int: ... +def getfilesystemencoding() -> str: ... # In practice, never returns None +def getrefcount(arg: Any) -> int: ... +def getrecursionlimit() -> int: ... +def getsizeof(obj: object, default: int = ...) -> int: ... +def getprofile() -> Optional[Any]: ... +def gettrace() -> Optional[Any]: ... +def setcheckinterval(interval: int) -> None: ... # deprecated +def setdlopenflags(n: int) -> None: ... +def setdefaultencoding(encoding: Text) -> None: ... # only exists after reload(sys) +def setprofile(profilefunc: Any) -> None: ... # TODO type +def setrecursionlimit(limit: int) -> None: ... +def settrace(tracefunc: Any) -> None: ... # TODO type diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/tempfile.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/tempfile.pyi new file mode 100644 index 0000000..2dcc1a9 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/tempfile.pyi @@ -0,0 +1,111 @@ +from typing import Any, AnyStr, IO, Iterable, Iterator, List, Optional, overload, Text, Tuple, Union +from thread import LockType +from random import Random + +TMP_MAX: int +tempdir: str +template: str +_name_sequence: Optional[_RandomNameSequence] + +class _RandomNameSequence: + characters: str = ... + mutex: LockType + @property + def rng(self) -> Random: ... + def __iter__(self) -> _RandomNameSequence: ... + def next(self) -> str: ... + # from os.path: + def normcase(self, path: AnyStr) -> AnyStr: ... + +class _TemporaryFileWrapper(IO[str]): + delete: bool + file: IO + name: Any + def __init__(self, file: IO, name: Any, delete: bool = ...) -> None: ... + def __del__(self) -> None: ... + def __enter__(self) -> _TemporaryFileWrapper: ... + def __exit__(self, exc, value, tb) -> bool: ... + def __getattr__(self, name: unicode) -> Any: ... + def close(self) -> None: ... + def unlink(self, path: unicode) -> None: ... + # These methods don't exist directly on this object, but + # are delegated to the underlying IO object through __getattr__. + # We need to add them here so that this class is concrete. + def __iter__(self) -> Iterator[str]: ... + def fileno(self) -> int: ... + def flush(self) -> None: ... + def isatty(self) -> bool: ... + def next(self) -> str: ... + def read(self, n: int = ...) -> str: ... + def readable(self) -> bool: ... + def readline(self, limit: int = ...) -> str: ... + def readlines(self, hint: int = ...) -> List[str]: ... + def seek(self, offset: int, whence: int = ...) -> int: ... + def seekable(self) -> bool: ... + def tell(self) -> int: ... + def truncate(self, size: Optional[int] = ...) -> int: ... + def writable(self) -> bool: ... + def write(self, s: Text) -> int: ... + def writelines(self, lines: Iterable[str]) -> None: ... + + +# TODO text files + +def TemporaryFile( + mode: Union[bytes, unicode] = ..., + bufsize: int = ..., + suffix: Union[bytes, unicode] = ..., + prefix: Union[bytes, unicode] = ..., + dir: Union[bytes, unicode] = ... +) -> _TemporaryFileWrapper: + ... + +def NamedTemporaryFile( + mode: Union[bytes, unicode] = ..., + bufsize: int = ..., + suffix: Union[bytes, unicode] = ..., + prefix: Union[bytes, unicode] = ..., + dir: Union[bytes, unicode] = ..., + delete: bool = ... +) -> _TemporaryFileWrapper: + ... + +def SpooledTemporaryFile( + max_size: int = ..., + mode: Union[bytes, unicode] = ..., + buffering: int = ..., + suffix: Union[bytes, unicode] = ..., + prefix: Union[bytes, unicode] = ..., + dir: Union[bytes, unicode] = ... +) -> _TemporaryFileWrapper: + ... + +class TemporaryDirectory: + name: Any + def __init__(self, + suffix: Union[bytes, unicode] = ..., + prefix: Union[bytes, unicode] = ..., + dir: Union[bytes, unicode] = ...) -> None: ... + def cleanup(self) -> None: ... + def __enter__(self) -> Any: ... # Can be str or unicode + def __exit__(self, type, value, traceback) -> bool: ... + +@overload +def mkstemp() -> Tuple[int, str]: ... +@overload +def mkstemp(suffix: AnyStr = ..., prefix: AnyStr = ..., dir: Optional[AnyStr] = ..., + text: bool = ...) -> Tuple[int, AnyStr]: ... +@overload +def mkdtemp() -> str: ... +@overload +def mkdtemp(suffix: AnyStr = ..., prefix: AnyStr = ..., dir: Optional[AnyStr] = ...) -> AnyStr: ... +@overload +def mktemp() -> str: ... +@overload +def mktemp(suffix: AnyStr = ..., prefix: AnyStr = ..., dir: Optional[AnyStr] = ...) -> AnyStr: ... +def gettempdir() -> str: ... +def gettempprefix() -> str: ... + +def _candidate_tempdir_list() -> List[str]: ... +def _get_candidate_names() -> Optional[_RandomNameSequence]: ... +def _get_default_tempdir() -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/textwrap.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/textwrap.pyi new file mode 100644 index 0000000..60498a6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/textwrap.pyi @@ -0,0 +1,61 @@ +from typing import AnyStr, List, Dict, Pattern + +class TextWrapper(object): + width: int = ... + initial_indent: str = ... + subsequent_indent: str = ... + expand_tabs: bool = ... + replace_whitespace: bool = ... + fix_sentence_endings: bool = ... + drop_whitespace: bool = ... + break_long_words: bool = ... + break_on_hyphens: bool = ... + + # Attributes not present in documentation + sentence_end_re: Pattern[str] = ... + wordsep_re: Pattern[str] = ... + wordsep_simple_re: Pattern[str] = ... + whitespace_trans: str = ... + unicode_whitespace_trans: Dict[int, int] = ... + uspace: int = ... + x: int = ... + + def __init__( + self, + width: int = ..., + initial_indent: str = ..., + subsequent_indent: str = ..., + expand_tabs: bool = ..., + replace_whitespace: bool = ..., + fix_sentence_endings: bool = ..., + break_long_words: bool = ..., + drop_whitespace: bool = ..., + break_on_hyphens: bool = ...) -> None: + ... + + def wrap(self, text: AnyStr) -> List[AnyStr]: ... + def fill(self, text: AnyStr) -> AnyStr: ... + +def wrap(text: AnyStr, + width: int = ..., + initial_indent: AnyStr = ..., + subsequent_indent: AnyStr = ..., + expand_tabs: bool = ..., + replace_whitespace: bool = ..., + fix_sentence_endings: bool = ..., + break_long_words: bool = ..., + drop_whitespace: bool = ..., + break_on_hyphens: bool = ...) -> List[AnyStr]: ... + +def fill(text: AnyStr, + width: int = ..., + initial_indent: AnyStr = ..., + subsequent_indent: AnyStr = ..., + expand_tabs: bool = ..., + replace_whitespace: bool = ..., + fix_sentence_endings: bool = ..., + break_long_words: bool = ..., + drop_whitespace: bool = ..., + break_on_hyphens: bool = ...) -> AnyStr: ... + +def dedent(text: AnyStr) -> AnyStr: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/thread.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/thread.pyi new file mode 100644 index 0000000..eb4e6d6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/thread.pyi @@ -0,0 +1,30 @@ +"""Stubs for the "thread" module.""" +from typing import Callable, Any + +def _count() -> int: ... + +class error(Exception): ... + +class LockType: + def acquire(self, waitflag: int = ...) -> bool: ... + def acquire_lock(self, waitflag: int = ...) -> bool: ... + def release(self) -> None: ... + def release_lock(self) -> None: ... + def locked(self) -> bool: ... + def locked_lock(self) -> bool: ... + def __enter__(self) -> LockType: ... + def __exit__(self, typ: Any, value: Any, traceback: Any) -> None: ... + +class _local(object): ... +class _localdummy(object): ... + +def start_new(function: Callable[..., Any], args: Any, kwargs: Any = ...) -> int: ... +def start_new_thread(function: Callable[..., Any], args: Any, kwargs: Any = ...) -> int: ... +def interrupt_main() -> None: ... +def exit() -> None: + raise SystemExit() +def exit_thread() -> Any: + raise SystemExit() +def allocate_lock() -> LockType: ... +def get_ident() -> int: ... +def stack_size(size: int = ...) -> int: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/toaiff.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/toaiff.pyi new file mode 100644 index 0000000..77334c7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/toaiff.pyi @@ -0,0 +1,16 @@ +# Stubs for toaiff (Python 2) + +# Source: https://hg.python.org/cpython/file/2.7/Lib/toaiff.py +from pipes import Template +from typing import Dict, List + + +__all__: List[str] +table: Dict[str, Template] +t: Template +uncompress: Template + +class error(Exception): ... + +def toaiff(filename: str) -> str: ... +def _toaiff(filename: str, temps: List[str]) -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/tokenize.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/tokenize.pyi new file mode 100644 index 0000000..43457b6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/tokenize.pyi @@ -0,0 +1,136 @@ +# Automatically generated by pytype, manually fixed up. May still contain errors. + +from typing import Any, Callable, Dict, Generator, Iterator, List, Tuple, Union, Iterable + +__author__: str +__credits__: str + +AMPER: int +AMPEREQUAL: int +AT: int +BACKQUOTE: int +Binnumber: str +Bracket: str +CIRCUMFLEX: int +CIRCUMFLEXEQUAL: int +COLON: int +COMMA: int +COMMENT: int +Comment: str +ContStr: str +DEDENT: int +DOT: int +DOUBLESLASH: int +DOUBLESLASHEQUAL: int +DOUBLESTAR: int +DOUBLESTAREQUAL: int +Decnumber: str +Double: str +Double3: str +ENDMARKER: int +EQEQUAL: int +EQUAL: int +ERRORTOKEN: int +Expfloat: str +Exponent: str +Floatnumber: str +Funny: str +GREATER: int +GREATEREQUAL: int +Hexnumber: str +INDENT: int + +def ISEOF(x: int) -> bool: ... +def ISNONTERMINAL(x: int) -> bool: ... +def ISTERMINAL(x: int) -> bool: ... + +Ignore: str +Imagnumber: str +Intnumber: str +LBRACE: int +LEFTSHIFT: int +LEFTSHIFTEQUAL: int +LESS: int +LESSEQUAL: int +LPAR: int +LSQB: int +MINEQUAL: int +MINUS: int +NAME: int +NEWLINE: int +NL: int +NOTEQUAL: int +NT_OFFSET: int +NUMBER: int +N_TOKENS: int +Name: str +Number: str +OP: int +Octnumber: str +Operator: str +PERCENT: int +PERCENTEQUAL: int +PLUS: int +PLUSEQUAL: int +PlainToken: str +Pointfloat: str +PseudoExtras: str +PseudoToken: str +RBRACE: int +RIGHTSHIFT: int +RIGHTSHIFTEQUAL: int +RPAR: int +RSQB: int +SEMI: int +SLASH: int +SLASHEQUAL: int +STAR: int +STAREQUAL: int +STRING: int +Single: str +Single3: str +Special: str +String: str +TILDE: int +Token: str +Triple: str +VBAR: int +VBAREQUAL: int +Whitespace: str +chain: type +double3prog: type +endprogs: Dict[str, Any] +pseudoprog: type +single3prog: type +single_quoted: Dict[str, str] +t: str +tabsize: int +tok_name: Dict[int, str] +tokenprog: type +triple_quoted: Dict[str, str] +x: str + +_Pos = Tuple[int, int] +_TokenType = Tuple[int, str, _Pos, _Pos, str] + +def any(*args, **kwargs) -> str: ... +def generate_tokens(readline: Callable[[], str]) -> Generator[_TokenType, None, None]: ... +def group(*args: str) -> str: ... +def maybe(*args: str) -> str: ... +def printtoken(type: int, token: str, srow_scol: _Pos, erow_ecol: _Pos, line: str) -> None: ... +def tokenize(readline: Callable[[], str], tokeneater: Callable[[Tuple[int, str, _Pos, _Pos, str]], None]) -> None: ... +def tokenize_loop(readline: Callable[[], str], tokeneater: Callable[[Tuple[int, str, _Pos, _Pos, str]], None]) -> None: ... +def untokenize(iterable: Iterable[_TokenType]) -> str: ... + +class StopTokenizing(Exception): ... + +class TokenError(Exception): ... + +class Untokenizer: + prev_col: int + prev_row: int + tokens: List[str] + def __init__(self) -> None: ... + def add_whitespace(self, _Pos) -> None: ... + def compat(self, token: Tuple[int, Any], iterable: Iterator[_TokenType]) -> None: ... + def untokenize(self, iterable: Iterable[_TokenType]) -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/types.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/types.pyi new file mode 100644 index 0000000..5984706 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/types.pyi @@ -0,0 +1,168 @@ +# Stubs for types +# Note, all classes "defined" here require special handling. + +from typing import ( + Any, Callable, Dict, Iterable, Iterator, List, Optional, + Tuple, Type, TypeVar, Union, overload, +) + +_T = TypeVar('_T') + +class NoneType: ... +TypeType = type +ObjectType = object + +IntType = int +LongType = int # Really long, but can't reference that due to a mypy import cycle +FloatType = float +BooleanType = bool +ComplexType = complex +StringType = str +UnicodeType = unicode +StringTypes: Tuple[Type[StringType], Type[UnicodeType]] +BufferType = buffer +TupleType = tuple +ListType = list +DictType = dict +DictionaryType = dict + +class _Cell: + cell_contents: Any + +class FunctionType: + func_closure: Optional[Tuple[_Cell, ...]] = ... + func_code: CodeType = ... + func_defaults: Optional[Tuple[Any, ...]] = ... + func_dict: Dict[str, Any] = ... + func_doc: Optional[str] = ... + func_globals: Dict[str, Any] = ... + func_name: str = ... + __closure__ = func_closure + __code__ = func_code + __defaults__ = func_defaults + __dict__ = func_dict + __globals__ = func_globals + __name__ = func_name + def __init__(self, code: CodeType, globals: Dict[str, Any], name: Optional[str] = ..., argdefs: Optional[Tuple[object, ...]] = ..., closure: Optional[Tuple[_Cell, ...]] = ...) -> None: ... + def __call__(self, *args: Any, **kwargs: Any) -> Any: ... + def __get__(self, obj: Optional[object], type: Optional[type]) -> UnboundMethodType: ... + +LambdaType = FunctionType + +class CodeType: + co_argcount: int + co_cellvars: Tuple[str, ...] + co_code: str + co_consts: Tuple[Any, ...] + co_filename: str + co_firstlineno: int + co_flags: int + co_freevars: Tuple[str, ...] + co_lnotab: str + co_name: str + co_names: Tuple[str, ...] + co_nlocals: int + co_stacksize: int + co_varnames: Tuple[str, ...] + +class GeneratorType: + gi_code: CodeType + gi_frame: FrameType + gi_running: int + def __iter__(self) -> GeneratorType: ... + def close(self) -> None: ... + def next(self) -> Any: ... + def send(self, arg: Any) -> Any: ... + @overload + def throw(self, val: BaseException) -> Any: ... + @overload + def throw(self, typ: type, val: BaseException = ..., tb: TracebackType = ...) -> Any: ... + +class ClassType: ... +class UnboundMethodType: + im_class: type = ... + im_func: FunctionType = ... + im_self: object = ... + __name__: str + __func__ = im_func + __self__ = im_self + def __init__(self, func: Callable, obj: object) -> None: ... + def __call__(self, *args: Any, **kwargs: Any) -> Any: ... + +class InstanceType(object): ... + +MethodType = UnboundMethodType + +class BuiltinFunctionType: + __self__: Optional[object] + def __call__(self, *args: Any, **kwargs: Any) -> Any: ... +BuiltinMethodType = BuiltinFunctionType + +class ModuleType: + __doc__: Optional[str] + __file__: Optional[str] + __name__: str + __package__: Optional[str] + __path__: Optional[Iterable[str]] + __dict__: Dict[str, Any] + def __init__(self, name: str, doc: Optional[str] = ...) -> None: ... +FileType = file +XRangeType = xrange + +class TracebackType: + tb_frame: FrameType + tb_lasti: int + tb_lineno: int + tb_next: TracebackType + +class FrameType: + f_back: FrameType + f_builtins: Dict[str, Any] + f_code: CodeType + f_exc_type: None + f_exc_value: None + f_exc_traceback: None + f_globals: Dict[str, Any] + f_lasti: int + f_lineno: int + f_locals: Dict[str, Any] + f_restricted: bool + f_trace: Callable[[], None] + + def clear(self) -> None: ... + +SliceType = slice +class EllipsisType: ... + +class DictProxyType: + # TODO is it possible to have non-string keys? + # no __init__ + def copy(self) -> dict: ... + def get(self, key: str, default: _T = ...) -> Union[Any, _T]: ... + def has_key(self, key: str) -> bool: ... + def items(self) -> List[Tuple[str, Any]]: ... + def iteritems(self) -> Iterator[Tuple[str, Any]]: ... + def iterkeys(self) -> Iterator[str]: ... + def itervalues(self) -> Iterator[Any]: ... + def keys(self) -> List[str]: ... + def values(self) -> List[Any]: ... + def __contains__(self, key: str) -> bool: ... + def __getitem__(self, key: str) -> Any: ... + def __iter__(self) -> Iterator[str]: ... + def __len__(self) -> int: ... + +class NotImplementedType: ... + +class GetSetDescriptorType: + __name__: str + __objclass__: type + def __get__(self, obj: Any, type: type = ...) -> Any: ... + def __set__(self, obj: Any) -> None: ... + def __delete__(self, obj: Any) -> None: ... +# Same type on Jython, different on CPython and PyPy, unknown on IronPython. +class MemberDescriptorType: + __name__: str + __objclass__: type + def __get__(self, obj: Any, type: type = ...) -> Any: ... + def __set__(self, obj: Any) -> None: ... + def __delete__(self, obj: Any) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/typing.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/typing.pyi new file mode 100644 index 0000000..6c159b9 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/typing.pyi @@ -0,0 +1,468 @@ +# Stubs for typing (Python 2.7) + +from abc import abstractmethod, ABCMeta +from types import CodeType, FrameType, TracebackType +import collections # Needed by aliases like DefaultDict, see mypy issue 2986 + +# Definitions of special type checking related constructs. Their definitions +# are not used, so their value does not matter. + +overload = object() +Any = object() +TypeVar = object() +_promote = object() +no_type_check = object() + +class _SpecialForm(object): + def __getitem__(self, typeargs: Any) -> object: ... + +Tuple: _SpecialForm = ... +Generic: _SpecialForm = ... +Protocol: _SpecialForm = ... +Callable: _SpecialForm = ... +Type: _SpecialForm = ... +ClassVar: _SpecialForm = ... + +class GenericMeta(type): ... + +# Return type that indicates a function does not return. +# This type is equivalent to the None type, but the no-op Union is necessary to +# distinguish the None type from the None value. +NoReturn = Union[None] + +# Type aliases and type constructors + +class TypeAlias: + # Class for defining generic aliases for library types. + def __init__(self, target_type: type) -> None: ... + def __getitem__(self, typeargs: Any) -> Any: ... + +Union = TypeAlias(object) +Optional = TypeAlias(object) +List = TypeAlias(object) +Dict = TypeAlias(object) +DefaultDict = TypeAlias(object) +Set = TypeAlias(object) +FrozenSet = TypeAlias(object) +Counter = TypeAlias(object) +Deque = TypeAlias(object) + +# Predefined type variables. +AnyStr = TypeVar('AnyStr', str, unicode) + +# Abstract base classes. + +# These type variables are used by the container types. +_T = TypeVar('_T') +_S = TypeVar('_S') +_KT = TypeVar('_KT') # Key type. +_VT = TypeVar('_VT') # Value type. +_T_co = TypeVar('_T_co', covariant=True) # Any type covariant containers. +_V_co = TypeVar('_V_co', covariant=True) # Any type covariant containers. +_KT_co = TypeVar('_KT_co', covariant=True) # Key type covariant containers. +_VT_co = TypeVar('_VT_co', covariant=True) # Value type covariant containers. +_T_contra = TypeVar('_T_contra', contravariant=True) # Ditto contravariant. +_TC = TypeVar('_TC', bound=Type[object]) +_C = TypeVar("_C", bound=Callable) + +def runtime(cls: _TC) -> _TC: ... + +@runtime +class SupportsInt(Protocol, metaclass=ABCMeta): + @abstractmethod + def __int__(self) -> int: ... + +@runtime +class SupportsFloat(Protocol, metaclass=ABCMeta): + @abstractmethod + def __float__(self) -> float: ... + +@runtime +class SupportsComplex(Protocol, metaclass=ABCMeta): + @abstractmethod + def __complex__(self) -> complex: ... + +@runtime +class SupportsAbs(Protocol[_T_co]): + @abstractmethod + def __abs__(self) -> _T_co: ... + +@runtime +class Reversible(Protocol[_T_co]): + @abstractmethod + def __reversed__(self) -> Iterator[_T_co]: ... + +@runtime +class Sized(Protocol, metaclass=ABCMeta): + @abstractmethod + def __len__(self) -> int: ... + +@runtime +class Hashable(Protocol, metaclass=ABCMeta): + # TODO: This is special, in that a subclass of a hashable class may not be hashable + # (for example, list vs. object). It's not obvious how to represent this. This class + # is currently mostly useless for static checking. + @abstractmethod + def __hash__(self) -> int: ... + +@runtime +class Iterable(Protocol[_T_co]): + @abstractmethod + def __iter__(self) -> Iterator[_T_co]: ... + +@runtime +class Iterator(Iterable[_T_co], Protocol[_T_co]): + @abstractmethod + def next(self) -> _T_co: ... + def __iter__(self) -> Iterator[_T_co]: ... + +class Generator(Iterator[_T_co], Generic[_T_co, _T_contra, _V_co]): + @abstractmethod + def next(self) -> _T_co: ... + + @abstractmethod + def send(self, value: _T_contra) -> _T_co: ... + + @abstractmethod + def throw(self, typ: Type[BaseException], val: Optional[BaseException] = ..., + tb: TracebackType = ...) -> _T_co: ... + @abstractmethod + def close(self) -> None: ... + @property + def gi_code(self) -> CodeType: ... + @property + def gi_frame(self) -> FrameType: ... + @property + def gi_running(self) -> bool: ... + +@runtime +class Container(Protocol[_T_co]): + @abstractmethod + def __contains__(self, x: object) -> bool: ... + +class Sequence(Iterable[_T_co], Container[_T_co], Reversible[_T_co], Generic[_T_co]): + @overload + @abstractmethod + def __getitem__(self, i: int) -> _T_co: ... + @overload + @abstractmethod + def __getitem__(self, s: slice) -> Sequence[_T_co]: ... + # Mixin methods + def index(self, x: Any) -> int: ... + def count(self, x: Any) -> int: ... + def __contains__(self, x: object) -> bool: ... + def __iter__(self) -> Iterator[_T_co]: ... + def __reversed__(self) -> Iterator[_T_co]: ... + # Implement Sized (but don't have it as a base class). + @abstractmethod + def __len__(self) -> int: ... + +class MutableSequence(Sequence[_T], Generic[_T]): + @abstractmethod + def insert(self, index: int, object: _T) -> None: ... + @overload + @abstractmethod + def __getitem__(self, i: int) -> _T: ... + @overload + @abstractmethod + def __getitem__(self, s: slice) -> MutableSequence[_T]: ... + @overload + @abstractmethod + def __setitem__(self, i: int, o: _T) -> None: ... + @overload + @abstractmethod + def __setitem__(self, s: slice, o: Iterable[_T]) -> None: ... + @overload + @abstractmethod + def __delitem__(self, i: int) -> None: ... + @overload + @abstractmethod + def __delitem__(self, i: slice) -> None: ... + # Mixin methods + def append(self, object: _T) -> None: ... + def extend(self, iterable: Iterable[_T]) -> None: ... + def reverse(self) -> None: ... + def pop(self, index: int = ...) -> _T: ... + def remove(self, object: _T) -> None: ... + def __iadd__(self, x: Iterable[_T]) -> MutableSequence[_T]: ... + +class AbstractSet(Iterable[_T_co], Container[_T_co], Generic[_T_co]): + @abstractmethod + def __contains__(self, x: object) -> bool: ... + # Mixin methods + def __le__(self, s: AbstractSet[Any]) -> bool: ... + def __lt__(self, s: AbstractSet[Any]) -> bool: ... + def __gt__(self, s: AbstractSet[Any]) -> bool: ... + def __ge__(self, s: AbstractSet[Any]) -> bool: ... + def __and__(self, s: AbstractSet[Any]) -> AbstractSet[_T_co]: ... + def __or__(self, s: AbstractSet[_T]) -> AbstractSet[Union[_T_co, _T]]: ... + def __sub__(self, s: AbstractSet[Any]) -> AbstractSet[_T_co]: ... + def __xor__(self, s: AbstractSet[_T]) -> AbstractSet[Union[_T_co, _T]]: ... + # TODO: argument can be any container? + def isdisjoint(self, s: AbstractSet[Any]) -> bool: ... + # Implement Sized (but don't have it as a base class). + @abstractmethod + def __len__(self) -> int: ... + + +class MutableSet(AbstractSet[_T], Generic[_T]): + @abstractmethod + def add(self, x: _T) -> None: ... + @abstractmethod + def discard(self, x: _T) -> None: ... + # Mixin methods + def clear(self) -> None: ... + def pop(self) -> _T: ... + def remove(self, element: _T) -> None: ... + def __ior__(self, s: AbstractSet[_S]) -> MutableSet[Union[_T, _S]]: ... + def __iand__(self, s: AbstractSet[Any]) -> MutableSet[_T]: ... + def __ixor__(self, s: AbstractSet[_S]) -> MutableSet[Union[_T, _S]]: ... + def __isub__(self, s: AbstractSet[Any]) -> MutableSet[_T]: ... + +class MappingView(object): + def __len__(self) -> int: ... + +class ItemsView(MappingView, AbstractSet[Tuple[_KT_co, _VT_co]], Generic[_KT_co, _VT_co]): + def __contains__(self, o: object) -> bool: ... + def __iter__(self) -> Iterator[Tuple[_KT_co, _VT_co]]: ... + +class KeysView(MappingView, AbstractSet[_KT_co], Generic[_KT_co]): + def __contains__(self, o: object) -> bool: ... + def __iter__(self) -> Iterator[_KT_co]: ... + +class ValuesView(MappingView, Iterable[_VT_co], Generic[_VT_co]): + def __contains__(self, o: object) -> bool: ... + def __iter__(self) -> Iterator[_VT_co]: ... + +@runtime +class ContextManager(Protocol[_T_co]): + def __enter__(self) -> _T_co: ... + def __exit__(self, __exc_type: Optional[Type[BaseException]], + __exc_value: Optional[BaseException], + __traceback: Optional[TracebackType]) -> Optional[bool]: ... + +class Mapping(Iterable[_KT], Container[_KT], Generic[_KT, _VT_co]): + # TODO: We wish the key type could also be covariant, but that doesn't work, + # see discussion in https: //github.com/python/typing/pull/273. + @abstractmethod + def __getitem__(self, k: _KT) -> _VT_co: + ... + # Mixin methods + @overload + def get(self, k: _KT) -> Optional[_VT_co]: ... + @overload + def get(self, k: _KT, default: Union[_VT_co, _T]) -> Union[_VT_co, _T]: ... + def keys(self) -> list[_KT]: ... + def values(self) -> list[_VT_co]: ... + def items(self) -> list[Tuple[_KT, _VT_co]]: ... + def iterkeys(self) -> Iterator[_KT]: ... + def itervalues(self) -> Iterator[_VT_co]: ... + def iteritems(self) -> Iterator[Tuple[_KT, _VT_co]]: ... + def __contains__(self, o: object) -> bool: ... + # Implement Sized (but don't have it as a base class). + @abstractmethod + def __len__(self) -> int: ... + +class MutableMapping(Mapping[_KT, _VT], Generic[_KT, _VT]): + @abstractmethod + def __setitem__(self, k: _KT, v: _VT) -> None: ... + @abstractmethod + def __delitem__(self, v: _KT) -> None: ... + + def clear(self) -> None: ... + @overload + def pop(self, k: _KT) -> _VT: ... + @overload + def pop(self, k: _KT, default: Union[_VT, _T] = ...) -> Union[_VT, _T]: ... + def popitem(self) -> Tuple[_KT, _VT]: ... + def setdefault(self, k: _KT, default: _VT = ...) -> _VT: ... + @overload + def update(self, __m: Mapping[_KT, _VT], **kwargs: _VT) -> None: ... + @overload + def update(self, __m: Iterable[Tuple[_KT, _VT]], **kwargs: _VT) -> None: ... + @overload + def update(self, **kwargs: _VT) -> None: ... + +Text = unicode + +TYPE_CHECKING = True + +class IO(Iterator[AnyStr], Generic[AnyStr]): + # TODO detach + # TODO use abstract properties + @property + def mode(self) -> str: ... + @property + def name(self) -> str: ... + @abstractmethod + def close(self) -> None: ... + @property + def closed(self) -> bool: ... + @abstractmethod + def fileno(self) -> int: ... + @abstractmethod + def flush(self) -> None: ... + @abstractmethod + def isatty(self) -> bool: ... + # TODO what if n is None? + @abstractmethod + def read(self, n: int = ...) -> AnyStr: ... + @abstractmethod + def readable(self) -> bool: ... + @abstractmethod + def readline(self, limit: int = ...) -> AnyStr: ... + @abstractmethod + def readlines(self, hint: int = ...) -> list[AnyStr]: ... + @abstractmethod + def seek(self, offset: int, whence: int = ...) -> int: ... + @abstractmethod + def seekable(self) -> bool: ... + @abstractmethod + def tell(self) -> int: ... + @abstractmethod + def truncate(self, size: Optional[int] = ...) -> int: ... + @abstractmethod + def writable(self) -> bool: ... + # TODO buffer objects + @abstractmethod + def write(self, s: AnyStr) -> int: ... + @abstractmethod + def writelines(self, lines: Iterable[AnyStr]) -> None: ... + + @abstractmethod + def next(self) -> AnyStr: ... + @abstractmethod + def __iter__(self) -> Iterator[AnyStr]: ... + @abstractmethod + def __enter__(self) -> IO[AnyStr]: ... + @abstractmethod + def __exit__(self, t: Optional[Type[BaseException]], value: Optional[BaseException], + traceback: Optional[TracebackType]) -> bool: ... + +class BinaryIO(IO[str]): + # TODO readinto + # TODO read1? + # TODO peek? + @abstractmethod + def __enter__(self) -> BinaryIO: ... + +class TextIO(IO[unicode]): + # TODO use abstractproperty + @property + def buffer(self) -> BinaryIO: ... + @property + def encoding(self) -> str: ... + @property + def errors(self) -> Optional[str]: ... + @property + def line_buffering(self) -> bool: ... + @property + def newlines(self) -> Any: ... # None, str or tuple + @abstractmethod + def __enter__(self) -> TextIO: ... + +class ByteString(Sequence[int], metaclass=ABCMeta): ... + +class Match(Generic[AnyStr]): + pos: int + endpos: int + lastindex: Optional[int] + string: AnyStr + + # The regular expression object whose match() or search() method produced + # this match instance. This should not be Pattern[AnyStr] because the type + # of the pattern is independent of the type of the matched string in + # Python 2. Strictly speaking Match should be generic over AnyStr twice: + # once for the type of the pattern and once for the type of the matched + # string. + re: Pattern[Any] + # Can be None if there are no groups or if the last group was unnamed; + # otherwise matches the type of the pattern. + lastgroup: Optional[Any] + + def expand(self, template: Union[str, Text]) -> Any: ... + + @overload + def group(self, group1: int = ...) -> AnyStr: ... + @overload + def group(self, group1: str) -> AnyStr: ... + @overload + def group(self, group1: int, group2: int, + *groups: int) -> Tuple[AnyStr, ...]: ... + @overload + def group(self, group1: str, group2: str, + *groups: str) -> Tuple[AnyStr, ...]: ... + + def groups(self, default: AnyStr = ...) -> Tuple[AnyStr, ...]: ... + def groupdict(self, default: AnyStr = ...) -> Dict[str, AnyStr]: ... + def start(self, group: Union[int, str] = ...) -> int: ... + def end(self, group: Union[int, str] = ...) -> int: ... + def span(self, group: Union[int, str] = ...) -> Tuple[int, int]: ... + +# We need a second TypeVar with the same definition as AnyStr, because +# Pattern is generic over AnyStr (determining the type of its .pattern +# attribute), but at the same time its methods take either bytes or +# Text and return the same type, regardless of the type of the pattern. +_AnyStr2 = TypeVar('_AnyStr2', bytes, Text) + +class Pattern(Generic[AnyStr]): + flags: int + groupindex: Dict[AnyStr, int] + groups: int + pattern: AnyStr + + def search(self, string: _AnyStr2, pos: int = ..., + endpos: int = ...) -> Optional[Match[_AnyStr2]]: ... + def match(self, string: _AnyStr2, pos: int = ..., + endpos: int = ...) -> Optional[Match[_AnyStr2]]: ... + def split(self, string: _AnyStr2, maxsplit: int = ...) -> List[_AnyStr2]: ... + # Returns either a list of _AnyStr2 or a list of tuples, depending on + # whether there are groups in the pattern. + def findall(self, string: Union[bytes, Text], pos: int = ..., + endpos: int = ...) -> List[Any]: ... + def finditer(self, string: _AnyStr2, pos: int = ..., + endpos: int = ...) -> Iterator[Match[_AnyStr2]]: ... + + @overload + def sub(self, repl: _AnyStr2, string: _AnyStr2, + count: int = ...) -> _AnyStr2: ... + @overload + def sub(self, repl: Callable[[Match[_AnyStr2]], _AnyStr2], string: _AnyStr2, + count: int = ...) -> _AnyStr2: ... + + @overload + def subn(self, repl: _AnyStr2, string: _AnyStr2, + count: int = ...) -> Tuple[_AnyStr2, int]: ... + @overload + def subn(self, repl: Callable[[Match[_AnyStr2]], _AnyStr2], string: _AnyStr2, + count: int = ...) -> Tuple[_AnyStr2, int]: ... + +# Functions + +def get_type_hints(obj: Callable, globalns: Optional[dict[Text, Any]] = ..., + localns: Optional[dict[Text, Any]] = ...) -> None: ... + +@overload +def cast(tp: Type[_T], obj: Any) -> _T: ... +@overload +def cast(tp: str, obj: Any) -> Any: ... + +# Type constructors + +# NamedTuple is special-cased in the type checker +class NamedTuple(tuple): + _fields: Tuple[str, ...] + + def __init__(self, typename: Text, fields: Iterable[Tuple[Text, Any]] = ..., *, + verbose: bool = ..., rename: bool = ..., **kwargs: Any) -> None: ... + + @classmethod + def _make(cls: Type[_T], iterable: Iterable[Any]) -> _T: ... + + def _asdict(self) -> dict: ... + def _replace(self: _T, **kwargs: Any) -> _T: ... + +def NewType(name: str, tp: Type[_T]) -> Type[_T]: ... + +# This itself is only available during type checking +def type_check_only(func_or_cls: _C) -> _C: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/unittest.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/unittest.pyi new file mode 100644 index 0000000..d8d499a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/unittest.pyi @@ -0,0 +1,262 @@ +# Stubs for unittest + +# Based on http://docs.python.org/2.7/library/unittest.html + +from typing import (Any, Callable, Dict, FrozenSet, Iterable, Iterator, + List, NoReturn, Optional, overload, Pattern, Sequence, Set, + Text, TextIO, Tuple, Type, TypeVar, Union) +from abc import abstractmethod, ABCMeta +import types + +_T = TypeVar('_T') +_FT = TypeVar('_FT') + +_ExceptionType = Union[Type[BaseException], Tuple[Type[BaseException], ...]] +_Regexp = Union[Text, Pattern[Text]] + +class Testable(metaclass=ABCMeta): + @abstractmethod + def run(self, result: TestResult) -> None: ... + @abstractmethod + def debug(self) -> None: ... + @abstractmethod + def countTestCases(self) -> int: ... + +# TODO ABC for test runners? + +class TestResult: + errors: List[Tuple[Testable, str]] + failures: List[Tuple[Testable, str]] + skipped: List[Tuple[Testable, str]] + expectedFailures: List[Tuple[Testable, str]] + unexpectedSuccesses: List[Testable] + shouldStop: bool + testsRun: int + buffer: bool + failfast: bool + + def wasSuccessful(self) -> bool: ... + def stop(self) -> None: ... + def startTest(self, test: Testable) -> None: ... + def stopTest(self, test: Testable) -> None: ... + def startTestRun(self) -> None: ... + def stopTestRun(self) -> None: ... + def addError(self, test: Testable, err: Tuple[type, Any, Any]) -> None: ... # TODO + def addFailure(self, test: Testable, err: Tuple[type, Any, Any]) -> None: ... # TODO + def addSuccess(self, test: Testable) -> None: ... + def addSkip(self, test: Testable, reason: str) -> None: ... + def addExpectedFailure(self, test: Testable, err: str) -> None: ... + def addUnexpectedSuccess(self, test: Testable) -> None: ... + +class _AssertRaisesBaseContext: + expected: Any + failureException: Type[BaseException] + obj_name: str + expected_regex: Pattern[str] + +class _AssertRaisesContext(_AssertRaisesBaseContext): + exception: Any + def __enter__(self) -> _AssertRaisesContext: ... + def __exit__(self, exc_type, exc_value, tb) -> bool: ... + +class TestCase(Testable): + failureException: Type[BaseException] + longMessage: bool + maxDiff: Optional[int] + # undocumented + _testMethodName: str + def __init__(self, methodName: str = ...) -> None: ... + def setUp(self) -> None: ... + def tearDown(self) -> None: ... + @classmethod + def setUpClass(cls) -> None: ... + @classmethod + def tearDownClass(cls) -> None: ... + def run(self, result: TestResult = ...) -> None: ... + def debug(self) -> None: ... + def assert_(self, expr: Any, msg: object = ...) -> None: ... + def failUnless(self, expr: Any, msg: object = ...) -> None: ... + def assertTrue(self, expr: Any, msg: object = ...) -> None: ... + def assertEqual(self, first: Any, second: Any, + msg: object = ...) -> None: ... + def assertEquals(self, first: Any, second: Any, + msg: object = ...) -> None: ... + def failUnlessEqual(self, first: Any, second: Any, + msg: object = ...) -> None: ... + def assertNotEqual(self, first: Any, second: Any, + msg: object = ...) -> None: ... + def assertNotEquals(self, first: Any, second: Any, + msg: object = ...) -> None: ... + def failIfEqual(self, first: Any, second: Any, + msg: object = ...) -> None: ... + @overload + def assertAlmostEqual(self, first: float, second: float, + places: int = ..., msg: Any = ...) -> None: ... + @overload + def assertAlmostEqual(self, first: float, second: float, *, + msg: Any = ..., delta: float = ...) -> None: ... + @overload + def assertAlmostEquals(self, first: float, second: float, + places: int = ..., msg: Any = ...) -> None: ... + @overload + def assertAlmostEquals(self, first: float, second: float, *, + msg: Any = ..., delta: float = ...) -> None: ... + def failUnlessAlmostEqual(self, first: float, second: float, places: int = ..., + msg: object = ...) -> None: ... + @overload + def assertNotAlmostEqual(self, first: float, second: float, + places: int = ..., msg: Any = ...) -> None: ... + @overload + def assertNotAlmostEqual(self, first: float, second: float, *, + msg: Any = ..., delta: float = ...) -> None: ... + @overload + def assertNotAlmostEquals(self, first: float, second: float, + places: int = ..., msg: Any = ...) -> None: ... + @overload + def assertNotAlmostEquals(self, first: float, second: float, *, + msg: Any = ..., delta: float = ...) -> None: ... + def failIfAlmostEqual(self, first: float, second: float, places: int = ..., + msg: object = ..., + delta: float = ...) -> None: ... + def assertGreater(self, first: Any, second: Any, + msg: object = ...) -> None: ... + def assertGreaterEqual(self, first: Any, second: Any, + msg: object = ...) -> None: ... + def assertMultiLineEqual(self, first: str, second: str, + msg: object = ...) -> None: ... + def assertSequenceEqual(self, first: Sequence[Any], second: Sequence[Any], + msg: object = ..., seq_type: type = ...) -> None: ... + def assertListEqual(self, first: List[Any], second: List[Any], + msg: object = ...) -> None: ... + def assertTupleEqual(self, first: Tuple[Any, ...], second: Tuple[Any, ...], + msg: object = ...) -> None: ... + def assertSetEqual(self, first: Union[Set[Any], FrozenSet[Any]], + second: Union[Set[Any], FrozenSet[Any]], msg: object = ...) -> None: ... + def assertDictEqual(self, first: Dict[Any, Any], second: Dict[Any, Any], + msg: object = ...) -> None: ... + def assertLess(self, first: Any, second: Any, + msg: object = ...) -> None: ... + def assertLessEqual(self, first: Any, second: Any, + msg: object = ...) -> None: ... + @overload + def assertRaises(self, exception: _ExceptionType, callable: Callable[..., Any], *args: Any, **kwargs: Any) -> None: ... + @overload + def assertRaises(self, exception: _ExceptionType) -> _AssertRaisesContext: ... + @overload + def assertRaisesRegexp(self, exception: _ExceptionType, regexp: _Regexp, callable: Callable[..., Any], *args: Any, **kwargs: Any) -> None: ... + @overload + def assertRaisesRegexp(self, exception: _ExceptionType, regexp: _Regexp) -> _AssertRaisesContext: ... + def assertRegexpMatches(self, text: Text, regexp: _Regexp, msg: object = ...) -> None: ... + def assertNotRegexpMatches(self, text: Text, regexp: _Regexp, msg: object = ...) -> None: ... + def assertItemsEqual(self, first: Iterable[Any], second: Iterable[Any], msg: object = ...) -> None: ... + def assertDictContainsSubset(self, expected: Dict[Any, Any], actual: Dict[Any, Any], msg: object = ...) -> None: ... + def addTypeEqualityFunc(self, typeobj: type, function: Callable[..., None]) -> None: ... + @overload + def failUnlessRaises(self, exception: _ExceptionType, callable: Callable[..., Any], *args: Any, **kwargs: Any) -> None: ... + @overload + def failUnlessRaises(self, exception: _ExceptionType) -> _AssertRaisesContext: ... + def failIf(self, expr: Any, msg: object = ...) -> None: ... + def assertFalse(self, expr: Any, msg: object = ...) -> None: ... + def assertIs(self, first: object, second: object, + msg: object = ...) -> None: ... + def assertIsNot(self, first: object, second: object, + msg: object = ...) -> None: ... + def assertIsNone(self, expr: Any, msg: object = ...) -> None: ... + def assertIsNotNone(self, expr: Any, msg: object = ...) -> None: ... + def assertIn(self, first: _T, second: Iterable[_T], + msg: object = ...) -> None: ... + def assertNotIn(self, first: _T, second: Iterable[_T], + msg: object = ...) -> None: ... + def assertIsInstance(self, obj: Any, cls: Union[type, Tuple[type, ...]], + msg: object = ...) -> None: ... + def assertNotIsInstance(self, obj: Any, cls: Union[type, Tuple[type, ...]], + msg: object = ...) -> None: ... + def fail(self, msg: object = ...) -> NoReturn: ... + def countTestCases(self) -> int: ... + def defaultTestResult(self) -> TestResult: ... + def id(self) -> str: ... + def shortDescription(self) -> str: ... # May return None + def addCleanup(self, function: Any, *args: Any, **kwargs: Any) -> None: ... + def doCleanups(self) -> bool: ... + def skipTest(self, reason: Any) -> None: ... + def _formatMessage(self, msg: Optional[Text], standardMsg: Text) -> str: ... # undocumented + def _getAssertEqualityFunc(self, first: Any, second: Any) -> Callable[..., None]: ... # undocumented + +class FunctionTestCase(Testable): + def __init__(self, testFunc: Callable[[], None], + setUp: Optional[Callable[[], None]] = ..., + tearDown: Optional[Callable[[], None]] = ..., + description: Optional[str] = ...) -> None: ... + def run(self, result: TestResult) -> None: ... + def debug(self) -> None: ... + def countTestCases(self) -> int: ... + +class TestSuite(Testable): + def __init__(self, tests: Iterable[Testable] = ...) -> None: ... + def addTest(self, test: Testable) -> None: ... + def addTests(self, tests: Iterable[Testable]) -> None: ... + def run(self, result: TestResult) -> None: ... + def debug(self) -> None: ... + def countTestCases(self) -> int: ... + def __iter__(self) -> Iterator[Testable]: ... + +class TestLoader: + testMethodPrefix: str + sortTestMethodsUsing: Optional[Callable[[str, str], int]] + suiteClass: Callable[[List[TestCase]], TestSuite] + def loadTestsFromTestCase(self, + testCaseClass: Type[TestCase]) -> TestSuite: ... + def loadTestsFromModule(self, module: types.ModuleType = ..., + use_load_tests: bool = ...) -> TestSuite: ... + def loadTestsFromName(self, name: str = ..., + module: Optional[types.ModuleType] = ...) -> TestSuite: ... + def loadTestsFromNames(self, names: List[str] = ..., + module: Optional[types.ModuleType] = ...) -> TestSuite: ... + def discover(self, start_dir: str, pattern: str = ..., + top_level_dir: Optional[str] = ...) -> TestSuite: ... + def getTestCaseNames(self, testCaseClass: Type[TestCase] = ...) -> List[str]: ... + +defaultTestLoader: TestLoader + +class TextTestResult(TestResult): + def __init__(self, stream: TextIO, descriptions: bool, verbosity: int) -> None: ... + +class TextTestRunner: + def __init__(self, stream: Optional[TextIO] = ..., descriptions: bool = ..., + verbosity: int = ..., failfast: bool = ..., buffer: bool = ..., + resultclass: Optional[Type[TestResult]] = ...) -> None: ... + def _makeResult(self) -> TestResult: ... + +class SkipTest(Exception): + ... + +# TODO precise types +def skipUnless(condition: Any, reason: Union[str, unicode]) -> Any: ... +def skipIf(condition: Any, reason: Union[str, unicode]) -> Any: ... +def expectedFailure(func: _FT) -> _FT: ... +def skip(reason: Union[str, unicode]) -> Any: ... + +# not really documented +class TestProgram: + result: TestResult + def runTests(self) -> None: ... # undocumented + +def main(module: Union[None, Text, types.ModuleType] = ..., defaultTest: Optional[str] = ..., + argv: Optional[Sequence[str]] = ..., + testRunner: Union[Type[TextTestRunner], TextTestRunner, None] = ..., + testLoader: TestLoader = ..., exit: bool = ..., verbosity: int = ..., + failfast: Optional[bool] = ..., catchbreak: Optional[bool] = ..., + buffer: Optional[bool] = ...) -> TestProgram: ... + +def load_tests(loader: TestLoader, tests: TestSuite, pattern: Optional[Text]) -> TestSuite: ... + +def installHandler() -> None: ... +def registerResult(result: TestResult) -> None: ... +def removeResult(result: TestResult) -> bool: ... +@overload +def removeHandler() -> None: ... +@overload +def removeHandler(function: Callable[..., Any]) -> Callable[..., Any]: ... + +# private but occasionally used +util: types.ModuleType diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/urllib.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/urllib.pyi new file mode 100644 index 0000000..8b44a06 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/urllib.pyi @@ -0,0 +1,134 @@ +from typing import Any, AnyStr, IO, List, Mapping, Sequence, Text, Tuple, TypeVar, Union + +def url2pathname(pathname: AnyStr) -> AnyStr: ... +def pathname2url(pathname: AnyStr) -> AnyStr: ... +def urlopen(url: str, data=..., proxies: Mapping[str, str] = ..., context=...) -> IO[Any]: ... +def urlretrieve(url, filename=..., reporthook=..., data=..., context=...): ... +def urlcleanup() -> None: ... + +class ContentTooShortError(IOError): + content: Any + def __init__(self, message, content) -> None: ... + +class URLopener: + version: Any + proxies: Any + key_file: Any + cert_file: Any + context: Any + addheaders: Any + tempcache: Any + ftpcache: Any + def __init__(self, proxies: Mapping[str, str] = ..., context=..., **x509) -> None: ... + def __del__(self): ... + def close(self): ... + def cleanup(self): ... + def addheader(self, *args): ... + type: Any + def open(self, fullurl: str, data=...): ... + def open_unknown(self, fullurl, data=...): ... + def open_unknown_proxy(self, proxy, fullurl, data=...): ... + def retrieve(self, url, filename=..., reporthook=..., data=...): ... + def open_http(self, url, data=...): ... + def http_error(self, url, fp, errcode, errmsg, headers, data=...): ... + def http_error_default(self, url, fp, errcode, errmsg, headers): ... + def open_https(self, url, data=...): ... + def open_file(self, url): ... + def open_local_file(self, url): ... + def open_ftp(self, url): ... + def open_data(self, url, data=...): ... + +class FancyURLopener(URLopener): + auth_cache: Any + tries: Any + maxtries: Any + def __init__(self, *args, **kwargs) -> None: ... + def http_error_default(self, url, fp, errcode, errmsg, headers): ... + def http_error_302(self, url, fp, errcode, errmsg, headers, data=...): ... + def redirect_internal(self, url, fp, errcode, errmsg, headers, data): ... + def http_error_301(self, url, fp, errcode, errmsg, headers, data=...): ... + def http_error_303(self, url, fp, errcode, errmsg, headers, data=...): ... + def http_error_307(self, url, fp, errcode, errmsg, headers, data=...): ... + def http_error_401(self, url, fp, errcode, errmsg, headers, data=...): ... + def http_error_407(self, url, fp, errcode, errmsg, headers, data=...): ... + def retry_proxy_http_basic_auth(self, url, realm, data=...): ... + def retry_proxy_https_basic_auth(self, url, realm, data=...): ... + def retry_http_basic_auth(self, url, realm, data=...): ... + def retry_https_basic_auth(self, url, realm, data=...): ... + def get_user_passwd(self, host, realm, clear_cache=...): ... + def prompt_user_passwd(self, host, realm): ... + +class ftpwrapper: + user: Any + passwd: Any + host: Any + port: Any + dirs: Any + timeout: Any + refcount: Any + keepalive: Any + def __init__(self, user, passwd, host, port, dirs, timeout=..., persistent=...) -> None: ... + busy: Any + ftp: Any + def init(self): ... + def retrfile(self, file, type): ... + def endtransfer(self): ... + def close(self): ... + def file_close(self): ... + def real_close(self): ... + +_AIUT = TypeVar("_AIUT", bound=addbase) + +class addbase: + fp: Any + def read(self, n: int = ...) -> bytes: ... + def readline(self, limit: int = ...) -> bytes: ... + def readlines(self, hint: int = ...) -> List[bytes]: ... + def fileno(self) -> int: ... # Optional[int], but that is rare + def __iter__(self: _AIUT) -> _AIUT: ... + def next(self) -> bytes: ... + def __init__(self, fp) -> None: ... + def close(self) -> None: ... + +class addclosehook(addbase): + closehook: Any + hookargs: Any + def __init__(self, fp, closehook, *hookargs) -> None: ... + def close(self): ... + +class addinfo(addbase): + headers: Any + def __init__(self, fp, headers) -> None: ... + def info(self): ... + +class addinfourl(addbase): + headers: Any + url: Any + code: Any + def __init__(self, fp, headers, url, code=...) -> None: ... + def info(self): ... + def getcode(self): ... + def geturl(self): ... + +def unwrap(url): ... +def splittype(url): ... +def splithost(url): ... +def splituser(host): ... +def splitpasswd(user): ... +def splitport(host): ... +def splitnport(host, defport=...): ... +def splitquery(url): ... +def splittag(url): ... +def splitattr(url): ... +def splitvalue(attr): ... +def unquote(s: AnyStr) -> AnyStr: ... +def unquote_plus(s: AnyStr) -> AnyStr: ... +def quote(s: AnyStr, safe: Text = ...) -> AnyStr: ... +def quote_plus(s: AnyStr, safe: Text = ...) -> AnyStr: ... +def urlencode(query: Union[Sequence[Tuple[Any, Any]], Mapping[Any, Any]], doseq=...) -> str: ... + +def getproxies() -> Mapping[str, str]: ... +def proxy_bypass(host): ... + +# Names in __all__ with no definition: +# basejoin diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/urllib2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/urllib2.pyi new file mode 100644 index 0000000..6611ad2 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/urllib2.pyi @@ -0,0 +1,182 @@ + +import ssl +from typing import Any, AnyStr, Dict, List, Union, Optional, Mapping, Callable, Sequence, Text, Tuple, Type +from urllib import addinfourl +from httplib import HTTPConnectionProtocol, HTTPResponse + +_string = Union[str, unicode] + +class URLError(IOError): + reason: Union[str, BaseException] + +class HTTPError(URLError, addinfourl): + code: int + headers: Mapping[str, str] + def __init__(self, url, code: int, msg: str, hdrs: Mapping[str, str], fp: addinfourl) -> None: ... + +class Request(object): + host: str + port: str + data: str + headers: Dict[str, str] + unverifiable: bool + type: Optional[str] + origin_req_host = ... + unredirected_hdrs: Dict[str, str] + + def __init__(self, url: str, data: Optional[str] = ..., headers: Dict[str, str] = ..., + origin_req_host: Optional[str] = ..., unverifiable: bool = ...) -> None: ... + def __getattr__(self, attr): ... + def get_method(self) -> str: ... + def add_data(self, data) -> None: ... + def has_data(self) -> bool: ... + def get_data(self) -> str: ... + def get_full_url(self) -> str: ... + def get_type(self): ... + def get_host(self) -> str: ... + def get_selector(self): ... + def set_proxy(self, host, type) -> None: ... + def has_proxy(self) -> bool: ... + def get_origin_req_host(self) -> str: ... + def is_unverifiable(self) -> bool: ... + def add_header(self, key: str, val: str) -> None: ... + def add_unredirected_header(self, key: str, val: str) -> None: ... + def has_header(self, header_name: str) -> bool: ... + def get_header(self, header_name: str, default: Optional[str] = ...) -> str: ... + def header_items(self): ... + +class OpenerDirector(object): + addheaders: List[Tuple[str, str]] + + def add_handler(self, handler: BaseHandler) -> None: ... + def open(self, fullurl: Union[Request, _string], data: Optional[_string] = ..., timeout: Optional[float] = ...) -> Optional[addinfourl]: ... + def error(self, proto: _string, *args: Any): ... + +# Note that this type is somewhat a lie. The return *can* be None if +# a custom opener has been installed that fails to handle the request. +def urlopen(url: Union[Request, _string], data: Optional[_string] = ..., timeout: Optional[float] = ..., + cafile: Optional[_string] = ..., capath: Optional[_string] = ..., cadefault: bool = ..., + context: Optional[ssl.SSLContext] = ...) -> addinfourl: ... +def install_opener(opener: OpenerDirector) -> None: ... +def build_opener(*handlers: Union[BaseHandler, Type[BaseHandler]]) -> OpenerDirector: ... + +class BaseHandler: + handler_order: int + parent: OpenerDirector + + def add_parent(self, parent: OpenerDirector) -> None: ... + def close(self) -> None: ... + def __lt__(self, other: Any) -> bool: ... + +class HTTPErrorProcessor(BaseHandler): + def http_response(self, request, response): ... + +class HTTPDefaultErrorHandler(BaseHandler): + def http_error_default(self, req: Request, fp: addinfourl, code: int, msg: str, hdrs: Mapping[str, str]): ... + +class HTTPRedirectHandler(BaseHandler): + max_repeats: int + max_redirections: int + def redirect_request(self, req: Request, fp: addinfourl, code: int, msg: str, headers: Mapping[str, str], newurl): ... + def http_error_301(self, req: Request, fp: addinfourl, code: int, msg: str, headers: Mapping[str, str]): ... + def http_error_302(self, req: Request, fp: addinfourl, code: int, msg: str, headers: Mapping[str, str]): ... + def http_error_303(self, req: Request, fp: addinfourl, code: int, msg: str, headers: Mapping[str, str]): ... + def http_error_307(self, req: Request, fp: addinfourl, code: int, msg: str, headers: Mapping[str, str]): ... + inf_msg: str + + +class ProxyHandler(BaseHandler): + proxies: Mapping[str, str] + + def __init__(self, proxies: Optional[Mapping[str, str]] = ...): ... + def proxy_open(self, req: Request, proxy, type): ... + +class HTTPPasswordMgr: + def __init__(self) -> None: ... + def add_password(self, realm: Optional[Text], uri: Union[Text, Sequence[Text]], user: Text, passwd: Text) -> None: ... + def find_user_password(self, realm: Optional[Text], authuri: Text) -> Tuple[Any, Any]: ... + def reduce_uri(self, uri: _string, default_port: bool = ...) -> Tuple[Any, Any]: ... + def is_suburi(self, base: _string, test: _string) -> bool: ... + +class HTTPPasswordMgrWithDefaultRealm(HTTPPasswordMgr): ... + +class AbstractBasicAuthHandler: + def __init__(self, password_mgr: Optional[HTTPPasswordMgr] = ...) -> None: ... + def add_password(self, realm: Optional[Text], uri: Union[Text, Sequence[Text]], user: Text, passwd: Text) -> None: ... + def http_error_auth_reqed(self, authreq, host, req: Request, headers: Mapping[str, str]): ... + def retry_http_basic_auth(self, host, req: Request, realm): ... + +class HTTPBasicAuthHandler(AbstractBasicAuthHandler, BaseHandler): + auth_header: str + def http_error_401(self, req: Request, fp: addinfourl, code: int, msg: str, headers: Mapping[str, str]): ... + +class ProxyBasicAuthHandler(AbstractBasicAuthHandler, BaseHandler): + auth_header: str + def http_error_407(self, req: Request, fp: addinfourl, code: int, msg: str, headers: Mapping[str, str]): ... + +class AbstractDigestAuthHandler: + def __init__(self, passwd: Optional[HTTPPasswordMgr] = ...) -> None: ... + def add_password(self, realm: Optional[Text], uri: Union[Text, Sequence[Text]], user: Text, passwd: Text) -> None: ... + def reset_retry_count(self) -> None: ... + def http_error_auth_reqed(self, auth_header: str, host: str, req: Request, + headers: Mapping[str, str]) -> None: ... + def retry_http_digest_auth(self, req: Request, auth: str) -> Optional[HTTPResponse]: ... + def get_cnonce(self, nonce: str) -> str: ... + def get_authorization(self, req: Request, chal: Mapping[str, str]) -> str: ... + def get_algorithm_impls(self, algorithm: str) -> Tuple[Callable[[str], str], Callable[[str, str], str]]: ... + def get_entity_digest(self, data: Optional[bytes], chal: Mapping[str, str]) -> Optional[str]: ... + +class HTTPDigestAuthHandler(BaseHandler, AbstractDigestAuthHandler): + auth_header: str + handler_order: int + def http_error_401(self, req: Request, fp: addinfourl, code: int, msg: str, headers: Mapping[str, str]): ... + +class ProxyDigestAuthHandler(BaseHandler, AbstractDigestAuthHandler): + auth_header: str + handler_order: int + def http_error_407(self, req: Request, fp: addinfourl, code: int, msg: str, headers: Mapping[str, str]): ... + +class AbstractHTTPHandler(BaseHandler): # undocumented + def __init__(self, debuglevel: int = ...) -> None: ... + def set_http_debuglevel(self, level: int) -> None: ... + def do_request_(self, request: Request) -> Request: ... + def do_open(self, + http_class: HTTPConnectionProtocol, + req: Request, + **http_conn_args: Optional[Any]) -> addinfourl: ... + +class HTTPHandler(AbstractHTTPHandler): + def http_open(self, req: Request) -> addinfourl: ... + def http_request(self, request: Request) -> Request: ... # undocumented + +class HTTPSHandler(AbstractHTTPHandler): + def __init__(self, debuglevel: int = ..., context: Optional[ssl.SSLContext] = ...) -> None: ... + def https_open(self, req: Request) -> addinfourl: ... + def https_request(self, request: Request) -> Request: ... # undocumented + +class HTTPCookieProcessor(BaseHandler): + def __init__(self, cookiejar: Optional[Any] = ...): ... + def http_request(self, request: Request): ... + def http_response(self, request: Request, response): ... + +class UnknownHandler(BaseHandler): + def unknown_open(self, req: Request): ... + +class FileHandler(BaseHandler): + def file_open(self, req: Request): ... + def get_names(self): ... + def open_local_file(self, req: Request): ... + +class FTPHandler(BaseHandler): + def ftp_open(self, req: Request): ... + def connect_ftp(self, user, passwd, host, port, dirs, timeout): ... + +class CacheFTPHandler(FTPHandler): + def __init__(self) -> None: ... + def setTimeout(self, t: Optional[float]): ... + def setMaxConns(self, m: int): ... + def check_cache(self): ... + def clear_cache(self): ... + +def parse_http_list(s: AnyStr) -> List[AnyStr]: ... +def parse_keqv_list(l: List[AnyStr]) -> Dict[AnyStr, AnyStr]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/urlparse.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/urlparse.pyi new file mode 100644 index 0000000..fb59095 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/urlparse.pyi @@ -0,0 +1,70 @@ +# Stubs for urlparse (Python 2) + +from typing import AnyStr, Dict, List, NamedTuple, Tuple, Sequence, Union, overload + +_String = Union[str, unicode] + +uses_relative: List[str] +uses_netloc: List[str] +uses_params: List[str] +non_hierarchical: List[str] +uses_query: List[str] +uses_fragment: List[str] +scheme_chars: str +MAX_CACHE_SIZE = 0 + +def clear_cache() -> None: ... + +class ResultMixin(object): + @property + def username(self) -> str: ... + @property + def password(self) -> str: ... + @property + def hostname(self) -> str: ... + @property + def port(self) -> int: ... + +class SplitResult( + NamedTuple( + 'SplitResult', + [ + ('scheme', str), ('netloc', str), ('path', str), ('query', str), ('fragment', str) + ] + ), + ResultMixin +): + def geturl(self) -> str: ... + +class ParseResult( + NamedTuple( + 'ParseResult', + [ + ('scheme', str), ('netloc', str), ('path', str), ('params', str), ('query', str), + ('fragment', str) + ] + ), + ResultMixin +): + def geturl(self) -> str: ... + +def urlparse(url: _String, scheme: _String = ..., + allow_fragments: bool = ...) -> ParseResult: ... +def urlsplit(url: _String, scheme: _String = ..., + allow_fragments: bool = ...) -> SplitResult: ... +@overload +def urlunparse(data: Tuple[_String, _String, _String, _String, _String, _String]) -> str: ... +@overload +def urlunparse(data: Sequence[_String]) -> str: ... +@overload +def urlunsplit(data: Tuple[_String, _String, _String, _String, _String]) -> str: ... +@overload +def urlunsplit(data: Sequence[_String]) -> str: ... +def urljoin(base: _String, url: _String, + allow_fragments: bool = ...) -> str: ... +def urldefrag(url: AnyStr) -> Tuple[AnyStr, str]: ... +def unquote(s: AnyStr) -> AnyStr: ... +def parse_qs(qs: AnyStr, keep_blank_values: bool = ..., + strict_parsing: bool = ...) -> Dict[AnyStr, List[AnyStr]]: ... +def parse_qsl(qs: AnyStr, keep_blank_values: int = ..., + strict_parsing: bool = ...) -> List[Tuple[AnyStr, AnyStr]]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/user.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/user.pyi new file mode 100644 index 0000000..e857a3a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/user.pyi @@ -0,0 +1,9 @@ +# Stubs for user (Python 2) + +# Docs: https://docs.python.org/2/library/user.html +# Source: https://hg.python.org/cpython/file/2.7/Lib/user.py +from typing import Any + +def __getattr__(name) -> Any: ... +home: str +pythonrc: str diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/whichdb.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/whichdb.pyi new file mode 100644 index 0000000..b1a69f4 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/whichdb.pyi @@ -0,0 +1,5 @@ +# Source: https://hg.python.org/cpython/file/2.7/Lib/whichdb.py + +from typing import Optional, Text + +def whichdb(filename: Text) -> Optional[str]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/xmlrpclib.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/xmlrpclib.pyi new file mode 100644 index 0000000..abf4098 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2/xmlrpclib.pyi @@ -0,0 +1,199 @@ +# Stubs for xmlrpclib (Python 2) + +from typing import Any, AnyStr, Callable, IO, Iterable, List, Mapping, MutableMapping, Optional, Tuple, Type, TypeVar, Union +from types import InstanceType +from datetime import datetime +from time import struct_time +from httplib import HTTPConnection, HTTPResponse, HTTPSConnection +from ssl import SSLContext +from StringIO import StringIO +from gzip import GzipFile + +_Unmarshaller = Any +_timeTuple = Tuple[int, int, int, int, int, int, int, int, int] +# Represents types that can be compared against a DateTime object +_dateTimeComp = Union[AnyStr, DateTime, datetime, _timeTuple] +# A "host description" used by Transport factories +_hostDesc = Union[str, Tuple[str, Mapping[Any, Any]]] + +def escape(s: AnyStr, replace: Callable[[AnyStr, AnyStr, AnyStr], AnyStr] = ...) -> AnyStr: ... + +MAXINT: int +MININT: int +PARSE_ERROR: int +SERVER_ERROR: int +APPLICATION_ERROR: int +SYSTEM_ERROR: int +TRANSPORT_ERROR: int +NOT_WELLFORMED_ERROR: int +UNSUPPORTED_ENCODING: int +INVALID_ENCODING_CHAR: int +INVALID_XMLRPC: int +METHOD_NOT_FOUND: int +INVALID_METHOD_PARAMS: int +INTERNAL_ERROR: int + +class Error(Exception): ... + +class ProtocolError(Error): + url: str + errcode: int + errmsg: str + headers: Any + def __init__(self, url: str, errcode: int, errmsg: str, headers: Any) -> None: ... + +class ResponseError(Error): ... + +class Fault(Error): + faultCode: Any + faultString: str + def __init__(self, faultCode: Any, faultString: str, **extra: Any) -> None: ... + +boolean: Type[bool] +Boolean: Type[bool] + +class DateTime: + value: str + def __init__(self, value: Union[str, unicode, datetime, float, int, _timeTuple, struct_time] = ...) -> None: ... + def make_comparable(self, other: _dateTimeComp) -> Tuple[_dateTimeComp, _dateTimeComp]: ... + def __lt__(self, other: _dateTimeComp) -> bool: ... + def __le__(self, other: _dateTimeComp) -> bool: ... + def __gt__(self, other: _dateTimeComp) -> bool: ... + def __ge__(self, other: _dateTimeComp) -> bool: ... + def __eq__(self, other: _dateTimeComp) -> bool: ... + def __ne__(self, other: _dateTimeComp) -> bool: ... + def timetuple(self) -> struct_time: ... + def __cmp__(self, other: _dateTimeComp) -> int: ... + def decode(self, data: Any) -> None: ... + def encode(self, out: IO) -> None: ... + +class Binary: + data: str + def __init__(self, data: Optional[str] = ...) -> None: ... + def __cmp__(self, other: Any) -> int: ... + def decode(self, data: str) -> None: ... + def encode(self, out: IO) -> None: ... + +WRAPPERS: tuple + +# Still part of the public API, but see http://bugs.python.org/issue1773632 +FastParser: None +FastUnmarshaller: None +FastMarshaller: None + +# xmlrpclib.py will leave ExpatParser undefined if it can't import expat from +# xml.parsers. Because this is Python 2.7, the import will succeed. +class ExpatParser: + def __init__(self, target: _Unmarshaller) -> None: ... + def feed(self, data: str): ... + def close(self): ... + +# TODO: Add xmllib.XMLParser as base class +class SlowParser: + handle_xml: Callable[[str, bool], None] + unknown_starttag: Callable[[str, Any], None] + handle_data: Callable[[str], None] + handle_cdata: Callable[[str], None] + unknown_endtag: Callable[[str, Callable[[Iterable[str], str], str]], None] + def __init__(self, target: _Unmarshaller) -> None: ... + +class Marshaller: + memo: MutableMapping[int, Any] + data: Optional[str] + encoding: Optional[str] + allow_none: bool + def __init__(self, encoding: Optional[str] = ..., allow_none: bool = ...) -> None: ... + dispatch: Mapping[type, Callable[[Marshaller, str, Callable[[str], None]], None]] + def dumps(self, values: Union[Iterable[Union[None, int, bool, long, float, str, unicode, List, Tuple, Mapping, datetime, InstanceType]], Fault]) -> str: ... + def dump_nil(self, value: None, write: Callable[[str], None]) -> None: ... + def dump_int(self, value: int, write: Callable[[str], None]) -> None: ... + def dump_bool(self, value: bool, write: Callable[[str], None]) -> None: ... + def dump_long(self, value: long, write: Callable[[str], None]) -> None: ... + def dump_double(self, value: float, write: Callable[[str], None]) -> None: ... + def dump_string(self, value: str, write: Callable[[str], None], escape: Callable[[AnyStr, Callable[[AnyStr, AnyStr, AnyStr], AnyStr]], AnyStr] = ...) -> None: ... + def dump_unicode(self, value: unicode, write: Callable[[str], None], escape: Callable[[AnyStr, Callable[[AnyStr, AnyStr, AnyStr], AnyStr]], AnyStr] = ...) -> None: ... + def dump_array(self, value: Union[List, Tuple], write: Callable[[str], None]) -> None: ... + def dump_struct(self, value: Mapping, write: Callable[[str], None], escape: Callable[[AnyStr, Callable[[AnyStr, AnyStr, AnyStr], AnyStr]], AnyStr] = ...) -> None: ... + def dump_datetime(self, value: datetime, write: Callable[[str], None]) -> None: ... + def dump_instance(self, value: InstanceType, write: Callable[[str], None]) -> None: ... + +class Unmarshaller: + def append(self, object: Any) -> None: ... + def __init__(self, use_datetime: bool = ...) -> None: ... + def close(self) -> tuple: ... + def getmethodname(self) -> Optional[str]: ... + def xml(self, encoding: str, standalone: bool) -> None: ... + def start(self, tag: str, attrs: Any) -> None: ... + def data(self, text: str) -> None: ... + def end(self, tag: str, join: Callable[[Iterable[str], str], str] = ...) -> None: ... + def end_dispatch(self, tag: str, data: str) -> None: ... + dispatch: Mapping[str, Callable[[Unmarshaller, str], None]] + def end_nil(self, data: str): ... + def end_boolean(self, data: str) -> None: ... + def end_int(self, data: str) -> None: ... + def end_double(self, data: str) -> None: ... + def end_string(self, data: str) -> None: ... + def end_array(self, data: str) -> None: ... + def end_struct(self, data: str) -> None: ... + def end_base64(self, data: str) -> None: ... + def end_dateTime(self, data: str) -> None: ... + def end_value(self, data: str) -> None: ... + def end_params(self, data: str) -> None: ... + def end_fault(self, data: str) -> None: ... + def end_methodName(self, data: str) -> None: ... + +class _MultiCallMethod: + def __init__(self, call_list: List[Tuple[str, tuple]], name: str) -> None: ... +class MultiCallIterator: + def __init__(self, results: List) -> None: ... + +class MultiCall: + def __init__(self, server: ServerProxy) -> None: ... + def __getattr__(self, name: str) -> _MultiCallMethod: ... + def __call__(self) -> MultiCallIterator: ... + +def getparser(use_datetime: bool = ...) -> Tuple[Union[ExpatParser, SlowParser], Unmarshaller]: ... +def dumps(params: Union[tuple, Fault], methodname: Optional[str] = ..., methodresponse: Optional[bool] = ..., encoding: Optional[str] = ..., allow_none: bool = ...) -> str: ... +def loads(data: str, use_datetime: bool = ...) -> Tuple[tuple, Optional[str]]: ... + +def gzip_encode(data: str) -> str: ... +def gzip_decode(data: str, max_decode: int = ...) -> str: ... + +class GzipDecodedResponse(GzipFile): + stringio: StringIO + def __init__(self, response: HTTPResponse) -> None: ... + def close(self): ... + +class _Method: + def __init__(self, send: Callable[[str, tuple], Any], name: str) -> None: ... + def __getattr__(self, name: str) -> _Method: ... + def __call__(self, *args: Any) -> Any: ... + +class Transport: + user_agent: str + accept_gzip_encoding: bool + encode_threshold: Optional[int] + def __init__(self, use_datetime: bool = ...) -> None: ... + def request(self, host: _hostDesc, handler: str, request_body: str, verbose: bool = ...) -> tuple: ... + verbose: bool + def single_request(self, host: _hostDesc, handler: str, request_body: str, verbose: bool = ...) -> tuple: ... + def getparser(self) -> Tuple[Union[ExpatParser, SlowParser], Unmarshaller]: ... + def get_host_info(self, host: _hostDesc) -> Tuple[str, Optional[List[Tuple[str, str]]], Optional[Mapping[Any, Any]]]: ... + def make_connection(self, host: _hostDesc) -> HTTPConnection: ... + def close(self) -> None: ... + def send_request(self, connection: HTTPConnection, handler: str, request_body: str) -> None: ... + def send_host(self, connection: HTTPConnection, host: str) -> None: ... + def send_user_agent(self, connection: HTTPConnection) -> None: ... + def send_content(self, connection: HTTPConnection, request_body: str) -> None: ... + def parse_response(self, response: HTTPResponse) -> tuple: ... + +class SafeTransport(Transport): + def __init__(self, use_datetime: bool = ..., context: Optional[SSLContext] = ...) -> None: ... + def make_connection(self, host: _hostDesc) -> HTTPSConnection: ... + +class ServerProxy: + def __init__(self, uri: str, transport: Optional[Transport] = ..., encoding: Optional[str] = ..., verbose: bool = ..., allow_none: bool = ..., use_datetime: bool = ..., context: Optional[SSLContext] = ...) -> None: ... + def __getattr__(self, name: str) -> _Method: ... + def __call__(self, attr: str) -> Optional[Transport]: ... + +Server = ServerProxy diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/__future__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/__future__.pyi new file mode 100644 index 0000000..13db2dc --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/__future__.pyi @@ -0,0 +1,24 @@ +import sys +from typing import List + +class _Feature: + def getOptionalRelease(self) -> sys._version_info: ... + def getMandatoryRelease(self) -> sys._version_info: ... + +absolute_import: _Feature +division: _Feature +generators: _Feature +nested_scopes: _Feature +print_function: _Feature +unicode_literals: _Feature +with_statement: _Feature +if sys.version_info >= (3, 0): + barry_as_FLUFL: _Feature + +if sys.version_info >= (3, 5): + generator_stop: _Feature + +if sys.version_info >= (3, 7): + annotations: _Feature + +all_feature_names: List[str] diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/_bisect.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/_bisect.pyi new file mode 100644 index 0000000..6233547 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/_bisect.pyi @@ -0,0 +1,11 @@ +"""Stub file for the '_bisect' module.""" + +from typing import Sequence, TypeVar + +_T = TypeVar('_T') +def bisect(a: Sequence[_T], x: _T, lo: int = ..., hi: int = ...) -> int: ... +def bisect_left(a: Sequence[_T], x: _T, lo: int = ..., hi: int = ...) -> int: ... +def bisect_right(a: Sequence[_T], x: _T, lo: int = ..., hi: int = ...) -> int: ... +def insort(a: Sequence[_T], x: _T, lo: int = ..., hi: int = ...) -> None: ... +def insort_left(a: Sequence[_T], x: _T, lo: int = ..., hi: int = ...) -> None: ... +def insort_right(a: Sequence[_T], x: _T, lo: int = ..., hi: int = ...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/_codecs.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/_codecs.pyi new file mode 100644 index 0000000..32163eb --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/_codecs.pyi @@ -0,0 +1,74 @@ +"""Stub file for the '_codecs' module.""" + +import sys +from typing import Any, Callable, Tuple, Optional, Dict, Text, Union + +import codecs + +# For convenience: +_Handler = Callable[[Exception], Tuple[Text, int]] +_String = Union[bytes, str] +_Errors = Union[str, Text, None] +if sys.version_info < (3, 0): + _Decodable = Union[bytes, Text] + _Encodable = Union[bytes, Text] +else: + _Decodable = bytes + _Encodable = str + +# This type is not exposed; it is defined in unicodeobject.c +class _EncodingMap(object): + def size(self) -> int: ... +_MapT = Union[Dict[int, int], _EncodingMap] + +def register(search_function: Callable[[str], Any]) -> None: ... +def register_error(errors: Union[str, Text], handler: _Handler) -> None: ... +def lookup(encoding: Union[str, Text]) -> codecs.CodecInfo: ... +def lookup_error(name: Union[str, Text]) -> _Handler: ... +def decode(obj: Any, encoding: Union[str, Text] = ..., errors: _Errors = ...) -> Any: ... +def encode(obj: Any, encoding: Union[str, Text] = ..., errors: _Errors = ...) -> Any: ... +def charmap_build(map: Text) -> _MapT: ... + +def ascii_decode(data: _Decodable, errors: _Errors = ...) -> Tuple[Text, int]: ... +def ascii_encode(data: _Encodable, errors: _Errors = ...) -> Tuple[bytes, int]: ... +def charbuffer_encode(data: _Encodable, errors: _Errors = ...) -> Tuple[bytes, int]: ... +def charmap_decode(data: _Decodable, errors: _Errors = ..., mapping: Optional[_MapT] = ...) -> Tuple[Text, int]: ... +def charmap_encode(data: _Encodable, errors: _Errors, mapping: Optional[_MapT] = ...) -> Tuple[bytes, int]: ... +def escape_decode(data: _String, errors: _Errors = ...) -> Tuple[str, int]: ... +def escape_encode(data: bytes, errors: _Errors = ...) -> Tuple[bytes, int]: ... +def latin_1_decode(data: _Decodable, errors: _Errors = ...) -> Tuple[Text, int]: ... +def latin_1_encode(data: _Encodable, errors: _Errors = ...) -> Tuple[bytes, int]: ... +def raw_unicode_escape_decode(data: _String, errors: _Errors = ...) -> Tuple[Text, int]: ... +def raw_unicode_escape_encode(data: _Encodable, errors: _Errors = ...) -> Tuple[bytes, int]: ... +def readbuffer_encode(data: _String, errors: _Errors = ...) -> Tuple[bytes, int]: ... +def unicode_escape_decode(data: _String, errors: _Errors = ...) -> Tuple[Text, int]: ... +def unicode_escape_encode(data: _Encodable, errors: _Errors = ...) -> Tuple[bytes, int]: ... +def unicode_internal_decode(data: _String, errors: _Errors = ...) -> Tuple[Text, int]: ... +def unicode_internal_encode(data: _String, errors: _Errors = ...) -> Tuple[bytes, int]: ... +def utf_16_be_decode(data: _Decodable, errors: _Errors = ..., final: int = ...) -> Tuple[Text, int]: ... +def utf_16_be_encode(data: _Encodable, errors: _Errors = ...) -> Tuple[bytes, int]: ... +def utf_16_decode(data: _Decodable, errors: _Errors = ..., final: int = ...) -> Tuple[Text, int]: ... +def utf_16_encode(data: _Encodable, errors: _Errors = ..., byteorder: int = ...) -> Tuple[bytes, int]: ... +def utf_16_ex_decode(data: _Decodable, errors: _Errors = ..., final: int = ...) -> Tuple[Text, int, int]: ... +def utf_16_le_decode(data: _Decodable, errors: _Errors = ..., final: int = ...) -> Tuple[Text, int]: ... +def utf_16_le_encode(data: _Encodable, errors: _Errors = ...) -> Tuple[bytes, int]: ... +def utf_32_be_decode(data: _Decodable, errors: _Errors = ..., final: int = ...) -> Tuple[Text, int]: ... +def utf_32_be_encode(data: _Encodable, errors: _Errors = ...) -> Tuple[bytes, int]: ... +def utf_32_decode(data: _Decodable, errors: _Errors = ..., final: int = ...) -> Tuple[Text, int]: ... +def utf_32_encode(data: _Encodable, errors: _Errors = ..., byteorder: int = ...) -> Tuple[bytes, int]: ... +def utf_32_ex_decode(data: _Decodable, errors: _Errors = ..., final: int = ...) -> Tuple[Text, int, int]: ... +def utf_32_le_decode(data: _Decodable, errors: _Errors = ..., final: int = ...) -> Tuple[Text, int]: ... +def utf_32_le_encode(data: _Encodable, errors: _Errors = ...) -> Tuple[bytes, int]: ... +def utf_7_decode(data: _Decodable, errors: _Errors = ..., final: int = ...) -> Tuple[Text, int]: ... +def utf_7_encode(data: _Encodable, errors: _Errors = ...) -> Tuple[bytes, int]: ... +def utf_8_decode(data: _Decodable, errors: _Errors = ..., final: int = ...) -> Tuple[Text, int]: ... +def utf_8_encode(data: _Encodable, errors: _Errors = ...) -> Tuple[bytes, int]: ... + +if sys.platform == 'win32': + def mbcs_decode(data: _Decodable, errors: _Errors = ..., final: int = ...) -> Tuple[Text, int]: ... + def mbcs_encode(str: _Encodable, errors: _Errors = ...) -> Tuple[bytes, int]: ... + if sys.version_info >= (3, 0): + def oem_decode(data: bytes, errors: _Errors = ..., final: int = ...) -> Tuple[Text, int]: ... + def code_page_decode(codepage: int, data: bytes, errors: _Errors = ..., final: int = ...) -> Tuple[Text, int]: ... + def oem_encode(str: Text, errors: _Errors = ...) -> Tuple[bytes, int]: ... + def code_page_encode(code_page: int, str: Text, errors: _Errors = ...) -> Tuple[bytes, int]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/_csv.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/_csv.pyi new file mode 100644 index 0000000..1c4c26e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/_csv.pyi @@ -0,0 +1,49 @@ +import sys + +from typing import Any, Iterable, Iterator, List, Optional, Sequence, Text + +QUOTE_ALL: int +QUOTE_MINIMAL: int +QUOTE_NONE: int +QUOTE_NONNUMERIC: int + +class Error(Exception): ... + +class Dialect: + delimiter: str + quotechar: Optional[str] + escapechar: Optional[str] + doublequote: bool + skipinitialspace: bool + lineterminator: str + quoting: int + strict: int + def __init__(self) -> None: ... + +class _reader(Iterator[List[str]]): + dialect: Dialect + line_num: int + if sys.version_info >= (3, 0): + def __next__(self) -> List[str]: ... + else: + def next(self) -> List[str]: ... + +class _writer: + dialect: Dialect + + if sys.version_info >= (3, 5): + def writerow(self, row: Iterable[Any]) -> None: ... + def writerows(self, rows: Iterable[Iterable[Any]]) -> None: ... + else: + def writerow(self, row: Sequence[Any]) -> None: ... + def writerows(self, rows: Iterable[Sequence[Any]]) -> None: ... + + +# TODO: precise type +def writer(csvfile: Any, dialect: Any = ..., **fmtparams: Any) -> _writer: ... +def reader(csvfile: Iterable[Text], dialect: Any = ..., **fmtparams: Any) -> _reader: ... +def register_dialect(name: str, dialect: Any = ..., **fmtparams: Any) -> None: ... +def unregister_dialect(name: str) -> None: ... +def get_dialect(name: str) -> Dialect: ... +def list_dialects() -> List[str]: ... +def field_size_limit(new_limit: int = ...) -> int: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/_heapq.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/_heapq.pyi new file mode 100644 index 0000000..8b7f6ea --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/_heapq.pyi @@ -0,0 +1,15 @@ +"""Stub file for the '_heapq' module.""" + +from typing import TypeVar, List + +_T = TypeVar("_T") + +def heapify(heap: List[_T]) -> None: ... +def heappop(heap: List[_T]) -> _T: + raise IndexError() # if list is empty +def heappush(heap: List[_T], item: _T) -> None: ... +def heappushpop(heap: List[_T], item: _T) -> _T: ... +def heapreplace(heap: List[_T], item: _T) -> _T: + raise IndexError() # if list is empty +def nlargest(a: int, b: List[_T]) -> List[_T]: ... +def nsmallest(a: int, b: List[_T]) -> List[_T]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/_random.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/_random.pyi new file mode 100644 index 0000000..a37149d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/_random.pyi @@ -0,0 +1,17 @@ +# Stubs for _random + +import sys +from typing import Tuple + +# Actually Tuple[(int,) * 625] +_State = Tuple[int, ...] + +class Random(object): + def __init__(self, seed: object = ...) -> None: ... + def seed(self, x: object = ...) -> None: ... + def getstate(self) -> _State: ... + def setstate(self, state: _State) -> None: ... + def random(self) -> float: ... + def getrandbits(self, k: int) -> int: ... + if sys.version_info < (3,): + def jumpahead(self, i: int) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/_weakref.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/_weakref.pyi new file mode 100644 index 0000000..6a527c1 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/_weakref.pyi @@ -0,0 +1,28 @@ +import sys +from typing import Any, Callable, Generic, Optional, TypeVar, overload + +_C = TypeVar('_C', bound=Callable[..., Any]) +_T = TypeVar('_T') + +class CallableProxyType(object): # "weakcallableproxy" + def __getattr__(self, attr: str) -> Any: ... + +class ProxyType(object): # "weakproxy" + def __getattr__(self, attr: str) -> Any: ... + +class ReferenceType(Generic[_T]): + if sys.version_info >= (3, 4): + __callback__: Callable[[ReferenceType[_T]], Any] + def __init__(self, o: _T, callback: Optional[Callable[[ReferenceType[_T]], Any]] = ...) -> None: ... + def __call__(self) -> Optional[_T]: ... + def __hash__(self) -> int: ... + +ref = ReferenceType + +def getweakrefcount(object: Any) -> int: ... +def getweakrefs(object: Any) -> int: ... +@overload +def proxy(object: _C, callback: Optional[Callable[[_C], Any]] = ...) -> CallableProxyType: ... +# Return CallableProxyType if object is callable, ProxyType otherwise +@overload +def proxy(object: _T, callback: Optional[Callable[[_T], Any]] = ...) -> Any: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/_weakrefset.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/_weakrefset.pyi new file mode 100644 index 0000000..950d3fe --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/_weakrefset.pyi @@ -0,0 +1,43 @@ +from typing import Iterator, Any, Iterable, MutableSet, Optional, TypeVar, Generic, Union + +_S = TypeVar('_S') +_T = TypeVar('_T') +_SelfT = TypeVar('_SelfT', bound=WeakSet) + +class WeakSet(MutableSet[_T], Generic[_T]): + def __init__(self, data: Optional[Iterable[_T]] = ...) -> None: ... + + def add(self, item: _T) -> None: ... + def clear(self) -> None: ... + def discard(self, item: _T) -> None: ... + def copy(self: _SelfT) -> _SelfT: ... + def pop(self) -> _T: ... + def remove(self, item: _T) -> None: ... + def update(self, other: Iterable[_T]) -> None: ... + def __contains__(self, item: object) -> bool: ... + def __len__(self) -> int: ... + def __iter__(self) -> Iterator[_T]: ... + + def __ior__(self, other: Iterable[_S]) -> WeakSet[Union[_S, _T]]: ... + def difference(self: _SelfT, other: Iterable[_T]) -> _SelfT: ... + def __sub__(self: _SelfT, other: Iterable[_T]) -> _SelfT: ... + def difference_update(self: _SelfT, other: Iterable[_T]) -> None: ... + def __isub__(self: _SelfT, other: Iterable[_T]) -> _SelfT: ... + def intersection(self: _SelfT, other: Iterable[_T]) -> _SelfT: ... + def __and__(self: _SelfT, other: Iterable[_T]) -> _SelfT: ... + def intersection_update(self, other: Iterable[_T]) -> None: ... + def __iand__(self: _SelfT, other: Iterable[_T]) -> _SelfT: ... + def issubset(self, other: Iterable[_T]) -> bool: ... + def __le__(self, other: Iterable[_T]) -> bool: ... + def __lt__(self, other: Iterable[_T]) -> bool: ... + def issuperset(self, other: Iterable[_T]) -> bool: ... + def __ge__(self, other: Iterable[_T]) -> bool: ... + def __gt__(self, other: Iterable[_T]) -> bool: ... + def __eq__(self, other: object) -> bool: ... + def symmetric_difference(self, other: Iterable[_S]) -> WeakSet[Union[_S, _T]]: ... + def __xor__(self, other: Iterable[_S]) -> WeakSet[Union[_S, _T]]: ... + def symmetric_difference_update(self, other: Iterable[_S]) -> None: ... + def __ixor__(self, other: Iterable[_S]) -> WeakSet[Union[_S, _T]]: ... + def union(self, other: Iterable[_S]) -> WeakSet[Union[_S, _T]]: ... + def __or__(self, other: Iterable[_S]) -> WeakSet[Union[_S, _T]]: ... + def isdisjoint(self, other: Iterable[_T]) -> bool: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/argparse.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/argparse.pyi new file mode 100644 index 0000000..d4dd5b5 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/argparse.pyi @@ -0,0 +1,408 @@ +# Stubs for argparse (Python 2.7 and 3.4) + +from typing import ( + Any, Callable, Dict, Generator, Iterable, List, IO, NoReturn, Optional, + Pattern, Sequence, Tuple, Type, Union, TypeVar, overload +) +import sys + +_T = TypeVar('_T') +_ActionT = TypeVar('_ActionT', bound='Action') +_N = TypeVar('_N') + +if sys.version_info >= (3,): + _Text = str +else: + _Text = Union[str, unicode] + +ONE_OR_MORE: str +OPTIONAL: str +PARSER: str +REMAINDER: str +SUPPRESS: str +ZERO_OR_MORE: str +_UNRECOGNIZED_ARGS_ATTR: str # undocumented + +class ArgumentError(Exception): ... + +# undocumented +class _AttributeHolder: + def _get_kwargs(self) -> List[Tuple[str, Any]]: ... + def _get_args(self) -> List[Any]: ... + +# undocumented +class _ActionsContainer: + description: Optional[_Text] + prefix_chars: _Text + argument_default: Optional[_Text] + conflict_handler: _Text + + _registries: Dict[_Text, Dict[Any, Any]] + _actions: List[Action] + _option_string_actions: Dict[_Text, Action] + _action_groups: List[_ArgumentGroup] + _mutually_exclusive_groups: List[_MutuallyExclusiveGroup] + _defaults: Dict[str, Any] + _negative_number_matcher: Pattern[str] + _has_negative_number_optionals: List[bool] + + def __init__(self, description: Optional[_Text], prefix_chars: _Text, + argument_default: Optional[_Text], conflict_handler: _Text) -> None: ... + def register(self, registry_name: _Text, value: Any, object: Any) -> None: ... + def _registry_get(self, registry_name: _Text, value: Any, default: Any = ...) -> Any: ... + def set_defaults(self, **kwargs: Any) -> None: ... + def get_default(self, dest: _Text) -> Any: ... + def add_argument(self, + *name_or_flags: _Text, + action: Union[_Text, Type[Action]] = ..., + nargs: Union[int, _Text] = ..., + const: Any = ..., + default: Any = ..., + type: Union[Callable[[str], _T], FileType] = ..., + choices: Iterable[_T] = ..., + required: bool = ..., + help: Optional[_Text] = ..., + metavar: Optional[Union[_Text, Tuple[_Text, ...]]] = ..., + dest: Optional[_Text] = ..., + version: _Text = ..., + **kwargs: Any) -> Action: ... + def add_argument_group(self, *args: Any, **kwargs: Any) -> _ArgumentGroup: ... + def add_mutually_exclusive_group(self, **kwargs: Any) -> _MutuallyExclusiveGroup: ... + def _add_action(self, action: _ActionT) -> _ActionT: ... + def _remove_action(self, action: Action) -> None: ... + def _add_container_actions(self, container: _ActionsContainer) -> None: ... + def _get_positional_kwargs(self, dest: _Text, **kwargs: Any) -> Dict[str, Any]: ... + def _get_optional_kwargs(self, *args: Any, **kwargs: Any) -> Dict[str, Any]: ... + def _pop_action_class(self, kwargs: Any, default: Optional[Type[Action]] = ...) -> Type[Action]: ... + def _get_handler(self) -> Callable[[Action, Iterable[Tuple[_Text, Action]]], Any]: ... + def _check_conflict(self, action: Action) -> None: ... + def _handle_conflict_error(self, action: Action, conflicting_actions: Iterable[Tuple[_Text, Action]]) -> NoReturn: ... + def _handle_conflict_resolve(self, action: Action, conflicting_actions: Iterable[Tuple[_Text, Action]]) -> None: ... + +class ArgumentParser(_AttributeHolder, _ActionsContainer): + prog: _Text + usage: Optional[_Text] + epilog: Optional[_Text] + formatter_class: Type[HelpFormatter] + fromfile_prefix_chars: Optional[_Text] + add_help: bool + + if sys.version_info >= (3, 5): + allow_abbrev: bool + + # undocumented + _positionals: _ArgumentGroup + _optionals: _ArgumentGroup + _subparsers: Optional[_ArgumentGroup] + + if sys.version_info >= (3, 5): + def __init__(self, + prog: Optional[str] = ..., + usage: Optional[str] = ..., + description: Optional[str] = ..., + epilog: Optional[str] = ..., + parents: Sequence[ArgumentParser] = ..., + formatter_class: Type[HelpFormatter] = ..., + prefix_chars: _Text = ..., + fromfile_prefix_chars: Optional[str] = ..., + argument_default: Optional[str] = ..., + conflict_handler: _Text = ..., + add_help: bool = ..., + allow_abbrev: bool = ...) -> None: ... + else: + def __init__(self, + prog: Optional[_Text] = ..., + usage: Optional[_Text] = ..., + description: Optional[_Text] = ..., + epilog: Optional[_Text] = ..., + parents: Sequence[ArgumentParser] = ..., + formatter_class: Type[HelpFormatter] = ..., + prefix_chars: _Text = ..., + fromfile_prefix_chars: Optional[_Text] = ..., + argument_default: Optional[_Text] = ..., + conflict_handler: _Text = ..., + add_help: bool = ...) -> None: ... + + # The type-ignores in these overloads should be temporary. See: + # https://github.com/python/typeshed/pull/2643#issuecomment-442280277 + @overload + def parse_args(self, args: Optional[Sequence[_Text]] = ...) -> Namespace: ... + @overload + def parse_args(self, args: Optional[Sequence[_Text]], namespace: None) -> Namespace: ... # type: ignore + @overload + def parse_args(self, args: Optional[Sequence[_Text]], namespace: _N) -> _N: ... + @overload + def parse_args(self, *, namespace: None) -> Namespace: ... # type: ignore + @overload + def parse_args(self, *, namespace: _N) -> _N: ... + + if sys.version_info >= (3, 7): + def add_subparsers(self, title: _Text = ..., + description: Optional[_Text] = ..., + prog: _Text = ..., + parser_class: Type[ArgumentParser] = ..., + action: Type[Action] = ..., + option_string: _Text = ..., + dest: Optional[_Text] = ..., + required: bool = ..., + help: Optional[_Text] = ..., + metavar: Optional[_Text] = ...) -> _SubParsersAction: ... + else: + def add_subparsers(self, title: _Text = ..., + description: Optional[_Text] = ..., + prog: _Text = ..., + parser_class: Type[ArgumentParser] = ..., + action: Type[Action] = ..., + option_string: _Text = ..., + dest: Optional[_Text] = ..., + help: Optional[_Text] = ..., + metavar: Optional[_Text] = ...) -> _SubParsersAction: ... + + def print_usage(self, file: Optional[IO[str]] = ...) -> None: ... + def print_help(self, file: Optional[IO[str]] = ...) -> None: ... + def format_usage(self) -> str: ... + def format_help(self) -> str: ... + def parse_known_args(self, args: Optional[Sequence[_Text]] = ..., + namespace: Optional[Namespace] = ...) -> Tuple[Namespace, List[str]]: ... + def convert_arg_line_to_args(self, arg_line: _Text) -> List[str]: ... + def exit(self, status: int = ..., message: Optional[_Text] = ...) -> NoReturn: ... + def error(self, message: _Text) -> NoReturn: ... + if sys.version_info >= (3, 7): + def parse_intermixed_args(self, args: Optional[Sequence[_Text]] = ..., + namespace: Optional[Namespace] = ...) -> Namespace: ... + def parse_known_intermixed_args(self, + args: Optional[Sequence[_Text]] = ..., + namespace: Optional[Namespace] = ...) -> Tuple[Namespace, List[str]]: ... + # undocumented + def _get_optional_actions(self) -> List[Action]: ... + def _get_positional_actions(self) -> List[Action]: ... + def _parse_known_args(self, arg_strings: List[_Text], namespace: Namespace) -> Tuple[Namespace, List[str]]: ... + def _read_args_from_files(self, arg_strings: List[_Text]) -> List[_Text]: ... + def _match_argument(self, action: Action, arg_strings_pattern: _Text) -> int: ... + def _match_arguments_partial(self, actions: Sequence[Action], arg_strings_pattern: _Text) -> List[int]: ... + def _parse_optional(self, arg_string: _Text) -> Optional[Tuple[Optional[Action], _Text, Optional[_Text]]]: ... + def _get_option_tuples(self, option_string: _Text) -> List[Tuple[Action, _Text, Optional[_Text]]]: ... + def _get_nargs_pattern(self, action: Action) -> _Text: ... + def _get_values(self, action: Action, arg_strings: List[_Text]) -> Any: ... + def _get_value(self, action: Action, arg_string: _Text) -> Any: ... + def _check_value(self, action: Action, value: Any) -> None: ... + def _get_formatter(self) -> HelpFormatter: ... + def _print_message(self, message: str, file: Optional[IO[str]] = ...) -> None: ... + +class HelpFormatter: + # undocumented + _prog: _Text + _indent_increment: int + _max_help_position: int + _width: int + _current_indent: int + _level: int + _action_max_length: int + _root_section: Any + _current_section: Any + _whitespace_matcher: Pattern[str] + _long_break_matcher: Pattern[str] + _Section: Type[Any] # Nested class + def __init__(self, prog: _Text, indent_increment: int = ..., + max_help_position: int = ..., + width: Optional[int] = ...) -> None: ... + def _indent(self) -> None: ... + def _dedent(self) -> None: ... + def _add_item(self, func: Callable[..., _Text], args: Iterable[Any]) -> None: ... + def start_section(self, heading: Optional[_Text]) -> None: ... + def end_section(self) -> None: ... + def add_text(self, text: Optional[_Text]) -> None: ... + def add_usage(self, usage: _Text, actions: Iterable[Action], groups: Iterable[_ArgumentGroup], prefix: Optional[_Text] = ...) -> None: ... + def add_argument(self, action: Action) -> None: ... + def add_arguments(self, actions: Iterable[Action]) -> None: ... + def format_help(self) -> _Text: ... + def _join_parts(self, part_strings: Iterable[_Text]) -> _Text: ... + def _format_usage(self, usage: _Text, actions: Iterable[Action], groups: Iterable[_ArgumentGroup], prefix: Optional[_Text]) -> _Text: ... + def _format_actions_usage(self, actions: Iterable[Action], groups: Iterable[_ArgumentGroup]) -> _Text: ... + def _format_text(self, text: _Text) -> _Text: ... + def _format_action(self, action: Action) -> _Text: ... + def _format_action_invocation(self, action: Action) -> _Text: ... + def _metavar_formatter(self, action: Action, default_metavar: _Text) -> Callable[[int], Tuple[_Text, ...]]: ... + def _format_args(self, action: Action, default_metavar: _Text) -> _Text: ... + def _expand_help(self, action: Action) -> _Text: ... + def _iter_indented_subactions(self, action: Action) -> Generator[Action, None, None]: ... + def _split_lines(self, text: _Text, width: int) -> List[_Text]: ... + def _fill_text(self, text: _Text, width: int, indent: int) -> _Text: ... + def _get_help_string(self, action: Action) -> Optional[_Text]: ... + def _get_default_metavar_for_optional(self, action: Action) -> _Text: ... + def _get_default_metavar_for_positional(self, action: Action) -> _Text: ... + +class RawDescriptionHelpFormatter(HelpFormatter): ... +class RawTextHelpFormatter(HelpFormatter): ... +class ArgumentDefaultsHelpFormatter(HelpFormatter): ... +if sys.version_info >= (3,): + class MetavarTypeHelpFormatter(HelpFormatter): ... + +class Action(_AttributeHolder): + option_strings: Sequence[_Text] + dest: _Text + nargs: Optional[Union[int, _Text]] + const: Any + default: Any + type: Union[Callable[[str], Any], FileType, None] + choices: Optional[Iterable[Any]] + required: bool + help: Optional[_Text] + metavar: Optional[Union[_Text, Tuple[_Text, ...]]] + + def __init__(self, + option_strings: Sequence[_Text], + dest: _Text, + nargs: Optional[Union[int, _Text]] = ..., + const: Any = ..., + default: Any = ..., + type: Optional[Union[Callable[[str], _T], FileType]] = ..., + choices: Optional[Iterable[_T]] = ..., + required: bool = ..., + help: Optional[_Text] = ..., + metavar: Optional[Union[_Text, Tuple[_Text, ...]]] = ...) -> None: ... + def __call__(self, parser: ArgumentParser, namespace: Namespace, + values: Union[_Text, Sequence[Any], None], + option_string: Optional[_Text] = ...) -> None: ... + +class Namespace(_AttributeHolder): + def __init__(self, **kwargs: Any) -> None: ... + def __getattr__(self, name: _Text) -> Any: ... + def __setattr__(self, name: _Text, value: Any) -> None: ... + def __contains__(self, key: str) -> bool: ... + +class FileType: + # undocumented + _mode: _Text + _bufsize: int + if sys.version_info >= (3, 4): + _encoding: Optional[_Text] + _errors: Optional[_Text] + if sys.version_info >= (3, 4): + def __init__(self, mode: _Text = ..., bufsize: int = ..., + encoding: Optional[_Text] = ..., + errors: Optional[_Text] = ...) -> None: ... + elif sys.version_info >= (3,): + def __init__(self, + mode: _Text = ..., bufsize: int = ...) -> None: ... + else: + def __init__(self, + mode: _Text = ..., bufsize: Optional[int] = ...) -> None: ... + def __call__(self, string: _Text) -> IO[Any]: ... + +# undocumented +class _ArgumentGroup(_ActionsContainer): + title: Optional[_Text] + _group_actions: List[Action] + def __init__(self, container: _ActionsContainer, + title: Optional[_Text] = ..., + description: Optional[_Text] = ..., **kwargs: Any) -> None: ... + +# undocumented +class _MutuallyExclusiveGroup(_ArgumentGroup): + required: bool + _container: _ActionsContainer + def __init__(self, container: _ActionsContainer, required: bool = ...) -> None: ... + +# undocumented +class _StoreAction(Action): ... + +# undocumented +class _StoreConstAction(Action): + def __init__(self, + option_strings: Sequence[_Text], + dest: _Text, + const: Any, + default: Any = ..., + required: bool = ..., + help: Optional[_Text] = ..., + metavar: Optional[Union[_Text, Tuple[_Text, ...]]] = ...) -> None: ... + +# undocumented +class _StoreTrueAction(_StoreConstAction): + def __init__(self, + option_strings: Sequence[_Text], + dest: _Text, + default: bool = ..., + required: bool = ..., + help: Optional[_Text] = ...) -> None: ... + +# undocumented +class _StoreFalseAction(_StoreConstAction): + def __init__(self, + option_strings: Sequence[_Text], + dest: _Text, + default: bool = ..., + required: bool = ..., + help: Optional[_Text] = ...) -> None: ... + +# undocumented +class _AppendAction(Action): ... + +# undocumented +class _AppendConstAction(Action): + def __init__(self, + option_strings: Sequence[_Text], + dest: _Text, + const: Any, + default: Any = ..., + required: bool = ..., + help: Optional[_Text] = ..., + metavar: Optional[Union[_Text, Tuple[_Text, ...]]] = ...) -> None: ... + +# undocumented +class _CountAction(Action): + def __init__(self, + option_strings: Sequence[_Text], + dest: _Text, + default: Any = ..., + required: bool = ..., + help: Optional[_Text] = ...) -> None: ... + +# undocumented +class _HelpAction(Action): + def __init__(self, + option_strings: Sequence[_Text], + dest: _Text = ..., + default: _Text = ..., + help: Optional[_Text] = ...) -> None: ... + +# undocumented +class _VersionAction(Action): + version: Optional[_Text] + def __init__(self, + option_strings: Sequence[_Text], + version: Optional[_Text] = ..., + dest: _Text = ..., + default: _Text = ..., + help: _Text = ...) -> None: ... + +# undocumented +class _SubParsersAction(Action): + _ChoicesPseudoAction: Type[Any] # nested class + _prog_prefix: _Text + _parser_class: Type[ArgumentParser] + _name_parser_map: Dict[_Text, ArgumentParser] + choices: Dict[_Text, ArgumentParser] + _choices_actions: List[Action] + def __init__(self, + option_strings: Sequence[_Text], + prog: _Text, + parser_class: Type[ArgumentParser], + dest: _Text = ..., + required: bool = ..., + help: Optional[_Text] = ..., + metavar: Optional[Union[_Text, Tuple[_Text, ...]]] = ...) -> None: ... + # TODO: Type keyword args properly. + def add_parser(self, name: _Text, **kwargs: Any) -> ArgumentParser: ... + def _get_subactions(self) -> List[Action]: ... + +# undocumented +class ArgumentTypeError(Exception): ... + +if sys.version_info < (3, 7): + # undocumented + def _ensure_value(namespace: Namespace, name: _Text, value: Any) -> Any: ... + +# undocumented +def _get_action_name(argument: Optional[Action]) -> Optional[str]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/array.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/array.pyi new file mode 100644 index 0000000..01c6f99 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/array.pyi @@ -0,0 +1,73 @@ +# Stubs for array + +# Based on http://docs.python.org/3.6/library/array.html + +import sys +from typing import (Any, BinaryIO, Generic, Iterable, Iterator, List, MutableSequence, + overload, Text, Tuple, TypeVar, Union) + +_T = TypeVar('_T', int, float, Text) + +if sys.version_info >= (3,): + typecodes: str + +class array(MutableSequence[_T], Generic[_T]): + typecode: str + itemsize: int + def __init__(self, typecode: str, + __initializer: Union[bytes, Iterable[_T]] = ...) -> None: ... + def append(self, x: _T) -> None: ... + def buffer_info(self) -> Tuple[int, int]: ... + def byteswap(self) -> None: ... + def count(self, x: Any) -> int: ... + def extend(self, iterable: Iterable[_T]) -> None: ... + if sys.version_info >= (3, 2): + def frombytes(self, s: bytes) -> None: ... + def fromfile(self, f: BinaryIO, n: int) -> None: ... + def fromlist(self, list: List[_T]) -> None: ... + def fromstring(self, s: bytes) -> None: ... + def fromunicode(self, s: str) -> None: ... + def index(self, x: _T) -> int: ... # type: ignore # Overrides Sequence + def insert(self, i: int, x: _T) -> None: ... + def pop(self, i: int = ...) -> _T: ... + if sys.version_info < (3,): + def read(self, f: BinaryIO, n: int) -> None: ... + def remove(self, x: Any) -> None: ... + def reverse(self) -> None: ... + if sys.version_info >= (3, 2): + def tobytes(self) -> bytes: ... + def tofile(self, f: BinaryIO) -> None: ... + def tolist(self) -> List[_T]: ... + def tostring(self) -> bytes: ... + def tounicode(self) -> str: ... + if sys.version_info < (3,): + def write(self, f: BinaryIO) -> None: ... + + def __len__(self) -> int: ... + + @overload + def __getitem__(self, i: int) -> _T: ... + @overload + def __getitem__(self, s: slice) -> array[_T]: ... + + @overload # type: ignore # Overrides MutableSequence + def __setitem__(self, i: int, o: _T) -> None: ... + @overload + def __setitem__(self, s: slice, o: array[_T]) -> None: ... + + def __delitem__(self, i: Union[int, slice]) -> None: ... + def __add__(self, x: array[_T]) -> array[_T]: ... + def __ge__(self, other: array[_T]) -> bool: ... + def __gt__(self, other: array[_T]) -> bool: ... + def __iadd__(self, x: array[_T]) -> array[_T]: ... # type: ignore # Overrides MutableSequence + def __imul__(self, n: int) -> array[_T]: ... + def __le__(self, other: array[_T]) -> bool: ... + def __lt__(self, other: array[_T]) -> bool: ... + def __mul__(self, n: int) -> array[_T]: ... + def __rmul__(self, n: int) -> array[_T]: ... + if sys.version_info < (3,): + def __delslice__(self, i: int, j: int) -> None: ... + def __getslice__(self, i: int, j: int) -> array[_T]: ... + def __setslice__(self, i: int, j: int, y: array[_T]) -> None: ... + +ArrayType = array diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/asynchat.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/asynchat.pyi new file mode 100644 index 0000000..a359ae7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/asynchat.pyi @@ -0,0 +1,41 @@ +from abc import abstractmethod +import asyncore +import socket +import sys +from typing import Optional, Sequence, Tuple, Union + + +class simple_producer: + def __init__(self, data: bytes, buffer_size: int = ...) -> None: ... + def more(self) -> bytes: ... + +class async_chat(asyncore.dispatcher): + ac_in_buffer_size: int + ac_out_buffer_size: int + def __init__(self, sock: Optional[socket.socket] = ..., map: Optional[asyncore._maptype] = ...) -> None: ... + + @abstractmethod + def collect_incoming_data(self, data: bytes) -> None: ... + @abstractmethod + def found_terminator(self) -> None: ... + def set_terminator(self, term: Union[bytes, int, None]) -> None: ... + def get_terminator(self) -> Union[bytes, int, None]: ... + def handle_read(self) -> None: ... + def handle_write(self) -> None: ... + def handle_close(self) -> None: ... + def push(self, data: bytes) -> None: ... + def push_with_producer(self, producer: simple_producer) -> None: ... + def readable(self) -> bool: ... + def writable(self) -> bool: ... + def close_when_done(self) -> None: ... + def initiate_send(self) -> None: ... + def discard_buffers(self) -> None: ... + +if sys.version_info < (3, 0): + class fifo: + def __init__(self, list: Sequence[Union[bytes, simple_producer]] = ...) -> None: ... + def __len__(self) -> int: ... + def is_empty(self) -> bool: ... + def first(self) -> bytes: ... + def push(self, data: Union[bytes, simple_producer]) -> None: ... + def pop(self) -> Tuple[int, bytes]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/asyncore.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/asyncore.pyi new file mode 100644 index 0000000..8dc8f47 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/asyncore.pyi @@ -0,0 +1,144 @@ +from typing import Tuple, Union, Optional, Any, Dict, overload + +import os +import select +import sys +import time +import warnings +from socket import SocketType +from typing import Optional + +from errno import (EALREADY, EINPROGRESS, EWOULDBLOCK, ECONNRESET, EINVAL, + ENOTCONN, ESHUTDOWN, EINTR, EISCONN, EBADF, ECONNABORTED, + EPIPE, EAGAIN, errorcode) + +# cyclic dependence with asynchat +_maptype = Dict[str, Any] + + +class ExitNow(Exception): ... + +def read(obj: Any) -> None: ... +def write(obj: Any) -> None: ... +def readwrite(obj: Any, flags: int) -> None: ... +def poll(timeout: float = ..., map: _maptype = ...) -> None: ... +def poll2(timeout: float = ..., map: _maptype = ...) -> None: ... + +poll3 = poll2 + +def loop(timeout: float = ..., use_poll: bool = ..., map: _maptype = ..., count: Optional[int] = ...) -> None: ... + + +# Not really subclass of socket.socket; it's only delegation. +# It is not covariant to it. +class dispatcher: + + debug: bool + connected: bool + accepting: bool + connecting: bool + closing: bool + ignore_log_types: frozenset[str] + socket: Optional[SocketType] + + def __init__(self, sock: Optional[SocketType] = ..., map: _maptype = ...) -> None: ... + def add_channel(self, map: _maptype = ...) -> None: ... + def del_channel(self, map: _maptype = ...) -> None: ... + def create_socket(self, family: int, type: int) -> None: ... + def set_socket(self, sock: SocketType, map: _maptype = ...) -> None: ... + def set_reuse_addr(self) -> None: ... + def readable(self) -> bool: ... + def writable(self) -> bool: ... + def listen(self, backlog: int) -> None: ... + def bind(self, address: Union[tuple, str]) -> None: ... + def connect(self, address: Union[tuple, str]) -> None: ... + def accept(self) -> Optional[Tuple[SocketType, Any]]: ... + def send(self, data: bytes) -> int: ... + def recv(self, buffer_size: int) -> bytes: ... + def close(self) -> None: ... + + def log(self, message: Any) -> None: ... + def log_info(self, message: Any, type: str = ...) -> None: ... + def handle_read_event(self) -> None: ... + def handle_connect_event(self) -> None: ... + def handle_write_event(self) -> None: ... + def handle_expt_event(self) -> None: ... + def handle_error(self) -> None: ... + def handle_expt(self) -> None: ... + def handle_read(self) -> None: ... + def handle_write(self) -> None: ... + def handle_connect(self) -> None: ... + def handle_accept(self) -> None: ... + def handle_close(self) -> None: ... + + if sys.version_info < (3, 5): + # Historically, some methods were "imported" from `self.socket` by + # means of `__getattr__`. This was long deprecated, and as of Python + # 3.5 has been removed; simply call the relevant methods directly on + # self.socket if necessary. + + def detach(self) -> int: ... + def fileno(self) -> int: ... + + # return value is an address + def getpeername(self) -> Any: ... + def getsockname(self) -> Any: ... + + @overload + def getsockopt(self, level: int, optname: int) -> int: ... + @overload + def getsockopt(self, level: int, optname: int, buflen: int) -> bytes: ... + + def gettimeout(self) -> float: ... + def ioctl(self, control: object, + option: Tuple[int, int, int]) -> None: ... + # TODO the return value may be BinaryIO or TextIO, depending on mode + def makefile(self, mode: str = ..., buffering: int = ..., + encoding: str = ..., errors: str = ..., + newline: str = ...) -> Any: + ... + + # return type is an address + def recvfrom(self, bufsize: int, flags: int = ...) -> Any: ... + def recvfrom_into(self, buffer: bytes, nbytes: int, flags: int = ...) -> Any: ... + def recv_into(self, buffer: bytes, nbytes: int, flags: int = ...) -> Any: ... + def sendall(self, data: bytes, flags: int = ...) -> None: ... + def sendto(self, data: bytes, address: Union[tuple, str], flags: int = ...) -> int: ... + def setblocking(self, flag: bool) -> None: ... + def settimeout(self, value: Union[float, None]) -> None: ... + def setsockopt(self, level: int, optname: int, value: Union[int, bytes]) -> None: ... + def shutdown(self, how: int) -> None: ... + +class dispatcher_with_send(dispatcher): + def __init__(self, sock: SocketType = ..., map: _maptype = ...) -> None: ... + def initiate_send(self) -> None: ... + def handle_write(self) -> None: ... + # incompatible signature: + # def send(self, data: bytes) -> Optional[int]: ... + +def compact_traceback() -> Tuple[Tuple[str, str, str], type, type, str]: ... +def close_all(map: _maptype = ..., ignore_all: bool = ...) -> None: ... + +# if os.name == 'posix': +# import fcntl +class file_wrapper: + fd: int + + def __init__(self, fd: int) -> None: ... + def recv(self, bufsize: int, flags: int = ...) -> bytes: ... + def send(self, data: bytes, flags: int = ...) -> int: ... + + @overload + def getsockopt(self, level: int, optname: int) -> int: ... + @overload + def getsockopt(self, level: int, optname: int, buflen: int) -> bytes: ... + + def read(self, bufsize: int, flags: int = ...) -> bytes: ... + def write(self, data: bytes, flags: int = ...) -> int: ... + + def close(self) -> None: ... + def fileno(self) -> int: ... + +class file_dispatcher(dispatcher): + def __init__(self, fd: int, map: _maptype = ...) -> None: ... + def set_file(self, fd: int) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/base64.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/base64.pyi new file mode 100644 index 0000000..7c648c8 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/base64.pyi @@ -0,0 +1,38 @@ +# Stubs for base64 + +from typing import IO, Union, Text +import sys + +if sys.version_info < (3,): + _encodable = Union[bytes, unicode] + _decodable = Union[bytes, unicode] +else: + _encodable = bytes + _decodable = Union[bytes, str] + +def b64encode(s: _encodable, altchars: bytes = ...) -> bytes: ... +def b64decode(s: _decodable, altchars: bytes = ..., + validate: bool = ...) -> bytes: ... +def standard_b64encode(s: _encodable) -> bytes: ... +def standard_b64decode(s: _decodable) -> bytes: ... +def urlsafe_b64encode(s: _encodable) -> bytes: ... +def urlsafe_b64decode(s: _decodable) -> bytes: ... +def b32encode(s: _encodable) -> bytes: ... +def b32decode(s: _decodable, casefold: bool = ..., + map01: bytes = ...) -> bytes: ... +def b16encode(s: _encodable) -> bytes: ... +def b16decode(s: _decodable, casefold: bool = ...) -> bytes: ... +if sys.version_info >= (3, 4): + def a85encode(b: _encodable, *, foldspaces: bool = ..., wrapcol: int = ..., + pad: bool = ..., adobe: bool = ...) -> bytes: ... + def a85decode(b: _decodable, *, foldspaces: bool = ..., + adobe: bool = ..., ignorechars: Union[str, bytes] = ...) -> bytes: ... + def b85encode(b: _encodable, pad: bool = ...) -> bytes: ... + def b85decode(b: _decodable) -> bytes: ... + +def decode(input: IO[bytes], output: IO[bytes]) -> None: ... +def decodebytes(s: bytes) -> bytes: ... +def decodestring(s: bytes) -> bytes: ... +def encode(input: IO[bytes], output: IO[bytes]) -> None: ... +def encodebytes(s: bytes) -> bytes: ... +def encodestring(s: bytes) -> bytes: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/binascii.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/binascii.pyi new file mode 100644 index 0000000..9689b71 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/binascii.pyi @@ -0,0 +1,47 @@ +# Stubs for binascii + +# Based on http://docs.python.org/3.2/library/binascii.html + +import sys +from typing import Union, Text + + +if sys.version_info < (3,): + # Python 2 accepts unicode ascii pretty much everywhere. + _Bytes = Union[bytes, Text] + _Ascii = Union[bytes, Text] +elif sys.version_info < (3, 3): + # Python 3.2 and below only accepts bytes. + _Bytes = bytes + _Ascii = bytes +else: + # But since Python 3.3 ASCII-only unicode strings are accepted by the + # a2b_* functions. + _Bytes = bytes + _Ascii = Union[bytes, Text] + +def a2b_uu(string: _Ascii) -> bytes: ... +if sys.version_info >= (3, 7): + def b2a_uu(data: _Bytes, *, backtick: bool = ...) -> bytes: ... +else: + def b2a_uu(data: _Bytes) -> bytes: ... +def a2b_base64(string: _Ascii) -> bytes: ... +if sys.version_info >= (3, 6): + def b2a_base64(data: _Bytes, *, newline: bool = ...) -> bytes: ... +else: + def b2a_base64(data: _Bytes) -> bytes: ... +def a2b_qp(string: _Ascii, header: bool = ...) -> bytes: ... +def b2a_qp(data: _Bytes, quotetabs: bool = ..., istext: bool = ..., header: bool = ...) -> bytes: ... +def a2b_hqx(string: _Ascii) -> bytes: ... +def rledecode_hqx(data: _Bytes) -> bytes: ... +def rlecode_hqx(data: _Bytes) -> bytes: ... +def b2a_hqx(data: _Bytes) -> bytes: ... +def crc_hqx(data: _Bytes, crc: int) -> int: ... +def crc32(data: _Bytes, crc: int = ...) -> int: ... +def b2a_hex(data: _Bytes) -> bytes: ... +def hexlify(data: _Bytes) -> bytes: ... +def a2b_hex(hexstr: _Ascii) -> bytes: ... +def unhexlify(hexlify: _Ascii) -> bytes: ... + +class Error(Exception): ... +class Incomplete(Exception): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/binhex.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/binhex.pyi new file mode 100644 index 0000000..c759ba0 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/binhex.pyi @@ -0,0 +1,48 @@ +from typing import ( + Any, + IO, + Tuple, + Union, +) + + +class Error(Exception): ... + +REASONABLY_LARGE: int +LINELEN: int +RUNCHAR: bytes + +class FInfo: + def __init__(self) -> None: ... + Type: str + Creator: str + Flags: int + +_FileInfoTuple = Tuple[str, FInfo, int, int] +_FileHandleUnion = Union[str, IO[bytes]] + +def getfileinfo(name: str) -> _FileInfoTuple: ... + +class openrsrc: + def __init__(self, *args: Any) -> None: ... + def read(self, *args: Any) -> bytes: ... + def write(self, *args: Any) -> None: ... + def close(self) -> None: ... + +class BinHex: + def __init__(self, name_finfo_dlen_rlen: _FileInfoTuple, ofp: _FileHandleUnion) -> None: ... + def write(self, data: bytes) -> None: ... + def close_data(self) -> None: ... + def write_rsrc(self, data: bytes) -> None: ... + def close(self) -> None: ... + +def binhex(inp: str, out: str) -> None: ... + +class HexBin: + def __init__(self, ifp: _FileHandleUnion) -> None: ... + def read(self, *n: int) -> bytes: ... + def close_data(self) -> None: ... + def read_rsrc(self, *n: int) -> bytes: ... + def close(self) -> None: ... + +def hexbin(inp: str, out: str) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/bisect.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/bisect.pyi new file mode 100644 index 0000000..5c54112 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/bisect.pyi @@ -0,0 +1,22 @@ +# Stubs for bisect + +from typing import Any, Sequence, TypeVar + +_T = TypeVar('_T') + +# TODO uncomment when mypy# 2035 is fixed +# def bisect_left(a: Sequence[_T], x: _T, lo: int = ..., hi: int = ...) -> int: ... +# def bisect_right(a: Sequence[_T], x: _T, lo: int = ..., hi: int = ...) -> int: ... +# def bisect(a: Sequence[_T], x: _T, lo: int = ..., hi: int = ...) -> int: ... +# +# def insort_left(a: Sequence[_T], x: _T, lo: int = ..., hi: int = ...) -> int: ... +# def insort_right(a: Sequence[_T], x: _T, lo: int = ..., hi: int = ...) -> int: ... +# def insort(a: Sequence[_T], x: _T, lo: int = ..., hi: int = ...) -> int: ... + +def bisect_left(a: Sequence, x: Any, lo: int = ..., hi: int = ...) -> int: ... +def bisect_right(a: Sequence, x: Any, lo: int = ..., hi: int = ...) -> int: ... +def bisect(a: Sequence, x: Any, lo: int = ..., hi: int = ...) -> int: ... + +def insort_left(a: Sequence, x: Any, lo: int = ..., hi: int = ...) -> int: ... +def insort_right(a: Sequence, x: Any, lo: int = ..., hi: int = ...) -> int: ... +def insort(a: Sequence, x: Any, lo: int = ..., hi: int = ...) -> int: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/builtins.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/builtins.pyi new file mode 100644 index 0000000..cca0e4f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/builtins.pyi @@ -0,0 +1,1622 @@ +# True and False are deliberately omitted because they are keywords in +# Python 3, and stub files conform to Python 3 syntax. + +from typing import ( + TypeVar, Iterator, Iterable, NoReturn, overload, Container, + Sequence, MutableSequence, Mapping, MutableMapping, Tuple, List, Any, Dict, Callable, Generic, + Set, AbstractSet, FrozenSet, MutableSet, Sized, Reversible, SupportsInt, SupportsFloat, SupportsAbs, + SupportsComplex, IO, BinaryIO, Union, + ItemsView, KeysView, ValuesView, ByteString, Optional, AnyStr, Type, Text, + Protocol, +) +from abc import abstractmethod, ABCMeta +from ast import mod, AST +from types import TracebackType, CodeType +import sys + +if sys.version_info >= (3,): + from typing import SupportsBytes, SupportsRound + +_T = TypeVar('_T') +_T_co = TypeVar('_T_co', covariant=True) +_KT = TypeVar('_KT') +_VT = TypeVar('_VT') +_S = TypeVar('_S') +_T1 = TypeVar('_T1') +_T2 = TypeVar('_T2') +_T3 = TypeVar('_T3') +_T4 = TypeVar('_T4') +_T5 = TypeVar('_T5') +_TT = TypeVar('_TT', bound='type') + +class object: + __doc__: Optional[str] + __dict__: Dict[str, Any] + __slots__: Union[Text, Iterable[Text]] + __module__: str + if sys.version_info >= (3, 6): + __annotations__: Dict[str, Any] + + @property + def __class__(self: _T) -> Type[_T]: ... + @__class__.setter + def __class__(self, __type: Type[object]) -> None: ... + def __init__(self) -> None: ... + def __new__(cls) -> Any: ... + def __setattr__(self, name: str, value: Any) -> None: ... + def __eq__(self, o: object) -> bool: ... + def __ne__(self, o: object) -> bool: ... + def __str__(self) -> str: ... + def __repr__(self) -> str: ... + def __hash__(self) -> int: ... + def __format__(self, format_spec: str) -> str: ... + def __getattribute__(self, name: str) -> Any: ... + def __delattr__(self, name: str) -> None: ... + def __sizeof__(self) -> int: ... + def __reduce__(self) -> tuple: ... + def __reduce_ex__(self, protocol: int) -> tuple: ... + if sys.version_info >= (3,): + def __dir__(self) -> Iterable[str]: ... + if sys.version_info >= (3, 6): + def __init_subclass__(cls) -> None: ... + +class staticmethod(object): # Special, only valid as a decorator. + __func__: Callable + if sys.version_info >= (3,): + __isabstractmethod__: bool + + def __init__(self, f: Callable) -> None: ... + def __new__(cls: Type[_T], *args: Any, **kwargs: Any) -> _T: ... + def __get__(self, obj: _T, type: Optional[Type[_T]] = ...) -> Callable: ... + +class classmethod(object): # Special, only valid as a decorator. + __func__: Callable + if sys.version_info >= (3,): + __isabstractmethod__: bool + + def __init__(self, f: Callable) -> None: ... + def __new__(cls: Type[_T], *args: Any, **kwargs: Any) -> _T: ... + def __get__(self, obj: _T, type: Optional[Type[_T]] = ...) -> Callable: ... + +class type(object): + __base__: type + __bases__: Tuple[type, ...] + __basicsize__: int + __dict__: Dict[str, Any] + __dictoffset__: int + __flags__: int + __itemsize__: int + __module__: str + __mro__: Tuple[type, ...] + __name__: str + if sys.version_info >= (3,): + __qualname__: str + __text_signature__: Optional[str] + __weakrefoffset__: int + + @overload + def __init__(self, o: object) -> None: ... + @overload + def __init__(self, name: str, bases: Tuple[type, ...], dict: Dict[str, Any]) -> None: ... + @overload + def __new__(cls, o: object) -> type: ... + @overload + def __new__(cls, name: str, bases: Tuple[type, ...], namespace: Dict[str, Any]) -> type: ... + def __call__(self, *args: Any, **kwds: Any) -> Any: ... + def __subclasses__(self: _TT) -> List[_TT]: ... + # Note: the documentation doesnt specify what the return type is, the standard + # implementation seems to be returning a list. + def mro(self) -> List[type]: ... + def __instancecheck__(self, instance: Any) -> bool: ... + def __subclasscheck__(self, subclass: type) -> bool: ... + if sys.version_info >= (3,): + @classmethod + def __prepare__(metacls, __name: str, __bases: Tuple[type, ...], **kwds: Any) -> Mapping[str, Any]: ... + +class super(object): + if sys.version_info >= (3,): + @overload + def __init__(self, t: Any, obj: Any) -> None: ... + @overload + def __init__(self, t: Any) -> None: ... + @overload + def __init__(self) -> None: ... + else: + @overload + def __init__(self, t: Any, obj: Any) -> None: ... + @overload + def __init__(self, t: Any) -> None: ... + +class int: + @overload + def __init__(self, x: Union[Text, bytes, SupportsInt] = ...) -> None: ... + @overload + def __init__(self, x: Union[Text, bytes, bytearray], base: int) -> None: ... + + @property + def real(self) -> int: ... + @property + def imag(self) -> int: ... + @property + def numerator(self) -> int: ... + @property + def denominator(self) -> int: ... + def conjugate(self) -> int: ... + + def bit_length(self) -> int: ... + if sys.version_info >= (3,): + def to_bytes(self, length: int, byteorder: str, *, signed: bool = ...) -> bytes: ... + @classmethod + def from_bytes(cls, bytes: Sequence[int], byteorder: str, *, + signed: bool = ...) -> int: ... # TODO buffer object argument + + def __add__(self, x: int) -> int: ... + def __sub__(self, x: int) -> int: ... + def __mul__(self, x: int) -> int: ... + def __floordiv__(self, x: int) -> int: ... + if sys.version_info < (3,): + def __div__(self, x: int) -> int: ... + def __truediv__(self, x: int) -> float: ... + def __mod__(self, x: int) -> int: ... + def __divmod__(self, x: int) -> Tuple[int, int]: ... + def __radd__(self, x: int) -> int: ... + def __rsub__(self, x: int) -> int: ... + def __rmul__(self, x: int) -> int: ... + def __rfloordiv__(self, x: int) -> int: ... + if sys.version_info < (3,): + def __rdiv__(self, x: int) -> int: ... + def __rtruediv__(self, x: int) -> float: ... + def __rmod__(self, x: int) -> int: ... + def __rdivmod__(self, x: int) -> Tuple[int, int]: ... + def __pow__(self, x: int) -> Any: ... # Return type can be int or float, depending on x. + def __rpow__(self, x: int) -> Any: ... + def __and__(self, n: int) -> int: ... + def __or__(self, n: int) -> int: ... + def __xor__(self, n: int) -> int: ... + def __lshift__(self, n: int) -> int: ... + def __rshift__(self, n: int) -> int: ... + def __rand__(self, n: int) -> int: ... + def __ror__(self, n: int) -> int: ... + def __rxor__(self, n: int) -> int: ... + def __rlshift__(self, n: int) -> int: ... + def __rrshift__(self, n: int) -> int: ... + def __neg__(self) -> int: ... + def __pos__(self) -> int: ... + def __invert__(self) -> int: ... + if sys.version_info >= (3,): + def __round__(self, ndigits: Optional[int] = ...) -> int: ... + def __getnewargs__(self) -> Tuple[int]: ... + + def __eq__(self, x: object) -> bool: ... + def __ne__(self, x: object) -> bool: ... + def __lt__(self, x: int) -> bool: ... + def __le__(self, x: int) -> bool: ... + def __gt__(self, x: int) -> bool: ... + def __ge__(self, x: int) -> bool: ... + + def __str__(self) -> str: ... + def __float__(self) -> float: ... + def __int__(self) -> int: ... + def __abs__(self) -> int: ... + def __hash__(self) -> int: ... + if sys.version_info >= (3,): + def __bool__(self) -> bool: ... + else: + def __nonzero__(self) -> bool: ... + def __index__(self) -> int: ... + +class float: + def __init__(self, x: Union[SupportsFloat, Text, bytes, bytearray] = ...) -> None: ... + def as_integer_ratio(self) -> Tuple[int, int]: ... + def hex(self) -> str: ... + def is_integer(self) -> bool: ... + @classmethod + def fromhex(cls, s: str) -> float: ... + + @property + def real(self) -> float: ... + @property + def imag(self) -> float: ... + def conjugate(self) -> float: ... + + def __add__(self, x: float) -> float: ... + def __sub__(self, x: float) -> float: ... + def __mul__(self, x: float) -> float: ... + def __floordiv__(self, x: float) -> float: ... + if sys.version_info < (3,): + def __div__(self, x: float) -> float: ... + def __truediv__(self, x: float) -> float: ... + def __mod__(self, x: float) -> float: ... + def __divmod__(self, x: float) -> Tuple[float, float]: ... + def __pow__(self, x: float) -> float: ... # In Python 3, returns complex if self is negative and x is not whole + def __radd__(self, x: float) -> float: ... + def __rsub__(self, x: float) -> float: ... + def __rmul__(self, x: float) -> float: ... + def __rfloordiv__(self, x: float) -> float: ... + if sys.version_info < (3,): + def __rdiv__(self, x: float) -> float: ... + def __rtruediv__(self, x: float) -> float: ... + def __rmod__(self, x: float) -> float: ... + def __rdivmod__(self, x: float) -> Tuple[float, float]: ... + def __rpow__(self, x: float) -> float: ... + def __getnewargs__(self) -> Tuple[float]: ... + if sys.version_info >= (3,): + @overload + def __round__(self) -> int: ... + @overload + def __round__(self, ndigits: None) -> int: ... + @overload + def __round__(self, ndigits: int) -> float: ... + + def __eq__(self, x: object) -> bool: ... + def __ne__(self, x: object) -> bool: ... + def __lt__(self, x: float) -> bool: ... + def __le__(self, x: float) -> bool: ... + def __gt__(self, x: float) -> bool: ... + def __ge__(self, x: float) -> bool: ... + def __neg__(self) -> float: ... + def __pos__(self) -> float: ... + + def __str__(self) -> str: ... + def __int__(self) -> int: ... + def __float__(self) -> float: ... + def __abs__(self) -> float: ... + def __hash__(self) -> int: ... + if sys.version_info >= (3,): + def __bool__(self) -> bool: ... + else: + def __nonzero__(self) -> bool: ... + +class complex: + @overload + def __init__(self, re: float = ..., im: float = ...) -> None: ... + @overload + def __init__(self, s: str) -> None: ... + @overload + def __init__(self, s: SupportsComplex) -> None: ... + + @property + def real(self) -> float: ... + @property + def imag(self) -> float: ... + + def conjugate(self) -> complex: ... + + def __add__(self, x: complex) -> complex: ... + def __sub__(self, x: complex) -> complex: ... + def __mul__(self, x: complex) -> complex: ... + def __pow__(self, x: complex) -> complex: ... + if sys.version_info < (3,): + def __div__(self, x: complex) -> complex: ... + def __truediv__(self, x: complex) -> complex: ... + def __radd__(self, x: complex) -> complex: ... + def __rsub__(self, x: complex) -> complex: ... + def __rmul__(self, x: complex) -> complex: ... + def __rpow__(self, x: complex) -> complex: ... + if sys.version_info < (3,): + def __rdiv__(self, x: complex) -> complex: ... + def __rtruediv__(self, x: complex) -> complex: ... + + def __eq__(self, x: object) -> bool: ... + def __ne__(self, x: object) -> bool: ... + def __neg__(self) -> complex: ... + def __pos__(self) -> complex: ... + + def __str__(self) -> str: ... + def __complex__(self) -> complex: ... + def __abs__(self) -> float: ... + def __hash__(self) -> int: ... + if sys.version_info >= (3,): + def __bool__(self) -> bool: ... + else: + def __nonzero__(self) -> bool: ... + +if sys.version_info >= (3,): + _str_base = object +else: + class basestring(metaclass=ABCMeta): ... + + class unicode(basestring, Sequence[unicode]): + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, o: object) -> None: ... + @overload + def __init__(self, o: str, encoding: unicode = ..., errors: unicode = ...) -> None: ... + def capitalize(self) -> unicode: ... + def center(self, width: int, fillchar: unicode = ...) -> unicode: ... + def count(self, x: unicode) -> int: ... + def decode(self, encoding: unicode = ..., errors: unicode = ...) -> unicode: ... + def encode(self, encoding: unicode = ..., errors: unicode = ...) -> str: ... + def endswith(self, suffix: Union[unicode, Tuple[unicode, ...]], start: int = ..., + end: int = ...) -> bool: ... + def expandtabs(self, tabsize: int = ...) -> unicode: ... + def find(self, sub: unicode, start: int = ..., end: int = ...) -> int: ... + def format(self, *args: Any, **kwargs: Any) -> unicode: ... + def index(self, sub: unicode, start: int = ..., end: int = ...) -> int: ... + def isalnum(self) -> bool: ... + def isalpha(self) -> bool: ... + def isdecimal(self) -> bool: ... + def isdigit(self) -> bool: ... + def isidentifier(self) -> bool: ... + def islower(self) -> bool: ... + def isnumeric(self) -> bool: ... + def isprintable(self) -> bool: ... + def isspace(self) -> bool: ... + def istitle(self) -> bool: ... + def isupper(self) -> bool: ... + def join(self, iterable: Iterable[unicode]) -> unicode: ... + def ljust(self, width: int, fillchar: unicode = ...) -> unicode: ... + def lower(self) -> unicode: ... + def lstrip(self, chars: unicode = ...) -> unicode: ... + def partition(self, sep: unicode) -> Tuple[unicode, unicode, unicode]: ... + def replace(self, old: unicode, new: unicode, count: int = ...) -> unicode: ... + def rfind(self, sub: unicode, start: int = ..., end: int = ...) -> int: ... + def rindex(self, sub: unicode, start: int = ..., end: int = ...) -> int: ... + def rjust(self, width: int, fillchar: unicode = ...) -> unicode: ... + def rpartition(self, sep: unicode) -> Tuple[unicode, unicode, unicode]: ... + def rsplit(self, sep: Optional[unicode] = ..., maxsplit: int = ...) -> List[unicode]: ... + def rstrip(self, chars: unicode = ...) -> unicode: ... + def split(self, sep: Optional[unicode] = ..., maxsplit: int = ...) -> List[unicode]: ... + def splitlines(self, keepends: bool = ...) -> List[unicode]: ... + def startswith(self, prefix: Union[unicode, Tuple[unicode, ...]], start: int = ..., + end: int = ...) -> bool: ... + def strip(self, chars: unicode = ...) -> unicode: ... + def swapcase(self) -> unicode: ... + def title(self) -> unicode: ... + def translate(self, table: Union[Dict[int, Any], unicode]) -> unicode: ... + def upper(self) -> unicode: ... + def zfill(self, width: int) -> unicode: ... + + @overload + def __getitem__(self, i: int) -> unicode: ... + @overload + def __getitem__(self, s: slice) -> unicode: ... + def __getslice__(self, start: int, stop: int) -> unicode: ... + def __add__(self, s: unicode) -> unicode: ... + def __mul__(self, n: int) -> unicode: ... + def __rmul__(self, n: int) -> unicode: ... + def __mod__(self, x: Any) -> unicode: ... + def __eq__(self, x: object) -> bool: ... + def __ne__(self, x: object) -> bool: ... + def __lt__(self, x: unicode) -> bool: ... + def __le__(self, x: unicode) -> bool: ... + def __gt__(self, x: unicode) -> bool: ... + def __ge__(self, x: unicode) -> bool: ... + + def __len__(self) -> int: ... + # The argument type is incompatible with Sequence + def __contains__(self, s: Union[unicode, bytes]) -> bool: ... # type: ignore + def __iter__(self) -> Iterator[unicode]: ... + def __str__(self) -> str: ... + def __repr__(self) -> str: ... + def __int__(self) -> int: ... + def __float__(self) -> float: ... + def __hash__(self) -> int: ... + def __getnewargs__(self) -> Tuple[unicode]: ... + + _str_base = basestring + +class str(Sequence[str], _str_base): + if sys.version_info >= (3,): + @overload + def __init__(self, o: object = ...) -> None: ... + @overload + def __init__(self, o: bytes, encoding: str = ..., errors: str = ...) -> None: ... + else: + def __init__(self, o: object = ...) -> None: ... + + def capitalize(self) -> str: ... + if sys.version_info >= (3, 3): + def casefold(self) -> str: ... + def center(self, width: int, fillchar: str = ...) -> str: ... + def count(self, x: Text, __start: Optional[int] = ..., __end: Optional[int] = ...) -> int: ... + if sys.version_info < (3,): + def decode(self, encoding: Text = ..., errors: Text = ...) -> unicode: ... + def encode(self, encoding: Text = ..., errors: Text = ...) -> bytes: ... + if sys.version_info >= (3,): + def endswith(self, suffix: Union[Text, Tuple[Text, ...]], start: Optional[int] = ..., + end: Optional[int] = ...) -> bool: ... + else: + def endswith(self, suffix: Union[Text, Tuple[Text, ...]]) -> bool: ... + def expandtabs(self, tabsize: int = ...) -> str: ... + def find(self, sub: Text, __start: Optional[int] = ..., __end: Optional[int] = ...) -> int: ... + def format(self, *args: Any, **kwargs: Any) -> str: ... + if sys.version_info >= (3,): + def format_map(self, map: Mapping[str, Any]) -> str: ... + def index(self, sub: Text, __start: Optional[int] = ..., __end: Optional[int] = ...) -> int: ... + def isalnum(self) -> bool: ... + def isalpha(self) -> bool: ... + if sys.version_info >= (3, 7): + def isascii(self) -> bool: ... + if sys.version_info >= (3,): + def isdecimal(self) -> bool: ... + def isdigit(self) -> bool: ... + if sys.version_info >= (3,): + def isidentifier(self) -> bool: ... + def islower(self) -> bool: ... + if sys.version_info >= (3,): + def isnumeric(self) -> bool: ... + def isprintable(self) -> bool: ... + def isspace(self) -> bool: ... + def istitle(self) -> bool: ... + def isupper(self) -> bool: ... + if sys.version_info >= (3,): + def join(self, iterable: Iterable[str]) -> str: ... + else: + def join(self, iterable: Iterable[AnyStr]) -> AnyStr: ... + def ljust(self, width: int, fillchar: str = ...) -> str: ... + def lower(self) -> str: ... + if sys.version_info >= (3,): + def lstrip(self, chars: Optional[str] = ...) -> str: ... + def partition(self, sep: str) -> Tuple[str, str, str]: ... + def replace(self, old: str, new: str, count: int = ...) -> str: ... + else: + @overload + def lstrip(self, chars: str = ...) -> str: ... + @overload + def lstrip(self, chars: unicode) -> unicode: ... + @overload + def partition(self, sep: bytearray) -> Tuple[str, bytearray, str]: ... + @overload + def partition(self, sep: str) -> Tuple[str, str, str]: ... + @overload + def partition(self, sep: unicode) -> Tuple[unicode, unicode, unicode]: ... + def replace(self, old: AnyStr, new: AnyStr, count: int = ...) -> AnyStr: ... + def rfind(self, sub: Text, __start: Optional[int] = ..., __end: Optional[int] = ...) -> int: ... + def rindex(self, sub: Text, __start: Optional[int] = ..., __end: Optional[int] = ...) -> int: ... + def rjust(self, width: int, fillchar: str = ...) -> str: ... + if sys.version_info >= (3,): + def rpartition(self, sep: str) -> Tuple[str, str, str]: ... + def rsplit(self, sep: Optional[str] = ..., maxsplit: int = ...) -> List[str]: ... + def rstrip(self, chars: Optional[str] = ...) -> str: ... + def split(self, sep: Optional[str] = ..., maxsplit: int = ...) -> List[str]: ... + else: + @overload + def rpartition(self, sep: bytearray) -> Tuple[str, bytearray, str]: ... + @overload + def rpartition(self, sep: str) -> Tuple[str, str, str]: ... + @overload + def rpartition(self, sep: unicode) -> Tuple[unicode, unicode, unicode]: ... + @overload + def rsplit(self, sep: Optional[str] = ..., maxsplit: int = ...) -> List[str]: ... + @overload + def rsplit(self, sep: unicode, maxsplit: int = ...) -> List[unicode]: ... + @overload + def rstrip(self, chars: str = ...) -> str: ... + @overload + def rstrip(self, chars: unicode) -> unicode: ... + @overload + def split(self, sep: Optional[str] = ..., maxsplit: int = ...) -> List[str]: ... + @overload + def split(self, sep: unicode, maxsplit: int = ...) -> List[unicode]: ... + def splitlines(self, keepends: bool = ...) -> List[str]: ... + if sys.version_info >= (3,): + def startswith(self, prefix: Union[Text, Tuple[Text, ...]], start: Optional[int] = ..., + end: Optional[int] = ...) -> bool: ... + def strip(self, chars: Optional[str] = ...) -> str: ... + else: + def startswith(self, prefix: Union[Text, Tuple[Text, ...]]) -> bool: ... + @overload + def strip(self, chars: str = ...) -> str: ... + @overload + def strip(self, chars: unicode) -> unicode: ... + def swapcase(self) -> str: ... + def title(self) -> str: ... + if sys.version_info >= (3,): + def translate(self, table: Union[Mapping[int, Union[int, str, None]], Sequence[Union[int, str, None]]]) -> str: ... + else: + def translate(self, table: Optional[AnyStr], deletechars: AnyStr = ...) -> AnyStr: ... + def upper(self) -> str: ... + def zfill(self, width: int) -> str: ... + if sys.version_info >= (3,): + @staticmethod + @overload + def maketrans(x: Union[Dict[int, _T], Dict[str, _T], Dict[Union[str, int], _T]]) -> Dict[int, _T]: ... + @staticmethod + @overload + def maketrans(x: str, y: str, z: str = ...) -> Dict[int, Union[int, None]]: ... + + if sys.version_info >= (3,): + def __add__(self, s: str) -> str: ... + else: + def __add__(self, s: AnyStr) -> AnyStr: ... + # Incompatible with Sequence.__contains__ + def __contains__(self, o: Union[str, Text]) -> bool: ... # type: ignore + def __eq__(self, x: object) -> bool: ... + def __ge__(self, x: Text) -> bool: ... + def __getitem__(self, i: Union[int, slice]) -> str: ... + def __gt__(self, x: Text) -> bool: ... + def __hash__(self) -> int: ... + def __iter__(self) -> Iterator[str]: ... + def __le__(self, x: Text) -> bool: ... + def __len__(self) -> int: ... + def __lt__(self, x: Text) -> bool: ... + def __mod__(self, x: Any) -> str: ... + def __mul__(self, n: int) -> str: ... + def __ne__(self, x: object) -> bool: ... + def __repr__(self) -> str: ... + def __rmul__(self, n: int) -> str: ... + def __str__(self) -> str: ... + def __getnewargs__(self) -> Tuple[str]: ... + + if sys.version_info < (3,): + def __getslice__(self, start: int, stop: int) -> str: ... + def __float__(self) -> float: ... + def __int__(self) -> int: ... + +if sys.version_info >= (3,): + class bytes(ByteString): + @overload + def __init__(self, ints: Iterable[int]) -> None: ... + @overload + def __init__(self, string: str, encoding: str, + errors: str = ...) -> None: ... + @overload + def __init__(self, length: int) -> None: ... + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, o: SupportsBytes) -> None: ... + def capitalize(self) -> bytes: ... + def center(self, width: int, fillchar: bytes = ...) -> bytes: ... + def count(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... + def decode(self, encoding: str = ..., errors: str = ...) -> str: ... + def endswith(self, suffix: Union[bytes, Tuple[bytes, ...]]) -> bool: ... + def expandtabs(self, tabsize: int = ...) -> bytes: ... + def find(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... + if sys.version_info >= (3, 5): + def hex(self) -> str: ... + def index(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... + def isalnum(self) -> bool: ... + def isalpha(self) -> bool: ... + if sys.version_info >= (3, 7): + def isascii(self) -> bool: ... + def isdigit(self) -> bool: ... + def islower(self) -> bool: ... + def isspace(self) -> bool: ... + def istitle(self) -> bool: ... + def isupper(self) -> bool: ... + def join(self, iterable: Iterable[Union[ByteString, memoryview]]) -> bytes: ... + def ljust(self, width: int, fillchar: bytes = ...) -> bytes: ... + def lower(self) -> bytes: ... + def lstrip(self, chars: Optional[bytes] = ...) -> bytes: ... + def partition(self, sep: bytes) -> Tuple[bytes, bytes, bytes]: ... + def replace(self, old: bytes, new: bytes, count: int = ...) -> bytes: ... + def rfind(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... + def rindex(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... + def rjust(self, width: int, fillchar: bytes = ...) -> bytes: ... + def rpartition(self, sep: bytes) -> Tuple[bytes, bytes, bytes]: ... + def rsplit(self, sep: Optional[bytes] = ..., maxsplit: int = ...) -> List[bytes]: ... + def rstrip(self, chars: Optional[bytes] = ...) -> bytes: ... + def split(self, sep: Optional[bytes] = ..., maxsplit: int = ...) -> List[bytes]: ... + def splitlines(self, keepends: bool = ...) -> List[bytes]: ... + def startswith( + self, + prefix: Union[bytes, Tuple[bytes, ...]], + start: Optional[int] = ..., + end: Optional[int] = ..., + ) -> bool: ... + def strip(self, chars: Optional[bytes] = ...) -> bytes: ... + def swapcase(self) -> bytes: ... + def title(self) -> bytes: ... + def translate(self, table: Optional[bytes], delete: bytes = ...) -> bytes: ... + def upper(self) -> bytes: ... + def zfill(self, width: int) -> bytes: ... + @classmethod + def fromhex(cls, s: str) -> bytes: ... + @classmethod + def maketrans(cls, frm: bytes, to: bytes) -> bytes: ... + + def __len__(self) -> int: ... + def __iter__(self) -> Iterator[int]: ... + def __str__(self) -> str: ... + def __repr__(self) -> str: ... + def __int__(self) -> int: ... + def __float__(self) -> float: ... + def __hash__(self) -> int: ... + @overload + def __getitem__(self, i: int) -> int: ... + @overload + def __getitem__(self, s: slice) -> bytes: ... + def __add__(self, s: bytes) -> bytes: ... + def __mul__(self, n: int) -> bytes: ... + def __rmul__(self, n: int) -> bytes: ... + if sys.version_info >= (3, 5): + def __mod__(self, value: Any) -> bytes: ... + # Incompatible with Sequence.__contains__ + def __contains__(self, o: Union[int, bytes]) -> bool: ... # type: ignore + def __eq__(self, x: object) -> bool: ... + def __ne__(self, x: object) -> bool: ... + def __lt__(self, x: bytes) -> bool: ... + def __le__(self, x: bytes) -> bool: ... + def __gt__(self, x: bytes) -> bool: ... + def __ge__(self, x: bytes) -> bool: ... + def __getnewargs__(self) -> Tuple[bytes]: ... +else: + bytes = str + +class bytearray(MutableSequence[int], ByteString): + if sys.version_info >= (3,): + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, ints: Iterable[int]) -> None: ... + @overload + def __init__(self, string: Text, encoding: Text, errors: Text = ...) -> None: ... + @overload + def __init__(self, length: int) -> None: ... + else: + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, ints: Iterable[int]) -> None: ... + @overload + def __init__(self, string: str) -> None: ... + @overload + def __init__(self, string: Text, encoding: Text, errors: Text = ...) -> None: ... + @overload + def __init__(self, length: int) -> None: ... + def capitalize(self) -> bytearray: ... + def center(self, width: int, fillchar: bytes = ...) -> bytearray: ... + if sys.version_info >= (3,): + def count(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... + def copy(self) -> bytearray: ... + else: + def count(self, x: str) -> int: ... + def decode(self, encoding: Text = ..., errors: Text = ...) -> str: ... + def endswith(self, suffix: Union[bytes, Tuple[bytes, ...]]) -> bool: ... + def expandtabs(self, tabsize: int = ...) -> bytearray: ... + if sys.version_info >= (3,): + def find(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... + if sys.version_info >= (3, 5): + def hex(self) -> str: ... + def index(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... + else: + def find(self, sub: str, start: int = ..., end: int = ...) -> int: ... + def index(self, sub: str, start: int = ..., end: int = ...) -> int: ... + def insert(self, index: int, object: int) -> None: ... + def isalnum(self) -> bool: ... + def isalpha(self) -> bool: ... + if sys.version_info >= (3, 7): + def isascii(self) -> bool: ... + def isdigit(self) -> bool: ... + def islower(self) -> bool: ... + def isspace(self) -> bool: ... + def istitle(self) -> bool: ... + def isupper(self) -> bool: ... + if sys.version_info >= (3,): + def join(self, iterable: Iterable[Union[ByteString, memoryview]]) -> bytearray: ... + def ljust(self, width: int, fillchar: bytes = ...) -> bytearray: ... + else: + def join(self, iterable: Iterable[str]) -> bytearray: ... + def ljust(self, width: int, fillchar: str = ...) -> bytearray: ... + def lower(self) -> bytearray: ... + def lstrip(self, chars: Optional[bytes] = ...) -> bytearray: ... + def partition(self, sep: bytes) -> Tuple[bytearray, bytearray, bytearray]: ... + def replace(self, old: bytes, new: bytes, count: int = ...) -> bytearray: ... + if sys.version_info >= (3,): + def rfind(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... + def rindex(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... + else: + def rfind(self, sub: bytes, start: int = ..., end: int = ...) -> int: ... + def rindex(self, sub: bytes, start: int = ..., end: int = ...) -> int: ... + def rjust(self, width: int, fillchar: bytes = ...) -> bytearray: ... + def rpartition(self, sep: bytes) -> Tuple[bytearray, bytearray, bytearray]: ... + def rsplit(self, sep: Optional[bytes] = ..., maxsplit: int = ...) -> List[bytearray]: ... + def rstrip(self, chars: Optional[bytes] = ...) -> bytearray: ... + def split(self, sep: Optional[bytes] = ..., maxsplit: int = ...) -> List[bytearray]: ... + def splitlines(self, keepends: bool = ...) -> List[bytearray]: ... + def startswith( + self, + prefix: Union[bytes, Tuple[bytes, ...]], + start: Optional[int] = ..., + end: Optional[int] = ..., + ) -> bool: ... + def strip(self, chars: Optional[bytes] = ...) -> bytearray: ... + def swapcase(self) -> bytearray: ... + def title(self) -> bytearray: ... + if sys.version_info >= (3,): + def translate(self, table: Optional[bytes], delete: bytes = ...) -> bytearray: ... + else: + def translate(self, table: str) -> bytearray: ... + def upper(self) -> bytearray: ... + def zfill(self, width: int) -> bytearray: ... + @staticmethod + def fromhex(s: str) -> bytearray: ... + if sys.version_info >= (3,): + @classmethod + def maketrans(cls, frm: bytes, to: bytes) -> bytes: ... + + def __len__(self) -> int: ... + def __iter__(self) -> Iterator[int]: ... + def __str__(self) -> str: ... + def __repr__(self) -> str: ... + def __int__(self) -> int: ... + def __float__(self) -> float: ... + def __hash__(self) -> int: ... + @overload + def __getitem__(self, i: int) -> int: ... + @overload + def __getitem__(self, s: slice) -> bytearray: ... + @overload + def __setitem__(self, i: int, x: int) -> None: ... + @overload + def __setitem__(self, s: slice, x: Union[Iterable[int], bytes]) -> None: ... + def __delitem__(self, i: Union[int, slice]) -> None: ... + if sys.version_info < (3,): + def __getslice__(self, start: int, stop: int) -> bytearray: ... + def __setslice__(self, start: int, stop: int, x: Union[Sequence[int], str]) -> None: ... + def __delslice__(self, start: int, stop: int) -> None: ... + def __add__(self, s: bytes) -> bytearray: ... + if sys.version_info >= (3,): + def __iadd__(self, s: Iterable[int]) -> bytearray: ... + def __mul__(self, n: int) -> bytearray: ... + if sys.version_info >= (3,): + def __rmul__(self, n: int) -> bytearray: ... + def __imul__(self, n: int) -> bytearray: ... + if sys.version_info >= (3, 5): + def __mod__(self, value: Any) -> bytes: ... + # Incompatible with Sequence.__contains__ + def __contains__(self, o: Union[int, bytes]) -> bool: ... # type: ignore + def __eq__(self, x: object) -> bool: ... + def __ne__(self, x: object) -> bool: ... + def __lt__(self, x: bytes) -> bool: ... + def __le__(self, x: bytes) -> bool: ... + def __gt__(self, x: bytes) -> bool: ... + def __ge__(self, x: bytes) -> bool: ... + +if sys.version_info >= (3,): + _mv_container_type = int +else: + _mv_container_type = str + +class memoryview(Sized, Container[_mv_container_type]): + format: str + itemsize: int + shape: Optional[Tuple[int, ...]] + strides: Optional[Tuple[int, ...]] + suboffsets: Optional[Tuple[int, ...]] + readonly: bool + ndim: int + + if sys.version_info >= (3,): + c_contiguous: bool + f_contiguous: bool + contiguous: bool + def __init__(self, obj: Union[bytes, bytearray, memoryview]) -> None: ... + def __enter__(self) -> memoryview: ... + def __exit__(self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType]) -> bool: ... + else: + def __init__(self, obj: Union[bytes, bytearray, buffer, memoryview]) -> None: ... + + @overload + def __getitem__(self, i: int) -> _mv_container_type: ... + @overload + def __getitem__(self, s: slice) -> memoryview: ... + + def __contains__(self, x: object) -> bool: ... + def __iter__(self) -> Iterator[_mv_container_type]: ... + def __len__(self) -> int: ... + + @overload + def __setitem__(self, i: int, o: bytes) -> None: ... + @overload + def __setitem__(self, s: slice, o: Sequence[bytes]) -> None: ... + @overload + def __setitem__(self, s: slice, o: memoryview) -> None: ... + + def tobytes(self) -> bytes: ... + def tolist(self) -> List[int]: ... + + if sys.version_info >= (3, 5): + def hex(self) -> str: ... + +class bool(int): + def __init__(self, o: object = ...) -> None: ... + @overload + def __and__(self, x: bool) -> bool: ... + @overload + def __and__(self, x: int) -> int: ... + @overload + def __or__(self, x: bool) -> bool: ... + @overload + def __or__(self, x: int) -> int: ... + @overload + def __xor__(self, x: bool) -> bool: ... + @overload + def __xor__(self, x: int) -> int: ... + @overload + def __rand__(self, x: bool) -> bool: ... + @overload + def __rand__(self, x: int) -> int: ... + @overload + def __ror__(self, x: bool) -> bool: ... + @overload + def __ror__(self, x: int) -> int: ... + @overload + def __rxor__(self, x: bool) -> bool: ... + @overload + def __rxor__(self, x: int) -> int: ... + def __getnewargs__(self) -> Tuple[int]: ... + +class slice(object): + start: Optional[int] + step: Optional[int] + stop: Optional[int] + @overload + def __init__(self, stop: Optional[int]) -> None: ... + @overload + def __init__(self, start: Optional[int], stop: Optional[int], step: Optional[int] = ...) -> None: ... + def indices(self, len: int) -> Tuple[int, int, int]: ... + +class tuple(Sequence[_T_co], Generic[_T_co]): + def __new__(cls: Type[_T], iterable: Iterable[_T_co] = ...) -> _T: ... + def __init__(self, iterable: Iterable[_T_co] = ...): ... + def __len__(self) -> int: ... + def __contains__(self, x: object) -> bool: ... + @overload + def __getitem__(self, x: int) -> _T_co: ... + @overload + def __getitem__(self, x: slice) -> Tuple[_T_co, ...]: ... + def __iter__(self) -> Iterator[_T_co]: ... + def __lt__(self, x: Tuple[_T_co, ...]) -> bool: ... + def __le__(self, x: Tuple[_T_co, ...]) -> bool: ... + def __gt__(self, x: Tuple[_T_co, ...]) -> bool: ... + def __ge__(self, x: Tuple[_T_co, ...]) -> bool: ... + def __add__(self, x: Tuple[_T_co, ...]) -> Tuple[_T_co, ...]: ... + def __mul__(self, n: int) -> Tuple[_T_co, ...]: ... + def __rmul__(self, n: int) -> Tuple[_T_co, ...]: ... + def count(self, x: Any) -> int: ... + if sys.version_info >= (3, 5): + def index(self, x: Any, start: int = ..., end: int = ...) -> int: ... + else: + def index(self, x: Any) -> int: ... + +class list(MutableSequence[_T], Generic[_T]): + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, iterable: Iterable[_T]) -> None: ... + if sys.version_info >= (3,): + def clear(self) -> None: ... + def copy(self) -> List[_T]: ... + def append(self, object: _T) -> None: ... + def extend(self, iterable: Iterable[_T]) -> None: ... + def pop(self, index: int = ...) -> _T: ... + def index(self, object: _T, start: int = ..., stop: int = ...) -> int: ... + def count(self, object: _T) -> int: ... + def insert(self, index: int, object: _T) -> None: ... + def remove(self, object: _T) -> None: ... + def reverse(self) -> None: ... + if sys.version_info >= (3,): + def sort(self, *, key: Optional[Callable[[_T], Any]] = ..., reverse: bool = ...) -> None: ... + else: + def sort(self, cmp: Callable[[_T, _T], Any] = ..., key: Callable[[_T], Any] = ..., reverse: bool = ...) -> None: ... + + def __len__(self) -> int: ... + def __iter__(self) -> Iterator[_T]: ... + def __str__(self) -> str: ... + def __hash__(self) -> int: ... + @overload + def __getitem__(self, i: int) -> _T: ... + @overload + def __getitem__(self, s: slice) -> List[_T]: ... + @overload + def __setitem__(self, i: int, o: _T) -> None: ... + @overload + def __setitem__(self, s: slice, o: Iterable[_T]) -> None: ... + def __delitem__(self, i: Union[int, slice]) -> None: ... + if sys.version_info < (3,): + def __getslice__(self, start: int, stop: int) -> List[_T]: ... + def __setslice__(self, start: int, stop: int, o: Sequence[_T]) -> None: ... + def __delslice__(self, start: int, stop: int) -> None: ... + def __add__(self, x: List[_T]) -> List[_T]: ... + def __iadd__(self: _S, x: Iterable[_T]) -> _S: ... + def __mul__(self, n: int) -> List[_T]: ... + def __rmul__(self, n: int) -> List[_T]: ... + if sys.version_info >= (3,): + def __imul__(self: _S, n: int) -> _S: ... + def __contains__(self, o: object) -> bool: ... + def __reversed__(self) -> Iterator[_T]: ... + def __gt__(self, x: List[_T]) -> bool: ... + def __ge__(self, x: List[_T]) -> bool: ... + def __lt__(self, x: List[_T]) -> bool: ... + def __le__(self, x: List[_T]) -> bool: ... + +class dict(MutableMapping[_KT, _VT], Generic[_KT, _VT]): + # NOTE: Keyword arguments are special. If they are used, _KT must include + # str, but we have no way of enforcing it here. + @overload + def __init__(self, **kwargs: _VT) -> None: ... + @overload + def __init__(self, map: Mapping[_KT, _VT], **kwargs: _VT) -> None: ... + @overload + def __init__(self, iterable: Iterable[Tuple[_KT, _VT]], **kwargs: _VT) -> None: ... + + def __new__(cls: Type[_T1], *args: Any, **kwargs: Any) -> _T1: ... + + if sys.version_info < (3,): + def has_key(self, k: _KT) -> bool: ... + def clear(self) -> None: ... + def copy(self) -> Dict[_KT, _VT]: ... + def popitem(self) -> Tuple[_KT, _VT]: ... + def setdefault(self, k: _KT, default: _VT = ...) -> _VT: ... + @overload + def update(self, __m: Mapping[_KT, _VT], **kwargs: _VT) -> None: ... + @overload + def update(self, __m: Iterable[Tuple[_KT, _VT]], **kwargs: _VT) -> None: ... + @overload + def update(self, **kwargs: _VT) -> None: ... + if sys.version_info >= (3,): + def keys(self) -> KeysView[_KT]: ... + def values(self) -> ValuesView[_VT]: ... + def items(self) -> ItemsView[_KT, _VT]: ... + else: + def iterkeys(self) -> Iterator[_KT]: ... + def itervalues(self) -> Iterator[_VT]: ... + def iteritems(self) -> Iterator[Tuple[_KT, _VT]]: ... + def viewkeys(self) -> KeysView[_KT]: ... + def viewvalues(self) -> ValuesView[_VT]: ... + def viewitems(self) -> ItemsView[_KT, _VT]: ... + @staticmethod + @overload + def fromkeys(seq: Iterable[_T]) -> Dict[_T, Any]: ... # TODO: Actually a class method (mypy/issues#328) + @staticmethod + @overload + def fromkeys(seq: Iterable[_T], value: _S) -> Dict[_T, _S]: ... + def __len__(self) -> int: ... + def __getitem__(self, k: _KT) -> _VT: ... + def __setitem__(self, k: _KT, v: _VT) -> None: ... + def __delitem__(self, v: _KT) -> None: ... + def __iter__(self) -> Iterator[_KT]: ... + def __str__(self) -> str: ... + +class set(MutableSet[_T], Generic[_T]): + def __init__(self, iterable: Iterable[_T] = ...) -> None: ... + def add(self, element: _T) -> None: ... + def clear(self) -> None: ... + def copy(self) -> Set[_T]: ... + def difference(self, *s: Iterable[Any]) -> Set[_T]: ... + def difference_update(self, *s: Iterable[Any]) -> None: ... + def discard(self, element: _T) -> None: ... + def intersection(self, *s: Iterable[Any]) -> Set[_T]: ... + def intersection_update(self, *s: Iterable[Any]) -> None: ... + def isdisjoint(self, s: Iterable[Any]) -> bool: ... + def issubset(self, s: Iterable[Any]) -> bool: ... + def issuperset(self, s: Iterable[Any]) -> bool: ... + def pop(self) -> _T: ... + def remove(self, element: _T) -> None: ... + def symmetric_difference(self, s: Iterable[_T]) -> Set[_T]: ... + def symmetric_difference_update(self, s: Iterable[_T]) -> None: ... + def union(self, *s: Iterable[_T]) -> Set[_T]: ... + def update(self, *s: Iterable[_T]) -> None: ... + def __len__(self) -> int: ... + def __contains__(self, o: object) -> bool: ... + def __iter__(self) -> Iterator[_T]: ... + def __str__(self) -> str: ... + def __and__(self, s: AbstractSet[object]) -> Set[_T]: ... + def __iand__(self, s: AbstractSet[object]) -> Set[_T]: ... + def __or__(self, s: AbstractSet[_S]) -> Set[Union[_T, _S]]: ... + def __ior__(self, s: AbstractSet[_S]) -> Set[Union[_T, _S]]: ... + def __sub__(self, s: AbstractSet[object]) -> Set[_T]: ... + def __isub__(self, s: AbstractSet[object]) -> Set[_T]: ... + def __xor__(self, s: AbstractSet[_S]) -> Set[Union[_T, _S]]: ... + def __ixor__(self, s: AbstractSet[_S]) -> Set[Union[_T, _S]]: ... + def __le__(self, s: AbstractSet[object]) -> bool: ... + def __lt__(self, s: AbstractSet[object]) -> bool: ... + def __ge__(self, s: AbstractSet[object]) -> bool: ... + def __gt__(self, s: AbstractSet[object]) -> bool: ... + +class frozenset(AbstractSet[_T], Generic[_T]): + def __init__(self, iterable: Iterable[_T] = ...) -> None: ... + def copy(self) -> FrozenSet[_T]: ... + def difference(self, *s: Iterable[object]) -> FrozenSet[_T]: ... + def intersection(self, *s: Iterable[object]) -> FrozenSet[_T]: ... + def isdisjoint(self, s: Iterable[_T]) -> bool: ... + def issubset(self, s: Iterable[object]) -> bool: ... + def issuperset(self, s: Iterable[object]) -> bool: ... + def symmetric_difference(self, s: Iterable[_T]) -> FrozenSet[_T]: ... + def union(self, *s: Iterable[_T]) -> FrozenSet[_T]: ... + def __len__(self) -> int: ... + def __contains__(self, o: object) -> bool: ... + def __iter__(self) -> Iterator[_T]: ... + def __str__(self) -> str: ... + def __and__(self, s: AbstractSet[_T]) -> FrozenSet[_T]: ... + def __or__(self, s: AbstractSet[_S]) -> FrozenSet[Union[_T, _S]]: ... + def __sub__(self, s: AbstractSet[_T]) -> FrozenSet[_T]: ... + def __xor__(self, s: AbstractSet[_S]) -> FrozenSet[Union[_T, _S]]: ... + def __le__(self, s: AbstractSet[object]) -> bool: ... + def __lt__(self, s: AbstractSet[object]) -> bool: ... + def __ge__(self, s: AbstractSet[object]) -> bool: ... + def __gt__(self, s: AbstractSet[object]) -> bool: ... + +class enumerate(Iterator[Tuple[int, _T]], Generic[_T]): + def __init__(self, iterable: Iterable[_T], start: int = ...) -> None: ... + def __iter__(self) -> Iterator[Tuple[int, _T]]: ... + if sys.version_info >= (3,): + def __next__(self) -> Tuple[int, _T]: ... + else: + def next(self) -> Tuple[int, _T]: ... + +if sys.version_info >= (3,): + class range(Sequence[int]): + start: int + stop: int + step: int + @overload + def __init__(self, stop: int) -> None: ... + @overload + def __init__(self, start: int, stop: int, step: int = ...) -> None: ... + def count(self, value: int) -> int: ... + def index(self, value: int, start: int = ..., stop: Optional[int] = ...) -> int: ... + def __len__(self) -> int: ... + def __contains__(self, o: object) -> bool: ... + def __iter__(self) -> Iterator[int]: ... + @overload + def __getitem__(self, i: int) -> int: ... + @overload + def __getitem__(self, s: slice) -> range: ... + def __repr__(self) -> str: ... + def __reversed__(self) -> Iterator[int]: ... +else: + class xrange(Sized, Iterable[int], Reversible[int]): + @overload + def __init__(self, stop: int) -> None: ... + @overload + def __init__(self, start: int, stop: int, step: int = ...) -> None: ... + def __len__(self) -> int: ... + def __iter__(self) -> Iterator[int]: ... + def __getitem__(self, i: int) -> int: ... + def __reversed__(self) -> Iterator[int]: ... + +class property(object): + def __init__(self, fget: Optional[Callable[[Any], Any]] = ..., + fset: Optional[Callable[[Any, Any], None]] = ..., + fdel: Optional[Callable[[Any], None]] = ..., + doc: Optional[str] = ...) -> None: ... + def getter(self, fget: Callable[[Any], Any]) -> property: ... + def setter(self, fset: Callable[[Any, Any], None]) -> property: ... + def deleter(self, fdel: Callable[[Any], None]) -> property: ... + def __get__(self, obj: Any, type: Optional[type] = ...) -> Any: ... + def __set__(self, obj: Any, value: Any) -> None: ... + def __delete__(self, obj: Any) -> None: ... + def fget(self) -> Any: ... + def fset(self, value: Any) -> None: ... + def fdel(self) -> None: ... + +if sys.version_info < (3,): + long = int + +NotImplemented: Any + +def abs(__n: SupportsAbs[_T]) -> _T: ... +def all(__i: Iterable[object]) -> bool: ... +def any(__i: Iterable[object]) -> bool: ... +if sys.version_info < (3,): + def apply(__func: Callable[..., _T], __args: Optional[Sequence[Any]] = ..., __kwds: Optional[Mapping[str, Any]] = ...) -> _T: ... +if sys.version_info >= (3,): + def ascii(__o: object) -> str: ... + +class _SupportsIndex(Protocol): + def __index__(self) -> int: ... +def bin(__number: Union[int, _SupportsIndex]) -> str: ... + +if sys.version_info >= (3, 7): + def breakpoint(*args: Any, **kws: Any) -> None: ... +def callable(__o: object) -> bool: ... +def chr(__code: int) -> str: ... +if sys.version_info < (3,): + def cmp(__x: Any, __y: Any) -> int: ... + _N1 = TypeVar('_N1', bool, int, float, complex) + def coerce(__x: _N1, __y: _N1) -> Tuple[_N1, _N1]: ... +if sys.version_info >= (3, 6): + # This class is to be exported as PathLike from os, + # but we define it here as _PathLike to avoid import cycle issues. + # See https://github.com/python/typeshed/pull/991#issuecomment-288160993 + class _PathLike(Generic[AnyStr]): + def __fspath__(self) -> AnyStr: ... + def compile(source: Union[str, bytes, mod, AST], filename: Union[str, bytes, _PathLike], mode: str, flags: int = ..., dont_inherit: int = ..., optimize: int = ...) -> Any: ... +elif sys.version_info >= (3,): + def compile(source: Union[str, bytes, mod, AST], filename: Union[str, bytes], mode: str, flags: int = ..., dont_inherit: int = ..., optimize: int = ...) -> Any: ... +else: + def compile(source: Union[Text, mod], filename: Text, mode: Text, flags: int = ..., dont_inherit: int = ...) -> Any: ... +if sys.version_info >= (3,): + def copyright() -> None: ... + def credits() -> None: ... +def delattr(__o: Any, __name: Text) -> None: ... +def dir(__o: object = ...) -> List[str]: ... +_N2 = TypeVar('_N2', int, float) +def divmod(__a: _N2, __b: _N2) -> Tuple[_N2, _N2]: ... +def eval(__source: Union[Text, bytes, CodeType], __globals: Optional[Dict[str, Any]] = ..., __locals: Optional[Mapping[str, Any]] = ...) -> Any: ... +if sys.version_info >= (3,): + def exec(__object: Union[str, bytes, CodeType], __globals: Optional[Dict[str, Any]] = ..., __locals: Optional[Mapping[str, Any]] = ...) -> Any: ... +else: + def execfile(__filename: str, __globals: Optional[Dict[str, Any]] = ..., __locals: Optional[Dict[str, Any]] = ...) -> None: ... +def exit(code: object = ...) -> NoReturn: ... +if sys.version_info >= (3,): + @overload + def filter(__function: None, __iterable: Iterable[Optional[_T]]) -> Iterator[_T]: ... + @overload + def filter(__function: Callable[[_T], Any], __iterable: Iterable[_T]) -> Iterator[_T]: ... +else: + @overload + def filter(__function: Callable[[AnyStr], Any], # type: ignore + __iterable: AnyStr) -> AnyStr: ... + @overload + def filter(__function: None, # type: ignore + __iterable: Tuple[Optional[_T], ...]) -> Tuple[_T, ...]: ... + @overload + def filter(__function: Callable[[_T], Any], # type: ignore + __iterable: Tuple[_T, ...]) -> Tuple[_T, ...]: ... + @overload + def filter(__function: None, + __iterable: Iterable[Optional[_T]]) -> List[_T]: ... + @overload + def filter(__function: Callable[[_T], Any], + __iterable: Iterable[_T]) -> List[_T]: ... +def format(__o: object, __format_spec: str = ...) -> str: ... # TODO unicode +def getattr(__o: Any, name: Text, __default: Any = ...) -> Any: ... +def globals() -> Dict[str, Any]: ... +def hasattr(__o: Any, __name: Text) -> bool: ... +def hash(__o: object) -> int: ... +if sys.version_info >= (3,): + def help(*args: Any, **kwds: Any) -> None: ... +def hex(__i: Union[int, _SupportsIndex]) -> str: ... +def id(__o: object) -> int: ... +if sys.version_info >= (3,): + def input(__prompt: Any = ...) -> str: ... +else: + def input(__prompt: Any = ...) -> Any: ... + def intern(__string: str) -> str: ... +@overload +def iter(__iterable: Iterable[_T]) -> Iterator[_T]: ... +@overload +def iter(__function: Callable[[], _T], __sentinel: _T) -> Iterator[_T]: ... +def isinstance(__o: object, __t: Union[type, Tuple[Union[type, Tuple], ...]]) -> bool: ... +def issubclass(__cls: type, __classinfo: Union[type, Tuple[Union[type, Tuple], ...]]) -> bool: ... +def len(__o: Sized) -> int: ... +if sys.version_info >= (3,): + def license() -> None: ... +def locals() -> Dict[str, Any]: ... +if sys.version_info >= (3,): + @overload + def map(__func: Callable[[_T1], _S], __iter1: Iterable[_T1]) -> Iterator[_S]: ... + @overload + def map(__func: Callable[[_T1, _T2], _S], __iter1: Iterable[_T1], + __iter2: Iterable[_T2]) -> Iterator[_S]: ... + @overload + def map(__func: Callable[[_T1, _T2, _T3], _S], + __iter1: Iterable[_T1], + __iter2: Iterable[_T2], + __iter3: Iterable[_T3]) -> Iterator[_S]: ... + @overload + def map(__func: Callable[[_T1, _T2, _T3, _T4], _S], + __iter1: Iterable[_T1], + __iter2: Iterable[_T2], + __iter3: Iterable[_T3], + __iter4: Iterable[_T4]) -> Iterator[_S]: ... + @overload + def map(__func: Callable[[_T1, _T2, _T3, _T4, _T5], _S], + __iter1: Iterable[_T1], + __iter2: Iterable[_T2], + __iter3: Iterable[_T3], + __iter4: Iterable[_T4], + __iter5: Iterable[_T5]) -> Iterator[_S]: ... + @overload + def map(__func: Callable[..., _S], + __iter1: Iterable[Any], + __iter2: Iterable[Any], + __iter3: Iterable[Any], + __iter4: Iterable[Any], + __iter5: Iterable[Any], + __iter6: Iterable[Any], + *iterables: Iterable[Any]) -> Iterator[_S]: ... +else: + @overload + def map(__func: None, __iter1: Iterable[_T1]) -> List[_T1]: ... + @overload + def map(__func: None, + __iter1: Iterable[_T1], + __iter2: Iterable[_T2]) -> List[Tuple[_T1, _T2]]: ... + @overload + def map(__func: None, + __iter1: Iterable[_T1], + __iter2: Iterable[_T2], + __iter3: Iterable[_T3]) -> List[Tuple[_T1, _T2, _T3]]: ... + @overload + def map(__func: None, + __iter1: Iterable[_T1], + __iter2: Iterable[_T2], + __iter3: Iterable[_T3], + __iter4: Iterable[_T4]) -> List[Tuple[_T1, _T2, _T3, _T4]]: ... + @overload + def map(__func: None, + __iter1: Iterable[_T1], + __iter2: Iterable[_T2], + __iter3: Iterable[_T3], + __iter4: Iterable[_T4], + __iter5: Iterable[_T5]) -> List[Tuple[_T1, _T2, _T3, _T4, _T5]]: ... + @overload + def map(__func: None, + __iter1: Iterable[Any], + __iter2: Iterable[Any], + __iter3: Iterable[Any], + __iter4: Iterable[Any], + __iter5: Iterable[Any], + __iter6: Iterable[Any], + *iterables: Iterable[Any]) -> List[Tuple[Any, ...]]: ... + @overload + def map(__func: Callable[[_T1], _S], __iter1: Iterable[_T1]) -> List[_S]: ... + @overload + def map(__func: Callable[[_T1, _T2], _S], + __iter1: Iterable[_T1], + __iter2: Iterable[_T2]) -> List[_S]: ... + @overload + def map(__func: Callable[[_T1, _T2, _T3], _S], + __iter1: Iterable[_T1], + __iter2: Iterable[_T2], + __iter3: Iterable[_T3]) -> List[_S]: ... + @overload + def map(__func: Callable[[_T1, _T2, _T3, _T4], _S], + __iter1: Iterable[_T1], + __iter2: Iterable[_T2], + __iter3: Iterable[_T3], + __iter4: Iterable[_T4]) -> List[_S]: ... + @overload + def map(__func: Callable[[_T1, _T2, _T3, _T4, _T5], _S], + __iter1: Iterable[_T1], + __iter2: Iterable[_T2], + __iter3: Iterable[_T3], + __iter4: Iterable[_T4], + __iter5: Iterable[_T5]) -> List[_S]: ... + @overload + def map(__func: Callable[..., _S], + __iter1: Iterable[Any], + __iter2: Iterable[Any], + __iter3: Iterable[Any], + __iter4: Iterable[Any], + __iter5: Iterable[Any], + __iter6: Iterable[Any], + *iterables: Iterable[Any]) -> List[_S]: ... +if sys.version_info >= (3,): + @overload + def max(__arg1: _T, __arg2: _T, *_args: _T, key: Callable[[_T], Any] = ...) -> _T: ... + @overload + def max(__iterable: Iterable[_T], *, key: Callable[[_T], Any] = ...) -> _T: ... + @overload + def max(__iterable: Iterable[_T], *, key: Callable[[_T], Any] = ..., default: _VT) -> Union[_T, _VT]: ... +else: + @overload + def max(__arg1: _T, __arg2: _T, *_args: _T, key: Callable[[_T], Any] = ...) -> _T: ... + @overload + def max(__iterable: Iterable[_T], *, key: Callable[[_T], Any] = ...) -> _T: ... +if sys.version_info >= (3,): + @overload + def min(__arg1: _T, __arg2: _T, *_args: _T, key: Callable[[_T], Any] = ...) -> _T: ... + @overload + def min(__iterable: Iterable[_T], *, key: Callable[[_T], Any] = ...) -> _T: ... + @overload + def min(__iterable: Iterable[_T], *, key: Callable[[_T], Any] = ..., default: _VT) -> Union[_T, _VT]: ... +else: + @overload + def min(__arg1: _T, __arg2: _T, *_args: _T, key: Callable[[_T], Any] = ...) -> _T: ... + @overload + def min(__iterable: Iterable[_T], *, key: Callable[[_T], Any] = ...) -> _T: ... +@overload +def next(__i: Iterator[_T]) -> _T: ... +@overload +def next(__i: Iterator[_T], default: _VT) -> Union[_T, _VT]: ... +def oct(__i: Union[int, _SupportsIndex]) -> str: ... + +if sys.version_info >= (3, 6): + def open(file: Union[str, bytes, int, _PathLike], mode: str = ..., buffering: int = ..., encoding: Optional[str] = ..., + errors: Optional[str] = ..., newline: Optional[str] = ..., closefd: bool = ..., + opener: Optional[Callable[[str, int], int]] = ...) -> IO[Any]: ... +elif sys.version_info >= (3,): + def open(file: Union[str, bytes, int], mode: str = ..., buffering: int = ..., encoding: Optional[str] = ..., + errors: Optional[str] = ..., newline: Optional[str] = ..., closefd: bool = ..., + opener: Optional[Callable[[str, int], int]] = ...) -> IO[Any]: ... +else: + def open(name: Union[unicode, int], mode: unicode = ..., buffering: int = ...) -> BinaryIO: ... + +def ord(__c: Union[Text, bytes]) -> int: ... +if sys.version_info >= (3,): + class _Writer(Protocol): + def write(self, __s: str) -> Any: ... + def print(*values: object, sep: Text = ..., end: Text = ..., file: Optional[_Writer] = ..., flush: bool = ...) -> None: ... +else: + class _Writer(Protocol): + def write(self, __s: Any) -> Any: ... + # This is only available after from __future__ import print_function. + def print(*values: object, sep: Text = ..., end: Text = ..., file: Optional[_Writer] = ...) -> None: ... +@overload +def pow(__x: int, __y: int) -> Any: ... # The return type can be int or float, depending on y +@overload +def pow(__x: int, __y: int, __z: int) -> Any: ... +@overload +def pow(__x: float, __y: float) -> float: ... +@overload +def pow(__x: float, __y: float, __z: float) -> float: ... +def quit(code: object = ...) -> NoReturn: ... +if sys.version_info < (3,): + def range(__x: int, __y: int = ..., __step: int = ...) -> List[int]: ... + def raw_input(__prompt: Any = ...) -> str: ... + @overload + def reduce(__function: Callable[[_T, _S], _T], __iterable: Iterable[_S], __initializer: _T) -> _T: ... + @overload + def reduce(__function: Callable[[_T, _T], _T], __iterable: Iterable[_T]) -> _T: ... + def reload(__module: Any) -> Any: ... +@overload +def reversed(__object: Sequence[_T]) -> Iterator[_T]: ... +@overload +def reversed(__object: Reversible[_T]) -> Iterator[_T]: ... +def repr(__o: object) -> str: ... +if sys.version_info >= (3,): + @overload + def round(number: float) -> int: ... + @overload + def round(number: float, ndigits: None) -> int: ... + @overload + def round(number: float, ndigits: int) -> float: ... + @overload + def round(number: SupportsRound[_T]) -> int: ... + @overload + def round(number: SupportsRound[_T], ndigits: None) -> int: ... # type: ignore + @overload + def round(number: SupportsRound[_T], ndigits: int) -> _T: ... +else: + @overload + def round(number: float) -> float: ... + @overload + def round(number: float, ndigits: int) -> float: ... + @overload + def round(number: SupportsFloat) -> float: ... + @overload + def round(number: SupportsFloat, ndigits: int) -> float: ... +def setattr(__object: Any, __name: Text, __value: Any) -> None: ... +if sys.version_info >= (3,): + def sorted(__iterable: Iterable[_T], *, + key: Optional[Callable[[_T], Any]] = ..., + reverse: bool = ...) -> List[_T]: ... +else: + def sorted(__iterable: Iterable[_T], *, + cmp: Callable[[_T, _T], int] = ..., + key: Callable[[_T], Any] = ..., + reverse: bool = ...) -> List[_T]: ... +@overload +def sum(__iterable: Iterable[_T]) -> Union[_T, int]: ... +@overload +def sum(__iterable: Iterable[_T], __start: _S) -> Union[_T, _S]: ... +if sys.version_info < (3,): + def unichr(__i: int) -> unicode: ... +def vars(__object: Any = ...) -> Dict[str, Any]: ... +if sys.version_info >= (3,): + @overload + def zip(__iter1: Iterable[_T1]) -> Iterator[Tuple[_T1]]: ... + @overload + def zip(__iter1: Iterable[_T1], __iter2: Iterable[_T2]) -> Iterator[Tuple[_T1, _T2]]: ... + @overload + def zip(__iter1: Iterable[_T1], __iter2: Iterable[_T2], + __iter3: Iterable[_T3]) -> Iterator[Tuple[_T1, _T2, _T3]]: ... + @overload + def zip(__iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3], + __iter4: Iterable[_T4]) -> Iterator[Tuple[_T1, _T2, _T3, _T4]]: ... + @overload + def zip(__iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3], + __iter4: Iterable[_T4], __iter5: Iterable[_T5]) -> Iterator[Tuple[_T1, _T2, _T3, _T4, _T5]]: ... + @overload + def zip(__iter1: Iterable[Any], __iter2: Iterable[Any], __iter3: Iterable[Any], + __iter4: Iterable[Any], __iter5: Iterable[Any], __iter6: Iterable[Any], + *iterables: Iterable[Any]) -> Iterator[Tuple[Any, ...]]: ... +else: + @overload + def zip(__iter1: Iterable[_T1]) -> List[Tuple[_T1]]: ... + @overload + def zip(__iter1: Iterable[_T1], + __iter2: Iterable[_T2]) -> List[Tuple[_T1, _T2]]: ... + @overload + def zip(__iter1: Iterable[_T1], __iter2: Iterable[_T2], + __iter3: Iterable[_T3]) -> List[Tuple[_T1, _T2, _T3]]: ... + @overload + def zip(__iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3], + __iter4: Iterable[_T4]) -> List[Tuple[_T1, _T2, _T3, _T4]]: ... + @overload + def zip(__iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3], + __iter4: Iterable[_T4], __iter5: Iterable[_T5]) -> List[Tuple[_T1, _T2, _T3, _T4, _T5]]: ... + @overload + def zip(__iter1: Iterable[Any], __iter2: Iterable[Any], __iter3: Iterable[Any], + __iter4: Iterable[Any], __iter5: Iterable[Any], __iter6: Iterable[Any], + *iterables: Iterable[Any]) -> List[Tuple[Any, ...]]: ... +def __import__(name: Text, globals: Dict[str, Any] = ..., locals: Dict[str, Any] = ..., + fromlist: List[str] = ..., level: int = ...) -> Any: ... + +# Actually the type of Ellipsis is , but since it's +# not exposed anywhere under that name, we make it private here. +class ellipsis: ... +Ellipsis: ellipsis + +if sys.version_info < (3,): + # TODO: buffer support is incomplete; e.g. some_string.startswith(some_buffer) doesn't type check. + _AnyBuffer = TypeVar('_AnyBuffer', str, unicode, bytearray, buffer) + + class buffer(Sized): + def __init__(self, object: _AnyBuffer, offset: int = ..., size: int = ...) -> None: ... + def __add__(self, other: _AnyBuffer) -> str: ... + def __cmp__(self, other: _AnyBuffer) -> bool: ... + def __getitem__(self, key: Union[int, slice]) -> str: ... + def __getslice__(self, i: int, j: int) -> str: ... + def __len__(self) -> int: ... + def __mul__(self, x: int) -> str: ... + +class BaseException(object): + args: Tuple[Any, ...] + if sys.version_info < (3,): + message: Any + if sys.version_info >= (3,): + __cause__: Optional[BaseException] + __context__: Optional[BaseException] + __suppress_context__: bool + __traceback__: Optional[TracebackType] + def __init__(self, *args: object) -> None: ... + if sys.version_info < (3,): + def __getitem__(self, i: int) -> Any: ... + def __getslice__(self, start: int, stop: int) -> Tuple[Any, ...]: ... + if sys.version_info >= (3,): + def with_traceback(self, tb: Optional[TracebackType]) -> BaseException: ... + +class GeneratorExit(BaseException): ... +class KeyboardInterrupt(BaseException): ... +class SystemExit(BaseException): + code: int +class Exception(BaseException): ... +class StopIteration(Exception): + if sys.version_info >= (3,): + value: Any +if sys.version_info >= (3,): + _StandardError = Exception + class OSError(Exception): + errno: int + strerror: str + # filename, filename2 are actually Union[str, bytes, None] + filename: Any + filename2: Any + EnvironmentError = OSError + IOError = OSError +else: + class StandardError(Exception): ... + _StandardError = StandardError + class EnvironmentError(StandardError): + errno: int + strerror: str + # TODO can this be unicode? + filename: str + class OSError(EnvironmentError): ... + class IOError(EnvironmentError): ... + +class ArithmeticError(_StandardError): ... +class AssertionError(_StandardError): ... +class AttributeError(_StandardError): ... +class BufferError(_StandardError): ... +class EOFError(_StandardError): ... +class ImportError(_StandardError): + if sys.version_info >= (3,): + name: str + path: str +class LookupError(_StandardError): ... +class MemoryError(_StandardError): ... +class NameError(_StandardError): ... +class ReferenceError(_StandardError): ... +class RuntimeError(_StandardError): ... +if sys.version_info >= (3, 5): + class StopAsyncIteration(Exception): + value: Any +class SyntaxError(_StandardError): + msg: str + lineno: int + offset: Optional[int] + text: str + filename: str +class SystemError(_StandardError): ... +class TypeError(_StandardError): ... +class ValueError(_StandardError): ... + +class FloatingPointError(ArithmeticError): ... +class OverflowError(ArithmeticError): ... +class ZeroDivisionError(ArithmeticError): ... + +if sys.version_info >= (3, 6): + class ModuleNotFoundError(ImportError): ... + +class IndexError(LookupError): ... +class KeyError(LookupError): ... + +class UnboundLocalError(NameError): ... + +class WindowsError(OSError): + winerror: int +if sys.version_info >= (3,): + class BlockingIOError(OSError): + characters_written: int + class ChildProcessError(OSError): ... + class ConnectionError(OSError): ... + class BrokenPipeError(ConnectionError): ... + class ConnectionAbortedError(ConnectionError): ... + class ConnectionRefusedError(ConnectionError): ... + class ConnectionResetError(ConnectionError): ... + class FileExistsError(OSError): ... + class FileNotFoundError(OSError): ... + class InterruptedError(OSError): ... + class IsADirectoryError(OSError): ... + class NotADirectoryError(OSError): ... + class PermissionError(OSError): ... + class ProcessLookupError(OSError): ... + class TimeoutError(OSError): ... + +class NotImplementedError(RuntimeError): ... +if sys.version_info >= (3, 5): + class RecursionError(RuntimeError): ... + +class IndentationError(SyntaxError): ... +class TabError(IndentationError): ... + +class UnicodeError(ValueError): ... +class UnicodeDecodeError(UnicodeError): + encoding: str + object: bytes + start: int + end: int + reason: str + def __init__(self, __encoding: str, __object: bytes, __start: int, __end: int, + __reason: str) -> None: ... +class UnicodeEncodeError(UnicodeError): + encoding: str + object: Text + start: int + end: int + reason: str + def __init__(self, __encoding: str, __object: Text, __start: int, __end: int, + __reason: str) -> None: ... +class UnicodeTranslateError(UnicodeError): ... + +class Warning(Exception): ... +class UserWarning(Warning): ... +class DeprecationWarning(Warning): ... +class SyntaxWarning(Warning): ... +class RuntimeWarning(Warning): ... +class FutureWarning(Warning): ... +class PendingDeprecationWarning(Warning): ... +class ImportWarning(Warning): ... +class UnicodeWarning(Warning): ... +class BytesWarning(Warning): ... +if sys.version_info >= (3, 2): + class ResourceWarning(Warning): ... + +if sys.version_info < (3,): + class file(BinaryIO): + @overload + def __init__(self, file: str, mode: str = ..., buffering: int = ...) -> None: ... + @overload + def __init__(self, file: unicode, mode: str = ..., buffering: int = ...) -> None: ... + @overload + def __init__(self, file: int, mode: str = ..., buffering: int = ...) -> None: ... + def __iter__(self) -> Iterator[str]: ... + def next(self) -> str: ... + def read(self, n: int = ...) -> str: ... + def __enter__(self) -> BinaryIO: ... + def __exit__(self, t: Optional[type] = ..., exc: Optional[BaseException] = ..., tb: Optional[Any] = ...) -> bool: ... + def flush(self) -> None: ... + def fileno(self) -> int: ... + def isatty(self) -> bool: ... + def close(self) -> None: ... + + def readable(self) -> bool: ... + def writable(self) -> bool: ... + def seekable(self) -> bool: ... + def seek(self, offset: int, whence: int = ...) -> int: ... + def tell(self) -> int: ... + def readline(self, limit: int = ...) -> str: ... + def readlines(self, hint: int = ...) -> List[str]: ... + def write(self, data: str) -> int: ... + def writelines(self, data: Iterable[str]) -> None: ... + def truncate(self, pos: Optional[int] = ...) -> int: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/bz2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/bz2.pyi new file mode 100644 index 0000000..2cb329c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/bz2.pyi @@ -0,0 +1,48 @@ +import io +import sys +from typing import Any, IO, Optional, Union + +if sys.version_info >= (3, 6): + from os import PathLike + _PathOrFile = Union[str, bytes, IO[Any], PathLike[Any]] +elif sys.version_info >= (3, 3): + _PathOrFile = Union[str, bytes, IO[Any]] +else: + _PathOrFile = str + +def compress(data: bytes, compresslevel: int = ...) -> bytes: ... +def decompress(data: bytes) -> bytes: ... + +if sys.version_info >= (3, 3): + def open(filename: _PathOrFile, + mode: str = ..., + compresslevel: int = ..., + encoding: Optional[str] = ..., + errors: Optional[str] = ..., + newline: Optional[str] = ...) -> IO[Any]: ... + +class BZ2File(io.BufferedIOBase, IO[bytes]): # type: ignore # python/mypy#5027 + def __init__(self, + filename: _PathOrFile, + mode: str = ..., + buffering: Optional[Any] = ..., + compresslevel: int = ...) -> None: ... + +class BZ2Compressor(object): + def __init__(self, compresslevel: int = ...) -> None: ... + def compress(self, data: bytes) -> bytes: ... + def flush(self) -> bytes: ... + +class BZ2Decompressor(object): + if sys.version_info >= (3, 5): + def decompress(self, data: bytes, max_length: int = ...) -> bytes: ... + else: + def decompress(self, data: bytes) -> bytes: ... + if sys.version_info >= (3, 3): + @property + def eof(self) -> bool: ... + if sys.version_info >= (3, 5): + @property + def needs_input(self) -> bool: ... + @property + def unused_data(self) -> bytes: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/cProfile.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/cProfile.pyi new file mode 100644 index 0000000..71e25ed --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/cProfile.pyi @@ -0,0 +1,24 @@ +import os +import sys +from typing import Any, Callable, Dict, Optional, Text, TypeVar, Union + +def run(statement: str, filename: Optional[str] = ..., sort: Union[str, int] = ...) -> None: ... +def runctx(statement: str, globals: Dict[str, Any], locals: Dict[str, Any], filename: Optional[str] = ..., sort: Union[str, int] = ...) -> None: ... + +_SelfT = TypeVar('_SelfT', bound='Profile') +_T = TypeVar('_T') +if sys.version_info >= (3, 6): + _Path = Union[bytes, Text, os.PathLike[Any]] +else: + _Path = Union[bytes, Text] + +class Profile: + def __init__(self, custom_timer: Callable[[], float] = ..., time_unit: float = ..., subcalls: bool = ..., builtins: bool = ...) -> None: ... + def enable(self) -> None: ... + def disable(self) -> None: ... + def print_stats(self, sort: Union[str, int] = ...) -> None: ... + def dump_stats(self, file: _Path) -> None: ... + def create_stats(self) -> None: ... + def run(self: _SelfT, cmd: str) -> _SelfT: ... + def runctx(self: _SelfT, cmd: str, globals: Dict[str, Any], locals: Dict[str, Any]) -> _SelfT: ... + def runcall(self, func: Callable[..., _T], *args: Any, **kw: Any) -> _T: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/calendar.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/calendar.pyi new file mode 100644 index 0000000..4b452cc --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/calendar.pyi @@ -0,0 +1,122 @@ +import datetime +import sys +from time import struct_time +from typing import Any, Iterable, List, Optional, Sequence, Tuple, Union + + +_LocaleType = Tuple[Optional[str], Optional[str]] + +class IllegalMonthError(ValueError): + def __init__(self, month: int) -> None: ... + def __str__(self) -> str: ... + +class IllegalWeekdayError(ValueError): + def __init__(self, weekday: int) -> None: ... + def __str__(self) -> str: ... + +def isleap(year: int) -> bool: ... +def leapdays(y1: int, y2: int) -> int: ... +def weekday(year: int, month: int, day: int) -> int: ... +def monthrange(year: int, month: int) -> Tuple[int, int]: ... + +class Calendar: + def __init__(self, firstweekday: int = ...) -> None: ... + def getfirstweekday(self) -> int: ... + def setfirstweekday(self, firstweekday: int) -> None: ... + def iterweekdays(self) -> Iterable[int]: ... + def itermonthdates(self, year: int, month: int) -> Iterable[datetime.date]: ... + def itermonthdays2(self, year: int, month: int) -> Iterable[Tuple[int, int]]: ... + def itermonthdays(self, year: int, month: int) -> Iterable[int]: ... + def monthdatescalendar(self, year: int, month: int) -> List[List[datetime.date]]: ... + def monthdays2calendar(self, year: int, month: int) -> List[List[Tuple[int, int]]]: ... + def monthdayscalendar(self, year: int, month: int) -> List[List[int]]: ... + def yeardatescalendar(self, year: int, width: int = ...) -> List[List[int]]: ... + def yeardays2calendar(self, year: int, width: int = ...) -> List[List[Tuple[int, int]]]: ... + def yeardayscalendar(self, year: int, width: int = ...) -> List[List[int]]: ... + if sys.version_info >= (3, 7): + def itermonthdays3(self, year: int, month: int) -> Iterable[Tuple[int, int, int]]: ... + def itermonthdays4(self, year: int, month: int) -> Iterable[Tuple[int, int, int, int]]: ... + +class TextCalendar(Calendar): + def prweek(self, theweek: int, width: int) -> None: ... + def formatday(self, day: int, weekday: int, width: int) -> str: ... + def formatweek(self, theweek: int, width: int) -> str: ... + def formatweekday(self, day: int, width: int) -> str: ... + def formatweekheader(self, width: int) -> str: ... + def formatmonthname(self, theyear: int, themonth: int, width: int, withyear: bool = ...) -> str: ... + def prmonth(self, theyear: int, themonth: int, w: int = ..., l: int = ...) -> None: ... + def formatmonth(self, theyear: int, themonth: int, w: int = ..., l: int = ...) -> str: ... + def formatyear(self, theyear: int, w: int = ..., l: int = ..., c: int = ..., m: int = ...) -> str: ... + def pryear(self, theyear: int, w: int = ..., l: int = ..., c: int = ..., m: int = ...) -> None: ... + +def firstweekday() -> int: ... +def monthcalendar(year: int, month: int) -> List[List[int]]: ... +def prweek(theweek: int, width: int) -> None: ... +def week(theweek: int, width: int) -> str: ... +def weekheader(width: int) -> str: ... +def prmonth(theyear: int, themonth: int, w: int = ..., l: int = ...) -> None: ... +def month(theyear: int, themonth: int, w: int = ..., l: int = ...) -> str: ... +def calendar(theyear: int, w: int = ..., l: int = ..., c: int = ..., m: int = ...) -> str: ... +def prcal(theyear: int, w: int = ..., l: int = ..., c: int = ..., m: int = ...) -> None: ... + +class HTMLCalendar(Calendar): + def formatday(self, day: int, weekday: int) -> str: ... + def formatweek(self, theweek: int) -> str: ... + def formatweekday(self, day: int) -> str: ... + def formatweekheader(self) -> str: ... + def formatmonthname(self, theyear: int, themonth: int, withyear: bool = ...) -> str: ... + def formatmonth(self, theyear: int, themonth: int, withyear: bool = ...) -> str: ... + def formatyear(self, theyear: int, width: int = ...) -> str: ... + def formatyearpage(self, theyear: int, width: int = ..., css: Optional[str] = ..., encoding: Optional[str] = ...) -> str: ... + if sys.version_info >= (3, 7): + cssclasses: List[str] + cssclass_noday: str + cssclasses_weekday_head: List[str] + cssclass_month_head: str + cssclass_month: str + cssclass_year: str + cssclass_year_head: str + +if sys.version_info < (3, 0): + class TimeEncoding: + def __init__(self, locale: _LocaleType) -> None: ... + def __enter__(self) -> _LocaleType: ... + def __exit__(self, *args: Any) -> None: ... +else: + class different_locale: + def __init__(self, locale: _LocaleType) -> None: ... + def __enter__(self) -> _LocaleType: ... + def __exit__(self, *args: Any) -> None: ... + +class LocaleTextCalendar(TextCalendar): + def __init__(self, firstweekday: int = ..., locale: Optional[_LocaleType] = ...) -> None: ... + def formatweekday(self, day: int, width: int) -> str: ... + def formatmonthname(self, theyear: int, themonth: int, width: int, withyear: bool = ...) -> str: ... + +class LocaleHTMLCalendar(HTMLCalendar): + def __init__(self, firstweekday: int = ..., locale: Optional[_LocaleType] = ...) -> None: ... + def formatweekday(self, day: int) -> str: ... + def formatmonthname(self, theyear: int, themonth: int, withyear: bool = ...) -> str: ... + +c: TextCalendar +def setfirstweekday(firstweekday: int) -> None: ... +def format(cols: int, colwidth: int = ..., spacing: int = ...) -> str: ... +def formatstring(cols: int, colwidth: int = ..., spacing: int = ...) -> str: ... +def timegm(tuple: Union[Tuple[int, ...], struct_time]) -> int: ... + +# Data attributes +day_name: Sequence[str] +day_abbr: Sequence[str] +month_name: Sequence[str] +month_abbr: Sequence[str] + +# Below constants are not in docs or __all__, but enough people have used them +# they are now effectively public. + +MONDAY: int +TUESDAY: int +WEDNESDAY: int +THURSDAY: int +FRIDAY: int +SATURDAY: int +SUNDAY: int diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/cgi.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/cgi.pyi new file mode 100644 index 0000000..02979c0 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/cgi.pyi @@ -0,0 +1,122 @@ +import sys +from typing import Any, AnyStr, Dict, IO, Iterable, List, Mapping, Optional, Tuple, TypeVar, Union + +_T = TypeVar('_T', bound=FieldStorage) + +def parse(fp: IO[Any] = ..., environ: Mapping[str, str] = ..., + keep_blank_values: bool = ..., strict_parsing: bool = ...) -> Dict[str, List[str]]: ... +def parse_qs(qs: str, keep_blank_values: bool = ..., strict_parsing: bool = ...) -> Dict[str, List[str]]: ... +def parse_qsl(qs: str, keep_blank_values: bool = ..., strict_parsing: bool = ...) -> Dict[str, List[str]]: ... +if sys.version_info >= (3, 7): + def parse_multipart(fp: IO[Any], pdict: Mapping[str, bytes], encoding: str = ..., errors: str = ...) -> Dict[str, List[Any]]: ... +else: + def parse_multipart(fp: IO[Any], pdict: Mapping[str, bytes]) -> Dict[str, List[bytes]]: ... +def parse_header(s: str) -> Tuple[str, Dict[str, str]]: ... +def test(environ: Mapping[str, str] = ...) -> None: ... +def print_environ(environ: Mapping[str, str] = ...) -> None: ... +def print_form(form: Dict[str, Any]) -> None: ... +def print_directory() -> None: ... +def print_environ_usage() -> None: ... +if sys.version_info >= (3, 0): + def escape(s: str, quote: bool = ...) -> str: ... +else: + def escape(s: AnyStr, quote: bool = ...) -> AnyStr: ... + + +class MiniFieldStorage: + # The first five "Any" attributes here are always None, but mypy doesn't support that + filename: Any + list: Any + type: Any + file: Optional[IO[bytes]] + type_options: Dict[Any, Any] + disposition: Any + disposition_options: Dict[Any, Any] + headers: Dict[Any, Any] + name: Any + value: Any + + def __init__(self, name: Any, value: Any) -> None: ... + def __repr__(self) -> str: ... + + +class FieldStorage(object): + FieldStorageClass: Optional[type] + keep_blank_values: int + strict_parsing: int + qs_on_post: Optional[str] + headers: Mapping[str, str] + fp: IO[bytes] + encoding: str + errors: str + outerboundary: bytes + bytes_read: int + limit: Optional[int] + disposition: str + disposition_options: Dict[str, str] + filename: Optional[str] + file: Optional[IO[bytes]] + type: str + type_options: Dict[str, str] + innerboundary: bytes + length: int + done: int + list: Optional[List[Any]] + value: Union[None, bytes, List[Any]] + + if sys.version_info >= (3, 0): + def __init__(self, fp: IO[Any] = ..., headers: Mapping[str, str] = ..., outerboundary: bytes = ..., + environ: Mapping[str, str] = ..., keep_blank_values: int = ..., strict_parsing: int = ..., + limit: int = ..., encoding: str = ..., errors: str = ...) -> None: ... + else: + def __init__(self, fp: IO[Any] = ..., headers: Mapping[str, str] = ..., outerboundary: bytes = ..., + environ: Mapping[str, str] = ..., keep_blank_values: int = ..., strict_parsing: int = ...) -> None: ... + + if sys.version_info >= (3, 0): + def __enter__(self: _T) -> _T: ... + def __exit__(self, *args: Any) -> None: ... + def __repr__(self) -> str: ... + def __iter__(self) -> Iterable[str]: ... + def __getitem__(self, key: str) -> Any: ... + def getvalue(self, key: str, default: Any = ...) -> Any: ... + def getfirst(self, key: str, default: Any = ...) -> Any: ... + def getlist(self, key: str) -> List[Any]: ... + def keys(self) -> List[str]: ... + if sys.version_info < (3, 0): + def has_key(self, key: str) -> bool: ... + def __contains__(self, key: str) -> bool: ... + def __len__(self) -> int: ... + if sys.version_info >= (3, 0): + def __bool__(self) -> bool: ... + else: + def __nonzero__(self) -> bool: ... + if sys.version_info >= (3, 0): + # In Python 3 it returns bytes or str IO depending on an internal flag + def make_file(self) -> IO[Any]: ... + else: + # In Python 2 it always returns bytes and ignores the "binary" flag + def make_file(self, binary: Any = ...) -> IO[bytes]: ... + + +if sys.version_info < (3, 0): + from UserDict import UserDict + + class FormContentDict(UserDict): + query_string: str + def __init__(self, environ: Mapping[str, str] = ..., keep_blank_values: int = ..., strict_parsing: int = ...) -> None: ... + + class SvFormContentDict(FormContentDict): + def getlist(self, key: Any) -> Any: ... + + class InterpFormContentDict(SvFormContentDict): ... + + class FormContent(FormContentDict): + # TODO this should have + # def values(self, key: Any) -> Any: ... + # but this is incompatible with the supertype, and adding '# type: ignore' triggers + # a parse error in pytype (https://github.com/google/pytype/issues/53) + def indexed_value(self, key: Any, location: int) -> Any: ... + def value(self, key: Any) -> Any: ... + def length(self, key: Any) -> int: ... + def stripped(self, key: Any) -> Any: ... + def pars(self) -> Dict[Any, Any]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/chunk.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/chunk.pyi new file mode 100644 index 0000000..2337f00 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/chunk.pyi @@ -0,0 +1,23 @@ +# Source(py2): https://hg.python.org/cpython/file/2.7/Lib/chunk.py +# Source(py3): https://github.com/python/cpython/blob/master/Lib/chunk.py + +from typing import IO + +class Chunk: + closed: bool + align: bool + file: IO[bytes] + chunkname: bytes + chunksize: int + size_read: int + offset: int + seekable: bool + def __init__(self, file: IO[bytes], align: bool = ..., bigendian: bool = ..., inclheader: bool = ...) -> None: ... + def getname(self) -> bytes: ... + def getsize(self) -> int: ... + def close(self) -> None: ... + def isatty(self) -> bool: ... + def seek(self, pos: int, whence: int = ...) -> None: ... + def tell(self) -> int: ... + def read(self, size: int = ...) -> bytes: ... + def skip(self) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/cmath.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/cmath.pyi new file mode 100644 index 0000000..4b15f0b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/cmath.pyi @@ -0,0 +1,42 @@ +"""Stub file for the 'cmath' module.""" + +import sys +from typing import SupportsComplex, SupportsFloat, Tuple, Union + +e: float +pi: float +if sys.version_info >= (3, 6): + inf: float + infj: complex + nan: float + nanj: complex + tau: float + +_C = Union[SupportsFloat, SupportsComplex] + +def acos(x: _C) -> complex: ... +def acosh(x: _C) -> complex: ... +def asin(x: _C) -> complex: ... +def asinh(x: _C) -> complex: ... +def atan(x: _C) -> complex: ... +def atanh(x: _C) -> complex: ... +def cos(x: _C) -> complex: ... +def cosh(x: _C) -> complex: ... +def exp(x: _C) -> complex: ... +if sys.version_info >= (3, 5): + def isclose(a: _C, b: _C, *, rel_tol: SupportsFloat = ..., abs_tol: SupportsFloat = ...) -> bool: ... +def isinf(z: _C) -> bool: ... +def isnan(z: _C) -> bool: ... +def log(x: _C, base: _C = ...) -> complex: ... +def log10(x: _C) -> complex: ... +def phase(z: _C) -> float: ... +def polar(z: _C) -> Tuple[float, float]: ... +def rect(r: float, phi: float) -> complex: ... +def sin(x: _C) -> complex: ... +def sinh(x: _C) -> complex: ... +def sqrt(x: _C) -> complex: ... +def tan(x: _C) -> complex: ... +def tanh(x: _C) -> complex: ... + +if sys.version_info >= (3,): + def isfinite(z: _C) -> bool: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/cmd.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/cmd.pyi new file mode 100644 index 0000000..c2aeb75 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/cmd.pyi @@ -0,0 +1,41 @@ +# Stubs for cmd (Python 2/3) + +from typing import Any, Optional, Text, IO, List, Callable, Tuple + +class Cmd: + prompt: str + identchars: str + ruler: str + lastcmd: str + intro: Optional[Any] + doc_leader: str + doc_header: str + misc_header: str + undoc_header: str + nohelp: str + use_rawinput: bool + stdin: IO[str] + stdout: IO[str] + cmdqueue: List[str] + completekey: str + def __init__(self, completekey: str = ..., stdin: Optional[IO[str]] = ..., stdout: Optional[IO[str]] = ...) -> None: ... + old_completer: Optional[Callable[[str, int], Optional[str]]] + def cmdloop(self, intro: Optional[Any] = ...) -> None: ... + def precmd(self, line: str) -> str: ... + def postcmd(self, stop: bool, line: str) -> bool: ... + def preloop(self) -> None: ... + def postloop(self) -> None: ... + def parseline(self, line: str) -> Tuple[Optional[str], Optional[str], str]: ... + def onecmd(self, line: str) -> bool: ... + def emptyline(self) -> bool: ... + def default(self, line: str) -> bool: ... + def completedefault(self, *ignored: Any) -> List[str]: ... + def completenames(self, text: str, *ignored: Any) -> List[str]: ... + completion_matches: Optional[List[str]] + def complete(self, text: str, state: int) -> Optional[List[str]]: ... + def get_names(self) -> List[str]: ... + # Only the first element of args matters. + def complete_help(self, *args: Any) -> List[str]: ... + def do_help(self, arg: Optional[str]) -> None: ... + def print_topics(self, header: str, cmds: Optional[List[str]], cmdlen: Any, maxcol: int) -> None: ... + def columnize(self, list: Optional[List[str]], displaywidth: int = ...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/code.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/code.pyi new file mode 100644 index 0000000..293ab9b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/code.pyi @@ -0,0 +1,38 @@ +# Stubs for code + +import sys +from typing import Any, Callable, Mapping, Optional +from types import CodeType + +class InteractiveInterpreter: + def __init__(self, locals: Optional[Mapping[str, Any]] = ...) -> None: ... + def runsource(self, source: str, filename: str = ..., + symbol: str = ...) -> bool: ... + def runcode(self, code: CodeType) -> None: ... + def showsyntaxerror(self, filename: Optional[str] = ...) -> None: ... + def showtraceback(self) -> None: ... + def write(self, data: str) -> None: ... + +class InteractiveConsole(InteractiveInterpreter): + def __init__(self, locals: Optional[Mapping[str, Any]] = ..., + filename: str = ...) -> None: ... + if sys.version_info >= (3, 6): + def interact(self, banner: Optional[str] = ..., + exitmsg: Optional[str] = ...) -> None: ... + else: + def interact(self, banner: Optional[str] = ...) -> None: ... + def push(self, line: str) -> bool: ... + def resetbuffer(self) -> None: ... + def raw_input(self, prompt: str = ...) -> str: ... + +if sys.version_info >= (3, 6): + def interact(banner: Optional[str] = ..., + readfunc: Optional[Callable[[str], str]] = ..., + local: Optional[Mapping[str, Any]] = ..., + exitmsg: Optional[str] = ...) -> None: ... +else: + def interact(banner: Optional[str] = ..., + readfunc: Optional[Callable[[str], str]] = ..., + local: Optional[Mapping[str, Any]] = ...) -> None: ... +def compile_command(source: str, filename: str = ..., + symbol: str = ...) -> Optional[CodeType]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/codecs.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/codecs.pyi new file mode 100644 index 0000000..b99ce91 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/codecs.pyi @@ -0,0 +1,242 @@ +import sys +from typing import Any, BinaryIO, Callable, Generator, IO, Iterable, Iterator, List, Optional, Protocol, Text, TextIO, Tuple, Type, TypeVar, Union + +from abc import abstractmethod +import types + +# TODO: this only satisfies the most common interface, where +# bytes (py2 str) is the raw form and str (py2 unicode) is the cooked form. +# In the long run, both should become template parameters maybe? +# There *are* bytes->bytes and str->str encodings in the standard library. +# They are much more common in Python 2 than in Python 3. + +_Decoded = Text +_Encoded = bytes + +class _Encoder(Protocol): + def __call__(self, input: _Decoded, errors: str = ...) -> Tuple[_Encoded, int]: ... # signature of Codec().encode +class _Decoder(Protocol): + def __call__(self, input: _Encoded, errors: str = ...) -> Tuple[_Decoded, int]: ... # signature of Codec().decode + +class _StreamReader(Protocol): + def __call__(self, stream: IO[_Encoded], errors: str = ...) -> StreamReader: ... +class _StreamWriter(Protocol): + def __call__(self, stream: IO[_Encoded], errors: str = ...) -> StreamWriter: ... + +class _IncrementalEncoder(Protocol): + def __call__(self, errors: str = ...) -> IncrementalEncoder: ... +class _IncrementalDecoder(Protocol): + def __call__(self, errors: str = ...) -> IncrementalDecoder: ... + +def encode(obj: _Decoded, encoding: str = ..., errors: str = ...) -> _Encoded: ... +def decode(obj: _Encoded, encoding: str = ..., errors: str = ...) -> _Decoded: ... +def lookup(encoding: str) -> CodecInfo: ... + +class CodecInfo(Tuple[_Encoder, _Decoder, _StreamReader, _StreamWriter]): + @property + def encode(self) -> _Encoder: ... + @property + def decode(self) -> _Decoder: ... + @property + def streamreader(self) -> _StreamReader: ... + @property + def streamwriter(self) -> _StreamWriter: ... + @property + def incrementalencoder(self) -> _IncrementalEncoder: ... + @property + def incrementaldecoder(self) -> _IncrementalDecoder: ... + name: str + def __init__( + self, + encode: _Encoder, + decode: _Decoder, + streamreader: _StreamReader = ..., + streamwriter: _StreamWriter = ..., + incrementalencoder: _IncrementalEncoder = ..., + incrementaldecoder: _IncrementalDecoder = ..., + name: str = ..., + ) -> None: ... + +def getencoder(encoding: str) -> _Encoder: ... +def getdecoder(encoding: str) -> _Decoder: ... +def getincrementalencoder(encoding: str) -> _IncrementalEncoder: ... +def getincrementaldecoder(encoding: str) -> _IncrementalDecoder: ... +def getreader(encoding: str) -> _StreamReader: ... +def getwriter(encoding: str) -> _StreamWriter: ... +def register(search_function: Callable[[str], CodecInfo]) -> None: ... +def open(filename: str, mode: str = ..., encoding: str = ..., errors: str = ..., buffering: int = ...) -> StreamReaderWriter: ... +def EncodedFile(file: IO[_Encoded], data_encoding: str, file_encoding: str = ..., errors: str = ...) -> StreamRecoder: ... +def iterencode(iterator: Iterable[_Decoded], encoding: str, errors: str = ...) -> Generator[_Encoded, None, None]: ... +def iterdecode(iterator: Iterable[_Encoded], encoding: str, errors: str = ...) -> Generator[_Decoded, None, None]: ... + +BOM: bytes +BOM_BE: bytes +BOM_LE: bytes +BOM_UTF8: bytes +BOM_UTF16: bytes +BOM_UTF16_BE: bytes +BOM_UTF16_LE: bytes +BOM_UTF32: bytes +BOM_UTF32_BE: bytes +BOM_UTF32_LE: bytes + +# It is expected that different actions be taken depending on which of the +# three subclasses of `UnicodeError` is actually ...ed. However, the Union +# is still needed for at least one of the cases. +def register_error(name: str, error_handler: Callable[[UnicodeError], Tuple[Union[str, bytes], int]]) -> None: ... +def lookup_error(name: str) -> Callable[[UnicodeError], Tuple[Union[str, bytes], int]]: ... +def strict_errors(exception: UnicodeError) -> Tuple[Union[str, bytes], int]: ... +def replace_errors(exception: UnicodeError) -> Tuple[Union[str, bytes], int]: ... +def ignore_errors(exception: UnicodeError) -> Tuple[Union[str, bytes], int]: ... +def xmlcharrefreplace_errors(exception: UnicodeError) -> Tuple[Union[str, bytes], int]: ... +def backslashreplace_errors(exception: UnicodeError) -> Tuple[Union[str, bytes], int]: ... + +class Codec: + # These are sort of @abstractmethod but sort of not. + # The StreamReader and StreamWriter subclasses only implement one. + def encode(self, input: _Decoded, errors: str = ...) -> Tuple[_Encoded, int]: ... + def decode(self, input: _Encoded, errors: str = ...) -> Tuple[_Decoded, int]: ... + +class IncrementalEncoder: + errors: str + def __init__(self, errors: str = ...) -> None: ... + @abstractmethod + def encode(self, object: _Decoded, final: bool = ...) -> _Encoded: ... + def reset(self) -> None: ... + # documentation says int but str is needed for the subclass. + def getstate(self) -> Union[int, _Decoded]: ... + def setstate(self, state: Union[int, _Decoded]) -> None: ... + +class IncrementalDecoder: + errors: str + def __init__(self, errors: str = ...) -> None: ... + @abstractmethod + def decode(self, object: _Encoded, final: bool = ...) -> _Decoded: ... + def reset(self) -> None: ... + def getstate(self) -> Tuple[_Encoded, int]: ... + def setstate(self, state: Tuple[_Encoded, int]) -> None: ... + +# These are not documented but used in encodings/*.py implementations. +class BufferedIncrementalEncoder(IncrementalEncoder): + buffer: str + def __init__(self, errors: str = ...) -> None: ... + @abstractmethod + def _buffer_encode(self, input: _Decoded, errors: str, final: bool) -> _Encoded: ... + def encode(self, input: _Decoded, final: bool = ...) -> _Encoded: ... + +class BufferedIncrementalDecoder(IncrementalDecoder): + buffer: bytes + def __init__(self, errors: str = ...) -> None: ... + @abstractmethod + def _buffer_decode(self, input: _Encoded, errors: str, final: bool) -> Tuple[_Decoded, int]: ... + def decode(self, object: _Encoded, final: bool = ...) -> _Decoded: ... + +_SW = TypeVar("_SW", bound=StreamWriter) + +# TODO: it is not possible to specify the requirement that all other +# attributes and methods are passed-through from the stream. +class StreamWriter(Codec): + errors: str + def __init__(self, stream: IO[_Encoded], errors: str = ...) -> None: ... + def write(self, obj: _Decoded) -> None: ... + def writelines(self, list: Iterable[_Decoded]) -> None: ... + def reset(self) -> None: ... + def __enter__(self: _SW) -> _SW: ... + def __exit__( + self, typ: Optional[Type[BaseException]], exc: Optional[BaseException], tb: Optional[types.TracebackType] + ) -> None: ... + def __getattr__(self, name: str) -> Any: ... + +_SR = TypeVar("_SR", bound=StreamReader) + +class StreamReader(Codec): + errors: str + def __init__(self, stream: IO[_Encoded], errors: str = ...) -> None: ... + def read(self, size: int = ..., chars: int = ..., firstline: bool = ...) -> _Decoded: ... + def readline(self, size: int = ..., keepends: bool = ...) -> _Decoded: ... + def readlines(self, sizehint: int = ..., keepends: bool = ...) -> List[_Decoded]: ... + def reset(self) -> None: ... + def __enter__(self: _SR) -> _SR: ... + def __exit__( + self, typ: Optional[Type[BaseException]], exc: Optional[BaseException], tb: Optional[types.TracebackType] + ) -> None: ... + def __iter__(self) -> Iterator[_Decoded]: ... + def __getattr__(self, name: str) -> Any: ... + +_T = TypeVar("_T", bound=StreamReaderWriter) + +# Doesn't actually inherit from TextIO, but wraps a BinaryIO to provide text reading and writing +# and delegates attributes to the underlying binary stream with __getattr__. +class StreamReaderWriter(TextIO): + def __init__(self, stream: IO[_Encoded], Reader: _StreamReader, Writer: _StreamWriter, errors: str = ...) -> None: ... + def read(self, size: int = ...) -> _Decoded: ... + def readline(self, size: Optional[int] = ...) -> _Decoded: ... + def readlines(self, sizehint: Optional[int] = ...) -> List[_Decoded]: ... + if sys.version_info >= (3,): + def __next__(self) -> Text: ... + else: + def next(self) -> Text: ... + def __iter__(self: _T) -> _T: ... + # This actually returns None, but that's incompatible with the supertype + def write(self, data: _Decoded) -> int: ... + def writelines(self, list: Iterable[_Decoded]) -> None: ... + def reset(self) -> None: ... + # Same as write() + def seek(self, offset: int, whence: int = ...) -> int: ... + def __enter__(self: _T) -> _T: ... + def __exit__( + self, typ: Optional[Type[BaseException]], exc: Optional[BaseException], tb: Optional[types.TracebackType] + ) -> bool: ... + def __getattr__(self, name: str) -> Any: ... + # These methods don't actually exist directly, but they are needed to satisfy the TextIO + # interface. At runtime, they are delegated through __getattr__. + def close(self) -> None: ... + def fileno(self) -> int: ... + def flush(self) -> None: ... + def isatty(self) -> bool: ... + def readable(self) -> bool: ... + def truncate(self, size: Optional[int] = ...) -> int: ... + def seekable(self) -> bool: ... + def tell(self) -> int: ... + def writable(self) -> bool: ... + +_SRT = TypeVar("_SRT", bound=StreamRecoder) + +class StreamRecoder(BinaryIO): + def __init__( + self, + stream: IO[_Encoded], + encode: _Encoder, + decode: _Decoder, + Reader: _StreamReader, + Writer: _StreamWriter, + errors: str = ..., + ) -> None: ... + def read(self, size: int = ...) -> bytes: ... + def readline(self, size: Optional[int] = ...) -> bytes: ... + def readlines(self, sizehint: Optional[int] = ...) -> List[bytes]: ... + if sys.version_info >= (3,): + def __next__(self) -> bytes: ... + else: + def next(self) -> bytes: ... + def __iter__(self: _SRT) -> _SRT: ... + def write(self, data: bytes) -> int: ... + def writelines(self, list: Iterable[bytes]) -> int: ... # type: ignore # it's supposed to return None + def reset(self) -> None: ... + def __getattr__(self, name: str) -> Any: ... + def __enter__(self: _SRT) -> _SRT: ... + def __exit__( + self, type: Optional[Type[BaseException]], value: Optional[BaseException], tb: Optional[types.TracebackType] + ) -> bool: ... + # These methods don't actually exist directly, but they are needed to satisfy the BinaryIO + # interface. At runtime, they are delegated through __getattr__. + def seek(self, offset: int, whence: int = ...) -> int: ... + def close(self) -> None: ... + def fileno(self) -> int: ... + def flush(self) -> None: ... + def isatty(self) -> bool: ... + def readable(self) -> bool: ... + def truncate(self, size: Optional[int] = ...) -> int: ... + def seekable(self) -> bool: ... + def tell(self) -> int: ... + def writable(self) -> bool: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/codeop.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/codeop.pyi new file mode 100644 index 0000000..0e1129e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/codeop.pyi @@ -0,0 +1,17 @@ +# Source(py2): https://hg.python.org/cpython/file/2.7/Lib/codeop.py +# Source(py3): https://github.com/python/cpython/blob/master/Lib/codeop.py + +from types import CodeType +from typing import Optional + +def compile_command(source: str, filename: str = ..., symbol: str = ...) -> Optional[CodeType]: ... + +class Compile: + flags: int + def __init__(self) -> None: ... + def __call__(self, source: str, filename: str, symbol: str) -> CodeType: ... + +class CommandCompiler: + compiler: Compile + def __init__(self) -> None: ... + def __call__(self, source: str, filename: str = ..., symbol: str = ...) -> Optional[CodeType]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/colorsys.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/colorsys.pyi new file mode 100644 index 0000000..c8b5591 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/colorsys.pyi @@ -0,0 +1,15 @@ +# Stubs for colorsys + +from typing import Tuple + +def rgb_to_yiq(r: float, g: float, b: float) -> Tuple[float, float, float]: ... +def yiq_to_rgb(y: float, i: float, q: float) -> Tuple[float, float, float]: ... +def rgb_to_hls(r: float, g: float, b: float) -> Tuple[float, float, float]: ... +def hls_to_rgb(h: float, l: float, s: float) -> Tuple[float, float, float]: ... +def rgb_to_hsv(r: float, g: float, b: float) -> Tuple[float, float, float]: ... +def hsv_to_rgb(h: float, s: float, v: float) -> Tuple[float, float, float]: ... + +# TODO undocumented +ONE_SIXTH: float +ONE_THIRD: float +TWO_THIRD: float diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/contextlib.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/contextlib.pyi new file mode 100644 index 0000000..dec1b41 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/contextlib.pyi @@ -0,0 +1,99 @@ +# Stubs for contextlib + +from typing import ( + Any, Callable, Generator, IO, Iterable, Iterator, Optional, Type, + Generic, TypeVar, overload +) +from types import TracebackType +import sys +# Aliased here for backwards compatibility; TODO eventually remove this +from typing import ContextManager as ContextManager + +if sys.version_info >= (3, 5): + from typing import AsyncContextManager, AsyncIterator + +if sys.version_info >= (3, 6): + from typing import ContextManager as AbstractContextManager +if sys.version_info >= (3, 7): + from typing import AsyncContextManager as AbstractAsyncContextManager + +_T = TypeVar('_T') + +_ExitFunc = Callable[[Optional[Type[BaseException]], + Optional[BaseException], + Optional[TracebackType]], bool] +_CM_EF = TypeVar('_CM_EF', ContextManager, _ExitFunc) + +if sys.version_info >= (3, 2): + class GeneratorContextManager(ContextManager[_T], Generic[_T]): + def __call__(self, func: Callable[..., _T]) -> Callable[..., _T]: ... + def contextmanager(func: Callable[..., Iterator[_T]]) -> Callable[..., GeneratorContextManager[_T]]: ... +else: + def contextmanager(func: Callable[..., Iterator[_T]]) -> Callable[..., ContextManager[_T]]: ... + +if sys.version_info >= (3, 7): + def asynccontextmanager(func: Callable[..., AsyncIterator[_T]]) -> Callable[..., AsyncContextManager[_T]]: ... + +if sys.version_info < (3,): + def nested(*mgr: ContextManager[Any]) -> ContextManager[Iterable[Any]]: ... + +class closing(ContextManager[_T], Generic[_T]): + def __init__(self, thing: _T) -> None: ... + +if sys.version_info >= (3, 4): + class suppress(ContextManager[None]): + def __init__(self, *exceptions: Type[BaseException]) -> None: ... + + class redirect_stdout(ContextManager[None]): + def __init__(self, new_target: IO[str]) -> None: ... + +if sys.version_info >= (3, 5): + class redirect_stderr(ContextManager[None]): + def __init__(self, new_target: IO[str]) -> None: ... + +if sys.version_info >= (3,): + class ContextDecorator: + def __call__(self, func: Callable[..., None]) -> Callable[..., ContextManager[None]]: ... + + _U = TypeVar('_U', bound='ExitStack') + + class ExitStack(ContextManager[ExitStack]): + def __init__(self) -> None: ... + def enter_context(self, cm: ContextManager[_T]) -> _T: ... + def push(self, exit: _CM_EF) -> _CM_EF: ... + def callback(self, callback: Callable[..., Any], + *args: Any, **kwds: Any) -> Callable[..., Any]: ... + def pop_all(self: _U) -> _U: ... + def close(self) -> None: ... + def __enter__(self: _U) -> _U: ... + +if sys.version_info >= (3, 7): + from typing import Awaitable + + _S = TypeVar('_S', bound='AsyncExitStack') + + _ExitCoroFunc = Callable[[Optional[Type[BaseException]], + Optional[BaseException], + Optional[TracebackType]], Awaitable[bool]] + _CallbackCoroFunc = Callable[..., Awaitable[Any]] + _ACM_EF = TypeVar('_ACM_EF', AsyncContextManager, _ExitCoroFunc) + + class AsyncExitStack(AsyncContextManager[AsyncExitStack]): + def __init__(self) -> None: ... + def enter_context(self, cm: ContextManager[_T]) -> _T: ... + def enter_async_context(self, cm: AsyncContextManager[_T]) -> Awaitable[_T]: ... + def push(self, exit: _CM_EF) -> _CM_EF: ... + def push_async_exit(self, exit: _ACM_EF) -> _ACM_EF: ... + def callback(self, callback: Callable[..., Any], + *args: Any, **kwds: Any) -> Callable[..., Any]: ... + def push_async_callback(self, callback: _CallbackCoroFunc, + *args: Any, **kwds: Any) -> _CallbackCoroFunc: ... + def pop_all(self: _S) -> _S: ... + def aclose(self) -> Awaitable[None]: ... + def __aenter__(self: _S) -> Awaitable[_S]: ... + +if sys.version_info >= (3, 7): + @overload + def nullcontext(enter_result: _T) -> ContextManager[_T]: ... + @overload + def nullcontext() -> ContextManager[None]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/copy.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/copy.pyi new file mode 100644 index 0000000..523802a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/copy.pyi @@ -0,0 +1,14 @@ +# Stubs for copy + +from typing import TypeVar, Optional, Dict, Any + +_T = TypeVar('_T') + +# None in CPython but non-None in Jython +PyStringMap: Any + +# Note: memo and _nil are internal kwargs. +def deepcopy(x: _T, memo: Optional[Dict[int, _T]] = ..., _nil: Any = ...) -> _T: ... +def copy(x: _T) -> _T: ... +class Error(Exception): ... +error = Error diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/crypt.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/crypt.pyi new file mode 100644 index 0000000..d55fc26 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/crypt.pyi @@ -0,0 +1,23 @@ +import sys +from typing import List, NamedTuple, Optional, Union + + +if sys.version_info >= (3, 3): + class _Method: ... + + METHOD_CRYPT: _Method + METHOD_MD5: _Method + METHOD_SHA256: _Method + METHOD_SHA512: _Method + if sys.version_info >= (3, 7): + METHOD_BLOWFISH: _Method + + methods: List[_Method] + + if sys.version_info >= (3, 7): + def mksalt(method: Optional[_Method] = ..., *, rounds: Optional[int] = ...) -> str: ... + else: + def mksalt(method: Optional[_Method] = ...) -> str: ... + def crypt(word: str, salt: Optional[Union[str, _Method]] = ...) -> str: ... +else: + def crypt(word: str, salt: str) -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/csv.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/csv.pyi new file mode 100644 index 0000000..0a04951 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/csv.pyi @@ -0,0 +1,93 @@ +from collections import OrderedDict +import sys +from typing import Any, Dict, Iterable, Iterator, List, Mapping, Optional, Sequence, Union + +from _csv import (_reader, + _writer, + reader as reader, + writer as writer, + register_dialect as register_dialect, + unregister_dialect as unregister_dialect, + get_dialect as get_dialect, + list_dialects as list_dialects, + field_size_limit as field_size_limit, + QUOTE_ALL as QUOTE_ALL, + QUOTE_MINIMAL as QUOTE_MINIMAL, + QUOTE_NONE as QUOTE_NONE, + QUOTE_NONNUMERIC as QUOTE_NONNUMERIC, + Error as Error, + ) + +_Dialect = Union[str, Dialect] +_DictRow = Mapping[str, Any] + +class Dialect(object): + delimiter: str + quotechar: Optional[str] + escapechar: Optional[str] + doublequote: bool + skipinitialspace: bool + lineterminator: str + quoting: int + def __init__(self) -> None: ... + +class excel(Dialect): + delimiter: str + quotechar: str + doublequote: bool + skipinitialspace: bool + lineterminator: str + quoting: int + +class excel_tab(excel): + delimiter: str + +if sys.version_info >= (3,): + class unix_dialect(Dialect): + delimiter: str + quotechar: str + doublequote: bool + skipinitialspace: bool + lineterminator: str + quoting: int + +if sys.version_info >= (3, 6): + _DRMapping = OrderedDict[str, str] +else: + _DRMapping = Dict[str, str] + + +class DictReader(Iterator[_DRMapping]): + restkey: Optional[str] + restval: Optional[str] + reader: _reader + dialect: _Dialect + line_num: int + fieldnames: Sequence[str] + def __init__(self, f: Iterable[str], fieldnames: Sequence[str] = ..., + restkey: Optional[str] = ..., restval: Optional[str] = ..., dialect: _Dialect = ..., + *args: Any, **kwds: Any) -> None: ... + def __iter__(self) -> DictReader: ... + if sys.version_info >= (3,): + def __next__(self) -> _DRMapping: ... + else: + def next(self) -> _DRMapping: ... + + +class DictWriter(object): + fieldnames: Sequence[str] + restval: Optional[Any] + extrasaction: str + writer: _writer + def __init__(self, f: Any, fieldnames: Sequence[str], + restval: Optional[Any] = ..., extrasaction: str = ..., dialect: _Dialect = ..., + *args: Any, **kwds: Any) -> None: ... + def writeheader(self) -> None: ... + def writerow(self, rowdict: _DictRow) -> None: ... + def writerows(self, rowdicts: Iterable[_DictRow]) -> None: ... + +class Sniffer(object): + preferred: List[str] + def __init__(self) -> None: ... + def sniff(self, sample: str, delimiters: Optional[str] = ...) -> Dialect: ... + def has_header(self, sample: str) -> bool: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/ctypes/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/ctypes/__init__.pyi new file mode 100644 index 0000000..e4cd6b4 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/ctypes/__init__.pyi @@ -0,0 +1,285 @@ +# Stubs for ctypes + +from array import array +from typing import ( + Any, Callable, ClassVar, Iterator, Iterable, List, Mapping, Optional, Sequence, Sized, Text, + Tuple, Type, Generic, TypeVar, overload, +) +from typing import Union as _UnionT +import sys + +_T = TypeVar('_T') +_DLLT = TypeVar('_DLLT', bound=CDLL) +_CT = TypeVar('_CT', bound=_CData) + + +RTLD_GLOBAL: int = ... +RTLD_LOCAL: int = ... +DEFAULT_MODE: int = ... + + +class CDLL(object): + _func_flags_: ClassVar[int] = ... + _func_restype_: ClassVar[_CData] = ... + _name: str = ... + _handle: int = ... + _FuncPtr: Type[_FuncPointer] = ... + def __init__(self, name: str, mode: int = ..., handle: Optional[int] = ..., + use_errno: bool = ..., use_last_error: bool = ...) -> None: ... + def __getattr__(self, name: str) -> _FuncPointer: ... + def __getitem__(self, name: str) -> _FuncPointer: ... +if sys.platform == 'win32': + class OleDLL(CDLL): ... + class WinDLL(CDLL): ... +class PyDLL(CDLL): ... + +class LibraryLoader(Generic[_DLLT]): + def __init__(self, dlltype: Type[_DLLT]) -> None: ... + def __getattr__(self, name: str) -> _DLLT: ... + def __getitem__(self, name: str) -> _DLLT: ... + def LoadLibrary(self, name: str) -> _DLLT: ... + +cdll: LibraryLoader[CDLL] = ... +if sys.platform == 'win32': + windll: LibraryLoader[WinDLL] = ... + oledll: LibraryLoader[OleDLL] = ... +pydll: LibraryLoader[PyDLL] = ... +pythonapi: PyDLL = ... + +# Anything that implements the read-write buffer interface. +# The buffer interface is defined purely on the C level, so we cannot define a normal Protocol +# for it. Instead we have to list the most common stdlib buffer classes in a Union. +_WritableBuffer = _UnionT[bytearray, memoryview, array, _CData] +# Same as _WritableBuffer, but also includes read-only buffer types (like bytes). +_ReadOnlyBuffer = _UnionT[_WritableBuffer, bytes] + +class _CDataMeta(type): + # By default mypy complains about the following two methods, because strictly speaking cls + # might not be a Type[_CT]. However this can never actually happen, because the only class that + # uses _CDataMeta as its metaclass is _CData. So it's safe to ignore the errors here. + def __mul__(cls: Type[_CT], other: int) -> Type[Array[_CT]]: ... # type: ignore + def __rmul__(cls: Type[_CT], other: int) -> Type[Array[_CT]]: ... # type: ignore +class _CData(metaclass=_CDataMeta): + _b_base: int = ... + _b_needsfree_: bool = ... + _objects: Optional[Mapping[Any, int]] = ... + @classmethod + def from_buffer(cls: Type[_CT], source: _WritableBuffer, offset: int = ...) -> _CT: ... + @classmethod + def from_buffer_copy(cls: Type[_CT], source: _ReadOnlyBuffer, offset: int = ...) -> _CT: ... + @classmethod + def from_address(cls: Type[_CT], address: int) -> _CT: ... + @classmethod + def from_param(cls: Type[_CT], obj: Any) -> _UnionT[_CT, _CArgObject]: ... + @classmethod + def in_dll(cls: Type[_CT], library: CDLL, name: str) -> _CT: ... + +class _PointerLike(_CData): ... + +_ECT = Callable[[Optional[Type[_CData]], + _FuncPointer, + Tuple[_CData, ...]], + _CData] +_PF = _UnionT[ + Tuple[int], + Tuple[int, str], + Tuple[int, str, Any] +] +class _FuncPointer(_PointerLike, _CData): + restype: _UnionT[Type[_CData], Callable[[int], None], None] = ... + argtypes: Sequence[Type[_CData]] = ... + errcheck: _ECT = ... + @overload + def __init__(self, address: int) -> None: ... + @overload + def __init__(self, callable: Callable[..., Any]) -> None: ... + @overload + def __init__(self, func_spec: Tuple[_UnionT[str, int], CDLL], + paramflags: Tuple[_PF, ...] = ...) -> None: ... + @overload + def __init__(self, vtlb_index: int, name: str, + paramflags: Tuple[_PF, ...] = ..., + iid: pointer[c_int] = ...) -> None: ... + def __call__(self, *args: Any, **kwargs: Any) -> Any: ... + +class ArgumentError(Exception): ... + + +def CFUNCTYPE(restype: Optional[Type[_CData]], + *argtypes: Type[_CData], + use_errno: bool = ..., + use_last_error: bool = ...) -> Type[_FuncPointer]: ... +if sys.platform == 'win32': + def WINFUNCTYPE(restype: Optional[Type[_CData]], + *argtypes: Type[_CData], + use_errno: bool = ..., + use_last_error: bool = ...) -> Type[_FuncPointer]: ... +def PYFUNCTYPE(restype: Optional[Type[_CData]], + *argtypes: Type[_CData]) -> Type[_FuncPointer]: ... + +class _CArgObject: ... + +# Any type that can be implicitly converted to c_void_p when passed as a C function argument. +# (bytes is not included here, see below.) +_CVoidPLike = _UnionT[_PointerLike, Array[Any], _CArgObject, int] +# Same as above, but including types known to be read-only (i. e. bytes). +# This distinction is not strictly necessary (ctypes doesn't differentiate between const +# and non-const pointers), but it catches errors like memmove(b'foo', buf, 4) +# when memmove(buf, b'foo', 4) was intended. +_CVoidConstPLike = _UnionT[_CVoidPLike, bytes] + +def addressof(obj: _CData) -> int: ... +def alignment(obj_or_type: _UnionT[_CData, Type[_CData]]) -> int: ... +def byref(obj: _CData, offset: int = ...) -> _CArgObject: ... +_PT = TypeVar('_PT', bound=_PointerLike) +def cast(obj: _UnionT[_CData, _CArgObject], type: Type[_PT]) -> _PT: ... +def create_string_buffer(init_or_size: _UnionT[int, bytes], + size: Optional[int] = ...) -> Array[c_char]: ... +c_buffer = create_string_buffer +def create_unicode_buffer(init_or_size: _UnionT[int, Text], + size: Optional[int] = ...) -> Array[c_wchar]: ... +if sys.platform == 'win32': + def DllCanUnloadNow() -> int: ... + def DllGetClassObject(rclsid: Any, riid: Any, ppv: Any) -> int: ... # TODO not documented + def FormatError(code: int) -> str: ... + def GetLastError() -> int: ... +def get_errno() -> int: ... +if sys.platform == 'win32': + def get_last_error() -> int: ... +def memmove(dst: _CVoidPLike, src: _CVoidConstPLike, count: int) -> None: ... +def memset(dst: _CVoidPLike, c: int, count: int) -> None: ... +def POINTER(type: Type[_CT]) -> Type[pointer[_CT]]: ... + +# The real ctypes.pointer is a function, not a class. The stub version of pointer behaves like +# ctypes._Pointer in that it is the base class for all pointer types. Unlike the real _Pointer, +# it can be instantiated directly (to mimic the behavior of the real pointer function). +class pointer(Generic[_CT], _PointerLike, _CData): + _type_: ClassVar[Type[_CT]] = ... + contents: _CT = ... + def __init__(self, arg: _CT = ...) -> None: ... + @overload + def __getitem__(self, i: int) -> _CT: ... + @overload + def __getitem__(self, s: slice) -> List[_CT]: ... + @overload + def __setitem__(self, i: int, o: _CT) -> None: ... + @overload + def __setitem__(self, s: slice, o: Iterable[_CT]) -> None: ... + +def resize(obj: _CData, size: int) -> None: ... +if sys.version_info < (3,): + def set_conversion_mode(encoding: str, errors: str) -> Tuple[str, str]: ... +def set_errno(value: int) -> int: ... +if sys.platform == 'win32': + def set_last_error(value: int) -> int: ... +def sizeof(obj_or_type: _UnionT[_CData, Type[_CData]]) -> int: ... +def string_at(address: _CVoidConstPLike, size: int = ...) -> bytes: ... +if sys.platform == 'win32': + def WinError(code: Optional[int] = ..., + desc: Optional[str] = ...) -> WindowsError: ... +def wstring_at(address: _CVoidConstPLike, size: int = ...) -> str: ... + +class _SimpleCData(Generic[_T], _CData): + value: _T = ... + def __init__(self, value: _T = ...) -> None: ... + +class c_byte(_SimpleCData[int]): ... + +class c_char(_SimpleCData[bytes]): + def __init__(self, value: _UnionT[int, bytes] = ...) -> None: ... +class c_char_p(_PointerLike, _SimpleCData[Optional[bytes]]): + def __init__(self, value: Optional[_UnionT[int, bytes]] = ...) -> None: ... + +class c_double(_SimpleCData[float]): ... +class c_longdouble(_SimpleCData[float]): ... +class c_float(_SimpleCData[float]): ... + +class c_int(_SimpleCData[int]): ... +class c_int8(_SimpleCData[int]): ... +class c_int16(_SimpleCData[int]): ... +class c_int32(_SimpleCData[int]): ... +class c_int64(_SimpleCData[int]): ... + +class c_long(_SimpleCData[int]): ... +class c_longlong(_SimpleCData[int]): ... + +class c_short(_SimpleCData[int]): ... + +class c_size_t(_SimpleCData[int]): ... +class c_ssize_t(_SimpleCData[int]): ... + +class c_ubyte(_SimpleCData[int]): ... + +class c_uint(_SimpleCData[int]): ... +class c_uint8(_SimpleCData[int]): ... +class c_uint16(_SimpleCData[int]): ... +class c_uint32(_SimpleCData[int]): ... +class c_uint64(_SimpleCData[int]): ... + +class c_ulong(_SimpleCData[int]): ... +class c_ulonglong(_SimpleCData[int]): ... + +class c_ushort(_SimpleCData[int]): ... + +class c_void_p(_PointerLike, _SimpleCData[Optional[int]]): ... + +class c_wchar(_SimpleCData[Text]): ... +class c_wchar_p(_PointerLike, _SimpleCData[Optional[Text]]): + def __init__(self, value: Optional[_UnionT[int, Text]] = ...) -> None: ... + +class c_bool(_SimpleCData[bool]): + def __init__(self, value: bool) -> None: ... + +if sys.platform == 'win32': + class HRESULT(_SimpleCData[int]): ... # TODO undocumented + +class py_object(_SimpleCData[_T]): ... + +class _CField: + offset: int = ... + size: int = ... +class _StructUnionMeta(_CDataMeta): + _fields_: Sequence[_UnionT[Tuple[str, Type[_CData]], Tuple[str, Type[_CData], int]]] = ... + _pack_: int = ... + _anonymous_: Sequence[str] = ... + def __getattr__(self, name: str) -> _CField: ... +class _StructUnionBase(_CData, metaclass=_StructUnionMeta): + def __init__(self, *args: Any, **kw: Any) -> None: ... + def __getattr__(self, name: str) -> Any: ... + def __setattr__(self, name: str, value: Any) -> None: ... + +class Union(_StructUnionBase): ... +class Structure(_StructUnionBase): ... +class BigEndianStructure(Structure): ... +class LittleEndianStructure(Structure): ... + +class Array(Generic[_CT], _CData): + _length_: ClassVar[int] = ... + _type_: ClassVar[Type[_CT]] = ... + raw: bytes = ... # Note: only available if _CT == c_char + value: Any = ... # Note: bytes if _CT == c_char, Text if _CT == c_wchar, unavailable otherwise + # TODO These methods cannot be annotated correctly at the moment. + # All of these "Any"s stand for the array's element type, but it's not possible to use _CT + # here, because of a special feature of ctypes. + # By default, when accessing an element of an Array[_CT], the returned object has type _CT. + # However, when _CT is a "simple type" like c_int, ctypes automatically "unboxes" the object + # and converts it to the corresponding Python primitive. For example, when accessing an element + # of an Array[c_int], a Python int object is returned, not a c_int. + # This behavior does *not* apply to subclasses of "simple types". + # If MyInt is a subclass of c_int, then accessing an element of an Array[MyInt] returns + # a MyInt, not an int. + # This special behavior is not easy to model in a stub, so for now all places where + # the array element type would belong are annotated with Any instead. + def __init__(self, *args: Any) -> None: ... + @overload + def __getitem__(self, i: int) -> Any: ... + @overload + def __getitem__(self, s: slice) -> List[Any]: ... + @overload + def __setitem__(self, i: int, o: Any) -> None: ... + @overload + def __setitem__(self, s: slice, o: Iterable[Any]) -> None: ... + def __iter__(self) -> Iterator[Any]: ... + # Can't inherit from Sized because the metaclass conflict between + # Sized and _CData prevents using _CDataMeta. + def __len__(self) -> int: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/ctypes/util.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/ctypes/util.pyi new file mode 100644 index 0000000..7077d9d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/ctypes/util.pyi @@ -0,0 +1,8 @@ +# Stubs for ctypes.util + +from typing import Optional +import sys + +def find_library(name: str) -> Optional[str]: ... +if sys.platform == 'win32': + def find_msvcrt() -> Optional[str]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/ctypes/wintypes.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/ctypes/wintypes.pyi new file mode 100644 index 0000000..c5a6226 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/ctypes/wintypes.pyi @@ -0,0 +1,209 @@ +from ctypes import ( + _SimpleCData, Array, Structure, c_byte, c_char, c_char_p, c_double, c_float, c_int, c_long, + c_longlong, c_short, c_uint, c_ulong, c_ulonglong, c_ushort, c_void_p, c_wchar, c_wchar_p, + pointer, +) + +BYTE = c_byte +WORD = c_ushort +DWORD = c_ulong +CHAR = c_char +WCHAR = c_wchar +UINT = c_uint +INT = c_int +DOUBLE = c_double +FLOAT = c_float +BOOLEAN = BYTE +BOOL = c_long +class VARIANT_BOOL(_SimpleCData[bool]): ... +ULONG = c_ulong +LONG = c_long +USHORT = c_ushort +SHORT = c_short +LARGE_INTEGER = c_longlong +_LARGE_INTEGER = c_longlong +ULARGE_INTEGER = c_ulonglong +_ULARGE_INTEGER = c_ulonglong + +OLESTR = c_wchar_p +LPOLESTR = c_wchar_p +LPCOLESTR = c_wchar_p +LPWSTR = c_wchar_p +LPCWSTR = c_wchar_p +LPSTR = c_char_p +LPCSTR = c_char_p +LPVOID = c_void_p +LPCVOID = c_void_p + +# These two types are pointer-sized unsigned and signed ints, respectively. +# At runtime, they are either c_[u]long or c_[u]longlong, depending on the host's pointer size +# (they are not really separate classes). +class WPARAM(_SimpleCData[int]): ... +class LPARAM(_SimpleCData[int]): ... + +ATOM = WORD +LANGID = WORD +COLORREF = DWORD +LGRPID = DWORD +LCTYPE = DWORD +LCID = DWORD + +HANDLE = c_void_p +HACCEL = HANDLE +HBITMAP = HANDLE +HBRUSH = HANDLE +HCOLORSPACE = HANDLE +HDC = HANDLE +HDESK = HANDLE +HDWP = HANDLE +HENHMETAFILE = HANDLE +HFONT = HANDLE +HGDIOBJ = HANDLE +HGLOBAL = HANDLE +HHOOK = HANDLE +HICON = HANDLE +HINSTANCE = HANDLE +HKEY = HANDLE +HKL = HANDLE +HLOCAL = HANDLE +HMENU = HANDLE +HMETAFILE = HANDLE +HMODULE = HANDLE +HMONITOR = HANDLE +HPALETTE = HANDLE +HPEN = HANDLE +HRGN = HANDLE +HRSRC = HANDLE +HSTR = HANDLE +HTASK = HANDLE +HWINSTA = HANDLE +HWND = HANDLE +SC_HANDLE = HANDLE +SERVICE_STATUS_HANDLE = HANDLE + +class RECT(Structure): + left: LONG + top: LONG + right: LONG + bottom: LONG +RECTL = RECT +_RECTL = RECT +tagRECT = RECT + +class _SMALL_RECT(Structure): + Left: SHORT + Top: SHORT + Right: SHORT + Bottom: SHORT +SMALL_RECT = _SMALL_RECT + +class _COORD(Structure): + X: SHORT + Y: SHORT + +class POINT(Structure): + x: LONG + y: LONG +POINTL = POINT +_POINTL = POINT +tagPOINT = POINT + +class SIZE(Structure): + cx: LONG + cy: LONG +SIZEL = SIZE +tagSIZE = SIZE + +def RGB(red: int, green: int, blue: int) -> int: ... + +class FILETIME(Structure): + dwLowDateTime: DWORD + dwHighDateTime: DWORD +_FILETIME = FILETIME + +class MSG(Structure): + hWnd: HWND + message: UINT + wParam: WPARAM + lParam: LPARAM + time: DWORD + pt: POINT +tagMSG = MSG +MAX_PATH: int + +class WIN32_FIND_DATAA(Structure): + dwFileAttributes: DWORD + ftCreationTime: FILETIME + ftLastAccessTime: FILETIME + ftLastWriteTime: FILETIME + nFileSizeHigh: DWORD + nFileSizeLow: DWORD + dwReserved0: DWORD + dwReserved1: DWORD + cFileName: Array[CHAR] + cAlternateFileName: Array[CHAR] + +class WIN32_FIND_DATAW(Structure): + dwFileAttributes: DWORD + ftCreationTime: FILETIME + ftLastAccessTime: FILETIME + ftLastWriteTime: FILETIME + nFileSizeHigh: DWORD + nFileSizeLow: DWORD + dwReserved0: DWORD + dwReserved1: DWORD + cFileName: Array[WCHAR] + cAlternateFileName: Array[WCHAR] + +# These pointer type definitions use pointer[...] instead of POINTER(...), to allow them +# to be used in type annotations. +PBOOL = pointer[BOOL] +LPBOOL = pointer[BOOL] +PBOOLEAN = pointer[BOOLEAN] +PBYTE = pointer[BYTE] +LPBYTE = pointer[BYTE] +PCHAR = pointer[CHAR] +LPCOLORREF = pointer[COLORREF] +PDWORD = pointer[DWORD] +LPDWORD = pointer[DWORD] +PFILETIME = pointer[FILETIME] +LPFILETIME = pointer[FILETIME] +PFLOAT = pointer[FLOAT] +PHANDLE = pointer[HANDLE] +LPHANDLE = pointer[HANDLE] +PHKEY = pointer[HKEY] +LPHKL = pointer[HKL] +PINT = pointer[INT] +LPINT = pointer[INT] +PLARGE_INTEGER = pointer[LARGE_INTEGER] +PLCID = pointer[LCID] +PLONG = pointer[LONG] +LPLONG = pointer[LONG] +PMSG = pointer[MSG] +LPMSG = pointer[MSG] +PPOINT = pointer[POINT] +LPPOINT = pointer[POINT] +PPOINTL = pointer[POINTL] +PRECT = pointer[RECT] +LPRECT = pointer[RECT] +PRECTL = pointer[RECTL] +LPRECTL = pointer[RECTL] +LPSC_HANDLE = pointer[SC_HANDLE] +PSHORT = pointer[SHORT] +PSIZE = pointer[SIZE] +LPSIZE = pointer[SIZE] +PSIZEL = pointer[SIZEL] +LPSIZEL = pointer[SIZEL] +PSMALL_RECT = pointer[SMALL_RECT] +PUINT = pointer[UINT] +LPUINT = pointer[UINT] +PULARGE_INTEGER = pointer[ULARGE_INTEGER] +PULONG = pointer[ULONG] +PUSHORT = pointer[USHORT] +PWCHAR = pointer[WCHAR] +PWIN32_FIND_DATAA = pointer[WIN32_FIND_DATAA] +LPWIN32_FIND_DATAA = pointer[WIN32_FIND_DATAA] +PWIN32_FIND_DATAW = pointer[WIN32_FIND_DATAW] +LPWIN32_FIND_DATAW = pointer[WIN32_FIND_DATAW] +PWORD = pointer[WORD] +LPWORD = pointer[WORD] diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/datetime.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/datetime.pyi new file mode 100644 index 0000000..ccc92ba --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/datetime.pyi @@ -0,0 +1,290 @@ +import sys +from time import struct_time +from typing import ( + AnyStr, Optional, SupportsAbs, Tuple, Union, overload, + ClassVar, +) + +if sys.version_info >= (3,): + _Text = str +else: + _Text = Union[str, unicode] + +MINYEAR: int +MAXYEAR: int + +class tzinfo: + def tzname(self, dt: Optional[datetime]) -> Optional[str]: ... + def utcoffset(self, dt: Optional[datetime]) -> Optional[timedelta]: ... + def dst(self, dt: Optional[datetime]) -> Optional[timedelta]: ... + def fromutc(self, dt: datetime) -> datetime: ... + +if sys.version_info >= (3, 2): + class timezone(tzinfo): + utc: ClassVar[timezone] + min: ClassVar[timezone] + max: ClassVar[timezone] + + def __init__(self, offset: timedelta, name: str = ...) -> None: ... + def __hash__(self) -> int: ... + +_tzinfo = tzinfo + +class date: + min: ClassVar[date] + max: ClassVar[date] + resolution: ClassVar[timedelta] + + def __init__(self, year: int, month: int, day: int) -> None: ... + + @classmethod + def fromtimestamp(cls, t: float) -> date: ... + @classmethod + def today(cls) -> date: ... + @classmethod + def fromordinal(cls, n: int) -> date: ... + if sys.version_info >= (3, 7): + @classmethod + def fromisoformat(cls, date_string: str) -> date: ... + + @property + def year(self) -> int: ... + @property + def month(self) -> int: ... + @property + def day(self) -> int: ... + + def ctime(self) -> str: ... + def strftime(self, fmt: _Text) -> str: ... + if sys.version_info >= (3,): + def __format__(self, fmt: str) -> str: ... + else: + def __format__(self, fmt: AnyStr) -> AnyStr: ... + def isoformat(self) -> str: ... + def timetuple(self) -> struct_time: ... + def toordinal(self) -> int: ... + def replace(self, year: int = ..., month: int = ..., day: int = ...) -> date: ... + def __le__(self, other: date) -> bool: ... + def __lt__(self, other: date) -> bool: ... + def __ge__(self, other: date) -> bool: ... + def __gt__(self, other: date) -> bool: ... + def __add__(self, other: timedelta) -> date: ... + @overload + def __sub__(self, other: timedelta) -> date: ... + @overload + def __sub__(self, other: date) -> timedelta: ... + def __hash__(self) -> int: ... + def weekday(self) -> int: ... + def isoweekday(self) -> int: ... + def isocalendar(self) -> Tuple[int, int, int]: ... + +class time: + min: ClassVar[time] + max: ClassVar[time] + resolution: ClassVar[timedelta] + + if sys.version_info >= (3, 6): + def __init__(self, hour: int = ..., minute: int = ..., second: int = ..., microsecond: int = ..., + tzinfo: Optional[_tzinfo] = ..., *, fold: int = ...) -> None: ... + else: + def __init__(self, hour: int = ..., minute: int = ..., second: int = ..., microsecond: int = ..., + tzinfo: Optional[_tzinfo] = ...) -> None: ... + + @property + def hour(self) -> int: ... + @property + def minute(self) -> int: ... + @property + def second(self) -> int: ... + @property + def microsecond(self) -> int: ... + @property + def tzinfo(self) -> Optional[_tzinfo]: ... + if sys.version_info >= (3, 6): + @property + def fold(self) -> int: ... + + def __le__(self, other: time) -> bool: ... + def __lt__(self, other: time) -> bool: ... + def __ge__(self, other: time) -> bool: ... + def __gt__(self, other: time) -> bool: ... + def __hash__(self) -> int: ... + def isoformat(self) -> str: ... + if sys.version_info >= (3, 7): + @classmethod + def fromisoformat(cls, time_string: str) -> time: ... + def strftime(self, fmt: _Text) -> str: ... + if sys.version_info >= (3,): + def __format__(self, fmt: str) -> str: ... + else: + def __format__(self, fmt: AnyStr) -> AnyStr: ... + def utcoffset(self) -> Optional[timedelta]: ... + def tzname(self) -> Optional[str]: ... + def dst(self) -> Optional[int]: ... + if sys.version_info >= (3, 6): + def replace(self, hour: int = ..., minute: int = ..., second: int = ..., + microsecond: int = ..., tzinfo: Optional[_tzinfo] = ..., + *, fold: int = ...) -> time: ... + else: + def replace(self, hour: int = ..., minute: int = ..., second: int = ..., + microsecond: int = ..., tzinfo: Optional[_tzinfo] = ...) -> time: ... + +_date = date +_time = time + +class timedelta(SupportsAbs[timedelta]): + min: ClassVar[timedelta] + max: ClassVar[timedelta] + resolution: ClassVar[timedelta] + + if sys.version_info >= (3, 6): + def __init__(self, days: float = ..., seconds: float = ..., microseconds: float = ..., + milliseconds: float = ..., minutes: float = ..., hours: float = ..., + weeks: float = ..., *, fold: int = ...) -> None: ... + else: + def __init__(self, days: float = ..., seconds: float = ..., microseconds: float = ..., + milliseconds: float = ..., minutes: float = ..., hours: float = ..., + weeks: float = ...) -> None: ... + + @property + def days(self) -> int: ... + @property + def seconds(self) -> int: ... + @property + def microseconds(self) -> int: ... + + def total_seconds(self) -> float: ... + def __add__(self, other: timedelta) -> timedelta: ... + def __radd__(self, other: timedelta) -> timedelta: ... + def __sub__(self, other: timedelta) -> timedelta: ... + def __rsub__(self, other: timedelta) -> timedelta: ... + def __neg__(self) -> timedelta: ... + def __pos__(self) -> timedelta: ... + def __abs__(self) -> timedelta: ... + def __mul__(self, other: float) -> timedelta: ... + def __rmul__(self, other: float) -> timedelta: ... + @overload + def __floordiv__(self, other: timedelta) -> int: ... + @overload + def __floordiv__(self, other: int) -> timedelta: ... + if sys.version_info >= (3,): + @overload + def __truediv__(self, other: timedelta) -> float: ... + @overload + def __truediv__(self, other: float) -> timedelta: ... + def __mod__(self, other: timedelta) -> timedelta: ... + def __divmod__(self, other: timedelta) -> Tuple[int, timedelta]: ... + else: + @overload + def __div__(self, other: timedelta) -> float: ... + @overload + def __div__(self, other: float) -> timedelta: ... + def __le__(self, other: timedelta) -> bool: ... + def __lt__(self, other: timedelta) -> bool: ... + def __ge__(self, other: timedelta) -> bool: ... + def __gt__(self, other: timedelta) -> bool: ... + def __hash__(self) -> int: ... + +class datetime(date): + min: ClassVar[datetime] + max: ClassVar[datetime] + resolution: ClassVar[timedelta] + + if sys.version_info >= (3, 6): + def __init__(self, year: int, month: int, day: int, hour: int = ..., + minute: int = ..., second: int = ..., microsecond: int = ..., + tzinfo: Optional[_tzinfo] = ..., *, fold: int = ...) -> None: ... + else: + def __init__(self, year: int, month: int, day: int, hour: int = ..., + minute: int = ..., second: int = ..., microsecond: int = ..., + tzinfo: Optional[_tzinfo] = ...) -> None: ... + + @property + def year(self) -> int: ... + @property + def month(self) -> int: ... + @property + def day(self) -> int: ... + @property + def hour(self) -> int: ... + @property + def minute(self) -> int: ... + @property + def second(self) -> int: ... + @property + def microsecond(self) -> int: ... + @property + def tzinfo(self) -> Optional[_tzinfo]: ... + if sys.version_info >= (3, 6): + @property + def fold(self) -> int: ... + + @classmethod + def fromtimestamp(cls, t: float, tz: Optional[_tzinfo] = ...) -> datetime: ... + @classmethod + def utcfromtimestamp(cls, t: float) -> datetime: ... + @classmethod + def today(cls) -> datetime: ... + @classmethod + def fromordinal(cls, n: int) -> datetime: ... + @classmethod + def now(cls, tz: Optional[_tzinfo] = ...) -> datetime: ... + @classmethod + def utcnow(cls) -> datetime: ... + if sys.version_info >= (3, 6): + @classmethod + def combine(cls, date: date, time: time, tzinfo: Optional[_tzinfo] = ...) -> datetime: ... + else: + @classmethod + def combine(cls, date: date, time: time) -> datetime: ... + if sys.version_info >= (3, 7): + @classmethod + def fromisoformat(cls, date_string: str) -> datetime: ... + def strftime(self, fmt: _Text) -> str: ... + if sys.version_info >= (3,): + def __format__(self, fmt: str) -> str: ... + else: + def __format__(self, fmt: AnyStr) -> AnyStr: ... + def toordinal(self) -> int: ... + def timetuple(self) -> struct_time: ... + if sys.version_info >= (3, 3): + def timestamp(self) -> float: ... + def utctimetuple(self) -> struct_time: ... + def date(self) -> _date: ... + def time(self) -> _time: ... + def timetz(self) -> _time: ... + if sys.version_info >= (3, 6): + def replace(self, year: int = ..., month: int = ..., day: int = ..., hour: int = ..., + minute: int = ..., second: int = ..., microsecond: int = ..., tzinfo: + Optional[_tzinfo] = ..., *, fold: int = ...) -> datetime: ... + else: + def replace(self, year: int = ..., month: int = ..., day: int = ..., hour: int = ..., + minute: int = ..., second: int = ..., microsecond: int = ..., tzinfo: + Optional[_tzinfo] = ...) -> datetime: ... + if sys.version_info >= (3, 3): + def astimezone(self, tz: Optional[_tzinfo] = ...) -> datetime: ... + else: + def astimezone(self, tz: _tzinfo) -> datetime: ... + def ctime(self) -> str: ... + if sys.version_info >= (3, 6): + def isoformat(self, sep: str = ..., timespec: str = ...) -> str: ... + else: + def isoformat(self, sep: str = ...) -> str: ... + @classmethod + def strptime(cls, date_string: _Text, format: _Text) -> datetime: ... + def utcoffset(self) -> Optional[timedelta]: ... + def tzname(self) -> Optional[str]: ... + def dst(self) -> Optional[timedelta]: ... + def __le__(self, other: datetime) -> bool: ... # type: ignore + def __lt__(self, other: datetime) -> bool: ... # type: ignore + def __ge__(self, other: datetime) -> bool: ... # type: ignore + def __gt__(self, other: datetime) -> bool: ... # type: ignore + def __add__(self, other: timedelta) -> datetime: ... + @overload # type: ignore + def __sub__(self, other: datetime) -> timedelta: ... + @overload + def __sub__(self, other: timedelta) -> datetime: ... + def __hash__(self) -> int: ... + def weekday(self) -> int: ... + def isoweekday(self) -> int: ... + def isocalendar(self) -> Tuple[int, int, int]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/decimal.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/decimal.pyi new file mode 100644 index 0000000..2018ed8 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/decimal.pyi @@ -0,0 +1,315 @@ +import numbers +import sys +from types import TracebackType +from typing import ( + Any, Container, Dict, List, NamedTuple, Optional, overload, Sequence, Text, Tuple, Type, TypeVar, Union, +) + +_Decimal = Union[Decimal, int] +_DecimalNew = Union[Decimal, float, Text, Tuple[int, Sequence[int], int]] +if sys.version_info >= (3,): + _ComparableNum = Union[Decimal, float, numbers.Rational] +else: + _ComparableNum = Union[Decimal, float] +_DecimalT = TypeVar('_DecimalT', bound=Decimal) + +DecimalTuple = NamedTuple('DecimalTuple', + [('sign', int), + ('digits', Tuple[int, ...]), + ('exponent', int)]) + +ROUND_DOWN: str +ROUND_HALF_UP: str +ROUND_HALF_EVEN: str +ROUND_CEILING: str +ROUND_FLOOR: str +ROUND_UP: str +ROUND_HALF_DOWN: str +ROUND_05UP: str + +if sys.version_info >= (3,): + HAVE_THREADS: bool + MAX_EMAX: int + MAX_PREC: int + MIN_EMIN: int + MIN_ETINY: int + +class DecimalException(ArithmeticError): + def handle(self, context: Context, *args: Any) -> Optional[Decimal]: ... + +class Clamped(DecimalException): ... + +class InvalidOperation(DecimalException): ... + +class ConversionSyntax(InvalidOperation): ... + +class DivisionByZero(DecimalException, ZeroDivisionError): ... + +class DivisionImpossible(InvalidOperation): ... + +class DivisionUndefined(InvalidOperation, ZeroDivisionError): ... + +class Inexact(DecimalException): ... + +class InvalidContext(InvalidOperation): ... + +class Rounded(DecimalException): ... + +class Subnormal(DecimalException): ... + +class Overflow(Inexact, Rounded): ... + +class Underflow(Inexact, Rounded, Subnormal): ... + +if sys.version_info >= (3,): + class FloatOperation(DecimalException, TypeError): ... + +def setcontext(context: Context) -> None: ... +def getcontext() -> Context: ... +def localcontext(ctx: Optional[Context] = ...) -> _ContextManager: ... + +class Decimal(object): + def __new__(cls: Type[_DecimalT], value: _DecimalNew = ..., context: Optional[Context] = ...) -> _DecimalT: ... + @classmethod + def from_float(cls, f: float) -> Decimal: ... + if sys.version_info >= (3,): + def __bool__(self) -> bool: ... + else: + def __nonzero__(self) -> bool: ... + def __eq__(self, other: object, context: Optional[Context] = ...) -> bool: ... + if sys.version_info < (3,): + def __ne__(self, other: object, context: Optional[Context] = ...) -> bool: ... + def __lt__(self, other: _ComparableNum, context: Optional[Context] = ...) -> bool: ... + def __le__(self, other: _ComparableNum, context: Optional[Context] = ...) -> bool: ... + def __gt__(self, other: _ComparableNum, context: Optional[Context] = ...) -> bool: ... + def __ge__(self, other: _ComparableNum, context: Optional[Context] = ...) -> bool: ... + def compare(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __hash__(self) -> int: ... + def as_tuple(self) -> DecimalTuple: ... + if sys.version_info >= (3,): + def as_integer_ratio(self) -> Tuple[int, int]: ... + def __str__(self, eng: bool = ..., context: Optional[Context] = ...) -> str: ... + def to_eng_string(self, context: Optional[Context] = ...) -> str: ... + def __neg__(self, context: Optional[Context] = ...) -> Decimal: ... + def __pos__(self, context: Optional[Context] = ...) -> Decimal: ... + def __abs__(self, round: bool = ..., context: Optional[Context] = ...) -> Decimal: ... + def __add__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __radd__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __sub__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __rsub__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __mul__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __rmul__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __truediv__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __rtruediv__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + if sys.version_info < (3,): + def __div__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __rdiv__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __divmod__(self, other: _Decimal, context: Optional[Context] = ...) -> Tuple[Decimal, Decimal]: ... + def __rdivmod__(self, other: _Decimal, context: Optional[Context] = ...) -> Tuple[Decimal, Decimal]: ... + def __mod__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __rmod__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def remainder_near(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __floordiv__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __rfloordiv__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __float__(self) -> float: ... + def __int__(self) -> int: ... + def __trunc__(self) -> int: ... + @property + def real(self) -> Decimal: ... + @property + def imag(self) -> Decimal: ... + def conjugate(self) -> Decimal: ... + def __complex__(self) -> complex: ... + if sys.version_info >= (3,): + @overload + def __round__(self) -> int: ... + @overload + def __round__(self, ndigits: int) -> Decimal: ... + def __floor__(self) -> int: ... + def __ceil__(self) -> int: ... + else: + def __long__(self) -> long: ... + def fma(self, other: _Decimal, third: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __pow__(self, other: _Decimal, modulo: Optional[_Decimal] = ..., context: Optional[Context] = ...) -> Decimal: ... + def __rpow__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def normalize(self, context: Optional[Context] = ...) -> Decimal: ... + if sys.version_info >= (3,): + def quantize(self, exp: _Decimal, rounding: Optional[str] = ..., + context: Optional[Context] = ...) -> Decimal: ... + def same_quantum(self, other: _Decimal, context: Optional[Context] = ...) -> bool: ... + else: + def quantize(self, exp: _Decimal, rounding: Optional[str] = ..., + context: Optional[Context] = ..., watchexp: bool = ...) -> Decimal: ... + def same_quantum(self, other: _Decimal) -> bool: ... + def to_integral_exact(self, rounding: Optional[str] = ..., context: Optional[Context] = ...) -> Decimal: ... + def to_integral_value(self, rounding: Optional[str] = ..., context: Optional[Context] = ...) -> Decimal: ... + def to_integral(self, rounding: Optional[str] = ..., context: Optional[Context] = ...) -> Decimal: ... + def sqrt(self, context: Optional[Context] = ...) -> Decimal: ... + def max(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def min(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def adjusted(self) -> int: ... + if sys.version_info >= (3,): + def canonical(self) -> Decimal: ... + else: + def canonical(self, context: Optional[Context] = ...) -> Decimal: ... + def compare_signal(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + if sys.version_info >= (3,): + def compare_total(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def compare_total_mag(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + else: + def compare_total(self, other: _Decimal) -> Decimal: ... + def compare_total_mag(self, other: _Decimal) -> Decimal: ... + def copy_abs(self) -> Decimal: ... + def copy_negate(self) -> Decimal: ... + if sys.version_info >= (3,): + def copy_sign(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + else: + def copy_sign(self, other: _Decimal) -> Decimal: ... + def exp(self, context: Optional[Context] = ...) -> Decimal: ... + def is_canonical(self) -> bool: ... + def is_finite(self) -> bool: ... + def is_infinite(self) -> bool: ... + def is_nan(self) -> bool: ... + def is_normal(self, context: Optional[Context] = ...) -> bool: ... + def is_qnan(self) -> bool: ... + def is_signed(self) -> bool: ... + def is_snan(self) -> bool: ... + def is_subnormal(self, context: Optional[Context] = ...) -> bool: ... + def is_zero(self) -> bool: ... + def ln(self, context: Optional[Context] = ...) -> Decimal: ... + def log10(self, context: Optional[Context] = ...) -> Decimal: ... + def logb(self, context: Optional[Context] = ...) -> Decimal: ... + def logical_and(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def logical_invert(self, context: Optional[Context] = ...) -> Decimal: ... + def logical_or(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def logical_xor(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def max_mag(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def min_mag(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def next_minus(self, context: Optional[Context] = ...) -> Decimal: ... + def next_plus(self, context: Optional[Context] = ...) -> Decimal: ... + def next_toward(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def number_class(self, context: Optional[Context] = ...) -> str: ... + def radix(self) -> Decimal: ... + def rotate(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def scaleb(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def shift(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __reduce__(self) -> Tuple[Type[Decimal], Tuple[str]]: ... + def __copy__(self) -> Decimal: ... + def __deepcopy__(self, memo: Any) -> Decimal: ... + def __format__(self, specifier: str, context: Optional[Context] = ...) -> str: ... + +class _ContextManager(object): + new_context: Context + saved_context: Context + def __init__(self, new_context: Context) -> None: ... + def __enter__(self) -> Context: ... + def __exit__(self, t: Optional[Type[BaseException]], v: Optional[BaseException], tb: Optional[TracebackType]) -> None: ... + +_TrapType = Type[DecimalException] + +class Context(object): + prec: int + rounding: str + Emin: int + Emax: int + capitals: int + if sys.version_info >= (3,): + clamp: int + else: + _clamp: int + traps: Dict[_TrapType, bool] + flags: Dict[_TrapType, bool] + if sys.version_info >= (3,): + def __init__(self, prec: Optional[int] = ..., rounding: Optional[str] = ..., + Emin: Optional[int] = ..., Emax: Optional[int] = ..., + capitals: Optional[int] = ..., clamp: Optional[int] = ..., + flags: Union[None, Dict[_TrapType, bool], Container[_TrapType]] = ..., + traps: Union[None, Dict[_TrapType, bool], Container[_TrapType]] = ..., + _ignored_flags: Optional[List[_TrapType]] = ...) -> None: ... + else: + def __init__(self, prec: Optional[int] = ..., rounding: Optional[str] = ..., + traps: Union[None, Dict[_TrapType, bool], Container[_TrapType]] = ..., + flags: Union[None, Dict[_TrapType, bool], Container[_TrapType]] = ..., + Emin: Optional[int] = ..., Emax: Optional[int] = ..., + capitals: Optional[int] = ..., _clamp: Optional[int] = ..., + _ignored_flags: Optional[List[_TrapType]] = ...) -> None: ... + if sys.version_info >= (3,): + # __setattr__() only allows to set a specific set of attributes, + # already defined above. + def __delattr__(self, name: str) -> None: ... + def __reduce__(self) -> Tuple[Type[Context], Tuple[Any, ...]]: ... + def clear_flags(self) -> None: ... + if sys.version_info >= (3,): + def clear_traps(self) -> None: ... + def copy(self) -> Context: ... + def __copy__(self) -> Context: ... + __hash__: Any = ... + def Etiny(self) -> int: ... + def Etop(self) -> int: ... + def create_decimal(self, num: _DecimalNew = ...) -> Decimal: ... + def create_decimal_from_float(self, f: float) -> Decimal: ... + def abs(self, a: _Decimal) -> Decimal: ... + def add(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def canonical(self, a: Decimal) -> Decimal: ... + def compare(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def compare_signal(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def compare_total(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def compare_total_mag(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def copy_abs(self, a: _Decimal) -> Decimal: ... + def copy_decimal(self, a: _Decimal) -> Decimal: ... + def copy_negate(self, a: _Decimal) -> Decimal: ... + def copy_sign(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def divide(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def divide_int(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def divmod(self, a: _Decimal, b: _Decimal) -> Tuple[Decimal, Decimal]: ... + def exp(self, a: _Decimal) -> Decimal: ... + def fma(self, a: _Decimal, b: _Decimal, c: _Decimal) -> Decimal: ... + def is_canonical(self, a: _Decimal) -> bool: ... + def is_finite(self, a: _Decimal) -> bool: ... + def is_infinite(self, a: _Decimal) -> bool: ... + def is_nan(self, a: _Decimal) -> bool: ... + def is_normal(self, a: _Decimal) -> bool: ... + def is_qnan(self, a: _Decimal) -> bool: ... + def is_signed(self, a: _Decimal) -> bool: ... + def is_snan(self, a: _Decimal) -> bool: ... + def is_subnormal(self, a: _Decimal) -> bool: ... + def is_zero(self, a: _Decimal) -> bool: ... + def ln(self, a: _Decimal) -> Decimal: ... + def log10(self, a: _Decimal) -> Decimal: ... + def logb(self, a: _Decimal) -> Decimal: ... + def logical_and(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def logical_invert(self, a: _Decimal) -> Decimal: ... + def logical_or(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def logical_xor(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def max(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def max_mag(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def min(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def min_mag(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def minus(self, a: _Decimal) -> Decimal: ... + def multiply(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def next_minus(self, a: _Decimal) -> Decimal: ... + def next_plus(self, a: _Decimal) -> Decimal: ... + def next_toward(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def normalize(self, a: _Decimal) -> Decimal: ... + def number_class(self, a: _Decimal) -> str: ... + def plus(self, a: _Decimal) -> Decimal: ... + def power(self, a: _Decimal, b: _Decimal, modulo: Optional[_Decimal] = ...) -> Decimal: ... + def quantize(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def radix(self) -> Decimal: ... + def remainder(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def remainder_near(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def rotate(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def same_quantum(self, a: _Decimal, b: _Decimal) -> bool: ... + def scaleb(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def shift(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def sqrt(self, a: _Decimal) -> Decimal: ... + def subtract(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def to_eng_string(self, a: _Decimal) -> str: ... + def to_sci_string(self, a: _Decimal) -> str: ... + def to_integral_exact(self, a: _Decimal) -> Decimal: ... + def to_integral_value(self, a: _Decimal) -> Decimal: ... + def to_integral(self, a: _Decimal) -> Decimal: ... + +DefaultContext: Context +BasicContext: Context +ExtendedContext: Context diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/difflib.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/difflib.pyi new file mode 100644 index 0000000..ddcec11 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/difflib.pyi @@ -0,0 +1,87 @@ +# Based on https://docs.python.org/2.7/library/difflib.html and https://docs.python.org/3.2/library/difflib.html + +import sys +from typing import ( + TypeVar, Callable, Iterable, Iterator, List, NamedTuple, Sequence, Tuple, + Generic, Optional, Text, Union, AnyStr +) + +_T = TypeVar('_T') + +if sys.version_info >= (3,): + _StrType = Text +else: + # Aliases can't point to type vars, so we need to redeclare AnyStr + _StrType = TypeVar('_StrType', Text, bytes) + +_JunkCallback = Union[Callable[[Text], bool], Callable[[str], bool]] + +Match = NamedTuple('Match', [ + ('a', int), + ('b', int), + ('size', int), +]) + +class SequenceMatcher(Generic[_T]): + def __init__(self, isjunk: Optional[Callable[[_T], bool]] = ..., + a: Sequence[_T] = ..., b: Sequence[_T] = ..., + autojunk: bool = ...) -> None: ... + def set_seqs(self, a: Sequence[_T], b: Sequence[_T]) -> None: ... + def set_seq1(self, a: Sequence[_T]) -> None: ... + def set_seq2(self, b: Sequence[_T]) -> None: ... + def find_longest_match(self, alo: int, ahi: int, blo: int, + bhi: int) -> Match: ... + def get_matching_blocks(self) -> List[Match]: ... + def get_opcodes(self) -> List[Tuple[str, int, int, int, int]]: ... + def get_grouped_opcodes(self, n: int = ... + ) -> Iterable[List[Tuple[str, int, int, int, int]]]: ... + def ratio(self) -> float: ... + def quick_ratio(self) -> float: ... + def real_quick_ratio(self) -> float: ... + +def get_close_matches(word: Sequence[_T], possibilities: Iterable[Sequence[_T]], + n: int = ..., cutoff: float = ...) -> List[Sequence[_T]]: ... + +class Differ: + def __init__(self, linejunk: _JunkCallback = ..., charjunk: _JunkCallback = ...) -> None: ... + def compare(self, a: Sequence[_StrType], b: Sequence[_StrType]) -> Iterator[_StrType]: ... + +def IS_LINE_JUNK(line: _StrType) -> bool: ... +def IS_CHARACTER_JUNK(line: _StrType) -> bool: ... +def unified_diff(a: Sequence[_StrType], b: Sequence[_StrType], fromfile: _StrType = ..., + tofile: _StrType = ..., fromfiledate: _StrType = ..., tofiledate: _StrType = ..., + n: int = ..., lineterm: _StrType = ...) -> Iterator[_StrType]: ... +def context_diff(a: Sequence[_StrType], b: Sequence[_StrType], fromfile: _StrType = ..., + tofile: _StrType = ..., fromfiledate: _StrType = ..., tofiledate: _StrType = ..., + n: int = ..., lineterm: _StrType = ...) -> Iterator[_StrType]: ... +def ndiff(a: Sequence[_StrType], b: Sequence[_StrType], + linejunk: _JunkCallback = ..., + charjunk: _JunkCallback = ... + ) -> Iterator[_StrType]: ... + +class HtmlDiff(object): + def __init__(self, tabsize: int = ..., wrapcolumn: int = ..., + linejunk: _JunkCallback = ..., + charjunk: _JunkCallback = ... + ) -> None: ... + def make_file(self, fromlines: Sequence[_StrType], tolines: Sequence[_StrType], + fromdesc: _StrType = ..., todesc: _StrType = ..., context: bool = ..., + numlines: int = ...) -> _StrType: ... + def make_table(self, fromlines: Sequence[_StrType], tolines: Sequence[_StrType], + fromdesc: _StrType = ..., todesc: _StrType = ..., context: bool = ..., + numlines: int = ...) -> _StrType: ... + +def restore(delta: Iterable[_StrType], which: int) -> Iterator[_StrType]: ... + +if sys.version_info >= (3, 5): + def diff_bytes( + dfunc: Callable[[Sequence[str], Sequence[str], str, str, str, str, int, str], Iterator[str]], + a: Sequence[bytes], + b: Sequence[bytes], + fromfile: bytes = ..., + tofile: bytes = ..., + fromfiledate: bytes = ..., + tofiledate: bytes = ..., + n: int = ..., + lineterm: bytes = ... + ) -> Iterator[bytes]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/dis.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/dis.pyi new file mode 100644 index 0000000..0ef27f4 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/dis.pyi @@ -0,0 +1,77 @@ +from typing import Callable, List, Union, Iterator, Tuple, Optional, Any, IO, NamedTuple, Dict + +import sys +import types + +from opcode import (hasconst as hasconst, hasname as hasname, hasjrel as hasjrel, + hasjabs as hasjabs, haslocal as haslocal, hascompare as hascompare, + hasfree as hasfree, cmp_op as cmp_op, opname as opname, opmap as opmap, + HAVE_ARGUMENT as HAVE_ARGUMENT, EXTENDED_ARG as EXTENDED_ARG) + +if sys.version_info >= (3, 4): + from opcode import stack_effect as stack_effect + +if sys.version_info >= (3, 6): + from opcode import hasnargs as hasnargs + +# Strictly this should not have to include Callable, but mypy doesn't use FunctionType +# for functions (python/mypy#3171) +_have_code = Union[types.MethodType, types.FunctionType, types.CodeType, type, Callable[..., Any]] +_have_code_or_string = Union[_have_code, str, bytes] + + +if sys.version_info >= (3, 4): + Instruction = NamedTuple( + "Instruction", + [ + ('opname', str), + ('opcode', int), + ('arg', Optional[int]), + ('argval', Any), + ('argrepr', str), + ('offset', int), + ('starts_line', Optional[int]), + ('is_jump_target', bool) + ] + ) + + class Bytecode: + codeobj: types.CodeType + first_line: int + def __init__(self, x: _have_code_or_string, *, first_line: Optional[int] = ..., + current_offset: Optional[int] = ...) -> None: ... + def __iter__(self) -> Iterator[Instruction]: ... + def __repr__(self) -> str: ... + def info(self) -> str: ... + def dis(self) -> str: ... + + @classmethod + def from_traceback(cls, tb: types.TracebackType) -> Bytecode: ... + + +COMPILER_FLAG_NAMES: Dict[int, str] + + +def findlabels(code: _have_code) -> List[int]: ... +def findlinestarts(code: _have_code) -> Iterator[Tuple[int, int]]: ... + +if sys.version_info >= (3, 0): + def pretty_flags(flags: int) -> str: ... + def code_info(x: _have_code_or_string) -> str: ... + +if sys.version_info >= (3, 4): + def dis(x: _have_code_or_string = ..., *, file: Optional[IO[str]] = ...) -> None: ... + def distb(tb: Optional[types.TracebackType] = ..., *, file: Optional[IO[str]] = ...) -> None: ... + def disassemble(co: _have_code, lasti: int = ..., *, file: Optional[IO[str]] = ...) -> None: ... + def disco(co: _have_code, lasti: int = ..., *, file: Optional[IO[str]] = ...) -> None: ... + def show_code(co: _have_code, *, file: Optional[IO[str]] = ...) -> None: ... + + def get_instructions(x: _have_code, *, first_line: Optional[int] = ...) -> Iterator[Instruction]: ... +else: + def dis(x: _have_code_or_string = ...) -> None: ... + def distb(tb: types.TracebackType = ...) -> None: ... + def disassemble(co: _have_code, lasti: int = ...) -> None: ... + def disco(co: _have_code, lasti: int = ...) -> None: ... + + if sys.version_info >= (3, 0): + def show_code(co: _have_code) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/__init__.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/archive_util.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/archive_util.pyi new file mode 100644 index 0000000..12172f3 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/archive_util.pyi @@ -0,0 +1,12 @@ +# Stubs for distutils.archive_util + +from typing import Optional + + +def make_archive(base_name: str, format: str, root_dir: Optional[str] = ..., + base_dir: Optional[str] = ..., verbose: int = ..., + dry_run: int = ...) -> str: ... +def make_tarball(base_name: str, base_dir: str, compress: Optional[str] = ..., + verbose: int = ..., dry_run: int = ...) -> str: ... +def make_zipfile(base_name: str, base_dir: str, verbose: int = ..., + dry_run: int = ...) -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/bcppcompiler.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/bcppcompiler.pyi new file mode 100644 index 0000000..9f27a0a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/bcppcompiler.pyi @@ -0,0 +1,6 @@ +# Stubs for distutils.bcppcompiler + +from distutils.ccompiler import CCompiler + + +class BCPPCompiler(CCompiler): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/ccompiler.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/ccompiler.pyi new file mode 100644 index 0000000..94fad8b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/ccompiler.pyi @@ -0,0 +1,119 @@ +# Stubs for distutils.ccompiler + +from typing import Any, Callable, List, Optional, Tuple, Union + + +_Macro = Union[Tuple[str], Tuple[str, str]] + + +def gen_lib_options(compiler: CCompiler, library_dirs: List[str], + runtime_library_dirs: List[str], + libraries: List[str]) -> List[str]: ... +def gen_preprocess_options(macros: List[_Macro], + include_dirs: List[str]) -> List[str]: ... +def get_default_compiler(osname: Optional[str] = ..., + platform: Optional[str] = ...) -> str: ... +def new_compiler(plat: Optional[str] = ..., compiler: Optional[str] = ..., + verbose: int = ..., dry_run: int = ..., + force: int = ...) -> CCompiler: ... +def show_compilers() -> None: ... + +class CCompiler: + def __init__(self, verbose: int = ..., dry_run: int = ..., + force: int = ...) -> None: ... + def add_include_dir(self, dir: str) -> None: ... + def set_include_dirs(self, dirs: List[str]) -> None: ... + def add_library(self, libname: str) -> None: ... + def set_libraries(self, libnames: List[str]) -> None: ... + def add_library_dir(self, dir: str) -> None: ... + def set_library_dirs(self, dirs: List[str]) -> None: ... + def add_runtime_library_dir(self, dir: str) -> None: ... + def set_runtime_library_dirs(self, dirs: List[str]) -> None: ... + def define_macro(self, name: str, value: Optional[str] = ...) -> None: ... + def undefine_macro(self, name: str) -> None: ... + def add_link_object(self, object: str) -> None: ... + def set_link_objects(self, objects: List[str]) -> None: ... + def detect_language(self, sources: Union[str, List[str]]) -> Optional[str]: ... + def find_library_file(self, dirs: List[str], lib: str, + debug: bool = ...) -> Optional[str]: ... + def has_function(self, funcname: str, includes: Optional[List[str]] = ..., + include_dirs: Optional[List[str]] = ..., + libraries: Optional[List[str]] = ..., + library_dirs: Optional[List[str]] = ...) -> bool: ... + def library_dir_option(self, dir: str) -> str: ... + def library_option(self, lib: str) -> str: ... + def runtime_library_dir_option(self, dir: str) -> str: ... + def set_executables(self, **args: str) -> None: ... + def compile(self, sources: List[str], output_dir: Optional[str] = ..., + macros: Optional[_Macro] = ..., + include_dirs: Optional[List[str]] = ..., debug: bool = ..., + extra_preargs: Optional[List[str]] = ..., + extra_postargs: Optional[List[str]] = ..., + depends: Optional[List[str]] = ...) -> List[str]: ... + def create_static_lib(self, objects: List[str], output_libname: str, + output_dir: Optional[str] = ..., debug: bool = ..., + target_lang: Optional[str] = ...) -> None: ... + def link(self, target_desc: str, objects: List[str], output_filename: str, + output_dir: Optional[str] = ..., + libraries: Optional[List[str]] = ..., + library_dirs: Optional[List[str]] = ..., + runtime_library_dirs: Optional[List[str]] = ..., + export_symbols: Optional[List[str]] = ..., debug: bool = ..., + extra_preargs: Optional[List[str]] = ..., + extra_postargs: Optional[List[str]] = ..., + build_temp: Optional[str] = ..., + target_lang: Optional[str] = ...) -> None: ... + def link_executable(self, objects: List[str], output_progname: str, + output_dir: Optional[str] = ..., + libraries: Optional[List[str]] = ..., + library_dirs: Optional[List[str]] = ..., + runtime_library_dirs: Optional[List[str]] = ..., + debug: bool = ..., + extra_preargs: Optional[List[str]] = ..., + extra_postargs: Optional[List[str]] = ..., + target_lang: Optional[str] = ...) -> None: ... + def link_shared_lib(self, objects: List[str], output_libname: str, + output_dir: Optional[str] = ..., + libraries: Optional[List[str]] = ..., + library_dirs: Optional[List[str]] = ..., + runtime_library_dirs: Optional[List[str]] = ..., + export_symbols: Optional[List[str]] = ..., + debug: bool = ..., + extra_preargs: Optional[List[str]] = ..., + extra_postargs: Optional[List[str]] = ..., + build_temp: Optional[str] = ..., + target_lang: Optional[str] = ...) -> None: ... + def link_shared_object(self, objects: List[str], output_filename: str, + output_dir: Optional[str] = ..., + libraries: Optional[List[str]] = ..., + library_dirs: Optional[List[str]] = ..., + runtime_library_dirs: Optional[List[str]] = ..., + export_symbols: Optional[List[str]] = ..., + debug: bool = ..., + extra_preargs: Optional[List[str]] = ..., + extra_postargs: Optional[List[str]] = ..., + build_temp: Optional[str] = ..., + target_lang: Optional[str] = ...) -> None: ... + def preprocess(self, source: str, output_file: Optional[str] = ..., + macros: Optional[List[_Macro]] = ..., + include_dirs: Optional[List[str]] = ..., + extra_preargs: Optional[List[str]] = ..., + extra_postargs: Optional[List[str]] = ...) -> None: ... + def executable_filename(self, basename: str, strip_dir: int = ..., + output_dir: str = ...) -> str: ... + def library_filename(self, libname: str, lib_type: str = ..., + strip_dir: int = ..., + output_dir: str = ...) -> str: ... + def object_filenames(self, source_filenames: List[str], + strip_dir: int = ..., + output_dir: str = ...) -> List[str]: ... + def shared_object_filename(self, basename: str, strip_dir: int = ..., + output_dir: str = ...) -> str: ... + def execute(self, func: Callable[..., None], args: Tuple[Any, ...], + msg: Optional[str] = ..., level: int = ...) -> None: ... + def spawn(self, cmd: List[str]) -> None: ... + def mkpath(self, name: str, mode: int = ...) -> None: ... + def move_file(self, src: str, dst: str) -> str: ... + def announce(self, msg: str, level: int = ...) -> None: ... + def warn(self, msg: str) -> None: ... + def debug_print(self, msg: str) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/cmd.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/cmd.pyi new file mode 100644 index 0000000..2ec5a50 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/cmd.pyi @@ -0,0 +1,40 @@ +# Stubs for distutils.cmd + +from typing import Callable, List, Tuple, Union, Optional, Iterable, Any, Text +from abc import abstractmethod +from distutils.dist import Distribution + +class Command: + sub_commands: List[Tuple[str, Union[Callable[[], bool], str, None]]] + def __init__(self, dist: Distribution) -> None: ... + @abstractmethod + def initialize_options(self) -> None: ... + @abstractmethod + def finalize_options(self) -> None: ... + @abstractmethod + def run(self) -> None: ... + + def announce(self, msg: Text, level: int = ...) -> None: ... + def debug_print(self, msg: Text) -> None: ... + + def ensure_string(self, option: str, default: Optional[str] = ...) -> None: ... + def ensure_string_list(self, option: Union[str, List[str]]) -> None: ... + def ensure_filename(self, option: str) -> None: ... + def ensure_dirname(self, option: str) -> None: ... + + def get_command_name(self) -> str: ... + def set_undefined_options(self, src_cmd: Text, *option_pairs: Tuple[str, str]) -> None: ... + def get_finalized_command(self, command: Text, create: int = ...) -> Command: ... + def reinitialize_command(self, command: Union[Command, Text], reinit_subcommands: int = ...) -> Command: ... + def run_command(self, command: Text) -> None: ... + def get_sub_commands(self) -> List[str]: ... + + def warn(self, msg: Text) -> None: ... + def execute(self, func: Callable[..., Any], args: Iterable[Any], msg: Optional[Text] = ..., level: int = ...) -> None: ... + def mkpath(self, name: str, mode: int = ...) -> None: ... + def copy_file(self, infile: str, outfile: str, preserve_mode: int = ..., preserve_times: int = ..., link: Optional[str] = ..., level: Any = ...) -> Tuple[str, bool]: ... # level is not used + def copy_tree(self, infile: str, outfile: str, preserve_mode: int = ..., preserve_times: int = ..., preserve_symlinks: int = ..., level: Any = ...) -> List[str]: ... # level is not used + def move_file(self, src: str, dest: str, level: Any = ...) -> str: ... # level is not used + def spawn(self, cmd: Iterable[str], search_path: int = ..., level: Any = ...) -> None: ... # level is not used + def make_archive(self, base_name: str, format: str, root_dir: Optional[str] = ..., base_dir: Optional[str] = ..., owner: Optional[str] = ..., group: Optional[str] = ...) -> str: ... + def make_file(self, infiles: Union[str, List[str], Tuple[str]], outfile: str, func: Callable[..., Any], args: List[Any], exec_msg: Optional[str] = ..., skip_msg: Optional[str] = ..., level: Any = ...) -> None: ... # level is not used diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/__init__.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/bdist.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/bdist.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/bdist_dumb.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/bdist_dumb.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/bdist_msi.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/bdist_msi.pyi new file mode 100644 index 0000000..a761792 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/bdist_msi.pyi @@ -0,0 +1,6 @@ +from distutils.cmd import Command + +class bdist_msi(Command): + def initialize_options(self) -> None: ... + def finalize_options(self) -> None: ... + def run(self) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/bdist_packager.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/bdist_packager.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/bdist_rpm.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/bdist_rpm.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/bdist_wininst.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/bdist_wininst.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/build.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/build.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/build_clib.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/build_clib.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/build_ext.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/build_ext.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/build_py.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/build_py.pyi new file mode 100644 index 0000000..34753e4 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/build_py.pyi @@ -0,0 +1,10 @@ +from distutils.cmd import Command +import sys + +if sys.version_info >= (3,): + class build_py(Command): + def initialize_options(self) -> None: ... + def finalize_options(self) -> None: ... + def run(self) -> None: ... + + class build_py_2to3(build_py): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/build_scripts.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/build_scripts.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/check.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/check.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/clean.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/clean.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/config.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/config.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/install.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/install.pyi new file mode 100644 index 0000000..94a9008 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/install.pyi @@ -0,0 +1,14 @@ +from distutils.cmd import Command +from typing import Optional, Text + + +class install(Command): + user: bool + prefix: Optional[Text] + home: Optional[Text] + root: Optional[Text] + install_lib: Optional[Text] + + def initialize_options(self) -> None: ... + def finalize_options(self) -> None: ... + def run(self) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/install_data.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/install_data.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/install_headers.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/install_headers.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/install_lib.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/install_lib.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/install_scripts.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/install_scripts.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/register.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/register.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/sdist.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/sdist.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/core.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/core.pyi new file mode 100644 index 0000000..125b799 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/core.pyi @@ -0,0 +1,50 @@ +# Stubs for distutils.core + +from typing import Any, List, Mapping, Optional, Tuple, Type, Union +from distutils.cmd import Command as Command +from distutils.dist import Distribution as Distribution +from distutils.extension import Extension as Extension + +def setup(name: str = ..., + version: str = ..., + description: str = ..., + long_description: str = ..., + author: str = ..., + author_email: str = ..., + maintainer: str = ..., + maintainer_email: str = ..., + url: str = ..., + download_url: str = ..., + packages: List[str] = ..., + py_modules: List[str] = ..., + scripts: List[str] = ..., + ext_modules: List[Extension] = ..., + classifiers: List[str] = ..., + distclass: Type[Distribution] = ..., + script_name: str = ..., + script_args: List[str] = ..., + options: Mapping[str, Any] = ..., + license: str = ..., + keywords: Union[List[str], str] = ..., + platforms: Union[List[str], str] = ..., + cmdclass: Mapping[str, Type[Command]] = ..., + data_files: List[Tuple[str, List[str]]] = ..., + package_dir: Mapping[str, str] = ..., + obsoletes: List[str] = ..., + provides: List[str] = ..., + requires: List[str] = ..., + command_packages: List[str] = ..., + command_options: Mapping[str, Mapping[str, Tuple[Any, Any]]] = ..., + package_data: Mapping[str, List[str]] = ..., + include_package_data: bool = ..., + libraries: List[str] = ..., + headers: List[str] = ..., + ext_package: str = ..., + include_dirs: List[str] = ..., + password: str = ..., + fullname: str = ..., + **attrs: Any) -> None: ... + +def run_setup(script_name: str, + script_args: Optional[List[str]] = ..., + stop_after: str = ...) -> Distribution: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/cygwinccompiler.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/cygwinccompiler.pyi new file mode 100644 index 0000000..1bfab90 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/cygwinccompiler.pyi @@ -0,0 +1,7 @@ +# Stubs for distutils.cygwinccompiler + +from distutils.unixccompiler import UnixCCompiler + + +class CygwinCCompiler(UnixCCompiler): ... +class Mingw32CCompiler(CygwinCCompiler): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/debug.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/debug.pyi new file mode 100644 index 0000000..76de447 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/debug.pyi @@ -0,0 +1,3 @@ +# Stubs for distutils.debug + +DEBUG: bool diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/dep_util.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/dep_util.pyi new file mode 100644 index 0000000..7df5847 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/dep_util.pyi @@ -0,0 +1,8 @@ +# Stubs for distutils.dep_util + +from typing import List, Tuple + +def newer(source: str, target: str) -> bool: ... +def newer_pairwise(sources: List[str], + targets: List[str]) -> List[Tuple[str, str]]: ... +def newer_group(sources: List[str], target: str, missing: str = ...) -> bool: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/dir_util.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/dir_util.pyi new file mode 100644 index 0000000..667ac2f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/dir_util.pyi @@ -0,0 +1,15 @@ +# Stubs for distutils.dir_util + +from typing import List + + +def mkpath(name: str, mode: int = ..., verbose: int = ..., + dry_run: int = ...) -> List[str]: ... +def create_tree(base_dir: str, files: List[str], mode: int = ..., + verbose: int = ..., dry_run: int = ...) -> None: ... +def copy_tree(src: str, dst: str, preserve_mode: int = ..., + preserve_times: int = ..., preserve_symlinks: int = ..., + update: int = ..., verbose: int = ..., + dry_run: int = ...) -> List[str]: ... +def remove_tree(directory: str, verbose: int = ..., + dry_run: int = ...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/dist.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/dist.pyi new file mode 100644 index 0000000..65e766d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/dist.pyi @@ -0,0 +1,11 @@ +# Stubs for distutils.dist +from distutils.cmd import Command + +from typing import Any, Mapping, Optional, Dict, Tuple, Iterable, Text + + +class Distribution: + def __init__(self, attrs: Optional[Mapping[str, Any]] = ...) -> None: ... + def get_option_dict(self, command: str) -> Dict[str, Tuple[str, Text]]: ... + def parse_config_files(self, filenames: Optional[Iterable[Text]] = ...) -> None: ... + def get_command_obj(self, command: str, create: bool = ...) -> Optional[Command]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/errors.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/errors.pyi new file mode 100644 index 0000000..e483362 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/errors.pyi @@ -0,0 +1,19 @@ +class DistutilsError(Exception): ... +class DistutilsModuleError(DistutilsError): ... +class DistutilsClassError(DistutilsError): ... +class DistutilsGetoptError(DistutilsError): ... +class DistutilsArgError(DistutilsError): ... +class DistutilsFileError(DistutilsError): ... +class DistutilsOptionError(DistutilsError): ... +class DistutilsSetupError(DistutilsError): ... +class DistutilsPlatformError(DistutilsError): ... +class DistutilsExecError(DistutilsError): ... +class DistutilsInternalError(DistutilsError): ... +class DistutilsTemplateError(DistutilsError): ... +class DistutilsByteCompileError(DistutilsError): ... +class CCompilerError(Exception): ... +class PreprocessError(CCompilerError): ... +class CompileError(CCompilerError): ... +class LibError(CCompilerError): ... +class LinkError(CCompilerError): ... +class UnknownFileError(CCompilerError): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/extension.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/extension.pyi new file mode 100644 index 0000000..5aa070e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/extension.pyi @@ -0,0 +1,39 @@ +# Stubs for distutils.extension + +from typing import List, Optional, Tuple +import sys + +class Extension: + if sys.version_info >= (3,): + def __init__(self, + name: str, + sources: List[str], + include_dirs: List[str] = ..., + define_macros: List[Tuple[str, Optional[str]]] = ..., + undef_macros: List[str] = ..., + library_dirs: List[str] = ..., + libraries: List[str] = ..., + runtime_library_dirs: List[str] = ..., + extra_objects: List[str] = ..., + extra_compile_args: List[str] = ..., + extra_link_args: List[str] = ..., + export_symbols: List[str] = ..., + depends: List[str] = ..., + language: str = ..., + optional: bool = ...) -> None: ... + else: + def __init__(self, + name: str, + sources: List[str], + include_dirs: List[str] = ..., + define_macros: List[Tuple[str, Optional[str]]] = ..., + undef_macros: List[str] = ..., + library_dirs: List[str] = ..., + libraries: List[str] = ..., + runtime_library_dirs: List[str] = ..., + extra_objects: List[str] = ..., + extra_compile_args: List[str] = ..., + extra_link_args: List[str] = ..., + export_symbols: List[str] = ..., + depends: List[str] = ..., + language: str = ...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/fancy_getopt.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/fancy_getopt.pyi new file mode 100644 index 0000000..aa7e964 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/fancy_getopt.pyi @@ -0,0 +1,27 @@ +# Stubs for distutils.fancy_getopt + +from typing import ( + Any, List, Mapping, Optional, Tuple, Union, + TypeVar, overload, +) + +_Option = Tuple[str, str, str] +_GR = Tuple[List[str], OptionDummy] + +def fancy_getopt(options: List[_Option], + negative_opt: Mapping[_Option, _Option], + object: Any, + args: Optional[List[str]]) -> Union[List[str], _GR]: ... +def wrap_text(text: str, width: int) -> List[str]: ... + +class FancyGetopt: + def __init__(self, option_table: Optional[List[_Option]] = ...) -> None: ... + # TODO kinda wrong, `getopt(object=object())` is invalid + @overload + def getopt(self, args: Optional[List[str]] = ...) -> _GR: ... + @overload + def getopt(self, args: Optional[List[str]], object: Any) -> List[str]: ... + def get_option_order(self) -> List[Tuple[str, str]]: ... + def generate_help(self, header: Optional[str] = ...) -> List[str]: ... + +class OptionDummy: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/file_util.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/file_util.pyi new file mode 100644 index 0000000..6324d63 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/file_util.pyi @@ -0,0 +1,12 @@ +# Stubs for distutils.file_util + +from typing import Optional, Sequence, Tuple + + +def copy_file(src: str, dst: str, preserve_mode: bool = ..., + preserve_times: bool = ..., update: bool = ..., + link: Optional[str] = ..., verbose: bool = ..., + dry_run: bool = ...) -> Tuple[str, str]: ... +def move_file(src: str, dst: str, verbose: bool = ..., + dry_run: bool = ...) -> str: ... +def write_file(filename: str, contents: Sequence[str]) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/filelist.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/filelist.pyi new file mode 100644 index 0000000..4ecaeba --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/filelist.pyi @@ -0,0 +1,3 @@ +# Stubs for distutils.filelist + +class FileList: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/log.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/log.pyi new file mode 100644 index 0000000..6c37cc5 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/log.pyi @@ -0,0 +1,28 @@ +from typing import Any, Callable, Iterable, Text + +DEBUG: int +INFO: int +WARN: int +ERROR: int +FATAL: int + +class Log: + def __init__(self, threshold: int = ...) -> None: ... + def log(self, level: int, msg: Text, *args: Any) -> None: ... + def debug(self, msg: Text, *args: Any) -> None: ... + def info(self, msg: Text, *args: Any) -> None: ... + def warn(self, msg: Text, *args: Any) -> None: ... + def error(self, msg: Text, *args: Any) -> None: ... + def fatal(self, msg: Text, *args: Any) -> None: ... + +_LogFunc = Callable[[Text, Iterable[Any]], None] + +log: Callable[[int, Text, Iterable[Any]], None] +debug: _LogFunc +info: _LogFunc +warn: _LogFunc +error: _LogFunc +fatal: _LogFunc + +def set_threshold(level: int) -> int: ... +def set_verbosity(v: int) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/msvccompiler.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/msvccompiler.pyi new file mode 100644 index 0000000..ffc9e44 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/msvccompiler.pyi @@ -0,0 +1,6 @@ +# Stubs for distutils.msvccompiler + +from distutils.ccompiler import CCompiler + + +class MSVCCompiler(CCompiler): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/spawn.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/spawn.pyi new file mode 100644 index 0000000..8df9eba --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/spawn.pyi @@ -0,0 +1,8 @@ +# Stubs for distutils.spawn + +from typing import List, Optional + +def spawn(cmd: List[str], search_path: bool = ..., + verbose: bool = ..., dry_run: bool = ...) -> None: ... +def find_executable(executable: str, + path: Optional[str] = ...) -> Optional[str]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/sysconfig.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/sysconfig.pyi new file mode 100644 index 0000000..62fa9af --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/sysconfig.pyi @@ -0,0 +1,19 @@ +# Stubs for distutils.sysconfig + +from typing import Mapping, Optional, Union +from distutils.ccompiler import CCompiler + +PREFIX: str +EXEC_PREFIX: str + +def get_config_var(name: str) -> Union[int, str, None]: ... +def get_config_vars(*args: str) -> Mapping[str, Union[int, str]]: ... +def get_config_h_filename() -> str: ... +def get_makefile_filename() -> str: ... +def get_python_inc(plat_specific: bool = ..., + prefix: Optional[str] = ...) -> str: ... +def get_python_lib(plat_specific: bool = ..., standard_lib: bool = ..., + prefix: Optional[str] = ...) -> str: ... + +def customize_compiler(compiler: CCompiler) -> None: ... +def set_python_build() -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/text_file.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/text_file.pyi new file mode 100644 index 0000000..8f90d41 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/text_file.pyi @@ -0,0 +1,18 @@ +# Stubs for distutils.text_file + +from typing import IO, List, Optional, Tuple, Union + +class TextFile: + def __init__(self, filename: Optional[str] = ..., + file: Optional[IO[str]] = ..., + *, strip_comments: bool = ..., + lstrip_ws: bool = ..., rstrip_ws: bool = ..., + skip_blanks: bool = ..., join_lines: bool = ..., + collapse_join: bool = ...) -> None: ... + def open(self, filename: str) -> None: ... + def close(self) -> None: ... + def warn(self, msg: str, + line: Union[List[int], Tuple[int, int], int] = ...) -> None: ... + def readline(self) -> Optional[str]: ... + def readlines(self) -> List[str]: ... + def unreadline(self, line: str) -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/unixccompiler.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/unixccompiler.pyi new file mode 100644 index 0000000..7ab7298 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/unixccompiler.pyi @@ -0,0 +1,6 @@ +# Stubs for distutils.unixccompiler + +from distutils.ccompiler import CCompiler + + +class UnixCCompiler(CCompiler): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/util.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/util.pyi new file mode 100644 index 0000000..942886d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/util.pyi @@ -0,0 +1,20 @@ +# Stubs for distutils.util + +from typing import Any, Callable, List, Mapping, Optional, Tuple + + +def get_platform() -> str: ... +def convert_path(pathname: str) -> str: ... +def change_root(new_root: str, pathname: str) -> str: ... +def check_environ() -> None: ... +def subst_vars(s: str, local_vars: Mapping[str, str]) -> None: ... +def split_quoted(s: str) -> List[str]: ... +def execute(func: Callable[..., None], args: Tuple[Any, ...], + msg: Optional[str] = ..., verbose: bool = ..., + dry_run: bool = ...) -> None: ... +def strtobool(val: str) -> bool: ... +def byte_compile(py_files: List[str], optimize: int = ..., force: bool = ..., + prefix: Optional[str] = ..., base_dir: Optional[str] = ..., + verbose: bool = ..., dry_run: bool = ..., + direct: Optional[bool] = ...) -> None: ... +def rfc822_escape(header: str) -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/version.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/version.pyi new file mode 100644 index 0000000..cb636b4 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/distutils/version.pyi @@ -0,0 +1,54 @@ +import sys +from abc import abstractmethod +from typing import Any, Optional, TypeVar, Union, Pattern, Text, Tuple + +_T = TypeVar('_T', bound='Version') + +class Version: + def __repr__(self) -> str: ... + + if sys.version_info >= (3,): + def __eq__(self, other: object) -> bool: ... + def __lt__(self: _T, other: Union[_T, str]) -> bool: ... + def __le__(self: _T, other: Union[_T, str]) -> bool: ... + def __gt__(self: _T, other: Union[_T, str]) -> bool: ... + def __ge__(self: _T, other: Union[_T, str]) -> bool: ... + + @abstractmethod + def __init__(self, vstring: Optional[Text] = ...) -> None: ... + @abstractmethod + def parse(self: _T, vstring: Text) -> _T: ... + @abstractmethod + def __str__(self) -> str: ... + if sys.version_info >= (3,): + @abstractmethod + def _cmp(self: _T, other: Union[_T, str]) -> bool: ... + else: + @abstractmethod + def __cmp__(self: _T, other: Union[_T, str]) -> bool: ... + +class StrictVersion(Version): + version_re: Pattern[str] + version: Tuple[int, int, int] + prerelease: Optional[Tuple[Text, int]] + + def __init__(self, vstring: Optional[Text] = ...) -> None: ... + def parse(self: _T, vstring: Text) -> _T: ... + def __str__(self) -> str: ... + if sys.version_info >= (3,): + def _cmp(self: _T, other: Union[_T, str]) -> bool: ... + else: + def __cmp__(self: _T, other: Union[_T, str]) -> bool: ... + +class LooseVersion(Version): + component_re: Pattern[str] + vstring: Text + version: Tuple[Union[Text, int], ...] + + def __init__(self, vstring: Optional[Text] = ...) -> None: ... + def parse(self: _T, vstring: Text) -> _T: ... + def __str__(self) -> str: ... + if sys.version_info >= (3,): + def _cmp(self: _T, other: Union[_T, str]) -> bool: ... + else: + def __cmp__(self: _T, other: Union[_T, str]) -> bool: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/doctest.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/doctest.pyi new file mode 100644 index 0000000..8151fb5 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/doctest.pyi @@ -0,0 +1,161 @@ +from typing import Any, Callable, Dict, List, NamedTuple, Optional, Tuple, Type, Union + +import sys +import types +import unittest + +TestResults = NamedTuple('TestResults', [ + ('failed', int), + ('attempted', int), +]) + +OPTIONFLAGS_BY_NAME: Dict[str, int] +def register_optionflag(name: str) -> int: ... +DONT_ACCEPT_TRUE_FOR_1: int +DONT_ACCEPT_BLANKLINE: int +NORMALIZE_WHITESPACE: int +ELLIPSIS: int +SKIP: int +IGNORE_EXCEPTION_DETAIL: int + +COMPARISON_FLAGS: int + +REPORT_UDIFF: int +REPORT_CDIFF: int +REPORT_NDIFF: int +REPORT_ONLY_FIRST_FAILURE: int +if sys.version_info >= (3, 4): + FAIL_FAST: int + +REPORTING_FLAGS: int + +BLANKLINE_MARKER: str +ELLIPSIS_MARKER: str + +class Example: + source: str + want: str + exc_msg: Optional[str] + lineno: int + indent: int + options: Dict[int, bool] + def __init__(self, source: str, want: str, exc_msg: Optional[str] = ..., lineno: int = ..., indent: int = ..., + options: Optional[Dict[int, bool]] = ...) -> None: ... + def __hash__(self) -> int: ... + +class DocTest: + examples: List[Example] + globs: Dict[str, Any] + name: str + filename: Optional[str] + lineno: Optional[int] + docstring: Optional[str] + def __init__(self, examples: List[Example], globs: Dict[str, Any], name: str, filename: Optional[str], lineno: Optional[int], docstring: Optional[str]) -> None: ... + def __hash__(self) -> int: ... + def __lt__(self, other: DocTest) -> bool: ... + +class DocTestParser: + def parse(self, string: str, name: str = ...) -> List[Union[str, Example]]: ... + def get_doctest(self, string: str, globs: Dict[str, Any], name: str, filename: Optional[str], lineno: Optional[str]) -> DocTest: ... + def get_examples(self, strin: str, name: str = ...) -> List[Example]: ... + +class DocTestFinder: + def __init__(self, verbose: bool = ..., parser: DocTestParser = ..., + recurse: bool = ..., exclude_empty: bool = ...) -> None: ... + def find(self, obj: object, name: Optional[str] = ..., module: Union[None, bool, types.ModuleType] = ..., + globs: Optional[Dict[str, Any]] = ..., extraglobs: Optional[Dict[str, Any]] = ...) -> List[DocTest]: ... + +_Out = Callable[[str], Any] +_ExcInfo = Tuple[Type[BaseException], BaseException, types.TracebackType] + +class DocTestRunner: + DIVIDER: str + optionflags: int + original_optionflags: int + tries: int + failures: int + test: DocTest + + def __init__(self, checker: Optional[OutputChecker] = ..., verbose: Optional[bool] = ..., optionflags: int = ...) -> None: ... + def report_start(self, out: _Out, test: DocTest, example: Example) -> None: ... + def report_success(self, out: _Out, test: DocTest, example: Example, got: str) -> None: ... + def report_failure(self, out: _Out, test: DocTest, example: Example, got: str) -> None: ... + def report_unexpected_exception(self, out: _Out, test: DocTest, example: Example, exc_info: _ExcInfo) -> None: ... + def run(self, test: DocTest, compileflags: Optional[int] = ..., out: Optional[_Out] = ..., clear_globs: bool = ...) -> TestResults: ... + def summarize(self, verbose: Optional[bool] = ...) -> TestResults: ... + def merge(self, other: DocTestRunner) -> None: ... + +class OutputChecker: + def check_output(self, want: str, got: str, optionflags: int) -> bool: ... + def output_difference(self, example: Example, got: str, optionflags: int) -> str: ... + +class DocTestFailure(Exception): + test: DocTest + example: Example + got: str + + def __init__(self, test: DocTest, example: Example, got: str) -> None: ... + +class UnexpectedException(Exception): + test: DocTest + example: Example + exc_info: _ExcInfo + + def __init__(self, test: DocTest, example: Example, exc_info: _ExcInfo) -> None: ... + +class DebugRunner(DocTestRunner): ... + +master: Optional[DocTestRunner] + +def testmod(m: Optional[types.ModuleType] = ..., name: Optional[str] = ..., globs: Dict[str, Any] = ..., verbose: Optional[bool] = ..., + report: bool = ..., optionflags: int = ..., extraglobs: Dict[str, Any] = ..., + raise_on_error: bool = ..., exclude_empty: bool = ...) -> TestResults: ... +def testfile(filename: str, module_relative: bool = ..., name: Optional[str] = ..., package: Union[None, str, types.ModuleType] = ..., + globs: Optional[Dict[str, Any]] = ..., verbose: Optional[bool] = ..., report: bool = ..., optionflags: int = ..., + extraglobs: Optional[Dict[str, Any]] = ..., raise_on_error: bool = ..., parser: DocTestParser = ..., + encoding: Optional[str] = ...) -> TestResults: ... +def run_docstring_examples(f: object, globs: Dict[str, Any], verbose: bool = ..., name: str = ..., + compileflags: Optional[int] = ..., optionflags: int = ...) -> None: ... +def set_unittest_reportflags(flags: int) -> int: ... + +class DocTestCase(unittest.TestCase): + def __init__(self, test: DocTest, optionflags: int = ..., setUp: Optional[Callable[[DocTest], Any]] = ..., + tearDown: Optional[Callable[[DocTest], Any]] = ..., + checker: Optional[OutputChecker] = ...) -> None: ... + def setUp(self) -> None: ... + def tearDown(self) -> None: ... + def runTest(self) -> None: ... + def format_failure(self, err: str) -> str: ... + def debug(self) -> None: ... + def id(self) -> str: ... + def __hash__(self) -> int: ... + def shortDescription(self) -> str: ... + +class SkipDocTestCase(DocTestCase): + def __init__(self, module: types.ModuleType) -> None: ... + def setUp(self) -> None: ... + def test_skip(self) -> None: ... + def shortDescription(self) -> str: ... + +if sys.version_info >= (3, 4): + class _DocTestSuite(unittest.TestSuite): ... +else: + _DocTestSuite = unittest.TestSuite + +def DocTestSuite(module: Union[None, str, types.ModuleType] = ..., globs: Optional[Dict[str, Any]] = ..., + extraglobs: Optional[Dict[str, Any]] = ..., test_finder: Optional[DocTestFinder] = ..., + **options: Any) -> _DocTestSuite: ... + +class DocFileCase(DocTestCase): + def id(self) -> str: ... + def format_failure(self, err: str) -> str: ... + +def DocFileTest(path: str, module_relative: bool = ..., package: Union[None, str, types.ModuleType] = ..., + globs: Optional[Dict[str, Any]] = ..., parser: DocTestParser = ..., + encoding: Optional[str] = ..., **options: Any) -> DocFileCase: ... +def DocFileSuite(*paths: str, **kw: Any) -> _DocTestSuite: ... +def script_from_examples(s: str) -> str: ... +def testsource(module: Union[None, str, types.ModuleType], name: str) -> str: ... +def debug_src(src: str, pm: bool = ..., globs: Optional[Dict[str, Any]] = ...) -> None: ... +def debug_script(src: str, pm: bool = ..., globs: Optional[Dict[str, Any]] = ...) -> None: ... +def debug(module: Union[None, str, types.ModuleType], name: str, pm: bool = ...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/errno.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/errno.pyi new file mode 100644 index 0000000..14987bb --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/errno.pyi @@ -0,0 +1,130 @@ +# Stubs for errno + +from typing import Mapping +import sys + +errorcode: Mapping[int, str] + +EPERM: int +ENOENT: int +ESRCH: int +EINTR: int +EIO: int +ENXIO: int +E2BIG: int +ENOEXEC: int +EBADF: int +ECHILD: int +EAGAIN: int +ENOMEM: int +EACCES: int +EFAULT: int +ENOTBLK: int +EBUSY: int +EEXIST: int +EXDEV: int +ENODEV: int +ENOTDIR: int +EISDIR: int +EINVAL: int +ENFILE: int +EMFILE: int +ENOTTY: int +ETXTBSY: int +EFBIG: int +ENOSPC: int +ESPIPE: int +EROFS: int +EMLINK: int +EPIPE: int +EDOM: int +ERANGE: int +EDEADLCK: int +ENAMETOOLONG: int +ENOLCK: int +ENOSYS: int +ENOTEMPTY: int +ELOOP: int +EWOULDBLOCK: int +ENOMSG: int +EIDRM: int +ECHRNG: int +EL2NSYNC: int +EL3HLT: int +EL3RST: int +ELNRNG: int +EUNATCH: int +ENOCSI: int +EL2HLT: int +EBADE: int +EBADR: int +EXFULL: int +ENOANO: int +EBADRQC: int +EBADSLT: int +EDEADLOCK: int +EBFONT: int +ENOSTR: int +ENODATA: int +ETIME: int +ENOSR: int +ENONET: int +ENOPKG: int +EREMOTE: int +ENOLINK: int +EADV: int +ESRMNT: int +ECOMM: int +EPROTO: int +EMULTIHOP: int +EDOTDOT: int +EBADMSG: int +EOVERFLOW: int +ENOTUNIQ: int +EBADFD: int +EREMCHG: int +ELIBACC: int +ELIBBAD: int +ELIBSCN: int +ELIBMAX: int +ELIBEXEC: int +EILSEQ: int +ERESTART: int +ESTRPIPE: int +EUSERS: int +ENOTSOCK: int +EDESTADDRREQ: int +EMSGSIZE: int +EPROTOTYPE: int +ENOPROTOOPT: int +EPROTONOSUPPORT: int +ESOCKTNOSUPPORT: int +ENOTSUP: int +EOPNOTSUPP: int +EPFNOSUPPORT: int +EAFNOSUPPORT: int +EADDRINUSE: int +EADDRNOTAVAIL: int +ENETDOWN: int +ENETUNREACH: int +ENETRESET: int +ECONNABORTED: int +ECONNRESET: int +ENOBUFS: int +EISCONN: int +ENOTCONN: int +ESHUTDOWN: int +ETOOMANYREFS: int +ETIMEDOUT: int +ECONNREFUSED: int +EHOSTDOWN: int +EHOSTUNREACH: int +EALREADY: int +EINPROGRESS: int +ESTALE: int +EUCLEAN: int +ENOTNAM: int +ENAVAIL: int +EISNAM: int +EREMOTEIO: int +EDQUOT: int diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/filecmp.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/filecmp.pyi new file mode 100644 index 0000000..57a8846 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/filecmp.pyi @@ -0,0 +1,48 @@ +# Stubs for filecmp (Python 2/3) +import sys +from typing import AnyStr, Callable, Dict, Generic, Iterable, List, Optional, Sequence, Tuple, Union, Text + +DEFAULT_IGNORES: List[str] + +def cmp(f1: Union[bytes, Text], f2: Union[bytes, Text], shallow: Union[int, bool] = ...) -> bool: ... +def cmpfiles(a: AnyStr, b: AnyStr, common: Iterable[AnyStr], + shallow: Union[int, bool] = ...) -> Tuple[List[AnyStr], List[AnyStr], List[AnyStr]]: ... + +class dircmp(Generic[AnyStr]): + def __init__(self, a: AnyStr, b: AnyStr, + ignore: Optional[Sequence[AnyStr]] = ..., + hide: Optional[Sequence[AnyStr]] = ...) -> None: ... + + left: AnyStr + right: AnyStr + hide: Sequence[AnyStr] + ignore: Sequence[AnyStr] + + # These properties are created at runtime by __getattr__ + subdirs: Dict[AnyStr, dircmp[AnyStr]] + same_files: List[AnyStr] + diff_files: List[AnyStr] + funny_files: List[AnyStr] + common_dirs: List[AnyStr] + common_files: List[AnyStr] + common_funny: List[AnyStr] + common: List[AnyStr] + left_only: List[AnyStr] + right_only: List[AnyStr] + left_list: List[AnyStr] + right_list: List[AnyStr] + + def report(self) -> None: ... + def report_partial_closure(self) -> None: ... + def report_full_closure(self) -> None: ... + + methodmap: Dict[str, Callable[[], None]] + def phase0(self) -> None: ... + def phase1(self) -> None: ... + def phase2(self) -> None: ... + def phase3(self) -> None: ... + def phase4(self) -> None: ... + def phase4_closure(self) -> None: ... + +if sys.version_info >= (3,): + def clear_cache() -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/fileinput.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/fileinput.pyi new file mode 100644 index 0000000..0eb8ca9 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/fileinput.pyi @@ -0,0 +1,62 @@ +from typing import Iterable, Callable, IO, AnyStr, Generic, Any, Text, Union, Iterator, Optional + +import os +import sys + +if sys.version_info >= (3, 6): + _Path = Union[Text, bytes, os.PathLike[Any]] +else: + _Path = Union[Text, bytes] + + +def input( + files: Union[_Path, Iterable[_Path], None] = ..., + inplace: bool = ..., + backup: str = ..., + bufsize: int = ..., + mode: str = ..., + openhook: Callable[[_Path, str], IO[AnyStr]] = ...) -> FileInput[AnyStr]: ... + + +def close() -> None: ... +def nextfile() -> None: ... +def filename() -> str: ... +def lineno() -> int: ... +def filelineno() -> int: ... +def fileno() -> int: ... +def isfirstline() -> bool: ... +def isstdin() -> bool: ... + +class FileInput(Iterable[AnyStr], Generic[AnyStr]): + def __init__( + self, + files: Union[None, _Path, Iterable[_Path]] = ..., + inplace: bool = ..., + backup: str = ..., + bufsize: int = ..., + mode: str = ..., + openhook: Callable[[_Path, str], IO[AnyStr]] = ... + ) -> None: ... + + def __del__(self) -> None: ... + def close(self) -> None: ... + if sys.version_info >= (3, 2): + def __enter__(self) -> FileInput[AnyStr]: ... + def __exit__(self, type: Any, value: Any, traceback: Any) -> None: ... + def __iter__(self) -> Iterator[AnyStr]: ... + def __next__(self) -> AnyStr: ... + def __getitem__(self, i: int) -> AnyStr: ... + def nextfile(self) -> None: ... + def readline(self) -> AnyStr: ... + def filename(self) -> str: ... + def lineno(self) -> int: ... + def filelineno(self) -> int: ... + def fileno(self) -> int: ... + def isfirstline(self) -> bool: ... + def isstdin(self) -> bool: ... + +def hook_compressed(filename: _Path, mode: str) -> IO[Any]: ... +if sys.version_info >= (3, 6): + def hook_encoded(encoding: str, errors: Optional[str] = ...) -> Callable[[_Path, str], IO[Any]]: ... +else: + def hook_encoded(encoding: str) -> Callable[[_Path, str], IO[Any]]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/formatter.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/formatter.pyi new file mode 100644 index 0000000..77a4956 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/formatter.pyi @@ -0,0 +1,105 @@ +# Source: https://hg.python.org/cpython/file/2.7/Lib/formatter.py +# and https://github.com/python/cpython/blob/master/Lib/formatter.py +from typing import Any, IO, List, Optional, Tuple + +AS_IS = None +_FontType = Tuple[str, bool, bool, bool] +_StylesType = Tuple[Any, ...] + +class NullFormatter: + writer: Optional[NullWriter] + def __init__(self, writer: Optional[NullWriter] = ...) -> None: ... + def end_paragraph(self, blankline: int) -> None: ... + def add_line_break(self) -> None: ... + def add_hor_rule(self, *args, **kw) -> None: ... + def add_label_data(self, format, counter: int, blankline: Optional[int] = ...) -> None: ... + def add_flowing_data(self, data: str) -> None: ... + def add_literal_data(self, data: str) -> None: ... + def flush_softspace(self) -> None: ... + def push_alignment(self, align: Optional[str]) -> None: ... + def pop_alignment(self) -> None: ... + def push_font(self, x: _FontType) -> None: ... + def pop_font(self) -> None: ... + def push_margin(self, margin: int) -> None: ... + def pop_margin(self) -> None: ... + def set_spacing(self, spacing: Optional[str]) -> None: ... + def push_style(self, *styles: _StylesType) -> None: ... + def pop_style(self, n: int = ...) -> None: ... + def assert_line_data(self, flag: int = ...) -> None: ... + +class AbstractFormatter: + writer: NullWriter + align: Optional[str] + align_stack: List[Optional[str]] + font_stack: List[_FontType] + margin_stack: List[int] + spacing: Optional[str] + style_stack: Any + nospace: int + softspace: int + para_end: int + parskip: int + hard_break: int + have_label: int + def __init__(self, writer: NullWriter) -> None: ... + def end_paragraph(self, blankline: int) -> None: ... + def add_line_break(self) -> None: ... + def add_hor_rule(self, *args, **kw) -> None: ... + def add_label_data(self, format, counter: int, blankline: Optional[int] = ...) -> None: ... + def format_counter(self, format, counter: int) -> str: ... + def format_letter(self, case: str, counter: int) -> str: ... + def format_roman(self, case: str, counter: int) -> str: ... + def add_flowing_data(self, data: str) -> None: ... + def add_literal_data(self, data: str) -> None: ... + def flush_softspace(self) -> None: ... + def push_alignment(self, align: Optional[str]) -> None: ... + def pop_alignment(self) -> None: ... + def push_font(self, font: _FontType) -> None: ... + def pop_font(self) -> None: ... + def push_margin(self, margin: int) -> None: ... + def pop_margin(self) -> None: ... + def set_spacing(self, spacing: Optional[str]) -> None: ... + def push_style(self, *styles: _StylesType) -> None: ... + def pop_style(self, n: int = ...) -> None: ... + def assert_line_data(self, flag: int = ...) -> None: ... + +class NullWriter: + def __init__(self) -> None: ... + def flush(self) -> None: ... + def new_alignment(self, align: Optional[str]) -> None: ... + def new_font(self, font: _FontType) -> None: ... + def new_margin(self, margin: int, level: int) -> None: ... + def new_spacing(self, spacing: Optional[str]) -> None: ... + def new_styles(self, styles) -> None: ... + def send_paragraph(self, blankline: int) -> None: ... + def send_line_break(self) -> None: ... + def send_hor_rule(self, *args, **kw) -> None: ... + def send_label_data(self, data: str) -> None: ... + def send_flowing_data(self, data: str) -> None: ... + def send_literal_data(self, data: str) -> None: ... + +class AbstractWriter(NullWriter): + def new_alignment(self, align: Optional[str]) -> None: ... + def new_font(self, font: _FontType) -> None: ... + def new_margin(self, margin: int, level: int) -> None: ... + def new_spacing(self, spacing: Optional[str]) -> None: ... + def new_styles(self, styles) -> None: ... + def send_paragraph(self, blankline: int) -> None: ... + def send_line_break(self) -> None: ... + def send_hor_rule(self, *args, **kw) -> None: ... + def send_label_data(self, data: str) -> None: ... + def send_flowing_data(self, data: str) -> None: ... + def send_literal_data(self, data: str) -> None: ... + +class DumbWriter(NullWriter): + file: IO + maxcol: int + def __init__(self, file: Optional[IO] = ..., maxcol: int = ...) -> None: ... + def reset(self) -> None: ... + def send_paragraph(self, blankline: int) -> None: ... + def send_line_break(self) -> None: ... + def send_hor_rule(self, *args, **kw) -> None: ... + def send_literal_data(self, data: str) -> None: ... + def send_flowing_data(self, data: str) -> None: ... + +def test(file: Optional[str] = ...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/fractions.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/fractions.pyi new file mode 100644 index 0000000..8bebe5f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/fractions.pyi @@ -0,0 +1,96 @@ +# Stubs for fractions +# See https://docs.python.org/3/library/fractions.html +# +# Note: these stubs are incomplete. The more complex type +# signatures are currently omitted. Also see numbers.pyi. + +from typing import Optional, TypeVar, Union, overload, Any +from numbers import Real, Integral, Rational +from decimal import Decimal +import sys + +_ComparableNum = Union[int, float, Decimal, Real] + + +@overload +def gcd(a: int, b: int) -> int: ... +@overload +def gcd(a: Integral, b: int) -> Integral: ... +@overload +def gcd(a: int, b: Integral) -> Integral: ... +@overload +def gcd(a: Integral, b: Integral) -> Integral: ... + + +class Fraction(Rational): + @overload + def __init__(self, + numerator: Union[int, Rational] = ..., + denominator: Optional[Union[int, Rational]] = ..., + *, + _normalize: bool = ...) -> None: ... + @overload + def __init__(self, value: float, *, _normalize: bool = ...) -> None: ... + @overload + def __init__(self, value: Decimal, *, _normalize: bool = ...) -> None: ... + @overload + def __init__(self, value: str, *, _normalize: bool = ...) -> None: ... + + @classmethod + def from_float(cls, f: float) -> Fraction: ... + @classmethod + def from_decimal(cls, dec: Decimal) -> Fraction: ... + def limit_denominator(self, max_denominator: int = ...) -> Fraction: ... + + @property + def numerator(self) -> int: ... + @property + def denominator(self) -> int: ... + + def __add__(self, other): ... + def __radd__(self, other): ... + def __sub__(self, other): ... + def __rsub__(self, other): ... + def __mul__(self, other): ... + def __rmul__(self, other): ... + def __truediv__(self, other): ... + def __rtruediv__(self, other): ... + if sys.version_info < (3, 0): + def __div__(self, other): ... + def __rdiv__(self, other): ... + def __floordiv__(self, other) -> int: ... + def __rfloordiv__(self, other) -> int: ... + def __mod__(self, other): ... + def __rmod__(self, other): ... + def __divmod__(self, other): ... + def __rdivmod__(self, other): ... + def __pow__(self, other): ... + def __rpow__(self, other): ... + + def __pos__(self) -> Fraction: ... + def __neg__(self) -> Fraction: ... + def __abs__(self) -> Fraction: ... + def __trunc__(self) -> int: ... + if sys.version_info >= (3, 0): + def __floor__(self) -> int: ... + def __ceil__(self) -> int: ... + def __round__(self, ndigits: Optional[Any] = ...): ... + + def __hash__(self) -> int: ... + def __eq__(self, other: object) -> bool: ... + def __lt__(self, other: _ComparableNum) -> bool: ... + def __gt__(self, other: _ComparableNum) -> bool: ... + def __le__(self, other: _ComparableNum) -> bool: ... + def __ge__(self, other: _ComparableNum) -> bool: ... + if sys.version_info >= (3, 0): + def __bool__(self) -> bool: ... + else: + def __nonzero__(self) -> bool: ... + + # Not actually defined within fractions.py, but provides more useful + # overrides + @property + def real(self) -> Fraction: ... + @property + def imag(self) -> Fraction: ... + def conjugate(self) -> Fraction: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/ftplib.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/ftplib.pyi new file mode 100644 index 0000000..dff8c47 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/ftplib.pyi @@ -0,0 +1,134 @@ +# Stubs for ftplib (Python 2.7/3) +import sys +from typing import Optional, BinaryIO, Tuple, TextIO, Iterable, Callable, List, Union, Iterator, Dict, Text, Type, TypeVar, Generic, Any +from types import TracebackType +from socket import socket +from ssl import SSLContext + +_T = TypeVar('_T') +_IntOrStr = Union[int, Text] + +MSG_OOB: int +FTP_PORT: int +MAXLINE: int +CRLF: str +if sys.version_info >= (3,): + B_CRLF: bytes + +class Error(Exception): ... +class error_reply(Error): ... +class error_temp(Error): ... +class error_perm(Error): ... +class error_proto(Error): ... + +all_errors = Tuple[Exception, ...] + +class FTP: + debugging: int + + # Note: This is technically the type that's passed in as the host argument. But to make it easier in Python 2 we + # accept Text but return str. + host: str + + port: int + maxline: int + sock: Optional[socket] + welcome: Optional[str] + passiveserver: int + timeout: int + af: int + lastresp: str + + if sys.version_info >= (3,): + file: Optional[TextIO] + encoding: str + def __enter__(self: _T) -> _T: ... + def __exit__(self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], + exc_tb: Optional[TracebackType]) -> bool: ... + else: + file: Optional[BinaryIO] + + if sys.version_info >= (3, 3): + source_address: Optional[Tuple[str, int]] + def __init__(self, host: Text = ..., user: Text = ..., passwd: Text = ..., acct: Text = ..., + timeout: float = ..., source_address: Optional[Tuple[str, int]] = ...) -> None: ... + def connect(self, host: Text = ..., port: int = ..., timeout: float = ..., + source_address: Optional[Tuple[str, int]] = ...) -> str: ... + else: + def __init__(self, host: Text = ..., user: Text = ..., passwd: Text = ..., acct: Text = ..., + timeout: float = ...) -> None: ... + def connect(self, host: Text = ..., port: int = ..., timeout: float = ...) -> str: ... + + def getwelcome(self) -> str: ... + def set_debuglevel(self, level: int) -> None: ... + def debug(self, level: int) -> None: ... + def set_pasv(self, val: Union[bool, int]) -> None: ... + def sanitize(self, s: Text) -> str: ... + def putline(self, line: Text) -> None: ... + def putcmd(self, line: Text) -> None: ... + def getline(self) -> str: ... + def getmultiline(self) -> str: ... + def getresp(self) -> str: ... + def voidresp(self) -> str: ... + def abort(self) -> str: ... + def sendcmd(self, cmd: Text) -> str: ... + def voidcmd(self, cmd: Text) -> str: ... + def sendport(self, host: Text, port: int) -> str: ... + def sendeprt(self, host: Text, port: int) -> str: ... + def makeport(self) -> socket: ... + def makepasv(self) -> Tuple[str, int]: ... + def login(self, user: Text = ..., passwd: Text = ..., acct: Text = ...) -> str: ... + + # In practice, `rest` rest can actually be anything whose str() is an integer sequence, so to make it simple we allow integers. + def ntransfercmd(self, cmd: Text, rest: Optional[_IntOrStr] = ...) -> Tuple[socket, int]: ... + def transfercmd(self, cmd: Text, rest: Optional[_IntOrStr] = ...) -> socket: ... + def retrbinary(self, cmd: Text, callback: Callable[[bytes], Any], blocksize: int = ..., rest: Optional[_IntOrStr] = ...) -> str: ... + def storbinary(self, cmd: Text, fp: BinaryIO, blocksize: int = ..., callback: Optional[Callable[[bytes], Any]] = ..., rest: Optional[_IntOrStr] = ...) -> str: ... + + def retrlines(self, cmd: Text, callback: Optional[Callable[[str], Any]] = ...) -> str: ... + def storlines(self, cmd: Text, fp: BinaryIO, callback: Optional[Callable[[bytes], Any]] = ...) -> str: ... + + def acct(self, password: Text) -> str: ... + def nlst(self, *args: Text) -> List[str]: ... + + # Technically only the last arg can be a Callable but ... + def dir(self, *args: Union[str, Callable[[str], None]]) -> None: ... + + if sys.version_info >= (3, 3): + def mlsd(self, path: Text = ..., facts: Iterable[str] = ...) -> Iterator[Tuple[str, Dict[str, str]]]: ... + def rename(self, fromname: Text, toname: Text) -> str: ... + def delete(self, filename: Text) -> str: ... + def cwd(self, dirname: Text) -> str: ... + def size(self, filename: Text) -> str: ... + def mkd(self, dirname: Text) -> str: ... + def rmd(self, dirname: Text) -> str: ... + def pwd(self) -> str: ... + def quit(self) -> str: ... + def close(self) -> None: ... + +class FTP_TLS(FTP): + def __init__(self, host: Text = ..., user: Text = ..., passwd: Text = ..., acct: Text = ..., + keyfile: Optional[str] = ..., certfile: Optional[str] = ..., + context: Optional[SSLContext] = ..., timeout: float = ..., + source_address: Optional[Tuple[str, int]] = ...) -> None: ... + + ssl_version: int + keyfile: Optional[str] + certfile: Optional[str] + context: SSLContext + + def login(self, user: Text = ..., passwd: Text = ..., acct: Text = ..., secure: bool = ...) -> str: ... + def auth(self) -> str: ... + def prot_p(self) -> str: ... + def prot_c(self) -> str: ... + + if sys.version_info >= (3, 3): + def ccc(self) -> str: ... + +if sys.version_info < (3,): + class Netrc: + def __init__(self, filename: Optional[Text] = ...) -> None: ... + def get_hosts(self) -> List[str]: ... + def get_account(self, host: Text) -> Tuple[Optional[str], Optional[str], Optional[str]]: ... + def get_macros(self) -> List[str]: ... + def get_macro(self, macro: Text) -> Tuple[str, ...]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/genericpath.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/genericpath.pyi new file mode 100644 index 0000000..e0b1c6d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/genericpath.pyi @@ -0,0 +1,21 @@ +from typing import Sequence, AnyStr, Text +import sys + +if sys.version_info >= (3, 0): + def commonprefix(m: Sequence[str]) -> str: ... +else: + def commonprefix(m: Sequence[AnyStr]) -> AnyStr: ... + +def exists(path: Text) -> bool: ... +def isfile(path: Text) -> bool: ... +def isdir(s: Text) -> bool: ... +def getsize(filename: Text) -> int: ... +def getmtime(filename: Text) -> float: ... +def getatime(filename: Text) -> float: ... +def getctime(filename: Text) -> float: ... + + +if sys.version_info >= (3, 4): + def samestat(s1: str, s2: str) -> int: ... + def samefile(f1: str, f2: str) -> int: ... + def sameopenfile(fp1: str, fp2: str) -> int: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/grp.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/grp.pyi new file mode 100644 index 0000000..6054727 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/grp.pyi @@ -0,0 +1,10 @@ +from typing import List, NamedTuple, Optional + +struct_group = NamedTuple("struct_group", [("gr_name", str), + ("gr_passwd", Optional[str]), + ("gr_gid", int), + ("gr_mem", List[str])]) + +def getgrall() -> List[struct_group]: ... +def getgrgid(gid: int) -> struct_group: ... +def getgrnam(name: str) -> struct_group: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/hmac.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/hmac.pyi new file mode 100644 index 0000000..47bbc7e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/hmac.pyi @@ -0,0 +1,38 @@ +# Stubs for hmac + +from typing import Any, Callable, Optional, Union, overload, AnyStr +from types import ModuleType +import sys + +_B = Union[bytes, bytearray] + +# TODO more precise type for object of hashlib +_Hash = Any + +digest_size: None + +if sys.version_info >= (3, 4): + def new(key: _B, msg: Optional[_B] = ..., + digestmod: Optional[Union[str, Callable[[], _Hash], ModuleType]] = ...) -> HMAC: ... +else: + def new(key: _B, msg: Optional[_B] = ..., + digestmod: Optional[Union[Callable[[], _Hash], ModuleType]] = ...) -> HMAC: ... + +class HMAC: + if sys.version_info >= (3,): + digest_size: int + if sys.version_info >= (3, 4): + block_size: int + name: str + def update(self, msg: _B) -> None: ... + def digest(self) -> bytes: ... + def hexdigest(self) -> str: ... + def copy(self) -> HMAC: ... + +@overload +def compare_digest(a: bytearray, b: bytearray) -> bool: ... +@overload +def compare_digest(a: AnyStr, b: AnyStr) -> bool: ... + +if sys.version_info >= (3, 7): + def digest(key: _B, msg: _B, digest: str) -> bytes: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/imaplib.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/imaplib.pyi new file mode 100644 index 0000000..ab32e7b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/imaplib.pyi @@ -0,0 +1,133 @@ +# Stubs for imaplib (Python 2) + +import imaplib +import subprocess +import sys +import time +from socket import socket as _socket +from ssl import SSLSocket +from typing import Any, Callable, Dict, IO, List, Optional, Pattern, Text, Tuple, Type, Union + +CommandResults = Tuple[str, List[Any]] + + +class IMAP4: + error: Type[Exception] = ... + abort: Type[Exception] = ... + readonly: Type[Exception] = ... + mustquote: Pattern[Text] = ... + debug: int = ... + state: str = ... + literal: Optional[Text] = ... + tagged_commands: Dict[str, str] = ... + untagged_responses: Dict[str, str] = ... + continuation_response: str = ... + is_readonly: bool = ... + tagnum: int = ... + tagpre: str = ... + tagre: Pattern[Text] = ... + welcome: bytes = ... + capabilities: Tuple[str] = ... + PROTOCOL_VERSION: str = ... + def __init__(self, host: str, port: int) -> None: ... + def __getattr__(self, attr: str) -> Any: ... + host: str = ... + port: int = ... + sock: _socket = ... + file: Union[IO[Text], IO[bytes]] = ... + def open(self, host: str = ..., port: int = ...) -> None: ... + def read(self, size: int) -> bytes: ... + def readline(self) -> bytes: ... + def send(self, data: bytes) -> None: ... + def shutdown(self) -> None: ... + def socket(self) -> _socket: ... + def recent(self) -> CommandResults: ... + def response(self, code: str) -> CommandResults: ... + def append(self, mailbox: str, flags: str, date_time: str, message: str) -> str: ... + def authenticate(self, mechanism: str, authobject: Callable) -> Tuple[str, str]: ... + def capability(self) -> CommandResults: ... + def check(self) -> CommandResults: ... + def close(self) -> CommandResults: ... + def copy(self, message_set: str, new_mailbox: str) -> CommandResults: ... + def create(self, mailbox: str) -> CommandResults: ... + def delete(self, mailbox: str) -> CommandResults: ... + def deleteacl(self, mailbox: str, who: str) -> CommandResults: ... + def expunge(self) -> CommandResults: ... + def fetch(self, message_set: str, message_parts: str) -> CommandResults: ... + def getacl(self, mailbox: str) -> CommandResults: ... + def getannotation(self, mailbox: str, entry: str, attribute: str) -> CommandResults: ... + def getquota(self, root: str) -> CommandResults: ... + def getquotaroot(self, mailbox: str) -> CommandResults: ... + def list(self, directory: str = ..., pattern: str = ...) -> CommandResults: ... + def login(self, user: str, password: str) -> CommandResults: ... + def login_cram_md5(self, user: str, password: str) -> CommandResults: ... + def logout(self) -> CommandResults: ... + def lsub(self, directory: str = ..., pattern: str = ...) -> CommandResults: ... + def myrights(self, mailbox: str) -> CommandResults: ... + def namespace(self) -> CommandResults: ... + def noop(self) -> CommandResults: ... + def partial(self, message_num: str, message_part: str, start: str, length: str) -> CommandResults: ... + def proxyauth(self, user: str) -> CommandResults: ... + def rename(self, oldmailbox: str, newmailbox: str) -> CommandResults: ... + def search(self, charset: Optional[str], *criteria: str) -> CommandResults: ... + def select(self, mailbox: str = ..., readonly: bool = ...) -> CommandResults: ... + def setacl(self, mailbox: str, who: str, what: str) -> CommandResults: ... + def setannotation(self, *args: List[str]) -> CommandResults: ... + def setquota(self, root: str, limits: str) -> CommandResults: ... + def sort(self, sort_criteria: str, charset: str, *search_criteria: List[str]) -> CommandResults: ... + if sys.version_info >= (3,): + def starttls(self, ssl_context: Optional[Any] = ...) -> CommandResults: ... + def status(self, mailbox: str, names: str) -> CommandResults: ... + def store(self, message_set: str, command: str, flags: str) -> CommandResults: ... + def subscribe(self, mailbox: str) -> CommandResults: ... + def thread(self, threading_algorithm: str, charset: str, *search_criteria: List[str]) -> CommandResults: ... + def uid(self, command: str, *args: List[str]) -> CommandResults: ... + def unsubscribe(self, mailbox: str) -> CommandResults: ... + def xatom(self, name: str, *args: List[str]) -> CommandResults: ... + def print_log(self) -> None: ... + +class IMAP4_SSL(IMAP4): + keyfile: str = ... + certfile: str = ... + def __init__(self, host: str = ..., port: int = ..., keyfile: Optional[str] = ..., certfile: Optional[str] = ...) -> None: ... + host: str = ... + port: int = ... + sock: _socket = ... + sslobj: SSLSocket = ... + file: IO[Any] = ... + def open(self, host: str = ..., port: Optional[int] = ...) -> None: ... + def read(self, size: int) -> bytes: ... + def readline(self) -> bytes: ... + def send(self, data: bytes) -> None: ... + def shutdown(self) -> None: ... + def socket(self) -> _socket: ... + def ssl(self) -> SSLSocket: ... + + +class IMAP4_stream(IMAP4): + command: str = ... + def __init__(self, command: str) -> None: ... + host: str = ... + port: int = ... + sock: _socket = ... + file: IO[Any] = ... + process: subprocess.Popen = ... + writefile: IO[Any] = ... + readfile: IO[Any] = ... + def open(self, host: str = ..., port: Optional[int] = ...) -> None: ... + def read(self, size: int) -> bytes: ... + def readline(self) -> bytes: ... + def send(self, data: bytes) -> None: ... + def shutdown(self) -> None: ... + +class _Authenticator: + mech: Callable = ... + def __init__(self, mechinst: Callable) -> None: ... + def process(self, data: str) -> str: ... + def encode(self, inp: bytes) -> str: ... + def decode(self, inp: str) -> bytes: ... + +def Internaldate2tuple(resp: str) -> time.struct_time: ... +def Int2AP(num: int) -> str: ... +def ParseFlags(resp: str) -> Tuple[str]: ... +def Time2Internaldate(date_time: Union[float, time.struct_time, str]) -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/imghdr.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/imghdr.pyi new file mode 100644 index 0000000..b9d8d17 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/imghdr.pyi @@ -0,0 +1,16 @@ +from typing import overload, Union, Text, BinaryIO, Optional, Any, List, Callable +import sys +import os + + +if sys.version_info >= (3, 6): + _File = Union[Text, os.PathLike[Text], BinaryIO] +else: + _File = Union[Text, BinaryIO] + + +@overload +def what(file: _File) -> Optional[str]: ... +@overload +def what(file: Any, h: bytes) -> Optional[str]: ... +tests: List[Callable[[bytes, BinaryIO], Optional[str]]] diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/keyword.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/keyword.pyi new file mode 100644 index 0000000..f9e3376 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/keyword.pyi @@ -0,0 +1,6 @@ +# Stubs for keyword + +from typing import Sequence, Text, Union + +def iskeyword(s: Union[Text, bytes]) -> bool: ... +kwlist: Sequence[str] diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/__init__.pyi new file mode 100644 index 0000000..145e31b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/__init__.pyi @@ -0,0 +1 @@ +# Stubs for lib2to3 (Python 3.6) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/__init__.pyi new file mode 100644 index 0000000..1adc82a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/__init__.pyi @@ -0,0 +1,10 @@ +# Stubs for lib2to3.pgen2 (Python 3.6) + +import os +import sys +from typing import Text, Union + +if sys.version_info >= (3, 6): + _Path = Union[Text, os.PathLike] +else: + _Path = Text diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/driver.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/driver.pyi new file mode 100644 index 0000000..56785f0 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/driver.pyi @@ -0,0 +1,24 @@ +# Stubs for lib2to3.pgen2.driver (Python 3.6) + +import os +import sys +from typing import Any, Callable, IO, Iterable, List, Optional, Text, Tuple, Union + +from logging import Logger +from lib2to3.pytree import _Convert, _NL +from lib2to3.pgen2 import _Path +from lib2to3.pgen2.grammar import Grammar + + +class Driver: + grammar: Grammar + logger: Logger + convert: _Convert + def __init__(self, grammar: Grammar, convert: Optional[_Convert] = ..., logger: Optional[Logger] = ...) -> None: ... + def parse_tokens(self, tokens: Iterable[Any], debug: bool = ...) -> _NL: ... + def parse_stream_raw(self, stream: IO[Text], debug: bool = ...) -> _NL: ... + def parse_stream(self, stream: IO[Text], debug: bool = ...) -> _NL: ... + def parse_file(self, filename: _Path, encoding: Optional[Text] = ..., debug: bool = ...) -> _NL: ... + def parse_string(self, text: Text, debug: bool = ...) -> _NL: ... + +def load_grammar(gt: Text = ..., gp: Optional[Text] = ..., save: bool = ..., force: bool = ..., logger: Optional[Logger] = ...) -> Grammar: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/grammar.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/grammar.pyi new file mode 100644 index 0000000..122d771 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/grammar.pyi @@ -0,0 +1,29 @@ +# Stubs for lib2to3.pgen2.grammar (Python 3.6) + +from lib2to3.pgen2 import _Path + +from typing import Any, Dict, List, Optional, Text, Tuple, TypeVar + +_P = TypeVar('_P') +_Label = Tuple[int, Optional[Text]] +_DFA = List[List[Tuple[int, int]]] +_DFAS = Tuple[_DFA, Dict[int, int]] + +class Grammar: + symbol2number: Dict[Text, int] + number2symbol: Dict[int, Text] + states: List[_DFA] + dfas: Dict[int, _DFAS] + labels: List[_Label] + keywords: Dict[Text, int] + tokens: Dict[int, int] + symbol2label: Dict[Text, int] + start: int + def __init__(self) -> None: ... + def dump(self, filename: _Path) -> None: ... + def load(self, filename: _Path) -> None: ... + def copy(self: _P) -> _P: ... + def report(self) -> None: ... + +opmap_raw: Text +opmap: Dict[Text, Text] diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/literals.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/literals.pyi new file mode 100644 index 0000000..8719500 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/literals.pyi @@ -0,0 +1,9 @@ +# Stubs for lib2to3.pgen2.literals (Python 3.6) + +from typing import Dict, Match, Text + +simple_escapes: Dict[Text, Text] + +def escape(m: Match) -> Text: ... +def evalString(s: Text) -> Text: ... +def test() -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/parse.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/parse.pyi new file mode 100644 index 0000000..101d476 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/parse.pyi @@ -0,0 +1,29 @@ +# Stubs for lib2to3.pgen2.parse (Python 3.6) + +from typing import Any, Dict, List, Optional, Sequence, Set, Text, Tuple + +from lib2to3.pgen2.grammar import Grammar, _DFAS +from lib2to3.pytree import _NL, _Convert, _RawNode + +_Context = Sequence[Any] + +class ParseError(Exception): + msg: Text + type: int + value: Optional[Text] + context: _Context + def __init__(self, msg: Text, type: int, value: Optional[Text], context: _Context) -> None: ... + +class Parser: + grammar: Grammar + convert: _Convert + stack: List[Tuple[_DFAS, int, _RawNode]] + rootnode: Optional[_NL] + used_names: Set[Text] + def __init__(self, grammar: Grammar, convert: Optional[_Convert] = ...) -> None: ... + def setup(self, start: Optional[int] = ...) -> None: ... + def addtoken(self, type: int, value: Optional[Text], context: _Context) -> bool: ... + def classify(self, type: int, value: Optional[Text], context: _Context) -> int: ... + def shift(self, type: int, value: Optional[Text], newstate: int, context: _Context) -> None: ... + def push(self, type: int, newdfa: _DFAS, newstate: int, context: _Context) -> None: ... + def pop(self) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/pgen.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/pgen.pyi new file mode 100644 index 0000000..42d503b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/pgen.pyi @@ -0,0 +1,50 @@ +# Stubs for lib2to3.pgen2.pgen (Python 3.6) + +from typing import ( + Any, Dict, IO, Iterable, Iterator, List, NoReturn, Optional, Text, Tuple +) + +from lib2to3.pgen2 import _Path, grammar +from lib2to3.pgen2.tokenize import _TokenInfo + +class PgenGrammar(grammar.Grammar): ... + +class ParserGenerator: + filename: _Path + stream: IO[Text] + generator: Iterator[_TokenInfo] + first: Dict[Text, Dict[Text, int]] + def __init__(self, filename: _Path, stream: Optional[IO[Text]] = ...) -> None: ... + def make_grammar(self) -> PgenGrammar: ... + def make_first(self, c: PgenGrammar, name: Text) -> Dict[int, int]: ... + def make_label(self, c: PgenGrammar, label: Text) -> int: ... + def addfirstsets(self) -> None: ... + def calcfirst(self, name: Text) -> None: ... + def parse(self) -> Tuple[Dict[Text, List[DFAState]], Text]: ... + def make_dfa(self, start: NFAState, finish: NFAState) -> List[DFAState]: ... + def dump_nfa(self, name: Text, start: NFAState, finish: NFAState) -> List[DFAState]: ... + def dump_dfa(self, name: Text, dfa: Iterable[DFAState]) -> None: ... + def simplify_dfa(self, dfa: List[DFAState]) -> None: ... + def parse_rhs(self) -> Tuple[NFAState, NFAState]: ... + def parse_alt(self) -> Tuple[NFAState, NFAState]: ... + def parse_item(self) -> Tuple[NFAState, NFAState]: ... + def parse_atom(self) -> Tuple[NFAState, NFAState]: ... + def expect(self, type: int, value: Optional[Any] = ...) -> Text: ... + def gettoken(self) -> None: ... + def raise_error(self, msg: str, *args: Any) -> NoReturn: ... + +class NFAState: + arcs: List[Tuple[Optional[Text], NFAState]] + def __init__(self) -> None: ... + def addarc(self, next: NFAState, label: Optional[Text] = ...) -> None: ... + +class DFAState: + nfaset: Dict[NFAState, Any] + isfinal: bool + arcs: Dict[Text, DFAState] + def __init__(self, nfaset: Dict[NFAState, Any], final: NFAState) -> None: ... + def addarc(self, next: DFAState, label: Text) -> None: ... + def unifystate(self, old: DFAState, new: DFAState) -> None: ... + def __eq__(self, other: Any) -> bool: ... + +def generate_grammar(filename: _Path = ...) -> PgenGrammar: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/token.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/token.pyi new file mode 100644 index 0000000..c256af8 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/token.pyi @@ -0,0 +1,73 @@ +# Stubs for lib2to3.pgen2.token (Python 3.6) + +import sys +from typing import Dict, Text + +ENDMARKER: int +NAME: int +NUMBER: int +STRING: int +NEWLINE: int +INDENT: int +DEDENT: int +LPAR: int +RPAR: int +LSQB: int +RSQB: int +COLON: int +COMMA: int +SEMI: int +PLUS: int +MINUS: int +STAR: int +SLASH: int +VBAR: int +AMPER: int +LESS: int +GREATER: int +EQUAL: int +DOT: int +PERCENT: int +BACKQUOTE: int +LBRACE: int +RBRACE: int +EQEQUAL: int +NOTEQUAL: int +LESSEQUAL: int +GREATEREQUAL: int +TILDE: int +CIRCUMFLEX: int +LEFTSHIFT: int +RIGHTSHIFT: int +DOUBLESTAR: int +PLUSEQUAL: int +MINEQUAL: int +STAREQUAL: int +SLASHEQUAL: int +PERCENTEQUAL: int +AMPEREQUAL: int +VBAREQUAL: int +CIRCUMFLEXEQUAL: int +LEFTSHIFTEQUAL: int +RIGHTSHIFTEQUAL: int +DOUBLESTAREQUAL: int +DOUBLESLASH: int +DOUBLESLASHEQUAL: int +OP: int +COMMENT: int +NL: int +if sys.version_info >= (3,): + RARROW: int +if sys.version_info >= (3, 5): + AT: int + ATEQUAL: int + AWAIT: int + ASYNC: int +ERRORTOKEN: int +N_TOKENS: int +NT_OFFSET: int +tok_name: Dict[int, Text] + +def ISTERMINAL(x: int) -> bool: ... +def ISNONTERMINAL(x: int) -> bool: ... +def ISEOF(x: int) -> bool: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/tokenize.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/tokenize.pyi new file mode 100644 index 0000000..c10305f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/tokenize.pyi @@ -0,0 +1,30 @@ +# Stubs for lib2to3.pgen2.tokenize (Python 3.6) +# NOTE: Only elements from __all__ are present. + +from typing import Callable, Iterable, Iterator, List, Text, Tuple +from lib2to3.pgen2.token import * # noqa + + +_Coord = Tuple[int, int] +_TokenEater = Callable[[int, Text, _Coord, _Coord, Text], None] +_TokenInfo = Tuple[int, Text, _Coord, _Coord, Text] + + +class TokenError(Exception): ... +class StopTokenizing(Exception): ... + +def tokenize(readline: Callable[[], Text], tokeneater: _TokenEater = ...) -> None: ... + +class Untokenizer: + tokens: List[Text] + prev_row: int + prev_col: int + def __init__(self) -> None: ... + def add_whitespace(self, start: _Coord) -> None: ... + def untokenize(self, iterable: Iterable[_TokenInfo]) -> Text: ... + def compat(self, token: Tuple[int, Text], iterable: Iterable[_TokenInfo]) -> None: ... + +def untokenize(iterable: Iterable[_TokenInfo]) -> Text: ... +def generate_tokens( + readline: Callable[[], Text] +) -> Iterator[_TokenInfo]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pygram.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pygram.pyi new file mode 100644 index 0000000..aeb7b93 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pygram.pyi @@ -0,0 +1,116 @@ +# Stubs for lib2to3.pygram (Python 3.6) + +from typing import Any +from lib2to3.pgen2.grammar import Grammar + +class Symbols: + def __init__(self, grammar: Grammar) -> None: ... + +class python_symbols(Symbols): + and_expr: int + and_test: int + annassign: int + arglist: int + argument: int + arith_expr: int + assert_stmt: int + async_funcdef: int + async_stmt: int + atom: int + augassign: int + break_stmt: int + classdef: int + comp_for: int + comp_if: int + comp_iter: int + comp_op: int + comparison: int + compound_stmt: int + continue_stmt: int + decorated: int + decorator: int + decorators: int + del_stmt: int + dictsetmaker: int + dotted_as_name: int + dotted_as_names: int + dotted_name: int + encoding_decl: int + eval_input: int + except_clause: int + exec_stmt: int + expr: int + expr_stmt: int + exprlist: int + factor: int + file_input: int + flow_stmt: int + for_stmt: int + funcdef: int + global_stmt: int + if_stmt: int + import_as_name: int + import_as_names: int + import_from: int + import_name: int + import_stmt: int + lambdef: int + listmaker: int + not_test: int + old_lambdef: int + old_test: int + or_test: int + parameters: int + pass_stmt: int + power: int + print_stmt: int + raise_stmt: int + return_stmt: int + shift_expr: int + simple_stmt: int + single_input: int + sliceop: int + small_stmt: int + star_expr: int + stmt: int + subscript: int + subscriptlist: int + suite: int + term: int + test: int + testlist: int + testlist1: int + testlist_gexp: int + testlist_safe: int + testlist_star_expr: int + tfpdef: int + tfplist: int + tname: int + trailer: int + try_stmt: int + typedargslist: int + varargslist: int + vfpdef: int + vfplist: int + vname: int + while_stmt: int + with_item: int + with_stmt: int + with_var: int + xor_expr: int + yield_arg: int + yield_expr: int + yield_stmt: int + +class pattern_symbols(Symbols): + Alternative: int + Alternatives: int + Details: int + Matcher: int + NegatedUnit: int + Repeater: int + Unit: int + +python_grammar: Grammar +python_grammar_no_print_statement: Grammar +pattern_grammar: Grammar diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pytree.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pytree.pyi new file mode 100644 index 0000000..06a7c12 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pytree.pyi @@ -0,0 +1,86 @@ +# Stubs for lib2to3.pytree (Python 3.6) + +import sys +from typing import Any, Callable, Dict, Iterator, List, Optional, Text, Tuple, TypeVar, Union + +from lib2to3.pgen2.grammar import Grammar + +_P = TypeVar('_P') +_NL = Union[Node, Leaf] +_Context = Tuple[Text, int, int] +_Results = Dict[Text, _NL] +_RawNode = Tuple[int, Text, _Context, Optional[List[_NL]]] +_Convert = Callable[[Grammar, _RawNode], Any] + +HUGE: int + +def type_repr(type_num: int) -> Text: ... + +class Base: + type: int + parent: Optional[Node] + prefix: Text + children: List[_NL] + was_changed: bool + was_checked: bool + def __eq__(self, other: Any) -> bool: ... + def _eq(self: _P, other: _P) -> bool: ... + def clone(self: _P) -> _P: ... + def post_order(self) -> Iterator[_NL]: ... + def pre_order(self) -> Iterator[_NL]: ... + def replace(self, new: Union[_NL, List[_NL]]) -> None: ... + def get_lineno(self) -> int: ... + def changed(self) -> None: ... + def remove(self) -> Optional[int]: ... + @property + def next_sibling(self) -> Optional[_NL]: ... + @property + def prev_sibling(self) -> Optional[_NL]: ... + def leaves(self) -> Iterator[Leaf]: ... + def depth(self) -> int: ... + def get_suffix(self) -> Text: ... + if sys.version_info < (3,): + def get_prefix(self) -> Text: ... + def set_prefix(self, prefix: Text) -> None: ... + +class Node(Base): + fixers_applied: List[Any] + def __init__(self, type: int, children: List[_NL], context: Optional[Any] = ..., prefix: Optional[Text] = ..., fixers_applied: Optional[List[Any]] = ...) -> None: ... + def set_child(self, i: int, child: _NL) -> None: ... + def insert_child(self, i: int, child: _NL) -> None: ... + def append_child(self, child: _NL) -> None: ... + +class Leaf(Base): + lineno: int + column: int + value: Text + fixers_applied: List[Any] + def __init__(self, type: int, value: Text, context: Optional[_Context] = ..., prefix: Optional[Text] = ..., fixers_applied: List[Any] = ...) -> None: ... + +def convert(gr: Grammar, raw_node: _RawNode) -> _NL: ... + +class BasePattern: + type: int + content: Optional[Text] + name: Optional[Text] + def optimize(self) -> BasePattern: ... # sic, subclasses are free to optimize themselves into different patterns + def match(self, node: _NL, results: Optional[_Results] = ...) -> bool: ... + def match_seq(self, nodes: List[_NL], results: Optional[_Results] = ...) -> bool: ... + def generate_matches(self, nodes: List[_NL]) -> Iterator[Tuple[int, _Results]]: ... + +class LeafPattern(BasePattern): + def __init__(self, type: Optional[int] = ..., content: Optional[Text] = ..., name: Optional[Text] = ...) -> None: ... + +class NodePattern(BasePattern): + wildcards: bool + def __init__(self, type: Optional[int] = ..., content: Optional[Text] = ..., name: Optional[Text] = ...) -> None: ... + +class WildcardPattern(BasePattern): + min: int + max: int + def __init__(self, content: Optional[Text] = ..., min: int = ..., max: int = ..., name: Optional[Text] = ...) -> None: ... + +class NegatedPattern(BasePattern): + def __init__(self, content: Optional[Text] = ...) -> None: ... + +def generate_matches(patterns: List[BasePattern], nodes: List[_NL]) -> Iterator[Tuple[int, _Results]]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/linecache.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/linecache.pyi new file mode 100644 index 0000000..3f35f46 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/linecache.pyi @@ -0,0 +1,12 @@ +import sys +from typing import Any, Dict, List, Optional, Text + +_ModuleGlobals = Dict[str, Any] + +def getline(filename: Text, lineno: int, module_globals: Optional[_ModuleGlobals] = ...) -> str: ... +def clearcache() -> None: ... +def getlines(filename: Text, module_globals: Optional[_ModuleGlobals] = ...) -> List[str]: ... +def checkcache(filename: Optional[Text] = ...) -> None: ... +def updatecache(filename: Text, module_globals: Optional[_ModuleGlobals] = ...) -> List[str]: ... +if sys.version_info >= (3, 5): + def lazycache(filename: Text, module_globals: _ModuleGlobals) -> bool: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/locale.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/locale.pyi new file mode 100644 index 0000000..a0d7383 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/locale.pyi @@ -0,0 +1,113 @@ +# Stubs for locale + +from decimal import Decimal +from typing import Any, Dict, Iterable, List, Mapping, Optional, Sequence, Tuple, Union +import sys + +# workaround for mypy#2010 +if sys.version_info < (3,): + from __builtin__ import str as _str +else: + from builtins import str as _str + +CODESET: int +D_T_FMT: int +D_FMT: int +T_FMT: int +T_FMT_AMPM: int + +DAY_1: int +DAY_2: int +DAY_3: int +DAY_4: int +DAY_5: int +DAY_6: int +DAY_7: int +ABDAY_1: int +ABDAY_2: int +ABDAY_3: int +ABDAY_4: int +ABDAY_5: int +ABDAY_6: int +ABDAY_7: int + +MON_1: int +MON_2: int +MON_3: int +MON_4: int +MON_5: int +MON_6: int +MON_7: int +MON_8: int +MON_9: int +MON_10: int +MON_11: int +MON_12: int +ABMON_1: int +ABMON_2: int +ABMON_3: int +ABMON_4: int +ABMON_5: int +ABMON_6: int +ABMON_7: int +ABMON_8: int +ABMON_9: int +ABMON_10: int +ABMON_11: int +ABMON_12: int + +RADIXCHAR: int +THOUSEP: int +YESEXPR: int +NOEXPR: int +CRNCYSTR: int + +ERA: int +ERA_D_T_FMT: int +ERA_D_FMT: int +ERA_T_FMT: int + +ALT_DIGITS: int + +LC_CTYPE: int +LC_COLLATE: int +LC_TIME: int +LC_MONETARY: int +LC_MESSAGES: int +LC_NUMERIC: int +LC_ALL: int + +CHAR_MAX: int + +class Error(Exception): ... + +def setlocale(category: int, + locale: Union[_str, Iterable[_str], None] = ...) -> _str: ... +def localeconv() -> Mapping[_str, Union[int, _str, List[int]]]: ... +def nl_langinfo(option: int) -> _str: ... +def getdefaultlocale(envvars: Tuple[_str, ...] = ...) -> Tuple[Optional[_str], Optional[_str]]: ... +def getlocale(category: int = ...) -> Sequence[_str]: ... +def getpreferredencoding(do_setlocale: bool = ...) -> _str: ... +def normalize(localename: _str) -> _str: ... +def resetlocale(category: int = ...) -> None: ... +def strcoll(string1: _str, string2: _str) -> int: ... +def strxfrm(string: _str) -> _str: ... +def format(format: _str, val: Union[float, Decimal], grouping: bool = ..., + monetary: bool = ...) -> _str: ... +if sys.version_info >= (3, 7): + def format_string(format: _str, val: Any, + grouping: bool = ..., monetary: bool = ...) -> _str: ... +else: + def format_string(format: _str, val: Any, + grouping: bool = ...) -> _str: ... +def currency(val: Union[int, float, Decimal], symbol: bool = ..., grouping: bool = ..., + international: bool = ...) -> _str: ... +if sys.version_info >= (3, 5): + def delocalize(string: _str) -> None: ... +def atof(string: _str) -> float: ... +def atoi(string: _str) -> int: ... +def str(float: float) -> _str: ... + +locale_alias: Dict[_str, _str] # undocumented +locale_encoding_alias: Dict[_str, _str] # undocumented +windows_locale: Dict[int, _str] # undocumented diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/logging/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/logging/__init__.pyi new file mode 100644 index 0000000..d736b08 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/logging/__init__.pyi @@ -0,0 +1,433 @@ +# Stubs for logging (Python 3.4) + +from typing import ( + Any, Callable, Dict, Iterable, List, Mapping, MutableMapping, Optional, IO, + Tuple, Text, Union, overload, +) +from string import Template +from time import struct_time +from types import TracebackType, FrameType +import sys +import threading + +_SysExcInfoType = Union[Tuple[type, BaseException, Optional[TracebackType]], + Tuple[None, None, None]] +if sys.version_info >= (3, 5): + _ExcInfoType = Union[None, bool, _SysExcInfoType, BaseException] +else: + _ExcInfoType = Union[None, bool, _SysExcInfoType] +_ArgsType = Union[Tuple[Any, ...], Mapping[str, Any]] +_FilterType = Union[Filter, Callable[[LogRecord], int]] +_Level = Union[int, Text] +if sys.version_info >= (3, 6): + from os import PathLike + _Path = Union[str, PathLike[str]] +else: + _Path = str + +raiseExceptions: bool + +def currentframe() -> FrameType: ... + +if sys.version_info >= (3,): + _levelToName: Dict[int, str] + _nameToLevel: Dict[str, int] +else: + _levelNames: dict + +class Filterer(object): + filters: List[Filter] + def __init__(self) -> None: ... + def addFilter(self, filter: Filter) -> None: ... + def removeFilter(self, filter: Filter) -> None: ... + def filter(self, record: LogRecord) -> bool: ... + +class Logger(Filterer): + name: str + level: int + parent: Union[Logger, PlaceHolder] + propagate: bool + handlers: List[Handler] + disabled: int + def __init__(self, name: str, level: _Level = ...) -> None: ... + def setLevel(self, level: Union[int, str]) -> None: ... + def isEnabledFor(self, lvl: int) -> bool: ... + def getEffectiveLevel(self) -> int: ... + def getChild(self, suffix: str) -> Logger: ... + if sys.version_info >= (3,): + def debug(self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... + def info(self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... + def warning(self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... + def warn(self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... + def error(self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... + def critical(self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... + fatal = critical + def log(self, level: int, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... + def exception(self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... + else: + def debug(self, + msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... + def info(self, + msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... + def warning(self, + msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... + warn = warning + def error(self, + msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... + def critical(self, + msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... + fatal = critical + def log(self, + level: int, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... + def exception(self, + msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... + def addFilter(self, filt: _FilterType) -> None: ... + def removeFilter(self, filt: _FilterType) -> None: ... + def filter(self, record: LogRecord) -> bool: ... + def addHandler(self, hdlr: Handler) -> None: ... + def removeHandler(self, hdlr: Handler) -> None: ... + if sys.version_info >= (3,): + def findCaller(self, stack_info: bool = ...) -> Tuple[str, int, str, Optional[str]]: ... + else: + def findCaller(self) -> Tuple[str, int, str]: ... + def handle(self, record: LogRecord) -> None: ... + if sys.version_info >= (3,): + def makeRecord(self, name: str, lvl: int, fn: str, lno: int, msg: Any, + args: _ArgsType, + exc_info: Optional[_SysExcInfoType], + func: Optional[str] = ..., + extra: Optional[Mapping[str, Any]] = ..., + sinfo: Optional[str] = ...) -> LogRecord: ... + else: + def makeRecord(self, + name: str, lvl: int, fn: str, lno: int, msg: Any, + args: _ArgsType, + exc_info: Optional[_SysExcInfoType], + func: Optional[str] = ..., + extra: Optional[Mapping[str, Any]] = ...) -> LogRecord: ... + if sys.version_info >= (3,): + def hasHandlers(self) -> bool: ... + + +CRITICAL: int +FATAL: int +ERROR: int +WARNING: int +WARN: int +INFO: int +DEBUG: int +NOTSET: int + + +class Handler(Filterer): + level: int # undocumented + formatter: Optional[Formatter] # undocumented + lock: Optional[threading.Lock] # undocumented + name: Optional[str] # undocumented + def __init__(self, level: _Level = ...) -> None: ... + def createLock(self) -> None: ... + def acquire(self) -> None: ... + def release(self) -> None: ... + def setLevel(self, lvl: Union[int, str]) -> None: ... + def setFormatter(self, form: Formatter) -> None: ... + def addFilter(self, filt: _FilterType) -> None: ... + def removeFilter(self, filt: _FilterType) -> None: ... + def filter(self, record: LogRecord) -> bool: ... + def flush(self) -> None: ... + def close(self) -> None: ... + def handle(self, record: LogRecord) -> None: ... + def handleError(self, record: LogRecord) -> None: ... + def format(self, record: LogRecord) -> str: ... + def emit(self, record: LogRecord) -> None: ... + + +class Formatter: + converter: Callable[[Optional[float]], struct_time] + _fmt: Optional[str] + datefmt: Optional[str] + if sys.version_info >= (3,): + _style: PercentStyle + default_time_format: str + default_msec_format: str + + if sys.version_info >= (3,): + def __init__(self, fmt: Optional[str] = ..., + datefmt: Optional[str] = ..., + style: str = ...) -> None: ... + else: + def __init__(self, + fmt: Optional[str] = ..., + datefmt: Optional[str] = ...) -> None: ... + + def format(self, record: LogRecord) -> str: ... + def formatTime(self, record: LogRecord, datefmt: str = ...) -> str: ... + def formatException(self, exc_info: _SysExcInfoType) -> str: ... + if sys.version_info >= (3,): + def formatMessage(self, record: LogRecord) -> str: ... # undocumented + def formatStack(self, stack_info: str) -> str: ... + + +class Filter: + def __init__(self, name: str = ...) -> None: ... + def filter(self, record: LogRecord) -> int: ... + + +class LogRecord: + args: _ArgsType + asctime: str + created: int + exc_info: Optional[_SysExcInfoType] + exc_text: Optional[str] + filename: str + funcName: str + levelname: str + levelno: int + lineno: int + module: str + msecs: int + message: str + msg: str + name: str + pathname: str + process: int + processName: str + relativeCreated: int + if sys.version_info >= (3,): + stack_info: Optional[str] + thread: int + threadName: str + if sys.version_info >= (3,): + def __init__(self, name: str, level: int, pathname: str, lineno: int, + msg: Any, args: _ArgsType, + exc_info: Optional[_SysExcInfoType], + func: Optional[str] = ..., + sinfo: Optional[str] = ...) -> None: ... + else: + def __init__(self, + name: str, level: int, pathname: str, lineno: int, + msg: Any, args: _ArgsType, + exc_info: Optional[_SysExcInfoType], + func: Optional[str] = ...) -> None: ... + def getMessage(self) -> str: ... + + +class LoggerAdapter: + logger: Logger + extra: Mapping[str, Any] + def __init__(self, logger: Logger, extra: Mapping[str, Any]) -> None: ... + def process(self, msg: Any, kwargs: MutableMapping[str, Any]) -> Tuple[Any, MutableMapping[str, Any]]: ... + if sys.version_info >= (3,): + def debug(self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... + def info(self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... + def warning(self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... + def warn(self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... + def error(self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... + def exception(self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... + def critical(self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... + def log(self, level: int, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... + else: + def debug(self, + msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... + def info(self, + msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... + def warning(self, + msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... + def error(self, + msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... + def exception(self, + msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... + def critical(self, + msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... + def log(self, + level: int, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... + def isEnabledFor(self, lvl: int) -> bool: ... + if sys.version_info >= (3,): + def getEffectiveLevel(self) -> int: ... + def setLevel(self, lvl: Union[int, str]) -> None: ... + def hasHandlers(self) -> bool: ... + + +if sys.version_info >= (3,): + def getLogger(name: Optional[str] = ...) -> Logger: ... +else: + @overload + def getLogger() -> Logger: ... + @overload + def getLogger(name: Union[Text, str]) -> Logger: ... +def getLoggerClass() -> type: ... +if sys.version_info >= (3,): + def getLogRecordFactory() -> Callable[..., LogRecord]: ... + +if sys.version_info >= (3,): + def debug(msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... + def info(msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... + def warning(msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... + def warn(msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... + def error(msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... + def critical(msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... + def exception(msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... + def log(level: int, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... +else: + def debug(msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... + def info(msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... + def warning(msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... + warn = warning + def error(msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... + def critical(msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... + def exception(msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... + def log(level: int, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... +fatal = critical + +def disable(lvl: int) -> None: ... +def addLevelName(lvl: int, levelName: str) -> None: ... +def getLevelName(lvl: Union[int, str]) -> Any: ... + +def makeLogRecord(attrdict: Mapping[str, Any]) -> LogRecord: ... + +if sys.version_info >= (3,): + def basicConfig(*, filename: _Path = ..., filemode: str = ..., + format: str = ..., datefmt: str = ..., style: str = ..., + level: _Level = ..., stream: IO[str] = ..., + handlers: Iterable[Handler] = ...) -> None: ... +else: + @overload + def basicConfig() -> None: ... + @overload + def basicConfig(*, filename: str = ..., filemode: str = ..., + format: str = ..., datefmt: str = ..., + level: _Level = ..., stream: IO[str] = ...) -> None: ... +def shutdown() -> None: ... + +def setLoggerClass(klass: type) -> None: ... + +def captureWarnings(capture: bool) -> None: ... + +if sys.version_info >= (3,): + def setLogRecordFactory(factory: Callable[..., LogRecord]) -> None: ... + + +if sys.version_info >= (3,): + lastResort: Optional[StreamHandler] + + +class StreamHandler(Handler): + stream: IO[str] + if sys.version_info >= (3,): + terminator: str + def __init__(self, stream: Optional[IO[str]] = ...) -> None: ... + + +class FileHandler(Handler): + baseFilename: str + mode: str + encoding: Optional[str] + delay: bool + def __init__(self, filename: _Path, mode: str = ..., + encoding: Optional[str] = ..., delay: bool = ...) -> None: ... + + +class NullHandler(Handler): ... + + +class PlaceHolder: + def __init__(self, alogger: Logger) -> None: ... + def append(self, alogger: Logger) -> None: ... + + +# Below aren't in module docs but still visible + +class RootLogger(Logger): ... + +root: RootLogger + + +if sys.version_info >= (3,): + class PercentStyle(object): + default_format: str + asctime_format: str + asctime_search: str + _fmt: str + + def __init__(self, fmt: str) -> None: ... + def usesTime(self) -> bool: ... + def format(self, record: Any) -> str: ... + + class StrFormatStyle(PercentStyle): + ... + + class StringTemplateStyle(PercentStyle): + _tpl: Template + + _STYLES: Dict[str, Tuple[PercentStyle, str]] + + +BASIC_FORMAT: str diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/logging/config.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/logging/config.pyi new file mode 100644 index 0000000..c8dbfdf --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/logging/config.pyi @@ -0,0 +1,33 @@ +# Stubs for logging.config (Python 3.4) + +from typing import Any, Callable, Dict, Optional, IO, Union +from threading import Thread +import sys +if sys.version_info >= (3,): + from configparser import RawConfigParser +else: + from ConfigParser import RawConfigParser +if sys.version_info >= (3, 6): + from os import PathLike + +if sys.version_info >= (3, 7): + _Path = Union[str, bytes, PathLike[str]] +elif sys.version_info >= (3, 6): + _Path = Union[str, PathLike[str]] +else: + _Path = str + + +def dictConfig(config: Dict[str, Any]) -> None: ... +if sys.version_info >= (3, 4): + def fileConfig(fname: Union[_Path, IO[str], RawConfigParser], + defaults: Optional[Dict[str, str]] = ..., + disable_existing_loggers: bool = ...) -> None: ... + def listen(port: int = ..., + verify: Optional[Callable[[bytes], Optional[bytes]]] = ...) -> Thread: ... +else: + def fileConfig(fname: Union[str, IO[str]], + defaults: Optional[Dict[str, str]] = ..., + disable_existing_loggers: bool = ...) -> None: ... + def listen(port: int = ...) -> Thread: ... +def stopListening() -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/logging/handlers.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/logging/handlers.pyi new file mode 100644 index 0000000..c18ddcc --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/logging/handlers.pyi @@ -0,0 +1,213 @@ +# Stubs for logging.handlers (Python 2.4) + +import datetime +from logging import Handler, FileHandler, LogRecord +from socket import SocketType +import ssl +import sys +from typing import Any, Callable, Dict, List, Optional, Tuple, Union, overload +if sys.version_info >= (3,): + from queue import Queue +else: + from Queue import Queue + +# TODO update socket stubs to add SocketKind +_SocketKind = int +if sys.version_info >= (3, 6): + from os import PathLike + _Path = Union[str, PathLike[str]] +else: + _Path = str + +DEFAULT_TCP_LOGGING_PORT: int +DEFAULT_UDP_LOGGING_PORT: int +DEFAULT_HTTP_LOGGING_PORT: int +DEFAULT_SOAP_LOGGING_PORT: int +SYSLOG_UDP_PORT: int +SYSLOG_TCP_PORT: int + +class WatchedFileHandler(FileHandler): + @overload + def __init__(self, filename: _Path) -> None: ... + @overload + def __init__(self, filename: _Path, mode: str) -> None: ... + @overload + def __init__(self, filename: _Path, mode: str, + encoding: Optional[str]) -> None: ... + @overload + def __init__(self, filename: _Path, mode: str, encoding: Optional[str], + delay: bool) -> None: ... + + +if sys.version_info >= (3,): + class BaseRotatingHandler(FileHandler): + terminator: str + namer: Optional[Callable[[str], str]] + rotator: Optional[Callable[[str, str], None]] + def __init__(self, filename: _Path, mode: str, + encoding: Optional[str] = ..., + delay: bool = ...) -> None: ... + def rotation_filename(self, default_name: str) -> None: ... + def rotate(self, source: str, dest: str) -> None: ... + + +if sys.version_info >= (3,): + class RotatingFileHandler(BaseRotatingHandler): + def __init__(self, filename: _Path, mode: str = ..., maxBytes: int = ..., + backupCount: int = ..., encoding: Optional[str] = ..., + delay: bool = ...) -> None: ... + def doRollover(self) -> None: ... +else: + class RotatingFileHandler(Handler): + def __init__(self, filename: str, mode: str = ..., maxBytes: int = ..., + backupCount: int = ..., encoding: Optional[str] = ..., + delay: bool = ...) -> None: ... + def doRollover(self) -> None: ... + + +if sys.version_info >= (3,): + class TimedRotatingFileHandler(BaseRotatingHandler): + if sys.version_info >= (3, 4): + def __init__(self, filename: _Path, when: str = ..., + interval: int = ..., + backupCount: int = ..., encoding: Optional[str] = ..., + delay: bool = ..., utc: bool = ..., + atTime: Optional[datetime.datetime] = ...) -> None: ... + else: + def __init__(self, + filename: str, when: str = ..., interval: int = ..., + backupCount: int = ..., encoding: Optional[str] = ..., + delay: bool = ..., utc: bool = ...) -> None: ... + def doRollover(self) -> None: ... +else: + class TimedRotatingFileHandler(Handler): + def __init__(self, + filename: str, when: str = ..., interval: int = ..., + backupCount: int = ..., encoding: Optional[str] = ..., + delay: bool = ..., utc: bool = ...) -> None: ... + def doRollover(self) -> None: ... + + +class SocketHandler(Handler): + retryStart: float + retryFactor: float + retryMax: float + if sys.version_info >= (3, 4): + def __init__(self, host: str, port: Optional[int]) -> None: ... + else: + def __init__(self, host: str, port: int) -> None: ... + def makeSocket(self) -> SocketType: ... + def makePickle(self, record: LogRecord) -> bytes: ... + def send(self, packet: bytes) -> None: ... + def createSocket(self) -> None: ... + + +class DatagramHandler(SocketHandler): ... + + +class SysLogHandler(Handler): + LOG_ALERT: int + LOG_CRIT: int + LOG_DEBUG: int + LOG_EMERG: int + LOG_ERR: int + LOG_INFO: int + LOG_NOTICE: int + LOG_WARNING: int + LOG_AUTH: int + LOG_AUTHPRIV: int + LOG_CRON: int + LOG_DAEMON: int + LOG_FTP: int + LOG_KERN: int + LOG_LPR: int + LOG_MAIL: int + LOG_NEWS: int + LOG_SYSLOG: int + LOG_USER: int + LOG_UUCP: int + LOG_LOCAL0: int + LOG_LOCAL1: int + LOG_LOCAL2: int + LOG_LOCAL3: int + LOG_LOCAL4: int + LOG_LOCAL5: int + LOG_LOCAL6: int + LOG_LOCAL7: int + def __init__(self, address: Union[Tuple[str, int], str] = ..., + facility: int = ..., socktype: _SocketKind = ...) -> None: ... + def encodePriority(self, facility: Union[int, str], + priority: Union[int, str]) -> int: ... + def mapPriority(self, levelName: str) -> str: ... + + +class NTEventLogHandler(Handler): + def __init__(self, appname: str, dllname: str = ..., + logtype: str = ...) -> None: ... + def getEventCategory(self, record: LogRecord) -> int: ... + # TODO correct return value? + def getEventType(self, record: LogRecord) -> int: ... + def getMessageID(self, record: LogRecord) -> int: ... + + +class SMTPHandler(Handler): + # TODO `secure` can also be an empty tuple + if sys.version_info >= (3,): + def __init__(self, mailhost: Union[str, Tuple[str, int]], fromaddr: str, + toaddrs: List[str], subject: str, + credentials: Optional[Tuple[str, str]] = ..., + secure: Union[Tuple[str], Tuple[str, str], None] = ..., + timeout: float = ...) -> None: ... + else: + def __init__(self, + mailhost: Union[str, Tuple[str, int]], fromaddr: str, + toaddrs: List[str], subject: str, + credentials: Optional[Tuple[str, str]] = ..., + secure: Union[Tuple[str], Tuple[str, str], None] = ...) -> None: ... + def getSubject(self, record: LogRecord) -> str: ... + + +class BufferingHandler(Handler): + def __init__(self, capacity: int) -> None: ... + def shouldFlush(self, record: LogRecord) -> bool: ... + +class MemoryHandler(BufferingHandler): + def __init__(self, capacity: int, flushLevel: int = ..., + target: Optional[Handler] = ...) -> None: ... + def setTarget(self, target: Handler) -> None: ... + + +class HTTPHandler(Handler): + if sys.version_info >= (3, 5): + def __init__(self, host: str, url: str, method: str = ..., + secure: bool = ..., + credentials: Optional[Tuple[str, str]] = ..., + context: Optional[ssl.SSLContext] = ...) -> None: ... + elif sys.version_info >= (3,): + def __init__(self, + host: str, url: str, method: str = ..., secure: bool = ..., + credentials: Optional[Tuple[str, str]] = ...) -> None: ... + else: + def __init__(self, + host: str, url: str, method: str = ...) -> None: ... + def mapLogRecord(self, record: LogRecord) -> Dict[str, Any]: ... + + +if sys.version_info >= (3,): + class QueueHandler(Handler): + def __init__(self, queue: Queue) -> None: ... + def prepare(self, record: LogRecord) -> Any: ... + def enqueue(self, record: LogRecord) -> None: ... + + class QueueListener: + if sys.version_info >= (3, 5): + def __init__(self, queue: Queue, *handlers: Handler, + respect_handler_level: bool = ...) -> None: ... + else: + def __init__(self, + queue: Queue, *handlers: Handler) -> None: ... + def dequeue(self, block: bool) -> LogRecord: ... + def prepare(self, record: LogRecord) -> Any: ... + def start(self) -> None: ... + def stop(self) -> None: ... + def enqueue_sentinel(self) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/macpath.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/macpath.pyi new file mode 100644 index 0000000..c0bf576 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/macpath.pyi @@ -0,0 +1,180 @@ +# NB: path.pyi and stdlib/2 and stdlib/3 must remain consistent! +# Stubs for os.path +# Ron Murawski + +import os +import sys +from typing import ( + overload, List, Any, AnyStr, Sequence, Tuple, BinaryIO, TextIO, + TypeVar, Union, Text, Callable, Optional +) + +_T = TypeVar('_T') + +if sys.version_info >= (3, 6): + from builtins import _PathLike + _PathType = Union[bytes, Text, _PathLike] + _StrPath = Union[Text, _PathLike[Text]] + _BytesPath = Union[bytes, _PathLike[bytes]] +else: + _PathType = Union[bytes, Text] + _StrPath = Text + _BytesPath = bytes + +# ----- os.path variables ----- +supports_unicode_filenames: bool +# aliases (also in os) +curdir: str +pardir: str +sep: str +if sys.platform == 'win32': + altsep: str +else: + altsep: Optional[str] +extsep: str +pathsep: str +defpath: str +devnull: str + +# ----- os.path function stubs ----- +if sys.version_info >= (3, 6): + # Overloads are necessary to work around python/mypy#3644. + @overload + def abspath(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def abspath(path: AnyStr) -> AnyStr: ... + @overload + def basename(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def basename(path: AnyStr) -> AnyStr: ... + @overload + def dirname(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def dirname(path: AnyStr) -> AnyStr: ... + @overload + def expanduser(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def expanduser(path: AnyStr) -> AnyStr: ... + @overload + def expandvars(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def expandvars(path: AnyStr) -> AnyStr: ... + @overload + def normcase(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def normcase(path: AnyStr) -> AnyStr: ... + @overload + def normpath(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def normpath(path: AnyStr) -> AnyStr: ... + if sys.platform == 'win32': + @overload + def realpath(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def realpath(path: AnyStr) -> AnyStr: ... + else: + @overload + def realpath(filename: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def realpath(filename: AnyStr) -> AnyStr: ... + +else: + def abspath(path: AnyStr) -> AnyStr: ... + def basename(path: AnyStr) -> AnyStr: ... + def dirname(path: AnyStr) -> AnyStr: ... + def expanduser(path: AnyStr) -> AnyStr: ... + def expandvars(path: AnyStr) -> AnyStr: ... + def normcase(path: AnyStr) -> AnyStr: ... + def normpath(path: AnyStr) -> AnyStr: ... + if sys.platform == 'win32': + def realpath(path: AnyStr) -> AnyStr: ... + else: + def realpath(filename: AnyStr) -> AnyStr: ... + +if sys.version_info >= (3, 6): + # In reality it returns str for sequences of _StrPath and bytes for sequences + # of _BytesPath, but mypy does not accept such a signature. + def commonpath(paths: Sequence[_PathType]) -> Any: ... +elif sys.version_info >= (3, 5): + def commonpath(paths: Sequence[AnyStr]) -> AnyStr: ... + +# NOTE: Empty lists results in '' (str) regardless of contained type. +# Also, in Python 2 mixed sequences of Text and bytes results in either Text or bytes +# So, fall back to Any +def commonprefix(list: Sequence[_PathType]) -> Any: ... + +if sys.version_info >= (3, 3): + def exists(path: Union[_PathType, int]) -> bool: ... +else: + def exists(path: _PathType) -> bool: ... +def lexists(path: _PathType) -> bool: ... + +# These return float if os.stat_float_times() == True, +# but int is a subclass of float. +def getatime(path: _PathType) -> float: ... +def getmtime(path: _PathType) -> float: ... +def getctime(path: _PathType) -> float: ... + +def getsize(path: _PathType) -> int: ... +def isabs(path: _PathType) -> bool: ... +def isfile(path: _PathType) -> bool: ... +def isdir(path: _PathType) -> bool: ... +def islink(path: _PathType) -> bool: ... +def ismount(path: _PathType) -> bool: ... + +if sys.version_info < (3, 0): + # Make sure signatures are disjunct, and allow combinations of bytes and unicode. + # (Since Python 2 allows that, too) + # Note that e.g. os.path.join("a", "b", "c", "d", u"e") will still result in + # a type error. + @overload + def join(__p1: bytes, *p: bytes) -> bytes: ... + @overload + def join(__p1: bytes, __p2: bytes, __p3: bytes, __p4: Text, *p: _PathType) -> Text: ... + @overload + def join(__p1: bytes, __p2: bytes, __p3: Text, *p: _PathType) -> Text: ... + @overload + def join(__p1: bytes, __p2: Text, *p: _PathType) -> Text: ... + @overload + def join(__p1: Text, *p: _PathType) -> Text: ... +elif sys.version_info >= (3, 6): + # Mypy complains that the signatures overlap (same for relpath below), but things seem to behave correctly anyway. + @overload + def join(path: _StrPath, *paths: _StrPath) -> Text: ... + @overload + def join(path: _BytesPath, *paths: _BytesPath) -> bytes: ... +else: + def join(path: AnyStr, *paths: AnyStr) -> AnyStr: ... + +@overload +def relpath(path: _BytesPath, start: Optional[_BytesPath] = ...) -> bytes: ... +@overload +def relpath(path: _StrPath, start: Optional[_StrPath] = ...) -> Text: ... + +def samefile(path1: _PathType, path2: _PathType) -> bool: ... +def sameopenfile(fp1: int, fp2: int) -> bool: ... +def samestat(stat1: os.stat_result, stat2: os.stat_result) -> bool: ... + +if sys.version_info >= (3, 6): + @overload + def split(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... + @overload + def split(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitdrive(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitdrive(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitext(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitext(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... +else: + def split(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + def splitdrive(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + def splitext(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + +if sys.platform == 'win32': + def splitunc(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... # deprecated + +if sys.version_info < (3,): + def walk(path: AnyStr, visit: Callable[[_T, AnyStr, List[AnyStr]], Any], arg: _T) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/marshal.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/marshal.pyi new file mode 100644 index 0000000..6eb3f17 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/marshal.pyi @@ -0,0 +1,8 @@ +from typing import Any, IO + +version: int + +def dump(value: Any, file: IO[Any], version: int = ...) -> None: ... +def load(file: IO[Any]) -> Any: ... +def dumps(value: Any, version: int = ...) -> str: ... +def loads(string: str) -> Any: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/math.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/math.pyi new file mode 100644 index 0000000..25eb1c4 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/math.pyi @@ -0,0 +1,71 @@ +# Stubs for math +# See: http://docs.python.org/2/library/math.html + +from typing import Tuple, Iterable, SupportsFloat, SupportsInt + +import sys + +e: float +pi: float +if sys.version_info >= (3, 5): + inf: float + nan: float +if sys.version_info >= (3, 6): + tau: float + +def acos(x: SupportsFloat) -> float: ... +def acosh(x: SupportsFloat) -> float: ... +def asin(x: SupportsFloat) -> float: ... +def asinh(x: SupportsFloat) -> float: ... +def atan(x: SupportsFloat) -> float: ... +def atan2(y: SupportsFloat, x: SupportsFloat) -> float: ... +def atanh(x: SupportsFloat) -> float: ... +if sys.version_info >= (3,): + def ceil(x: SupportsFloat) -> int: ... +else: + def ceil(x: SupportsFloat) -> float: ... +def copysign(x: SupportsFloat, y: SupportsFloat) -> float: ... +def cos(x: SupportsFloat) -> float: ... +def cosh(x: SupportsFloat) -> float: ... +def degrees(x: SupportsFloat) -> float: ... +def erf(x: SupportsFloat) -> float: ... +def erfc(x: SupportsFloat) -> float: ... +def exp(x: SupportsFloat) -> float: ... +def expm1(x: SupportsFloat) -> float: ... +def fabs(x: SupportsFloat) -> float: ... +def factorial(x: SupportsInt) -> int: ... +if sys.version_info >= (3,): + def floor(x: SupportsFloat) -> int: ... +else: + def floor(x: SupportsFloat) -> float: ... +def fmod(x: SupportsFloat, y: SupportsFloat) -> float: ... +def frexp(x: SupportsFloat) -> Tuple[float, int]: ... +def fsum(iterable: Iterable) -> float: ... +def gamma(x: SupportsFloat) -> float: ... +if sys.version_info >= (3, 5): + def gcd(a: int, b: int) -> int: ... +def hypot(x: SupportsFloat, y: SupportsFloat) -> float: ... +if sys.version_info >= (3, 5): + def isclose(a: SupportsFloat, b: SupportsFloat, rel_tol: SupportsFloat = ..., abs_tol: SupportsFloat = ...) -> bool: ... +def isinf(x: SupportsFloat) -> bool: ... +if sys.version_info >= (3,): + def isfinite(x: SupportsFloat) -> bool: ... +def isnan(x: SupportsFloat) -> bool: ... +def ldexp(x: SupportsFloat, i: int) -> float: ... +def lgamma(x: SupportsFloat) -> float: ... +def log(x: SupportsFloat, base: SupportsFloat = ...) -> float: ... +def log10(x: SupportsFloat) -> float: ... +def log1p(x: SupportsFloat) -> float: ... +if sys.version_info >= (3, 3): + def log2(x: SupportsFloat) -> float: ... +def modf(x: SupportsFloat) -> Tuple[float, float]: ... +def pow(x: SupportsFloat, y: SupportsFloat) -> float: ... +def radians(x: SupportsFloat) -> float: ... +if sys.version_info >= (3, 7): + def remainder(x: SupportsFloat, y: SupportsFloat) -> float: ... +def sin(x: SupportsFloat) -> float: ... +def sinh(x: SupportsFloat) -> float: ... +def sqrt(x: SupportsFloat) -> float: ... +def tan(x: SupportsFloat) -> float: ... +def tanh(x: SupportsFloat) -> float: ... +def trunc(x: SupportsFloat) -> int: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/mimetypes.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/mimetypes.pyi new file mode 100644 index 0000000..eb83027 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/mimetypes.pyi @@ -0,0 +1,38 @@ +# Stubs for mimetypes + +from typing import Dict, IO, List, Optional, Sequence, Text, Tuple +import sys + +def guess_type(url: Text, + strict: bool = ...) -> Tuple[Optional[str], Optional[str]]: ... +def guess_all_extensions(type: str, strict: bool = ...) -> List[str]: ... +def guess_extension(type: str, strict: bool = ...) -> Optional[str]: ... + +def init(files: Optional[Sequence[str]] = ...) -> None: ... +def read_mime_types(filename: str) -> Optional[Dict[str, str]]: ... +def add_type(type: str, ext: str, strict: bool = ...) -> None: ... + +inited: bool +knownfiles: List[str] +suffix_map: Dict[str, str] +encodings_map: Dict[str, str] +types_map: Dict[str, str] +common_types: Dict[str, str] + +class MimeTypes: + suffix_map: Dict[str, str] + encodings_map: Dict[str, str] + types_map: Tuple[Dict[str, str], Dict[str, str]] + types_map_inv: Tuple[Dict[str, str], Dict[str, str]] + def __init__(self, filenames: Tuple[str, ...] = ..., + strict: bool = ...) -> None: ... + def guess_extension(self, type: str, + strict: bool = ...) -> Optional[str]: ... + def guess_type(self, url: str, + strict: bool = ...) -> Tuple[Optional[str], Optional[str]]: ... + def guess_all_extensions(self, type: str, + strict: bool = ...) -> List[str]: ... + def read(self, filename: str, strict: bool = ...) -> None: ... + def readfp(self, fp: IO[str], strict: bool = ...) -> None: ... + if sys.platform == 'win32': + def read_windows_registry(self, strict: bool = ...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/mmap.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/mmap.pyi new file mode 100644 index 0000000..709d5d9 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/mmap.pyi @@ -0,0 +1,73 @@ +import sys +from typing import (Optional, Sequence, Union, Generic, overload, + Iterable, Iterator, Sized, ContextManager, AnyStr) + +ACCESS_DEFAULT: int +ACCESS_READ: int +ACCESS_WRITE: int +ACCESS_COPY: int + +ALLOCATIONGRANULARITY: int + +if sys.platform != 'win32': + MAP_ANON: int + MAP_ANONYMOUS: int + MAP_DENYWRITE: int + MAP_EXECUTABLE: int + MAP_PRIVATE: int + MAP_SHARED: int + PROT_EXEC: int + PROT_READ: int + PROT_WRITE: int + + PAGESIZE: int + +class _mmap(Generic[AnyStr]): + if sys.platform == 'win32': + def __init__(self, fileno: int, length: int, + tagname: Optional[str] = ..., access: int = ..., + offset: int = ...) -> None: ... + else: + def __init__(self, + fileno: int, length: int, flags: int = ..., + prot: int = ..., access: int = ..., + offset: int = ...) -> None: ... + def close(self) -> None: ... + def find(self, sub: AnyStr, + start: int = ..., end: int = ...) -> int: ... + def flush(self, offset: int = ..., size: int = ...) -> int: ... + def move(self, dest: int, src: int, count: int) -> None: ... + def read(self, n: int = ...) -> AnyStr: ... + def read_byte(self) -> AnyStr: ... + def readline(self) -> AnyStr: ... + def resize(self, newsize: int) -> None: ... + def seek(self, pos: int, whence: int = ...) -> None: ... + def size(self) -> int: ... + def tell(self) -> int: ... + def write(self, bytes: AnyStr) -> None: ... + def write_byte(self, byte: AnyStr) -> None: ... + def __len__(self) -> int: ... + +if sys.version_info >= (3,): + class mmap(_mmap, ContextManager[mmap], Iterable[bytes], Sized): + closed: bool + def rfind(self, sub: bytes, start: int = ..., stop: int = ...) -> int: ... + @overload + def __getitem__(self, index: int) -> int: ... + @overload + def __getitem__(self, index: slice) -> bytes: ... + def __delitem__(self, index: Union[int, slice]) -> None: ... + @overload + def __setitem__(self, index: int, object: int) -> None: ... + @overload + def __setitem__(self, index: slice, object: bytes) -> None: ... + # Doesn't actually exist, but the object is actually iterable because it has __getitem__ and + # __len__, so we claim that there is also an __iter__ to help type checkers. + def __iter__(self) -> Iterator[bytes]: ... +else: + class mmap(_mmap, Sequence[bytes]): + def rfind(self, string: bytes, start: int = ..., stop: int = ...) -> int: ... + def __getitem__(self, index: Union[int, slice]) -> bytes: ... + def __getslice__(self, i: Optional[int], j: Optional[int]) -> bytes: ... + def __delitem__(self, index: Union[int, slice]) -> None: ... + def __setitem__(self, index: Union[int, slice], object: bytes) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/netrc.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/netrc.pyi new file mode 100644 index 0000000..3ceae88 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/netrc.pyi @@ -0,0 +1,19 @@ +from typing import AnyStr, Dict, List, Optional, Tuple, overload + + +class NetrcParseError(Exception): + filename: Optional[str] + lineno: Optional[int] + msg: str + + +# (login, account, password) tuple +_NetrcTuple = Tuple[str, Optional[str], Optional[str]] + + +class netrc: + hosts: Dict[str, _NetrcTuple] + macros: Dict[str, List[str]] + + def __init__(self, file: str = ...) -> None: ... + def authenticators(self, host: str) -> Optional[_NetrcTuple]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/nis.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/nis.pyi new file mode 100644 index 0000000..87223ca --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/nis.pyi @@ -0,0 +1,10 @@ +import sys +from typing import Dict, List + +if sys.platform != 'win32': + def cat(map: str, domain: str = ...) -> Dict[str, str]: ... + def get_default_domain() -> str: ... + def maps(domain: str = ...) -> List[str]: ... + def match(key: str, map: str, domain: str = ...) -> str: ... + + class error(Exception): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/ntpath.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/ntpath.pyi new file mode 100644 index 0000000..c0bf576 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/ntpath.pyi @@ -0,0 +1,180 @@ +# NB: path.pyi and stdlib/2 and stdlib/3 must remain consistent! +# Stubs for os.path +# Ron Murawski + +import os +import sys +from typing import ( + overload, List, Any, AnyStr, Sequence, Tuple, BinaryIO, TextIO, + TypeVar, Union, Text, Callable, Optional +) + +_T = TypeVar('_T') + +if sys.version_info >= (3, 6): + from builtins import _PathLike + _PathType = Union[bytes, Text, _PathLike] + _StrPath = Union[Text, _PathLike[Text]] + _BytesPath = Union[bytes, _PathLike[bytes]] +else: + _PathType = Union[bytes, Text] + _StrPath = Text + _BytesPath = bytes + +# ----- os.path variables ----- +supports_unicode_filenames: bool +# aliases (also in os) +curdir: str +pardir: str +sep: str +if sys.platform == 'win32': + altsep: str +else: + altsep: Optional[str] +extsep: str +pathsep: str +defpath: str +devnull: str + +# ----- os.path function stubs ----- +if sys.version_info >= (3, 6): + # Overloads are necessary to work around python/mypy#3644. + @overload + def abspath(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def abspath(path: AnyStr) -> AnyStr: ... + @overload + def basename(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def basename(path: AnyStr) -> AnyStr: ... + @overload + def dirname(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def dirname(path: AnyStr) -> AnyStr: ... + @overload + def expanduser(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def expanduser(path: AnyStr) -> AnyStr: ... + @overload + def expandvars(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def expandvars(path: AnyStr) -> AnyStr: ... + @overload + def normcase(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def normcase(path: AnyStr) -> AnyStr: ... + @overload + def normpath(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def normpath(path: AnyStr) -> AnyStr: ... + if sys.platform == 'win32': + @overload + def realpath(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def realpath(path: AnyStr) -> AnyStr: ... + else: + @overload + def realpath(filename: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def realpath(filename: AnyStr) -> AnyStr: ... + +else: + def abspath(path: AnyStr) -> AnyStr: ... + def basename(path: AnyStr) -> AnyStr: ... + def dirname(path: AnyStr) -> AnyStr: ... + def expanduser(path: AnyStr) -> AnyStr: ... + def expandvars(path: AnyStr) -> AnyStr: ... + def normcase(path: AnyStr) -> AnyStr: ... + def normpath(path: AnyStr) -> AnyStr: ... + if sys.platform == 'win32': + def realpath(path: AnyStr) -> AnyStr: ... + else: + def realpath(filename: AnyStr) -> AnyStr: ... + +if sys.version_info >= (3, 6): + # In reality it returns str for sequences of _StrPath and bytes for sequences + # of _BytesPath, but mypy does not accept such a signature. + def commonpath(paths: Sequence[_PathType]) -> Any: ... +elif sys.version_info >= (3, 5): + def commonpath(paths: Sequence[AnyStr]) -> AnyStr: ... + +# NOTE: Empty lists results in '' (str) regardless of contained type. +# Also, in Python 2 mixed sequences of Text and bytes results in either Text or bytes +# So, fall back to Any +def commonprefix(list: Sequence[_PathType]) -> Any: ... + +if sys.version_info >= (3, 3): + def exists(path: Union[_PathType, int]) -> bool: ... +else: + def exists(path: _PathType) -> bool: ... +def lexists(path: _PathType) -> bool: ... + +# These return float if os.stat_float_times() == True, +# but int is a subclass of float. +def getatime(path: _PathType) -> float: ... +def getmtime(path: _PathType) -> float: ... +def getctime(path: _PathType) -> float: ... + +def getsize(path: _PathType) -> int: ... +def isabs(path: _PathType) -> bool: ... +def isfile(path: _PathType) -> bool: ... +def isdir(path: _PathType) -> bool: ... +def islink(path: _PathType) -> bool: ... +def ismount(path: _PathType) -> bool: ... + +if sys.version_info < (3, 0): + # Make sure signatures are disjunct, and allow combinations of bytes and unicode. + # (Since Python 2 allows that, too) + # Note that e.g. os.path.join("a", "b", "c", "d", u"e") will still result in + # a type error. + @overload + def join(__p1: bytes, *p: bytes) -> bytes: ... + @overload + def join(__p1: bytes, __p2: bytes, __p3: bytes, __p4: Text, *p: _PathType) -> Text: ... + @overload + def join(__p1: bytes, __p2: bytes, __p3: Text, *p: _PathType) -> Text: ... + @overload + def join(__p1: bytes, __p2: Text, *p: _PathType) -> Text: ... + @overload + def join(__p1: Text, *p: _PathType) -> Text: ... +elif sys.version_info >= (3, 6): + # Mypy complains that the signatures overlap (same for relpath below), but things seem to behave correctly anyway. + @overload + def join(path: _StrPath, *paths: _StrPath) -> Text: ... + @overload + def join(path: _BytesPath, *paths: _BytesPath) -> bytes: ... +else: + def join(path: AnyStr, *paths: AnyStr) -> AnyStr: ... + +@overload +def relpath(path: _BytesPath, start: Optional[_BytesPath] = ...) -> bytes: ... +@overload +def relpath(path: _StrPath, start: Optional[_StrPath] = ...) -> Text: ... + +def samefile(path1: _PathType, path2: _PathType) -> bool: ... +def sameopenfile(fp1: int, fp2: int) -> bool: ... +def samestat(stat1: os.stat_result, stat2: os.stat_result) -> bool: ... + +if sys.version_info >= (3, 6): + @overload + def split(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... + @overload + def split(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitdrive(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitdrive(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitext(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitext(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... +else: + def split(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + def splitdrive(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + def splitext(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + +if sys.platform == 'win32': + def splitunc(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... # deprecated + +if sys.version_info < (3,): + def walk(path: AnyStr, visit: Callable[[_T, AnyStr, List[AnyStr]], Any], arg: _T) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/numbers.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/numbers.pyi new file mode 100644 index 0000000..50b561c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/numbers.pyi @@ -0,0 +1,140 @@ +# Stubs for numbers (Python 3.5) +# See https://docs.python.org/2.7/library/numbers.html +# and https://docs.python.org/3/library/numbers.html +# +# Note: these stubs are incomplete. The more complex type +# signatures are currently omitted. + +from typing import Any, Optional, SupportsFloat +from abc import ABCMeta, abstractmethod +import sys + +class Number(metaclass=ABCMeta): + @abstractmethod + def __hash__(self) -> int: ... + +class Complex(Number): + @abstractmethod + def __complex__(self) -> complex: ... + if sys.version_info >= (3, 0): + def __bool__(self) -> bool: ... + else: + def __nonzero__(self) -> bool: ... + @property + @abstractmethod + def real(self): ... + @property + @abstractmethod + def imag(self): ... + @abstractmethod + def __add__(self, other): ... + @abstractmethod + def __radd__(self, other): ... + @abstractmethod + def __neg__(self): ... + @abstractmethod + def __pos__(self): ... + def __sub__(self, other): ... + def __rsub__(self, other): ... + @abstractmethod + def __mul__(self, other): ... + @abstractmethod + def __rmul__(self, other): ... + if sys.version_info < (3, 0): + @abstractmethod + def __div__(self, other): ... + @abstractmethod + def __rdiv__(self, other): ... + @abstractmethod + def __truediv__(self, other): ... + @abstractmethod + def __rtruediv__(self, other): ... + @abstractmethod + def __pow__(self, exponent): ... + @abstractmethod + def __rpow__(self, base): ... + def __abs__(self): ... + def conjugate(self): ... + def __eq__(self, other: object) -> bool: ... + if sys.version_info < (3, 0): + def __ne__(self, other: object) -> bool: ... + +class Real(Complex, SupportsFloat): + @abstractmethod + def __float__(self) -> float: ... + @abstractmethod + def __trunc__(self) -> int: ... + if sys.version_info >= (3, 0): + @abstractmethod + def __floor__(self) -> int: ... + @abstractmethod + def __ceil__(self) -> int: ... + @abstractmethod + def __round__(self, ndigits: Optional[int] = ...): ... + def __divmod__(self, other): ... + def __rdivmod__(self, other): ... + @abstractmethod + def __floordiv__(self, other): ... + @abstractmethod + def __rfloordiv__(self, other): ... + @abstractmethod + def __mod__(self, other): ... + @abstractmethod + def __rmod__(self, other): ... + @abstractmethod + def __lt__(self, other) -> bool: ... + @abstractmethod + def __le__(self, other) -> bool: ... + def __complex__(self) -> complex: ... + @property + def real(self): ... + @property + def imag(self): ... + def conjugate(self): ... + +class Rational(Real): + @property + @abstractmethod + def numerator(self) -> int: ... + @property + @abstractmethod + def denominator(self) -> int: ... + def __float__(self) -> float: ... + +class Integral(Rational): + if sys.version_info >= (3, 0): + @abstractmethod + def __int__(self) -> int: ... + else: + @abstractmethod + def __long__(self) -> long: ... + def __index__(self) -> int: ... + @abstractmethod + def __pow__(self, exponent, modulus: Optional[Any] = ...): ... + @abstractmethod + def __lshift__(self, other): ... + @abstractmethod + def __rlshift__(self, other): ... + @abstractmethod + def __rshift__(self, other): ... + @abstractmethod + def __rrshift__(self, other): ... + @abstractmethod + def __and__(self, other): ... + @abstractmethod + def __rand__(self, other): ... + @abstractmethod + def __xor__(self, other): ... + @abstractmethod + def __rxor__(self, other): ... + @abstractmethod + def __or__(self, other): ... + @abstractmethod + def __ror__(self, other): ... + @abstractmethod + def __invert__(self): ... + def __float__(self) -> float: ... + @property + def numerator(self) -> int: ... + @property + def denominator(self) -> int: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/opcode.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/opcode.pyi new file mode 100644 index 0000000..34350e7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/opcode.pyi @@ -0,0 +1,23 @@ +from typing import List, Dict, Optional, Sequence + +import sys + +cmp_op: Sequence[str] +hasconst: List[int] +hasname: List[int] +hasjrel: List[int] +hasjabs: List[int] +haslocal: List[int] +hascompare: List[int] +hasfree: List[int] +opname: List[str] + +opmap: Dict[str, int] +HAVE_ARGUMENT: int +EXTENDED_ARG: int + +if sys.version_info >= (3, 4): + def stack_effect(opcode: int, oparg: Optional[int] = ...) -> int: ... + +if sys.version_info >= (3, 6): + hasnargs: List[int] diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/operator.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/operator.pyi new file mode 100644 index 0000000..eafc37c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/operator.pyi @@ -0,0 +1,227 @@ +# Stubs for operator + +from typing import ( + Any, Callable, Container, Mapping, MutableMapping, MutableSequence, Sequence, SupportsAbs, Tuple, + TypeVar, overload, +) +import sys + + +_T = TypeVar('_T') +_K = TypeVar('_K') +_V = TypeVar('_V') + + +def lt(a: Any, b: Any) -> Any: ... +def le(a: Any, b: Any) -> Any: ... +def eq(a: Any, b: Any) -> Any: ... +def ne(a: Any, b: Any) -> Any: ... +def ge(a: Any, b: Any) -> Any: ... +def gt(a: Any, b: Any) -> Any: ... +def __lt__(a: Any, b: Any) -> Any: ... +def __le__(a: Any, b: Any) -> Any: ... +def __eq__(a: Any, b: Any) -> Any: ... +def __ne__(a: Any, b: Any) -> Any: ... +def __ge__(a: Any, b: Any) -> Any: ... +def __gt__(a: Any, b: Any) -> Any: ... + +def not_(obj: Any) -> bool: ... +def __not__(obj: Any) -> bool: ... + +def truth(x: Any) -> bool: ... + +def is_(a: Any, b: Any) -> bool: ... + +def is_not(a: Any, b: Any) -> bool: ... + +def abs(x: SupportsAbs) -> Any: ... +def __abs__(a: SupportsAbs) -> Any: ... + +def add(a: Any, b: Any) -> Any: ... +def __add__(a: Any, b: Any) -> Any: ... + +def and_(a: Any, b: Any) -> Any: ... +def __and__(a: Any, b: Any) -> Any: ... + +if sys.version_info < (3, ): + def div(a: Any, b: Any) -> Any: ... + def __div__(a: Any, b: Any) -> Any: ... + +def floordiv(a: Any, b: Any) -> Any: ... +def __floordiv__(a: Any, b: Any) -> Any: ... + +def index(a: Any) -> int: ... +def __index__(a: Any) -> int: ... + +def inv(obj: Any) -> Any: ... +def invert(obj: Any) -> Any: ... +def __inv__(obj: Any) -> Any: ... +def __invert__(obj: Any) -> Any: ... + +def lshift(a: Any, b: Any) -> Any: ... +def __lshift__(a: Any, b: Any) -> Any: ... + +def mod(a: Any, b: Any) -> Any: ... +def __mod__(a: Any, b: Any) -> Any: ... + +def mul(a: Any, b: Any) -> Any: ... +def __mul__(a: Any, b: Any) -> Any: ... + +if sys.version_info >= (3, 5): + def matmul(a: Any, b: Any) -> Any: ... + def __matmul__(a: Any, b: Any) -> Any: ... + +def neg(obj: Any) -> Any: ... +def __neg__(obj: Any) -> Any: ... + +def or_(a: Any, b: Any) -> Any: ... +def __or__(a: Any, b: Any) -> Any: ... + +def pos(obj: Any) -> Any: ... +def __pos__(obj: Any) -> Any: ... + +def pow(a: Any, b: Any) -> Any: ... +def __pow__(a: Any, b: Any) -> Any: ... + +def rshift(a: Any, b: Any) -> Any: ... +def __rshift__(a: Any, b: Any) -> Any: ... + +def sub(a: Any, b: Any) -> Any: ... +def __sub__(a: Any, b: Any) -> Any: ... + +def truediv(a: Any, b: Any) -> Any: ... +def __truediv__(a: Any, b: Any) -> Any: ... + +def xor(a: Any, b: Any) -> Any: ... +def __xor__(a: Any, b: Any) -> Any: ... + +def concat(a: Sequence[_T], b: Sequence[_T]) -> Sequence[_T]: ... +def __concat__(a: Sequence[_T], b: Sequence[_T]) -> Sequence[_T]: ... + +def contains(a: Container[Any], b: Any) -> bool: ... +def __contains__(a: Container[Any], b: Any) -> bool: ... + +def countOf(a: Container[Any], b: Any) -> int: ... + +@overload +def delitem(a: MutableSequence[_T], b: int) -> None: ... +@overload +def delitem(a: MutableMapping[_K, _V], b: _K) -> None: ... +@overload +def __delitem__(a: MutableSequence[_T], b: int) -> None: ... +@overload +def __delitem__(a: MutableMapping[_K, _V], b: _K) -> None: ... + +if sys.version_info < (3, ): + def delslice(a: MutableSequence[Any], b: int, c: int) -> None: ... + def __delslice__(a: MutableSequence[Any], b: int, c: int) -> None: ... + +@overload +def getitem(a: Sequence[_T], b: int) -> _T: ... +@overload +def getitem(a: Mapping[_K, _V], b: _K) -> _V: ... +@overload +def __getitem__(a: Sequence[_T], b: int) -> _T: ... +@overload +def __getitem__(a: Mapping[_K, _V], b: _K) -> _V: ... + +if sys.version_info < (3, ): + def getslice(a: Sequence[_T], b: int, c: int) -> Sequence[_T]: ... + def __getslice__(a: Sequence[_T], b: int, c: int) -> Sequence[_T]: ... + +def indexOf(a: Sequence[_T], b: _T) -> int: ... + +if sys.version_info < (3, ): + def repeat(a: Any, b: int) -> Any: ... + def __repeat__(a: Any, b: int) -> Any: ... + +if sys.version_info < (3, ): + def sequenceIncludes(a: Container[Any], b: Any) -> bool: ... + +@overload +def setitem(a: MutableSequence[_T], b: int, c: _T) -> None: ... +@overload +def setitem(a: MutableMapping[_K, _V], b: _K, c: _V) -> None: ... +@overload +def __setitem__(a: MutableSequence[_T], b: int, c: _T) -> None: ... +@overload +def __setitem__(a: MutableMapping[_K, _V], b: _K, c: _V) -> None: ... + +if sys.version_info < (3, ): + def setslice(a: MutableSequence[_T], b: int, c: int, v: Sequence[_T]) -> None: ... + def __setslice__(a: MutableSequence[_T], b: int, c: int, v: Sequence[_T]) -> None: ... + + +if sys.version_info >= (3, 4): + def length_hint(obj: Any, default: int = ...) -> int: ... + +@overload +def attrgetter(attr: str) -> Callable[[Any], Any]: ... +@overload +def attrgetter(*attrs: str) -> Callable[[Any], Tuple[Any, ...]]: ... + +@overload +def itemgetter(item: Any) -> Callable[[Any], Any]: ... +@overload +def itemgetter(*items: Any) -> Callable[[Any], Tuple[Any, ...]]: ... + +def methodcaller(name: str, *args: Any, **kwargs: Any) -> Callable[..., Any]: ... + + +def iadd(a: Any, b: Any) -> Any: ... +def __iadd__(a: Any, b: Any) -> Any: ... + +def iand(a: Any, b: Any) -> Any: ... +def __iand__(a: Any, b: Any) -> Any: ... + +def iconcat(a: Any, b: Any) -> Any: ... +def __iconcat__(a: Any, b: Any) -> Any: ... + +if sys.version_info < (3, ): + def idiv(a: Any, b: Any) -> Any: ... + def __idiv__(a: Any, b: Any) -> Any: ... + +def ifloordiv(a: Any, b: Any) -> Any: ... +def __ifloordiv__(a: Any, b: Any) -> Any: ... + +def ilshift(a: Any, b: Any) -> Any: ... +def __ilshift__(a: Any, b: Any) -> Any: ... + +def imod(a: Any, b: Any) -> Any: ... +def __imod__(a: Any, b: Any) -> Any: ... + +def imul(a: Any, b: Any) -> Any: ... +def __imul__(a: Any, b: Any) -> Any: ... + +if sys.version_info >= (3, 5): + def imatmul(a: Any, b: Any) -> Any: ... + def __imatmul__(a: Any, b: Any) -> Any: ... + +def ior(a: Any, b: Any) -> Any: ... +def __ior__(a: Any, b: Any) -> Any: ... + +def ipow(a: Any, b: Any) -> Any: ... +def __ipow__(a: Any, b: Any) -> Any: ... + +if sys.version_info < (3, ): + def irepeat(a: Any, b: int) -> Any: ... + def __irepeat__(a: Any, b: int) -> Any: ... + +def irshift(a: Any, b: Any) -> Any: ... +def __irshift__(a: Any, b: Any) -> Any: ... + +def isub(a: Any, b: Any) -> Any: ... +def __isub__(a: Any, b: Any) -> Any: ... + +def itruediv(a: Any, b: Any) -> Any: ... +def __itruediv__(a: Any, b: Any) -> Any: ... + +def ixor(a: Any, b: Any) -> Any: ... +def __ixor__(a: Any, b: Any) -> Any: ... + + +if sys.version_info < (3, ): + def isCallable(x: Any) -> bool: ... + def isMappingType(x: Any) -> bool: ... + def isNumberType(x: Any) -> bool: ... + def isSequenceType(x: Any) -> bool: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/optparse.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/optparse.pyi new file mode 100644 index 0000000..9b8b8ea --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/optparse.pyi @@ -0,0 +1,228 @@ +# Generated by pytype, with only minor tweaks. Might be incomplete. +import sys +from typing import Any, AnyStr, Callable, Dict, IO, Iterable, List, Mapping, Optional, Sequence, Tuple, Union + +# See https://groups.google.com/forum/#!topic/python-ideas/gA1gdj3RZ5g +if sys.version_info >= (3,): + _Text = str +else: + _Text = Union[str, unicode] + +NO_DEFAULT: Tuple[_Text, ...] +SUPPRESS_HELP: _Text +SUPPRESS_USAGE: _Text + +def check_builtin(option: Option, opt: Any, value: _Text) -> Any: ... +def check_choice(option: Option, opt: Any, value: _Text) -> Any: ... +if sys.version_info < (3,): + def isbasestring(x: Any) -> bool: ... + +class OptParseError(Exception): + msg: _Text + def __init__(self, msg: _Text) -> None: ... + +class BadOptionError(OptParseError): + opt_str: _Text + def __init__(self, opt_str: _Text) -> None: ... + +class AmbiguousOptionError(BadOptionError): + possibilities: Iterable[_Text] + def __init__(self, opt_str: _Text, possibilities: Sequence[_Text]) -> None: ... + +class OptionError(OptParseError): + msg: _Text + option_id: _Text + def __init__(self, msg: _Text, option: Option) -> None: ... + +class OptionConflictError(OptionError): ... + +class OptionValueError(OptParseError): ... + + +class HelpFormatter: + NO_DEFAULT_VALUE: _Text + _long_opt_fmt: _Text + _short_opt_fmt: _Text + current_indent: int + default_tag: _Text + help_position: Any + help_width: Any + indent_increment: int + level: int + max_help_position: int + option_strings: Dict[Option, _Text] + parser: OptionParser + short_first: Any + width: int + def __init__(self, indent_increment: int, max_help_position: int, width: Optional[int], short_first: int) -> None: ... + def _format__Text(self, _Text: _Text) -> _Text: ... + def dedent(self) -> None: ... + def expand_default(self, option: Option) -> _Text: ... + def format_description(self, description: _Text) -> _Text: ... + def format_epilog(self, epilog) -> _Text: ... + def format_heading(self, heading: Any) -> _Text: ... + def format_option(self, option: OptionParser) -> _Text: ... + def format_option_strings(self, option: OptionParser) -> Any: ... + def format_usage(self, usage: Any) -> _Text: ... + def indent(self) -> None: ... + def set_long_opt_delimiter(self, delim: _Text) -> None: ... + def set_parser(self, parser: OptionParser) -> None: ... + def set_short_opt_delimiter(self, delim: _Text) -> None: ... + def store_option_strings(self, parser: OptionParser) -> None: ... + +class IndentedHelpFormatter(HelpFormatter): + def __init__(self, + indent_increment: int = ..., + max_help_position: int = ..., + width: Optional[int] = ..., + short_first: int = ...) -> None: ... + def format_heading(self, heading: _Text) -> _Text: ... + def format_usage(self, usage: _Text) -> _Text: ... + +class TitledHelpFormatter(HelpFormatter): + def __init__(self, + indent_increment: int = ..., + max_help_position: int = ..., + width: Optional[int] = ..., + short_first: int = ...) -> None: ... + def format_heading(self, heading: _Text) -> _Text: ... + def format_usage(self, usage: _Text) -> _Text: ... + +class Option: + ACTIONS: Tuple[_Text, ...] + ALWAYS_TYPED_ACTIONS: Tuple[_Text, ...] + ATTRS: List[_Text] + CHECK_METHODS: Optional[List[Callable]] + CONST_ACTIONS: Tuple[_Text, ...] + STORE_ACTIONS: Tuple[_Text, ...] + TYPED_ACTIONS: Tuple[_Text, ...] + TYPES: Tuple[_Text, ...] + TYPE_CHECKER: Dict[_Text, Callable] + _long_opts: List[_Text] + _short_opts: List[_Text] + action: _Text + dest: Optional[_Text] + nargs: int + type: Any + def __init__(self, *opts, **attrs) -> None: ... + def _check_action(self) -> None: ... + def _check_callback(self) -> None: ... + def _check_choice(self) -> None: ... + def _check_const(self) -> None: ... + def _check_dest(self) -> None: ... + def _check_nargs(self) -> None: ... + def _check_opt_strings(self, opts: Optional[_Text]) -> Any: ... + def _check_type(self) -> None: ... + def _set_attrs(self, attrs: Dict[_Text, Any]) -> None: ... + def _set_opt_strings(self, opts: _Text) -> None: ... + def check_value(self, opt: Any, value: Any) -> Any: ... + def convert_value(self, opt: Any, value: Any) -> Any: ... + def get_opt_string(self) -> _Text: ... + def process(self, opt: Any, value: Any, values: Any, parser: OptionParser) -> int: ... + def take_action(self, action: _Text, dest: _Text, opt: Any, value: Any, values: Any, parser: OptionParser) -> int: ... + def takes_value(self) -> bool: ... + +make_option = Option + +class OptionContainer: + _long_opt: Dict[_Text, Option] + _short_opt: Dict[_Text, Option] + conflict_handler: _Text + defaults: Dict[_Text, Any] + description: Any + option_class: Any + def __init__(self, option_class: Option, conflict_handler: Any, description: Any) -> None: ... + def _check_conflict(self, option: Any) -> None: ... + def _create_option_mappings(self) -> None: ... + def _share_option_mappings(self, parser: OptionParser) -> None: ... + def add_option(self, *args, **kwargs) -> Any: ... + def add_options(self, option_list: Iterable[Option]) -> None: ... + def destroy(self) -> None: ... + def format_description(self, formatter: Optional[HelpFormatter]) -> Any: ... + def format_help(self, formatter: Optional[HelpFormatter]) -> _Text: ... + def format_option_help(self, formatter: Optional[HelpFormatter]) -> _Text: ... + def get_description(self) -> Any: ... + def get_option(self, opt_str: _Text) -> Optional[Option]: ... + def has_option(self, opt_str: _Text) -> bool: ... + def remove_option(self, opt_str: _Text) -> None: ... + def set_conflict_handler(self, handler: Any) -> None: ... + def set_description(self, description: Any) -> None: ... + +class OptionGroup(OptionContainer): + option_list: List[Option] + parser: OptionParser + title: _Text + def __init__(self, parser: OptionParser, title: _Text, description: Optional[_Text] = ...) -> None: ... + def _create_option_list(self) -> None: ... + def set_title(self, title: _Text) -> None: ... + +class Values: + def __init__(self, defaults: Optional[Mapping[str, Any]] = ...) -> None: ... + def _update(self, dict: Mapping[_Text, Any], mode: Any) -> None: ... + def _update_careful(self, dict: Mapping[_Text, Any]) -> None: ... + def _update_loose(self, dict: Mapping[_Text, Any]) -> None: ... + def ensure_value(self, attr: _Text, value: Any) -> Any: ... + def read_file(self, filename: _Text, mode: _Text) -> None: ... + def read_module(self, modname: _Text, mode: _Text) -> None: ... + def __getattr__(self, name: str) -> Any: ... + def __setattr__(self, name: str, value: Any) -> None: ... + +class OptionParser(OptionContainer): + allow_interspersed_args: bool + epilog: Optional[_Text] + formatter: HelpFormatter + largs: Optional[List[_Text]] + option_groups: List[OptionParser] + option_list: List[Option] + process_default_values: Any + prog: Optional[_Text] + rargs: Optional[List[Any]] + standard_option_list: List[Option] + usage: Optional[_Text] + values: Optional[Values] + version: _Text + def __init__(self, + usage: Optional[_Text] = ..., + option_list: Iterable[Option] = ..., + option_class: Option = ..., + version: Optional[_Text] = ..., + conflict_handler: _Text = ..., + description: Optional[_Text] = ..., + formatter: Optional[HelpFormatter] = ..., + add_help_option: bool = ..., + prog: Optional[_Text] = ..., + epilog: Optional[_Text] = ...) -> None: ... + def _add_help_option(self) -> None: ... + def _add_version_option(self) -> None: ... + def _create_option_list(self) -> None: ... + def _get_all_options(self) -> List[Option]: ... + def _get_args(self, args: Iterable) -> List[Any]: ... + def _init_parsing_state(self) -> None: ... + def _match_long_opt(self, opt: _Text) -> _Text: ... + def _populate_option_list(self, option_list: Iterable[Option], add_help: bool = ...) -> None: ... + def _process_args(self, largs: List, rargs: List, values: Values) -> None: ... + def _process_long_opt(self, rargs: List, values: Any) -> None: ... + def _process_short_opts(self, rargs: List, values: Any) -> None: ... + def add_option_group(self, *args, **kwargs) -> OptionParser: ... + def check_values(self, values: Values, args: List[_Text]) -> Tuple[Values, List[_Text]]: ... + def disable_interspersed_args(self) -> None: ... + def enable_interspersed_args(self) -> None: ... + def error(self, msg: _Text) -> None: ... + def exit(self, status: int = ..., msg: Optional[str] = ...) -> None: ... + def expand_prog_name(self, s: Optional[_Text]) -> Any: ... + def format_epilog(self, formatter: HelpFormatter) -> Any: ... + def format_help(self, formatter: Optional[HelpFormatter] = ...) -> _Text: ... + def format_option_help(self, formatter: Optional[HelpFormatter] = ...) -> _Text: ... + def get_default_values(self) -> Values: ... + def get_option_group(self, opt_str: _Text) -> Any: ... + def get_prog_name(self) -> _Text: ... + def get_usage(self) -> _Text: ... + def get_version(self) -> _Text: ... + def parse_args(self, args: Optional[Sequence[AnyStr]] = ..., values: Optional[Values] = ...) -> Tuple[Values, List[AnyStr]]: ... + def print_usage(self, file: Optional[IO[str]] = ...) -> None: ... + def print_help(self, file: Optional[IO[str]] = ...) -> None: ... + def print_version(self, file: Optional[IO[str]] = ...) -> None: ... + def set_default(self, dest: Any, value: Any) -> None: ... + def set_defaults(self, **kwargs) -> None: ... + def set_process_default_values(self, process: Any) -> None: ... + def set_usage(self, usage: _Text) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/pdb.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/pdb.pyi new file mode 100644 index 0000000..e403c36 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/pdb.pyi @@ -0,0 +1,62 @@ +# NOTE: This stub is incomplete - only contains some global functions + +from cmd import Cmd +import sys +from types import FrameType +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar + +_T = TypeVar('_T') + +class Restart(Exception): ... + +def run(statement: str, globals: Optional[Dict[str, Any]] = ..., + locals: Optional[Dict[str, Any]] = ...) -> None: ... +def runeval(expression: str, globals: Optional[Dict[str, Any]] = ..., + locals: Optional[Dict[str, Any]] = ...) -> Any: ... +def runctx(statement: str, globals: Dict[str, Any], locals: Dict[str, Any]) -> None: ... +def runcall(*args: Any, **kwds: Any) -> Any: ... + +if sys.version_info >= (3, 7): + def set_trace(*, header: Optional[str] = ...) -> None: ... +else: + def set_trace() -> None: ... + +def post_mortem(t: Optional[Any] = ...) -> None: ... +def pm() -> None: ... + +class Pdb(Cmd): + if sys.version_info >= (3, 6): + def __init__( + self, + completekey: str = ..., + stdin: Optional[IO[str]] = ..., + stdout: Optional[IO[str]] = ..., + skip: Optional[Iterable[str]] = ..., + nosigint: bool = ..., + readrc: bool = ..., + ) -> None: ... + elif sys.version_info >= (3, 2): + def __init__( + self, + completekey: str = ..., + stdin: Optional[IO[str]] = ..., + stdout: Optional[IO[str]] = ..., + skip: Optional[Iterable[str]] = ..., + nosigint: bool = ..., + ) -> None: ... + else: + def __init__( + self, + completekey: str = ..., + stdin: Optional[IO[str]] = ..., + stdout: Optional[IO[str]] = ..., + skip: Optional[Iterable[str]] = ..., + ) -> None: ... + # TODO: The run* and set_trace() methods are actually defined on bdb.Bdb, from which Pdb inherits. + # Move these methods there once we have a bdb stub. + def run(self, statement: str, globals: Optional[Dict[str, Any]] = ..., + locals: Optional[Dict[str, Any]] = ...) -> None: ... + def runeval(self, expression: str, globals: Optional[Dict[str, Any]] = ..., + locals: Optional[Dict[str, Any]] = ...) -> Any: ... + def runcall(self, func: Callable[..., _T], *args: Any, **kwds: Any) -> Optional[_T]: ... + def set_trace(self, frame: Optional[FrameType] = ...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/pickle.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/pickle.pyi new file mode 100644 index 0000000..7bfad8f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/pickle.pyi @@ -0,0 +1,140 @@ +import sys +from typing import Any, IO, Mapping, Union, Tuple, Callable, Optional, Iterator + +HIGHEST_PROTOCOL: int +if sys.version_info >= (3, 0): + DEFAULT_PROTOCOL: int + + +if sys.version_info >= (3, 0): + def dump(obj: Any, file: IO[bytes], protocol: Optional[int] = ..., *, + fix_imports: bool = ...) -> None: ... + def dumps(obj: Any, protocol: Optional[int] = ..., *, + fix_imports: bool = ...) -> bytes: ... + def loads(bytes_object: bytes, *, fix_imports: bool = ..., + encoding: str = ..., errors: str = ...) -> Any: ... + def load(file: IO[bytes], *, fix_imports: bool = ..., encoding: str = ..., + errors: str = ...) -> Any: ... +else: + def dump(obj: Any, file: IO[bytes], protocol: Optional[int] = ...) -> None: ... + def dumps(obj: Any, protocol: Optional[int] = ...) -> bytes: ... + def load(file: IO[bytes]) -> Any: ... + def loads(string: bytes) -> Any: ... + +class PickleError(Exception): ... +class PicklingError(PickleError): ... +class UnpicklingError(PickleError): ... + +_reducedtype = Union[str, + Tuple[Callable[..., Any], Tuple], + Tuple[Callable[..., Any], Tuple, Any], + Tuple[Callable[..., Any], Tuple, Any, + Optional[Iterator]], + Tuple[Callable[..., Any], Tuple, Any, + Optional[Iterator], Optional[Iterator]]] + + +class Pickler: + fast: bool + if sys.version_info >= (3, 3): + dispatch_table: Mapping[type, Callable[[Any], _reducedtype]] + + if sys.version_info >= (3, 0): + def __init__(self, file: IO[bytes], protocol: Optional[int] = ..., *, + fix_imports: bool = ...) -> None: ... + else: + def __init__(self, file: IO[bytes], protocol: Optional[int] = ...) -> None: ... + + def dump(self, obj: Any) -> None: ... + def clear_memo(self) -> None: ... + def persistent_id(self, obj: Any) -> Any: ... + + +class Unpickler: + if sys.version_info >= (3, 0): + def __init__(self, file: IO[bytes], *, fix_imports: bool = ..., + encoding: str = ..., errors: str = ...) -> None: ... + else: + def __init__(self, file: IO[bytes]) -> None: ... + + def load(self) -> Any: ... + def find_class(self, module: str, name: str) -> Any: ... + if sys.version_info >= (3, 0): + def persistent_load(self, pid: Any) -> Any: ... + +MARK: bytes +STOP: bytes +POP: bytes +POP_MARK: bytes +DUP: bytes +FLOAT: bytes +INT: bytes +BININT: bytes +BININT1: bytes +LONG: bytes +BININT2: bytes +NONE: bytes +PERSID: bytes +BINPERSID: bytes +REDUCE: bytes +STRING: bytes +BINSTRING: bytes +SHORT_BINSTRING: bytes +UNICODE: bytes +BINUNICODE: bytes +APPEND: bytes +BUILD: bytes +GLOBAL: bytes +DICT: bytes +EMPTY_DICT: bytes +APPENDS: bytes +GET: bytes +BINGET: bytes +INST: bytes +LONG_BINGET: bytes +LIST: bytes +EMPTY_LIST: bytes +OBJ: bytes +PUT: bytes +BINPUT: bytes +LONG_BINPUT: bytes +SETITEM: bytes +TUPLE: bytes +EMPTY_TUPLE: bytes +SETITEMS: bytes +BINFLOAT: bytes + +TRUE: bytes +FALSE: bytes + +# protocol 2 +PROTO: bytes +NEWOBJ: bytes +EXT1: bytes +EXT2: bytes +EXT4: bytes +TUPLE1: bytes +TUPLE2: bytes +TUPLE3: bytes +NEWTRUE: bytes +NEWFALSE: bytes +LONG1: bytes +LONG4: bytes + +if sys.version_info >= (3, 0): + # protocol 3 + BINBYTES: bytes + SHORT_BINBYTES: bytes + +if sys.version_info >= (3, 4): + # protocol 4 + SHORT_BINUNICODE: bytes + BINUNICODE8: bytes + BINBYTES8: bytes + EMPTY_SET: bytes + ADDITEMS: bytes + FROZENSET: bytes + NEWOBJ_EX: bytes + STACK_GLOBAL: bytes + MEMOIZE: bytes + FRAME: bytes diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/pickletools.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/pickletools.pyi new file mode 100644 index 0000000..c036646 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/pickletools.pyi @@ -0,0 +1,145 @@ +# Stubs for pickletools (Python 2 and 3) +import sys +from typing import Any, Callable, IO, Iterator, List, MutableMapping, Optional, Text, Tuple, Type, Union + +_Reader = Callable[[IO[bytes]], Any] + +if sys.version_info >= (3, 0): + bytes_types: Tuple[Type[Any], ...] + +UP_TO_NEWLINE: int +TAKEN_FROM_ARGUMENT1: int +TAKEN_FROM_ARGUMENT4: int +if sys.version_info >= (3, 3): + TAKEN_FROM_ARGUMENT4U: int +if sys.version_info >= (3, 4): + TAKEN_FROM_ARGUMENT8U: int + +class ArgumentDescriptor(object): + name: str + n: int + reader: _Reader + doc: str + def __init__(self, name: str, n: int, reader: _Reader, doc: str) -> None: ... + +def read_uint1(f: IO[bytes]) -> int: ... +uint1: ArgumentDescriptor + +def read_uint2(f: IO[bytes]) -> int: ... +uint2: ArgumentDescriptor + +def read_int4(f: IO[bytes]) -> int: ... +int4: ArgumentDescriptor + +if sys.version_info >= (3, 3): + def read_uint4(f: IO[bytes]) -> int: ... + uint4: ArgumentDescriptor + +if sys.version_info >= (3, 5): + def read_uint8(f: IO[bytes]) -> int: ... + uint8: ArgumentDescriptor + +def read_stringnl(f: IO[bytes], decode: bool = ..., stripquotes: bool = ...) -> Union[bytes, Text]: ... +stringnl: ArgumentDescriptor + +def read_stringnl_noescape(f: IO[bytes]) -> str: ... +stringnl_noescape: ArgumentDescriptor + +def read_stringnl_noescape_pair(f: IO[bytes]) -> Text: ... +stringnl_noescape_pair: ArgumentDescriptor + +def read_string1(f: IO[bytes]) -> str: ... +string1: ArgumentDescriptor + +def read_string4(f: IO[bytes]) -> str: ... +string4: ArgumentDescriptor + +if sys.version_info >= (3, 3): + def read_bytes1(f: IO[bytes]) -> bytes: ... + bytes1: ArgumentDescriptor + + def read_bytes4(f: IO[bytes]) -> bytes: ... + bytes4: ArgumentDescriptor + +if sys.version_info >= (3, 4): + def read_bytes8(f: IO[bytes]) -> bytes: ... + bytes8: ArgumentDescriptor + +def read_unicodestringnl(f: IO[bytes]) -> Text: ... +unicodestringnl: ArgumentDescriptor + +if sys.version_info >= (3, 4): + def read_unicodestring1(f: IO[bytes]) -> Text: ... + unicodestring1: ArgumentDescriptor + +def read_unicodestring4(f: IO[bytes]) -> Text: ... +unicodestring4: ArgumentDescriptor + +if sys.version_info >= (3, 4): + def read_unicodestring8(f: IO[bytes]) -> Text: ... + unicodestring8: ArgumentDescriptor + +def read_decimalnl_short(f: IO[bytes]) -> int: ... +def read_decimalnl_long(f: IO[bytes]) -> int: ... +decimalnl_short: ArgumentDescriptor +decimalnl_long: ArgumentDescriptor + +def read_floatnl(f: IO[bytes]) -> float: ... +floatnl: ArgumentDescriptor + +def read_float8(f: IO[bytes]) -> float: ... +float8: ArgumentDescriptor + +def read_long1(f: IO[bytes]) -> int: ... +long1: ArgumentDescriptor + +def read_long4(f: IO[bytes]) -> int: ... +long4: ArgumentDescriptor + +class StackObject(object): + name: str + obtype: Union[Type[Any], Tuple[Type[Any], ...]] + doc: str + def __init__(self, name: str, obtype: Union[Type[Any], Tuple[Type[Any], ...]], doc: str) -> None: ... + +pyint: StackObject +pylong: StackObject +pyinteger_or_bool: StackObject +pybool: StackObject +pyfloat: StackObject +if sys.version_info >= (3, 4): + pybytes_or_str: StackObject +pystring: StackObject +if sys.version_info >= (3, 0): + pybytes: StackObject +pyunicode: StackObject +pynone: StackObject +pytuple: StackObject +pylist: StackObject +pydict: StackObject +if sys.version_info >= (3, 4): + pyset: StackObject + pyfrozenset: StackObject +anyobject: StackObject +markobject: StackObject +stackslice: StackObject + +class OpcodeInfo(object): + name: str + code: str + arg: Optional[ArgumentDescriptor] + stack_before: List[StackObject] + stack_after: List[StackObject] + proto: int + doc: str + def __init__(self, name: str, code: str, arg: Optional[ArgumentDescriptor], + stack_before: List[StackObject], stack_after: List[StackObject], proto: int, doc: str) -> None: ... + +opcodes: List[OpcodeInfo] + +def genops(pickle: Union[bytes, IO[bytes]]) -> Iterator[Tuple[OpcodeInfo, Optional[Any], Optional[int]]]: ... +def optimize(p: Union[bytes, IO[bytes]]) -> bytes: ... +if sys.version_info >= (3, 2): + def dis(pickle: Union[bytes, IO[bytes]], out: Optional[IO[str]] = ..., memo: Optional[MutableMapping[int, Any]] = ..., indentlevel: int = ..., annotate: int = ...) -> None: ... +else: + def dis(pickle: Union[bytes, IO[bytes]], out: Optional[IO[str]] = ..., memo: Optional[MutableMapping[int, Any]] = ..., indentlevel: int = ...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/pkgutil.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/pkgutil.pyi new file mode 100644 index 0000000..c7bad42 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/pkgutil.pyi @@ -0,0 +1,35 @@ +# Stubs for pkgutil + +from typing import Any, Callable, Generator, IO, Iterable, Optional, Tuple, NamedTuple +import sys + +if sys.version_info >= (3,): + from importlib.abc import Loader +else: + Loader = Any + +if sys.version_info >= (3, 6): + ModuleInfo = NamedTuple('ModuleInfo', [('module_finder', Any), ('name', str), ('ispkg', bool)]) + _YMFNI = Generator[ModuleInfo, None, None] +else: + _YMFNI = Generator[Tuple[Any, str, bool], None, None] + + +def extend_path(path: Iterable[str], name: str) -> Iterable[str]: ... + +class ImpImporter: + def __init__(self, dirname: Optional[str] = ...) -> None: ... + +class ImpLoader: + def __init__(self, fullname: str, file: IO[str], filename: str, + etc: Tuple[str, str, int]) -> None: ... + +def find_loader(fullname: str) -> Loader: ... +def get_importer(path_item: str) -> Any: ... # TODO precise type +def get_loader(module_or_name: str) -> Loader: ... +def iter_importers(fullname: str = ...) -> Generator[Any, None, None]: ... # TODO precise type +def iter_modules(path: Optional[Iterable[str]] = ..., + prefix: str = ...) -> _YMFNI: ... # TODO precise type +def walk_packages(path: Optional[Iterable[str]] = ..., prefix: str = ..., + onerror: Optional[Callable[[str], None]] = ...) -> _YMFNI: ... +def get_data(package: str, resource: str) -> Optional[bytes]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/plistlib.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/plistlib.pyi new file mode 100644 index 0000000..64201dd --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/plistlib.pyi @@ -0,0 +1,57 @@ +# Stubs for plistlib + +from typing import ( + Any, IO, Mapping, MutableMapping, Optional, Union, + Type, TypeVar, +) +from typing import Dict as DictT +import sys +if sys.version_info >= (3,): + from enum import Enum + + class PlistFormat(Enum): + FMT_XML = ... + FMT_BINARY = ... + FMT_XML = PlistFormat.FMT_XML + FMT_BINARY = PlistFormat.FMT_BINARY + +mm = MutableMapping[str, Any] +_D = TypeVar('_D', bound=mm) +if sys.version_info >= (3,): + _Path = str +else: + _Path = Union[str, unicode] + +if sys.version_info >= (3, 4): + def load(fp: IO[bytes], *, fmt: Optional[PlistFormat] = ..., + use_builtin_types: bool = ..., dict_type: Type[_D] = ...) -> _D: ... + def loads(data: bytes, *, fmt: Optional[PlistFormat] = ..., + use_builtin_types: bool = ..., dict_type: Type[_D] = ...) -> _D: ... + def dump(value: Mapping[str, Any], fp: IO[bytes], *, + fmt: PlistFormat = ..., sort_keys: bool = ..., + skipkeys: bool = ...) -> None: ... + def dumps(value: Mapping[str, Any], *, fmt: PlistFormat = ..., + skipkeys: bool = ..., sort_keys: bool = ...) -> bytes: ... + +def readPlist(pathOrFile: Union[_Path, IO[bytes]]) -> DictT[str, Any]: ... +def writePlist(value: Mapping[str, Any], pathOrFile: Union[_Path, IO[bytes]]) -> None: ... +def readPlistFromBytes(data: bytes) -> DictT[str, Any]: ... +def writePlistToBytes(value: Mapping[str, Any]) -> bytes: ... +if sys.version_info < (3,): + def readPlistFromResource(path: _Path, restype: str = ..., + resid: int = ...) -> DictT[str, Any]: ... + def writePlistToResource(rootObject: Mapping[str, Any], path: _Path, + restype: str = ..., + resid: int = ...) -> None: ... + def readPlistFromString(data: str) -> DictT[str, Any]: ... + def writePlistToString(rootObject: Mapping[str, Any]) -> str: ... + +if sys.version_info < (3, 7): + class Dict(dict): + def __getattr__(self, attr: str) -> Any: ... + def __setattr__(self, attr: str, value: Any) -> None: ... + def __delattr__(self, attr: str) -> None: ... + +class Data: + data: bytes + def __init__(self, data: bytes) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/poplib.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/poplib.pyi new file mode 100644 index 0000000..d2b7dab --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/poplib.pyi @@ -0,0 +1,77 @@ +# Stubs for poplib (Python 2 and 3) + +import socket +import ssl +import sys +from typing import ( + Any, BinaryIO, Dict, List, NoReturn, Optional, overload, Pattern, Text, + Tuple, +) + +_LongResp = Tuple[bytes, List[bytes], int] + +class error_proto(Exception): ... + +POP3_PORT: int +POP3_SSL_PORT: int +CR: bytes +LF: bytes +CRLF: bytes + + +class POP3: + if sys.version_info >= (3, 0): + encoding: Text + + host: Text + port: int + sock: socket.socket + file: BinaryIO + welcome: bytes + + def __init__(self, host: Text, port: int = ..., timeout: float = ...) -> None: ... + def getwelcome(self) -> bytes: ... + def set_debuglevel(self, level: int) -> None: ... + def user(self, user: Text) -> bytes: ... + def pass_(self, pswd: Text) -> bytes: ... + def stat(self) -> Tuple[int, int]: ... + def list(self, which: Optional[Any] = ...) -> _LongResp: ... + def retr(self, which: Any) -> _LongResp: ... + def dele(self, which: Any) -> bytes: ... + def noop(self) -> bytes: ... + def rset(self) -> bytes: ... + def quit(self) -> bytes: ... + def close(self) -> None: ... + def rpop(self, user: Text) -> bytes: ... + + timestamp: Pattern[Text] + + if sys.version_info < (3, 0): + def apop(self, user: Text, secret: Text) -> bytes: ... + else: + def apop(self, user: Text, password: Text) -> bytes: ... + def top(self, which: Any, howmuch: int) -> _LongResp: ... + + @overload + def uidl(self) -> _LongResp: ... + @overload + def uidl(self, which: Any) -> bytes: ... + + if sys.version_info >= (3, 5): + def utf8(self) -> bytes: ... + if sys.version_info >= (3, 4): + def capa(self) -> Dict[Text, List[Text]]: ... + def stls(self, context: Optional[ssl.SSLContext] = ...) -> bytes: ... + + +class POP3_SSL(POP3): + if sys.version_info >= (3, 0): + def __init__(self, host: Text, port: int = ..., keyfile: Optional[Text] = ..., certfile: Optional[Text] = ..., + timeout: float = ..., context: Optional[ssl.SSLContext] = ...) -> None: ... + else: + def __init__(self, host: Text, port: int = ..., keyfile: Optional[Text] = ..., certfile: Optional[Text] = ..., + timeout: float = ...) -> None: ... + + if sys.version_info >= (3, 4): + # "context" is actually the last argument, but that breaks LSP and it doesn't really matter because all the arguments are ignored + def stls(self, context: Any = ..., keyfile: Any = ..., certfile: Any = ...) -> bytes: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/posixpath.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/posixpath.pyi new file mode 100644 index 0000000..c0bf576 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/posixpath.pyi @@ -0,0 +1,180 @@ +# NB: path.pyi and stdlib/2 and stdlib/3 must remain consistent! +# Stubs for os.path +# Ron Murawski + +import os +import sys +from typing import ( + overload, List, Any, AnyStr, Sequence, Tuple, BinaryIO, TextIO, + TypeVar, Union, Text, Callable, Optional +) + +_T = TypeVar('_T') + +if sys.version_info >= (3, 6): + from builtins import _PathLike + _PathType = Union[bytes, Text, _PathLike] + _StrPath = Union[Text, _PathLike[Text]] + _BytesPath = Union[bytes, _PathLike[bytes]] +else: + _PathType = Union[bytes, Text] + _StrPath = Text + _BytesPath = bytes + +# ----- os.path variables ----- +supports_unicode_filenames: bool +# aliases (also in os) +curdir: str +pardir: str +sep: str +if sys.platform == 'win32': + altsep: str +else: + altsep: Optional[str] +extsep: str +pathsep: str +defpath: str +devnull: str + +# ----- os.path function stubs ----- +if sys.version_info >= (3, 6): + # Overloads are necessary to work around python/mypy#3644. + @overload + def abspath(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def abspath(path: AnyStr) -> AnyStr: ... + @overload + def basename(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def basename(path: AnyStr) -> AnyStr: ... + @overload + def dirname(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def dirname(path: AnyStr) -> AnyStr: ... + @overload + def expanduser(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def expanduser(path: AnyStr) -> AnyStr: ... + @overload + def expandvars(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def expandvars(path: AnyStr) -> AnyStr: ... + @overload + def normcase(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def normcase(path: AnyStr) -> AnyStr: ... + @overload + def normpath(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def normpath(path: AnyStr) -> AnyStr: ... + if sys.platform == 'win32': + @overload + def realpath(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def realpath(path: AnyStr) -> AnyStr: ... + else: + @overload + def realpath(filename: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def realpath(filename: AnyStr) -> AnyStr: ... + +else: + def abspath(path: AnyStr) -> AnyStr: ... + def basename(path: AnyStr) -> AnyStr: ... + def dirname(path: AnyStr) -> AnyStr: ... + def expanduser(path: AnyStr) -> AnyStr: ... + def expandvars(path: AnyStr) -> AnyStr: ... + def normcase(path: AnyStr) -> AnyStr: ... + def normpath(path: AnyStr) -> AnyStr: ... + if sys.platform == 'win32': + def realpath(path: AnyStr) -> AnyStr: ... + else: + def realpath(filename: AnyStr) -> AnyStr: ... + +if sys.version_info >= (3, 6): + # In reality it returns str for sequences of _StrPath and bytes for sequences + # of _BytesPath, but mypy does not accept such a signature. + def commonpath(paths: Sequence[_PathType]) -> Any: ... +elif sys.version_info >= (3, 5): + def commonpath(paths: Sequence[AnyStr]) -> AnyStr: ... + +# NOTE: Empty lists results in '' (str) regardless of contained type. +# Also, in Python 2 mixed sequences of Text and bytes results in either Text or bytes +# So, fall back to Any +def commonprefix(list: Sequence[_PathType]) -> Any: ... + +if sys.version_info >= (3, 3): + def exists(path: Union[_PathType, int]) -> bool: ... +else: + def exists(path: _PathType) -> bool: ... +def lexists(path: _PathType) -> bool: ... + +# These return float if os.stat_float_times() == True, +# but int is a subclass of float. +def getatime(path: _PathType) -> float: ... +def getmtime(path: _PathType) -> float: ... +def getctime(path: _PathType) -> float: ... + +def getsize(path: _PathType) -> int: ... +def isabs(path: _PathType) -> bool: ... +def isfile(path: _PathType) -> bool: ... +def isdir(path: _PathType) -> bool: ... +def islink(path: _PathType) -> bool: ... +def ismount(path: _PathType) -> bool: ... + +if sys.version_info < (3, 0): + # Make sure signatures are disjunct, and allow combinations of bytes and unicode. + # (Since Python 2 allows that, too) + # Note that e.g. os.path.join("a", "b", "c", "d", u"e") will still result in + # a type error. + @overload + def join(__p1: bytes, *p: bytes) -> bytes: ... + @overload + def join(__p1: bytes, __p2: bytes, __p3: bytes, __p4: Text, *p: _PathType) -> Text: ... + @overload + def join(__p1: bytes, __p2: bytes, __p3: Text, *p: _PathType) -> Text: ... + @overload + def join(__p1: bytes, __p2: Text, *p: _PathType) -> Text: ... + @overload + def join(__p1: Text, *p: _PathType) -> Text: ... +elif sys.version_info >= (3, 6): + # Mypy complains that the signatures overlap (same for relpath below), but things seem to behave correctly anyway. + @overload + def join(path: _StrPath, *paths: _StrPath) -> Text: ... + @overload + def join(path: _BytesPath, *paths: _BytesPath) -> bytes: ... +else: + def join(path: AnyStr, *paths: AnyStr) -> AnyStr: ... + +@overload +def relpath(path: _BytesPath, start: Optional[_BytesPath] = ...) -> bytes: ... +@overload +def relpath(path: _StrPath, start: Optional[_StrPath] = ...) -> Text: ... + +def samefile(path1: _PathType, path2: _PathType) -> bool: ... +def sameopenfile(fp1: int, fp2: int) -> bool: ... +def samestat(stat1: os.stat_result, stat2: os.stat_result) -> bool: ... + +if sys.version_info >= (3, 6): + @overload + def split(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... + @overload + def split(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitdrive(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitdrive(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitext(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitext(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... +else: + def split(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + def splitdrive(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + def splitext(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + +if sys.platform == 'win32': + def splitunc(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... # deprecated + +if sys.version_info < (3,): + def walk(path: AnyStr, visit: Callable[[_T, AnyStr, List[AnyStr]], Any], arg: _T) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/pprint.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/pprint.pyi new file mode 100644 index 0000000..90a87ab --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/pprint.pyi @@ -0,0 +1,40 @@ +# Stubs for pprint + +# Based on http://docs.python.org/2/library/pprint.html +# Based on http://docs.python.org/3/library/pprint.html + +import sys +from typing import Any, Dict, Tuple, IO + +if sys.version_info >= (3, 4): + def pformat(o: object, indent: int = ..., width: int = ..., + depth: int = ..., compact: bool = ...) -> str: ... +else: + def pformat(o: object, indent: int = ..., width: int = ..., + depth: int = ...) -> str: ... + +if sys.version_info >= (3, 4): + def pprint(o: object, stream: IO[str] = ..., indent: int = ..., width: int = ..., + depth: int = ..., compact: bool = ...) -> None: ... +else: + def pprint(o: object, stream: IO[str] = ..., indent: int = ..., width: int = ..., + depth: int = ...) -> None: ... + +def isreadable(o: object) -> bool: ... +def isrecursive(o: object) -> bool: ... +def saferepr(o: object) -> str: ... + +class PrettyPrinter: + if sys.version_info >= (3, 4): + def __init__(self, indent: int = ..., width: int = ..., depth: int = ..., + stream: IO[str] = ..., compact: bool = ...) -> None: ... + else: + def __init__(self, indent: int = ..., width: int = ..., depth: int = ..., + stream: IO[str] = ...) -> None: ... + + def pformat(self, o: object) -> str: ... + def pprint(self, o: object) -> None: ... + def isreadable(self, o: object) -> bool: ... + def isrecursive(self, o: object) -> bool: ... + def format(self, o: object, context: Dict[int, Any], maxlevels: int, + level: int) -> Tuple[str, bool, bool]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/profile.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/profile.pyi new file mode 100644 index 0000000..31236bb --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/profile.pyi @@ -0,0 +1,27 @@ +import os +import sys +from typing import Any, Callable, Dict, Optional, Text, TypeVar, Union + +def run(statement: str, filename: Optional[str] = ..., sort: Union[str, int] = ...) -> None: ... +def runctx(statement: str, globals: Dict[str, Any], locals: Dict[str, Any], filename: Optional[str] = ..., sort: Union[str, int] = ...) -> None: ... + +_SelfT = TypeVar('_SelfT', bound='Profile') +_T = TypeVar('_T') +if sys.version_info >= (3, 6): + _Path = Union[bytes, Text, os.PathLike[Any]] +else: + _Path = Union[bytes, Text] + +class Profile: + def __init__(self, timer: Optional[Callable[[], float]] = ..., bias: Optional[int] = ...) -> None: ... + def set_cmd(self, cmd: str) -> None: ... + def simulate_call(self, name: str) -> None: ... + def simulate_cmd_complete(self) -> None: ... + def print_stats(self, sort: Union[str, int] = ...) -> None: ... + def dump_stats(self, file: _Path) -> None: ... + def create_stats(self) -> None: ... + def snapshot_stats(self) -> None: ... + def run(self: _SelfT, cmd: str) -> _SelfT: ... + def runctx(self: _SelfT, cmd: str, globals: Dict[str, Any], locals: Dict[str, Any]) -> _SelfT: ... + def runcall(self, func: Callable[..., _T], *args: Any, **kw: Any) -> _T: ... + def calibrate(self, m: int, verbose: int = ...) -> float: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/pstats.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/pstats.pyi new file mode 100644 index 0000000..8bf1b0d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/pstats.pyi @@ -0,0 +1,39 @@ +from profile import Profile +from cProfile import Profile as _cProfile +import os +import sys +from typing import Any, Dict, IO, Iterable, List, Text, Tuple, TypeVar, Union, overload + +_Selector = Union[str, float, int] +_T = TypeVar('_T', bound='Stats') +if sys.version_info >= (3, 6): + _Path = Union[bytes, Text, os.PathLike[Any]] +else: + _Path = Union[bytes, Text] + +class Stats: + def __init__(self: _T, __arg: Union[None, str, Text, Profile, _cProfile] = ..., + *args: Union[None, str, Text, Profile, _cProfile, _T], + stream: IO[Any] = ...) -> None: ... + def init(self, arg: Union[None, str, Text, Profile, _cProfile]) -> None: ... + def load_stats(self, arg: Union[None, str, Text, Profile, _cProfile]) -> None: ... + def get_top_level_stats(self) -> None: ... + def add(self: _T, *arg_list: Union[None, str, Text, Profile, _cProfile, _T]) -> _T: ... + def dump_stats(self, filename: _Path) -> None: ... + def get_sort_arg_defs(self) -> Dict[str, Tuple[Tuple[Tuple[int, int], ...], str]]: ... + @overload + def sort_stats(self: _T, field: int) -> _T: ... + @overload + def sort_stats(self: _T, *field: str) -> _T: ... + def reverse_order(self: _T) -> _T: ... + def strip_dirs(self: _T) -> _T: ... + def calc_callees(self) -> None: ... + def eval_print_amount(self, sel: _Selector, list: List[str], msg: str) -> Tuple[List[str], str]: ... + def get_print_list(self, sel_list: Iterable[_Selector]) -> Tuple[int, List[str]]: ... + def print_stats(self: _T, *amount: _Selector) -> _T: ... + def print_callees(self: _T, *amount: _Selector) -> _T: ... + def print_callers(self: _T, *amount: _Selector) -> _T: ... + def print_call_heading(self, name_size: int, column_title: str) -> None: ... + def print_call_line(self, name_size: int, source: str, call_dict: Dict[str, Any], arrow: str = ...) -> None: ... + def print_title(self) -> None: ... + def print_line(self, func: str) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/pty.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/pty.pyi new file mode 100644 index 0000000..3931bb0 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/pty.pyi @@ -0,0 +1,20 @@ +# Stubs for pty (Python 2 and 3) +import sys +from typing import Callable, Iterable, Tuple, Union + +_Reader = Callable[[int], bytes] + +STDIN_FILENO: int +STDOUT_FILENO: int +STDERR_FILENO: int + +CHILD: int + +def openpty() -> Tuple[int, int]: ... +def master_open() -> Tuple[int, str]: ... +def slave_open(tty_name: str) -> int: ... +def fork() -> Tuple[int, int]: ... +if sys.version_info >= (3, 4): + def spawn(argv: Union[str, Iterable[str]], master_read: _Reader = ..., stdin_read: _Reader = ...) -> int: ... +else: + def spawn(argv: Union[str, Iterable[str]], master_read: _Reader = ..., stdin_read: _Reader = ...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/pwd.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/pwd.pyi new file mode 100644 index 0000000..5bd0bbb --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/pwd.pyi @@ -0,0 +1,13 @@ +from typing import List, NamedTuple + +struct_passwd = NamedTuple("struct_passwd", [("pw_name", str), + ("pw_passwd", str), + ("pw_uid", int), + ("pw_gid", int), + ("pw_gecos", str), + ("pw_dir", str), + ("pw_shell", str)]) + +def getpwall() -> List[struct_passwd]: ... +def getpwuid(uid: int) -> struct_passwd: ... +def getpwnam(name: str) -> struct_passwd: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/py_compile.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/py_compile.pyi new file mode 100644 index 0000000..a8be113 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/py_compile.pyi @@ -0,0 +1,20 @@ +# Stubs for py_compile (Python 2 and 3) +import sys + +from typing import Optional, List, Text, AnyStr, Union + +_EitherStr = Union[bytes, Text] + +class PyCompileError(Exception): + exc_type_name: str + exc_value: BaseException + file: str + msg: str + def __init__(self, exc_type: str, exc_value: BaseException, file: str, msg: str = ...) -> None: ... + +if sys.version_info >= (3, 2): + def compile(file: AnyStr, cfile: Optional[AnyStr] = ..., dfile: Optional[AnyStr] = ..., doraise: bool = ..., optimize: int = ...) -> Optional[AnyStr]: ... +else: + def compile(file: _EitherStr, cfile: Optional[_EitherStr] = ..., dfile: Optional[_EitherStr] = ..., doraise: bool = ...) -> None: ... + +def main(args: Optional[List[Text]] = ...) -> int: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/pyclbr.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/pyclbr.pyi new file mode 100644 index 0000000..efecf32 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/pyclbr.pyi @@ -0,0 +1,40 @@ +from typing import List, Union, Sequence, Optional, Dict + + +class Class: + module: str + name: str + super: Optional[List[Union[Class, str]]] + methods: Dict[str, int] + file: int + lineno: int + + def __init__(self, + module: str, + name: str, + super: Optional[List[Union[Class, str]]], + file: str, + lineno: int) -> None: ... + + +class Function: + module: str + name: str + file: int + lineno: int + + def __init__(self, + module: str, + name: str, + file: str, + lineno: int) -> None: ... + + +def readmodule(module: str, + path: Optional[Sequence[str]] = ... + ) -> Dict[str, Class]: ... + + +def readmodule_ex(module: str, + path: Optional[Sequence[str]] = ... + ) -> Dict[str, Union[Class, Function, List[str]]]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/pydoc.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/pydoc.pyi new file mode 100644 index 0000000..1150741 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/pydoc.pyi @@ -0,0 +1,180 @@ +import sys +from typing import Any, AnyStr, Callable, Container, Dict, IO, List, Mapping, MutableMapping, NoReturn, Optional, Text, Tuple, Type, Union +from types import FunctionType, MethodType, ModuleType, TracebackType +if sys.version_info >= (3,): + from reprlib import Repr +else: + from repr import Repr + +# the return type of sys.exc_info(), used by ErrorDuringImport.__init__ +_Exc_Info = Tuple[Optional[Type[BaseException]], Optional[BaseException], Optional[TracebackType]] + +__author__: str +__date__: str +__version__: str +__credits__: str + +def pathdirs() -> List[str]: ... +def getdoc(object: object) -> Text: ... +def splitdoc(doc: AnyStr) -> Tuple[AnyStr, AnyStr]: ... +def classname(object: object, modname: str) -> str: ... +def isdata(object: object) -> bool: ... +def replace(text: AnyStr, *pairs: AnyStr) -> AnyStr: ... +def cram(text: str, maxlen: int) -> str: ... +def stripid(text: str) -> str: ... +def allmethods(cl: type) -> MutableMapping[str, MethodType]: ... +def visiblename(name: str, all: Optional[Container[str]] = ..., obj: Optional[object] = ...) -> bool: ... +def classify_class_attrs(object: object) -> List[Tuple[str, str, type, str]]: ... + +def ispackage(path: str) -> bool: ... +def source_synopsis(file: IO[AnyStr]) -> Optional[AnyStr]: ... +def synopsis(filename: str, cache: MutableMapping[str, Tuple[int, str]] = ...) -> Optional[str]: ... + +class ErrorDuringImport(Exception): + filename: str + exc: Optional[Type[BaseException]] + value: Optional[BaseException] + tb: Optional[TracebackType] + def __init__(self, filename: str, exc_info: _Exc_Info) -> None: ... + +def importfile(path: str) -> ModuleType: ... +def safeimport(path: str, forceload: bool = ..., cache: MutableMapping[str, ModuleType] = ...) -> ModuleType: ... + +class Doc: + def document(self, object: object, name: Optional[str] = ..., *args: Any) -> str: ... + def fail(self, object: object, name: Optional[str] = ..., *args: Any) -> NoReturn: ... + def docmodule(self, object: object, name: Optional[str] = ..., *args: Any) -> str: ... + def docclass(self, object: object, name: Optional[str] = ..., *args: Any) -> str: ... + def docroutine(self, object: object, name: Optional[str] = ..., *args: Any) -> str: ... + def docother(self, object: object, name: Optional[str] = ..., *args: Any) -> str: ... + def docproperty(self, object: object, name: Optional[str] = ..., *args: Any) -> str: ... + def docdata(self, object: object, name: Optional[str] = ..., *args: Any) -> str: ... + def getdocloc(self, object: object) -> Optional[str]: ... + +class HTMLRepr(Repr): + maxlist: int + maxtuple: int + maxdict: int + maxstring: int + maxother: int + def __init__(self) -> None: ... + def escape(self, text: str) -> str: ... + def repr(self, object: object) -> str: ... + def repr1(self, x: object, level: complex) -> str: ... + def repr_string(self, x: Text, level: complex) -> str: ... + def repr_str(self, x: Text, level: complex) -> str: ... + def repr_instance(self, x: object, level: complex) -> str: ... + def repr_unicode(self, x: AnyStr, level: complex) -> str: ... + +class HTMLDoc(Doc): + def repr(self, object: object) -> str: ... + def escape(self, test: str) -> str: ... + def page(self, title: str, contents: str) -> str: ... + def heading(self, title: str, fgcol: str, bgcol: str, extras: str = ...) -> str: ... + def section(self, title: str, fgcol: str, bgcol: str, contents: str, width: int = ..., prelude: str = ..., marginalia: Optional[str] = ..., gap: str = ...) -> str: ... + def bigsection(self, title: str, *args) -> str: ... + def preformat(self, text: str) -> str: ... + def multicolumn(self, list: List[Any], format: Callable[[Any], str], cols: int = ...) -> str: ... + def grey(self, text: str) -> str: ... + def namelink(self, name: str, *dicts: MutableMapping[str, str]) -> str: ... + def classlink(self, object: object, modname: str) -> str: ... + def modulelink(self, object: object) -> str: ... + def modpkglink(self, data: Tuple[str, str, bool, bool]) -> str: ... + def markup(self, text: str, escape: Optional[Callable[[str], str]] = ..., funcs: Mapping[str, str] = ..., classes: Mapping[str, str] = ..., methods: Mapping[str, str] = ...) -> str: ... + def formattree(self, tree: List[Union[Tuple[type, Tuple[type, ...]], list]], modname: str, parent: Optional[type] = ...) -> str: ... + def docmodule(self, object: object, name: Optional[str] = ..., mod: Optional[str] = ..., *ignored) -> str: ... + def docclass(self, object: object, name: Optional[str] = ..., mod: Optional[str] = ..., funcs: Mapping[str, str] = ..., classes: Mapping[str, str] = ..., *ignored) -> str: ... + def formatvalue(self, object: object) -> str: ... + def docroutine(self, object: object, name: Optional[str] = ..., mod: Optional[str] = ..., funcs: Mapping[str, str] = ..., classes: Mapping[str, str] = ..., methods: Mapping[str, str] = ..., cl: Optional[type] = ..., *ignored) -> str: ... + def docproperty(self, object: object, name: Optional[str] = ..., mod: Optional[str] = ..., cl: Optional[Any] = ..., *ignored) -> str: ... + def docother(self, object: object, name: Optional[str] = ..., mod: Optional[Any] = ..., *ignored) -> str: ... + def docdata(self, object: object, name: Optional[str] = ..., mod: Optional[Any] = ..., cl: Optional[Any] = ..., *ignored) -> str: ... + def index(self, dir: str, shadowed: Optional[MutableMapping[str, bool]] = ...) -> str: ... + +class TextRepr(Repr): + maxlist: int + maxtuple: int + maxdict: int + maxstring: int + maxother: int + def __init__(self) -> None: ... + def repr1(self, x: object, level: complex) -> str: ... + def repr_string(self, x: str, level: complex) -> str: ... + def repr_str(self, x: str, level: complex) -> str: ... + def repr_instance(self, x: object, level: complex) -> str: ... + +class TextDoc(Doc): + def repr(self, object: object) -> str: ... + def bold(self, text: str) -> str: ... + def indent(self, text: str, prefix: str = ...) -> str: ... + def section(self, title: str, contents: str) -> str: ... + def formattree(self, tree: List[Union[Tuple[type, Tuple[type, ...]], list]], modname: str, parent: Optional[type] = ..., prefix: str = ...) -> str: ... + def docmodule(self, object: object, name: Optional[str] = ..., mod: Optional[Any] = ..., *ignored) -> str: ... + def docclass(self, object: object, name: Optional[str] = ..., mod: Optional[str] = ..., *ignored) -> str: ... + def formatvalue(self, object: object) -> str: ... + def docroutine(self, object: object, name: Optional[str] = ..., mod: Optional[str] = ..., cl: Optional[Any] = ..., *ignored) -> str: ... + def docproperty(self, object: object, name: Optional[str] = ..., mod: Optional[Any] = ..., cl: Optional[Any] = ..., *ignored) -> str: ... + def docdata(self, object: object, name: Optional[str] = ..., mod: Optional[str] = ..., cl: Optional[Any] = ..., *ignored) -> str: ... + def docother(self, object: object, name: Optional[str] = ..., mod: Optional[str] = ..., parent: Optional[str] = ..., maxlen: Optional[int] = ..., doc: Optional[Any] = ..., *ignored) -> str: ... + +def pager(text: str) -> None: ... +def getpager() -> Callable[[str], None]: ... +def plain(text: str) -> str: ... +def pipepager(text: str, cmd: str) -> None: ... +def tempfilepager(text: str, cmd: str) -> None: ... +def ttypager(text: str) -> None: ... +def plainpager(text: str) -> None: ... +def describe(thing: Any) -> str: ... +def locate(path: str, forceload: bool = ...) -> object: ... + +text: TextDoc +html: HTMLDoc + +class _OldStyleClass: ... + +def resolve(thing: Union[str, object], forceload: bool = ...) -> Optional[Tuple[object, str]]: ... +def render_doc(thing: Union[str, object], title: str = ..., forceload: bool = ...) -> str: ... +def doc(thing: Union[str, object], title: str = ..., forceload: bool = ...) -> None: ... +def writedoc(thing: Union[str, object], forceload: bool = ...) -> None: ... +def writedocs(dir: str, pkgpath: str = ..., done: Optional[Any] = ...) -> None: ... + +class Helper: + keywords: Dict[str, Union[str, Tuple[str, str]]] + symbols: Dict[str, str] + topics: Dict[str, Union[str, Tuple[str, ...]]] + def __init__(self, input: Optional[IO[str]] = ..., output: Optional[IO[str]] = ...) -> None: ... + input: IO[str] + output: IO[str] + def __call__(self, request: Union[str, Helper, object] = ...) -> None: ... + def interact(self) -> None: ... + def getline(self, prompt: str) -> str: ... + def help(self, request: Any) -> None: ... + def intro(self) -> None: ... + def list(self, items: List[str], columns: int = ..., width: int = ...) -> None: ... + def listkeywords(self) -> None: ... + def listsymbols(self) -> None: ... + def listtopics(self) -> None: ... + def showtopic(self, topic: str, more_xrefs: str = ...) -> None: ... + def showsymbol(self, symbol: str) -> None: ... + def listmodules(self, key: str = ...) -> None: ... + +help: Helper + +# See Python issue #11182: "remove the unused and undocumented pydoc.Scanner class" +# class Scanner: +# roots = ... # type: Any +# state = ... # type: Any +# children = ... # type: Any +# descendp = ... # type: Any +# def __init__(self, roots, children, descendp) -> None: ... +# def next(self): ... + +class ModuleScanner: + quit: bool + def run(self, callback: Callable[[Optional[str], str, str], None], key: Optional[Any] = ..., completer: Optional[Callable[[], None]] = ..., onerror: Optional[Callable] = ...) -> None: ... + +def apropos(key: str) -> None: ... +def serve(port: int, callback: Optional[Callable[[Any], None]] = ..., completer: Optional[Callable[[], None]] = ...) -> None: ... +def gui() -> None: ... +def ispath(x: Any) -> bool: ... +def cli() -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/pyexpat/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/pyexpat/__init__.pyi new file mode 100644 index 0000000..670e561 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/pyexpat/__init__.pyi @@ -0,0 +1,75 @@ +from typing import List, Tuple, Optional, Callable, Any, Protocol, Union, Dict, Text + +import pyexpat.errors as errors +import pyexpat.model as model + +EXPAT_VERSION: str # undocumented +version_info: Tuple[int, int, int] # undocumented +native_encoding: str # undocumented +features: List[Tuple[str, int]] # undocumented + +class ExpatError(Exception): + code: int + lineno: int + offset: int + +error = ExpatError + +class _Reader(Protocol): + def read(self, length: int) -> bytes: ... + +XML_PARAM_ENTITY_PARSING_NEVER: int +XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE: int +XML_PARAM_ENTITY_PARSING_ALWAYS: int + +_Model = Tuple[int, int, Optional[str], tuple] + +class XMLParserType(object): + def Parse(self, data: Union[Text, bytes], isfinal: bool = ...) -> int: ... + def ParseFile(self, file: _Reader) -> int: ... + def SetBase(self, base: Text) -> None: ... + def GetBase(self) -> Optional[str]: ... + def GetInputContext(self) -> Optional[bytes]: ... + def ExternalEntityParserCreate(self, context: Optional[Text], encoding: Text = ...) -> XMLParserType: ... + def SetParamEntityParsing(self, flag: int) -> int: ... + def UseForeignDTD(self, flag: bool = ...) -> None: ... + buffer_size: int + buffer_text: bool + buffer_used: int + namespace_prefixes: bool # undocumented + ordered_attributes: bool + specified_attributes: bool + ErrorByteIndex: int + ErrorCode: int + ErrorColumnNumber: int + ErrorLineNumber: int + CurrentByteIndex: int + CurrentColumnNumber: int + CurrentLineNumber: int + XmlDeclHandler: Optional[Callable[[str, Optional[str], int], Any]] + StartDoctypeDeclHandler: Optional[Callable[[str, Optional[str], Optional[str], bool], Any]] + EndDoctypeDeclHandler: Optional[Callable[[], Any]] + ElementDeclHandler: Optional[Callable[[str, _Model], Any]] + AttlistDeclHandler: Optional[Callable[[str, str, str, Optional[str], bool], Any]] + StartElementHandler: Optional[Union[ + Callable[[str, Dict[str, str]], Any], + Callable[[str, List[str]], Any], + Callable[[str, Union[Dict[str, str]], List[str]], Any]]] + EndElementHandler: Optional[Callable[[str], Any]] + ProcessingInstructionHandler: Optional[Callable[[str, str], Any]] + CharacterDataHandler: Optional[Callable[[str], Any]] + UnparsedEntityDeclHandler: Optional[Callable[[str, Optional[str], str, Optional[str], str], Any]] + EntityDeclHandler: Optional[Callable[[str, bool, Optional[str], Optional[str], str, Optional[str], Optional[str]], Any]] + NotationDeclHandler: Optional[Callable[[str, Optional[str], str, Optional[str]], Any]] + StartNamespaceDeclHandler: Optional[Callable[[str, str], Any]] + EndNamespaceDeclHandler: Optional[Callable[[str], Any]] + CommentHandler: Optional[Callable[[str], Any]] + StartCdataSectionHandler: Optional[Callable[[], Any]] + EndCdataSectionHandler: Optional[Callable[[], Any]] + DefaultHandler: Optional[Callable[[str], Any]] + DefaultHandlerExpand: Optional[Callable[[str], Any]] + NotStandaloneHandler: Optional[Callable[[], int]] + ExternalEntityRefHandler: Optional[Callable[[str, Optional[str], Optional[str], Optional[str]], int]] + +def ErrorString(errno: int) -> str: ... +def ParserCreate(encoding: Optional[Text] = ..., namespace_separator: Optional[Text] = ...) -> XMLParserType: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/pyexpat/errors.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/pyexpat/errors.pyi new file mode 100644 index 0000000..6cde43e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/pyexpat/errors.pyi @@ -0,0 +1,44 @@ +import sys +from typing import Dict + +if sys.version_info >= (3, 2): + codes: Dict[str, int] + messages: Dict[int, str] + +XML_ERROR_ABORTED: str +XML_ERROR_ASYNC_ENTITY: str +XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF: str +XML_ERROR_BAD_CHAR_REF: str +XML_ERROR_BINARY_ENTITY_REF: str +XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING: str +XML_ERROR_DUPLICATE_ATTRIBUTE: str +XML_ERROR_ENTITY_DECLARED_IN_PE: str +XML_ERROR_EXTERNAL_ENTITY_HANDLING: str +XML_ERROR_FEATURE_REQUIRES_XML_DTD: str +XML_ERROR_FINISHED: str +XML_ERROR_INCOMPLETE_PE: str +XML_ERROR_INCORRECT_ENCODING: str +XML_ERROR_INVALID_TOKEN: str +XML_ERROR_JUNK_AFTER_DOC_ELEMENT: str +XML_ERROR_MISPLACED_XML_PI: str +XML_ERROR_NOT_STANDALONE: str +XML_ERROR_NOT_SUSPENDED: str +XML_ERROR_NO_ELEMENTS: str +XML_ERROR_NO_MEMORY: str +XML_ERROR_PARAM_ENTITY_REF: str +XML_ERROR_PARTIAL_CHAR: str +XML_ERROR_PUBLICID: str +XML_ERROR_RECURSIVE_ENTITY_REF: str +XML_ERROR_SUSPENDED: str +XML_ERROR_SUSPEND_PE: str +XML_ERROR_SYNTAX: str +XML_ERROR_TAG_MISMATCH: str +XML_ERROR_TEXT_DECL: str +XML_ERROR_UNBOUND_PREFIX: str +XML_ERROR_UNCLOSED_CDATA_SECTION: str +XML_ERROR_UNCLOSED_TOKEN: str +XML_ERROR_UNDECLARING_PREFIX: str +XML_ERROR_UNDEFINED_ENTITY: str +XML_ERROR_UNEXPECTED_STATE: str +XML_ERROR_UNKNOWN_ENCODING: str +XML_ERROR_XML_DECL: str diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/pyexpat/model.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/pyexpat/model.pyi new file mode 100644 index 0000000..f357cf6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/pyexpat/model.pyi @@ -0,0 +1,11 @@ +XML_CTYPE_ANY: int +XML_CTYPE_CHOICE: int +XML_CTYPE_EMPTY: int +XML_CTYPE_MIXED: int +XML_CTYPE_NAME: int +XML_CTYPE_SEQ: int + +XML_CQUANT_NONE: int +XML_CQUANT_OPT: int +XML_CQUANT_PLUS: int +XML_CQUANT_REP: int diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/quopri.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/quopri.pyi new file mode 100644 index 0000000..2823f8c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/quopri.pyi @@ -0,0 +1,8 @@ +# Stubs for quopri (Python 2 and 3) + +from typing import BinaryIO + +def encode(input: BinaryIO, output: BinaryIO, quotetabs: int, header: int = ...) -> None: ... +def encodestring(s: bytes, quotetabs: int = ..., header: int = ...) -> bytes: ... +def decode(input: BinaryIO, output: BinaryIO, header: int = ...) -> None: ... +def decodestring(s: bytes, header: int = ...) -> bytes: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/readline.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/readline.pyi new file mode 100644 index 0000000..aff2deb --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/readline.pyi @@ -0,0 +1,41 @@ +# Stubs for readline + +from typing import Callable, Optional, Sequence +import sys + +_CompleterT = Optional[Callable[[str, int], Optional[str]]] +_CompDispT = Optional[Callable[[str, Sequence[str], int], None]] + + +def parse_and_bind(string: str) -> None: ... +def read_init_file(filename: str = ...) -> None: ... + +def get_line_buffer() -> str: ... +def insert_text(string: str) -> None: ... +def redisplay() -> None: ... + +def read_history_file(filename: str = ...) -> None: ... +def write_history_file(filename: str = ...) -> None: ... +if sys.version_info >= (3, 5): + def append_history_file(nelements: int, filename: str = ...) -> None: ... +def get_history_length() -> int: ... +def set_history_length(length: int) -> None: ... + +def clear_history() -> None: ... +def get_current_history_length() -> int: ... +def get_history_item(index: int) -> str: ... +def remove_history_item(pos: int) -> None: ... +def replace_history_item(pos: int, line: str) -> None: ... +def add_history(string: str) -> None: ... + +def set_startup_hook(function: Optional[Callable[[], None]] = ...) -> None: ... +def set_pre_input_hook(function: Optional[Callable[[], None]] = ...) -> None: ... + +def set_completer(function: _CompleterT = ...) -> None: ... +def get_completer() -> _CompleterT: ... +def get_completion_type() -> int: ... +def get_begidx() -> int: ... +def get_endidx() -> int: ... +def set_completer_delims(string: str) -> None: ... +def get_completer_delims() -> str: ... +def set_completion_display_matches_hook(function: _CompDispT = ...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/rlcompleter.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/rlcompleter.pyi new file mode 100644 index 0000000..3db9d0c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/rlcompleter.pyi @@ -0,0 +1,14 @@ +# Stubs for rlcompleter + +from typing import Any, Dict, Optional, Union +import sys + +if sys.version_info >= (3,): + _Text = str +else: + _Text = Union[str, unicode] + + +class Completer: + def __init__(self, namespace: Optional[Dict[str, Any]] = ...) -> None: ... + def complete(self, text: _Text, state: int) -> Optional[str]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/sched.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/sched.pyi new file mode 100644 index 0000000..5d5cf33 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/sched.pyi @@ -0,0 +1,27 @@ +import sys +from typing import Any, Callable, Dict, List, NamedTuple, Optional, Text, Tuple + +Event = NamedTuple('Event', [ + ('time', float), + ('priority', Any), + ('action', Callable[..., Any]), + ('argument', Tuple[Any, ...]), + ('kwargs', Dict[Text, Any]), +]) + +class scheduler: + if sys.version_info >= (3, 3): + def __init__(self, timefunc: Callable[[], float] = ..., delayfunc: Callable[[float], None] = ...) -> None: ... + def enterabs(self, time: float, priority: Any, action: Callable[..., Any], argument: Tuple[Any, ...] = ..., kwargs: Dict[str, Any] = ...) -> Event: ... + def enter(self, delay: float, priority: Any, action: Callable[..., Any], argument: Tuple[Any, ...] = ..., kwargs: Dict[str, Any] = ...) -> Event: ... + def run(self, blocking: bool = ...) -> Optional[float]: ... + else: + def __init__(self, timefunc: Callable[[], float], delayfunc: Callable[[float], None]) -> None: ... + def enterabs(self, time: float, priority: Any, action: Callable[..., Any], argument: Tuple[Any, ...]) -> Event: ... + def enter(self, delay: float, priority: Any, action: Callable[..., Any], argument: Tuple[Any, ...]) -> Event: ... + def run(self) -> None: ... + + def cancel(self, event: Event) -> None: ... + def empty(self) -> bool: ... + @property + def queue(self) -> List[Event]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/select.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/select.pyi new file mode 100644 index 0000000..ab9ffc6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/select.pyi @@ -0,0 +1,137 @@ +import sys +from typing import Any, Optional, Sequence, Tuple, Iterable, List, Union + +# When we have protocols, this should change to a protocol with a fileno method +# See https://docs.python.org/3/c-api/file.html#c.PyObject_AsFileDescriptor +_FileDescriptor = Union[int, Any] + +EPOLLERR: int +EPOLLET: int +EPOLLHUP: int +EPOLLIN: int +EPOLLMSG: int +EPOLLONESHOT: int +EPOLLOUT: int +EPOLLPRI: int +EPOLLRDBAND: int +EPOLLRDNORM: int +EPOLLWRBAND: int +EPOLLWRNORM: int +EPOLL_RDHUP: int +KQ_EV_ADD: int +KQ_EV_CLEAR: int +KQ_EV_DELETE: int +KQ_EV_DISABLE: int +KQ_EV_ENABLE: int +KQ_EV_EOF: int +KQ_EV_ERROR: int +KQ_EV_FLAG1: int +KQ_EV_ONESHOT: int +KQ_EV_SYSFLAGS: int +KQ_FILTER_AIO: int +KQ_FILTER_NETDEV: int +KQ_FILTER_PROC: int +KQ_FILTER_READ: int +KQ_FILTER_SIGNAL: int +KQ_FILTER_TIMER: int +KQ_FILTER_VNODE: int +KQ_FILTER_WRITE: int +KQ_NOTE_ATTRIB: int +KQ_NOTE_CHILD: int +KQ_NOTE_DELETE: int +KQ_NOTE_EXEC: int +KQ_NOTE_EXIT: int +KQ_NOTE_EXTEND: int +KQ_NOTE_FORK: int +KQ_NOTE_LINK: int +KQ_NOTE_LINKDOWN: int +KQ_NOTE_LINKINV: int +KQ_NOTE_LINKUP: int +KQ_NOTE_LOWAT: int +KQ_NOTE_PCTRLMASK: int +KQ_NOTE_PDATAMASK: int +KQ_NOTE_RENAME: int +KQ_NOTE_REVOKE: int +KQ_NOTE_TRACK: int +KQ_NOTE_TRACKERR: int +KQ_NOTE_WRITE: int +PIPE_BUF: int +POLLERR: int +POLLHUP: int +POLLIN: int +POLLMSG: int +POLLNVAL: int +POLLOUT: int +POLLPRI: int +POLLRDBAND: int +POLLRDNORM: int +POLLWRBAND: int +POLLWRNORM: int + +class poll: + def __init__(self) -> None: ... + def register(self, fd: _FileDescriptor, eventmask: int = ...) -> None: ... + def modify(self, fd: _FileDescriptor, eventmask: int) -> None: ... + def unregister(self, fd: _FileDescriptor) -> None: ... + def poll(self, timeout: Optional[float] = ...) -> List[Tuple[int, int]]: ... + +def select(rlist: Sequence[Any], wlist: Sequence[Any], xlist: Sequence[Any], + timeout: Optional[float] = ...) -> Tuple[List[Any], + List[Any], + List[Any]]: ... + +if sys.version_info >= (3, 3): + error = OSError +else: + class error(Exception): ... + +# BSD only +class kevent(object): + data: Any + fflags: int + filter: int + flags: int + ident: int + udata: Any + def __init__(self, ident: _FileDescriptor, filter: int = ..., flags: int = ..., fflags: int = ..., data: Any = ..., udata: Any = ...) -> None: ... + +# BSD only +class kqueue(object): + closed: bool + def __init__(self) -> None: ... + def close(self) -> None: ... + def control(self, changelist: Optional[Iterable[kevent]], max_events: int, timeout: float = ...) -> List[kevent]: ... + def fileno(self) -> int: ... + @classmethod + def fromfd(cls, fd: _FileDescriptor) -> kqueue: ... + +# Linux only +class epoll(object): + if sys.version_info >= (3, 3): + def __init__(self, sizehint: int = ..., flags: int = ...) -> None: ... + else: + def __init__(self, sizehint: int = ...) -> None: ... + if sys.version_info >= (3, 4): + def __enter__(self) -> epoll: ... + def __exit__(self, *args: Any) -> None: ... + def close(self) -> None: ... + closed: bool + def fileno(self) -> int: ... + def register(self, fd: _FileDescriptor, eventmask: int = ...) -> None: ... + def modify(self, fd: _FileDescriptor, eventmask: int) -> None: ... + def unregister(self, fd: _FileDescriptor) -> None: ... + def poll(self, timeout: float = ..., maxevents: int = ...) -> List[Tuple[int, int]]: ... + @classmethod + def fromfd(cls, fd: _FileDescriptor) -> epoll: ... + +if sys.version_info >= (3, 3): + # Solaris only + class devpoll: + if sys.version_info >= (3, 4): + def close(self) -> None: ... + closed: bool + def fileno(self) -> int: ... + def register(self, fd: _FileDescriptor, eventmask: int = ...) -> None: ... + def modify(self, fd: _FileDescriptor, eventmask: int = ...) -> None: ... + def unregister(self, fd: _FileDescriptor) -> None: ... + def poll(self, timeout: Optional[float] = ...) -> List[Tuple[int, int]]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/shutil.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/shutil.pyi new file mode 100644 index 0000000..de1f8fc --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/shutil.pyi @@ -0,0 +1,135 @@ +import os +import sys + +# 'bytes' paths are not properly supported: they don't work with all functions, +# sometimes they only work partially (broken exception messages), and the test +# cases don't use them. + +from typing import ( + List, Iterable, Callable, Any, Tuple, Sequence, NamedTuple, IO, + AnyStr, Optional, Union, Set, TypeVar, overload, Type, Protocol, Text +) + +if sys.version_info >= (3, 6): + _Path = Union[str, os.PathLike[str]] + _AnyStr = str + _AnyPath = TypeVar("_AnyPath", str, os.PathLike[str]) + # Return value of some functions that may either return a path-like object that was passed in or + # a string + _PathReturn = Any +elif sys.version_info >= (3,): + _Path = str + _AnyStr = str + _AnyPath = str + _PathReturn = str +else: + _Path = Text + _AnyStr = TypeVar("_AnyStr", str, unicode) + _AnyPath = TypeVar("_AnyPath", str, unicode) + _PathReturn = Type[None] + +if sys.version_info >= (3,): + class Error(OSError): ... + class SameFileError(Error): ... + class SpecialFileError(OSError): ... + class ExecError(OSError): ... + class ReadError(OSError): ... + class RegistryError(Exception): ... +else: + class Error(EnvironmentError): ... + class SpecialFileError(EnvironmentError): ... + class ExecError(EnvironmentError): ... + +_S_co = TypeVar("_S_co", covariant=True) +_S_contra = TypeVar("_S_contra", contravariant=True) + +class _Reader(Protocol[_S_co]): + def read(self, length: int) -> _S_co: ... + +class _Writer(Protocol[_S_contra]): + def write(self, data: _S_contra) -> Any: ... + +def copyfileobj(fsrc: _Reader[AnyStr], fdst: _Writer[AnyStr], + length: int = ...) -> None: ... + +if sys.version_info >= (3,): + def copyfile(src: _Path, dst: _AnyPath, *, + follow_symlinks: bool = ...) -> _AnyPath: ... + def copymode(src: _Path, dst: _Path, *, + follow_symlinks: bool = ...) -> None: ... + def copystat(src: _Path, dst: _Path, *, + follow_symlinks: bool = ...) -> None: ... + def copy(src: _Path, dst: _Path, *, + follow_symlinks: bool = ...) -> _PathReturn: ... + def copy2(src: _Path, dst: _Path, *, + follow_symlinks: bool = ...) -> _PathReturn: ... +else: + def copyfile(src: _Path, dst: _Path) -> None: ... + def copymode(src: _Path, dst: _Path) -> None: ... + def copystat(src: _Path, dst: _Path) -> None: ... + def copy(src: _Path, dst: _Path) -> _PathReturn: ... + def copy2(src: _Path, dst: _Path) -> _PathReturn: ... + +def ignore_patterns(*patterns: _Path) -> Callable[[Any, List[_AnyStr]], Set[_AnyStr]]: ... + +if sys.version_info >= (3,): + _IgnoreFn = Union[None, Callable[[str, List[str]], Iterable[str]], Callable[[_Path, List[str]], Iterable[str]]] + def copytree(src: _Path, dst: _Path, symlinks: bool = ..., + ignore: _IgnoreFn = ..., + copy_function: Callable[[str, str], None] = ..., + ignore_dangling_symlinks: bool = ...) -> _PathReturn: ... +else: + _IgnoreFn = Union[None, Callable[[AnyStr, List[AnyStr]], Iterable[AnyStr]]] + def copytree(src: AnyStr, dst: AnyStr, symlinks: bool = ..., + ignore: _IgnoreFn = ...) -> _PathReturn: ... + +if sys.version_info >= (3,): + @overload + def rmtree(path: bytes, ignore_errors: bool = ..., + onerror: Optional[Callable[[Any, str, Any], Any]] = ...) -> None: ... + @overload + def rmtree(path: _AnyPath, ignore_errors: bool = ..., + onerror: Optional[Callable[[Any, _AnyPath, Any], Any]] = ...) -> None: ... +else: + def rmtree(path: _AnyPath, ignore_errors: bool = ..., + onerror: Optional[Callable[[Any, _AnyPath, Any], Any]] = ...) -> None: ... + +if sys.version_info >= (3, 5): + _CopyFn = Union[Callable[[str, str], None], Callable[[_Path, _Path], None]] + def move(src: _Path, dst: _Path, + copy_function: _CopyFn = ...) -> _PathReturn: ... +else: + def move(src: _Path, dst: _Path) -> _PathReturn: ... + +if sys.version_info >= (3,): + _ntuple_diskusage = NamedTuple('usage', [('total', int), + ('used', int), + ('free', int)]) + def disk_usage(path: _Path) -> _ntuple_diskusage: ... + def chown(path: _Path, user: Optional[str] = ..., + group: Optional[str] = ...) -> None: ... + def which(cmd: _Path, mode: int = ..., + path: Optional[_Path] = ...) -> Optional[str]: ... + +def make_archive(base_name: _AnyStr, format: str, root_dir: Optional[_Path] = ..., + base_dir: Optional[_Path] = ..., verbose: bool = ..., + dry_run: bool = ..., owner: Optional[str] = ..., group: Optional[str] = ..., + logger: Optional[Any] = ...) -> _AnyStr: ... +def get_archive_formats() -> List[Tuple[str, str]]: ... + +def register_archive_format(name: str, function: Callable[..., Any], + extra_args: Optional[Sequence[Union[Tuple[str, Any], List[Any]]]] = ..., + description: str = ...) -> None: ... +def unregister_archive_format(name: str) -> None: ... + +if sys.version_info >= (3,): + # Should be _Path once http://bugs.python.org/issue30218 is fixed + def unpack_archive(filename: str, extract_dir: Optional[_Path] = ..., + format: Optional[str] = ...) -> None: ... + def register_unpack_format(name: str, extensions: List[str], function: Any, + extra_args: Sequence[Tuple[str, Any]] = ..., + description: str = ...) -> None: ... + def unregister_unpack_format(name: str) -> None: ... + def get_unpack_formats() -> List[Tuple[str, List[str], str]]: ... + + def get_terminal_size(fallback: Tuple[int, int] = ...) -> os.terminal_size: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/site.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/site.pyi new file mode 100644 index 0000000..4fdbad8 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/site.pyi @@ -0,0 +1,17 @@ +# Stubs for site + +from typing import List, Iterable, Optional +import sys + +PREFIXES: List[str] +ENABLE_USER_SITE: Optional[bool] +USER_SITE: Optional[str] +USER_BASE: Optional[str] + +if sys.version_info < (3,): + def main() -> None: ... +def addsitedir(sitedir: str, + known_paths: Optional[Iterable[str]] = ...) -> None: ... +def getsitepackages(prefixes: Optional[Iterable[str]] = ...) -> List[str]: ... +def getuserbase() -> str: ... +def getusersitepackages() -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/smtpd.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/smtpd.pyi new file mode 100644 index 0000000..923b8bc --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/smtpd.pyi @@ -0,0 +1,87 @@ +# Stubs for smtpd (Python 2 and 3) +import sys +import socket +import asyncore +import asynchat + +from typing import Any, DefaultDict, List, Optional, Text, Tuple, Type + +_Address = Tuple[str, int] # (host, port) + + +class SMTPChannel(asynchat.async_chat): + COMMAND: int + DATA: int + + if sys.version_info >= (3, 3): + command_size_limits: DefaultDict[str, int] + + if sys.version_info >= (3,): + smtp_server: SMTPServer + conn: socket.socket + addr: Any + received_lines: List[Text] + smtp_state: int + seen_greeting: str + mailfrom: str + rcpttos: List[str] + received_data: str + fqdn: str + peer: str + + command_size_limit: int + data_size_limit: int + + if sys.version_info >= (3, 5): + enable_SMTPUTF8: bool + + if sys.version_info >= (3, 3): + @property + def max_command_size_limit(self) -> int: ... + + if sys.version_info >= (3, 5): + def __init__(self, server: SMTPServer, conn: socket.socket, addr: Any, data_size_limit: int = ..., + map: Optional[asyncore._maptype] = ..., enable_SMTPUTF8: bool = ..., decode_data: bool = ...) -> None: ... + elif sys.version_info >= (3, 4): + def __init__(self, server: SMTPServer, conn: socket.socket, addr: Any, data_size_limit: int = ..., + map: Optional[asyncore._maptype] = ...) -> None: ... + else: + def __init__(self, server: SMTPServer, conn: socket.socket, addr: Any, data_size_limit: int = ...) -> None: ... + def push(self, msg: bytes) -> None: ... + def collect_incoming_data(self, data: bytes) -> None: ... + def found_terminator(self) -> None: ... + def smtp_HELO(self, arg: str) -> None: ... + def smtp_NOOP(self, arg: str) -> None: ... + def smtp_QUIT(self, arg: str) -> None: ... + def smtp_MAIL(self, arg: str) -> None: ... + def smtp_RCPT(self, arg: str) -> None: ... + def smtp_RSET(self, arg: str) -> None: ... + def smtp_DATA(self, arg: str) -> None: ... + if sys.version_info >= (3, 3): + def smtp_EHLO(self, arg: str) -> None: ... + def smtp_HELP(self, arg: str) -> None: ... + def smtp_VRFY(self, arg: str) -> None: ... + def smtp_EXPN(self, arg: str) -> None: ... + +class SMTPServer(asyncore.dispatcher): + channel_class: Type[SMTPChannel] + + data_size_limit: int + enable_SMTPUTF8: bool + + if sys.version_info >= (3, 5): + def __init__(self, localaddr: _Address, remoteaddr: _Address, + data_size_limit: int = ..., map: Optional[asyncore._maptype] = ..., + enable_SMTPUTF8: bool = ..., decode_data: bool = ...) -> None: ... + elif sys.version_info >= (3, 4): + def __init__(self, localaddr: _Address, remoteaddr: _Address, + data_size_limit: int = ..., map: Optional[asyncore._maptype] = ...) -> None: ... + else: + def __init__(self, localaddr: _Address, remoteaddr: _Address, + data_size_limit: int = ...) -> None: ... + def handle_accepted(self, conn: socket.socket, addr: Any) -> None: ... + def process_message(self, peer: _Address, mailfrom: str, rcpttos: List[Text], data: str, **kwargs: Any) -> Optional[str]: ... + +class DebuggingServer(SMTPServer): ... +class PureProxy(SMTPServer): ... +class MailmanProxy(PureProxy): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/sndhdr.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/sndhdr.pyi new file mode 100644 index 0000000..aecd70b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/sndhdr.pyi @@ -0,0 +1,25 @@ +# Stubs for sndhdr (Python 2 and 3) + +import os +import sys +from typing import Any, NamedTuple, Optional, Tuple, Union + +if sys.version_info >= (3, 5): + SndHeaders = NamedTuple('SndHeaders', [ + ('filetype', str), + ('framerate', int), + ('nchannels', int), + ('nframes', int), + ('sampwidth', Union[int, str]), + ]) + _SndHeaders = SndHeaders +else: + _SndHeaders = Tuple[str, int, int, int, Union[int, str]] + +if sys.version_info >= (3, 6): + _Path = Union[str, bytes, os.PathLike[Any]] +else: + _Path = Union[str, bytes] + +def what(filename: _Path) -> Optional[_SndHeaders]: ... +def whathdr(filename: _Path) -> Optional[_SndHeaders]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/socket.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/socket.pyi new file mode 100644 index 0000000..22b2f91 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/socket.pyi @@ -0,0 +1,626 @@ +# Stubs for socket +# Ron Murawski + +# based on: http://docs.python.org/3.2/library/socket.html +# see: http://hg.python.org/cpython/file/3d0686d90f55/Lib/socket.py +# see: http://nullege.com/codes/search/socket +# adapted for Python 2.7 by Michal Pokorny +import sys +from typing import Any, Iterable, Tuple, List, Optional, Union, overload, TypeVar, Text + +_WriteBuffer = Union[bytearray, memoryview] + +# ----- variables and constants ----- + +AF_UNIX: AddressFamily +AF_INET: AddressFamily +AF_INET6: AddressFamily +SOCK_STREAM: SocketKind +SOCK_DGRAM: SocketKind +SOCK_RAW: SocketKind +SOCK_RDM: SocketKind +SOCK_SEQPACKET: SocketKind +SOCK_CLOEXEC: SocketKind +SOCK_NONBLOCK: SocketKind +SOMAXCONN: int +has_ipv6: bool +_GLOBAL_DEFAULT_TIMEOUT: Any +SocketType: Any +SocketIO: Any + +# These are flags that may exist on Python 3.6. Many don't exist on all platforms. +AF_AAL5: AddressFamily +AF_APPLETALK: AddressFamily +AF_ASH: AddressFamily +AF_ATMPVC: AddressFamily +AF_ATMSVC: AddressFamily +AF_AX25: AddressFamily +AF_BLUETOOTH: AddressFamily +AF_BRIDGE: AddressFamily +AF_CAN: AddressFamily +AF_DECnet: AddressFamily +AF_ECONET: AddressFamily +AF_IPX: AddressFamily +AF_IRDA: AddressFamily +AF_KEY: AddressFamily +AF_LLC: AddressFamily +AF_NETBEUI: AddressFamily +AF_NETLINK: AddressFamily +AF_NETROM: AddressFamily +AF_PACKET: AddressFamily +AF_PPPOX: AddressFamily +AF_RDS: AddressFamily +AF_ROSE: AddressFamily +AF_ROUTE: AddressFamily +AF_SECURITY: AddressFamily +AF_SNA: AddressFamily +AF_SYSTEM: AddressFamily +AF_TIPC: AddressFamily +AF_UNSPEC: AddressFamily +AF_WANPIPE: AddressFamily +AF_X25: AddressFamily +AI_ADDRCONFIG: AddressInfo +AI_ALL: AddressInfo +AI_CANONNAME: AddressInfo +AI_DEFAULT: AddressInfo +AI_MASK: AddressInfo +AI_NUMERICHOST: AddressInfo +AI_NUMERICSERV: AddressInfo +AI_PASSIVE: AddressInfo +AI_V4MAPPED: AddressInfo +AI_V4MAPPED_CFG: AddressInfo +BDADDR_ANY: str +BDADDR_LOCAL: str +BTPROTO_HCI: int +BTPROTO_L2CAP: int +BTPROTO_RFCOMM: int +BTPROTO_SCO: int +CAN_EFF_FLAG: int +CAN_EFF_MASK: int +CAN_ERR_FLAG: int +CAN_ERR_MASK: int +CAN_RAW: int +CAN_RAW_ERR_FILTER: int +CAN_RAW_FILTER: int +CAN_RAW_LOOPBACK: int +CAN_RAW_RECV_OWN_MSGS: int +CAN_RTR_FLAG: int +CAN_SFF_MASK: int +CAPI: int +EAGAIN: int +EAI_ADDRFAMILY: int +EAI_AGAIN: int +EAI_BADFLAGS: int +EAI_BADHINTS: int +EAI_FAIL: int +EAI_FAMILY: int +EAI_MAX: int +EAI_MEMORY: int +EAI_NODATA: int +EAI_NONAME: int +EAI_OVERFLOW: int +EAI_PROTOCOL: int +EAI_SERVICE: int +EAI_SOCKTYPE: int +EAI_SYSTEM: int +EBADF: int +EINTR: int +EWOULDBLOCK: int +HCI_DATA_DIR: int +HCI_FILTER: int +HCI_TIME_STAMP: int +INADDR_ALLHOSTS_GROUP: int +INADDR_ANY: int +INADDR_BROADCAST: int +INADDR_LOOPBACK: int +INADDR_MAX_LOCAL_GROUP: int +INADDR_NONE: int +INADDR_UNSPEC_GROUP: int +IPPORT_RESERVED: int +IPPORT_USERRESERVED: int +IPPROTO_AH: int +IPPROTO_BIP: int +IPPROTO_DSTOPTS: int +IPPROTO_EGP: int +IPPROTO_EON: int +IPPROTO_ESP: int +IPPROTO_FRAGMENT: int +IPPROTO_GGP: int +IPPROTO_GRE: int +IPPROTO_HELLO: int +IPPROTO_HOPOPTS: int +IPPROTO_ICMP: int +IPPROTO_ICMPV6: int +IPPROTO_IDP: int +IPPROTO_IGMP: int +IPPROTO_IP: int +IPPROTO_IPCOMP: int +IPPROTO_IPIP: int +IPPROTO_IPV4: int +IPPROTO_IPV6: int +IPPROTO_MAX: int +IPPROTO_MOBILE: int +IPPROTO_ND: int +IPPROTO_NONE: int +IPPROTO_PIM: int +IPPROTO_PUP: int +IPPROTO_RAW: int +IPPROTO_ROUTING: int +IPPROTO_RSVP: int +IPPROTO_SCTP: int +IPPROTO_TCP: int +IPPROTO_TP: int +IPPROTO_UDP: int +IPPROTO_VRRP: int +IPPROTO_XTP: int +IPV6_CHECKSUM: int +IPV6_DONTFRAG: int +IPV6_DSTOPTS: int +IPV6_HOPLIMIT: int +IPV6_HOPOPTS: int +IPV6_JOIN_GROUP: int +IPV6_LEAVE_GROUP: int +IPV6_MULTICAST_HOPS: int +IPV6_MULTICAST_IF: int +IPV6_MULTICAST_LOOP: int +IPV6_NEXTHOP: int +IPV6_PATHMTU: int +IPV6_PKTINFO: int +IPV6_RECVDSTOPTS: int +IPV6_RECVHOPLIMIT: int +IPV6_RECVHOPOPTS: int +IPV6_RECVPATHMTU: int +IPV6_RECVPKTINFO: int +IPV6_RECVRTHDR: int +IPV6_RECVTCLASS: int +IPV6_RTHDR: int +IPV6_RTHDR_TYPE_0: int +IPV6_RTHDRDSTOPTS: int +IPV6_TCLASS: int +IPV6_UNICAST_HOPS: int +IPV6_USE_MIN_MTU: int +IPV6_V6ONLY: int +IP_ADD_MEMBERSHIP: int +IP_DEFAULT_MULTICAST_LOOP: int +IP_DEFAULT_MULTICAST_TTL: int +IP_DROP_MEMBERSHIP: int +IP_HDRINCL: int +IP_MAX_MEMBERSHIPS: int +IP_MULTICAST_IF: int +IP_MULTICAST_LOOP: int +IP_MULTICAST_TTL: int +IP_OPTIONS: int +IP_RECVDSTADDR: int +IP_RECVOPTS: int +IP_RECVRETOPTS: int +IP_RETOPTS: int +IP_TOS: int +IP_TRANSPARENT: int +IP_TTL: int +IPX_TYPE: int +LOCAL_PEERCRED: int +MSG_BCAST: MsgFlag +MSG_BTAG: MsgFlag +MSG_CMSG_CLOEXEC: MsgFlag +MSG_CONFIRM: MsgFlag +MSG_CTRUNC: MsgFlag +MSG_DONTROUTE: MsgFlag +MSG_DONTWAIT: MsgFlag +MSG_EOF: MsgFlag +MSG_EOR: MsgFlag +MSG_ERRQUEUE: MsgFlag +MSG_ETAG: MsgFlag +MSG_FASTOPEN: MsgFlag +MSG_MCAST: MsgFlag +MSG_MORE: MsgFlag +MSG_NOSIGNAL: MsgFlag +MSG_NOTIFICATION: MsgFlag +MSG_OOB: MsgFlag +MSG_PEEK: MsgFlag +MSG_TRUNC: MsgFlag +MSG_WAITALL: MsgFlag +NETLINK_ARPD: int +NETLINK_CRYPTO: int +NETLINK_DNRTMSG: int +NETLINK_FIREWALL: int +NETLINK_IP6_FW: int +NETLINK_NFLOG: int +NETLINK_ROUTE6: int +NETLINK_ROUTE: int +NETLINK_SKIP: int +NETLINK_TAPBASE: int +NETLINK_TCPDIAG: int +NETLINK_USERSOCK: int +NETLINK_W1: int +NETLINK_XFRM: int +NI_DGRAM: int +NI_MAXHOST: int +NI_MAXSERV: int +NI_NAMEREQD: int +NI_NOFQDN: int +NI_NUMERICHOST: int +NI_NUMERICSERV: int +PACKET_BROADCAST: int +PACKET_FASTROUTE: int +PACKET_HOST: int +PACKET_LOOPBACK: int +PACKET_MULTICAST: int +PACKET_OTHERHOST: int +PACKET_OUTGOING: int +PF_CAN: int +PF_PACKET: int +PF_RDS: int +PF_SYSTEM: int +SCM_CREDENTIALS: int +SCM_CREDS: int +SCM_RIGHTS: int +SHUT_RD: int +SHUT_RDWR: int +SHUT_WR: int +SOL_ATALK: int +SOL_AX25: int +SOL_CAN_BASE: int +SOL_CAN_RAW: int +SOL_HCI: int +SOL_IP: int +SOL_IPX: int +SOL_NETROM: int +SOL_RDS: int +SOL_ROSE: int +SOL_SOCKET: int +SOL_TCP: int +SOL_TIPC: int +SOL_UDP: int +SO_ACCEPTCONN: int +SO_BINDTODEVICE: int +SO_BROADCAST: int +SO_DEBUG: int +SO_DONTROUTE: int +SO_ERROR: int +SO_EXCLUSIVEADDRUSE: int +SO_KEEPALIVE: int +SO_LINGER: int +SO_MARK: int +SO_OOBINLINE: int +SO_PASSCRED: int +SO_PEERCRED: int +SO_PRIORITY: int +SO_RCVBUF: int +SO_RCVLOWAT: int +SO_RCVTIMEO: int +SO_REUSEADDR: int +SO_REUSEPORT: int +SO_SETFIB: int +SO_SNDBUF: int +SO_SNDLOWAT: int +SO_SNDTIMEO: int +SO_TYPE: int +SO_USELOOPBACK: int +SYSPROTO_CONTROL: int +TCP_CORK: int +TCP_DEFER_ACCEPT: int +TCP_FASTOPEN: int +TCP_INFO: int +TCP_KEEPCNT: int +TCP_KEEPIDLE: int +TCP_KEEPINTVL: int +TCP_LINGER2: int +TCP_MAXSEG: int +TCP_NODELAY: int +TCP_NOTSENT_LOWAT: int +TCP_QUICKACK: int +TCP_SYNCNT: int +TCP_WINDOW_CLAMP: int +TIPC_ADDR_ID: int +TIPC_ADDR_NAME: int +TIPC_ADDR_NAMESEQ: int +TIPC_CFG_SRV: int +TIPC_CLUSTER_SCOPE: int +TIPC_CONN_TIMEOUT: int +TIPC_CRITICAL_IMPORTANCE: int +TIPC_DEST_DROPPABLE: int +TIPC_HIGH_IMPORTANCE: int +TIPC_IMPORTANCE: int +TIPC_LOW_IMPORTANCE: int +TIPC_MEDIUM_IMPORTANCE: int +TIPC_NODE_SCOPE: int +TIPC_PUBLISHED: int +TIPC_SRC_DROPPABLE: int +TIPC_SUB_CANCEL: int +TIPC_SUB_PORTS: int +TIPC_SUB_SERVICE: int +TIPC_SUBSCR_TIMEOUT: int +TIPC_TOP_SRV: int +TIPC_WAIT_FOREVER: int +TIPC_WITHDRAWN: int +TIPC_ZONE_SCOPE: int + +if sys.version_info >= (3, 3): + RDS_CANCEL_SENT_TO: int + RDS_CMSG_RDMA_ARGS: int + RDS_CMSG_RDMA_DEST: int + RDS_CMSG_RDMA_MAP: int + RDS_CMSG_RDMA_STATUS: int + RDS_CMSG_RDMA_UPDATE: int + RDS_CONG_MONITOR: int + RDS_FREE_MR: int + RDS_GET_MR: int + RDS_GET_MR_FOR_DEST: int + RDS_RDMA_DONTWAIT: int + RDS_RDMA_FENCE: int + RDS_RDMA_INVALIDATE: int + RDS_RDMA_NOTIFY_ME: int + RDS_RDMA_READWRITE: int + RDS_RDMA_SILENT: int + RDS_RDMA_USE_ONCE: int + RDS_RECVERR: int + +if sys.version_info >= (3, 4): + CAN_BCM: int + CAN_BCM_TX_SETUP: int + CAN_BCM_TX_DELETE: int + CAN_BCM_TX_READ: int + CAN_BCM_TX_SEND: int + CAN_BCM_RX_SETUP: int + CAN_BCM_RX_DELETE: int + CAN_BCM_RX_READ: int + CAN_BCM_TX_STATUS: int + CAN_BCM_TX_EXPIRED: int + CAN_BCM_RX_STATUS: int + CAN_BCM_RX_TIMEOUT: int + CAN_BCM_RX_CHANGED: int + AF_LINK: AddressFamily + +if sys.version_info >= (3, 5): + CAN_RAW_FD_FRAMES: int + +if sys.version_info >= (3, 6): + SO_DOMAIN: int + SO_PROTOCOL: int + SO_PEERSEC: int + SO_PASSSEC: int + TCP_USER_TIMEOUT: int + TCP_CONGESTION: int + AF_ALG: AddressFamily + SOL_ALG: int + ALG_SET_KEY: int + ALG_SET_IV: int + ALG_SET_OP: int + ALG_SET_AEAD_ASSOCLEN: int + ALG_SET_AEAD_AUTHSIZE: int + ALG_SET_PUBKEY: int + ALG_OP_DECRYPT: int + ALG_OP_ENCRYPT: int + ALG_OP_SIGN: int + ALG_OP_VERIFY: int + +if sys.platform == 'win32': + SIO_RCVALL: int + SIO_KEEPALIVE_VALS: int + RCVALL_IPLEVEL: int + RCVALL_MAX: int + RCVALL_OFF: int + RCVALL_ON: int + RCVALL_SOCKETLEVELONLY: int + + if sys.version_info >= (3, 6): + SIO_LOOPBACK_FAST_PATH: int + +# enum versions of above flags py 3.4+ +if sys.version_info >= (3, 4): + from enum import IntEnum + + class AddressFamily(IntEnum): + AF_UNIX = ... + AF_INET = ... + AF_INET6 = ... + AF_APPLETALK = ... + AF_ASH = ... + AF_ATMPVC = ... + AF_ATMSVC = ... + AF_AX25 = ... + AF_BLUETOOTH = ... + AF_BRIDGE = ... + AF_DECnet = ... + AF_ECONET = ... + AF_IPX = ... + AF_IRDA = ... + AF_KEY = ... + AF_LLC = ... + AF_NETBEUI = ... + AF_NETLINK = ... + AF_NETROM = ... + AF_PACKET = ... + AF_PPPOX = ... + AF_ROSE = ... + AF_ROUTE = ... + AF_SECURITY = ... + AF_SNA = ... + AF_TIPC = ... + AF_UNSPEC = ... + AF_WANPIPE = ... + AF_X25 = ... + AF_LINK = ... + + class SocketKind(IntEnum): + SOCK_STREAM = ... + SOCK_DGRAM = ... + SOCK_RAW = ... + SOCK_RDM = ... + SOCK_SEQPACKET = ... + SOCK_CLOEXEC = ... + SOCK_NONBLOCK = ... +else: + AddressFamily = int + SocketKind = int + +if sys.version_info >= (3, 6): + from enum import IntFlag + + class AddressInfo(IntFlag): + AI_ADDRCONFIG = ... + AI_ALL = ... + AI_CANONNAME = ... + AI_NUMERICHOST = ... + AI_NUMERICSERV = ... + AI_PASSIVE = ... + AI_V4MAPPED = ... + + class MsgFlag(IntFlag): + MSG_CTRUNC = ... + MSG_DONTROUTE = ... + MSG_DONTWAIT = ... + MSG_EOR = ... + MSG_OOB = ... + MSG_PEEK = ... + MSG_TRUNC = ... + MSG_WAITALL = ... +else: + AddressInfo = int + MsgFlag = int + + +# ----- exceptions ----- +class error(IOError): + ... + +class herror(error): + def __init__(self, herror: int, string: str) -> None: ... + +class gaierror(error): + def __init__(self, error: int, string: str) -> None: ... + +class timeout(error): + ... + + +# Addresses can be either tuples of varying lengths (AF_INET, AF_INET6, +# AF_NETLINK, AF_TIPC) or strings (AF_UNIX). + +_Address = Union[tuple, str] +_RetAddress = Any + +# TODO AF_PACKET and AF_BLUETOOTH address objects + +_CMSG = Tuple[int, int, bytes] +_SelfT = TypeVar('_SelfT', bound=socket) + +# ----- classes ----- +class socket: + family: int + type: int + proto: int + + if sys.version_info < (3,): + def __init__(self, family: int = ..., type: int = ..., proto: int = ...) -> None: ... + else: + def __init__(self, family: int = ..., type: int = ..., proto: int = ..., fileno: Optional[int] = ...) -> None: ... + + if sys.version_info >= (3, 2): + def __enter__(self: _SelfT) -> _SelfT: ... + def __exit__(self, *args: Any) -> None: ... + + # --- methods --- + def accept(self) -> Tuple[socket, _RetAddress]: ... + def bind(self, address: Union[_Address, bytes]) -> None: ... + def close(self) -> None: ... + def connect(self, address: Union[_Address, bytes]) -> None: ... + def connect_ex(self, address: Union[_Address, bytes]) -> int: ... + def detach(self) -> int: ... + def fileno(self) -> int: ... + + def getpeername(self) -> _RetAddress: ... + def getsockname(self) -> _RetAddress: ... + + @overload + def getsockopt(self, level: int, optname: int) -> int: ... + @overload + def getsockopt(self, level: int, optname: int, buflen: int) -> bytes: ... + + def gettimeout(self) -> Optional[float]: ... + def ioctl(self, control: object, + option: Tuple[int, int, int]) -> None: ... + if sys.version_info < (3, 5): + def listen(self, backlog: int) -> None: ... + else: + def listen(self, backlog: int = ...) -> None: ... + # TODO the return value may be BinaryIO or TextIO, depending on mode + def makefile(self, mode: str = ..., buffering: int = ..., + encoding: str = ..., errors: str = ..., + newline: str = ...) -> Any: + ... + def recv(self, bufsize: int, flags: int = ...) -> bytes: ... + + def recvfrom(self, bufsize: int, flags: int = ...) -> Tuple[bytes, _RetAddress]: ... + def recvfrom_into(self, buffer: _WriteBuffer, nbytes: int, + flags: int = ...) -> Tuple[int, _RetAddress]: ... + def recv_into(self, buffer: _WriteBuffer, nbytes: int, + flags: int = ...) -> int: ... + def send(self, data: bytes, flags: int = ...) -> int: ... + def sendall(self, data: bytes, flags: int = ...) -> None: + ... # return type: None on success + @overload + def sendto(self, data: bytes, address: _Address) -> int: ... + @overload + def sendto(self, data: bytes, flags: int, address: _Address) -> int: ... + def setblocking(self, flag: bool) -> None: ... + def settimeout(self, value: Optional[float]) -> None: ... + def setsockopt(self, level: int, optname: int, value: Union[int, bytes]) -> None: ... + def shutdown(self, how: int) -> None: ... + + if sys.version_info >= (3, 3): + def recvmsg(self, __bufsize: int, __ancbufsize: int = ..., + __flags: int = ...) -> Tuple[bytes, List[_CMSG], int, Any]: ... + def recvmsg_into(self, __buffers: Iterable[_WriteBuffer], __ancbufsize: int = ..., + __flags: int = ...) -> Tuple[int, List[_CMSG], int, Any]: ... + def sendmsg(self, __buffers: Iterable[bytes], __ancdata: Iterable[_CMSG] = ..., + __flags: int = ..., __address: _Address = ...) -> int: ... + if sys.version_info >= (3, 4): + def set_inheritable(self, inheritable: bool) -> None: ... + + +# ----- functions ----- +def create_connection(address: Tuple[Optional[str], int], + timeout: Optional[float] = ..., + source_address: Tuple[Union[bytearray, bytes, Text], int] = ...) -> socket: ... + +# the 5th tuple item is an address +# TODO the "Tuple[Any, ...]" should be "Union[Tuple[str, int], Tuple[str, int, int, int]]" but that triggers +# https://github.com/python/mypy/issues/2509 +def getaddrinfo( + host: Optional[Union[bytearray, bytes, Text]], port: Union[str, int, None], family: int = ..., + socktype: int = ..., proto: int = ..., + flags: int = ...) -> List[Tuple[int, int, int, str, Tuple[Any, ...]]]: + ... + +def getfqdn(name: str = ...) -> str: ... +def gethostbyname(hostname: str) -> str: ... +def gethostbyname_ex(hostname: str) -> Tuple[str, List[str], List[str]]: ... +def gethostname() -> str: ... +def gethostbyaddr(ip_address: str) -> Tuple[str, List[str], List[str]]: ... +def getnameinfo(sockaddr: tuple, flags: int) -> Tuple[str, int]: ... +def getprotobyname(protocolname: str) -> int: ... +def getservbyname(servicename: str, protocolname: str = ...) -> int: ... +def getservbyport(port: int, protocolname: str = ...) -> str: ... +def socketpair(family: int = ..., + type: int = ..., + proto: int = ...) -> Tuple[socket, socket]: ... +def fromfd(fd: int, family: int, type: int, proto: int = ...) -> socket: ... +def ntohl(x: int) -> int: ... # param & ret val are 32-bit ints +def ntohs(x: int) -> int: ... # param & ret val are 16-bit ints +def htonl(x: int) -> int: ... # param & ret val are 32-bit ints +def htons(x: int) -> int: ... # param & ret val are 16-bit ints +def inet_aton(ip_string: str) -> bytes: ... # ret val 4 bytes in length +def inet_ntoa(packed_ip: bytes) -> str: ... +def inet_pton(address_family: int, ip_string: str) -> bytes: ... +def inet_ntop(address_family: int, packed_ip: bytes) -> str: ... +def getdefaulttimeout() -> Optional[float]: ... +def setdefaulttimeout(timeout: Optional[float]) -> None: ... + +if sys.version_info >= (3, 3): + def CMSG_LEN(length: int) -> int: ... + def CMSG_SPACE(length: int) -> int: ... + def sethostname(name: str) -> None: ... + def if_nameindex() -> List[Tuple[int, str]]: ... + def if_nametoindex(name: str) -> int: ... + def if_indextoname(index: int) -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/sqlite3/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/sqlite3/__init__.pyi new file mode 100644 index 0000000..d5d20d6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/sqlite3/__init__.pyi @@ -0,0 +1 @@ +from sqlite3.dbapi2 import * # noqa: F403 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/sqlite3/dbapi2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/sqlite3/dbapi2.pyi new file mode 100644 index 0000000..5b3d2a0 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/sqlite3/dbapi2.pyi @@ -0,0 +1,289 @@ +# Filip Hron +# based heavily on Andrey Vlasovskikh's python-skeletons https://github.com/JetBrains/python-skeletons/blob/master/sqlite3.py + +import os +import sys +from typing import Any, Callable, Iterable, Iterator, List, Optional, Text, Tuple, Type, TypeVar, Union +from datetime import date, time, datetime + +_T = TypeVar('_T') + +paramstyle: str +threadsafety: int +apilevel: str +Date = date +Time = time +Timestamp = datetime + +def DateFromTicks(ticks): ... +def TimeFromTicks(ticks): ... +def TimestampFromTicks(ticks): ... + +version_info: str +sqlite_version_info: Tuple[int, int, int] +if sys.version_info >= (3,): + Binary = memoryview +else: + Binary = buffer + +def register_adapters_and_converters(): ... + +# The remaining definitions are imported from _sqlite3. + +PARSE_COLNAMES: int +PARSE_DECLTYPES: int +SQLITE_ALTER_TABLE: int +SQLITE_ANALYZE: int +SQLITE_ATTACH: int +SQLITE_CREATE_INDEX: int +SQLITE_CREATE_TABLE: int +SQLITE_CREATE_TEMP_INDEX: int +SQLITE_CREATE_TEMP_TABLE: int +SQLITE_CREATE_TEMP_TRIGGER: int +SQLITE_CREATE_TEMP_VIEW: int +SQLITE_CREATE_TRIGGER: int +SQLITE_CREATE_VIEW: int +SQLITE_DELETE: int +SQLITE_DENY: int +SQLITE_DETACH: int +SQLITE_DROP_INDEX: int +SQLITE_DROP_TABLE: int +SQLITE_DROP_TEMP_INDEX: int +SQLITE_DROP_TEMP_TABLE: int +SQLITE_DROP_TEMP_TRIGGER: int +SQLITE_DROP_TEMP_VIEW: int +SQLITE_DROP_TRIGGER: int +SQLITE_DROP_VIEW: int +SQLITE_IGNORE: int +SQLITE_INSERT: int +SQLITE_OK: int +SQLITE_PRAGMA: int +SQLITE_READ: int +SQLITE_REINDEX: int +SQLITE_SELECT: int +SQLITE_TRANSACTION: int +SQLITE_UPDATE: int +adapters: Any +converters: Any +sqlite_version: str +version: str + +# TODO: adapt needs to get probed +def adapt(obj, protocol, alternate): ... +def complete_statement(sql: str) -> bool: ... +if sys.version_info >= (3, 7): + def connect(database: Union[bytes, Text, os.PathLike[Text]], + timeout: float = ..., + detect_types: int = ..., + isolation_level: Optional[str] = ..., + check_same_thread: bool = ..., + factory: Optional[Type[Connection]] = ..., + cached_statements: int = ..., + uri: bool = ...) -> Connection: ... +elif sys.version_info >= (3, 4): + def connect(database: Union[bytes, Text], + timeout: float = ..., + detect_types: int = ..., + isolation_level: Optional[str] = ..., + check_same_thread: bool = ..., + factory: Optional[Type[Connection]] = ..., + cached_statements: int = ..., + uri: bool = ...) -> Connection: ... +else: + def connect(database: Union[bytes, Text], + timeout: float = ..., + detect_types: int = ..., + isolation_level: Optional[str] = ..., + check_same_thread: bool = ..., + factory: Optional[Type[Connection]] = ..., + cached_statements: int = ...) -> Connection: ... +def enable_callback_tracebacks(flag: bool) -> None: ... +def enable_shared_cache(do_enable: int) -> None: ... +def register_adapter(type: Type[_T], callable: Callable[[_T], Union[int, float, str, bytes]]) -> None: ... +def register_converter(typename: str, callable: Callable[[bytes], Any]) -> None: ... + +class Cache(object): + def __init__(self, *args, **kwargs) -> None: ... + def display(self, *args, **kwargs) -> None: ... + def get(self, *args, **kwargs) -> None: ... + +class Connection(object): + DataError: Any + DatabaseError: Any + Error: Any + IntegrityError: Any + InterfaceError: Any + InternalError: Any + NotSupportedError: Any + OperationalError: Any + ProgrammingError: Any + Warning: Any + in_transaction: Any + isolation_level: Any + row_factory: Any + text_factory: Any + total_changes: Any + def __init__(self, *args, **kwargs): ... + def close(self) -> None: ... + def commit(self) -> None: ... + def create_aggregate(self, name: str, num_params: int, aggregate_class: type) -> None: ... + def create_collation(self, name: str, callable: Any) -> None: ... + def create_function(self, name: str, num_params: int, func: Any) -> None: ... + def cursor(self, cursorClass: Optional[type] = ...) -> Cursor: ... + def execute(self, sql: str, parameters: Iterable = ...) -> Cursor: ... + # TODO: please check in executemany() if seq_of_parameters type is possible like this + def executemany(self, sql: str, seq_of_parameters: Iterable[Iterable]) -> Cursor: ... + def executescript(self, sql_script: Union[bytes, Text]) -> Cursor: ... + def interrupt(self, *args, **kwargs) -> None: ... + def iterdump(self, *args, **kwargs) -> None: ... + def rollback(self, *args, **kwargs) -> None: ... + # TODO: set_authorizer(authorzer_callback) + # see https://docs.python.org/2/library/sqlite3.html#sqlite3.Connection.set_authorizer + # returns [SQLITE_OK, SQLITE_DENY, SQLITE_IGNORE] so perhaps int + def set_authorizer(self, *args, **kwargs) -> None: ... + # set_progress_handler(handler, n) -> see https://docs.python.org/2/library/sqlite3.html#sqlite3.Connection.set_progress_handler + def set_progress_handler(self, *args, **kwargs) -> None: ... + def set_trace_callback(self, *args, **kwargs): ... + # enable_load_extension and load_extension is not available on python distributions compiled + # without sqlite3 loadable extension support. see footnotes https://docs.python.org/3/library/sqlite3.html#f1 + def enable_load_extension(self, enabled: bool) -> None: ... + def load_extension(self, path: str) -> None: ... + if sys.version_info >= (3, 7): + def backup(self, target: Connection, *, pages: int = ..., + progress: Optional[Callable[[int, int, int], object]] = ..., name: str = ..., + sleep: float = ...) -> None: ... + def __call__(self, *args, **kwargs): ... + def __enter__(self, *args, **kwargs): ... + def __exit__(self, *args, **kwargs): ... + +class Cursor(Iterator[Any]): + arraysize: Any + connection: Any + description: Any + lastrowid: Any + row_factory: Any + rowcount: Any + # TODO: Cursor class accepts exactly 1 argument + # required type is sqlite3.Connection (which is imported as _Connection) + # however, the name of the __init__ variable is unknown + def __init__(self, *args, **kwargs) -> None: ... + def close(self, *args, **kwargs) -> None: ... + def execute(self, sql: str, parameters: Iterable = ...) -> Cursor: ... + def executemany(self, sql: str, seq_of_parameters: Iterable[Iterable]) -> Cursor: ... + def executescript(self, sql_script: Union[bytes, Text]) -> Cursor: ... + def fetchall(self) -> List[Any]: ... + def fetchmany(self, size: Optional[int] = ...) -> List[Any]: ... + def fetchone(self) -> Any: ... + def setinputsizes(self, *args, **kwargs) -> None: ... + def setoutputsize(self, *args, **kwargs) -> None: ... + def __iter__(self) -> Cursor: ... + if sys.version_info >= (3, 0): + def __next__(self) -> Any: ... + else: + def next(self) -> Any: ... + + +class DataError(DatabaseError): ... + +class DatabaseError(Error): ... + +class Error(Exception): ... + +class IntegrityError(DatabaseError): ... + +class InterfaceError(Error): ... + +class InternalError(DatabaseError): ... + +class NotSupportedError(DatabaseError): ... + +class OperationalError(DatabaseError): ... + +class OptimizedUnicode(object): + maketrans: Any + def __init__(self, *args, **kwargs): ... + def capitalize(self, *args, **kwargs): ... + def casefold(self, *args, **kwargs): ... + def center(self, *args, **kwargs): ... + def count(self, *args, **kwargs): ... + def encode(self, *args, **kwargs): ... + def endswith(self, *args, **kwargs): ... + def expandtabs(self, *args, **kwargs): ... + def find(self, *args, **kwargs): ... + def format(self, *args, **kwargs): ... + def format_map(self, *args, **kwargs): ... + def index(self, *args, **kwargs): ... + def isalnum(self, *args, **kwargs): ... + def isalpha(self, *args, **kwargs): ... + def isdecimal(self, *args, **kwargs): ... + def isdigit(self, *args, **kwargs): ... + def isidentifier(self, *args, **kwargs): ... + def islower(self, *args, **kwargs): ... + def isnumeric(self, *args, **kwargs): ... + def isprintable(self, *args, **kwargs): ... + def isspace(self, *args, **kwargs): ... + def istitle(self, *args, **kwargs): ... + def isupper(self, *args, **kwargs): ... + def join(self, *args, **kwargs): ... + def ljust(self, *args, **kwargs): ... + def lower(self, *args, **kwargs): ... + def lstrip(self, *args, **kwargs): ... + def partition(self, *args, **kwargs): ... + def replace(self, *args, **kwargs): ... + def rfind(self, *args, **kwargs): ... + def rindex(self, *args, **kwargs): ... + def rjust(self, *args, **kwargs): ... + def rpartition(self, *args, **kwargs): ... + def rsplit(self, *args, **kwargs): ... + def rstrip(self, *args, **kwargs): ... + def split(self, *args, **kwargs): ... + def splitlines(self, *args, **kwargs): ... + def startswith(self, *args, **kwargs): ... + def strip(self, *args, **kwargs): ... + def swapcase(self, *args, **kwargs): ... + def title(self, *args, **kwargs): ... + def translate(self, *args, **kwargs): ... + def upper(self, *args, **kwargs): ... + def zfill(self, *args, **kwargs): ... + def __add__(self, other): ... + def __contains__(self, *args, **kwargs): ... + def __eq__(self, other): ... + def __format__(self, *args, **kwargs): ... + def __ge__(self, other): ... + def __getitem__(self, index): ... + def __getnewargs__(self, *args, **kwargs): ... + def __gt__(self, other): ... + def __hash__(self): ... + def __iter__(self): ... + def __le__(self, other): ... + def __len__(self, *args, **kwargs): ... + def __lt__(self, other): ... + def __mod__(self, other): ... + def __mul__(self, other): ... + def __ne__(self, other): ... + def __rmod__(self, other): ... + def __rmul__(self, other): ... + +class PrepareProtocol(object): + def __init__(self, *args, **kwargs): ... + +class ProgrammingError(DatabaseError): ... + +class Row(object): + def __init__(self, *args, **kwargs): ... + def keys(self, *args, **kwargs): ... + def __eq__(self, other): ... + def __ge__(self, other): ... + def __getitem__(self, index): ... + def __gt__(self, other): ... + def __hash__(self): ... + def __iter__(self): ... + def __le__(self, other): ... + def __len__(self, *args, **kwargs): ... + def __lt__(self, other): ... + def __ne__(self, other): ... + +class Statement(object): + def __init__(self, *args, **kwargs): ... + +class Warning(Exception): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/sre_compile.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/sre_compile.pyi new file mode 100644 index 0000000..be39a31 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/sre_compile.pyi @@ -0,0 +1,18 @@ +# Source: https://hg.python.org/cpython/file/2.7/Lib/sre_compile.py +# and https://github.com/python/cpython/blob/master/Lib/sre_compile.py + +import sys +from sre_parse import SubPattern +from typing import Any, List, Pattern, Tuple, Type, TypeVar, Union + +MAXCODE: int +if sys.version_info < (3, 0): + STRING_TYPES: Tuple[Type[str], Type[unicode]] + _IsStringType = int +else: + from sre_constants import _NamedIntConstant + def dis(code: List[_NamedIntConstant]) -> None: ... + _IsStringType = bool + +def isstring(obj: Any) -> _IsStringType: ... +def compile(p: Union[str, bytes, SubPattern], flags: int = ...) -> Pattern: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/ssl.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/ssl.pyi new file mode 100644 index 0000000..4b51e40 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/ssl.pyi @@ -0,0 +1,313 @@ +# Stubs for ssl + +from typing import ( + Any, Dict, Callable, List, NamedTuple, Optional, Set, Tuple, Union, +) +import socket +import sys + +_PCTRTT = Tuple[Tuple[str, str], ...] +_PCTRTTT = Tuple[_PCTRTT, ...] +_PeerCertRetDictType = Dict[str, Union[str, _PCTRTTT, _PCTRTT]] +_PeerCertRetType = Union[_PeerCertRetDictType, bytes, None] +_EnumRetType = List[Tuple[bytes, str, Union[Set[str], bool]]] +_PasswordType = Union[Callable[[], Union[str, bytes]], str, bytes] + +if sys.version_info >= (3, 5): + _SC1ArgT = Union[SSLSocket, SSLObject] +else: + _SC1ArgT = SSLSocket +_SrvnmeCbType = Callable[[_SC1ArgT, Optional[str], SSLSocket], Optional[int]] + +class SSLError(OSError): + library: str + reason: str +class SSLZeroReturnError(SSLError): ... +class SSLWantReadError(SSLError): ... +class SSLWantWriteError(SSLError): ... +class SSLSyscallError(SSLError): ... +class SSLEOFError(SSLError): ... + +if sys.version_info >= (3, 7): + class SSLCertVerificationError(SSLError, ValueError): + verify_code: int + verify_message: str + + CertificateError = SSLCertVerificationError +else: + class CertificateError(ValueError): ... + + +def wrap_socket(sock: socket.socket, keyfile: Optional[str] = ..., + certfile: Optional[str] = ..., server_side: bool = ..., + cert_reqs: int = ..., ssl_version: int = ..., + ca_certs: Optional[str] = ..., + do_handshake_on_connect: bool = ..., + suppress_ragged_eofs: bool = ..., + ciphers: Optional[str] = ...) -> SSLSocket: ... + + +if sys.version_info < (3,) or sys.version_info >= (3, 4): + def create_default_context(purpose: Any = ..., *, + cafile: Optional[str] = ..., + capath: Optional[str] = ..., + cadata: Optional[str] = ...) -> SSLContext: ... + +if sys.version_info >= (3, 4): + def _create_unverified_context(protocol: int = ..., *, + cert_reqs: int = ..., + check_hostname: bool = ..., + purpose: Any = ..., + certfile: Optional[str] = ..., + keyfile: Optional[str] = ..., + cafile: Optional[str] = ..., + capath: Optional[str] = ..., + cadata: Optional[str] = ...) -> SSLContext: ... + _create_default_https_context: Callable[..., SSLContext] + +if sys.version_info >= (3, 3): + def RAND_bytes(num: int) -> bytes: ... + def RAND_pseudo_bytes(num: int) -> Tuple[bytes, bool]: ... +def RAND_status() -> bool: ... +def RAND_egd(path: str) -> None: ... +def RAND_add(bytes: bytes, entropy: float) -> None: ... + + +def match_hostname(cert: _PeerCertRetType, hostname: str) -> None: ... +def cert_time_to_seconds(cert_time: str) -> int: ... +def get_server_certificate(addr: Tuple[str, int], ssl_version: int = ..., + ca_certs: Optional[str] = ...) -> str: ... +def DER_cert_to_PEM_cert(der_cert_bytes: bytes) -> str: ... +def PEM_cert_to_DER_cert(pem_cert_string: str) -> bytes: ... +if sys.version_info < (3,) or sys.version_info >= (3, 4): + DefaultVerifyPaths = NamedTuple('DefaultVerifyPaths', + [('cafile', str), ('capath', str), + ('openssl_cafile_env', str), + ('openssl_cafile', str), + ('openssl_capath_env', str), + ('openssl_capath', str)]) + def get_default_verify_paths() -> DefaultVerifyPaths: ... + +if sys.platform == 'win32': + if sys.version_info < (3,) or sys.version_info >= (3, 4): + def enum_certificates(store_name: str) -> _EnumRetType: ... + def enum_crls(store_name: str) -> _EnumRetType: ... + + +CERT_NONE: int +CERT_OPTIONAL: int +CERT_REQUIRED: int + +if sys.version_info < (3,) or sys.version_info >= (3, 4): + VERIFY_DEFAULT: int + VERIFY_CRL_CHECK_LEAF: int + VERIFY_CRL_CHECK_CHAIN: int + VERIFY_X509_STRICT: int + VERIFY_X509_TRUSTED_FIRST: int + +PROTOCOL_SSLv23: int +PROTOCOL_SSLv2: int +PROTOCOL_SSLv3: int +PROTOCOL_TLSv1: int +if sys.version_info < (3,) or sys.version_info >= (3, 4): + PROTOCOL_TLSv1_1: int + PROTOCOL_TLSv1_2: int +if sys.version_info >= (3, 5): + PROTOCOL_TLS: int +if sys.version_info >= (3, 6): + PROTOCOL_TLS_CLIENT: int + PROTOCOL_TLS_SERVER: int + +OP_ALL: int +OP_NO_SSLv2: int +OP_NO_SSLv3: int +OP_NO_TLSv1: int +if sys.version_info < (3,) or sys.version_info >= (3, 4): + OP_NO_TLSv1_1: int + OP_NO_TLSv1_2: int +OP_CIPHER_SERVER_PREFERENCE: int +OP_SINGLE_DH_USE: int +OP_SINGLE_ECDH_USE: int +OP_NO_COMPRESSION: int +if sys.version_info >= (3, 6): + OP_NO_TICKET: int + +if sys.version_info < (3,) or sys.version_info >= (3, 5): + HAS_ALPN: int +HAS_ECDH: bool +HAS_SNI: bool +HAS_NPN: bool +CHANNEL_BINDING_TYPES: List[str] + +OPENSSL_VERSION: str +OPENSSL_VERSION_INFO: Tuple[int, int, int, int, int] +OPENSSL_VERSION_NUMBER: int + +if sys.version_info < (3,) or sys.version_info >= (3, 4): + ALERT_DESCRIPTION_HANDSHAKE_FAILURE: int + ALERT_DESCRIPTION_INTERNAL_ERROR: int + ALERT_DESCRIPTION_ACCESS_DENIED: int + ALERT_DESCRIPTION_BAD_CERTIFICATE: int + ALERT_DESCRIPTION_BAD_CERTIFICATE_HASH_VALUE: int + ALERT_DESCRIPTION_BAD_CERTIFICATE_STATUS_RESPONSE: int + ALERT_DESCRIPTION_BAD_RECORD_MAC: int + ALERT_DESCRIPTION_CERTIFICATE_EXPIRED: int + ALERT_DESCRIPTION_CERTIFICATE_REVOKED: int + ALERT_DESCRIPTION_CERTIFICATE_UNKNOWN: int + ALERT_DESCRIPTION_CERTIFICATE_UNOBTAINABLE: int + ALERT_DESCRIPTION_CLOSE_NOTIFY: int + ALERT_DESCRIPTION_DECODE_ERROR: int + ALERT_DESCRIPTION_DECOMPRESSION_FAILURE: int + ALERT_DESCRIPTION_DECRYPT_ERROR: int + ALERT_DESCRIPTION_ILLEGAL_PARAMETER: int + ALERT_DESCRIPTION_INSUFFICIENT_SECURITY: int + ALERT_DESCRIPTION_NO_RENEGOTIATION: int + ALERT_DESCRIPTION_PROTOCOL_VERSION: int + ALERT_DESCRIPTION_RECORD_OVERFLOW: int + ALERT_DESCRIPTION_UNEXPECTED_MESSAGE: int + ALERT_DESCRIPTION_UNKNOWN_CA: int + ALERT_DESCRIPTION_UNKNOWN_PSK_IDENTITY: int + ALERT_DESCRIPTION_UNRECOGNIZED_NAME: int + ALERT_DESCRIPTION_UNSUPPORTED_CERTIFICATE: int + ALERT_DESCRIPTION_UNSUPPORTED_EXTENSION: int + ALERT_DESCRIPTION_USER_CANCELLED: int + +if sys.version_info < (3,) or sys.version_info >= (3, 4): + _PurposeType = NamedTuple('_PurposeType', [('nid', int), ('shortname', str), ('longname', str), ('oid', str)]) + class Purpose: + SERVER_AUTH: _PurposeType + CLIENT_AUTH: _PurposeType + + +class SSLSocket(socket.socket): + context: SSLContext + server_side: bool + server_hostname: Optional[str] + if sys.version_info >= (3, 6): + session: Optional[SSLSession] + session_reused: Optional[bool] + + def read(self, len: int = ..., + buffer: Optional[bytearray] = ...) -> bytes: ... + def write(self, buf: bytes) -> int: ... + def do_handshake(self) -> None: ... + def getpeercert(self, binary_form: bool = ...) -> _PeerCertRetType: ... + def cipher(self) -> Tuple[str, int, int]: ... + if sys.version_info >= (3, 5): + def shared_cipher(self) -> Optional[List[Tuple[str, int, int]]]: ... + def compression(self) -> Optional[str]: ... + def get_channel_binding(self, cb_type: str = ...) -> Optional[bytes]: ... + if sys.version_info < (3,) or sys.version_info >= (3, 5): + def selected_alpn_protocol(self) -> Optional[str]: ... + def selected_npn_protocol(self) -> Optional[str]: ... + def unwrap(self) -> socket.socket: ... + if sys.version_info < (3,) or sys.version_info >= (3, 5): + def version(self) -> Optional[str]: ... + def pending(self) -> int: ... + + +class SSLContext: + if sys.version_info < (3,) or sys.version_info >= (3, 4): + check_hostname: bool + options: int + @property + def protocol(self) -> int: ... + if sys.version_info < (3,) or sys.version_info >= (3, 4): + verify_flags: int + verify_mode: int + if sys.version_info >= (3, 5): + def __init__(self, protocol: int = ...) -> None: ... + else: + def __init__(self, protocol: int) -> None: ... + if sys.version_info < (3,) or sys.version_info >= (3, 4): + def cert_store_stats(self) -> Dict[str, int]: ... + def load_cert_chain(self, certfile: str, keyfile: Optional[str] = ..., + password: _PasswordType = ...) -> None: ... + if sys.version_info < (3,) or sys.version_info >= (3, 4): + def load_default_certs(self, purpose: _PurposeType = ...) -> None: ... + def load_verify_locations(self, cafile: Optional[str] = ..., + capath: Optional[str] = ..., + cadata: Union[str, bytes, None] = ...) -> None: ... + def get_ca_certs(self, + binary_form: bool = ...) -> Union[List[_PeerCertRetDictType], List[bytes]]: ... + else: + def load_verify_locations(self, + cafile: Optional[str] = ..., + capath: Optional[str] = ...) -> None: ... + def set_default_verify_paths(self) -> None: ... + def set_ciphers(self, ciphers: str) -> None: ... + if sys.version_info < (3,) or sys.version_info >= (3, 5): + def set_alpn_protocols(self, protocols: List[str]) -> None: ... + def set_npn_protocols(self, protocols: List[str]) -> None: ... + def set_servername_callback(self, + server_name_callback: Optional[_SrvnmeCbType]) -> None: ... + def load_dh_params(self, dhfile: str) -> None: ... + def set_ecdh_curve(self, curve_name: str) -> None: ... + def wrap_socket(self, sock: socket.socket, server_side: bool = ..., + do_handshake_on_connect: bool = ..., + suppress_ragged_eofs: bool = ..., + server_hostname: Optional[str] = ...) -> SSLSocket: ... + if sys.version_info >= (3, 5): + def wrap_bio(self, incoming: MemoryBIO, outgoing: MemoryBIO, + server_side: bool = ..., + server_hostname: Optional[str] = ...) -> SSLObject: ... + def session_stats(self) -> Dict[str, int]: ... + + +if sys.version_info >= (3, 5): + class SSLObject: + context: SSLContext + server_side: bool + server_hostname: Optional[str] + if sys.version_info >= (3, 6): + session: Optional[SSLSession] + session_reused: bool + def read(self, len: int = ..., + buffer: Optional[bytearray] = ...) -> bytes: ... + def write(self, buf: bytes) -> int: ... + def getpeercert(self, binary_form: bool = ...) -> _PeerCertRetType: ... + def selected_npn_protocol(self) -> Optional[str]: ... + def cipher(self) -> Tuple[str, int, int]: ... + def shared_cipher(self) -> Optional[List[Tuple[str, int, int]]]: ... + def compression(self) -> Optional[str]: ... + def pending(self) -> int: ... + def do_handshake(self) -> None: ... + def unwrap(self) -> None: ... + def get_channel_binding(self, cb_type: str = ...) -> Optional[bytes]: ... + + class MemoryBIO: + pending: int + eof: bool + def read(self, n: int = ...) -> bytes: ... + def write(self, buf: bytes) -> int: ... + def write_eof(self) -> None: ... + +if sys.version_info >= (3, 6): + class SSLSession: + id: bytes + time: int + timeout: int + ticket_lifetime_hint: int + has_ticket: bool + + +# TODO below documented in cpython but not in docs.python.org +# taken from python 3.4 +SSL_ERROR_EOF: int +SSL_ERROR_INVALID_ERROR_CODE: int +SSL_ERROR_SSL: int +SSL_ERROR_SYSCALL: int +SSL_ERROR_WANT_CONNECT: int +SSL_ERROR_WANT_READ: int +SSL_ERROR_WANT_WRITE: int +SSL_ERROR_WANT_X509_LOOKUP: int +SSL_ERROR_ZERO_RETURN: int + +def get_protocol_name(protocol_code: int) -> str: ... + +AF_INET: int +PEM_FOOTER: str +PEM_HEADER: str +SOCK_STREAM: int +SOL_SOCKET: int +SO_TYPE: int diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/stringprep.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/stringprep.pyi new file mode 100644 index 0000000..e3b7e9d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/stringprep.pyi @@ -0,0 +1,23 @@ +# Stubs for stringprep (Python 2 and 3) + +from typing import Text + +def in_table_a1(code: Text) -> bool: ... +def in_table_b1(code: Text) -> bool: ... +def map_table_b3(code: Text) -> Text: ... +def map_table_b2(a: Text) -> Text: ... +def in_table_c11(code: Text) -> bool: ... +def in_table_c12(code: Text) -> bool: ... +def in_table_c11_c12(code: Text) -> bool: ... +def in_table_c21(code: Text) -> bool: ... +def in_table_c22(code: Text) -> bool: ... +def in_table_c21_c22(code: Text) -> bool: ... +def in_table_c3(code: Text) -> bool: ... +def in_table_c4(code: Text) -> bool: ... +def in_table_c5(code: Text) -> bool: ... +def in_table_c6(code: Text) -> bool: ... +def in_table_c7(code: Text) -> bool: ... +def in_table_c8(code: Text) -> bool: ... +def in_table_c9(code: Text) -> bool: ... +def in_table_d1(code: Text) -> bool: ... +def in_table_d2(code: Text) -> bool: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/struct.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/struct.pyi new file mode 100644 index 0000000..552ee22 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/struct.pyi @@ -0,0 +1,44 @@ +# Stubs for struct + +# Based on http://docs.python.org/3.2/library/struct.html +# Based on http://docs.python.org/2/library/struct.html + +import sys +from typing import Any, Tuple, Text, Union, Iterator +from array import array +from mmap import mmap + +class error(Exception): ... + +_FmtType = Union[bytes, Text] +if sys.version_info >= (3,): + _BufferType = Union[array[int], bytes, bytearray, memoryview, mmap] + _WriteBufferType = Union[array, bytearray, memoryview, mmap] +else: + _BufferType = Union[array[int], bytes, bytearray, buffer, memoryview, mmap] + _WriteBufferType = Union[array[Any], bytearray, buffer, memoryview, mmap] + +def pack(fmt: _FmtType, *v: Any) -> bytes: ... +def pack_into(fmt: _FmtType, buffer: _WriteBufferType, offset: int, *v: Any) -> None: ... +def unpack(fmt: _FmtType, buffer: _BufferType) -> Tuple[Any, ...]: ... +def unpack_from(fmt: _FmtType, buffer: _BufferType, offset: int = ...) -> Tuple[Any, ...]: ... +if sys.version_info >= (3, 4): + def iter_unpack(fmt: _FmtType, buffer: _BufferType) -> Iterator[Tuple[Any, ...]]: ... + +def calcsize(fmt: _FmtType) -> int: ... + +class Struct: + if sys.version_info >= (3, 7): + format: str + else: + format: bytes + size: int + + def __init__(self, format: _FmtType) -> None: ... + + def pack(self, *v: Any) -> bytes: ... + def pack_into(self, buffer: _WriteBufferType, offset: int, *v: Any) -> None: ... + def unpack(self, buffer: _BufferType) -> Tuple[Any, ...]: ... + def unpack_from(self, buffer: _BufferType, offset: int = ...) -> Tuple[Any, ...]: ... + if sys.version_info >= (3, 4): + def iter_unpack(self, buffer: _BufferType) -> Iterator[Tuple[Any, ...]]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/sunau.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/sunau.pyi new file mode 100644 index 0000000..6577c31 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/sunau.pyi @@ -0,0 +1,87 @@ +# Stubs for sunau (Python 2 and 3) + +import sys +from typing import Any, NamedTuple, NoReturn, Optional, Text, IO, Union, Tuple + +_File = Union[Text, IO[bytes]] + +class Error(Exception): ... + +AUDIO_FILE_MAGIC: int +AUDIO_FILE_ENCODING_MULAW_8: int +AUDIO_FILE_ENCODING_LINEAR_8: int +AUDIO_FILE_ENCODING_LINEAR_16: int +AUDIO_FILE_ENCODING_LINEAR_24: int +AUDIO_FILE_ENCODING_LINEAR_32: int +AUDIO_FILE_ENCODING_FLOAT: int +AUDIO_FILE_ENCODING_DOUBLE: int +AUDIO_FILE_ENCODING_ADPCM_G721: int +AUDIO_FILE_ENCODING_ADPCM_G722: int +AUDIO_FILE_ENCODING_ADPCM_G723_3: int +AUDIO_FILE_ENCODING_ADPCM_G723_5: int +AUDIO_FILE_ENCODING_ALAW_8: int +AUDIO_UNKNOWN_SIZE: int + +if sys.version_info < (3, 0): + _sunau_params = Tuple[int, int, int, int, str, str] +else: + _sunau_params = NamedTuple('_sunau_params', [ + ('nchannels', int), + ('sampwidth', int), + ('framerate', int), + ('nframes', int), + ('comptype', str), + ('compname', str), + ]) + +class Au_read: + def __init__(self, f: _File) -> None: ... + if sys.version_info >= (3, 3): + def __enter__(self) -> Au_read: ... + def __exit__(self, *args: Any) -> None: ... + def getfp(self) -> Optional[IO[bytes]]: ... + def rewind(self) -> None: ... + def close(self) -> None: ... + def tell(self) -> int: ... + def getnchannels(self) -> int: ... + def getnframes(self) -> int: ... + def getsampwidth(self) -> int: ... + def getframerate(self) -> int: ... + def getcomptype(self) -> str: ... + def getcompname(self) -> str: ... + def getparams(self) -> _sunau_params: ... + def getmarkers(self) -> None: ... + def getmark(self, id: Any) -> NoReturn: ... + def setpos(self, pos: int) -> None: ... + def readframes(self, nframes: int) -> Optional[bytes]: ... + +class Au_write: + def __init__(self, f: _File) -> None: ... + if sys.version_info >= (3, 3): + def __enter__(self) -> Au_write: ... + def __exit__(self, *args: Any) -> None: ... + def setnchannels(self, nchannels: int) -> None: ... + def getnchannels(self) -> int: ... + def setsampwidth(self, sampwidth: int) -> None: ... + def getsampwidth(self) -> int: ... + def setframerate(self, framerate: float) -> None: ... + def getframerate(self) -> int: ... + def setnframes(self, nframes: int) -> None: ... + def getnframes(self) -> int: ... + def setcomptype(self, comptype: str, compname: str) -> None: ... + def getcomptype(self) -> str: ... + def getcompname(self) -> str: ... + def setparams(self, params: _sunau_params) -> None: ... + def getparams(self) -> _sunau_params: ... + def setmark(self, id: Any, pos: Any, name: Any) -> NoReturn: ... + def getmark(self, id: Any) -> NoReturn: ... + def getmarkers(self) -> None: ... + def tell(self) -> int: ... + # should be any bytes-like object after 3.4, but we don't have a type for that + def writeframesraw(self, data: bytes) -> None: ... + def writeframes(self, data: bytes) -> None: ... + def close(self) -> None: ... + +# Returns a Au_read if mode is rb and Au_write if mode is wb +def open(f: _File, mode: Optional[str] = ...) -> Any: ... +openfp = open diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/symtable.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/symtable.pyi new file mode 100644 index 0000000..fd8b9ad --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/symtable.pyi @@ -0,0 +1,45 @@ +import sys +from typing import List, Sequence, Tuple, Text + +def symtable(code: Text, filename: Text, compile_type: Text) -> SymbolTable: ... + +class SymbolTable(object): + def get_type(self) -> str: ... + def get_id(self) -> int: ... + def get_name(self) -> str: ... + def get_lineno(self) -> int: ... + def is_optimized(self) -> bool: ... + def is_nested(self) -> bool: ... + def has_children(self) -> bool: ... + def has_exec(self) -> bool: ... + if sys.version_info < (3, 0): + def has_import_star(self) -> bool: ... + def get_identifiers(self) -> Sequence[str]: ... + def lookup(self, name: str) -> Symbol: ... + def get_symbols(self) -> List[Symbol]: ... + def get_children(self) -> List[SymbolTable]: ... + +class Function(SymbolTable): + def get_parameters(self) -> Tuple[str, ...]: ... + def get_locals(self) -> Tuple[str, ...]: ... + def get_globals(self) -> Tuple[str, ...]: ... + def get_frees(self) -> Tuple[str, ...]: ... + +class Class(SymbolTable): + def get_methods(self) -> Tuple[str, ...]: ... + +class Symbol(object): + def get_name(self) -> str: ... + def is_referenced(self) -> bool: ... + def is_parameter(self) -> bool: ... + def is_global(self) -> bool: ... + def is_declared_global(self) -> bool: ... + def is_local(self) -> bool: ... + if sys.version_info >= (3, 6): + def is_annotated(self) -> bool: ... + def is_free(self) -> bool: ... + def is_imported(self) -> bool: ... + def is_assigned(self) -> bool: ... + def is_namespace(self) -> bool: ... + def get_namespaces(self) -> Sequence[SymbolTable]: ... + def get_namespace(self) -> SymbolTable: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/sysconfig.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/sysconfig.pyi new file mode 100644 index 0000000..5d6c9cb --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/sysconfig.pyi @@ -0,0 +1,19 @@ +# Stubs for sysconfig + +from typing import overload, Any, Dict, IO, List, Optional, Tuple, Union + +@overload +def get_config_vars() -> Dict[str, Any]: ... +@overload +def get_config_vars(arg: str, *args: str) -> List[Any]: ... +def get_config_var(name: str) -> Optional[str]: ... +def get_scheme_names() -> Tuple[str, ...]: ... +def get_path_names() -> Tuple[str, ...]: ... +def get_path(name: str, scheme: str = ..., vars: Optional[Dict[str, Any]] = ..., expand: bool = ...) -> Optional[str]: ... +def get_paths(scheme: str = ..., vars: Optional[Dict[str, Any]] = ..., expand: bool = ...) -> Dict[str, str]: ... +def get_python_version() -> str: ... +def get_platform() -> str: ... +def is_python_build() -> bool: ... +def parse_config_h(fp: IO[Any], vars: Optional[Dict[str, Any]]) -> Dict[str, Any]: ... +def get_config_h_filename() -> str: ... +def get_makefile_filename() -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/syslog.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/syslog.pyi new file mode 100644 index 0000000..1237a6b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/syslog.pyi @@ -0,0 +1,44 @@ +from typing import overload + +LOG_ALERT: int +LOG_AUTH: int +LOG_CONS: int +LOG_CRIT: int +LOG_CRON: int +LOG_DAEMON: int +LOG_DEBUG: int +LOG_EMERG: int +LOG_ERR: int +LOG_INFO: int +LOG_KERN: int +LOG_LOCAL0: int +LOG_LOCAL1: int +LOG_LOCAL2: int +LOG_LOCAL3: int +LOG_LOCAL4: int +LOG_LOCAL5: int +LOG_LOCAL6: int +LOG_LOCAL7: int +LOG_LPR: int +LOG_MAIL: int +LOG_NDELAY: int +LOG_NEWS: int +LOG_NOTICE: int +LOG_NOWAIT: int +LOG_PERROR: int +LOG_PID: int +LOG_SYSLOG: int +LOG_USER: int +LOG_UUCP: int +LOG_WARNING: int + +def LOG_MASK(a: int) -> int: ... +def LOG_UPTO(a: int) -> int: ... +def closelog() -> None: ... +def openlog(ident: str = ..., logoption: int = ..., facility: int = ...) -> None: ... +def setlogmask(x: int) -> int: ... + +@overload +def syslog(priority: int, message: str) -> None: ... +@overload +def syslog(message: str) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/tabnanny.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/tabnanny.pyi new file mode 100644 index 0000000..cbc8353 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/tabnanny.pyi @@ -0,0 +1,22 @@ +# Stubs for tabnanny (Python 2 and 3) + +import os +import sys +from typing import Iterable, Tuple, Union + +if sys.version_info >= (3, 6): + _Path = Union[str, bytes, os.PathLike] +else: + _Path = Union[str, bytes] + +verbose: int +filename_only: int + +class NannyNag(Exception): + def __init__(self, lineno: int, msg: str, line: str) -> None: ... + def get_lineno(self) -> int: ... + def get_msg(self) -> str: ... + def get_line(self) -> str: ... + +def check(file: _Path) -> None: ... +def process_tokens(tokens: Iterable[Tuple[int, str, Tuple[int, int], Tuple[int, int], str]]) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/tarfile.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/tarfile.pyi new file mode 100644 index 0000000..f598494 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/tarfile.pyi @@ -0,0 +1,189 @@ +# Stubs for tarfile + +from typing import ( + Callable, IO, Iterable, Iterator, List, Mapping, Optional, Type, + Union, +) +import os +import sys +from types import TracebackType + +if sys.version_info >= (3, 6): + _Path = Union[bytes, str, os.PathLike] +elif sys.version_info >= (3,): + _Path = Union[bytes, str] +else: + _Path = Union[str, unicode] + +ENCODING: str + +USTAR_FORMAT: int +GNU_FORMAT: int +PAX_FORMAT: int +DEFAULT_FORMAT: int + +REGTYPE: bytes +AREGTYPE: bytes +LNKTYPE: bytes +SYMTYPE: bytes +DIRTYPE: bytes +FIFOTYPE: bytes +CONTTYPE: bytes +CHRTYPE: bytes +BLKTYPE: bytes +GNUTYPE_SPARSE: bytes + +if sys.version_info < (3,): + TAR_PLAIN: int + TAR_GZIPPED: int + +def open(name: Optional[_Path] = ..., mode: str = ..., + fileobj: Optional[IO[bytes]] = ..., bufsize: int = ..., + *, format: Optional[int] = ..., tarinfo: Optional[TarInfo] = ..., + dereference: Optional[bool] = ..., + ignore_zeros: Optional[bool] = ..., + encoding: Optional[str] = ..., errors: str = ..., + pax_headers: Optional[Mapping[str, str]] = ..., + debug: Optional[int] = ..., + errorlevel: Optional[int] = ..., + compresslevel: Optional[int] = ...) -> TarFile: ... + +class TarFile(Iterable[TarInfo]): + name: Optional[_Path] + mode: str + fileobj: Optional[IO[bytes]] + format: Optional[int] + tarinfo: Optional[TarInfo] + dereference: Optional[bool] + ignore_zeros: Optional[bool] + encoding: Optional[str] + errors: str + pax_headers: Optional[Mapping[str, str]] + debug: Optional[int] + errorlevel: Optional[int] + if sys.version_info < (3,): + posix: bool + def __init__(self, name: Optional[_Path] = ..., mode: str = ..., + fileobj: Optional[IO[bytes]] = ..., + format: Optional[int] = ..., tarinfo: Optional[TarInfo] = ..., + dereference: Optional[bool] = ..., + ignore_zeros: Optional[bool] = ..., + encoding: Optional[str] = ..., errors: str = ..., + pax_headers: Optional[Mapping[str, str]] = ..., + debug: Optional[int] = ..., + errorlevel: Optional[int] = ..., + compresslevel: Optional[int] = ...) -> None: ... + def __enter__(self) -> TarFile: ... + def __exit__(self, + exc_type: Optional[Type[BaseException]], + exc_val: Optional[BaseException], + exc_tb: Optional[TracebackType]) -> bool: ... + def __iter__(self) -> Iterator[TarInfo]: ... + @classmethod + def open(cls, name: Optional[_Path] = ..., mode: str = ..., + fileobj: Optional[IO[bytes]] = ..., bufsize: int = ..., + *, format: Optional[int] = ..., tarinfo: Optional[TarInfo] = ..., + dereference: Optional[bool] = ..., + ignore_zeros: Optional[bool] = ..., + encoding: Optional[str] = ..., errors: str = ..., + pax_headers: Optional[Mapping[str, str]] = ..., + debug: Optional[int] = ..., + errorlevel: Optional[int] = ...) -> TarFile: ... + def getmember(self, name: str) -> TarInfo: ... + def getmembers(self) -> List[TarInfo]: ... + def getnames(self) -> List[str]: ... + if sys.version_info >= (3, 5): + def list(self, verbose: bool = ..., + *, members: Optional[List[TarInfo]] = ...) -> None: ... + else: + def list(self, verbose: bool = ...) -> None: ... + def next(self) -> Optional[TarInfo]: ... + if sys.version_info >= (3, 5): + def extractall(self, path: _Path = ..., + members: Optional[List[TarInfo]] = ..., + *, numeric_owner: bool = ...) -> None: ... + else: + def extractall(self, path: _Path = ..., + members: Optional[List[TarInfo]] = ...) -> None: ... + if sys.version_info >= (3, 5): + def extract(self, member: Union[str, TarInfo], path: _Path = ..., + set_attrs: bool = ..., + *, numeric_owner: bool = ...) -> None: ... + elif sys.version_info >= (3,): + def extract(self, member: Union[str, TarInfo], path: _Path = ..., + set_attrs: bool = ...) -> None: ... + else: + def extract(self, member: Union[str, TarInfo], + path: _Path = ...) -> None: ... + def extractfile(self, + member: Union[str, TarInfo]) -> Optional[IO[bytes]]: ... + if sys.version_info >= (3, 7): + def add(self, name: str, arcname: Optional[str] = ..., + recursive: bool = ..., *, + filter: Optional[Callable[[TarInfo], Optional[TarInfo]]] = ...) -> None: ... + elif sys.version_info >= (3,): + def add(self, name: str, arcname: Optional[str] = ..., + recursive: bool = ..., + exclude: Optional[Callable[[str], bool]] = ..., *, + filter: Optional[Callable[[TarInfo], Optional[TarInfo]]] = ...) -> None: ... + else: + def add(self, name: str, arcname: Optional[str] = ..., + recursive: bool = ..., + exclude: Optional[Callable[[str], bool]] = ..., + filter: Optional[Callable[[TarInfo], Optional[TarInfo]]] = ...) -> None: ... + def addfile(self, tarinfo: TarInfo, + fileobj: Optional[IO[bytes]] = ...) -> None: ... + def gettarinfo(self, name: Optional[str] = ..., + arcname: Optional[str] = ..., + fileobj: Optional[IO[bytes]] = ...) -> TarInfo: ... + def close(self) -> None: ... + +def is_tarfile(name: str) -> bool: ... + +if sys.version_info < (3, 8): + def filemode(mode: int) -> str: ... # undocumented + +if sys.version_info < (3,): + class TarFileCompat: + def __init__(self, filename: str, mode: str = ..., + compression: int = ...) -> None: ... + +class TarError(Exception): ... +class ReadError(TarError): ... +class CompressionError(TarError): ... +class StreamError(TarError): ... +class ExtractError(TarError): ... +class HeaderError(TarError): ... + +class TarInfo: + name: str + size: int + mtime: int + mode: int + type: bytes + linkname: str + uid: int + gid: int + uname: str + gname: str + pax_headers: Mapping[str, str] + def __init__(self, name: str = ...) -> None: ... + if sys.version_info >= (3,): + @classmethod + def frombuf(cls, buf: bytes, encoding: str, errors: str) -> TarInfo: ... + else: + @classmethod + def frombuf(cls, buf: bytes) -> TarInfo: ... + @classmethod + def fromtarfile(cls, tarfile: TarFile) -> TarInfo: ... + def tobuf(self, format: Optional[int] = ..., + encoding: Optional[str] = ..., errors: str = ...) -> bytes: ... + def isfile(self) -> bool: ... + def isreg(self) -> bool: ... + def isdir(self) -> bool: ... + def issym(self) -> bool: ... + def islnk(self) -> bool: ... + def ischr(self) -> bool: ... + def isblk(self) -> bool: ... + def isfifo(self) -> bool: ... + def isdev(self) -> bool: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/telnetlib.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/telnetlib.pyi new file mode 100644 index 0000000..50b90b5 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/telnetlib.pyi @@ -0,0 +1,115 @@ +# Stubs for telnetlib (Python 2 and 3) + +import socket +import sys +from typing import Any, Callable, Match, Optional, Pattern, Sequence, Tuple, Union + +DEBUGLEVEL: int +TELNET_PORT: int + +IAC: bytes +DONT: bytes +DO: bytes +WONT: bytes +WILL: bytes +theNULL: bytes + +SE: bytes +NOP: bytes +DM: bytes +BRK: bytes +IP: bytes +AO: bytes +AYT: bytes +EC: bytes +EL: bytes +GA: bytes +SB: bytes + +BINARY: bytes +ECHO: bytes +RCP: bytes +SGA: bytes +NAMS: bytes +STATUS: bytes +TM: bytes +RCTE: bytes +NAOL: bytes +NAOP: bytes +NAOCRD: bytes +NAOHTS: bytes +NAOHTD: bytes +NAOFFD: bytes +NAOVTS: bytes +NAOVTD: bytes +NAOLFD: bytes +XASCII: bytes +LOGOUT: bytes +BM: bytes +DET: bytes +SUPDUP: bytes +SUPDUPOUTPUT: bytes +SNDLOC: bytes +TTYPE: bytes +EOR: bytes +TUID: bytes +OUTMRK: bytes +TTYLOC: bytes +VT3270REGIME: bytes +X3PAD: bytes +NAWS: bytes +TSPEED: bytes +LFLOW: bytes +LINEMODE: bytes +XDISPLOC: bytes +OLD_ENVIRON: bytes +AUTHENTICATION: bytes +ENCRYPT: bytes +NEW_ENVIRON: bytes + +TN3270E: bytes +XAUTH: bytes +CHARSET: bytes +RSP: bytes +COM_PORT_OPTION: bytes +SUPPRESS_LOCAL_ECHO: bytes +TLS: bytes +KERMIT: bytes +SEND_URL: bytes +FORWARD_X: bytes +PRAGMA_LOGON: bytes +SSPI_LOGON: bytes +PRAGMA_HEARTBEAT: bytes +EXOPL: bytes +NOOPT: bytes + +class Telnet: + def __init__(self, host: Optional[str] = ..., port: int = ..., + timeout: int = ...) -> None: ... + def open(self, host: str, port: int = ..., timeout: int = ...) -> None: ... + def msg(self, msg: str, *args: Any) -> None: ... + def set_debuglevel(self, debuglevel: int) -> None: ... + def close(self) -> None: ... + def get_socket(self) -> socket.socket: ... + def fileno(self) -> int: ... + def write(self, buffer: bytes) -> None: ... + def read_until(self, match: bytes, timeout: Optional[int] = ...) -> bytes: ... + def read_all(self) -> bytes: ... + def read_some(self) -> bytes: ... + def read_very_eager(self) -> bytes: ... + def read_eager(self) -> bytes: ... + def read_lazy(self) -> bytes: ... + def read_very_lazy(self) -> bytes: ... + def read_sb_data(self) -> bytes: ... + def set_option_negotiation_callback(self, callback: Optional[Callable[[socket.socket, bytes, bytes], Any]]) -> None: ... + def process_rawq(self) -> None: ... + def rawq_getchar(self) -> bytes: ... + def fill_rawq(self) -> None: ... + def sock_avail(self) -> bool: ... + def interact(self) -> None: ... + def mt_interact(self) -> None: ... + def listener(self) -> None: ... + def expect(self, list: Sequence[Union[Pattern[bytes], bytes]], timeout: Optional[int] = ...) -> Tuple[int, Optional[Match[bytes]], bytes]: ... + if sys.version_info >= (3, 6): + def __enter__(self) -> Telnet: ... + def __exit__(self, type: Any, value: Any, traceback: Any) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/termios.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/termios.pyi new file mode 100644 index 0000000..d788e16 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/termios.pyi @@ -0,0 +1,248 @@ +# Stubs for termios + +from typing import IO, List, Union + +_FD = Union[int, IO[str]] +_Attr = List[Union[int, List[bytes]]] + +# TODO constants not really documented +B0: int +B1000000: int +B110: int +B115200: int +B1152000: int +B1200: int +B134: int +B150: int +B1500000: int +B1800: int +B19200: int +B200: int +B2000000: int +B230400: int +B2400: int +B2500000: int +B300: int +B3000000: int +B3500000: int +B38400: int +B4000000: int +B460800: int +B4800: int +B50: int +B500000: int +B57600: int +B576000: int +B600: int +B75: int +B921600: int +B9600: int +BRKINT: int +BS0: int +BS1: int +BSDLY: int +CBAUD: int +CBAUDEX: int +CDSUSP: int +CEOF: int +CEOL: int +CEOT: int +CERASE: int +CFLUSH: int +CIBAUD: int +CINTR: int +CKILL: int +CLNEXT: int +CLOCAL: int +CQUIT: int +CR0: int +CR1: int +CR2: int +CR3: int +CRDLY: int +CREAD: int +CRPRNT: int +CRTSCTS: int +CS5: int +CS6: int +CS7: int +CS8: int +CSIZE: int +CSTART: int +CSTOP: int +CSTOPB: int +CSUSP: int +CWERASE: int +ECHO: int +ECHOCTL: int +ECHOE: int +ECHOK: int +ECHOKE: int +ECHONL: int +ECHOPRT: int +EXTA: int +EXTB: int +FF0: int +FF1: int +FFDLY: int +FIOASYNC: int +FIOCLEX: int +FIONBIO: int +FIONCLEX: int +FIONREAD: int +FLUSHO: int +HUPCL: int +ICANON: int +ICRNL: int +IEXTEN: int +IGNBRK: int +IGNCR: int +IGNPAR: int +IMAXBEL: int +INLCR: int +INPCK: int +IOCSIZE_MASK: int +IOCSIZE_SHIFT: int +ISIG: int +ISTRIP: int +IUCLC: int +IXANY: int +IXOFF: int +IXON: int +NCC: int +NCCS: int +NL0: int +NL1: int +NLDLY: int +NOFLSH: int +N_MOUSE: int +N_PPP: int +N_SLIP: int +N_STRIP: int +N_TTY: int +OCRNL: int +OFDEL: int +OFILL: int +OLCUC: int +ONLCR: int +ONLRET: int +ONOCR: int +OPOST: int +PARENB: int +PARMRK: int +PARODD: int +PENDIN: int +TAB0: int +TAB1: int +TAB2: int +TAB3: int +TABDLY: int +TCFLSH: int +TCGETA: int +TCGETS: int +TCIFLUSH: int +TCIOFF: int +TCIOFLUSH: int +TCION: int +TCOFLUSH: int +TCOOFF: int +TCOON: int +TCSADRAIN: int +TCSAFLUSH: int +TCSANOW: int +TCSBRK: int +TCSBRKP: int +TCSETA: int +TCSETAF: int +TCSETAW: int +TCSETS: int +TCSETSF: int +TCSETSW: int +TCXONC: int +TIOCCONS: int +TIOCEXCL: int +TIOCGETD: int +TIOCGICOUNT: int +TIOCGLCKTRMIOS: int +TIOCGPGRP: int +TIOCGSERIAL: int +TIOCGSOFTCAR: int +TIOCGWINSZ: int +TIOCINQ: int +TIOCLINUX: int +TIOCMBIC: int +TIOCMBIS: int +TIOCMGET: int +TIOCMIWAIT: int +TIOCMSET: int +TIOCM_CAR: int +TIOCM_CD: int +TIOCM_CTS: int +TIOCM_DSR: int +TIOCM_DTR: int +TIOCM_LE: int +TIOCM_RI: int +TIOCM_RNG: int +TIOCM_RTS: int +TIOCM_SR: int +TIOCM_ST: int +TIOCNOTTY: int +TIOCNXCL: int +TIOCOUTQ: int +TIOCPKT: int +TIOCPKT_DATA: int +TIOCPKT_DOSTOP: int +TIOCPKT_FLUSHREAD: int +TIOCPKT_FLUSHWRITE: int +TIOCPKT_NOSTOP: int +TIOCPKT_START: int +TIOCPKT_STOP: int +TIOCSCTTY: int +TIOCSERCONFIG: int +TIOCSERGETLSR: int +TIOCSERGETMULTI: int +TIOCSERGSTRUCT: int +TIOCSERGWILD: int +TIOCSERSETMULTI: int +TIOCSERSWILD: int +TIOCSER_TEMT: int +TIOCSETD: int +TIOCSLCKTRMIOS: int +TIOCSPGRP: int +TIOCSSERIAL: int +TIOCSSOFTCAR: int +TIOCSTI: int +TIOCSWINSZ: int +TOSTOP: int +VDISCARD: int +VEOF: int +VEOL: int +VEOL2: int +VERASE: int +VINTR: int +VKILL: int +VLNEXT: int +VMIN: int +VQUIT: int +VREPRINT: int +VSTART: int +VSTOP: int +VSUSP: int +VSWTC: int +VSWTCH: int +VT0: int +VT1: int +VTDLY: int +VTIME: int +VWERASE: int +XCASE: int +XTABS: int + +def tcgetattr(fd: _FD) -> _Attr: ... +def tcsetattr(fd: _FD, when: int, attributes: _Attr) -> None: ... +def tcsendbreak(fd: _FD, duration: int) -> None: ... +def tcdrain(fd: _FD) -> None: ... +def tcflush(fd: _FD, queue: int) -> None: ... +def tcflow(fd: _FD, action: int) -> None: ... + +class error(Exception): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/threading.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/threading.pyi new file mode 100644 index 0000000..3008f7b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/threading.pyi @@ -0,0 +1,187 @@ +# Stubs for threading + +from typing import ( + Any, Callable, Iterable, List, Mapping, Optional, Tuple, Type, Union, + TypeVar, +) +from types import FrameType, TracebackType +import sys + +# TODO recursive type +_TF = Callable[[FrameType, str, Any], Optional[Callable[..., Any]]] + +_PF = Callable[[FrameType, str, Any], None] +_T = TypeVar('_T') + + +def active_count() -> int: ... +if sys.version_info < (3,): + def activeCount() -> int: ... + +def current_thread() -> Thread: ... +def currentThread() -> Thread: ... + +if sys.version_info >= (3,): + def get_ident() -> int: ... + +def enumerate() -> List[Thread]: ... + +if sys.version_info >= (3, 4): + def main_thread() -> Thread: ... + +def settrace(func: _TF) -> None: ... +def setprofile(func: _PF) -> None: ... +def stack_size(size: int = ...) -> int: ... + +if sys.version_info >= (3,): + TIMEOUT_MAX: float + +class ThreadError(Exception): ... + + +class local(object): + def __getattribute__(self, name: str) -> Any: ... + def __setattr__(self, name: str, value: Any) -> None: ... + def __delattr__(self, name: str) -> None: ... + + +class Thread: + name: str + ident: Optional[int] + daemon: bool + if sys.version_info >= (3,): + def __init__(self, group: None = ..., + target: Optional[Callable[..., Any]] = ..., + name: Optional[str] = ..., + args: Iterable = ..., + kwargs: Mapping[str, Any] = ..., + *, daemon: Optional[bool] = ...) -> None: ... + else: + def __init__(self, group: None = ..., + target: Optional[Callable[..., Any]] = ..., + name: Optional[str] = ..., + args: Iterable = ..., + kwargs: Mapping[str, Any] = ...) -> None: ... + def start(self) -> None: ... + def run(self) -> None: ... + def join(self, timeout: Optional[float] = ...) -> None: ... + def getName(self) -> str: ... + def setName(self, name: str) -> None: ... + def is_alive(self) -> bool: ... + def isAlive(self) -> bool: ... + def isDaemon(self) -> bool: ... + def setDaemon(self, daemonic: bool) -> None: ... + + +class _DummyThread(Thread): ... + + +class Lock: + def __init__(self) -> None: ... + def __enter__(self) -> bool: ... + def __exit__(self, exc_type: Optional[Type[BaseException]], + exc_val: Optional[BaseException], + exc_tb: Optional[TracebackType]) -> bool: ... + if sys.version_info >= (3,): + def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ... + else: + def acquire(self, blocking: bool = ...) -> bool: ... + def release(self) -> None: ... + def locked(self) -> bool: ... + + +class _RLock: + def __init__(self) -> None: ... + def __enter__(self) -> bool: ... + def __exit__(self, exc_type: Optional[Type[BaseException]], + exc_val: Optional[BaseException], + exc_tb: Optional[TracebackType]) -> bool: ... + if sys.version_info >= (3,): + def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ... + else: + def acquire(self, blocking: bool = ...) -> bool: ... + def release(self) -> None: ... + + +RLock = _RLock + + +class Condition: + def __init__(self, lock: Union[Lock, _RLock, None] = ...) -> None: ... + def __enter__(self) -> bool: ... + def __exit__(self, exc_type: Optional[Type[BaseException]], + exc_val: Optional[BaseException], + exc_tb: Optional[TracebackType]) -> bool: ... + if sys.version_info >= (3,): + def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ... + else: + def acquire(self, blocking: bool = ...) -> bool: ... + def release(self) -> None: ... + def wait(self, timeout: Optional[float] = ...) -> bool: ... + if sys.version_info >= (3,): + def wait_for(self, predicate: Callable[[], _T], + timeout: Optional[float] = ...) -> _T: ... + def notify(self, n: int = ...) -> None: ... + def notify_all(self) -> None: ... + def notifyAll(self) -> None: ... + + +class Semaphore: + def __init__(self, value: int = ...) -> None: ... + def __enter__(self) -> bool: ... + def __exit__(self, exc_type: Optional[Type[BaseException]], + exc_val: Optional[BaseException], + exc_tb: Optional[TracebackType]) -> bool: ... + if sys.version_info >= (3,): + def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ... + else: + def acquire(self, blocking: bool = ...) -> bool: ... + def release(self) -> None: ... + +class BoundedSemaphore: + def __init__(self, value: int = ...) -> None: ... + def __enter__(self) -> bool: ... + def __exit__(self, exc_type: Optional[Type[BaseException]], + exc_val: Optional[BaseException], + exc_tb: Optional[TracebackType]) -> bool: ... + if sys.version_info >= (3,): + def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ... + else: + def acquire(self, blocking: bool = ...) -> bool: ... + def release(self) -> None: ... + + +class Event: + def __init__(self) -> None: ... + def is_set(self) -> bool: ... + if sys.version_info < (3,): + def isSet(self) -> bool: ... + def set(self) -> None: ... + def clear(self) -> None: ... + def wait(self, timeout: Optional[float] = ...) -> bool: ... + + +class Timer(Thread): + if sys.version_info >= (3,): + def __init__(self, interval: float, function: Callable[..., None], + args: Optional[List[Any]] = ..., + kwargs: Optional[Mapping[str, Any]] = ...) -> None: ... + else: + def __init__(self, interval: float, function: Callable[..., None], + args: List[Any] = ..., + kwargs: Mapping[str, Any] = ...) -> None: ... + def cancel(self) -> None: ... + + +if sys.version_info >= (3,): + class Barrier: + parties: int + n_waiting: int + broken: bool + def __init__(self, parties: int, action: Optional[Callable[[], None]] = ..., + timeout: Optional[float] = ...) -> None: ... + def wait(self, timeout: Optional[float] = ...) -> int: ... + def reset(self) -> None: ... + def abort(self) -> None: ... + + class BrokenBarrierError(RuntimeError): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/time.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/time.pyi new file mode 100644 index 0000000..b04e616 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/time.pyi @@ -0,0 +1,103 @@ +"""Stub file for the 'time' module.""" +# See https://docs.python.org/3/library/time.html + +import sys +from typing import Any, NamedTuple, Tuple, Union, Optional +if sys.version_info >= (3, 3): + from types import SimpleNamespace + +_TimeTuple = Tuple[int, int, int, int, int, int, int, int, int] + +if sys.version_info < (3, 3): + accept2dyear: bool +altzone: int +daylight: int +timezone: int +tzname: Tuple[str, str] + +if sys.version_info >= (3, 7) and sys.platform != 'win32': + CLOCK_BOOTTIME: int # Linux + CLOCK_PROF: int # FreeBSD, NetBSD, OpenBSD + CLOCK_UPTIME: int # FreeBSD, OpenBSD + +if sys.version_info >= (3, 3) and sys.platform != 'win32': + CLOCK_HIGHRES: int = ... # Solaris only + CLOCK_MONOTONIC: int = ... # Unix only + CLOCK_MONOTONIC_RAW: int = ... # Linux 2.6.28 or later + CLOCK_PROCESS_CPUTIME_ID: int = ... # Unix only + CLOCK_REALTIME: int = ... # Unix only + CLOCK_THREAD_CPUTIME_ID: int = ... # Unix only + + +if sys.version_info >= (3, 3): + class struct_time( + NamedTuple( + '_struct_time', + [('tm_year', int), ('tm_mon', int), ('tm_mday', int), + ('tm_hour', int), ('tm_min', int), ('tm_sec', int), + ('tm_wday', int), ('tm_yday', int), ('tm_isdst', int), + ('tm_zone', str), ('tm_gmtoff', int)] + ) + ): + def __init__( + self, + o: Union[ + Tuple[int, int, int, int, int, int, int, int, int], + Tuple[int, int, int, int, int, int, int, int, int, str], + Tuple[int, int, int, int, int, int, int, int, int, str, int] + ], + _arg: Any = ..., + ) -> None: ... + def __new__( + cls, + o: Union[ + Tuple[int, int, int, int, int, int, int, int, int], + Tuple[int, int, int, int, int, int, int, int, int, str], + Tuple[int, int, int, int, int, int, int, int, int, str, int] + ], + _arg: Any = ..., + ) -> struct_time: ... +else: + class struct_time( + NamedTuple( + '_struct_time', + [('tm_year', int), ('tm_mon', int), ('tm_mday', int), + ('tm_hour', int), ('tm_min', int), ('tm_sec', int), + ('tm_wday', int), ('tm_yday', int), ('tm_isdst', int)] + ) + ): + def __init__(self, o: _TimeTuple, _arg: Any = ...) -> None: ... + def __new__(cls, o: _TimeTuple, _arg: Any = ...) -> struct_time: ... + +def asctime(t: Union[_TimeTuple, struct_time] = ...) -> str: ... +def clock() -> float: ... +def ctime(secs: Optional[float] = ...) -> str: ... +def gmtime(secs: Optional[float] = ...) -> struct_time: ... +def localtime(secs: Optional[float] = ...) -> struct_time: ... +def mktime(t: Union[_TimeTuple, struct_time]) -> float: ... +def sleep(secs: float) -> None: ... +def strftime(format: str, t: Union[_TimeTuple, struct_time] = ...) -> str: ... +def strptime(string: str, format: str = ...) -> struct_time: ... +def time() -> float: ... +if sys.platform != 'win32': + def tzset() -> None: ... # Unix only + +if sys.version_info >= (3, 3): + def get_clock_info(name: str) -> SimpleNamespace: ... + def monotonic() -> float: ... + def perf_counter() -> float: ... + def process_time() -> float: ... + if sys.platform != 'win32': + def clock_getres(clk_id: int) -> float: ... # Unix only + def clock_gettime(clk_id: int) -> float: ... # Unix only + def clock_settime(clk_id: int, time: float) -> None: ... # Unix only + +if sys.version_info >= (3, 7): + def clock_gettime_ns(clock_id: int) -> int: ... + def clock_settime_ns(clock_id: int, time: int) -> int: ... + def monotonic_ns() -> int: ... + def perf_counter_ns() -> int: ... + def process_time_ns() -> int: ... + def time_ns() -> int: ... + def thread_time() -> float: ... + def thread_time_ns() -> int: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/timeit.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/timeit.pyi new file mode 100644 index 0000000..bc4cbba --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/timeit.pyi @@ -0,0 +1,34 @@ +# Stubs for timeit (Python 2 and 3) + +import sys +from typing import Any, Callable, Dict, IO, List, Optional, Sequence, Text, Tuple, Union + +_str = Union[str, Text] +_Timer = Callable[[], float] +_stmt = Union[_str, Callable[[], Any]] + +default_timer: _Timer + +class Timer: + if sys.version_info >= (3, 5): + def __init__(self, stmt: _stmt = ..., setup: _stmt = ..., timer: _Timer = ..., + globals: Optional[Dict[str, Any]] = ...) -> None: ... + else: + def __init__(self, stmt: _stmt = ..., setup: _stmt = ..., timer: _Timer = ...) -> None: ... + def print_exc(self, file: Optional[IO[str]] = ...) -> None: ... + def timeit(self, number: int = ...) -> float: ... + def repeat(self, repeat: int = ..., number: int = ...) -> List[float]: ... + if sys.version_info >= (3, 6): + def autorange(self, callback: Optional[Callable[[int, float], Any]] = ...) -> Tuple[int, float]: ... + +if sys.version_info >= (3, 5): + def timeit(stmt: _stmt = ..., setup: _stmt = ..., timer: _Timer = ..., + number: int = ..., globals: Optional[Dict[str, Any]] = ...) -> float: ... + def repeat(stmt: _stmt = ..., setup: _stmt = ..., timer: _Timer = ..., + repeat: int = ..., number: int = ..., globals: Optional[Dict[str, Any]] = ...) -> List[float]: ... +else: + def timeit(stmt: _stmt = ..., setup: _stmt = ..., timer: _Timer = ..., + number: int = ...) -> float: ... + def repeat(stmt: _stmt = ..., setup: _stmt = ..., timer: _Timer = ..., + repeat: int = ..., number: int = ...) -> List[float]: ... +def main(args: Optional[Sequence[str]]) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/token.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/token.pyi new file mode 100644 index 0000000..fa50862 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/token.pyi @@ -0,0 +1,71 @@ +import sys +from typing import Dict + +ENDMARKER: int +NAME: int +NUMBER: int +STRING: int +NEWLINE: int +INDENT: int +DEDENT: int +LPAR: int +RPAR: int +LSQB: int +RSQB: int +COLON: int +COMMA: int +SEMI: int +PLUS: int +MINUS: int +STAR: int +SLASH: int +VBAR: int +AMPER: int +LESS: int +GREATER: int +EQUAL: int +DOT: int +PERCENT: int +if sys.version_info < (3,): + BACKQUOTE: int +LBRACE: int +RBRACE: int +EQEQUAL: int +NOTEQUAL: int +LESSEQUAL: int +GREATEREQUAL: int +TILDE: int +CIRCUMFLEX: int +LEFTSHIFT: int +RIGHTSHIFT: int +DOUBLESTAR: int +PLUSEQUAL: int +MINEQUAL: int +STAREQUAL: int +SLASHEQUAL: int +PERCENTEQUAL: int +AMPEREQUAL: int +VBAREQUAL: int +CIRCUMFLEXEQUAL: int +LEFTSHIFTEQUAL: int +RIGHTSHIFTEQUAL: int +DOUBLESTAREQUAL: int +DOUBLESLASH: int +DOUBLESLASHEQUAL: int +AT: int +if sys.version_info >= (3,): + RARROW: int + ELLIPSIS: int +if sys.version_info >= (3, 5): + ATEQUAL: int + AWAIT: int + ASYNC: int +OP: int +ERRORTOKEN: int +N_TOKENS: int +NT_OFFSET: int +tok_name: Dict[int, str] + +def ISTERMINAL(x: int) -> bool: ... +def ISNONTERMINAL(x: int) -> bool: ... +def ISEOF(x: int) -> bool: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/trace.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/trace.pyi new file mode 100644 index 0000000..af06d39 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/trace.pyi @@ -0,0 +1,35 @@ +# Stubs for trace (Python 2 and 3) + +import os +import sys +import types +from typing import Any, Callable, Mapping, Optional, Sequence, Text, Tuple, TypeVar, Union + +_T = TypeVar('_T') +_localtrace = Callable[[types.FrameType, str, Any], Callable[..., Any]] + +if sys.version_info >= (3, 6): + _Path = Union[Text, os.PathLike] +else: + _Path = Text + +class CoverageResults: + def update(self, other: CoverageResults) -> None: ... + def write_results(self, show_missing: bool = ..., summary: bool = ..., coverdir: Optional[_Path] = ...) -> None: ... + def write_results_file(self, path: _Path, lines: Sequence[str], lnotab: Any, lines_hit: Mapping[int, int], encoding: Optional[str] = ...) -> Tuple[int, int]: ... + +class Trace: + def __init__(self, count: int = ..., trace: int = ..., countfuncs: int = ..., countcallers: int = ..., + ignoremods: Sequence[str] = ..., ignoredirs: Sequence[str] = ..., infile: Optional[_Path] = ..., + outfile: Optional[_Path] = ..., timing: bool = ...) -> None: ... + def run(self, cmd: Union[str, types.CodeType]) -> None: ... + def runctx(self, cmd: Union[str, types.CodeType], globals: Optional[Mapping[str, Any]] = ..., locals: Optional[Mapping[str, Any]] = ...) -> None: ... + def runfunc(self, func: Callable[..., _T], *args: Any, **kw: Any) -> _T: ... + def file_module_function_of(self, frame: types.FrameType) -> Tuple[str, Optional[str], str]: ... + def globaltrace_trackcallers(self, frame: types.FrameType, why: str, arg: Any) -> None: ... + def globaltrace_countfuncs(self, frame: types.FrameType, why: str, arg: Any) -> None: ... + def globaltrace_lt(self, frame: types.FrameType, why: str, arg: Any) -> None: ... + def localtrace_trace_and_count(self, frame: types.FrameType, why: str, arg: Any) -> _localtrace: ... + def localtrace_trace(self, frame: types.FrameType, why: str, arg: Any) -> _localtrace: ... + def localtrace_count(self, frame: types.FrameType, why: str, arg: Any) -> _localtrace: ... + def results(self) -> CoverageResults: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/traceback.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/traceback.pyi new file mode 100644 index 0000000..7adc5eb --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/traceback.pyi @@ -0,0 +1,120 @@ +# Stubs for traceback + +from typing import Any, Dict, Generator, IO, Iterator, List, Mapping, Optional, Protocol, Tuple, Type, Iterable +from types import FrameType, TracebackType +import sys + +_PT = Tuple[str, int, str, Optional[str]] + + +def print_tb(tb: Optional[TracebackType], limit: Optional[int] = ..., + file: Optional[IO[str]] = ...) -> None: ... +if sys.version_info >= (3,): + def print_exception(etype: Optional[Type[BaseException]], + value: Optional[BaseException], + tb: Optional[TracebackType], limit: Optional[int] = ..., + file: Optional[IO[str]] = ..., + chain: bool = ...) -> None: ... + def print_exc(limit: Optional[int] = ..., file: Optional[IO[str]] = ..., + chain: bool = ...) -> None: ... + def print_last(limit: Optional[int] = ..., file: Optional[IO[str]] = ..., + chain: bool = ...) -> None: ... +else: + def print_exception(etype: Optional[Type[BaseException]], + value: Optional[BaseException], + tb: Optional[TracebackType], limit: Optional[int] = ..., + file: Optional[IO[str]] = ...) -> None: ... + def print_exc(limit: Optional[int] = ..., + file: Optional[IO[str]] = ...) -> None: ... + def print_last(limit: Optional[int] = ..., + file: Optional[IO[str]] = ...) -> None: ... +def print_stack(f: Optional[FrameType] = ..., limit: Optional[int] = ..., + file: Optional[IO[str]] = ...) -> None: ... + +if sys.version_info >= (3, 5): + def extract_tb(tb: Optional[TracebackType], limit: Optional[int] = ...) -> StackSummary: ... + def extract_stack(f: Optional[FrameType] = ..., + limit: Optional[int] = ...) -> StackSummary: ... + def format_list(extracted_list: List[FrameSummary]) -> List[str]: ... + class _Writer(Protocol): + def write(self, s: str) -> Any: ... + # undocumented + def print_list(extracted_list: List[FrameSummary], file: Optional[_Writer] = ...) -> None: ... +else: + def extract_tb(tb: Optional[TracebackType], limit: Optional[int] = ...) -> List[_PT]: ... + def extract_stack(f: Optional[FrameType] = ..., + limit: Optional[int] = ...) -> List[_PT]: ... + def format_list(extracted_list: List[_PT]) -> List[str]: ... +def format_exception_only(etype: Optional[Type[BaseException]], + value: Optional[BaseException]) -> List[str]: ... +if sys.version_info >= (3,): + def format_exception(etype: Optional[Type[BaseException]], value: Optional[BaseException], + tb: Optional[TracebackType], limit: Optional[int] = ..., + chain: bool = ...) -> List[str]: ... + def format_exc(limit: Optional[int] = ..., chain: bool = ...) -> str: ... +else: + def format_exception(etype: Optional[Type[BaseException]], + value: Optional[BaseException], + tb: Optional[TracebackType], + limit: Optional[int] = ...) -> List[str]: ... + def format_exc(limit: Optional[int] = ...) -> str: ... +def format_tb(tb: Optional[TracebackType], limit: Optional[int] = ...) -> List[str]: ... +def format_stack(f: Optional[FrameType] = ..., + limit: Optional[int] = ...) -> List[str]: ... +if sys.version_info >= (3, 4): + def clear_frames(tb: TracebackType) -> None: ... +if sys.version_info >= (3, 5): + def walk_stack(f: Optional[FrameType]) -> Iterator[Tuple[FrameType, int]]: ... + def walk_tb(tb: Optional[TracebackType]) -> Iterator[Tuple[FrameType, int]]: ... +if sys.version_info < (3,): + def tb_lineno(tb: TracebackType) -> int: ... + + +if sys.version_info >= (3, 5): + class TracebackException: + __cause__ = ... # type:TracebackException + __context__ = ... # type:TracebackException + __suppress_context__: bool + stack: StackSummary + exc_type: Type[BaseException] + filename: str + lineno: int + text: str + offset: int + msg: str + def __init__(self, exc_type: Type[BaseException], + exc_value: BaseException, exc_traceback: TracebackType, + *, limit: Optional[int] = ..., lookup_lines: bool = ..., + capture_locals: bool = ...) -> None: ... + @classmethod + def from_exception(cls, exc: BaseException, + *, limit: Optional[int] = ..., + lookup_lines: bool = ..., + capture_locals: bool = ...) -> TracebackException: ... + def format(self, *, chain: bool = ...) -> Generator[str, None, None]: ... + def format_exception_only(self) -> Generator[str, None, None]: ... + + class FrameSummary(Iterable): + filename: str + lineno: int + name: str + line: str + locals: Optional[Dict[str, str]] + def __init__(self, filename: str, lineno: int, name: str, + lookup_line: bool = ..., + locals: Optional[Mapping[str, str]] = ..., + line: Optional[str] = ...) -> None: ... + # TODO: more precise typing for __getitem__ and __iter__, + # for a namedtuple-like view on (filename, lineno, name, str). + def __getitem__(self, i: int) -> Any: ... + def __iter__(self) -> Iterator[Any]: ... + + class StackSummary(List[FrameSummary]): + @classmethod + def extract(cls, + frame_gen: Generator[Tuple[FrameType, int], None, None], + *, limit: Optional[int] = ..., lookup_lines: bool = ..., + capture_locals: bool = ...) -> StackSummary: ... + @classmethod + def from_list(cls, a_list: List[_PT]) -> StackSummary: ... + def format(self) -> List[str]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/tty.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/tty.pyi new file mode 100644 index 0000000..2bce1ec --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/tty.pyi @@ -0,0 +1,17 @@ +# Stubs for tty (Python 3.6) + +from typing import IO, Union + +_FD = Union[int, IO[str]] + +# XXX: Undocumented integer constants +IFLAG: int +OFLAG: int +CFLAG: int +LFLAG: int +ISPEED: int +OSPEED: int +CC: int + +def setraw(fd: _FD, when: int = ...) -> None: ... +def setcbreak(fd: _FD, when: int = ...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/turtle.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/turtle.pyi new file mode 100644 index 0000000..c9d9d90 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/turtle.pyi @@ -0,0 +1,501 @@ +from typing import Tuple, overload, Optional, Union, Dict, Any, Sequence, TypeVar, List, Callable, Text +import sys +if sys.version_info >= (3,): + from tkinter import Canvas, PhotoImage +else: + # TODO: Replace these aliases once we have Python 2 stubs for the Tkinter module. + Canvas = Any + PhotoImage = Any + +# Note: '_Color' is the alias we use for arguments and _AnyColor is the +# alias we use for return types. Really, these two aliases should be the +# same, but as per the "no union returns" typeshed policy, we'll return +# Any instead. +_Color = Union[Text, Tuple[float, float, float]] +_AnyColor = Any + +# TODO: Replace this with a TypedDict once it becomes standardized. +_PenState = Dict[str, Any] + +_Speed = Union[str, float] +_PolygonCoords = Sequence[Tuple[float, float]] + +# TODO: Type this more accurately +# Vec2D is actually a custom subclass of 'tuple'. +Vec2D = Tuple[float, float] + +class TurtleScreenBase(object): + cv: Canvas = ... + canvwidth: int = ... + canvheight: int = ... + xscale: float = ... + yscale: float = ... + def __init__(self, cv: Canvas) -> None: ... + if sys.version_info >= (3,): + def mainloop(self) -> None: ... + def textinput(self, title: str, prompt: str) -> Optional[str]: ... + def numinput(self, title: str, prompt: str, default: Optional[float] = ..., minval: Optional[float] = ..., maxval: Optional[float] = ...) -> Optional[float]: ... + +class Terminator(Exception): ... +class TurtleGraphicsError(Exception): ... + +class Shape(object): + def __init__(self, type_: str, data: Union[_PolygonCoords, PhotoImage, None] = ...) -> None: ... + def addcomponent(self, poly: _PolygonCoords, fill: _Color, outline: Optional[_Color] = ...) -> None: ... + +class TurtleScreen(TurtleScreenBase): + def __init__(self, cv: Canvas, mode: str = ..., colormode: float = ..., delay: int = ...) -> None: ... + def clear(self) -> None: ... + @overload + def mode(self) -> str: ... + @overload + def mode(self, mode: str) -> None: ... + def setworldcoordinates(self, llx: float, lly: float, urx: float, ury: float) -> None: ... + def register_shape(self, name: str, shape: Union[_PolygonCoords, Shape, None] = ...) -> None: ... + @overload + def colormode(self) -> float: ... + @overload + def colormode(self, cmode: float) -> None: ... + def reset(self) -> None: ... + def turtles(self) -> List[Turtle]: ... + @overload + def bgcolor(self) -> _AnyColor: ... + @overload + def bgcolor(self, color: _Color) -> None: ... + @overload + def bgcolor(self, r: float, g: float, b: float) -> None: ... + @overload + def tracer(self) -> int: ... + @overload + def tracer(self, n: int, delay: Optional[int] = ...) -> None: ... + @overload + def delay(self) -> int: ... + @overload + def delay(self, delay: int) -> None: ... + def update(self) -> None: ... + def window_width(self) -> int: ... + def window_height(self) -> int: ... + def getcanvas(self) -> Canvas: ... + def getshapes(self) -> List[str]: ... + def onclick(self, fun: Callable[[float, float], Any], btn: int = ..., add: Optional[Any] = ...) -> None: ... + def onkey(self, fun: Callable[[], Any], key: str) -> None: ... + def listen(self, xdummy: Optional[float] = ..., ydummy: Optional[float] = ...) -> None: ... + def ontimer(self, fun: Callable[[], Any], t: int = ...) -> None: ... + @overload + def bgpic(self) -> str: ... + @overload + def bgpic(self, picname: str) -> None: ... + @overload + def screensize(self) -> Tuple[int, int]: ... + @overload + def screensize(self, canvwidth: int, canvheight: int, bg: Optional[_Color] = ...) -> None: ... + onscreenclick = onclick + resetscreen = reset + clearscreen = clear + addshape = register_shape + if sys.version_info >= (3,): + def onkeypress(self, fun: Callable[[], Any], key: Optional[str] = ...) -> None: ... + onkeyrelease = onkey + +class TNavigator(object): + START_ORIENTATION: Dict[str, Vec2D] = ... + DEFAULT_MODE: str = ... + DEFAULT_ANGLEOFFSET: int = ... + DEFAULT_ANGLEORIENT: int = ... + def __init__(self, mode: str = ...) -> None: ... + def reset(self) -> None: ... + def degrees(self, fullcircle: float = ...) -> None: ... + def radians(self) -> None: ... + def forward(self, distance: float) -> None: ... + def back(self, distance: float) -> None: ... + def right(self, angle: float) -> None: ... + def left(self, angle: float) -> None: ... + def pos(self) -> Vec2D: ... + def xcor(self) -> float: ... + def ycor(self) -> float: ... + @overload + def goto(self, x: Tuple[float, float]) -> None: ... + @overload + def goto(self, x: float, y: float) -> None: ... + def home(self) -> None: ... + def setx(self, x: float) -> None: ... + def sety(self, y: float) -> None: ... + @overload + def distance(self, x: Union[TNavigator, Tuple[float, float]]) -> float: ... + @overload + def distance(self, x: float, y: float) -> float: ... + @overload + def towards(self, x: Union[TNavigator, Tuple[float, float]]) -> float: ... + @overload + def towards(self, x: float, y: float) -> float: ... + def heading(self) -> float: ... + def setheading(self, to_angle: float) -> None: ... + def circle(self, radius: float, extent: Optional[float] = ..., steps: Optional[int] = ...) -> None: ... + fd = forward + bk = back + backward = back + rt = right + lt = left + position = pos + setpos = goto + setposition = goto + seth = setheading + + +class TPen(object): + def __init__(self, resizemode: str = ...) -> None: ... + @overload + def resizemode(self) -> str: ... + @overload + def resizemode(self, rmode: str) -> None: ... + @overload + def pensize(self) -> int: ... + @overload + def pensize(self, width: int) -> None: ... + def penup(self) -> None: ... + def pendown(self) -> None: ... + def isdown(self) -> bool: ... + @overload + def speed(self) -> int: ... + @overload + def speed(self, speed: _Speed) -> None: ... + @overload + def pencolor(self) -> _AnyColor: ... + @overload + def pencolor(self, color: _Color) -> None: ... + @overload + def pencolor(self, r: float, g: float, b: float) -> None: ... + @overload + def fillcolor(self) -> _AnyColor: ... + @overload + def fillcolor(self, color: _Color) -> None: ... + @overload + def fillcolor(self, r: float, g: float, b: float) -> None: ... + @overload + def color(self) -> Tuple[_AnyColor, _AnyColor]: ... + @overload + def color(self, color: _Color) -> None: ... + @overload + def color(self, r: float, g: float, b: float) -> None: ... + @overload + def color(self, color1: _Color, color2: _Color) -> None: ... + def showturtle(self) -> None: ... + def hideturtle(self) -> None: ... + def isvisible(self) -> bool: ... + # Note: signatures 1 and 2 overlap unsafely when no arguments are provided + @overload + def pen(self) -> _PenState: ... # type: ignore + @overload + def pen(self, pen: Optional[_PenState] = ..., *, + shown: bool = ..., pendown: bool = ..., pencolor: _Color = ..., fillcolor: _Color = ..., + pensize: int = ..., speed: int = ..., resizemode: str = ..., stretchfactor: Tuple[float, float] = ..., + outline: int = ..., tilt: float = ...) -> None: ... + width = pensize + up = penup + pu = penup + pd = pendown + down = pendown + st = showturtle + ht = hideturtle + +_T = TypeVar('_T') + +class RawTurtle(TPen, TNavigator): + def __init__(self, canvas: Union[Canvas, TurtleScreen, None] = ..., shape: str = ..., undobuffersize: int = ..., visible: bool = ...) -> None: ... + def reset(self) -> None: ... + def setundobuffer(self, size: Optional[int]) -> None: ... + def undobufferentries(self) -> int: ... + def clear(self) -> None: ... + def clone(self: _T) -> _T: ... + @overload + def shape(self) -> str: ... + @overload + def shape(self, name: str) -> None: ... + # Unsafely overlaps when no arguments are provided + @overload + def shapesize(self) -> Tuple[float, float, float]: ... # type: ignore + @overload + def shapesize(self, stretch_wid: Optional[float] = ..., stretch_len: Optional[float] = ..., outline: Optional[float] = ...) -> None: ... + if sys.version_info >= (3,): + @overload + def shearfactor(self) -> float: ... + @overload + def shearfactor(self, shear: float) -> None: ... + # Unsafely overlaps when no arguments are provided + @overload + def shapetransform(self) -> Tuple[float, float, float, float]: ... # type: ignore + @overload + def shapetransform(self, t11: Optional[float] = ..., t12: Optional[float] = ..., t21: Optional[float] = ..., t22: Optional[float] = ...) -> None: ... + def get_shapepoly(self) -> Optional[_PolygonCoords]: ... + def settiltangle(self, angle: float) -> None: ... + @overload + def tiltangle(self) -> float: ... + @overload + def tiltangle(self, angle: float) -> None: ... + def tilt(self, angle: float) -> None: ... + # Can return either 'int' or Tuple[int, ...] based on if the stamp is + # a compound stamp or not. So, as per the "no Union return" policy, + # we return Any. + def stamp(self) -> Any: ... + def clearstamp(self, stampid: Union[int, Tuple[int, ...]]) -> None: ... + def clearstamps(self, n: Optional[int] = ...) -> None: ... + def filling(self) -> bool: ... + def begin_fill(self) -> None: ... + def end_fill(self) -> None: ... + def dot(self, size: Optional[int] = ..., *color: _Color) -> None: ... + def write(self, arg: object, move: bool = ..., align: str = ..., font: Tuple[str, int, str] = ...) -> None: ... + def begin_poly(self) -> None: ... + def end_poly(self) -> None: ... + def get_poly(self) -> Optional[_PolygonCoords]: ... + def getscreen(self) -> TurtleScreen: ... + def getturtle(self: _T) -> _T: ... + getpen = getturtle + def onclick(self, fun: Callable[[float, float], Any], btn: int = ..., add: Optional[bool] = ...) -> None: ... + def onrelease(self, fun: Callable[[float, float], Any], btn: int = ..., add: Optional[bool] = ...) -> None: ... + def ondrag(self, fun: Callable[[float, float], Any], btn: int = ..., add: Optional[bool] = ...) -> None: ... + def undo(self) -> None: ... + turtlesize = shapesize + +class _Screen(TurtleScreen): + def __init__(self) -> None: ... + def setup(self, width: int = ..., height: int = ..., startx: int = ..., starty: int = ...) -> None: ... + def title(self, titlestring: str) -> None: ... + def bye(self) -> None: ... + def exitonclick(self) -> None: ... + +def Screen() -> _Screen: ... + +class Turtle(RawTurtle): + def __init__(self, shape: str = ..., undobuffersize: int = ..., visible: bool = ...) -> None: ... + +RawPen = RawTurtle +Pen = Turtle + +def write_docstringdict(filename: str) -> None: ... + +# Note: it's somewhat unfortunate that we have to copy the function signatures. +# It would be nice if we could partially reduce the redundancy by doing something +# like the following: +# +# _screen: Screen +# clear = _screen.clear +# +# However, it seems pytype does not support this type of syntax in pyi files. + +# Functions copied from TurtleScreenBase: + +# Note: mainloop() was always present in the global scope, but was added to +# TurtleScreenBase in Python 3.0 +def mainloop() -> None: ... +if sys.version_info >= (3,): + def textinput(title: str, prompt: str) -> Optional[str]: ... + def numinput(title: str, prompt: str, default: Optional[float] = ..., minval: Optional[float] = ..., maxval: Optional[float] = ...) -> Optional[float]: ... + +# Functions copied from TurtleScreen: + +def clear() -> None: ... +@overload +def mode() -> str: ... +@overload +def mode(mode: str) -> None: ... +def setworldcoordinates(llx: float, lly: float, urx: float, ury: float) -> None: ... +def register_shape(name: str, shape: Union[_PolygonCoords, Shape, None] = ...) -> None: ... +@overload +def colormode() -> float: ... +@overload +def colormode(cmode: float) -> None: ... +def reset() -> None: ... +def turtles() -> List[Turtle]: ... +@overload +def bgcolor() -> _AnyColor: ... +@overload +def bgcolor(color: _Color) -> None: ... +@overload +def bgcolor(r: float, g: float, b: float) -> None: ... +@overload +def tracer() -> int: ... +@overload +def tracer(n: int, delay: Optional[int] = ...) -> None: ... +@overload +def delay() -> int: ... +@overload +def delay(delay: int) -> None: ... +def update() -> None: ... +def window_width() -> int: ... +def window_height() -> int: ... +def getcanvas() -> Canvas: ... +def getshapes() -> List[str]: ... +def onclick(fun: Callable[[float, float], Any], btn: int = ..., add: Optional[Any] = ...) -> None: ... +def onkey(fun: Callable[[], Any], key: str) -> None: ... +def listen(xdummy: Optional[float] = ..., ydummy: Optional[float] = ...) -> None: ... +def ontimer(fun: Callable[[], Any], t: int = ...) -> None: ... +@overload +def bgpic() -> str: ... +@overload +def bgpic(picname: str) -> None: ... +@overload +def screensize() -> Tuple[int, int]: ... +@overload +def screensize(canvwidth: int, canvheight: int, bg: Optional[_Color] = ...) -> None: ... +onscreenclick = onclick +resetscreen = reset +clearscreen = clear +addshape = register_shape +if sys.version_info >= (3,): + def onkeypress(fun: Callable[[], Any], key: Optional[str] = ...) -> None: ... + onkeyrelease = onkey + +# Functions copied from TNavigator: + +def degrees(fullcircle: float = ...) -> None: ... +def radians() -> None: ... +def forward(distance: float) -> None: ... +def back(distance: float) -> None: ... +def right(angle: float) -> None: ... +def left(angle: float) -> None: ... +def pos() -> Vec2D: ... +def xcor() -> float: ... +def ycor() -> float: ... +@overload +def goto(x: Tuple[float, float]) -> None: ... +@overload +def goto(x: float, y: float) -> None: ... +def home() -> None: ... +def setx(x: float) -> None: ... +def sety(y: float) -> None: ... +@overload +def distance(x: Union[TNavigator, Tuple[float, float]]) -> float: ... +@overload +def distance(x: float, y: float) -> float: ... +@overload +def towards(x: Union[TNavigator, Tuple[float, float]]) -> float: ... +@overload +def towards(x: float, y: float) -> float: ... +def heading() -> float: ... +def setheading(to_angle: float) -> None: ... +def circle(radius: float, extent: Optional[float] = ..., steps: Optional[int] = ...) -> None: ... +fd = forward +bk = back +backward = back +rt = right +lt = left +position = pos +setpos = goto +setposition = goto +seth = setheading + +# Functions copied from TPen: + +@overload +def resizemode() -> str: ... +@overload +def resizemode(rmode: str) -> None: ... +@overload +def pensize() -> int: ... +@overload +def pensize(width: int) -> None: ... +def penup() -> None: ... +def pendown() -> None: ... +def isdown() -> bool: ... +@overload +def speed() -> int: ... +@overload +def speed(speed: _Speed) -> None: ... +@overload +def pencolor() -> _AnyColor: ... +@overload +def pencolor(color: _Color) -> None: ... +@overload +def pencolor(r: float, g: float, b: float) -> None: ... +@overload +def fillcolor() -> _AnyColor: ... +@overload +def fillcolor(color: _Color) -> None: ... +@overload +def fillcolor(r: float, g: float, b: float) -> None: ... +@overload +def color() -> Tuple[_AnyColor, _AnyColor]: ... +@overload +def color(color: _Color) -> None: ... +@overload +def color(r: float, g: float, b: float) -> None: ... +@overload +def color(color1: _Color, color2: _Color) -> None: ... +def showturtle() -> None: ... +def hideturtle() -> None: ... +def isvisible() -> bool: ... +# Note: signatures 1 and 2 overlap unsafely when no arguments are provided +@overload +def pen() -> _PenState: ... # type: ignore +@overload +def pen(pen: Optional[_PenState] = ..., *, + shown: bool = ..., pendown: bool = ..., pencolor: _Color = ..., fillcolor: _Color = ..., + pensize: int = ..., speed: int = ..., resizemode: str = ..., stretchfactor: Tuple[float, float] = ..., + outline: int = ..., tilt: float = ...) -> None: ... +width = pensize +up = penup +pu = penup +pd = pendown +down = pendown +st = showturtle +ht = hideturtle + +# Functions copied from RawTurtle: + +def setundobuffer(size: Optional[int]) -> None: ... +def undobufferentries() -> int: ... +@overload +def shape() -> str: ... +@overload +def shape(name: str) -> None: ... +# Unsafely overlaps when no arguments are provided +@overload +def shapesize() -> Tuple[float, float, float]: ... # type: ignore +@overload +def shapesize(stretch_wid: Optional[float] = ..., stretch_len: Optional[float] = ..., outline: Optional[float] = ...) -> None: ... +if sys.version_info >= (3,): + @overload + def shearfactor() -> float: ... + @overload + def shearfactor(shear: float) -> None: ... + # Unsafely overlaps when no arguments are provided + @overload + def shapetransform() -> Tuple[float, float, float, float]: ... # type: ignore + @overload + def shapetransform(t11: Optional[float] = ..., t12: Optional[float] = ..., t21: Optional[float] = ..., t22: Optional[float] = ...) -> None: ... + def get_shapepoly() -> Optional[_PolygonCoords]: ... +def settiltangle(angle: float) -> None: ... +@overload +def tiltangle() -> float: ... +@overload +def tiltangle(angle: float) -> None: ... +def tilt(angle: float) -> None: ... +# Can return either 'int' or Tuple[int, ...] based on if the stamp is +# a compound stamp or not. So, as per the "no Union return" policy, +# we return Any. +def stamp() -> Any: ... +def clearstamp(stampid: Union[int, Tuple[int, ...]]) -> None: ... +def clearstamps(n: Optional[int] = ...) -> None: ... +def filling() -> bool: ... +def begin_fill() -> None: ... +def end_fill() -> None: ... +def dot(size: Optional[int] = ..., *color: _Color) -> None: ... +def write(arg: object, move: bool = ..., align: str = ..., font: Tuple[str, int, str] = ...) -> None: ... +def begin_poly() -> None: ... +def end_poly() -> None: ... +def get_poly() -> Optional[_PolygonCoords]: ... +def getscreen() -> TurtleScreen: ... +def getturtle() -> Turtle: ... +getpen = getturtle +def onrelease(fun: Callable[[float, float], Any], btn: int = ..., add: Optional[Any] = ...) -> None: ... +def ondrag(fun: Callable[[float, float], Any], btn: int = ..., add: Optional[Any] = ...) -> None: ... +def undo() -> None: ... +turtlesize = shapesize + +# Functions copied from RawTurtle with a few tweaks: + +def clone() -> Turtle: ... + +# Extra functions present only in the global scope: + +done = mainloop diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/unicodedata.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/unicodedata.pyi new file mode 100644 index 0000000..bf4f30b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/unicodedata.pyi @@ -0,0 +1,38 @@ +# Stubs for unicodedata (Python 2.7 and 3.4) +from typing import Any, Text, TypeVar, Union + +ucd_3_2_0: UCD +ucnhash_CAPI: Any +unidata_version: str + +_default = TypeVar('_default') + +def bidirectional(__chr: Text) -> Text: ... +def category(__chr: Text) -> Text: ... +def combining(__chr: Text) -> int: ... +def decimal(__chr: Text, __default: _default = ...) -> Union[int, _default]: ... +def decomposition(__chr: Text) -> Text: ... +def digit(__chr: Text, __default: _default = ...) -> Union[int, _default]: ... +def east_asian_width(__chr: Text) -> Text: ... +def lookup(__name: Union[Text, bytes]) -> Text: ... +def mirrored(__chr: Text) -> int: ... +def name(__chr: Text, __default: _default = ...) -> Union[Text, _default]: ... +def normalize(__form: Text, __unistr: Text) -> Text: ... +def numeric(__chr: Text, __default: _default = ...) -> Union[float, _default]: ... + +class UCD(object): + # The methods below are constructed from the same array in C + # (unicodedata_functions) and hence identical to the methods above. + unidata_version: str + def bidirectional(self, __chr: Text) -> str: ... + def category(self, __chr: Text) -> str: ... + def combining(self, __chr: Text) -> int: ... + def decimal(self, __chr: Text, __default: _default = ...) -> Union[int, _default]: ... + def decomposition(self, __chr: Text) -> str: ... + def digit(self, __chr: Text, __default: _default = ...) -> Union[int, _default]: ... + def east_asian_width(self, __chr: Text) -> str: ... + def lookup(self, __name: Union[Text, bytes]) -> Text: ... + def mirrored(self, __chr: Text) -> int: ... + def name(self, __chr: Text, __default: _default = ...) -> Union[Text, _default]: ... + def normalize(self, __form: Text, __unistr: Text) -> Text: ... + def numeric(self, __chr: Text, __default: _default = ...) -> Union[float, _default]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/uu.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/uu.pyi new file mode 100644 index 0000000..c926dbb --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/uu.pyi @@ -0,0 +1,13 @@ +# Stubs for uu (Python 2 and 3) +import sys +from typing import BinaryIO, Union, Optional, Text + +_File = Union[Text, BinaryIO] + +class Error(Exception): ... + +if sys.version_info >= (3, 7): + def encode(in_file: _File, out_file: _File, name: Optional[str] = ..., mode: Optional[int] = ..., backtick: bool = ...) -> None: ... +else: + def encode(in_file: _File, out_file: _File, name: Optional[str] = ..., mode: Optional[int] = ...) -> None: ... +def decode(in_file: _File, out_file: Optional[_File] = ..., mode: Optional[int] = ..., quiet: int = ...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/uuid.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/uuid.pyi new file mode 100644 index 0000000..9c009d9 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/uuid.pyi @@ -0,0 +1,90 @@ +# Stubs for uuid + +import sys +from typing import Tuple, Optional, Any, Text + +# Because UUID has properties called int and bytes we need to rename these temporarily. +_Int = int +_Bytes = bytes +_FieldsType = Tuple[int, int, int, int, int, int] + +class UUID: + def __init__(self, hex: Optional[Text] = ..., + bytes: Optional[_Bytes] = ..., + bytes_le: Optional[_Bytes] = ..., + fields: Optional[_FieldsType] = ..., + int: Optional[_Int] = ..., + version: Optional[_Int] = ...) -> None: ... + @property + def bytes(self) -> _Bytes: ... + @property + def bytes_le(self) -> _Bytes: ... + @property + def clock_seq(self) -> _Int: ... + @property + def clock_seq_hi_variant(self) -> _Int: ... + @property + def clock_seq_low(self) -> _Int: ... + @property + def fields(self) -> _FieldsType: ... + @property + def hex(self) -> str: ... + @property + def int(self) -> _Int: ... + @property + def node(self) -> _Int: ... + @property + def time(self) -> _Int: ... + @property + def time_hi_version(self) -> _Int: ... + @property + def time_low(self) -> _Int: ... + @property + def time_mid(self) -> _Int: ... + @property + def urn(self) -> str: ... + @property + def variant(self) -> str: ... + @property + def version(self) -> Optional[_Int]: ... + + def __int__(self) -> _Int: ... + + if sys.version_info >= (3,): + def __eq__(self, other: Any) -> bool: ... + def __lt__(self, other: Any) -> bool: ... + def __le__(self, other: Any) -> bool: ... + def __gt__(self, other: Any) -> bool: ... + def __ge__(self, other: Any) -> bool: ... + else: + def get_bytes(self) -> _Bytes: ... + def get_bytes_le(self) -> _Bytes: ... + def get_clock_seq(self) -> _Int: ... + def get_clock_seq_hi_variant(self) -> _Int: ... + def get_clock_seq_low(self) -> _Int: ... + def get_fields(self) -> _FieldsType: ... + def get_hex(self) -> str: ... + def get_node(self) -> _Int: ... + def get_time(self) -> _Int: ... + def get_time_hi_version(self) -> _Int: ... + def get_time_low(self) -> _Int: ... + def get_time_mid(self) -> _Int: ... + def get_urn(self) -> str: ... + def get_variant(self) -> str: ... + def get_version(self) -> Optional[_Int]: ... + def __cmp__(self, other: Any) -> _Int: ... + +def getnode() -> int: ... +def uuid1(node: Optional[_Int] = ..., clock_seq: Optional[_Int] = ...) -> UUID: ... +def uuid3(namespace: UUID, name: str) -> UUID: ... +def uuid4() -> UUID: ... +def uuid5(namespace: UUID, name: str) -> UUID: ... + +NAMESPACE_DNS: UUID +NAMESPACE_URL: UUID +NAMESPACE_OID: UUID +NAMESPACE_X500: UUID +RESERVED_NCS: str +RFC_4122: str +RESERVED_MICROSOFT: str +RESERVED_FUTURE: str diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/warnings.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/warnings.pyi new file mode 100644 index 0000000..a44e43e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/warnings.pyi @@ -0,0 +1,38 @@ +# Stubs for warnings + +from typing import Any, Dict, List, NamedTuple, Optional, TextIO, Tuple, Type, Union +from types import ModuleType, TracebackType + +def warn(message: Union[str, Warning], category: Optional[Type[Warning]] = ..., + stacklevel: int = ...) -> None: ... +def warn_explicit(message: Union[str, Warning], category: Type[Warning], + filename: str, lineno: int, module: Optional[str] = ..., + registry: Optional[Dict[Union[str, Tuple[str, Type[Warning], int]], int]] = ..., + module_globals: Optional[Dict[str, Any]] = ...) -> None: ... +def showwarning(message: str, category: Type[Warning], filename: str, + lineno: int, file: Optional[TextIO] = ..., + line: Optional[str] = ...) -> None: ... +def formatwarning(message: str, category: Type[Warning], filename: str, + lineno: int, line: Optional[str] = ...) -> str: ... +def filterwarnings(action: str, message: str = ..., + category: Type[Warning] = ..., module: str = ..., + lineno: int = ..., append: bool = ...) -> None: ... +def simplefilter(action: str, category: Type[Warning] = ..., lineno: int = ..., + append: bool = ...) -> None: ... +def resetwarnings() -> None: ... + +_Record = NamedTuple('_Record', + [('message', str), + ('category', Type[Warning]), + ('filename', str), + ('lineno', int), + ('file', Optional[TextIO]), + ('line', Optional[str])]) + +class catch_warnings: + def __init__(self, *, record: bool = ..., + module: Optional[ModuleType] = ...) -> None: ... + def __enter__(self) -> Optional[List[_Record]]: ... + def __exit__(self, exc_type: Optional[Type[BaseException]], + exc_val: Optional[BaseException], + exc_tb: Optional[TracebackType]) -> bool: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/wave.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/wave.pyi new file mode 100644 index 0000000..951142a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/wave.pyi @@ -0,0 +1,76 @@ +# Stubs for wave (Python 2 and 3) + +import sys +from typing import ( + Any, NamedTuple, NoReturn, Optional, Text, BinaryIO, Union, Tuple +) + +_File = Union[Text, BinaryIO] + +class Error(Exception): ... + +WAVE_FORMAT_PCM: int + +if sys.version_info < (3, 0): + _wave_params = Tuple[int, int, int, int, str, str] +else: + _wave_params = NamedTuple('_wave_params', [ + ('nchannels', int), + ('sampwidth', int), + ('framerate', int), + ('nframes', int), + ('comptype', str), + ('compname', str), + ]) + +class Wave_read: + def __init__(self, f: _File) -> None: ... + if sys.version_info >= (3, 0): + def __enter__(self) -> Wave_read: ... + def __exit__(self, *args: Any) -> None: ... + def getfp(self) -> Optional[BinaryIO]: ... + def rewind(self) -> None: ... + def close(self) -> None: ... + def tell(self) -> int: ... + def getnchannels(self) -> int: ... + def getnframes(self) -> int: ... + def getsampwidth(self) -> int: ... + def getframerate(self) -> int: ... + def getcomptype(self) -> str: ... + def getcompname(self) -> str: ... + def getparams(self) -> _wave_params: ... + def getmarkers(self) -> None: ... + def getmark(self, id: Any) -> NoReturn: ... + def setpos(self, pos: int) -> None: ... + def readframes(self, nframes: int) -> bytes: ... + +class Wave_write: + def __init__(self, f: _File) -> None: ... + if sys.version_info >= (3, 0): + def __enter__(self) -> Wave_write: ... + def __exit__(self, *args: Any) -> None: ... + def setnchannels(self, nchannels: int) -> None: ... + def getnchannels(self) -> int: ... + def setsampwidth(self, sampwidth: int) -> None: ... + def getsampwidth(self) -> int: ... + def setframerate(self, framerate: float) -> None: ... + def getframerate(self) -> int: ... + def setnframes(self, nframes: int) -> None: ... + def getnframes(self) -> int: ... + def setcomptype(self, comptype: str, compname: str) -> None: ... + def getcomptype(self) -> str: ... + def getcompname(self) -> str: ... + def setparams(self, params: _wave_params) -> None: ... + def getparams(self) -> _wave_params: ... + def setmark(self, id: Any, pos: Any, name: Any) -> NoReturn: ... + def getmark(self, id: Any) -> NoReturn: ... + def getmarkers(self) -> None: ... + def tell(self) -> int: ... + # should be any bytes-like object after 3.4, but we don't have a type for that + def writeframesraw(self, data: bytes) -> None: ... + def writeframes(self, data: bytes) -> None: ... + def close(self) -> None: ... + +# Returns a Wave_read if mode is rb and Wave_write if mode is wb +def open(f: _File, mode: Optional[str] = ...) -> Any: ... +openfp = open diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/weakref.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/weakref.pyi new file mode 100644 index 0000000..e3ddbf2 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/weakref.pyi @@ -0,0 +1,110 @@ +import sys +import types +from typing import ( + TypeVar, Generic, Any, Callable, overload, Mapping, Iterator, Tuple, + Iterable, Optional, Type, MutableMapping, Union, List, Dict +) + +from _weakref import ( + getweakrefcount as getweakrefcount, + getweakrefs as getweakrefs, + ref as ref, + proxy as proxy, + CallableProxyType as CallableProxyType, + ProxyType as ProxyType, + ReferenceType as ReferenceType) +from _weakrefset import WeakSet as WeakSet + +if sys.version_info < (3, 0): + from exceptions import ReferenceError as ReferenceError + +_S = TypeVar('_S') +_T = TypeVar('_T') +_KT = TypeVar('_KT') +_VT = TypeVar('_VT') + +ProxyTypes: Tuple[Type[Any], ...] + +if sys.version_info >= (3, 4): + class WeakMethod(ref[types.MethodType]): + def __new__(cls, meth: types.MethodType, callback: Optional[Callable[[types.MethodType], Any]] = ...) -> WeakMethod: ... + def __call__(self) -> Optional[types.MethodType]: ... + +class WeakValueDictionary(MutableMapping[_KT, _VT]): + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, __map: Union[Mapping[_KT, _VT], Iterable[Tuple[_KT, _VT]]], **kwargs: _VT) -> None: ... + + def __len__(self) -> int: ... + def __getitem__(self, k: _KT) -> _VT: ... + def __setitem__(self, k: _KT, v: _VT) -> None: ... + def __delitem__(self, v: _KT) -> None: ... + if sys.version_info < (3, 0): + def has_key(self, key: object) -> bool: ... + def __contains__(self, o: object) -> bool: ... + def __iter__(self) -> Iterator[_KT]: ... + def __str__(self) -> str: ... + + def copy(self) -> WeakValueDictionary[_KT, _VT]: ... + + if sys.version_info < (3, 0): + def keys(self) -> List[_KT]: ... + def values(self) -> List[_VT]: ... + def items(self) -> List[Tuple[_KT, _VT]]: ... + def iterkeys(self) -> Iterator[_KT]: ... + def itervalues(self) -> Iterator[_VT]: ... + def iteritems(self) -> Iterator[Tuple[_KT, _VT]]: ... + else: + # These are incompatible with Mapping + def keys(self) -> Iterator[_KT]: ... # type: ignore + def values(self) -> Iterator[_VT]: ... # type: ignore + def items(self) -> Iterator[Tuple[_KT, _VT]]: ... # type: ignore + def itervaluerefs(self) -> Iterator[KeyedRef[_KT, _VT]]: ... + def valuerefs(self) -> List[KeyedRef[_KT, _VT]]: ... + +class KeyedRef(ref[_T], Generic[_KT, _T]): + key: _KT + def __init__(self, ob: _T, callback: Callable[[_T], Any], key: _KT) -> None: ... + +class WeakKeyDictionary(MutableMapping[_KT, _VT]): + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, __map: Union[Mapping[_KT, _VT], Iterable[Tuple[_KT, _VT]]], **kwargs: _VT) -> None: ... + + def __len__(self) -> int: ... + def __getitem__(self, k: _KT) -> _VT: ... + def __setitem__(self, k: _KT, v: _VT) -> None: ... + def __delitem__(self, v: _KT) -> None: ... + if sys.version_info < (3, 0): + def has_key(self, key: object) -> bool: ... + def __contains__(self, o: object) -> bool: ... + def __iter__(self) -> Iterator[_KT]: ... + def __str__(self) -> str: ... + + def copy(self) -> WeakKeyDictionary[_KT, _VT]: ... + + if sys.version_info < (3, 0): + def keys(self) -> List[_KT]: ... + def values(self) -> List[_VT]: ... + def items(self) -> List[Tuple[_KT, _VT]]: ... + def iterkeys(self) -> Iterator[_KT]: ... + def itervalues(self) -> Iterator[_VT]: ... + def iteritems(self) -> Iterator[Tuple[_KT, _VT]]: ... + def iterkeyrefs(self) -> Iterator[ref[_KT]]: ... + else: + # These are incompatible with Mapping + def keys(self) -> Iterator[_KT]: ... # type: ignore + def values(self) -> Iterator[_VT]: ... # type: ignore + def items(self) -> Iterator[Tuple[_KT, _VT]]: ... # type: ignore + def keyrefs(self) -> List[ref[_KT]]: ... + +if sys.version_info >= (3, 4): + class finalize: + def __init__(self, obj: _S, func: Callable[..., _T], *args: Any, **kwargs: Any) -> None: ... + def __call__(self, _: Any = ...) -> Optional[_T]: ... + def detach(self) -> Optional[Tuple[_S, _T, Tuple[Any, ...], Dict[str, Any]]]: ... + def peek(self) -> Optional[Tuple[_S, _T, Tuple[Any, ...], Dict[str, Any]]]: ... + alive: bool + atexit: bool diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/webbrowser.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/webbrowser.pyi new file mode 100644 index 0000000..7d1b4cb --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/webbrowser.pyi @@ -0,0 +1,99 @@ +import sys +from typing import Any, Optional, Callable, List, Text, Union, Sequence + +class Error(Exception): ... + +if sys.version_info >= (3, 7): + def register(name: Text, klass: Optional[Callable[[], BaseBrowser]], instance: BaseBrowser = ..., *, preferred: bool = ...) -> None: ... +else: + def register(name: Text, klass: Optional[Callable[[], BaseBrowser]], instance: BaseBrowser = ..., update_tryorder: int = ...) -> None: ... +def get(using: Optional[Text] = ...) -> BaseBrowser: ... +def open(url: Text, new: int = ..., autoraise: bool = ...) -> bool: ... +def open_new(url: Text) -> bool: ... +def open_new_tab(url: Text) -> bool: ... + +class BaseBrowser: + args: List[str] + name: str + basename: str + def __init__(self, name: Text = ...) -> None: ... + def open(self, url: Text, new: int = ..., autoraise: bool = ...) -> bool: ... + def open_new(self, url: Text) -> bool: ... + def open_new_tab(self, url: Text) -> bool: ... + +class GenericBrowser(BaseBrowser): + args: List[str] + name: str + basename: str + def __init__(self, name: Union[Text, Sequence[Text]]) -> None: ... + def open(self, url: Text, new: int = ..., autoraise: bool = ...) -> bool: ... + +class BackgroundBrowser(GenericBrowser): + def open(self, url: Text, new: int = ..., autoraise: bool = ...) -> bool: ... + +class UnixBrowser(BaseBrowser): + raise_opts: List[str] + background: bool + redirect_stdout: bool + remote_args: List[str] + remote_action: str + remote_action_newwin: str + remote_action_newtab: str + def open(self, url: Text, new: int = ..., autoraise: bool = ...) -> bool: ... + +class Mozilla(UnixBrowser): + raise_opts: List[str] + remote_args: List[str] + remote_action: str + remote_action_newwin: str + remote_action_newtab: str + background: bool + +class Galeon(UnixBrowser): + raise_opts: List[str] + remote_args: List[str] + remote_action: str + remote_action_newwin: str + background: bool + +if sys.version_info[:2] == (2, 7) or sys.version_info >= (3, 3): + class Chrome(UnixBrowser): + remote_args: List[str] + remote_action: str + remote_action_newwin: str + remote_action_newtab: str + background: bool + +class Opera(UnixBrowser): + raise_opts: List[str] + remote_args: List[str] + remote_action: str + remote_action_newwin: str + remote_action_newtab: str + background: bool + +class Elinks(UnixBrowser): + remote_args: List[str] + remote_action: str + remote_action_newwin: str + remote_action_newtab: str + background: bool + redirect_stdout: bool + +class Konqueror(BaseBrowser): + def open(self, url: Text, new: int = ..., autoraise: bool = ...) -> bool: ... + +class Grail(BaseBrowser): + def open(self, url: Text, new: int = ..., autoraise: bool = ...) -> bool: ... + +class WindowsDefault(BaseBrowser): + def open(self, url: Text, new: int = ..., autoraise: bool = ...) -> bool: ... + +class MacOSX(BaseBrowser): + name: str + def __init__(self, name: Text) -> None: ... + def open(self, url: Text, new: int = ..., autoraise: bool = ...) -> bool: ... + +class MacOSXOSAScript(BaseBrowser): + def __init__(self, name: Text) -> None: ... + def open(self, url: Text, new: int = ..., autoraise: bool = ...) -> bool: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/wsgiref/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/wsgiref/__init__.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/wsgiref/handlers.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/wsgiref/handlers.pyi new file mode 100644 index 0000000..3271c88 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/wsgiref/handlers.pyi @@ -0,0 +1,87 @@ +import sys +from abc import abstractmethod +from types import TracebackType +from typing import Optional, Dict, MutableMapping, Type, Text, Callable, List, Tuple, IO + +from .headers import Headers +from .types import WSGIApplication, WSGIEnvironment, StartResponse, InputStream, ErrorStream +from .util import FileWrapper, guess_scheme + +_exc_info = Tuple[Optional[Type[BaseException]], + Optional[BaseException], + Optional[TracebackType]] + +def format_date_time(timestamp: Optional[float]) -> str: ... # undocumented +if sys.version_info >= (3, 2): + def read_environ() -> Dict[str, str]: ... + +class BaseHandler: + wsgi_version: Tuple[int, int] # undocumented + wsgi_multithread: bool + wsgi_multiprocess: bool + wsgi_run_once: bool + + origin_server: bool + http_version: str + server_software: Optional[str] + + os_environ: MutableMapping[str, str] + + wsgi_file_wrapper: Optional[Type[FileWrapper]] + headers_class: Type[Headers] # undocumented + + traceback_limit: Optional[int] + error_status: str + error_headers: List[Tuple[Text, Text]] + error_body: bytes + + def run(self, application: WSGIApplication) -> None: ... + + def setup_environ(self) -> None: ... + def finish_response(self) -> None: ... + def get_scheme(self) -> str: ... + def set_content_length(self) -> None: ... + def cleanup_headers(self) -> None: ... + def start_response(self, status: Text, headers: List[Tuple[Text, Text]], exc_info: Optional[_exc_info] = ...) -> Callable[[bytes], None]: ... + def send_preamble(self) -> None: ... + def write(self, data: bytes) -> None: ... + def sendfile(self) -> bool: ... + def finish_content(self) -> None: ... + def close(self) -> None: ... + def send_headers(self) -> None: ... + def result_is_file(self) -> bool: ... + def client_is_modern(self) -> bool: ... + def log_exception(self, exc_info: _exc_info) -> None: ... + def handle_error(self) -> None: ... + def error_output(self, environ: WSGIEnvironment, start_response: StartResponse) -> List[bytes]: ... + + @abstractmethod + def _write(self, data: bytes) -> None: ... + @abstractmethod + def _flush(self) -> None: ... + @abstractmethod + def get_stdin(self) -> InputStream: ... + @abstractmethod + def get_stderr(self) -> ErrorStream: ... + @abstractmethod + def add_cgi_vars(self) -> None: ... + +class SimpleHandler(BaseHandler): + stdin: InputStream + stdout: IO[bytes] + stderr: ErrorStream + base_env: MutableMapping[str, str] + def __init__(self, stdin: InputStream, stdout: IO[bytes], stderr: ErrorStream, environ: MutableMapping[str, str], multithread: bool = ..., multiprocess: bool = ...) -> None: ... + def get_stdin(self) -> InputStream: ... + def get_stderr(self) -> ErrorStream: ... + def add_cgi_vars(self) -> None: ... + def _write(self, data: bytes) -> None: ... + def _flush(self) -> None: ... + +class BaseCGIHandler(SimpleHandler): ... + +class CGIHandler(BaseCGIHandler): + def __init__(self) -> None: ... + +class IISCGIHandler(BaseCGIHandler): + def __init__(self) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/wsgiref/headers.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/wsgiref/headers.pyi new file mode 100644 index 0000000..8539225 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/wsgiref/headers.pyi @@ -0,0 +1,31 @@ +import sys +from typing import overload, Pattern, Optional, List, Tuple + +_HeaderList = List[Tuple[str, str]] + +tspecials: Pattern[str] # undocumented + +class Headers: + if sys.version_info < (3, 5): + def __init__(self, headers: _HeaderList) -> None: ... + else: + def __init__(self, headers: Optional[_HeaderList] = ...) -> None: ... + def __len__(self) -> int: ... + def __setitem__(self, name: str, val: str) -> None: ... + def __delitem__(self, name: str) -> None: ... + def __getitem__(self, name: str) -> Optional[str]: ... + if sys.version_info < (3,): + def has_key(self, name: str) -> bool: ... + def __contains__(self, name: str) -> bool: ... + def get_all(self, name: str) -> List[str]: ... + @overload + def get(self, name: str, default: str) -> str: ... + @overload + def get(self, name: str, default: Optional[str] = ...) -> Optional[str]: ... + def keys(self) -> List[str]: ... + def values(self) -> List[str]: ... + def items(self) -> _HeaderList: ... + if sys.version_info >= (3,): + def __bytes__(self) -> bytes: ... + def setdefault(self, name: str, value: str) -> str: ... + def add_header(self, _name: str, _value: Optional[str], **_params: Optional[str]) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/wsgiref/simple_server.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/wsgiref/simple_server.pyi new file mode 100644 index 0000000..50b8377 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/wsgiref/simple_server.pyi @@ -0,0 +1,40 @@ +import sys +from typing import Optional, List, Type, TypeVar, overload + +from .handlers import SimpleHandler +from .types import WSGIApplication, WSGIEnvironment, StartResponse, ErrorStream + +if sys.version_info < (3,): + from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer +else: + from http.server import HTTPServer, BaseHTTPRequestHandler + +server_version: str # undocumented +sys_version: str # undocumented +software_version: str # undocumented + +class ServerHandler(SimpleHandler): # undocumented + server_software: str + def close(self) -> None: ... + +class WSGIServer(HTTPServer): + application: Optional[WSGIApplication] + base_environ: WSGIEnvironment # only available after call to setup_environ() + def setup_environ(self) -> None: ... + def get_app(self) -> Optional[WSGIApplication]: ... + def set_app(self, application: Optional[WSGIApplication]) -> None: ... + +class WSGIRequestHandler(BaseHTTPRequestHandler): + server_version: str + def get_environ(self) -> WSGIEnvironment: ... + def get_stderr(self) -> ErrorStream: ... + def handle(self) -> None: ... + +def demo_app(environ: WSGIEnvironment, start_response: StartResponse) -> List[bytes]: ... + +_S = TypeVar("_S", bound=WSGIServer) + +@overload +def make_server(host: str, port: int, app: WSGIApplication, *, handler_class: Type[WSGIRequestHandler] = ...) -> WSGIServer: ... +@overload +def make_server(host: str, port: int, app: WSGIApplication, server_class: Type[_S], handler_class: Type[WSGIRequestHandler] = ...) -> _S: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/wsgiref/types.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/wsgiref/types.pyi new file mode 100644 index 0000000..39a913e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/wsgiref/types.pyi @@ -0,0 +1,44 @@ +# Type declaration for a WSGI Function +# +# wsgiref/types.py doesn't exist and neither do the types defined in this +# file. They are provided for type checking purposes. +# +# This means you cannot simply import wsgiref.types in your code. Instead, +# use the `TYPE_CHECKING` flag from the typing module: +# +# from typing import TYPE_CHECKING +# +# if TYPE_CHECKING: +# from wsgiref.types import WSGIApplication +# +# This import is now only taken into account by the type checker. Consequently, +# you need to use 'WSGIApplication' and not simply WSGIApplication when type +# hinting your code. Otherwise Python will raise NameErrors. + +from sys import _OptExcInfo +from typing import Callable, Dict, Iterable, List, Any, Text, Protocol, Tuple, Optional + +class StartResponse(Protocol): + def __call__(self, status: str, headers: List[Tuple[str, str]], exc_info: Optional[_OptExcInfo] = ...) -> Callable[[bytes], Any]: ... + +WSGIEnvironment = Dict[Text, Any] +WSGIApplication = Callable[[WSGIEnvironment, StartResponse], Iterable[bytes]] + +# WSGI input streams per PEP 3333 +class InputStream(Protocol): + def read(self, size: int = ...) -> bytes: ... + def readline(self, size: int = ...) -> bytes: ... + def readlines(self, hint: int = ...) -> List[bytes]: ... + def __iter__(self) -> Iterable[bytes]: ... + +# WSGI error streams per PEP 3333 +class ErrorStream(Protocol): + def flush(self) -> None: ... + def write(self, s: str) -> None: ... + def writelines(self, seq: List[str]) -> None: ... + +class _Readable(Protocol): + def read(self, size: int = ...) -> bytes: ... +# Optional file wrapper in wsgi.file_wrapper +class FileWrapper(Protocol): + def __call__(self, file: _Readable, block_size: int = ...) -> Iterable[bytes]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/wsgiref/util.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/wsgiref/util.pyi new file mode 100644 index 0000000..501ddcd --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/wsgiref/util.pyi @@ -0,0 +1,23 @@ +import sys +from typing import IO, Any, Optional + +from .types import WSGIEnvironment + +class FileWrapper: + filelike: IO[bytes] + blksize: int + def __init__(self, filelike: IO[bytes], bklsize: int = ...) -> None: ... + def __getitem__(self, key: Any) -> bytes: ... + def __iter__(self) -> FileWrapper: ... + if sys.version_info < (3,): + def next(self) -> bytes: ... + else: + def __next__(self) -> bytes: ... + def close(self) -> None: ... # only exists if filelike.close exists + +def guess_scheme(environ: WSGIEnvironment) -> str: ... +def application_uri(environ: WSGIEnvironment) -> str: ... +def request_uri(environ: WSGIEnvironment, include_query: bool = ...) -> str: ... +def shift_path_info(environ: WSGIEnvironment) -> Optional[str]: ... +def setup_testing_defaults(environ: WSGIEnvironment) -> None: ... +def is_hop_by_hop(header_name: str) -> bool: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/wsgiref/validate.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/wsgiref/validate.pyi new file mode 100644 index 0000000..c7fa699 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/wsgiref/validate.pyi @@ -0,0 +1,53 @@ +import sys +from typing import Any, Iterable, Iterator, Optional, NoReturn, Callable + +from wsgiref.types import WSGIApplication, InputStream, ErrorStream + +class WSGIWarning(Warning): ... + +def validator(application: WSGIApplication) -> WSGIApplication: ... + +class InputWrapper: + input: InputStream + def __init__(self, wsgi_input: InputStream) -> None: ... + if sys.version_info < (3,): + def read(self, size: int = ...) -> bytes: ... + def readline(self) -> bytes: ... + else: + def read(self, size: int) -> bytes: ... + def readline(self, size: int = ...) -> bytes: ... + def readlines(self, hint: int = ...) -> bytes: ... + def __iter__(self) -> Iterable[bytes]: ... + def close(self) -> NoReturn: ... + +class ErrorWrapper: + errors: ErrorStream + def __init__(self, wsgi_errors: ErrorStream) -> None: ... + def write(self, s: str) -> None: ... + def flush(self) -> None: ... + def writelines(self, seq: Iterable[str]) -> None: ... + def close(self) -> NoReturn: ... + +class WriteWrapper: + writer: Callable[[bytes], Any] + def __init__(self, wsgi_writer: Callable[[bytes], Any]) -> None: ... + def __call__(self, s: bytes) -> None: ... + +class PartialIteratorWrapper: + iterator: Iterator[bytes] + def __init__(self, wsgi_iterator: Iterator[bytes]) -> None: ... + def __iter__(self) -> IteratorWrapper: ... + +class IteratorWrapper: + original_iterator: Iterator[bytes] + iterator: Iterator[bytes] + closed: bool + check_start_response: Optional[bool] + def __init__(self, wsgi_iterator: Iterator[bytes], check_start_response: Optional[bool]) -> None: ... + def __iter__(self) -> IteratorWrapper: ... + if sys.version_info < (3,): + def next(self) -> bytes: ... + else: + def __next__(self) -> bytes: ... + def close(self) -> None: ... + def __del__(self) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/xdrlib.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/xdrlib.pyi new file mode 100644 index 0000000..864aced --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/xdrlib.pyi @@ -0,0 +1,56 @@ +# Structs for xdrlib (Python 2 and 3) +from typing import Callable, List, Sequence, TypeVar + +_T = TypeVar('_T') + +class Error(Exception): + msg: str + def __init__(self, msg: str) -> None: ... + +class ConversionError(Error): ... + +class Packer: + def __init__(self) -> None: ... + def reset(self) -> None: ... + def get_buffer(self) -> bytes: ... + def get_buf(self) -> bytes: ... + def pack_uint(self, x: int) -> None: ... + def pack_int(self, x: int) -> None: ... + def pack_enum(self, x: int) -> None: ... + def pack_bool(self, x: bool) -> None: ... + def pack_uhyper(self, x: int) -> None: ... + def pack_hyper(self, x: int) -> None: ... + def pack_float(self, x: float) -> None: ... + def pack_double(self, x: float) -> None: ... + def pack_fstring(self, n: int, s: bytes) -> None: ... + def pack_fopaque(self, n: int, s: bytes) -> None: ... + def pack_string(self, s: bytes) -> None: ... + def pack_opaque(self, s: bytes) -> None: ... + def pack_bytes(self, s: bytes) -> None: ... + def pack_list(self, list: Sequence[_T], pack_item: Callable[[_T], None]) -> None: ... + def pack_farray(self, n: int, list: Sequence[_T], pack_item: Callable[[_T], None]) -> None: ... + def pack_array(self, list: Sequence[_T], pack_item: Callable[[_T], None]) -> None: ... + +class Unpacker: + def __init__(self, data: bytes) -> None: ... + def reset(self, data: bytes) -> None: ... + def get_position(self) -> int: ... + def set_position(self, position: int) -> None: ... + def get_buffer(self) -> bytes: ... + def done(self) -> None: ... + def unpack_uint(self) -> int: ... + def unpack_int(self) -> int: ... + def unpack_enum(self) -> int: ... + def unpack_bool(self) -> bool: ... + def unpack_uhyper(self) -> int: ... + def unpack_hyper(self) -> int: ... + def unpack_float(self) -> float: ... + def unpack_double(self) -> float: ... + def unpack_fstring(self, n: int) -> bytes: ... + def unpack_fopaque(self, n: int) -> bytes: ... + def unpack_string(self) -> bytes: ... + def unpack_opaque(self) -> bytes: ... + def unpack_bytes(self) -> bytes: ... + def unpack_list(self, unpack_item: Callable[[], _T]) -> List[_T]: ... + def unpack_farray(self, n: int, unpack_item: Callable[[], _T]) -> List[_T]: ... + def unpack_array(self, unpack_item: Callable[[], _T]) -> List[_T]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/xml/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/xml/__init__.pyi new file mode 100644 index 0000000..c524ac2 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/xml/__init__.pyi @@ -0,0 +1 @@ +import xml.parsers as parsers diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/xml/etree/ElementInclude.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/xml/etree/ElementInclude.pyi new file mode 100644 index 0000000..e8c3cd5 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/xml/etree/ElementInclude.pyi @@ -0,0 +1,17 @@ +# Stubs for xml.etree.ElementInclude (Python 3.4) + +from typing import Union, Optional, Callable +from xml.etree.ElementTree import Element + +XINCLUDE: str +XINCLUDE_INCLUDE: str +XINCLUDE_FALLBACK: str + +class FatalIncludeError(SyntaxError): ... + +def default_loader(href: Union[str, bytes, int], parse: str, encoding: Optional[str] = ...) -> Union[str, Element]: ... + +# TODO: loader is of type default_loader ie it takes a callable that has the +# same signature as default_loader. But default_loader has a keyword argument +# Which can't be represented using Callable... +def include(elem: Element, loader: Optional[Callable[..., Union[str, Element]]] = ...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/xml/etree/ElementPath.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/xml/etree/ElementPath.pyi new file mode 100644 index 0000000..1477b32 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/xml/etree/ElementPath.pyi @@ -0,0 +1,33 @@ +# Stubs for xml.etree.ElementPath (Python 3.4) + +from typing import Pattern, Dict, Generator, Tuple, List, Union, TypeVar, Callable, Optional +from xml.etree.ElementTree import Element + +xpath_tokenizer_re: Pattern + +_token = Tuple[str, str] +_next = Callable[[], _token] +_callback = Callable[[_SelectorContext, List[Element]], Generator[Element, None, None]] + +def xpath_tokenizer(pattern: str, namespaces: Optional[Dict[str, str]] = ...) -> Generator[_token, None, None]: ... +def get_parent_map(context: _SelectorContext) -> Dict[Element, Element]: ... +def prepare_child(next: _next, token: _token) -> _callback: ... +def prepare_star(next: _next, token: _token) -> _callback: ... +def prepare_self(next: _next, token: _token) -> _callback: ... +def prepare_descendant(next: _next, token: _token) -> _callback: ... +def prepare_parent(next: _next, token: _token) -> _callback: ... +def prepare_predicate(next: _next, token: _token) -> _callback: ... + +ops: Dict[str, Callable[[_next, _token], _callback]] + +class _SelectorContext: + parent_map: Dict[Element, Element] + root: Element + def __init__(self, root: Element) -> None: ... + +_T = TypeVar('_T') + +def iterfind(elem: Element, path: str, namespaces: Optional[Dict[str, str]] = ...) -> List[Element]: ... +def find(elem: Element, path: str, namespaces: Optional[Dict[str, str]] = ...) -> Optional[Element]: ... +def findall(elem: Element, path: str, namespaces: Optional[Dict[str, str]] = ...) -> List[Element]: ... +def findtext(elem: Element, path: str, default: Optional[_T] = ..., namespaces: Optional[Dict[str, str]] = ...) -> Union[_T, str]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/xml/etree/ElementTree.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/xml/etree/ElementTree.pyi new file mode 100644 index 0000000..d5f64b6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/xml/etree/ElementTree.pyi @@ -0,0 +1,167 @@ +# Stubs for xml.etree.ElementTree + +from typing import Any, Callable, Dict, Generator, IO, ItemsView, Iterable, Iterator, KeysView, List, MutableSequence, Optional, overload, Sequence, Text, Tuple, TypeVar, Union +import io +import sys + +VERSION: str + +class ParseError(SyntaxError): ... + +def iselement(element: object) -> bool: ... + +_T = TypeVar('_T') + +# Type for parser inputs. Parser will accept any unicode/str/bytes and coerce, +# and this is true in py2 and py3 (even fromstringlist() in python3 can be +# called with a heterogeneous list) +_parser_input_type = Union[bytes, Text] + +# Type for individual tag/attr/ns/text values in args to most functions. +# In py2, the library accepts str or unicode everywhere and coerces +# aggressively. +# In py3, bytes is not coerced to str and so use of bytes is probably an error, +# so we exclude it. (why? the parser never produces bytes when it parses XML, +# so e.g., element.get(b'name') will always return None for parsed XML, even if +# there is a 'name' attribute.) +_str_argument_type = Union[str, Text] + +# Type for return values from individual tag/attr/text values and serialization +if sys.version_info >= (3,): + # note: in python3, everything comes out as str, yay: + _str_result_type = str + # unfortunately, tostring and tostringlist can return either bytes or str + # depending on the value of `encoding` parameter. Client code knows best: + _tostring_result_type = Any +else: + # in python2, if the tag/attribute/text wasn't decode-able as ascii, it + # comes out as a unicode string; otherwise it comes out as str. (see + # _fixtext function in the source). Client code knows best: + _str_result_type = Any + # On the bright side, tostring and tostringlist always return bytes: + _tostring_result_type = bytes + +class Element(MutableSequence[Element]): + tag: _str_result_type + attrib: Dict[_str_result_type, _str_result_type] + text: Optional[_str_result_type] + tail: Optional[_str_result_type] + def __init__(self, tag: Union[_str_argument_type, Callable[..., Element]], attrib: Dict[_str_argument_type, _str_argument_type] = ..., **extra: _str_argument_type) -> None: ... + def append(self, subelement: Element) -> None: ... + def clear(self) -> None: ... + def copy(self) -> Element: ... + def extend(self, elements: Iterable[Element]) -> None: ... + def find(self, path: _str_argument_type, namespaces: Optional[Dict[_str_argument_type, _str_argument_type]] = ...) -> Optional[Element]: ... + def findall(self, path: _str_argument_type, namespaces: Optional[Dict[_str_argument_type, _str_argument_type]] = ...) -> List[Element]: ... + def findtext(self, path: _str_argument_type, default: Optional[_T] = ..., namespaces: Optional[Dict[_str_argument_type, _str_argument_type]] = ...) -> Union[_T, _str_result_type]: ... + def get(self, key: _str_argument_type, default: Optional[_T] = ...) -> Union[_str_result_type, _T]: ... + def getchildren(self) -> List[Element]: ... + def getiterator(self, tag: Optional[_str_argument_type] = ...) -> List[Element]: ... + if sys.version_info >= (3, 2): + def insert(self, index: int, subelement: Element) -> None: ... + else: + def insert(self, index: int, element: Element) -> None: ... + def items(self) -> ItemsView[_str_result_type, _str_result_type]: ... + def iter(self, tag: Optional[_str_argument_type] = ...) -> Generator[Element, None, None]: ... + def iterfind(self, path: _str_argument_type, namespaces: Optional[Dict[_str_argument_type, _str_argument_type]] = ...) -> List[Element]: ... + def itertext(self) -> Generator[_str_result_type, None, None]: ... + def keys(self) -> KeysView[_str_result_type]: ... + def makeelement(self, tag: _str_argument_type, attrib: Dict[_str_argument_type, _str_argument_type]) -> Element: ... + def remove(self, subelement: Element) -> None: ... + def set(self, key: _str_argument_type, value: _str_argument_type) -> None: ... + def __bool__(self) -> bool: ... + def __delitem__(self, i: Union[int, slice]) -> None: ... + @overload + def __getitem__(self, i: int) -> Element: ... + @overload + def __getitem__(self, s: slice) -> MutableSequence[Element]: ... + def __len__(self) -> int: ... + @overload + def __setitem__(self, i: int, o: Element) -> None: ... + @overload + def __setitem__(self, s: slice, o: Iterable[Element]) -> None: ... + + +def SubElement(parent: Element, tag: _str_argument_type, attrib: Dict[_str_argument_type, _str_argument_type] = ..., **extra: _str_argument_type) -> Element: ... +def Comment(text: Optional[_str_argument_type] = ...) -> Element: ... +def ProcessingInstruction(target: _str_argument_type, text: Optional[_str_argument_type] = ...) -> Element: ... + +PI: Callable[..., Element] + +class QName: + text: str + def __init__(self, text_or_uri: _str_argument_type, tag: Optional[_str_argument_type] = ...) -> None: ... + + +_file_or_filename = Union[str, bytes, int, IO[Any]] + +class ElementTree: + def __init__(self, element: Optional[Element] = ..., file: Optional[_file_or_filename] = ...) -> None: ... + def getroot(self) -> Element: ... + def parse(self, source: _file_or_filename, parser: Optional[XMLParser] = ...) -> Element: ... + def iter(self, tag: Optional[_str_argument_type] = ...) -> Generator[Element, None, None]: ... + def getiterator(self, tag: Optional[_str_argument_type] = ...) -> List[Element]: ... + def find(self, path: _str_argument_type, namespaces: Optional[Dict[_str_argument_type, _str_argument_type]] = ...) -> Optional[Element]: ... + def findtext(self, path: _str_argument_type, default: Optional[_T] = ..., namespaces: Optional[Dict[_str_argument_type, _str_argument_type]] = ...) -> Union[_T, _str_result_type]: ... + def findall(self, path: _str_argument_type, namespaces: Optional[Dict[_str_argument_type, _str_argument_type]] = ...) -> List[Element]: ... + def iterfind(self, path: _str_argument_type, namespaces: Optional[Dict[_str_argument_type, _str_argument_type]] = ...) -> List[Element]: ... + if sys.version_info >= (3, 4): + def write(self, file_or_filename: _file_or_filename, encoding: Optional[str] = ..., xml_declaration: Optional[bool] = ..., default_namespace: Optional[_str_argument_type] = ..., method: Optional[str] = ..., *, short_empty_elements: bool = ...) -> None: ... + else: + def write(self, file_or_filename: _file_or_filename, encoding: Optional[str] = ..., xml_declaration: Optional[bool] = ..., default_namespace: Optional[_str_argument_type] = ..., method: Optional[str] = ...) -> None: ... + def write_c14n(self, file: _file_or_filename) -> None: ... + +def register_namespace(prefix: _str_argument_type, uri: _str_argument_type) -> None: ... +if sys.version_info >= (3, 4): + def tostring(element: Element, encoding: Optional[str] = ..., method: Optional[str] = ..., *, short_empty_elements: bool = ...) -> _tostring_result_type: ... + def tostringlist(element: Element, encoding: Optional[str] = ..., method: Optional[str] = ..., *, short_empty_elements: bool = ...) -> List[_tostring_result_type]: ... +else: + def tostring(element: Element, encoding: Optional[str] = ..., method: Optional[str] = ...) -> _tostring_result_type: ... + def tostringlist(element: Element, encoding: Optional[str] = ..., method: Optional[str] = ...) -> List[_tostring_result_type]: ... +def dump(elem: Element) -> None: ... +def parse(source: _file_or_filename, parser: Optional[XMLParser] = ...) -> ElementTree: ... +def iterparse(source: _file_or_filename, events: Optional[Sequence[str]] = ..., parser: Optional[XMLParser] = ...) -> Iterator[Tuple[str, Any]]: ... + +if sys.version_info >= (3, 4): + class XMLPullParser: + def __init__(self, events: Optional[Sequence[str]] = ..., *, _parser: Optional[XMLParser] = ...) -> None: ... + def feed(self, data: bytes) -> None: ... + def close(self) -> None: ... + def read_events(self) -> Iterator[Tuple[str, Element]]: ... + +def XML(text: _parser_input_type, parser: Optional[XMLParser] = ...) -> Element: ... +def XMLID(text: _parser_input_type, parser: Optional[XMLParser] = ...) -> Tuple[Element, Dict[_str_result_type, Element]]: ... + +# This is aliased to XML in the source. +fromstring = XML + +def fromstringlist(sequence: Sequence[_parser_input_type], parser: Optional[XMLParser] = ...) -> Element: ... + +# This type is both not precise enough and too precise. The TreeBuilder +# requires the elementfactory to accept tag and attrs in its args and produce +# some kind of object that has .text and .tail properties. +# I've chosen to constrain the ElementFactory to always produce an Element +# because that is how almost everyone will use it. +# Unfortunately, the type of the factory arguments is dependent on how +# TreeBuilder is called by client code (they could pass strs, bytes or whatever); +# but we don't want to use a too-broad type, or it would be too hard to write +# elementfactories. +_ElementFactory = Callable[[Any, Dict[Any, Any]], Element] + +class TreeBuilder: + def __init__(self, element_factory: Optional[_ElementFactory] = ...) -> None: ... + def close(self) -> Element: ... + def data(self, data: _parser_input_type) -> None: ... + def start(self, tag: _parser_input_type, attrs: Dict[_parser_input_type, _parser_input_type]) -> Element: ... + def end(self, tag: _parser_input_type) -> Element: ... + +class XMLParser: + parser: Any + target: TreeBuilder + # TODO-what is entity used for??? + entity: Any + version: str + def __init__(self, html: int = ..., target: Optional[TreeBuilder] = ..., encoding: Optional[str] = ...) -> None: ... + def doctype(self, name: str, pubid: str, system: str) -> None: ... + def close(self) -> Element: ... + def feed(self, data: _parser_input_type) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/xml/etree/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/xml/etree/__init__.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/xml/etree/cElementTree.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/xml/etree/cElementTree.pyi new file mode 100644 index 0000000..c384968 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/xml/etree/cElementTree.pyi @@ -0,0 +1,3 @@ +# Stubs for xml.etree.cElementTree (Python 3.4) + +from xml.etree.ElementTree import * # noqa: F403 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/xml/parsers/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/xml/parsers/__init__.pyi new file mode 100644 index 0000000..cac0862 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/xml/parsers/__init__.pyi @@ -0,0 +1 @@ +import xml.parsers.expat as expat diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/xml/parsers/expat/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/xml/parsers/expat/__init__.pyi new file mode 100644 index 0000000..73f3758 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/xml/parsers/expat/__init__.pyi @@ -0,0 +1 @@ +from pyexpat import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/xml/parsers/expat/errors.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/xml/parsers/expat/errors.pyi new file mode 100644 index 0000000..e22d769 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/xml/parsers/expat/errors.pyi @@ -0,0 +1 @@ +from pyexpat.errors import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/xml/parsers/expat/model.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/xml/parsers/expat/model.pyi new file mode 100644 index 0000000..d8f44b4 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/xml/parsers/expat/model.pyi @@ -0,0 +1 @@ +from pyexpat.model import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/xml/sax/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/xml/sax/__init__.pyi new file mode 100644 index 0000000..6edf12d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/xml/sax/__init__.pyi @@ -0,0 +1,34 @@ +from typing import Any, List, NoReturn, Optional, Text, Union, IO + +import xml.sax +from xml.sax.xmlreader import InputSource, Locator +from xml.sax.handler import ContentHandler, ErrorHandler + +class SAXException(Exception): + def __init__(self, msg: str, exception: Optional[Exception] = ...) -> None: ... + def getMessage(self) -> str: ... + def getException(self) -> Exception: ... + def __getitem__(self, ix: Any) -> NoReturn: ... + +class SAXParseException(SAXException): + def __init__(self, msg: str, exception: Exception, locator: Locator) -> None: ... + def getColumnNumber(self) -> int: ... + def getLineNumber(self) -> int: ... + def getPublicId(self): ... + def getSystemId(self): ... + +class SAXNotRecognizedException(SAXException): ... +class SAXNotSupportedException(SAXException): ... +class SAXReaderNotAvailable(SAXNotSupportedException): ... + +default_parser_list: List[str] + +def make_parser(parser_list: List[str] = ...) -> xml.sax.xmlreader.XMLReader: ... + +def parse(source: Union[str, IO[str]], handler: xml.sax.handler.ContentHandler, + errorHandler: xml.sax.handler.ErrorHandler = ...) -> None: ... + +def parseString(string: Union[bytes, Text], handler: xml.sax.handler.ContentHandler, + errorHandler: Optional[xml.sax.handler.ErrorHandler] = ...) -> None: ... + +def _create_parser(parser_name: str) -> xml.sax.xmlreader.XMLReader: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/xml/sax/handler.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/xml/sax/handler.pyi new file mode 100644 index 0000000..3a51933 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/xml/sax/handler.pyi @@ -0,0 +1,46 @@ +from typing import Any + +version: Any + +class ErrorHandler: + def error(self, exception): ... + def fatalError(self, exception): ... + def warning(self, exception): ... + +class ContentHandler: + def __init__(self) -> None: ... + def setDocumentLocator(self, locator): ... + def startDocument(self): ... + def endDocument(self): ... + def startPrefixMapping(self, prefix, uri): ... + def endPrefixMapping(self, prefix): ... + def startElement(self, name, attrs): ... + def endElement(self, name): ... + def startElementNS(self, name, qname, attrs): ... + def endElementNS(self, name, qname): ... + def characters(self, content): ... + def ignorableWhitespace(self, whitespace): ... + def processingInstruction(self, target, data): ... + def skippedEntity(self, name): ... + +class DTDHandler: + def notationDecl(self, name, publicId, systemId): ... + def unparsedEntityDecl(self, name, publicId, systemId, ndata): ... + +class EntityResolver: + def resolveEntity(self, publicId, systemId): ... + +feature_namespaces: Any +feature_namespace_prefixes: Any +feature_string_interning: Any +feature_validation: Any +feature_external_ges: Any +feature_external_pes: Any +all_features: Any +property_lexical_handler: Any +property_declaration_handler: Any +property_dom_node: Any +property_xml_string: Any +property_encoding: Any +property_interning_dict: Any +all_properties: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/xml/sax/saxutils.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/xml/sax/saxutils.pyi new file mode 100644 index 0000000..342d6ed --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/xml/sax/saxutils.pyi @@ -0,0 +1,58 @@ +import sys +from typing import Mapping, Text + +from xml.sax import handler +from xml.sax import xmlreader + +def escape(data: Text, entities: Mapping[Text, Text] = ...) -> Text: ... +def unescape(data: Text, entities: Mapping[Text, Text] = ...) -> Text: ... +def quoteattr(data: Text, entities: Mapping[Text, Text] = ...) -> Text: ... + +class XMLGenerator(handler.ContentHandler): + if sys.version_info >= (3, 0): + def __init__(self, out=..., encoding=..., short_empty_elements: bool = ...) -> None: ... + else: + def __init__(self, out=..., encoding=...) -> None: ... + def startDocument(self): ... + def endDocument(self): ... + def startPrefixMapping(self, prefix, uri): ... + def endPrefixMapping(self, prefix): ... + def startElement(self, name, attrs): ... + def endElement(self, name): ... + def startElementNS(self, name, qname, attrs): ... + def endElementNS(self, name, qname): ... + def characters(self, content): ... + def ignorableWhitespace(self, content): ... + def processingInstruction(self, target, data): ... + +class XMLFilterBase(xmlreader.XMLReader): + def __init__(self, parent=...) -> None: ... + def error(self, exception): ... + def fatalError(self, exception): ... + def warning(self, exception): ... + def setDocumentLocator(self, locator): ... + def startDocument(self): ... + def endDocument(self): ... + def startPrefixMapping(self, prefix, uri): ... + def endPrefixMapping(self, prefix): ... + def startElement(self, name, attrs): ... + def endElement(self, name): ... + def startElementNS(self, name, qname, attrs): ... + def endElementNS(self, name, qname): ... + def characters(self, content): ... + def ignorableWhitespace(self, chars): ... + def processingInstruction(self, target, data): ... + def skippedEntity(self, name): ... + def notationDecl(self, name, publicId, systemId): ... + def unparsedEntityDecl(self, name, publicId, systemId, ndata): ... + def resolveEntity(self, publicId, systemId): ... + def parse(self, source): ... + def setLocale(self, locale): ... + def getFeature(self, name): ... + def setFeature(self, name, state): ... + def getProperty(self, name): ... + def setProperty(self, name, value): ... + def getParent(self): ... + def setParent(self, parent): ... + +def prepare_input_source(source, base=...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/xml/sax/xmlreader.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/xml/sax/xmlreader.pyi new file mode 100644 index 0000000..fbc1ac1 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/xml/sax/xmlreader.pyi @@ -0,0 +1,71 @@ +class XMLReader: + def __init__(self) -> None: ... + def parse(self, source): ... + def getContentHandler(self): ... + def setContentHandler(self, handler): ... + def getDTDHandler(self): ... + def setDTDHandler(self, handler): ... + def getEntityResolver(self): ... + def setEntityResolver(self, resolver): ... + def getErrorHandler(self): ... + def setErrorHandler(self, handler): ... + def setLocale(self, locale): ... + def getFeature(self, name): ... + def setFeature(self, name, state): ... + def getProperty(self, name): ... + def setProperty(self, name, value): ... + +class IncrementalParser(XMLReader): + def __init__(self, bufsize=...) -> None: ... + def parse(self, source): ... + def feed(self, data): ... + def prepareParser(self, source): ... + def close(self): ... + def reset(self): ... + +class Locator: + def getColumnNumber(self): ... + def getLineNumber(self): ... + def getPublicId(self): ... + def getSystemId(self): ... + +class InputSource: + def __init__(self, system_id=...) -> None: ... + def setPublicId(self, public_id): ... + def getPublicId(self): ... + def setSystemId(self, system_id): ... + def getSystemId(self): ... + def setEncoding(self, encoding): ... + def getEncoding(self): ... + def setByteStream(self, bytefile): ... + def getByteStream(self): ... + def setCharacterStream(self, charfile): ... + def getCharacterStream(self): ... + +class AttributesImpl: + def __init__(self, attrs) -> None: ... + def getLength(self): ... + def getType(self, name): ... + def getValue(self, name): ... + def getValueByQName(self, name): ... + def getNameByQName(self, name): ... + def getQNameByName(self, name): ... + def getNames(self): ... + def getQNames(self): ... + def __len__(self): ... + def __getitem__(self, name): ... + def keys(self): ... + def has_key(self, name): ... + def __contains__(self, name): ... + def get(self, name, alternative=...): ... + def copy(self): ... + def items(self): ... + def values(self): ... + +class AttributesNSImpl(AttributesImpl): + def __init__(self, attrs, qnames) -> None: ... + def getValueByQName(self, name): ... + def getNameByQName(self, name): ... + def getQNameByName(self, name): ... + def getQNames(self): ... + def copy(self): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/zipfile.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/zipfile.pyi new file mode 100644 index 0000000..a06d3fd --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/zipfile.pyi @@ -0,0 +1,105 @@ +# Stubs for zipfile + +from typing import Callable, Dict, IO, Iterable, List, Optional, Text, Tuple, Type, Union +from types import TracebackType +import os +import sys + + +if sys.version_info >= (3, 6): + _Path = Union[os.PathLike[Text], Text] +else: + _Path = Text +_SZI = Union[Text, ZipInfo] +_DT = Tuple[int, int, int, int, int, int] + + +if sys.version_info >= (3,): + class BadZipFile(Exception): ... + BadZipfile = BadZipFile +else: + class BadZipfile(Exception): ... +error = BadZipfile + +class LargeZipFile(Exception): ... + +class ZipFile: + debug: int + comment: bytes + filelist: List[ZipInfo] + fp: IO[bytes] + NameToInfo: Dict[Text, ZipInfo] + def __init__(self, file: Union[_Path, IO[bytes]], mode: Text = ..., compression: int = ..., + allowZip64: bool = ...) -> None: ... + def __enter__(self) -> ZipFile: ... + def __exit__(self, exc_type: Optional[Type[BaseException]], + exc_val: Optional[BaseException], + exc_tb: Optional[TracebackType]) -> bool: ... + def close(self) -> None: ... + def getinfo(self, name: Text) -> ZipInfo: ... + def infolist(self) -> List[ZipInfo]: ... + def namelist(self) -> List[Text]: ... + def open(self, name: _SZI, mode: Text = ..., + pwd: Optional[bytes] = ...) -> IO[bytes]: ... + def extract(self, member: _SZI, path: Optional[_SZI] = ..., + pwd: bytes = ...) -> str: ... + def extractall(self, path: Optional[_Path] = ..., + members: Optional[Iterable[Text]] = ..., + pwd: Optional[bytes] = ...) -> None: ... + def printdir(self) -> None: ... + def setpassword(self, pwd: bytes) -> None: ... + def read(self, name: _SZI, pwd: Optional[bytes] = ...) -> bytes: ... + def testzip(self) -> Optional[str]: ... + def write(self, filename: _Path, arcname: Optional[_Path] = ..., + compress_type: Optional[int] = ...) -> None: ... + if sys.version_info >= (3,): + def writestr(self, zinfo_or_arcname: _SZI, data: Union[bytes, str], + compress_type: Optional[int] = ...) -> None: ... + else: + def writestr(self, + zinfo_or_arcname: _SZI, bytes: bytes, + compress_type: Optional[int] = ...) -> None: ... + +class PyZipFile(ZipFile): + if sys.version_info >= (3,): + def __init__(self, file: Union[str, IO[bytes]], mode: str = ..., + compression: int = ..., allowZip64: bool = ..., + opimize: int = ...) -> None: ... + def writepy(self, pathname: str, basename: str = ..., + filterfunc: Optional[Callable[[str], bool]] = ...) -> None: ... + else: + def writepy(self, + pathname: Text, basename: Text = ...) -> None: ... + +class ZipInfo: + filename: Text + date_time: _DT + compress_type: int + comment: bytes + extra: bytes + create_system: int + create_version: int + extract_version: int + reserved: int + flag_bits: int + volume: int + internal_attr: int + external_attr: int + header_offset: int + CRC: int + compress_size: int + file_size: int + def __init__(self, filename: Optional[Text] = ..., + date_time: Optional[_DT] = ...) -> None: ... + if sys.version_info >= (3, 6): + def is_dir(self) -> bool: ... + def FileHeader(self, zip64: Optional[bool] = ...) -> bytes: ... + + +def is_zipfile(filename: Union[_Path, IO[bytes]]) -> bool: ... + +ZIP_STORED: int +ZIP_DEFLATED: int +if sys.version_info >= (3, 3): + ZIP_BZIP2: int + ZIP_LZMA: int diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/zipimport.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/zipimport.pyi new file mode 100644 index 0000000..c22531a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/zipimport.pyi @@ -0,0 +1,18 @@ +"""Stub file for the 'zipimport' module.""" + +from typing import Optional +from types import CodeType, ModuleType + +class ZipImportError(ImportError): ... + +class zipimporter(object): + archive: str + prefix: str + def __init__(self, archivepath: str) -> None: ... + def find_module(self, fullname: str, path: str = ...) -> Optional[zipimporter]: ... + def get_code(self, fullname: str) -> CodeType: ... + def get_data(self, pathname: str) -> str: ... + def get_filename(self, fullname: str) -> str: ... + def get_source(self, fullname: str) -> Optional[str]: ... + def is_package(self, fullname: str) -> bool: ... + def load_module(self, fullname: str) -> ModuleType: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/zlib.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/zlib.pyi new file mode 100644 index 0000000..4ea5372 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/2and3/zlib.pyi @@ -0,0 +1,55 @@ +# Stubs for zlib +import sys + +DEFLATED: int +DEF_MEM_LEVEL: int +MAX_WBITS: int +ZLIB_VERSION: str +Z_BEST_COMPRESSION: int +Z_BEST_SPEED: int +Z_DEFAULT_COMPRESSION: int +Z_DEFAULT_STRATEGY: int +Z_FILTERED: int +Z_FINISH: int +Z_FULL_FLUSH: int +Z_HUFFMAN_ONLY: int +Z_NO_FLUSH: int +Z_SYNC_FLUSH: int +if sys.version_info >= (3,): + DEF_BUF_SIZE: int + ZLIB_RUNTIME_VERSION: str + +class error(Exception): ... + + +class _Compress: + def compress(self, data: bytes) -> bytes: ... + def flush(self, mode: int = ...) -> bytes: ... + def copy(self) -> _Compress: ... + + +class _Decompress: + unused_data: bytes + unconsumed_tail: bytes + if sys.version_info >= (3,): + eof: bool + def decompress(self, data: bytes, max_length: int = ...) -> bytes: ... + def flush(self, length: int = ...) -> bytes: ... + def copy(self) -> _Decompress: ... + + +def adler32(data: bytes, value: int = ...) -> int: ... +def compress(data: bytes, level: int = ...) -> bytes: ... +if sys.version_info >= (3,): + def compressobj(level: int = ..., method: int = ..., wbits: int = ..., + memLevel: int = ..., strategy: int = ..., + zdict: bytes = ...) -> _Compress: ... +else: + def compressobj(level: int = ..., method: int = ..., wbits: int = ..., + memlevel: int = ..., strategy: int = ...) -> _Compress: ... +def crc32(data: bytes, value: int = ...) -> int: ... +def decompress(data: bytes, wbits: int = ..., bufsize: int = ...) -> bytes: ... +if sys.version_info >= (3,): + def decompressobj(wbits: int = ..., zdict: bytes = ...) -> _Decompress: ... +else: + def decompressobj(wbits: int = ...) -> _Decompress: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3.5/zipapp.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3.5/zipapp.pyi new file mode 100644 index 0000000..b90b755 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3.5/zipapp.pyi @@ -0,0 +1,16 @@ +# Stubs for zipapp (Python 3.5+) + +from pathlib import Path +import sys +from typing import BinaryIO, Callable, Optional, Union + +_Path = Union[str, Path, BinaryIO] + +class ZipAppError(Exception): ... + +if sys.version_info >= (3, 7): + def create_archive(source: _Path, target: Optional[_Path] = ..., interpreter: Optional[str] = ..., main: Optional[str] = ..., + filter: Optional[Callable[[Path], bool]] = ..., compressed: bool = ...) -> None: ... +else: + def create_archive(source: _Path, target: Optional[_Path] = ..., interpreter: Optional[str] = ..., main: Optional[str] = ...) -> None: ... +def get_interpreter(archive: _Path) -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3.6/secrets.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3.6/secrets.pyi new file mode 100644 index 0000000..5069dba --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3.6/secrets.pyi @@ -0,0 +1,14 @@ +# Stubs for secrets (Python 3.6) + +from typing import Optional, Sequence, TypeVar +from hmac import compare_digest as compare_digest +from random import SystemRandom as SystemRandom + +_T = TypeVar('_T') + +def randbelow(exclusive_upper_bound: int) -> int: ... +def randbits(k: int) -> int: ... +def choice(seq: Sequence[_T]) -> _T: ... +def token_bytes(nbytes: Optional[int] = ...) -> bytes: ... +def token_hex(nbytes: Optional[int] = ...) -> str: ... +def token_urlsafe(nbytes: Optional[int] = ...) -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3.7/contextvars.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3.7/contextvars.pyi new file mode 100644 index 0000000..ab2ae9e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3.7/contextvars.pyi @@ -0,0 +1,30 @@ +from typing import Any, Callable, ClassVar, Generic, Iterator, Mapping, TypeVar, Union + +_T = TypeVar('_T') + +class ContextVar(Generic[_T]): + def __init__(self, name: str, *, default: _T = ...) -> None: ... + @property + def name(self) -> str: ... + def get(self, default: _T = ...) -> _T: ... + def set(self, value: _T) -> Token[_T]: ... + def reset(self, token: Token[_T]) -> None: ... + +class Token(Generic[_T]): + @property + def var(self) -> ContextVar[_T]: ... + @property + def old_value(self) -> Any: ... # returns either _T or MISSING, but that's hard to express + MISSING: ClassVar[object] + +def copy_context() -> Context: ... + +# It doesn't make sense to make this generic, because for most Contexts each ContextVar will have +# a different value. +class Context(Mapping[ContextVar[Any], Any]): + def __init__(self) -> None: ... + def run(self, callable: Callable[..., _T], *args: Any, **kwargs: Any) -> _T: ... + def copy(self) -> Context: ... + def __getitem__(self, key: ContextVar[Any]) -> Any: ... + def __iter__(self) -> Iterator[ContextVar[Any]]: ... + def __len__(self) -> int: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3.7/dataclasses.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3.7/dataclasses.pyi new file mode 100644 index 0000000..f8bcd52 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3.7/dataclasses.pyi @@ -0,0 +1,71 @@ +from typing import overload, Any, Callable, Dict, Generic, Iterable, List, Mapping, Optional, Tuple, Type, TypeVar, Union + + +_T = TypeVar('_T') + +class _MISSING_TYPE: ... +MISSING: _MISSING_TYPE + +@overload +def asdict(obj: Any) -> Dict[str, Any]: ... +@overload +def asdict(obj: Any, *, dict_factory: Callable[[List[Tuple[str, Any]]], _T]) -> _T: ... + +@overload +def astuple(obj: Any) -> Tuple[Any, ...]: ... +@overload +def astuple(obj: Any, *, tuple_factory: Callable[[List[Any]], _T]) -> _T: ... + + +@overload +def dataclass(_cls: Type[_T]) -> Type[_T]: ... + +@overload +def dataclass(*, init: bool = ..., repr: bool = ..., eq: bool = ..., order: bool = ..., + unsafe_hash: bool = ..., frozen: bool = ...) -> Callable[[Type[_T]], Type[_T]]: ... + + +class Field(Generic[_T]): + name: str + type: Type[_T] + default: _T + default_factory: Callable[[], _T] + repr: bool + hash: Optional[bool] + init: bool + compare: bool + metadata: Optional[Mapping[str, Any]] + + +# NOTE: Actual return type is 'Field[_T]', but we want to help type checkers +# to understand the magic that happens at runtime. +@overload # `default` and `default_factory` are optional and mutually exclusive. +def field(*, default: _T, + init: bool = ..., repr: bool = ..., hash: Optional[bool] = ..., compare: bool = ..., + metadata: Optional[Mapping[str, Any]] = ...) -> _T: ... + +@overload +def field(*, default_factory: Callable[[], _T], + init: bool = ..., repr: bool = ..., hash: Optional[bool] = ..., compare: bool = ..., + metadata: Optional[Mapping[str, Any]] = ...) -> _T: ... + +@overload +def field(*, + init: bool = ..., repr: bool = ..., hash: Optional[bool] = ..., compare: bool = ..., + metadata: Optional[Mapping[str, Any]] = ...) -> Any: ... + + +def fields(class_or_instance: Any) -> Tuple[Field[Any], ...]: ... + +def is_dataclass(obj: Any) -> bool: ... + +class FrozenInstanceError(AttributeError): ... + +class InitVar(Generic[_T]): ... + +def make_dataclass(cls_name: str, fields: Iterable[Union[str, Tuple[str, type], Tuple[str, type, Field[Any]]]], *, + bases: Tuple[type, ...] = ..., namespace: Optional[Dict[str, Any]] = ..., + init: bool = ..., repr: bool = ..., eq: bool = ..., order: bool = ..., hash: bool = ..., + frozen: bool = ...): ... + +def replace(obj: _T, **changes: Any) -> _T: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/_ast.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/_ast.pyi new file mode 100644 index 0000000..9f4284e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/_ast.pyi @@ -0,0 +1,409 @@ +import sys +import typing +from typing import Any, Optional, ClassVar + +PyCF_ONLY_AST: int + +_identifier = str + +class AST: + _attributes: ClassVar[typing.Tuple[str, ...]] + _fields: ClassVar[typing.Tuple[str, ...]] + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + # TODO: Not all nodes have all of the following attributes + lineno: int + col_offset: int + if sys.version_info >= (3, 8): + end_lineno: Optional[int] + end_col_offset: Optional[int] + type_comment: Optional[str] + +class mod(AST): + ... + +if sys.version_info >= (3, 8): + class type_ignore(AST): ... + + class TypeIgnore(type_ignore): ... + + class FunctionType(mod): + argtypes: typing.List[expr] + returns: expr + +class Module(mod): + body: typing.List[stmt] + if sys.version_info >= (3, 7): + docstring: Optional[str] + if sys.version_info >= (3, 8): + type_ignores: typing.List[TypeIgnore] + +class Interactive(mod): + body: typing.List[stmt] + +class Expression(mod): + body: expr + +class Suite(mod): + body: typing.List[stmt] + + +class stmt(AST): ... + +class FunctionDef(stmt): + name: _identifier + args: arguments + body: typing.List[stmt] + decorator_list: typing.List[expr] + returns: Optional[expr] + if sys.version_info >= (3, 7): + docstring: Optional[str] + +class AsyncFunctionDef(stmt): + name: _identifier + args: arguments + body: typing.List[stmt] + decorator_list: typing.List[expr] + returns: Optional[expr] + if sys.version_info >= (3, 7): + docstring: Optional[str] + +class ClassDef(stmt): + name: _identifier + bases: typing.List[expr] + keywords: typing.List[keyword] + body: typing.List[stmt] + decorator_list: typing.List[expr] + if sys.version_info >= (3, 7): + docstring: Optional[str] + +class Return(stmt): + value: Optional[expr] + +class Delete(stmt): + targets: typing.List[expr] + +class Assign(stmt): + targets: typing.List[expr] + value: expr + +class AugAssign(stmt): + target: expr + op: operator + value: expr + +if sys.version_info >= (3, 6): + class AnnAssign(stmt): + target: expr + annotation: expr + value: Optional[expr] + simple: int + +class For(stmt): + target: expr + iter: expr + body: typing.List[stmt] + orelse: typing.List[stmt] + +class AsyncFor(stmt): + target: expr + iter: expr + body: typing.List[stmt] + orelse: typing.List[stmt] + +class While(stmt): + test: expr + body: typing.List[stmt] + orelse: typing.List[stmt] + +class If(stmt): + test: expr + body: typing.List[stmt] + orelse: typing.List[stmt] + +class With(stmt): + items: typing.List[withitem] + body: typing.List[stmt] + +class AsyncWith(stmt): + items: typing.List[withitem] + body: typing.List[stmt] + +class Raise(stmt): + exc: Optional[expr] + cause: Optional[expr] + +class Try(stmt): + body: typing.List[stmt] + handlers: typing.List[ExceptHandler] + orelse: typing.List[stmt] + finalbody: typing.List[stmt] + +class Assert(stmt): + test: expr + msg: Optional[expr] + +class Import(stmt): + names: typing.List[alias] + +class ImportFrom(stmt): + module: Optional[_identifier] + names: typing.List[alias] + level: int + +class Global(stmt): + names: typing.List[_identifier] + +class Nonlocal(stmt): + names: typing.List[_identifier] + +class Expr(stmt): + value: expr + +class Pass(stmt): ... +class Break(stmt): ... +class Continue(stmt): ... + + +class slice(AST): + ... + +_slice = slice # this lets us type the variable named 'slice' below + +class Slice(slice): + lower: Optional[expr] + upper: Optional[expr] + step: Optional[expr] + +class ExtSlice(slice): + dims: typing.List[slice] + +class Index(slice): + value: expr + + +class expr(AST): ... + +class BoolOp(expr): + op: boolop + values: typing.List[expr] + +class BinOp(expr): + left: expr + op: operator + right: expr + +class UnaryOp(expr): + op: unaryop + operand: expr + +class Lambda(expr): + args: arguments + body: expr + +class IfExp(expr): + test: expr + body: expr + orelse: expr + +class Dict(expr): + keys: typing.List[expr] + values: typing.List[expr] + +class Set(expr): + elts: typing.List[expr] + +class ListComp(expr): + elt: expr + generators: typing.List[comprehension] + +class SetComp(expr): + elt: expr + generators: typing.List[comprehension] + +class DictComp(expr): + key: expr + value: expr + generators: typing.List[comprehension] + +class GeneratorExp(expr): + elt: expr + generators: typing.List[comprehension] + +class Await(expr): + value: expr + +class Yield(expr): + value: Optional[expr] + +class YieldFrom(expr): + value: expr + +class Compare(expr): + left: expr + ops: typing.List[cmpop] + comparators: typing.List[expr] + +class Call(expr): + func: expr + args: typing.List[expr] + keywords: typing.List[keyword] + +class Num(expr): # Deprecated in 3.8; use Constant + n: complex + +class Str(expr): # Deprecated in 3.8; use Constant + s: str + +if sys.version_info >= (3, 6): + class FormattedValue(expr): + value: expr + conversion: Optional[int] + format_spec: Optional[expr] + + class JoinedStr(expr): + values: typing.List[expr] + +class Bytes(expr): # Deprecated in 3.8; use Constant + s: bytes + +class NameConstant(expr): + value: Any + +if sys.version_info >= (3, 8): + class Constant(expr): + value: Any # None, str, bytes, bool, int, float, complex, Ellipsis + kind: Optional[str] + # Aliases for value, for backwards compatibility + s: Any + n: complex + + class NamedExpr(expr): + target: expr + value: expr + +class Ellipsis(expr): ... + +class Attribute(expr): + value: expr + attr: _identifier + ctx: expr_context + +class Subscript(expr): + value: expr + slice: _slice + ctx: expr_context + +class Starred(expr): + value: expr + ctx: expr_context + +class Name(expr): + id: _identifier + ctx: expr_context + +class List(expr): + elts: typing.List[expr] + ctx: expr_context + +class Tuple(expr): + elts: typing.List[expr] + ctx: expr_context + + +class expr_context(AST): + ... + +class AugLoad(expr_context): ... +class AugStore(expr_context): ... +class Del(expr_context): ... +class Load(expr_context): ... +class Param(expr_context): ... +class Store(expr_context): ... + + +class boolop(AST): + ... + +class And(boolop): ... +class Or(boolop): ... + +class operator(AST): + ... + +class Add(operator): ... +class BitAnd(operator): ... +class BitOr(operator): ... +class BitXor(operator): ... +class Div(operator): ... +class FloorDiv(operator): ... +class LShift(operator): ... +class Mod(operator): ... +class Mult(operator): ... +class MatMult(operator): ... +class Pow(operator): ... +class RShift(operator): ... +class Sub(operator): ... + +class unaryop(AST): + ... + +class Invert(unaryop): ... +class Not(unaryop): ... +class UAdd(unaryop): ... +class USub(unaryop): ... + +class cmpop(AST): + ... + +class Eq(cmpop): ... +class Gt(cmpop): ... +class GtE(cmpop): ... +class In(cmpop): ... +class Is(cmpop): ... +class IsNot(cmpop): ... +class Lt(cmpop): ... +class LtE(cmpop): ... +class NotEq(cmpop): ... +class NotIn(cmpop): ... + + +class comprehension(AST): + target: expr + iter: expr + ifs: typing.List[expr] + if sys.version_info >= (3, 6): + is_async: int + + +class excepthandler(AST): + ... + +class ExceptHandler(excepthandler): + type: Optional[expr] + name: Optional[_identifier] + body: typing.List[stmt] + + +class arguments(AST): + args: typing.List[arg] + vararg: Optional[arg] + kwonlyargs: typing.List[arg] + kw_defaults: typing.List[expr] + kwarg: Optional[arg] + defaults: typing.List[expr] + +class arg(AST): + arg: _identifier + annotation: Optional[expr] + +class keyword(AST): + arg: Optional[_identifier] + value: expr + +class alias(AST): + name: _identifier + asname: Optional[_identifier] + +class withitem(AST): + context_expr: expr + optional_vars: Optional[expr] diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/_compression.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/_compression.pyi new file mode 100644 index 0000000..bf474e6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/_compression.pyi @@ -0,0 +1,16 @@ +from typing import Any +import io + +BUFFER_SIZE: Any + +class BaseStream(io.BufferedIOBase): ... + +class DecompressReader(io.RawIOBase): + def readable(self): ... + def __init__(self, fp, decomp_factory, trailing_error=..., **decomp_args): ... + def close(self): ... + def seekable(self): ... + def readinto(self, b): ... + def read(self, size: int = ...): ... + def seek(self, offset, whence=...): ... + def tell(self): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/_curses.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/_curses.pyi new file mode 100644 index 0000000..16c6fd7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/_curses.pyi @@ -0,0 +1,447 @@ +from typing import Any, BinaryIO, IO, Optional, Tuple, Union, overload + +_chtype = Union[str, bytes, int] + +ALL_MOUSE_EVENTS: int +A_ALTCHARSET: int +A_ATTRIBUTES: int +A_BLINK: int +A_BOLD: int +A_CHARTEXT: int +A_COLOR: int +A_DIM: int +A_HORIZONTAL: int +A_INVIS: int +A_LEFT: int +A_LOW: int +A_NORMAL: int +A_PROTECT: int +A_REVERSE: int +A_RIGHT: int +A_STANDOUT: int +A_TOP: int +A_UNDERLINE: int +A_VERTICAL: int +BUTTON1_CLICKED: int +BUTTON1_DOUBLE_CLICKED: int +BUTTON1_PRESSED: int +BUTTON1_RELEASED: int +BUTTON1_TRIPLE_CLICKED: int +BUTTON2_CLICKED: int +BUTTON2_DOUBLE_CLICKED: int +BUTTON2_PRESSED: int +BUTTON2_RELEASED: int +BUTTON2_TRIPLE_CLICKED: int +BUTTON3_CLICKED: int +BUTTON3_DOUBLE_CLICKED: int +BUTTON3_PRESSED: int +BUTTON3_RELEASED: int +BUTTON3_TRIPLE_CLICKED: int +BUTTON4_CLICKED: int +BUTTON4_DOUBLE_CLICKED: int +BUTTON4_PRESSED: int +BUTTON4_RELEASED: int +BUTTON4_TRIPLE_CLICKED: int +BUTTON_ALT: int +BUTTON_CTRL: int +BUTTON_SHIFT: int +COLOR_BLACK: int +COLOR_BLUE: int +COLOR_CYAN: int +COLOR_GREEN: int +COLOR_MAGENTA: int +COLOR_RED: int +COLOR_WHITE: int +COLOR_YELLOW: int +ERR: int +KEY_A1: int +KEY_A3: int +KEY_B2: int +KEY_BACKSPACE: int +KEY_BEG: int +KEY_BREAK: int +KEY_BTAB: int +KEY_C1: int +KEY_C3: int +KEY_CANCEL: int +KEY_CATAB: int +KEY_CLEAR: int +KEY_CLOSE: int +KEY_COMMAND: int +KEY_COPY: int +KEY_CREATE: int +KEY_CTAB: int +KEY_DC: int +KEY_DL: int +KEY_DOWN: int +KEY_EIC: int +KEY_END: int +KEY_ENTER: int +KEY_EOL: int +KEY_EOS: int +KEY_EXIT: int +KEY_F0: int +KEY_F1: int +KEY_F10: int +KEY_F11: int +KEY_F12: int +KEY_F13: int +KEY_F14: int +KEY_F15: int +KEY_F16: int +KEY_F17: int +KEY_F18: int +KEY_F19: int +KEY_F2: int +KEY_F20: int +KEY_F21: int +KEY_F22: int +KEY_F23: int +KEY_F24: int +KEY_F25: int +KEY_F26: int +KEY_F27: int +KEY_F28: int +KEY_F29: int +KEY_F3: int +KEY_F30: int +KEY_F31: int +KEY_F32: int +KEY_F33: int +KEY_F34: int +KEY_F35: int +KEY_F36: int +KEY_F37: int +KEY_F38: int +KEY_F39: int +KEY_F4: int +KEY_F40: int +KEY_F41: int +KEY_F42: int +KEY_F43: int +KEY_F44: int +KEY_F45: int +KEY_F46: int +KEY_F47: int +KEY_F48: int +KEY_F49: int +KEY_F5: int +KEY_F50: int +KEY_F51: int +KEY_F52: int +KEY_F53: int +KEY_F54: int +KEY_F55: int +KEY_F56: int +KEY_F57: int +KEY_F58: int +KEY_F59: int +KEY_F6: int +KEY_F60: int +KEY_F61: int +KEY_F62: int +KEY_F63: int +KEY_F7: int +KEY_F8: int +KEY_F9: int +KEY_FIND: int +KEY_HELP: int +KEY_HOME: int +KEY_IC: int +KEY_IL: int +KEY_LEFT: int +KEY_LL: int +KEY_MARK: int +KEY_MAX: int +KEY_MESSAGE: int +KEY_MIN: int +KEY_MOUSE: int +KEY_MOVE: int +KEY_NEXT: int +KEY_NPAGE: int +KEY_OPEN: int +KEY_OPTIONS: int +KEY_PPAGE: int +KEY_PREVIOUS: int +KEY_PRINT: int +KEY_REDO: int +KEY_REFERENCE: int +KEY_REFRESH: int +KEY_REPLACE: int +KEY_RESET: int +KEY_RESIZE: int +KEY_RESTART: int +KEY_RESUME: int +KEY_RIGHT: int +KEY_SAVE: int +KEY_SBEG: int +KEY_SCANCEL: int +KEY_SCOMMAND: int +KEY_SCOPY: int +KEY_SCREATE: int +KEY_SDC: int +KEY_SDL: int +KEY_SELECT: int +KEY_SEND: int +KEY_SEOL: int +KEY_SEXIT: int +KEY_SF: int +KEY_SFIND: int +KEY_SHELP: int +KEY_SHOME: int +KEY_SIC: int +KEY_SLEFT: int +KEY_SMESSAGE: int +KEY_SMOVE: int +KEY_SNEXT: int +KEY_SOPTIONS: int +KEY_SPREVIOUS: int +KEY_SPRINT: int +KEY_SR: int +KEY_SREDO: int +KEY_SREPLACE: int +KEY_SRESET: int +KEY_SRIGHT: int +KEY_SRSUME: int +KEY_SSAVE: int +KEY_SSUSPEND: int +KEY_STAB: int +KEY_SUNDO: int +KEY_SUSPEND: int +KEY_UNDO: int +KEY_UP: int +OK: int +REPORT_MOUSE_POSITION: int +_C_API: Any +version: bytes + +def baudrate() -> int: ... +def beep() -> None: ... +def can_change_color() -> bool: ... +def cbreak(flag: bool = ...) -> None: ... +def color_content(color_number: int) -> Tuple[int, int, int]: ... +def color_pair(color_number: int) -> int: ... +def curs_set(visibility: int) -> int: ... +def def_prog_mode() -> None: ... +def def_shell_mode() -> None: ... +def delay_output(ms: int) -> None: ... +def doupdate() -> None: ... +def echo(flag: bool = ...) -> None: ... +def endwin() -> None: ... +def erasechar() -> bytes: ... +def filter() -> None: ... +def flash() -> None: ... +def flushinp() -> None: ... +def getmouse() -> Tuple[int, int, int, int, int]: ... +def getsyx() -> Tuple[int, int]: ... +def getwin(f: BinaryIO) -> _CursesWindow: ... +def halfdelay(tenths: int) -> None: ... +def has_colors() -> bool: ... +def has_ic() -> bool: ... +def has_il() -> bool: ... +def has_key(ch: int) -> bool: ... +def init_color(color_number: int, r: int, g: int, b: int) -> None: ... +def init_pair(pair_number: int, fg: int, bg: int) -> None: ... +def initscr() -> _CursesWindow: ... +def intrflush(ch: bool) -> None: ... +def is_term_resized(nlines: int, ncols: int) -> bool: ... +def isendwin() -> bool: ... +def keyname(k: int) -> bytes: ... +def killchar() -> bytes: ... +def longname() -> bytes: ... +def meta(yes: bool) -> None: ... +def mouseinterval(interval: int) -> None: ... +def mousemask(mousemask: int) -> Tuple[int, int]: ... +def napms(ms: int) -> int: ... +def newpad(nlines: int, ncols: int) -> _CursesWindow: ... +def newwin(nlines: int, ncols: int, begin_y: int = ..., begin_x: int = ...) -> _CursesWindow: ... +def nl(flag: bool = ...) -> None: ... +def nocbreak() -> None: ... +def noecho() -> None: ... +def nonl() -> None: ... +def noqiflush() -> None: ... +def noraw() -> None: ... +def pair_content(pair_number: int) -> Tuple[int, int]: ... +def pair_number(attr: int) -> int: ... +def putp(string: bytes) -> None: ... +def qiflush(flag: bool = ...) -> None: ... +def raw(flag: bool = ...) -> None: ... +def reset_prog_mode() -> None: ... +def reset_shell_mode() -> None: ... +def resetty() -> None: ... +def resize_term(nlines: int, ncols: int) -> None: ... +def resizeterm(nlines: int, ncols: int) -> None: ... +def savetty() -> None: ... +def setsyx(y: int, x: int) -> None: ... +def setupterm(termstr: str = ..., fd: int = ...) -> None: ... +def start_color() -> None: ... +def termattrs() -> int: ... +def termname() -> bytes: ... +def tigetflag(capname: str) -> int: ... +def tigetnum(capname: str) -> int: ... +def tigetstr(capname: str) -> bytes: ... +def tparm(fmt: bytes, i1: int = ..., i2: int = ..., i3: int = ..., i4: int = ..., i5: int = ..., i6: int = ..., i7: int = ..., i8: int = ..., i9: int = ...) -> bytes: ... +def typeahead(fd: int) -> None: ... +def unctrl(ch: _chtype) -> bytes: ... +def unget_wch(ch: _chtype) -> None: ... +def ungetch(ch: _chtype) -> None: ... +def ungetmouse(id: int, x: int, y: int, z: int, bstate: int) -> None: ... +def update_lines_cols() -> int: ... +def use_default_colors() -> None: ... +def use_env(flag: bool) -> None: ... + +class error(Exception): ... + +class _CursesWindow: + encoding: str + @overload + def addch(self, ch: _chtype, attr: int = ...) -> None: ... + @overload + def addch(self, y: int, x: int, ch: _chtype, attr: int = ...) -> None: ... + @overload + def addnstr(self, str: str, n: int, attr: int = ...) -> None: ... + @overload + def addnstr(self, y: int, x: int, str: str, n: int, attr: int = ...) -> None: ... + @overload + def addstr(self, str: str, attr: int = ...) -> None: ... + @overload + def addstr(self, y: int, x: int, str: str, attr: int = ...) -> None: ... + def attroff(self, attr: int) -> None: ... + def attron(self, attr: int) -> None: ... + def attrset(self, attr: int) -> None: ... + def bkgd(self, ch: _chtype, attr: int = ...) -> None: ... + def bkgset(self, ch: _chtype, attr: int = ...) -> None: ... + def border(self, ls: _chtype = ..., rs: _chtype = ..., ts: _chtype = ..., bs: _chtype = ..., tl: _chtype = ..., tr: _chtype = ..., bl: _chtype = ..., br: _chtype = ...) -> None: ... + @overload + def box(self) -> None: ... + @overload + def box(self, vertch: _chtype = ..., horch: _chtype = ...) -> None: ... + @overload + def chgat(self, attr: int) -> None: ... + @overload + def chgat(self, num: int, attr: int) -> None: ... + @overload + def chgat(self, y: int, x: int, attr: int) -> None: ... + @overload + def chgat(self, y: int, x: int, num: int, attr: int) -> None: ... + def clear(self) -> None: ... + def clearok(self, yes: int) -> None: ... + def clrtobot(self) -> None: ... + def clrtoeol(self) -> None: ... + def cursyncup(self) -> None: ... + @overload + def delch(self) -> None: ... + @overload + def delch(self, y: int, x: int) -> None: ... + def deleteln(self) -> None: ... + @overload + def derwin(self, begin_y: int, begin_x: int) -> _CursesWindow: ... + @overload + def derwin(self, nlines: int, ncols: int, begin_y: int, begin_x: int) -> _CursesWindow: ... + def echochar(self, ch: _chtype, attr: int = ...) -> None: ... + def enclose(self, y: int, x: int) -> bool: ... + def erase(self) -> None: ... + def getbegyx(self) -> Tuple[int, int]: ... + def getbkgd(self) -> Tuple[int, int]: ... + @overload + def getch(self) -> _chtype: ... + @overload + def getch(self, y: int, x: int) -> _chtype: ... + @overload + def get_wch(self) -> _chtype: ... + @overload + def get_wch(self, y: int, x: int) -> _chtype: ... + @overload + def getkey(self) -> str: ... + @overload + def getkey(self, y: int, x: int) -> str: ... + def getmaxyx(self) -> Tuple[int, int]: ... + def getparyx(self) -> Tuple[int, int]: ... + @overload + def getstr(self) -> _chtype: ... + @overload + def getstr(self, n: int) -> _chtype: ... + @overload + def getstr(self, y: int, x: int) -> _chtype: ... + @overload + def getstr(self, y: int, x: int, n: int) -> _chtype: ... + def getyx(self) -> Tuple[int, int]: ... + @overload + def hline(self, ch: _chtype, n: int) -> None: ... + @overload + def hline(self, y: int, x: int, ch: _chtype, n: int) -> None: ... + def idcok(self, flag: bool) -> None: ... + def idlok(self, yes: bool) -> None: ... + def immedok(self, flag: bool) -> None: ... + @overload + def inch(self) -> _chtype: ... + @overload + def inch(self, y: int, x: int) -> _chtype: ... + @overload + def insch(self, ch: _chtype, attr: int = ...) -> None: ... + @overload + def insch(self, y: int, x: int, ch: _chtype, attr: int = ...) -> None: ... + def insdelln(self, nlines: int) -> None: ... + def insertln(self) -> None: ... + @overload + def insnstr(self, str: str, n: int, attr: int = ...) -> None: ... + @overload + def insnstr(self, y: int, x: int, str: str, n: int, attr: int = ...) -> None: ... + @overload + def insstr(self, str: str, attr: int = ...) -> None: ... + @overload + def insstr(self, y: int, x: int, str: str, attr: int = ...) -> None: ... + @overload + def instr(self, n: int = ...) -> _chtype: ... + @overload + def instr(self, y: int, x: int, n: int = ...) -> _chtype: ... + def is_linetouched(self, line: int) -> bool: ... + def is_wintouched(self) -> bool: ... + def keypad(self, yes: bool) -> None: ... + def leaveok(self, yes: bool) -> None: ... + def move(self, new_y: int, new_x: int) -> None: ... + def mvderwin(self, y: int, x: int) -> None: ... + def mvwin(self, new_y: int, new_x: int) -> None: ... + def nodelay(self, yes: bool) -> None: ... + def notimeout(self, yes: bool) -> None: ... + def noutrefresh(self) -> None: ... + @overload + def overlay(self, destwin: _CursesWindow) -> None: ... + @overload + def overlay(self, destwin: _CursesWindow, sminrow: int, smincol: int, dminrow: int, dmincol: int, dmaxrow: int, dmaxcol: int) -> None: ... + @overload + def overwrite(self, destwin: _CursesWindow) -> None: ... + @overload + def overwrite(self, destwin: _CursesWindow, sminrow: int, smincol: int, dminrow: int, dmincol: int, dmaxrow: int, dmaxcol: int) -> None: ... + def putwin(self, file: IO[Any]) -> None: ... + def redrawln(self, beg: int, num: int) -> None: ... + def redrawwin(self) -> None: ... + @overload + def refresh(self) -> None: ... + @overload + def refresh(self, pminrow: int, pmincol: int, sminrow: int, smincol: int, smaxrow: int, smaxcol: int) -> None: ... + def resize(self, nlines: int, ncols: int) -> None: ... + def scroll(self, lines: int = ...) -> None: ... + def scrollok(self, flag: bool) -> None: ... + def setscrreg(self, top: int, bottom: int) -> None: ... + def standend(self) -> None: ... + def standout(self) -> None: ... + @overload + def subpad(self, begin_y: int, begin_x: int) -> _CursesWindow: ... + @overload + def subpad(self, nlines: int, ncols: int, begin_y: int, begin_x: int) -> _CursesWindow: ... + @overload + def subwin(self, begin_y: int, begin_x: int) -> _CursesWindow: ... + @overload + def subwin(self, nlines: int, ncols: int, begin_y: int, begin_x: int) -> _CursesWindow: ... + def syncdown(self) -> None: ... + def syncok(self, flag: bool) -> None: ... + def syncup(self) -> None: ... + def timeout(self, delay: int) -> None: ... + def touchline(self, start: int, count: int, changed: bool = ...) -> None: ... + def touchwin(self) -> None: ... + def untouchwin(self) -> None: ... + @overload + def vline(self, ch: _chtype, n: int) -> None: ... + @overload + def vline(self, y: int, x: int, ch: _chtype, n: int) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/_dummy_thread.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/_dummy_thread.pyi new file mode 100644 index 0000000..1260d42 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/_dummy_thread.pyi @@ -0,0 +1,21 @@ +from typing import Any, Callable, Dict, NoReturn, Optional, Tuple + +TIMEOUT_MAX: int +error = RuntimeError + +def start_new_thread(function: Callable[..., Any], args: Tuple[Any, ...], kwargs: Dict[str, Any] = ...) -> None: ... +def exit() -> NoReturn: ... +def get_ident() -> int: ... +def allocate_lock() -> LockType: ... +def stack_size(size: Optional[int] = ...) -> int: ... + +class LockType(object): + locked_status: bool + def __init__(self) -> None: ... + def acquire(self, waitflag: Optional[bool] = ..., timeout: int = ...) -> bool: ... + def __enter__(self, waitflag: Optional[bool] = ..., timeout: int = ...) -> bool: ... + def __exit__(self, typ: Any, val: Any, tb: Any) -> None: ... + def release(self) -> bool: ... + def locked(self) -> bool: ... + +def interrupt_main() -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/_imp.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/_imp.pyi new file mode 100644 index 0000000..7015b3b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/_imp.pyi @@ -0,0 +1,22 @@ +# Stubs for _imp (Python 3.6) + +import sys +import types +from typing import Any, List + +if sys.version_info >= (3, 5): + from importlib.machinery import ModuleSpec + def create_builtin(spec: ModuleSpec) -> types.ModuleType: ... + def create_dynamic(spec: ModuleSpec, file: Any = ...) -> None: ... + +def acquire_lock() -> None: ... +def exec_builtin(mod: types.ModuleType) -> int: ... +def exec_dynamic(mod: types.ModuleType) -> int: ... +def extension_suffixes() -> List[str]: ... +def get_frozen_object(name: str) -> types.CodeType: ... +def init_frozen(name: str) -> types.ModuleType: ... +def is_builtin(name: str) -> int: ... +def is_frozen(name: str) -> bool: ... +def is_frozen_package(name: str) -> bool: ... +def lock_held() -> bool: ... +def release_lock() -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/_importlib_modulespec.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/_importlib_modulespec.pyi new file mode 100644 index 0000000..51cb489 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/_importlib_modulespec.pyi @@ -0,0 +1,45 @@ +# ModuleSpec, ModuleType, Loader are part of a dependency cycle. +# They are officially defined/exported in other places: +# +# - ModuleType in types +# - Loader in importlib.abc +# - ModuleSpec in importlib.machinery (3.4 and later only) +# +# _Loader is the PEP-451-defined interface for a loader type/object. + +from abc import ABCMeta +import sys +from typing import Any, Dict, List, Optional, Protocol + +class _Loader(Protocol): + def load_module(self, fullname: str) -> ModuleType: ... + +class ModuleSpec: + def __init__(self, name: str, loader: Optional[Loader], *, + origin: Optional[str] = ..., loader_state: Any = ..., + is_package: Optional[bool] = ...) -> None: ... + name: str + loader: Optional[_Loader] + origin: Optional[str] + submodule_search_locations: Optional[List[str]] + loader_state: Any + cached: Optional[str] + parent: Optional[str] + has_location: bool + +class ModuleType: + __name__: str + __file__: str + __dict__: Dict[str, Any] + __loader__: Optional[_Loader] + __package__: Optional[str] + __spec__: Optional[ModuleSpec] + def __init__(self, name: str, doc: Optional[str] = ...) -> None: ... + +class Loader(metaclass=ABCMeta): + def load_module(self, fullname: str) -> ModuleType: ... + def module_repr(self, module: ModuleType) -> str: ... + def create_module(self, spec: ModuleSpec) -> Optional[ModuleType]: ... + # Not defined on the actual class for backwards-compatibility reasons, + # but expected in new code. + def exec_module(self, module: ModuleType) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/_json.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/_json.pyi new file mode 100644 index 0000000..217fadd --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/_json.pyi @@ -0,0 +1,30 @@ +"""Stub file for the '_json' module.""" + +from typing import Any, Tuple + +class make_encoder: + sort_keys: Any + skipkeys: Any + key_separator: Any + indent: Any + markers: Any + default: Any + encoder: Any + item_separator: Any + def __init__(self, markers, default, encoder, indent, key_separator, + item_separator, sort_keys, skipkeys, allow_nan) -> None: ... + def __call__(self, *args, **kwargs) -> Any: ... + +class make_scanner: + object_hook: Any + object_pairs_hook: Any + parse_int: Any + parse_constant: Any + parse_float: Any + strict: bool + # TODO: 'context' needs the attrs above (ducktype), but not __call__. + def __init__(self, context: make_scanner) -> None: ... + def __call__(self, string: str, index: int) -> Tuple[Any, int]: ... + +def encode_basestring_ascii(s: str) -> str: ... +def scanstring(string: str, end: int, strict: bool = ...) -> Tuple[str, int]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/_markupbase.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/_markupbase.pyi new file mode 100644 index 0000000..09f69c7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/_markupbase.pyi @@ -0,0 +1,9 @@ +from typing import Tuple + +class ParserBase: + def __init__(self) -> None: ... + def error(self, message: str) -> None: ... + def reset(self) -> None: ... + def getpos(self) -> Tuple[int, int]: ... + + def unknown_decl(self, data: str) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/_operator.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/_operator.pyi new file mode 100644 index 0000000..6d08cd7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/_operator.pyi @@ -0,0 +1,64 @@ +# Stubs for _operator (Python 3.5) + +import sys +from typing import AnyStr + +# In reality the import is the other way around, but this way we can keep the operator stub in 2and3 +from operator import ( + truth as truth, + contains as contains, + indexOf as indexOf, + countOf as countOf, + is_ as is_, + is_not as is_not, + index as index, + add as add, + sub as sub, + mul as mul, + floordiv as floordiv, + truediv as truediv, + mod as mod, + neg as neg, + pos as pos, + abs as abs, + inv as inv, + invert as invert, + length_hint as length_hint, + lshift as lshift, + rshift as rshift, + not_ as not_, + and_ as and_, + xor as xor, + or_ as or_, + iadd as iadd, + isub as isub, + imul as imul, + ifloordiv as ifloordiv, + itruediv as itruediv, + imod as imod, + ilshift as ilshift, + irshift as irshift, + iand as iand, + ixor as ixor, + ior as ior, + concat as concat, + iconcat as iconcat, + getitem as getitem, + setitem as setitem, + delitem as delitem, + pow as pow, + ipow as ipow, + eq as eq, + ne as ne, + lt as lt, + le as le, + gt as gt, + ge as ge, + itemgetter as itemgetter, + attrgetter as attrgetter, + methodcaller as methodcaller, +) +if sys.version_info >= (3, 5): + from operator import matmul as matmul, imatmul as imatmul + +def _compare_digest(a: AnyStr, b: AnyStr) -> bool: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/_posixsubprocess.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/_posixsubprocess.pyi new file mode 100644 index 0000000..67b7d7c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/_posixsubprocess.pyi @@ -0,0 +1,14 @@ +# Stubs for _posixsubprocess + +# NOTE: These are incomplete! + +from typing import Tuple, Sequence, Callable + +def cloexec_pipe() -> Tuple[int, int]: ... +def fork_exec(args: Sequence[str], + executable_list: Sequence[bytes], close_fds: bool, fds_to_keep: Sequence[int], + cwd: str, env_list: Sequence[bytes], + p2cread: int, p2cwrite: int, c2pred: int, c2pwrite: int, + errread: int, errwrite: int, errpipe_read: int, + errpipe_write: int, restore_signals: int, start_new_session: int, + preexec_fn: Callable[[], None]) -> int: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/_stat.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/_stat.pyi new file mode 100644 index 0000000..ffd28cb --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/_stat.pyi @@ -0,0 +1,69 @@ +"""Stub file for the '_stat' module.""" + +SF_APPEND: int +SF_ARCHIVED: int +SF_IMMUTABLE: int +SF_NOUNLINK: int +SF_SNAPSHOT: int +ST_ATIME: int +ST_CTIME: int +ST_DEV: int +ST_GID: int +ST_INO: int +ST_MODE: int +ST_MTIME: int +ST_NLINK: int +ST_SIZE: int +ST_UID: int +S_ENFMT: int +S_IEXEC: int +S_IFBLK: int +S_IFCHR: int +S_IFDIR: int +S_IFDOOR: int +S_IFIFO: int +S_IFLNK: int +S_IFPORT: int +S_IFREG: int +S_IFSOCK: int +S_IFWHT: int +S_IREAD: int +S_IRGRP: int +S_IROTH: int +S_IRUSR: int +S_IRWXG: int +S_IRWXO: int +S_IRWXU: int +S_ISGID: int +S_ISUID: int +S_ISVTX: int +S_IWGRP: int +S_IWOTH: int +S_IWRITE: int +S_IWUSR: int +S_IXGRP: int +S_IXOTH: int +S_IXUSR: int +UF_APPEND: int +UF_COMPRESSED: int +UF_HIDDEN: int +UF_IMMUTABLE: int +UF_NODUMP: int +UF_NOUNLINK: int +UF_OPAQUE: int + +def S_IMODE(mode: int) -> int: ... +def S_IFMT(mode: int) -> int: ... + +def S_ISBLK(mode: int) -> bool: ... +def S_ISCHR(mode: int) -> bool: ... +def S_ISDIR(mode: int) -> bool: ... +def S_ISDOOR(mode: int) -> bool: ... +def S_ISFIFO(mode: int) -> bool: ... +def S_ISLNK(mode: int) -> bool: ... +def S_ISPORT(mode: int) -> bool: ... +def S_ISREG(mode: int) -> bool: ... +def S_ISSOCK(mode: int) -> bool: ... +def S_ISWHT(mode: int) -> bool: ... + +def filemode(mode: int) -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/_subprocess.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/_subprocess.pyi new file mode 100644 index 0000000..76967b9 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/_subprocess.pyi @@ -0,0 +1,38 @@ +# Stubs for _subprocess + +# NOTE: These are incomplete! + +from typing import Mapping, Any, Tuple + +CREATE_NEW_CONSOLE = 0 +CREATE_NEW_PROCESS_GROUP = 0 +STD_INPUT_HANDLE = 0 +STD_OUTPUT_HANDLE = 0 +STD_ERROR_HANDLE = 0 +SW_HIDE = 0 +STARTF_USESTDHANDLES = 0 +STARTF_USESHOWWINDOW = 0 +INFINITE = 0 +DUPLICATE_SAME_ACCESS = 0 +WAIT_OBJECT_0 = 0 + +# TODO not exported by the Python module +class Handle: + def Close(self) -> None: ... + +def GetVersion() -> int: ... +def GetExitCodeProcess(handle: Handle) -> int: ... +def WaitForSingleObject(handle: Handle, timeout: int) -> int: ... +def CreateProcess(executable: str, cmd_line: str, + proc_attrs, thread_attrs, + inherit: int, flags: int, + env_mapping: Mapping[str, str], + curdir: str, + startupinfo: Any) -> Tuple[Any, Handle, int, int]: ... +def GetModuleFileName(module: int) -> str: ... +def GetCurrentProcess() -> Handle: ... +def DuplicateHandle(source_proc: Handle, source: Handle, target_proc: Handle, + target: Any, access: int, inherit: int) -> int: ... +def CreatePipe(pipe_attrs, size: int) -> Tuple[Handle, Handle]: ... +def GetStdHandle(arg: int) -> int: ... +def TerminateProcess(handle: Handle, exit_code: int) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/_thread.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/_thread.pyi new file mode 100644 index 0000000..41f02b0 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/_thread.pyi @@ -0,0 +1,31 @@ +# Stubs for _thread + +from types import TracebackType +from typing import Any, Callable, Dict, NoReturn, Optional, Tuple, Type + +error = RuntimeError + +def _count() -> int: ... + +_dangling: Any + +class LockType: + def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ... + def release(self) -> None: ... + def locked(self) -> bool: ... + def __enter__(self) -> bool: ... + def __exit__( + self, + type: Optional[Type[BaseException]], + value: Optional[BaseException], + traceback: Optional[TracebackType], + ) -> None: ... + +def start_new_thread(function: Callable[..., Any], args: Tuple[Any, ...], kwargs: Dict[str, Any] = ...) -> int: ... +def interrupt_main() -> None: ... +def exit() -> NoReturn: ... +def allocate_lock() -> LockType: ... +def get_ident() -> int: ... +def stack_size(size: int = ...) -> int: ... + +TIMEOUT_MAX: int diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/_threading_local.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/_threading_local.pyi new file mode 100644 index 0000000..a286d2d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/_threading_local.pyi @@ -0,0 +1,18 @@ +# Source: https://github.com/python/cpython/blob/master/Lib/_threading_local.py +from typing import Any, Dict, List, Tuple +from weakref import ReferenceType + +__all__: List[str] +localdict = Dict[Any, Any] + +class _localimpl: + key: str + dicts: Dict[int, Tuple[ReferenceType, localdict]] + def __init__(self) -> None: ... + def get_dict(self) -> localdict: ... + def create_dict(self) -> localdict: ... + +class local: + def __getattribute__(self, name: str) -> Any: ... + def __setattr__(self, name: str, value: Any) -> None: ... + def __delattr__(self, name: str) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/_tracemalloc.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/_tracemalloc.pyi new file mode 100644 index 0000000..21d0033 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/_tracemalloc.pyi @@ -0,0 +1,26 @@ +"""Stub file for the '_tracemalloc' module.""" +# This is an autogenerated file. It serves as a starting point +# for a more precise manual annotation of this module. +# Feel free to edit the source below, but remove this header when you do. + +from typing import Any + +def _get_object_traceback(*args, **kwargs) -> Any: ... + +def _get_traces() -> Any: + raise MemoryError() + +def clear_traces() -> None: ... + +def get_traceback_limit() -> int: ... + +def get_traced_memory() -> tuple: ... + +def get_tracemalloc_memory() -> Any: ... + +def is_tracing() -> bool: ... + +def start(*args, **kwargs) -> None: + raise ValueError() + +def stop() -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/_warnings.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/_warnings.pyi new file mode 100644 index 0000000..6529c40 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/_warnings.pyi @@ -0,0 +1,11 @@ +from typing import Any, List, Optional, Type + +_defaultaction: str +_onceregistry: dict +filters: List[tuple] + +def warn(message: Warning, category: Optional[Type[Warning]] = ..., stacklevel: int = ...) -> None: ... +def warn_explicit(message: Warning, category: Optional[Type[Warning]], + filename: str, lineno: int, + module: Any = ..., registry: dict = ..., + module_globals: dict = ...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/_winapi.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/_winapi.pyi new file mode 100644 index 0000000..af6c923 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/_winapi.pyi @@ -0,0 +1,96 @@ +from typing import Any, Union, Tuple, Optional, overload, Dict, NoReturn, Sequence + +CREATE_NEW_CONSOLE: int +CREATE_NEW_PROCESS_GROUP: int +DUPLICATE_CLOSE_SOURCE: int +DUPLICATE_SAME_ACCESS: int +ERROR_ALREADY_EXISTS: int +ERROR_BROKEN_PIPE: int +ERROR_IO_PENDING: int +ERROR_MORE_DATA: int +ERROR_NETNAME_DELETED: int +ERROR_NO_DATA: int +ERROR_NO_SYSTEM_RESOURCES: int +ERROR_OPERATION_ABORTED: int +ERROR_PIPE_BUSY: int +ERROR_PIPE_CONNECTED: int +ERROR_SEM_TIMEOUT: int +FILE_FLAG_FIRST_PIPE_INSTANCE: int +FILE_FLAG_OVERLAPPED: int +FILE_GENERIC_READ: int +FILE_GENERIC_WRITE: int +GENERIC_READ: int +GENERIC_WRITE: int +INFINITE: int +NMPWAIT_WAIT_FOREVER: int +NULL: int +OPEN_EXISTING: int +PIPE_ACCESS_DUPLEX: int +PIPE_ACCESS_INBOUND: int +PIPE_READMODE_MESSAGE: int +PIPE_TYPE_MESSAGE: int +PIPE_UNLIMITED_INSTANCES: int +PIPE_WAIT: int +PROCESS_ALL_ACCESS: int +PROCESS_DUP_HANDLE: int +STARTF_USESHOWWINDOW: int +STARTF_USESTDHANDLES: int +STD_ERROR_HANDLE: int +STD_INPUT_HANDLE: int +STD_OUTPUT_HANDLE: int +STILL_ACTIVE: int +SW_HIDE: int +WAIT_ABANDONED_0: int +WAIT_OBJECT_0: int +WAIT_TIMEOUT: int + +def CloseHandle(handle: int) -> None: ... + +# TODO: once literal types are supported, overload with Literal[True/False] +@overload +def ConnectNamedPipe(handle: int, overlapped: Union[int, bool]) -> Any: ... +@overload +def ConnectNamedPipe(handle: int) -> None: ... + +def CreateFile(file_name: str, desired_access: int, share_mode: int, security_attributes: int, creation_disposition: int, flags_and_attributes: int, template_file: int) -> int: ... +def CreateJunction(src_path: str, dest_path: str) -> None: ... +def CreateNamedPipe(name: str, open_mode: int, pipe_mode: int, max_instances: int, out_buffer_size: int, in_buffer_size: int, default_timeout: int, security_attributes: int) -> int: ... +def CreatePipe(pipe_attrs: Any, size: int) -> Tuple[int, int]: ... +def CreateProcess(application_name: Optional[str], command_line: Optional[str], proc_attrs: Any, thread_attrs: Any, inherit_handles: bool, creation_flags: int, env_mapping: Dict[str, str], cwd: Optional[str], startup_info: Any) -> Tuple[int, int, int, int]: ... +def DuplicateHandle(source_process_handle: int, source_handle: int, target_process_handle: int, desired_access: int, inherit_handle: bool, options: int = ...) -> int: ... +def ExitProcess(ExitCode: int) -> NoReturn: ... +def GetACP() -> int: ... +def GetFileType(handle: int) -> int: ... +def GetCurrentProcess() -> int: ... +def GetExitCodeProcess(process: int) -> int: ... +def GetLastError() -> int: ... +def GetModuleFileName(module_handle: int) -> str: ... +def GetStdHandle(std_handle: int) -> int: ... +def GetVersion() -> int: ... +def OpenProcess(desired_access: int, inherit_handle: bool, process_id: int) -> int: ... +def PeekNamedPipe(handle: int, size: int = ...) -> Union[Tuple[int, int], Tuple[bytes, int, int]]: ... + +# TODO: once literal types are supported, overload with Literal[True/False] +@overload +def ReadFile(handle: int, size: int, overlapped: Union[int, bool]) -> Any: ... +@overload +def ReadFile(handle: int, size: int) -> Tuple[int, int]: ... + +def SetNamedPipeHandleState(named_pipe: int, mode: Optional[int], max_collection_count: Optional[int], collect_data_timeout: Optional[int]) -> None: ... +def TerminateProcess(handle: int, exit_code: int) -> None: ... +def WaitForMultipleObjects(handle_seq: Sequence[int], wait_flag: bool, milliseconds: int = ...) -> int: ... +def WaitForSingleObject(handle: int, milliseconds: int) -> int: ... +def WaitNamedPipe(name: str, timeout: int) -> None: ... + +# TODO: once literal types are supported, overload with Literal[True/False] +@overload +def WriteFile(handle: int, buffer: bytes, overlapped: Union[int, bool]) -> Any: ... +@overload +def WriteFile(handle: int, buffer: bytes) -> Tuple[bytes, int]: ... + + +class Overlapped: + event: int = ... + def GetOverlappedResult(self, wait: bool) -> Tuple[int, int]: ... + def cancel(self) -> None: ... + def getbuffer(self) -> Optional[bytes]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/abc.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/abc.pyi new file mode 100644 index 0000000..e9c530d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/abc.pyi @@ -0,0 +1,19 @@ +from typing import Any, Callable, Type, TypeVar +# Stubs for abc. + +_T = TypeVar('_T') +_FuncT = TypeVar('_FuncT', bound=Callable[..., Any]) + +# Thesee definitions have special processing in mypy +class ABCMeta(type): + def register(cls: ABCMeta, subclass: Type[_T]) -> Type[_T]: ... + +def abstractmethod(callable: _FuncT) -> _FuncT: ... +class abstractproperty(property): ... +# These two are deprecated and not supported by mypy +def abstractstaticmethod(callable: _FuncT) -> _FuncT: ... +def abstractclassmethod(callable: _FuncT) -> _FuncT: ... + +class ABC(metaclass=ABCMeta): ... + +def get_cache_token() -> object: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/ast.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/ast.pyi new file mode 100644 index 0000000..090d5f8 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/ast.pyi @@ -0,0 +1,39 @@ +# Python 3.5 ast + +import sys +# Rename typing to _typing, as not to conflict with typing imported +# from _ast below when loaded in an unorthodox way by the Dropbox +# internal Bazel integration. +import typing as _typing +from typing import Any, Iterator, Optional, Union, TypeVar + +# The same unorthodox Bazel integration causes issues with sys, which +# is imported in both modules. unfortunately we can't just rename sys, +# since mypy only supports version checks with a sys that is named +# sys. +from _ast import * # type: ignore + +class NodeVisitor(): + def visit(self, node: AST) -> Any: ... + def generic_visit(self, node: AST) -> Any: ... + +class NodeTransformer(NodeVisitor): + def generic_visit(self, node: AST) -> Optional[AST]: ... + +_T = TypeVar('_T', bound=AST) + +if sys.version_info >= (3, 8): + def parse(source: Union[str, bytes], filename: Union[str, bytes] = ..., mode: str = ..., + type_comments: bool = ..., feature_version: int = ...) -> AST: ... +else: + def parse(source: Union[str, bytes], filename: Union[str, bytes] = ..., mode: str = ...) -> AST: ... + +def copy_location(new_node: _T, old_node: AST) -> _T: ... +def dump(node: AST, annotate_fields: bool = ..., include_attributes: bool = ...) -> str: ... +def fix_missing_locations(node: _T) -> _T: ... +def get_docstring(node: AST, clean: bool = ...) -> str: ... +def increment_lineno(node: _T, n: int = ...) -> _T: ... +def iter_child_nodes(node: AST) -> Iterator[AST]: ... +def iter_fields(node: AST) -> Iterator[_typing.Tuple[str, Any]]: ... +def literal_eval(node_or_string: Union[str, AST]) -> Any: ... +def walk(node: AST) -> Iterator[AST]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/asyncio/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/asyncio/__init__.pyi new file mode 100644 index 0000000..b98c2d1 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/asyncio/__init__.pyi @@ -0,0 +1,125 @@ +import sys +from typing import List, Type + +from asyncio.coroutines import ( + coroutine as coroutine, + iscoroutinefunction as iscoroutinefunction, + iscoroutine as iscoroutine, +) +from asyncio.protocols import ( + BaseProtocol as BaseProtocol, + Protocol as Protocol, + DatagramProtocol as DatagramProtocol, + SubprocessProtocol as SubprocessProtocol, +) +from asyncio.streams import ( + StreamReader as StreamReader, + StreamWriter as StreamWriter, + StreamReaderProtocol as StreamReaderProtocol, + open_connection as open_connection, + start_server as start_server, + IncompleteReadError as IncompleteReadError, + LimitOverrunError as LimitOverrunError, +) +from asyncio.subprocess import ( + create_subprocess_exec as create_subprocess_exec, + create_subprocess_shell as create_subprocess_shell, +) +from asyncio.transports import ( + BaseTransport as BaseTransport, + ReadTransport as ReadTransport, + WriteTransport as WriteTransport, + Transport as Transport, + DatagramTransport as DatagramTransport, + SubprocessTransport as SubprocessTransport, +) +from asyncio.futures import ( + Future as Future, + CancelledError as CancelledError, + TimeoutError as TimeoutError, + InvalidStateError as InvalidStateError, + wrap_future as wrap_future, +) +from asyncio.tasks import ( + FIRST_COMPLETED as FIRST_COMPLETED, + FIRST_EXCEPTION as FIRST_EXCEPTION, + ALL_COMPLETED as ALL_COMPLETED, + as_completed as as_completed, + ensure_future as ensure_future, + gather as gather, + run_coroutine_threadsafe as run_coroutine_threadsafe, + shield as shield, + sleep as sleep, + wait as wait, + wait_for as wait_for, + Task as Task, +) +from asyncio.base_events import BaseEventLoop as BaseEventLoop +from asyncio.events import ( + AbstractEventLoopPolicy as AbstractEventLoopPolicy, + AbstractEventLoop as AbstractEventLoop, + AbstractServer as AbstractServer, + Handle as Handle, + TimerHandle as TimerHandle, + get_event_loop_policy as get_event_loop_policy, + set_event_loop_policy as set_event_loop_policy, + get_event_loop as get_event_loop, + set_event_loop as set_event_loop, + new_event_loop as new_event_loop, + get_child_watcher as get_child_watcher, + set_child_watcher as set_child_watcher, +) +from asyncio.queues import ( + Queue as Queue, + PriorityQueue as PriorityQueue, + LifoQueue as LifoQueue, + QueueFull as QueueFull, + QueueEmpty as QueueEmpty, +) +from asyncio.locks import ( + Lock as Lock, + Event as Event, + Condition as Condition, + Semaphore as Semaphore, + BoundedSemaphore as BoundedSemaphore, +) + +if sys.version_info < (3, 5): + from asyncio.queues import JoinableQueue as JoinableQueue +else: + from asyncio.futures import isfuture as isfuture + from asyncio.events import ( + _set_running_loop as _set_running_loop, + _get_running_loop as _get_running_loop, + ) +if sys.platform != 'win32': + from asyncio.streams import ( + open_unix_connection as open_unix_connection, + start_unix_server as start_unix_server, + ) + +if sys.version_info >= (3, 7): + from asyncio.events import ( + get_running_loop as get_running_loop, + ) + from asyncio.tasks import ( + all_tasks as all_tasks, + create_task as create_task, + current_task as current_task, + ) + from asyncio.runners import ( + run as run, + ) + + +# TODO: It should be possible to instantiate these classes, but mypy +# currently disallows this. +# See https://github.com/python/mypy/issues/1843 +SelectorEventLoop: Type[AbstractEventLoop] +if sys.platform == 'win32': + ProactorEventLoop: Type[AbstractEventLoop] +DefaultEventLoopPolicy: Type[AbstractEventLoopPolicy] + +# TODO: AbstractChildWatcher (UNIX only) + +__all__: List[str] diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/asyncio/base_events.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/asyncio/base_events.pyi new file mode 100644 index 0000000..2262a67 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/asyncio/base_events.pyi @@ -0,0 +1,140 @@ +import selectors +from socket import socket +import ssl +import sys +from typing import Any, Awaitable, Callable, Dict, Generator, List, Optional, Sequence, Tuple, TypeVar, Union, overload +from asyncio.futures import Future +from asyncio.coroutines import coroutine +from asyncio.events import AbstractEventLoop, AbstractServer, Handle, TimerHandle +from asyncio.protocols import BaseProtocol +from asyncio.tasks import Task +from asyncio.transports import BaseTransport + +_T = TypeVar('_T') +_Context = Dict[str, Any] +_ExceptionHandler = Callable[[AbstractEventLoop, _Context], Any] +_ProtocolFactory = Callable[[], BaseProtocol] +_SSLContext = Union[bool, None, ssl.SSLContext] +_TransProtPair = Tuple[BaseTransport, BaseProtocol] + +class BaseEventLoop(AbstractEventLoop): + def run_forever(self) -> None: ... + + # Can't use a union, see mypy issue # 1873. + @overload + def run_until_complete(self, future: Generator[Any, None, _T]) -> _T: ... + @overload + def run_until_complete(self, future: Awaitable[_T]) -> _T: ... + + def stop(self) -> None: ... + def is_running(self) -> bool: ... + def is_closed(self) -> bool: ... + def close(self) -> None: ... + if sys.version_info >= (3, 6): + @coroutine + def shutdown_asyncgens(self) -> Generator[Any, None, None]: ... + # Methods scheduling callbacks. All these return Handles. + def call_soon(self, callback: Callable[..., Any], *args: Any) -> Handle: ... + def call_later(self, delay: float, callback: Callable[..., Any], *args: Any) -> TimerHandle: ... + def call_at(self, when: float, callback: Callable[..., Any], *args: Any) -> TimerHandle: ... + def time(self) -> float: ... + # Future methods + if sys.version_info >= (3, 5): + def create_future(self) -> Future[Any]: ... + # Tasks methods + def create_task(self, coro: Union[Awaitable[_T], Generator[Any, None, _T]]) -> Task[_T]: ... + def set_task_factory(self, factory: Optional[Callable[[AbstractEventLoop, Generator[Any, None, _T]], Future[_T]]]) -> None: ... + def get_task_factory(self) -> Optional[Callable[[AbstractEventLoop, Generator[Any, None, _T]], Future[_T]]]: ... + # Methods for interacting with threads + def call_soon_threadsafe(self, callback: Callable[..., Any], *args: Any) -> Handle: ... + @coroutine + def run_in_executor(self, executor: Any, + func: Callable[..., _T], *args: Any) -> Generator[Any, None, _T]: ... + def set_default_executor(self, executor: Any) -> None: ... + # Network I/O methods returning Futures. + @coroutine + # TODO the "Tuple[Any, ...]" should be "Union[Tuple[str, int], Tuple[str, int, int, int]]" but that triggers + # https://github.com/python/mypy/issues/2509 + def getaddrinfo(self, host: Optional[str], port: Union[str, int, None], *, + family: int = ..., type: int = ..., proto: int = ..., + flags: int = ...) -> Generator[Any, None, List[Tuple[int, int, int, str, Tuple[Any, ...]]]]: ... + @coroutine + def getnameinfo(self, sockaddr: tuple, flags: int = ...) -> Generator[Any, None, Tuple[str, int]]: ... + @overload + @coroutine + def create_connection(self, protocol_factory: _ProtocolFactory, host: str = ..., port: int = ..., *, + ssl: _SSLContext = ..., family: int = ..., proto: int = ..., flags: int = ..., sock: None = ..., + local_addr: Optional[str] = ..., server_hostname: Optional[str] = ...) -> Generator[Any, None, _TransProtPair]: ... + @overload + @coroutine + def create_connection(self, protocol_factory: _ProtocolFactory, host: None = ..., port: None = ..., *, + ssl: _SSLContext = ..., family: int = ..., proto: int = ..., flags: int = ..., sock: socket, + local_addr: None = ..., server_hostname: Optional[str] = ...) -> Generator[Any, None, _TransProtPair]: ... + @overload + @coroutine + def create_server(self, protocol_factory: _ProtocolFactory, host: Optional[Union[str, Sequence[str]]] = ..., port: int = ..., *, + family: int = ..., flags: int = ..., + sock: None = ..., backlog: int = ..., ssl: _SSLContext = ..., + reuse_address: Optional[bool] = ..., + reuse_port: Optional[bool] = ...) -> Generator[Any, None, AbstractServer]: ... + @overload + @coroutine + def create_server(self, protocol_factory: _ProtocolFactory, host: None = ..., port: None = ..., *, + family: int = ..., flags: int = ..., + sock: socket, backlog: int = ..., ssl: _SSLContext = ..., + reuse_address: Optional[bool] = ..., + reuse_port: Optional[bool] = ...) -> Generator[Any, None, AbstractServer]: ... + @coroutine + def create_unix_connection(self, protocol_factory: _ProtocolFactory, path: str, *, + ssl: _SSLContext = ..., sock: Optional[socket] = ..., + server_hostname: str = ...) -> Generator[Any, None, _TransProtPair]: ... + @coroutine + def create_unix_server(self, protocol_factory: _ProtocolFactory, path: str, *, + sock: Optional[socket] = ..., backlog: int = ..., ssl: _SSLContext = ...) -> Generator[Any, None, AbstractServer]: ... + @coroutine + def create_datagram_endpoint(self, protocol_factory: _ProtocolFactory, + local_addr: Optional[Tuple[str, int]] = ..., remote_addr: Optional[Tuple[str, int]] = ..., *, + family: int = ..., proto: int = ..., flags: int = ..., + reuse_address: Optional[bool] = ..., reuse_port: Optional[bool] = ..., + allow_broadcast: Optional[bool] = ..., + sock: Optional[socket] = ...) -> Generator[Any, None, _TransProtPair]: ... + @coroutine + def connect_accepted_socket(self, protocol_factory: _ProtocolFactory, sock: socket, *, ssl: _SSLContext = ...) -> Generator[Any, None, _TransProtPair]: ... + # Pipes and subprocesses. + @coroutine + def connect_read_pipe(self, protocol_factory: _ProtocolFactory, pipe: Any) -> Generator[Any, None, _TransProtPair]: ... + @coroutine + def connect_write_pipe(self, protocol_factory: _ProtocolFactory, pipe: Any) -> Generator[Any, None, _TransProtPair]: ... + @coroutine + def subprocess_shell(self, protocol_factory: _ProtocolFactory, cmd: Union[bytes, str], *, stdin: Any = ..., + stdout: Any = ..., stderr: Any = ..., + **kwargs: Any) -> Generator[Any, None, _TransProtPair]: ... + @coroutine + def subprocess_exec(self, protocol_factory: _ProtocolFactory, *args: Any, stdin: Any = ..., + stdout: Any = ..., stderr: Any = ..., + **kwargs: Any) -> Generator[Any, None, _TransProtPair]: ... + def add_reader(self, fd: selectors._FileObject, callback: Callable[..., Any], *args: Any) -> None: ... + def remove_reader(self, fd: selectors._FileObject) -> None: ... + def add_writer(self, fd: selectors._FileObject, callback: Callable[..., Any], *args: Any) -> None: ... + def remove_writer(self, fd: selectors._FileObject) -> None: ... + # Completion based I/O methods returning Futures. + @coroutine + def sock_recv(self, sock: socket, nbytes: int) -> Generator[Any, None, bytes]: ... + @coroutine + def sock_sendall(self, sock: socket, data: bytes) -> Generator[Any, None, None]: ... + @coroutine + def sock_connect(self, sock: socket, address: str) -> Generator[Any, None, None]: ... + @coroutine + def sock_accept(self, sock: socket) -> Generator[Any, None, Tuple[socket, Any]]: ... + # Signal handling. + def add_signal_handler(self, sig: int, callback: Callable[..., Any], *args: Any) -> None: ... + def remove_signal_handler(self, sig: int) -> None: ... + # Error handlers. + def set_exception_handler(self, handler: Optional[_ExceptionHandler]) -> None: ... + if sys.version_info >= (3, 5): + def get_exception_handler(self) -> Optional[_ExceptionHandler]: ... + def default_exception_handler(self, context: _Context) -> None: ... + def call_exception_handler(self, context: _Context) -> None: ... + # Debug flag management. + def get_debug(self) -> bool: ... + def set_debug(self, enabled: bool) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/asyncio/coroutines.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/asyncio/coroutines.pyi new file mode 100644 index 0000000..981ccd5 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/asyncio/coroutines.pyi @@ -0,0 +1,9 @@ +from typing import Any, Callable, Generator, List, TypeVar + +__all__: List[str] + +_F = TypeVar('_F', bound=Callable[..., Any]) + +def coroutine(func: _F) -> _F: ... +def iscoroutinefunction(func: Callable[..., Any]) -> bool: ... +def iscoroutine(obj: Any) -> bool: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/asyncio/events.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/asyncio/events.pyi new file mode 100644 index 0000000..c81d027 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/asyncio/events.pyi @@ -0,0 +1,246 @@ +import selectors +from socket import socket +import ssl +import sys +from typing import Any, Awaitable, Callable, Dict, Generator, List, Optional, Sequence, Tuple, TypeVar, Union, overload +from abc import ABCMeta, abstractmethod +from asyncio.futures import Future +from asyncio.coroutines import coroutine +from asyncio.protocols import BaseProtocol +from asyncio.tasks import Task +from asyncio.transports import BaseTransport + +__all__: List[str] + +_T = TypeVar('_T') +_Context = Dict[str, Any] +_ExceptionHandler = Callable[[AbstractEventLoop, _Context], Any] +_ProtocolFactory = Callable[[], BaseProtocol] +_SSLContext = Union[bool, None, ssl.SSLContext] +_TransProtPair = Tuple[BaseTransport, BaseProtocol] + +class Handle: + _cancelled = False + _args: List[Any] + def __init__(self, callback: Callable[..., Any], args: List[Any], loop: AbstractEventLoop) -> None: ... + def __repr__(self) -> str: ... + def cancel(self) -> None: ... + def _run(self) -> None: ... + +class TimerHandle(Handle): + def __init__(self, when: float, callback: Callable[..., Any], args: List[Any], + loop: AbstractEventLoop) -> None: ... + def __hash__(self) -> int: ... + +class AbstractServer: + sockets: Optional[List[socket]] + def close(self) -> None: ... + @coroutine + def wait_closed(self) -> Generator[Any, None, None]: ... + +class AbstractEventLoop(metaclass=ABCMeta): + slow_callback_duration: float = ... + @abstractmethod + def run_forever(self) -> None: ... + + # Can't use a union, see mypy issue # 1873. + @overload + @abstractmethod + def run_until_complete(self, future: Generator[Any, None, _T]) -> _T: ... + @overload + @abstractmethod + def run_until_complete(self, future: Awaitable[_T]) -> _T: ... + + @abstractmethod + def stop(self) -> None: ... + @abstractmethod + def is_running(self) -> bool: ... + @abstractmethod + def is_closed(self) -> bool: ... + @abstractmethod + def close(self) -> None: ... + if sys.version_info >= (3, 6): + @abstractmethod + @coroutine + def shutdown_asyncgens(self) -> Generator[Any, None, None]: ... + # Methods scheduling callbacks. All these return Handles. + @abstractmethod + def call_soon(self, callback: Callable[..., Any], *args: Any) -> Handle: ... + @abstractmethod + def call_later(self, delay: float, callback: Callable[..., Any], *args: Any) -> TimerHandle: ... + @abstractmethod + def call_at(self, when: float, callback: Callable[..., Any], *args: Any) -> TimerHandle: ... + @abstractmethod + def time(self) -> float: ... + # Future methods + if sys.version_info >= (3, 5): + @abstractmethod + def create_future(self) -> Future[Any]: ... + # Tasks methods + @abstractmethod + def create_task(self, coro: Union[Awaitable[_T], Generator[Any, None, _T]]) -> Task[_T]: ... + @abstractmethod + def set_task_factory(self, factory: Optional[Callable[[AbstractEventLoop, Generator[Any, None, _T]], Future[_T]]]) -> None: ... + @abstractmethod + def get_task_factory(self) -> Optional[Callable[[AbstractEventLoop, Generator[Any, None, _T]], Future[_T]]]: ... + # Methods for interacting with threads + @abstractmethod + def call_soon_threadsafe(self, callback: Callable[..., Any], *args: Any) -> Handle: ... + @abstractmethod + @coroutine + def run_in_executor(self, executor: Any, + func: Callable[..., _T], *args: Any) -> Generator[Any, None, _T]: ... + @abstractmethod + def set_default_executor(self, executor: Any) -> None: ... + # Network I/O methods returning Futures. + @abstractmethod + @coroutine + # TODO the "Tuple[Any, ...]" should be "Union[Tuple[str, int], Tuple[str, int, int, int]]" but that triggers + # https://github.com/python/mypy/issues/2509 + def getaddrinfo(self, host: Optional[str], port: Union[str, int, None], *, + family: int = ..., type: int = ..., proto: int = ..., + flags: int = ...) -> Generator[Any, None, List[Tuple[int, int, int, str, Tuple[Any, ...]]]]: ... + @abstractmethod + @coroutine + def getnameinfo(self, sockaddr: tuple, flags: int = ...) -> Generator[Any, None, Tuple[str, int]]: ... + @overload + @abstractmethod + @coroutine + def create_connection(self, protocol_factory: _ProtocolFactory, host: str = ..., port: int = ..., *, + ssl: _SSLContext = ..., family: int = ..., proto: int = ..., flags: int = ..., sock: None = ..., + local_addr: Optional[str] = ..., server_hostname: Optional[str] = ...) -> Generator[Any, None, _TransProtPair]: ... + @overload + @abstractmethod + @coroutine + def create_connection(self, protocol_factory: _ProtocolFactory, host: None = ..., port: None = ..., *, + ssl: _SSLContext = ..., family: int = ..., proto: int = ..., flags: int = ..., sock: socket, + local_addr: None = ..., server_hostname: Optional[str] = ...) -> Generator[Any, None, _TransProtPair]: ... + @overload + @abstractmethod + @coroutine + def create_server(self, protocol_factory: _ProtocolFactory, host: Optional[Union[str, Sequence[str]]] = ..., port: int = ..., *, + family: int = ..., flags: int = ..., + sock: None = ..., backlog: int = ..., ssl: _SSLContext = ..., + reuse_address: Optional[bool] = ..., + reuse_port: Optional[bool] = ...) -> Generator[Any, None, AbstractServer]: ... + @overload + @abstractmethod + @coroutine + def create_server(self, protocol_factory: _ProtocolFactory, host: None = ..., port: None = ..., *, + family: int = ..., flags: int = ..., + sock: socket, backlog: int = ..., ssl: _SSLContext = ..., + reuse_address: Optional[bool] = ..., + reuse_port: Optional[bool] = ...) -> Generator[Any, None, AbstractServer]: ... + @abstractmethod + @coroutine + def create_unix_connection(self, protocol_factory: _ProtocolFactory, path: str, *, + ssl: _SSLContext = ..., sock: Optional[socket] = ..., + server_hostname: str = ...) -> Generator[Any, None, _TransProtPair]: ... + @abstractmethod + @coroutine + def create_unix_server(self, protocol_factory: _ProtocolFactory, path: str, *, + sock: Optional[socket] = ..., backlog: int = ..., ssl: _SSLContext = ...) -> Generator[Any, None, AbstractServer]: ... + @abstractmethod + @coroutine + def create_datagram_endpoint(self, protocol_factory: _ProtocolFactory, + local_addr: Optional[Tuple[str, int]] = ..., remote_addr: Optional[Tuple[str, int]] = ..., *, + family: int = ..., proto: int = ..., flags: int = ..., + reuse_address: Optional[bool] = ..., reuse_port: Optional[bool] = ..., + allow_broadcast: Optional[bool] = ..., + sock: Optional[socket] = ...) -> Generator[Any, None, _TransProtPair]: ... + @abstractmethod + @coroutine + def connect_accepted_socket(self, protocol_factory: _ProtocolFactory, sock: socket, *, ssl: _SSLContext = ...) -> Generator[Any, None, _TransProtPair]: ... + # Pipes and subprocesses. + @abstractmethod + @coroutine + def connect_read_pipe(self, protocol_factory: _ProtocolFactory, pipe: Any) -> Generator[Any, None, _TransProtPair]: ... + @abstractmethod + @coroutine + def connect_write_pipe(self, protocol_factory: _ProtocolFactory, pipe: Any) -> Generator[Any, None, _TransProtPair]: ... + @abstractmethod + @coroutine + def subprocess_shell(self, protocol_factory: _ProtocolFactory, cmd: Union[bytes, str], *, stdin: Any = ..., + stdout: Any = ..., stderr: Any = ..., + **kwargs: Any) -> Generator[Any, None, _TransProtPair]: ... + @abstractmethod + @coroutine + def subprocess_exec(self, protocol_factory: _ProtocolFactory, *args: Any, stdin: Any = ..., + stdout: Any = ..., stderr: Any = ..., + **kwargs: Any) -> Generator[Any, None, _TransProtPair]: ... + @abstractmethod + def add_reader(self, fd: selectors._FileObject, callback: Callable[..., Any], *args: Any) -> None: ... + @abstractmethod + def remove_reader(self, fd: selectors._FileObject) -> None: ... + @abstractmethod + def add_writer(self, fd: selectors._FileObject, callback: Callable[..., Any], *args: Any) -> None: ... + @abstractmethod + def remove_writer(self, fd: selectors._FileObject) -> None: ... + # Completion based I/O methods returning Futures. + @abstractmethod + @coroutine + def sock_recv(self, sock: socket, nbytes: int) -> Generator[Any, None, bytes]: ... + @abstractmethod + @coroutine + def sock_sendall(self, sock: socket, data: bytes) -> Generator[Any, None, None]: ... + @abstractmethod + @coroutine + def sock_connect(self, sock: socket, address: str) -> Generator[Any, None, None]: ... + @abstractmethod + @coroutine + def sock_accept(self, sock: socket) -> Generator[Any, None, Tuple[socket, Any]]: ... + # Signal handling. + @abstractmethod + def add_signal_handler(self, sig: int, callback: Callable[..., Any], *args: Any) -> None: ... + @abstractmethod + def remove_signal_handler(self, sig: int) -> None: ... + # Error handlers. + @abstractmethod + def set_exception_handler(self, handler: Optional[_ExceptionHandler]) -> None: ... + if sys.version_info >= (3, 5): + @abstractmethod + def get_exception_handler(self) -> Optional[_ExceptionHandler]: ... + @abstractmethod + def default_exception_handler(self, context: _Context) -> None: ... + @abstractmethod + def call_exception_handler(self, context: _Context) -> None: ... + # Debug flag management. + @abstractmethod + def get_debug(self) -> bool: ... + @abstractmethod + def set_debug(self, enabled: bool) -> None: ... + +class AbstractEventLoopPolicy(metaclass=ABCMeta): + @abstractmethod + def get_event_loop(self) -> AbstractEventLoop: ... + @abstractmethod + def set_event_loop(self, loop: Optional[AbstractEventLoop]) -> None: ... + @abstractmethod + def new_event_loop(self) -> AbstractEventLoop: ... + # Child processes handling (Unix only). + @abstractmethod + def get_child_watcher(self) -> Any: ... # TODO: unix_events.AbstractChildWatcher + @abstractmethod + def set_child_watcher(self, watcher: Any) -> None: ... # TODO: unix_events.AbstractChildWatcher + +class BaseDefaultEventLoopPolicy(AbstractEventLoopPolicy, metaclass=ABCMeta): + def __init__(self) -> None: ... + def get_event_loop(self) -> AbstractEventLoop: ... + def set_event_loop(self, loop: Optional[AbstractEventLoop]) -> None: ... + def new_event_loop(self) -> AbstractEventLoop: ... + +def get_event_loop_policy() -> AbstractEventLoopPolicy: ... +def set_event_loop_policy(policy: AbstractEventLoopPolicy) -> None: ... + +def get_event_loop() -> AbstractEventLoop: ... +def set_event_loop(loop: Optional[AbstractEventLoop]) -> None: ... +def new_event_loop() -> AbstractEventLoop: ... + +def get_child_watcher() -> Any: ... # TODO: unix_events.AbstractChildWatcher +def set_child_watcher(watcher: Any) -> None: ... # TODO: unix_events.AbstractChildWatcher + +def _set_running_loop(loop: Optional[AbstractEventLoop]) -> None: ... +def _get_running_loop() -> AbstractEventLoop: ... + +if sys.version_info >= (3, 7): + def get_running_loop() -> AbstractEventLoop: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/asyncio/futures.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/asyncio/futures.pyi new file mode 100644 index 0000000..ed2e4a0 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/asyncio/futures.pyi @@ -0,0 +1,64 @@ +import sys +from typing import Any, Union, Callable, TypeVar, Type, List, Generic, Iterable, Generator, Awaitable, Optional, Tuple +from .events import AbstractEventLoop +from concurrent.futures import ( + CancelledError as CancelledError, + TimeoutError as TimeoutError, + Future as _ConcurrentFuture, + Error, +) + +if sys.version_info >= (3, 7): + from contextvars import Context + +__all__: List[str] + +_T = TypeVar('_T') +_S = TypeVar('_S', bound=Future) + +class InvalidStateError(Error): ... + +class _TracebackLogger: + exc: BaseException + tb: List[str] + def __init__(self, exc: Any, loop: AbstractEventLoop) -> None: ... + def activate(self) -> None: ... + def clear(self) -> None: ... + def __del__(self) -> None: ... + +if sys.version_info >= (3, 5): + def isfuture(obj: object) -> bool: ... + +class Future(Awaitable[_T], Iterable[_T]): + _state: str + _exception: BaseException + _blocking = False + _log_traceback = False + _tb_logger: Type[_TracebackLogger] + def __init__(self, *, loop: Optional[AbstractEventLoop] = ...) -> None: ... + def __repr__(self) -> str: ... + def __del__(self) -> None: ... + if sys.version_info >= (3, 7): + def get_loop(self) -> AbstractEventLoop: ... + def _callbacks(self: _S) -> List[Tuple[Callable[[_S], Any], Context]]: ... + def add_done_callback(self: _S, __fn: Callable[[_S], Any], *, context: Optional[Context] = ...) -> None: ... + else: + @property + def _callbacks(self: _S) -> List[Callable[[_S], Any]]: ... + def add_done_callback(self: _S, __fn: Callable[[_S], Any]) -> None: ... + def cancel(self) -> bool: ... + def _schedule_callbacks(self) -> None: ... + def cancelled(self) -> bool: ... + def done(self) -> bool: ... + def result(self) -> _T: ... + def exception(self) -> BaseException: ... + def remove_done_callback(self: _S, fn: Callable[[_S], Any]) -> int: ... + def set_result(self, result: _T) -> None: ... + def set_exception(self, exception: Union[type, BaseException]) -> None: ... + def _copy_state(self, other: Any) -> None: ... + def __iter__(self) -> Generator[Any, None, _T]: ... + def __await__(self) -> Generator[Any, None, _T]: ... + @property + def _loop(self) -> AbstractEventLoop: ... + +def wrap_future(f: Union[_ConcurrentFuture[_T], Future[_T]]) -> Future[_T]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/asyncio/locks.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/asyncio/locks.pyi new file mode 100644 index 0000000..56b8a67 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/asyncio/locks.pyi @@ -0,0 +1,60 @@ +from typing import Any, Callable, Generator, Iterable, Iterator, List, Type, TypeVar, Union, Optional, Awaitable + +from .coroutines import coroutine +from .events import AbstractEventLoop +from .futures import Future +from types import TracebackType + +_T = TypeVar('_T') + +__all__: List[str] + +class _ContextManager: + def __init__(self, lock: Union[Lock, Semaphore]) -> None: ... + def __enter__(self) -> object: ... + def __exit__(self, *args: Any) -> None: ... + +class _ContextManagerMixin(Future[_ContextManager]): + # Apparently this exists to *prohibit* use as a context manager. + def __enter__(self) -> object: ... + def __exit__(self, *args: Any) -> None: ... + def __aenter__(self) -> Awaitable[None]: ... + def __aexit__(self, exc_type: Optional[Type[BaseException]], exc: Optional[BaseException], tb: Optional[TracebackType]) -> Awaitable[None]: ... + +class Lock(_ContextManagerMixin): + def __init__(self, *, loop: Optional[AbstractEventLoop] = ...) -> None: ... + def locked(self) -> bool: ... + @coroutine + def acquire(self) -> Generator[Any, None, bool]: ... + def release(self) -> None: ... + +class Event: + def __init__(self, *, loop: Optional[AbstractEventLoop] = ...) -> None: ... + def is_set(self) -> bool: ... + def set(self) -> None: ... + def clear(self) -> None: ... + @coroutine + def wait(self) -> Generator[Any, None, bool]: ... + +class Condition(_ContextManagerMixin): + def __init__(self, lock: Optional[Lock] = ..., *, loop: Optional[AbstractEventLoop] = ...) -> None: ... + def locked(self) -> bool: ... + @coroutine + def acquire(self) -> Generator[Any, None, bool]: ... + def release(self) -> None: ... + @coroutine + def wait(self) -> Generator[Any, None, bool]: ... + @coroutine + def wait_for(self, predicate: Callable[[], _T]) -> Generator[Any, None, _T]: ... + def notify(self, n: int = ...) -> None: ... + def notify_all(self) -> None: ... + +class Semaphore(_ContextManagerMixin): + def __init__(self, value: int = ..., *, loop: Optional[AbstractEventLoop] = ...) -> None: ... + def locked(self) -> bool: ... + @coroutine + def acquire(self) -> Generator[Any, None, bool]: ... + def release(self) -> None: ... + +class BoundedSemaphore(Semaphore): + def __init__(self, value: int = ..., *, loop: Optional[AbstractEventLoop] = ...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/asyncio/protocols.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/asyncio/protocols.pyi new file mode 100644 index 0000000..bb258e1 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/asyncio/protocols.pyi @@ -0,0 +1,24 @@ +from asyncio import transports +from typing import List, Optional, Text, Tuple, Union + +__all__: List[str] + + +class BaseProtocol: + def connection_made(self, transport: transports.BaseTransport) -> None: ... + def connection_lost(self, exc: Optional[Exception]) -> None: ... + def pause_writing(self) -> None: ... + def resume_writing(self) -> None: ... + +class Protocol(BaseProtocol): + def data_received(self, data: bytes) -> None: ... + def eof_received(self) -> Optional[bool]: ... + +class DatagramProtocol(BaseProtocol): + def datagram_received(self, data: Union[bytes, Text], addr: Tuple[str, int]) -> None: ... + def error_received(self, exc: Exception) -> None: ... + +class SubprocessProtocol(BaseProtocol): + def pipe_data_received(self, fd: int, data: Union[bytes, Text]) -> None: ... + def pipe_connection_lost(self, fd: int, exc: Optional[Exception]) -> None: ... + def process_exited(self) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/asyncio/queues.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/asyncio/queues.pyi new file mode 100644 index 0000000..dc4e9ef --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/asyncio/queues.pyi @@ -0,0 +1,50 @@ +import sys +from asyncio.events import AbstractEventLoop +from .coroutines import coroutine +from .futures import Future +from typing import Any, Generator, Generic, List, TypeVar, Optional + +__all__: List[str] + + +class QueueEmpty(Exception): ... +class QueueFull(Exception): ... + +_T = TypeVar('_T') + +class Queue(Generic[_T]): + def __init__(self, maxsize: int = ..., *, loop: Optional[AbstractEventLoop] = ...) -> None: ... + def _init(self, maxsize: int) -> None: ... + def _get(self) -> _T: ... + def _put(self, item: _T) -> None: ... + def __repr__(self) -> str: ... + def __str__(self) -> str: ... + def _format(self) -> str: ... + def _consume_done_getters(self) -> None: ... + def _consume_done_putters(self) -> None: ... + def qsize(self) -> int: ... + @property + def maxsize(self) -> int: ... + def empty(self) -> bool: ... + def full(self) -> bool: ... + @coroutine + def put(self, item: _T) -> Generator[Any, None, None]: ... + def put_nowait(self, item: _T) -> None: ... + @coroutine + def get(self) -> Generator[Any, None, _T]: ... + def get_nowait(self) -> _T: ... + @coroutine + def join(self) -> Generator[Any, None, bool]: ... + def task_done(self) -> None: ... + + +class PriorityQueue(Queue[_T]): ... + + +class LifoQueue(Queue[_T]): ... + +if sys.version_info < (3, 5): + class JoinableQueue(Queue[_T]): + def task_done(self) -> None: ... + @coroutine + def join(self) -> Generator[Any, None, bool]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/asyncio/runners.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/asyncio/runners.pyi new file mode 100644 index 0000000..7d8c28c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/asyncio/runners.pyi @@ -0,0 +1,9 @@ +import sys + + +if sys.version_info >= (3, 7): + from typing import Awaitable, TypeVar + + _T = TypeVar('_T') + + def run(main: Awaitable[_T], *, debug: bool = ...) -> _T: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/asyncio/streams.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/asyncio/streams.pyi new file mode 100644 index 0000000..68271c0 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/asyncio/streams.pyi @@ -0,0 +1,119 @@ +import sys +from typing import Any, Awaitable, Callable, Generator, Iterable, List, Optional, Tuple, Union + +from . import coroutines +from . import events +from . import protocols +from . import transports + +_ClientConnectedCallback = Callable[[StreamReader, StreamWriter], Optional[Awaitable[None]]] + + +__all__: List[str] + +class IncompleteReadError(EOFError): + expected: Optional[int] + partial: bytes + def __init__(self, partial: bytes, expected: Optional[int]) -> None: ... + +class LimitOverrunError(Exception): + consumed: int + def __init__(self, message: str, consumed: int) -> None: ... + +@coroutines.coroutine +def open_connection( + host: str = ..., + port: Union[int, str] = ..., + *, + loop: Optional[events.AbstractEventLoop] = ..., + limit: int = ..., + **kwds: Any +) -> Generator[Any, None, Tuple[StreamReader, StreamWriter]]: ... + +@coroutines.coroutine +def start_server( + client_connected_cb: _ClientConnectedCallback, + host: Optional[str] = ..., + port: Optional[Union[int, str]] = ..., + *, + loop: Optional[events.AbstractEventLoop] = ..., + limit: int = ..., + **kwds: Any +) -> Generator[Any, None, events.AbstractServer]: ... + +if sys.platform != 'win32': + if sys.version_info >= (3, 7): + from os import PathLike + _PathType = Union[str, PathLike[str]] + else: + _PathType = str + + @coroutines.coroutine + def open_unix_connection( + path: _PathType = ..., + *, + loop: Optional[events.AbstractEventLoop] = ..., + limit: int = ..., + **kwds: Any + ) -> Generator[Any, None, Tuple[StreamReader, StreamWriter]]: ... + + @coroutines.coroutine + def start_unix_server( + client_connected_cb: _ClientConnectedCallback, + path: _PathType = ..., + *, + loop: Optional[events.AbstractEventLoop] = ..., + limit: int = ..., + **kwds: Any) -> Generator[Any, None, events.AbstractServer]: ... + +class FlowControlMixin(protocols.Protocol): ... + +class StreamReaderProtocol(FlowControlMixin, protocols.Protocol): + def __init__(self, + stream_reader: StreamReader, + client_connected_cb: _ClientConnectedCallback = ..., + loop: Optional[events.AbstractEventLoop] = ...) -> None: ... + def connection_made(self, transport: transports.BaseTransport) -> None: ... + def connection_lost(self, exc: Optional[Exception]) -> None: ... + def data_received(self, data: bytes) -> None: ... + def eof_received(self) -> bool: ... + +class StreamWriter: + def __init__(self, + transport: transports.BaseTransport, + protocol: protocols.BaseProtocol, + reader: Optional[StreamReader], + loop: events.AbstractEventLoop) -> None: ... + @property + def transport(self) -> transports.BaseTransport: ... + def write(self, data: bytes) -> None: ... + def writelines(self, data: Iterable[bytes]) -> None: ... + def write_eof(self) -> None: ... + def can_write_eof(self) -> bool: ... + def close(self) -> None: ... + if sys.version_info >= (3, 7): + def is_closing(self) -> bool: ... + @coroutines.coroutine + def wait_closed(self) -> None: ... + def get_extra_info(self, name: str, default: Any = ...) -> Any: ... + @coroutines.coroutine + def drain(self) -> Generator[Any, None, None]: ... + +class StreamReader: + def __init__(self, + limit: int = ..., + loop: Optional[events.AbstractEventLoop] = ...) -> None: ... + def exception(self) -> Exception: ... + def set_exception(self, exc: Exception) -> None: ... + def set_transport(self, transport: transports.BaseTransport) -> None: ... + def feed_eof(self) -> None: ... + def at_eof(self) -> bool: ... + def feed_data(self, data: bytes) -> None: ... + @coroutines.coroutine + def readline(self) -> Generator[Any, None, bytes]: ... + @coroutines.coroutine + def readuntil(self, separator: bytes = ...) -> Generator[Any, None, bytes]: ... + @coroutines.coroutine + def read(self, n: int = ...) -> Generator[Any, None, bytes]: ... + @coroutines.coroutine + def readexactly(self, n: int) -> Generator[Any, None, bytes]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/asyncio/subprocess.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/asyncio/subprocess.pyi new file mode 100644 index 0000000..46ed302 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/asyncio/subprocess.pyi @@ -0,0 +1,67 @@ +from asyncio import events +from asyncio import protocols +from asyncio import streams +from asyncio import transports +from asyncio.coroutines import coroutine +from typing import Any, Generator, List, Optional, Text, Tuple, Union, IO + +__all__: List[str] + +PIPE: int +STDOUT: int +DEVNULL: int + +class SubprocessStreamProtocol(streams.FlowControlMixin, + protocols.SubprocessProtocol): + stdin: Optional[streams.StreamWriter] + stdout: Optional[streams.StreamReader] + stderr: Optional[streams.StreamReader] + def __init__(self, limit: int, loop: events.AbstractEventLoop) -> None: ... + def connection_made(self, transport: transports.BaseTransport) -> None: ... + def pipe_data_received(self, fd: int, data: Union[bytes, Text]) -> None: ... + def pipe_connection_lost(self, fd: int, exc: Optional[Exception]) -> None: ... + def process_exited(self) -> None: ... + + +class Process: + stdin: Optional[streams.StreamWriter] + stdout: Optional[streams.StreamReader] + stderr: Optional[streams.StreamReader] + pid: int + def __init__(self, + transport: transports.BaseTransport, + protocol: protocols.BaseProtocol, + loop: events.AbstractEventLoop) -> None: ... + @property + def returncode(self) -> int: ... + @coroutine + def wait(self) -> Generator[Any, None, int]: ... + def send_signal(self, signal: int) -> None: ... + def terminate(self) -> None: ... + def kill(self) -> None: ... + @coroutine + def communicate(self, input: Optional[bytes] = ...) -> Generator[Any, None, Tuple[bytes, bytes]]: ... + + +@coroutine +def create_subprocess_shell( + *Args: Union[str, bytes], # Union used instead of AnyStr due to mypy issue #1236 + stdin: Union[int, IO[Any], None] = ..., + stdout: Union[int, IO[Any], None] = ..., + stderr: Union[int, IO[Any], None] = ..., + loop: events.AbstractEventLoop = ..., + limit: int = ..., + **kwds: Any +) -> Generator[Any, None, Process]: ... + +@coroutine +def create_subprocess_exec( + program: Union[str, bytes], # Union used instead of AnyStr due to mypy issue #1236 + *args: Any, + stdin: Union[int, IO[Any], None] = ..., + stdout: Union[int, IO[Any], None] = ..., + stderr: Union[int, IO[Any], None] = ..., + loop: events.AbstractEventLoop = ..., + limit: int = ..., + **kwds: Any +) -> Generator[Any, None, Process]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/asyncio/tasks.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/asyncio/tasks.pyi new file mode 100644 index 0000000..6fe13f5 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/asyncio/tasks.pyi @@ -0,0 +1,77 @@ +import concurrent.futures +import sys +from typing import (Any, TypeVar, Set, Dict, List, TextIO, Union, Tuple, Generic, Callable, + Coroutine, Generator, Iterable, Awaitable, overload, Sequence, Iterator, + Optional) +from types import FrameType +from .events import AbstractEventLoop +from .futures import Future + +__all__: List[str] + +_T = TypeVar('_T') +_T1 = TypeVar('_T1') +_T2 = TypeVar('_T2') +_T3 = TypeVar('_T3') +_T4 = TypeVar('_T4') +_T5 = TypeVar('_T5') +_FutureT = Union[Future[_T], Generator[Any, None, _T], Awaitable[_T]] + +FIRST_EXCEPTION: str +FIRST_COMPLETED: str +ALL_COMPLETED: str + +def as_completed(fs: Sequence[_FutureT[_T]], *, loop: AbstractEventLoop = ..., + timeout: Optional[float] = ...) -> Iterator[Future[_T]]: ... +def ensure_future(coro_or_future: _FutureT[_T], + *, loop: Optional[AbstractEventLoop] = ...) -> Future[_T]: ... +# Prior to Python 3.7 'async' was an alias for 'ensure_future'. +# It became a keyword in 3.7. +@overload +def gather(coro_or_future1: _FutureT[_T1], + *, loop: AbstractEventLoop = ..., return_exceptions: bool = ...) -> Future[Tuple[_T1]]: ... +@overload +def gather(coro_or_future1: _FutureT[_T1], coro_or_future2: _FutureT[_T2], + *, loop: AbstractEventLoop = ..., return_exceptions: bool = ...) -> Future[Tuple[_T1, _T2]]: ... +@overload +def gather(coro_or_future1: _FutureT[_T1], coro_or_future2: _FutureT[_T2], coro_or_future3: _FutureT[_T3], + *, loop: AbstractEventLoop = ..., return_exceptions: bool = ...) -> Future[Tuple[_T1, _T2, _T3]]: ... +@overload +def gather(coro_or_future1: _FutureT[_T1], coro_or_future2: _FutureT[_T2], coro_or_future3: _FutureT[_T3], + coro_or_future4: _FutureT[_T4], + *, loop: AbstractEventLoop = ..., return_exceptions: bool = ...) -> Future[Tuple[_T1, _T2, _T3, _T4]]: ... +@overload +def gather(coro_or_future1: _FutureT[_T1], coro_or_future2: _FutureT[_T2], coro_or_future3: _FutureT[_T3], + coro_or_future4: _FutureT[_T4], coro_or_future5: _FutureT[_T5], + *, loop: AbstractEventLoop = ..., return_exceptions: bool = ...) -> Future[Tuple[_T1, _T2, _T3, _T4, _T5]]: ... +@overload +def gather(coro_or_future1: _FutureT[Any], coro_or_future2: _FutureT[Any], coro_or_future3: _FutureT[Any], + coro_or_future4: _FutureT[Any], coro_or_future5: _FutureT[Any], coro_or_future6: _FutureT[Any], + *coros_or_futures: _FutureT[Any], + loop: AbstractEventLoop = ..., return_exceptions: bool = ...) -> Future[Tuple[Any, ...]]: ... +def run_coroutine_threadsafe(coro: _FutureT[_T], + loop: AbstractEventLoop) -> concurrent.futures.Future[_T]: ... +def shield(arg: _FutureT[_T], *, loop: AbstractEventLoop = ...) -> Future[_T]: ... +def sleep(delay: float, result: _T = ..., loop: AbstractEventLoop = ...) -> Future[_T]: ... +def wait(fs: Iterable[_FutureT[_T]], *, loop: AbstractEventLoop = ..., timeout: Optional[float] = ..., + return_when: str = ...) -> Future[Tuple[Set[Future[_T]], Set[Future[_T]]]]: ... +def wait_for(fut: _FutureT[_T], timeout: Optional[float], + *, loop: AbstractEventLoop = ...) -> Future[_T]: ... + +class Task(Future[_T], Generic[_T]): + @classmethod + def current_task(cls, loop: Optional[AbstractEventLoop] = ...) -> Task: ... + @classmethod + def all_tasks(cls, loop: Optional[AbstractEventLoop] = ...) -> Set[Task]: ... + def __init__(self, coro: Union[Generator[Any, None, _T], Awaitable[_T]], *, loop: AbstractEventLoop = ...) -> None: ... + def __repr__(self) -> str: ... + def get_stack(self, *, limit: int = ...) -> List[FrameType]: ... + def print_stack(self, *, limit: int = ..., file: TextIO = ...) -> None: ... + def cancel(self) -> bool: ... + def _step(self, value: Any = ..., exc: Exception = ...) -> None: ... + def _wakeup(self, future: Future[Any]) -> None: ... + +if sys.version_info >= (3, 7): + def all_tasks(loop: Optional[AbstractEventLoop] = ...) -> Set[Task]: ... + def create_task(coro: Union[Generator[Any, None, _T], Awaitable[_T]]) -> Task: ... + def current_task(loop: Optional[AbstractEventLoop] = ...) -> Optional[Task]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/asyncio/transports.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/asyncio/transports.pyi new file mode 100644 index 0000000..9ea6688 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/asyncio/transports.pyi @@ -0,0 +1,38 @@ +from typing import Dict, Any, TypeVar, Mapping, List, Optional, Tuple + +__all__: List[str] + +class BaseTransport: + def __init__(self, extra: Mapping[Any, Any] = ...) -> None: ... + def get_extra_info(self, name: Any, default: Any = ...) -> Any: ... + def is_closing(self) -> bool: ... + def close(self) -> None: ... + +class ReadTransport(BaseTransport): + def pause_reading(self) -> None: ... + def resume_reading(self) -> None: ... + +class WriteTransport(BaseTransport): + def set_write_buffer_limits( + self, high: int = ..., low: int = ... + ) -> None: ... + def get_write_buffer_size(self) -> int: ... + def write(self, data: Any) -> None: ... + def writelines(self, list_of_data: List[Any]) -> None: ... + def write_eof(self) -> None: ... + def can_write_eof(self) -> bool: ... + def abort(self) -> None: ... + +class Transport(ReadTransport, WriteTransport): ... + +class DatagramTransport(BaseTransport): + def sendto(self, data: Any, addr: Optional[Tuple[str, int]] = ...) -> None: ... + def abort(self) -> None: ... + +class SubprocessTransport(BaseTransport): + def get_pid(self) -> int: ... + def get_returncode(self) -> int: ... + def get_pipe_transport(self, fd: int) -> BaseTransport: ... + def send_signal(self, signal: int) -> int: ... + def terminate(self) -> None: ... + def kill(self) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/atexit.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/atexit.pyi new file mode 100644 index 0000000..24f9389 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/atexit.pyi @@ -0,0 +1,9 @@ +"""Stub file for the 'atexit' module.""" + +from typing import Any, Callable + +def _clear() -> None: ... +def _ncallbacks() -> int: ... +def _run_exitfuncs() -> None: ... +def register(func: Callable[..., Any], *args: Any, **kwargs: Any) -> Callable[..., Any]: ... +def unregister(func: Callable[..., Any]) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/collections/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/collections/__init__.pyi new file mode 100644 index 0000000..524ff6f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/collections/__init__.pyi @@ -0,0 +1,348 @@ +# These are not exported. +import sys +import typing +from typing import ( + TypeVar, Generic, Dict, overload, List, Tuple, + Any, Type, Optional, Union +) +# These are exported. +from . import abc + +from typing import ( + Callable as Callable, + Container as Container, + Hashable as Hashable, + Iterable as Iterable, + Iterator as Iterator, + Sized as Sized, + Generator as Generator, + ByteString as ByteString, + Reversible as Reversible, + Mapping as Mapping, + MappingView as MappingView, + ItemsView as ItemsView, + KeysView as KeysView, + ValuesView as ValuesView, + MutableMapping as MutableMapping, + Sequence as Sequence, + MutableSequence as MutableSequence, + MutableSet as MutableSet, + AbstractSet as Set, +) +if sys.version_info >= (3, 6): + from typing import ( + Collection as Collection, + AsyncGenerator as AsyncGenerator, + ) +if sys.version_info >= (3, 5): + from typing import ( + Awaitable as Awaitable, + Coroutine as Coroutine, + AsyncIterable as AsyncIterable, + AsyncIterator as AsyncIterator, + ) + +_S = TypeVar('_S') +_T = TypeVar('_T') +_KT = TypeVar('_KT') +_VT = TypeVar('_VT') + + +# namedtuple is special-cased in the type checker; the initializer is ignored. +if sys.version_info >= (3, 7): + def namedtuple(typename: str, field_names: Union[str, Iterable[str]], *, + rename: bool = ..., module: Optional[str] = ..., defaults: Optional[Iterable[Any]] = ...) -> Type[tuple]: ... +elif sys.version_info >= (3, 6): + def namedtuple(typename: str, field_names: Union[str, Iterable[str]], *, + verbose: bool = ..., rename: bool = ..., module: Optional[str] = ...) -> Type[tuple]: ... +else: + def namedtuple(typename: str, field_names: Union[str, Iterable[str]], + verbose: bool = ..., rename: bool = ...) -> Type[tuple]: ... + +_UserDictT = TypeVar('_UserDictT', bound=UserDict) + +class UserDict(MutableMapping[_KT, _VT]): + data: Dict[_KT, _VT] + def __init__(self, dict: Optional[Mapping[_KT, _VT]] = ..., **kwargs: _VT) -> None: ... + def __len__(self) -> int: ... + def __getitem__(self, key: _KT) -> _VT: ... + def __setitem__(self, key: _KT, item: _VT) -> None: ... + def __delitem__(self, key: _KT) -> None: ... + def __iter__(self) -> Iterator[_KT]: ... + def __contains__(self, key: object) -> bool: ... + def copy(self: _UserDictT) -> _UserDictT: ... + @classmethod + def fromkeys(cls: Type[_UserDictT], iterable: Iterable[_KT], value: Optional[_VT] = ...) -> _UserDictT: ... + +_UserListT = TypeVar('_UserListT', bound=UserList) + +class UserList(MutableSequence[_T]): + data: List[_T] + def __init__(self, initlist: Optional[Iterable[_T]] = ...) -> None: ... + def __lt__(self, other: object) -> bool: ... + def __le__(self, other: object) -> bool: ... + def __gt__(self, other: object) -> bool: ... + def __ge__(self, other: object) -> bool: ... + def __contains__(self, item: object) -> bool: ... + def __len__(self) -> int: ... + @overload + def __getitem__(self, i: int) -> _T: ... + @overload + def __getitem__(self, i: slice) -> MutableSequence[_T]: ... + @overload + def __setitem__(self, i: int, o: _T) -> None: ... + @overload + def __setitem__(self, i: slice, o: Iterable[_T]) -> None: ... + def __delitem__(self, i: Union[int, slice]) -> None: ... + def __add__(self: _UserListT, other: Iterable[_T]) -> _UserListT: ... + def __iadd__(self: _UserListT, other: Iterable[_T]) -> _UserListT: ... + def __mul__(self: _UserListT, n: int) -> _UserListT: ... + def __imul__(self: _UserListT, n: int) -> _UserListT: ... + def append(self, item: _T) -> None: ... + def insert(self, i: int, item: _T) -> None: ... + def pop(self, i: int = ...) -> _T: ... + def remove(self, item: _T) -> None: ... + def clear(self) -> None: ... + def copy(self: _UserListT) -> _UserListT: ... + def count(self, item: _T) -> int: ... + def index(self, item: _T, *args: Any) -> int: ... + def reverse(self) -> None: ... + def sort(self, *args: Any, **kwds: Any) -> None: ... + def extend(self, other: Iterable[_T]) -> None: ... + +_UserStringT = TypeVar('_UserStringT', bound=UserString) + +class UserString(Sequence[str]): + data: str + def __init__(self, seq: object) -> None: ... + def __int__(self) -> int: ... + def __float__(self) -> float: ... + def __complex__(self) -> complex: ... + if sys.version_info >= (3, 5): + def __getnewargs__(self) -> Tuple[str]: ... + def __lt__(self, string: Union[str, UserString]) -> bool: ... + def __le__(self, string: Union[str, UserString]) -> bool: ... + def __gt__(self, string: Union[str, UserString]) -> bool: ... + def __ge__(self, string: Union[str, UserString]) -> bool: ... + def __contains__(self, char: object) -> bool: ... + def __len__(self) -> int: ... + # It should return a str to implement Sequence correctly, but it doesn't. + def __getitem__(self: _UserStringT, i: Union[int, slice]) -> _UserStringT: ... # type: ignore + def __add__(self: _UserStringT, other: object) -> _UserStringT: ... + def __mul__(self: _UserStringT, n: int) -> _UserStringT: ... + def __mod__(self: _UserStringT, args: Any) -> _UserStringT: ... + def capitalize(self: _UserStringT) -> _UserStringT: ... + if sys.version_info >= (3, 5): + def casefold(self: _UserStringT) -> _UserStringT: ... + def center(self: _UserStringT, width: int, *args: Any) -> _UserStringT: ... + def count(self, sub: Union[str, UserString], start: int = ..., end: int = ...) -> int: ... + def encode(self: _UserStringT, encoding: Optional[str] = ..., errors: Optional[str] = ...) -> _UserStringT: ... + def endswith(self, suffix: Union[str, Tuple[str, ...]], start: int = ..., end: int = ...) -> bool: ... + def expandtabs(self: _UserStringT, tabsize: int = ...) -> _UserStringT: ... + def find(self, sub: Union[str, UserString], start: int = ..., end: int = ...) -> int: ... + def format(self, *args: Any, **kwds: Any) -> str: ... + if sys.version_info >= (3, 5): + def format_map(self, mapping: Mapping[str, Any]) -> str: ... + def index(self, sub: str, start: int = ..., end: int = ...) -> int: ... + def isalpha(self) -> bool: ... + def isalnum(self) -> bool: ... + def isdecimal(self) -> bool: ... + def isdigit(self) -> bool: ... + def isidentifier(self) -> bool: ... + def islower(self) -> bool: ... + def isnumeric(self) -> bool: ... + if sys.version_info >= (3, 5): + def isprintable(self) -> bool: ... + def isspace(self) -> bool: ... + def istitle(self) -> bool: ... + def isupper(self) -> bool: ... + def join(self, seq: Iterable[str]) -> str: ... + def ljust(self: _UserStringT, width: int, *args: Any) -> _UserStringT: ... + def lower(self: _UserStringT) -> _UserStringT: ... + def lstrip(self: _UserStringT, chars: Optional[str] = ...) -> _UserStringT: ... + if sys.version_info >= (3, 5): + @staticmethod + @overload + def maketrans(x: Union[Dict[int, _T], Dict[str, _T], Dict[Union[str, int], _T]]) -> Dict[int, _T]: ... + @staticmethod + @overload + def maketrans(x: str, y: str, z: str = ...) -> Dict[int, Union[int, None]]: ... + def partition(self, sep: str) -> Tuple[str, str, str]: ... + def replace(self: _UserStringT, old: Union[str, UserString], new: Union[str, UserString], maxsplit: int = ...) -> _UserStringT: ... + def rfind(self, sub: Union[str, UserString], start: int = ..., end: int = ...) -> int: ... + def rindex(self, sub: Union[str, UserString], start: int = ..., end: int = ...) -> int: ... + def rjust(self: _UserStringT, width: int, *args: Any) -> _UserStringT: ... + def rpartition(self, sep: str) -> Tuple[str, str, str]: ... + def rstrip(self: _UserStringT, chars: Optional[str] = ...) -> _UserStringT: ... + def split(self, sep: Optional[str] = ..., maxsplit: int = ...) -> List[str]: ... + def rsplit(self, sep: Optional[str] = ..., maxsplit: int = ...) -> List[str]: ... + def splitlines(self, keepends: bool = ...) -> List[str]: ... + def startswith(self, prefix: Union[str, Tuple[str, ...]], start: int = ..., end: int = ...) -> bool: ... + def strip(self: _UserStringT, chars: Optional[str] = ...) -> _UserStringT: ... + def swapcase(self: _UserStringT) -> _UserStringT: ... + def title(self: _UserStringT) -> _UserStringT: ... + def translate(self: _UserStringT, *args: Any) -> _UserStringT: ... + def upper(self: _UserStringT) -> _UserStringT: ... + def zfill(self: _UserStringT, width: int) -> _UserStringT: ... + + +# Technically, deque only derives from MutableSequence in 3.5 (before then, the insert and index +# methods did not exist). +# But in practice it's not worth losing sleep over. +class deque(MutableSequence[_T], Generic[_T]): + @property + def maxlen(self) -> Optional[int]: ... + def __init__(self, iterable: Iterable[_T] = ..., + maxlen: Optional[int] = ...) -> None: ... + def append(self, x: _T) -> None: ... + def appendleft(self, x: _T) -> None: ... + def clear(self) -> None: ... + if sys.version_info >= (3, 5): + def copy(self) -> deque[_T]: ... + def count(self, x: _T) -> int: ... + def extend(self, iterable: Iterable[_T]) -> None: ... + def extendleft(self, iterable: Iterable[_T]) -> None: ... + def insert(self, i: int, x: _T) -> None: ... + def index(self, x: _T, start: int = ..., stop: int = ...) -> int: ... + def pop(self, i: int = ...) -> _T: ... + def popleft(self) -> _T: ... + def remove(self, value: _T) -> None: ... + def reverse(self) -> None: ... + def rotate(self, n: int) -> None: ... + + def __len__(self) -> int: ... + def __iter__(self) -> Iterator[_T]: ... + def __str__(self) -> str: ... + def __hash__(self) -> int: ... + + # These methods of deque don't really take slices, but we need to + # define them as taking a slice to satisfy MutableSequence. + @overload + def __getitem__(self, index: int) -> _T: ... + @overload + def __getitem__(self, s: slice) -> MutableSequence[_T]: + raise TypeError + @overload + def __setitem__(self, i: int, x: _T) -> None: ... + @overload + def __setitem__(self, s: slice, o: Iterable[_T]) -> None: + raise TypeError + @overload + def __delitem__(self, i: int) -> None: ... + @overload + def __delitem__(self, s: slice) -> None: + raise TypeError + + def __contains__(self, o: object) -> bool: ... + def __reversed__(self) -> Iterator[_T]: ... + + def __iadd__(self: _S, iterable: Iterable[_T]) -> _S: ... + + if sys.version_info >= (3, 5): + def __add__(self, other: deque[_T]) -> deque[_T]: ... + def __mul__(self, other: int) -> deque[_T]: ... + def __imul__(self, other: int) -> None: ... + +_CounterT = TypeVar('_CounterT', bound=Counter) + +class Counter(Dict[_T, int], Generic[_T]): + @overload + def __init__(self, **kwargs: int) -> None: ... + @overload + def __init__(self, mapping: Mapping[_T, int]) -> None: ... + @overload + def __init__(self, iterable: Iterable[_T]) -> None: ... + def copy(self: _CounterT) -> _CounterT: ... + def elements(self) -> Iterator[_T]: ... + + def most_common(self, n: Optional[int] = ...) -> List[Tuple[_T, int]]: ... + + @overload + def subtract(self, __mapping: Mapping[_T, int]) -> None: ... + @overload + def subtract(self, iterable: Iterable[_T]) -> None: ... + + # The Iterable[Tuple[...]] argument type is not actually desirable + # (the tuples will be added as keys, breaking type safety) but + # it's included so that the signature is compatible with + # Dict.update. Not sure if we should use '# type: ignore' instead + # and omit the type from the union. + @overload + def update(self, __m: Mapping[_T, int], **kwargs: int) -> None: ... + @overload + def update(self, __m: Union[Iterable[_T], Iterable[Tuple[_T, int]]], **kwargs: int) -> None: ... + @overload + def update(self, **kwargs: int) -> None: ... + + def __add__(self, other: Counter[_T]) -> Counter[_T]: ... + def __sub__(self, other: Counter[_T]) -> Counter[_T]: ... + def __and__(self, other: Counter[_T]) -> Counter[_T]: ... + def __or__(self, other: Counter[_T]) -> Counter[_T]: ... + def __pos__(self) -> Counter[_T]: ... + def __neg__(self) -> Counter[_T]: ... + def __iadd__(self, other: Counter[_T]) -> Counter[_T]: ... + def __isub__(self, other: Counter[_T]) -> Counter[_T]: ... + def __iand__(self, other: Counter[_T]) -> Counter[_T]: ... + def __ior__(self, other: Counter[_T]) -> Counter[_T]: ... + +_OrderedDictT = TypeVar('_OrderedDictT', bound=OrderedDict) + +class _OrderedDictKeysView(KeysView[_KT], Reversible[_KT]): + def __reversed__(self) -> Iterator[_KT]: ... +class _OrderedDictItemsView(ItemsView[_KT, _VT], Reversible[Tuple[_KT, _VT]]): + def __reversed__(self) -> Iterator[Tuple[_KT, _VT]]: ... +class _OrderedDictValuesView(ValuesView[_VT], Reversible[_VT]): + def __reversed__(self) -> Iterator[_VT]: ... + +class OrderedDict(Dict[_KT, _VT], Reversible[_KT], Generic[_KT, _VT]): + def popitem(self, last: bool = ...) -> Tuple[_KT, _VT]: ... + def move_to_end(self, key: _KT, last: bool = ...) -> None: ... + def copy(self: _OrderedDictT) -> _OrderedDictT: ... + def __reversed__(self) -> Iterator[_KT]: ... + def keys(self) -> _OrderedDictKeysView[_KT]: ... + def items(self) -> _OrderedDictItemsView[_KT, _VT]: ... + def values(self) -> _OrderedDictValuesView[_VT]: ... + +_DefaultDictT = TypeVar('_DefaultDictT', bound=defaultdict) + +class defaultdict(Dict[_KT, _VT], Generic[_KT, _VT]): + default_factory: Optional[Callable[[], _VT]] + + @overload + def __init__(self, **kwargs: _VT) -> None: ... + @overload + def __init__(self, default_factory: Optional[Callable[[], _VT]]) -> None: ... + @overload + def __init__(self, default_factory: Optional[Callable[[], _VT]], **kwargs: _VT) -> None: ... + @overload + def __init__(self, default_factory: Optional[Callable[[], _VT]], + map: Mapping[_KT, _VT]) -> None: ... + @overload + def __init__(self, default_factory: Optional[Callable[[], _VT]], + map: Mapping[_KT, _VT], **kwargs: _VT) -> None: ... + @overload + def __init__(self, default_factory: Optional[Callable[[], _VT]], + iterable: Iterable[Tuple[_KT, _VT]]) -> None: ... + @overload + def __init__(self, default_factory: Optional[Callable[[], _VT]], + iterable: Iterable[Tuple[_KT, _VT]], **kwargs: _VT) -> None: ... + def __missing__(self, key: _KT) -> _VT: ... + # TODO __reversed__ + def copy(self: _DefaultDictT) -> _DefaultDictT: ... + +class ChainMap(MutableMapping[_KT, _VT], Generic[_KT, _VT]): + def __init__(self, *maps: Mapping[_KT, _VT]) -> None: ... + + @property + def maps(self) -> List[Mapping[_KT, _VT]]: ... + + def new_child(self, m: Mapping[_KT, _VT] = ...) -> typing.ChainMap[_KT, _VT]: ... + + @property + def parents(self) -> typing.ChainMap[_KT, _VT]: ... + + def __setitem__(self, k: _KT, v: _VT) -> None: ... + def __delitem__(self, v: _KT) -> None: ... + def __getitem__(self, k: _KT) -> _VT: ... + def __iter__(self) -> Iterator[_KT]: ... + def __len__(self) -> int: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/collections/abc.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/collections/abc.pyi new file mode 100644 index 0000000..a957728 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/collections/abc.pyi @@ -0,0 +1,40 @@ +# Stubs for collections.abc (introduced from Python 3.3) +# +# https://docs.python.org/3.3/whatsnew/3.3.html#collections +import sys + +from . import ( + Container as Container, + Hashable as Hashable, + Iterable as Iterable, + Iterator as Iterator, + Sized as Sized, + Callable as Callable, + Mapping as Mapping, + MutableMapping as MutableMapping, + Sequence as Sequence, + MutableSequence as MutableSequence, + Set as Set, + MutableSet as MutableSet, + MappingView as MappingView, + ItemsView as ItemsView, + KeysView as KeysView, + ValuesView as ValuesView, +) + +if sys.version_info >= (3, 5): + from . import ( + Generator as Generator, + ByteString as ByteString, + Awaitable as Awaitable, + Coroutine as Coroutine, + AsyncIterable as AsyncIterable, + AsyncIterator as AsyncIterator, + ) + +if sys.version_info >= (3, 6): + from . import ( + Collection as Collection, + Reversible as Reversible, + AsyncGenerator as AsyncGenerator, + ) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/compileall.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/compileall.pyi new file mode 100644 index 0000000..8d2731c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/compileall.pyi @@ -0,0 +1,20 @@ +# Stubs for compileall (Python 3) + +import os +import sys +from typing import Optional, Union, Pattern + +if sys.version_info < (3, 6): + _Path = Union[str, bytes] + _SuccessType = bool +else: + _Path = Union[str, bytes, os.PathLike] + _SuccessType = int + +# rx can be any object with a 'search' method; once we have Protocols we can change the type +if sys.version_info < (3, 5): + def compile_dir(dir: _Path, maxlevels: int = ..., ddir: Optional[_Path] = ..., force: bool = ..., rx: Optional[Pattern] = ..., quiet: int = ..., legacy: bool = ..., optimize: int = ...) -> _SuccessType: ... +else: + def compile_dir(dir: _Path, maxlevels: int = ..., ddir: Optional[_Path] = ..., force: bool = ..., rx: Optional[Pattern] = ..., quiet: int = ..., legacy: bool = ..., optimize: int = ..., workers: int = ...) -> _SuccessType: ... +def compile_file(fullname: _Path, ddir: Optional[_Path] = ..., force: bool = ..., rx: Optional[Pattern] = ..., quiet: int = ..., legacy: bool = ..., optimize: int = ...) -> _SuccessType: ... +def compile_path(skip_curdir: bool = ..., maxlevels: int = ..., force: bool = ..., quiet: int = ..., legacy: bool = ..., optimize: int = ...) -> _SuccessType: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/concurrent/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/concurrent/__init__.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/concurrent/futures/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/concurrent/futures/__init__.pyi new file mode 100644 index 0000000..4439dca --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/concurrent/futures/__init__.pyi @@ -0,0 +1,3 @@ +from ._base import * # noqa: F403 +from .thread import * # noqa: F403 +from .process import * # noqa: F403 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/concurrent/futures/_base.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/concurrent/futures/_base.pyi new file mode 100644 index 0000000..95189a7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/concurrent/futures/_base.pyi @@ -0,0 +1,56 @@ +from typing import TypeVar, Generic, Any, Iterable, Iterator, Callable, Tuple, Optional, Set, NamedTuple +from types import TracebackType +import sys + +FIRST_COMPLETED: str +FIRST_EXCEPTION: str +ALL_COMPLETED: str +PENDING: Any +RUNNING: Any +CANCELLED: Any +CANCELLED_AND_NOTIFIED: Any +FINISHED: Any +LOGGER: Any + +class Error(Exception): ... +class CancelledError(Error): ... +class TimeoutError(Error): ... + +_T = TypeVar('_T') + +class Future(Generic[_T]): + def __init__(self) -> None: ... + def cancel(self) -> bool: ... + def cancelled(self) -> bool: ... + def running(self) -> bool: ... + def done(self) -> bool: ... + def add_done_callback(self, fn: Callable[[Future[_T]], Any]) -> None: ... + def result(self, timeout: Optional[float] = ...) -> _T: ... + def set_running_or_notify_cancel(self) -> bool: ... + def set_result(self, result: _T) -> None: ... + + if sys.version_info >= (3,): + def exception(self, timeout: Optional[float] = ...) -> Optional[BaseException]: ... + def set_exception(self, exception: Optional[BaseException]) -> None: ... + else: + def exception(self, timeout: Optional[float] = ...) -> Any: ... + def exception_info(self, timeout: Optional[float] = ...) -> Tuple[Any, Optional[TracebackType]]: ... + def set_exception(self, exception: Any) -> None: ... + def set_exception_info(self, exception: Any, traceback: Optional[TracebackType]) -> None: ... + + +class Executor: + def submit(self, fn: Callable[..., _T], *args: Any, **kwargs: Any) -> Future[_T]: ... + if sys.version_info >= (3, 5): + def map(self, func: Callable[..., _T], *iterables: Iterable[Any], timeout: Optional[float] = ..., + chunksize: int = ...) -> Iterator[_T]: ... + else: + def map(self, func: Callable[..., _T], *iterables: Iterable[Any], timeout: Optional[float] = ...,) -> Iterator[_T]: ... + def shutdown(self, wait: bool = ...) -> None: ... + def __enter__(self: _T) -> _T: ... + def __exit__(self, exc_type: Any, exc_val: Any, exc_tb: Any) -> bool: ... + +def as_completed(fs: Iterable[Future[_T]], timeout: Optional[float] = ...) -> Iterator[Future[_T]]: ... + +def wait(fs: Iterable[Future[_T]], timeout: Optional[float] = ..., return_when: str = ...) -> Tuple[Set[Future[_T]], + Set[Future[_T]]]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/concurrent/futures/process.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/concurrent/futures/process.pyi new file mode 100644 index 0000000..ba0cd61 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/concurrent/futures/process.pyi @@ -0,0 +1,17 @@ +from typing import Any, Callable, Optional, Tuple +from ._base import Future, Executor +import sys + +EXTRA_QUEUED_CALLS: Any + +if sys.version_info >= (3,): + class BrokenProcessPool(RuntimeError): ... + +if sys.version_info >= (3, 7): + class ProcessPoolExecutor(Executor): + def __init__(self, max_workers: Optional[int] = ..., + initializer: Optional[Callable[..., None]] = ..., + initargs: Tuple[Any, ...] = ...) -> None: ... +else: + class ProcessPoolExecutor(Executor): + def __init__(self, max_workers: Optional[int] = ...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/concurrent/futures/thread.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/concurrent/futures/thread.pyi new file mode 100644 index 0000000..983594d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/concurrent/futures/thread.pyi @@ -0,0 +1,15 @@ +from typing import Any, Callable, Optional, Tuple +from ._base import Executor, Future +import sys + +class ThreadPoolExecutor(Executor): + if sys.version_info >= (3, 7): + def __init__(self, max_workers: Optional[int] = ..., + thread_name_prefix: str = ..., + initializer: Optional[Callable[..., None]] = ..., + initargs: Tuple[Any, ...] = ...) -> None: ... + elif sys.version_info >= (3, 6) or sys.version_info < (3,): + def __init__(self, max_workers: Optional[int] = ..., + thread_name_prefix: str = ...) -> None: ... + else: + def __init__(self, max_workers: Optional[int] = ...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/configparser.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/configparser.pyi new file mode 100644 index 0000000..17501c1 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/configparser.pyi @@ -0,0 +1,234 @@ +# Based on http://docs.python.org/3.5/library/configparser.html and on +# reading configparser.py. + +import sys +from typing import (AbstractSet, MutableMapping, Mapping, Dict, Sequence, List, + Union, Iterable, Iterator, Callable, Any, IO, overload, + Optional, Pattern, Type, TypeVar) +# Types only used in type comments only +from typing import Optional, Tuple # noqa + +if sys.version_info >= (3, 6): + from os import PathLike + +# Internal type aliases +_section = Mapping[str, str] +_parser = MutableMapping[str, _section] +_converter = Callable[[str], Any] +_converters = Dict[str, _converter] +_T = TypeVar('_T') + +if sys.version_info >= (3, 7): + _Path = Union[str, bytes, PathLike[str]] +elif sys.version_info >= (3, 6): + _Path = Union[str, PathLike[str]] +else: + _Path = str + +DEFAULTSECT: str +MAX_INTERPOLATION_DEPTH: int + +class Interpolation: + def before_get(self, parser: _parser, + section: str, + option: str, + value: str, + defaults: _section) -> str: ... + + def before_set(self, parser: _parser, + section: str, + option: str, + value: str) -> str: ... + + def before_read(self, parser: _parser, + section: str, + option: str, + value: str) -> str: ... + + def before_write(self, parser: _parser, + section: str, + option: str, + value: str) -> str: ... + + +class BasicInterpolation(Interpolation): ... +class ExtendedInterpolation(Interpolation): ... +class LegacyInterpolation(Interpolation): ... + + +class RawConfigParser(_parser): + def __init__(self, + defaults: Optional[_section] = ..., + dict_type: Type[Mapping[str, str]] = ..., + allow_no_value: bool = ..., + *, + delimiters: Sequence[str] = ..., + comment_prefixes: Sequence[str] = ..., + inline_comment_prefixes: Optional[Sequence[str]] = ..., + strict: bool = ..., + empty_lines_in_values: bool = ..., + default_section: str = ..., + interpolation: Optional[Interpolation] = ...) -> None: ... + + def __len__(self) -> int: ... + + def __getitem__(self, section: str) -> SectionProxy: ... + + def __setitem__(self, section: str, options: _section) -> None: ... + + def __delitem__(self, section: str) -> None: ... + + def __iter__(self) -> Iterator[str]: ... + + def defaults(self) -> _section: ... + + def sections(self) -> List[str]: ... + + def add_section(self, section: str) -> None: ... + + def has_section(self, section: str) -> bool: ... + + def options(self, section: str) -> List[str]: ... + + def has_option(self, section: str, option: str) -> bool: ... + + def read(self, filenames: Union[_Path, Iterable[_Path]], + encoding: Optional[str] = ...) -> List[str]: ... + def read_file(self, f: Iterable[str], source: Optional[str] = ...) -> None: ... + def read_string(self, string: str, source: str = ...) -> None: ... + def read_dict(self, dictionary: Mapping[str, Mapping[str, Any]], + source: str = ...) -> None: ... + def readfp(self, fp: Iterable[str], filename: Optional[str] = ...) -> None: ... + + # These get* methods are partially applied (with the same names) in + # SectionProxy; the stubs should be kept updated together + def getint(self, section: str, option: str, *, raw: bool = ..., vars: Optional[_section] = ..., fallback: int = ...) -> int: ... + + def getfloat(self, section: str, option: str, *, raw: bool = ..., vars: Optional[_section] = ..., fallback: float = ...) -> float: ... + + def getboolean(self, section: str, option: str, *, raw: bool = ..., vars: Optional[_section] = ..., fallback: bool = ...) -> bool: ... + + def _get_conv(self, section: str, option: str, conv: Callable[[str], _T], *, raw: bool = ..., vars: Optional[_section] = ..., fallback: _T = ...) -> _T: ... + + # This is incompatible with MutableMapping so we ignore the type + @overload # type: ignore + def get(self, section: str, option: str, *, raw: bool = ..., vars: Optional[_section] = ...) -> str: ... + + @overload # type: ignore + def get(self, section: str, option: str, *, raw: bool = ..., vars: Optional[_section] = ..., fallback: _T) -> Union[str, _T]: ... + + @overload + def items(self, *, raw: bool = ..., vars: Optional[_section] = ...) -> AbstractSet[Tuple[str, SectionProxy]]: ... + + @overload + def items(self, section: str, raw: bool = ..., vars: Optional[_section] = ...) -> List[Tuple[str, str]]: ... + + def set(self, section: str, option: str, value: str) -> None: ... + + def write(self, + fileobject: IO[str], + space_around_delimiters: bool = ...) -> None: ... + + def remove_option(self, section: str, option: str) -> bool: ... + + def remove_section(self, section: str) -> bool: ... + + def optionxform(self, option: str) -> str: ... + + +class ConfigParser(RawConfigParser): + def __init__(self, + defaults: Optional[_section] = ..., + dict_type: Type[Mapping[str, str]] = ..., + allow_no_value: bool = ..., + delimiters: Sequence[str] = ..., + comment_prefixes: Sequence[str] = ..., + inline_comment_prefixes: Optional[Sequence[str]] = ..., + strict: bool = ..., + empty_lines_in_values: bool = ..., + default_section: str = ..., + interpolation: Optional[Interpolation] = ..., + converters: _converters = ...) -> None: ... + +class SafeConfigParser(ConfigParser): ... + +class SectionProxy(MutableMapping[str, str]): + def __init__(self, parser: RawConfigParser, name: str) -> None: ... + def __getitem__(self, key: str) -> str: ... + def __setitem__(self, key: str, value: str) -> None: ... + def __delitem__(self, key: str) -> None: ... + def __contains__(self, key: object) -> bool: ... + def __len__(self) -> int: ... + def __iter__(self) -> Iterator[str]: ... + @property + def parser(self) -> RawConfigParser: ... + @property + def name(self) -> str: ... + def get(self, option: str, fallback: Optional[str] = ..., *, raw: bool = ..., vars: Optional[_section] = ..., **kwargs: Any) -> str: ... # type: ignore + + # These are partially-applied version of the methods with the same names in + # RawConfigParser; the stubs should be kept updated together + def getint(self, option: str, *, raw: bool = ..., vars: Optional[_section] = ..., fallback: int = ...) -> int: ... + def getfloat(self, option: str, *, raw: bool = ..., vars: Optional[_section] = ..., fallback: float = ...) -> float: ... + def getboolean(self, option: str, *, raw: bool = ..., vars: Optional[_section] = ..., fallback: bool = ...) -> bool: ... + + # SectionProxy can have arbitrary attributes when custon converters are used + def __getattr__(self, key: str) -> Callable[..., Any]: ... + +class ConverterMapping(MutableMapping[str, Optional[_converter]]): + GETTERCRE: Pattern + def __init__(self, parser: RawConfigParser) -> None: ... + def __getitem__(self, key: str) -> _converter: ... + def __setitem__(self, key: str, value: Optional[_converter]) -> None: ... + def __delitem__(self, key: str) -> None: ... + def __iter__(self) -> Iterator[str]: ... + def __len__(self) -> int: ... + + +class Error(Exception): ... + + +class NoSectionError(Error): ... + + +class DuplicateSectionError(Error): + section: str + source: Optional[str] + lineno: Optional[int] + + +class DuplicateOptionError(Error): + section: str + option: str + source: Optional[str] + lineno: Optional[int] + + +class NoOptionError(Error): + section: str + option: str + + +class InterpolationError(Error): + section: str + option: str + + +class InterpolationDepthError(InterpolationError): ... + + +class InterpolationMissingOptionError(InterpolationError): + reference: str + + +class InterpolationSyntaxError(InterpolationError): ... + + +class ParsingError(Error): + source: str + errors: Sequence[Tuple[int, str]] + + +class MissingSectionHeaderError(ParsingError): + lineno: int + line: str diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/curses/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/curses/__init__.pyi new file mode 100644 index 0000000..a8d6df4 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/curses/__init__.pyi @@ -0,0 +1,12 @@ +import _curses +from _curses import * # noqa: F403 +from typing import TypeVar, Callable, Any, Sequence, Mapping + +_T = TypeVar('_T') + +LINES: int +COLS: int + +def initscr() -> _curses._CursesWindow: ... +def start_color() -> None: ... +def wrapper(func: Callable[..., _T], *arg: Any, **kwds: Any) -> _T: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/curses/ascii.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/curses/ascii.pyi new file mode 100644 index 0000000..4033769 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/curses/ascii.pyi @@ -0,0 +1,62 @@ +from typing import List, Union, overload, TypeVar + +_Ch = TypeVar('_Ch', str, int) + +NUL: int +SOH: int +STX: int +ETX: int +EOT: int +ENQ: int +ACK: int +BEL: int +BS: int +TAB: int +HT: int +LF: int +NL: int +VT: int +FF: int +CR: int +SO: int +SI: int +DLE: int +DC1: int +DC2: int +DC3: int +DC4: int +NAK: int +SYN: int +ETB: int +CAN: int +EM: int +SUB: int +ESC: int +FS: int +GS: int +RS: int +US: int +SP: int +DEL: int + +controlnames: List[int] + +def isalnum(c: Union[str, int]) -> bool: ... +def isalpha(c: Union[str, int]) -> bool: ... +def isascii(c: Union[str, int]) -> bool: ... +def isblank(c: Union[str, int]) -> bool: ... +def iscntrl(c: Union[str, int]) -> bool: ... +def isdigit(c: Union[str, int]) -> bool: ... +def isgraph(c: Union[str, int]) -> bool: ... +def islower(c: Union[str, int]) -> bool: ... +def isprint(c: Union[str, int]) -> bool: ... +def ispunct(c: Union[str, int]) -> bool: ... +def isspace(c: Union[str, int]) -> bool: ... +def isupper(c: Union[str, int]) -> bool: ... +def isxdigit(c: Union[str, int]) -> bool: ... +def isctrl(c: Union[str, int]) -> bool: ... +def ismeta(c: Union[str, int]) -> bool: ... +def ascii(c: _Ch) -> _Ch: ... +def ctrl(c: _Ch) -> _Ch: ... +def alt(c: _Ch) -> _Ch: ... +def unctrl(c: Union[str, int]) -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/curses/panel.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/curses/panel.pyi new file mode 100644 index 0000000..90f70c4 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/curses/panel.pyi @@ -0,0 +1,20 @@ +from _curses import _CursesWindow + +class _Curses_Panel: # type is (note the space in the class name) + def above(self) -> _Curses_Panel: ... + def below(self) -> _Curses_Panel: ... + def bottom(self) -> None: ... + def hidden(self) -> bool: ... + def hide(self) -> None: ... + def move(self, y: int, x: int) -> None: ... + def replace(self, win: _CursesWindow) -> None: ... + def set_userptr(self, obj: object) -> None: ... + def show(self) -> None: ... + def top(self) -> None: ... + def userptr(self) -> object: ... + def window(self) -> _CursesWindow: ... + +def bottom_panel() -> _Curses_Panel: ... +def new_panel(win: _CursesWindow) -> _Curses_Panel: ... +def top_panel() -> _Curses_Panel: ... +def update_panels() -> _Curses_Panel: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/curses/textpad.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/curses/textpad.pyi new file mode 100644 index 0000000..a218564 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/curses/textpad.pyi @@ -0,0 +1,11 @@ +from _curses import _CursesWindow +from typing import Callable, Union + +def rectangle(win: _CursesWindow, uly: int, ulx: int, lry: int, lrx: int) -> None: ... + +class Textbox: + stripspaces: bool + def __init__(self, w: _CursesWindow, insert_mode: bool = ...) -> None: ... + def edit(self, validate: Callable[[int], int]) -> str: ... + def do_command(self, ch: Union[str, int]) -> None: ... + def gather(self) -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/email/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/email/__init__.pyi new file mode 100644 index 0000000..ec7c25b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/email/__init__.pyi @@ -0,0 +1,26 @@ +# Stubs for email (Python 3.4) + +from typing import Callable, Optional, IO +import sys +from email.message import Message +from email.policy import Policy + +def message_from_string(s: str, _class: Callable[[], Message] = ..., *, policy: Policy = ...) -> Message: ... +def message_from_bytes(s: bytes, _class: Callable[[], Message] = ..., *, policy: Policy = ...) -> Message: ... +def message_from_file(fp: IO[str], _class: Callable[[], Message] = ..., *, policy: Policy = ...) -> Message: ... +def message_from_binary_file(fp: IO[bytes], _class: Callable[[], Message] = ..., *, policy: Policy = ...) -> Message: ... + +# Names in __all__ with no definition: +# base64mime +# charset +# encoders +# errors +# feedparser +# generator +# header +# iterators +# message +# mime +# parser +# quoprimime +# utils diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/email/charset.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/email/charset.pyi new file mode 100644 index 0000000..3a6c19d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/email/charset.pyi @@ -0,0 +1,31 @@ +# Stubs for email.charset (Python 3.4) + +from typing import List, Optional, Iterator, Any + +QP: int # undocumented +BASE64: int # undocumented +SHORTEST: int # undocumented + +class Charset: + input_charset: str + header_encoding: int + body_encoding: int + output_charset: Optional[str] + input_codec: Optional[str] + output_codec: Optional[str] + def __init__(self, input_charset: str = ...) -> None: ... + def get_body_encoding(self) -> str: ... + def get_output_charset(self) -> Optional[str]: ... + def header_encode(self, string: str) -> str: ... + def header_encode_lines(self, string: str, + maxlengths: Iterator[int]) -> List[str]: ... + def body_encode(self, string: str) -> str: ... + def __str__(self) -> str: ... + def __eq__(self, other: Any) -> bool: ... + def __ne__(self, other: Any) -> bool: ... + +def add_charset(charset: str, header_enc: Optional[int] = ..., + body_enc: Optional[int] = ..., + output_charset: Optional[str] = ...) -> None: ... +def add_alias(alias: str, canonical: str) -> None: ... +def add_codec(charset: str, codecname: str) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/email/contentmanager.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/email/contentmanager.pyi new file mode 100644 index 0000000..ed55ef6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/email/contentmanager.pyi @@ -0,0 +1,15 @@ +# Stubs for email.contentmanager (Python 3.4) + +from typing import Any, Callable +from email.message import Message + +class ContentManager: + def __init__(self) -> None: ... + def get_content(self, msg: Message, *args: Any, **kw: Any) -> Any: ... + def set_content(self, msg: Message, obj: Any, *args: Any, + **kw: Any) -> Any: ... + def add_get_handler(self, key: str, handler: Callable[..., Any]) -> None: ... + def add_set_handler(self, typekey: type, + handler: Callable[..., Any]) -> None: ... + +raw_data_manager: ContentManager diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/email/encoders.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/email/encoders.pyi new file mode 100644 index 0000000..bb5c84c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/email/encoders.pyi @@ -0,0 +1,8 @@ +# Stubs for email.encoders (Python 3.4) + +from email.message import Message + +def encode_base64(msg: Message) -> None: ... +def encode_quopri(msg: Message) -> None: ... +def encode_7or8bit(msg: Message) -> None: ... +def encode_noop(msg: Message) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/email/errors.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/email/errors.pyi new file mode 100644 index 0000000..77d9902 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/email/errors.pyi @@ -0,0 +1,19 @@ +# Stubs for email.errors (Python 3.4) + +class MessageError(Exception): ... +class MessageParseError(MessageError): ... +class HeaderParseError(MessageParseError): ... +class BoundaryError(MessageParseError): ... +class MultipartConversionError(MessageError, TypeError): ... + +class MessageDefect(ValueError): ... +class NoBoundaryInMultipartDefect(MessageDefect): ... +class StartBoundaryNotFoundDefect(MessageDefect): ... +class FirstHeaderLineIsContinuationDefect(MessageDefect): ... +class MisplacedEnvelopeHeaderDefect(MessageDefect): ... +class MalformedHeaderDefect(MessageDefect): ... +class MultipartInvariantViolationDefect(MessageDefect): ... +class InvalidBase64PaddingDefect(MessageDefect): ... +class InvalidBase64CharactersDefect(MessageDefect): ... +class CloseBoundaryNotFoundDefect(MessageDefect): ... +class MissingHeaderBodySeparatorDefect(MessageDefect): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/email/feedparser.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/email/feedparser.pyi new file mode 100644 index 0000000..48d940b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/email/feedparser.pyi @@ -0,0 +1,18 @@ +# Stubs for email.feedparser (Python 3.4) + +from typing import Callable +import sys +from email.message import Message +from email.policy import Policy + +class FeedParser: + def __init__(self, _factory: Callable[[], Message] = ..., *, + policy: Policy = ...) -> None: ... + def feed(self, data: str) -> None: ... + def close(self) -> Message: ... + +class BytesFeedParser: + def __init__(self, _factory: Callable[[], Message] = ..., *, + policy: Policy = ...) -> None: ... + def feed(self, data: str) -> None: ... + def close(self) -> Message: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/email/generator.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/email/generator.pyi new file mode 100644 index 0000000..81e733b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/email/generator.pyi @@ -0,0 +1,27 @@ +# Stubs for email.generator (Python 3.4) + +from typing import TextIO, Optional +from email.message import Message +from email.policy import Policy + +class Generator: + def clone(self, fp: TextIO) -> Generator: ... + def write(self, s: str) -> None: ... + def __init__(self, outfp: TextIO, mangle_from_: bool = ..., + maxheaderlen: int = ..., *, + policy: Policy = ...) -> None: ... + def flatten(self, msg: Message, unixfrom: bool = ..., + linesep: Optional[str] = ...) -> None: ... + +class BytesGenerator: + def clone(self, fp: TextIO) -> Generator: ... + def write(self, s: str) -> None: ... + def __init__(self, outfp: TextIO, mangle_from_: bool = ..., + maxheaderlen: int = ..., *, + policy: Policy = ...) -> None: ... + def flatten(self, msg: Message, unixfrom: bool = ..., + linesep: Optional[str] = ...) -> None: ... + +class DecodedGenerator(Generator): + def __init__(self, outfp: TextIO, mangle_from_: bool = ..., + maxheaderlen: int = ..., *, fmt: Optional[str] = ...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/email/header.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/email/header.pyi new file mode 100644 index 0000000..21b9995 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/email/header.pyi @@ -0,0 +1,25 @@ +# Stubs for email.header (Python 3.4) + +from typing import Union, Optional, Any, List, Tuple +from email.charset import Charset + +class Header: + def __init__(self, s: Union[bytes, str, None] = ..., + charset: Union[Charset, str, None] = ..., + maxlinelen: Optional[int] = ..., + header_name: Optional[str] = ..., continuation_ws: str = ..., + errors: str = ...) -> None: ... + def append(self, s: Union[bytes, str], + charset: Union[Charset, str, None] = ..., + errors: str = ...) -> None: ... + def encode(self, splitchars: str = ..., maxlinelen: Optional[int] = ..., + linesep: str = ...) -> str: ... + def __str__(self) -> str: ... + def __eq__(self, other: Any) -> bool: ... + def __ne__(self, other: Any) -> bool: ... + +def decode_header(header: Union[Header, str]) -> List[Tuple[bytes, Optional[str]]]: ... +def make_header(decoded_seq: List[Tuple[bytes, Optional[str]]], + maxlinelen: Optional[int] = ..., + header_name: Optional[str] = ..., + continuation_ws: str = ...) -> Header: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/email/headerregistry.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/email/headerregistry.pyi new file mode 100644 index 0000000..6af1abf --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/email/headerregistry.pyi @@ -0,0 +1,97 @@ +# Stubs for email.headerregistry (Python 3.4) + +from datetime import datetime as _datetime +from typing import Dict, Tuple, Optional, Any, Union, Mapping +from email.errors import MessageDefect +from email.policy import Policy + +class BaseHeader(str): + @property + def name(self) -> str: ... + @property + def defects(self) -> Tuple[MessageDefect, ...]: ... + @property + def max_count(self) -> Optional[int]: ... + def __new__(cls, name: str, value: Any) -> BaseHeader: ... + def init(self, *args: Any, **kw: Any) -> None: ... + def fold(self, *, policy: Policy) -> str: ... + +class UnstructuredHeader: + @classmethod + def parse(cls, string: str, kwds: Dict[str, Any]) -> None: ... + +class UniqueUnstructuredHeader(UnstructuredHeader): ... + +class DateHeader: + datetime: _datetime + @classmethod + def parse(cls, string: Union[str, _datetime], + kwds: Dict[str, Any]) -> None: ... + +class UniqueDateHeader(DateHeader): ... + +class AddressHeader: + groups: Tuple[Group, ...] + addresses: Tuple[Address, ...] + @classmethod + def parse(cls, string: str, kwds: Dict[str, Any]) -> None: ... + +class UniqueAddressHeader(AddressHeader): ... + +class SingleAddressHeader(AddressHeader): + @property + def address(self) -> Address: ... + +class UniqueSingleAddressHeader(SingleAddressHeader): ... + +class MIMEVersionHeader: + version: Optional[str] + major: Optional[int] + minor: Optional[int] + @classmethod + def parse(cls, string: str, kwds: Dict[str, Any]) -> None: ... + +class ParameterizedMIMEHeader: + params: Mapping[str, Any] + @classmethod + def parse(cls, string: str, kwds: Dict[str, Any]) -> None: ... + +class ContentTypeHeader(ParameterizedMIMEHeader): + content_type: str + maintype: str + subtype: str + +class ContentDispositionHeader(ParameterizedMIMEHeader): + content_disposition: str + +class ContentTransferEncodingHeader: + cte: str + @classmethod + def parse(cls, string: str, kwds: Dict[str, Any]) -> None: ... + +class HeaderRegistry: + def __init__(self, base_class: BaseHeader = ..., + default_class: BaseHeader = ..., + use_default_map: bool = ...) -> None: ... + def map_to_type(self, name: str, cls: BaseHeader) -> None: ... + def __getitem__(self, name: str) -> BaseHeader: ... + def __call__(self, name: str, value: Any) -> BaseHeader: ... + +class Address: + display_name: str + username: str + domain: str + @property + def addr_spec(self) -> str: ... + def __init__(self, display_name: str = ..., + username: Optional[str] = ..., + domain: Optional[str] = ..., + addr_spec: Optional[str] = ...) -> None: ... + def __str__(self) -> str: ... + +class Group: + display_name: Optional[str] + addresses: Tuple[Address, ...] + def __init__(self, display_name: Optional[str] = ..., + addresses: Optional[Tuple[Address, ...]] = ...) -> None: ... + def __str__(self) -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/email/iterators.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/email/iterators.pyi new file mode 100644 index 0000000..6a69f39 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/email/iterators.pyi @@ -0,0 +1,8 @@ +# Stubs for email.iterators (Python 3.4) + +from typing import Iterator, Optional +from email.message import Message + +def body_line_iterator(msg: Message, decode: bool = ...) -> Iterator[str]: ... +def typed_subpart_iterator(msg: Message, maintype: str = ..., + subtype: Optional[str] = ...) -> Iterator[str]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/email/message.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/email/message.pyi new file mode 100644 index 0000000..09fbdda --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/email/message.pyi @@ -0,0 +1,105 @@ +# Stubs for email.message (Python 3.4) + +from typing import ( + List, Optional, Union, Tuple, TypeVar, Generator, Sequence, Iterator, Any +) +import sys +from email.charset import Charset +from email.errors import MessageDefect +from email.header import Header +from email.policy import Policy +from email.contentmanager import ContentManager + +_T = TypeVar('_T') + +_PayloadType = Union[List[Message], str, bytes] +_CharsetType = Union[Charset, str, None] +_ParamsType = Union[str, None, Tuple[str, Optional[str], str]] +_ParamType = Union[str, Tuple[Optional[str], Optional[str], str]] +_HeaderType = Union[str, Header] + +class Message: + preamble: Optional[str] + epilogue: Optional[str] + defects: List[MessageDefect] + def __str__(self) -> str: ... + def is_multipart(self) -> bool: ... + def set_unixfrom(self, unixfrom: str) -> None: ... + def get_unixfrom(self) -> Optional[str]: ... + def attach(self, payload: Message) -> None: ... + def get_payload(self, i: int = ..., decode: bool = ...) -> Optional[_PayloadType]: ... + def set_payload(self, payload: _PayloadType, + charset: _CharsetType = ...) -> None: ... + def set_charset(self, charset: _CharsetType) -> None: ... + def get_charset(self) -> _CharsetType: ... + def __len__(self) -> int: ... + def __contains__(self, name: str) -> bool: ... + def __getitem__(self, name: str) -> Optional[_HeaderType]: ... + def __setitem__(self, name: str, val: _HeaderType) -> None: ... + def __delitem__(self, name: str) -> None: ... + def keys(self) -> List[str]: ... + def values(self) -> List[_HeaderType]: ... + def items(self) -> List[Tuple[str, _HeaderType]]: ... + def get(self, name: str, failobj: _T = ...) -> Union[_HeaderType, _T]: ... + def get_all(self, name: str, failobj: _T = ...) -> Union[List[_HeaderType], _T]: ... + def add_header(self, _name: str, _value: str, **_params: _ParamsType) -> None: ... + def replace_header(self, _name: str, _value: _HeaderType) -> None: ... + def get_content_type(self) -> str: ... + def get_content_maintype(self) -> str: ... + def get_content_subtype(self) -> str: ... + def get_default_type(self) -> str: ... + def set_default_type(self, ctype: str) -> None: ... + def get_params(self, failobj: _T = ..., header: str = ..., + unquote: bool = ...) -> Union[List[Tuple[str, str]], _T]: ... + def get_param(self, param: str, failobj: _T = ..., header: str = ..., + unquote: bool = ...) -> Union[_T, _ParamType]: ... + def del_param(self, param: str, header: str = ..., + requote: bool = ...) -> None: ... + def set_type(self, type: str, header: str = ..., + requote: bool = ...) -> None: ... + def get_filename(self, failobj: _T = ...) -> Union[_T, str]: ... + def get_boundary(self, failobj: _T = ...) -> Union[_T, str]: ... + def set_boundary(self, boundary: str) -> None: ... + def get_content_charset(self, failobj: _T = ...) -> Union[_T, str]: ... + def get_charsets(self, failobj: _T = ...) -> Union[_T, List[str]]: ... + def walk(self) -> Generator[Message, None, None]: ... + if sys.version_info >= (3, 5): + def get_content_disposition(self) -> Optional[str]: ... + def as_string(self, unixfrom: bool = ..., maxheaderlen: int = ..., + policy: Optional[Policy] = ...) -> str: ... + def as_bytes(self, unixfrom: bool = ..., + policy: Optional[Policy] = ...) -> bytes: ... + def __bytes__(self) -> bytes: ... + def set_param(self, param: str, value: str, header: str = ..., + requote: bool = ..., charset: str = ..., + language: str = ..., replace: bool = ...) -> None: ... + def __init__(self, policy: Policy = ...) -> None: ... + +class MIMEPart(Message): + def get_body(self, + preferencelist: Sequence[str] = ...) -> Optional[Message]: ... + def iter_attachments(self) -> Iterator[Message]: ... + def iter_parts(self) -> Iterator[Message]: ... + def get_content(self, *args: Any, + content_manager: Optional[ContentManager] = ..., + **kw: Any) -> Any: ... + def set_content(self, *args: Any, + content_manager: Optional[ContentManager] = ..., + **kw: Any) -> None: ... + def make_related(self, boundary: Optional[str] = ...) -> None: ... + def make_alternative(self, boundary: Optional[str] = ...) -> None: ... + def make_mixed(self, boundary: Optional[str] = ...) -> None: ... + def add_related(self, *args: Any, + content_manager: Optional[ContentManager] = ..., + **kw: Any) -> None: ... + def add_alternative(self, *args: Any, + content_manager: Optional[ContentManager] = ..., + **kw: Any) -> None: ... + def add_attachment(self, *args: Any, + content_manager: Optional[ContentManager] = ..., + **kw: Any) -> None: ... + def clear(self) -> None: ... + def clear_content(self) -> None: ... + def is_attachment(self) -> bool: ... + +class EmailMessage(MIMEPart): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/email/mime/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/email/mime/__init__.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/email/mime/application.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/email/mime/application.pyi new file mode 100644 index 0000000..1a40e28 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/email/mime/application.pyi @@ -0,0 +1,11 @@ +# Stubs for email.mime.application (Python 3.4) + +from typing import Callable, Optional, Tuple, Union +from email.mime.nonmultipart import MIMENonMultipart + +_ParamsType = Union[str, None, Tuple[str, Optional[str], str]] + +class MIMEApplication(MIMENonMultipart): + def __init__(self, _data: Union[str, bytes], _subtype: str = ..., + _encoder: Callable[[MIMEApplication], None] = ..., + **_params: _ParamsType) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/email/mime/audio.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/email/mime/audio.pyi new file mode 100644 index 0000000..5bb57d3 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/email/mime/audio.pyi @@ -0,0 +1,11 @@ +# Stubs for email.mime.audio (Python 3.4) + +from typing import Callable, Optional, Tuple, Union +from email.mime.nonmultipart import MIMENonMultipart + +_ParamsType = Union[str, None, Tuple[str, Optional[str], str]] + +class MIMEAudio(MIMENonMultipart): + def __init__(self, _audiodata: Union[str, bytes], _subtype: Optional[str] = ..., + _encoder: Callable[[MIMEAudio], None] = ..., + **_params: _ParamsType) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/email/mime/base.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/email/mime/base.pyi new file mode 100644 index 0000000..448d34b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/email/mime/base.pyi @@ -0,0 +1,10 @@ +# Stubs for email.mime.base (Python 3.4) + +from typing import Optional, Tuple, Union +import email.message + +_ParamsType = Union[str, None, Tuple[str, Optional[str], str]] + +class MIMEBase(email.message.Message): + def __init__(self, _maintype: str, _subtype: str, + **_params: _ParamsType) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/email/mime/image.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/email/mime/image.pyi new file mode 100644 index 0000000..d32d9ee --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/email/mime/image.pyi @@ -0,0 +1,11 @@ +# Stubs for email.mime.image (Python 3.4) + +from typing import Callable, Optional, Tuple, Union +from email.mime.nonmultipart import MIMENonMultipart + +_ParamsType = Union[str, None, Tuple[str, Optional[str], str]] + +class MIMEImage(MIMENonMultipart): + def __init__(self, _imagedata: Union[str, bytes], _subtype: Optional[str] = ..., + _encoder: Callable[[MIMEImage], None] = ..., + **_params: _ParamsType) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/email/mime/message.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/email/mime/message.pyi new file mode 100644 index 0000000..561e8c3 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/email/mime/message.pyi @@ -0,0 +1,7 @@ +# Stubs for email.mime.message (Python 3.4) + +from email.message import Message +from email.mime.nonmultipart import MIMENonMultipart + +class MIMEMessage(MIMENonMultipart): + def __init__(self, _msg: Message, _subtype: str = ...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/email/mime/multipart.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/email/mime/multipart.pyi new file mode 100644 index 0000000..ea5eba1 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/email/mime/multipart.pyi @@ -0,0 +1,12 @@ +# Stubs for email.mime.multipart (Python 3.4) + +from typing import Optional, Sequence, Tuple, Union +from email.message import Message +from email.mime.base import MIMEBase + +_ParamsType = Union[str, None, Tuple[str, Optional[str], str]] + +class MIMEMultipart(MIMEBase): + def __init__(self, _subtype: str = ..., boundary: Optional[str] = ..., + _subparts: Optional[Sequence[Message]] = ..., + **_params: _ParamsType) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/email/mime/nonmultipart.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/email/mime/nonmultipart.pyi new file mode 100644 index 0000000..1fd3ea9 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/email/mime/nonmultipart.pyi @@ -0,0 +1,5 @@ +# Stubs for email.mime.nonmultipart (Python 3.4) + +from email.mime.base import MIMEBase + +class MIMENonMultipart(MIMEBase): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/email/mime/text.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/email/mime/text.pyi new file mode 100644 index 0000000..73adaf5 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/email/mime/text.pyi @@ -0,0 +1,8 @@ +# Stubs for email.mime.text (Python 3.4) + +from typing import Optional +from email.mime.nonmultipart import MIMENonMultipart + +class MIMEText(MIMENonMultipart): + def __init__(self, _text: str, _subtype: str = ..., + _charset: Optional[str] = ...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/email/parser.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/email/parser.pyi new file mode 100644 index 0000000..180e382 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/email/parser.pyi @@ -0,0 +1,33 @@ +# Stubs for email.parser (Python 3.4) + +import email.feedparser +from email.message import Message +from email.policy import Policy +from typing import BinaryIO, Callable, Optional, TextIO + +FeedParser = email.feedparser.FeedParser +BytesFeedParser = email.feedparser.BytesFeedParser + +class Parser: + def __init__(self, _class: Callable[[], Message] = ..., *, + policy: Policy = ...) -> None: ... + def parse(self, fp: TextIO, headersonly: bool = ...) -> Message: ... + def parsestr(self, text: str, headersonly: bool = ...) -> Message: ... + +class HeaderParser(Parser): + def __init__(self, _class: Callable[[], Message] = ..., *, + policy: Policy = ...) -> None: ... + def parse(self, fp: TextIO, headersonly: bool = ...) -> Message: ... + def parsestr(self, text: str, headersonly: bool = ...) -> Message: ... + +class BytesHeaderParser(BytesParser): + def __init__(self, _class: Callable[[], Message] = ..., *, + policy: Policy = ...) -> None: ... + def parse(self, fp: BinaryIO, headersonly: bool = ...) -> Message: ... + def parsebytes(self, text: bytes, headersonly: bool = ...) -> Message: ... + +class BytesParser: + def __init__(self, _class: Callable[[], Message] = ..., *, + policy: Policy = ...) -> None: ... + def parse(self, fp: BinaryIO, headersonly: bool = ...) -> Message: ... + def parsebytes(self, text: bytes, headersonly: bool = ...) -> Message: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/email/policy.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/email/policy.pyi new file mode 100644 index 0000000..e47e643 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/email/policy.pyi @@ -0,0 +1,64 @@ +# Stubs for email.policy (Python 3.4) + +from abc import abstractmethod +from typing import Any, List, Optional, Tuple, Union, Callable +import sys +from email.message import Message +from email.errors import MessageDefect +from email.header import Header +from email.contentmanager import ContentManager + +class Policy: + max_line_length: Optional[int] + linesep: str + cte_type: str + raise_on_defect: bool + if sys.version_info >= (3, 5): + mange_from: bool + def __init__(self, **kw: Any) -> None: ... + def clone(self, **kw: Any) -> Policy: ... + def handle_defect(self, obj: Message, + defect: MessageDefect) -> None: ... + def register_defect(self, obj: Message, + defect: MessageDefect) -> None: ... + def header_max_count(self, name: str) -> Optional[int]: ... + @abstractmethod + def header_source_parse(self, sourcelines: List[str]) -> str: ... + @abstractmethod + def header_store_parse(self, name: str, + value: str) -> Tuple[str, str]: ... + @abstractmethod + def header_fetch_parse(self, name: str, + value: str) -> str: ... + @abstractmethod + def fold(self, name: str, value: str) -> str: ... + @abstractmethod + def fold_binary(self, name: str, value: str) -> bytes: ... + +class Compat32(Policy): + def header_source_parse(self, sourcelines: List[str]) -> str: ... + def header_store_parse(self, name: str, + value: str) -> Tuple[str, str]: ... + def header_fetch_parse(self, name: str, value: str) -> Union[str, Header]: ... # type: ignore + def fold(self, name: str, value: str) -> str: ... + def fold_binary(self, name: str, value: str) -> bytes: ... + +compat32: Compat32 + +class EmailPolicy(Policy): + utf8: bool + refold_source: str + header_factory: Callable[[str, str], str] + content_manager: ContentManager + def header_source_parse(self, sourcelines: List[str]) -> str: ... + def header_store_parse(self, name: str, + value: str) -> Tuple[str, str]: ... + def header_fetch_parse(self, name: str, value: str) -> str: ... + def fold(self, name: str, value: str) -> str: ... + def fold_binary(self, name: str, value: str) -> bytes: ... + +default: EmailPolicy +SMTP: EmailPolicy +SMTPUTF8: EmailPolicy +HTTP: EmailPolicy +strict: EmailPolicy diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/email/utils.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/email/utils.pyi new file mode 100644 index 0000000..6c0a183 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/email/utils.pyi @@ -0,0 +1,33 @@ +# Stubs for email.utils (Python 3.4) + +from typing import List, Optional, Tuple, Union +from email.charset import Charset +import datetime + +_ParamType = Union[str, Tuple[Optional[str], Optional[str], str]] +_PDTZ = Tuple[int, int, int, int, int, int, int, int, int, Optional[int]] + +def quote(str: str) -> str: ... +def unquote(str: str) -> str: ... +def parseaddr(address: Optional[str]) -> Tuple[str, str]: ... +def formataddr(pair: Tuple[Optional[str], str], + charset: Union[str, Charset] = ...) -> str: ... +def getaddresses(fieldvalues: List[str]) -> List[Tuple[str, str]]: ... +def parsedate(date: str) -> Optional[Tuple[int, int, int, int, int, int, int, int, int]]: ... +def parsedate_tz(date: str) -> Optional[_PDTZ]: ... +def parsedate_to_datetime(date: str) -> datetime.datetime: ... +def mktime_tz(tuple: _PDTZ) -> int: ... +def formatdate(timeval: Optional[float] = ..., localtime: bool = ..., + usegmt: bool = ...) -> str: ... +def format_datetime(dt: datetime.datetime, usegmt: bool = ...) -> str: ... +def localtime(dt: Optional[datetime.datetime] = ...) -> datetime.datetime: ... +def make_msgid(idstring: Optional[str] = ..., + domain: Optional[str] = ...) -> str: ... +def decode_rfc2231(s: str) -> Tuple[Optional[str], Optional[str], str]: ... +def encode_rfc2231(s: str, charset: Optional[str] = ..., + language: Optional[str] = ...) -> str: ... +def collapse_rfc2231_value(value: _ParamType, errors: str = ..., + fallback_charset: str = ...) -> str: ... +def decode_params( + params: List[Tuple[str, str]] +) -> List[Tuple[str, _ParamType]]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/encodings/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/encodings/__init__.pyi new file mode 100644 index 0000000..2ae6c0a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/encodings/__init__.pyi @@ -0,0 +1,6 @@ +import codecs + +import typing + +def search_function(encoding: str) -> codecs.CodecInfo: + ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/encodings/utf_8.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/encodings/utf_8.pyi new file mode 100644 index 0000000..d38bd58 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/encodings/utf_8.pyi @@ -0,0 +1,15 @@ +import codecs +from typing import Text, Tuple + +class IncrementalEncoder(codecs.IncrementalEncoder): + def encode(self, input: Text, final: bool = ...) -> bytes: ... + +class IncrementalDecoder(codecs.BufferedIncrementalDecoder): + def _buffer_decode(self, input: bytes, errors: str, final: bool) -> Tuple[Text, int]: ... + +class StreamWriter(codecs.StreamWriter): ... +class StreamReader(codecs.StreamReader): ... + +def getregentry() -> codecs.CodecInfo: ... +def encode(input: Text, errors: Text = ...) -> bytes: ... +def decode(input: bytes, errors: Text = ...) -> Text: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/enum.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/enum.pyi new file mode 100644 index 0000000..703c7cf --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/enum.pyi @@ -0,0 +1,77 @@ +# NB: third_party/2/enum.pyi and stdlib/3.4/enum.pyi must remain consistent! +import sys +from typing import Any, Dict, Iterator, List, Mapping, Type, TypeVar, Union +from abc import ABCMeta + +_T = TypeVar('_T') +_S = TypeVar('_S', bound=Type[Enum]) + +# Note: EnumMeta actually subclasses type directly, not ABCMeta. +# This is a temporary workaround to allow multiple creation of enums with builtins +# such as str as mixins, which due to the handling of ABCs of builtin types, cause +# spurious inconsistent metaclass structure. See #1595. +# Structurally: Iterable[T], Reversible[T], Container[T] where T is the enum itself +class EnumMeta(ABCMeta): + def __iter__(self: Type[_T]) -> Iterator[_T]: ... + def __reversed__(self: Type[_T]) -> Iterator[_T]: ... + def __contains__(self: Type[_T], member: object) -> bool: ... + def __getitem__(self: Type[_T], name: str) -> _T: ... + @property + def __members__(self: Type[_T]) -> Mapping[str, _T]: ... + def __len__(self) -> int: ... + +class Enum(metaclass=EnumMeta): + name: str + value: Any + _name_: str + _value_: Any + _member_names_: List[str] # undocumented + _member_map_: Dict[str, Enum] # undocumented + _value2member_map_: Dict[int, Enum] # undocumented + if sys.version_info >= (3, 7): + _ignore_: Union[str, List[str]] + if sys.version_info >= (3, 6): + _order_: str + @classmethod + def _missing_(cls, value: object) -> Any: ... + @staticmethod + def _generate_next_value_(name: str, start: int, count: int, last_values: List[Any]) -> Any: ... + def __new__(cls: Type[_T], value: object) -> _T: ... + def __repr__(self) -> str: ... + def __str__(self) -> str: ... + def __dir__(self) -> List[str]: ... + def __format__(self, format_spec: str) -> str: ... + def __hash__(self) -> Any: ... + def __reduce_ex__(self, proto: object) -> Any: ... + +class IntEnum(int, Enum): + value: int + +def unique(enumeration: _S) -> _S: ... + +if sys.version_info >= (3, 6): + _auto_null: Any + + # subclassing IntFlag so it picks up all implemented base functions, best modeling behavior of enum.auto() + class auto(IntFlag): + value: Any + + class Flag(Enum): + def __contains__(self: _T, other: _T) -> bool: ... + def __repr__(self) -> str: ... + def __str__(self) -> str: ... + def __bool__(self) -> bool: ... + def __or__(self: _T, other: _T) -> _T: ... + def __and__(self: _T, other: _T) -> _T: ... + def __xor__(self: _T, other: _T) -> _T: ... + def __invert__(self: _T) -> _T: ... + + # The `type: ignore` comment is needed because mypy considers the type + # signatures of several methods defined in int and Flag to be incompatible. + class IntFlag(int, Flag): # type: ignore + def __or__(self: _T, other: Union[int, _T]) -> _T: ... + def __and__(self: _T, other: Union[int, _T]) -> _T: ... + def __xor__(self: _T, other: Union[int, _T]) -> _T: ... + __ror__ = __or__ + __rand__ = __and__ + __rxor__ = __xor__ diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/faulthandler.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/faulthandler.pyi new file mode 100644 index 0000000..1a87c9c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/faulthandler.pyi @@ -0,0 +1,23 @@ +import sys +from typing import Union, Protocol + + +class _HasFileno(Protocol): + def fileno(self) -> int: ... + + +if sys.version_info >= (3, 5): + _File = Union[_HasFileno, int] +else: + _File = _HasFileno + + +def cancel_dump_traceback_later() -> None: ... +def disable() -> None: ... +def dump_traceback(file: _File = ..., all_threads: bool = ...) -> None: ... +def dump_traceback_later(timeout: int, repeat: bool = ..., file: _File = ..., exit: bool = ...) -> None: ... +def enable(file: _File = ..., all_threads: bool = ...) -> None: ... +def is_enabled() -> bool: ... +if sys.platform != "win32": + def register(signum: int, file: _File = ..., all_threads: bool = ..., chain: bool = ...) -> None: ... + def unregister(signum: int) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/fcntl.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/fcntl.pyi new file mode 100644 index 0000000..fdcb4fc --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/fcntl.pyi @@ -0,0 +1,96 @@ +# Stubs for fcntl +from io import IOBase +from typing import Any, IO, Union + +FASYNC: int +FD_CLOEXEC: int +DN_ACCESS: int +DN_ATTRIB: int +DN_CREATE: int +DN_DELETE: int +DN_MODIFY: int +DN_MULTISHOT: int +DN_RENAME: int +F_DUPFD: int +F_DUPFD_CLOEXEC: int +F_FULLFSYNC: int +F_EXLCK: int +F_GETFD: int +F_GETFL: int +F_GETLEASE: int +F_GETLK: int +F_GETLK64: int +F_GETOWN: int +F_NOCACHE: int +F_GETSIG: int +F_NOTIFY: int +F_RDLCK: int +F_SETFD: int +F_SETFL: int +F_SETLEASE: int +F_SETLK: int +F_SETLK64: int +F_SETLKW: int +F_SETLKW64: int +F_SETOWN: int +F_SETSIG: int +F_SHLCK: int +F_UNLCK: int +F_WRLCK: int +I_ATMARK: int +I_CANPUT: int +I_CKBAND: int +I_FDINSERT: int +I_FIND: int +I_FLUSH: int +I_FLUSHBAND: int +I_GETBAND: int +I_GETCLTIME: int +I_GETSIG: int +I_GRDOPT: int +I_GWROPT: int +I_LINK: int +I_LIST: int +I_LOOK: int +I_NREAD: int +I_PEEK: int +I_PLINK: int +I_POP: int +I_PUNLINK: int +I_PUSH: int +I_RECVFD: int +I_SENDFD: int +I_SETCLTIME: int +I_SETSIG: int +I_SRDOPT: int +I_STR: int +I_SWROPT: int +I_UNLINK: int +LOCK_EX: int +LOCK_MAND: int +LOCK_NB: int +LOCK_READ: int +LOCK_RW: int +LOCK_SH: int +LOCK_UN: int +LOCK_WRITE: int + +_AnyFile = Union[int, IO[Any], IOBase] + +# TODO All these return either int or bytes depending on the value of +# cmd (not on the type of arg). +def fcntl(fd: _AnyFile, + cmd: int, + arg: Union[int, bytes] = ...) -> Any: ... +# TODO This function accepts any object supporting a buffer interface, +# as arg, is there a better way to express this than bytes? +def ioctl(fd: _AnyFile, + request: int, + arg: Union[int, bytes] = ..., + mutate_flag: bool = ...) -> Any: ... +def flock(fd: _AnyFile, operation: int) -> None: ... +def lockf(fd: _AnyFile, + cmd: int, + len: int = ..., + start: int = ..., + whence: int = ...) -> Any: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/fnmatch.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/fnmatch.pyi new file mode 100644 index 0000000..4f99b4a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/fnmatch.pyi @@ -0,0 +1,11 @@ +# Stubs for fnmatch + +# Based on http://docs.python.org/3.2/library/fnmatch.html and +# python-lib/fnmatch.py + +from typing import Iterable, List, AnyStr + +def fnmatch(name: AnyStr, pat: AnyStr) -> bool: ... +def fnmatchcase(name: AnyStr, pat: AnyStr) -> bool: ... +def filter(names: Iterable[AnyStr], pat: AnyStr) -> List[AnyStr]: ... +def translate(pat: str) -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/functools.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/functools.pyi new file mode 100644 index 0000000..409e84b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/functools.pyi @@ -0,0 +1,143 @@ +import sys +from typing import Any, Callable, Generic, Dict, Iterable, Mapping, Optional, Sequence, Tuple, Type, TypeVar, NamedTuple, Union, overload + +_AnyCallable = Callable[..., Any] + +_T = TypeVar("_T") +_T2 = TypeVar("_T2") +_T3 = TypeVar("_T3") +_T4 = TypeVar("_T4") +_T5 = TypeVar("_T5") +_S = TypeVar("_S") +@overload +def reduce(function: Callable[[_T, _S], _T], + sequence: Iterable[_S], initial: _T) -> _T: ... +@overload +def reduce(function: Callable[[_T, _T], _T], + sequence: Iterable[_T]) -> _T: ... + + +class _CacheInfo(NamedTuple('CacheInfo', [ + ('hits', int), + ('misses', int), + ('maxsize', int), + ('currsize', int) +])): ... + +class _lru_cache_wrapper(Generic[_T]): + __wrapped__: Callable[..., _T] + def __call__(self, *args: Any, **kwargs: Any) -> _T: ... + def cache_info(self) -> _CacheInfo: ... + def cache_clear(self) -> None: ... + +class lru_cache(): + def __init__(self, maxsize: Optional[int] = ..., typed: bool = ...) -> None: ... + def __call__(self, f: Callable[..., _T]) -> _lru_cache_wrapper[_T]: ... + + +WRAPPER_ASSIGNMENTS: Sequence[str] +WRAPPER_UPDATES: Sequence[str] + +def update_wrapper(wrapper: _AnyCallable, wrapped: _AnyCallable, assigned: Sequence[str] = ..., + updated: Sequence[str] = ...) -> _AnyCallable: ... +def wraps(wrapped: _AnyCallable, assigned: Sequence[str] = ..., updated: Sequence[str] = ...) -> Callable[[_AnyCallable], _AnyCallable]: ... +def total_ordering(cls: type) -> type: ... +def cmp_to_key(mycmp: Callable[[_T, _T], int]) -> Callable[[_T], Any]: ... + +@overload +def partial(__func: Callable[[_T], _S], __arg: _T) -> Callable[[], _S]: ... +@overload +def partial(__func: Callable[[_T, _T2], _S], __arg: _T) -> Callable[[_T2], _S]: ... +@overload +def partial(__func: Callable[[_T, _T2, _T3], _S], __arg: _T) -> Callable[[_T2, _T3], _S]: ... +@overload +def partial(__func: Callable[[_T, _T2, _T3, _T4], _S], __arg: _T) -> Callable[[_T2, _T3, _T4], _S]: ... +@overload +def partial(__func: Callable[[_T, _T2, _T3, _T4, _T5], _S], __arg: _T) -> Callable[[_T2, _T3, _T4, _T5], _S]: ... + +@overload +def partial(__func: Callable[[_T, _T2], _S], + __arg1: _T, + __arg2: _T2) -> Callable[[], _S]: ... +@overload +def partial(__func: Callable[[_T, _T2, _T3], _S], + __arg1: _T, + __arg2: _T2) -> Callable[[_T3], _S]: ... +@overload +def partial(__func: Callable[[_T, _T2, _T3, _T4], _S], + __arg1: _T, + __arg2: _T2) -> Callable[[_T3, _T4], _S]: ... +@overload +def partial(__func: Callable[[_T, _T2, _T3, _T4, _T5], _S], + __arg1: _T, + __arg2: _T2) -> Callable[[_T3, _T4, _T5], _S]: ... + +@overload +def partial(__func: Callable[[_T, _T2, _T3], _S], + __arg1: _T, + __arg2: _T2, + __arg3: _T3) -> Callable[[], _S]: ... +@overload +def partial(__func: Callable[[_T, _T2, _T3, _T4], _S], + __arg1: _T, + __arg2: _T2, + __arg3: _T3) -> Callable[[_T4], _S]: ... +@overload +def partial(__func: Callable[[_T, _T2, _T3, _T4, _T5], _S], + __arg1: _T, + __arg2: _T2, + __arg3: _T3) -> Callable[[_T4, _T5], _S]: ... + +@overload +def partial(__func: Callable[[_T, _T2, _T3, _T4], _S], + __arg1: _T, + __arg2: _T2, + __arg3: _T3, + __arg4: _T4) -> Callable[[], _S]: ... +@overload +def partial(__func: Callable[[_T, _T2, _T3, _T4, _T5], _S], + __arg1: _T, + __arg2: _T2, + __arg3: _T3, + __arg4: _T4) -> Callable[[_T5], _S]: ... + +@overload +def partial(__func: Callable[[_T, _T2, _T3, _T4, _T5], _S], + __arg1: _T, + __arg2: _T2, + __arg3: _T3, + __arg4: _T4, + __arg5: _T5) -> Callable[[], _S]: ... + +@overload +def partial(__func: Callable[..., _S], + *args: Any, + **kwargs: Any) -> Callable[..., _S]: ... + +# With protocols, this could change into a generic protocol that defines __get__ and returns _T +_Descriptor = Any + +class partialmethod(Generic[_T]): + func: Union[Callable[..., _T], _Descriptor] + args: Tuple[Any, ...] + keywords: Dict[str, Any] + + @overload + def __init__(self, func: Callable[..., _T], *args: Any, **keywords: Any) -> None: ... + @overload + def __init__(self, func: _Descriptor, *args: Any, **keywords: Any) -> None: ... + def __get__(self, obj: Any, cls: Type[Any]) -> Callable[..., _T]: ... + @property + def __isabstractmethod__(self) -> bool: ... + +class _SingleDispatchCallable(Generic[_T]): + registry: Mapping[Any, Callable[..., _T]] + def dispatch(self, cls: Any) -> Callable[..., _T]: ... + @overload + def register(self, cls: Any) -> Callable[[Callable[..., _T]], Callable[..., _T]]: ... + @overload + def register(self, cls: Any, func: Callable[..., _T]) -> Callable[..., _T]: ... + def _clear_cache(self) -> None: ... + def __call__(self, *args: Any, **kwargs: Any) -> _T: ... + +def singledispatch(func: Callable[..., _T]) -> _SingleDispatchCallable[_T]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/gc.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/gc.pyi new file mode 100644 index 0000000..d4bb109 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/gc.pyi @@ -0,0 +1,28 @@ +# Stubs for gc + +from typing import Any, Dict, List, Tuple + + +DEBUG_COLLECTABLE: int +DEBUG_LEAK: int +DEBUG_SAVEALL: int +DEBUG_STATS: int +DEBUG_UNCOLLECTABLE: int +callbacks: List[Any] +garbage: List[Any] + +def collect(generations: int = ...) -> int: ... +def disable() -> None: ... +def enable() -> None: ... +def get_count() -> Tuple[int, int, int]: ... +def get_debug() -> int: ... +def get_objects() -> List[Any]: ... +def get_referents(*objs: Any) -> List[Any]: ... +def get_referrers(*objs: Any) -> List[Any]: ... +def get_stats() -> List[Dict[str, Any]]: ... +def get_threshold() -> Tuple[int, int, int]: ... +def is_tracked(obj: Any) -> bool: ... +def isenabled() -> bool: ... +def set_debug(flags: int) -> None: ... +def set_threshold(threshold0: int, threshold1: int = ..., + threshold2: int = ...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/getopt.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/getopt.pyi new file mode 100644 index 0000000..0417a82 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/getopt.pyi @@ -0,0 +1,14 @@ +# Stubs for getopt + +# Based on http://docs.python.org/3.2/library/getopt.html + +from typing import List, Tuple + +def getopt(args: List[str], shortopts: str, longopts: List[str] = ...) -> Tuple[List[Tuple[str, str]], List[str]]: ... +def gnu_getopt(args: List[str], shortopts: str, longopts: List[str] = ...) -> Tuple[List[Tuple[str, str]], List[str]]: ... + +class GetoptError(Exception): + msg: str + opt: str + +error = GetoptError diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/getpass.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/getpass.pyi new file mode 100644 index 0000000..55a8433 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/getpass.pyi @@ -0,0 +1,12 @@ +# Stubs for getpass + +from typing import Optional, TextIO + + +def getpass(prompt: str = ..., stream: Optional[TextIO] = ...) -> str: ... + + +def getuser() -> str: ... + + +class GetPassWarning(UserWarning): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/gettext.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/gettext.pyi new file mode 100644 index 0000000..eeb9b09 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/gettext.pyi @@ -0,0 +1,44 @@ +# Stubs for gettext (Python 3.4) + +from typing import Any, IO, List, Optional, Union, Callable + +class NullTranslations: + def __init__(self, fp: IO[str] = ...) -> None: ... + def add_fallback(self, fallback: NullTranslations) -> None: ... + def gettext(self, message: str) -> str: ... + def lgettext(self, message: str) -> str: ... + def ngettext(self, singular: str, plural: str, n: int) -> str: ... + def lngettext(self, singular: str, plural: str, n: int) -> str: ... + def info(self) -> Any: ... + def charset(self) -> Any: ... + def output_charset(self) -> Any: ... + def set_output_charset(self, charset: Any) -> None: ... + def install(self, names: List[str] = ...) -> None: ... + +class GNUTranslations(NullTranslations): + LE_MAGIC: int + BE_MAGIC: int + +def find(domain: str, localedir: str = ..., languages: List[str] = ..., + all: bool = ...): ... + +def translation(domain: str, localedir: str = ..., languages: List[str] = ..., + class_: Callable[[IO[str]], NullTranslations] = ..., + fallback: bool = ..., codeset: Any = ...) -> NullTranslations: ... + +def install(domain: str, localedir: str = ..., codeset: Any = ..., + names: List[str] = ...): ... + +def textdomain(domain: str = ...) -> str: ... +def bindtextdomain(domain: str, localedir: str = ...) -> str: ... +def bind_textdomain_codeset(domain: str, codeset: str = ...) -> str: ... +def dgettext(domain: str, message: str) -> str: ... +def ldgettext(domain: str, message: str) -> str: ... +def dngettext(domain: str, singular: str, plural: str, n: int) -> str: ... +def ldngettext(domain: str, singular: str, plural: str, n: int) -> str: ... +def gettext(message: str) -> str: ... +def lgettext(message: str) -> str: ... +def ngettext(singular: str, plural: str, n: int) -> str: ... +def lngettext(singular: str, plural: str, n: int) -> str: ... + +Catalog = translation diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/glob.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/glob.pyi new file mode 100644 index 0000000..22ee205 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/glob.pyi @@ -0,0 +1,23 @@ +# Stubs for glob +# Based on http://docs.python.org/3/library/glob.html + +from typing import List, Iterator, AnyStr, Union +import sys + +if sys.version_info >= (3, 6): + def glob0(dirname: AnyStr, pattern: AnyStr) -> List[AnyStr]: ... +else: + def glob0(dirname: AnyStr, basename: AnyStr) -> List[AnyStr]: ... + +def glob1(dirname: AnyStr, pattern: AnyStr) -> List[AnyStr]: ... + +if sys.version_info >= (3, 5): + def glob(pathname: AnyStr, *, recursive: bool = ...) -> List[AnyStr]: ... + def iglob(pathname: AnyStr, *, recursive: bool = ...) -> Iterator[AnyStr]: ... +else: + def glob(pathname: AnyStr) -> List[AnyStr]: ... + def iglob(pathname: AnyStr) -> Iterator[AnyStr]: ... + +def escape(pathname: AnyStr) -> AnyStr: ... + +def has_magic(s: Union[str, bytes]) -> bool: ... # undocumented diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/gzip.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/gzip.pyi new file mode 100644 index 0000000..6f1bf7a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/gzip.pyi @@ -0,0 +1,49 @@ +from typing import Any, IO, Optional +from os.path import _PathType +import _compression +import zlib + +def open(filename, mode: str = ..., compresslevel: int = ..., encoding: Optional[str] = ..., errors: Optional[str] = ..., newline: Optional[str] = ...) -> IO[Any]: ... + +class _PaddedFile: + file: IO[bytes] + def __init__(self, f: IO[bytes], prepend: bytes = ...) -> None: ... + def read(self, size: int) -> bytes: ... + def prepend(self, prepend: bytes = ...) -> None: ... + def seek(self, off: int) -> int: ... + def seekable(self) -> bool: ... + +class GzipFile(_compression.BaseStream): + myfileobj: Optional[IO[bytes]] + mode: str + name: str + compress: zlib._Compress + fileobj: IO[bytes] + def __init__(self, filename: Optional[_PathType] = ..., mode: Optional[str] = ..., compresslevel: int = ..., fileobj: Optional[IO[bytes]] = ..., mtime: Optional[float] = ...) -> None: ... + @property + def filename(self) -> str: ... + @property + def mtime(self) -> Optional[int]: ... + crc: int + def write(self, data: bytes) -> int: ... + def read(self, size: Optional[int] = ...) -> bytes: ... + def read1(self, size: int = ...) -> bytes: ... + def peek(self, n: int) -> bytes: ... + @property + def closed(self) -> bool: ... + def close(self) -> None: ... + def flush(self, zlib_mode: int = ...) -> None: ... + def fileno(self) -> int: ... + def rewind(self) -> None: ... + def readable(self) -> bool: ... + def writable(self) -> bool: ... + def seekable(self) -> bool: ... + def seek(self, offset: int, whence: int = ...) -> int: ... + def readline(self, size: int = ...) -> bytes: ... + +class _GzipReader(_compression.DecompressReader): + def __init__(self, fp: IO[bytes]) -> None: ... + def read(self, size: int = ...) -> bytes: ... + +def compress(data, compresslevel: int = ...) -> bytes: ... +def decompress(data: bytes) -> bytes: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/hashlib.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/hashlib.pyi new file mode 100644 index 0000000..616bb0f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/hashlib.pyi @@ -0,0 +1,69 @@ +# Stubs for hashlib + +import sys +from typing import AbstractSet, Optional, Union + +_DataType = Union[bytes, bytearray, memoryview] + +class _Hash(object): + digest_size: int + block_size: int + + # [Python documentation note] Changed in version 3.4: The name attribute has + # been present in CPython since its inception, but until Python 3.4 was not + # formally specified, so may not exist on some platforms + name: str + + def __init__(self, data: _DataType = ...) -> None: ... + + def copy(self) -> _Hash: ... + def digest(self) -> bytes: ... + def hexdigest(self) -> str: ... + def update(self, arg: _DataType) -> None: ... + +def md5(arg: _DataType = ...) -> _Hash: ... +def sha1(arg: _DataType = ...) -> _Hash: ... +def sha224(arg: _DataType = ...) -> _Hash: ... +def sha256(arg: _DataType = ...) -> _Hash: ... +def sha384(arg: _DataType = ...) -> _Hash: ... +def sha512(arg: _DataType = ...) -> _Hash: ... + +def new(name: str, data: _DataType = ...) -> _Hash: ... + +algorithms_guaranteed: AbstractSet[str] +algorithms_available: AbstractSet[str] + +def pbkdf2_hmac(hash_name: str, password: _DataType, salt: _DataType, iterations: int, dklen: Optional[int] = ...) -> bytes: ... + +if sys.version_info >= (3, 6): + class _VarLenHash(object): + digest_size: int + block_size: int + name: str + + def __init__(self, data: _DataType = ...) -> None: ... + + def copy(self) -> _VarLenHash: ... + def digest(self, length: int) -> bytes: ... + def hexdigest(self, length: int) -> str: ... + def update(self, arg: _DataType) -> None: ... + + sha3_224 = _Hash + sha3_256 = _Hash + sha3_384 = _Hash + sha3_512 = _Hash + shake_128 = _VarLenHash + shake_256 = _VarLenHash + + def scrypt(password: _DataType, *, salt: _DataType, n: int, r: int, p: int, maxmem: int = ..., dklen: int = ...) -> bytes: ... + + class _BlakeHash(_Hash): + MAX_DIGEST_SIZE: int + MAX_KEY_SIZE: int + PERSON_SIZE: int + SALT_SIZE: int + + def __init__(self, data: _DataType = ..., digest_size: int = ..., key: _DataType = ..., salt: _DataType = ..., person: _DataType = ..., fanout: int = ..., depth: int = ..., leaf_size: int = ..., node_offset: int = ..., node_depth: int = ..., inner_size: int = ..., last_node: bool = ...) -> None: ... + + blake2b = _BlakeHash + blake2s = _BlakeHash diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/heapq.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/heapq.pyi new file mode 100644 index 0000000..5c49dfa --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/heapq.pyi @@ -0,0 +1,23 @@ +# Stubs for heapq + +# Based on http://docs.python.org/3.2/library/heapq.html + +import sys +from typing import TypeVar, List, Iterable, Any, Callable, Optional + +_T = TypeVar('_T') + +def heappush(heap: List[_T], item: _T) -> None: ... +def heappop(heap: List[_T]) -> _T: ... +def heappushpop(heap: List[_T], item: _T) -> _T: ... +def heapify(x: List[_T]) -> None: ... +def heapreplace(heap: List[_T], item: _T) -> _T: ... +if sys.version_info >= (3, 5): + def merge(*iterables: Iterable[_T], key: Callable[[_T], Any] = ..., + reverse: bool = ...) -> Iterable[_T]: ... +else: + def merge(*iterables: Iterable[_T]) -> Iterable[_T]: ... +def nlargest(n: int, iterable: Iterable[_T], + key: Optional[Callable[[_T], Any]] = ...) -> List[_T]: ... +def nsmallest(n: int, iterable: Iterable[_T], + key: Callable[[_T], Any] = ...) -> List[_T]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/html/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/html/__init__.pyi new file mode 100644 index 0000000..af2a800 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/html/__init__.pyi @@ -0,0 +1,4 @@ +from typing import AnyStr + +def escape(s: AnyStr, quote: bool = ...) -> AnyStr: ... +def unescape(s: AnyStr) -> AnyStr: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/html/entities.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/html/entities.pyi new file mode 100644 index 0000000..e8ce9f6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/html/entities.pyi @@ -0,0 +1,6 @@ +from typing import Any + +name2codepoint: Any +html5: Any +codepoint2name: Any +entitydefs: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/html/parser.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/html/parser.pyi new file mode 100644 index 0000000..102a2cc --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/html/parser.pyi @@ -0,0 +1,31 @@ +from typing import List, Tuple +from _markupbase import ParserBase +import sys + +class HTMLParser(ParserBase): + if sys.version_info >= (3, 5): + def __init__(self, *, convert_charrefs: bool = ...) -> None: ... + else: + def __init__(self, strict: bool = ..., *, + convert_charrefs: bool = ...) -> None: ... + def feed(self, feed: str) -> None: ... + def close(self) -> None: ... + def reset(self) -> None: ... + def getpos(self) -> Tuple[int, int]: ... + def get_starttag_text(self) -> str: ... + + def handle_starttag(self, tag: str, + attrs: List[Tuple[str, str]]) -> None: ... + def handle_endtag(self, tag: str) -> None: ... + def handle_startendtag(self, tag: str, + attrs: List[Tuple[str, str]]) -> None: ... + def handle_data(self, data: str) -> None: ... + def handle_entityref(self, name: str) -> None: ... + def handle_charref(self, name: str) -> None: ... + def handle_comment(self, data: str) -> None: ... + def handle_decl(self, decl: str) -> None: ... + def handle_pi(self, data: str) -> None: ... + def unknown_decl(self, data: str) -> None: ... + +if sys.version_info < (3, 5): + class HTMLParseError(Exception): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/http/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/http/__init__.pyi new file mode 100644 index 0000000..580250b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/http/__init__.pyi @@ -0,0 +1,69 @@ +import sys + +from enum import IntEnum + +if sys.version_info >= (3, 5): + class HTTPStatus(IntEnum): + + def __init__(self, *a) -> None: ... + + phrase: str + description: str + + CONTINUE = ... + SWITCHING_PROTOCOLS = ... + PROCESSING = ... + OK = ... + CREATED = ... + ACCEPTED = ... + NON_AUTHORITATIVE_INFORMATION = ... + NO_CONTENT = ... + RESET_CONTENT = ... + PARTIAL_CONTENT = ... + MULTI_STATUS = ... + ALREADY_REPORTED = ... + IM_USED = ... + MULTIPLE_CHOICES = ... + MOVED_PERMANENTLY = ... + FOUND = ... + SEE_OTHER = ... + NOT_MODIFIED = ... + USE_PROXY = ... + TEMPORARY_REDIRECT = ... + PERMANENT_REDIRECT = ... + BAD_REQUEST = ... + UNAUTHORIZED = ... + PAYMENT_REQUIRED = ... + FORBIDDEN = ... + NOT_FOUND = ... + METHOD_NOT_ALLOWED = ... + NOT_ACCEPTABLE = ... + PROXY_AUTHENTICATION_REQUIRED = ... + REQUEST_TIMEOUT = ... + CONFLICT = ... + GONE = ... + LENGTH_REQUIRED = ... + PRECONDITION_FAILED = ... + REQUEST_ENTITY_TOO_LARGE = ... + REQUEST_URI_TOO_LONG = ... + UNSUPPORTED_MEDIA_TYPE = ... + REQUESTED_RANGE_NOT_SATISFIABLE = ... + EXPECTATION_FAILED = ... + UNPROCESSABLE_ENTITY = ... + LOCKED = ... + FAILED_DEPENDENCY = ... + UPGRADE_REQUIRED = ... + PRECONDITION_REQUIRED = ... + TOO_MANY_REQUESTS = ... + REQUEST_HEADER_FIELDS_TOO_LARGE = ... + INTERNAL_SERVER_ERROR = ... + NOT_IMPLEMENTED = ... + BAD_GATEWAY = ... + SERVICE_UNAVAILABLE = ... + GATEWAY_TIMEOUT = ... + HTTP_VERSION_NOT_SUPPORTED = ... + VARIANT_ALSO_NEGOTIATES = ... + INSUFFICIENT_STORAGE = ... + LOOP_DETECTED = ... + NOT_EXTENDED = ... + NETWORK_AUTHENTICATION_REQUIRED = ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/http/client.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/http/client.pyi new file mode 100644 index 0000000..5528b01 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/http/client.pyi @@ -0,0 +1,223 @@ +from typing import ( + Any, Dict, IO, Iterable, List, Iterator, Mapping, Optional, + Protocol, Tuple, Type, TypeVar, + Union, + overload, + BinaryIO, +) +import email.message +import io +from socket import socket +import sys +import ssl +import types + +_DataType = Union[bytes, IO[Any], Iterable[bytes], str] +_T = TypeVar('_T') + +HTTP_PORT: int +HTTPS_PORT: int + +CONTINUE: int +SWITCHING_PROTOCOLS: int +PROCESSING: int + +OK: int +CREATED: int +ACCEPTED: int +NON_AUTHORITATIVE_INFORMATION: int +NO_CONTENT: int +RESET_CONTENT: int +PARTIAL_CONTENT: int +MULTI_STATUS: int +IM_USED: int + +MULTIPLE_CHOICES: int +MOVED_PERMANENTLY: int +FOUND: int +SEE_OTHER: int +NOT_MODIFIED: int +USE_PROXY: int +TEMPORARY_REDIRECT: int + +BAD_REQUEST: int +UNAUTHORIZED: int +PAYMENT_REQUIRED: int +FORBIDDEN: int +NOT_FOUND: int +METHOD_NOT_ALLOWED: int +NOT_ACCEPTABLE: int +PROXY_AUTHENTICATION_REQUIRED: int +REQUEST_TIMEOUT: int +CONFLICT: int +GONE: int +LENGTH_REQUIRED: int +PRECONDITION_FAILED: int +REQUEST_ENTITY_TOO_LARGE: int +REQUEST_URI_TOO_LONG: int +UNSUPPORTED_MEDIA_TYPE: int +REQUESTED_RANGE_NOT_SATISFIABLE: int +EXPECTATION_FAILED: int +UNPROCESSABLE_ENTITY: int +LOCKED: int +FAILED_DEPENDENCY: int +UPGRADE_REQUIRED: int +PRECONDITION_REQUIRED: int +TOO_MANY_REQUESTS: int +REQUEST_HEADER_FIELDS_TOO_LARGE: int + +INTERNAL_SERVER_ERROR: int +NOT_IMPLEMENTED: int +BAD_GATEWAY: int +SERVICE_UNAVAILABLE: int +GATEWAY_TIMEOUT: int +HTTP_VERSION_NOT_SUPPORTED: int +INSUFFICIENT_STORAGE: int +NOT_EXTENDED: int +NETWORK_AUTHENTICATION_REQUIRED: int + +responses: Dict[int, str] + +class HTTPMessage(email.message.Message): ... + +if sys.version_info >= (3, 5): + # Ignore errors to work around python/mypy#5027 + class HTTPResponse(io.BufferedIOBase, BinaryIO): # type: ignore + msg: HTTPMessage + headers: HTTPMessage + version: int + debuglevel: int + closed: bool + status: int + reason: str + def __init__(self, sock: socket, debuglevel: int = ..., + method: Optional[str] = ..., url: Optional[str] = ...) -> None: ... + def read(self, amt: Optional[int] = ...) -> bytes: ... + @overload + def getheader(self, name: str) -> Optional[str]: ... + @overload + def getheader(self, name: str, default: _T) -> Union[str, _T]: ... + def getheaders(self) -> List[Tuple[str, str]]: ... + def fileno(self) -> int: ... + def isclosed(self) -> bool: ... + def __iter__(self) -> Iterator[bytes]: ... + def __enter__(self) -> HTTPResponse: ... + def __exit__(self, exc_type: Optional[Type[BaseException]], + exc_val: Optional[BaseException], + exc_tb: Optional[types.TracebackType]) -> bool: ... + def info(self) -> email.message.Message: ... + def geturl(self) -> str: ... + def getcode(self) -> int: ... + def begin(self) -> None: ... +else: + class HTTPResponse(io.RawIOBase, BinaryIO): # type: ignore + msg: HTTPMessage + headers: HTTPMessage + version: int + debuglevel: int + closed: bool + status: int + reason: str + def read(self, amt: Optional[int] = ...) -> bytes: ... + def readinto(self, b: bytearray) -> int: ... + @overload + def getheader(self, name: str) -> Optional[str]: ... + @overload + def getheader(self, name: str, default: _T) -> Union[str, _T]: ... + def getheaders(self) -> List[Tuple[str, str]]: ... + def fileno(self) -> int: ... + def __iter__(self) -> Iterator[bytes]: ... + def __enter__(self) -> HTTPResponse: ... + def __exit__(self, exc_type: Optional[Type[BaseException]], + exc_val: Optional[BaseException], + exc_tb: Optional[types.TracebackType]) -> bool: ... + def info(self) -> email.message.Message: ... + def geturl(self) -> str: ... + def getcode(self) -> int: ... + def begin(self) -> None: ... + +# This is an API stub only for the class below, not a class itself. +# urllib.request uses it for a parameter. +class HTTPConnectionProtocol(Protocol): + if sys.version_info >= (3, 7): + def __call__(self, host: str, port: Optional[int] = ..., + timeout: int = ..., + source_address: Optional[Tuple[str, int]] = ..., + blocksize: int = ...): ... + else: + def __call__(self, host: str, port: Optional[int] = ..., + timeout: int = ..., + source_address: Optional[Tuple[str, int]] = ...): ... + +class HTTPConnection: + host: str = ... + port: int = ... + if sys.version_info >= (3, 7): + def __init__( + self, + host: str, port: Optional[int] = ..., + timeout: int = ..., + source_address: Optional[Tuple[str, int]] = ..., blocksize: int = ... + ) -> None: ... + else: + def __init__( + self, + host: str, port: Optional[int] = ..., + timeout: int = ..., + source_address: Optional[Tuple[str, int]] = ... + ) -> None: ... + if sys.version_info >= (3, 6): + def request(self, method: str, url: str, + body: Optional[_DataType] = ..., + headers: Mapping[str, str] = ..., + *, encode_chunked: bool = ...) -> None: ... + else: + def request(self, method: str, url: str, + body: Optional[_DataType] = ..., + headers: Mapping[str, str] = ...) -> None: ... + def getresponse(self) -> HTTPResponse: ... + def set_debuglevel(self, level: int) -> None: ... + def set_tunnel(self, host: str, port: Optional[int] = ..., + headers: Optional[Mapping[str, str]] = ...) -> None: ... + def connect(self) -> None: ... + def close(self) -> None: ... + def putrequest(self, request: str, selector: str, skip_host: bool = ..., + skip_accept_encoding: bool = ...) -> None: ... + def putheader(self, header: str, *argument: str) -> None: ... + if sys.version_info >= (3, 6): + def endheaders(self, message_body: Optional[_DataType] = ..., + *, encode_chunked: bool = ...) -> None: ... + else: + def endheaders(self, message_body: Optional[_DataType] = ...) -> None: ... + def send(self, data: _DataType) -> None: ... + +class HTTPSConnection(HTTPConnection): + def __init__(self, + host: str, port: Optional[int] = ..., + key_file: Optional[str] = ..., + cert_file: Optional[str] = ..., + timeout: int = ..., + source_address: Optional[Tuple[str, int]] = ..., + *, context: Optional[ssl.SSLContext] = ..., + check_hostname: Optional[bool] = ...) -> None: ... + +class HTTPException(Exception): ... +error = HTTPException + +class NotConnected(HTTPException): ... +class InvalidURL(HTTPException): ... +class UnknownProtocol(HTTPException): ... +class UnknownTransferEncoding(HTTPException): ... +class UnimplementedFileMode(HTTPException): ... +class IncompleteRead(HTTPException): ... + +class ImproperConnectionState(HTTPException): ... +class CannotSendRequest(ImproperConnectionState): ... +class CannotSendHeader(ImproperConnectionState): ... +class ResponseNotReady(ImproperConnectionState): ... + +class BadStatusLine(HTTPException): ... +class LineTooLong(HTTPException): ... + +if sys.version_info >= (3, 5): + class RemoteDisconnected(ConnectionResetError, BadStatusLine): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/http/cookiejar.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/http/cookiejar.pyi new file mode 100644 index 0000000..25701ea --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/http/cookiejar.pyi @@ -0,0 +1,115 @@ +from typing import Dict, Iterable, Iterator, Optional, Sequence, Tuple, TypeVar, Union, overload +from http.client import HTTPResponse +from urllib.request import Request + +_T = TypeVar('_T') + +class LoadError(OSError): ... + + +class CookieJar(Iterable[Cookie]): + def __init__(self, policy: Optional[CookiePolicy] = ...) -> None: ... + def add_cookie_header(self, request: Request) -> None: ... + def extract_cookies(self, response: HTTPResponse, + request: Request) -> None: ... + def set_policy(self, policy: CookiePolicy) -> None: ... + def make_cookies(self, response: HTTPResponse, + request: Request) -> Sequence[Cookie]: ... + def set_cookie(self, cookie: Cookie) -> None: ... + def set_cookie_if_ok(self, cookie: Cookie, + request: Request) -> None: ... + def clear(self, domain: str = ..., path: str = ..., + name: str = ...) -> None: ... + def clear_session_cookies(self) -> None: ... + def __iter__(self) -> Iterator[Cookie]: ... + def __len__(self) -> int: ... + +class FileCookieJar(CookieJar): + filename: str + delayload: bool + def __init__(self, filename: str = ..., delayload: bool = ..., + policy: Optional[CookiePolicy] = ...) -> None: ... + def save(self, filename: Optional[str] = ..., ignore_discard: bool = ..., + ignore_expires: bool = ...) -> None: ... + def load(self, filename: Optional[str] = ..., ignore_discard: bool = ..., + ignore_expires: bool = ...) -> None: ... + def revert(self, filename: Optional[str] = ..., ignore_discard: bool = ..., + ignore_expires: bool = ...) -> None: ... + +class MozillaCookieJar(FileCookieJar): ... +class LWPCookieJar(FileCookieJar): ... + + +class CookiePolicy: + netscape: bool + rfc2965: bool + hide_cookie2: bool + def set_ok(self, cookie: Cookie, request: Request) -> bool: ... + def return_ok(self, cookie: Cookie, request: Request) -> bool: ... + def domain_return_ok(self, domain: str, request: Request) -> bool: ... + def path_return_ok(self, path: str, request: Request) -> bool: ... + + +class DefaultCookiePolicy(CookiePolicy): + rfc2109_as_netscape: bool + strict_domain: bool + strict_rfc2965_unverifiable: bool + strict_ns_unverifiable: bool + strict_ns_domain: int + strict_ns_set_initial_dollar: bool + strict_ns_set_path: bool + DomainStrictNoDots: int + DomainStrictNonDomain: int + DomainRFC2965Match: int + DomainLiberal: int + DomainStrict: int + def __init__(self, blocked_domains: Optional[Sequence[str]] = ..., + allowed_domains: Optional[Sequence[str]] = ..., + netscape: bool = ..., + rfc2965: bool = ..., + rfc2109_as_netscape: Optional[bool] = ..., + hide_cookie2: bool = ..., strict_domain: bool = ..., + strict_rfc2965_unverifiable: bool = ..., + strict_ns_unverifiable: bool = ..., + strict_ns_domain: int = ..., + strict_ns_set_initial_dollar: bool = ..., + strict_ns_set_path: bool = ...) -> None: ... + def blocked_domains(self) -> Tuple[str, ...]: ... + def set_blocked_domains(self, blocked_domains: Sequence[str]) -> None: ... + def is_blocked(self, domain: str) -> bool: ... + def allowed_domains(self) -> Optional[Tuple[str, ...]]: ... + def set_allowed_domains(self, allowed_domains: Optional[Sequence[str]]) -> None: ... + def is_not_allowed(self, domain: str) -> bool: ... + + +class Cookie: + version: Optional[int] + name: str + value: Optional[str] + port: Optional[str] + path: str + secure: bool + expires: Optional[int] + discard: bool + comment: Optional[str] + comment_url: Optional[str] + rfc2109: bool + port_specified: bool + domain: str # undocumented + domain_specified: bool + domain_initial_dot: bool + def __init__(self, version: Optional[int], name: str, value: Optional[str], # undocumented + port: Optional[str], port_specified: bool, + domain: str, domain_specified: bool, domain_initial_dot: bool, + path: str, path_specified: bool, + secure: bool, expires: Optional[int], discard: bool, + comment: Optional[str], comment_url: Optional[str], + rest: Dict[str, str], + rfc2109: bool = ...) -> None: ... + def has_nonstandard_attr(self, name: str) -> bool: ... + @overload + def get_nonstandard_attr(self, name: str) -> Optional[str]: ... + @overload + def get_nonstandard_attr(self, name: str, default: _T = ...) -> Union[str, _T]: ... + def set_nonstandard_attr(self, name: str, value: str) -> None: ... + def is_expired(self, now: int = ...) -> bool: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/http/cookies.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/http/cookies.pyi new file mode 100644 index 0000000..5e5d58a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/http/cookies.pyi @@ -0,0 +1,31 @@ +# Stubs for http.cookies (Python 3.5) + +from typing import Generic, Dict, List, Mapping, MutableMapping, Optional, TypeVar, Union + +_DataType = Union[str, Mapping[str, Union[str, Morsel]]] +_T = TypeVar('_T') + +class CookieError(Exception): ... + +class Morsel(Dict[str, str], Generic[_T]): + value: str + coded_value: _T + key: str + def set(self, key: str, val: str, coded_val: _T) -> None: ... + def isReservedKey(self, K: str) -> bool: ... + def output(self, attrs: Optional[List[str]] = ..., + header: str = ...) -> str: ... + def js_output(self, attrs: Optional[List[str]] = ...) -> str: ... + def OutputString(self, attrs: Optional[List[str]] = ...) -> str: ... + +class BaseCookie(Dict[str, Morsel], Generic[_T]): + def __init__(self, input: Optional[_DataType] = ...) -> None: ... + def value_decode(self, val: str) -> _T: ... + def value_encode(self, val: _T) -> str: ... + def output(self, attrs: Optional[List[str]] = ..., header: str = ..., + sep: str = ...) -> str: ... + def js_output(self, attrs: Optional[List[str]] = ...) -> str: ... + def load(self, rawdata: _DataType) -> None: ... + def __setitem__(self, key: str, value: Union[str, Morsel]) -> None: ... + +class SimpleCookie(BaseCookie): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/http/server.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/http/server.pyi new file mode 100644 index 0000000..7a7729f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/http/server.pyi @@ -0,0 +1,71 @@ +# Stubs for http.server (Python 3.4) + +import sys +from typing import Any, BinaryIO, Dict, List, Mapping, Optional, Tuple, Union +import socketserver +import email.message + +if sys.version_info >= (3, 7): + from builtins import _PathLike + +class HTTPServer(socketserver.TCPServer): + server_name: str + server_port: int + def __init__(self, server_address: Tuple[str, int], + RequestHandlerClass: type) -> None: ... + +class BaseHTTPRequestHandler: + client_address: Tuple[str, int] + server: socketserver.BaseServer + close_connection: bool + requestline: str + command: str + path: str + request_version: str + headers: email.message.Message + rfile: BinaryIO + wfile: BinaryIO + server_version: str + sys_version: str + error_message_format: str + error_content_type: str + protocol_version: str + MessageClass: type + responses: Mapping[int, Tuple[str, str]] + def __init__(self, request: bytes, client_address: Tuple[str, int], + server: socketserver.BaseServer) -> None: ... + def handle(self) -> None: ... + def handle_one_request(self) -> None: ... + def handle_expect_100(self) -> bool: ... + def send_error(self, code: int, message: Optional[str] = ..., + explain: Optional[str] = ...) -> None: ... + def send_response(self, code: int, + message: Optional[str] = ...) -> None: ... + def send_header(self, keyword: str, value: str) -> None: ... + def send_response_only(self, code: int, + message: Optional[str] = ...) -> None: ... + def end_headers(self) -> None: ... + def flush_headers(self) -> None: ... + def log_request(self, code: Union[int, str] = ..., + size: Union[int, str] = ...) -> None: ... + def log_error(self, format: str, *args: Any) -> None: ... + def log_message(self, format: str, *args: Any) -> None: ... + def version_string(self) -> str: ... + def date_time_string(self, timestamp: Optional[int] = ...) -> str: ... + def log_date_time_string(self) -> str: ... + def address_string(self) -> str: ... + +class SimpleHTTPRequestHandler(BaseHTTPRequestHandler): + extensions_map: Dict[str, str] + if sys.version_info >= (3, 7): + def __init__(self, request: bytes, client_address: Tuple[str, int], + server: socketserver.BaseServer, directory: Optional[Union[str, _PathLike[str]]]) -> None: ... + else: + def __init__(self, request: bytes, client_address: Tuple[str, int], + server: socketserver.BaseServer) -> None: ... + def do_GET(self) -> None: ... + def do_HEAD(self) -> None: ... + +class CGIHTTPRequestHandler(SimpleHTTPRequestHandler): + cgi_directories: List[str] + def do_POST(self) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/imp.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/imp.pyi new file mode 100644 index 0000000..3344091 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/imp.pyi @@ -0,0 +1,55 @@ +# Stubs for imp (Python 3.6) + +import os +import sys +import types +from typing import Any, IO, List, Optional, Tuple, TypeVar, Union + +from _imp import (lock_held as lock_held, acquire_lock as acquire_lock, release_lock as release_lock, + get_frozen_object as get_frozen_object, is_frozen_package as is_frozen_package, + init_frozen as init_frozen, is_builtin as is_builtin, is_frozen as is_frozen) + +if sys.version_info >= (3, 5): + from _imp import create_dynamic as create_dynamic + +_T = TypeVar('_T') + +if sys.version_info >= (3, 6): + _Path = Union[str, os.PathLike[str]] +else: + _Path = str + +SEARCH_ERROR: int +PY_SOURCE: int +PY_COMPILED: int +C_EXTENSION: int +PY_RESOURCE: int +PKG_DIRECTORY: int +C_BUILTIN: int +PY_FROZEN: int +PY_CODERESOURCE: int +IMP_HOOK: int + +def new_module(name: str) -> types.ModuleType: ... +def get_magic() -> bytes: ... +def get_tag() -> str: ... +def cache_from_source(path: _Path, debug_override: Optional[bool] = ...) -> str: ... +def source_from_cache(path: _Path) -> str: ... +def get_suffixes() -> List[Tuple[str, str, int]]: ... + +class NullImporter: + def __init__(self, path: _Path) -> None: ... + def find_module(self, fullname: Any) -> None: ... + +# PathLike doesn't work for the pathname argument here +def load_source(name: str, pathname: str, file: Optional[IO[Any]] = ...) -> types.ModuleType: ... +def load_compiled(name: str, pathname: str, file: Optional[IO[Any]] = ...) -> types.ModuleType: ... +def load_package(name: str, path: _Path) -> types.ModuleType: ... +def load_module(name: str, file: IO[Any], filename: str, details: Tuple[str, str, int]) -> types.ModuleType: ... +if sys.version_info >= (3, 6): + def find_module(name: str, path: Union[None, List[str], List[os.PathLike[str]], List[_Path]] = ...) -> Tuple[str, str, Tuple[IO[Any], str, int]]: ... +else: + def find_module(name: str, path: Optional[List[str]] = ...) -> Tuple[str, str, Tuple[IO[Any], str, int]]: ... +def reload(module: types.ModuleType) -> types.ModuleType: ... +def init_builtin(name: str) -> Optional[types.ModuleType]: ... +def load_dynamic(name: str, path: str, file: Optional[IO[Any]] = ...) -> types.ModuleType: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/importlib/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/importlib/__init__.pyi new file mode 100644 index 0000000..d46f7e1 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/importlib/__init__.pyi @@ -0,0 +1,17 @@ +from importlib.abc import Loader +import sys +import types +from typing import Any, Mapping, Optional, Sequence + +def __import__(name: str, globals: Optional[Mapping[str, Any]] = ..., + locals: Optional[Mapping[str, Any]] = ..., + fromlist: Sequence[str] = ..., + level: int = ...) -> types.ModuleType: ... + +def import_module(name: str, package: Optional[str] = ...) -> types.ModuleType: ... + +def find_loader(name: str, path: Optional[str] = ...) -> Optional[Loader]: ... + +def invalidate_caches() -> None: ... + +def reload(module: types.ModuleType) -> types.ModuleType: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/importlib/abc.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/importlib/abc.pyi new file mode 100644 index 0000000..a86e194 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/importlib/abc.pyi @@ -0,0 +1,97 @@ +from abc import ABCMeta, abstractmethod +import os +import sys +import types +from typing import Any, IO, Iterator, Mapping, Optional, Sequence, Tuple, Union + +# Loader is exported from this module, but for circular import reasons +# exists in its own stub file (with ModuleSpec and ModuleType). +from _importlib_modulespec import Loader as Loader # Exported + +from _importlib_modulespec import ModuleSpec + +_Path = Union[bytes, str] + +class Finder(metaclass=ABCMeta): + ... + # Technically this class defines the following method, but its subclasses + # in this module violate its signature. Since this class is deprecated, it's + # easier to simply ignore that this method exists. + # @abstractmethod + # def find_module(self, fullname: str, + # path: Optional[Sequence[_Path]] = ...) -> Optional[Loader]: ... + +class ResourceLoader(Loader): + @abstractmethod + def get_data(self, path: _Path) -> bytes: ... + +class InspectLoader(Loader): + def is_package(self, fullname: str) -> bool: ... + def get_code(self, fullname: str) -> Optional[types.CodeType]: ... + def load_module(self, fullname: str) -> types.ModuleType: ... + @abstractmethod + def get_source(self, fullname: str) -> Optional[str]: ... + def exec_module(self, module: types.ModuleType) -> None: ... + if sys.version_info < (3, 5): + def source_to_code(self, data: Union[bytes, str], + path: str = ...) -> types.CodeType: ... + else: + @staticmethod + def source_to_code(data: Union[bytes, str], + path: str = ...) -> types.CodeType: ... + +class ExecutionLoader(InspectLoader): + @abstractmethod + def get_filename(self, fullname: str) -> _Path: ... + def get_code(self, fullname: str) -> Optional[types.CodeType]: ... + +class SourceLoader(ResourceLoader, ExecutionLoader, metaclass=ABCMeta): + def path_mtime(self, path: _Path) -> float: ... + def set_data(self, path: _Path, data: bytes) -> None: ... + def get_source(self, fullname: str) -> Optional[str]: ... + def path_stats(self, path: _Path) -> Mapping[str, Any]: ... + + +class MetaPathFinder(Finder): + def find_module(self, fullname: str, + path: Optional[Sequence[_Path]]) -> Optional[Loader]: + ... + def invalidate_caches(self) -> None: ... + # Not defined on the actual class, but expected to exist. + def find_spec( + self, fullname: str, path: Optional[Sequence[_Path]], + target: Optional[types.ModuleType] = ... + ) -> Optional[ModuleSpec]: + ... + +class PathEntryFinder(Finder): + def find_module(self, fullname: str) -> Optional[Loader]: ... + def find_loader( + self, fullname: str + ) -> Tuple[Optional[Loader], Sequence[_Path]]: ... + def invalidate_caches(self) -> None: ... + # Not defined on the actual class, but expected to exist. + def find_spec( + self, fullname: str, + target: Optional[types.ModuleType] = ... + ) -> Optional[ModuleSpec]: ... + +class FileLoader(ResourceLoader, ExecutionLoader, metaclass=ABCMeta): + name: str + path: _Path + def __init__(self, fullname: str, path: _Path) -> None: ... + def get_data(self, path: _Path) -> bytes: ... + def get_filename(self, fullname: str) -> _Path: ... + +if sys.version_info >= (3, 7): + _PathLike = Union[bytes, str, os.PathLike[Any]] + + class ResourceReader(metaclass=ABCMeta): + @abstractmethod + def open_resource(self, resource: _PathLike) -> IO[bytes]: ... + @abstractmethod + def resource_path(self, resource: _PathLike) -> str: ... + @abstractmethod + def is_resource(self, name: str) -> bool: ... + @abstractmethod + def contents(self) -> Iterator[str]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/importlib/machinery.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/importlib/machinery.pyi new file mode 100644 index 0000000..036a91f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/importlib/machinery.pyi @@ -0,0 +1,116 @@ +import importlib.abc +import sys +import types +from typing import Any, Callable, List, Optional, Sequence, Tuple, Union + +# ModuleSpec is exported from this module, but for circular import +# reasons exists in its own stub file (with Loader and ModuleType). +from _importlib_modulespec import ModuleSpec as ModuleSpec # Exported + +class BuiltinImporter(importlib.abc.MetaPathFinder, + importlib.abc.InspectLoader): + # MetaPathFinder + @classmethod + def find_module( + cls, fullname: str, + path: Optional[Sequence[importlib.abc._Path]] + ) -> Optional[importlib.abc.Loader]: + ... + @classmethod + def find_spec(cls, fullname: str, + path: Optional[Sequence[importlib.abc._Path]], + target: Optional[types.ModuleType] = ...) -> Optional[ModuleSpec]: + ... + # InspectLoader + @classmethod + def is_package(cls, fullname: str) -> bool: ... + @classmethod + def load_module(cls, fullname: str) -> types.ModuleType: ... + @classmethod + def get_code(cls, fullname: str) -> None: ... + @classmethod + def get_source(cls, fullname: str) -> None: ... + # Loader + @staticmethod + def module_repr(module: types.ModuleType) -> str: ... + @classmethod + def create_module(cls, spec: ModuleSpec) -> Optional[types.ModuleType]: ... + @classmethod + def exec_module(cls, module: types.ModuleType) -> None: ... + +class FrozenImporter(importlib.abc.MetaPathFinder, importlib.abc.InspectLoader): + # MetaPathFinder + @classmethod + def find_module( + cls, fullname: str, + path: Optional[Sequence[importlib.abc._Path]] + ) -> Optional[importlib.abc.Loader]: + ... + @classmethod + def find_spec(cls, fullname: str, + path: Optional[Sequence[importlib.abc._Path]], + target: Optional[types.ModuleType] = ...) -> Optional[ModuleSpec]: + ... + # InspectLoader + @classmethod + def is_package(cls, fullname: str) -> bool: ... + @classmethod + def load_module(cls, fullname: str) -> types.ModuleType: ... + @classmethod + def get_code(cls, fullname: str) -> None: ... + @classmethod + def get_source(cls, fullname: str) -> None: ... + # Loader + @staticmethod + def module_repr(module: types.ModuleType) -> str: ... + @classmethod + def create_module(cls, spec: ModuleSpec) -> Optional[types.ModuleType]: + ... + @staticmethod + def exec_module(module: types.ModuleType) -> None: ... + +class WindowsRegistryFinder(importlib.abc.MetaPathFinder): + @classmethod + def find_module( + cls, fullname: str, + path: Optional[Sequence[importlib.abc._Path]] + ) -> Optional[importlib.abc.Loader]: + ... + @classmethod + def find_spec(cls, fullname: str, + path: Optional[Sequence[importlib.abc._Path]], + target: Optional[types.ModuleType] = ...) -> Optional[ModuleSpec]: + ... + +class PathFinder(importlib.abc.MetaPathFinder): ... + +SOURCE_SUFFIXES: List[str] +DEBUG_BYTECODE_SUFFIXES: List[str] +OPTIMIZED_BYTECODE_SUFFIXES: List[str] +BYTECODE_SUFFIXES: List[str] +EXTENSION_SUFFIXES: List[str] + +def all_suffixes() -> List[str]: ... + +class FileFinder(importlib.abc.PathEntryFinder): + path: str + def __init__( + self, path: str, + *loader_details: Tuple[importlib.abc.Loader, List[str]] + ) -> None: ... + @classmethod + def path_hook( + cls, *loader_details: Tuple[importlib.abc.Loader, List[str]] + ) -> Callable[[str], importlib.abc.PathEntryFinder]: ... + +class SourceFileLoader(importlib.abc.FileLoader, + importlib.abc.SourceLoader): + ... + +class SourcelessFileLoader(importlib.abc.FileLoader, + importlib.abc.SourceLoader): + ... + +class ExtensionFileLoader(importlib.abc.ExecutionLoader): + def get_filename(self, fullname: str) -> importlib.abc._Path: ... + def get_source(self, fullname: str) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/importlib/resources.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/importlib/resources.pyi new file mode 100644 index 0000000..007477d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/importlib/resources.pyi @@ -0,0 +1,25 @@ +import sys +# This is a >=3.7 module, so we conditionally include its source. +if sys.version_info >= (3, 7): + import os + + from pathlib import Path + from types import ModuleType + from typing import ContextManager, Iterator, Union, BinaryIO, TextIO + + Package = Union[str, ModuleType] + Resource = Union[str, os.PathLike] + + def open_binary(package: Package, resource: Resource) -> BinaryIO: ... + def open_text(package: Package, + resource: Resource, + encoding: str = ..., + errors: str = ...) -> TextIO: ... + def read_binary(package: Package, resource: Resource) -> bytes: ... + def read_text(package: Package, + resource: Resource, + encoding: str = ..., + errors: str = ...) -> str: ... + def path(package: Package, resource: Resource) -> ContextManager[Path]: ... + def is_resource(package: Package, name: str) -> bool: ... + def contents(package: Package) -> Iterator[str]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/importlib/util.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/importlib/util.pyi new file mode 100644 index 0000000..706a5dd --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/importlib/util.pyi @@ -0,0 +1,53 @@ +import importlib.abc +import importlib.machinery +import sys +import types +from typing import Any, Callable, List, Optional + +def module_for_loader( + fxn: Callable[..., types.ModuleType] +) -> Callable[..., types.ModuleType]: ... +def set_loader( + fxn: Callable[..., types.ModuleType] +) -> Callable[..., types.ModuleType]: ... +def set_package( + fxn: Callable[..., types.ModuleType] +) -> Callable[..., types.ModuleType]: ... + +def resolve_name(name: str, package: str) -> str: ... + +MAGIC_NUMBER: bytes + +def cache_from_source(path: str, debug_override: Optional[bool] = ..., *, + optimization: Optional[Any] = ...) -> str: ... +def source_from_cache(path: str) -> str: ... +def decode_source(source_bytes: bytes) -> str: ... +def find_spec( + name: str, package: Optional[str] = ... +) -> Optional[importlib.machinery.ModuleSpec]: ... +def spec_from_loader( + name: str, loader: Optional[importlib.abc.Loader], *, + origin: Optional[str] = ..., loader_state: Optional[Any] = ..., + is_package: Optional[bool] = ... +) -> importlib.machinery.ModuleSpec: ... +def spec_from_file_location( + name: str, location: str, *, + loader: Optional[importlib.abc.Loader] = ..., + submodule_search_locations: Optional[List[str]] = ... +) -> importlib.machinery.ModuleSpec: ... + +if sys.version_info >= (3, 5): + def module_from_spec( + spec: importlib.machinery.ModuleSpec + ) -> types.ModuleType: ... + + class LazyLoader(importlib.abc.Loader): + def __init__(self, loader: importlib.abc.Loader) -> None: ... + @classmethod + def factory( + cls, loader: importlib.abc.Loader + ) -> Callable[..., LazyLoader]: ... + def create_module( + self, spec: importlib.machinery.ModuleSpec + ) -> Optional[types.ModuleType]: ... + def exec_module(self, module: types.ModuleType) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/inspect.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/inspect.pyi new file mode 100644 index 0000000..6173715 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/inspect.pyi @@ -0,0 +1,329 @@ +import sys +from typing import (AbstractSet, Any, Callable, Dict, Generator, List, Mapping, + NamedTuple, Optional, Sequence, Tuple, Union, + ) +from types import CodeType, FrameType, ModuleType, TracebackType +from collections import OrderedDict + +# +# Types and members +# +class EndOfBlock(Exception): ... + +class BlockFinder: + indent: int + islambda: bool + started: bool + passline: bool + indecorator: bool + decoratorhasargs: bool + last: int + def tokeneater(self, type: int, token: str, srow_scol: Tuple[int, int], + erow_ecol: Tuple[int, int], line: str) -> None: ... + +CO_OPTIMIZED: int +CO_NEWLOCALS: int +CO_VARARGS: int +CO_VARKEYWORDS: int +CO_NESTED: int +CO_GENERATOR: int +CO_NOFREE: int +if sys.version_info >= (3, 5): + CO_COROUTINE: int + CO_ITERABLE_COROUTINE: int +if sys.version_info >= (3, 6): + CO_ASYNC_GENERATOR: int +TPFLAGS_IS_ABSTRACT: int + +if sys.version_info < (3, 6): + ModuleInfo = NamedTuple('ModuleInfo', [('name', str), + ('suffix', str), + ('mode', str), + ('module_type', int), + ]) + def getmoduleinfo(path: str) -> Optional[ModuleInfo]: ... + +def getmembers(object: object, + predicate: Optional[Callable[[Any], bool]] = ..., + ) -> List[Tuple[str, Any]]: ... +def getmodulename(path: str) -> Optional[str]: ... + +def ismodule(object: object) -> bool: ... +def isclass(object: object) -> bool: ... +def ismethod(object: object) -> bool: ... +def isfunction(object: object) -> bool: ... +def isgeneratorfunction(object: object) -> bool: ... +def isgenerator(object: object) -> bool: ... + +if sys.version_info >= (3, 5): + def iscoroutinefunction(object: object) -> bool: ... + def iscoroutine(object: object) -> bool: ... + def isawaitable(object: object) -> bool: ... +if sys.version_info >= (3, 6): + def isasyncgenfunction(object: object) -> bool: ... + def isasyncgen(object: object) -> bool: ... +def istraceback(object: object) -> bool: ... +def isframe(object: object) -> bool: ... +def iscode(object: object) -> bool: ... +def isbuiltin(object: object) -> bool: ... +def isroutine(object: object) -> bool: ... +def isabstract(object: object) -> bool: ... +def ismethoddescriptor(object: object) -> bool: ... +def isdatadescriptor(object: object) -> bool: ... +def isgetsetdescriptor(object: object) -> bool: ... +def ismemberdescriptor(object: object) -> bool: ... + + +# +# Retrieving source code +# +def findsource(object: object) -> Tuple[List[str], int]: ... +def getabsfile(object: object) -> str: ... +def getblock(lines: Sequence[str]) -> Sequence[str]: ... +def getdoc(object: object) -> str: ... +def getcomments(object: object) -> str: ... +def getfile(object: object) -> str: ... +def getmodule(object: object) -> ModuleType: ... +def getsourcefile(object: object) -> str: ... +# TODO restrict to "module, class, method, function, traceback, frame, +# or code object" +def getsourcelines(object: object) -> Tuple[List[str], int]: ... +# TODO restrict to "a module, class, method, function, traceback, frame, +# or code object" +def getsource(object: object) -> str: ... +def cleandoc(doc: str) -> str: ... +def indentsize(line: str) -> int: ... + + +# +# Introspecting callables with the Signature object +# +def signature(callable: Callable[..., Any], + *, + follow_wrapped: bool = ...) -> Signature: ... + +class Signature: + def __init__(self, + parameters: Optional[Sequence[Parameter]] = ..., + *, + return_annotation: Any = ...) -> None: ... + # TODO: can we be more specific here? + empty: object = ... + + parameters: Mapping[str, Parameter] + + # TODO: can we be more specific here? + return_annotation: Any + + def bind(self, *args: Any, **kwargs: Any) -> BoundArguments: ... + def bind_partial(self, *args: Any, **kwargs: Any) -> BoundArguments: ... + def replace(self, + *, + parameters: Optional[Sequence[Parameter]] = ..., + return_annotation: Any = ...) -> Signature: ... + + if sys.version_info >= (3, 5): + @classmethod + def from_callable(cls, + obj: Callable[..., Any], + *, + follow_wrapped: bool = ...) -> Signature: ... + +# The name is the same as the enum's name in CPython +class _ParameterKind: ... + +class Parameter: + def __init__(self, + name: str, + kind: _ParameterKind, + *, + default: Any = ..., + annotation: Any = ...) -> None: ... + empty: Any = ... + name: str + default: Any + annotation: Any + + kind: _ParameterKind + POSITIONAL_ONLY: _ParameterKind = ... + POSITIONAL_OR_KEYWORD: _ParameterKind = ... + VAR_POSITIONAL: _ParameterKind = ... + KEYWORD_ONLY: _ParameterKind = ... + VAR_KEYWORD: _ParameterKind = ... + + def replace(self, + *, + name: Optional[str] = ..., + kind: Optional[_ParameterKind] = ..., + default: Any = ..., + annotation: Any = ...) -> Parameter: ... + +class BoundArguments: + arguments: OrderedDict[str, Any] + args: Tuple[Any, ...] + kwargs: Dict[str, Any] + signature: Signature + + if sys.version_info >= (3, 5): + def apply_defaults(self) -> None: ... + + +# +# Classes and functions +# + +# TODO: The actual return type should be List[_ClassTreeItem] but mypy doesn't +# seem to be supporting this at the moment: +# _ClassTreeItem = Union[List[_ClassTreeItem], Tuple[type, Tuple[type, ...]]] +def getclasstree(classes: List[type], unique: bool = ...) -> Any: ... + +ArgSpec = NamedTuple('ArgSpec', [('args', List[str]), + ('varargs', str), + ('keywords', str), + ('defaults', tuple), + ]) + +Arguments = NamedTuple('Arguments', [('args', List[str]), + ('varargs', Optional[str]), + ('varkw', Optional[str]), + ]) + +def getargs(co: CodeType) -> Arguments: ... +def getargspec(func: object) -> ArgSpec: ... + +FullArgSpec = NamedTuple('FullArgSpec', [('args', List[str]), + ('varargs', Optional[str]), + ('varkw', Optional[str]), + ('defaults', tuple), + ('kwonlyargs', List[str]), + ('kwonlydefaults', Dict[str, Any]), + ('annotations', Dict[str, Any]), + ]) + +def getfullargspec(func: object) -> FullArgSpec: ... + +# TODO make the field types more specific here +ArgInfo = NamedTuple('ArgInfo', [('args', List[str]), + ('varargs', Optional[str]), + ('keywords', Optional[str]), + ('locals', Dict[str, Any]), + ]) + +def getargvalues(frame: FrameType) -> ArgInfo: ... +def formatannotation(annotation: object, base_module: Optional[str] = ...) -> str: ... +def formatannotationrelativeto(object: object) -> Callable[[object], str]: ... +def formatargspec(args: List[str], + varargs: Optional[str] = ..., + varkw: Optional[str] = ..., + defaults: Optional[Tuple[Any, ...]] = ..., + kwonlyargs: Optional[List[str]] = ..., + kwonlydefaults: Optional[Dict[str, Any]] = ..., + annotations: Dict[str, Any] = ..., + formatarg: Callable[[str], str] = ..., + formatvarargs: Callable[[str], str] = ..., + formatvarkw: Callable[[str], str] = ..., + formatvalue: Callable[[Any], str] = ..., + formatreturns: Callable[[Any], str] = ..., + formatannotations: Callable[[Any], str] = ..., + ) -> str: ... +def formatargvalues(args: List[str], + varargs: Optional[str] = ..., + varkw: Optional[str] = ..., + locals: Optional[Dict[str, Any]] = ..., + formatarg: Optional[Callable[[str], str]] = ..., + formatvarargs: Optional[Callable[[str], str]] = ..., + formatvarkw: Optional[Callable[[str], str]] = ..., + formatvalue: Optional[Callable[[Any], str]] = ..., + ) -> str: ... +def getmro(cls: type) -> Tuple[type, ...]: ... + +def getcallargs(func: Callable[..., Any], + *args: Any, + **kwds: Any) -> Dict[str, Any]: ... + + +ClosureVars = NamedTuple('ClosureVars', [('nonlocals', Mapping[str, Any]), + ('globals', Mapping[str, Any]), + ('builtins', Mapping[str, Any]), + ('unbound', AbstractSet[str]), + ]) +def getclosurevars(func: Callable[..., Any]) -> ClosureVars: ... + +def unwrap(func: Callable[..., Any], + *, + stop: Optional[Callable[[Any], Any]] = ...) -> Any: ... + + +# +# The interpreter stack +# + +Traceback = NamedTuple( + 'Traceback', + [ + ('filename', str), + ('lineno', int), + ('function', str), + ('code_context', List[str]), + ('index', int), + ] +) + +# Python 3.5+ (functions returning it used to return regular tuples) +FrameInfo = NamedTuple('FrameInfo', [('frame', FrameType), + ('filename', str), + ('lineno', int), + ('function', str), + ('code_context', List[str]), + ('index', int), + ]) + +def getframeinfo(frame: Union[FrameType, TracebackType], context: int = ...) -> Traceback: ... +def getouterframes(frame: Any, context: int = ...) -> List[FrameInfo]: ... +def getinnerframes(traceback: TracebackType, context: int = ...) -> List[FrameInfo]: ... +def getlineno(frame: FrameType) -> int: ... +def currentframe() -> Optional[FrameType]: ... +def stack(context: int = ...) -> List[FrameInfo]: ... +def trace(context: int = ...) -> List[FrameInfo]: ... + +# +# Fetching attributes statically +# + +def getattr_static(obj: object, attr: str, default: Optional[Any] = ...) -> Any: ... + + +# +# Current State of Generators and Coroutines +# + +# TODO In the next two blocks of code, can we be more specific regarding the +# type of the "enums"? + +GEN_CREATED: str +GEN_RUNNING: str +GEN_SUSPENDED: str +GEN_CLOSED: str +def getgeneratorstate(generator: Generator[Any, Any, Any]) -> str: ... + +if sys.version_info >= (3, 5): + CORO_CREATED: str + CORO_RUNNING: str + CORO_SUSPENDED: str + CORO_CLOSED: str + # TODO can we be more specific than "object"? + def getcoroutinestate(coroutine: object) -> str: ... + +def getgeneratorlocals(generator: Generator[Any, Any, Any]) -> Dict[str, Any]: ... + +if sys.version_info >= (3, 5): + # TODO can we be more specific than "object"? + def getcoroutinelocals(coroutine: object) -> Dict[str, Any]: ... + +Attribute = NamedTuple('Attribute', [('name', str), + ('kind', str), + ('defining_class', type), + ('object', object), + ]) + +def classify_class_attrs(cls: type) -> List[Attribute]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/io.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/io.pyi new file mode 100644 index 0000000..903fab2 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/io.pyi @@ -0,0 +1,210 @@ +from typing import ( + List, BinaryIO, TextIO, Iterator, Union, Optional, Callable, Tuple, Type, Any, IO, Iterable +) +import builtins +import codecs +from mmap import mmap +import sys +from types import TracebackType +from typing import TypeVar + +_bytearray_like = Union[bytearray, mmap] + +DEFAULT_BUFFER_SIZE: int + +SEEK_SET: int +SEEK_CUR: int +SEEK_END: int + +_T = TypeVar('_T', bound='IOBase') + +open = builtins.open + +BlockingIOError = builtins.BlockingIOError +class UnsupportedOperation(OSError, ValueError): ... + +class IOBase: + def __iter__(self) -> Iterator[bytes]: ... + def __next__(self) -> bytes: ... + def __enter__(self: _T) -> _T: ... + def __exit__(self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], + exc_tb: Optional[TracebackType]) -> bool: ... + def close(self) -> None: ... + def fileno(self) -> int: ... + def flush(self) -> None: ... + def isatty(self) -> bool: ... + def readable(self) -> bool: ... + def readlines(self, hint: int = ...) -> List[bytes]: ... + def seek(self, offset: int, whence: int = ...) -> int: ... + def seekable(self) -> bool: ... + def tell(self) -> int: ... + def truncate(self, size: Optional[int] = ...) -> int: ... + def writable(self) -> bool: ... + def writelines(self, lines: Iterable[Union[bytes, bytearray]]) -> None: ... + def readline(self, size: int = ...) -> bytes: ... + def __del__(self) -> None: ... + @property + def closed(self) -> bool: ... + +class RawIOBase(IOBase): + def readall(self) -> bytes: ... + def readinto(self, b: bytearray) -> Optional[int]: ... + def write(self, b: Union[bytes, bytearray]) -> Optional[int]: ... + def read(self, size: int = ...) -> Optional[bytes]: ... + +class BufferedIOBase(IOBase): + def detach(self) -> RawIOBase: ... + def readinto(self, b: _bytearray_like) -> int: ... + def write(self, b: Union[bytes, bytearray]) -> int: ... + if sys.version_info >= (3, 5): + def readinto1(self, b: _bytearray_like) -> int: ... + def read(self, size: Optional[int] = ...) -> bytes: ... + def read1(self, size: int = ...) -> bytes: ... + + +class FileIO(RawIOBase): + mode: str + name: Union[int, str] + def __init__( + self, + name: Union[str, bytes, int], + mode: str = ..., + closefd: bool = ..., + opener: Optional[Callable[[Union[int, str], str], int]] = ... + ) -> None: ... + +# TODO should extend from BufferedIOBase +class BytesIO(BinaryIO): + def __init__(self, initial_bytes: bytes = ...) -> None: ... + # BytesIO does not contain a "name" field. This workaround is necessary + # to allow BytesIO sub-classes to add this field, as it is defined + # as a read-only property on IO[]. + name: Any + def getvalue(self) -> bytes: ... + def getbuffer(self) -> memoryview: ... + # copied from IOBase + def __iter__(self) -> Iterator[bytes]: ... + def __next__(self) -> bytes: ... + def __enter__(self) -> BytesIO: ... + def __exit__(self, t: Optional[Type[BaseException]] = ..., value: Optional[BaseException] = ..., + traceback: Optional[TracebackType] = ...) -> bool: ... + def close(self) -> None: ... + def fileno(self) -> int: ... + def flush(self) -> None: ... + def isatty(self) -> bool: ... + def readable(self) -> bool: ... + def readlines(self, hint: int = ...) -> List[bytes]: ... + def seek(self, offset: int, whence: int = ...) -> int: ... + def seekable(self) -> bool: ... + def tell(self) -> int: ... + def truncate(self, size: Optional[int] = ...) -> int: ... + def writable(self) -> bool: ... + # TODO should be the next line instead + # def writelines(self, lines: List[Union[bytes, bytearray]]) -> None: ... + def writelines(self, lines: Any) -> None: ... + def readline(self, size: int = ...) -> bytes: ... + def __del__(self) -> None: ... + closed: bool + # copied from BufferedIOBase + def detach(self) -> RawIOBase: ... + def readinto(self, b: _bytearray_like) -> int: ... + def write(self, b: Union[bytes, bytearray]) -> int: ... + if sys.version_info >= (3, 5): + def readinto1(self, b: _bytearray_like) -> int: ... + def read(self, size: Optional[int] = ...) -> bytes: ... + def read1(self, size: int = ...) -> bytes: ... + +class BufferedReader(BufferedIOBase): + def __init__(self, raw: RawIOBase, buffer_size: int = ...) -> None: ... + def peek(self, size: int = ...) -> bytes: ... + +class BufferedWriter(BufferedIOBase): + def __init__(self, raw: RawIOBase, buffer_size: int = ...) -> None: ... + def flush(self) -> None: ... + def write(self, b: Union[bytes, bytearray]) -> int: ... + +class BufferedRandom(BufferedReader, BufferedWriter): + def __init__(self, raw: RawIOBase, buffer_size: int = ...) -> None: ... + def seek(self, offset: int, whence: int = ...) -> int: ... + def tell(self) -> int: ... + +class BufferedRWPair(BufferedIOBase): + def __init__(self, reader: RawIOBase, writer: RawIOBase, + buffer_size: int = ...) -> None: ... + + +class TextIOBase(IOBase): + encoding: str + errors: Optional[str] + newlines: Union[str, Tuple[str, ...], None] + def __iter__(self) -> Iterator[str]: ... # type: ignore + def __next__(self) -> str: ... # type: ignore + def detach(self) -> IOBase: ... + def write(self, s: str) -> int: ... + def writelines(self, lines: List[str]) -> None: ... # type: ignore + def readline(self, size: int = ...) -> str: ... # type: ignore + def readlines(self, hint: int = ...) -> List[str]: ... # type: ignore + def read(self, size: Optional[int] = ...) -> str: ... + def seek(self, offset: int, whence: int = ...) -> int: ... + def tell(self) -> int: ... + +# TODO should extend from TextIOBase +class TextIOWrapper(TextIO): + line_buffering: bool + # TODO uncomment after fixing mypy about using write_through + # def __init__(self, buffer: IO[bytes], encoding: str = ..., + # errors: Optional[str] = ..., newline: Optional[str] = ..., + # line_buffering: bool = ..., write_through: bool = ...) \ + # -> None: ... + def __init__( + self, + buffer: IO[bytes], + encoding: str = ..., + errors: Optional[str] = ..., + newline: Optional[str] = ..., + line_buffering: bool = ..., + write_through: bool = ... + ) -> None: ... + # copied from IOBase + def __exit__(self, t: Optional[Type[BaseException]] = ..., value: Optional[BaseException] = ..., + traceback: Optional[TracebackType] = ...) -> bool: ... + def close(self) -> None: ... + def fileno(self) -> int: ... + def flush(self) -> None: ... + def isatty(self) -> bool: ... + def readable(self) -> bool: ... + def readlines(self, hint: int = ...) -> List[str]: ... + def seekable(self) -> bool: ... + def truncate(self, size: Optional[int] = ...) -> int: ... + def writable(self) -> bool: ... + # TODO should be the next line instead + # def writelines(self, lines: List[str]) -> None: ... + def writelines(self, lines: Any) -> None: ... + def __del__(self) -> None: ... + closed: bool + # copied from TextIOBase + encoding: str + errors: Optional[str] + newlines: Union[str, Tuple[str, ...], None] + def __iter__(self) -> Iterator[str]: ... + def __next__(self) -> str: ... + def __enter__(self) -> TextIO: ... + def detach(self) -> IOBase: ... + def write(self, s: str) -> int: ... + def readline(self, size: int = ...) -> str: ... + def read(self, size: Optional[int] = ...) -> str: ... + def seek(self, offset: int, whence: int = ...) -> int: ... + def tell(self) -> int: ... + +class StringIO(TextIOWrapper): + def __init__(self, initial_value: str = ..., + newline: Optional[str] = ...) -> None: ... + # StringIO does not contain a "name" field. This workaround is necessary + # to allow StringIO sub-classes to add this field, as it is defined + # as a read-only property on IO[]. + name: Any + def getvalue(self) -> str: ... + def __enter__(self) -> StringIO: ... + +class IncrementalNewlineDecoder(codecs.IncrementalDecoder): + def decode(self, input: bytes, final: bool = ...) -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/ipaddress.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/ipaddress.pyi new file mode 100644 index 0000000..f706330 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/ipaddress.pyi @@ -0,0 +1,151 @@ +import sys +from typing import (Any, Container, Generic, Iterable, Iterator, Optional, + overload, SupportsInt, Tuple, TypeVar) + +# Undocumented length constants +IPV4LENGTH: int +IPV6LENGTH: int + +_A = TypeVar("_A", IPv4Address, IPv6Address) +_N = TypeVar("_N", IPv4Network, IPv6Network) +_T = TypeVar("_T") + +def ip_address(address: object) -> Any: ... # morally Union[IPv4Address, IPv6Address] +def ip_network(address: object, strict: bool = ...) -> Any: ... # morally Union[IPv4Network, IPv6Network] +def ip_interface(address: object) -> Any: ... # morally Union[IPv4Interface, IPv6Interface] + +class _IPAddressBase: + def __eq__(self, other: Any) -> bool: ... + def __ge__(self: _T, other: _T) -> bool: ... + def __gt__(self: _T, other: _T) -> bool: ... + def __le__(self: _T, other: _T) -> bool: ... + def __lt__(self: _T, other: _T) -> bool: ... + def __ne__(self, other: Any) -> bool: ... + @property + def compressed(self) -> str: ... + @property + def exploded(self) -> str: ... + if sys.version_info >= (3, 5): + @property + def reverse_pointer(self) -> str: ... + @property + def version(self) -> int: ... + +class _BaseAddress(_IPAddressBase, SupportsInt): + def __init__(self, address: object) -> None: ... + def __add__(self: _T, other: int) -> _T: ... + def __hash__(self) -> int: ... + def __int__(self) -> int: ... + def __sub__(self: _T, other: int) -> _T: ... + @property + def is_global(self) -> bool: ... + @property + def is_link_local(self) -> bool: ... + @property + def is_loopback(self) -> bool: ... + @property + def is_multicast(self) -> bool: ... + @property + def is_private(self) -> bool: ... + @property + def is_reserved(self) -> bool: ... + @property + def is_unspecified(self) -> bool: ... + @property + def max_prefixlen(self) -> int: ... + @property + def packed(self) -> bytes: ... + +class _BaseNetwork(_IPAddressBase, Container, Iterable[_A], Generic[_A]): + network_address: _A + netmask: _A + def __init__(self, address: object, strict: bool = ...) -> None: ... + def __contains__(self, other: Any) -> bool: ... + def __getitem__(self, n: int) -> _A: ... + def __iter__(self) -> Iterator[_A]: ... + def address_exclude(self: _T, other: _T) -> Iterator[_T]: ... + @property + def broadcast_address(self) -> _A: ... + def compare_networks(self: _T, other: _T) -> int: ... + def hosts(self) -> Iterator[_A]: ... + @property + def is_global(self) -> bool: ... + @property + def is_link_local(self) -> bool: ... + @property + def is_loopback(self) -> bool: ... + @property + def is_multicast(self) -> bool: ... + @property + def is_private(self) -> bool: ... + @property + def is_reserved(self) -> bool: ... + @property + def is_unspecified(self) -> bool: ... + @property + def max_prefixlen(self) -> int: ... + @property + def num_addresses(self) -> int: ... + def overlaps(self: _T, other: _T) -> bool: ... + @property + def prefixlen(self) -> int: ... + def subnets(self: _T, prefixlen_diff: int = ..., new_prefix: Optional[int] = ...) -> Iterator[_T]: ... + def supernet(self: _T, prefixlen_diff: int = ..., new_prefix: Optional[int] = ...) -> _T: ... + @property + def with_hostmask(self) -> str: ... + @property + def with_netmask(self) -> str: ... + @property + def with_prefixlen(self) -> str: ... + @property + def hostmask(self) -> _A: ... + +class _BaseInterface(_BaseAddress, Generic[_A, _N]): + hostmask: _A + netmask: _A + network: _N + @property + def ip(self) -> _A: ... + @property + def with_hostmask(self) -> str: ... + @property + def with_netmask(self) -> str: ... + @property + def with_prefixlen(self) -> str: ... + +class IPv4Address(_BaseAddress): ... +class IPv4Network(_BaseNetwork[IPv4Address]): ... +class IPv4Interface(IPv4Address, _BaseInterface[IPv4Address, IPv4Network]): ... + +class IPv6Address(_BaseAddress): + @property + def ipv4_mapped(self) -> Optional[IPv4Address]: ... + @property + def is_site_local(self) -> bool: ... + @property + def sixtofour(self) -> Optional[IPv4Address]: ... + @property + def teredo(self) -> Optional[Tuple[IPv4Address, IPv4Address]]: ... + +class IPv6Network(_BaseNetwork[IPv6Address]): + @property + def is_site_local(self) -> bool: ... + +class IPv6Interface(IPv6Address, _BaseInterface[IPv6Address, IPv6Network]): ... + +def v4_int_to_packed(address: int) -> bytes: ... +def v6_int_to_packed(address: int) -> bytes: ... +@overload +def summarize_address_range(first: IPv4Address, last: IPv4Address) -> Iterator[IPv4Network]: ... +@overload +def summarize_address_range(first: IPv6Address, last: IPv6Address) -> Iterator[IPv6Network]: ... +def collapse_addresses(addresses: Iterable[_N]) -> Iterator[_N]: ... +@overload +def get_mixed_type_key(obj: _A) -> Tuple[int, _A]: ... +@overload +def get_mixed_type_key(obj: IPv4Network) -> Tuple[int, IPv4Address, IPv4Address]: ... +@overload +def get_mixed_type_key(obj: IPv6Network) -> Tuple[int, IPv6Address, IPv6Address]: ... + +class AddressValueError(ValueError): ... +class NetmaskValueError(ValueError): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/itertools.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/itertools.pyi new file mode 100644 index 0000000..f34dd5b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/itertools.pyi @@ -0,0 +1,106 @@ +# Stubs for itertools + +# Based on http://docs.python.org/3.2/library/itertools.html + +from typing import (Iterator, TypeVar, Iterable, overload, Any, Callable, Tuple, + Generic, Optional) + +_T = TypeVar('_T') +_S = TypeVar('_S') +_N = TypeVar('_N', int, float) +Predicate = Callable[[_T], object] + +def count(start: _N = ..., + step: _N = ...) -> Iterator[_N]: ... # more general types? +def cycle(iterable: Iterable[_T]) -> Iterator[_T]: ... + +@overload +def repeat(object: _T) -> Iterator[_T]: ... +@overload +def repeat(object: _T, times: int) -> Iterator[_T]: ... + +def accumulate(iterable: Iterable[_T], func: Callable[[_T, _T], _T] = ...) -> Iterator[_T]: ... + +class chain(Iterator[_T], Generic[_T]): + def __init__(self, *iterables: Iterable[_T]) -> None: ... + def __next__(self) -> _T: ... + def __iter__(self) -> Iterator[_T]: ... + @staticmethod + def from_iterable(iterable: Iterable[Iterable[_S]]) -> Iterator[_S]: ... + +def compress(data: Iterable[_T], selectors: Iterable[Any]) -> Iterator[_T]: ... +def dropwhile(predicate: Predicate[_T], + iterable: Iterable[_T]) -> Iterator[_T]: ... +def filterfalse(predicate: Optional[Predicate[_T]], + iterable: Iterable[_T]) -> Iterator[_T]: ... + +@overload +def groupby(iterable: Iterable[_T], key: None = ...) -> Iterator[Tuple[_T, Iterator[_T]]]: ... +@overload +def groupby(iterable: Iterable[_T], key: Callable[[_T], _S]) -> Iterator[Tuple[_S, Iterator[_T]]]: ... + +@overload +def islice(iterable: Iterable[_T], stop: Optional[int]) -> Iterator[_T]: ... +@overload +def islice(iterable: Iterable[_T], start: Optional[int], stop: Optional[int], + step: Optional[int] = ...) -> Iterator[_T]: ... + +def starmap(func: Callable[..., _S], iterable: Iterable[Iterable[Any]]) -> Iterator[_S]: ... +def takewhile(predicate: Predicate[_T], + iterable: Iterable[_T]) -> Iterator[_T]: ... +def tee(iterable: Iterable[_T], n: int = ...) -> Tuple[Iterator[_T], ...]: ... +def zip_longest(*p: Iterable[Any], + fillvalue: Any = ...) -> Iterator[Any]: ... + +_T1 = TypeVar('_T1') +_T2 = TypeVar('_T2') +_T3 = TypeVar('_T3') +_T4 = TypeVar('_T4') +_T5 = TypeVar('_T5') +_T6 = TypeVar('_T6') + +@overload +def product(iter1: Iterable[_T1]) -> Iterator[Tuple[_T1]]: ... +@overload +def product(iter1: Iterable[_T1], + iter2: Iterable[_T2]) -> Iterator[Tuple[_T1, _T2]]: ... +@overload +def product(iter1: Iterable[_T1], + iter2: Iterable[_T2], + iter3: Iterable[_T3]) -> Iterator[Tuple[_T1, _T2, _T3]]: ... +@overload +def product(iter1: Iterable[_T1], + iter2: Iterable[_T2], + iter3: Iterable[_T3], + iter4: Iterable[_T4]) -> Iterator[Tuple[_T1, _T2, _T3, _T4]]: ... +@overload +def product(iter1: Iterable[_T1], + iter2: Iterable[_T2], + iter3: Iterable[_T3], + iter4: Iterable[_T4], + iter5: Iterable[_T5]) -> Iterator[Tuple[_T1, _T2, _T3, _T4, _T5]]: ... +@overload +def product(iter1: Iterable[_T1], + iter2: Iterable[_T2], + iter3: Iterable[_T3], + iter4: Iterable[_T4], + iter5: Iterable[_T5], + iter6: Iterable[_T6]) -> Iterator[Tuple[_T1, _T2, _T3, _T4, _T5, _T6]]: ... +@overload +def product(iter1: Iterable[Any], + iter2: Iterable[Any], + iter3: Iterable[Any], + iter4: Iterable[Any], + iter5: Iterable[Any], + iter6: Iterable[Any], + iter7: Iterable[Any], + *iterables: Iterable[Any]) -> Iterator[Tuple[Any, ...]]: ... +@overload +def product(*iterables: Iterable[Any], repeat: int = ...) -> Iterator[Tuple[Any, ...]]: ... + +def permutations(iterable: Iterable[_T], + r: Optional[int] = ...) -> Iterator[Tuple[_T, ...]]: ... +def combinations(iterable: Iterable[_T], + r: int) -> Iterator[Tuple[_T, ...]]: ... +def combinations_with_replacement(iterable: Iterable[_T], + r: int) -> Iterator[Tuple[_T, ...]]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/json/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/json/__init__.pyi new file mode 100644 index 0000000..620b239 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/json/__init__.pyi @@ -0,0 +1,58 @@ +import sys +from typing import Any, IO, Optional, Tuple, Callable, Dict, List, Union, Protocol + +from .decoder import JSONDecoder as JSONDecoder +from .encoder import JSONEncoder as JSONEncoder +if sys.version_info >= (3, 5): + from .decoder import JSONDecodeError as JSONDecodeError + +def dumps(obj: Any, + skipkeys: bool = ..., + ensure_ascii: bool = ..., + check_circular: bool = ..., + allow_nan: bool = ..., + cls: Any = ..., + indent: Union[None, int, str] = ..., + separators: Optional[Tuple[str, str]] = ..., + default: Optional[Callable[[Any], Any]] = ..., + sort_keys: bool = ..., + **kwds: Any) -> str: ... + +def dump(obj: Any, + fp: IO[str], + skipkeys: bool = ..., + ensure_ascii: bool = ..., + check_circular: bool = ..., + allow_nan: bool = ..., + cls: Any = ..., + indent: Union[None, int, str] = ..., + separators: Optional[Tuple[str, str]] = ..., + default: Optional[Callable[[Any], Any]] = ..., + sort_keys: bool = ..., + **kwds: Any) -> None: ... + +if sys.version_info >= (3, 6): + _LoadsString = Union[str, bytes, bytearray] +else: + _LoadsString = str +def loads(s: _LoadsString, + encoding: Any = ..., # ignored and deprecated + cls: Any = ..., + object_hook: Optional[Callable[[Dict], Any]] = ..., + parse_float: Optional[Callable[[str], Any]] = ..., + parse_int: Optional[Callable[[str], Any]] = ..., + parse_constant: Optional[Callable[[str], Any]] = ..., + object_pairs_hook: Optional[Callable[[List[Tuple[Any, Any]]], Any]] = ..., + **kwds: Any) -> Any: ... + +class _Reader(Protocol): + def read(self) -> _LoadsString: ... + +def load(fp: _Reader, + cls: Any = ..., + object_hook: Optional[Callable[[Dict], Any]] = ..., + parse_float: Optional[Callable[[str], Any]] = ..., + parse_int: Optional[Callable[[str], Any]] = ..., + parse_constant: Optional[Callable[[str], Any]] = ..., + object_pairs_hook: Optional[Callable[[List[Tuple[Any, Any]]], Any]] = ..., + **kwds: Any) -> Any: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/json/decoder.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/json/decoder.pyi new file mode 100644 index 0000000..8e30c1e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/json/decoder.pyi @@ -0,0 +1,28 @@ +import sys +from typing import Any, Callable, Dict, List, Optional, Tuple + +if sys.version_info >= (3, 5): + class JSONDecodeError(ValueError): + msg: str + doc: str + pos: int + lineno: int + colno: int + def __init__(self, msg: str, doc: str, pos: int) -> None: ... + +class JSONDecoder: + object_hook: Callable[[Dict[str, Any]], Any] + parse_float: Callable[[str], Any] + parse_int: Callable[[str], Any] + parse_constant = ... # Callable[[str], Any] + strict: bool + object_pairs_hook: Callable[[List[Tuple[str, Any]]], Any] + + def __init__(self, object_hook: Optional[Callable[[Dict[str, Any]], Any]] = ..., + parse_float: Optional[Callable[[str], Any]] = ..., + parse_int: Optional[Callable[[str], Any]] = ..., + parse_constant: Optional[Callable[[str], Any]] = ..., + strict: bool = ..., + object_pairs_hook: Optional[Callable[[List[Tuple[str, Any]]], Any]] = ...) -> None: ... + def decode(self, s: str) -> Any: ... + def raw_decode(self, s: str, idx: int = ...) -> Tuple[Any, int]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/json/encoder.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/json/encoder.pyi new file mode 100644 index 0000000..e35f344 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/json/encoder.pyi @@ -0,0 +1,21 @@ +from typing import Any, Callable, Iterator, Optional, Tuple + +class JSONEncoder: + item_separator: str + key_separator: str + + skipkeys: bool + ensure_ascii: bool + check_circular: bool + allow_nan: bool + sort_keys: bool + indent: int + + def __init__(self, skipkeys: bool = ..., ensure_ascii: bool = ..., + check_circular: bool = ..., allow_nan: bool = ..., sort_keys: bool = ..., + indent: Optional[int] = ..., separators: Optional[Tuple[str, str]] = ..., + default: Optional[Callable] = ...) -> None: ... + + def default(self, o: Any) -> Any: ... + def encode(self, o: Any) -> str: ... + def iterencode(self, o: Any, _one_shot: bool = ...) -> Iterator[str]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/lzma.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/lzma.pyi new file mode 100644 index 0000000..cd0a088 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/lzma.pyi @@ -0,0 +1,107 @@ +import io +import sys +from typing import Any, IO, Mapping, Optional, Sequence, Union + +if sys.version_info >= (3, 6): + from os import PathLike + _PathOrFile = Union[str, bytes, IO[Any], PathLike[Any]] +else: + _PathOrFile = Union[str, bytes, IO[Any]] + +_FilterChain = Sequence[Mapping[str, Any]] + +FORMAT_AUTO: int +FORMAT_XZ: int +FORMAT_ALONE: int +FORMAT_RAW: int +CHECK_NONE: int +CHECK_CRC32: int +CHECK_CRC64: int +CHECK_SHA256: int +CHECK_ID_MAX: int +CHECK_UNKNOWN: int +FILTER_LZMA1: int +FILTER_LZMA2: int +FILTER_DELTA: int +FILTER_X86: int +FILTER_IA64: int +FILTER_ARM: int +FILTER_ARMTHUMB: int +FILTER_SPARC: int +FILTER_POWERPC: int +MF_HC3: int +MF_HC4: int +MF_BT2: int +MF_BT3: int +MF_BT4: int +MODE_FAST: int +MODE_NORMAL: int +PRESET_DEFAULT: int +PRESET_EXTREME: int + +# from _lzma.c +class LZMADecompressor(object): + def __init__(self, format: Optional[int] = ..., memlimit: Optional[int] = ..., filters: Optional[_FilterChain] = ...) -> None: ... + def decompress(self, data: bytes, max_length: int = ...) -> bytes: ... + @property + def check(self) -> int: ... + @property + def eof(self) -> bool: ... + @property + def unused_data(self) -> bytes: ... + if sys.version_info >= (3, 5): + @property + def needs_input(self) -> bool: ... + +# from _lzma.c +class LZMACompressor(object): + def __init__(self, + format: Optional[int] = ..., + check: int = ..., + preset: Optional[int] = ..., + filters: Optional[_FilterChain] = ...) -> None: ... + def compress(self, data: bytes) -> bytes: ... + def flush(self) -> bytes: ... + + +class LZMAError(Exception): ... + + +class LZMAFile(io.BufferedIOBase, IO[bytes]): # type: ignore # python/mypy#5027 + def __init__(self, + filename: Optional[_PathOrFile] = ..., + mode: str = ..., + *, + format: Optional[int] = ..., + check: int = ..., + preset: Optional[int] = ..., + filters: Optional[_FilterChain] = ...) -> None: ... + def close(self) -> None: ... + @property + def closed(self) -> bool: ... + def fileno(self) -> int: ... + def seekable(self) -> bool: ... + def readable(self) -> bool: ... + def writable(self) -> bool: ... + def peek(self, size: int = ...) -> bytes: ... + def read(self, size: Optional[int] = ...) -> bytes: ... + def read1(self, size: int = ...) -> bytes: ... + def readline(self, size: int = ...) -> bytes: ... + def write(self, data: bytes) -> int: ... + def seek(self, offset: int, whence: int = ...) -> int: ... + def tell(self) -> int: ... + + +def open(filename: _PathOrFile, + mode: str = ..., + *, + format: Optional[int] = ..., + check: int = ..., + preset: Optional[int] = ..., + filters: Optional[_FilterChain] = ..., + encoding: Optional[str] = ..., + errors: Optional[str] = ..., + newline: Optional[str] = ...) -> IO[Any]: ... +def compress(data: bytes, format: int = ..., check: int = ..., preset: Optional[int] = ..., filters: Optional[_FilterChain] = ...) -> bytes: ... +def decompress(data: bytes, format: int = ..., memlimit: Optional[int] = ..., filters: Optional[_FilterChain] = ...) -> bytes: ... +def is_check_supported(check: int) -> bool: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/msvcrt.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/msvcrt.pyi new file mode 100644 index 0000000..bcab64c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/msvcrt.pyi @@ -0,0 +1,8 @@ +# Stubs for msvcrt + +# NOTE: These are incomplete! + +from typing import overload, BinaryIO, TextIO + +def get_osfhandle(file: int) -> int: ... +def open_osfhandle(handle: int, flags: int) -> int: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/__init__.pyi new file mode 100644 index 0000000..e5fad0a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/__init__.pyi @@ -0,0 +1,85 @@ +# Stubs for multiprocessing + +from typing import ( + Any, Callable, ContextManager, Iterable, Mapping, Optional, Dict, List, + Union, Sequence, Tuple +) + +from logging import Logger +from multiprocessing import connection, pool, spawn, synchronize +from multiprocessing.context import ( + BaseContext, + ProcessError as ProcessError, BufferTooShort as BufferTooShort, TimeoutError as TimeoutError, AuthenticationError as AuthenticationError) +from multiprocessing.managers import SyncManager +from multiprocessing.process import current_process as current_process +from multiprocessing.queues import Queue as Queue, SimpleQueue as SimpleQueue, JoinableQueue as JoinableQueue +from multiprocessing.spawn import freeze_support as freeze_support +from multiprocessing.spawn import set_executable as set_executable + +import sys + +# N.B. The functions below are generated at runtime by partially applying +# multiprocessing.context.BaseContext's methods, so the two signatures should +# be identical (modulo self). + +# Sychronization primitives +_LockLike = Union[synchronize.Lock, synchronize.RLock] +def Barrier(parties: int, + action: Optional[Callable] = ..., + timeout: Optional[float] = ...) -> synchronize.Barrier: ... +def BoundedSemaphore(value: int = ...) -> synchronize.BoundedSemaphore: ... +def Condition(lock: Optional[_LockLike] = ...) -> synchronize.Condition: ... +def Event(lock: Optional[_LockLike] = ...) -> synchronize.Event: ... +def Lock() -> synchronize.Lock: ... +def RLock() -> synchronize.RLock: ... +def Semaphore(value: int = ...) -> synchronize.Semaphore: ... + +def Pipe(duplex: bool = ...) -> Tuple[connection.Connection, connection.Connection]: ... + +def Pool(processes: Optional[int] = ..., + initializer: Optional[Callable[..., Any]] = ..., + initargs: Iterable[Any] = ..., + maxtasksperchild: Optional[int] = ...) -> pool.Pool: ... + +class Process(): + name: str + daemon: bool + pid: Optional[int] + exitcode: Optional[int] + authkey: bytes + sentinel: int + # TODO: set type of group to None + def __init__(self, + group: Any = ..., + target: Optional[Callable] = ..., + name: Optional[str] = ..., + args: Iterable[Any] = ..., + kwargs: Mapping[Any, Any] = ..., + *, + daemon: Optional[bool] = ...) -> None: ... + def start(self) -> None: ... + def run(self) -> None: ... + def terminate(self) -> None: ... + if sys.version_info >= (3, 7): + def kill(self) -> None: ... + def close(self) -> None: ... + def is_alive(self) -> bool: ... + def join(self, timeout: Optional[float] = ...) -> None: ... + +class Value(): + value: Any = ... + def __init__(self, typecode_or_type: str, *args: Any, lock: Union[bool, _LockLike] = ...) -> None: ... + def get_lock(self) -> _LockLike: ... + +# ----- multiprocessing function stubs ----- +def active_children() -> List[Process]: ... +def allow_connection_pickling() -> None: ... +def cpu_count() -> int: ... +def get_logger() -> Logger: ... +def log_to_stderr(level: Optional[Union[str, int]] = ...) -> Logger: ... +def Manager() -> SyncManager: ... +def set_forkserver_preload(module_names: List[str]) -> None: ... +def get_all_start_methods() -> List[str]: ... +def get_context(method: Optional[str] = ...) -> BaseContext: ... +def get_start_method(allow_none: Optional[bool]) -> Optional[str]: ... +def set_start_method(method: str, force: Optional[bool] = ...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/connection.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/connection.pyi new file mode 100644 index 0000000..76bdca0 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/connection.pyi @@ -0,0 +1,48 @@ +from typing import Any, Iterable, List, Optional, Tuple, Type, Union +import socket +import sys +import types + +# https://docs.python.org/3/library/multiprocessing.html#address-formats +_Address = Union[str, Tuple[str, int]] + +class _ConnectionBase: + @property + def closed(self) -> bool: ... # undocumented + @property + def readable(self) -> bool: ... # undocumented + @property + def writable(self) -> bool: ... # undocumented + def fileno(self) -> int: ... + def close(self) -> None: ... + def send_bytes(self, + buf: bytes, + offset: int = ..., + size: Optional[int] = ...) -> None: ... + def send(self, obj: Any) -> None: ... + def recv_bytes(self, maxlength: Optional[int] = ...) -> bytes: ... + def recv_bytes_into(self, buf: Any, offset: int = ...) -> int: ... + def recv(self) -> Any: ... + def poll(self, timeout: Optional[float] = ...) -> bool: ... + +class Connection(_ConnectionBase): ... + +if sys.platform == "win32": + class PipeConnection(_ConnectionBase): ... + +class Listener: + def __init__(self, address: Optional[_Address] = ..., family: Optional[str] = ..., backlog: int = ..., authkey: Optional[bytes] = ...) -> None: ... + def accept(self) -> Connection: ... + def close(self) -> None: ... + @property + def address(self) -> _Address: ... + @property + def last_accepted(self) -> Optional[_Address]: ... + def __enter__(self) -> Listener: ... + def __exit__(self, exc_type: Optional[Type[BaseException]], exc_value: Optional[BaseException], exc_tb: Optional[types.TracebackType]) -> None: ... + +def deliver_challenge(connection: Connection, authkey: bytes) -> None: ... +def answer_challenge(connection: Connection, authkey: bytes) -> None: ... +def wait(object_list: Iterable[Union[Connection, socket.socket, int]], timeout: Optional[float] = ...) -> List[Union[Connection, socket.socket, int]]: ... +def Client(address: _Address, family: Optional[str] = ..., authkey: Optional[bytes] = ...) -> Connection: ... +def Pipe(duplex: bool = ...) -> Tuple[Connection, Connection]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/context.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/context.pyi new file mode 100644 index 0000000..dada9b3 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/context.pyi @@ -0,0 +1,179 @@ +# Stubs for multiprocessing.context + +from logging import Logger +import multiprocessing +from multiprocessing import synchronize +from multiprocessing import queues +import sys +from typing import ( + Any, Callable, Iterable, Optional, List, Mapping, Sequence, Tuple, Type, + Union, +) + +_LockLike = Union[synchronize.Lock, synchronize.RLock] + +class ProcessError(Exception): ... + +class BufferTooShort(ProcessError): ... + +class TimeoutError(ProcessError): ... + +class AuthenticationError(ProcessError): ... + +class BaseContext(object): + ProcessError: Type[Exception] + BufferTooShort: Type[Exception] + TimeoutError: Type[Exception] + AuthenticationError: Type[Exception] + + # N.B. The methods below are applied at runtime to generate + # multiprocessing.*, so the signatures should be identical (modulo self). + + @staticmethod + def current_process() -> multiprocessing.Process: ... + @staticmethod + def active_children() -> List[multiprocessing.Process]: ... + def cpu_count(self) -> int: ... + # TODO: change return to SyncManager once a stub exists in multiprocessing.managers + def Manager(self) -> Any: ... + # TODO: change return to Pipe once a stub exists in multiprocessing.connection + def Pipe(self, duplex: bool) -> Any: ... + + def Barrier(self, + parties: int, + action: Optional[Callable] = ..., + timeout: Optional[float] = ...) -> synchronize.Barrier: ... + def BoundedSemaphore(self, + value: int = ...) -> synchronize.BoundedSemaphore: ... + def Condition(self, + lock: Optional[_LockLike] = ...) -> synchronize.Condition: ... + def Event(self, lock: Optional[_LockLike] = ...) -> synchronize.Event: ... + def Lock(self) -> synchronize.Lock: ... + def RLock(self) -> synchronize.RLock: ... + def Semaphore(self, value: int = ...) -> synchronize.Semaphore: ... + + def Queue(self, maxsize: int = ...) -> queues.Queue: ... + def JoinableQueue(self, maxsize: int = ...) -> queues.JoinableQueue: ... + def SimpleQueue(self) -> queues.SimpleQueue: ... + def Pool( + self, + processes: Optional[int] = ..., + initializer: Optional[Callable[..., Any]] = ..., + initargs: Iterable[Any] = ..., + maxtasksperchild: Optional[int] = ... + ) -> multiprocessing.pool.Pool: ... + def Process( + self, + group: Any = ..., + target: Optional[Callable] = ..., + name: Optional[str] = ..., + args: Iterable[Any] = ..., + kwargs: Mapping[Any, Any] = ..., + *, + daemon: Optional[bool] = ... + ) -> multiprocessing.Process: ... + # TODO: typecode_or_type param is a ctype with a base class of _SimpleCData or array.typecode Need to figure out + # how to handle the ctype + # TODO: change return to RawValue once a stub exists in multiprocessing.sharedctypes + def RawValue(self, typecode_or_type: Any, *args: Any) -> Any: ... + # TODO: typecode_or_type param is a ctype with a base class of _SimpleCData or array.typecode Need to figure out + # how to handle the ctype + # TODO: change return to RawArray once a stub exists in multiprocessing.sharedctypes + def RawArray(self, typecode_or_type: Any, size_or_initializer: Union[int, Sequence[Any]]) -> Any: ... + # TODO: typecode_or_type param is a ctype with a base class of _SimpleCData or array.typecode Need to figure out + # how to handle the ctype + # TODO: change return to Value once a stub exists in multiprocessing.sharedctypes + def Value( + self, + typecode_or_type: Any, + *args: Any, + lock: bool = ... + ) -> Any: ... + # TODO: typecode_or_type param is a ctype with a base class of _SimpleCData or array.typecode Need to figure out + # how to handle the ctype + # TODO: change return to Array once a stub exists in multiprocessing.sharedctypes + def Array( + self, + typecode_or_type: Any, + size_or_initializer: Union[int, Sequence[Any]], + *, + lock: bool = ... + ) -> Any: ... + def freeze_support(self) -> None: ... + def get_logger(self) -> Logger: ... + def log_to_stderr(self, level: Optional[str] = ...) -> Logger: ... + def allow_connection_pickling(self) -> None: ... + def set_executable(self, executable: str) -> None: ... + def set_forkserver_preload(self, module_names: List[str]) -> None: ... + def get_context(self, method: Optional[str] = ...) -> BaseContext: ... + def get_start_method(self, allow_none: bool = ...) -> str: ... + def set_start_method(self, method: Optional[str] = ...) -> None: ... + @property + def reducer(self) -> str: ... + @reducer.setter + def reducer(self, reduction: str) -> None: ... + def _check_available(self) -> None: ... + +class Process(object): + _start_method: Optional[str] + @staticmethod + # TODO: type should be BaseProcess once a stub in multiprocessing.process exists + def _Popen(process_obj: Any) -> DefaultContext: ... + +class DefaultContext(object): + Process: Type[multiprocessing.Process] + + def __init__(self, context: BaseContext) -> None: ... + def get_context(self, method: Optional[str] = ...) -> BaseContext: ... + def set_start_method(self, method: str, force: bool = ...) -> None: ... + def get_start_method(self, allow_none: bool = ...) -> str: ... + def get_all_start_methods(self) -> List[str]: ... + +if sys.platform != 'win32': + # TODO: type should be BaseProcess once a stub in multiprocessing.process exists + class ForkProcess(Any): # type: ignore + _start_method: str + @staticmethod + def _Popen(process_obj: Any) -> Any: ... + + # TODO: type should be BaseProcess once a stub in multiprocessing.process exists + class SpawnProcess(Any): # type: ignore + _start_method: str + @staticmethod + def _Popen(process_obj: Any) -> SpawnProcess: ... + + # TODO: type should be BaseProcess once a stub in multiprocessing.process exists + class ForkServerProcess(Any): # type: ignore + _start_method: str + @staticmethod + def _Popen(process_obj: Any) -> Any: ... + + class ForkContext(BaseContext): + _name: str + Process: Type[ForkProcess] + + class SpawnContext(BaseContext): + _name: str + Process: Type[SpawnProcess] + + class ForkServerContext(BaseContext): + _name: str + Process: Type[ForkServerProcess] +else: + # TODO: type should be BaseProcess once a stub in multiprocessing.process exists + class SpawnProcess(Any): # type: ignore + _start_method: str + @staticmethod + # TODO: type should be BaseProcess once a stub in multiprocessing.process exists + def _Popen(process_obj: Process) -> Any: ... + + class SpawnContext(BaseContext): + _name: str + Process: Type[SpawnProcess] + +def _force_start_method(method: str) -> None: ... +# TODO: type should be BaseProcess once a stub in multiprocessing.process exists +def get_spawning_popen() -> Optional[Any]: ... +# TODO: type should be BaseProcess once a stub in multiprocessing.process exists +def set_spawning_popen(popen: Any) -> None: ... +def assert_spawning(obj: Any) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/dummy/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/dummy/__init__.pyi new file mode 100644 index 0000000..c169d2d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/dummy/__init__.pyi @@ -0,0 +1,42 @@ +from typing import Any, Optional, List, Type + +import array +import sys +import threading +import weakref + +from .connection import Pipe +from threading import Lock, RLock, Semaphore, BoundedSemaphore +from threading import Event, Condition, Barrier +from queue import Queue + +JoinableQueue = Queue + + +class DummyProcess(threading.Thread): + _children: weakref.WeakKeyDictionary + _parent: threading.Thread + _pid: None + _start_called: int + exitcode: Optional[int] + def __init__(self, group=..., target=..., name=..., args=..., kwargs=...) -> None: ... + +Process = DummyProcess + +class Namespace(object): + def __init__(self, **kwds) -> None: ... + +class Value(object): + _typecode: Any + _value: Any + value: Any + def __init__(self, typecode, value, lock=...) -> None: ... + + +def Array(typecode, sequence, lock=...) -> array.array: ... +def Manager() -> Any: ... +def Pool(processes=..., initializer=..., initargs=...) -> Any: ... +def active_children() -> List: ... +def current_process() -> threading.Thread: ... +def freeze_support() -> None: ... +def shutdown() -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/dummy/connection.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/dummy/connection.pyi new file mode 100644 index 0000000..3baaf28 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/dummy/connection.pyi @@ -0,0 +1,35 @@ +from typing import Any, List, Optional, Tuple, Type, TypeVar + +from queue import Queue + +families: List[None] + +_TConnection = TypeVar('_TConnection', bound=Connection) +_TListener = TypeVar('_TListener', bound=Listener) + +class Connection(object): + _in: Any + _out: Any + recv: Any + recv_bytes: Any + send: Any + send_bytes: Any + def __enter__(self: _TConnection) -> _TConnection: ... + def __exit__(self, exc_type, exc_value, exc_tb) -> None: ... + def __init__(self, _in, _out) -> None: ... + def close(self) -> None: ... + def poll(self, timeout: float = ...) -> bool: ... + +class Listener(object): + _backlog_queue: Optional[Queue] + @property + def address(self) -> Optional[Queue]: ... + def __enter__(self: _TListener) -> _TListener: ... + def __exit__(self, exc_type, exc_value, exc_tb) -> None: ... + def __init__(self, address=..., family=..., backlog=...) -> None: ... + def accept(self) -> Connection: ... + def close(self) -> None: ... + + +def Client(address) -> Connection: ... +def Pipe(duplex: bool = ...) -> Tuple[Connection, Connection]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/managers.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/managers.pyi new file mode 100644 index 0000000..a5ec399 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/managers.pyi @@ -0,0 +1,47 @@ +# Stubs for multiprocessing.managers + +# NOTE: These are incomplete! + +import queue +import threading +from typing import ( + Any, Callable, ContextManager, Dict, Iterable, List, Mapping, Optional, + Sequence, Tuple, TypeVar, Union, +) + +_T = TypeVar('_T') +_KT = TypeVar('_KT') +_VT = TypeVar('_VT') + +class Namespace: ... + +_Namespace = Namespace + +class BaseManager(ContextManager[BaseManager]): + address: Union[str, Tuple[str, int]] + def connect(self) -> None: ... + @classmethod + def register(cls, typeid: str, callable: Optional[Callable] = ..., + proxytype: Any = ..., + exposed: Optional[Sequence[str]] = ..., + method_to_typeid: Optional[Mapping[str, str]] = ..., + create_method: bool = ...) -> None: ... + def shutdown(self) -> None: ... + def start(self, initializer: Optional[Callable[..., Any]] = ..., + initargs: Iterable[Any] = ...) -> None: ... + +class SyncManager(BaseManager): + def BoundedSemaphore(self, value: Any = ...) -> threading.BoundedSemaphore: ... + def Condition(self, lock: Any = ...) -> threading.Condition: ... + def Event(self) -> threading.Event: ... + def Lock(self) -> threading.Lock: ... + def Namespace(self) -> _Namespace: ... + def Queue(self, maxsize: int = ...) -> queue.Queue: ... + def RLock(self) -> threading.RLock: ... + def Semaphore(self, value: Any = ...) -> threading.Semaphore: ... + def Array(self, typecode: Any, sequence: Sequence[_T]) -> Sequence[_T]: ... + def Value(self, typecode: Any, value: _T) -> _T: ... + def dict(self, sequence: Mapping[_KT, _VT] = ...) -> Dict[_KT, _VT]: ... + def list(self, sequence: Sequence[_T] = ...) -> List[_T]: ... + +class RemoteError(Exception): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/pool.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/pool.pyi new file mode 100644 index 0000000..469d83a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/pool.pyi @@ -0,0 +1,87 @@ +from typing import ( + Any, Callable, ContextManager, Iterable, Mapping, Optional, List, + Type, TypeVar, Generic, Iterator +) +from types import TracebackType + +_PT = TypeVar('_PT', bound='Pool') +_S = TypeVar('_S') +_T = TypeVar('_T') + +class ApplyResult(Generic[_T]): + def get(self, timeout: Optional[float] = ...) -> _T: ... + def wait(self, timeout: Optional[float] = ...) -> None: ... + def ready(self) -> bool: ... + def successful(self) -> bool: ... + +# alias created during issue #17805 +AsyncResult = ApplyResult + +_IMIT = TypeVar('_IMIT', bound=IMapIterator) + +class IMapIterator(Iterator[_T]): + def __iter__(self: _IMIT) -> _IMIT: ... + def next(self, timeout: Optional[float] = ...) -> _T: ... + def __next__(self, timeout: Optional[float] = ...) -> _T: ... + +class IMapUnorderedIterator(IMapIterator): ... + +class Pool(ContextManager[Pool]): + def __init__(self, processes: Optional[int] = ..., + initializer: Optional[Callable[..., None]] = ..., + initargs: Iterable[Any] = ..., + maxtasksperchild: Optional[int] = ..., + context: Optional[Any] = ...) -> None: ... + def apply(self, + func: Callable[..., _T], + args: Iterable[Any] = ..., + kwds: Mapping[str, Any] = ...) -> _T: ... + def apply_async(self, + func: Callable[..., _T], + args: Iterable[Any] = ..., + kwds: Mapping[str, Any] = ..., + callback: Optional[Callable[[_T], None]] = ..., + error_callback: Optional[Callable[[BaseException], None]] = ...) -> AsyncResult[_T]: ... + def map(self, + func: Callable[[_S], _T], + iterable: Iterable[_S] = ..., + chunksize: Optional[int] = ...) -> List[_T]: ... + def map_async(self, func: Callable[[_S], _T], + iterable: Iterable[_S] = ..., + chunksize: Optional[int] = ..., + callback: Optional[Callable[[_T], None]] = ..., + error_callback: Optional[Callable[[BaseException], None]] = ...) -> AsyncResult[List[_T]]: ... + def imap(self, + func: Callable[[_S], _T], + iterable: Iterable[_S] = ..., + chunksize: Optional[int] = ...) -> IMapIterator[_T]: ... + def imap_unordered(self, + func: Callable[[_S], _T], + iterable: Iterable[_S] = ..., + chunksize: Optional[int] = ...) -> IMapIterator[_T]: ... + def starmap(self, + func: Callable[..., _T], + iterable: Iterable[Iterable[Any]] = ..., + chunksize: Optional[int] = ...) -> List[_T]: ... + def starmap_async(self, + func: Callable[..., _T], + iterable: Iterable[Iterable[Any]] = ..., + chunksize: Optional[int] = ..., + callback: Optional[Callable[[_T], None]] = ..., + error_callback: Optional[Callable[[BaseException], None]] = ...) -> AsyncResult[List[_T]]: ... + def close(self) -> None: ... + def terminate(self) -> None: ... + def join(self) -> None: ... + def __enter__(self: _PT) -> _PT: ... + + +class ThreadPool(Pool, ContextManager[ThreadPool]): + + def __init__(self, processes: Optional[int] = ..., + initializer: Optional[Callable[..., Any]] = ..., + initargs: Iterable[Any] = ...) -> None: ... + +# undocumented +RUN: int +CLOSE: int +TERMINATE: int diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/process.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/process.pyi new file mode 100644 index 0000000..df8ea93 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/process.pyi @@ -0,0 +1,5 @@ +from typing import List +from multiprocessing import Process + +def current_process() -> Process: ... +def active_children() -> List[Process]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/queues.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/queues.pyi new file mode 100644 index 0000000..c6dd0f2 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/queues.pyi @@ -0,0 +1,30 @@ +from typing import Any, Generic, Optional, TypeVar + +import queue + +_T = TypeVar('_T') + +class Queue(queue.Queue[_T]): + # FIXME: `ctx` is a circular dependency and it's not actually optional. + # It's marked as such to be able to use the generic Queue in __init__.pyi. + def __init__(self, maxsize: int = ..., *, ctx: Any = ...) -> None: ... + def get(self, block: bool = ..., timeout: Optional[float] = ...) -> _T: ... + def put(self, obj: _T, block: bool = ..., timeout: Optional[float] = ...) -> None: ... + def qsize(self) -> int: ... + def empty(self) -> bool: ... + def full(self) -> bool: ... + def put_nowait(self, item: _T) -> None: ... + def get_nowait(self) -> _T: ... + def close(self) -> None: ... + def join_thread(self) -> None: ... + def cancel_join_thread(self) -> None: ... + +class JoinableQueue(Queue[_T]): + def task_done(self) -> None: ... + def join(self) -> None: ... + +class SimpleQueue(Generic[_T]): + def __init__(self, *, ctx: Any = ...) -> None: ... + def empty(self) -> bool: ... + def get(self) -> _T: ... + def put(self, item: _T) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/spawn.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/spawn.pyi new file mode 100644 index 0000000..659253c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/spawn.pyi @@ -0,0 +1,18 @@ +from typing import Any, Dict, List, Mapping, Optional, Sequence +from types import ModuleType + +WINEXE: bool +WINSERVICE: bool + +def set_executable(exe: str) -> None: ... +def get_executable() -> str: ... +def is_forking(argv: Sequence[str]) -> bool: ... +def freeze_support() -> None: ... +def get_command_line(**kwds: Any) -> List[str]: ... +def spawn_main(pipe_handle: int, parent_pid: Optional[int] = ..., tracker_fd: Optional[int] = ...) -> None: ... +# undocumented +def _main(fd: int) -> Any: ... +def get_preparation_data(name: str) -> Dict[str, Any]: ... +old_main_modules: List[ModuleType] = ... +def prepare(data: Mapping[str, Any]) -> None: ... +def import_main_path(main_path: str) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/synchronize.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/synchronize.pyi new file mode 100644 index 0000000..9b22681 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/synchronize.pyi @@ -0,0 +1,63 @@ +from typing import Callable, ContextManager, Optional, Union + +from multiprocessing.context import BaseContext +import threading +import sys + +_LockLike = Union[Lock, RLock] + +class Barrier(threading.Barrier): + def __init__(self, + parties: int, + action: Optional[Callable] = ..., + timeout: Optional[float] = ..., + * + ctx: BaseContext) -> None: ... + +class BoundedSemaphore(Semaphore): + def __init__(self, value: int = ..., *, ctx: BaseContext) -> None: ... + +class Condition(ContextManager[bool]): + def __init__(self, + lock: Optional[_LockLike] = ..., + *, + ctx: BaseContext) -> None: ... + if sys.version_info >= (3, 7): + def notify(self, n: int = ...) -> None: ... + else: + def notify(self) -> None: ... + def notify_all(self) -> None: ... + def wait(self, timeout: Optional[float] = ...) -> bool: ... + def wait_for(self, + predicate: Callable[[], bool], + timeout: Optional[float] = ...) -> bool: ... + def acquire(self, + block: bool = ..., + timeout: Optional[float] = ...) -> bool: ... + def release(self) -> None: ... + +class Event(ContextManager[bool]): + def __init__(self, + lock: Optional[_LockLike] = ..., + *, + ctx: BaseContext) -> None: ... + def is_set(self) -> bool: ... + def set(self) -> None: ... + def clear(self) -> None: ... + def wait(self, timeout: Optional[float] = ...) -> bool: ... + +class Lock(SemLock): + def __init__(self, *, ctx: BaseContext) -> None: ... + +class RLock(SemLock): + def __init__(self, *, ctx: BaseContext) -> None: ... + +class Semaphore(SemLock): + def __init__(self, value: int = ..., *, ctx: BaseContext) -> None: ... + +# Not part of public API +class SemLock(ContextManager[bool]): + def acquire(self, + block: bool = ..., + timeout: Optional[float] = ...) -> bool: ... + def release(self) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/nntplib.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/nntplib.pyi new file mode 100644 index 0000000..00abdd9 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/nntplib.pyi @@ -0,0 +1,102 @@ +# Stubs for nntplib (Python 3) + +import datetime +import socket +import ssl +from typing import Any, Dict, IO, Iterable, List, NamedTuple, Optional, Tuple, TypeVar, Union + +_SelfT = TypeVar('_SelfT', bound=_NNTPBase) +_File = Union[IO[bytes], bytes, str, None] + + +class NNTPError(Exception): + response: str +class NNTPReplyError(NNTPError): ... +class NNTPTemporaryError(NNTPError): ... +class NNTPPermanentError(NNTPError): ... +class NNTPProtocolError(NNTPError): ... +class NNTPDataError(NNTPError): ... + +NNTP_PORT: int +NNTP_SSL_PORT: int + +GroupInfo = NamedTuple('GroupInfo', [ + ('group', str), + ('last', str), + ('first', str), + ('flag', str), +]) +ArticleInfo = NamedTuple('ArticleInfo', [ + ('number', int), + ('message_id', str), + ('lines', List[bytes]), +]) + +def decode_header(header_str: str) -> str: ... + +class _NNTPBase: + encoding: str + errors: str + + host: str + file: IO[bytes] + debugging: int + welcome: str + readermode_afterauth: bool + tls_on: bool + authenticated: bool + nntp_implementation: str + nntp_version: int + + def __init__(self, file: IO[bytes], host: str, + readermode: Optional[bool] = ..., timeout: float = ...) -> None: ... + def __enter__(self: _SelfT) -> _SelfT: ... + def __exit__(self, *args: Any) -> None: ... + def getwelcome(self) -> str: ... + def getcapabilities(self) -> Dict[str, List[str]]: ... + def set_debuglevel(self, level: int) -> None: ... + def debug(self, level: int) -> None: ... + def capabilities(self) -> Tuple[str, Dict[str, List[str]]]: ... + def newgroups(self, date: Union[datetime.date, datetime.datetime], *, file: _File = ...) -> Tuple[str, List[str]]: ... + def newnews(self, group: str, date: Union[datetime.date, datetime.datetime], *, file: _File = ...) -> Tuple[str, List[str]]: ... + def list(self, group_pattern: Optional[str] = ..., *, file: _File = ...) -> Tuple[str, List[str]]: ... + def description(self, group: str) -> str: ... + def descriptions(self, group_pattern: str) -> Tuple[str, Dict[str, str]]: ... + def group(self, name: str) -> Tuple[str, int, int, int, str]: ... + def help(self, *, file: _File = ...) -> Tuple[str, List[str]]: ... + def stat(self, message_spec: Any = ...) -> Tuple[str, int, str]: ... + def next(self) -> Tuple[str, int, str]: ... + def last(self) -> Tuple[str, int, str]: ... + def head(self, message_spec: Any = ..., *, file: _File = ...) -> Tuple[str, ArticleInfo]: ... + def body(self, message_spec: Any = ..., *, file: _File = ...) -> Tuple[str, ArticleInfo]: ... + def article(self, message_spec: Any = ..., *, file: _File = ...) -> Tuple[str, ArticleInfo]: ... + def slave(self) -> str: ... + def xhdr(self, hdr: str, str: Any, *, file: _File = ...) -> Tuple[str, List[str]]: ... + def xover(self, start: int, end: int, *, file: _File = ...) -> Tuple[str, List[Tuple[int, Dict[str, str]]]]: ... + def over(self, message_spec: Union[None, str, List[Any], Tuple[Any, ...]], *, file: _File = ...) -> Tuple[str, List[Tuple[int, Dict[str, str]]]]: ... + def xgtitle(self, group: str, *, file: _File = ...) -> Tuple[str, List[Tuple[str, str]]]: ... + def xpath(self, id: Any) -> Tuple[str, str]: ... + def date(self) -> Tuple[str, datetime.datetime]: ... + def post(self, data: Union[bytes, Iterable[bytes]]) -> str: ... + def ihave(self, message_id: Any, data: Union[bytes, Iterable[bytes]]) -> str: ... + def quit(self) -> str: ... + def login(self, user: Optional[str] = ..., password: Optional[str] = ..., usenetrc: bool = ...) -> None: ... + def starttls(self, ssl_context: Optional[ssl.SSLContext] = ...) -> None: ... + + +class NNTP(_NNTPBase): + port: int + sock: socket.socket + + def __init__(self, host: str, port: int = ..., user: Optional[str] = ..., password: Optional[str] = ..., + readermode: Optional[bool] = ..., usenetrc: bool = ..., + timeout: float = ...) -> None: ... + + +class NNTP_SSL(_NNTPBase): + sock: socket.socket + + def __init__(self, host: str, port: int = ..., user: Optional[str] = ..., password: Optional[str] = ..., + ssl_context: Optional[ssl.SSLContext] = ..., + readermode: Optional[bool] = ..., usenetrc: bool = ..., + timeout: float = ...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/nturl2path.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/nturl2path.pyi new file mode 100644 index 0000000..b8ad8d6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/nturl2path.pyi @@ -0,0 +1,2 @@ +def url2pathname(url: str) -> str: ... +def pathname2url(p: str) -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/os/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/os/__init__.pyi new file mode 100644 index 0000000..b717926 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/os/__init__.pyi @@ -0,0 +1,722 @@ +# Stubs for os +# Ron Murawski + +from io import TextIOWrapper as _TextIOWrapper +import sys +from typing import ( + Mapping, MutableMapping, Dict, List, Any, Tuple, IO, Iterable, Iterator, NoReturn, overload, Union, AnyStr, + Optional, Generic, Set, Callable, Text, Sequence, NamedTuple, TypeVar, ContextManager +) + +# Re-exported names from other modules. +from builtins import OSError as error +from . import path as path + +_T = TypeVar('_T') + +# ----- os variables ----- + +if sys.version_info >= (3, 2): + supports_bytes_environ: bool + +if sys.version_info >= (3, 3): + supports_dir_fd: Set[Callable[..., Any]] + supports_fd: Set[Callable[..., Any]] + supports_effective_ids: Set[Callable[..., Any]] + supports_follow_symlinks: Set[Callable[..., Any]] + + if sys.platform != 'win32': + # Unix only + PRIO_PROCESS: int + PRIO_PGRP: int + PRIO_USER: int + + F_LOCK: int + F_TLOCK: int + F_ULOCK: int + F_TEST: int + + POSIX_FADV_NORMAL: int + POSIX_FADV_SEQUENTIAL: int + POSIX_FADV_RANDOM: int + POSIX_FADV_NOREUSE: int + POSIX_FADV_WILLNEED: int + POSIX_FADV_DONTNEED: int + + SF_NODISKIO: int + SF_MNOWAIT: int + SF_SYNC: int + + XATTR_SIZE_MAX: int # Linux only + XATTR_CREATE: int # Linux only + XATTR_REPLACE: int # Linux only + + P_PID: int + P_PGID: int + P_ALL: int + + WEXITED: int + WSTOPPED: int + WNOWAIT: int + + CLD_EXITED: int + CLD_DUMPED: int + CLD_TRAPPED: int + CLD_CONTINUED: int + + SCHED_OTHER: int # some flavors of Unix + SCHED_BATCH: int # some flavors of Unix + SCHED_IDLE: int # some flavors of Unix + SCHED_SPORADIC: int # some flavors of Unix + SCHED_FIFO: int # some flavors of Unix + SCHED_RR: int # some flavors of Unix + SCHED_RESET_ON_FORK: int # some flavors of Unix + + RTLD_LAZY: int + RTLD_NOW: int + RTLD_GLOBAL: int + RTLD_LOCAL: int + RTLD_NODELETE: int + RTLD_NOLOAD: int + RTLD_DEEPBIND: int + + +SEEK_SET: int +SEEK_CUR: int +SEEK_END: int +if sys.version_info >= (3, 3) and sys.platform != 'win32': + SEEK_DATA: int # some flavors of Unix + SEEK_HOLE: int # some flavors of Unix + +O_RDONLY: int +O_WRONLY: int +O_RDWR: int +O_APPEND: int +O_CREAT: int +O_EXCL: int +O_TRUNC: int +# We don't use sys.platform for O_* flags to denote platform-dependent APIs because some codes, +# including tests for mypy, use a more finer way than sys.platform before using these APIs +# See https://github.com/python/typeshed/pull/2286 for discussions +O_DSYNC: int # Unix only +O_RSYNC: int # Unix only +O_SYNC: int # Unix only +O_NDELAY: int # Unix only +O_NONBLOCK: int # Unix only +O_NOCTTY: int # Unix only +if sys.version_info >= (3, 3): + O_CLOEXEC: int # Unix only +O_SHLOCK: int # Unix only +O_EXLOCK: int # Unix only +O_BINARY: int # Windows only +O_NOINHERIT: int # Windows only +O_SHORT_LIVED: int # Windows only +O_TEMPORARY: int # Windows only +O_RANDOM: int # Windows only +O_SEQUENTIAL: int # Windows only +O_TEXT: int # Windows only +O_ASYNC: int # Gnu extension if in C library +O_DIRECT: int # Gnu extension if in C library +O_DIRECTORY: int # Gnu extension if in C library +O_NOFOLLOW: int # Gnu extension if in C library +O_NOATIME: int # Gnu extension if in C library +if sys.version_info >= (3, 4): + O_PATH: int # Gnu extension if in C library + O_TMPFILE: int # Gnu extension if in C library +O_LARGEFILE: int # Gnu extension if in C library + +curdir: str +pardir: str +sep: str +if sys.platform == 'win32': + altsep: str +else: + altsep: Optional[str] +extsep: str +pathsep: str +defpath: str +linesep: str +devnull: str +name: str + +F_OK: int +R_OK: int +W_OK: int +X_OK: int + +class _Environ(MutableMapping[AnyStr, AnyStr], Generic[AnyStr]): + def copy(self) -> Dict[AnyStr, AnyStr]: ... + def __delitem__(self, key: AnyStr) -> None: ... + def __getitem__(self, key: AnyStr) -> AnyStr: ... + def __setitem__(self, key: AnyStr, value: AnyStr) -> None: ... + def __iter__(self) -> Iterator[AnyStr]: ... + def __len__(self) -> int: ... + +environ: _Environ[str] +if sys.version_info >= (3, 2): + environb: _Environ[bytes] + +if sys.platform != 'win32': + confstr_names: Dict[str, int] + pathconf_names: Dict[str, int] + sysconf_names: Dict[str, int] + + EX_OK: int + EX_USAGE: int + EX_DATAERR: int + EX_NOINPUT: int + EX_NOUSER: int + EX_NOHOST: int + EX_UNAVAILABLE: int + EX_SOFTWARE: int + EX_OSERR: int + EX_OSFILE: int + EX_CANTCREAT: int + EX_IOERR: int + EX_TEMPFAIL: int + EX_PROTOCOL: int + EX_NOPERM: int + EX_CONFIG: int + EX_NOTFOUND: int + +P_NOWAIT: int +P_NOWAITO: int +P_WAIT: int +if sys.platform == 'win32': + P_DETACH: int + P_OVERLAY: int + +# wait()/waitpid() options +if sys.platform != 'win32': + WNOHANG: int # Unix only + WCONTINUED: int # some Unix systems + WUNTRACED: int # Unix only + +TMP_MAX: int # Undocumented, but used by tempfile + +# ----- os classes (structures) ----- +class stat_result: + # For backward compatibility, the return value of stat() is also + # accessible as a tuple of at least 10 integers giving the most important + # (and portable) members of the stat structure, in the order st_mode, + # st_ino, st_dev, st_nlink, st_uid, st_gid, st_size, st_atime, st_mtime, + # st_ctime. More items may be added at the end by some implementations. + + st_mode: int # protection bits, + st_ino: int # inode number, + st_dev: int # device, + st_nlink: int # number of hard links, + st_uid: int # user id of owner, + st_gid: int # group id of owner, + st_size: int # size of file, in bytes, + st_atime: float # time of most recent access, + st_mtime: float # time of most recent content modification, + st_ctime: float # platform dependent (time of most recent metadata change on Unix, or the time of creation on Windows) + st_atime_ns: int # time of most recent access, in nanoseconds + st_mtime_ns: int # time of most recent content modification in nanoseconds + st_ctime_ns: int # platform dependent (time of most recent metadata change on Unix, or the time of creation on Windows) in nanoseconds + + def __getitem__(self, i: int) -> int: ... + + # not documented + def __init__(self, tuple: Tuple[int, ...]) -> None: ... + + # On some Unix systems (such as Linux), the following attributes may also + # be available: + st_blocks: int # number of blocks allocated for file + st_blksize: int # filesystem blocksize + st_rdev: int # type of device if an inode device + st_flags: int # user defined flags for file + + # On other Unix systems (such as FreeBSD), the following attributes may be + # available (but may be only filled out if root tries to use them): + st_gen: int # file generation number + st_birthtime: int # time of file creation + + # On Mac OS systems, the following attributes may also be available: + st_rsize: int + st_creator: int + st_type: int + +if sys.version_info >= (3, 6): + from builtins import _PathLike as PathLike # See comment in builtins + +_PathType = path._PathType +if sys.version_info >= (3, 3): + _FdOrPathType = Union[int, _PathType] +else: + _FdOrPathType = _PathType + +if sys.version_info >= (3, 6): + class DirEntry(PathLike[AnyStr]): + # This is what the scandir interator yields + # The constructor is hidden + + name: AnyStr + path: AnyStr + def inode(self) -> int: ... + def is_dir(self, *, follow_symlinks: bool = ...) -> bool: ... + def is_file(self, *, follow_symlinks: bool = ...) -> bool: ... + def is_symlink(self) -> bool: ... + def stat(self, *, follow_symlinks: bool = ...) -> stat_result: ... + + def __fspath__(self) -> AnyStr: ... +elif sys.version_info >= (3, 5): + class DirEntry(Generic[AnyStr]): + # This is what the scandir interator yields + # The constructor is hidden + + name: AnyStr + path: AnyStr + def inode(self) -> int: ... + def is_dir(self, *, follow_symlinks: bool = ...) -> bool: ... + def is_file(self, *, follow_symlinks: bool = ...) -> bool: ... + def is_symlink(self) -> bool: ... + def stat(self, *, follow_symlinks: bool = ...) -> stat_result: ... + + +if sys.platform != 'win32': + class statvfs_result: # Unix only + f_bsize: int + f_frsize: int + f_blocks: int + f_bfree: int + f_bavail: int + f_files: int + f_ffree: int + f_favail: int + f_flag: int + f_namemax: int + +# ----- os function stubs ----- +if sys.version_info >= (3, 6): + def fsencode(filename: Union[str, bytes, PathLike]) -> bytes: ... +else: + def fsencode(filename: Union[str, bytes]) -> bytes: ... + +if sys.version_info >= (3, 6): + def fsdecode(filename: Union[str, bytes, PathLike]) -> str: ... +else: + def fsdecode(filename: Union[str, bytes]) -> str: ... + +if sys.version_info >= (3, 6): + @overload + def fspath(path: str) -> str: ... + @overload + def fspath(path: bytes) -> bytes: ... + @overload + def fspath(path: PathLike) -> Any: ... + +def get_exec_path(env: Optional[Mapping[str, str]] = ...) -> List[str]: ... +# NOTE: get_exec_path(): returns List[bytes] when env not None +def getlogin() -> str: ... +def getpid() -> int: ... +def getppid() -> int: ... +def strerror(code: int) -> str: ... +def umask(mask: int) -> int: ... + +if sys.platform != 'win32': + # Unix only + def ctermid() -> str: ... + def getegid() -> int: ... + def geteuid() -> int: ... + def getgid() -> int: ... + if sys.version_info >= (3, 3): + def getgrouplist(user: str, gid: int) -> List[int]: ... + def getgroups() -> List[int]: ... # Unix only, behaves differently on Mac + def initgroups(username: str, gid: int) -> None: ... + def getpgid(pid: int) -> int: ... + def getpgrp() -> int: ... + if sys.version_info >= (3, 3): + def getpriority(which: int, who: int) -> int: ... + def setpriority(which: int, who: int, priority: int) -> None: ... + def getresuid() -> Tuple[int, int, int]: ... + def getresgid() -> Tuple[int, int, int]: ... + def getuid() -> int: ... + def setegid(egid: int) -> None: ... + def seteuid(euid: int) -> None: ... + def setgid(gid: int) -> None: ... + def setgroups(groups: Sequence[int]) -> None: ... + def setpgrp() -> None: ... + def setpgid(pid: int, pgrp: int) -> None: ... + def setregid(rgid: int, egid: int) -> None: ... + def setresgid(rgid: int, egid: int, sgid: int) -> None: ... + def setresuid(ruid: int, euid: int, suid: int) -> None: ... + def setreuid(ruid: int, euid: int) -> None: ... + def getsid(pid: int) -> int: ... + def setsid() -> None: ... + def setuid(uid: int) -> None: ... + if sys.version_info >= (3, 3): + from posix import uname_result + def uname() -> uname_result: ... + else: + def uname() -> Tuple[str, str, str, str, str]: ... + +@overload +def getenv(key: Text) -> Optional[str]: ... +@overload +def getenv(key: Text, default: _T) -> Union[str, _T]: ... +def getenvb(key: bytes, default: bytes = ...) -> bytes: ... +def putenv(key: Union[bytes, Text], value: Union[bytes, Text]) -> None: ... +def unsetenv(key: Union[bytes, Text]) -> None: ... + +# Return IO or TextIO +def fdopen(fd: int, mode: str = ..., buffering: int = ..., encoding: Optional[str] = ..., + errors: str = ..., newline: str = ..., closefd: bool = ...) -> Any: ... +def close(fd: int) -> None: ... +def closerange(fd_low: int, fd_high: int) -> None: ... +def device_encoding(fd: int) -> Optional[str]: ... +def dup(fd: int) -> int: ... +if sys.version_info >= (3, 7): + def dup2(fd: int, fd2: int, inheritable: bool = ...) -> int: ... +elif sys.version_info >= (3, 4): + def dup2(fd: int, fd2: int, inheritable: bool = ...) -> None: ... +else: + def dup2(fd: int, fd2: int) -> None: ... +def fstat(fd: int) -> stat_result: ... +def fsync(fd: int) -> None: ... +def lseek(fd: int, pos: int, how: int) -> int: ... +if sys.version_info >= (3, 3): + def open(file: _PathType, flags: int, mode: int = ..., *, dir_fd: Optional[int] = ...) -> int: ... +else: + def open(file: _PathType, flags: int, mode: int = ...) -> int: ... +def pipe() -> Tuple[int, int]: ... +def read(fd: int, n: int) -> bytes: ... + +if sys.platform != 'win32': + # Unix only + def fchmod(fd: int, mode: int) -> None: ... + def fchown(fd: int, uid: int, gid: int) -> None: ... + def fdatasync(fd: int) -> None: ... # Unix only, not Mac + def fpathconf(fd: int, name: Union[str, int]) -> int: ... + def fstatvfs(fd: int) -> statvfs_result: ... + def ftruncate(fd: int, length: int) -> None: ... + if sys.version_info >= (3, 5): + def get_blocking(fd: int) -> bool: ... + def set_blocking(fd: int, blocking: bool) -> None: ... + def isatty(fd: int) -> bool: ... + if sys.version_info >= (3, 3): + def lockf(__fd: int, __cmd: int, __length: int) -> None: ... + def openpty() -> Tuple[int, int]: ... # some flavors of Unix + if sys.version_info >= (3, 3): + def pipe2(flags: int) -> Tuple[int, int]: ... # some flavors of Unix + def posix_fallocate(fd: int, offset: int, length: int) -> None: ... + def posix_fadvise(fd: int, offset: int, length: int, advice: int) -> None: ... + def pread(fd: int, buffersize: int, offset: int) -> bytes: ... + def pwrite(fd: int, string: bytes, offset: int) -> int: ... + @overload + def sendfile(__out_fd: int, __in_fd: int, offset: Optional[int], count: int) -> int: ... + @overload + def sendfile(__out_fd: int, __in_fd: int, offset: int, count: int, + headers: Sequence[bytes] = ..., trailers: Sequence[bytes] = ..., flags: int = ...) -> int: ... # FreeBSD and Mac OS X only + def readv(fd: int, buffers: Sequence[bytearray]) -> int: ... + def writev(fd: int, buffers: Sequence[bytes]) -> int: ... + +terminal_size = NamedTuple('terminal_size', [('columns', int), ('lines', int)]) +def get_terminal_size(fd: int = ...) -> terminal_size: ... + +if sys.version_info >= (3, 4): + def get_inheritable(fd: int) -> bool: ... + def set_inheritable(fd: int, inheritable: bool) -> None: ... + +if sys.platform != 'win32': + # Unix only + def tcgetpgrp(fd: int) -> int: ... + def tcsetpgrp(fd: int, pg: int) -> None: ... + def ttyname(fd: int) -> str: ... +def write(fd: int, string: bytes) -> int: ... +if sys.version_info >= (3, 3): + def access(path: _FdOrPathType, mode: int, *, dir_fd: Optional[int] = ..., + effective_ids: bool = ..., follow_symlinks: bool = ...) -> bool: ... +else: + def access(path: _PathType, mode: int) -> bool: ... +def chdir(path: _FdOrPathType) -> None: ... +def fchdir(fd: int) -> None: ... +def getcwd() -> str: ... +def getcwdb() -> bytes: ... +if sys.version_info >= (3, 3): + def chmod(path: _FdOrPathType, mode: int, *, dir_fd: Optional[int] = ..., follow_symlinks: bool = ...) -> None: ... + if sys.platform != 'win32': + def chflags(path: _PathType, flags: int, follow_symlinks: bool = ...) -> None: ... # some flavors of Unix + def chown(path: _FdOrPathType, uid: int, gid: int, *, dir_fd: Optional[int] = ..., follow_symlinks: bool = ...) -> None: ... # Unix only +else: + def chmod(path: _PathType, mode: int) -> None: ... + if sys.platform != 'win32': + def chflags(path: _PathType, flags: int) -> None: ... # Some flavors of Unix + def chown(path: _PathType, uid: int, gid: int) -> None: ... # Unix only +if sys.platform != 'win32': + # Unix only + def chroot(path: _PathType) -> None: ... + def lchflags(path: _PathType, flags: int) -> None: ... + def lchmod(path: _PathType, mode: int) -> None: ... + def lchown(path: _PathType, uid: int, gid: int) -> None: ... +if sys.version_info >= (3, 3): + def link(src: _PathType, link_name: _PathType, *, src_dir_fd: Optional[int] = ..., + dst_dir_fd: Optional[int] = ..., follow_symlinks: bool = ...) -> None: ... +else: + def link(src: _PathType, link_name: _PathType) -> None: ... + +if sys.version_info >= (3, 6): + @overload + def listdir(path: Optional[str] = ...) -> List[str]: ... + @overload + def listdir(path: bytes) -> List[bytes]: ... + @overload + def listdir(path: int) -> List[str]: ... + @overload + def listdir(path: PathLike[str]) -> List[str]: ... +elif sys.version_info >= (3, 3): + @overload + def listdir(path: Optional[str] = ...) -> List[str]: ... + @overload + def listdir(path: bytes) -> List[bytes]: ... + @overload + def listdir(path: int) -> List[str]: ... +else: + @overload + def listdir(path: Optional[str] = ...) -> List[str]: ... + @overload + def listdir(path: bytes) -> List[bytes]: ... + +if sys.version_info >= (3, 3): + def lstat(path: _PathType, *, dir_fd: Optional[int] = ...) -> stat_result: ... + def mkdir(path: _PathType, mode: int = ..., *, dir_fd: Optional[int] = ...) -> None: ... + if sys.platform != 'win32': + def mkfifo(path: _PathType, mode: int = ..., *, dir_fd: Optional[int] = ...) -> None: ... # Unix only +else: + def lstat(path: _PathType) -> stat_result: ... + def mkdir(path: _PathType, mode: int = ...) -> None: ... + if sys.platform != 'win32': + def mkfifo(path: _PathType, mode: int = ...) -> None: ... # Unix only +if sys.version_info >= (3, 4): + def makedirs(name: _PathType, mode: int = ..., exist_ok: bool = ...) -> None: ... +else: + def makedirs(path: _PathType, mode: int = ..., exist_ok: bool = ...) -> None: ... +if sys.version_info >= (3, 4): + def mknod(path: _PathType, mode: int = ..., device: int = ..., + *, dir_fd: Optional[int] = ...) -> None: ... +elif sys.version_info >= (3, 3): + def mknod(filename: _PathType, mode: int = ..., device: int = ..., + *, dir_fd: Optional[int] = ...) -> None: ... +else: + def mknod(filename: _PathType, mode: int = ..., device: int = ...) -> None: ... +def major(device: int) -> int: ... +def minor(device: int) -> int: ... +def makedev(major: int, minor: int) -> int: ... +if sys.platform != 'win32': + def pathconf(path: _FdOrPathType, name: Union[str, int]) -> int: ... # Unix only +if sys.version_info >= (3, 6): + def readlink(path: Union[AnyStr, PathLike[AnyStr]], *, dir_fd: Optional[int] = ...) -> AnyStr: ... +elif sys.version_info >= (3, 3): + def readlink(path: AnyStr, *, dir_fd: Optional[int] = ...) -> AnyStr: ... +else: + def readlink(path: AnyStr) -> AnyStr: ... +if sys.version_info >= (3, 3): + def remove(path: _PathType, *, dir_fd: Optional[int] = ...) -> None: ... +else: + def remove(path: _PathType) -> None: ... +if sys.version_info >= (3, 4): + def removedirs(name: _PathType) -> None: ... +else: + def removedirs(path: _PathType) -> None: ... +if sys.version_info >= (3, 3): + def rename(src: _PathType, dst: _PathType, *, + src_dir_fd: Optional[int] = ..., dst_dir_fd: Optional[int] = ...) -> None: ... +else: + def rename(src: _PathType, dst: _PathType) -> None: ... +def renames(old: _PathType, new: _PathType) -> None: ... +if sys.version_info >= (3, 3): + def replace(src: _PathType, dst: _PathType, *, + src_dir_fd: Optional[int] = ..., dst_dir_fd: Optional[int] = ...) -> None: ... + def rmdir(path: _PathType, *, dir_fd: Optional[int] = ...) -> None: ... +else: + def rmdir(path: _PathType) -> None: ... +if sys.version_info >= (3, 7): + class _ScandirIterator(Iterator[DirEntry[AnyStr]], ContextManager[_ScandirIterator[AnyStr]]): + def __next__(self) -> DirEntry[AnyStr]: ... + def close(self) -> None: ... + @overload + def scandir() -> _ScandirIterator[str]: ... + @overload + def scandir(path: int) -> _ScandirIterator[str]: ... + @overload + def scandir(path: Union[AnyStr, PathLike[AnyStr]]) -> _ScandirIterator[AnyStr]: ... +elif sys.version_info >= (3, 6): + class _ScandirIterator(Iterator[DirEntry[AnyStr]], ContextManager[_ScandirIterator[AnyStr]]): + def __next__(self) -> DirEntry[AnyStr]: ... + def close(self) -> None: ... + @overload + def scandir() -> _ScandirIterator[str]: ... + @overload + def scandir(path: Union[AnyStr, PathLike[AnyStr]]) -> _ScandirIterator[AnyStr]: ... +elif sys.version_info >= (3, 5): + @overload + def scandir() -> Iterator[DirEntry[str]]: ... + @overload + def scandir(path: AnyStr) -> Iterator[DirEntry[AnyStr]]: ... +if sys.version_info >= (3, 3): + def stat(path: _FdOrPathType, *, dir_fd: Optional[int] = ..., + follow_symlinks: bool = ...) -> stat_result: ... +else: + def stat(path: _PathType) -> stat_result: ... +if sys.version_info < (3, 7): + @overload + def stat_float_times() -> bool: ... + @overload + def stat_float_times(__newvalue: bool) -> None: ... +if sys.platform != 'win32': + def statvfs(path: _FdOrPathType) -> statvfs_result: ... # Unix only +if sys.version_info >= (3, 3): + def symlink(source: _PathType, link_name: _PathType, + target_is_directory: bool = ..., *, dir_fd: Optional[int] = ...) -> None: ... + if sys.platform != 'win32': + def sync() -> None: ... # Unix only + def truncate(path: _FdOrPathType, length: int) -> None: ... # Unix only up to version 3.4 + def unlink(path: _PathType, *, dir_fd: Optional[int] = ...) -> None: ... + def utime(path: _FdOrPathType, times: Optional[Union[Tuple[int, int], Tuple[float, float]]] = ..., *, + ns: Tuple[int, int] = ..., dir_fd: Optional[int] = ..., + follow_symlinks: bool = ...) -> None: ... +else: + def symlink(source: _PathType, link_name: _PathType, + target_is_directory: bool = ...) -> None: + ... # final argument in Windows only + def unlink(path: _PathType) -> None: ... + def utime(path: _PathType, times: Optional[Tuple[float, float]]) -> None: ... + +if sys.version_info >= (3, 6): + def walk(top: Union[AnyStr, PathLike[AnyStr]], topdown: bool = ..., + onerror: Optional[Callable[[OSError], Any]] = ..., + followlinks: bool = ...) -> Iterator[Tuple[AnyStr, List[AnyStr], + List[AnyStr]]]: ... +else: + def walk(top: AnyStr, topdown: bool = ..., onerror: Optional[Callable[[OSError], Any]] = ..., + followlinks: bool = ...) -> Iterator[Tuple[AnyStr, List[AnyStr], + List[AnyStr]]]: ... +if sys.platform != 'win32' and sys.version_info >= (3, 3): + if sys.version_info >= (3, 7): + @overload + def fwalk(top: Union[str, PathLike[str]] = ..., topdown: bool = ..., + onerror: Optional[Callable] = ..., *, follow_symlinks: bool = ..., + dir_fd: Optional[int] = ...) -> Iterator[Tuple[str, List[str], List[str], int]]: ... + @overload + def fwalk(top: bytes, topdown: bool = ..., + onerror: Optional[Callable] = ..., *, follow_symlinks: bool = ..., + dir_fd: Optional[int] = ...) -> Iterator[Tuple[bytes, List[bytes], List[bytes], int]]: ... + elif sys.version_info >= (3, 6): + def fwalk(top: Union[str, PathLike[str]] = ..., topdown: bool = ..., + onerror: Optional[Callable] = ..., *, follow_symlinks: bool = ..., + dir_fd: Optional[int] = ...) -> Iterator[Tuple[str, List[str], List[str], int]]: ... + else: + def fwalk(top: str = ..., topdown: bool = ..., + onerror: Optional[Callable] = ..., *, follow_symlinks: bool = ..., + dir_fd: Optional[int] = ...) -> Iterator[Tuple[str, List[str], List[str], int]]: ... + def getxattr(path: _FdOrPathType, attribute: _PathType, *, follow_symlinks: bool = ...) -> bytes: ... # Linux only + def listxattr(path: _FdOrPathType, *, follow_symlinks: bool = ...) -> List[str]: ... # Linux only + def removexattr(path: _FdOrPathType, attribute: _PathType, *, follow_symlinks: bool = ...) -> None: ... # Linux only + def setxattr(path: _FdOrPathType, attribute: _PathType, value: bytes, flags: int = ..., *, + follow_symlinks: bool = ...) -> None: ... # Linux only + +def abort() -> NoReturn: ... +# These are defined as execl(file, *args) but the first *arg is mandatory. +def execl(file: _PathType, __arg0: Union[bytes, Text], *args: Union[bytes, Text]) -> NoReturn: ... +def execlp(file: _PathType, __arg0: Union[bytes, Text], *args: Union[bytes, Text]) -> NoReturn: ... + +# These are: execle(file, *args, env) but env is pulled from the last element of the args. +def execle(file: _PathType, __arg0: Union[bytes, Text], *args: Any) -> NoReturn: ... +def execlpe(file: _PathType, __arg0: Union[bytes, Text], *args: Any) -> NoReturn: ... + +# The docs say `args: tuple or list of strings` +# The implementation enforces tuple or list so we can't use Sequence. +_ExecVArgs = Union[Tuple[Union[bytes, Text], ...], List[bytes], List[Text], List[Union[bytes, Text]]] +def execv(path: _PathType, args: _ExecVArgs) -> NoReturn: ... +def execve(path: _FdOrPathType, args: _ExecVArgs, env: Mapping[str, str]) -> NoReturn: ... +def execvp(file: _PathType, args: _ExecVArgs) -> NoReturn: ... +def execvpe(file: _PathType, args: _ExecVArgs, env: Mapping[str, str]) -> NoReturn: ... + +def _exit(n: int) -> NoReturn: ... +def kill(pid: int, sig: int) -> None: ... +if sys.platform != 'win32': + # Unix only + def fork() -> int: ... + def forkpty() -> Tuple[int, int]: ... # some flavors of Unix + def killpg(pgid: int, sig: int) -> None: ... + def nice(increment: int) -> int: ... + def plock(op: int) -> None: ... # ???op is int? + +if sys.version_info >= (3, 0): + class _wrap_close(_TextIOWrapper): + def close(self) -> Optional[int]: ... # type: ignore + def popen(command: str, mode: str = ..., buffering: int = ...) -> _wrap_close: ... +else: + class _wrap_close(IO[Text]): + def close(self) -> Optional[int]: ... + def popen(__cmd: Text, __mode: Text = ..., __bufsize: int = ...) -> _wrap_close: ... + def popen2(__cmd: Text, __mode: Text = ..., __bufsize: int = ...) -> Tuple[IO[Text], IO[Text]]: ... + def popen3(__cmd: Text, __mode: Text = ..., __bufsize: int = ...) -> Tuple[IO[Text], IO[Text], IO[Text]]: ... + def popen4(__cmd: Text, __mode: Text = ..., __bufsize: int = ...) -> Tuple[IO[Text], IO[Text]]: ... + +def spawnl(mode: int, path: _PathType, arg0: Union[bytes, Text], *args: Union[bytes, Text]) -> int: ... +def spawnle(mode: int, path: _PathType, arg0: Union[bytes, Text], + *args: Any) -> int: ... # Imprecise sig +def spawnv(mode: int, path: _PathType, args: List[Union[bytes, Text]]) -> int: ... +def spawnve(mode: int, path: _PathType, args: List[Union[bytes, Text]], + env: Mapping[str, str]) -> int: ... +def system(command: _PathType) -> int: ... +if sys.version_info >= (3, 3): + from posix import times_result + def times() -> times_result: ... +else: + def times() -> Tuple[float, float, float, float, float]: ... +def waitpid(pid: int, options: int) -> Tuple[int, int]: ... + +if sys.platform == 'win32': + def startfile(path: _PathType, operation: Optional[str] = ...) -> None: ... +else: + # Unix only + def spawnlp(mode: int, file: _PathType, arg0: Union[bytes, Text], *args: Union[bytes, Text]) -> int: ... + def spawnlpe(mode: int, file: _PathType, arg0: Union[bytes, Text], *args: Any) -> int: ... # Imprecise signature + def spawnvp(mode: int, file: _PathType, args: List[Union[bytes, Text]]) -> int: ... + def spawnvpe(mode: int, file: _PathType, args: List[Union[bytes, Text]], env: Mapping[str, str]) -> int: ... + def wait() -> Tuple[int, int]: ... # Unix only + if sys.version_info >= (3, 3): + from posix import waitid_result + def waitid(idtype: int, ident: int, options: int) -> waitid_result: ... + def wait3(options: int) -> Tuple[int, int, Any]: ... + def wait4(pid: int, options: int) -> Tuple[int, int, Any]: ... + def WCOREDUMP(status: int) -> bool: ... + def WIFCONTINUED(status: int) -> bool: ... + def WIFSTOPPED(status: int) -> bool: ... + def WIFSIGNALED(status: int) -> bool: ... + def WIFEXITED(status: int) -> bool: ... + def WEXITSTATUS(status: int) -> int: ... + def WSTOPSIG(status: int) -> int: ... + def WTERMSIG(status: int) -> int: ... + +if sys.platform != 'win32' and sys.version_info >= (3, 3): + from posix import sched_param + def sched_get_priority_min(policy: int) -> int: ... # some flavors of Unix + def sched_get_priority_max(policy: int) -> int: ... # some flavors of Unix + def sched_setscheduler(pid: int, policy: int, param: sched_param) -> None: ... # some flavors of Unix + def sched_getscheduler(pid: int) -> int: ... # some flavors of Unix + def sched_setparam(pid: int, param: sched_param) -> None: ... # some flavors of Unix + def sched_getparam(pid: int) -> sched_param: ... # some flavors of Unix + def sched_rr_get_interval(pid: int) -> float: ... # some flavors of Unix + def sched_yield() -> None: ... # some flavors of Unix + def sched_setaffinity(pid: int, mask: Iterable[int]) -> None: ... # some flavors of Unix + def sched_getaffinity(pid: int) -> Set[int]: ... # some flavors of Unix + +if sys.version_info >= (3, 4): + def cpu_count() -> Optional[int]: ... +if sys.platform != 'win32': + # Unix only + def confstr(name: Union[str, int]) -> Optional[str]: ... + def getloadavg() -> Tuple[float, float, float]: ... + def sysconf(name: Union[str, int]) -> int: ... +if sys.version_info >= (3, 6): + def getrandom(size: int, flags: int = ...) -> bytes: ... + def urandom(size: int) -> bytes: ... +else: + def urandom(n: int) -> bytes: ... + +if sys.version_info >= (3, 7): + def register_at_fork(func: Callable[..., object], when: str) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/os/path.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/os/path.pyi new file mode 100644 index 0000000..c0bf576 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/os/path.pyi @@ -0,0 +1,180 @@ +# NB: path.pyi and stdlib/2 and stdlib/3 must remain consistent! +# Stubs for os.path +# Ron Murawski + +import os +import sys +from typing import ( + overload, List, Any, AnyStr, Sequence, Tuple, BinaryIO, TextIO, + TypeVar, Union, Text, Callable, Optional +) + +_T = TypeVar('_T') + +if sys.version_info >= (3, 6): + from builtins import _PathLike + _PathType = Union[bytes, Text, _PathLike] + _StrPath = Union[Text, _PathLike[Text]] + _BytesPath = Union[bytes, _PathLike[bytes]] +else: + _PathType = Union[bytes, Text] + _StrPath = Text + _BytesPath = bytes + +# ----- os.path variables ----- +supports_unicode_filenames: bool +# aliases (also in os) +curdir: str +pardir: str +sep: str +if sys.platform == 'win32': + altsep: str +else: + altsep: Optional[str] +extsep: str +pathsep: str +defpath: str +devnull: str + +# ----- os.path function stubs ----- +if sys.version_info >= (3, 6): + # Overloads are necessary to work around python/mypy#3644. + @overload + def abspath(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def abspath(path: AnyStr) -> AnyStr: ... + @overload + def basename(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def basename(path: AnyStr) -> AnyStr: ... + @overload + def dirname(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def dirname(path: AnyStr) -> AnyStr: ... + @overload + def expanduser(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def expanduser(path: AnyStr) -> AnyStr: ... + @overload + def expandvars(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def expandvars(path: AnyStr) -> AnyStr: ... + @overload + def normcase(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def normcase(path: AnyStr) -> AnyStr: ... + @overload + def normpath(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def normpath(path: AnyStr) -> AnyStr: ... + if sys.platform == 'win32': + @overload + def realpath(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def realpath(path: AnyStr) -> AnyStr: ... + else: + @overload + def realpath(filename: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def realpath(filename: AnyStr) -> AnyStr: ... + +else: + def abspath(path: AnyStr) -> AnyStr: ... + def basename(path: AnyStr) -> AnyStr: ... + def dirname(path: AnyStr) -> AnyStr: ... + def expanduser(path: AnyStr) -> AnyStr: ... + def expandvars(path: AnyStr) -> AnyStr: ... + def normcase(path: AnyStr) -> AnyStr: ... + def normpath(path: AnyStr) -> AnyStr: ... + if sys.platform == 'win32': + def realpath(path: AnyStr) -> AnyStr: ... + else: + def realpath(filename: AnyStr) -> AnyStr: ... + +if sys.version_info >= (3, 6): + # In reality it returns str for sequences of _StrPath and bytes for sequences + # of _BytesPath, but mypy does not accept such a signature. + def commonpath(paths: Sequence[_PathType]) -> Any: ... +elif sys.version_info >= (3, 5): + def commonpath(paths: Sequence[AnyStr]) -> AnyStr: ... + +# NOTE: Empty lists results in '' (str) regardless of contained type. +# Also, in Python 2 mixed sequences of Text and bytes results in either Text or bytes +# So, fall back to Any +def commonprefix(list: Sequence[_PathType]) -> Any: ... + +if sys.version_info >= (3, 3): + def exists(path: Union[_PathType, int]) -> bool: ... +else: + def exists(path: _PathType) -> bool: ... +def lexists(path: _PathType) -> bool: ... + +# These return float if os.stat_float_times() == True, +# but int is a subclass of float. +def getatime(path: _PathType) -> float: ... +def getmtime(path: _PathType) -> float: ... +def getctime(path: _PathType) -> float: ... + +def getsize(path: _PathType) -> int: ... +def isabs(path: _PathType) -> bool: ... +def isfile(path: _PathType) -> bool: ... +def isdir(path: _PathType) -> bool: ... +def islink(path: _PathType) -> bool: ... +def ismount(path: _PathType) -> bool: ... + +if sys.version_info < (3, 0): + # Make sure signatures are disjunct, and allow combinations of bytes and unicode. + # (Since Python 2 allows that, too) + # Note that e.g. os.path.join("a", "b", "c", "d", u"e") will still result in + # a type error. + @overload + def join(__p1: bytes, *p: bytes) -> bytes: ... + @overload + def join(__p1: bytes, __p2: bytes, __p3: bytes, __p4: Text, *p: _PathType) -> Text: ... + @overload + def join(__p1: bytes, __p2: bytes, __p3: Text, *p: _PathType) -> Text: ... + @overload + def join(__p1: bytes, __p2: Text, *p: _PathType) -> Text: ... + @overload + def join(__p1: Text, *p: _PathType) -> Text: ... +elif sys.version_info >= (3, 6): + # Mypy complains that the signatures overlap (same for relpath below), but things seem to behave correctly anyway. + @overload + def join(path: _StrPath, *paths: _StrPath) -> Text: ... + @overload + def join(path: _BytesPath, *paths: _BytesPath) -> bytes: ... +else: + def join(path: AnyStr, *paths: AnyStr) -> AnyStr: ... + +@overload +def relpath(path: _BytesPath, start: Optional[_BytesPath] = ...) -> bytes: ... +@overload +def relpath(path: _StrPath, start: Optional[_StrPath] = ...) -> Text: ... + +def samefile(path1: _PathType, path2: _PathType) -> bool: ... +def sameopenfile(fp1: int, fp2: int) -> bool: ... +def samestat(stat1: os.stat_result, stat2: os.stat_result) -> bool: ... + +if sys.version_info >= (3, 6): + @overload + def split(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... + @overload + def split(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitdrive(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitdrive(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitext(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitext(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... +else: + def split(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + def splitdrive(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + def splitext(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + +if sys.platform == 'win32': + def splitunc(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... # deprecated + +if sys.version_info < (3,): + def walk(path: AnyStr, visit: Callable[[_T, AnyStr, List[AnyStr]], Any], arg: _T) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/pathlib.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/pathlib.pyi new file mode 100644 index 0000000..42968fa --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/pathlib.pyi @@ -0,0 +1,122 @@ +from typing import Any, Generator, IO, Optional, Sequence, Tuple, Type, TypeVar, Union, List +from types import TracebackType +import os +import sys + +_P = TypeVar('_P', bound='PurePath') + +if sys.version_info >= (3, 6): + _PurePathBase = os.PathLike[str] +else: + _PurePathBase = object + +class PurePath(_PurePathBase): + parts: Tuple[str, ...] + drive: str + root: str + anchor: str + name: str + suffix: str + suffixes: List[str] + stem: str + if sys.version_info < (3, 5): + def __init__(self, *pathsegments: str) -> None: ... + elif sys.version_info < (3, 6): + def __new__(cls: Type[_P], *args: Union[str, PurePath]) -> _P: ... + else: + def __new__(cls: Type[_P], *args: Union[str, os.PathLike[str]]) -> _P: ... + def __hash__(self) -> int: ... + def __lt__(self, other: PurePath) -> bool: ... + def __le__(self, other: PurePath) -> bool: ... + def __gt__(self, other: PurePath) -> bool: ... + def __ge__(self, other: PurePath) -> bool: ... + def __truediv__(self: _P, key: Union[str, PurePath]) -> _P: ... + if sys.version_info < (3,): + def __div__(self: _P, key: Union[str, PurePath]) -> _P: ... + def __bytes__(self) -> bytes: ... + def as_posix(self) -> str: ... + def as_uri(self) -> str: ... + def is_absolute(self) -> bool: ... + def is_reserved(self) -> bool: ... + def match(self, path_pattern: str) -> bool: ... + def relative_to(self: _P, *other: Union[str, PurePath]) -> _P: ... + def with_name(self: _P, name: str) -> _P: ... + def with_suffix(self: _P, suffix: str) -> _P: ... + def joinpath(self: _P, *other: Union[str, PurePath]) -> _P: ... + + @property + def parents(self: _P) -> Sequence[_P]: ... + @property + def parent(self: _P) -> _P: ... + +class PurePosixPath(PurePath): ... +class PureWindowsPath(PurePath): ... + +class Path(PurePath): + def __enter__(self) -> Path: ... + def __exit__(self, exc_type: Optional[Type[BaseException]], + exc_value: Optional[BaseException], + traceback: Optional[TracebackType]) -> Optional[bool]: ... + @classmethod + def cwd(cls: Type[_P]) -> _P: ... + def stat(self) -> os.stat_result: ... + def chmod(self, mode: int) -> None: ... + def exists(self) -> bool: ... + def glob(self, pattern: str) -> Generator[Path, None, None]: ... + def group(self) -> str: ... + def is_dir(self) -> bool: ... + def is_file(self) -> bool: ... + def is_symlink(self) -> bool: ... + def is_socket(self) -> bool: ... + def is_fifo(self) -> bool: ... + def is_block_device(self) -> bool: ... + def is_char_device(self) -> bool: ... + def iterdir(self) -> Generator[Path, None, None]: ... + def lchmod(self, mode: int) -> None: ... + def lstat(self) -> os.stat_result: ... + if sys.version_info < (3, 5): + def mkdir(self, mode: int = ..., + parents: bool = ...) -> None: ... + else: + def mkdir(self, mode: int = ..., parents: bool = ..., + exist_ok: bool = ...) -> None: ... + def open(self, mode: str = ..., buffering: int = ..., + encoding: Optional[str] = ..., errors: Optional[str] = ..., + newline: Optional[str] = ...) -> IO[Any]: ... + def owner(self) -> str: ... + def rename(self, target: Union[str, PurePath]) -> None: ... + def replace(self, target: Union[str, PurePath]) -> None: ... + if sys.version_info < (3, 6): + def resolve(self: _P) -> _P: ... + else: + def resolve(self: _P, strict: bool = ...) -> _P: ... + def rglob(self, pattern: str) -> Generator[Path, None, None]: ... + def rmdir(self) -> None: ... + def symlink_to(self, target: Union[str, Path], + target_is_directory: bool = ...) -> None: ... + def touch(self, mode: int = ..., exist_ok: bool = ...) -> None: ... + def unlink(self) -> None: ... + + if sys.version_info >= (3, 5): + @classmethod + def home(cls: Type[_P]) -> _P: ... + if sys.version_info < (3, 6): + def __new__(cls: Type[_P], *args: Union[str, PurePath], + **kwargs: Any) -> _P: ... + else: + def __new__(cls: Type[_P], *args: Union[str, os.PathLike[str]], + **kwargs: Any) -> _P: ... + + def absolute(self: _P) -> _P: ... + def expanduser(self: _P) -> _P: ... + def read_bytes(self) -> bytes: ... + def read_text(self, encoding: Optional[str] = ..., + errors: Optional[str] = ...) -> str: ... + def samefile(self, other_path: Union[str, bytes, int, Path]) -> bool: ... + def write_bytes(self, data: bytes) -> int: ... + def write_text(self, data: str, encoding: Optional[str] = ..., + errors: Optional[str] = ...) -> int: ... + + +class PosixPath(Path, PurePosixPath): ... +class WindowsPath(Path, PureWindowsPath): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/pipes.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/pipes.pyi new file mode 100644 index 0000000..658373e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/pipes.pyi @@ -0,0 +1,19 @@ +# Stubs for pipes + +# Based on http://docs.python.org/3.5/library/pipes.html + +import os + +class Template: + def __init__(self) -> None: ... + def reset(self) -> None: ... + def clone(self) -> Template: ... + def debug(self, flag: bool) -> None: ... + def append(self, cmd: str, kind: str) -> None: ... + def prepend(self, cmd: str, kind: str) -> None: ... + def open(self, file: str, rw: str) -> os._wrap_close: ... + def copy(self, file: str, rw: str) -> os._wrap_close: ... + +# Not documented, but widely used. +# Documented as shlex.quote since 3.3. +def quote(s: str) -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/platform.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/platform.pyi new file mode 100644 index 0000000..728e259 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/platform.pyi @@ -0,0 +1,34 @@ +# Stubs for platform (Python 3.5) + +from os import devnull as DEV_NULL +from os import popen +from typing import Tuple, NamedTuple + +def libc_ver(executable: str = ..., lib: str = ..., version: str = ..., chunksize: int = ...) -> Tuple[str, str]: ... +def linux_distribution(distname: str = ..., version: str = ..., id: str = ..., supported_dists: Tuple[str, ...] = ..., full_distribution_name: bool = ...) -> Tuple[str, str, str]: ... +def dist(distname: str = ..., version: str = ..., id: str = ..., supported_dists: Tuple[str, ...] = ...) -> Tuple[str, str, str]: ... +def win32_ver(release: str = ..., version: str = ..., csd: str = ..., ptype: str = ...) -> Tuple[str, str, str, str]: ... +def mac_ver(release: str = ..., versioninfo: Tuple[str, str, str] = ..., machine: str = ...) -> Tuple[str, Tuple[str, str, str], str]: ... +def java_ver(release: str = ..., vendor: str = ..., vminfo: Tuple[str, str, str] = ..., osinfo: Tuple[str, str, str] = ...) -> Tuple[str, str, Tuple[str, str, str], Tuple[str, str, str]]: ... +def system_alias(system: str, release: str, version: str) -> Tuple[str, str, str]: ... +def architecture(executable: str = ..., bits: str = ..., linkage: str = ...) -> Tuple[str, str]: ... + +uname_result = NamedTuple('uname_result', [('system', str), ('node', str), ('release', str), ('version', str), ('machine', str), ('processor', str)]) + +def uname() -> uname_result: ... +def system() -> str: ... +def node() -> str: ... +def release() -> str: ... +def version() -> str: ... +def machine() -> str: ... +def processor() -> str: ... + +def python_implementation() -> str: ... +def python_version() -> str: ... +def python_version_tuple() -> Tuple[str, str, str]: ... +def python_branch() -> str: ... +def python_revision() -> str: ... +def python_build() -> Tuple[str, str]: ... +def python_compiler() -> str: ... + +def platform(aliased: bool = ..., terse: bool = ...) -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/posix.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/posix.pyi new file mode 100644 index 0000000..6902e5f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/posix.pyi @@ -0,0 +1,112 @@ +# Stubs for posix + +# NOTE: These are incomplete! + +import sys +from typing import NamedTuple, Tuple + +from os import stat_result as stat_result + +uname_result = NamedTuple('uname_result', [ + ('sysname', str), + ('nodename', str), + ('release', str), + ('version', str), + ('machine', str), +]) + +times_result = NamedTuple('times_result', [ + ('user', float), + ('system', float), + ('children_user', float), + ('children_system', float), + ('elapsed', float), +]) + +waitid_result = NamedTuple('waitid_result', [ + ('si_pid', int), + ('si_uid', int), + ('si_signo', int), + ('si_status', int), + ('si_code', int), +]) + +sched_param = NamedTuple('sched_param', [ + ('sched_priority', int), +]) + + +EX_CANTCREAT: int +EX_CONFIG: int +EX_DATAERR: int +EX_IOERR: int +EX_NOHOST: int +EX_NOINPUT: int +EX_NOPERM: int +EX_NOTFOUND: int +EX_NOUSER: int +EX_OK: int +EX_OSERR: int +EX_OSFILE: int +EX_PROTOCOL: int +EX_SOFTWARE: int +EX_TEMPFAIL: int +EX_UNAVAILABLE: int +EX_USAGE: int + +F_OK: int +R_OK: int +W_OK: int +X_OK: int + +if sys.version_info >= (3, 6): + GRND_NONBLOCK: int + GRND_RANDOM: int +NGROUPS_MAX: int + +O_APPEND: int +if sys.version_info >= (3, 4): + O_ACCMODE: int +O_ASYNC: int +O_CREAT: int +O_DIRECT: int +O_DIRECTORY: int +O_DSYNC: int +O_EXCL: int +O_LARGEFILE: int +O_NDELAY: int +O_NOATIME: int +O_NOCTTY: int +O_NOFOLLOW: int +O_NONBLOCK: int +O_RDONLY: int +O_RDWR: int +O_RSYNC: int +O_SYNC: int +O_TRUNC: int +O_WRONLY: int + +ST_APPEND: int +ST_MANDLOCK: int +ST_NOATIME: int +ST_NODEV: int +ST_NODIRATIME: int +ST_NOEXEC: int +ST_NOSUID: int +ST_RDONLY: int +ST_RELATIME: int +ST_SYNCHRONOUS: int +ST_WRITE: int + +TMP_MAX: int +WCONTINUED: int +WCOREDUMP: int +WEXITSTATUS: int +WIFCONTINUED: int +WIFEXITED: int +WIFSIGNALED: int +WIFSTOPPED: int +WNOHANG: int +WSTOPSIG: int +WTERMSIG: int +WUNTRACED: int diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/queue.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/queue.pyi new file mode 100644 index 0000000..9874524 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/queue.pyi @@ -0,0 +1,32 @@ +# Stubs for queue + +# NOTE: These are incomplete! + +from collections import deque +from typing import Any, TypeVar, Generic, Optional + +_T = TypeVar('_T') + +class Empty(Exception): ... +class Full(Exception): ... + +class Queue(Generic[_T]): + maxsize: int + queue: deque # undocumented + def __init__(self, maxsize: int = ...) -> None: ... + def _init(self, maxsize: int) -> None: ... + def empty(self) -> bool: ... + def full(self) -> bool: ... + def get(self, block: bool = ..., timeout: Optional[float] = ...) -> _T: ... + def get_nowait(self) -> _T: ... + def _get(self) -> _T: ... + def put(self, item: _T, block: bool = ..., timeout: Optional[float] = ...) -> None: ... + def put_nowait(self, item: _T) -> None: ... + def _put(self, item: _T) -> None: ... + def join(self) -> None: ... + def qsize(self) -> int: ... + def _qsize(self) -> int: ... + def task_done(self) -> None: ... + +class PriorityQueue(Queue[_T]): ... +class LifoQueue(Queue[_T]): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/random.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/random.pyi new file mode 100644 index 0000000..35ee634 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/random.pyi @@ -0,0 +1,71 @@ +# Stubs for random +# Ron Murawski +# Updated by Jukka Lehtosalo + +# based on http://docs.python.org/3.2/library/random.html + +# ----- random classes ----- + +import _random +import sys +from typing import ( + Any, TypeVar, Sequence, List, Callable, AbstractSet, Union, Optional +) + +_T = TypeVar('_T') + +class Random(_random.Random): + def __init__(self, x: Any = ...) -> None: ... + def seed(self, a: Any = ..., version: int = ...) -> None: ... + def getstate(self) -> tuple: ... + def setstate(self, state: tuple) -> None: ... + def getrandbits(self, k: int) -> int: ... + def randrange(self, start: int, stop: Union[int, None] = ..., step: int = ...) -> int: ... + def randint(self, a: int, b: int) -> int: ... + def choice(self, seq: Sequence[_T]) -> _T: ... + if sys.version_info >= (3, 6): + def choices(self, population: Sequence[_T], weights: Optional[Sequence[float]] = ..., *, cum_weights: Optional[Sequence[float]] = ..., k: int = ...) -> List[_T]: ... + def shuffle(self, x: List[Any], random: Union[Callable[[], float], None] = ...) -> None: ... + def sample(self, population: Union[Sequence[_T], AbstractSet[_T]], k: int) -> List[_T]: ... + def random(self) -> float: ... + def uniform(self, a: float, b: float) -> float: ... + def triangular(self, low: float = ..., high: float = ..., mode: float = ...) -> float: ... + def betavariate(self, alpha: float, beta: float) -> float: ... + def expovariate(self, lambd: float) -> float: ... + def gammavariate(self, alpha: float, beta: float) -> float: ... + def gauss(self, mu: float, sigma: float) -> float: ... + def lognormvariate(self, mu: float, sigma: float) -> float: ... + def normalvariate(self, mu: float, sigma: float) -> float: ... + def vonmisesvariate(self, mu: float, kappa: float) -> float: ... + def paretovariate(self, alpha: float) -> float: ... + def weibullvariate(self, alpha: float, beta: float) -> float: ... + +# SystemRandom is not implemented for all OS's; good on Windows & Linux +class SystemRandom(Random): + ... + +# ----- random function stubs ----- +def seed(a: Any = ..., version: int = ...) -> None: ... +def getstate() -> object: ... +def setstate(state: object) -> None: ... +def getrandbits(k: int) -> int: ... +def randrange(start: int, stop: Union[None, int] = ..., step: int = ...) -> int: ... +def randint(a: int, b: int) -> int: ... +def choice(seq: Sequence[_T]) -> _T: ... +if sys.version_info >= (3, 6): + def choices(population: Sequence[_T], weights: Optional[Sequence[float]] = ..., *, cum_weights: Optional[Sequence[float]] = ..., k: int = ...) -> List[_T]: ... +def shuffle(x: List[Any], random: Union[Callable[[], float], None] = ...) -> None: ... +def sample(population: Union[Sequence[_T], AbstractSet[_T]], k: int) -> List[_T]: ... +def random() -> float: ... +def uniform(a: float, b: float) -> float: ... +def triangular(low: float = ..., high: float = ..., + mode: float = ...) -> float: ... +def betavariate(alpha: float, beta: float) -> float: ... +def expovariate(lambd: float) -> float: ... +def gammavariate(alpha: float, beta: float) -> float: ... +def gauss(mu: float, sigma: float) -> float: ... +def lognormvariate(mu: float, sigma: float) -> float: ... +def normalvariate(mu: float, sigma: float) -> float: ... +def vonmisesvariate(mu: float, kappa: float) -> float: ... +def paretovariate(alpha: float) -> float: ... +def weibullvariate(alpha: float, beta: float) -> float: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/re.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/re.pyi new file mode 100644 index 0000000..a75bfe6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/re.pyi @@ -0,0 +1,155 @@ +# Stubs for re +# Ron Murawski +# 'bytes' support added by Jukka Lehtosalo + +# based on: http://docs.python.org/3.2/library/re.html +# and http://hg.python.org/cpython/file/618ea5612e83/Lib/re.py + +import sys +from typing import ( + List, Iterator, overload, Callable, Tuple, Sequence, Dict, + Generic, AnyStr, Match, Pattern, Any, Optional, Union +) + +# ----- re variables and constants ----- +if sys.version_info >= (3, 6): + import enum + class RegexFlag(enum.IntFlag): + A = 0 + ASCII = 0 + DEBUG = 0 + I = 0 + IGNORECASE = 0 + L = 0 + LOCALE = 0 + M = 0 + MULTILINE = 0 + S = 0 + DOTALL = 0 + X = 0 + VERBOSE = 0 + U = 0 + UNICODE = 0 + T = 0 + TEMPLATE = 0 + + A = RegexFlag.A + ASCII = RegexFlag.ASCII + DEBUG = RegexFlag.DEBUG + I = RegexFlag.I + IGNORECASE = RegexFlag.IGNORECASE + L = RegexFlag.L + LOCALE = RegexFlag.LOCALE + M = RegexFlag.M + MULTILINE = RegexFlag.MULTILINE + S = RegexFlag.S + DOTALL = RegexFlag.DOTALL + X = RegexFlag.X + VERBOSE = RegexFlag.VERBOSE + U = RegexFlag.U + UNICODE = RegexFlag.UNICODE + T = RegexFlag.T + TEMPLATE = RegexFlag.TEMPLATE + _FlagsType = Union[int, RegexFlag] +else: + A = 0 + ASCII = 0 + DEBUG = 0 + I = 0 + IGNORECASE = 0 + L = 0 + LOCALE = 0 + M = 0 + MULTILINE = 0 + S = 0 + DOTALL = 0 + X = 0 + VERBOSE = 0 + U = 0 + UNICODE = 0 + T = 0 + TEMPLATE = 0 + _FlagsType = int + +if sys.version_info < (3, 7): + # undocumented + _pattern_type: type + +class error(Exception): ... + +@overload +def compile(pattern: AnyStr, flags: _FlagsType = ...) -> Pattern[AnyStr]: ... +@overload +def compile(pattern: Pattern[AnyStr], flags: _FlagsType = ...) -> Pattern[AnyStr]: ... + +@overload +def search(pattern: AnyStr, string: AnyStr, flags: _FlagsType = ...) -> Optional[Match[AnyStr]]: ... +@overload +def search(pattern: Pattern[AnyStr], string: AnyStr, flags: _FlagsType = ...) -> Optional[Match[AnyStr]]: ... + +@overload +def match(pattern: AnyStr, string: AnyStr, flags: _FlagsType = ...) -> Optional[Match[AnyStr]]: ... +@overload +def match(pattern: Pattern[AnyStr], string: AnyStr, flags: _FlagsType = ...) -> Optional[Match[AnyStr]]: ... + +# New in Python 3.4 +@overload +def fullmatch(pattern: AnyStr, string: AnyStr, flags: _FlagsType = ...) -> Optional[Match[AnyStr]]: ... +@overload +def fullmatch(pattern: Pattern[AnyStr], string: AnyStr, flags: _FlagsType = ...) -> Optional[Match[AnyStr]]: ... + +@overload +def split(pattern: AnyStr, string: AnyStr, + maxsplit: int = ..., flags: _FlagsType = ...) -> List[AnyStr]: ... +@overload +def split(pattern: Pattern[AnyStr], string: AnyStr, + maxsplit: int = ..., flags: _FlagsType = ...) -> List[AnyStr]: ... + +@overload +def findall(pattern: AnyStr, string: AnyStr, flags: _FlagsType = ...) -> List[Any]: ... +@overload +def findall(pattern: Pattern[AnyStr], string: AnyStr, flags: _FlagsType = ...) -> List[Any]: ... + +# Return an iterator yielding match objects over all non-overlapping matches +# for the RE pattern in string. The string is scanned left-to-right, and +# matches are returned in the order found. Empty matches are included in the +# result unless they touch the beginning of another match. +@overload +def finditer(pattern: AnyStr, string: AnyStr, + flags: _FlagsType = ...) -> Iterator[Match[AnyStr]]: ... +@overload +def finditer(pattern: Pattern[AnyStr], string: AnyStr, + flags: _FlagsType = ...) -> Iterator[Match[AnyStr]]: ... + +@overload +def sub(pattern: AnyStr, repl: AnyStr, string: AnyStr, count: int = ..., + flags: _FlagsType = ...) -> AnyStr: ... +@overload +def sub(pattern: AnyStr, repl: Callable[[Match[AnyStr]], AnyStr], + string: AnyStr, count: int = ..., flags: _FlagsType = ...) -> AnyStr: ... +@overload +def sub(pattern: Pattern[AnyStr], repl: AnyStr, string: AnyStr, count: int = ..., + flags: _FlagsType = ...) -> AnyStr: ... +@overload +def sub(pattern: Pattern[AnyStr], repl: Callable[[Match[AnyStr]], AnyStr], + string: AnyStr, count: int = ..., flags: _FlagsType = ...) -> AnyStr: ... + +@overload +def subn(pattern: AnyStr, repl: AnyStr, string: AnyStr, count: int = ..., + flags: _FlagsType = ...) -> Tuple[AnyStr, int]: ... +@overload +def subn(pattern: AnyStr, repl: Callable[[Match[AnyStr]], AnyStr], + string: AnyStr, count: int = ..., + flags: _FlagsType = ...) -> Tuple[AnyStr, int]: ... +@overload +def subn(pattern: Pattern[AnyStr], repl: AnyStr, string: AnyStr, count: int = ..., + flags: _FlagsType = ...) -> Tuple[AnyStr, int]: ... +@overload +def subn(pattern: Pattern[AnyStr], repl: Callable[[Match[AnyStr]], AnyStr], + string: AnyStr, count: int = ..., + flags: _FlagsType = ...) -> Tuple[AnyStr, int]: ... + +def escape(string: AnyStr) -> AnyStr: ... + +def purge() -> None: ... +def template(pattern: Union[AnyStr, Pattern[AnyStr]], flags: _FlagsType = ...) -> Pattern[AnyStr]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/reprlib.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/reprlib.pyi new file mode 100644 index 0000000..4622518 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/reprlib.pyi @@ -0,0 +1,37 @@ +# Stubs for reprlib (Python 3) + +from array import array +from typing import Any, Callable, Deque, Dict, FrozenSet, List, Set, Tuple + +_ReprFunc = Callable[[Any], str] + +def recursive_repr(fillvalue: str = ...) -> Callable[[_ReprFunc], _ReprFunc]: ... + +class Repr: + maxlevel: int + maxdict: int + maxlist: int + maxtuple: int + maxset: int + maxfrozenset: int + maxdeque: int + maxarray: int + maxlong: int + maxstring: int + maxother: int + def __init__(self) -> None: ... + def repr(self, x: Any) -> str: ... + def repr1(self, x: Any, level: int) -> str: ... + def repr_tuple(self, x: Tuple[Any, ...], level: int) -> str: ... + def repr_list(self, x: List[Any], level: int) -> str: ... + def repr_array(self, x: array, level: int) -> str: ... + def repr_set(self, x: Set[Any], level: int) -> str: ... + def repr_frozenset(self, x: FrozenSet[Any], level: int) -> str: ... + def repr_deque(self, x: Deque[Any], level: int) -> str: ... + def repr_dict(self, x: Dict[Any, Any], level: int) -> str: ... + def repr_str(self, x: str, level: int) -> str: ... + def repr_int(self, x: int, level: int) -> str: ... + def repr_instance(self, x: Any, level: int) -> str: ... + +aRepr: Repr +def repr(x: object) -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/resource.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/resource.pyi new file mode 100644 index 0000000..0d2e30b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/resource.pyi @@ -0,0 +1,42 @@ +# Stubs for resource + +# NOTE: These are incomplete! + +from typing import Tuple, Optional, NamedTuple + +RLIMIT_AS: int +RLIMIT_CORE: int +RLIMIT_CPU: int +RLIMIT_DATA: int +RLIMIT_FSIZE: int +RLIMIT_MEMLOCK: int +RLIMIT_MSGQUEUE: int +RLIMIT_NICE: int +RLIMIT_NOFILE: int +RLIMIT_NPROC: int +RLIMIT_OFILE: int +RLIMIT_RSS: int +RLIMIT_RTPRIO: int +RLIMIT_RTTIME: int +RLIMIT_SIGPENDING: int +RLIMIT_STACK: int +RLIM_INFINITY: int +RUSAGE_CHILDREN: int +RUSAGE_SELF: int +RUSAGE_THREAD: int + +_RUsage = NamedTuple('_RUsage', [('ru_utime', float), ('ru_stime', float), ('ru_maxrss', int), + ('ru_ixrss', int), ('ru_idrss', int), ('ru_isrss', int), + ('ru_minflt', int), ('ru_majflt', int), ('ru_nswap', int), + ('ru_inblock', int), ('ru_oublock', int), ('ru_msgsnd', int), + ('ru_msgrcv', int), ('ru_nsignals', int), ('ru_nvcsw', int), + ('ru_nivcsw', int)]) + +def getpagesize() -> int: ... +def getrlimit(resource: int) -> Tuple[int, int]: ... +def getrusage(who: int) -> _RUsage: ... +def prlimit(pid: int, resource: int, limits: Optional[Tuple[int, int]]) -> Tuple[int, int]: ... +def setrlimit(resource: int, limits: Tuple[int, int]) -> None: ... + +# NOTE: This is an alias of OSError in Python 3.3. +class error(Exception): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/runpy.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/runpy.pyi new file mode 100644 index 0000000..654c53c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/runpy.pyi @@ -0,0 +1,23 @@ +from types import ModuleType +from typing import Dict, Optional, Any + +class _TempModule: + mod_name: str = ... + module: ModuleType = ... + def __init__(self, mod_name): ... + def __enter__(self): ... + def __exit__(self, *args): ... + +class _ModifiedArgv0: + value: Any = ... + def __init__(self, value): ... + def __enter__(self): ... + def __exit__(self, *args): ... + +def run_module(mod_name: str, + init_globals: Optional[Dict[str, Any]] = ..., + run_name: Optional[str] = ..., + alter_sys: bool = ...): ... +def run_path(path_name: str, + init_globals: Optional[Dict[str, Any]] = ..., + run_name: str = ...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/selectors.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/selectors.pyi new file mode 100644 index 0000000..39e68ce --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/selectors.pyi @@ -0,0 +1,90 @@ +# Stubs for selector +# See https://docs.python.org/3/library/selectors.html + +from typing import Any, List, NamedTuple, Mapping, Tuple, Optional, Union +from abc import ABCMeta, abstractmethod +import socket + + +# Type aliases added mainly to preserve some context +# +# See https://github.com/python/typeshed/issues/482 +# for details regarding how _FileObject is typed. +_FileObject = Union[int, socket.socket] +_FileDescriptor = int +_EventMask = int + + +EVENT_READ: _EventMask +EVENT_WRITE: _EventMask + + +SelectorKey = NamedTuple('SelectorKey', [ + ('fileobj', _FileObject), + ('fd', _FileDescriptor), + ('events', _EventMask), + ('data', Any) +]) + + +class BaseSelector(metaclass=ABCMeta): + @abstractmethod + def register(self, fileobj: _FileObject, events: _EventMask, data: Any = ...) -> SelectorKey: ... + + @abstractmethod + def unregister(self, fileobj: _FileObject) -> SelectorKey: ... + + def modify(self, fileobj: _FileObject, events: _EventMask, data: Any = ...) -> SelectorKey: ... + + @abstractmethod + def select(self, timeout: Optional[float] = ...) -> List[Tuple[SelectorKey, _EventMask]]: ... + + def close(self) -> None: ... + + def get_key(self, fileobj: _FileObject) -> SelectorKey: ... + + @abstractmethod + def get_map(self) -> Mapping[_FileObject, SelectorKey]: ... + + def __enter__(self) -> BaseSelector: ... + + def __exit__(self, *args: Any) -> None: ... + +class SelectSelector(BaseSelector): + def register(self, fileobj: _FileObject, events: _EventMask, data: Any = ...) -> SelectorKey: ... + def unregister(self, fileobj: _FileObject) -> SelectorKey: ... + def select(self, timeout: Optional[float] = ...) -> List[Tuple[SelectorKey, _EventMask]]: ... + def get_map(self) -> Mapping[_FileObject, SelectorKey]: ... + +class PollSelector(BaseSelector): + def register(self, fileobj: _FileObject, events: _EventMask, data: Any = ...) -> SelectorKey: ... + def unregister(self, fileobj: _FileObject) -> SelectorKey: ... + def select(self, timeout: Optional[float] = ...) -> List[Tuple[SelectorKey, _EventMask]]: ... + def get_map(self) -> Mapping[_FileObject, SelectorKey]: ... + +class EpollSelector(BaseSelector): + def fileno(self) -> int: ... + def register(self, fileobj: _FileObject, events: _EventMask, data: Any = ...) -> SelectorKey: ... + def unregister(self, fileobj: _FileObject) -> SelectorKey: ... + def select(self, timeout: Optional[float] = ...) -> List[Tuple[SelectorKey, _EventMask]]: ... + def get_map(self) -> Mapping[_FileObject, SelectorKey]: ... + +class DevpollSelector(BaseSelector): + def fileno(self) -> int: ... + def register(self, fileobj: _FileObject, events: _EventMask, data: Any = ...) -> SelectorKey: ... + def unregister(self, fileobj: _FileObject) -> SelectorKey: ... + def select(self, timeout: Optional[float] = ...) -> List[Tuple[SelectorKey, _EventMask]]: ... + def get_map(self) -> Mapping[_FileObject, SelectorKey]: ... + +class KqueueSelector(BaseSelector): + def fileno(self) -> int: ... + def register(self, fileobj: _FileObject, events: _EventMask, data: Any = ...) -> SelectorKey: ... + def unregister(self, fileobj: _FileObject) -> SelectorKey: ... + def select(self, timeout: Optional[float] = ...) -> List[Tuple[SelectorKey, _EventMask]]: ... + def get_map(self) -> Mapping[_FileObject, SelectorKey]: ... + +class DefaultSelector(BaseSelector): + def register(self, fileobj: _FileObject, events: _EventMask, data: Any = ...) -> SelectorKey: ... + def unregister(self, fileobj: _FileObject) -> SelectorKey: ... + def select(self, timeout: Optional[float] = ...) -> List[Tuple[SelectorKey, _EventMask]]: ... + def get_map(self) -> Mapping[_FileObject, SelectorKey]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/shelve.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/shelve.pyi new file mode 100644 index 0000000..4a33969 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/shelve.pyi @@ -0,0 +1,31 @@ +from typing import Any, Dict, Iterator, Optional, Tuple +import collections + + +class Shelf(collections.MutableMapping): + def __init__(self, dict: Dict[bytes, Any], protocol: Optional[int] = ..., writeback: bool = ..., keyencoding: str = ...) -> None: ... + def __iter__(self) -> Iterator[str]: ... + def __len__(self) -> int: ... + def __contains__(self, key: Any) -> bool: ... # key should be str, but it would conflict with superclass's type signature + def get(self, key: str, default: Any = ...) -> Any: ... + def __getitem__(self, key: str) -> Any: ... + def __setitem__(self, key: str, value: Any) -> None: ... + def __delitem__(self, key: str) -> None: ... + def __enter__(self) -> Shelf: ... + def __exit__(self, type: Any, value: Any, traceback: Any) -> None: ... + def close(self) -> None: ... + def __del__(self) -> None: ... + def sync(self) -> None: ... + +class BsdDbShelf(Shelf): + def __init__(self, dict: Dict[bytes, Any], protocol: Optional[int] = ..., writeback: bool = ..., keyencoding: str = ...) -> None: ... + def set_location(self, key: Any) -> Tuple[str, Any]: ... + def next(self) -> Tuple[str, Any]: ... + def previous(self) -> Tuple[str, Any]: ... + def first(self) -> Tuple[str, Any]: ... + def last(self) -> Tuple[str, Any]: ... + +class DbfilenameShelf(Shelf): + def __init__(self, filename: str, flag: str = ..., protocol: Optional[int] = ..., writeback: bool = ...) -> None: ... + +def open(filename: str, flag: str = ..., protocol: Optional[int] = ..., writeback: bool = ...) -> DbfilenameShelf: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/shlex.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/shlex.pyi new file mode 100644 index 0000000..fb398ea --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/shlex.pyi @@ -0,0 +1,50 @@ +# Stubs for shlex + +# Based on http://docs.python.org/3.2/library/shlex.html + +from typing import List, Tuple, Any, TextIO, Union, Optional, Iterable, TypeVar +import sys + +def split(s: str, comments: bool = ..., + posix: bool = ...) -> List[str]: ... + +# Added in 3.3, use (undocumented) pipes.quote in previous versions. +def quote(s: str) -> str: ... + +_SLT = TypeVar('_SLT', bound=shlex) + +class shlex(Iterable[str]): + commenters: str + wordchars: str + whitespace: str + escape: str + quotes: str + escapedquotes: str + whitespace_split: bool + infile: str + instream: TextIO + source: str + debug = 0 + lineno = 0 + token: str + eof: str + if sys.version_info >= (3, 6): + punctuation_chars: str + + if sys.version_info >= (3, 6): + def __init__(self, instream: Union[str, TextIO] = ..., infile: Optional[str] = ..., + posix: bool = ..., punctuation_chars: Union[bool, str] = ...) -> None: ... + else: + def __init__(self, instream: Union[str, TextIO] = ..., infile: Optional[str] = ..., + posix: bool = ...) -> None: ... + def get_token(self) -> str: ... + def push_token(self, tok: str) -> None: ... + def read_token(self) -> str: ... + def sourcehook(self, filename: str) -> Tuple[str, TextIO]: ... + # TODO argument types + def push_source(self, newstream: Any, newfile: Any = ...) -> None: ... + def pop_source(self) -> None: ... + def error_leader(self, infile: str = ..., + lineno: int = ...) -> None: ... + def __iter__(self: _SLT) -> _SLT: ... + def __next__(self) -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/signal.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/signal.pyi new file mode 100644 index 0000000..34a8cdd --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/signal.pyi @@ -0,0 +1,187 @@ +"""Stub file for the 'signal' module.""" + +import sys +from enum import IntEnum +from typing import Any, Callable, List, Tuple, Dict, Generic, Union, Optional, Iterable, Set +from types import FrameType + +class ItimerError(IOError): ... + +ITIMER_PROF: int = ... +ITIMER_REAL: int = ... +ITIMER_VIRTUAL: int = ... + +NSIG: int = ... + +if sys.version_info >= (3, 5): + class Signals(IntEnum): + SIGABRT = ... + SIGALRM = ... + SIGBREAK = ... # Windows + SIGBUS = ... + SIGCHLD = ... + SIGCLD = ... + SIGCONT = ... + SIGEMT = ... + SIGFPE = ... + SIGHUP = ... + SIGILL = ... + SIGINFO = ... + SIGINT = ... + SIGIO = ... + SIGIOT = ... + SIGKILL = ... + SIGPIPE = ... + SIGPOLL = ... + SIGPROF = ... + SIGPWR = ... + SIGQUIT = ... + SIGRTMAX = ... + SIGRTMIN = ... + SIGSEGV = ... + SIGSTOP = ... + SIGSYS = ... + SIGTERM = ... + SIGTRAP = ... + SIGTSTP = ... + SIGTTIN = ... + SIGTTOU = ... + SIGURG = ... + SIGUSR1 = ... + SIGUSR2 = ... + SIGVTALRM = ... + SIGWINCH = ... + SIGXCPU = ... + SIGXFSZ = ... + + class Handlers(IntEnum): + SIG_DFL = ... + SIG_IGN = ... + + SIG_DFL = Handlers.SIG_DFL + SIG_IGN = Handlers.SIG_IGN + + class Sigmasks(IntEnum): + SIG_BLOCK = ... + SIG_UNBLOCK = ... + SIG_SETMASK = ... + + SIG_BLOCK = Sigmasks.SIG_BLOCK + SIG_UNBLOCK = Sigmasks.SIG_UNBLOCK + SIG_SETMASK = Sigmasks.SIG_SETMASK + + _SIG = Signals + _SIGNUM = Union[int, Signals] + _HANDLER = Union[Callable[[Signals, FrameType], None], int, Handlers, None] +else: + SIG_DFL: int = ... + SIG_IGN: int = ... + + SIG_BLOCK: int = ... + SIG_UNBLOCK: int = ... + SIG_SETMASK: int = ... + + _SIG = int + _SIGNUM = int + _HANDLER = Union[Callable[[int, FrameType], None], int, None] + +SIGABRT: _SIG = ... +SIGALRM: _SIG = ... +SIGBREAK: _SIG = ... # Windows +SIGBUS: _SIG = ... +SIGCHLD: _SIG = ... +SIGCLD: _SIG = ... +SIGCONT: _SIG = ... +SIGEMT: _SIG = ... +SIGFPE: _SIG = ... +SIGHUP: _SIG = ... +SIGILL: _SIG = ... +SIGINFO: _SIG = ... +SIGINT: _SIG = ... +SIGIO: _SIG = ... +SIGIOT: _SIG = ... +SIGKILL: _SIG = ... +SIGPIPE: _SIG = ... +SIGPOLL: _SIG = ... +SIGPROF: _SIG = ... +SIGPWR: _SIG = ... +SIGQUIT: _SIG = ... +SIGRTMAX: _SIG = ... +SIGRTMIN: _SIG = ... +SIGSEGV: _SIG = ... +SIGSTOP: _SIG = ... +SIGSYS: _SIG = ... +SIGTERM: _SIG = ... +SIGTRAP: _SIG = ... +SIGTSTP: _SIG = ... +SIGTTIN: _SIG = ... +SIGTTOU: _SIG = ... +SIGURG: _SIG = ... +SIGUSR1: _SIG = ... +SIGUSR2: _SIG = ... +SIGVTALRM: _SIG = ... +SIGWINCH: _SIG = ... +SIGXCPU: _SIG = ... +SIGXFSZ: _SIG = ... + +# Windows +CTRL_C_EVENT: _SIG = ... +CTRL_BREAK_EVENT: _SIG = ... + +class struct_siginfo(Tuple[int, int, int, int, int, int, int]): + def __init__(self, sequence: Iterable[int]) -> None: ... + @property + def si_signo(self) -> int: ... + @property + def si_code(self) -> int: ... + @property + def si_errno(self) -> int: ... + @property + def si_pid(self) -> int: ... + @property + def si_uid(self) -> int: ... + @property + def si_status(self) -> int: ... + @property + def si_band(self) -> int: ... + +def alarm(time: int) -> int: ... + +def default_int_handler(signum: int, frame: FrameType) -> None: + raise KeyboardInterrupt() + +def getitimer(which: int) -> Tuple[float, float]: ... + +def getsignal(signalnum: _SIGNUM) -> _HANDLER: + raise ValueError() + +def pause() -> None: ... + +def pthread_kill(thread_id: int, signum: int) -> None: + raise OSError() + +def pthread_sigmask(how: int, mask: Iterable[int]) -> Set[_SIGNUM]: + raise OSError() + +def set_wakeup_fd(fd: int) -> int: ... + +def setitimer(which: int, seconds: float, interval: float = ...) -> Tuple[float, float]: ... + +def siginterrupt(signalnum: int, flag: bool) -> None: + raise OSError() + +def signal(signalnum: _SIGNUM, handler: _HANDLER) -> _HANDLER: + raise OSError() + +def sigpending() -> Any: + raise OSError() + +def sigtimedwait(sigset: Iterable[int], timeout: float) -> Optional[struct_siginfo]: + raise OSError() + raise ValueError() + +def sigwait(sigset: Iterable[int]) -> _SIGNUM: + raise OSError() + +def sigwaitinfo(sigset: Iterable[int]) -> struct_siginfo: + raise OSError() diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/smtplib.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/smtplib.pyi new file mode 100644 index 0000000..ec8e27f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/smtplib.pyi @@ -0,0 +1,141 @@ +from email.message import Message as _Message +from socket import socket +from ssl import SSLContext +from types import TracebackType +from typing import ( + Any, AnyStr, Dict, Generic, List, Optional, Sequence, Tuple, Union, + Pattern, Type, Callable, Protocol, overload) +import sys + +_Reply = Tuple[int, bytes] +_SendErrs = Dict[str, _Reply] +# Should match source_address for socket.create_connection +_SourceAddress = Tuple[Union[bytearray, bytes, str], int] + +SMTP_PORT: int +SMTP_SSL_PORT: int +CRLF: str +bCRLF: bytes + +OLDSTYLE_AUTH: Pattern[str] + +class SMTPException(OSError): ... +class SMTPServerDisconnected(SMTPException): ... + +class SMTPResponseException(SMTPException): + smtp_code: int + smtp_error: Union[bytes, str] + args: Union[Tuple[int, Union[bytes, str]], Tuple[int, bytes, str]] + def __init__(self, code: int, msg: Union[bytes, str]) -> None: ... + +class SMTPSenderRefused(SMTPResponseException): + smtp_code: int + smtp_error: bytes + sender: str + args: Tuple[int, bytes, str] + def __init__(self, code: int, msg: bytes, sender: str) -> None: ... + +class SMTPRecipientsRefused(SMTPException): + recipients: _SendErrs + args: Tuple[_SendErrs] + def __init__(self, recipients: _SendErrs) -> None: ... + +class SMTPDataError(SMTPResponseException): ... +class SMTPConnectError(SMTPResponseException): ... +class SMTPHeloError(SMTPResponseException): ... +class SMTPAuthenticationError(SMTPResponseException): ... + +def quoteaddr(addrstring: str) -> str: ... +def quotedata(data: str) -> str: ... + +class _AuthObject(Protocol): + @overload + def __call__(self, challenge: None = ...) -> Optional[str]: ... + @overload + def __call__(self, challenge: bytes) -> str: ... + +class SMTP: + debuglevel: int = ... + # Type of file should match what socket.makefile() returns + file: Any = ... + helo_resp: Optional[bytes] = ... + ehlo_msg: str = ... + ehlo_resp: Optional[bytes] = ... + does_esmtp: int = ... + default_port: int = ... + timeout: float + esmtp_features: Dict[str, str] + command_encoding: str + source_address: Optional[_SourceAddress] + local_hostname: str + def __init__(self, host: str = ..., port: int = ..., + local_hostname: Optional[str] = ..., timeout: float = ..., + source_address: Optional[_SourceAddress] = ...) -> None: ... + def __enter__(self) -> SMTP: ... + def __exit__(self, exc_type: Optional[Type[BaseException]], + exc_value: Optional[BaseException], + tb: Optional[TracebackType]) -> None: ... + def set_debuglevel(self, debuglevel: int) -> None: ... + sock: Optional[socket] + def connect(self, host: str = ..., port: int = ..., + source_address: Optional[_SourceAddress] = ...) -> _Reply: ... + def send(self, s: Union[bytes, str]) -> None: ... + def putcmd(self, cmd: str, args: str = ...) -> None: ... + def getreply(self) -> _Reply: ... + def docmd(self, cmd: str, args: str = ...) -> _Reply: ... + def helo(self, name: str = ...) -> _Reply: ... + def ehlo(self, name: str = ...) -> _Reply: ... + def has_extn(self, opt: str) -> bool: ... + def help(self, args: str = ...) -> bytes: ... + def rset(self) -> _Reply: ... + def noop(self) -> _Reply: ... + def mail(self, sender: str, options: Sequence[str] = ...) -> _Reply: ... + def rcpt(self, recip: str, options: Sequence[str] = ...) -> _Reply: ... + def data(self, msg: Union[bytes, str]) -> _Reply: ... + def verify(self, address: str) -> _Reply: ... + vrfy = verify + def expn(self, address: str) -> _Reply: ... + def ehlo_or_helo_if_needed(self) -> None: ... + if sys.version_info >= (3, 5): + user: str + password: str + def auth(self, mechanism: str, authobject: _AuthObject, *, initial_response_ok: bool = ...) -> _Reply: ... + @overload + def auth_cram_md5(self, challenge: None = ...) -> None: ... + @overload + def auth_cram_md5(self, challenge: bytes) -> str: ... + def auth_plain(self, challenge: Optional[bytes] = ...) -> str: ... + def auth_login(self, challenge: Optional[bytes] = ...) -> str: ... + def login(self, user: str, password: str, *, + initial_response_ok: bool = ...) -> _Reply: ... + else: + def login(self, user: str, password: str) -> _Reply: ... + def starttls(self, keyfile: Optional[str] = ..., certfile: Optional[str] = ..., + context: Optional[SSLContext] = ...) -> _Reply: ... + def sendmail(self, from_addr: str, to_addrs: Union[str, Sequence[str]], + msg: Union[bytes, str], mail_options: Sequence[str] = ..., + rcpt_options: List[str] = ...) -> _SendErrs: ... + def send_message(self, msg: _Message, from_addr: Optional[str] = ..., + to_addrs: Optional[Union[str, Sequence[str]]] = ..., + mail_options: List[str] = ..., + rcpt_options: Sequence[str] = ...) -> _SendErrs: ... + def close(self) -> None: ... + def quit(self) -> _Reply: ... + +class SMTP_SSL(SMTP): + keyfile: Optional[str] + certfile: Optional[str] + context: SSLContext + def __init__(self, host: str = ..., port: int = ..., + local_hostname: Optional[str] = ..., + keyfile: Optional[str] = ..., certfile: Optional[str] = ..., + timeout: float = ..., + source_address: Optional[_SourceAddress] = ..., + context: Optional[SSLContext] = ...) -> None: ... + +LMTP_PORT: int + +class LMTP(SMTP): + def __init__(self, host: str = ..., port: int = ..., + local_hostname: Optional[str] = ..., + source_address: Optional[_SourceAddress] = ...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/socketserver.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/socketserver.pyi new file mode 100644 index 0000000..d485b8b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/socketserver.pyi @@ -0,0 +1,99 @@ +# NB: SocketServer.pyi and socketserver.pyi must remain consistent! +# Stubs for socketserver + +from typing import Any, BinaryIO, Optional, Tuple, Type +from socket import SocketType +import sys +import types + +class BaseServer: + address_family: int + RequestHandlerClass: type + server_address: Tuple[str, int] + socket: SocketType + allow_reuse_address: bool + request_queue_size: int + socket_type: int + timeout: Optional[float] + def __init__(self, server_address: Tuple[str, int], + RequestHandlerClass: type) -> None: ... + def fileno(self) -> int: ... + def handle_request(self) -> None: ... + def serve_forever(self, poll_interval: float = ...) -> None: ... + def shutdown(self) -> None: ... + def server_close(self) -> None: ... + def finish_request(self, request: bytes, + client_address: Tuple[str, int]) -> None: ... + def get_request(self) -> None: ... + def handle_error(self, request: bytes, + client_address: Tuple[str, int]) -> None: ... + def handle_timeout(self) -> None: ... + def process_request(self, request: bytes, + client_address: Tuple[str, int]) -> None: ... + def server_activate(self) -> None: ... + def server_bind(self) -> None: ... + def verify_request(self, request: bytes, + client_address: Tuple[str, int]) -> bool: ... + if sys.version_info >= (3, 6): + def __enter__(self) -> BaseServer: ... + def __exit__(self, exc_type: Optional[Type[BaseException]], + exc_val: Optional[BaseException], + exc_tb: Optional[types.TracebackType]) -> bool: ... + if sys.version_info >= (3, 3): + def service_actions(self) -> None: ... + +class TCPServer(BaseServer): + def __init__(self, server_address: Tuple[str, int], + RequestHandlerClass: type, + bind_and_activate: bool = ...) -> None: ... + +class UDPServer(BaseServer): + def __init__(self, server_address: Tuple[str, int], + RequestHandlerClass: type, + bind_and_activate: bool = ...) -> None: ... + +if sys.platform != 'win32': + class UnixStreamServer(BaseServer): + def __init__(self, server_address: Tuple[str, int], + RequestHandlerClass: type, + bind_and_activate: bool = ...) -> None: ... + + class UnixDatagramServer(BaseServer): + def __init__(self, server_address: Tuple[str, int], + RequestHandlerClass: type, + bind_and_activate: bool = ...) -> None: ... + +class ForkingMixIn: ... +class ThreadingMixIn: ... + +class ForkingTCPServer(ForkingMixIn, TCPServer): ... +class ForkingUDPServer(ForkingMixIn, UDPServer): ... +class ThreadingTCPServer(ThreadingMixIn, TCPServer): ... +class ThreadingUDPServer(ThreadingMixIn, UDPServer): ... +if sys.platform != 'win32': + class ThreadingUnixStreamServer(ThreadingMixIn, UnixStreamServer): ... + class ThreadingUnixDatagramServer(ThreadingMixIn, UnixDatagramServer): ... + + +class BaseRequestHandler: + # Those are technically of types, respectively: + # * Union[SocketType, Tuple[bytes, SocketType]] + # * Union[Tuple[str, int], str] + # But there are some concerns that having unions here would cause + # too much inconvenience to people using it (see + # https://github.com/python/typeshed/pull/384#issuecomment-234649696) + request: Any + client_address: Any + + server: BaseServer + def setup(self) -> None: ... + def handle(self) -> None: ... + def finish(self) -> None: ... + +class StreamRequestHandler(BaseRequestHandler): + rfile: BinaryIO + wfile: BinaryIO + +class DatagramRequestHandler(BaseRequestHandler): + rfile: BinaryIO + wfile: BinaryIO diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/spwd.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/spwd.pyi new file mode 100644 index 0000000..0e55d74 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/spwd.pyi @@ -0,0 +1,14 @@ +from typing import List, NamedTuple + +struct_spwd = NamedTuple("struct_spwd", [("sp_namp", str), + ("sp_pwdp", str), + ("sp_lstchg", int), + ("sp_min", int), + ("sp_max", int), + ("sp_warn", int), + ("sp_inact", int), + ("sp_expire", int), + ("sp_flag", int)]) + +def getspall() -> List[struct_spwd]: ... +def getspnam(name: str) -> struct_spwd: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/sre_constants.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/sre_constants.pyi new file mode 100644 index 0000000..85f50ca --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/sre_constants.pyi @@ -0,0 +1,114 @@ +# Source: https://github.com/python/cpython/blob/master/Lib/sre_constants.py + +from typing import Any, Dict, List, Optional, Union + +MAGIC: int + +class error(Exception): + msg: str + pattern: Optional[Union[str, bytes]] + pos: Optional[int] + lineno: int + colno: int + def __init__(self, msg: str, pattern: Union[str, bytes] = ..., pos: int = ...) -> None: ... + +class _NamedIntConstant(int): + name: Any + def __new__(cls, value: int, name: str): ... + +MAXREPEAT: _NamedIntConstant +OPCODES: List[_NamedIntConstant] +ATCODES: List[_NamedIntConstant] +CHCODES: List[_NamedIntConstant] +OP_IGNORE: Dict[_NamedIntConstant, _NamedIntConstant] +AT_MULTILINE: Dict[_NamedIntConstant, _NamedIntConstant] +AT_LOCALE: Dict[_NamedIntConstant, _NamedIntConstant] +AT_UNICODE: Dict[_NamedIntConstant, _NamedIntConstant] +CH_LOCALE: Dict[_NamedIntConstant, _NamedIntConstant] +CH_UNICODE: Dict[_NamedIntConstant, _NamedIntConstant] +SRE_FLAG_TEMPLATE: int +SRE_FLAG_IGNORECASE: int +SRE_FLAG_LOCALE: int +SRE_FLAG_MULTILINE: int +SRE_FLAG_DOTALL: int +SRE_FLAG_UNICODE: int +SRE_FLAG_VERBOSE: int +SRE_FLAG_DEBUG: int +SRE_FLAG_ASCII: int +SRE_INFO_PREFIX: int +SRE_INFO_LITERAL: int +SRE_INFO_CHARSET: int + + +# Stubgen above; manually defined constants below (dynamic at runtime) + +# from OPCODES +FAILURE: _NamedIntConstant +SUCCESS: _NamedIntConstant +ANY: _NamedIntConstant +ANY_ALL: _NamedIntConstant +ASSERT: _NamedIntConstant +ASSERT_NOT: _NamedIntConstant +AT: _NamedIntConstant +BRANCH: _NamedIntConstant +CALL: _NamedIntConstant +CATEGORY: _NamedIntConstant +CHARSET: _NamedIntConstant +BIGCHARSET: _NamedIntConstant +GROUPREF: _NamedIntConstant +GROUPREF_EXISTS: _NamedIntConstant +GROUPREF_IGNORE: _NamedIntConstant +IN: _NamedIntConstant +IN_IGNORE: _NamedIntConstant +INFO: _NamedIntConstant +JUMP: _NamedIntConstant +LITERAL: _NamedIntConstant +LITERAL_IGNORE: _NamedIntConstant +MARK: _NamedIntConstant +MAX_UNTIL: _NamedIntConstant +MIN_UNTIL: _NamedIntConstant +NOT_LITERAL: _NamedIntConstant +NOT_LITERAL_IGNORE: _NamedIntConstant +NEGATE: _NamedIntConstant +RANGE: _NamedIntConstant +REPEAT: _NamedIntConstant +REPEAT_ONE: _NamedIntConstant +SUBPATTERN: _NamedIntConstant +MIN_REPEAT_ONE: _NamedIntConstant +RANGE_IGNORE: _NamedIntConstant +MIN_REPEAT: _NamedIntConstant +MAX_REPEAT: _NamedIntConstant + +# from ATCODES +AT_BEGINNING: _NamedIntConstant +AT_BEGINNING_LINE: _NamedIntConstant +AT_BEGINNING_STRING: _NamedIntConstant +AT_BOUNDARY: _NamedIntConstant +AT_NON_BOUNDARY: _NamedIntConstant +AT_END: _NamedIntConstant +AT_END_LINE: _NamedIntConstant +AT_END_STRING: _NamedIntConstant +AT_LOC_BOUNDARY: _NamedIntConstant +AT_LOC_NON_BOUNDARY: _NamedIntConstant +AT_UNI_BOUNDARY: _NamedIntConstant +AT_UNI_NON_BOUNDARY: _NamedIntConstant + +# from CHCODES +CATEGORY_DIGIT: _NamedIntConstant +CATEGORY_NOT_DIGIT: _NamedIntConstant +CATEGORY_SPACE: _NamedIntConstant +CATEGORY_NOT_SPACE: _NamedIntConstant +CATEGORY_WORD: _NamedIntConstant +CATEGORY_NOT_WORD: _NamedIntConstant +CATEGORY_LINEBREAK: _NamedIntConstant +CATEGORY_NOT_LINEBREAK: _NamedIntConstant +CATEGORY_LOC_WORD: _NamedIntConstant +CATEGORY_LOC_NOT_WORD: _NamedIntConstant +CATEGORY_UNI_DIGIT: _NamedIntConstant +CATEGORY_UNI_NOT_DIGIT: _NamedIntConstant +CATEGORY_UNI_SPACE: _NamedIntConstant +CATEGORY_UNI_NOT_SPACE: _NamedIntConstant +CATEGORY_UNI_WORD: _NamedIntConstant +CATEGORY_UNI_NOT_WORD: _NamedIntConstant +CATEGORY_UNI_LINEBREAK: _NamedIntConstant +CATEGORY_UNI_NOT_LINEBREAK: _NamedIntConstant diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/sre_parse.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/sre_parse.pyi new file mode 100644 index 0000000..93b3c1d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/sre_parse.pyi @@ -0,0 +1,81 @@ +# Source: https://github.com/python/cpython/blob/master/Lib/sre_parse.py + +from typing import ( + Any, Dict, FrozenSet, Iterable, List, Match, + Optional, Pattern as _Pattern, Tuple, Union +) +from sre_constants import _NamedIntConstant as NIC, error as _Error + +SPECIAL_CHARS: str +REPEAT_CHARS: str +DIGITS: FrozenSet[str] +OCTDIGITS: FrozenSet[str] +HEXDIGITS: FrozenSet[str] +ASCIILETTERS: FrozenSet[str] +WHITESPACE: FrozenSet[str] +ESCAPES: Dict[str, Tuple[NIC, int]] +CATEGORIES: Dict[str, Union[Tuple[NIC, NIC], Tuple[NIC, List[Tuple[NIC, NIC]]]]] +FLAGS: Dict[str, int] +GLOBAL_FLAGS: int + +class Verbose(Exception): ... + +class Pattern: + flags: int + groupdict: Dict[str, int] + groupwidths: List[Optional[int]] + lookbehindgroups: Optional[int] + def __init__(self) -> None: ... + @property + def groups(self) -> int: ... + def opengroup(self, name: str = ...) -> int: ... + def closegroup(self, gid: int, p: SubPattern) -> None: ... + def checkgroup(self, gid: int) -> bool: ... + def checklookbehindgroup(self, gid: int, source: Tokenizer) -> None: ... + + +_OpSubpatternType = Tuple[Optional[int], int, int, SubPattern] +_OpGroupRefExistsType = Tuple[int, SubPattern, SubPattern] +_OpInType = List[Tuple[NIC, int]] +_OpBranchType = Tuple[None, List[SubPattern]] +_AvType = Union[_OpInType, _OpBranchType, Iterable[SubPattern], _OpGroupRefExistsType, _OpSubpatternType] +_CodeType = Tuple[NIC, _AvType] + + +class SubPattern: + pattern: Pattern + data: List[_CodeType] + width: Optional[int] + def __init__(self, pattern: Pattern, data: List[_CodeType] = ...) -> None: ... + def dump(self, level: int = ...) -> None: ... + def __len__(self) -> int: ... + def __delitem__(self, index: Union[int, slice]) -> None: ... + def __getitem__(self, index: Union[int, slice]) -> Union[SubPattern, _CodeType]: ... + def __setitem__(self, index: Union[int, slice], code: _CodeType) -> None: ... + def insert(self, index: int, code: _CodeType) -> None: ... + def append(self, code: _CodeType) -> None: ... + def getwidth(self) -> int: ... + + +class Tokenizer: + istext: bool + string: Any + decoded_string: str + index: int + next: Optional[str] + def __init__(self, string: Any) -> None: ... + def match(self, char: str) -> bool: ... + def get(self) -> Optional[str]: ... + def getwhile(self, n: int, charset: Iterable[str]) -> str: ... + def getuntil(self, terminator: str) -> str: ... + @property + def pos(self) -> int: ... + def tell(self) -> int: ... + def seek(self, index: int) -> None: ... + def error(self, msg: str, offset: int = ...) -> _Error: ... + +def fix_flags(src: Union[str, bytes], flag: int) -> int: ... +def parse(str: str, flags: int = ..., pattern: Pattern = ...) -> SubPattern: ... +_TemplateType = Tuple[List[Tuple[int, int]], List[str]] +def parse_template(source: str, pattern: _Pattern) -> _TemplateType: ... +def expand_template(template: _TemplateType, match: Match) -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/stat.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/stat.pyi new file mode 100644 index 0000000..c45a068 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/stat.pyi @@ -0,0 +1,75 @@ +# Stubs for stat + +# Based on http://docs.python.org/3.2/library/stat.html + +import sys +import typing + +def S_ISDIR(mode: int) -> bool: ... +def S_ISCHR(mode: int) -> bool: ... +def S_ISBLK(mode: int) -> bool: ... +def S_ISREG(mode: int) -> bool: ... +def S_ISFIFO(mode: int) -> bool: ... +def S_ISLNK(mode: int) -> bool: ... +def S_ISSOCK(mode: int) -> bool: ... + +def S_IMODE(mode: int) -> int: ... +def S_IFMT(mode: int) -> int: ... + +def filemode(mode: int) -> str: ... + +ST_MODE = 0 +ST_INO = 0 +ST_DEV = 0 +ST_NLINK = 0 +ST_UID = 0 +ST_GID = 0 +ST_SIZE = 0 +ST_ATIME = 0 +ST_MTIME = 0 +ST_CTIME = 0 + +S_IFSOCK = 0 +S_IFLNK = 0 +S_IFREG = 0 +S_IFBLK = 0 +S_IFDIR = 0 +S_IFCHR = 0 +S_IFIFO = 0 +S_ISUID = 0 +S_ISGID = 0 +S_ISVTX = 0 + +S_IRWXU = 0 +S_IRUSR = 0 +S_IWUSR = 0 +S_IXUSR = 0 + +S_IRWXG = 0 +S_IRGRP = 0 +S_IWGRP = 0 +S_IXGRP = 0 + +S_IRWXO = 0 +S_IROTH = 0 +S_IWOTH = 0 +S_IXOTH = 0 + +S_ENFMT = 0 +S_IREAD = 0 +S_IWRITE = 0 +S_IEXEC = 0 + +UF_NODUMP = 0 +UF_IMMUTABLE = 0 +UF_APPEND = 0 +UF_OPAQUE = 0 +UF_NOUNLINK = 0 +if sys.platform == 'darwin': + UF_COMPRESSED = 0 # OS X 10.6+ only + UF_HIDDEN = 0 # OX X 10.5+ only +SF_ARCHIVED = 0 +SF_IMMUTABLE = 0 +SF_APPEND = 0 +SF_NOUNLINK = 0 +SF_SNAPSHOT = 0 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/statistics.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/statistics.pyi new file mode 100644 index 0000000..d9116e5 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/statistics.pyi @@ -0,0 +1,24 @@ +# Stubs for statistics + +from decimal import Decimal +from fractions import Fraction +import sys +from typing import Iterable, Optional, TypeVar + +# Most functions in this module accept homogeneous collections of one of these types +_Number = TypeVar('_Number', float, Decimal, Fraction) + +class StatisticsError(ValueError): ... + +def mean(data: Iterable[_Number]) -> _Number: ... +if sys.version_info >= (3, 6): + def harmonic_mean(data: Iterable[_Number]) -> _Number: ... +def median(data: Iterable[_Number]) -> _Number: ... +def median_low(data: Iterable[_Number]) -> _Number: ... +def median_high(data: Iterable[_Number]) -> _Number: ... +def median_grouped(data: Iterable[_Number]) -> _Number: ... +def mode(data: Iterable[_Number]) -> _Number: ... +def pstdev(data: Iterable[_Number], mu: Optional[_Number] = ...) -> _Number: ... +def pvariance(data: Iterable[_Number], mu: Optional[_Number] = ...) -> _Number: ... +def stdev(data: Iterable[_Number], xbar: Optional[_Number] = ...) -> _Number: ... +def variance(data: Iterable[_Number], xbar: Optional[_Number] = ...) -> _Number: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/string.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/string.pyi new file mode 100644 index 0000000..92fc036 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/string.pyi @@ -0,0 +1,42 @@ +# Stubs for string + +# Based on http://docs.python.org/3.2/library/string.html + +from typing import Mapping, Sequence, Any, Optional, Union, List, Tuple, Iterable + +ascii_letters: str +ascii_lowercase: str +ascii_uppercase: str +digits: str +hexdigits: str +octdigits: str +punctuation: str +printable: str +whitespace: str + +def capwords(s: str, sep: str = ...) -> str: ... + +class Template: + template: str + + def __init__(self, template: str) -> None: ... + def substitute(self, mapping: Mapping[str, str] = ..., **kwds: str) -> str: ... + def safe_substitute(self, mapping: Mapping[str, str] = ..., + **kwds: str) -> str: ... + +# TODO(MichalPokorny): This is probably badly and/or loosely typed. +class Formatter: + def format(self, format_string: str, *args: Any, **kwargs: Any) -> str: ... + def vformat(self, format_string: str, args: Sequence[Any], + kwargs: Mapping[str, Any]) -> str: ... + def parse(self, format_string: str) -> Iterable[Tuple[str, Optional[str], Optional[str], Optional[str]]]: ... + def get_field(self, field_name: str, args: Sequence[Any], + kwargs: Mapping[str, Any]) -> Any: ... + def get_value(self, key: Union[int, str], args: Sequence[Any], + kwargs: Mapping[str, Any]) -> Any: + raise IndexError() + raise KeyError() + def check_unused_args(self, used_args: Sequence[Union[int, str]], args: Sequence[Any], + kwargs: Mapping[str, Any]) -> None: ... + def format_field(self, value: Any, format_spec: str) -> Any: ... + def convert_field(self, value: Any, conversion: str) -> Any: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/subprocess.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/subprocess.pyi new file mode 100644 index 0000000..b242449 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/subprocess.pyi @@ -0,0 +1,365 @@ +# Stubs for subprocess + +# Based on http://docs.python.org/3.6/library/subprocess.html +import sys +from typing import Sequence, Any, Mapping, Callable, Tuple, IO, Optional, Union, List, Type, Text +from types import TracebackType + +# We prefer to annotate inputs to methods (eg subprocess.check_call) with these +# union types. However, outputs (eg check_call return) and class attributes +# (eg TimeoutError.cmd) we prefer to annotate with Any, so the caller does not +# have to use an assertion to confirm which type. +# +# For example: +# +# try: +# x = subprocess.check_output(["ls", "-l"]) +# reveal_type(x) # Any, but morally is _TXT +# except TimeoutError as e: +# reveal_type(e.cmd) # Any, but morally is _CMD +_FILE = Union[None, int, IO[Any]] +_TXT = Union[bytes, Text] +if sys.version_info >= (3, 6): + from builtins import _PathLike + _PATH = Union[bytes, Text, _PathLike] +else: + _PATH = Union[bytes, Text] +# Python 3.6 does't support _CMD being a single PathLike. +# See: https://bugs.python.org/issue31961 +_CMD = Union[_TXT, Sequence[_PATH]] +_ENV = Union[Mapping[bytes, _TXT], Mapping[Text, _TXT]] + +if sys.version_info >= (3, 5): + class CompletedProcess: + # morally: _CMD + args: Any + returncode: int + # morally: Optional[_TXT] + stdout: Any + stderr: Any + def __init__(self, args: _CMD, + returncode: int, + stdout: Optional[_TXT] = ..., + stderr: Optional[_TXT] = ...) -> None: ... + def check_returncode(self) -> None: ... + + if sys.version_info >= (3, 7): + # Nearly the same args as for 3.6, except for capture_output and text + def run(args: _CMD, + bufsize: int = ..., + executable: _PATH = ..., + stdin: _FILE = ..., + stdout: _FILE = ..., + stderr: _FILE = ..., + preexec_fn: Callable[[], Any] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[_PATH] = ..., + env: Optional[_ENV] = ..., + universal_newlines: bool = ..., + startupinfo: Any = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + *, + capture_output: bool = ..., + check: bool = ..., + encoding: Optional[str] = ..., + errors: Optional[str] = ..., + input: Optional[_TXT] = ..., + text: Optional[bool] = ..., + timeout: Optional[float] = ...) -> CompletedProcess: ... + elif sys.version_info >= (3, 6): + # Nearly same args as Popen.__init__ except for timeout, input, and check + def run(args: _CMD, + bufsize: int = ..., + executable: _PATH = ..., + stdin: _FILE = ..., + stdout: _FILE = ..., + stderr: _FILE = ..., + preexec_fn: Callable[[], Any] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[_PATH] = ..., + env: Optional[_ENV] = ..., + universal_newlines: bool = ..., + startupinfo: Any = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + *, + check: bool = ..., + encoding: Optional[str] = ..., + errors: Optional[str] = ..., + input: Optional[_TXT] = ..., + timeout: Optional[float] = ...) -> CompletedProcess: ... + else: + # Nearly same args as Popen.__init__ except for timeout, input, and check + def run(args: _CMD, + timeout: Optional[float] = ..., + input: Optional[_TXT] = ..., + check: bool = ..., + bufsize: int = ..., + executable: _PATH = ..., + stdin: _FILE = ..., + stdout: _FILE = ..., + stderr: _FILE = ..., + preexec_fn: Callable[[], Any] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[_PATH] = ..., + env: Optional[_ENV] = ..., + universal_newlines: bool = ..., + startupinfo: Any = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ...) -> CompletedProcess: ... + +# Same args as Popen.__init__ +def call(args: _CMD, + bufsize: int = ..., + executable: _PATH = ..., + stdin: _FILE = ..., + stdout: _FILE = ..., + stderr: _FILE = ..., + preexec_fn: Callable[[], Any] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[_PATH] = ..., + env: Optional[_ENV] = ..., + universal_newlines: bool = ..., + startupinfo: Any = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + timeout: float = ...) -> int: ... + +# Same args as Popen.__init__ +def check_call(args: _CMD, + bufsize: int = ..., + executable: _PATH = ..., + stdin: _FILE = ..., + stdout: _FILE = ..., + stderr: _FILE = ..., + preexec_fn: Callable[[], Any] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[_PATH] = ..., + env: Optional[_ENV] = ..., + universal_newlines: bool = ..., + startupinfo: Any = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + timeout: float = ...) -> int: ... + +if sys.version_info >= (3, 7): + # 3.7 added text + def check_output(args: _CMD, + bufsize: int = ..., + executable: _PATH = ..., + stdin: _FILE = ..., + stderr: _FILE = ..., + preexec_fn: Callable[[], Any] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[_PATH] = ..., + env: Optional[_ENV] = ..., + universal_newlines: bool = ..., + startupinfo: Any = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + *, + timeout: float = ..., + input: _TXT = ..., + encoding: Optional[str] = ..., + errors: Optional[str] = ..., + text: Optional[bool] = ..., + ) -> Any: ... # morally: -> _TXT +elif sys.version_info >= (3, 6): + # 3.6 added encoding and errors + def check_output(args: _CMD, + bufsize: int = ..., + executable: _PATH = ..., + stdin: _FILE = ..., + stderr: _FILE = ..., + preexec_fn: Callable[[], Any] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[_PATH] = ..., + env: Optional[_ENV] = ..., + universal_newlines: bool = ..., + startupinfo: Any = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + *, + timeout: float = ..., + input: _TXT = ..., + encoding: Optional[str] = ..., + errors: Optional[str] = ..., + ) -> Any: ... # morally: -> _TXT +else: + def check_output(args: _CMD, + bufsize: int = ..., + executable: _PATH = ..., + stdin: _FILE = ..., + stderr: _FILE = ..., + preexec_fn: Callable[[], Any] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[_PATH] = ..., + env: Optional[_ENV] = ..., + universal_newlines: bool = ..., + startupinfo: Any = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + timeout: float = ..., + input: _TXT = ..., + ) -> Any: ... # morally: -> _TXT + + +PIPE: int +STDOUT: int +DEVNULL: int +class SubprocessError(Exception): ... +class TimeoutExpired(SubprocessError): + def __init__(self, cmd: _CMD, timeout: float, output: Optional[_TXT] = ..., stderr: Optional[_TXT] = ...) -> None: ... + # morally: _CMD + cmd: Any + timeout: float + # morally: Optional[_TXT] + output: Any + stdout: Any + stderr: Any + + +class CalledProcessError(Exception): + returncode = 0 + # morally: _CMD + cmd: Any + # morally: Optional[_TXT] + output: Any + + if sys.version_info >= (3, 5): + # morally: Optional[_TXT] + stdout: Any + stderr: Any + + def __init__(self, + returncode: int, + cmd: _CMD, + output: Optional[_TXT] = ..., + stderr: Optional[_TXT] = ...) -> None: ... + +class Popen: + args: _CMD + stdin: IO[Any] + stdout: IO[Any] + stderr: IO[Any] + pid = 0 + returncode = 0 + + if sys.version_info >= (3, 6): + def __init__(self, + args: _CMD, + bufsize: int = ..., + executable: Optional[_PATH] = ..., + stdin: Optional[_FILE] = ..., + stdout: Optional[_FILE] = ..., + stderr: Optional[_FILE] = ..., + preexec_fn: Optional[Callable[[], Any]] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[_PATH] = ..., + env: Optional[_ENV] = ..., + universal_newlines: bool = ..., + startupinfo: Optional[Any] = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + *, + encoding: Optional[str] = ..., + errors: Optional[str] = ...) -> None: ... + else: + def __init__(self, + args: _CMD, + bufsize: int = ..., + executable: Optional[_PATH] = ..., + stdin: Optional[_FILE] = ..., + stdout: Optional[_FILE] = ..., + stderr: Optional[_FILE] = ..., + preexec_fn: Optional[Callable[[], Any]] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[_PATH] = ..., + env: Optional[_ENV] = ..., + universal_newlines: bool = ..., + startupinfo: Optional[Any] = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ...) -> None: ... + + def poll(self) -> int: ... + def wait(self, timeout: Optional[float] = ...) -> int: ... + # Return str/bytes + def communicate(self, + input: Optional[_TXT] = ..., + timeout: Optional[float] = ..., + # morally: -> Tuple[Optional[_TXT], Optional[_TXT]] + ) -> Tuple[Any, Any]: ... + def send_signal(self, signal: int) -> None: ... + def terminate(self) -> None: ... + def kill(self) -> None: ... + def __enter__(self) -> Popen: ... + def __exit__(self, type: Optional[Type[BaseException]], value: Optional[BaseException], traceback: Optional[TracebackType]) -> bool: ... + +# The result really is always a str. +def getstatusoutput(cmd: _TXT) -> Tuple[int, str]: ... +def getoutput(cmd: _TXT) -> str: ... + +def list2cmdline(seq: Sequence[str]) -> str: ... # undocumented + +if sys.platform == 'win32': + class STARTUPINFO: + if sys.version_info >= (3, 7): + def __init__(self, *, dwFlags: int = ..., hStdInput: Optional[Any] = ..., hStdOutput: Optional[Any] = ..., hStdError: Optional[Any] = ..., wShowWindow: int = ..., lpAttributeList: Optional[Mapping[str, Any]] = ...) -> None: ... + dwFlags: int + hStdInput: Optional[Any] + hStdOutput: Optional[Any] + hStdError: Optional[Any] + wShowWindow: int + if sys.version_info >= (3, 7): + lpAttributeList: Mapping[str, Any] + + STD_INPUT_HANDLE: Any + STD_OUTPUT_HANDLE: Any + STD_ERROR_HANDLE: Any + SW_HIDE: int + STARTF_USESTDHANDLES: int + STARTF_USESHOWWINDOW: int + CREATE_NEW_CONSOLE: int + CREATE_NEW_PROCESS_GROUP: int + if sys.version_info >= (3, 7): + ABOVE_NORMAL_PRIORITY_CLASS: int + BELOW_NORMAL_PRIORITY_CLASS: int + HIGH_PRIORITY_CLASS: int + IDLE_PRIORITY_CLASS: int + NORMAL_PRIORITY_CLASS: int + REALTIME_PRIORITY_CLASS: int + CREATE_NO_WINDOW: int + DETACHED_PROCESS: int + CREATE_DEFAULT_ERROR_MODE: int + CREATE_BREAKAWAY_FROM_JOB: int diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/symbol.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/symbol.pyi new file mode 100644 index 0000000..0cf5f1c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/symbol.pyi @@ -0,0 +1,97 @@ +# Stubs for symbol (Python 3) + +import sys +from typing import Dict + +single_input: int +file_input: int +eval_input: int +decorator: int +decorators: int +decorated: int +if sys.version_info >= (3, 5): + async_funcdef: int +funcdef: int +parameters: int +typedargslist: int +tfpdef: int +varargslist: int +vfpdef: int +stmt: int +simple_stmt: int +small_stmt: int +expr_stmt: int +if sys.version_info >= (3, 6): + annassign: int +testlist_star_expr: int +augassign: int +del_stmt: int +pass_stmt: int +flow_stmt: int +break_stmt: int +continue_stmt: int +return_stmt: int +yield_stmt: int +raise_stmt: int +import_stmt: int +import_name: int +import_from: int +import_as_name: int +dotted_as_name: int +import_as_names: int +dotted_as_names: int +dotted_name: int +global_stmt: int +nonlocal_stmt: int +assert_stmt: int +compound_stmt: int +if sys.version_info >= (3, 5): + async_stmt: int +if_stmt: int +while_stmt: int +for_stmt: int +try_stmt: int +with_stmt: int +with_item: int +except_clause: int +suite: int +test: int +test_nocond: int +lambdef: int +lambdef_nocond: int +or_test: int +and_test: int +not_test: int +comparison: int +comp_op: int +star_expr: int +expr: int +xor_expr: int +and_expr: int +shift_expr: int +arith_expr: int +term: int +factor: int +power: int +if sys.version_info >= (3, 5): + atom_expr: int +atom: int +testlist_comp: int +trailer: int +subscriptlist: int +subscript: int +sliceop: int +exprlist: int +testlist: int +dictorsetmaker: int +classdef: int +arglist: int +argument: int +comp_iter: int +comp_for: int +comp_if: int +encoding_decl: int +yield_expr: int +yield_arg: int + +sym_name: Dict[int, str] diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/sys.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/sys.pyi new file mode 100644 index 0000000..3f856bb --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/sys.pyi @@ -0,0 +1,201 @@ +# Stubs for sys +# Ron Murawski + +# based on http://docs.python.org/3.2/library/sys.html + +from typing import ( + List, NoReturn, Sequence, Any, Dict, Tuple, TextIO, overload, Optional, + Union, TypeVar, Callable, Type +) +import sys +from types import FrameType, ModuleType, TracebackType + +from importlib.abc import MetaPathFinder + +_T = TypeVar('_T') + +# The following type alias are stub-only and do not exist during runtime +_ExcInfo = Tuple[Type[BaseException], BaseException, TracebackType] +_OptExcInfo = Tuple[Optional[Type[BaseException]], Optional[BaseException], Optional[TracebackType]] + +# ----- sys variables ----- +abiflags: str +argv: List[str] +base_exec_prefix: str +base_prefix: str +byteorder: str +builtin_module_names: Sequence[str] # actually a tuple of strings +copyright: str +# dllhandle = 0 # Windows only +dont_write_bytecode: bool +__displayhook__: Any # contains the original value of displayhook +__excepthook__: Any # contains the original value of excepthook +exec_prefix: str +executable: str +float_repr_style: str +hexversion: int +last_type: Optional[Type[BaseException]] +last_value: Optional[BaseException] +last_traceback: Optional[TracebackType] +maxsize: int +maxunicode: int +meta_path: List[MetaPathFinder] +modules: Dict[str, ModuleType] +path: List[str] +path_hooks: List[Any] # TODO precise type; function, path to finder +path_importer_cache: Dict[str, Any] # TODO precise type +platform: str +prefix: str +ps1: str +ps2: str +stdin: TextIO +stdout: TextIO +stderr: TextIO +__stdin__: TextIO +__stdout__: TextIO +__stderr__: TextIO +# deprecated and removed in Python 3.3: +subversion: Tuple[str, str, str] +tracebacklimit: int +version: str +api_version: int +warnoptions: Any +# Each entry is a tuple of the form (action, message, category, module, +# lineno) +# winver = '' # Windows only +_xoptions: Dict[Any, Any] + + +flags: _flags +class _flags: + debug: int + division_warning: int + inspect: int + interactive: int + optimize: int + dont_write_bytecode: int + no_user_site: int + no_site: int + ignore_environment: int + verbose: int + bytes_warning: int + quiet: int + hash_randomization: int + if sys.version_info >= (3, 7): + dev_mode: int + +float_info: _float_info +class _float_info: + epsilon: float # DBL_EPSILON + dig: int # DBL_DIG + mant_dig: int # DBL_MANT_DIG + max: float # DBL_MAX + max_exp: int # DBL_MAX_EXP + max_10_exp: int # DBL_MAX_10_EXP + min: float # DBL_MIN + min_exp: int # DBL_MIN_EXP + min_10_exp: int # DBL_MIN_10_EXP + radix: int # FLT_RADIX + rounds: int # FLT_ROUNDS + +hash_info: _hash_info +class _hash_info: + width: int + modulus: int + inf: int + nan: int + imag: int + +implementation: _implementation +class _implementation: + name: str + version: _version_info + hexversion: int + cache_tag: str + +int_info: _int_info +class _int_info: + bits_per_digit: int + sizeof_digit: int + +class _version_info(Tuple[int, int, int, str, int]): + major: int + minor: int + micro: int + releaselevel: str + serial: int +version_info: _version_info + +def call_tracing(fn: Callable[..., _T], args: Any) -> _T: ... +def _clear_type_cache() -> None: ... +def _current_frames() -> Dict[int, Any]: ... +def displayhook(value: Optional[int]) -> None: ... +def excepthook(type_: Type[BaseException], value: BaseException, + traceback: TracebackType) -> None: ... +def exc_info() -> _OptExcInfo: ... +# sys.exit() accepts an optional argument of anything printable +def exit(arg: object = ...) -> NoReturn: + raise SystemExit() +def getcheckinterval() -> int: ... # deprecated +def getdefaultencoding() -> str: ... +if sys.platform != 'win32': + # Unix only + def getdlopenflags() -> int: ... +def getfilesystemencoding() -> str: ... +def getrefcount(arg: Any) -> int: ... +def getrecursionlimit() -> int: ... + +@overload +def getsizeof(obj: object) -> int: ... +@overload +def getsizeof(obj: object, default: int) -> int: ... + +def getswitchinterval() -> float: ... + +@overload +def _getframe() -> FrameType: ... +@overload +def _getframe(depth: int) -> FrameType: ... + +_ProfileFunc = Callable[[FrameType, str, Any], Any] +def getprofile() -> Optional[_ProfileFunc]: ... +def setprofile(profilefunc: Optional[_ProfileFunc]) -> None: ... + +_TraceFunc = Callable[[FrameType, str, Any], Optional[Callable[[FrameType, str, Any], Any]]] +def gettrace() -> Optional[_TraceFunc]: ... +def settrace(tracefunc: Optional[_TraceFunc]) -> None: ... + + +class _WinVersion(Tuple[int, int, int, int, + str, int, int, int, int, + Tuple[int, int, int]]): + major: int + minor: int + build: int + platform: int + service_pack: str + service_pack_minor: int + service_pack_major: int + suite_mast: int + product_type: int + platform_version: Tuple[int, int, int] + + +def getwindowsversion() -> _WinVersion: ... # Windows only + +def intern(string: str) -> str: ... + +if sys.version_info >= (3, 5): + def is_finalizing() -> bool: ... + +if sys.version_info >= (3, 7): + __breakpointhook__: Any # contains the original value of breakpointhook + def breakpointhook(*args: Any, **kwargs: Any) -> Any: ... + +def setcheckinterval(interval: int) -> None: ... # deprecated +def setdlopenflags(n: int) -> None: ... # Linux only +def setrecursionlimit(limit: int) -> None: ... +def setswitchinterval(interval: float) -> None: ... +def settscdump(on_flag: bool) -> None: ... + +def gettotalrefcount() -> int: ... # Debug builds only diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/tempfile.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/tempfile.pyi new file mode 100644 index 0000000..e041b44 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/tempfile.pyi @@ -0,0 +1,123 @@ +# Stubs for tempfile +# Ron Murawski + +# based on http://docs.python.org/3.3/library/tempfile.html + +import sys +from types import TracebackType +from typing import Any, AnyStr, Generic, IO, Iterable, Iterator, List, Optional, overload, Tuple, Type + +# global variables +TMP_MAX: int +tempdir: Optional[str] +template: str + + +if sys.version_info >= (3, 5): + def TemporaryFile( + mode: str = ..., buffering: int = ..., encoding: Optional[str] = ..., + newline: Optional[str] = ..., suffix: Optional[AnyStr] = ..., prefix: Optional[AnyStr] = ..., + dir: Optional[AnyStr] = ... + ) -> IO[Any]: + ... + def NamedTemporaryFile( + mode: str = ..., buffering: int = ..., encoding: Optional[str] = ..., + newline: Optional[str] = ..., suffix: Optional[AnyStr] = ..., prefix: Optional[AnyStr] = ..., + dir: Optional[AnyStr] = ..., delete: bool = ... + ) -> IO[Any]: + ... + + # It does not actually derive from IO[AnyStr], but it does implement the + # protocol. + class SpooledTemporaryFile(IO[AnyStr]): + def __init__(self, max_size: int = ..., mode: str = ..., + buffering: int = ..., encoding: Optional[str] = ..., + newline: Optional[str] = ..., suffix: Optional[str] = ..., + prefix: Optional[str] = ..., dir: Optional[str] = ... + ) -> None: ... + def rollover(self) -> None: ... + def __enter__(self) -> SpooledTemporaryFile: ... + def __exit__(self, exc_type: Optional[Type[BaseException]], + exc_val: Optional[BaseException], + exc_tb: Optional[TracebackType]) -> bool: ... + + # These methods are copied from the abstract methods of IO, because + # SpooledTemporaryFile implements IO. + # See also https://github.com/python/typeshed/pull/2452#issuecomment-420657918. + def close(self) -> None: ... + def fileno(self) -> int: ... + def flush(self) -> None: ... + def isatty(self) -> bool: ... + def read(self, n: int = ...) -> AnyStr: ... + def readable(self) -> bool: ... + def readline(self, limit: int = ...) -> AnyStr: ... + def readlines(self, hint: int = ...) -> List[AnyStr]: ... + def seek(self, offset: int, whence: int = ...) -> int: ... + def seekable(self) -> bool: ... + def tell(self) -> int: ... + def truncate(self, size: Optional[int] = ...) -> int: ... + def writable(self) -> bool: ... + def write(self, s: AnyStr) -> int: ... + def writelines(self, lines: Iterable[AnyStr]) -> None: ... + def __next__(self) -> AnyStr: ... + def __iter__(self) -> Iterator[AnyStr]: ... + + class TemporaryDirectory(Generic[AnyStr]): + name: str + def __init__(self, suffix: Optional[AnyStr] = ..., prefix: Optional[AnyStr] = ..., + dir: Optional[AnyStr] = ...) -> None: ... + def cleanup(self) -> None: ... + def __enter__(self) -> AnyStr: ... + def __exit__(self, exc_type: Optional[Type[BaseException]], + exc_val: Optional[BaseException], + exc_tb: Optional[TracebackType]) -> bool: ... + + def mkstemp(suffix: Optional[AnyStr] = ..., prefix: Optional[AnyStr] = ..., dir: Optional[AnyStr] = ..., + text: bool = ...) -> Tuple[int, AnyStr]: ... + @overload + def mkdtemp() -> str: ... + @overload + def mkdtemp(suffix: Optional[AnyStr] = ..., prefix: Optional[AnyStr] = ..., + dir: Optional[AnyStr] = ...) -> AnyStr: ... + def mktemp(suffix: Optional[AnyStr] = ..., prefix: Optional[AnyStr] = ..., dir: Optional[AnyStr] = ...) -> AnyStr: ... + + def gettempdirb() -> bytes: ... + def gettempprefixb() -> bytes: ... +else: + def TemporaryFile( + mode: str = ..., buffering: int = ..., encoding: Optional[str] = ..., + newline: Optional[str] = ..., suffix: str = ..., prefix: str = ..., + dir: Optional[str] = ... + ) -> IO[Any]: + ... + def NamedTemporaryFile( + mode: str = ..., buffering: int = ..., encoding: Optional[str] = ..., + newline: Optional[str] = ..., suffix: str = ..., prefix: str = ..., + dir: Optional[str] = ..., delete: bool = ... + ) -> IO[Any]: + ... + def SpooledTemporaryFile( + max_size: int = ..., mode: str = ..., buffering: int = ..., + encoding: str = ..., newline: str = ..., suffix: str = ..., + prefix: str = ..., dir: Optional[str] = ... + ) -> IO[Any]: + ... + + class TemporaryDirectory: + name: str + def __init__(self, suffix: str = ..., prefix: str = ..., + dir: Optional[str] = ...) -> None: ... + def cleanup(self) -> None: ... + def __enter__(self) -> str: ... + def __exit__(self, exc_type: Optional[Type[BaseException]], + exc_val: Optional[BaseException], + exc_tb: Optional[TracebackType]) -> bool: ... + + def mkstemp(suffix: str = ..., prefix: str = ..., dir: Optional[str] = ..., + text: bool = ...) -> Tuple[int, str]: ... + def mkdtemp(suffix: str = ..., prefix: str = ..., + dir: Optional[str] = ...) -> str: ... + def mktemp(suffix: str = ..., prefix: str = ..., dir: Optional[str] = ...) -> str: ... + +def gettempdir() -> str: ... +def gettempprefix() -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/textwrap.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/textwrap.pyi new file mode 100644 index 0000000..f61f975 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/textwrap.pyi @@ -0,0 +1,113 @@ +from typing import Callable, List, Optional, Dict, Pattern + +class TextWrapper: + width: int = ... + initial_indent: str = ... + subsequent_indent: str = ... + expand_tabs: bool = ... + replace_whitespace: bool = ... + fix_sentence_endings: bool = ... + drop_whitespace: bool = ... + break_long_words: bool = ... + break_on_hyphens: bool = ... + tabsize: int = ... + max_lines: Optional[int] = ... + placeholder: str = ... + + # Attributes not present in documentation + sentence_end_re: Pattern[str] = ... + wordsep_re: Pattern[str] = ... + wordsep_simple_re: Pattern[str] = ... + whitespace_trans: str = ... + unicode_whitespace_trans: Dict[int, int] = ... + uspace: int = ... + x: int = ... + + def __init__( + self, + width: int = ..., + initial_indent: str = ..., + subsequent_indent: str = ..., + expand_tabs: bool = ..., + replace_whitespace: bool = ..., + fix_sentence_endings: bool = ..., + break_long_words: bool = ..., + drop_whitespace: bool = ..., + break_on_hyphens: bool = ..., + tabsize: int = ..., + *, + max_lines: Optional[int] = ..., + placeholder: str = ...) -> None: + ... + + # Private methods *are* part of the documented API for subclasses. + def _munge_whitespace(self, text: str) -> str: ... + def _split(self, text: str) -> List[str]: ... + def _fix_sentence_endings(self, chunks: List[str]) -> None: ... + def _handle_long_word(self, reversed_chunks: List[str], cur_line: List[str], cur_len: int, width: int) -> None: ... + def _wrap_chunks(self, chunks: List[str]) -> List[str]: ... + def _split_chunks(self, text: str) -> List[str]: ... + + def wrap(self, text: str) -> List[str]: ... + def fill(self, text: str) -> str: ... + + +def wrap( + text: str = ..., + width: int = ..., + *, + initial_indent: str = ..., + subsequent_indent: str = ..., + expand_tabs: bool = ..., + tabsize: int = ..., + replace_whitespace: bool = ..., + fix_sentence_endings: bool = ..., + break_long_words: bool = ..., + break_on_hyphens: bool = ..., + drop_whitespace: bool = ..., + max_lines: int = ..., + placeholder: str = ... +) -> List[str]: + ... + +def fill( + text: str, + width: int = ..., + *, + initial_indent: str = ..., + subsequent_indent: str = ..., + expand_tabs: bool = ..., + tabsize: int = ..., + replace_whitespace: bool = ..., + fix_sentence_endings: bool = ..., + break_long_words: bool = ..., + break_on_hyphens: bool = ..., + drop_whitespace: bool = ..., + max_lines: int = ..., + placeholder: str = ... +) -> str: + ... + +def shorten( + text: str, + width: int, + *, + initial_indent: str = ..., + subsequent_indent: str = ..., + expand_tabs: bool = ..., + tabsize: int = ..., + replace_whitespace: bool = ..., + fix_sentence_endings: bool = ..., + break_long_words: bool = ..., + break_on_hyphens: bool = ..., + drop_whitespace: bool = ..., + # Omit `max_lines: int = None`, it is forced to 1 here. + placeholder: str = ... +) -> str: + ... + +def dedent(text: str) -> str: + ... + +def indent(text: str, prefix: str, predicate: Callable[[str], bool] = ...) -> str: + ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/tkinter/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/tkinter/__init__.pyi new file mode 100644 index 0000000..c638394 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/tkinter/__init__.pyi @@ -0,0 +1,663 @@ +from types import TracebackType +from typing import Any, Optional, Dict, Callable, Type +from tkinter.constants import * # noqa: F403 + +TclError: Any +wantobjects: Any +TkVersion: Any +TclVersion: Any +READABLE: Any +WRITABLE: Any +EXCEPTION: Any + +class Event: ... + +def NoDefaultRoot(): ... + +class Variable: + def __init__(self, master: Optional[Any] = ..., value: Optional[Any] = ..., name: Optional[Any] = ...): ... + def __del__(self): ... + def set(self, value): ... + initialize: Any + def get(self): ... + def trace_variable(self, mode, callback): ... + trace: Any + def trace_vdelete(self, mode, cbname): ... + def trace_vinfo(self): ... + def __eq__(self, other): ... + +class StringVar(Variable): + def __init__(self, master: Optional[Any] = ..., value: Optional[Any] = ..., name: Optional[Any] = ...): ... + def get(self): ... + +class IntVar(Variable): + def __init__(self, master: Optional[Any] = ..., value: Optional[Any] = ..., name: Optional[Any] = ...): ... + def get(self): ... + +class DoubleVar(Variable): + def __init__(self, master: Optional[Any] = ..., value: Optional[Any] = ..., name: Optional[Any] = ...): ... + def get(self): ... + +class BooleanVar(Variable): + def __init__(self, master: Optional[Any] = ..., value: Optional[Any] = ..., name: Optional[Any] = ...): ... + def set(self, value): ... + initialize: Any + def get(self): ... + +def mainloop(n: int = ...): ... + +getint: Any +getdouble: Any + +def getboolean(s): ... + +class Misc: + def destroy(self): ... + def deletecommand(self, name): ... + def tk_strictMotif(self, boolean: Optional[Any] = ...): ... + def tk_bisque(self): ... + def tk_setPalette(self, *args, **kw): ... + def tk_menuBar(self, *args): ... + def wait_variable(self, name: str = ...): ... + waitvar: Any + def wait_window(self, window: Optional[Any] = ...): ... + def wait_visibility(self, window: Optional[Any] = ...): ... + def setvar(self, name: str = ..., value: str = ...): ... + def getvar(self, name: str = ...): ... + def getint(self, s): ... + def getdouble(self, s): ... + def getboolean(self, s): ... + def focus_set(self): ... + focus: Any + def focus_force(self): ... + def focus_get(self): ... + def focus_displayof(self): ... + def focus_lastfor(self): ... + def tk_focusFollowsMouse(self): ... + def tk_focusNext(self): ... + def tk_focusPrev(self): ... + def after(self, ms, func: Optional[Any] = ..., *args): ... + def after_idle(self, func, *args): ... + def after_cancel(self, id): ... + def bell(self, displayof: int = ...): ... + def clipboard_get(self, **kw): ... + def clipboard_clear(self, **kw): ... + def clipboard_append(self, string, **kw): ... + def grab_current(self): ... + def grab_release(self): ... + def grab_set(self): ... + def grab_set_global(self): ... + def grab_status(self): ... + def option_add(self, pattern, value, priority: Optional[Any] = ...): ... + def option_clear(self): ... + def option_get(self, name, className): ... + def option_readfile(self, fileName, priority: Optional[Any] = ...): ... + def selection_clear(self, **kw): ... + def selection_get(self, **kw): ... + def selection_handle(self, command, **kw): ... + def selection_own(self, **kw): ... + def selection_own_get(self, **kw): ... + def send(self, interp, cmd, *args): ... + def lower(self, belowThis: Optional[Any] = ...): ... + def tkraise(self, aboveThis: Optional[Any] = ...): ... + lift: Any + def winfo_atom(self, name, displayof: int = ...): ... + def winfo_atomname(self, id, displayof: int = ...): ... + def winfo_cells(self): ... + def winfo_children(self): ... + def winfo_class(self): ... + def winfo_colormapfull(self): ... + def winfo_containing(self, rootX, rootY, displayof: int = ...): ... + def winfo_depth(self): ... + def winfo_exists(self): ... + def winfo_fpixels(self, number): ... + def winfo_geometry(self): ... + def winfo_height(self): ... + def winfo_id(self): ... + def winfo_interps(self, displayof: int = ...): ... + def winfo_ismapped(self): ... + def winfo_manager(self): ... + def winfo_name(self): ... + def winfo_parent(self): ... + def winfo_pathname(self, id, displayof: int = ...): ... + def winfo_pixels(self, number): ... + def winfo_pointerx(self): ... + def winfo_pointerxy(self): ... + def winfo_pointery(self): ... + def winfo_reqheight(self): ... + def winfo_reqwidth(self): ... + def winfo_rgb(self, color): ... + def winfo_rootx(self): ... + def winfo_rooty(self): ... + def winfo_screen(self): ... + def winfo_screencells(self): ... + def winfo_screendepth(self): ... + def winfo_screenheight(self): ... + def winfo_screenmmheight(self): ... + def winfo_screenmmwidth(self): ... + def winfo_screenvisual(self): ... + def winfo_screenwidth(self): ... + def winfo_server(self): ... + def winfo_toplevel(self): ... + def winfo_viewable(self): ... + def winfo_visual(self): ... + def winfo_visualid(self): ... + def winfo_visualsavailable(self, includeids: int = ...): ... + def winfo_vrootheight(self): ... + def winfo_vrootwidth(self): ... + def winfo_vrootx(self): ... + def winfo_vrooty(self): ... + def winfo_width(self): ... + def winfo_x(self): ... + def winfo_y(self): ... + def update(self): ... + def update_idletasks(self): ... + def bindtags(self, tagList: Optional[Any] = ...): ... + def bind(self, sequence: Optional[Any] = ..., func: Optional[Any] = ..., add: Optional[Any] = ...): ... + def unbind(self, sequence, funcid: Optional[Any] = ...): ... + def bind_all(self, sequence: Optional[Any] = ..., func: Optional[Any] = ..., add: Optional[Any] = ...): ... + def unbind_all(self, sequence): ... + def bind_class(self, className, sequence: Optional[Any] = ..., func: Optional[Any] = ..., add: Optional[Any] = ...): ... + def unbind_class(self, className, sequence): ... + def mainloop(self, n: int = ...): ... + def quit(self): ... + def nametowidget(self, name): ... + register: Any + def configure(self, cnf: Optional[Any] = ..., **kw): ... + config: Any + def cget(self, key): ... + __getitem__: Any + def __setitem__(self, key, value): ... + def keys(self): ... + def pack_propagate(self, flag=...): ... + propagate: Any + def pack_slaves(self): ... + slaves: Any + def place_slaves(self): ... + def grid_anchor(self, anchor: Optional[Any] = ...): ... + anchor: Any + def grid_bbox(self, column: Optional[Any] = ..., row: Optional[Any] = ..., col2: Optional[Any] = ..., + row2: Optional[Any] = ...): ... + bbox: Any + def grid_columnconfigure(self, index, cnf=..., **kw): ... + columnconfigure: Any + def grid_location(self, x, y): ... + def grid_propagate(self, flag=...): ... + def grid_rowconfigure(self, index, cnf=..., **kw): ... + rowconfigure: Any + def grid_size(self): ... + size: Any + def grid_slaves(self, row: Optional[Any] = ..., column: Optional[Any] = ...): ... + def event_add(self, virtual, *sequences): ... + def event_delete(self, virtual, *sequences): ... + def event_generate(self, sequence, **kw): ... + def event_info(self, virtual: Optional[Any] = ...): ... + def image_names(self): ... + def image_types(self): ... + +class CallWrapper: + func: Any + subst: Any + widget: Any + def __init__(self, func, subst, widget): ... + def __call__(self, *args): ... + +class XView: + def xview(self, *args): ... + def xview_moveto(self, fraction): ... + def xview_scroll(self, number, what): ... + +class YView: + def yview(self, *args): ... + def yview_moveto(self, fraction): ... + def yview_scroll(self, number, what): ... + +class Wm: + def wm_aspect(self, minNumer: Optional[Any] = ..., minDenom: Optional[Any] = ..., maxNumer: Optional[Any] = ..., + maxDenom: Optional[Any] = ...): ... + aspect: Any + def wm_attributes(self, *args): ... + attributes: Any + def wm_client(self, name: Optional[Any] = ...): ... + client: Any + def wm_colormapwindows(self, *wlist): ... + colormapwindows: Any + def wm_command(self, value: Optional[Any] = ...): ... + command: Any + def wm_deiconify(self): ... + deiconify: Any + def wm_focusmodel(self, model: Optional[Any] = ...): ... + focusmodel: Any + def wm_forget(self, window): ... + forget: Any + def wm_frame(self): ... + frame: Any + def wm_geometry(self, newGeometry: Optional[Any] = ...): ... + geometry: Any + def wm_grid(self, baseWidth: Optional[Any] = ..., baseHeight: Optional[Any] = ..., widthInc: Optional[Any] = ..., + heightInc: Optional[Any] = ...): ... + grid: Any + def wm_group(self, pathName: Optional[Any] = ...): ... + group: Any + def wm_iconbitmap(self, bitmap: Optional[Any] = ..., default: Optional[Any] = ...): ... + iconbitmap: Any + def wm_iconify(self): ... + iconify: Any + def wm_iconmask(self, bitmap: Optional[Any] = ...): ... + iconmask: Any + def wm_iconname(self, newName: Optional[Any] = ...): ... + iconname: Any + def wm_iconphoto(self, default: bool = ..., *args): ... + iconphoto: Any + def wm_iconposition(self, x: Optional[Any] = ..., y: Optional[Any] = ...): ... + iconposition: Any + def wm_iconwindow(self, pathName: Optional[Any] = ...): ... + iconwindow: Any + def wm_manage(self, widget): ... + manage: Any + def wm_maxsize(self, width: Optional[Any] = ..., height: Optional[Any] = ...): ... + maxsize: Any + def wm_minsize(self, width: Optional[Any] = ..., height: Optional[Any] = ...): ... + minsize: Any + def wm_overrideredirect(self, boolean: Optional[Any] = ...): ... + overrideredirect: Any + def wm_positionfrom(self, who: Optional[Any] = ...): ... + positionfrom: Any + def wm_protocol(self, name: Optional[Any] = ..., func: Optional[Any] = ...): ... + protocol: Any + def wm_resizable(self, width: Optional[Any] = ..., height: Optional[Any] = ...): ... + resizable: Any + def wm_sizefrom(self, who: Optional[Any] = ...): ... + sizefrom: Any + def wm_state(self, newstate: Optional[Any] = ...): ... + state: Any + def wm_title(self, string: Optional[Any] = ...): ... + title: Any + def wm_transient(self, master: Optional[Any] = ...): ... + transient: Any + def wm_withdraw(self): ... + withdraw: Any + +class Tk(Misc, Wm): + master: Optional[Any] + children: Dict[str, Any] + tk: Any + def __init__(self, screenName: Optional[str] = ..., baseName: Optional[str] = ..., className: str = ..., useTk: bool = ..., + sync: bool = ..., use: Optional[str] = ...) -> None: ... + def loadtk(self) -> None: ... + def destroy(self) -> None: ... + def readprofile(self, baseName: str, className: str) -> None: ... + report_callback_exception: Callable[[Type[BaseException], BaseException, TracebackType], Any] + def __getattr__(self, attr: str) -> Any: ... + +def Tcl(screenName: Optional[Any] = ..., baseName: Optional[Any] = ..., className: str = ..., useTk: bool = ...): ... + +class Pack: + def pack_configure(self, cnf=..., **kw): ... + pack: Any + def pack_forget(self): ... + forget: Any + def pack_info(self): ... + info: Any + propagate: Any + slaves: Any + +class Place: + def place_configure(self, cnf=..., **kw): ... + place: Any + def place_forget(self): ... + forget: Any + def place_info(self): ... + info: Any + slaves: Any + +class Grid: + def grid_configure(self, cnf=..., **kw): ... + grid: Any + bbox: Any + columnconfigure: Any + def grid_forget(self): ... + forget: Any + def grid_remove(self): ... + def grid_info(self): ... + info: Any + location: Any + propagate: Any + rowconfigure: Any + size: Any + slaves: Any + +class BaseWidget(Misc): + widgetName: Any + def __init__(self, master, widgetName, cnf=..., kw=..., extra=...): ... + def destroy(self): ... + +class Widget(BaseWidget, Pack, Place, Grid): ... + +class Toplevel(BaseWidget, Wm): + def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... + +class Button(Widget): + def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... + def flash(self): ... + def invoke(self): ... + +class Canvas(Widget, XView, YView): + def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... + def addtag(self, *args): ... + def addtag_above(self, newtag, tagOrId): ... + def addtag_all(self, newtag): ... + def addtag_below(self, newtag, tagOrId): ... + def addtag_closest(self, newtag, x, y, halo: Optional[Any] = ..., start: Optional[Any] = ...): ... + def addtag_enclosed(self, newtag, x1, y1, x2, y2): ... + def addtag_overlapping(self, newtag, x1, y1, x2, y2): ... + def addtag_withtag(self, newtag, tagOrId): ... + def bbox(self, *args): ... + def tag_unbind(self, tagOrId, sequence, funcid: Optional[Any] = ...): ... + def tag_bind(self, tagOrId, sequence: Optional[Any] = ..., func: Optional[Any] = ..., add: Optional[Any] = ...): ... + def canvasx(self, screenx, gridspacing: Optional[Any] = ...): ... + def canvasy(self, screeny, gridspacing: Optional[Any] = ...): ... + def coords(self, *args): ... + def create_arc(self, *args, **kw): ... + def create_bitmap(self, *args, **kw): ... + def create_image(self, *args, **kw): ... + def create_line(self, *args, **kw): ... + def create_oval(self, *args, **kw): ... + def create_polygon(self, *args, **kw): ... + def create_rectangle(self, *args, **kw): ... + def create_text(self, *args, **kw): ... + def create_window(self, *args, **kw): ... + def dchars(self, *args): ... + def delete(self, *args): ... + def dtag(self, *args): ... + def find(self, *args): ... + def find_above(self, tagOrId): ... + def find_all(self): ... + def find_below(self, tagOrId): ... + def find_closest(self, x, y, halo: Optional[Any] = ..., start: Optional[Any] = ...): ... + def find_enclosed(self, x1, y1, x2, y2): ... + def find_overlapping(self, x1, y1, x2, y2): ... + def find_withtag(self, tagOrId): ... + def focus(self, *args): ... + def gettags(self, *args): ... + def icursor(self, *args): ... + def index(self, *args): ... + def insert(self, *args): ... + def itemcget(self, tagOrId, option): ... + def itemconfigure(self, tagOrId, cnf: Optional[Any] = ..., **kw): ... + itemconfig: Any + def tag_lower(self, *args): ... + lower: Any + def move(self, *args): ... + def postscript(self, cnf=..., **kw): ... + def tag_raise(self, *args): ... + lift: Any + def scale(self, *args): ... + def scan_mark(self, x, y): ... + def scan_dragto(self, x, y, gain: int = ...): ... + def select_adjust(self, tagOrId, index): ... + def select_clear(self): ... + def select_from(self, tagOrId, index): ... + def select_item(self): ... + def select_to(self, tagOrId, index): ... + def type(self, tagOrId): ... + +class Checkbutton(Widget): + def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... + def deselect(self): ... + def flash(self): ... + def invoke(self): ... + def select(self): ... + def toggle(self): ... + +class Entry(Widget, XView): + def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... + def delete(self, first, last: Optional[Any] = ...): ... + def get(self): ... + def icursor(self, index): ... + def index(self, index): ... + def insert(self, index, string): ... + def scan_mark(self, x): ... + def scan_dragto(self, x): ... + def selection_adjust(self, index): ... + select_adjust: Any + def selection_clear(self): ... + select_clear: Any + def selection_from(self, index): ... + select_from: Any + def selection_present(self): ... + select_present: Any + def selection_range(self, start, end): ... + select_range: Any + def selection_to(self, index): ... + select_to: Any + +class Frame(Widget): + def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... + +class Label(Widget): + def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... + +class Listbox(Widget, XView, YView): + def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... + def activate(self, index): ... + def bbox(self, index): ... + def curselection(self): ... + def delete(self, first, last: Optional[Any] = ...): ... + def get(self, first, last: Optional[Any] = ...): ... + def index(self, index): ... + def insert(self, index, *elements): ... + def nearest(self, y): ... + def scan_mark(self, x, y): ... + def scan_dragto(self, x, y): ... + def see(self, index): ... + def selection_anchor(self, index): ... + select_anchor: Any + def selection_clear(self, first, last: Optional[Any] = ...): ... # type: ignore + select_clear: Any + def selection_includes(self, index): ... + select_includes: Any + def selection_set(self, first, last: Optional[Any] = ...): ... + select_set: Any + def size(self): ... + def itemcget(self, index, option): ... + def itemconfigure(self, index, cnf: Optional[Any] = ..., **kw): ... + itemconfig: Any + +class Menu(Widget): + def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... + def tk_popup(self, x, y, entry: str = ...): ... + def tk_bindForTraversal(self): ... + def activate(self, index): ... + def add(self, itemType, cnf=..., **kw): ... + def add_cascade(self, cnf=..., **kw): ... + def add_checkbutton(self, cnf=..., **kw): ... + def add_command(self, cnf=..., **kw): ... + def add_radiobutton(self, cnf=..., **kw): ... + def add_separator(self, cnf=..., **kw): ... + def insert(self, index, itemType, cnf=..., **kw): ... + def insert_cascade(self, index, cnf=..., **kw): ... + def insert_checkbutton(self, index, cnf=..., **kw): ... + def insert_command(self, index, cnf=..., **kw): ... + def insert_radiobutton(self, index, cnf=..., **kw): ... + def insert_separator(self, index, cnf=..., **kw): ... + def delete(self, index1, index2: Optional[Any] = ...): ... + def entrycget(self, index, option): ... + def entryconfigure(self, index, cnf: Optional[Any] = ..., **kw): ... + entryconfig: Any + def index(self, index): ... + def invoke(self, index): ... + def post(self, x, y): ... + def type(self, index): ... + def unpost(self): ... + def xposition(self, index): ... + def yposition(self, index): ... + +class Menubutton(Widget): + def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... + +class Message(Widget): + def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... + +class Radiobutton(Widget): + def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... + def deselect(self): ... + def flash(self): ... + def invoke(self): ... + def select(self): ... + +class Scale(Widget): + def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... + def get(self): ... + def set(self, value): ... + def coords(self, value: Optional[Any] = ...): ... + def identify(self, x, y): ... + +class Scrollbar(Widget): + def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... + def activate(self, index: Optional[Any] = ...): ... + def delta(self, deltax, deltay): ... + def fraction(self, x, y): ... + def identify(self, x, y): ... + def get(self): ... + def set(self, first, last): ... + +class Text(Widget, XView, YView): + def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... + def bbox(self, index): ... + def compare(self, index1, op, index2): ... + def count(self, index1, index2, *args): ... + def debug(self, boolean: Optional[Any] = ...): ... + def delete(self, index1, index2: Optional[Any] = ...): ... + def dlineinfo(self, index): ... + def dump(self, index1, index2: Optional[Any] = ..., command: Optional[Any] = ..., **kw): ... + def edit(self, *args): ... + def edit_modified(self, arg: Optional[Any] = ...): ... + def edit_redo(self): ... + def edit_reset(self): ... + def edit_separator(self): ... + def edit_undo(self): ... + def get(self, index1, index2: Optional[Any] = ...): ... + def image_cget(self, index, option): ... + def image_configure(self, index, cnf: Optional[Any] = ..., **kw): ... + def image_create(self, index, cnf=..., **kw): ... + def image_names(self): ... + def index(self, index): ... + def insert(self, index, chars, *args): ... + def mark_gravity(self, markName, direction: Optional[Any] = ...): ... + def mark_names(self): ... + def mark_set(self, markName, index): ... + def mark_unset(self, *markNames): ... + def mark_next(self, index): ... + def mark_previous(self, index): ... + def peer_create(self, newPathName, cnf=..., **kw): ... + def peer_names(self): ... + def replace(self, index1, index2, chars, *args): ... + def scan_mark(self, x, y): ... + def scan_dragto(self, x, y): ... + def search(self, pattern, index, stopindex: Optional[Any] = ..., forwards: Optional[Any] = ..., + backwards: Optional[Any] = ..., exact: Optional[Any] = ..., regexp: Optional[Any] = ..., + nocase: Optional[Any] = ..., count: Optional[Any] = ..., elide: Optional[Any] = ...): ... + def see(self, index): ... + def tag_add(self, tagName, index1, *args): ... + def tag_unbind(self, tagName, sequence, funcid: Optional[Any] = ...): ... + def tag_bind(self, tagName, sequence, func, add: Optional[Any] = ...): ... + def tag_cget(self, tagName, option): ... + def tag_configure(self, tagName, cnf: Optional[Any] = ..., **kw): ... + tag_config: Any + def tag_delete(self, *tagNames): ... + def tag_lower(self, tagName, belowThis: Optional[Any] = ...): ... + def tag_names(self, index: Optional[Any] = ...): ... + def tag_nextrange(self, tagName, index1, index2: Optional[Any] = ...): ... + def tag_prevrange(self, tagName, index1, index2: Optional[Any] = ...): ... + def tag_raise(self, tagName, aboveThis: Optional[Any] = ...): ... + def tag_ranges(self, tagName): ... + def tag_remove(self, tagName, index1, index2: Optional[Any] = ...): ... + def window_cget(self, index, option): ... + def window_configure(self, index, cnf: Optional[Any] = ..., **kw): ... + window_config: Any + def window_create(self, index, cnf=..., **kw): ... + def window_names(self): ... + def yview_pickplace(self, *what): ... + +class _setit: + def __init__(self, var, value, callback: Optional[Any] = ...): ... + def __call__(self, *args): ... + +class OptionMenu(Menubutton): + widgetName: Any + menuname: Any + def __init__(self, master, variable, value, *values, **kwargs): ... + def __getitem__(self, name): ... + def destroy(self): ... + +class Image: + name: Any + tk: Any + def __init__(self, imgtype, name: Optional[Any] = ..., cnf=..., master: Optional[Any] = ..., **kw): ... + def __del__(self): ... + def __setitem__(self, key, value): ... + def __getitem__(self, key): ... + def configure(self, **kw): ... + config: Any + def height(self): ... + def type(self): ... + def width(self): ... + +class PhotoImage(Image): + def __init__(self, name: Optional[Any] = ..., cnf=..., master: Optional[Any] = ..., **kw): ... + def blank(self): ... + def cget(self, option): ... + def __getitem__(self, key): ... + def copy(self): ... + def zoom(self, x, y: str = ...): ... + def subsample(self, x, y: str = ...): ... + def get(self, x, y): ... + def put(self, data, to: Optional[Any] = ...): ... + def write(self, filename, format: Optional[Any] = ..., from_coords: Optional[Any] = ...): ... + +class BitmapImage(Image): + def __init__(self, name: Optional[Any] = ..., cnf=..., master: Optional[Any] = ..., **kw): ... + +def image_names(): ... +def image_types(): ... + +class Spinbox(Widget, XView): + def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... + def bbox(self, index): ... + def delete(self, first, last: Optional[Any] = ...): ... + def get(self): ... + def icursor(self, index): ... + def identify(self, x, y): ... + def index(self, index): ... + def insert(self, index, s): ... + def invoke(self, element): ... + def scan(self, *args): ... + def scan_mark(self, x): ... + def scan_dragto(self, x): ... + def selection(self, *args): ... + def selection_adjust(self, index): ... + def selection_clear(self): ... + def selection_element(self, element: Optional[Any] = ...): ... + +class LabelFrame(Widget): + def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... + +class PanedWindow(Widget): + def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... + def add(self, child, **kw): ... + def remove(self, child): ... + forget: Any + def identify(self, x, y): ... + def proxy(self, *args): ... + def proxy_coord(self): ... + def proxy_forget(self): ... + def proxy_place(self, x, y): ... + def sash(self, *args): ... + def sash_coord(self, index): ... + def sash_mark(self, index): ... + def sash_place(self, index, x, y): ... + def panecget(self, child, option): ... + def paneconfigure(self, tagOrId, cnf: Optional[Any] = ..., **kw): ... + paneconfig: Any + def panes(self): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/tkinter/commondialog.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/tkinter/commondialog.pyi new file mode 100644 index 0000000..d6a8a0d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/tkinter/commondialog.pyi @@ -0,0 +1,8 @@ +from typing import Any, Mapping, Optional + +class Dialog: + command: Optional[Any] = ... + master: Optional[Any] = ... + options: Mapping[str, Any] = ... + def __init__(self, master: Optional[Any] = ..., **options) -> None: ... + def show(self, **options) -> Any: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/tkinter/constants.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/tkinter/constants.pyi new file mode 100644 index 0000000..e21a93e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/tkinter/constants.pyi @@ -0,0 +1,79 @@ +from typing import Any + +NO: Any +YES: Any +TRUE: Any +FALSE: Any +ON: Any +OFF: Any +N: Any +S: Any +W: Any +E: Any +NW: Any +SW: Any +NE: Any +SE: Any +NS: Any +EW: Any +NSEW: Any +CENTER: Any +NONE: Any +X: Any +Y: Any +BOTH: Any +LEFT: Any +TOP: Any +RIGHT: Any +BOTTOM: Any +RAISED: Any +SUNKEN: Any +FLAT: Any +RIDGE: Any +GROOVE: Any +SOLID: Any +HORIZONTAL: Any +VERTICAL: Any +NUMERIC: Any +CHAR: Any +WORD: Any +BASELINE: Any +INSIDE: Any +OUTSIDE: Any +SEL: Any +SEL_FIRST: Any +SEL_LAST: Any +END: Any +INSERT: Any +CURRENT: Any +ANCHOR: Any +ALL: Any +NORMAL: Any +DISABLED: Any +ACTIVE: Any +HIDDEN: Any +CASCADE: Any +CHECKBUTTON: Any +COMMAND: Any +RADIOBUTTON: Any +SEPARATOR: Any +SINGLE: Any +BROWSE: Any +MULTIPLE: Any +EXTENDED: Any +DOTBOX: Any +UNDERLINE: Any +PIESLICE: Any +CHORD: Any +ARC: Any +FIRST: Any +LAST: Any +BUTT: Any +PROJECTING: Any +ROUND: Any +BEVEL: Any +MITER: Any +MOVETO: Any +SCROLL: Any +UNITS: Any +PAGES: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/tkinter/dialog.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/tkinter/dialog.pyi new file mode 100644 index 0000000..3136f21 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/tkinter/dialog.pyi @@ -0,0 +1,10 @@ +from typing import Any, Mapping, Optional +from tkinter import Widget + +DIALOG_ICON: str + +class Dialog(Widget): + widgetName: str = ... + num: int = ... + def __init__(self, master: Optional[Any] = ..., cnf: Mapping[str, Any] = ..., **kw) -> None: ... + def destroy(self) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/tkinter/filedialog.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/tkinter/filedialog.pyi new file mode 100644 index 0000000..6d5f165 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/tkinter/filedialog.pyi @@ -0,0 +1,65 @@ +from typing import Any, Dict, Optional, Tuple +from tkinter import Button, commondialog, Entry, Frame, Listbox, Scrollbar, Toplevel + +dialogstates: Dict[Any, Tuple[Any, Any]] + +class FileDialog: + title: str = ... + master: Any = ... + directory: Optional[Any] = ... + top: Toplevel = ... + botframe: Frame = ... + selection: Entry = ... + filter: Entry = ... + midframe: Entry = ... + filesbar: Scrollbar = ... + files: Listbox = ... + dirsbar: Scrollbar = ... + dirs: Listbox = ... + ok_button: Button = ... + filter_button: Button = ... + cancel_button: Button = ... + def __init__(self, master, title: Optional[Any] = ...) -> None: ... # title is usually a str or None, but e.g. int doesn't raise en exception either + how: Optional[Any] = ... + def go(self, dir_or_file: Any = ..., pattern: str = ..., default: str = ..., key: Optional[Any] = ...): ... + def quit(self, how: Optional[Any] = ...) -> None: ... + def dirs_double_event(self, event) -> None: ... + def dirs_select_event(self, event) -> None: ... + def files_double_event(self, event) -> None: ... + def files_select_event(self, event) -> None: ... + def ok_event(self, event) -> None: ... + def ok_command(self) -> None: ... + def filter_command(self, event: Optional[Any] = ...) -> None: ... + def get_filter(self): ... + def get_selection(self): ... + def cancel_command(self, event: Optional[Any] = ...) -> None: ... + def set_filter(self, dir, pat) -> None: ... + def set_selection(self, file) -> None: ... + +class LoadFileDialog(FileDialog): + title: str = ... + def ok_command(self) -> None: ... + +class SaveFileDialog(FileDialog): + title: str = ... + def ok_command(self): ... + +class _Dialog(commondialog.Dialog): ... + +class Open(_Dialog): + command: str = ... + +class SaveAs(_Dialog): + command: str = ... + +class Directory(commondialog.Dialog): + command: str = ... + +def askopenfilename(**options): ... +def asksaveasfilename(**options): ... +def askopenfilenames(**options): ... +def askopenfile(mode: str = ..., **options): ... +def askopenfiles(mode: str = ..., **options): ... +def asksaveasfile(mode: str = ..., **options): ... +def askdirectory(**options): ... +def test() -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/tkinter/messagebox.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/tkinter/messagebox.pyi new file mode 100644 index 0000000..b44e660 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/tkinter/messagebox.pyi @@ -0,0 +1,31 @@ +from tkinter.commondialog import Dialog +from typing import Any, Optional + +ERROR: str +INFO: str +QUESTION: str +WARNING: str +ABORTRETRYIGNORE: str +OK: str +OKCANCEL: str +RETRYCANCEL: str +YESNO: str +YESNOCANCEL: str +ABORT: str +RETRY: str +IGNORE: str +CANCEL: str +YES: str +NO: str + +class Message(Dialog): + command: str = ... + +def showinfo(title: Optional[str] = ..., message: Optional[str] = ..., **options: Any) -> str: ... +def showwarning(title: Optional[str] = ..., message: Optional[str] = ..., **options: Any) -> str: ... +def showerror(title: Optional[str] = ..., message: Optional[str] = ..., **options: Any) -> str: ... +def askquestion(title: Optional[str] = ..., message: Optional[str] = ..., **options: Any) -> str: ... +def askokcancel(title: Optional[str] = ..., message: Optional[str] = ..., **options: Any) -> bool: ... +def askyesno(title: Optional[str] = ..., message: Optional[str] = ..., **options: Any) -> bool: ... +def askyesnocancel(title: Optional[str] = ..., message: Optional[str] = ..., **options: Any) -> Optional[bool]: ... +def askretrycancel(title: Optional[str] = ..., message: Optional[str] = ..., **options: Any) -> bool: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/tkinter/ttk.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/tkinter/ttk.pyi new file mode 100644 index 0000000..0362f17 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/tkinter/ttk.pyi @@ -0,0 +1,160 @@ +import sys +from typing import Any, Optional +import tkinter + +def tclobjs_to_py(adict): ... +def setup_master(master: Optional[Any] = ...): ... + +class Style: + master: Any + tk: Any + def __init__(self, master: Optional[Any] = ...): ... + def configure(self, style, query_opt: Optional[Any] = ..., **kw): ... + def map(self, style, query_opt: Optional[Any] = ..., **kw): ... + def lookup(self, style, option, state: Optional[Any] = ..., default: Optional[Any] = ...): ... + def layout(self, style, layoutspec: Optional[Any] = ...): ... + def element_create(self, elementname, etype, *args, **kw): ... + def element_names(self): ... + def element_options(self, elementname): ... + def theme_create(self, themename, parent: Optional[Any] = ..., settings: Optional[Any] = ...): ... + def theme_settings(self, themename, settings): ... + def theme_names(self): ... + def theme_use(self, themename: Optional[Any] = ...): ... + +class Widget(tkinter.Widget): + def __init__(self, master, widgetname, kw: Optional[Any] = ...): ... + def identify(self, x, y): ... + def instate(self, statespec, callback: Optional[Any] = ..., *args, **kw): ... + def state(self, statespec: Optional[Any] = ...): ... + +class Button(Widget): + def __init__(self, master: Optional[Any] = ..., **kw): ... + def invoke(self): ... + +class Checkbutton(Widget): + def __init__(self, master: Optional[Any] = ..., **kw): ... + def invoke(self): ... + +class Entry(Widget, tkinter.Entry): + def __init__(self, master: Optional[Any] = ..., widget: Optional[Any] = ..., **kw): ... + def bbox(self, index): ... + def identify(self, x, y): ... + def validate(self): ... + +class Combobox(Entry): + def __init__(self, master: Optional[Any] = ..., **kw): ... + def current(self, newindex: Optional[Any] = ...): ... + def set(self, value): ... + +class Frame(Widget): + def __init__(self, master: Optional[Any] = ..., **kw): ... + +class Label(Widget): + def __init__(self, master: Optional[Any] = ..., **kw): ... + +class Labelframe(Widget): + def __init__(self, master: Optional[Any] = ..., **kw): ... + +LabelFrame: Any + +class Menubutton(Widget): + def __init__(self, master: Optional[Any] = ..., **kw): ... + +class Notebook(Widget): + def __init__(self, master: Optional[Any] = ..., **kw): ... + def add(self, child, **kw): ... + def forget(self, tab_id): ... + def hide(self, tab_id): ... + def identify(self, x, y): ... + def index(self, tab_id): ... + def insert(self, pos, child, **kw): ... + def select(self, tab_id: Optional[Any] = ...): ... + def tab(self, tab_id, option: Optional[Any] = ..., **kw): ... + def tabs(self): ... + def enable_traversal(self): ... + +class Panedwindow(Widget, tkinter.PanedWindow): + def __init__(self, master: Optional[Any] = ..., **kw): ... + forget: Any + def insert(self, pos, child, **kw): ... + def pane(self, pane, option: Optional[Any] = ..., **kw): ... + def sashpos(self, index, newpos: Optional[Any] = ...): ... + +PanedWindow: Any + +class Progressbar(Widget): + def __init__(self, master: Optional[Any] = ..., **kw): ... + def start(self, interval: Optional[Any] = ...): ... + def step(self, amount: Optional[Any] = ...): ... + def stop(self): ... + +class Radiobutton(Widget): + def __init__(self, master: Optional[Any] = ..., **kw): ... + def invoke(self): ... + +class Scale(Widget, tkinter.Scale): + def __init__(self, master: Optional[Any] = ..., **kw): ... + def configure(self, cnf: Optional[Any] = ..., **kw): ... + def get(self, x: Optional[Any] = ..., y: Optional[Any] = ...): ... + +class Scrollbar(Widget, tkinter.Scrollbar): + def __init__(self, master: Optional[Any] = ..., **kw): ... + +class Separator(Widget): + def __init__(self, master: Optional[Any] = ..., **kw): ... + +class Sizegrip(Widget): + def __init__(self, master: Optional[Any] = ..., **kw): ... + +if sys.version_info >= (3, 7): + class Spinbox(Entry): + def __init__(self, master: Any = ..., **kw: Any) -> None: ... + def set(self, value: Any) -> None: ... + +class Treeview(Widget, tkinter.XView, tkinter.YView): + def __init__(self, master: Optional[Any] = ..., **kw): ... + def bbox(self, item, column: Optional[Any] = ...): ... + def get_children(self, item: Optional[Any] = ...): ... + def set_children(self, item, *newchildren): ... + def column(self, column, option: Optional[Any] = ..., **kw): ... + def delete(self, *items): ... + def detach(self, *items): ... + def exists(self, item): ... + def focus(self, item: Optional[Any] = ...): ... + def heading(self, column, option: Optional[Any] = ..., **kw): ... + def identify(self, component, x, y): ... + def identify_row(self, y): ... + def identify_column(self, x): ... + def identify_region(self, x, y): ... + def identify_element(self, x, y): ... + def index(self, item): ... + def insert(self, parent, index, iid: Optional[Any] = ..., **kw): ... + def item(self, item, option: Optional[Any] = ..., **kw): ... + def move(self, item, parent, index): ... + reattach: Any + def next(self, item): ... + def parent(self, item): ... + def prev(self, item): ... + def see(self, item): ... + def selection(self, selop: Optional[Any] = ..., items: Optional[Any] = ...): ... + def selection_set(self, items): ... + def selection_add(self, items): ... + def selection_remove(self, items): ... + def selection_toggle(self, items): ... + def set(self, item, column: Optional[Any] = ..., value: Optional[Any] = ...): ... + def tag_bind(self, tagname, sequence: Optional[Any] = ..., callback: Optional[Any] = ...): ... + def tag_configure(self, tagname, option: Optional[Any] = ..., **kw): ... + def tag_has(self, tagname, item: Optional[Any] = ...): ... + +class LabeledScale(Frame): + label: Any + scale: Any + def __init__(self, master: Optional[Any] = ..., variable: Optional[Any] = ..., from_: int = ..., to: int = ..., **kw): ... + def destroy(self): ... + value: Any + +class OptionMenu(Menubutton): + def __init__(self, master, variable, default: Optional[Any] = ..., *values, **kwargs): ... + def __getitem__(self, item): ... + def set_menu(self, default: Optional[Any] = ..., *values): ... + def destroy(self): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/tokenize.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/tokenize.pyi new file mode 100644 index 0000000..33c8a2d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/tokenize.pyi @@ -0,0 +1,114 @@ +from typing import Any, Callable, Generator, Iterable, List, NamedTuple, Optional, Union, Sequence, TextIO, Tuple +from builtins import open as _builtin_open +import sys +from token import * # noqa: F403 + +COMMENT: int +NL: int +ENCODING: int + +_Position = Tuple[int, int] + +_TokenInfo = NamedTuple('TokenInfo', [ + ('type', int), + ('string', str), + ('start', _Position), + ('end', _Position), + ('line', str) +]) + +class TokenInfo(_TokenInfo): + @property + def exact_type(self) -> int: ... + +# Backwards compatible tokens can be sequences of a shorter length too +_Token = Union[TokenInfo, Sequence[Union[int, str, _Position]]] + +class TokenError(Exception): ... +class StopTokenizing(Exception): ... + +class Untokenizer: + tokens: List[str] + prev_row: int + prev_col: int + encoding: Optional[str] + def __init__(self) -> None: ... + def add_whitespace(self, start: _Position) -> None: ... + def untokenize(self, iterable: Iterable[_Token]) -> str: ... + def compat(self, token: Sequence[Union[int, str]], iterable: Iterable[_Token]) -> None: ... + +def untokenize(iterable: Iterable[_Token]) -> Any: ... +def detect_encoding(readline: Callable[[], bytes]) -> Tuple[str, Sequence[bytes]]: ... +def tokenize(readline: Callable[[], bytes]) -> Generator[TokenInfo, None, None]: ... +def generate_tokens(readline: Callable[[], str]) -> Generator[TokenInfo, None, None]: ... + +if sys.version_info >= (3, 6): + from os import PathLike + def open(filename: Union[str, bytes, int, PathLike]) -> TextIO: ... +else: + def open(filename: Union[str, bytes, int]) -> TextIO: ... + +# Names in __all__ with no definition: +# AMPER +# AMPEREQUAL +# ASYNC +# AT +# ATEQUAL +# AWAIT +# CIRCUMFLEX +# CIRCUMFLEXEQUAL +# COLON +# COMMA +# DEDENT +# DOT +# DOUBLESLASH +# DOUBLESLASHEQUAL +# DOUBLESTAR +# DOUBLESTAREQUAL +# ELLIPSIS +# ENDMARKER +# EQEQUAL +# EQUAL +# ERRORTOKEN +# GREATER +# GREATEREQUAL +# INDENT +# ISEOF +# ISNONTERMINAL +# ISTERMINAL +# LBRACE +# LEFTSHIFT +# LEFTSHIFTEQUAL +# LESS +# LESSEQUAL +# LPAR +# LSQB +# MINEQUAL +# MINUS +# NAME +# NEWLINE +# NOTEQUAL +# NT_OFFSET +# NUMBER +# N_TOKENS +# OP +# PERCENT +# PERCENTEQUAL +# PLUS +# PLUSEQUAL +# RARROW +# RBRACE +# RIGHTSHIFT +# RIGHTSHIFTEQUAL +# RPAR +# RSQB +# SEMI +# SLASH +# SLASHEQUAL +# STAR +# STAREQUAL +# STRING +# TILDE +# VBAR +# VBAREQUAL +# tok_name diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/tracemalloc.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/tracemalloc.pyi new file mode 100644 index 0000000..8758cc6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/tracemalloc.pyi @@ -0,0 +1,70 @@ +# Stubs for tracemalloc (Python 3.4+) + +import sys +from typing import List, Optional, Sequence, Tuple, Union, overload + +def clear_traces() -> None: ... +def get_object_traceback(obj: object) -> Optional[Traceback]: ... +def get_traceback_limit() -> int: ... +def get_traced_memory() -> Tuple[int, int]: ... +def get_tracemalloc_memory() -> int: ... +def is_tracing() -> bool: ... +def start(nframe: int = ...) -> None: ... +def stop() -> None: ... +def take_snapshot() -> Snapshot: ... + +if sys.version_info >= (3, 6): + class DomainFilter: + inclusive: bool + domain: int + def __init__(self, inclusive: bool, domain: int) -> None: ... + +class Filter: + if sys.version_info >= (3, 6): + domain: Optional[int] + inclusive: bool + lineno: Optional[int] + filename_pattern: str + all_frames: bool + def __init__(self, inclusive: bool, filename_pattern: str, lineno: Optional[int] = ..., all_frames: bool = ..., domain: Optional[int] = ...) -> None: ... + +class Frame: + filename: str + lineno: int + +class Snapshot: + def compare_to(self, old_snapshot: Snapshot, key_type: str, cumulative: bool = ...) -> List[StatisticDiff]: ... + def dump(self, filename: str) -> None: ... + if sys.version_info >= (3, 6): + def filter_traces(self, filters: Sequence[Union[DomainFilter, Filter]]) -> Snapshot: ... + else: + def filter_traces(self, filters: Sequence[Filter]) -> Snapshot: ... + @classmethod + def load(cls, filename: str) -> Snapshot: ... + def statistics(self, key_type: str, cumulative: bool = ...) -> List[Statistic]: ... + traceback_limit: int + traces: Sequence[Trace] + +class Statistic: + count: int + size: int + traceback: Traceback + +class StatisticDiff: + count: int + count_diff: int + size: int + size_diff: int + traceback: Traceback + +class Trace: + size: int + traceback: Traceback + +class Traceback(Sequence[Frame]): + def format(self, limit: Optional[int] = ...) -> List[str]: ... + @overload + def __getitem__(self, i: int) -> Frame: ... + @overload + def __getitem__(self, s: slice) -> Sequence[Frame]: ... + def __len__(self) -> int: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/types.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/types.pyi new file mode 100644 index 0000000..11ee600 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/types.pyi @@ -0,0 +1,208 @@ +# Stubs for types +# Note, all classes "defined" here require special handling. + +# TODO parts of this should be conditional on version + +import sys +from typing import ( + Any, Awaitable, Callable, Dict, Generic, Iterator, Mapping, Optional, Tuple, TypeVar, + Union, overload, Type +) + +# ModuleType is exported from this module, but for circular import +# reasons exists in its own stub file (with ModuleSpec and Loader). +from _importlib_modulespec import ModuleType as ModuleType # Exported + +_T = TypeVar('_T') +_T_co = TypeVar('_T_co', covariant=True) +_T_contra = TypeVar('_T_contra', contravariant=True) +_KT = TypeVar('_KT') +_VT = TypeVar('_VT') + +class _Cell: + cell_contents: Any + +class FunctionType: + __closure__: Optional[Tuple[_Cell, ...]] + __code__: CodeType + __defaults__: Optional[Tuple[Any, ...]] + __dict__: Dict[str, Any] + __globals__: Dict[str, Any] + __name__: str + __qualname__: str + __annotations__: Dict[str, Any] + __kwdefaults__: Dict[str, Any] + def __init__(self, code: CodeType, globals: Dict[str, Any], name: Optional[str] = ..., argdefs: Optional[Tuple[object, ...]] = ..., closure: Optional[Tuple[_Cell, ...]] = ...) -> None: ... + def __call__(self, *args: Any, **kwargs: Any) -> Any: ... + def __get__(self, obj: Optional[object], type: Optional[type]) -> MethodType: ... +LambdaType = FunctionType + +class CodeType: + """Create a code object. Not for the faint of heart.""" + co_argcount: int + co_kwonlyargcount: int + co_nlocals: int + co_stacksize: int + co_flags: int + co_code: bytes + co_consts: Tuple[Any, ...] + co_names: Tuple[str, ...] + co_varnames: Tuple[str, ...] + co_filename: str + co_name: str + co_firstlineno: int + co_lnotab: bytes + co_freevars: Tuple[str, ...] + co_cellvars: Tuple[str, ...] + def __init__( + self, + argcount: int, + kwonlyargcount: int, + nlocals: int, + stacksize: int, + flags: int, + codestring: bytes, + constants: Tuple[Any, ...], + names: Tuple[str, ...], + varnames: Tuple[str, ...], + filename: str, + name: str, + firstlineno: int, + lnotab: bytes, + freevars: Tuple[str, ...] = ..., + cellvars: Tuple[str, ...] = ..., + ) -> None: ... + +class MappingProxyType(Mapping[_KT, _VT], Generic[_KT, _VT]): + def __init__(self, mapping: Mapping[_KT, _VT]) -> None: ... + def __getitem__(self, k: _KT) -> _VT: ... + def __iter__(self) -> Iterator[_KT]: ... + def __len__(self) -> int: ... + def copy(self) -> Mapping[_KT, _VT]: ... + +class SimpleNamespace: + def __init__(self, **kwargs: Any) -> None: ... + def __getattribute__(self, name: str) -> Any: ... + def __setattr__(self, name: str, value: Any) -> None: ... + def __delattr__(self, name: str) -> None: ... + +class GeneratorType: + gi_code: CodeType + gi_frame: FrameType + gi_running: bool + gi_yieldfrom: Optional[GeneratorType] + def __iter__(self) -> GeneratorType: ... + def __next__(self) -> Any: ... + def close(self) -> None: ... + def send(self, arg: Any) -> Any: ... + @overload + def throw(self, val: BaseException) -> Any: ... + @overload + def throw(self, typ: type, val: BaseException = ..., tb: TracebackType = ...) -> Any: ... + +if sys.version_info >= (3, 6): + class AsyncGeneratorType(Generic[_T_co, _T_contra]): + ag_await: Optional[Awaitable[Any]] + ag_frame: FrameType + ag_running: bool + ag_code: CodeType + def __aiter__(self) -> Awaitable[AsyncGeneratorType[_T_co, _T_contra]]: ... + def __anext__(self) -> Awaitable[_T_co]: ... + def asend(self, val: _T_contra) -> Awaitable[_T_co]: ... + @overload + def athrow(self, val: BaseException) -> Awaitable[_T_co]: ... + @overload + def athrow(self, typ: Type[BaseException], val: BaseException, tb: TracebackType = ...) -> Awaitable[_T_co]: ... + def aclose(self) -> Awaitable[_T_co]: ... + +class CoroutineType: + cr_await: Optional[Any] + cr_code: CodeType + cr_frame: FrameType + cr_running: bool + def close(self) -> None: ... + def send(self, arg: Any) -> Any: ... + @overload + def throw(self, val: BaseException) -> Any: ... + @overload + def throw(self, typ: type, val: BaseException = ..., tb: TracebackType = ...) -> Any: ... + +class _StaticFunctionType: + """Fictional type to correct the type of MethodType.__func__. + + FunctionType is a descriptor, so mypy follows the descriptor protocol and + converts MethodType.__func__ back to MethodType (the return type of + FunctionType.__get__). But this is actually a special case; MethodType is + implemented in C and its attribute access doesn't go through + __getattribute__. + + By wrapping FunctionType in _StaticFunctionType, we get the right result; + similar to wrapping a function in staticmethod() at runtime to prevent it + being bound as a method. + """ + def __get__(self, obj: Optional[object], type: Optional[type]) -> FunctionType: ... + +class MethodType: + __func__: _StaticFunctionType + __self__: object + __name__: str + __qualname__: str + def __init__(self, func: Callable, obj: object) -> None: ... + def __call__(self, *args: Any, **kwargs: Any) -> Any: ... +class BuiltinFunctionType: + __self__: Union[object, ModuleType] + __name__: str + __qualname__: str + def __call__(self, *args: Any, **kwargs: Any) -> Any: ... +BuiltinMethodType = BuiltinFunctionType + +class TracebackType: + if sys.version_info >= (3, 7): + def __init__(self, tb_next: Optional[TracebackType], tb_frame: FrameType, tb_lasti: int, tb_lineno: int) -> None: ... + tb_next: Optional[TracebackType] + else: + @property + def tb_next(self) -> Optional[TracebackType]: ... + # the rest are read-only even in 3.7 + @property + def tb_frame(self) -> FrameType: ... + @property + def tb_lasti(self) -> int: ... + @property + def tb_lineno(self) -> int: ... + +class FrameType: + f_back: FrameType + f_builtins: Dict[str, Any] + f_code: CodeType + f_globals: Dict[str, Any] + f_lasti: int + f_lineno: int + f_locals: Dict[str, Any] + f_trace: Callable[[], None] + if sys.version_info >= (3, 7): + f_trace_lines: bool + f_trace_opcodes: bool + + def clear(self) -> None: ... + +class GetSetDescriptorType: + __name__: str + __objclass__: type + def __get__(self, obj: Any, type: type = ...) -> Any: ... + def __set__(self, obj: Any) -> None: ... + def __delete__(self, obj: Any) -> None: ... +class MemberDescriptorType: + __name__: str + __objclass__: type + def __get__(self, obj: Any, type: type = ...) -> Any: ... + def __set__(self, obj: Any) -> None: ... + def __delete__(self, obj: Any) -> None: ... + +def new_class(name: str, bases: Tuple[type, ...] = ..., kwds: Dict[str, Any] = ..., exec_body: Callable[[Dict[str, Any]], None] = ...) -> type: ... +def prepare_class(name: str, bases: Tuple[type, ...] = ..., kwds: Dict[str, Any] = ...) -> Tuple[type, Dict[str, Any], Dict[str, Any]]: ... + +# Actually a different type, but `property` is special and we want that too. +DynamicClassAttribute = property + +def coroutine(f: Callable[..., Any]) -> CoroutineType: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/typing.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/typing.pyi new file mode 100644 index 0000000..c99c1f9 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/typing.pyi @@ -0,0 +1,597 @@ +# Stubs for typing + +import sys +from abc import abstractmethod, ABCMeta +from types import CodeType, FrameType, TracebackType +import collections # Needed by aliases like DefaultDict, see mypy issue 2986 + +# Definitions of special type checking related constructs. Their definition +# are not used, so their value does not matter. + +overload = object() +Any = object() +TypeVar = object() +_promote = object() +no_type_check = object() + +class _SpecialForm: + def __getitem__(self, typeargs: Any) -> Any: ... + +Tuple: _SpecialForm = ... +Generic: _SpecialForm = ... +Protocol: _SpecialForm = ... +Callable: _SpecialForm = ... +Type: _SpecialForm = ... +ClassVar: _SpecialForm = ... + +class GenericMeta(type): ... + +# Return type that indicates a function does not return. +# This type is equivalent to the None type, but the no-op Union is necessary to +# distinguish the None type from the None value. +NoReturn = Union[None] + +# Type aliases and type constructors + +class TypeAlias: + # Class for defining generic aliases for library types. + def __init__(self, target_type: type) -> None: ... + def __getitem__(self, typeargs: Any) -> Any: ... + +Union = TypeAlias(object) +Optional = TypeAlias(object) +List = TypeAlias(object) +Dict = TypeAlias(object) +DefaultDict = TypeAlias(object) +Set = TypeAlias(object) +FrozenSet = TypeAlias(object) +Counter = TypeAlias(object) +Deque = TypeAlias(object) +ChainMap = TypeAlias(object) + +# Predefined type variables. +AnyStr = TypeVar('AnyStr', str, bytes) + +# Abstract base classes. + +# These type variables are used by the container types. +_T = TypeVar('_T') +_S = TypeVar('_S') +_KT = TypeVar('_KT') # Key type. +_VT = TypeVar('_VT') # Value type. +_T_co = TypeVar('_T_co', covariant=True) # Any type covariant containers. +_V_co = TypeVar('_V_co', covariant=True) # Any type covariant containers. +_KT_co = TypeVar('_KT_co', covariant=True) # Key type covariant containers. +_VT_co = TypeVar('_VT_co', covariant=True) # Value type covariant containers. +_T_contra = TypeVar('_T_contra', contravariant=True) # Ditto contravariant. +_TC = TypeVar('_TC', bound=Type[object]) +_C = TypeVar("_C", bound=Callable) + +def runtime(cls: _TC) -> _TC: ... + +@runtime +class SupportsInt(Protocol, metaclass=ABCMeta): + @abstractmethod + def __int__(self) -> int: ... + +@runtime +class SupportsFloat(Protocol, metaclass=ABCMeta): + @abstractmethod + def __float__(self) -> float: ... + +@runtime +class SupportsComplex(Protocol, metaclass=ABCMeta): + @abstractmethod + def __complex__(self) -> complex: ... + +@runtime +class SupportsBytes(Protocol, metaclass=ABCMeta): + @abstractmethod + def __bytes__(self) -> bytes: ... + +@runtime +class SupportsAbs(Protocol[_T_co]): + @abstractmethod + def __abs__(self) -> _T_co: ... + +@runtime +class SupportsRound(Protocol[_T_co]): + @overload + @abstractmethod + def __round__(self) -> int: ... + @overload + @abstractmethod + def __round__(self, ndigits: int) -> _T_co: ... + +@runtime +class Reversible(Protocol[_T_co]): + @abstractmethod + def __reversed__(self) -> Iterator[_T_co]: ... + +@runtime +class Sized(Protocol, metaclass=ABCMeta): + @abstractmethod + def __len__(self) -> int: ... + +@runtime +class Hashable(Protocol, metaclass=ABCMeta): + # TODO: This is special, in that a subclass of a hashable class may not be hashable + # (for example, list vs. object). It's not obvious how to represent this. This class + # is currently mostly useless for static checking. + @abstractmethod + def __hash__(self) -> int: ... + +@runtime +class Iterable(Protocol[_T_co]): + @abstractmethod + def __iter__(self) -> Iterator[_T_co]: ... + +@runtime +class Iterator(Iterable[_T_co], Protocol[_T_co]): + @abstractmethod + def __next__(self) -> _T_co: ... + def __iter__(self) -> Iterator[_T_co]: ... + +class Generator(Iterator[_T_co], Generic[_T_co, _T_contra, _V_co]): + @abstractmethod + def __next__(self) -> _T_co: ... + + @abstractmethod + def send(self, value: _T_contra) -> _T_co: ... + + @abstractmethod + def throw(self, typ: Type[BaseException], val: Optional[BaseException] = ..., + tb: Optional[TracebackType] = ...) -> _T_co: ... + + @abstractmethod + def close(self) -> None: ... + + @abstractmethod + def __iter__(self) -> Generator[_T_co, _T_contra, _V_co]: ... + + @property + def gi_code(self) -> CodeType: ... + @property + def gi_frame(self) -> FrameType: ... + @property + def gi_running(self) -> bool: ... + @property + def gi_yieldfrom(self) -> Optional[Generator]: ... + +# TODO: Several types should only be defined if sys.python_version >= (3, 5): +# Awaitable, AsyncIterator, AsyncIterable, Coroutine, Collection. +# See https: //github.com/python/typeshed/issues/655 for why this is not easy. + +@runtime +class Awaitable(Protocol[_T_co]): + @abstractmethod + def __await__(self) -> Generator[Any, None, _T_co]: ... + +class Coroutine(Awaitable[_V_co], Generic[_T_co, _T_contra, _V_co]): + @property + def cr_await(self) -> Optional[Any]: ... + @property + def cr_code(self) -> CodeType: ... + @property + def cr_frame(self) -> FrameType: ... + @property + def cr_running(self) -> bool: ... + + @abstractmethod + def send(self, value: _T_contra) -> _T_co: ... + + @abstractmethod + def throw(self, typ: Type[BaseException], val: Optional[BaseException] = ..., + tb: Optional[TracebackType] = ...) -> _T_co: ... + + @abstractmethod + def close(self) -> None: ... + + +# NOTE: This type does not exist in typing.py or PEP 484. +# The parameters correspond to Generator, but the 4th is the original type. +class AwaitableGenerator(Awaitable[_V_co], Generator[_T_co, _T_contra, _V_co], + Generic[_T_co, _T_contra, _V_co, _S], metaclass=ABCMeta): ... + +@runtime +class AsyncIterable(Protocol[_T_co]): + @abstractmethod + def __aiter__(self) -> AsyncIterator[_T_co]: ... + +@runtime +class AsyncIterator(AsyncIterable[_T_co], + Protocol[_T_co]): + @abstractmethod + def __anext__(self) -> Awaitable[_T_co]: ... + def __aiter__(self) -> AsyncIterator[_T_co]: ... + +if sys.version_info >= (3, 6): + class AsyncGenerator(AsyncIterator[_T_co], Generic[_T_co, _T_contra]): + @abstractmethod + def __anext__(self) -> Awaitable[_T_co]: ... + + @abstractmethod + def asend(self, value: _T_contra) -> Awaitable[_T_co]: ... + + @abstractmethod + def athrow(self, typ: Type[BaseException], val: Optional[BaseException] = ..., + tb: Any = ...) -> Awaitable[_T_co]: ... + + @abstractmethod + def aclose(self) -> Awaitable[None]: ... + + @abstractmethod + def __aiter__(self) -> AsyncGenerator[_T_co, _T_contra]: ... + + @property + def ag_await(self) -> Any: ... + @property + def ag_code(self) -> CodeType: ... + @property + def ag_frame(self) -> FrameType: ... + @property + def ag_running(self) -> bool: ... + +@runtime +class Container(Protocol[_T_co]): + @abstractmethod + def __contains__(self, __x: object) -> bool: ... + + +if sys.version_info >= (3, 6): + @runtime + class Collection(Iterable[_T_co], Container[_T_co], Protocol[_T_co]): + # Implement Sized (but don't have it as a base class). + @abstractmethod + def __len__(self) -> int: ... + + _Collection = Collection +else: + @runtime + class _Collection(Iterable[_T_co], Container[_T_co], Protocol[_T_co]): + # Implement Sized (but don't have it as a base class). + @abstractmethod + def __len__(self) -> int: ... + +class Sequence(_Collection[_T_co], Reversible[_T_co], Generic[_T_co]): + @overload + @abstractmethod + def __getitem__(self, i: int) -> _T_co: ... + @overload + @abstractmethod + def __getitem__(self, s: slice) -> Sequence[_T_co]: ... + # Mixin methods + if sys.version_info >= (3, 5): + def index(self, x: Any, start: int = ..., end: int = ...) -> int: ... + else: + def index(self, x: Any) -> int: ... + def count(self, x: Any) -> int: ... + def __contains__(self, x: object) -> bool: ... + def __iter__(self) -> Iterator[_T_co]: ... + def __reversed__(self) -> Iterator[_T_co]: ... + +class MutableSequence(Sequence[_T], Generic[_T]): + @abstractmethod + def insert(self, index: int, object: _T) -> None: ... + @overload + @abstractmethod + def __getitem__(self, i: int) -> _T: ... + @overload + @abstractmethod + def __getitem__(self, s: slice) -> MutableSequence[_T]: ... + @overload + @abstractmethod + def __setitem__(self, i: int, o: _T) -> None: ... + @overload + @abstractmethod + def __setitem__(self, s: slice, o: Iterable[_T]) -> None: ... + @overload + @abstractmethod + def __delitem__(self, i: int) -> None: ... + @overload + @abstractmethod + def __delitem__(self, i: slice) -> None: ... + # Mixin methods + def append(self, object: _T) -> None: ... + def clear(self) -> None: ... + def extend(self, iterable: Iterable[_T]) -> None: ... + def reverse(self) -> None: ... + def pop(self, index: int = ...) -> _T: ... + def remove(self, object: _T) -> None: ... + def __iadd__(self, x: Iterable[_T]) -> MutableSequence[_T]: ... + +class AbstractSet(_Collection[_T_co], Generic[_T_co]): + @abstractmethod + def __contains__(self, x: object) -> bool: ... + # Mixin methods + def __le__(self, s: AbstractSet[Any]) -> bool: ... + def __lt__(self, s: AbstractSet[Any]) -> bool: ... + def __gt__(self, s: AbstractSet[Any]) -> bool: ... + def __ge__(self, s: AbstractSet[Any]) -> bool: ... + def __and__(self, s: AbstractSet[Any]) -> AbstractSet[_T_co]: ... + def __or__(self, s: AbstractSet[_T]) -> AbstractSet[Union[_T_co, _T]]: ... + def __sub__(self, s: AbstractSet[Any]) -> AbstractSet[_T_co]: ... + def __xor__(self, s: AbstractSet[_T]) -> AbstractSet[Union[_T_co, _T]]: ... + # TODO: Argument can be a more general ABC? + def isdisjoint(self, s: AbstractSet[Any]) -> bool: ... + +class MutableSet(AbstractSet[_T], Generic[_T]): + @abstractmethod + def add(self, x: _T) -> None: ... + @abstractmethod + def discard(self, x: _T) -> None: ... + # Mixin methods + def clear(self) -> None: ... + def pop(self) -> _T: ... + def remove(self, element: _T) -> None: ... + def __ior__(self, s: AbstractSet[_S]) -> MutableSet[Union[_T, _S]]: ... + def __iand__(self, s: AbstractSet[Any]) -> MutableSet[_T]: ... + def __ixor__(self, s: AbstractSet[_S]) -> MutableSet[Union[_T, _S]]: ... + def __isub__(self, s: AbstractSet[Any]) -> MutableSet[_T]: ... + +class MappingView: + def __len__(self) -> int: ... + +class ItemsView(MappingView, AbstractSet[Tuple[_KT_co, _VT_co]], Generic[_KT_co, _VT_co]): + def __and__(self, o: Iterable[_T]) -> AbstractSet[Union[Tuple[_KT_co, _VT_co], _T]]: ... + def __contains__(self, o: object) -> bool: ... + def __iter__(self) -> Iterator[Tuple[_KT_co, _VT_co]]: ... + def __or__(self, o: Iterable[_T]) -> AbstractSet[Union[Tuple[_KT_co, _VT_co], _T]]: ... + def __xor__(self, o: Iterable[_T]) -> AbstractSet[Union[Tuple[_KT_co, _VT_co], _T]]: ... + +class KeysView(MappingView, AbstractSet[_KT_co], Generic[_KT_co]): + def __and__(self, o: Iterable[_T]) -> AbstractSet[Union[_KT_co, _T]]: ... + def __contains__(self, o: object) -> bool: ... + def __iter__(self) -> Iterator[_KT_co]: ... + def __or__(self, o: Iterable[_T]) -> AbstractSet[Union[_KT_co, _T]]: ... + def __xor__(self, o: Iterable[_T]) -> AbstractSet[Union[_KT_co, _T]]: ... + +class ValuesView(MappingView, Iterable[_VT_co], Generic[_VT_co]): + def __contains__(self, o: object) -> bool: ... + def __iter__(self) -> Iterator[_VT_co]: ... + +@runtime +class ContextManager(Protocol[_T_co]): + def __enter__(self) -> _T_co: ... + def __exit__(self, __exc_type: Optional[Type[BaseException]], + __exc_value: Optional[BaseException], + __traceback: Optional[TracebackType]) -> Optional[bool]: ... + +if sys.version_info >= (3, 5): + @runtime + class AsyncContextManager(Protocol[_T_co]): + def __aenter__(self) -> Awaitable[_T_co]: ... + def __aexit__(self, exc_type: Optional[Type[BaseException]], + exc_value: Optional[BaseException], + traceback: Optional[TracebackType]) -> Awaitable[Optional[bool]]: ... + +class Mapping(_Collection[_KT], Generic[_KT, _VT_co]): + # TODO: We wish the key type could also be covariant, but that doesn't work, + # see discussion in https: //github.com/python/typing/pull/273. + @abstractmethod + def __getitem__(self, k: _KT) -> _VT_co: + ... + # Mixin methods + @overload + def get(self, k: _KT) -> Optional[_VT_co]: ... + @overload + def get(self, k: _KT, default: Union[_VT_co, _T]) -> Union[_VT_co, _T]: ... + def items(self) -> AbstractSet[Tuple[_KT, _VT_co]]: ... + def keys(self) -> AbstractSet[_KT]: ... + def values(self) -> ValuesView[_VT_co]: ... + def __contains__(self, o: object) -> bool: ... + +class MutableMapping(Mapping[_KT, _VT], Generic[_KT, _VT]): + @abstractmethod + def __setitem__(self, k: _KT, v: _VT) -> None: ... + @abstractmethod + def __delitem__(self, v: _KT) -> None: ... + + def clear(self) -> None: ... + @overload + def pop(self, k: _KT) -> _VT: ... + @overload + def pop(self, k: _KT, default: Union[_VT, _T] = ...) -> Union[_VT, _T]: ... + def popitem(self) -> Tuple[_KT, _VT]: ... + def setdefault(self, k: _KT, default: _VT = ...) -> _VT: ... + # 'update' used to take a Union, but using overloading is better. + # The second overloaded type here is a bit too general, because + # Mapping[Tuple[_KT, _VT], W] is a subclass of Iterable[Tuple[_KT, _VT]], + # but will always have the behavior of the first overloaded type + # at runtime, leading to keys of a mix of types _KT and Tuple[_KT, _VT]. + # We don't currently have any way of forcing all Mappings to use + # the first overload, but by using overloading rather than a Union, + # mypy will commit to using the first overload when the argument is + # known to be a Mapping with unknown type parameters, which is closer + # to the behavior we want. See mypy issue #1430. + @overload + def update(self, __m: Mapping[_KT, _VT], **kwargs: _VT) -> None: ... + @overload + def update(self, __m: Iterable[Tuple[_KT, _VT]], **kwargs: _VT) -> None: ... + @overload + def update(self, **kwargs: _VT) -> None: ... + +Text = str + +TYPE_CHECKING = True + +class IO(Iterator[AnyStr], Generic[AnyStr]): + # TODO detach + # TODO use abstract properties + @property + def mode(self) -> str: ... + @property + def name(self) -> str: ... + @abstractmethod + def close(self) -> None: ... + @property + def closed(self) -> bool: ... + @abstractmethod + def fileno(self) -> int: ... + @abstractmethod + def flush(self) -> None: ... + @abstractmethod + def isatty(self) -> bool: ... + # TODO what if n is None? + @abstractmethod + def read(self, n: int = ...) -> AnyStr: ... + @abstractmethod + def readable(self) -> bool: ... + @abstractmethod + def readline(self, limit: int = ...) -> AnyStr: ... + @abstractmethod + def readlines(self, hint: int = ...) -> list[AnyStr]: ... + @abstractmethod + def seek(self, offset: int, whence: int = ...) -> int: ... + @abstractmethod + def seekable(self) -> bool: ... + @abstractmethod + def tell(self) -> int: ... + @abstractmethod + def truncate(self, size: Optional[int] = ...) -> int: ... + @abstractmethod + def writable(self) -> bool: ... + # TODO buffer objects + @abstractmethod + def write(self, s: AnyStr) -> int: ... + @abstractmethod + def writelines(self, lines: Iterable[AnyStr]) -> None: ... + + @abstractmethod + def __next__(self) -> AnyStr: ... + @abstractmethod + def __iter__(self) -> Iterator[AnyStr]: ... + @abstractmethod + def __enter__(self) -> IO[AnyStr]: ... + @abstractmethod + def __exit__(self, t: Optional[Type[BaseException]], value: Optional[BaseException], + traceback: Optional[TracebackType]) -> bool: ... + +class BinaryIO(IO[bytes]): + # TODO readinto + # TODO read1? + # TODO peek? + @overload + @abstractmethod + def write(self, s: bytearray) -> int: ... + @overload + @abstractmethod + def write(self, s: bytes) -> int: ... + + @abstractmethod + def __enter__(self) -> BinaryIO: ... + +class TextIO(IO[str]): + # TODO use abstractproperty + @property + def buffer(self) -> BinaryIO: ... + @property + def encoding(self) -> str: ... + @property + def errors(self) -> Optional[str]: ... + @property + def line_buffering(self) -> int: ... # int on PyPy, bool on CPython + @property + def newlines(self) -> Any: ... # None, str or tuple + @abstractmethod + def __enter__(self) -> TextIO: ... + +class ByteString(Sequence[int], metaclass=ABCMeta): ... + +class Match(Generic[AnyStr]): + pos = 0 + endpos = 0 + lastindex = 0 + lastgroup: AnyStr + string: AnyStr + + # The regular expression object whose match() or search() method produced + # this match instance. + re: Pattern[AnyStr] + + def expand(self, template: AnyStr) -> AnyStr: ... + + @overload + def group(self, group1: int = ...) -> AnyStr: ... + @overload + def group(self, group1: str) -> AnyStr: ... + @overload + def group(self, group1: int, group2: int, + *groups: int) -> Sequence[AnyStr]: ... + @overload + def group(self, group1: str, group2: str, + *groups: str) -> Sequence[AnyStr]: ... + + def groups(self, default: AnyStr = ...) -> Sequence[AnyStr]: ... + def groupdict(self, default: AnyStr = ...) -> dict[str, AnyStr]: ... + def start(self, group: Union[int, str] = ...) -> int: ... + def end(self, group: Union[int, str] = ...) -> int: ... + def span(self, group: Union[int, str] = ...) -> Tuple[int, int]: ... + if sys.version_info >= (3, 6): + def __getitem__(self, g: Union[int, str]) -> AnyStr: ... + +class Pattern(Generic[AnyStr]): + flags = 0 + groupindex: Mapping[str, int] + groups = 0 + pattern: AnyStr + + def search(self, string: AnyStr, pos: int = ..., + endpos: int = ...) -> Optional[Match[AnyStr]]: ... + def match(self, string: AnyStr, pos: int = ..., + endpos: int = ...) -> Optional[Match[AnyStr]]: ... + # New in Python 3.4 + def fullmatch(self, string: AnyStr, pos: int = ..., + endpos: int = ...) -> Optional[Match[AnyStr]]: ... + def split(self, string: AnyStr, maxsplit: int = ...) -> list[AnyStr]: ... + def findall(self, string: AnyStr, pos: int = ..., + endpos: int = ...) -> list[Any]: ... + def finditer(self, string: AnyStr, pos: int = ..., + endpos: int = ...) -> Iterator[Match[AnyStr]]: ... + + @overload + def sub(self, repl: AnyStr, string: AnyStr, + count: int = ...) -> AnyStr: ... + @overload + def sub(self, repl: Callable[[Match[AnyStr]], AnyStr], string: AnyStr, + count: int = ...) -> AnyStr: ... + + @overload + def subn(self, repl: AnyStr, string: AnyStr, + count: int = ...) -> Tuple[AnyStr, int]: ... + @overload + def subn(self, repl: Callable[[Match[AnyStr]], AnyStr], string: AnyStr, + count: int = ...) -> Tuple[AnyStr, int]: ... + +# Functions + +def get_type_hints(obj: Callable, globalns: Optional[dict[str, Any]] = ..., + localns: Optional[dict[str, Any]] = ...) -> dict[str, Any]: ... + +@overload +def cast(tp: Type[_T], obj: Any) -> _T: ... +@overload +def cast(tp: str, obj: Any) -> Any: ... + +# Type constructors + +# NamedTuple is special-cased in the type checker +class NamedTuple(tuple): + _field_types: collections.OrderedDict[str, Type[Any]] + _field_defaults: Dict[str, Any] = ... + _fields: Tuple[str, ...] + _source: str + + def __init__(self, typename: str, fields: Iterable[Tuple[str, Any]] = ..., *, + verbose: bool = ..., rename: bool = ..., **kwargs: Any) -> None: ... + + @classmethod + def _make(cls: Type[_T], iterable: Iterable[Any]) -> _T: ... + + def _asdict(self) -> collections.OrderedDict[str, Any]: ... + def _replace(self: _T, **kwargs: Any) -> _T: ... + +def NewType(name: str, tp: Type[_T]) -> Type[_T]: ... + +# This itself is only available during type checking +def type_check_only(func_or_cls: _C) -> _C: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/unittest/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/unittest/__init__.pyi new file mode 100644 index 0000000..3ed602c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/unittest/__init__.pyi @@ -0,0 +1,31 @@ +# Stubs for unittest + +from typing import Iterable, List, Optional, Type, Union +from types import ModuleType + +from unittest.case import * +from unittest.loader import * +from unittest.result import * +from unittest.runner import * +from unittest.signals import * +from unittest.suite import * + + +# not really documented +class TestProgram: + result: TestResult + def runTests(self) -> None: ... # undocumented + + +def main(module: Union[None, str, ModuleType] = ..., + defaultTest: Union[str, Iterable[str], None] = ..., + argv: Optional[List[str]] = ..., + testRunner: Union[Type[TestRunner], TestRunner, None] = ..., + testLoader: TestLoader = ..., exit: bool = ..., verbosity: int = ..., + failfast: Optional[bool] = ..., catchbreak: Optional[bool] = ..., + buffer: Optional[bool] = ..., + warnings: Optional[str] = ...) -> TestProgram: ... + + +def load_tests(loader: TestLoader, tests: TestSuite, + pattern: Optional[str]) -> TestSuite: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/unittest/case.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/unittest/case.pyi new file mode 100644 index 0000000..f71e5e4 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/unittest/case.pyi @@ -0,0 +1,224 @@ +from typing import ( + Any, AnyStr, Callable, Container, ContextManager, Dict, FrozenSet, Generic, + Iterable, List, NoReturn, Optional, overload, Pattern, Sequence, Set, + Tuple, Type, TypeVar, Union, +) +import logging +import unittest.result +from types import TracebackType + + +_E = TypeVar('_E', bound=BaseException) +_FT = TypeVar('_FT', bound=Callable[..., Any]) + + +def expectedFailure(func: _FT) -> _FT: ... +def skip(reason: str) -> Callable[[_FT], _FT]: ... +def skipIf(condition: object, reason: str) -> Callable[[_FT], _FT]: ... +def skipUnless(condition: object, reason: str) -> Callable[[_FT], _FT]: ... + + +class SkipTest(Exception): + def __init__(self, reason: str) -> None: ... + + +class TestCase: + failureException: Type[BaseException] + longMessage: bool + maxDiff: Optional[int] + # undocumented + _testMethodName: str + # undocumented + _testMethodDoc: str + def __init__(self, methodName: str = ...) -> None: ... + def setUp(self) -> None: ... + def tearDown(self) -> None: ... + @classmethod + def setUpClass(cls) -> None: ... + @classmethod + def tearDownClass(cls) -> None: ... + def run(self, result: Optional[unittest.result.TestResult] = ...) -> Optional[unittest.result.TestResult]: ... + def __call__(self, result: Optional[unittest.result.TestResult] = ...) -> Optional[unittest.result.TestResult]: ... + def skipTest(self, reason: Any) -> None: ... + def subTest(self, msg: Any = ..., **params: Any) -> ContextManager[None]: ... + def debug(self) -> None: ... + def _addSkip( + self, result: unittest.result.TestResult, test_case: unittest.case.TestCase, reason: str + ) -> None: ... + def assertEqual(self, first: Any, second: Any, msg: Any = ...) -> None: ... + def assertNotEqual(self, first: Any, second: Any, + msg: Any = ...) -> None: ... + def assertTrue(self, expr: Any, msg: Any = ...) -> None: ... + def assertFalse(self, expr: Any, msg: Any = ...) -> None: ... + def assertIs(self, expr1: Any, expr2: Any, msg: Any = ...) -> None: ... + def assertIsNot(self, expr1: Any, expr2: Any, msg: Any = ...) -> None: ... + def assertIsNone(self, obj: Any, msg: Any = ...) -> None: ... + def assertIsNotNone(self, obj: Any, msg: Any = ...) -> None: ... + def assertIn(self, member: Any, + container: Union[Iterable[Any], Container[Any]], + msg: Any = ...) -> None: ... + def assertNotIn(self, member: Any, + container: Union[Iterable[Any], Container[Any]], + msg: Any = ...) -> None: ... + def assertIsInstance(self, obj: Any, + cls: Union[type, Tuple[type, ...]], + msg: Any = ...) -> None: ... + def assertNotIsInstance(self, obj: Any, + cls: Union[type, Tuple[type, ...]], + msg: Any = ...) -> None: ... + def assertGreater(self, a: Any, b: Any, msg: Any = ...) -> None: ... + def assertGreaterEqual(self, a: Any, b: Any, msg: Any = ...) -> None: ... + def assertLess(self, a: Any, b: Any, msg: Any = ...) -> None: ... + def assertLessEqual(self, a: Any, b: Any, msg: Any = ...) -> None: ... + @overload + def assertRaises(self, # type: ignore + expected_exception: Union[Type[BaseException], Tuple[Type[BaseException], ...]], + callable: Callable[..., Any], + *args: Any, **kwargs: Any) -> None: ... + @overload + def assertRaises(self, + expected_exception: Union[Type[_E], Tuple[Type[_E], ...]], + msg: Any = ...) -> _AssertRaisesContext[_E]: ... + @overload + def assertRaisesRegex(self, # type: ignore + expected_exception: Union[Type[BaseException], Tuple[Type[BaseException], ...]], + expected_regex: Union[str, bytes, Pattern[str], Pattern[bytes]], + callable: Callable[..., Any], + *args: Any, **kwargs: Any) -> None: ... + @overload + def assertRaisesRegex(self, + expected_exception: Union[Type[_E], Tuple[Type[_E], ...]], + expected_regex: Union[str, bytes, Pattern[str], Pattern[bytes]], + msg: Any = ...) -> _AssertRaisesContext[_E]: ... + @overload + def assertWarns(self, # type: ignore + expected_warning: Union[Type[Warning], Tuple[Type[Warning], ...]], + callable: Callable[..., Any], + *args: Any, **kwargs: Any) -> None: ... + @overload + def assertWarns(self, + expected_warning: Union[Type[Warning], Tuple[Type[Warning], ...]], + msg: Any = ...) -> _AssertWarnsContext: ... + @overload + def assertWarnsRegex(self, # type: ignore + expected_warning: Union[Type[Warning], Tuple[Type[Warning], ...]], + expected_regex: Union[str, bytes, Pattern[str], Pattern[bytes]], + callable: Callable[..., Any], + *args: Any, **kwargs: Any) -> None: ... + @overload + def assertWarnsRegex(self, + expected_warning: Union[Type[Warning], Tuple[Type[Warning], ...]], + expected_regex: Union[str, bytes, Pattern[str], Pattern[bytes]], + msg: Any = ...) -> _AssertWarnsContext: ... + def assertLogs( + self, logger: Optional[logging.Logger] = ..., + level: Union[int, str, None] = ... + ) -> _AssertLogsContext: ... + def assertAlmostEqual(self, first: float, second: float, places: int = ..., + msg: Any = ..., delta: float = ...) -> None: ... + @overload + def assertNotAlmostEqual(self, first: float, second: float, *, + msg: Any = ...) -> None: ... + @overload + def assertNotAlmostEqual(self, first: float, second: float, + places: int = ..., msg: Any = ...) -> None: ... + @overload + def assertNotAlmostEqual(self, first: float, second: float, *, + msg: Any = ..., delta: float = ...) -> None: ... + def assertRegex(self, text: AnyStr, expected_regex: Union[AnyStr, Pattern[AnyStr]], + msg: Any = ...) -> None: ... + def assertNotRegex(self, text: AnyStr, unexpected_regex: Union[AnyStr, Pattern[AnyStr]], + msg: Any = ...) -> None: ... + def assertCountEqual(self, first: Iterable[Any], second: Iterable[Any], + msg: Any = ...) -> None: ... + def addTypeEqualityFunc(self, typeobj: Type[Any], + function: Callable[..., None]) -> None: ... + def assertMultiLineEqual(self, first: str, second: str, + msg: Any = ...) -> None: ... + def assertSequenceEqual(self, seq1: Sequence[Any], seq2: Sequence[Any], + msg: Any = ..., + seq_type: Type[Sequence[Any]] = ...) -> None: ... + def assertListEqual(self, list1: List[Any], list2: List[Any], + msg: Any = ...) -> None: ... + def assertTupleEqual(self, tuple1: Tuple[Any, ...], tuple2: Tuple[Any, ...], + msg: Any = ...) -> None: ... + def assertSetEqual(self, set1: Union[Set[Any], FrozenSet[Any]], + set2: Union[Set[Any], FrozenSet[Any]], msg: Any = ...) -> None: ... + def assertDictEqual(self, d1: Dict[Any, Any], d2: Dict[Any, Any], + msg: Any = ...) -> None: ... + def fail(self, msg: Any = ...) -> NoReturn: ... + def countTestCases(self) -> int: ... + def defaultTestResult(self) -> unittest.result.TestResult: ... + def id(self) -> str: ... + def shortDescription(self) -> Optional[str]: ... + def addCleanup(self, function: Callable[..., Any], *args: Any, + **kwargs: Any) -> None: ... + def doCleanups(self) -> None: ... + def _formatMessage(self, msg: Optional[str], standardMsg: str) -> str: ... # undocumented + def _getAssertEqualityFunc(self, first: Any, second: Any) -> Callable[..., None]: ... # undocumented + # below is deprecated + def failUnlessEqual(self, first: Any, second: Any, + msg: Any = ...) -> None: ... + def assertEquals(self, first: Any, second: Any, msg: Any = ...) -> None: ... + def failIfEqual(self, first: Any, second: Any, msg: Any = ...) -> None: ... + def assertNotEquals(self, first: Any, second: Any, + msg: Any = ...) -> None: ... + def failUnless(self, expr: bool, msg: Any = ...) -> None: ... + def assert_(self, expr: bool, msg: Any = ...) -> None: ... + def failIf(self, expr: bool, msg: Any = ...) -> None: ... + @overload + def failUnlessRaises(self, # type: ignore + exception: Union[Type[BaseException], Tuple[Type[BaseException], ...]], + callable: Callable[..., Any] = ..., + *args: Any, **kwargs: Any) -> None: ... + @overload + def failUnlessRaises(self, + exception: Union[Type[_E], Tuple[Type[_E], ...]], + msg: Any = ...) -> _AssertRaisesContext[_E]: ... + def failUnlessAlmostEqual(self, first: float, second: float, + places: int = ..., msg: Any = ...) -> None: ... + def assertAlmostEquals(self, first: float, second: float, places: int = ..., + msg: Any = ..., delta: float = ...) -> None: ... + def failIfAlmostEqual(self, first: float, second: float, places: int = ..., + msg: Any = ...) -> None: ... + def assertNotAlmostEquals(self, first: float, second: float, + places: int = ..., msg: Any = ..., + delta: float = ...) -> None: ... + def assertRegexpMatches(self, text: AnyStr, regex: Union[AnyStr, Pattern[AnyStr]], + msg: Any = ...) -> None: ... + @overload + def assertRaisesRegexp(self, # type: ignore + exception: Union[Type[BaseException], Tuple[Type[BaseException], ...]], + callable: Callable[..., Any] = ..., + *args: Any, **kwargs: Any) -> None: ... + @overload + def assertRaisesRegexp(self, + exception: Union[Type[_E], Tuple[Type[_E], ...]], + msg: Any = ...) -> _AssertRaisesContext[_E]: ... + +class FunctionTestCase(TestCase): + def __init__(self, testFunc: Callable[[], None], + setUp: Optional[Callable[[], None]] = ..., + tearDown: Optional[Callable[[], None]] = ..., + description: Optional[str] = ...) -> None: ... + +class _AssertRaisesContext(Generic[_E]): + exception: _E + def __enter__(self) -> _AssertRaisesContext[_E]: ... + def __exit__(self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], + exc_tb: Optional[TracebackType]) -> bool: ... + +class _AssertWarnsContext: + warning: Warning + filename: str + lineno: int + def __enter__(self) -> _AssertWarnsContext: ... + def __exit__(self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], + exc_tb: Optional[TracebackType]) -> bool: ... + +class _AssertLogsContext: + records: List[logging.LogRecord] + output: List[str] + def __enter__(self) -> _AssertLogsContext: ... + def __exit__(self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], + exc_tb: Optional[TracebackType]) -> bool: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/unittest/loader.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/unittest/loader.pyi new file mode 100644 index 0000000..53b81ad --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/unittest/loader.pyi @@ -0,0 +1,32 @@ +import sys +import unittest.case +import unittest.suite +import unittest.result +from types import ModuleType +from typing import Any, Callable, List, Optional, Sequence, Type + + +class TestLoader: + if sys.version_info >= (3, 5): + errors: List[Type[BaseException]] + testMethodPrefix: str + sortTestMethodsUsing: Callable[[str, str], bool] + suiteClass: Callable[[List[unittest.case.TestCase]], unittest.suite.TestSuite] + def loadTestsFromTestCase(self, + testCaseClass: Type[unittest.case.TestCase]) -> unittest.suite.TestSuite: ... + if sys.version_info >= (3, 5): + def loadTestsFromModule(self, module: ModuleType, + *, pattern: Any = ...) -> unittest.suite.TestSuite: ... + else: + def loadTestsFromModule(self, + module: ModuleType) -> unittest.suite.TestSuite: ... + def loadTestsFromName(self, name: str, + module: Optional[ModuleType] = ...) -> unittest.suite.TestSuite: ... + def loadTestsFromNames(self, names: Sequence[str], + module: Optional[ModuleType] = ...) -> unittest.suite.TestSuite: ... + def getTestCaseNames(self, + testCaseClass: Type[unittest.case.TestCase]) -> Sequence[str]: ... + def discover(self, start_dir: str, pattern: str = ..., + top_level_dir: Optional[str] = ...) -> unittest.suite.TestSuite: ... + +defaultTestLoader: TestLoader diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/unittest/mock.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/unittest/mock.pyi new file mode 100644 index 0000000..cb3db61 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/unittest/mock.pyi @@ -0,0 +1,146 @@ +# Stubs for mock + +import sys +from typing import Any, Optional, Text, Type + +FILTER_DIR: Any + +class _slotted: ... + +class _SentinelObject: + name: Any + def __init__(self, name: Any) -> None: ... + +class _Sentinel: + def __init__(self) -> None: ... + def __getattr__(self, name: str) -> Any: ... + +sentinel: Any +DEFAULT: Any + +class _CallList(list): + def __contains__(self, value: Any) -> bool: ... + +class _MockIter: + obj: Any + def __init__(self, obj: Any) -> None: ... + def __iter__(self) -> Any: ... + def __next__(self) -> Any: ... + +class Base: + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + +# TODO: Defining this and other mock classes as classes in this stub causes +# many false positives with mypy and production code. See if we can +# improve mypy somehow and use a class with an "Any" base class. +NonCallableMock: Any + +class CallableMixin(Base): + side_effect: Any + def __init__(self, spec: Optional[Any] = ..., side_effect: Optional[Any] = ..., return_value: Any = ..., wraps: Optional[Any] = ..., name: Optional[Any] = ..., spec_set: Optional[Any] = ..., parent: Optional[Any] = ..., _spec_state: Optional[Any] = ..., _new_name: Any = ..., _new_parent: Optional[Any] = ..., **kwargs: Any) -> None: ... + def __call__(_mock_self, *args: Any, **kwargs: Any) -> Any: ... + +Mock: Any + +class _patch: + attribute_name: Any + getter: Any + attribute: Any + new: Any + new_callable: Any + spec: Any + create: bool + has_local: Any + spec_set: Any + autospec: Any + kwargs: Any + additional_patchers: Any + def __init__(self, getter: Any, attribute: Any, new: Any, spec: Any, create: Any, spec_set: Any, autospec: Any, new_callable: Any, kwargs: Any) -> None: ... + def copy(self) -> Any: ... + def __call__(self, func: Any) -> Any: ... + def decorate_class(self, klass: Any) -> Any: ... + def decorate_callable(self, func: Any) -> Any: ... + def get_original(self) -> Any: ... + target: Any + temp_original: Any + is_local: Any + def __enter__(self) -> Any: ... + def __exit__(self, *exc_info: Any) -> Any: ... + def start(self) -> Any: ... + def stop(self) -> Any: ... + +class _patch_dict: + in_dict: Any + values: Any + clear: Any + def __init__(self, in_dict: Any, values: Any = ..., clear: Any = ..., **kwargs: Any) -> None: ... + def __call__(self, f: Any) -> Any: ... + def decorate_class(self, klass: Any) -> Any: ... + def __enter__(self) -> Any: ... + def __exit__(self, *args: Any) -> Any: ... + start: Any + stop: Any + +class _patcher: + TEST_PREFIX: str + dict: Type[_patch_dict] + def __call__(self, target: Any, new: Optional[Any] = ..., spec: Optional[Any] = ..., create: bool = ..., spec_set: Optional[Any] = ..., autospec: Optional[Any] = ..., new_callable: Optional[Any] = ..., **kwargs: Any) -> _patch: ... + def object(self, target: Any, attribute: Text, new: Optional[Any] = ..., spec: Optional[Any] = ..., create: bool = ..., spec_set: Optional[Any] = ..., autospec: Optional[Any] = ..., new_callable: Optional[Any] = ..., **kwargs: Any) -> _patch: ... + def multiple(self, target: Any, spec: Optional[Any] = ..., create: bool = ..., spec_set: Optional[Any] = ..., autospec: Optional[Any] = ..., new_callable: Optional[Any] = ..., **kwargs: Any) -> _patch: ... + def stopall(self) -> None: ... + +patch: _patcher + +class MagicMixin: + def __init__(self, *args: Any, **kw: Any) -> None: ... + +NonCallableMagicMock: Any +MagicMock: Any + +class MagicProxy: + name: Any + parent: Any + def __init__(self, name: Any, parent: Any) -> None: ... + def __call__(self, *args: Any, **kwargs: Any) -> Any: ... + def create_mock(self) -> Any: ... + def __get__(self, obj: Any, _type: Optional[Any] = ...) -> Any: ... + +class _ANY: + def __eq__(self, other: Any) -> bool: ... + def __ne__(self, other: Any) -> bool: ... + +ANY: Any + +class _Call(tuple): + def __new__(cls, value: Any = ..., name: Optional[Any] = ..., parent: Optional[Any] = ..., two: bool = ..., from_kall: bool = ...) -> Any: ... + name: Any + parent: Any + from_kall: Any + def __init__(self, value: Any = ..., name: Optional[Any] = ..., parent: Optional[Any] = ..., two: bool = ..., from_kall: bool = ...) -> None: ... + def __eq__(self, other: Any) -> bool: ... + __ne__: Any + def __call__(self, *args: Any, **kwargs: Any) -> Any: ... + def __getattr__(self, attr: Any) -> Any: ... + def count(self, *args: Any, **kwargs: Any) -> Any: ... + def index(self, *args: Any, **kwargs: Any) -> Any: ... + def call_list(self) -> Any: ... + +call: Any + +def create_autospec(spec: Any, spec_set: Any = ..., instance: Any = ..., _parent: Optional[Any] = ..., _name: Optional[Any] = ..., **kwargs: Any) -> Any: ... + +class _SpecState: + spec: Any + ids: Any + spec_set: Any + parent: Any + instance: Any + name: Any + def __init__(self, spec: Any, spec_set: Any = ..., parent: Optional[Any] = ..., name: Optional[Any] = ..., ids: Optional[Any] = ..., instance: Any = ...) -> None: ... + +def mock_open(mock: Optional[Any] = ..., read_data: Any = ...) -> Any: ... + +PropertyMock: Any + +if sys.version_info >= (3, 7): + def seal(mock: Any) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/unittest/result.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/unittest/result.pyi new file mode 100644 index 0000000..cb85399 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/unittest/result.pyi @@ -0,0 +1,36 @@ +from typing import Any, List, Optional, Tuple, Type +from types import TracebackType +import unittest.case + + +_SysExcInfoType = Tuple[Optional[Type[BaseException]], + Optional[BaseException], + Optional[TracebackType]] + + +class TestResult: + errors: List[Tuple[unittest.case.TestCase, str]] + failures: List[Tuple[unittest.case.TestCase, str]] + skipped: List[Tuple[unittest.case.TestCase, str]] + expectedFailures: List[Tuple[unittest.case.TestCase, str]] + unexpectedSuccesses: List[unittest.case.TestCase] + shouldStop: bool + testsRun: int + buffer: bool + failfast: bool + tb_locals: bool + def wasSuccessful(self) -> bool: ... + def stop(self) -> None: ... + def startTest(self, test: unittest.case.TestCase) -> None: ... + def stopTest(self, test: unittest.case.TestCase) -> None: ... + def startTestRun(self) -> None: ... + def stopTestRun(self) -> None: ... + def addError(self, test: unittest.case.TestCase, err: _SysExcInfoType) -> None: ... + def addFailure(self, test: unittest.case.TestCase, err: _SysExcInfoType) -> None: ... + def addSuccess(self, test: unittest.case.TestCase) -> None: ... + def addSkip(self, test: unittest.case.TestCase, reason: str) -> None: ... + def addExpectedFailure(self, test: unittest.case.TestCase, + err: _SysExcInfoType) -> None: ... + def addUnexpectedSuccess(self, test: unittest.case.TestCase) -> None: ... + def addSubTest(self, test: unittest.case.TestCase, subtest: unittest.case.TestCase, + outcome: Optional[_SysExcInfoType]) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/unittest/runner.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/unittest/runner.pyi new file mode 100644 index 0000000..786bc19 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/unittest/runner.pyi @@ -0,0 +1,40 @@ +from typing import Callable, Optional, TextIO, Tuple, Type, Union +import sys +import unittest.case +import unittest.result +import unittest.suite + + +_ResultClassType = Callable[[TextIO, bool, int], unittest.result.TestResult] + + +class TextTestResult(unittest.result.TestResult): + separator1: str + separator2: str + def __init__(self, stream: TextIO, descriptions: bool, + verbosity: int) -> None: ... + def getDescription(self, test: unittest.case.TestCase) -> str: ... + def printErrors(self) -> None: ... + def printErrorList(self, flavour: str, errors: Tuple[unittest.case.TestCase, str]) -> None: ... + + +class TestRunner: + def run(self, test: Union[unittest.suite.TestSuite, unittest.case.TestCase]) -> unittest.result.TestResult: ... + + +class TextTestRunner(TestRunner): + if sys.version_info >= (3, 5): + def __init__(self, stream: Optional[TextIO] = ..., + descriptions: bool = ..., verbosity: int = ..., + failfast: bool = ..., buffer: bool = ..., + resultclass: Optional[_ResultClassType] = ..., + warnings: Optional[Type[Warning]] = ..., + *, tb_locals: bool = ...) -> None: ... + else: + def __init__(self, + stream: Optional[TextIO] = ..., + descriptions: bool = ..., verbosity: int = ..., + failfast: bool = ..., buffer: bool = ..., + resultclass: Optional[_ResultClassType] = ..., + warnings: Optional[Type[Warning]] = ...) -> None: ... + def _makeResult(self) -> unittest.result.TestResult: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/unittest/signals.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/unittest/signals.pyi new file mode 100644 index 0000000..a4616b7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/unittest/signals.pyi @@ -0,0 +1,14 @@ +from typing import Any, Callable, overload, TypeVar +import unittest.result + + +_F = TypeVar('_F', bound=Callable[..., Any]) + + +def installHandler() -> None: ... +def registerResult(result: unittest.result.TestResult) -> None: ... +def removeResult(result: unittest.result.TestResult) -> bool: ... +@overload +def removeHandler() -> None: ... +@overload +def removeHandler(function: _F) -> _F: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/unittest/suite.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/unittest/suite.pyi new file mode 100644 index 0000000..54e9e69 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/unittest/suite.pyi @@ -0,0 +1,22 @@ +from typing import Iterable, Iterator, List, Union +import unittest.case +import unittest.result + + +_TestType = Union[unittest.case.TestCase, TestSuite] + + +class BaseTestSuite(Iterable[_TestType]): + _tests: List[unittest.case.TestCase] + _removed_tests: int + def __init__(self, tests: Iterable[_TestType] = ...) -> None: ... + def __call__(self, result: unittest.result.TestResult) -> unittest.result.TestResult: ... + def addTest(self, test: _TestType) -> None: ... + def addTests(self, tests: Iterable[_TestType]) -> None: ... + def run(self, result: unittest.result.TestResult) -> unittest.result.TestResult: ... + def debug(self) -> None: ... + def countTestCases(self) -> int: ... + def __iter__(self) -> Iterator[_TestType]: ... + + +class TestSuite(BaseTestSuite): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/urllib/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/urllib/__init__.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/urllib/error.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/urllib/error.pyi new file mode 100644 index 0000000..191c765 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/urllib/error.pyi @@ -0,0 +1,12 @@ +from typing import Dict, Union +from urllib.response import addinfourl + +# Stubs for urllib.error + +class URLError(IOError): + reason: Union[str, BaseException] +class HTTPError(URLError, addinfourl): + code: int + headers: Dict[str, str] + def __init__(self, url, code, msg, hdrs, fp) -> None: ... +class ContentTooShortError(URLError): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/urllib/parse.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/urllib/parse.pyi new file mode 100644 index 0000000..8d7cc4a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/urllib/parse.pyi @@ -0,0 +1,146 @@ +# Stubs for urllib.parse +from typing import Any, List, Dict, Tuple, AnyStr, Generic, overload, Sequence, Mapping, Union, NamedTuple, Callable, Optional +import sys + +_Str = Union[bytes, str] + + +uses_relative: List[str] +uses_netloc: List[str] +uses_params: List[str] +non_hierarchical: List[str] +uses_query: List[str] +uses_fragment: List[str] +scheme_chars: str +MAX_CACHE_SIZE = 0 + +class _ResultMixinBase(Generic[AnyStr]): + def geturl(self) -> AnyStr: ... + +class _ResultMixinStr(_ResultMixinBase[str]): + def encode(self, encoding: str = ..., errors: str = ...) -> _ResultMixinBytes: ... + + +class _ResultMixinBytes(_ResultMixinBase[str]): + def decode(self, encoding: str = ..., errors: str = ...) -> _ResultMixinStr: ... + + +class _NetlocResultMixinBase(Generic[AnyStr]): + username: AnyStr + password: AnyStr + hostname: AnyStr + port: int + +class _NetlocResultMixinStr(_NetlocResultMixinBase[str], _ResultMixinStr): ... + +class _NetlocResultMixinBytes(_NetlocResultMixinBase[bytes], _ResultMixinBytes): ... + +class _DefragResultBase(tuple, Generic[AnyStr]): + url: AnyStr + fragment: AnyStr + + +_SplitResultBase = NamedTuple( + '_SplitResultBase', + [ + ('scheme', str), ('netloc', str), ('path', str), ('query', str), ('fragment', str) + ] +) +_SplitResultBytesBase = NamedTuple( + '_SplitResultBytesBase', + [ + ('scheme', bytes), ('netloc', bytes), ('path', bytes), ('query', bytes), ('fragment', bytes) + ] +) + +_ParseResultBase = NamedTuple( + '_ParseResultBase', + [ + ('scheme', str), ('netloc', str), ('path', str), ('params', str), ('query', str), ('fragment', str) + ] +) +_ParseResultBytesBase = NamedTuple( + '_ParseResultBytesBase', + [ + ('scheme', bytes), ('netloc', bytes), ('path', bytes), ('params', bytes), ('query', bytes), ('fragment', bytes) + ] +) + +# Structured result objects for string data +class DefragResult(_DefragResultBase[str], _ResultMixinStr): ... + +class SplitResult(_SplitResultBase, _NetlocResultMixinStr): ... + +class ParseResult(_ParseResultBase, _NetlocResultMixinStr): ... + +# Structured result objects for bytes data +class DefragResultBytes(_DefragResultBase[bytes], _ResultMixinBytes): ... + +class SplitResultBytes(_SplitResultBytesBase, _NetlocResultMixinBytes): ... + +class ParseResultBytes(_ParseResultBytesBase, _NetlocResultMixinBytes): ... + + +def parse_qs(qs: AnyStr, keep_blank_values: bool = ..., strict_parsing: bool = ..., encoding: str = ..., errors: str = ...) -> Dict[AnyStr, List[AnyStr]]: ... + +def parse_qsl(qs: AnyStr, keep_blank_values: bool = ..., strict_parsing: bool = ..., encoding: str = ..., errors: str = ...) -> List[Tuple[AnyStr, AnyStr]]: ... + + +@overload +def quote(string: str, safe: _Str = ..., encoding: str = ..., errors: str = ...) -> str: ... +@overload +def quote(string: bytes, safe: _Str = ...) -> str: ... + +def quote_from_bytes(bs: bytes, safe: _Str = ...) -> str: ... + +@overload +def quote_plus(string: str, safe: _Str = ..., encoding: str = ..., errors: str = ...) -> str: ... +@overload +def quote_plus(string: bytes, safe: _Str = ...) -> str: ... + +def unquote(string: str, encoding: str = ..., errors: str = ...) -> str: ... + +def unquote_to_bytes(string: _Str) -> bytes: ... + +def unquote_plus(string: str, encoding: str = ..., errors: str = ...) -> str: ... + +@overload +def urldefrag(url: str) -> DefragResult: ... +@overload +def urldefrag(url: bytes) -> DefragResultBytes: ... + +if sys.version_info >= (3, 5): + def urlencode(query: Union[Mapping[Any, Any], + Mapping[Any, Sequence[Any]], + Sequence[Tuple[Any, Any]], + Sequence[Tuple[Any, Sequence[Any]]]], + doseq: bool = ..., safe: AnyStr = ..., encoding: str = ..., errors: str = ..., + quote_via: Callable[[str, AnyStr, str, str], str] = ...) -> str: ... +else: + def urlencode(query: Union[Mapping[Any, Any], + Mapping[Any, Sequence[Any]], + Sequence[Tuple[Any, Any]], + Sequence[Tuple[Any, Sequence[Any]]]], + doseq: bool = ..., safe: AnyStr = ..., encoding: str = ..., errors: str = ...) -> str: ... + +def urljoin(base: AnyStr, url: Optional[AnyStr], allow_fragments: bool = ...) -> AnyStr: ... + +@overload +def urlparse(url: str, scheme: str = ..., allow_fragments: bool = ...) -> ParseResult: ... +@overload +def urlparse(url: bytes, scheme: bytes = ..., allow_fragments: bool = ...) -> ParseResultBytes: ... + +@overload +def urlsplit(url: str, scheme: str = ..., allow_fragments: bool = ...) -> SplitResult: ... +@overload +def urlsplit(url: bytes, scheme: bytes = ..., allow_fragments: bool = ...) -> SplitResultBytes: ... + +@overload +def urlunparse(components: Tuple[AnyStr, AnyStr, AnyStr, AnyStr, AnyStr, AnyStr]) -> AnyStr: ... +@overload +def urlunparse(components: Sequence[AnyStr]) -> AnyStr: ... + +@overload +def urlunsplit(components: Tuple[AnyStr, AnyStr, AnyStr, AnyStr, AnyStr]) -> AnyStr: ... +@overload +def urlunsplit(components: Sequence[AnyStr]) -> AnyStr: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/urllib/request.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/urllib/request.pyi new file mode 100644 index 0000000..a1a5568 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/urllib/request.pyi @@ -0,0 +1,222 @@ +# Stubs for urllib.request (Python 3.4) + +from typing import ( + Any, Callable, ClassVar, Dict, List, IO, Mapping, Optional, Sequence, Tuple, + TypeVar, Union, overload, NoReturn, +) +from http.client import HTTPResponse, HTTPMessage, HTTPConnectionProtocol +from http.cookiejar import CookieJar +from email.message import Message +from urllib.response import addinfourl +import ssl +import sys +import os + +_T = TypeVar('_T') +_UrlopenRet = Union[_HTTPResponse, addinfourl] + +class _HTTPResponse(HTTPResponse): + url: str + msg: str # type: ignore + +def urlopen( + url: Union[str, Request], data: Optional[bytes] = ..., + timeout: float = ..., *, cafile: Optional[str] = ..., + capath: Optional[str] = ..., cadefault: bool = ..., + context: Optional[ssl.SSLContext] = ... +) -> _UrlopenRet: ... +def install_opener(opener: OpenerDirector) -> None: ... +def build_opener( + *handlers: Union[BaseHandler, Callable[[], BaseHandler]] +) -> OpenerDirector: ... +def url2pathname(path: str) -> str: ... +def pathname2url(path: str) -> str: ... +def getproxies() -> Dict[str, str]: ... +def parse_http_list(s: str) -> List[str]: ... +def parse_keqv_list(l: List[str]) -> Dict[str, str]: ... + +class Request: + @property + def full_url(self) -> str: ... + @full_url.setter + def full_url(self, value: str) -> None: ... + @full_url.deleter + def full_url(self) -> None: ... + type: str + host: str + origin_req_host: str + selector: str + data: Optional[bytes] + headers: Dict[str, str] + unverifiable: bool + method: Optional[str] + def __init__(self, url: str, data: Optional[bytes] = ..., + headers: Dict[str, str] = ..., origin_req_host: Optional[str] = ..., + unverifiable: bool = ..., method: Optional[str] = ...) -> None: ... + def get_method(self) -> str: ... + def add_header(self, key: str, val: str) -> None: ... + def add_unredirected_header(self, key: str, val: str) -> None: ... + def has_header(self, header_name: str) -> bool: ... + def remove_header(self, header_name: str) -> None: ... + def get_full_url(self) -> str: ... + def set_proxy(self, host: str, type: str) -> None: ... + @overload + def get_header(self, header_name: str) -> Optional[str]: ... + @overload + def get_header(self, header_name: str, default: _T) -> Union[str, _T]: ... + def header_items(self) -> List[Tuple[str, str]]: ... + +class OpenerDirector: + addheaders: List[Tuple[str, str]] + def add_handler(self, handler: BaseHandler) -> None: ... + def open(self, url: Union[str, Request], data: Optional[bytes] = ..., + timeout: float = ...) -> _UrlopenRet: ... + def error(self, proto: str, *args: Any) -> _UrlopenRet: ... + + +class BaseHandler: + handler_order: ClassVar[int] + parent: OpenerDirector + def add_parent(self, parent: OpenerDirector) -> None: ... + def close(self) -> None: ... + def http_error_nnn(self, req: Request, fp: IO[str], code: int, msg: int, + hdrs: Mapping[str, str]) -> _UrlopenRet: ... + +class HTTPDefaultErrorHandler(BaseHandler): ... + +class HTTPRedirectHandler(BaseHandler): + def redirect_request(self, req: Request, fp: IO[str], code: int, msg: str, + hdrs: Mapping[str, str], + newurl: str) -> Optional[Request]: ... + def http_error_301(self, req: Request, fp: IO[str], code: int, msg: int, + hdrs: Mapping[str, str]) -> Optional[_UrlopenRet]: ... + def http_error_302(self, req: Request, fp: IO[str], code: int, msg: int, + hdrs: Mapping[str, str]) -> Optional[_UrlopenRet]: ... + def http_error_303(self, req: Request, fp: IO[str], code: int, msg: int, + hdrs: Mapping[str, str]) -> Optional[_UrlopenRet]: ... + def http_error_307(self, req: Request, fp: IO[str], code: int, msg: int, + hdrs: Mapping[str, str]) -> Optional[_UrlopenRet]: ... + +class HTTPCookieProcessor(BaseHandler): + cookiejar: CookieJar + def __init__(self, cookiejar: Optional[CookieJar] = ...) -> None: ... + +class ProxyHandler(BaseHandler): + def __init__(self, proxies: Optional[Dict[str, str]] = ...) -> None: ... + # TODO add a method for every (common) proxy protocol + +class HTTPPasswordMgr: + def add_password(self, realm: str, uri: Union[str, Sequence[str]], + user: str, passwd: str) -> None: ... + def find_user_password(self, realm: str, authuri: str) -> Tuple[Optional[str], Optional[str]]: ... + +class HTTPPasswordMgrWithDefaultRealm(HTTPPasswordMgr): + def add_password(self, realm: str, uri: Union[str, Sequence[str]], + user: str, passwd: str) -> None: ... + def find_user_password(self, realm: str, authuri: str) -> Tuple[Optional[str], Optional[str]]: ... + +if sys.version_info >= (3, 5): + class HTTPPasswordMgrWithPriorAuth(HTTPPasswordMgrWithDefaultRealm): + def add_password(self, realm: str, uri: Union[str, Sequence[str]], + user: str, passwd: str, + is_authenticated: bool = ...) -> None: ... + def update_authenticated(self, uri: Union[str, Sequence[str]], + is_authenticated: bool = ...) -> None: ... + def is_authenticated(self, authuri: str) -> bool: ... + +class AbstractBasicAuthHandler: + def __init__(self, + password_mgr: Optional[HTTPPasswordMgr] = ...) -> None: ... + def http_error_auth_reqed(self, authreq: str, host: str, req: Request, + headers: Mapping[str, str]) -> None: ... + +class HTTPBasicAuthHandler(AbstractBasicAuthHandler, BaseHandler): + def http_error_401(self, req: Request, fp: IO[str], code: int, msg: int, + hdrs: Mapping[str, str]) -> Optional[_UrlopenRet]: ... + +class ProxyBasicAuthHandler(AbstractBasicAuthHandler, BaseHandler): + def http_error_407(self, req: Request, fp: IO[str], code: int, msg: int, + hdrs: Mapping[str, str]) -> Optional[_UrlopenRet]: ... + +class AbstractDigestAuthHandler: + def __init__(self, passwd: Optional[HTTPPasswordMgr] = ...) -> None: ... + def reset_retry_count(self) -> None: ... + def http_error_auth_reqed(self, auth_header: str, host: str, req: Request, + headers: Mapping[str, str]) -> None: ... + def retry_http_digest_auth(self, req: Request, auth: str) -> Optional[_UrlopenRet]: ... + def get_cnonce(self, nonce: str) -> str: ... + def get_authorization(self, req: Request, chal: Mapping[str, str]) -> str: ... + def get_algorithm_impls(self, algorithm: str) -> Tuple[Callable[[str], str], Callable[[str, str], str]]: ... + def get_entity_digest(self, data: Optional[bytes], chal: Mapping[str, str]) -> Optional[str]: ... + +class HTTPDigestAuthHandler(BaseHandler, AbstractDigestAuthHandler): + def http_error_401(self, req: Request, fp: IO[str], code: int, msg: int, + hdrs: Mapping[str, str]) -> Optional[_UrlopenRet]: ... + +class ProxyDigestAuthHandler(BaseHandler, AbstractDigestAuthHandler): + def http_error_407(self, req: Request, fp: IO[str], code: int, msg: int, + hdrs: Mapping[str, str]) -> Optional[_UrlopenRet]: ... + +class AbstractHTTPHandler(BaseHandler): # undocumented + def __init__(self, debuglevel: int = ...) -> None: ... + def set_http_debuglevel(self, level: int) -> None: ... + def do_request_(self, request: Request) -> Request: ... + def do_open(self, + http_class: HTTPConnectionProtocol, + req: Request, + **http_conn_args: Any) -> HTTPResponse: ... + +class HTTPHandler(AbstractHTTPHandler): + def http_open(self, req: Request) -> HTTPResponse: ... + def http_request(self, request: Request) -> Request: ... # undocumented + +class HTTPSHandler(AbstractHTTPHandler): + def __init__(self, debuglevel: int = ..., + context: Optional[ssl.SSLContext] = ..., + check_hostname: Optional[bool] = ...) -> None: ... + def https_open(self, req: Request) -> HTTPResponse: ... + def https_request(self, request: Request) -> Request: ... # undocumented + +class FileHandler(BaseHandler): + def file_open(self, req: Request) -> addinfourl: ... + +class DataHandler(BaseHandler): + def data_open(self, req: Request) -> addinfourl: ... + +class FTPHandler(BaseHandler): + def ftp_open(self, req: Request) -> addinfourl: ... + +class CacheFTPHandler(FTPHandler): + def setTimeout(self, t: float) -> None: ... + def setMaxConns(self, m: int) -> None: ... + +class UnknownHandler(BaseHandler): + def unknown_open(self, req: Request) -> NoReturn: ... + +class HTTPErrorProcessor(BaseHandler): + def http_response(self, request, response) -> _UrlopenRet: ... + def https_response(self, request, response) -> _UrlopenRet: ... + +if sys.version_info >= (3, 6): + def urlretrieve(url: str, filename: Optional[Union[str, os.PathLike]] = ..., + reporthook: Optional[Callable[[int, int, int], None]] = ..., + data: Optional[bytes] = ...) -> Tuple[str, HTTPMessage]: ... +else: + def urlretrieve(url: str, filename: Optional[str] = ..., + reporthook: Optional[Callable[[int, int, int], None]] = ..., + data: Optional[bytes] = ...) -> Tuple[str, HTTPMessage]: ... +def urlcleanup() -> None: ... + +class URLopener: + version: ClassVar[str] + def __init__(self, proxies: Optional[Dict[str, str]] = ..., + **x509: str) -> None: ... + def open(self, fullurl: str, data: Optional[bytes] = ...) -> _UrlopenRet: ... + def open_unknown(self, fullurl: str, + data: Optional[bytes] = ...) -> _UrlopenRet: ... + def retrieve(self, url: str, filename: Optional[str] = ..., + reporthook: Optional[Callable[[int, int, int], None]] = ..., + data: Optional[bytes] = ...) -> Tuple[str, Optional[Message]]: ... + +class FancyURLopener(URLopener): + def prompt_user_passwd(self, host: str, realm: str) -> Tuple[str, str]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/urllib/response.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/urllib/response.pyi new file mode 100644 index 0000000..ef3507d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/urllib/response.pyi @@ -0,0 +1,41 @@ +# private module, we only expose what's needed + +from typing import BinaryIO, Iterable, List, Mapping, Optional, Type, TypeVar +from types import TracebackType + +_AIUT = TypeVar("_AIUT", bound=addbase) + +class addbase(BinaryIO): + def __enter__(self: _AIUT) -> _AIUT: ... + def __exit__(self, type: Optional[Type[BaseException]], value: Optional[BaseException], traceback: Optional[TracebackType]) -> bool: ... + def __iter__(self: _AIUT) -> _AIUT: ... + def __next__(self) -> bytes: ... + def close(self) -> None: ... + # These methods don't actually exist, but the class inherits at runtime from + # tempfile._TemporaryFileWrapper, which uses __getattr__ to delegate to the + # underlying file object. To satisfy the BinaryIO interface, we pretend that this + # class has these additional methods. + def fileno(self) -> int: ... + def flush(self) -> None: ... + def isatty(self) -> bool: ... + def read(self, n: int = ...) -> bytes: ... + def readable(self) -> bool: ... + def readline(self, limit: int = ...) -> bytes: ... + def readlines(self, hint: int = ...) -> List[bytes]: ... + def seek(self, offset: int, whence: int = ...) -> int: ... + def seekable(self) -> bool: ... + def tell(self) -> int: ... + def truncate(self, size: Optional[int] = ...) -> int: ... + def writable(self) -> bool: ... + def write(self, s: bytes) -> int: ... + def writelines(self, lines: Iterable[bytes]) -> None: ... + +class addinfo(addbase): + headers: Mapping[str, str] + def info(self) -> Mapping[str, str]: ... + +class addinfourl(addinfo): + url: str + code: int + def geturl(self) -> str: ... + def getcode(self) -> int: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/urllib/robotparser.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/urllib/robotparser.pyi new file mode 100644 index 0000000..36150ab --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/stdlib/3/urllib/robotparser.pyi @@ -0,0 +1,18 @@ +# Stubs for urllib.robotparser (Python 3.4) + +from typing import Iterable, NamedTuple, Optional +import sys + +_RequestRate = NamedTuple('_RequestRate', [('requests', int), ('seconds', int)]) + +class RobotFileParser: + def __init__(self, url: str = ...) -> None: ... + def set_url(self, url: str) -> None: ... + def read(self) -> None: ... + def parse(self, lines: Iterable[str]) -> None: ... + def can_fetch(self, user_agent: str, url: str) -> bool: ... + def mtime(self) -> int: ... + def modified(self) -> None: ... + if sys.version_info >= (3, 6): + def crawl_delay(self, useragent: str) -> Optional[str]: ... + def request_rate(self, useragent: str) -> Optional[_RequestRate]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/OpenSSL/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/OpenSSL/__init__.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/OpenSSL/crypto.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/OpenSSL/crypto.pyi new file mode 100644 index 0000000..395e630 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/OpenSSL/crypto.pyi @@ -0,0 +1,191 @@ +# Stubs for OpenSSL.crypto (Python 2) + +from typing import Any, Callable, Iterable, List, Optional, Set, Text, Tuple, Union + +from cryptography.hazmat.primitives.asymmetric import dsa, rsa +from datetime import datetime + +FILETYPE_PEM: int +FILETYPE_ASN1: int +FILETYPE_TEXT: int +TYPE_RSA: int +TYPE_DSA: int + +class Error(Exception): ... + +_Key = Union[rsa.RSAPublicKey, rsa.RSAPrivateKey, dsa.DSAPublicKey, dsa.DSAPrivateKey] + +class PKey: + def __init__(self) -> None: ... + def to_cryptography_key(self) -> _Key: ... + @classmethod + def from_cryptography_key(cls, crypto_key: _Key): ... + def generate_key(self, type: int, bits: int) -> None: ... + def check(self) -> bool: ... + def type(self) -> int: ... + def bits(self) -> int: ... + +class _EllipticCurve: + name: Text + +def get_elliptic_curves() -> Set[_EllipticCurve]: ... +def get_elliptic_curve(name: str) -> _EllipticCurve: ... + +class X509Name: + def __init__(self, name: X509Name) -> None: ... + countryName: Union[str, unicode] + stateOrProvinceName: Union[str, unicode] + localityName: Union[str, unicode] + organizationName: Union[str, unicode] + organizationalUnitName: Union[str, unicode] + commonName: Union[str, unicode] + emailAddress: Union[str, unicode] + C: Union[str, unicode] + ST: Union[str, unicode] + L: Union[str, unicode] + O: Union[str, unicode] + OU: Union[str, unicode] + CN: Union[str, unicode] + def hash(self) -> int: ... + def der(self) -> bytes: ... + def get_components(self) -> List[Tuple[str, str]]: ... + +class X509Extension: + def __init__(self, type_name: bytes, critical: bool, value: bytes, subject: Optional[X509] = ..., + issuer: Optional[X509] = ...) -> None: ... + def get_critical(self) -> bool: ... + def get_short_name(self) -> str: ... + def get_data(self) -> str: ... + +class X509Req: + def __init__(self) -> None: ... + def set_pubkey(self, pkey: PKey) -> None: ... + def get_pubkey(self) -> PKey: ... + def set_version(self, version: int) -> None: ... + def get_version(self) -> int: ... + def get_subject(self) -> X509Name: ... + def add_extensions(self, extensions: Iterable[X509Extension]) -> None: ... + def get_extensions(self) -> List[X509Extension]: ... + def sign(self, pkey: PKey, digest: str) -> None: ... + def verify(self, pkey: PKey) -> bool: ... + +class X509: + def __init__(self) -> None: ... + def set_version(self, version: int) -> None: ... + def get_version(self) -> int: ... + def get_pubkey(self) -> PKey: ... + def set_pubkey(self, pkey: PKey) -> None: ... + def sign(self, pkey: PKey, digest: str) -> None: ... + def get_signature_algorithm(self) -> str: ... + def digest(self, digest_name: str) -> str: ... + def subject_name_hash(self) -> str: ... + def set_serial_number(self, serial: int) -> None: ... + def get_serial_number(self) -> int: ... + def gmtime_adj_notAfter(self, amount: int) -> None: ... + def gmtime_adj_notBefore(self, amount: int) -> None: ... + def has_expired(self) -> bool: ... + def get_notBefore(self) -> str: ... + def set_notBefore(self, when: str) -> None: ... + def get_notAfter(self) -> str: ... + def set_notAfter(self, when: str) -> None: ... + def get_issuer(self) -> X509Name: ... + def set_issuer(self, issuer: X509Name) -> None: ... + def get_subject(self) -> X509Name: ... + def set_subject(self, subject: X509Name) -> None: ... + def get_extension_count(self) -> int: ... + def add_extensions(self, extensions: Iterable[X509Extension]) -> None: ... + def get_extension(self, index: int) -> X509Extension: ... + +class X509StoreFlags: + CRL_CHECK: int + CRL_CHECK_ALL: int + IGNORE_CRITICAL: int + X509_STRICT: int + ALLOW_PROXY_CERTS: int + POLICY_CHECK: int + EXPLICIT_POLICY: int + INHIBIT_MAP: int + NOTIFY_POLICY: int + CHECK_SS_SIGNATURE: int + CB_ISSUER_CHECK: int + +class X509Store: + def __init__(self) -> None: ... + def add_cert(self, cert: X509) -> None: ... + def add_crl(self, crl: CRL) -> None: ... + def set_flags(self, flags: int) -> None: ... + def set_time(self, vfy_time: datetime) -> None: ... + +class X509StoreContextError(Exception): + certificate: X509 + def __init__(self, message: str, certificate: X509) -> None: ... + +class X509StoreContext: + def __init__(self, store: X509Store, certificate: X509) -> None: ... + def set_store(self, store: X509Store) -> None: ... + def verify_certificate(self) -> None: ... + +def load_certificate(type: int, buffer: Union[str, unicode]) -> X509: ... +def dump_certificate(type: int, cert: X509) -> bytes: ... +def dump_publickey(type: int, pkey: PKey) -> bytes: ... +def dump_privatekey(type: int, pkey: PKey, cipher: Optional[str] = ..., + passphrase: Optional[Union[str, Callable[[int], int]]] = ...) -> bytes: ... + +class Revoked: + def __init__(self) -> None: ... + def set_serial(self, hex_str: str) -> None: ... + def get_serial(self) -> str: ... + def set_reason(self, reason: str) -> None: ... + def get_reason(self) -> str: ... + def all_reasons(self) -> List[str]: ... + def set_rev_date(self, when: str) -> None: ... + def get_rev_date(self) -> str: ... + +class CRL: + def __init__(self) -> None: ... + def get_revoked(self) -> Tuple[Revoked, ...]: ... + def add_revoked(self, revoked: Revoked) -> None: ... + def get_issuer(self) -> X509Name: ... + def set_version(self, version: int) -> None: ... + def set_lastUpdate(self, when: str) -> None: ... + def set_nextUpdate(self, when: str) -> None: ... + def sign(self, issuer_cert: X509, issuer_key: PKey, digest: str) -> None: ... + def export(self, cert: X509, key: PKey, type: int = ..., days: int = ..., digest: str = ...) -> bytes: ... + +class PKCS7: + def type_is_signed(self) -> bool: ... + def type_is_enveloped(self) -> bool: ... + def type_is_signedAndEnveloped(self) -> bool: ... + def type_is_data(self) -> bool: ... + def get_type_name(self) -> str: ... + +class PKCS12: + def __init__(self) -> None: ... + def get_certificate(self) -> X509: ... + def set_certificate(self, cert: X509) -> None: ... + def get_privatekey(self) -> PKey: ... + def set_privatekey(self, pkey: PKey) -> None: ... + def get_ca_certificates(self) -> Tuple[X509, ...]: ... + def set_ca_certificates(self, cacerts: Iterable[X509]) -> None: ... + def set_friendlyname(self, name: bytes) -> None: ... + def get_friendlyname(self) -> bytes: ... + def export(self, passphrase: Optional[str] = ..., iter: int = ..., maciter: int = ...): ... + +class NetscapeSPKI: + def __init__(self) -> None: ... + def sign(self, pkey: PKey, digest: str) -> None: ... + def verify(self, key: PKey) -> bool: ... + def b64_encode(self) -> str: ... + def get_pubkey(self) -> PKey: ... + def set_pubkey(self, pkey: PKey) -> None: ... + +def load_publickey(type: int, buffer: Union[str, unicode]) -> PKey: ... +def load_privatekey(type: int, buffer: bytes, passphrase: Optional[Union[str, Callable[[int], int]]] = ...): ... +def dump_certificate_request(type: int, req: X509Req): ... +def load_certificate_request(type, buffer: Union[str, unicode]) -> X509Req: ... +def sign(pkey: PKey, data: Union[str, unicode], digest: str) -> bytes: ... +def verify(cert: X509, signature: bytes, data: Union[str, unicode], digest: str) -> None: ... +def dump_crl(type: int, crl: CRL) -> bytes: ... +def load_crl(type: int, buffer: Union[str, unicode]) -> CRL: ... +def load_pkcs7_data(type: int, buffer: Union[str, unicode]) -> PKCS7: ... +def load_pkcs12(buffer: Union[str, unicode], passphrase: Optional[Union[str, Callable[[int], int]]] = ...) -> PKCS12: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/concurrent/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/concurrent/__init__.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/concurrent/futures/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/concurrent/futures/__init__.pyi new file mode 100644 index 0000000..4439dca --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/concurrent/futures/__init__.pyi @@ -0,0 +1,3 @@ +from ._base import * # noqa: F403 +from .thread import * # noqa: F403 +from .process import * # noqa: F403 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/concurrent/futures/_base.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/concurrent/futures/_base.pyi new file mode 100644 index 0000000..95189a7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/concurrent/futures/_base.pyi @@ -0,0 +1,56 @@ +from typing import TypeVar, Generic, Any, Iterable, Iterator, Callable, Tuple, Optional, Set, NamedTuple +from types import TracebackType +import sys + +FIRST_COMPLETED: str +FIRST_EXCEPTION: str +ALL_COMPLETED: str +PENDING: Any +RUNNING: Any +CANCELLED: Any +CANCELLED_AND_NOTIFIED: Any +FINISHED: Any +LOGGER: Any + +class Error(Exception): ... +class CancelledError(Error): ... +class TimeoutError(Error): ... + +_T = TypeVar('_T') + +class Future(Generic[_T]): + def __init__(self) -> None: ... + def cancel(self) -> bool: ... + def cancelled(self) -> bool: ... + def running(self) -> bool: ... + def done(self) -> bool: ... + def add_done_callback(self, fn: Callable[[Future[_T]], Any]) -> None: ... + def result(self, timeout: Optional[float] = ...) -> _T: ... + def set_running_or_notify_cancel(self) -> bool: ... + def set_result(self, result: _T) -> None: ... + + if sys.version_info >= (3,): + def exception(self, timeout: Optional[float] = ...) -> Optional[BaseException]: ... + def set_exception(self, exception: Optional[BaseException]) -> None: ... + else: + def exception(self, timeout: Optional[float] = ...) -> Any: ... + def exception_info(self, timeout: Optional[float] = ...) -> Tuple[Any, Optional[TracebackType]]: ... + def set_exception(self, exception: Any) -> None: ... + def set_exception_info(self, exception: Any, traceback: Optional[TracebackType]) -> None: ... + + +class Executor: + def submit(self, fn: Callable[..., _T], *args: Any, **kwargs: Any) -> Future[_T]: ... + if sys.version_info >= (3, 5): + def map(self, func: Callable[..., _T], *iterables: Iterable[Any], timeout: Optional[float] = ..., + chunksize: int = ...) -> Iterator[_T]: ... + else: + def map(self, func: Callable[..., _T], *iterables: Iterable[Any], timeout: Optional[float] = ...,) -> Iterator[_T]: ... + def shutdown(self, wait: bool = ...) -> None: ... + def __enter__(self: _T) -> _T: ... + def __exit__(self, exc_type: Any, exc_val: Any, exc_tb: Any) -> bool: ... + +def as_completed(fs: Iterable[Future[_T]], timeout: Optional[float] = ...) -> Iterator[Future[_T]]: ... + +def wait(fs: Iterable[Future[_T]], timeout: Optional[float] = ..., return_when: str = ...) -> Tuple[Set[Future[_T]], + Set[Future[_T]]]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/concurrent/futures/process.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/concurrent/futures/process.pyi new file mode 100644 index 0000000..ba0cd61 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/concurrent/futures/process.pyi @@ -0,0 +1,17 @@ +from typing import Any, Callable, Optional, Tuple +from ._base import Future, Executor +import sys + +EXTRA_QUEUED_CALLS: Any + +if sys.version_info >= (3,): + class BrokenProcessPool(RuntimeError): ... + +if sys.version_info >= (3, 7): + class ProcessPoolExecutor(Executor): + def __init__(self, max_workers: Optional[int] = ..., + initializer: Optional[Callable[..., None]] = ..., + initargs: Tuple[Any, ...] = ...) -> None: ... +else: + class ProcessPoolExecutor(Executor): + def __init__(self, max_workers: Optional[int] = ...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/concurrent/futures/thread.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/concurrent/futures/thread.pyi new file mode 100644 index 0000000..983594d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/concurrent/futures/thread.pyi @@ -0,0 +1,15 @@ +from typing import Any, Callable, Optional, Tuple +from ._base import Executor, Future +import sys + +class ThreadPoolExecutor(Executor): + if sys.version_info >= (3, 7): + def __init__(self, max_workers: Optional[int] = ..., + thread_name_prefix: str = ..., + initializer: Optional[Callable[..., None]] = ..., + initargs: Tuple[Any, ...] = ...) -> None: ... + elif sys.version_info >= (3, 6) or sys.version_info < (3,): + def __init__(self, max_workers: Optional[int] = ..., + thread_name_prefix: str = ...) -> None: ... + else: + def __init__(self, max_workers: Optional[int] = ...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/cryptography/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/cryptography/__init__.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/cryptography/hazmat/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/cryptography/hazmat/__init__.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/cryptography/hazmat/primitives/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/cryptography/hazmat/primitives/__init__.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/cryptography/hazmat/primitives/asymmetric/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/cryptography/hazmat/primitives/asymmetric/__init__.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/cryptography/hazmat/primitives/asymmetric/dsa.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/cryptography/hazmat/primitives/asymmetric/dsa.pyi new file mode 100644 index 0000000..cfb0c73 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/cryptography/hazmat/primitives/asymmetric/dsa.pyi @@ -0,0 +1,4 @@ +# Minimal stub expressing only the classes required by OpenSSL.crypto. + +class DSAPrivateKey: ... +class DSAPublicKey: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/cryptography/hazmat/primitives/asymmetric/rsa.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/cryptography/hazmat/primitives/asymmetric/rsa.pyi new file mode 100644 index 0000000..006e822 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/cryptography/hazmat/primitives/asymmetric/rsa.pyi @@ -0,0 +1,58 @@ +from cryptography.hazmat.primitives.serialization import Encoding, KeySerializationEncryption, PrivateFormat, PublicFormat +from typing import Tuple + +class RSAPrivateKey: + def signer(self, padding, algorithm): ... + def decrypt(self, ciphertext: bytes, padding) -> bytes: ... + def public_key(self) -> RSAPublicKey: ... + @property + def key_size(self) -> int: ... + def sign(self, data: bytes, padding, algorithm) -> bytes: ... + +class RSAPrivateKeyWithSerialization(RSAPrivateKey): + def private_numbers(self) -> RSAPrivateNumbers: ... + def private_bytes(self, encoding: Encoding, format: PrivateFormat, + encryption_algorithm: KeySerializationEncryption) -> bytes: ... + +class RSAPublicKey: + def verifier(self, signature: bytes, padding, algorithm): ... + def encrypt(self, plaintext: bytes, padding) -> bytes: ... + @property + def key_size(self) -> int: ... + def public_numbers(self) -> RSAPublicNumbers: ... + def public_bytes(self, encoding: Encoding, format: PublicFormat) -> bytes: ... + def verify(self, signature: bytes, data: bytes, padding, algorithm) -> None: ... + +RSAPublicKeyWithSerialization = RSAPublicKey + +def generate_private_key(public_exponent: int, key_size: int, backend) -> RSAPrivateKey: ... +def rsa_crt_iqmp(p: int, q: int) -> int: ... +def rsa_crt_dmp1(private_exponent: int, p: int) -> int: ... +def rsa_crt_dmq1(private_exponent: int, q: int) -> int: ... +def rsa_recover_prime_factors(n: int, e: int, d: int) -> Tuple[int, int]: ... + +class RSAPrivateNumbers: + def __init__(self, p: int, q: int, d: int, dmp1: int, dmq1: int, iqmp: int, public_numbers: RSAPublicNumbers) -> None: ... + @property + def p(self) -> int: ... + @property + def q(self) -> int: ... + @property + def d(self) -> int: ... + @property + def dmp1(self) -> int: ... + @property + def dmq1(self) -> int: ... + @property + def iqmp(self) -> int: ... + @property + def public_numbers(self) -> RSAPublicNumbers: ... + def private_key(self, backend) -> RSAPrivateKey: ... + +class RSAPublicNumbers: + def __init__(self, e: int, n: int) -> None: ... + @property + def p(self) -> int: ... + @property + def q(self) -> int: ... + def public_key(self, backend) -> RSAPublicKey: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/cryptography/hazmat/primitives/serialization.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/cryptography/hazmat/primitives/serialization.pyi new file mode 100644 index 0000000..bec4e89 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/cryptography/hazmat/primitives/serialization.pyi @@ -0,0 +1,33 @@ +from typing import Any, Optional +from enum import Enum + +def load_pem_private_key(data: bytes, password: Optional[bytes], backend): ... +def load_pem_public_key(data: bytes, backend): ... +def load_der_private_key(data: bytes, password: Optional[bytes], backend): ... +def load_der_public_key(data: bytes, backend): ... +def load_ssh_public_key(data: bytes, backend): ... + +class Encoding(Enum): + PEM: str + DER: str + OpenSSH: str + +class PrivateFormat(Enum): + PKCS8: str + TraditionalOpenSSL: str + +class PublicFormat(Enum): + SubjectPublicKeyInfo: str + PKCS1: str + OpenSSH: str + +class ParameterFormat(Enum): + PKCS3: str + +class KeySerializationEncryption: ... + +class BestAvailableEncryption(KeySerializationEncryption): + password: Any + def __init__(self, password) -> None: ... + +class NoEncryption(KeySerializationEncryption): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/enum.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/enum.pyi new file mode 100644 index 0000000..703c7cf --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/enum.pyi @@ -0,0 +1,77 @@ +# NB: third_party/2/enum.pyi and stdlib/3.4/enum.pyi must remain consistent! +import sys +from typing import Any, Dict, Iterator, List, Mapping, Type, TypeVar, Union +from abc import ABCMeta + +_T = TypeVar('_T') +_S = TypeVar('_S', bound=Type[Enum]) + +# Note: EnumMeta actually subclasses type directly, not ABCMeta. +# This is a temporary workaround to allow multiple creation of enums with builtins +# such as str as mixins, which due to the handling of ABCs of builtin types, cause +# spurious inconsistent metaclass structure. See #1595. +# Structurally: Iterable[T], Reversible[T], Container[T] where T is the enum itself +class EnumMeta(ABCMeta): + def __iter__(self: Type[_T]) -> Iterator[_T]: ... + def __reversed__(self: Type[_T]) -> Iterator[_T]: ... + def __contains__(self: Type[_T], member: object) -> bool: ... + def __getitem__(self: Type[_T], name: str) -> _T: ... + @property + def __members__(self: Type[_T]) -> Mapping[str, _T]: ... + def __len__(self) -> int: ... + +class Enum(metaclass=EnumMeta): + name: str + value: Any + _name_: str + _value_: Any + _member_names_: List[str] # undocumented + _member_map_: Dict[str, Enum] # undocumented + _value2member_map_: Dict[int, Enum] # undocumented + if sys.version_info >= (3, 7): + _ignore_: Union[str, List[str]] + if sys.version_info >= (3, 6): + _order_: str + @classmethod + def _missing_(cls, value: object) -> Any: ... + @staticmethod + def _generate_next_value_(name: str, start: int, count: int, last_values: List[Any]) -> Any: ... + def __new__(cls: Type[_T], value: object) -> _T: ... + def __repr__(self) -> str: ... + def __str__(self) -> str: ... + def __dir__(self) -> List[str]: ... + def __format__(self, format_spec: str) -> str: ... + def __hash__(self) -> Any: ... + def __reduce_ex__(self, proto: object) -> Any: ... + +class IntEnum(int, Enum): + value: int + +def unique(enumeration: _S) -> _S: ... + +if sys.version_info >= (3, 6): + _auto_null: Any + + # subclassing IntFlag so it picks up all implemented base functions, best modeling behavior of enum.auto() + class auto(IntFlag): + value: Any + + class Flag(Enum): + def __contains__(self: _T, other: _T) -> bool: ... + def __repr__(self) -> str: ... + def __str__(self) -> str: ... + def __bool__(self) -> bool: ... + def __or__(self: _T, other: _T) -> _T: ... + def __and__(self: _T, other: _T) -> _T: ... + def __xor__(self: _T, other: _T) -> _T: ... + def __invert__(self: _T) -> _T: ... + + # The `type: ignore` comment is needed because mypy considers the type + # signatures of several methods defined in int and Flag to be incompatible. + class IntFlag(int, Flag): # type: ignore + def __or__(self: _T, other: Union[int, _T]) -> _T: ... + def __and__(self: _T, other: Union[int, _T]) -> _T: ... + def __xor__(self: _T, other: Union[int, _T]) -> _T: ... + __ror__ = __or__ + __rand__ = __and__ + __rxor__ = __xor__ diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/fb303/FacebookService.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/fb303/FacebookService.pyi new file mode 100644 index 0000000..ead5d24 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/fb303/FacebookService.pyi @@ -0,0 +1,297 @@ +from typing import Any +from thrift.Thrift import TProcessor # type: ignore + +fastbinary: Any + +class Iface: + def getName(self): ... + def getVersion(self): ... + def getStatus(self): ... + def getStatusDetails(self): ... + def getCounters(self): ... + def getCounter(self, key): ... + def setOption(self, key, value): ... + def getOption(self, key): ... + def getOptions(self): ... + def getCpuProfile(self, profileDurationInSec): ... + def aliveSince(self): ... + def reinitialize(self): ... + def shutdown(self): ... + +class Client(Iface): + def __init__(self, iprot, oprot=...) -> None: ... + def getName(self): ... + def send_getName(self): ... + def recv_getName(self): ... + def getVersion(self): ... + def send_getVersion(self): ... + def recv_getVersion(self): ... + def getStatus(self): ... + def send_getStatus(self): ... + def recv_getStatus(self): ... + def getStatusDetails(self): ... + def send_getStatusDetails(self): ... + def recv_getStatusDetails(self): ... + def getCounters(self): ... + def send_getCounters(self): ... + def recv_getCounters(self): ... + def getCounter(self, key): ... + def send_getCounter(self, key): ... + def recv_getCounter(self): ... + def setOption(self, key, value): ... + def send_setOption(self, key, value): ... + def recv_setOption(self): ... + def getOption(self, key): ... + def send_getOption(self, key): ... + def recv_getOption(self): ... + def getOptions(self): ... + def send_getOptions(self): ... + def recv_getOptions(self): ... + def getCpuProfile(self, profileDurationInSec): ... + def send_getCpuProfile(self, profileDurationInSec): ... + def recv_getCpuProfile(self): ... + def aliveSince(self): ... + def send_aliveSince(self): ... + def recv_aliveSince(self): ... + def reinitialize(self): ... + def send_reinitialize(self): ... + def shutdown(self): ... + def send_shutdown(self): ... + +class Processor(Iface, TProcessor): + def __init__(self, handler) -> None: ... + def process(self, iprot, oprot): ... + def process_getName(self, seqid, iprot, oprot): ... + def process_getVersion(self, seqid, iprot, oprot): ... + def process_getStatus(self, seqid, iprot, oprot): ... + def process_getStatusDetails(self, seqid, iprot, oprot): ... + def process_getCounters(self, seqid, iprot, oprot): ... + def process_getCounter(self, seqid, iprot, oprot): ... + def process_setOption(self, seqid, iprot, oprot): ... + def process_getOption(self, seqid, iprot, oprot): ... + def process_getOptions(self, seqid, iprot, oprot): ... + def process_getCpuProfile(self, seqid, iprot, oprot): ... + def process_aliveSince(self, seqid, iprot, oprot): ... + def process_reinitialize(self, seqid, iprot, oprot): ... + def process_shutdown(self, seqid, iprot, oprot): ... + +class getName_args: + thrift_spec: Any + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class getName_result: + thrift_spec: Any + success: Any + def __init__(self, success=...) -> None: ... + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class getVersion_args: + thrift_spec: Any + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class getVersion_result: + thrift_spec: Any + success: Any + def __init__(self, success=...) -> None: ... + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class getStatus_args: + thrift_spec: Any + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class getStatus_result: + thrift_spec: Any + success: Any + def __init__(self, success=...) -> None: ... + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class getStatusDetails_args: + thrift_spec: Any + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class getStatusDetails_result: + thrift_spec: Any + success: Any + def __init__(self, success=...) -> None: ... + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class getCounters_args: + thrift_spec: Any + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class getCounters_result: + thrift_spec: Any + success: Any + def __init__(self, success=...) -> None: ... + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class getCounter_args: + thrift_spec: Any + key: Any + def __init__(self, key=...) -> None: ... + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class getCounter_result: + thrift_spec: Any + success: Any + def __init__(self, success=...) -> None: ... + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class setOption_args: + thrift_spec: Any + key: Any + value: Any + def __init__(self, key=..., value=...) -> None: ... + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class setOption_result: + thrift_spec: Any + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class getOption_args: + thrift_spec: Any + key: Any + def __init__(self, key=...) -> None: ... + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class getOption_result: + thrift_spec: Any + success: Any + def __init__(self, success=...) -> None: ... + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class getOptions_args: + thrift_spec: Any + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class getOptions_result: + thrift_spec: Any + success: Any + def __init__(self, success=...) -> None: ... + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class getCpuProfile_args: + thrift_spec: Any + profileDurationInSec: Any + def __init__(self, profileDurationInSec=...) -> None: ... + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class getCpuProfile_result: + thrift_spec: Any + success: Any + def __init__(self, success=...) -> None: ... + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class aliveSince_args: + thrift_spec: Any + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class aliveSince_result: + thrift_spec: Any + success: Any + def __init__(self, success=...) -> None: ... + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class reinitialize_args: + thrift_spec: Any + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class shutdown_args: + thrift_spec: Any + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/fb303/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/fb303/__init__.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/gflags.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/gflags.pyi new file mode 100644 index 0000000..87edd4e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/gflags.pyi @@ -0,0 +1,242 @@ +from typing import Any, Callable, Dict, Iterable, IO, List, Optional, Sequence, Union +from types import ModuleType + +class Error(Exception): ... +FlagsError = Error + +class DuplicateFlag(FlagsError): ... + +class CantOpenFlagFileError(FlagsError): ... + +class DuplicateFlagCannotPropagateNoneToSwig(DuplicateFlag): ... + +class DuplicateFlagError(DuplicateFlag): + def __init__(self, flagname: str, flag_values: FlagValues, other_flag_values: FlagValues = ...) -> None: ... + +class IllegalFlagValueError(FlagsError): ... +IllegalFlagValue = IllegalFlagValueError + +class UnrecognizedFlag(FlagsError): ... + +class UnrecognizedFlagError(UnrecognizedFlag): + def __init__(self, flagname: str, flagvalue: str = ...) -> None: ... + +def get_help_width() -> int: ... +GetHelpWidth = get_help_width +def CutCommonSpacePrefix(text) -> str: ... +def text_wrap(text: str, length: int = ..., indent: str = ..., firstline_indent: str = ..., tabs: str = ...) -> str: ... +TextWrap = text_wrap +def doc_to_help(doc: str) -> str: ... +DocToHelp = doc_to_help + +class FlagValues: + def __init__(self) -> None: ... + def UseGnuGetOpt(self, use_gnu_getopt: bool = ...) -> None: ... + def is_gnu_getopt(self) -> bool: ... + IsGnuGetOpt = is_gnu_getopt + # TODO dict type + def FlagDict(self) -> dict: ... + def flags_by_module_dict(self) -> Dict[str, List[Flag]]: ... + FlagsByModuleDict = flags_by_module_dict + def flags_by_module_id_dict(self) -> Dict[int, List[Flag]]: ... + FlagsByModuleIdDict = flags_by_module_id_dict + def key_flags_by_module_dict(self) -> Dict[str, List[Flag]]: ... + KeyFlagsByModuleDict = key_flags_by_module_dict + def find_module_defining_flag(self, flagname: str, default: str = ...) -> str: ... + FindModuleDefiningFlag = find_module_defining_flag + def find_module_id_defining_flag(self, flagname: str, default: int = ...) -> int: ... + FindModuleIdDefiningFlag = find_module_id_defining_flag + def append_flag_values(self, flag_values: FlagValues) -> None: ... + AppendFlagValues = append_flag_values + def remove_flag_values(self, flag_values: FlagValues) -> None: ... + RemoveFlagValues = remove_flag_values + def __setitem__(self, name: str, flag: Flag) -> None: ... + def __getitem__(self, name: str) -> Flag: ... + def __getattr__(self, name: str) -> Any: ... + def __setattr__(self, name: str, value: Any): ... + def __delattr__(self, flag_name: str) -> None: ... + def set_default(self, name: str, value: Any) -> None: ... + SetDefault = set_default + def __contains__(self, name: str) -> bool: ... + has_key = __contains__ + def __iter__(self) -> Iterable[str]: ... + def __call__(self, argv: List[str], known_only: bool = ...) -> List[str]: ... + def reset(self) -> None: ... + Reset = reset + def RegisteredFlags(self) -> List[str]: ... + def flag_values_dict(self) -> Dict[str, Any]: ... + FlagValuesDict = flag_values_dict + def __str__(self) -> str: ... + def GetHelp(self, prefix: str = ...) -> str: ... + def module_help(self, module: Union[ModuleType, str]) -> str: ... + ModuleHelp = module_help + def main_module_help(self) -> str: ... + MainModuleHelp = main_module_help + def get(self, name: str, default: Any) -> Any: ... + def ShortestUniquePrefixes(self, fl: Dict[str, Flag]) -> Dict[str, str]: ... + def ExtractFilename(self, flagfile_str: str) -> str: ... + def read_flags_from_files(self, argv: List[str], force_gnu: bool = ...) -> List[str]: ... + ReadFlagsFromFiles = read_flags_from_files + def flags_into_string(self) -> str: ... + FlagsIntoString = flags_into_string + def append_flags_into_file(self, filename: str) -> None: ... + AppendFlagsIntoFile = append_flags_into_file + def write_help_in_xml_format(self, outfile: IO[str] = ...) -> None: ... + WriteHelpInXMLFormat = write_help_in_xml_format + # TODO validator: gflags_validators.Validator + def AddValidator(self, validator: Any) -> None: ... + +FLAGS: FlagValues + +class Flag: + name: str + default: Any + default_as_str: str + value: Any + help: str + short_name: str + boolean = False + present = False + parser: ArgumentParser + serializer: ArgumentSerializer + allow_override = False + + def __init__(self, parser: ArgumentParser, serializer: ArgumentSerializer, name: str, + default: Optional[str], help_string: str, short_name: str = ..., boolean: bool = ..., + allow_override: bool = ...) -> None: ... + def Parse(self, argument: Any) -> Any: ... + def Unparse(self) -> None: ... + def Serialize(self) -> str: ... + def SetDefault(self, value: Any) -> None: ... + def Type(self) -> str: ... + def WriteInfoInXMLFormat(self, outfile: IO[str], module_name: str, is_key: bool = ..., indent: str = ...) -> None: ... + +class ArgumentParser(object): + syntactic_help: str + # TODO what is this + def parse(self, argument: Any) -> Any: ... + Parser = parse + def flag_type(self) -> str: ... + Type = flag_type + def WriteCustomInfoInXMLFormat(self, outfile: IO[str], indent: str) -> None: ... + +class ArgumentSerializer: + def Serialize(self, value: Any) -> unicode: ... + +class ListSerializer(ArgumentSerializer): + def __init__(self, list_sep: str) -> None: ... + def Serialize(self, value: List[Any]) -> str: ... + +def register_validator(flag_name: str, + checker: Callable[[Any], bool], + message: str = ..., + flag_values: FlagValues = ...) -> None: ... +RegisterValidator = register_validator +def mark_flag_as_required(flag_name: str, flag_values: FlagValues = ...) -> None: ... +MarkFlagAsRequired = mark_flag_as_required + +def DEFINE(parser: ArgumentParser, name: str, default: Any, help: str, + flag_values: FlagValues = ..., serializer: ArgumentSerializer = ..., **args: Any) -> None: ... +def DEFINE_flag(flag: Flag, flag_values: FlagValues = ...) -> None: ... +def declare_key_flag(flag_name: str, flag_values: FlagValues = ...) -> None: ... +DECLARE_key_flag = declare_key_flag +def adopt_module_key_flags(module: ModuleType, flag_values: FlagValues = ...) -> None: ... +ADOPT_module_key_flags = adopt_module_key_flags +def DEFINE_string(name: str, default: Optional[str], help: str, flag_values: FlagValues = ..., **args: Any): ... + +class BooleanParser(ArgumentParser): + def Convert(self, argument: Any) -> bool: ... + def Parse(self, argument: Any) -> bool: ... + +class BooleanFlag(Flag): + def __init__(self, name: str, default: Optional[bool], help: str, short_name=..., **args: Any) -> None: ... + +def DEFINE_boolean(name: str, default: Optional[bool], help: str, flag_values: FlagValues = ..., **args: Any) -> None: ... + +DEFINE_bool = DEFINE_boolean + +class HelpFlag(BooleanFlag): + def __init__(self) -> None: ... + def Parse(self, arg: Any) -> None: ... + +class HelpXMLFlag(BooleanFlag): + def __init__(self) -> None: ... + def Parse(self, arg: Any) -> None: ... + +class HelpshortFlag(BooleanFlag): + def __init__(self) -> None: ... + def Parse(self, arg: Any) -> None: ... + +class NumericParser(ArgumentParser): + def IsOutsideBounds(self, val: float) -> bool: ... + def Parse(self, argument: Any) -> float: ... + def WriteCustomInfoInXMLFormat(self, outfile: IO[str], indent: str) -> None: ... + def Convert(self, argument: Any) -> Any: ... + +class FloatParser(NumericParser): + number_article: str + number_name: str + syntactic_help: str + def __init__(self, lower_bound: float = ..., upper_bound: float = ...) -> None: ... + def Convert(self, argument: Any) -> float: ... + +def DEFINE_float(name: str, default: Optional[float], help: str, lower_bound: float = ..., + upper_bound: float = ..., flag_values: FlagValues = ..., **args: Any) -> None: ... + +class IntegerParser(NumericParser): + number_article: str + number_name: str + syntactic_help: str + def __init__(self, lower_bound: int = ..., upper_bound: int = ...) -> None: ... + def Convert(self, argument: Any) -> int: ... + +def DEFINE_integer(name: str, default: Optional[int], help: str, lower_bound: int = ..., + upper_bound: int = ..., flag_values: FlagValues = ..., **args: Any) -> None: ... + +class EnumParser(ArgumentParser): + def __init__(self, enum_values: List[str]) -> None: ... + def Parse(self, argument: Any) -> Any: ... + +class EnumFlag(Flag): + def __init__(self, name: str, default: Optional[str], help: str, enum_values: List[str], + short_name: str, **args: Any) -> None: ... + +def DEFINE_enum(name: str, default: Optional[str], enum_values: List[str], help: str, + flag_values: FlagValues = ..., **args: Any) -> None: ... + +class BaseListParser(ArgumentParser): + def __init__(self, token: str = ..., name: str = ...) -> None: ... + def Parse(self, argument: Any) -> list: ... + +class ListParser(BaseListParser): + def __init__(self) -> None: ... + def WriteCustomInfoInXMLFormat(self, outfile: IO[str], indent: str): ... + +class WhitespaceSeparatedListParser(BaseListParser): + def __init__(self) -> None: ... + def WriteCustomInfoInXMLFormat(self, outfile: IO[str], indent: str): ... + +def DEFINE_list(name: str, default: Optional[List[str]], help: str, flag_values: FlagValues = ..., **args: Any) -> None: ... +def DEFINE_spaceseplist(name: str, default: Optional[List[str]], help: str, flag_values: FlagValues = ..., + **args: Any) -> None: ... + +class MultiFlag(Flag): + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + def Parse(self, arguments: Any) -> None: ... + def Serialize(self) -> str: ... + +def DEFINE_multi_string(name: str, default: Optional[Union[str, List[str]]], help: str, + flag_values: FlagValues = ..., **args: Any) -> None: ... +DEFINE_multistring = DEFINE_multi_string + +def DEFINE_multi_integer(name: str, default: Optional[Union[int, List[int]]], help: str, lower_bound: int = ..., + upper_bound: int = ..., flag_values: FlagValues = ..., **args: Any) -> None: ... +DEFINE_multi_int = DEFINE_multi_integer + +def DEFINE_multi_float(name: str, default: Optional[Union[float, List[float]]], help: str, + lower_bound: float = ..., upper_bound: float = ..., + flag_values: FlagValues = ..., **args: Any) -> None: ... + +def DEFINE_multi_enum(name: str, default: Optional[Union[Sequence[str], str]], + enum_values: Sequence[str], help: str, + flag_values: FlagValues = ..., case_sensitive: bool = ..., **args: Any): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/kazoo/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/kazoo/__init__.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/kazoo/client.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/kazoo/client.pyi new file mode 100644 index 0000000..0d3fc00 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/kazoo/client.pyi @@ -0,0 +1,97 @@ +from typing import Any + +string_types: Any +bytes_types: Any +LOST_STATES: Any +ENVI_VERSION: Any +ENVI_VERSION_KEY: Any +log: Any + +class KazooClient: + logger: Any + handler: Any + auth_data: Any + default_acl: Any + randomize_hosts: Any + hosts: Any + chroot: Any + state: Any + state_listeners: Any + read_only: Any + retry: Any + Barrier: Any + Counter: Any + DoubleBarrier: Any + ChildrenWatch: Any + DataWatch: Any + Election: Any + NonBlockingLease: Any + MultiNonBlockingLease: Any + Lock: Any + Party: Any + Queue: Any + LockingQueue: Any + SetPartitioner: Any + Semaphore: Any + ShallowParty: Any + def __init__(self, hosts=..., timeout=..., client_id=..., handler=..., default_acl=..., auth_data=..., read_only=..., + randomize_hosts=..., connection_retry=..., command_retry=..., logger=..., **kwargs) -> None: ... + @property + def client_state(self): ... + @property + def client_id(self): ... + @property + def connected(self): ... + def set_hosts(self, hosts, randomize_hosts=...): ... + def add_listener(self, listener): ... + def remove_listener(self, listener): ... + def start(self, timeout=...): ... + def start_async(self): ... + def stop(self): ... + def restart(self): ... + def close(self): ... + def command(self, cmd=...): ... + def server_version(self, retries=...): ... + def add_auth(self, scheme, credential): ... + def add_auth_async(self, scheme, credential): ... + def unchroot(self, path): ... + def sync_async(self, path): ... + def sync(self, path): ... + def create(self, path, value=..., acl=..., ephemeral=..., sequence=..., makepath=...): ... + def create_async(self, path, value=..., acl=..., ephemeral=..., sequence=..., makepath=...): ... + def ensure_path(self, path, acl=...): ... + def ensure_path_async(self, path, acl=...): ... + def exists(self, path, watch=...): ... + def exists_async(self, path, watch=...): ... + def get(self, path, watch=...): ... + def get_async(self, path, watch=...): ... + def get_children(self, path, watch=..., include_data=...): ... + def get_children_async(self, path, watch=..., include_data=...): ... + def get_acls(self, path): ... + def get_acls_async(self, path): ... + def set_acls(self, path, acls, version=...): ... + def set_acls_async(self, path, acls, version=...): ... + def set(self, path, value, version=...): ... + def set_async(self, path, value, version=...): ... + def transaction(self): ... + def delete(self, path, version=..., recursive=...): ... + def delete_async(self, path, version=...): ... + def reconfig(self, joining, leaving, new_members, from_config=...): ... + def reconfig_async(self, joining, leaving, new_members, from_config): ... + +class TransactionRequest: + client: Any + operations: Any + committed: Any + def __init__(self, client) -> None: ... + def create(self, path, value=..., acl=..., ephemeral=..., sequence=...): ... + def delete(self, path, version=...): ... + def set_data(self, path, value, version=...): ... + def check(self, path, version): ... + def commit_async(self): ... + def commit(self): ... + def __enter__(self): ... + def __exit__(self, exc_type, exc_value, exc_tb): ... + +class KazooState: + ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/kazoo/exceptions.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/kazoo/exceptions.pyi new file mode 100644 index 0000000..4dd76cc --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/kazoo/exceptions.pyi @@ -0,0 +1,58 @@ +from typing import Any + +class KazooException(Exception): ... +class ZookeeperError(KazooException): ... +class CancelledError(KazooException): ... +class ConfigurationError(KazooException): ... +class ZookeeperStoppedError(KazooException): ... +class ConnectionDropped(KazooException): ... +class LockTimeout(KazooException): ... +class WriterNotClosedException(KazooException): ... + +EXCEPTIONS: Any + +class RolledBackError(ZookeeperError): ... +class SystemZookeeperError(ZookeeperError): ... +class RuntimeInconsistency(ZookeeperError): ... +class DataInconsistency(ZookeeperError): ... +class ConnectionLoss(ZookeeperError): ... +class MarshallingError(ZookeeperError): ... +class UnimplementedError(ZookeeperError): ... +class OperationTimeoutError(ZookeeperError): ... +class BadArgumentsError(ZookeeperError): ... +class NewConfigNoQuorumError(ZookeeperError): ... +class ReconfigInProcessError(ZookeeperError): ... +class APIError(ZookeeperError): ... +class NoNodeError(ZookeeperError): ... +class NoAuthError(ZookeeperError): ... +class BadVersionError(ZookeeperError): ... +class NoChildrenForEphemeralsError(ZookeeperError): ... +class NodeExistsError(ZookeeperError): ... +class NotEmptyError(ZookeeperError): ... +class SessionExpiredError(ZookeeperError): ... +class InvalidCallbackError(ZookeeperError): ... +class InvalidACLError(ZookeeperError): ... +class AuthFailedError(ZookeeperError): ... +class SessionMovedError(ZookeeperError): ... +class NotReadOnlyCallError(ZookeeperError): ... +class ConnectionClosedError(SessionExpiredError): ... + +ConnectionLossException: Any +MarshallingErrorException: Any +SystemErrorException: Any +RuntimeInconsistencyException: Any +DataInconsistencyException: Any +UnimplementedException: Any +OperationTimeoutException: Any +BadArgumentsException: Any +ApiErrorException: Any +NoNodeException: Any +NoAuthException: Any +BadVersionException: Any +NoChildrenForEphemeralsException: Any +NodeExistsException: Any +InvalidACLException: Any +AuthFailedException: Any +NotEmptyException: Any +SessionExpiredException: Any +InvalidCallbackException: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/kazoo/recipe/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/kazoo/recipe/__init__.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/kazoo/recipe/watchers.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/kazoo/recipe/watchers.pyi new file mode 100644 index 0000000..111a48c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/kazoo/recipe/watchers.pyi @@ -0,0 +1,21 @@ +from typing import Any + +log: Any + +class DataWatch: + def __init__(self, client, path, func=..., *args, **kwargs) -> None: ... + def __call__(self, func): ... + +class ChildrenWatch: + def __init__(self, client, path, func=..., allow_session_lost=..., send_event=...) -> None: ... + def __call__(self, func): ... + +class PatientChildrenWatch: + client: Any + path: Any + children: Any + time_boundary: Any + children_changed: Any + def __init__(self, client, path, time_boundary=...) -> None: ... + asy: Any + def start(self): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/pathlib2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/pathlib2.pyi new file mode 100644 index 0000000..42968fa --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/pathlib2.pyi @@ -0,0 +1,122 @@ +from typing import Any, Generator, IO, Optional, Sequence, Tuple, Type, TypeVar, Union, List +from types import TracebackType +import os +import sys + +_P = TypeVar('_P', bound='PurePath') + +if sys.version_info >= (3, 6): + _PurePathBase = os.PathLike[str] +else: + _PurePathBase = object + +class PurePath(_PurePathBase): + parts: Tuple[str, ...] + drive: str + root: str + anchor: str + name: str + suffix: str + suffixes: List[str] + stem: str + if sys.version_info < (3, 5): + def __init__(self, *pathsegments: str) -> None: ... + elif sys.version_info < (3, 6): + def __new__(cls: Type[_P], *args: Union[str, PurePath]) -> _P: ... + else: + def __new__(cls: Type[_P], *args: Union[str, os.PathLike[str]]) -> _P: ... + def __hash__(self) -> int: ... + def __lt__(self, other: PurePath) -> bool: ... + def __le__(self, other: PurePath) -> bool: ... + def __gt__(self, other: PurePath) -> bool: ... + def __ge__(self, other: PurePath) -> bool: ... + def __truediv__(self: _P, key: Union[str, PurePath]) -> _P: ... + if sys.version_info < (3,): + def __div__(self: _P, key: Union[str, PurePath]) -> _P: ... + def __bytes__(self) -> bytes: ... + def as_posix(self) -> str: ... + def as_uri(self) -> str: ... + def is_absolute(self) -> bool: ... + def is_reserved(self) -> bool: ... + def match(self, path_pattern: str) -> bool: ... + def relative_to(self: _P, *other: Union[str, PurePath]) -> _P: ... + def with_name(self: _P, name: str) -> _P: ... + def with_suffix(self: _P, suffix: str) -> _P: ... + def joinpath(self: _P, *other: Union[str, PurePath]) -> _P: ... + + @property + def parents(self: _P) -> Sequence[_P]: ... + @property + def parent(self: _P) -> _P: ... + +class PurePosixPath(PurePath): ... +class PureWindowsPath(PurePath): ... + +class Path(PurePath): + def __enter__(self) -> Path: ... + def __exit__(self, exc_type: Optional[Type[BaseException]], + exc_value: Optional[BaseException], + traceback: Optional[TracebackType]) -> Optional[bool]: ... + @classmethod + def cwd(cls: Type[_P]) -> _P: ... + def stat(self) -> os.stat_result: ... + def chmod(self, mode: int) -> None: ... + def exists(self) -> bool: ... + def glob(self, pattern: str) -> Generator[Path, None, None]: ... + def group(self) -> str: ... + def is_dir(self) -> bool: ... + def is_file(self) -> bool: ... + def is_symlink(self) -> bool: ... + def is_socket(self) -> bool: ... + def is_fifo(self) -> bool: ... + def is_block_device(self) -> bool: ... + def is_char_device(self) -> bool: ... + def iterdir(self) -> Generator[Path, None, None]: ... + def lchmod(self, mode: int) -> None: ... + def lstat(self) -> os.stat_result: ... + if sys.version_info < (3, 5): + def mkdir(self, mode: int = ..., + parents: bool = ...) -> None: ... + else: + def mkdir(self, mode: int = ..., parents: bool = ..., + exist_ok: bool = ...) -> None: ... + def open(self, mode: str = ..., buffering: int = ..., + encoding: Optional[str] = ..., errors: Optional[str] = ..., + newline: Optional[str] = ...) -> IO[Any]: ... + def owner(self) -> str: ... + def rename(self, target: Union[str, PurePath]) -> None: ... + def replace(self, target: Union[str, PurePath]) -> None: ... + if sys.version_info < (3, 6): + def resolve(self: _P) -> _P: ... + else: + def resolve(self: _P, strict: bool = ...) -> _P: ... + def rglob(self, pattern: str) -> Generator[Path, None, None]: ... + def rmdir(self) -> None: ... + def symlink_to(self, target: Union[str, Path], + target_is_directory: bool = ...) -> None: ... + def touch(self, mode: int = ..., exist_ok: bool = ...) -> None: ... + def unlink(self) -> None: ... + + if sys.version_info >= (3, 5): + @classmethod + def home(cls: Type[_P]) -> _P: ... + if sys.version_info < (3, 6): + def __new__(cls: Type[_P], *args: Union[str, PurePath], + **kwargs: Any) -> _P: ... + else: + def __new__(cls: Type[_P], *args: Union[str, os.PathLike[str]], + **kwargs: Any) -> _P: ... + + def absolute(self: _P) -> _P: ... + def expanduser(self: _P) -> _P: ... + def read_bytes(self) -> bytes: ... + def read_text(self, encoding: Optional[str] = ..., + errors: Optional[str] = ...) -> str: ... + def samefile(self, other_path: Union[str, bytes, int, Path]) -> bool: ... + def write_bytes(self, data: bytes) -> int: ... + def write_text(self, data: str, encoding: Optional[str] = ..., + errors: Optional[str] = ...) -> int: ... + + +class PosixPath(Path, PurePosixPath): ... +class WindowsPath(Path, PureWindowsPath): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/pymssql.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/pymssql.pyi new file mode 100644 index 0000000..8e08ee3 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/pymssql.pyi @@ -0,0 +1,48 @@ +from datetime import datetime, date, time + +from typing import Any, Dict, Tuple, Iterable, List, Optional, Union, Sequence + +Scalar = Union[int, float, str, datetime, date, time] +Result = Union[Tuple[Scalar, ...], Dict[str, Scalar]] + +class Connection(object): + def __init__(self, user, password, host, database, timeout, + login_timeout, charset, as_dict) -> None: ... + def autocommit(self, status: bool) -> None: ... + def close(self) -> None: ... + def commit(self) -> None: ... + def cursor(self) -> Cursor: ... + def rollback(self) -> None: ... + +class Cursor(object): + def __init__(self) -> None: ... + def __iter__(self): ... + def __next__(self) -> Any: ... + def callproc(self, procname: str, **kwargs) -> None: ... + def close(self) -> None: ... + def execute(self, stmt: str, + params: Optional[Union[Scalar, Tuple[Scalar, ...], + Dict[str, Scalar]]]) -> None: ... + def executemany(self, stmt: str, + params: Optional[Sequence[Tuple[Scalar, ...]]]) -> None: ... + def fetchall(self) -> List[Result]: ... + def fetchmany(self, size: Optional[int]) -> List[Result]: ... + def fetchone(self) -> Result: ... + +def connect(server: Optional[str], + user: Optional[str], + password: Optional[str], + database: Optional[str], + timeout: Optional[int], + login_timeout: Optional[int], + charset: Optional[str], + as_dict: Optional[bool], + host: Optional[str], + appname: Optional[str], + port: Optional[str], + + conn_properties: Optional[Union[str, Sequence[str]]], + autocommit: Optional[bool], + tds_version: Optional[str]) -> Connection: ... +def get_max_connections() -> int: ... +def set_max_connections(n: int) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/redis/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/redis/__init__.pyi new file mode 100644 index 0000000..333de49 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/redis/__init__.pyi @@ -0,0 +1,24 @@ +from . import client +from . import connection +from . import utils +from . import exceptions + +Redis = client.Redis +StrictRedis = client.StrictRedis +BlockingConnectionPool = connection.BlockingConnectionPool +ConnectionPool = connection.ConnectionPool +Connection = connection.Connection +SSLConnection = connection.SSLConnection +UnixDomainSocketConnection = connection.UnixDomainSocketConnection +from_url = utils.from_url +AuthenticationError = exceptions.AuthenticationError +BusyLoadingError = exceptions.BusyLoadingError +ConnectionError = exceptions.ConnectionError +DataError = exceptions.DataError +InvalidResponse = exceptions.InvalidResponse +PubSubError = exceptions.PubSubError +ReadOnlyError = exceptions.ReadOnlyError +RedisError = exceptions.RedisError +ResponseError = exceptions.ResponseError +TimeoutError = exceptions.TimeoutError +WatchError = exceptions.WatchError diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/redis/client.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/redis/client.pyi new file mode 100644 index 0000000..f416761 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/redis/client.pyi @@ -0,0 +1,292 @@ +from typing import Any + +SYM_EMPTY: Any + +def list_or_args(keys, args): ... +def timestamp_to_datetime(response): ... +def string_keys_to_dict(key_string, callback): ... +def dict_merge(*dicts): ... +def parse_debug_object(response): ... +def parse_object(response, infotype): ... +def parse_info(response): ... + +SENTINEL_STATE_TYPES: Any + +def parse_sentinel_state(item): ... +def parse_sentinel_master(response): ... +def parse_sentinel_masters(response): ... +def parse_sentinel_slaves_and_sentinels(response): ... +def parse_sentinel_get_master(response): ... +def pairs_to_dict(response): ... +def pairs_to_dict_typed(response, type_info): ... +def zset_score_pairs(response, **options): ... +def sort_return_tuples(response, **options): ... +def int_or_none(response): ... +def float_or_none(response): ... +def bool_ok(response): ... +def parse_client_list(response, **options): ... +def parse_config_get(response, **options): ... +def parse_scan(response, **options): ... +def parse_hscan(response, **options): ... +def parse_zscan(response, **options): ... +def parse_slowlog_get(response, **options): ... + +class StrictRedis: + RESPONSE_CALLBACKS: Any + @classmethod + def from_url(cls, url, db=..., **kwargs): ... + connection_pool: Any + response_callbacks: Any + def __init__(self, host=..., port=..., db=..., password=..., socket_timeout=..., socket_connect_timeout=..., + socket_keepalive=..., socket_keepalive_options=..., connection_pool=..., unix_socket_path=..., encoding=..., + encoding_errors=..., charset=..., errors=..., decode_responses=..., retry_on_timeout=..., ssl=..., + ssl_keyfile=..., ssl_certfile=..., ssl_cert_reqs=..., ssl_ca_certs=...) -> None: ... + def set_response_callback(self, command, callback): ... + def pipeline(self, transaction=..., shard_hint=...): ... + def transaction(self, func, *watches, **kwargs): ... + def lock(self, name, timeout=..., sleep=..., blocking_timeout=..., lock_class=..., thread_local=...): ... + def pubsub(self, **kwargs): ... + def execute_command(self, *args, **options): ... + def parse_response(self, connection, command_name, **options): ... + def bgrewriteaof(self): ... + def bgsave(self): ... + def client_kill(self, address): ... + def client_list(self): ... + def client_getname(self): ... + def client_setname(self, name): ... + def config_get(self, pattern=...): ... + def config_set(self, name, value): ... + def config_resetstat(self): ... + def config_rewrite(self): ... + def dbsize(self): ... + def debug_object(self, key): ... + def echo(self, value): ... + def flushall(self): ... + def flushdb(self): ... + def info(self, section=...): ... + def lastsave(self): ... + def object(self, infotype, key): ... + def ping(self): ... + def save(self): ... + def sentinel(self, *args): ... + def sentinel_get_master_addr_by_name(self, service_name): ... + def sentinel_master(self, service_name): ... + def sentinel_masters(self): ... + def sentinel_monitor(self, name, ip, port, quorum): ... + def sentinel_remove(self, name): ... + def sentinel_sentinels(self, service_name): ... + def sentinel_set(self, name, option, value): ... + def sentinel_slaves(self, service_name): ... + def shutdown(self): ... + def slaveof(self, host=..., port=...): ... + def slowlog_get(self, num=...): ... + def slowlog_len(self): ... + def slowlog_reset(self): ... + def time(self): ... + def append(self, key, value): ... + def bitcount(self, key, start=..., end=...): ... + def bitop(self, operation, dest, *keys): ... + def bitpos(self, key, bit, start=..., end=...): ... + def decr(self, name, amount=...): ... + def delete(self, *names): ... + def __delitem__(self, name): ... + def dump(self, name): ... + def exists(self, name): ... + __contains__: Any + def expire(self, name, time): ... + def expireat(self, name, when): ... + def get(self, name): ... + def __getitem__(self, name): ... + def getbit(self, name, offset): ... + def getrange(self, key, start, end): ... + def getset(self, name, value): ... + def incr(self, name, amount=...): ... + def incrby(self, name, amount=...): ... + def incrbyfloat(self, name, amount=...): ... + def keys(self, pattern=...): ... + def mget(self, keys, *args): ... + def mset(self, *args, **kwargs): ... + def msetnx(self, *args, **kwargs): ... + def move(self, name, db): ... + def persist(self, name): ... + def pexpire(self, name, time): ... + def pexpireat(self, name, when): ... + def psetex(self, name, time_ms, value): ... + def pttl(self, name): ... + def randomkey(self): ... + def rename(self, src, dst): ... + def renamenx(self, src, dst): ... + def restore(self, name, ttl, value): ... + def set(self, name, value, ex=..., px=..., nx=..., xx=...): ... + def __setitem__(self, name, value): ... + def setbit(self, name, offset, value): ... + def setex(self, name, time, value): ... + def setnx(self, name, value): ... + def setrange(self, name, offset, value): ... + def strlen(self, name): ... + def substr(self, name, start, end=...): ... + def ttl(self, name): ... + def type(self, name): ... + def watch(self, *names): ... + def unwatch(self): ... + def blpop(self, keys, timeout=...): ... + def brpop(self, keys, timeout=...): ... + def brpoplpush(self, src, dst, timeout=...): ... + def lindex(self, name, index): ... + def linsert(self, name, where, refvalue, value): ... + def llen(self, name): ... + def lpop(self, name): ... + def lpush(self, name, *values): ... + def lpushx(self, name, value): ... + def lrange(self, name, start, end): ... + def lrem(self, name, count, value): ... + def lset(self, name, index, value): ... + def ltrim(self, name, start, end): ... + def rpop(self, name): ... + def rpoplpush(self, src, dst): ... + def rpush(self, name, *values): ... + def rpushx(self, name, value): ... + def sort(self, name, start=..., num=..., by=..., get=..., desc=..., alpha=..., store=..., groups=...): ... + def scan(self, cursor=..., match=..., count=...): ... + def scan_iter(self, match=..., count=...): ... + def sscan(self, name, cursor=..., match=..., count=...): ... + def sscan_iter(self, name, match=..., count=...): ... + def hscan(self, name, cursor=..., match=..., count=...): ... + def hscan_iter(self, name, match=..., count=...): ... + def zscan(self, name, cursor=..., match=..., count=..., score_cast_func=...): ... + def zscan_iter(self, name, match=..., count=..., score_cast_func=...): ... + def sadd(self, name, *values): ... + def scard(self, name): ... + def sdiff(self, keys, *args): ... + def sdiffstore(self, dest, keys, *args): ... + def sinter(self, keys, *args): ... + def sinterstore(self, dest, keys, *args): ... + def sismember(self, name, value): ... + def smembers(self, name): ... + def smove(self, src, dst, value): ... + def spop(self, name): ... + def srandmember(self, name, number=...): ... + def srem(self, name, *values): ... + def sunion(self, keys, *args): ... + def sunionstore(self, dest, keys, *args): ... + def zadd(self, name, *args, **kwargs): ... + def zcard(self, name): ... + def zcount(self, name, min, max): ... + def zincrby(self, name, value, amount=...): ... + def zinterstore(self, dest, keys, aggregate=...): ... + def zlexcount(self, name, min, max): ... + def zrange(self, name, start, end, desc=..., withscores=..., score_cast_func=...): ... + def zrangebylex(self, name, min, max, start=..., num=...): ... + def zrangebyscore(self, name, min, max, start=..., num=..., withscores=..., score_cast_func=...): ... + def zrank(self, name, value): ... + def zrem(self, name, *values): ... + def zremrangebylex(self, name, min, max): ... + def zremrangebyrank(self, name, min, max): ... + def zremrangebyscore(self, name, min, max): ... + def zrevrange(self, name, start, end, withscores=..., score_cast_func=...): ... + def zrevrangebyscore(self, name, max, min, start=..., num=..., withscores=..., score_cast_func=...): ... + def zrevrank(self, name, value): ... + def zscore(self, name, value): ... + def zunionstore(self, dest, keys, aggregate=...): ... + def pfadd(self, name, *values): ... + def pfcount(self, name): ... + def pfmerge(self, dest, *sources): ... + def hdel(self, name, *keys): ... + def hexists(self, name, key): ... + def hget(self, name, key): ... + def hgetall(self, name): ... + def hincrby(self, name, key, amount=...): ... + def hincrbyfloat(self, name, key, amount=...): ... + def hkeys(self, name): ... + def hlen(self, name): ... + def hset(self, name, key, value): ... + def hsetnx(self, name, key, value): ... + def hmset(self, name, mapping): ... + def hmget(self, name, keys, *args): ... + def hvals(self, name): ... + def publish(self, channel, message): ... + def eval(self, script, numkeys, *keys_and_args): ... + def evalsha(self, sha, numkeys, *keys_and_args): ... + def script_exists(self, *args): ... + def script_flush(self): ... + def script_kill(self): ... + def script_load(self, script): ... + def register_script(self, script): ... + +class Redis(StrictRedis): + RESPONSE_CALLBACKS: Any + def pipeline(self, transaction=..., shard_hint=...): ... + def setex(self, name, value, time): ... + def lrem(self, name, value, num=...): ... + def zadd(self, name, *args, **kwargs): ... + +class PubSub: + PUBLISH_MESSAGE_TYPES: Any + UNSUBSCRIBE_MESSAGE_TYPES: Any + connection_pool: Any + shard_hint: Any + ignore_subscribe_messages: Any + connection: Any + encoding: Any + encoding_errors: Any + decode_responses: Any + def __init__(self, connection_pool, shard_hint=..., ignore_subscribe_messages=...) -> None: ... + def __del__(self): ... + channels: Any + patterns: Any + def reset(self): ... + def close(self): ... + def on_connect(self, connection): ... + def encode(self, value): ... + @property + def subscribed(self): ... + def execute_command(self, *args, **kwargs): ... + def parse_response(self, block=...): ... + def psubscribe(self, *args, **kwargs): ... + def punsubscribe(self, *args): ... + def subscribe(self, *args, **kwargs): ... + def unsubscribe(self, *args): ... + def listen(self): ... + def get_message(self, ignore_subscribe_messages=...): ... + def handle_message(self, response, ignore_subscribe_messages=...): ... + def run_in_thread(self, sleep_time=...): ... + +class BasePipeline: + UNWATCH_COMMANDS: Any + connection_pool: Any + connection: Any + response_callbacks: Any + transaction: Any + shard_hint: Any + watching: Any + def __init__(self, connection_pool, response_callbacks, transaction, shard_hint) -> None: ... + def __enter__(self): ... + def __exit__(self, exc_type, exc_value, traceback): ... + def __del__(self): ... + def __len__(self): ... + command_stack: Any + scripts: Any + explicit_transaction: Any + def reset(self): ... + def multi(self): ... + def execute_command(self, *args, **kwargs): ... + def immediate_execute_command(self, *args, **options): ... + def pipeline_execute_command(self, *args, **options): ... + def raise_first_error(self, commands, response): ... + def annotate_exception(self, exception, number, command): ... + def parse_response(self, connection, command_name, **options): ... + def load_scripts(self): ... + def execute(self, raise_on_error=...): ... + def watch(self, *names): ... + def unwatch(self): ... + def script_load_for_pipeline(self, script): ... + +class StrictPipeline(BasePipeline, StrictRedis): ... +class Pipeline(BasePipeline, Redis): ... + +class Script: + registered_client: Any + script: Any + sha: Any + def __init__(self, registered_client, script) -> None: ... + def __call__(self, keys=..., args=..., client=...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/redis/connection.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/redis/connection.pyi new file mode 100644 index 0000000..7b7ddef --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/redis/connection.pyi @@ -0,0 +1,134 @@ +from typing import Any + +ssl_available: Any +hiredis_version: Any +HIREDIS_SUPPORTS_CALLABLE_ERRORS: Any +HIREDIS_SUPPORTS_BYTE_BUFFER: Any +msg: Any +HIREDIS_USE_BYTE_BUFFER: Any +SYM_STAR: Any +SYM_DOLLAR: Any +SYM_CRLF: Any +SYM_EMPTY: Any +SERVER_CLOSED_CONNECTION_ERROR: Any + +class Token: + value: Any + def __init__(self, value) -> None: ... + +class BaseParser: + EXCEPTION_CLASSES: Any + def parse_error(self, response): ... + +class SocketBuffer: + socket_read_size: Any + bytes_written: Any + bytes_read: Any + def __init__(self, socket, socket_read_size) -> None: ... + @property + def length(self): ... + def read(self, length): ... + def readline(self): ... + def purge(self): ... + def close(self): ... + +class PythonParser(BaseParser): + encoding: Any + socket_read_size: Any + def __init__(self, socket_read_size) -> None: ... + def __del__(self): ... + def on_connect(self, connection): ... + def on_disconnect(self): ... + def can_read(self): ... + def read_response(self): ... + +class HiredisParser(BaseParser): + socket_read_size: Any + def __init__(self, socket_read_size) -> None: ... + def __del__(self): ... + def on_connect(self, connection): ... + def on_disconnect(self): ... + def can_read(self): ... + def read_response(self): ... + +DefaultParser: Any + +class Connection: + description_format: Any + pid: Any + host: Any + port: Any + db: Any + password: Any + socket_timeout: Any + socket_connect_timeout: Any + socket_keepalive: Any + socket_keepalive_options: Any + retry_on_timeout: Any + encoding: Any + encoding_errors: Any + decode_responses: Any + def __init__(self, host=..., port=..., db=..., password=..., socket_timeout=..., socket_connect_timeout=..., + socket_keepalive=..., socket_keepalive_options=..., retry_on_timeout=..., encoding=..., encoding_errors=..., + decode_responses=..., parser_class=..., socket_read_size=...) -> None: ... + def __del__(self): ... + def register_connect_callback(self, callback): ... + def clear_connect_callbacks(self): ... + def connect(self): ... + def on_connect(self): ... + def disconnect(self): ... + def send_packed_command(self, command): ... + def send_command(self, *args): ... + def can_read(self): ... + def read_response(self): ... + def encode(self, value): ... + def pack_command(self, *args): ... + def pack_commands(self, commands): ... + +class SSLConnection(Connection): + description_format: Any + keyfile: Any + certfile: Any + cert_reqs: Any + ca_certs: Any + def __init__(self, ssl_keyfile=..., ssl_certfile=..., ssl_cert_reqs=..., ssl_ca_certs=..., **kwargs) -> None: ... + +class UnixDomainSocketConnection(Connection): + description_format: Any + pid: Any + path: Any + db: Any + password: Any + socket_timeout: Any + retry_on_timeout: Any + encoding: Any + encoding_errors: Any + decode_responses: Any + def __init__(self, path=..., db=..., password=..., socket_timeout=..., encoding=..., encoding_errors=..., + decode_responses=..., retry_on_timeout=..., parser_class=..., socket_read_size=...) -> None: ... + +class ConnectionPool: + @classmethod + def from_url(cls, url, db=..., **kwargs): ... + connection_class: Any + connection_kwargs: Any + max_connections: Any + def __init__(self, connection_class=..., max_connections=..., **connection_kwargs) -> None: ... + pid: Any + def reset(self): ... + def get_connection(self, command_name, *keys, **options): ... + def make_connection(self): ... + def release(self, connection): ... + def disconnect(self): ... + +class BlockingConnectionPool(ConnectionPool): + queue_class: Any + timeout: Any + def __init__(self, max_connections=..., timeout=..., connection_class=..., queue_class=..., **connection_kwargs) -> None: ... + pid: Any + pool: Any + def reset(self): ... + def make_connection(self): ... + def get_connection(self, command_name, *keys, **options): ... + def release(self, connection): ... + def disconnect(self): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/redis/exceptions.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/redis/exceptions.pyi new file mode 100644 index 0000000..e0cd08a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/redis/exceptions.pyi @@ -0,0 +1,17 @@ +class RedisError(Exception): ... + +def __unicode__(self): ... + +class AuthenticationError(RedisError): ... +class ConnectionError(RedisError): ... +class TimeoutError(RedisError): ... +class BusyLoadingError(ConnectionError): ... +class InvalidResponse(RedisError): ... +class ResponseError(RedisError): ... +class DataError(RedisError): ... +class PubSubError(RedisError): ... +class WatchError(RedisError): ... +class NoScriptError(ResponseError): ... +class ExecAbortError(ResponseError): ... +class ReadOnlyError(ResponseError): ... +class LockError(RedisError, ValueError): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/redis/utils.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/redis/utils.pyi new file mode 100644 index 0000000..9559abb --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/redis/utils.pyi @@ -0,0 +1,8 @@ +from typing import Any + +HIREDIS_AVAILABLE: Any + +def from_url(url, db=..., **kwargs): ... +def pipeline(redis_obj): ... + +class dummy: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/routes/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/routes/__init__.pyi new file mode 100644 index 0000000..8a1261f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/routes/__init__.pyi @@ -0,0 +1,15 @@ +from . import mapper +from . import util + +class _RequestConfig: + def __getattr__(self, name): ... + def __setattr__(self, name, value): ... + def __delattr__(self, name): ... + def load_wsgi_environ(self, environ): ... + +def request_config(original=...): ... + +Mapper = mapper.Mapper +redirect_to = util.redirect_to +url_for = util.url_for +URLGenerator = util.URLGenerator diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/routes/mapper.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/routes/mapper.pyi new file mode 100644 index 0000000..f834d08 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/routes/mapper.pyi @@ -0,0 +1,67 @@ +from typing import Any + +COLLECTION_ACTIONS: Any +MEMBER_ACTIONS: Any + +def strip_slashes(name): ... + +class SubMapperParent: + def submapper(self, **kargs): ... + def collection(self, collection_name, resource_name, path_prefix=..., member_prefix=..., controller=..., + collection_actions=..., member_actions=..., member_options=..., **kwargs): ... + +class SubMapper(SubMapperParent): + kwargs: Any + obj: Any + collection_name: Any + member: Any + resource_name: Any + formatted: Any + def __init__(self, obj, resource_name=..., collection_name=..., actions=..., formatted=..., **kwargs) -> None: ... + def connect(self, *args, **kwargs): ... + def link(self, rel=..., name=..., action=..., method=..., formatted=..., **kwargs): ... + def new(self, **kwargs): ... + def edit(self, **kwargs): ... + def action(self, name=..., action=..., method=..., formatted=..., **kwargs): ... + def index(self, name=..., **kwargs): ... + def show(self, name=..., **kwargs): ... + def create(self, **kwargs): ... + def update(self, **kwargs): ... + def delete(self, **kwargs): ... + def add_actions(self, actions): ... + def __enter__(self): ... + def __exit__(self, type, value, tb): ... + +class Mapper(SubMapperParent): + matchlist: Any + maxkeys: Any + minkeys: Any + urlcache: Any + prefix: Any + req_data: Any + directory: Any + always_scan: Any + controller_scan: Any + debug: Any + append_slash: Any + sub_domains: Any + sub_domains_ignore: Any + domain_match: Any + explicit: Any + encoding: Any + decode_errors: Any + hardcode_names: Any + minimization: Any + create_regs_lock: Any + def __init__(self, controller_scan=..., directory=..., always_scan=..., register=..., explicit=...) -> None: ... + environ: Any + def extend(self, routes, path_prefix=...): ... + def make_route(self, *args, **kargs): ... + def connect(self, *args, **kargs): ... + def create_regs(self, *args, **kwargs): ... + def match(self, url=..., environ=...): ... + def routematch(self, url=..., environ=...): ... + obj: Any + def generate(self, *args, **kargs): ... + def resource(self, member_name, collection_name, **kwargs): ... + def redirect(self, match_path, destination_path, *args, **kwargs): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/routes/util.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/routes/util.pyi new file mode 100644 index 0000000..e3be1d4 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/routes/util.pyi @@ -0,0 +1,20 @@ +from typing import Any + +class RoutesException(Exception): ... +class MatchException(RoutesException): ... +class GenerationException(RoutesException): ... + +def url_for(*args, **kargs): ... + +class URLGenerator: + mapper: Any + environ: Any + def __init__(self, mapper, environ) -> None: ... + def __call__(self, *args, **kargs): ... + def current(self, *args, **kwargs): ... + +def redirect_to(*args, **kargs): ... +def cache_hostinfo(environ): ... +def controller_scan(directory=...): ... +def as_unicode(value, encoding, errors=...): ... +def ascii_characters(string): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/scribe/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/scribe/__init__.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/scribe/scribe.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/scribe/scribe.pyi new file mode 100644 index 0000000..3530bf8 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/scribe/scribe.pyi @@ -0,0 +1,39 @@ +from typing import Any + +import fb303.FacebookService +from .ttypes import * # noqa: F403 +from thrift.Thrift import TProcessor # type: ignore # We don't have thrift stubs in typeshed + +class Iface(fb303.FacebookService.Iface): + def Log(self, messages): ... + +class Client(fb303.FacebookService.Client, Iface): + def __init__(self, iprot, oprot=...) -> None: ... + def Log(self, messages): ... + def send_Log(self, messages): ... + def recv_Log(self): ... + +class Processor(fb303.FacebookService.Processor, Iface, TProcessor): + def __init__(self, handler) -> None: ... + def process(self, iprot, oprot): ... + def process_Log(self, seqid, iprot, oprot): ... + +class Log_args: + thrift_spec: Any + messages: Any + def __init__(self, messages=...) -> None: ... + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class Log_result: + thrift_spec: Any + success: Any + def __init__(self, success=...) -> None: ... + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/scribe/ttypes.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/scribe/ttypes.pyi new file mode 100644 index 0000000..5bb7ded --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/scribe/ttypes.pyi @@ -0,0 +1,18 @@ +from typing import Any + +fastbinary: Any + +class ResultCode: + OK: Any + TRY_LATER: Any + +class LogEntry: + thrift_spec: Any + category: Any + message: Any + def __init__(self, category=..., message=...) -> None: ... + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/__init__.pyi new file mode 100644 index 0000000..3bed050 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/__init__.pyi @@ -0,0 +1,96 @@ +# Stubs for six (Python 2.7) + +from __future__ import print_function + +import types +from typing import ( + Any, AnyStr, Callable, Dict, Iterable, Mapping, NoReturn, Optional, + Pattern, Text, Tuple, Type, TypeVar, Union, overload, ValuesView, KeysView, ItemsView, +) +import typing +import unittest + +# Exports +from __builtin__ import unichr as unichr +from StringIO import StringIO as StringIO, StringIO as BytesIO +from functools import wraps as wraps +from . import moves + + +_T = TypeVar('_T') +_K = TypeVar('_K') +_V = TypeVar('_V') + +# TODO make constant, then move this stub to 2and3 +# https://github.com/python/typeshed/issues/17 +PY2 = True +PY3 = False +PY34 = False + +string_types = (str, unicode) +integer_types = (int, long) +class_types = (type, types.ClassType) +text_type = unicode +binary_type = str + +MAXSIZE: int + +# def add_move +# def remove_move + +def advance_iterator(it: typing.Iterator[_T]) -> _T: ... +next = advance_iterator + +def callable(obj: object) -> bool: ... + +def get_unbound_function(unbound: types.MethodType) -> types.FunctionType: ... +def create_bound_method(func: types.FunctionType, obj: object) -> types.MethodType: ... +def create_unbound_method(func: types.FunctionType, cls: Union[type, types.ClassType]) -> types.MethodType: ... + +class Iterator: + def next(self) -> Any: ... + +def get_method_function(meth: types.MethodType) -> types.FunctionType: ... +def get_method_self(meth: types.MethodType) -> Optional[object]: ... +def get_function_closure(fun: types.FunctionType) -> Optional[Tuple[types._Cell, ...]]: ... +def get_function_code(fun: types.FunctionType) -> types.CodeType: ... +def get_function_defaults(fun: types.FunctionType) -> Optional[Tuple[Any, ...]]: ... +def get_function_globals(fun: types.FunctionType) -> Dict[str, Any]: ... + +def iterkeys(d: Mapping[_K, _V]) -> typing.Iterator[_K]: ... +def itervalues(d: Mapping[_K, _V]) -> typing.Iterator[_V]: ... +def iteritems(d: Mapping[_K, _V]) -> typing.Iterator[Tuple[_K, _V]]: ... +# def iterlists + +def viewkeys(d: Mapping[_K, _V]) -> KeysView[_K]: ... +def viewvalues(d: Mapping[_K, _V]) -> ValuesView[_V]: ... +def viewitems(d: Mapping[_K, _V]) -> ItemsView[_K, _V]: ... + +def b(s: str) -> binary_type: ... +def u(s: str) -> text_type: ... +int2byte = chr +def byte2int(bs: binary_type) -> int: ... +def indexbytes(buf: binary_type, i: int) -> int: ... +def iterbytes(buf: binary_type) -> typing.Iterator[int]: ... + +def assertCountEqual(self: unittest.TestCase, first: Iterable[_T], second: Iterable[_T], msg: str = ...) -> None: ... +@overload +def assertRaisesRegex(self: unittest.TestCase, msg: str = ...) -> Any: ... +@overload +def assertRaisesRegex(self: unittest.TestCase, callable_obj: Callable[..., Any], *args: Any, **kwargs: Any) -> Any: ... +def assertRegex(self: unittest.TestCase, text: AnyStr, expected_regex: Union[AnyStr, Pattern[AnyStr]], + msg: str = ...) -> None: ... + +def reraise(tp: Optional[Type[BaseException]], value: Optional[BaseException], + tb: Optional[types.TracebackType] = ...) -> NoReturn: ... +def exec_(_code_: Union[unicode, types.CodeType], _globs_: Dict[str, Any] = ..., _locs_: Dict[str, Any] = ...): ... +def raise_from(value: Union[BaseException, Type[BaseException]], from_value: Optional[BaseException]) -> NoReturn: ... + +print_ = print + +def with_metaclass(meta: type, *bases: type) -> type: ... +def add_metaclass(metaclass: type) -> Callable[[_T], _T]: ... +def ensure_binary(s: Union[bytes, Text], encoding: str = ..., errors: str = ...) -> bytes: ... +def ensure_str(s: Union[bytes, Text], encoding: str = ..., errors: str = ...) -> str: ... +def ensure_text(s: Union[bytes, Text], encoding: str = ..., errors: str = ...) -> Text: ... +def python_2_unicode_compatible(klass: _T) -> _T: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/BaseHTTPServer.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/BaseHTTPServer.pyi new file mode 100644 index 0000000..16f7a9d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/BaseHTTPServer.pyi @@ -0,0 +1 @@ +from BaseHTTPServer import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/SimpleHTTPServer.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/SimpleHTTPServer.pyi new file mode 100644 index 0000000..97cfe77 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/SimpleHTTPServer.pyi @@ -0,0 +1 @@ +from SimpleHTTPServer import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/__init__.pyi new file mode 100644 index 0000000..ade0304 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/__init__.pyi @@ -0,0 +1,66 @@ +# Stubs for six.moves +# +# Note: Commented out items means they weren't implemented at the time. +# Uncomment them when the modules have been added to the typeshed. +from cStringIO import StringIO as cStringIO +from itertools import ifilter as filter +from itertools import ifilterfalse as filterfalse +from __builtin__ import raw_input as input +from __builtin__ import intern as intern +from itertools import imap as map +from os import getcwdu as getcwd +from os import getcwd as getcwdb +from __builtin__ import xrange as range +from __builtin__ import reload as reload_module +from __builtin__ import reduce as reduce +from pipes import quote as shlex_quote +from StringIO import StringIO as StringIO +from UserDict import UserDict as UserDict +from UserList import UserList as UserList +from UserString import UserString as UserString +from __builtin__ import xrange as xrange +from itertools import izip as zip +from itertools import izip_longest as zip_longest +import __builtin__ as builtins +from . import configparser +# import copy_reg as copyreg +# import gdbm as dbm_gnu +from . import _dummy_thread +from . import http_cookiejar +from . import http_cookies +from . import html_entities +from . import html_parser +from . import http_client +# import email.MIMEMultipart as email_mime_multipart +# import email.MIMENonMultipart as email_mime_nonmultipart +from . import email_mime_text +# import email.MIMEBase as email_mime_base +from . import BaseHTTPServer +# import CGIHTTPServer as CGIHTTPServer +from . import SimpleHTTPServer +from . import cPickle +from . import queue +from . import reprlib +from . import socketserver +from . import _thread +# import Tkinter as tkinter +# import Dialog as tkinter_dialog +# import FileDialog as tkinter_filedialog +# import ScrolledText as tkinter_scrolledtext +# import SimpleDialog as tkinter_simpledialog +# import Tix as tkinter_tix +# import ttk as tkinter_ttk +# import Tkconstants as tkinter_constants +# import Tkdnd as tkinter_dnd +# import tkColorChooser as tkinter_colorchooser +# import tkCommonDialog as tkinter_commondialog +# import tkFileDialog as tkinter_tkfiledialog +# import tkFont as tkinter_font +# import tkMessageBox as tkinter_messagebox +# import tkSimpleDialog as tkinter_tksimpledialog +from . import urllib_parse +from . import urllib_error +from . import urllib +from . import urllib_robotparser +from . import xmlrpc_client +# import SimpleXMLRPCServer as xmlrpc_server diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/_dummy_thread.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/_dummy_thread.pyi new file mode 100644 index 0000000..3efe922 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/_dummy_thread.pyi @@ -0,0 +1 @@ +from dummy_thread import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/_thread.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/_thread.pyi new file mode 100644 index 0000000..b27f4c7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/_thread.pyi @@ -0,0 +1 @@ +from thread import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/cPickle.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/cPickle.pyi new file mode 100644 index 0000000..ca829a7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/cPickle.pyi @@ -0,0 +1 @@ +from cPickle import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/configparser.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/configparser.pyi new file mode 100644 index 0000000..b2da53a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/configparser.pyi @@ -0,0 +1 @@ +from ConfigParser import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/email_mime_base.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/email_mime_base.pyi new file mode 100644 index 0000000..4df155c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/email_mime_base.pyi @@ -0,0 +1 @@ +from email.mime.base import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/email_mime_multipart.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/email_mime_multipart.pyi new file mode 100644 index 0000000..4f31241 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/email_mime_multipart.pyi @@ -0,0 +1 @@ +from email.mime.multipart import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/email_mime_nonmultipart.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/email_mime_nonmultipart.pyi new file mode 100644 index 0000000..c15c8c0 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/email_mime_nonmultipart.pyi @@ -0,0 +1 @@ +from email.mime.nonmultipart import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/email_mime_text.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/email_mime_text.pyi new file mode 100644 index 0000000..214bf1e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/email_mime_text.pyi @@ -0,0 +1 @@ +from email.MIMEText import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/html_entities.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/html_entities.pyi new file mode 100644 index 0000000..9e15d01 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/html_entities.pyi @@ -0,0 +1 @@ +from htmlentitydefs import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/html_parser.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/html_parser.pyi new file mode 100644 index 0000000..984cee6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/html_parser.pyi @@ -0,0 +1 @@ +from HTMLParser import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/http_client.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/http_client.pyi new file mode 100644 index 0000000..24ef0b4 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/http_client.pyi @@ -0,0 +1 @@ +from httplib import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/http_cookiejar.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/http_cookiejar.pyi new file mode 100644 index 0000000..1357ad3 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/http_cookiejar.pyi @@ -0,0 +1 @@ +from cookielib import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/http_cookies.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/http_cookies.pyi new file mode 100644 index 0000000..5115c0d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/http_cookies.pyi @@ -0,0 +1 @@ +from Cookie import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/queue.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/queue.pyi new file mode 100644 index 0000000..7ce3ccb --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/queue.pyi @@ -0,0 +1 @@ +from Queue import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/reprlib.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/reprlib.pyi new file mode 100644 index 0000000..40ad103 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/reprlib.pyi @@ -0,0 +1 @@ +from repr import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/socketserver.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/socketserver.pyi new file mode 100644 index 0000000..c80a6e7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/socketserver.pyi @@ -0,0 +1 @@ +from SocketServer import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib/__init__.pyi new file mode 100644 index 0000000..d08209c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib/__init__.pyi @@ -0,0 +1,5 @@ +import six.moves.urllib.error as error +import six.moves.urllib.parse as parse +import six.moves.urllib.request as request +import six.moves.urllib.response as response +import six.moves.urllib.robotparser as robotparser diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib/error.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib/error.pyi new file mode 100644 index 0000000..044327e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib/error.pyi @@ -0,0 +1,3 @@ +from urllib2 import URLError as URLError +from urllib2 import HTTPError as HTTPError +from urllib import ContentTooShortError as ContentTooShortError diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib/parse.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib/parse.pyi new file mode 100644 index 0000000..4096c27 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib/parse.pyi @@ -0,0 +1,24 @@ +# Stubs for six.moves.urllib.parse +from urlparse import ParseResult as ParseResult +from urlparse import SplitResult as SplitResult +from urlparse import parse_qs as parse_qs +from urlparse import parse_qsl as parse_qsl +from urlparse import urldefrag as urldefrag +from urlparse import urljoin as urljoin +from urlparse import urlparse as urlparse +from urlparse import urlsplit as urlsplit +from urlparse import urlunparse as urlunparse +from urlparse import urlunsplit as urlunsplit +from urllib import quote as quote +from urllib import quote_plus as quote_plus +from urllib import unquote as unquote +from urllib import unquote_plus as unquote_plus +from urllib import urlencode as urlencode +from urllib import splitquery as splitquery +from urllib import splittag as splittag +from urllib import splituser as splituser +from urlparse import uses_fragment as uses_fragment +from urlparse import uses_netloc as uses_netloc +from urlparse import uses_params as uses_params +from urlparse import uses_query as uses_query +from urlparse import uses_relative as uses_relative diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib/request.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib/request.pyi new file mode 100644 index 0000000..6aadde1 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib/request.pyi @@ -0,0 +1,36 @@ +# Stubs for six.moves.urllib.request +from urllib2 import urlopen as urlopen +from urllib2 import install_opener as install_opener +from urllib2 import build_opener as build_opener +from urllib import pathname2url as pathname2url +from urllib import url2pathname as url2pathname +from urllib import getproxies as getproxies +from urllib2 import Request as Request +from urllib2 import OpenerDirector as OpenerDirector +from urllib2 import HTTPDefaultErrorHandler as HTTPDefaultErrorHandler +from urllib2 import HTTPRedirectHandler as HTTPRedirectHandler +from urllib2 import HTTPCookieProcessor as HTTPCookieProcessor +from urllib2 import ProxyHandler as ProxyHandler +from urllib2 import BaseHandler as BaseHandler +from urllib2 import HTTPPasswordMgr as HTTPPasswordMgr +from urllib2 import HTTPPasswordMgrWithDefaultRealm as HTTPPasswordMgrWithDefaultRealm +from urllib2 import AbstractBasicAuthHandler as AbstractBasicAuthHandler +from urllib2 import HTTPBasicAuthHandler as HTTPBasicAuthHandler +from urllib2 import ProxyBasicAuthHandler as ProxyBasicAuthHandler +from urllib2 import AbstractDigestAuthHandler as AbstractDigestAuthHandler +from urllib2 import HTTPDigestAuthHandler as HTTPDigestAuthHandler +from urllib2 import ProxyDigestAuthHandler as ProxyDigestAuthHandler +from urllib2 import HTTPHandler as HTTPHandler +from urllib2 import HTTPSHandler as HTTPSHandler +from urllib2 import FileHandler as FileHandler +from urllib2 import FTPHandler as FTPHandler +from urllib2 import CacheFTPHandler as CacheFTPHandler +from urllib2 import UnknownHandler as UnknownHandler +from urllib2 import HTTPErrorProcessor as HTTPErrorProcessor +from urllib import urlretrieve as urlretrieve +from urllib import urlcleanup as urlcleanup +from urllib import URLopener as URLopener +from urllib import FancyURLopener as FancyURLopener +from urllib import proxy_bypass as proxy_bypass +from urllib2 import parse_http_list as parse_http_list +from urllib2 import parse_keqv_list as parse_keqv_list diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib/response.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib/response.pyi new file mode 100644 index 0000000..83e117f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib/response.pyi @@ -0,0 +1,5 @@ +# Stubs for six.moves.urllib.response +from urllib import addbase as addbase +from urllib import addclosehook as addclosehook +from urllib import addinfo as addinfo +from urllib import addinfourl as addinfourl diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib/robotparser.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib/robotparser.pyi new file mode 100644 index 0000000..11eef50 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib/robotparser.pyi @@ -0,0 +1 @@ +from robotparser import RobotFileParser as RobotFileParser diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib_error.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib_error.pyi new file mode 100644 index 0000000..b560812 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib_error.pyi @@ -0,0 +1 @@ +from .urllib.error import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib_parse.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib_parse.pyi new file mode 100644 index 0000000..bdb4d1c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib_parse.pyi @@ -0,0 +1 @@ +from .urllib.parse import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib_request.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib_request.pyi new file mode 100644 index 0000000..dc03dce --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib_request.pyi @@ -0,0 +1 @@ +from .urllib.request import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib_response.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib_response.pyi new file mode 100644 index 0000000..bbee522 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib_response.pyi @@ -0,0 +1 @@ +from .urllib.response import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib_robotparser.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib_robotparser.pyi new file mode 100644 index 0000000..ddb63b7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib_robotparser.pyi @@ -0,0 +1 @@ +from robotparser import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/xmlrpc_client.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/xmlrpc_client.pyi new file mode 100644 index 0000000..1b3bd74 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/six/moves/xmlrpc_client.pyi @@ -0,0 +1 @@ +from xmlrpclib import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/tornado/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/tornado/__init__.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/tornado/concurrent.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/tornado/concurrent.pyi new file mode 100644 index 0000000..91fc326 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/tornado/concurrent.pyi @@ -0,0 +1,43 @@ +from typing import Any + +futures: Any + +class ReturnValueIgnoredError(Exception): ... + +class _TracebackLogger: + exc_info: Any + formatted_tb: Any + def __init__(self, exc_info) -> None: ... + def activate(self): ... + def clear(self): ... + def __del__(self): ... + +class Future: + def __init__(self) -> None: ... + def cancel(self): ... + def cancelled(self): ... + def running(self): ... + def done(self): ... + def result(self, timeout=...): ... + def exception(self, timeout=...): ... + def add_done_callback(self, fn): ... + def set_result(self, result): ... + def set_exception(self, exception): ... + def exc_info(self): ... + def set_exc_info(self, exc_info): ... + def __del__(self): ... + +TracebackFuture: Any +FUTURES: Any + +def is_future(x): ... + +class DummyExecutor: + def submit(self, fn, *args, **kwargs): ... + def shutdown(self, wait=...): ... + +dummy_executor: Any + +def run_on_executor(*args, **kwargs): ... +def return_future(f): ... +def chain_future(a, b): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/tornado/gen.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/tornado/gen.pyi new file mode 100644 index 0000000..ee3954b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/tornado/gen.pyi @@ -0,0 +1,109 @@ +from typing import Any +from collections import namedtuple + +singledispatch: Any + +class KeyReuseError(Exception): ... +class UnknownKeyError(Exception): ... +class LeakedCallbackError(Exception): ... +class BadYieldError(Exception): ... +class ReturnValueIgnoredError(Exception): ... +class TimeoutError(Exception): ... + +def engine(func): ... +def coroutine(func, replace_callback=...): ... + +class Return(Exception): + value: Any + def __init__(self, value=...) -> None: ... + +class WaitIterator: + current_index: Any + def __init__(self, *args, **kwargs) -> None: ... + def done(self): ... + def next(self): ... + +class YieldPoint: + def start(self, runner): ... + def is_ready(self): ... + def get_result(self): ... + +class Callback(YieldPoint): + key: Any + def __init__(self, key) -> None: ... + runner: Any + def start(self, runner): ... + def is_ready(self): ... + def get_result(self): ... + +class Wait(YieldPoint): + key: Any + def __init__(self, key) -> None: ... + runner: Any + def start(self, runner): ... + def is_ready(self): ... + def get_result(self): ... + +class WaitAll(YieldPoint): + keys: Any + def __init__(self, keys) -> None: ... + runner: Any + def start(self, runner): ... + def is_ready(self): ... + def get_result(self): ... + +def Task(func, *args, **kwargs): ... + +class YieldFuture(YieldPoint): + future: Any + io_loop: Any + def __init__(self, future, io_loop=...) -> None: ... + runner: Any + key: Any + result_fn: Any + def start(self, runner): ... + def is_ready(self): ... + def get_result(self): ... + +class Multi(YieldPoint): + keys: Any + children: Any + unfinished_children: Any + quiet_exceptions: Any + def __init__(self, children, quiet_exceptions=...) -> None: ... + def start(self, runner): ... + def is_ready(self): ... + def get_result(self): ... + +def multi_future(children, quiet_exceptions=...): ... +def maybe_future(x): ... +def with_timeout(timeout, future, io_loop=..., quiet_exceptions=...): ... +def sleep(duration): ... + +moment: Any + +class Runner: + gen: Any + result_future: Any + future: Any + yield_point: Any + pending_callbacks: Any + results: Any + running: Any + finished: Any + had_exception: Any + io_loop: Any + stack_context_deactivate: Any + def __init__(self, gen, result_future, first_yielded) -> None: ... + def register_callback(self, key): ... + def is_ready(self, key): ... + def set_result(self, key, result): ... + def pop_result(self, key): ... + def run(self): ... + def handle_yield(self, yielded): ... + def result_callback(self, key): ... + def handle_exception(self, typ, value, tb): ... + +Arguments = namedtuple('Arguments', ['args', 'kwargs']) + +def convert_yielded(yielded): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/tornado/httpclient.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/tornado/httpclient.pyi new file mode 100644 index 0000000..f107093 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/tornado/httpclient.pyi @@ -0,0 +1,96 @@ +from typing import Any +from tornado.util import Configurable + +class HTTPClient: + def __init__(self, async_client_class=..., **kwargs) -> None: ... + def __del__(self): ... + def close(self): ... + def fetch(self, request, **kwargs): ... + +class AsyncHTTPClient(Configurable): + @classmethod + def configurable_base(cls): ... + @classmethod + def configurable_default(cls): ... + def __new__(cls, io_loop=..., force_instance=..., **kwargs): ... + io_loop: Any + defaults: Any + def initialize(self, io_loop, defaults=...): ... + def close(self): ... + def fetch(self, request, callback=..., raise_error=..., **kwargs): ... + def fetch_impl(self, request, callback): ... + @classmethod + def configure(cls, impl, **kwargs): ... + +class HTTPRequest: + proxy_host: Any + proxy_port: Any + proxy_username: Any + proxy_password: Any + url: Any + method: Any + body_producer: Any + auth_username: Any + auth_password: Any + auth_mode: Any + connect_timeout: Any + request_timeout: Any + follow_redirects: Any + max_redirects: Any + user_agent: Any + decompress_response: Any + network_interface: Any + streaming_callback: Any + header_callback: Any + prepare_curl_callback: Any + allow_nonstandard_methods: Any + validate_cert: Any + ca_certs: Any + allow_ipv6: Any + client_key: Any + client_cert: Any + ssl_options: Any + expect_100_continue: Any + start_time: Any + def __init__(self, url, method=..., headers=..., body=..., auth_username=..., auth_password=..., auth_mode=..., + connect_timeout=..., request_timeout=..., if_modified_since=..., follow_redirects=..., max_redirects=..., + user_agent=..., use_gzip=..., network_interface=..., streaming_callback=..., header_callback=..., + prepare_curl_callback=..., proxy_host=..., proxy_port=..., proxy_username=..., proxy_password=..., + allow_nonstandard_methods=..., validate_cert=..., ca_certs=..., allow_ipv6=..., client_key=..., client_cert=..., + body_producer=..., expect_100_continue=..., decompress_response=..., ssl_options=...) -> None: ... + @property + def headers(self): ... + @headers.setter + def headers(self, value): ... + @property + def body(self): ... + @body.setter + def body(self, value): ... + +class HTTPResponse: + request: Any + code: Any + reason: Any + headers: Any + buffer: Any + effective_url: Any + error: Any + request_time: Any + time_info: Any + def __init__(self, request, code, headers=..., buffer=..., effective_url=..., error=..., request_time=..., time_info=..., + reason=...) -> None: ... + body: Any + def rethrow(self): ... + +class HTTPError(Exception): + code: Any + response: Any + def __init__(self, code, message=..., response=...) -> None: ... + +class _RequestProxy: + request: Any + defaults: Any + def __init__(self, request, defaults) -> None: ... + def __getattr__(self, name): ... + +def main(): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/tornado/httpserver.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/tornado/httpserver.pyi new file mode 100644 index 0000000..9bcf99a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/tornado/httpserver.pyi @@ -0,0 +1,43 @@ +from typing import Any +from tornado import httputil +from tornado.tcpserver import TCPServer +from tornado.util import Configurable + +class HTTPServer(TCPServer, Configurable, httputil.HTTPServerConnectionDelegate): + def __init__(self, *args, **kwargs) -> None: ... + request_callback: Any + no_keep_alive: Any + xheaders: Any + protocol: Any + conn_params: Any + def initialize(self, request_callback, no_keep_alive=..., io_loop=..., xheaders=..., ssl_options=..., protocol=..., + decompress_request=..., chunk_size=..., max_header_size=..., idle_connection_timeout=..., body_timeout=..., + max_body_size=..., max_buffer_size=...): ... + @classmethod + def configurable_base(cls): ... + @classmethod + def configurable_default(cls): ... + def close_all_connections(self): ... + def handle_stream(self, stream, address): ... + def start_request(self, server_conn, request_conn): ... + def on_close(self, server_conn): ... + +class _HTTPRequestContext: + address: Any + protocol: Any + address_family: Any + remote_ip: Any + def __init__(self, stream, address, protocol) -> None: ... + +class _ServerRequestAdapter(httputil.HTTPMessageDelegate): + server: Any + connection: Any + request: Any + delegate: Any + def __init__(self, server, server_conn, request_conn) -> None: ... + def headers_received(self, start_line, headers): ... + def data_received(self, chunk): ... + def finish(self): ... + def on_connection_close(self): ... + +HTTPRequest: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/tornado/httputil.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/tornado/httputil.pyi new file mode 100644 index 0000000..bfc81fa --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/tornado/httputil.pyi @@ -0,0 +1,90 @@ +from typing import Any +from tornado.util import ObjectDict +from collections import namedtuple + +class SSLError(Exception): ... + +class _NormalizedHeaderCache(dict): + size: Any + queue: Any + def __init__(self, size) -> None: ... + def __missing__(self, key): ... + +class HTTPHeaders(dict): + def __init__(self, *args, **kwargs) -> None: ... + def add(self, name, value): ... + def get_list(self, name): ... + def get_all(self): ... + def parse_line(self, line): ... + @classmethod + def parse(cls, headers): ... + def __setitem__(self, name, value): ... + def __getitem__(self, name): ... + def __delitem__(self, name): ... + def __contains__(self, name): ... + def get(self, name, default=...): ... + def update(self, *args, **kwargs): ... + def copy(self): ... + __copy__: Any + def __deepcopy__(self, memo_dict): ... + +class HTTPServerRequest: + method: Any + uri: Any + version: Any + headers: Any + body: Any + remote_ip: Any + protocol: Any + host: Any + files: Any + connection: Any + arguments: Any + query_arguments: Any + body_arguments: Any + def __init__(self, method=..., uri=..., version=..., headers=..., body=..., host=..., files=..., connection=..., + start_line=...) -> None: ... + def supports_http_1_1(self): ... + @property + def cookies(self): ... + def write(self, chunk, callback=...): ... + def finish(self): ... + def full_url(self): ... + def request_time(self): ... + def get_ssl_certificate(self, binary_form=...): ... + +class HTTPInputError(Exception): ... +class HTTPOutputError(Exception): ... + +class HTTPServerConnectionDelegate: + def start_request(self, server_conn, request_conn): ... + def on_close(self, server_conn): ... + +class HTTPMessageDelegate: + def headers_received(self, start_line, headers): ... + def data_received(self, chunk): ... + def finish(self): ... + def on_connection_close(self): ... + +class HTTPConnection: + def write_headers(self, start_line, headers, chunk=..., callback=...): ... + def write(self, chunk, callback=...): ... + def finish(self): ... + +def url_concat(url, args): ... + +class HTTPFile(ObjectDict): ... + +def parse_body_arguments(content_type, body, arguments, files, headers=...): ... +def parse_multipart_form_data(boundary, data, arguments, files): ... +def format_timestamp(ts): ... + +RequestStartLine = namedtuple('RequestStartLine', ['method', 'path', 'version']) + +def parse_request_start_line(line): ... + +ResponseStartLine = namedtuple('ResponseStartLine', ['version', 'code', 'reason']) + +def parse_response_start_line(line): ... +def doctests(): ... +def split_host_and_port(netloc): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/tornado/ioloop.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/tornado/ioloop.pyi new file mode 100644 index 0000000..92c3548 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/tornado/ioloop.pyi @@ -0,0 +1,84 @@ +from typing import Any +from tornado.util import Configurable + +signal: Any + +class TimeoutError(Exception): ... + +class IOLoop(Configurable): + NONE: Any + READ: Any + WRITE: Any + ERROR: Any + @staticmethod + def instance(): ... + @staticmethod + def initialized(): ... + def install(self): ... + @staticmethod + def clear_instance(): ... + @staticmethod + def current(instance=...): ... + def make_current(self): ... + @staticmethod + def clear_current(): ... + @classmethod + def configurable_base(cls): ... + @classmethod + def configurable_default(cls): ... + def initialize(self, make_current=...): ... + def close(self, all_fds=...): ... + def add_handler(self, fd, handler, events): ... + def update_handler(self, fd, events): ... + def remove_handler(self, fd): ... + def set_blocking_signal_threshold(self, seconds, action): ... + def set_blocking_log_threshold(self, seconds): ... + def log_stack(self, signal, frame): ... + def start(self): ... + def stop(self): ... + def run_sync(self, func, timeout=...): ... + def time(self): ... + def add_timeout(self, deadline, callback, *args, **kwargs): ... + def call_later(self, delay, callback, *args, **kwargs): ... + def call_at(self, when, callback, *args, **kwargs): ... + def remove_timeout(self, timeout): ... + def add_callback(self, callback, *args, **kwargs): ... + def add_callback_from_signal(self, callback, *args, **kwargs): ... + def spawn_callback(self, callback, *args, **kwargs): ... + def add_future(self, future, callback): ... + def handle_callback_exception(self, callback): ... + def split_fd(self, fd): ... + def close_fd(self, fd): ... + +class PollIOLoop(IOLoop): + time_func: Any + def initialize(self, impl, time_func=..., **kwargs): ... + def close(self, all_fds=...): ... + def add_handler(self, fd, handler, events): ... + def update_handler(self, fd, events): ... + def remove_handler(self, fd): ... + def set_blocking_signal_threshold(self, seconds, action): ... + def start(self): ... + def stop(self): ... + def time(self): ... + def call_at(self, deadline, callback, *args, **kwargs): ... + def remove_timeout(self, timeout): ... + def add_callback(self, callback, *args, **kwargs): ... + def add_callback_from_signal(self, callback, *args, **kwargs): ... + +class _Timeout: + deadline: Any + callback: Any + tiebreaker: Any + def __init__(self, deadline, callback, io_loop) -> None: ... + def __lt__(self, other): ... + def __le__(self, other): ... + +class PeriodicCallback: + callback: Any + callback_time: Any + io_loop: Any + def __init__(self, callback, callback_time, io_loop=...) -> None: ... + def start(self): ... + def stop(self): ... + def is_running(self): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/tornado/locks.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/tornado/locks.pyi new file mode 100644 index 0000000..723e991 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/tornado/locks.pyi @@ -0,0 +1,45 @@ +from typing import Any, Optional + +class _TimeoutGarbageCollector: + def __init__(self): ... + +class Condition(_TimeoutGarbageCollector): + io_loop: Any + def __init__(self): ... + def wait(self, timeout: Optional[Any] = ...): ... + def notify(self, n: int = ...): ... + def notify_all(self): ... + +class Event: + def __init__(self): ... + def is_set(self): ... + def set(self): ... + def clear(self): ... + def wait(self, timeout: Optional[Any] = ...): ... + +class _ReleasingContextManager: + def __init__(self, obj): ... + def __enter__(self): ... + def __exit__(self, exc_type, exc_val, exc_tb): ... + +class Semaphore(_TimeoutGarbageCollector): + def __init__(self, value: int = ...): ... + def release(self): ... + def acquire(self, timeout: Optional[Any] = ...): ... + def __enter__(self): ... + __exit__: Any + def __aenter__(self): ... + def __aexit__(self, typ, value, tb): ... + +class BoundedSemaphore(Semaphore): + def __init__(self, value: int = ...): ... + def release(self): ... + +class Lock: + def __init__(self): ... + def acquire(self, timeout: Optional[Any] = ...): ... + def release(self): ... + def __enter__(self): ... + __exit__: Any + def __aenter__(self): ... + def __aexit__(self, typ, value, tb): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/tornado/netutil.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/tornado/netutil.pyi new file mode 100644 index 0000000..53c8fc7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/tornado/netutil.pyi @@ -0,0 +1,45 @@ +from typing import Any +from tornado.util import Configurable + +ssl: Any +certifi: Any +xrange: Any +ssl_match_hostname: Any +SSLCertificateError: Any + +def bind_sockets(port, address=..., family=..., backlog=..., flags=...): ... +def bind_unix_socket(file, mode=..., backlog=...): ... +def add_accept_handler(sock, callback, io_loop=...): ... +def is_valid_ip(ip): ... + +class Resolver(Configurable): + @classmethod + def configurable_base(cls): ... + @classmethod + def configurable_default(cls): ... + def resolve(self, host, port, family=..., callback=...): ... + def close(self): ... + +class ExecutorResolver(Resolver): + io_loop: Any + executor: Any + close_executor: Any + def initialize(self, io_loop=..., executor=..., close_executor=...): ... + def close(self): ... + def resolve(self, host, port, family=...): ... + +class BlockingResolver(ExecutorResolver): + def initialize(self, io_loop=...): ... + +class ThreadedResolver(ExecutorResolver): + def initialize(self, io_loop=..., num_threads=...): ... + +class OverrideResolver(Resolver): + resolver: Any + mapping: Any + def initialize(self, resolver, mapping): ... + def close(self): ... + def resolve(self, host, port, *args, **kwargs): ... + +def ssl_options_to_context(ssl_options): ... +def ssl_wrap_socket(socket, ssl_options, server_hostname=..., **kwargs): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/tornado/process.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/tornado/process.pyi new file mode 100644 index 0000000..c467454 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/tornado/process.pyi @@ -0,0 +1,24 @@ +from typing import Any, Optional + +long = int +CalledProcessError: Any + +def cpu_count() -> int: ... +def fork_processes(num_processes, max_restarts: int = ...) -> Optional[int]: ... +def task_id() -> int: ... + +class Subprocess: + STREAM: Any = ... + io_loop: Any = ... + stdin: Any = ... + stdout: Any = ... + stderr: Any = ... + proc: Any = ... + returncode: Any = ... + def __init__(self, *args, **kwargs) -> None: ... + def set_exit_callback(self, callback): ... + def wait_for_exit(self, raise_error: bool = ...): ... + @classmethod + def initialize(cls, io_loop: Optional[Any] = ...): ... + @classmethod + def uninitialize(cls): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/tornado/tcpserver.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/tornado/tcpserver.pyi new file mode 100644 index 0000000..28fe6a4 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/tornado/tcpserver.pyi @@ -0,0 +1,17 @@ +from typing import Any + +ssl: Any + +class TCPServer: + io_loop: Any + ssl_options: Any + max_buffer_size: Any + read_chunk_size: Any + def __init__(self, io_loop=..., ssl_options=..., max_buffer_size=..., read_chunk_size=...) -> None: ... + def listen(self, port, address=...): ... + def add_sockets(self, sockets): ... + def add_socket(self, socket): ... + def bind(self, port, address=..., family=..., backlog=...): ... + def start(self, num_processes=...): ... + def stop(self): ... + def handle_stream(self, stream, address): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/tornado/testing.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/tornado/testing.pyi new file mode 100644 index 0000000..25fd0e5 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/tornado/testing.pyi @@ -0,0 +1,60 @@ +from typing import Any, Optional +import unittest +import logging + +AsyncHTTPClient: Any +gen: Any +HTTPServer: Any +IOLoop: Any +netutil: Any +SimpleAsyncHTTPClient: Any + +def get_unused_port(): ... +def bind_unused_port(): ... + +class AsyncTestCase(unittest.TestCase): + def __init__(self, *args, **kwargs): ... + io_loop: Any + def setUp(self): ... + def tearDown(self): ... + def get_new_ioloop(self): ... + def run(self, result: Optional[Any] = ...): ... + def stop(self, _arg: Optional[Any] = ..., **kwargs): ... + def wait(self, condition: Optional[Any] = ..., timeout: float = ...): ... + +class AsyncHTTPTestCase(AsyncTestCase): + http_client: Any + http_server: Any + def setUp(self): ... + def get_http_client(self): ... + def get_http_server(self): ... + def get_app(self): ... + def fetch(self, path, **kwargs): ... + def get_httpserver_options(self): ... + def get_http_port(self): ... + def get_protocol(self): ... + def get_url(self, path): ... + def tearDown(self): ... + +class AsyncHTTPSTestCase(AsyncHTTPTestCase): + def get_http_client(self): ... + def get_httpserver_options(self): ... + def get_ssl_options(self): ... + def get_protocol(self): ... + +def gen_test(f): ... + +class LogTrapTestCase(unittest.TestCase): + def run(self, result: Optional[Any] = ...): ... + +class ExpectLog(logging.Filter): + logger: Any + regex: Any + required: Any + matched: Any + def __init__(self, logger, regex, required: bool = ...): ... + def filter(self, record): ... + def __enter__(self): ... + def __exit__(self, typ, value, tb): ... + +def main(**kwargs): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/tornado/util.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/tornado/util.pyi new file mode 100644 index 0000000..1f6e0d2 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/tornado/util.pyi @@ -0,0 +1,46 @@ +from typing import Any + +xrange: Any + +class ObjectDict(dict): + def __getattr__(self, name): ... + def __setattr__(self, name, value): ... + +class GzipDecompressor: + decompressobj: Any + def __init__(self) -> None: ... + def decompress(self, value, max_length=...): ... + @property + def unconsumed_tail(self): ... + def flush(self): ... + +unicode_type: Any +basestring_type: Any + +def import_object(name): ... + +bytes_type: Any + +def errno_from_exception(e): ... + +class Configurable: + def __new__(cls, *args, **kwargs): ... + @classmethod + def configurable_base(cls): ... + @classmethod + def configurable_default(cls): ... + def initialize(self): ... + @classmethod + def configure(cls, impl, **kwargs): ... + @classmethod + def configured_class(cls): ... + +class ArgReplacer: + name: Any + arg_pos: Any + def __init__(self, func, name) -> None: ... + def get_old_value(self, args, kwargs, default=...): ... + def replace(self, new_value, args, kwargs): ... + +def timedelta_to_seconds(td): ... +def doctests(): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/tornado/web.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/tornado/web.pyi new file mode 100644 index 0000000..c63f414 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2/tornado/web.pyi @@ -0,0 +1,257 @@ +from typing import Any +from tornado import httputil + +MIN_SUPPORTED_SIGNED_VALUE_VERSION: Any +MAX_SUPPORTED_SIGNED_VALUE_VERSION: Any +DEFAULT_SIGNED_VALUE_VERSION: Any +DEFAULT_SIGNED_VALUE_MIN_VERSION: Any + +class RequestHandler: + SUPPORTED_METHODS: Any + application: Any + request: Any + path_args: Any + path_kwargs: Any + ui: Any + def __init__(self, application, request, **kwargs) -> None: ... + def initialize(self): ... + @property + def settings(self): ... + def head(self, *args, **kwargs): ... + def get(self, *args, **kwargs): ... + def post(self, *args, **kwargs): ... + def delete(self, *args, **kwargs): ... + def patch(self, *args, **kwargs): ... + def put(self, *args, **kwargs): ... + def options(self, *args, **kwargs): ... + def prepare(self): ... + def on_finish(self): ... + def on_connection_close(self): ... + def clear(self): ... + def set_default_headers(self): ... + def set_status(self, status_code, reason=...): ... + def get_status(self): ... + def set_header(self, name, value): ... + def add_header(self, name, value): ... + def clear_header(self, name): ... + def get_argument(self, name, default=..., strip=...): ... + def get_arguments(self, name, strip=...): ... + def get_body_argument(self, name, default=..., strip=...): ... + def get_body_arguments(self, name, strip=...): ... + def get_query_argument(self, name, default=..., strip=...): ... + def get_query_arguments(self, name, strip=...): ... + def decode_argument(self, value, name=...): ... + @property + def cookies(self): ... + def get_cookie(self, name, default=...): ... + def set_cookie(self, name, value, domain=..., expires=..., path=..., expires_days=..., **kwargs): ... + def clear_cookie(self, name, path=..., domain=...): ... + def clear_all_cookies(self, path=..., domain=...): ... + def set_secure_cookie(self, name, value, expires_days=..., version=..., **kwargs): ... + def create_signed_value(self, name, value, version=...): ... + def get_secure_cookie(self, name, value=..., max_age_days=..., min_version=...): ... + def get_secure_cookie_key_version(self, name, value=...): ... + def redirect(self, url, permanent=..., status=...): ... + def write(self, chunk): ... + def render(self, template_name, **kwargs): ... + def render_string(self, template_name, **kwargs): ... + def get_template_namespace(self): ... + def create_template_loader(self, template_path): ... + def flush(self, include_footers=..., callback=...): ... + def finish(self, chunk=...): ... + def send_error(self, status_code=..., **kwargs): ... + def write_error(self, status_code, **kwargs): ... + @property + def locale(self): ... + @locale.setter + def locale(self, value): ... + def get_user_locale(self): ... + def get_browser_locale(self, default=...): ... + @property + def current_user(self): ... + @current_user.setter + def current_user(self, value): ... + def get_current_user(self): ... + def get_login_url(self): ... + def get_template_path(self): ... + @property + def xsrf_token(self): ... + def check_xsrf_cookie(self): ... + def xsrf_form_html(self): ... + def static_url(self, path, include_host=..., **kwargs): ... + def require_setting(self, name, feature=...): ... + def reverse_url(self, name, *args): ... + def compute_etag(self): ... + def set_etag_header(self): ... + def check_etag_header(self): ... + def data_received(self, chunk): ... + def log_exception(self, typ, value, tb): ... + +def asynchronous(method): ... +def stream_request_body(cls): ... +def removeslash(method): ... +def addslash(method): ... + +class Application(httputil.HTTPServerConnectionDelegate): + transforms: Any + handlers: Any + named_handlers: Any + default_host: Any + settings: Any + ui_modules: Any + ui_methods: Any + def __init__(self, handlers=..., default_host=..., transforms=..., **settings) -> None: ... + def listen(self, port, address=..., **kwargs): ... + def add_handlers(self, host_pattern, host_handlers): ... + def add_transform(self, transform_class): ... + def start_request(self, server_conn, request_conn): ... + def __call__(self, request): ... + def reverse_url(self, name, *args): ... + def log_request(self, handler): ... + +class _RequestDispatcher(httputil.HTTPMessageDelegate): + application: Any + connection: Any + request: Any + chunks: Any + handler_class: Any + handler_kwargs: Any + path_args: Any + path_kwargs: Any + def __init__(self, application, connection) -> None: ... + def headers_received(self, start_line, headers): ... + stream_request_body: Any + def set_request(self, request): ... + def data_received(self, data): ... + def finish(self): ... + def on_connection_close(self): ... + handler: Any + def execute(self): ... + +class HTTPError(Exception): + status_code: Any + log_message: Any + args: Any + reason: Any + def __init__(self, status_code, log_message=..., *args, **kwargs) -> None: ... + +class Finish(Exception): ... + +class MissingArgumentError(HTTPError): + arg_name: Any + def __init__(self, arg_name) -> None: ... + +class ErrorHandler(RequestHandler): + def initialize(self, status_code): ... + def prepare(self): ... + def check_xsrf_cookie(self): ... + +class RedirectHandler(RequestHandler): + def initialize(self, url, permanent=...): ... + def get(self): ... + +class StaticFileHandler(RequestHandler): + CACHE_MAX_AGE: Any + root: Any + default_filename: Any + def initialize(self, path, default_filename=...): ... + @classmethod + def reset(cls): ... + def head(self, path): ... + path: Any + absolute_path: Any + modified: Any + def get(self, path, include_body=...): ... + def compute_etag(self): ... + def set_headers(self): ... + def should_return_304(self): ... + @classmethod + def get_absolute_path(cls, root, path): ... + def validate_absolute_path(self, root, absolute_path): ... + @classmethod + def get_content(cls, abspath, start=..., end=...): ... + @classmethod + def get_content_version(cls, abspath): ... + def get_content_size(self): ... + def get_modified_time(self): ... + def get_content_type(self): ... + def set_extra_headers(self, path): ... + def get_cache_time(self, path, modified, mime_type): ... + @classmethod + def make_static_url(cls, settings, path, include_version=...): ... + def parse_url_path(self, url_path): ... + @classmethod + def get_version(cls, settings, path): ... + +class FallbackHandler(RequestHandler): + fallback: Any + def initialize(self, fallback): ... + def prepare(self): ... + +class OutputTransform: + def __init__(self, request) -> None: ... + def transform_first_chunk(self, status_code, headers, chunk, finishing): ... + def transform_chunk(self, chunk, finishing): ... + +class GZipContentEncoding(OutputTransform): + CONTENT_TYPES: Any + MIN_LENGTH: Any + def __init__(self, request) -> None: ... + def transform_first_chunk(self, status_code, headers, chunk, finishing): ... + def transform_chunk(self, chunk, finishing): ... + +def authenticated(method): ... + +class UIModule: + handler: Any + request: Any + ui: Any + locale: Any + def __init__(self, handler) -> None: ... + @property + def current_user(self): ... + def render(self, *args, **kwargs): ... + def embedded_javascript(self): ... + def javascript_files(self): ... + def embedded_css(self): ... + def css_files(self): ... + def html_head(self): ... + def html_body(self): ... + def render_string(self, path, **kwargs): ... + +class _linkify(UIModule): + def render(self, text, **kwargs): ... + +class _xsrf_form_html(UIModule): + def render(self): ... + +class TemplateModule(UIModule): + def __init__(self, handler) -> None: ... + def render(self, path, **kwargs): ... + def embedded_javascript(self): ... + def javascript_files(self): ... + def embedded_css(self): ... + def css_files(self): ... + def html_head(self): ... + def html_body(self): ... + +class _UIModuleNamespace: + handler: Any + ui_modules: Any + def __init__(self, handler, ui_modules) -> None: ... + def __getitem__(self, key): ... + def __getattr__(self, key): ... + +class URLSpec: + regex: Any + handler_class: Any + kwargs: Any + name: Any + def __init__(self, pattern, handler, kwargs=..., name=...) -> None: ... + def reverse(self, *args): ... + +url: Any + +def create_signed_value(secret, name, value, version=..., clock=..., key_version=...): ... +def decode_signed_value(secret, name, value, max_age_days=..., clock=..., min_version=...): ... +def get_signature_key_version(value): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/AES.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/AES.pyi new file mode 100644 index 0000000..144ccfa --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/AES.pyi @@ -0,0 +1,19 @@ +from typing import Any, Union, Text +from .blockalgo import BlockAlgo + +__revision__: str + +class AESCipher(BlockAlgo): + def __init__(self, key: Union[bytes, Text], *args, **kwargs) -> None: ... + +def new(key: Union[bytes, Text], *args, **kwargs) -> AESCipher: ... + +MODE_ECB: int +MODE_CBC: int +MODE_CFB: int +MODE_PGP: int +MODE_OFB: int +MODE_CTR: int +MODE_OPENPGP: int +block_size: int +key_size: int diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/ARC2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/ARC2.pyi new file mode 100644 index 0000000..24a12ea --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/ARC2.pyi @@ -0,0 +1,19 @@ +from typing import Any, Union, Text +from .blockalgo import BlockAlgo + +__revision__: str + +class RC2Cipher(BlockAlgo): + def __init__(self, key: Union[bytes, Text], *args, **kwargs) -> None: ... + +def new(key: Union[bytes, Text], *args, **kwargs) -> RC2Cipher: ... + +MODE_ECB: int +MODE_CBC: int +MODE_CFB: int +MODE_PGP: int +MODE_OFB: int +MODE_CTR: int +MODE_OPENPGP: int +block_size: int +key_size: int diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/ARC4.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/ARC4.pyi new file mode 100644 index 0000000..109e2bf --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/ARC4.pyi @@ -0,0 +1,15 @@ +from typing import Any, Union, Text + +__revision__: str + +class ARC4Cipher: + block_size: int + key_size: int + def __init__(self, key: Union[bytes, Text], *args, **kwargs) -> None: ... + def encrypt(self, plaintext): ... + def decrypt(self, ciphertext): ... + +def new(key: Union[bytes, Text], *args, **kwargs) -> ARC4Cipher: ... + +block_size: int +key_size: int diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/Blowfish.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/Blowfish.pyi new file mode 100644 index 0000000..e29ca6b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/Blowfish.pyi @@ -0,0 +1,19 @@ +from typing import Any, Union, Text +from .blockalgo import BlockAlgo + +__revision__: str + +class BlowfishCipher(BlockAlgo): + def __init__(self, key: Union[bytes, Text], *args, **kwargs) -> None: ... + +def new(key: Union[bytes, Text], *args, **kwargs) -> BlowfishCipher: ... + +MODE_ECB: int +MODE_CBC: int +MODE_CFB: int +MODE_PGP: int +MODE_OFB: int +MODE_CTR: int +MODE_OPENPGP: int +block_size: int +key_size: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/CAST.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/CAST.pyi new file mode 100644 index 0000000..b291919 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/CAST.pyi @@ -0,0 +1,19 @@ +from typing import Any, Union, Text +from .blockalgo import BlockAlgo + +__revision__: str + +class CAST128Cipher(BlockAlgo): + def __init__(self, key: Union[bytes, Text], *args, **kwargs) -> None: ... + +def new(key: Union[bytes, Text], *args, **kwargs) -> CAST128Cipher: ... + +MODE_ECB: int +MODE_CBC: int +MODE_CFB: int +MODE_PGP: int +MODE_OFB: int +MODE_CTR: int +MODE_OPENPGP: int +block_size: int +key_size: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/DES.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/DES.pyi new file mode 100644 index 0000000..30a40dd --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/DES.pyi @@ -0,0 +1,19 @@ +from typing import Any, Union, Text +from .blockalgo import BlockAlgo + +__revision__: str + +class DESCipher(BlockAlgo): + def __init__(self, key: Union[bytes, Text], *args, **kwargs) -> None: ... + +def new(key: Union[bytes, Text], *args, **kwargs) -> DESCipher: ... + +MODE_ECB: int +MODE_CBC: int +MODE_CFB: int +MODE_PGP: int +MODE_OFB: int +MODE_CTR: int +MODE_OPENPGP: int +block_size: int +key_size: int diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/DES3.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/DES3.pyi new file mode 100644 index 0000000..59ccd8f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/DES3.pyi @@ -0,0 +1,20 @@ +from typing import Any, Union, Text + +from .blockalgo import BlockAlgo + +__revision__: str + +class DES3Cipher(BlockAlgo): + def __init__(self, key: Union[bytes, Text], *args, **kwargs) -> None: ... + +def new(key: Union[bytes, Text], *args, **kwargs) -> DES3Cipher: ... + +MODE_ECB: int +MODE_CBC: int +MODE_CFB: int +MODE_PGP: int +MODE_OFB: int +MODE_CTR: int +MODE_OPENPGP: int +block_size: int +key_size: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/PKCS1_OAEP.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/PKCS1_OAEP.pyi new file mode 100644 index 0000000..50980a4 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/PKCS1_OAEP.pyi @@ -0,0 +1,13 @@ +from typing import Any, Optional, Union, Text + +from Crypto.PublicKey.RSA import _RSAobj + +class PKCS1OAEP_Cipher: + def __init__(self, key: _RSAobj, hashAlgo: Any, mgfunc: Any, label: Any) -> None: ... + def can_encrypt(self): ... + def can_decrypt(self): ... + def encrypt(self, message: Union[bytes, Text]) -> bytes: ... + def decrypt(self, ct: bytes) -> bytes: ... + + +def new(key: _RSAobj, hashAlgo: Optional[Any] = ..., mgfunc: Optional[Any] = ..., label: Any = ...) -> PKCS1OAEP_Cipher: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/PKCS1_v1_5.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/PKCS1_v1_5.pyi new file mode 100644 index 0000000..c2b9ea1 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/PKCS1_v1_5.pyi @@ -0,0 +1,13 @@ +from typing import Any, Union, Text + +from Crypto.PublicKey.RSA import _RSAobj + +class PKCS115_Cipher: + def __init__(self, key: _RSAobj) -> None: ... + def can_encrypt(self) -> bool: ... + def can_decrypt(self) -> bool: ... + rf: Any + def encrypt(self, message: Union[bytes, Text]) -> bytes: ... + def decrypt(self, ct: bytes, sentinel: Any) -> bytes: ... + +def new(key: _RSAobj) -> PKCS115_Cipher: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/XOR.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/XOR.pyi new file mode 100644 index 0000000..4c952c2 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/XOR.pyi @@ -0,0 +1,16 @@ +from typing import Any, Union, Text + +__revision__: str + +class XORCipher: + block_size: int + key_size: int + def __init__(self, key: Union[bytes, Text], *args, **kwargs) -> None: ... + def encrypt(self, plaintext: Union[bytes, Text]) -> bytes: ... + def decrypt(self, ciphertext: bytes) -> bytes: ... + + +def new(key: Union[bytes, Text], *args, **kwargs) -> XORCipher: ... + +block_size: int +key_size: int diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/__init__.pyi new file mode 100644 index 0000000..309f274 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/__init__.pyi @@ -0,0 +1,11 @@ +# Names in __all__ with no definition: +# AES +# ARC2 +# ARC4 +# Blowfish +# CAST +# DES +# DES3 +# PKCS1_OAEP +# PKCS1_v1_5 +# XOR diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/blockalgo.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/blockalgo.pyi new file mode 100644 index 0000000..8286b7a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/blockalgo.pyi @@ -0,0 +1,17 @@ +from typing import Any, Union, Text + +MODE_ECB: int +MODE_CBC: int +MODE_CFB: int +MODE_PGP: int +MODE_OFB: int +MODE_CTR: int +MODE_OPENPGP: int + +class BlockAlgo: + mode: int + block_size: int + IV: Any + def __init__(self, factory: Any, key: Union[bytes, Text], *args, **kwargs) -> None: ... + def encrypt(self, plaintext: Union[bytes, Text]) -> bytes: ... + def decrypt(self, ciphertext: bytes) -> bytes: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/HMAC.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/HMAC.pyi new file mode 100644 index 0000000..5e2337d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/HMAC.pyi @@ -0,0 +1,16 @@ +from typing import Any, Optional + +digest_size: Any + +class HMAC: + digest_size: Any + digestmod: Any + outer: Any + inner: Any + def __init__(self, key, msg: Optional[Any] = ..., digestmod: Optional[Any] = ...) -> None: ... + def update(self, msg): ... + def copy(self): ... + def digest(self): ... + def hexdigest(self): ... + +def new(key, msg: Optional[Any] = ..., digestmod: Optional[Any] = ...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/MD2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/MD2.pyi new file mode 100644 index 0000000..1575b11 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/MD2.pyi @@ -0,0 +1,13 @@ +from typing import Any, Optional +from Crypto.Hash.hashalgo import HashAlgo + +class MD2Hash(HashAlgo): + oid: Any + digest_size: int + block_size: int + def __init__(self, data: Optional[Any] = ...) -> None: ... + def new(self, data: Optional[Any] = ...): ... + +def new(data: Optional[Any] = ...): ... + +digest_size: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/MD4.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/MD4.pyi new file mode 100644 index 0000000..644b3bd --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/MD4.pyi @@ -0,0 +1,13 @@ +from typing import Any, Optional +from Crypto.Hash.hashalgo import HashAlgo + +class MD4Hash(HashAlgo): + oid: Any + digest_size: int + block_size: int + def __init__(self, data: Optional[Any] = ...) -> None: ... + def new(self, data: Optional[Any] = ...): ... + +def new(data: Optional[Any] = ...): ... + +digest_size: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/MD5.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/MD5.pyi new file mode 100644 index 0000000..52261ab --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/MD5.pyi @@ -0,0 +1,13 @@ +from typing import Any, Optional +from Crypto.Hash.hashalgo import HashAlgo + +class MD5Hash(HashAlgo): + oid: Any + digest_size: int + block_size: int + def __init__(self, data: Optional[Any] = ...) -> None: ... + def new(self, data: Optional[Any] = ...): ... + +def new(data: Optional[Any] = ...): ... + +digest_size: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/RIPEMD.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/RIPEMD.pyi new file mode 100644 index 0000000..3fe4ac5 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/RIPEMD.pyi @@ -0,0 +1,13 @@ +from typing import Any, Optional +from Crypto.Hash.hashalgo import HashAlgo + +class RIPEMD160Hash(HashAlgo): + oid: Any + digest_size: int + block_size: int + def __init__(self, data: Optional[Any] = ...) -> None: ... + def new(self, data: Optional[Any] = ...): ... + +def new(data: Optional[Any] = ...): ... + +digest_size: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA.pyi new file mode 100644 index 0000000..145abd8 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA.pyi @@ -0,0 +1,13 @@ +from typing import Any, Optional +from Crypto.Hash.hashalgo import HashAlgo + +class SHA1Hash(HashAlgo): + oid: Any + digest_size: int + block_size: int + def __init__(self, data: Optional[Any] = ...) -> None: ... + def new(self, data: Optional[Any] = ...): ... + +def new(data: Optional[Any] = ...): ... + +digest_size: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA224.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA224.pyi new file mode 100644 index 0000000..fcd170f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA224.pyi @@ -0,0 +1,13 @@ +from typing import Any, Optional +from Crypto.Hash.hashalgo import HashAlgo + +class SHA224Hash(HashAlgo): + oid: Any + digest_size: int + block_size: int + def __init__(self, data: Optional[Any] = ...) -> None: ... + def new(self, data: Optional[Any] = ...): ... + +def new(data: Optional[Any] = ...): ... + +digest_size: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA256.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA256.pyi new file mode 100644 index 0000000..2ee9472 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA256.pyi @@ -0,0 +1,13 @@ +from typing import Any, Optional +from Crypto.Hash.hashalgo import HashAlgo + +class SHA256Hash(HashAlgo): + oid: Any + digest_size: int + block_size: int + def __init__(self, data: Optional[Any] = ...) -> None: ... + def new(self, data: Optional[Any] = ...): ... + +def new(data: Optional[Any] = ...): ... + +digest_size: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA384.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA384.pyi new file mode 100644 index 0000000..ce63a32 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA384.pyi @@ -0,0 +1,13 @@ +from typing import Any, Optional +from Crypto.Hash.hashalgo import HashAlgo + +class SHA384Hash(HashAlgo): + oid: Any + digest_size: int + block_size: int + def __init__(self, data: Optional[Any] = ...) -> None: ... + def new(self, data: Optional[Any] = ...): ... + +def new(data: Optional[Any] = ...): ... + +digest_size: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA512.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA512.pyi new file mode 100644 index 0000000..c59eb76 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA512.pyi @@ -0,0 +1,13 @@ +from typing import Any, Optional +from Crypto.Hash.hashalgo import HashAlgo + +class SHA512Hash(HashAlgo): + oid: Any + digest_size: int + block_size: int + def __init__(self, data: Optional[Any] = ...) -> None: ... + def new(self, data: Optional[Any] = ...): ... + +def new(data: Optional[Any] = ...): ... + +digest_size: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/__init__.pyi new file mode 100644 index 0000000..9af06f4 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/__init__.pyi @@ -0,0 +1,11 @@ +# Names in __all__ with no definition: +# HMAC +# MD2 +# MD4 +# MD5 +# RIPEMD +# SHA +# SHA224 +# SHA256 +# SHA384 +# SHA512 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/hashalgo.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/hashalgo.pyi new file mode 100644 index 0000000..7c57e03 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/hashalgo.pyi @@ -0,0 +1,11 @@ +from typing import Any, Optional + +class HashAlgo: + digest_size: Any + block_size: Any + def __init__(self, hashFactory, data: Optional[Any] = ...) -> None: ... + def update(self, data): ... + def digest(self): ... + def hexdigest(self): ... + def copy(self): ... + def new(self, data: Optional[Any] = ...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Protocol/AllOrNothing.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Protocol/AllOrNothing.pyi new file mode 100644 index 0000000..a7ae7d6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Protocol/AllOrNothing.pyi @@ -0,0 +1,10 @@ +from typing import Any, Optional + +__revision__: str + +def isInt(x): ... + +class AllOrNothing: + def __init__(self, ciphermodule, mode: Optional[Any] = ..., IV: Optional[Any] = ...) -> None: ... + def digest(self, text): ... + def undigest(self, blocks): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Protocol/Chaffing.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Protocol/Chaffing.pyi new file mode 100644 index 0000000..d70e9f6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Protocol/Chaffing.pyi @@ -0,0 +1,5 @@ +__revision__: str + +class Chaff: + def __init__(self, factor: float = ..., blocksper: int = ...) -> None: ... + def chaff(self, blocks): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Protocol/KDF.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Protocol/KDF.pyi new file mode 100644 index 0000000..a10d839 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Protocol/KDF.pyi @@ -0,0 +1,7 @@ +from typing import Any, Optional +from Crypto.Hash import SHA as SHA1 + +__revision__: str + +def PBKDF1(password, salt, dkLen, count: int = ..., hashAlgo: Optional[Any] = ...): ... +def PBKDF2(password, salt, dkLen: int = ..., count: int = ..., prf: Optional[Any] = ...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Protocol/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Protocol/__init__.pyi new file mode 100644 index 0000000..e3744e5 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Protocol/__init__.pyi @@ -0,0 +1,4 @@ +# Names in __all__ with no definition: +# AllOrNothing +# Chaffing +# KDF diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/DSA.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/DSA.pyi new file mode 100644 index 0000000..bc48d23 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/DSA.pyi @@ -0,0 +1,27 @@ +from typing import Any, Optional +from .pubkey import pubkey + +class _DSAobj(pubkey): + keydata: Any + implementation: Any + key: Any + def __init__(self, implementation, key) -> None: ... + def __getattr__(self, attrname): ... + def sign(self, M, K): ... + def verify(self, M, signature): ... + def has_private(self): ... + def size(self): ... + def can_blind(self): ... + def can_encrypt(self): ... + def can_sign(self): ... + def publickey(self): ... + +class DSAImplementation: + error: Any + def __init__(self, **kwargs) -> None: ... + def generate(self, bits, randfunc: Optional[Any] = ..., progress_func: Optional[Any] = ...): ... + def construct(self, tup): ... + +generate: Any +construct: Any +error: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/ElGamal.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/ElGamal.pyi new file mode 100644 index 0000000..1a256a3 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/ElGamal.pyi @@ -0,0 +1,19 @@ +from typing import Any, Optional + +from Crypto.PublicKey.pubkey import pubkey +from Crypto.PublicKey.pubkey import * # noqa: F403 + +class error(Exception): ... + +def generate(bits, randfunc, progress_func: Optional[Any] = ...): ... +def construct(tup): ... + +class ElGamalobj(pubkey): + keydata: Any + def encrypt(self, plaintext, K): ... + def decrypt(self, ciphertext): ... + def sign(self, M, K): ... + def verify(self, M, signature): ... + def size(self): ... + def has_private(self): ... + def publickey(self): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/RSA.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/RSA.pyi new file mode 100644 index 0000000..5ce7b91 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/RSA.pyi @@ -0,0 +1,32 @@ +from typing import Any, Optional, Union, Text +from .pubkey import pubkey + +class _RSAobj(pubkey): + keydata: Any + implementation: Any + key: Any + def __init__(self, implementation, key, randfunc: Optional[Any] = ...) -> None: ... + def __getattr__(self, attrname): ... + def encrypt(self, plaintext, K): ... + def decrypt(self, ciphertext): ... + def sign(self, M, K): ... + def verify(self, M, signature): ... + def has_private(self): ... + def size(self): ... + def can_blind(self): ... + def can_encrypt(self): ... + def can_sign(self): ... + def publickey(self): ... + def exportKey(self, format: str = ..., passphrase: Optional[Any] = ..., pkcs: int = ...): ... + +class RSAImplementation: + error: Any + def __init__(self, **kwargs) -> None: ... + def generate(self, bits, randfunc: Optional[Any] = ..., progress_func: Optional[Any] = ..., e: int = ...): ... + def construct(self, tup): ... + def importKey(self, externKey: Any, passphrase: Union[None, bytes, Text] = ...) -> _RSAobj: ... + +generate: Any +construct: Any +importKey: Any +error: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/__init__.pyi new file mode 100644 index 0000000..36d9e94 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/__init__.pyi @@ -0,0 +1,4 @@ +# Names in __all__ with no definition: +# DSA +# ElGamal +# RSA diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/pubkey.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/pubkey.pyi new file mode 100644 index 0000000..b9281ad --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/pubkey.pyi @@ -0,0 +1,21 @@ +from Crypto.Util.number import * # noqa: F403 + +__revision__: str + +class pubkey: + def __init__(self) -> None: ... + def encrypt(self, plaintext, K): ... + def decrypt(self, ciphertext): ... + def sign(self, M, K): ... + def verify(self, M, signature): ... + def validate(self, M, signature): ... + def blind(self, M, B): ... + def unblind(self, M, B): ... + def can_sign(self): ... + def can_encrypt(self): ... + def can_blind(self): ... + def size(self): ... + def has_private(self): ... + def publickey(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/Fortuna/FortunaAccumulator.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/Fortuna/FortunaAccumulator.pyi new file mode 100644 index 0000000..40149bf --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/Fortuna/FortunaAccumulator.pyi @@ -0,0 +1,25 @@ +from typing import Any + +__revision__: str + +class FortunaPool: + digest_size: Any + def __init__(self) -> None: ... + def append(self, data): ... + def digest(self): ... + def hexdigest(self): ... + length: int + def reset(self): ... + +def which_pools(r): ... + +class FortunaAccumulator: + min_pool_size: int + reseed_interval: float + reseed_count: int + generator: Any + last_reseed: Any + pools: Any + def __init__(self) -> None: ... + def random_data(self, bytes): ... + def add_random_event(self, source_number, pool_number, data): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/Fortuna/FortunaGenerator.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/Fortuna/FortunaGenerator.pyi new file mode 100644 index 0000000..047ac93 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/Fortuna/FortunaGenerator.pyi @@ -0,0 +1,16 @@ +from typing import Any + +__revision__: str + +class AESGenerator: + block_size: Any + key_size: int + max_blocks_per_request: Any + counter: Any + key: Any + block_size_shift: Any + blocks_per_key: Any + max_bytes_per_request: Any + def __init__(self) -> None: ... + def reseed(self, seed): ... + def pseudo_random_data(self, bytes): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/Fortuna/SHAd256.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/Fortuna/SHAd256.pyi new file mode 100644 index 0000000..1fbd51f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/Fortuna/SHAd256.pyi @@ -0,0 +1,13 @@ +from typing import Any, Optional + +class _SHAd256: + digest_size: Any + def __init__(self, internal_api_check, sha256_hash_obj) -> None: ... + def copy(self): ... + def digest(self): ... + def hexdigest(self): ... + def update(self, data): ... + +digest_size: Any + +def new(data: Optional[Any] = ...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/Fortuna/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/Fortuna/__init__.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/OSRNG/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/OSRNG/__init__.pyi new file mode 100644 index 0000000..d1f1427 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/OSRNG/__init__.pyi @@ -0,0 +1 @@ +__revision__: str diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/OSRNG/fallback.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/OSRNG/fallback.pyi new file mode 100644 index 0000000..72df987 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/OSRNG/fallback.pyi @@ -0,0 +1,5 @@ +from .rng_base import BaseRNG + +class PythonOSURandomRNG(BaseRNG): + name: str + def __init__(self) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/OSRNG/posix.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/OSRNG/posix.pyi new file mode 100644 index 0000000..bbaf740 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/OSRNG/posix.pyi @@ -0,0 +1,6 @@ +from typing import Any, Optional +from .rng_base import BaseRNG + +class DevURandomRNG(BaseRNG): + name: str + def __init__(self, devname: Optional[Any] = ...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/OSRNG/rng_base.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/OSRNG/rng_base.pyi new file mode 100644 index 0000000..12e3d81 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/OSRNG/rng_base.pyi @@ -0,0 +1,11 @@ +__revision__: str + +class BaseRNG: + closed: bool + def __init__(self) -> None: ... + def __del__(self): ... + def __enter__(self): ... + def __exit__(self): ... + def close(self): ... + def flush(self): ... + def read(self, N: int = ...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/__init__.pyi new file mode 100644 index 0000000..f30acfd --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/__init__.pyi @@ -0,0 +1 @@ +def new(*args, **kwargs): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/random.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/random.pyi new file mode 100644 index 0000000..88ea62e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/random.pyi @@ -0,0 +1,17 @@ +from typing import Any, Optional + +class StrongRandom: + def __init__(self, rng: Optional[Any] = ..., randfunc: Optional[Any] = ...) -> None: ... + def getrandbits(self, k): ... + def randrange(self, *args): ... + def randint(self, a, b): ... + def choice(self, seq): ... + def shuffle(self, x): ... + def sample(self, population, k): ... + +getrandbits: Any +randrange: Any +randint: Any +choice: Any +shuffle: Any +sample: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Signature/PKCS1_PSS.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Signature/PKCS1_PSS.pyi new file mode 100644 index 0000000..8341c2b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Signature/PKCS1_PSS.pyi @@ -0,0 +1,9 @@ +from typing import Any, Optional + +class PSS_SigScheme: + def __init__(self, key, mgfunc, saltLen) -> None: ... + def can_sign(self): ... + def sign(self, mhash): ... + def verify(self, mhash, S): ... + +def new(key, mgfunc: Optional[Any] = ..., saltLen: Optional[Any] = ...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Signature/PKCS1_v1_5.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Signature/PKCS1_v1_5.pyi new file mode 100644 index 0000000..4a2b225 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Signature/PKCS1_v1_5.pyi @@ -0,0 +1,7 @@ +class PKCS115_SigScheme: + def __init__(self, key) -> None: ... + def can_sign(self): ... + def sign(self, mhash): ... + def verify(self, mhash, S): ... + +def new(key): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Signature/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Signature/__init__.pyi new file mode 100644 index 0000000..560f06f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Signature/__init__.pyi @@ -0,0 +1,3 @@ +# Names in __all__ with no definition: +# PKCS1_PSS +# PKCS1_v1_5 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/Counter.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/Counter.pyi new file mode 100644 index 0000000..4aae7f2 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/Counter.pyi @@ -0,0 +1,3 @@ +from typing import Any + +def new(nbits, prefix: Any = ..., suffix: Any = ..., initial_value: int = ..., overflow: int = ..., little_endian: bool = ..., allow_wraparound: bool = ..., disable_shortcut: bool = ...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/RFC1751.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/RFC1751.pyi new file mode 100644 index 0000000..e1e8f5e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/RFC1751.pyi @@ -0,0 +1,9 @@ +from typing import Any + +__revision__: str +binary: Any + +def key_to_english(key): ... +def english_to_key(s): ... + +wordlist: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/__init__.pyi new file mode 100644 index 0000000..1747299 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/__init__.pyi @@ -0,0 +1,6 @@ +# Names in __all__ with no definition: +# RFC1751 +# asn1 +# number +# randpool +# strxor diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/asn1.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/asn1.pyi new file mode 100644 index 0000000..03d4b29 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/asn1.pyi @@ -0,0 +1,45 @@ +from typing import Any, Optional + +class DerObject: + typeTags: Any + typeTag: Any + payload: Any + def __init__(self, ASN1Type: Optional[Any] = ..., payload: Any = ...) -> None: ... + def isType(self, ASN1Type): ... + def encode(self): ... + def decode(self, derEle, noLeftOvers: int = ...): ... + +class DerInteger(DerObject): + value: Any + def __init__(self, value: int = ...) -> None: ... + payload: Any + def encode(self): ... + def decode(self, derEle, noLeftOvers: int = ...): ... + +class DerSequence(DerObject): + def __init__(self, startSeq: Optional[Any] = ...) -> None: ... + def __delitem__(self, n): ... + def __getitem__(self, n): ... + def __setitem__(self, key, value): ... + def __setslice__(self, i, j, sequence): ... + def __delslice__(self, i, j): ... + def __getslice__(self, i, j): ... + def __len__(self): ... + def append(self, item): ... + def hasInts(self): ... + def hasOnlyInts(self): ... + payload: Any + def encode(self): ... + def decode(self, derEle, noLeftOvers: int = ...): ... + +class DerOctetString(DerObject): + payload: Any + def __init__(self, value: Any = ...) -> None: ... + def decode(self, derEle, noLeftOvers: int = ...): ... + +class DerNull(DerObject): + def __init__(self) -> None: ... + +class DerObjectId(DerObject): + def __init__(self) -> None: ... + def decode(self, derEle, noLeftOvers: int = ...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/number.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/number.pyi new file mode 100644 index 0000000..4ffbd03 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/number.pyi @@ -0,0 +1,22 @@ +from typing import Any, Optional +from warnings import warn as _warn + +__revision__: str +bignum: Any + +def size(N): ... +def getRandomNumber(N, randfunc: Optional[Any] = ...): ... +def getRandomInteger(N, randfunc: Optional[Any] = ...): ... +def getRandomRange(a, b, randfunc: Optional[Any] = ...): ... +def getRandomNBitInteger(N, randfunc: Optional[Any] = ...): ... +def GCD(x, y): ... +def inverse(u, v): ... +def getPrime(N, randfunc: Optional[Any] = ...): ... +def getStrongPrime(N, e: int = ..., false_positive_prob: float = ..., randfunc: Optional[Any] = ...): ... +def isPrime(N, false_positive_prob: float = ..., randfunc: Optional[Any] = ...): ... +def long_to_bytes(n, blocksize: int = ...): ... +def bytes_to_long(s): ... +def long2str(n, blocksize: int = ...): ... +def str2long(s): ... + +sieve_base: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/randpool.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/randpool.pyi new file mode 100644 index 0000000..4d90f92 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/randpool.pyi @@ -0,0 +1,16 @@ +from typing import Any, Optional + +__revision__: str + +class RandomPool: + bytes: Any + bits: Any + entropy: Any + def __init__(self, numbytes: int = ..., cipher: Optional[Any] = ..., hash: Optional[Any] = ..., file: Optional[Any] = ...) -> None: ... + def get_bytes(self, N): ... + def randomize(self, N: int = ...): ... + def stir(self, s: str = ...): ... + def stir_n(self, N: int = ...): ... + def add_event(self, s: str = ...): ... + def getBytes(self, N): ... + def addEvent(self, event, s: str = ...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/strxor.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/strxor.pyi new file mode 100644 index 0000000..cb6269b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/strxor.pyi @@ -0,0 +1,2 @@ +def strxor(*args, **kwargs): ... +def strxor_c(*args, **kwargs): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/__init__.pyi new file mode 100644 index 0000000..6d8e124 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/__init__.pyi @@ -0,0 +1,7 @@ +# Names in __all__ with no definition: +# Cipher +# Hash +# Protocol +# PublicKey +# Signature +# Util diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/pct_warnings.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/pct_warnings.pyi new file mode 100644 index 0000000..b77e975 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/Crypto/pct_warnings.pyi @@ -0,0 +1,7 @@ +class CryptoWarning(Warning): ... +class CryptoDeprecationWarning(DeprecationWarning, CryptoWarning): ... +class CryptoRuntimeWarning(RuntimeWarning, CryptoWarning): ... +class RandomPool_DeprecationWarning(CryptoDeprecationWarning): ... +class ClockRewindWarning(CryptoRuntimeWarning): ... +class GetRandomNumber_DeprecationWarning(CryptoDeprecationWarning): ... +class PowmInsecureWarning(CryptoRuntimeWarning): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/atomicwrites/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/atomicwrites/__init__.pyi new file mode 100644 index 0000000..07edff6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/atomicwrites/__init__.pyi @@ -0,0 +1,13 @@ +from typing import AnyStr, Callable, ContextManager, IO, Optional, Text, Type + +def replace_atomic(src: AnyStr, dst: AnyStr) -> None: ... +def move_atomic(src: AnyStr, dst: AnyStr) -> None: ... +class AtomicWriter(object): + def __init__(self, path: AnyStr, mode: Text = ..., overwrite: bool = ...) -> None: ... + def open(self) -> ContextManager[IO]: ... + def _open(self, get_fileobject: Callable) -> ContextManager[IO]: ... + def get_fileobject(self, dir: Optional[AnyStr] = ..., **kwargs) -> IO: ... + def sync(self, f: IO) -> None: ... + def commit(self, f: IO) -> None: ... + def rollback(self, f: IO) -> None: ... +def atomic_write(path: AnyStr, writer_cls: Type[AtomicWriter] = ..., **cls_kwargs: object) -> ContextManager[IO]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/attr/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/attr/__init__.pyi new file mode 100644 index 0000000..fcb93b1 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/attr/__init__.pyi @@ -0,0 +1,255 @@ +from typing import ( + Any, + Callable, + Dict, + Generic, + List, + Optional, + Sequence, + Mapping, + Tuple, + Type, + TypeVar, + Union, + overload, +) + +# `import X as X` is required to make these public +from . import exceptions as exceptions +from . import filters as filters +from . import converters as converters +from . import validators as validators + +_T = TypeVar("_T") +_C = TypeVar("_C", bound=type) + +_ValidatorType = Callable[[Any, Attribute[_T], _T], Any] +_ConverterType = Callable[[Any], _T] +_FilterType = Callable[[Attribute[_T], _T], bool] +# FIXME: in reality, if multiple validators are passed they must be in a list or tuple, +# but those are invariant and so would prevent subtypes of _ValidatorType from working +# when passed in a list or tuple. +_ValidatorArgType = Union[_ValidatorType[_T], Sequence[_ValidatorType[_T]]] + +# _make -- + +NOTHING: object + +# NOTE: Factory lies about its return type to make this possible: `x: List[int] = Factory(list)` +# Work around mypy issue #4554 in the common case by using an overload. +@overload +def Factory(factory: Callable[[], _T]) -> _T: ... +@overload +def Factory( + factory: Union[Callable[[Any], _T], Callable[[], _T]], + takes_self: bool = ..., +) -> _T: ... + +class Attribute(Generic[_T]): + name: str + default: Optional[_T] + validator: Optional[_ValidatorType[_T]] + repr: bool + cmp: bool + hash: Optional[bool] + init: bool + converter: Optional[_ConverterType[_T]] + metadata: Dict[Any, Any] + type: Optional[Type[_T]] + kw_only: bool + def __lt__(self, x: Attribute[_T]) -> bool: ... + def __le__(self, x: Attribute[_T]) -> bool: ... + def __gt__(self, x: Attribute[_T]) -> bool: ... + def __ge__(self, x: Attribute[_T]) -> bool: ... + +# NOTE: We had several choices for the annotation to use for type arg: +# 1) Type[_T] +# - Pros: Handles simple cases correctly +# - Cons: Might produce less informative errors in the case of conflicting TypeVars +# e.g. `attr.ib(default='bad', type=int)` +# 2) Callable[..., _T] +# - Pros: Better error messages than #1 for conflicting TypeVars +# - Cons: Terrible error messages for validator checks. +# e.g. attr.ib(type=int, validator=validate_str) +# -> error: Cannot infer function type argument +# 3) type (and do all of the work in the mypy plugin) +# - Pros: Simple here, and we could customize the plugin with our own errors. +# - Cons: Would need to write mypy plugin code to handle all the cases. +# We chose option #1. + +# `attr` lies about its return type to make the following possible: +# attr() -> Any +# attr(8) -> int +# attr(validator=) -> Whatever the callable expects. +# This makes this type of assignments possible: +# x: int = attr(8) +# +# This form catches explicit None or no default but with no other arguments returns Any. +@overload +def attrib( + default: None = ..., + validator: None = ..., + repr: bool = ..., + cmp: bool = ..., + hash: Optional[bool] = ..., + init: bool = ..., + convert: None = ..., + metadata: Optional[Mapping[Any, Any]] = ..., + type: None = ..., + converter: None = ..., + factory: None = ..., + kw_only: bool = ..., +) -> Any: ... + +# This form catches an explicit None or no default and infers the type from the other arguments. +@overload +def attrib( + default: None = ..., + validator: Optional[_ValidatorArgType[_T]] = ..., + repr: bool = ..., + cmp: bool = ..., + hash: Optional[bool] = ..., + init: bool = ..., + convert: Optional[_ConverterType[_T]] = ..., + metadata: Optional[Mapping[Any, Any]] = ..., + type: Optional[Type[_T]] = ..., + converter: Optional[_ConverterType[_T]] = ..., + factory: Optional[Callable[[], _T]] = ..., + kw_only: bool = ..., +) -> _T: ... + +# This form catches an explicit default argument. +@overload +def attrib( + default: _T, + validator: Optional[_ValidatorArgType[_T]] = ..., + repr: bool = ..., + cmp: bool = ..., + hash: Optional[bool] = ..., + init: bool = ..., + convert: Optional[_ConverterType[_T]] = ..., + metadata: Optional[Mapping[Any, Any]] = ..., + type: Optional[Type[_T]] = ..., + converter: Optional[_ConverterType[_T]] = ..., + factory: Optional[Callable[[], _T]] = ..., + kw_only: bool = ..., +) -> _T: ... + +# This form covers type=non-Type: e.g. forward references (str), Any +@overload +def attrib( + default: Optional[_T] = ..., + validator: Optional[_ValidatorArgType[_T]] = ..., + repr: bool = ..., + cmp: bool = ..., + hash: Optional[bool] = ..., + init: bool = ..., + convert: Optional[_ConverterType[_T]] = ..., + metadata: Optional[Mapping[Any, Any]] = ..., + type: object = ..., + converter: Optional[_ConverterType[_T]] = ..., + factory: Optional[Callable[[], _T]] = ..., + kw_only: bool = ..., +) -> Any: ... +@overload +def attrs( + maybe_cls: _C, + these: Optional[Dict[str, Any]] = ..., + repr_ns: Optional[str] = ..., + repr: bool = ..., + cmp: bool = ..., + hash: Optional[bool] = ..., + init: bool = ..., + slots: bool = ..., + frozen: bool = ..., + weakref_slot: bool = ..., + str: bool = ..., + auto_attribs: bool = ..., + kw_only: bool = ..., + cache_hash: bool = ..., + auto_exc: bool = ..., +) -> _C: ... +@overload +def attrs( + maybe_cls: None = ..., + these: Optional[Dict[str, Any]] = ..., + repr_ns: Optional[str] = ..., + repr: bool = ..., + cmp: bool = ..., + hash: Optional[bool] = ..., + init: bool = ..., + slots: bool = ..., + frozen: bool = ..., + weakref_slot: bool = ..., + str: bool = ..., + auto_attribs: bool = ..., + kw_only: bool = ..., + cache_hash: bool = ..., + auto_exc: bool = ..., +) -> Callable[[_C], _C]: ... + +# TODO: add support for returning NamedTuple from the mypy plugin +class _Fields(Tuple[Attribute[Any], ...]): + def __getattr__(self, name: str) -> Attribute[Any]: ... + +def fields(cls: type) -> _Fields: ... +def fields_dict(cls: type) -> Dict[str, Attribute[Any]]: ... +def validate(inst: Any) -> None: ... + +# TODO: add support for returning a proper attrs class from the mypy plugin +# we use Any instead of _CountingAttr so that e.g. `make_class('Foo', [attr.ib()])` is valid +def make_class( + name: str, + attrs: Union[List[str], Tuple[str, ...], Dict[str, Any]], + bases: Tuple[type, ...] = ..., + repr_ns: Optional[str] = ..., + repr: bool = ..., + cmp: bool = ..., + hash: Optional[bool] = ..., + init: bool = ..., + slots: bool = ..., + frozen: bool = ..., + weakref_slot: bool = ..., + str: bool = ..., + auto_attribs: bool = ..., + kw_only: bool = ..., + cache_hash: bool = ..., + auto_exc: bool = ..., +) -> type: ... + +# _funcs -- + +# TODO: add support for returning TypedDict from the mypy plugin +# FIXME: asdict/astuple do not honor their factory args. waiting on one of these: +# https://github.com/python/mypy/issues/4236 +# https://github.com/python/typing/issues/253 +def asdict( + inst: Any, + recurse: bool = ..., + filter: Optional[_FilterType[Any]] = ..., + dict_factory: Type[Mapping[Any, Any]] = ..., + retain_collection_types: bool = ..., +) -> Dict[str, Any]: ... + +# TODO: add support for returning NamedTuple from the mypy plugin +def astuple( + inst: Any, + recurse: bool = ..., + filter: Optional[_FilterType[Any]] = ..., + tuple_factory: Type[Sequence[Any]] = ..., + retain_collection_types: bool = ..., +) -> Tuple[Any, ...]: ... +def has(cls: type) -> bool: ... +def assoc(inst: _T, **changes: Any) -> _T: ... +def evolve(inst: _T, **changes: Any) -> _T: ... + +# _config -- + +def set_run_validators(run: bool) -> None: ... +def get_run_validators() -> bool: ... + +# aliases -- + +s = attributes = attrs +ib = attr = attrib +dataclass = attrs # Technically, partial(attrs, auto_attribs=True) ;) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/attr/converters.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/attr/converters.pyi new file mode 100644 index 0000000..63b2a38 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/attr/converters.pyi @@ -0,0 +1,12 @@ +from typing import TypeVar, Optional, Callable, overload +from . import _ConverterType + +_T = TypeVar("_T") + +def optional( + converter: _ConverterType[_T] +) -> _ConverterType[Optional[_T]]: ... +@overload +def default_if_none(default: _T) -> _ConverterType[_T]: ... +@overload +def default_if_none(*, factory: Callable[[], _T]) -> _ConverterType[_T]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/attr/exceptions.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/attr/exceptions.pyi new file mode 100644 index 0000000..48fffcc --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/attr/exceptions.pyi @@ -0,0 +1,7 @@ +class FrozenInstanceError(AttributeError): + msg: str = ... + +class AttrsAttributeNotFoundError(ValueError): ... +class NotAnAttrsClassError(ValueError): ... +class DefaultAlreadySetError(RuntimeError): ... +class UnannotatedAttributeError(RuntimeError): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/attr/filters.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/attr/filters.pyi new file mode 100644 index 0000000..68368fe --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/attr/filters.pyi @@ -0,0 +1,5 @@ +from typing import Union, Any +from . import Attribute, _FilterType + +def include(*what: Union[type, Attribute[Any]]) -> _FilterType[Any]: ... +def exclude(*what: Union[type, Attribute[Any]]) -> _FilterType[Any]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/attr/validators.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/attr/validators.pyi new file mode 100644 index 0000000..01af068 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/attr/validators.pyi @@ -0,0 +1,24 @@ +from typing import Container, List, Union, TypeVar, Type, Any, Optional, Tuple +from . import _ValidatorType + +_T = TypeVar("_T") + +def instance_of( + type: Union[Tuple[Type[_T], ...], Type[_T]] +) -> _ValidatorType[_T]: ... +def provides(interface: Any) -> _ValidatorType[Any]: ... +def optional( + validator: Union[_ValidatorType[_T], List[_ValidatorType[_T]]] +) -> _ValidatorType[Optional[_T]]: ... +def in_(options: Container[_T]) -> _ValidatorType[_T]: ... +def and_(*validators: _ValidatorType[_T]) -> _ValidatorType[_T]: ... +def deep_iterable( + member_validator: _ValidatorType[_T], + iterable_validator: Optional[_ValidatorType[_T]], +) -> _ValidatorType[_T]: ... +def deep_mapping( + key_validator: _ValidatorType[_T], + value_validator: _ValidatorType[_T], + mapping_validator: Optional[_ValidatorType[_T]], +) -> _ValidatorType[_T]: ... +def is_callable() -> _ValidatorType[_T]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/backports/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/backports/__init__.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/backports/ssl_match_hostname.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/backports/ssl_match_hostname.pyi new file mode 100644 index 0000000..c219980 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/backports/ssl_match_hostname.pyi @@ -0,0 +1,3 @@ +class CertificateError(ValueError): ... + +def match_hostname(cert, hostname): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/backports_abc.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/backports_abc.pyi new file mode 100644 index 0000000..b48ae33 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/backports_abc.pyi @@ -0,0 +1,15 @@ +from typing import Any + +def mk_gen(): ... +def mk_awaitable(): ... +def mk_coroutine(): ... + +Generator: Any +Awaitable: Any +Coroutine: Any + +def isawaitable(obj): ... + +PATCHED: Any + +def patch(patch_inspect: bool = ...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/bleach/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/bleach/__init__.pyi new file mode 100644 index 0000000..3a1ad2c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/bleach/__init__.pyi @@ -0,0 +1,32 @@ +from typing import Any, Container, Iterable, Optional, Text + +from bleach.linkifier import DEFAULT_CALLBACKS as DEFAULT_CALLBACKS, Linker as Linker +from bleach.sanitizer import ( + ALLOWED_ATTRIBUTES as ALLOWED_ATTRIBUTES, + ALLOWED_PROTOCOLS as ALLOWED_PROTOCOLS, + ALLOWED_STYLES as ALLOWED_STYLES, + ALLOWED_TAGS as ALLOWED_TAGS, + Cleaner as Cleaner, +) + +from .linkifier import _Callback + +__releasedate__: Text +__version__: Text +VERSION: Any # packaging.version.Version + +def clean( + text: Text, + tags: Container[Text] = ..., + attributes: Any = ..., + styles: Container[Text] = ..., + protocols: Container[Text] = ..., + strip: bool = ..., + strip_comments: bool = ..., +) -> Text: ... +def linkify( + text: Text, + callbacks: Iterable[_Callback] = ..., + skip_tags: Optional[Container[Text]] = ..., + parse_email: bool = ..., +) -> Text: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/bleach/callbacks.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/bleach/callbacks.pyi new file mode 100644 index 0000000..25c5c01 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/bleach/callbacks.pyi @@ -0,0 +1,6 @@ +from typing import MutableMapping, Any, Text + +_Attrs = MutableMapping[Any, Text] + +def nofollow(attrs: _Attrs, new: bool = ...) -> _Attrs: ... +def target_blank(attrs: _Attrs, new: bool = ...) -> _Attrs: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/bleach/linkifier.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/bleach/linkifier.pyi new file mode 100644 index 0000000..f6ef3ce --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/bleach/linkifier.pyi @@ -0,0 +1,31 @@ +from typing import Any, Container, Iterable, List, MutableMapping, Optional, Pattern, Protocol, Text + +_Attrs = MutableMapping[Any, Text] + +class _Callback(Protocol): + def __call__(self, attrs: _Attrs, new: bool = ...) -> _Attrs: ... + +DEFAULT_CALLBACKS: List[_Callback] + +TLDS: List[Text] + +def build_url_re(tlds: Iterable[Text] = ..., protocols: Iterable[Text] = ...) -> Pattern[Text]: ... + +URL_RE: Pattern[Text] +PROTO_RE: Pattern[Text] +EMAIL_RE: Pattern[Text] + +class Linker(object): + def __init__( + self, + callbacks: Iterable[_Callback] = ..., + skip_tags: Optional[Container[Text]] = ..., + parse_email: bool = ..., + url_re: Pattern[Text] = ..., + email_re: Pattern[Text] = ..., + recognized_tags: Optional[Container[Text]] = ..., + ) -> None: ... + def linkify(self, text: Text) -> Text: ... + +class LinkifyFilter(object): # TODO: derives from html5lib.Filter + def __getattr__(self, item: str) -> Any: ... # incomplete diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/bleach/sanitizer.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/bleach/sanitizer.pyi new file mode 100644 index 0000000..c6a7283 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/bleach/sanitizer.pyi @@ -0,0 +1,34 @@ +from typing import Any, Callable, Container, Dict, Iterable, List, Optional, Pattern, Text, Type, Union + +ALLOWED_TAGS: List[Text] +ALLOWED_ATTRIBUTES: Dict[Text, List[Text]] +ALLOWED_STYLES: List[Text] +ALLOWED_PROTOCOLS: List[Text] + +INVISIBLE_CHARACTERS: Text +INVISIBLE_CHARACTERS_RE: Pattern[Text] +INVISIBLE_REPLACEMENT_CHAR: Text + +# A html5lib Filter class +_Filter = Any + +class Cleaner(object): + def __init__( + self, + tags: Container[Text] = ..., + attributes: Any = ..., + styles: Container[Text] = ..., + protocols: Container[Text] = ..., + strip: bool = ..., + strip_comments: bool = ..., + filters: Optional[Iterable[_Filter]] = ..., + ) -> None: ... + def clean(self, text: Text) -> Text: ... + +_AttributeFilter = Callable[[Text, Text, Text], bool] +_AttributeDict = Dict[Text, Union[Container[Text], _AttributeFilter]] + +def attribute_filter_factory(attributes: Union[_AttributeFilter, _AttributeDict, Container[Text]]) -> _AttributeFilter: ... + +class BleachSanitizerFilter(object): # TODO: derives from html5lib.sanitizer.Filter + def __getattr__(self, item: str) -> Any: ... # incomplete diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/bleach/utils.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/bleach/utils.pyi new file mode 100644 index 0000000..984c554 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/bleach/utils.pyi @@ -0,0 +1,8 @@ +from collections import OrderedDict +from typing import overload, Mapping, Any, Text + +@overload +def alphabetize_attributes(attrs: None) -> None: ... +@overload +def alphabetize_attributes(attrs: Mapping[Any, Text]) -> OrderedDict[Any, Text]: ... +def force_unicode(text: Text) -> Text: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/__init__.pyi new file mode 100644 index 0000000..8426785 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/__init__.pyi @@ -0,0 +1,76 @@ +from typing import Any, Optional, Text +import logging + +from .s3.connection import S3Connection + +Version: Any +UserAgent: Any +config: Any +BUCKET_NAME_RE: Any +TOO_LONG_DNS_NAME_COMP: Any +GENERATION_RE: Any +VERSION_RE: Any +ENDPOINTS_PATH: Any + +def init_logging(): ... + +class NullHandler(logging.Handler): + def emit(self, record): ... + +log: Any +perflog: Any + +def set_file_logger(name, filepath, level: Any = ..., format_string: Optional[Any] = ...): ... +def set_stream_logger(name, level: Any = ..., format_string: Optional[Any] = ...): ... +def connect_sqs(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_s3(aws_access_key_id: Optional[Text] = ..., aws_secret_access_key: Optional[Text] = ..., **kwargs) -> S3Connection: ... +def connect_gs(gs_access_key_id: Optional[Any] = ..., gs_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_ec2(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_elb(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_autoscale(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_cloudwatch(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_sdb(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_fps(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_mturk(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_cloudfront(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_vpc(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_rds(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_rds2(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_emr(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_sns(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_iam(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_route53(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_cloudformation(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_euca(host: Optional[Any] = ..., aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., port: int = ..., path: str = ..., is_secure: bool = ..., **kwargs): ... +def connect_glacier(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_ec2_endpoint(url, aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_walrus(host: Optional[Any] = ..., aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., port: int = ..., path: str = ..., is_secure: bool = ..., **kwargs): ... +def connect_ses(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_sts(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_ia(ia_access_key_id: Optional[Any] = ..., ia_secret_access_key: Optional[Any] = ..., is_secure: bool = ..., **kwargs): ... +def connect_dynamodb(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_swf(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_cloudsearch(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_cloudsearch2(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., sign_request: bool = ..., **kwargs): ... +def connect_cloudsearchdomain(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_beanstalk(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_elastictranscoder(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_opsworks(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_redshift(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_support(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_cloudtrail(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_directconnect(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_kinesis(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_logs(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_route53domains(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_cognito_identity(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_cognito_sync(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_kms(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_awslambda(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_codedeploy(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_configservice(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_cloudhsm(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_ec2containerservice(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_machinelearning(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def storage_uri(uri_str, default_scheme: str = ..., debug: int = ..., validate: bool = ..., bucket_storage_uri_class: Any = ..., suppress_consec_slashes: bool = ..., is_latest: bool = ...): ... +def storage_uri_for_key(key): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/auth.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/auth.pyi new file mode 100644 index 0000000..033d1d7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/auth.pyi @@ -0,0 +1,108 @@ +from typing import Any, Optional +from boto.auth_handler import AuthHandler + +SIGV4_DETECT: Any + +class HmacKeys: + host: Any + def __init__(self, host, config, provider) -> None: ... + def update_provider(self, provider): ... + def algorithm(self): ... + def sign_string(self, string_to_sign): ... + +class AnonAuthHandler(AuthHandler, HmacKeys): + capability: Any + def __init__(self, host, config, provider) -> None: ... + def add_auth(self, http_request, **kwargs): ... + +class HmacAuthV1Handler(AuthHandler, HmacKeys): + capability: Any + def __init__(self, host, config, provider) -> None: ... + def update_provider(self, provider): ... + def add_auth(self, http_request, **kwargs): ... + +class HmacAuthV2Handler(AuthHandler, HmacKeys): + capability: Any + def __init__(self, host, config, provider) -> None: ... + def update_provider(self, provider): ... + def add_auth(self, http_request, **kwargs): ... + +class HmacAuthV3Handler(AuthHandler, HmacKeys): + capability: Any + def __init__(self, host, config, provider) -> None: ... + def add_auth(self, http_request, **kwargs): ... + +class HmacAuthV3HTTPHandler(AuthHandler, HmacKeys): + capability: Any + def __init__(self, host, config, provider) -> None: ... + def headers_to_sign(self, http_request): ... + def canonical_headers(self, headers_to_sign): ... + def string_to_sign(self, http_request): ... + def add_auth(self, req, **kwargs): ... + +class HmacAuthV4Handler(AuthHandler, HmacKeys): + capability: Any + service_name: Any + region_name: Any + def __init__(self, host, config, provider, service_name: Optional[Any] = ..., region_name: Optional[Any] = ...) -> None: ... + def headers_to_sign(self, http_request): ... + def host_header(self, host, http_request): ... + def query_string(self, http_request): ... + def canonical_query_string(self, http_request): ... + def canonical_headers(self, headers_to_sign): ... + def signed_headers(self, headers_to_sign): ... + def canonical_uri(self, http_request): ... + def payload(self, http_request): ... + def canonical_request(self, http_request): ... + def scope(self, http_request): ... + def split_host_parts(self, host): ... + def determine_region_name(self, host): ... + def determine_service_name(self, host): ... + def credential_scope(self, http_request): ... + def string_to_sign(self, http_request, canonical_request): ... + def signature(self, http_request, string_to_sign): ... + def add_auth(self, req, **kwargs): ... + +class S3HmacAuthV4Handler(HmacAuthV4Handler, AuthHandler): + capability: Any + region_name: Any + def __init__(self, *args, **kwargs) -> None: ... + def clean_region_name(self, region_name): ... + def canonical_uri(self, http_request): ... + def canonical_query_string(self, http_request): ... + def host_header(self, host, http_request): ... + def headers_to_sign(self, http_request): ... + def determine_region_name(self, host): ... + def determine_service_name(self, host): ... + def mangle_path_and_params(self, req): ... + def payload(self, http_request): ... + def add_auth(self, req, **kwargs): ... + def presign(self, req, expires, iso_date: Optional[Any] = ...): ... + +class STSAnonHandler(AuthHandler): + capability: Any + def add_auth(self, http_request, **kwargs): ... + +class QuerySignatureHelper(HmacKeys): + def add_auth(self, http_request, **kwargs): ... + +class QuerySignatureV0AuthHandler(QuerySignatureHelper, AuthHandler): + SignatureVersion: int + capability: Any + +class QuerySignatureV1AuthHandler(QuerySignatureHelper, AuthHandler): + SignatureVersion: int + capability: Any + def __init__(self, *args, **kw) -> None: ... + +class QuerySignatureV2AuthHandler(QuerySignatureHelper, AuthHandler): + SignatureVersion: int + capability: Any + +class POSTPathQSV2AuthHandler(QuerySignatureV2AuthHandler, AuthHandler): + capability: Any + def add_auth(self, req, **kwargs): ... + +def get_auth_handler(host, config, provider, requested_capability: Optional[Any] = ...): ... +def detect_potential_sigv4(func): ... +def detect_potential_s3sigv4(func): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/auth_handler.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/auth_handler.pyi new file mode 100644 index 0000000..018e6d1 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/auth_handler.pyi @@ -0,0 +1,9 @@ +from typing import Any +from boto.plugin import Plugin + +class NotReadyToAuthenticate(Exception): ... + +class AuthHandler(Plugin): + capability: Any + def __init__(self, host, config, provider) -> None: ... + def add_auth(self, http_request): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/compat.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/compat.pyi new file mode 100644 index 0000000..ce99703 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/compat.pyi @@ -0,0 +1,17 @@ +import sys + +from typing import Any +from base64 import encodestring as encodebytes + +from six.moves import http_client + +expanduser: Any + +if sys.version_info >= (3, 0): + StandardError = Exception +else: + from __builtin__ import StandardError as StandardError + +long_type: Any +unquote_str: Any +parse_qs_safe: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/connection.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/connection.pyi new file mode 100644 index 0000000..820d6e3 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/connection.pyi @@ -0,0 +1,115 @@ +from typing import Any, Dict, Optional, Text +from six.moves import http_client + +HAVE_HTTPS_CONNECTION: bool +ON_APP_ENGINE: Any +PORTS_BY_SECURITY: Any +DEFAULT_CA_CERTS_FILE: Any + +class HostConnectionPool: + queue: Any + def __init__(self) -> None: ... + def size(self): ... + def put(self, conn): ... + def get(self): ... + def clean(self): ... + +class ConnectionPool: + CLEAN_INTERVAL: float + STALE_DURATION: float + host_to_pool: Any + last_clean_time: float + mutex: Any + def __init__(self) -> None: ... + def size(self): ... + def get_http_connection(self, host, port, is_secure): ... + def put_http_connection(self, host, port, is_secure, conn): ... + def clean(self): ... + +class HTTPRequest: + method: Any + protocol: Any + host: Any + port: Any + path: Any + auth_path: Any + params: Any + headers: Any + body: Any + def __init__(self, method, protocol, host, port, path, auth_path, params, headers, body) -> None: ... + def authorize(self, connection, **kwargs): ... + +class HTTPResponse(http_client.HTTPResponse): + def __init__(self, *args, **kwargs) -> None: ... + def read(self, amt: Optional[Any] = ...): ... + +class AWSAuthConnection: + suppress_consec_slashes: Any + num_retries: int + is_secure: Any + https_validate_certificates: Any + ca_certificates_file: Any + port: Any + http_exceptions: Any + http_unretryable_exceptions: Any + socket_exception_values: Any + https_connection_factory: Any + protocol: str + host: Any + path: Any + debug: Any + host_header: Any + http_connection_kwargs: Any + provider: Any + auth_service_name: Any + request_hook: Any + def __init__(self, host, aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., is_secure: bool = ..., port: Optional[Any] = ..., proxy: Optional[Any] = ..., proxy_port: Optional[Any] = ..., proxy_user: Optional[Any] = ..., proxy_pass: Optional[Any] = ..., debug: int = ..., https_connection_factory: Optional[Any] = ..., path: str = ..., provider: str = ..., security_token: Optional[Any] = ..., suppress_consec_slashes: bool = ..., validate_certs: bool = ..., profile_name: Optional[Any] = ...) -> None: ... + auth_region_name: Any + @property + def connection(self): ... + @property + def aws_access_key_id(self): ... + @property + def gs_access_key_id(self) -> Any: ... + access_key: Any + @property + def aws_secret_access_key(self): ... + @property + def gs_secret_access_key(self): ... + secret_key: Any + @property + def profile_name(self): ... + def get_path(self, path: str = ...): ... + def server_name(self, port: Optional[Any] = ...): ... + proxy: Any + proxy_port: Any + proxy_user: Any + proxy_pass: Any + no_proxy: Any + use_proxy: Any + def handle_proxy(self, proxy, proxy_port, proxy_user, proxy_pass): ... + def get_http_connection(self, host, port, is_secure): ... + def skip_proxy(self, host): ... + def new_http_connection(self, host, port, is_secure): ... + def put_http_connection(self, host, port, is_secure, connection): ... + def proxy_ssl(self, host: Optional[Any] = ..., port: Optional[Any] = ...): ... + def prefix_proxy_to_path(self, path, host: Optional[Any] = ...): ... + def get_proxy_auth_header(self): ... + def get_proxy_url_with_auth(self): ... + def set_host_header(self, request): ... + def set_request_hook(self, hook): ... + def build_base_http_request(self, method, path, auth_path, params: Optional[Any] = ..., headers: Optional[Any] = ..., data: str = ..., host: Optional[Any] = ...): ... + def make_request(self, method, path, headers: Optional[Any] = ..., data: str = ..., host: Optional[Any] = ..., auth_path: Optional[Any] = ..., sender: Optional[Any] = ..., override_num_retries: Optional[Any] = ..., params: Optional[Any] = ..., retry_handler: Optional[Any] = ...): ... + def close(self): ... + +class AWSQueryConnection(AWSAuthConnection): + APIVersion: str + ResponseError: Any + def __init__(self, aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., is_secure: bool = ..., port: Optional[Any] = ..., proxy: Optional[Any] = ..., proxy_port: Optional[Any] = ..., proxy_user: Optional[Any] = ..., proxy_pass: Optional[Any] = ..., host: Optional[Any] = ..., debug: int = ..., https_connection_factory: Optional[Any] = ..., path: str = ..., security_token: Optional[Any] = ..., validate_certs: bool = ..., profile_name: Optional[Any] = ..., provider: str = ...) -> None: ... + def get_utf8_value(self, value): ... + def make_request(self, action, params: Optional[Any] = ..., path: str = ..., verb: str = ..., *args, **kwargs): ... # type: ignore # https://github.com/python/mypy/issues/1237 + def build_list_params(self, params, items, label): ... + def build_complex_list_params(self, params, items, label, names): ... + def get_list(self, action, params, markers, path: str = ..., parent: Optional[Any] = ..., verb: str = ...): ... + def get_object(self, action, params, cls, path: str = ..., parent: Optional[Any] = ..., verb: str = ...): ... + def get_status(self, action, params, path: str = ..., parent: Optional[Any] = ..., verb: str = ...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/ec2/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/ec2/__init__.pyi new file mode 100644 index 0000000..d671c90 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/ec2/__init__.pyi @@ -0,0 +1,7 @@ +from typing import Any + +RegionData: Any + +def regions(**kw_params): ... +def connect_to_region(region_name, **kw_params): ... +def get_region(region_name, **kw_params): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/elb/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/elb/__init__.pyi new file mode 100644 index 0000000..16cf5b4 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/elb/__init__.pyi @@ -0,0 +1,39 @@ +from typing import Any +from boto.connection import AWSQueryConnection + +RegionData: Any + +def regions(): ... +def connect_to_region(region_name, **kw_params): ... + +class ELBConnection(AWSQueryConnection): + APIVersion: Any + DefaultRegionName: Any + DefaultRegionEndpoint: Any + region: Any + def __init__(self, aws_access_key_id=..., aws_secret_access_key=..., is_secure=..., port=..., proxy=..., proxy_port=..., proxy_user=..., proxy_pass=..., debug=..., https_connection_factory=..., region=..., path=..., security_token=..., validate_certs=..., profile_name=...) -> None: ... + def build_list_params(self, params, items, label): ... + def get_all_load_balancers(self, load_balancer_names=..., marker=...): ... + def create_load_balancer(self, name, zones, listeners=..., subnets=..., security_groups=..., scheme=..., complex_listeners=...): ... + def create_load_balancer_listeners(self, name, listeners=..., complex_listeners=...): ... + def delete_load_balancer(self, name): ... + def delete_load_balancer_listeners(self, name, ports): ... + def enable_availability_zones(self, load_balancer_name, zones_to_add): ... + def disable_availability_zones(self, load_balancer_name, zones_to_remove): ... + def modify_lb_attribute(self, load_balancer_name, attribute, value): ... + def get_all_lb_attributes(self, load_balancer_name): ... + def get_lb_attribute(self, load_balancer_name, attribute): ... + def register_instances(self, load_balancer_name, instances): ... + def deregister_instances(self, load_balancer_name, instances): ... + def describe_instance_health(self, load_balancer_name, instances=...): ... + def configure_health_check(self, name, health_check): ... + def set_lb_listener_SSL_certificate(self, lb_name, lb_port, ssl_certificate_id): ... + def create_app_cookie_stickiness_policy(self, name, lb_name, policy_name): ... + def create_lb_cookie_stickiness_policy(self, cookie_expiration_period, lb_name, policy_name): ... + def create_lb_policy(self, lb_name, policy_name, policy_type, policy_attributes): ... + def delete_lb_policy(self, lb_name, policy_name): ... + def set_lb_policies_of_listener(self, lb_name, lb_port, policies): ... + def set_lb_policies_of_backend_server(self, lb_name, instance_port, policies): ... + def apply_security_groups_to_lb(self, name, security_groups): ... + def attach_lb_to_subnets(self, name, subnets): ... + def detach_lb_from_subnets(self, name, subnets): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/exception.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/exception.pyi new file mode 100644 index 0000000..e83a074 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/exception.pyi @@ -0,0 +1,146 @@ +from typing import Any, Optional +from boto.compat import StandardError + +class BotoClientError(StandardError): + reason: Any + def __init__(self, reason, *args) -> None: ... + +class SDBPersistenceError(StandardError): ... +class StoragePermissionsError(BotoClientError): ... +class S3PermissionsError(StoragePermissionsError): ... +class GSPermissionsError(StoragePermissionsError): ... + +class BotoServerError(StandardError): + status: Any + reason: Any + body: Any + request_id: Any + error_code: Any + message: str + box_usage: Any + def __init__(self, status, reason, body: Optional[Any] = ..., *args) -> None: ... + def __getattr__(self, name): ... + def __setattr__(self, name, value): ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + +class ConsoleOutput: + parent: Any + instance_id: Any + timestamp: Any + comment: Any + output: Any + def __init__(self, parent: Optional[Any] = ...) -> None: ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + +class StorageCreateError(BotoServerError): + bucket: Any + def __init__(self, status, reason, body: Optional[Any] = ...) -> None: ... + def endElement(self, name, value, connection): ... + +class S3CreateError(StorageCreateError): ... +class GSCreateError(StorageCreateError): ... +class StorageCopyError(BotoServerError): ... +class S3CopyError(StorageCopyError): ... +class GSCopyError(StorageCopyError): ... + +class SQSError(BotoServerError): + detail: Any + type: Any + def __init__(self, status, reason, body: Optional[Any] = ...) -> None: ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + +class SQSDecodeError(BotoClientError): + message: Any + def __init__(self, reason, message) -> None: ... + +class StorageResponseError(BotoServerError): + resource: Any + def __init__(self, status, reason, body: Optional[Any] = ...) -> None: ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + +class S3ResponseError(StorageResponseError): ... +class GSResponseError(StorageResponseError): ... + +class EC2ResponseError(BotoServerError): + errors: Any + def __init__(self, status, reason, body: Optional[Any] = ...) -> None: ... + def startElement(self, name, attrs, connection): ... + request_id: Any + def endElement(self, name, value, connection): ... + +class JSONResponseError(BotoServerError): + status: Any + reason: Any + body: Any + error_message: Any + error_code: Any + def __init__(self, status, reason, body: Optional[Any] = ..., *args) -> None: ... + +class DynamoDBResponseError(JSONResponseError): ... +class SWFResponseError(JSONResponseError): ... +class EmrResponseError(BotoServerError): ... + +class _EC2Error: + connection: Any + error_code: Any + error_message: Any + def __init__(self, connection: Optional[Any] = ...) -> None: ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + +class SDBResponseError(BotoServerError): ... +class AWSConnectionError(BotoClientError): ... +class StorageDataError(BotoClientError): ... +class S3DataError(StorageDataError): ... +class GSDataError(StorageDataError): ... + +class InvalidUriError(Exception): + message: Any + def __init__(self, message) -> None: ... + +class InvalidAclError(Exception): + message: Any + def __init__(self, message) -> None: ... + +class InvalidCorsError(Exception): + message: Any + def __init__(self, message) -> None: ... + +class NoAuthHandlerFound(Exception): ... + +class InvalidLifecycleConfigError(Exception): + message: Any + def __init__(self, message) -> None: ... + +class ResumableTransferDisposition: + START_OVER: str + WAIT_BEFORE_RETRY: str + ABORT_CUR_PROCESS: str + ABORT: str + +class ResumableUploadException(Exception): + message: Any + disposition: Any + def __init__(self, message, disposition) -> None: ... + +class ResumableDownloadException(Exception): + message: Any + disposition: Any + def __init__(self, message, disposition) -> None: ... + +class TooManyRecordsException(Exception): + message: Any + def __init__(self, message) -> None: ... + +class PleaseRetryException(Exception): + message: Any + response: Any + def __init__(self, message, response: Optional[Any] = ...) -> None: ... + +class InvalidInstanceMetadataError(Exception): + MSG: str + def __init__(self, msg) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/kms/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/kms/__init__.pyi new file mode 100644 index 0000000..41fff60 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/kms/__init__.pyi @@ -0,0 +1,5 @@ +from typing import List +import boto.regioninfo + +def regions() -> List[boto.regioninfo.RegionInfo]: ... +def connect_to_region(region_name, **kw_params): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/kms/exceptions.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/kms/exceptions.pyi new file mode 100644 index 0000000..5ac2ecd --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/kms/exceptions.pyi @@ -0,0 +1,17 @@ +from boto.exception import BotoServerError + +class InvalidGrantTokenException(BotoServerError): ... +class DisabledException(BotoServerError): ... +class LimitExceededException(BotoServerError): ... +class DependencyTimeoutException(BotoServerError): ... +class InvalidMarkerException(BotoServerError): ... +class AlreadyExistsException(BotoServerError): ... +class InvalidCiphertextException(BotoServerError): ... +class KeyUnavailableException(BotoServerError): ... +class InvalidAliasNameException(BotoServerError): ... +class UnsupportedOperationException(BotoServerError): ... +class InvalidArnException(BotoServerError): ... +class KMSInternalException(BotoServerError): ... +class InvalidKeyUsageException(BotoServerError): ... +class MalformedPolicyDocumentException(BotoServerError): ... +class NotFoundException(BotoServerError): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/kms/layer1.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/kms/layer1.pyi new file mode 100644 index 0000000..f48ce66 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/kms/layer1.pyi @@ -0,0 +1,37 @@ +from typing import Any, Dict, List, Mapping, Optional, Type +from boto.connection import AWSQueryConnection + +class KMSConnection(AWSQueryConnection): + APIVersion: str + DefaultRegionName: str + DefaultRegionEndpoint: str + ServiceName: str + TargetPrefix: str + ResponseError: Type[Exception] + region: Any + def __init__(self, **kwargs) -> None: ... + def create_alias(self, alias_name: str, target_key_id: str) -> Optional[Dict[str, Any]]: ... + def create_grant(self, key_id: str, grantee_principal: str, retiring_principal: Optional[str] = ..., operations: Optional[List[str]] = ..., constraints: Optional[Dict[str, Dict[str, str]]] = ..., grant_tokens: Optional[List[str]] = ...) -> Optional[Dict[str, Any]]: ... + def create_key(self, policy: Optional[str] = ..., description: Optional[str] = ..., key_usage: Optional[str] = ...) -> Optional[Dict[str, Any]]: ... + def decrypt(self, ciphertext_blob: bytes, encryption_context: Optional[Mapping[str, Any]] = ..., grant_tokens: Optional[List[str]] = ...) -> Optional[Dict[str, Any]]: ... + def delete_alias(self, alias_name: str) -> Optional[Dict[str, Any]]: ... + def describe_key(self, key_id: str) -> Optional[Dict[str, Any]]: ... + def disable_key(self, key_id: str) -> Optional[Dict[str, Any]]: ... + def disable_key_rotation(self, key_id: str) -> Optional[Dict[str, Any]]: ... + def enable_key(self, key_id: str) -> Optional[Dict[str, Any]]: ... + def enable_key_rotation(self, key_id: str) -> Optional[Dict[str, Any]]: ... + def encrypt(self, key_id: str, plaintext: bytes, encryption_context: Optional[Mapping[str, Any]] = ..., grant_tokens: Optional[List[str]] = ...) -> Optional[Dict[str, Any]]: ... + def generate_data_key(self, key_id: str, encryption_context: Optional[Mapping[str, Any]] = ..., number_of_bytes: Optional[int] = ..., key_spec: Optional[str] = ..., grant_tokens: Optional[List[str]] = ...) -> Optional[Dict[str, Any]]: ... + def generate_data_key_without_plaintext(self, key_id: str, encryption_context: Optional[Mapping[str, Any]] = ..., key_spec: Optional[str] = ..., number_of_bytes: Optional[int] = ..., grant_tokens: Optional[List[str]] = ...) -> Optional[Dict[str, Any]]: ... + def generate_random(self, number_of_bytes: Optional[int] = ...) -> Optional[Dict[str, Any]]: ... + def get_key_policy(self, key_id: str, policy_name: str) -> Optional[Dict[str, Any]]: ... + def get_key_rotation_status(self, key_id: str) -> Optional[Dict[str, Any]]: ... + def list_aliases(self, limit: Optional[int] = ..., marker: Optional[str] = ...) -> Optional[Dict[str, Any]]: ... + def list_grants(self, key_id: str, limit: Optional[int] = ..., marker: Optional[str] = ...) -> Optional[Dict[str, Any]]: ... + def list_key_policies(self, key_id: str, limit: Optional[int] = ..., marker: Optional[str] = ...) -> Optional[Dict[str, Any]]: ... + def list_keys(self, limit: Optional[int] = ..., marker: Optional[str] = ...) -> Optional[Dict[str, Any]]: ... + def put_key_policy(self, key_id: str, policy_name: str, policy: str) -> Optional[Dict[str, Any]]: ... + def re_encrypt(self, ciphertext_blob: bytes, destination_key_id: str, source_encryption_context: Optional[Mapping[str, Any]] = ..., destination_encryption_context: Optional[Mapping[str, Any]] = ..., grant_tokens: Optional[List[str]] = ...) -> Optional[Dict[str, Any]]: ... + def retire_grant(self, grant_token: str) -> Optional[Dict[str, Any]]: ... + def revoke_grant(self, key_id: str, grant_id: str) -> Optional[Dict[str, Any]]: ... + def update_key_description(self, key_id: str, description: str) -> Optional[Dict[str, Any]]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/plugin.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/plugin.pyi new file mode 100644 index 0000000..e7d5f1b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/plugin.pyi @@ -0,0 +1,9 @@ +from typing import Any, Optional + +class Plugin: + capability: Any + @classmethod + def is_capable(cls, requested_capability): ... + +def get_plugin(cls, requested_capability: Optional[Any] = ...): ... +def load_plugins(config): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/regioninfo.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/regioninfo.pyi new file mode 100644 index 0000000..525b565 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/regioninfo.pyi @@ -0,0 +1,16 @@ +from typing import Any, Optional + +def load_endpoint_json(path): ... +def merge_endpoints(defaults, additions): ... +def load_regions(): ... +def get_regions(service_name, region_cls: Optional[Any] = ..., connection_cls: Optional[Any] = ...): ... + +class RegionInfo: + connection: Any + name: Any + endpoint: Any + connection_cls: Any + def __init__(self, connection: Optional[Any] = ..., name: Optional[Any] = ..., endpoint: Optional[Any] = ..., connection_cls: Optional[Any] = ...) -> None: ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + def connect(self, **kw_params): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/__init__.pyi new file mode 100644 index 0000000..d88955e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/__init__.pyi @@ -0,0 +1,14 @@ +from typing import Optional + +from .connection import S3Connection + +from boto.connection import AWSAuthConnection +from boto.regioninfo import RegionInfo + +from typing import List, Type, Text + +class S3RegionInfo(RegionInfo): + def connect(self, name: Optional[Text] = ..., endpoint: Optional[str] = ..., connection_cls: Optional[Type[AWSAuthConnection]] = ..., **kw_params) -> S3Connection: ... + +def regions() -> List[S3RegionInfo]: ... +def connect_to_region(region_name: Text, **kw_params): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/acl.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/acl.pyi new file mode 100644 index 0000000..168f914 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/acl.pyi @@ -0,0 +1,39 @@ +from .connection import S3Connection +from .user import User +from typing import Any, Dict, Optional, List, Text, Union + +CannedACLStrings: List[str] + +class Policy: + parent: Any + namespace: Any + acl: ACL + def __init__(self, parent: Optional[Any] = ...) -> None: ... + owner: User + def startElement(self, name: Text, attrs: Dict[str, Any], connection: S3Connection) -> Union[None, User, ACL]: ... + def endElement(self, name: Text, value: Any, connection: S3Connection) -> None: ... + def to_xml(self) -> str: ... + +class ACL: + policy: Policy + grants: List[Grant] + def __init__(self, policy: Optional[Policy] = ...) -> None: ... + def add_grant(self, grant: Grant) -> None: ... + def add_email_grant(self, permission: Text, email_address: Text) -> None: ... + def add_user_grant(self, permission: Text, user_id: Text, display_name: Optional[Text] = ...) -> None: ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name: Text, value: Any, connection: S3Connection) -> None: ... + def to_xml(self) -> str: ... + +class Grant: + NameSpace: Text + permission: Text + id: Text + display_name: Text + uri: Text + email_address: Text + type: Text + def __init__(self, permission: Optional[Text] = ..., type: Optional[Text] = ..., id: Optional[Text] = ..., display_name: Optional[Text] = ..., uri: Optional[Text] = ..., email_address: Optional[Text] = ...) -> None: ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name: Text, value: Any, connection: S3Connection) -> None: ... + def to_xml(self) -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/bucket.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/bucket.pyi new file mode 100644 index 0000000..daed502 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/bucket.pyi @@ -0,0 +1,94 @@ +from .bucketlistresultset import BucketListResultSet +from .connection import S3Connection +from .key import Key + +from typing import Any, Dict, Optional, Text, Type, List + +class S3WebsiteEndpointTranslate: + trans_region: Dict[str, str] + @classmethod + def translate_region(self, reg: Text) -> str: ... + +S3Permissions: List[str] + +class Bucket: + LoggingGroup: str + BucketPaymentBody: str + VersioningBody: str + VersionRE: str + MFADeleteRE: str + name: Text + connection: S3Connection + key_class: Type[Key] + def __init__(self, connection: Optional[S3Connection] = ..., name: Optional[Text] = ..., key_class: Type[Key] = ...) -> None: ... + def __iter__(self): ... + def __contains__(self, key_name) -> bool: ... + def startElement(self, name, attrs, connection): ... + creation_date: Any + def endElement(self, name, value, connection): ... + def set_key_class(self, key_class): ... + def lookup(self, key_name, headers: Optional[Dict[Text, Text]] = ...): ... + def get_key(self, key_name, headers: Optional[Dict[Text, Text]] = ..., version_id: Optional[Any] = ..., response_headers: Optional[Dict[Text, Text]] = ..., validate: bool = ...) -> Key: ... + def list(self, prefix: Text = ..., delimiter: Text = ..., marker: Text = ..., headers: Optional[Dict[Text, Text]] = ..., encoding_type: Optional[Any] = ...) -> BucketListResultSet: ... + def list_versions(self, prefix: str = ..., delimiter: str = ..., key_marker: str = ..., version_id_marker: str = ..., headers: Optional[Dict[Text, Text]] = ..., encoding_type: Optional[Text] = ...) -> BucketListResultSet: ... + def list_multipart_uploads(self, key_marker: str = ..., upload_id_marker: str = ..., headers: Optional[Dict[Text, Text]] = ..., encoding_type: Optional[Any] = ...): ... + def validate_kwarg_names(self, kwargs, names): ... + def get_all_keys(self, headers: Optional[Dict[Text, Text]] = ..., **params): ... + def get_all_versions(self, headers: Optional[Dict[Text, Text]] = ..., **params): ... + def validate_get_all_versions_params(self, params): ... + def get_all_multipart_uploads(self, headers: Optional[Dict[Text, Text]] = ..., **params): ... + def new_key(self, key_name: Optional[Any] = ...): ... + def generate_url(self, expires_in, method: str = ..., headers: Optional[Dict[Text, Text]] = ..., force_http: bool = ..., response_headers: Optional[Dict[Text, Text]] = ..., expires_in_absolute: bool = ...): ... + def delete_keys(self, keys, quiet: bool = ..., mfa_token: Optional[Any] = ..., headers: Optional[Dict[Text, Text]] = ...): ... + def delete_key(self, key_name, headers: Optional[Dict[Text, Text]] = ..., version_id: Optional[Any] = ..., mfa_token: Optional[Any] = ...): ... + def copy_key(self, new_key_name, src_bucket_name, src_key_name, metadata: Optional[Any] = ..., src_version_id: Optional[Any] = ..., storage_class: str = ..., preserve_acl: bool = ..., encrypt_key: bool = ..., headers: Optional[Dict[Text, Text]] = ..., query_args: Optional[Any] = ...): ... + def set_canned_acl(self, acl_str, key_name: str = ..., headers: Optional[Dict[Text, Text]] = ..., version_id: Optional[Any] = ...): ... + def get_xml_acl(self, key_name: str = ..., headers: Optional[Dict[Text, Text]] = ..., version_id: Optional[Any] = ...): ... + def set_xml_acl(self, acl_str, key_name: str = ..., headers: Optional[Dict[Text, Text]] = ..., version_id: Optional[Any] = ..., query_args: str = ...): ... + def set_acl(self, acl_or_str, key_name: str = ..., headers: Optional[Dict[Text, Text]] = ..., version_id: Optional[Any] = ...): ... + def get_acl(self, key_name: str = ..., headers: Optional[Dict[Text, Text]] = ..., version_id: Optional[Any] = ...): ... + def set_subresource(self, subresource, value, key_name: str = ..., headers: Optional[Dict[Text, Text]] = ..., version_id: Optional[Any] = ...): ... + def get_subresource(self, subresource, key_name: str = ..., headers: Optional[Dict[Text, Text]] = ..., version_id: Optional[Any] = ...): ... + def make_public(self, recursive: bool = ..., headers: Optional[Dict[Text, Text]] = ...): ... + def add_email_grant(self, permission, email_address, recursive: bool = ..., headers: Optional[Dict[Text, Text]] = ...): ... + def add_user_grant(self, permission, user_id, recursive: bool = ..., headers: Optional[Dict[Text, Text]] = ..., display_name: Optional[Any] = ...): ... + def list_grants(self, headers: Optional[Dict[Text, Text]] = ...): ... + def get_location(self): ... + def set_xml_logging(self, logging_str, headers: Optional[Dict[Text, Text]] = ...): ... + def enable_logging(self, target_bucket, target_prefix: str = ..., grants: Optional[Any] = ..., headers: Optional[Dict[Text, Text]] = ...): ... + def disable_logging(self, headers: Optional[Dict[Text, Text]] = ...): ... + def get_logging_status(self, headers: Optional[Dict[Text, Text]] = ...): ... + def set_as_logging_target(self, headers: Optional[Dict[Text, Text]] = ...): ... + def get_request_payment(self, headers: Optional[Dict[Text, Text]] = ...): ... + def set_request_payment(self, payer: str = ..., headers: Optional[Dict[Text, Text]] = ...): ... + def configure_versioning(self, versioning, mfa_delete: bool = ..., mfa_token: Optional[Any] = ..., headers: Optional[Dict[Text, Text]] = ...): ... + def get_versioning_status(self, headers: Optional[Dict[Text, Text]] = ...): ... + def configure_lifecycle(self, lifecycle_config, headers: Optional[Dict[Text, Text]] = ...): ... + def get_lifecycle_config(self, headers: Optional[Dict[Text, Text]] = ...): ... + def delete_lifecycle_configuration(self, headers: Optional[Dict[Text, Text]] = ...): ... + def configure_website(self, suffix: Optional[Any] = ..., error_key: Optional[Any] = ..., redirect_all_requests_to: Optional[Any] = ..., routing_rules: Optional[Any] = ..., headers: Optional[Dict[Text, Text]] = ...): ... + def set_website_configuration(self, config, headers: Optional[Dict[Text, Text]] = ...): ... + def set_website_configuration_xml(self, xml, headers: Optional[Dict[Text, Text]] = ...): ... + def get_website_configuration(self, headers: Optional[Dict[Text, Text]] = ...): ... + def get_website_configuration_obj(self, headers: Optional[Dict[Text, Text]] = ...): ... + def get_website_configuration_with_xml(self, headers: Optional[Dict[Text, Text]] = ...): ... + def get_website_configuration_xml(self, headers: Optional[Dict[Text, Text]] = ...): ... + def delete_website_configuration(self, headers: Optional[Dict[Text, Text]] = ...): ... + def get_website_endpoint(self): ... + def get_policy(self, headers: Optional[Dict[Text, Text]] = ...): ... + def set_policy(self, policy, headers: Optional[Dict[Text, Text]] = ...): ... + def delete_policy(self, headers: Optional[Dict[Text, Text]] = ...): ... + def set_cors_xml(self, cors_xml, headers: Optional[Dict[Text, Text]] = ...): ... + def set_cors(self, cors_config, headers: Optional[Dict[Text, Text]] = ...): ... + def get_cors_xml(self, headers: Optional[Dict[Text, Text]] = ...): ... + def get_cors(self, headers: Optional[Dict[Text, Text]] = ...): ... + def delete_cors(self, headers: Optional[Dict[Text, Text]] = ...): ... + def initiate_multipart_upload(self, key_name, headers: Optional[Dict[Text, Text]] = ..., reduced_redundancy: bool = ..., metadata: Optional[Any] = ..., encrypt_key: bool = ..., policy: Optional[Any] = ...): ... + def complete_multipart_upload(self, key_name, upload_id, xml_body, headers: Optional[Dict[Text, Text]] = ...): ... + def cancel_multipart_upload(self, key_name, upload_id, headers: Optional[Dict[Text, Text]] = ...): ... + def delete(self, headers: Optional[Dict[Text, Text]] = ...): ... + def get_tags(self): ... + def get_xml_tags(self): ... + def set_xml_tags(self, tag_str, headers: Optional[Dict[Text, Text]] = ..., query_args: str = ...): ... + def set_tags(self, tags, headers: Optional[Dict[Text, Text]] = ...): ... + def delete_tags(self, headers: Optional[Dict[Text, Text]] = ...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/bucketlistresultset.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/bucketlistresultset.pyi new file mode 100644 index 0000000..b33d84d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/bucketlistresultset.pyi @@ -0,0 +1,40 @@ +from .bucket import Bucket +from .key import Key + +from typing import Any, Iterable, Iterator, Optional + +def bucket_lister(bucket, prefix: str = ..., delimiter: str = ..., marker: str = ..., headers: Optional[Any] = ..., encoding_type: Optional[Any] = ...): ... + +class BucketListResultSet(Iterable[Key]): + bucket: Any + prefix: Any + delimiter: Any + marker: Any + headers: Any + encoding_type: Any + def __init__(self, bucket: Optional[Any] = ..., prefix: str = ..., delimiter: str = ..., marker: str = ..., headers: Optional[Any] = ..., encoding_type: Optional[Any] = ...) -> None: ... + def __iter__(self) -> Iterator[Key]: ... + +def versioned_bucket_lister(bucket, prefix: str = ..., delimiter: str = ..., key_marker: str = ..., version_id_marker: str = ..., headers: Optional[Any] = ..., encoding_type: Optional[Any] = ...): ... + +class VersionedBucketListResultSet: + bucket: Any + prefix: Any + delimiter: Any + key_marker: Any + version_id_marker: Any + headers: Any + encoding_type: Any + def __init__(self, bucket: Optional[Any] = ..., prefix: str = ..., delimiter: str = ..., key_marker: str = ..., version_id_marker: str = ..., headers: Optional[Any] = ..., encoding_type: Optional[Any] = ...) -> None: ... + def __iter__(self) -> Iterator[Key]: ... + +def multipart_upload_lister(bucket, key_marker: str = ..., upload_id_marker: str = ..., headers: Optional[Any] = ..., encoding_type: Optional[Any] = ...): ... + +class MultiPartUploadListResultSet: + bucket: Any + key_marker: Any + upload_id_marker: Any + headers: Any + encoding_type: Any + def __init__(self, bucket: Optional[Any] = ..., key_marker: str = ..., upload_id_marker: str = ..., headers: Optional[Any] = ..., encoding_type: Optional[Any] = ...) -> None: ... + def __iter__(self): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/bucketlogging.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/bucketlogging.pyi new file mode 100644 index 0000000..4eaa1ab --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/bucketlogging.pyi @@ -0,0 +1,11 @@ +from typing import Any, Optional + +class BucketLogging: + target: Any + prefix: Any + grants: Any + def __init__(self, target: Optional[Any] = ..., prefix: Optional[Any] = ..., grants: Optional[Any] = ...) -> None: ... + def add_grant(self, grant): ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + def to_xml(self): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/connection.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/connection.pyi new file mode 100644 index 0000000..9148e68 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/connection.pyi @@ -0,0 +1,67 @@ +from .bucket import Bucket + +from typing import Any, Dict, Optional, Text, Type +from boto.connection import AWSAuthConnection +from boto.exception import BotoClientError + +def check_lowercase_bucketname(n): ... +def assert_case_insensitive(f): ... + +class _CallingFormat: + def get_bucket_server(self, server, bucket): ... + def build_url_base(self, connection, protocol, server, bucket, key: str = ...): ... + def build_host(self, server, bucket): ... + def build_auth_path(self, bucket, key: str = ...): ... + def build_path_base(self, bucket, key: str = ...): ... + +class SubdomainCallingFormat(_CallingFormat): + def get_bucket_server(self, server, bucket): ... + +class VHostCallingFormat(_CallingFormat): + def get_bucket_server(self, server, bucket): ... + +class OrdinaryCallingFormat(_CallingFormat): + def get_bucket_server(self, server, bucket): ... + def build_path_base(self, bucket, key: str = ...): ... + +class ProtocolIndependentOrdinaryCallingFormat(OrdinaryCallingFormat): + def build_url_base(self, connection, protocol, server, bucket, key: str = ...): ... + +class Location: + DEFAULT: str + EU: str + EUCentral1: str + USWest: str + USWest2: str + SAEast: str + APNortheast: str + APSoutheast: str + APSoutheast2: str + CNNorth1: str + +class NoHostProvided: ... +class HostRequiredError(BotoClientError): ... + +class S3Connection(AWSAuthConnection): + DefaultHost: Any + DefaultCallingFormat: Any + QueryString: str + calling_format: Any + bucket_class: Type[Bucket] + anon: Any + def __init__(self, aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., is_secure: bool = ..., port: Optional[Any] = ..., proxy: Optional[Any] = ..., proxy_port: Optional[Any] = ..., proxy_user: Optional[Any] = ..., proxy_pass: Optional[Any] = ..., host: Any = ..., debug: int = ..., https_connection_factory: Optional[Any] = ..., calling_format: Any = ..., path: str = ..., provider: str = ..., bucket_class: Type[Bucket] = ..., security_token: Optional[Any] = ..., suppress_consec_slashes: bool = ..., anon: bool = ..., validate_certs: Optional[Any] = ..., profile_name: Optional[Any] = ...) -> None: ... + def __iter__(self): ... + def __contains__(self, bucket_name): ... + def set_bucket_class(self, bucket_class: Type[Bucket]) -> None: ... + def build_post_policy(self, expiration_time, conditions): ... + def build_post_form_args(self, bucket_name, key, expires_in: int = ..., acl: Optional[Any] = ..., success_action_redirect: Optional[Any] = ..., max_content_length: Optional[Any] = ..., http_method: str = ..., fields: Optional[Any] = ..., conditions: Optional[Any] = ..., storage_class: str = ..., server_side_encryption: Optional[Any] = ...): ... + def generate_url_sigv4(self, expires_in, method, bucket: str = ..., key: str = ..., headers: Optional[Dict[Text, Text]] = ..., force_http: bool = ..., response_headers: Optional[Dict[Text, Text]] = ..., version_id: Optional[Any] = ..., iso_date: Optional[Any] = ...): ... + def generate_url(self, expires_in, method, bucket: str = ..., key: str = ..., headers: Optional[Dict[Text, Text]] = ..., query_auth: bool = ..., force_http: bool = ..., response_headers: Optional[Dict[Text, Text]] = ..., expires_in_absolute: bool = ..., version_id: Optional[Any] = ...): ... + def get_all_buckets(self, headers: Optional[Dict[Text, Text]] = ...): ... + def get_canonical_user_id(self, headers: Optional[Dict[Text, Text]] = ...): ... + def get_bucket(self, bucket_name: Text, validate: bool = ..., headers: Optional[Dict[Text, Text]] = ...) -> Bucket: ... + def head_bucket(self, bucket_name, headers: Optional[Dict[Text, Text]] = ...): ... + def lookup(self, bucket_name, validate: bool = ..., headers: Optional[Dict[Text, Text]] = ...): ... + def create_bucket(self, bucket_name, headers: Optional[Dict[Text, Text]] = ..., location: Any = ..., policy: Optional[Any] = ...): ... + def delete_bucket(self, bucket, headers: Optional[Dict[Text, Text]] = ...): ... + def make_request(self, method, bucket: str = ..., key: str = ..., headers: Optional[Any] = ..., data: str = ..., query_args: Optional[Any] = ..., sender: Optional[Any] = ..., override_num_retries: Optional[Any] = ..., retry_handler: Optional[Any] = ..., *args, **kwargs): ... # type: ignore # https://github.com/python/mypy/issues/1237 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/cors.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/cors.pyi new file mode 100644 index 0000000..6ffe8ee --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/cors.pyi @@ -0,0 +1,19 @@ +from typing import Any, Optional + +class CORSRule: + allowed_method: Any + allowed_origin: Any + id: Any + allowed_header: Any + max_age_seconds: Any + expose_header: Any + def __init__(self, allowed_method: Optional[Any] = ..., allowed_origin: Optional[Any] = ..., id: Optional[Any] = ..., allowed_header: Optional[Any] = ..., max_age_seconds: Optional[Any] = ..., expose_header: Optional[Any] = ...) -> None: ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + def to_xml(self) -> str: ... + +class CORSConfiguration(list): + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + def to_xml(self) -> str: ... + def add_rule(self, allowed_method, allowed_origin, id: Optional[Any] = ..., allowed_header: Optional[Any] = ..., max_age_seconds: Optional[Any] = ..., expose_header: Optional[Any] = ...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/deletemarker.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/deletemarker.pyi new file mode 100644 index 0000000..b2955c0 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/deletemarker.pyi @@ -0,0 +1,12 @@ +from typing import Any, Optional + +class DeleteMarker: + bucket: Any + name: Any + version_id: Any + is_latest: bool + last_modified: Any + owner: Any + def __init__(self, bucket: Optional[Any] = ..., name: Optional[Any] = ...) -> None: ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/key.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/key.pyi new file mode 100644 index 0000000..4200e7a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/key.pyi @@ -0,0 +1,232 @@ +from typing import Any, Callable, Dict, Optional, Text, Union, overload + +class Key: + DefaultContentType: str + RestoreBody: str + BufferSize: Any + base_user_settable_fields: Any + base_fields: Any + bucket: Any + name: str + metadata: Any + cache_control: Any + content_type: Any + content_encoding: Any + content_disposition: Any + content_language: Any + filename: Any + etag: Any + is_latest: bool + last_modified: Any + owner: Any + path: Any + resp: Any + mode: Any + size: Any + version_id: Any + source_version_id: Any + delete_marker: bool + encrypted: Any + ongoing_restore: Any + expiry_date: Any + local_hashes: Any + def __init__(self, bucket: Optional[Any] = ..., name: Optional[Any] = ...) -> None: ... + def __iter__(self): ... + @property + def provider(self): ... + key: Any + md5: Any + base64md5: Any + storage_class: Any + def get_md5_from_hexdigest(self, md5_hexdigest): ... + def handle_encryption_headers(self, resp): ... + def handle_version_headers(self, resp, force: bool = ...): ... + def handle_restore_headers(self, response): ... + def handle_addl_headers(self, headers): ... + def open_read( + self, + headers: Optional[Dict[Text, Text]] = ..., + query_args: str = ..., + override_num_retries: Optional[Any] = ..., + response_headers: Optional[Dict[Text, Text]] = ..., + ): ... + def open_write(self, headers: Optional[Dict[Text, Text]] = ..., override_num_retries: Optional[Any] = ...): ... + def open( + self, + mode: str = ..., + headers: Optional[Dict[Text, Text]] = ..., + query_args: Optional[Any] = ..., + override_num_retries: Optional[Any] = ..., + ): ... + closed: bool + def close(self, fast: bool = ...): ... + def next(self): ... + __next__: Any + def read(self, size: int = ...): ... + def change_storage_class(self, new_storage_class, dst_bucket: Optional[Any] = ..., validate_dst_bucket: bool = ...): ... + def copy( + self, + dst_bucket, + dst_key, + metadata: Optional[Any] = ..., + reduced_redundancy: bool = ..., + preserve_acl: bool = ..., + encrypt_key: bool = ..., + validate_dst_bucket: bool = ..., + ): ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + def exists(self, headers: Optional[Dict[Text, Text]] = ...): ... + def delete(self, headers: Optional[Dict[Text, Text]] = ...): ... + def get_metadata(self, name): ... + def set_metadata(self, name, value): ... + def update_metadata(self, d): ... + def set_acl(self, acl_str, headers: Optional[Dict[Text, Text]] = ...): ... + def get_acl(self, headers: Optional[Dict[Text, Text]] = ...): ... + def get_xml_acl(self, headers: Optional[Dict[Text, Text]] = ...): ... + def set_xml_acl(self, acl_str, headers: Optional[Dict[Text, Text]] = ...): ... + def set_canned_acl(self, acl_str, headers: Optional[Dict[Text, Text]] = ...): ... + def get_redirect(self): ... + def set_redirect(self, redirect_location, headers: Optional[Dict[Text, Text]] = ...): ... + def make_public(self, headers: Optional[Dict[Text, Text]] = ...): ... + def generate_url( + self, + expires_in, + method: str = ..., + headers: Optional[Dict[Text, Text]] = ..., + query_auth: bool = ..., + force_http: bool = ..., + response_headers: Optional[Dict[Text, Text]] = ..., + expires_in_absolute: bool = ..., + version_id: Optional[Any] = ..., + policy: Optional[Any] = ..., + reduced_redundancy: bool = ..., + encrypt_key: bool = ..., + ): ... + def send_file( + self, + fp, + headers: Optional[Dict[Text, Text]] = ..., + cb: Optional[Callable[[int, int], Any]] = ..., + num_cb: int = ..., + query_args: Optional[Any] = ..., + chunked_transfer: bool = ..., + size: Optional[Any] = ..., + ): ... + def should_retry(self, response, chunked_transfer: bool = ...): ... + def compute_md5(self, fp, size: Optional[Any] = ...): ... + def set_contents_from_stream( + self, + fp, + headers: Optional[Dict[Text, Text]] = ..., + replace: bool = ..., + cb: Optional[Callable[[int, int], Any]] = ..., + num_cb: int = ..., + policy: Optional[Any] = ..., + reduced_redundancy: bool = ..., + query_args: Optional[Any] = ..., + size: Optional[Any] = ..., + ): ... + def set_contents_from_file( + self, + fp, + headers: Optional[Dict[Text, Text]] = ..., + replace: bool = ..., + cb: Optional[Callable[[int, int], Any]] = ..., + num_cb: int = ..., + policy: Optional[Any] = ..., + md5: Optional[Any] = ..., + reduced_redundancy: bool = ..., + query_args: Optional[Any] = ..., + encrypt_key: bool = ..., + size: Optional[Any] = ..., + rewind: bool = ..., + ): ... + def set_contents_from_filename( + self, + filename, + headers: Optional[Dict[Text, Text]] = ..., + replace: bool = ..., + cb: Optional[Callable[[int, int], Any]] = ..., + num_cb: int = ..., + policy: Optional[Any] = ..., + md5: Optional[Any] = ..., + reduced_redundancy: bool = ..., + encrypt_key: bool = ..., + ): ... + def set_contents_from_string( + self, + string_data: Union[Text, bytes], + headers: Optional[Dict[Text, Text]] = ..., + replace: bool = ..., + cb: Optional[Callable[[int, int], Any]] = ..., + num_cb: int = ..., + policy: Optional[Any] = ..., + md5: Optional[Any] = ..., + reduced_redundancy: bool = ..., + encrypt_key: bool = ..., + ) -> None: ... + def get_file( + self, + fp, + headers: Optional[Dict[Text, Text]] = ..., + cb: Optional[Callable[[int, int], Any]] = ..., + num_cb: int = ..., + torrent: bool = ..., + version_id: Optional[Any] = ..., + override_num_retries: Optional[Any] = ..., + response_headers: Optional[Dict[Text, Text]] = ..., + ): ... + def get_torrent_file( + self, fp, headers: Optional[Dict[Text, Text]] = ..., cb: Optional[Callable[[int, int], Any]] = ..., num_cb: int = ... + ): ... + def get_contents_to_file( + self, + fp, + headers: Optional[Dict[Text, Text]] = ..., + cb: Optional[Callable[[int, int], Any]] = ..., + num_cb: int = ..., + torrent: bool = ..., + version_id: Optional[Any] = ..., + res_download_handler: Optional[Any] = ..., + response_headers: Optional[Dict[Text, Text]] = ..., + ): ... + def get_contents_to_filename( + self, + filename, + headers: Optional[Dict[Text, Text]] = ..., + cb: Optional[Callable[[int, int], Any]] = ..., + num_cb: int = ..., + torrent: bool = ..., + version_id: Optional[Any] = ..., + res_download_handler: Optional[Any] = ..., + response_headers: Optional[Dict[Text, Text]] = ..., + ): ... + @overload + def get_contents_as_string( + self, + headers: Optional[Dict[Text, Text]] = ..., + cb: Optional[Callable[[int, int], Any]] = ..., + num_cb: int = ..., + torrent: bool = ..., + version_id: Optional[Any] = ..., + response_headers: Optional[Dict[Text, Text]] = ..., + encoding: None = ..., + ) -> bytes: ... + @overload + def get_contents_as_string( + self, + headers: Optional[Dict[Text, Text]] = ..., + cb: Optional[Callable[[int, int], Any]] = ..., + num_cb: int = ..., + torrent: bool = ..., + version_id: Optional[Any] = ..., + response_headers: Optional[Dict[Text, Text]] = ..., + *, encoding: Text, + ) -> Text: ... + def add_email_grant(self, permission, email_address, headers: Optional[Dict[Text, Text]] = ...): ... + def add_user_grant( + self, permission, user_id, headers: Optional[Dict[Text, Text]] = ..., display_name: Optional[Any] = ... + ): ... + def set_remote_metadata(self, metadata_plus, metadata_minus, preserve_acl, headers: Optional[Dict[Text, Text]] = ...): ... + def restore(self, days, headers: Optional[Dict[Text, Text]] = ...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/keyfile.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/keyfile.pyi new file mode 100644 index 0000000..121da16 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/keyfile.pyi @@ -0,0 +1,29 @@ +from typing import Any + +class KeyFile: + key: Any + location: int + closed: bool + softspace: int + mode: str + encoding: str + errors: str + newlines: str + name: Any + def __init__(self, key) -> None: ... + def tell(self): ... + def seek(self, pos, whence: Any = ...): ... + def read(self, size): ... + def close(self): ... + def isatty(self): ... + def getkey(self): ... + def write(self, buf): ... + def fileno(self): ... + def flush(self): ... + def next(self): ... + def readinto(self): ... + def readline(self): ... + def readlines(self): ... + def truncate(self): ... + def writelines(self): ... + def xreadlines(self): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/lifecycle.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/lifecycle.pyi new file mode 100644 index 0000000..0b775ef --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/lifecycle.pyi @@ -0,0 +1,51 @@ +from typing import Any, Optional + +class Rule: + id: Any + prefix: Any + status: Any + expiration: Any + transition: Any + def __init__(self, id: Optional[Any] = ..., prefix: Optional[Any] = ..., status: Optional[Any] = ..., expiration: Optional[Any] = ..., transition: Optional[Any] = ...) -> None: ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + def to_xml(self): ... + +class Expiration: + days: Any + date: Any + def __init__(self, days: Optional[Any] = ..., date: Optional[Any] = ...) -> None: ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + def to_xml(self): ... + +class Transition: + days: Any + date: Any + storage_class: Any + def __init__(self, days: Optional[Any] = ..., date: Optional[Any] = ..., storage_class: Optional[Any] = ...) -> None: ... + def to_xml(self): ... + +class Transitions(list): + transition_properties: int + current_transition_property: int + temp_days: Any + temp_date: Any + temp_storage_class: Any + def __init__(self) -> None: ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + def to_xml(self): ... + def add_transition(self, days: Optional[Any] = ..., date: Optional[Any] = ..., storage_class: Optional[Any] = ...): ... + @property + def days(self): ... + @property + def date(self): ... + @property + def storage_class(self): ... + +class Lifecycle(list): + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + def to_xml(self): ... + def add_rule(self, id: Optional[Any] = ..., prefix: str = ..., status: str = ..., expiration: Optional[Any] = ..., transition: Optional[Any] = ...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/multidelete.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/multidelete.pyi new file mode 100644 index 0000000..fa0c8dd --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/multidelete.pyi @@ -0,0 +1,27 @@ +from typing import Any, Optional + +class Deleted: + key: Any + version_id: Any + delete_marker: Any + delete_marker_version_id: Any + def __init__(self, key: Optional[Any] = ..., version_id: Optional[Any] = ..., delete_marker: bool = ..., delete_marker_version_id: Optional[Any] = ...) -> None: ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + +class Error: + key: Any + version_id: Any + code: Any + message: Any + def __init__(self, key: Optional[Any] = ..., version_id: Optional[Any] = ..., code: Optional[Any] = ..., message: Optional[Any] = ...) -> None: ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + +class MultiDeleteResult: + bucket: Any + deleted: Any + errors: Any + def __init__(self, bucket: Optional[Any] = ...) -> None: ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/multipart.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/multipart.pyi new file mode 100644 index 0000000..8463c4d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/multipart.pyi @@ -0,0 +1,49 @@ +from typing import Any, Optional + +class CompleteMultiPartUpload: + bucket: Any + location: Any + bucket_name: Any + key_name: Any + etag: Any + version_id: Any + encrypted: Any + def __init__(self, bucket: Optional[Any] = ...) -> None: ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + +class Part: + bucket: Any + part_number: Any + last_modified: Any + etag: Any + size: Any + def __init__(self, bucket: Optional[Any] = ...) -> None: ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + +def part_lister(mpupload, part_number_marker: Optional[Any] = ...): ... + +class MultiPartUpload: + bucket: Any + bucket_name: Any + key_name: Any + id: Any + initiator: Any + owner: Any + storage_class: Any + initiated: Any + part_number_marker: Any + next_part_number_marker: Any + max_parts: Any + is_truncated: bool + def __init__(self, bucket: Optional[Any] = ...) -> None: ... + def __iter__(self): ... + def to_xml(self): ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + def get_all_parts(self, max_parts: Optional[Any] = ..., part_number_marker: Optional[Any] = ..., encoding_type: Optional[Any] = ...): ... + def upload_part_from_file(self, fp, part_num, headers: Optional[Any] = ..., replace: bool = ..., cb: Optional[Any] = ..., num_cb: int = ..., md5: Optional[Any] = ..., size: Optional[Any] = ...): ... + def copy_part_from_key(self, src_bucket_name, src_key_name, part_num, start: Optional[Any] = ..., end: Optional[Any] = ..., src_version_id: Optional[Any] = ..., headers: Optional[Any] = ...): ... + def complete_upload(self): ... + def cancel_upload(self): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/prefix.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/prefix.pyi new file mode 100644 index 0000000..de8f3a3 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/prefix.pyi @@ -0,0 +1,10 @@ +from typing import Any, Optional + +class Prefix: + bucket: Any + name: Any + def __init__(self, bucket: Optional[Any] = ..., name: Optional[Any] = ...) -> None: ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + @property + def provider(self): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/tagging.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/tagging.pyi new file mode 100644 index 0000000..9dec4e3 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/tagging.pyi @@ -0,0 +1,22 @@ +from typing import Any, Optional + +class Tag: + key: Any + value: Any + def __init__(self, key: Optional[Any] = ..., value: Optional[Any] = ...) -> None: ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + def to_xml(self): ... + def __eq__(self, other): ... + +class TagSet(list): + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + def add_tag(self, key, value): ... + def to_xml(self): ... + +class Tags(list): + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + def to_xml(self): ... + def add_tag_set(self, tag_set): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/user.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/user.pyi new file mode 100644 index 0000000..c5cc11c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/user.pyi @@ -0,0 +1,10 @@ +from typing import Any, Optional + +class User: + type: Any + id: Any + display_name: Any + def __init__(self, parent: Optional[Any] = ..., id: str = ..., display_name: str = ...) -> None: ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + def to_xml(self, element_name: str = ...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/website.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/website.pyi new file mode 100644 index 0000000..2a92866 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/website.pyi @@ -0,0 +1,62 @@ +from typing import Any, Optional + +def tag(key, value): ... + +class WebsiteConfiguration: + suffix: Any + error_key: Any + redirect_all_requests_to: Any + routing_rules: Any + def __init__(self, suffix: Optional[Any] = ..., error_key: Optional[Any] = ..., redirect_all_requests_to: Optional[Any] = ..., routing_rules: Optional[Any] = ...) -> None: ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + def to_xml(self): ... + +class _XMLKeyValue: + translator: Any + container: Any + def __init__(self, translator, container: Optional[Any] = ...) -> None: ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + def to_xml(self): ... + +class RedirectLocation(_XMLKeyValue): + TRANSLATOR: Any + hostname: Any + protocol: Any + def __init__(self, hostname: Optional[Any] = ..., protocol: Optional[Any] = ...) -> None: ... + def to_xml(self): ... + +class RoutingRules(list): + def add_rule(self, rule): ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + def to_xml(self): ... + +class RoutingRule: + condition: Any + redirect: Any + def __init__(self, condition: Optional[Any] = ..., redirect: Optional[Any] = ...) -> None: ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + def to_xml(self): ... + @classmethod + def when(cls, key_prefix: Optional[Any] = ..., http_error_code: Optional[Any] = ...): ... + def then_redirect(self, hostname: Optional[Any] = ..., protocol: Optional[Any] = ..., replace_key: Optional[Any] = ..., replace_key_prefix: Optional[Any] = ..., http_redirect_code: Optional[Any] = ...): ... + +class Condition(_XMLKeyValue): + TRANSLATOR: Any + key_prefix: Any + http_error_code: Any + def __init__(self, key_prefix: Optional[Any] = ..., http_error_code: Optional[Any] = ...) -> None: ... + def to_xml(self): ... + +class Redirect(_XMLKeyValue): + TRANSLATOR: Any + hostname: Any + protocol: Any + replace_key: Any + replace_key_prefix: Any + http_redirect_code: Any + def __init__(self, hostname: Optional[Any] = ..., protocol: Optional[Any] = ..., replace_key: Optional[Any] = ..., replace_key_prefix: Optional[Any] = ..., http_redirect_code: Optional[Any] = ...) -> None: ... + def to_xml(self): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/utils.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/utils.pyi new file mode 100644 index 0000000..6552b0a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/boto/utils.pyi @@ -0,0 +1,239 @@ +import datetime +import logging.handlers +import subprocess +import sys +import time + +import boto.connection +from typing import ( + Any, + Callable, + ContextManager, + Dict, + IO, + Iterable, + List, + Mapping, + Optional, + Sequence, + Tuple, + Type, + TypeVar, + Union, +) + +_KT = TypeVar('_KT') +_VT = TypeVar('_VT') + +if sys.version_info[0] >= 3: + # TODO move _StringIO definition into boto.compat once stubs exist and rename to StringIO + import io + _StringIO = io.StringIO + + from hashlib import _Hash + _HashType = _Hash + + from email.message import Message as _Message +else: + # TODO move _StringIO definition into boto.compat once stubs exist and rename to StringIO + import StringIO + _StringIO = StringIO.StringIO + + from hashlib import _hash + _HashType = _hash + + # TODO use email.message.Message once stubs exist + _Message = Any + +_Provider = Any # TODO replace this with boto.provider.Provider once stubs exist +_LockType = Any # TODO replace this with _thread.LockType once stubs exist + + +JSONDecodeError: Type[ValueError] +qsa_of_interest: List[str] + + +def unquote_v(nv: str) -> Union[str, Tuple[str, str]]: ... +def canonical_string( + method: str, + path: str, + headers: Mapping[str, Optional[str]], + expires: Optional[int] = ..., + provider: Optional[_Provider] = ..., +) -> str: ... +def merge_meta( + headers: Mapping[str, str], + metadata: Mapping[str, str], + provider: Optional[_Provider] = ..., +) -> Mapping[str, str]: ... +def get_aws_metadata( + headers: Mapping[str, str], + provider: Optional[_Provider] = ..., +) -> Mapping[str, str]: ... +def retry_url( + url: str, + retry_on_404: bool = ..., + num_retries: int = ..., + timeout: Optional[int] = ..., +) -> str: ... + +class LazyLoadMetadata(Dict[_KT, _VT]): + def __init__( + self, + url: str, + num_retries: int, + timeout: Optional[int] = ..., + ) -> None: ... + +def get_instance_metadata( + version: str = ..., + url: str = ..., + data: str = ..., + timeout: Optional[int] = ..., + num_retries: int = ..., +) -> Optional[LazyLoadMetadata]: ... +def get_instance_identity( + version: str = ..., + url: str = ..., + timeout: Optional[int] = ..., + num_retries: int = ..., +) -> Optional[Mapping[str, Any]]: ... +def get_instance_userdata( + version: str = ..., + sep: Optional[str] = ..., + url: str = ..., + timeout: Optional[int] = ..., + num_retries: int = ..., +) -> Mapping[str, str]: ... + +ISO8601: str +ISO8601_MS: str +RFC1123: str +LOCALE_LOCK: _LockType + +def setlocale(name: Union[str, Tuple[str, str]]) -> ContextManager[str]: ... +def get_ts(ts: Optional[time.struct_time] = ...) -> str: ... +def parse_ts(ts: str) -> datetime.datetime: ... +def find_class(module_name: str, class_name: Optional[str] = ...) -> Optional[Type[Any]]: ... +def update_dme(username: str, password: str, dme_id: str, ip_address: str) -> str: ... +def fetch_file( + uri: str, + file: Optional[IO[str]] = ..., + username: Optional[str] = ..., + password: Optional[str] = ..., +) -> Optional[IO[str]]: ... + +class ShellCommand: + exit_code: int + command: subprocess._CMD + log_fp: _StringIO + wait: bool + fail_fast: bool + + def __init__( + self, + command: subprocess._CMD, + wait: bool = ..., + fail_fast: bool = ..., + cwd: Optional[subprocess._TXT] = ..., + ) -> None: ... + + process: subprocess.Popen + + def run(self, cwd: Optional[subprocess._CMD] = ...) -> Optional[int]: ... + def setReadOnly(self, value) -> None: ... + def getStatus(self) -> Optional[int]: ... + + status: Optional[int] + + def getOutput(self) -> str: ... + + output: str + +class AuthSMTPHandler(logging.handlers.SMTPHandler): + username: str + password: str + def __init__( + self, + mailhost: str, + username: str, + password: str, + fromaddr: str, + toaddrs: Sequence[str], + subject: str, + ) -> None: ... + +class LRUCache(Dict[_KT, _VT]): + class _Item: + previous: Optional[LRUCache._Item] + next: Optional[LRUCache._Item] + key = ... + value = ... + def __init__(self, key, value) -> None: ... + + _dict: Dict[_KT, LRUCache._Item] + capacity: int + head: Optional[LRUCache._Item] + tail: Optional[LRUCache._Item] + + def __init__(self, capacity: int) -> None: ... + + +# This exists to work around Password.str's name shadowing the str type +_str = str + +class Password: + hashfunc: Callable[[bytes], _HashType] + str: Optional[_str] + + def __init__( + self, + str: Optional[_str] = ..., + hashfunc: Optional[Callable[[bytes], _HashType]] = ..., + ) -> None: ... + def set(self, value: Union[bytes, _str]) -> None: ... + def __eq__(self, other: Any) -> bool: ... + def __len__(self) -> int: ... + +def notify( + subject: str, + body: Optional[str] = ..., + html_body: Optional[Union[Sequence[str], str]] = ..., + to_string: Optional[str] = ..., + attachments: Optional[Iterable[_Message]] = ..., + append_instance_id: bool = ..., +) -> None: ... +def get_utf8_value(value: str) -> bytes: ... +def mklist(value: Any) -> List: ... +def pythonize_name(name: str) -> str: ... +def write_mime_multipart( + content: List[Tuple[str, str]], + compress: bool = ..., + deftype: str = ..., + delimiter: str = ..., +) -> str: ... +def guess_mime_type(content: str, deftype: str) -> str: ... +def compute_md5( + fp: IO[Any], + buf_size: int = ..., + size: Optional[int] = ..., +) -> Tuple[str, str, int]: ... +def compute_hash( + fp: IO[Any], + buf_size: int = ..., + size: Optional[int] = ..., + hash_algorithm: Any = ..., +) -> Tuple[str, str, int]: ... +def find_matching_headers(name: str, headers: Mapping[str, Optional[str]]) -> List[str]: ... +def merge_headers_by_name(name: str, headers: Mapping[str, Optional[str]]) -> str: ... + +class RequestHook: + def handle_request_data( + self, + request: boto.connection.HTTPRequest, + response: boto.connection.HTTPResponse, + error: bool = ..., + ) -> Any: ... + +def host_is_ipv6(hostname: str) -> bool: ... +def parse_host(hostname: str) -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/certifi.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/certifi.pyi new file mode 100644 index 0000000..c809e6d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/certifi.pyi @@ -0,0 +1,2 @@ +def where() -> str: ... +def old_where() -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/characteristic/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/characteristic/__init__.pyi new file mode 100644 index 0000000..20bd6e5 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/characteristic/__init__.pyi @@ -0,0 +1,34 @@ +from typing import Sequence, Callable, Union, Any, Optional, AnyStr, TypeVar, Type + +def with_repr(attrs: Sequence[Union[AnyStr, Attribute]]) -> Callable[..., Any]: ... +def with_cmp(attrs: Sequence[Union[AnyStr, Attribute]]) -> Callable[..., Any]: ... +def with_init(attrs: Sequence[Union[AnyStr, Attribute]]) -> Callable[..., Any]: ... +def immutable(attrs: Sequence[Union[AnyStr, Attribute]]) -> Callable[..., Any]: ... + +def strip_leading_underscores(attribute_name: AnyStr) -> AnyStr: ... + +NOTHING = Any + +_T = TypeVar('_T') + +def attributes( + attrs: Sequence[Union[AnyStr, Attribute]], + apply_with_cmp: bool = ..., + apply_with_init: bool = ..., + apply_with_repr: bool = ..., + apply_immutable: bool = ..., + store_attributes: Optional[Callable[[type, Attribute], Any]] = ..., + **kw: Optional[dict]) -> Callable[[Type[_T]], Type[_T]]: ... + +class Attribute: + def __init__( + self, + name: AnyStr, + exclude_from_cmp: bool = ..., + exclude_from_init: bool = ..., + exclude_from_repr: bool = ..., + exclude_from_immutable: bool = ..., + default_value: Any = ..., + default_factory: Optional[Callable[[None], Any]] = ..., + instance_of: Optional[Any] = ..., + init_aliaser: Optional[Callable[[AnyStr], AnyStr]] = ...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/click/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/click/__init__.pyi new file mode 100644 index 0000000..4733c6d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/click/__init__.pyi @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +""" + click + ~~~~~ + + Click is a simple Python module that wraps the stdlib's optparse to make + writing command line scripts fun. Unlike other modules, it's based around + a simple API that does not come with too much magic and is composable. + + In case optparse ever gets removed from the stdlib, it will be shipped by + this module. + + :copyright: (c) 2014 by Armin Ronacher. + :license: BSD, see LICENSE for more details. +""" + +# Core classes +from .core import ( + Context as Context, + BaseCommand as BaseCommand, + Command as Command, + MultiCommand as MultiCommand, + Group as Group, + CommandCollection as CommandCollection, + Parameter as Parameter, + Option as Option, + Argument as Argument, +) + +# Globals +from .globals import get_current_context as get_current_context + +# Decorators +from .decorators import ( + pass_context as pass_context, + pass_obj as pass_obj, + make_pass_decorator as make_pass_decorator, + command as command, + group as group, + argument as argument, + option as option, + confirmation_option as confirmation_option, + password_option as password_option, + version_option as version_option, + help_option as help_option, +) + +# Types +from .types import ( + ParamType as ParamType, + File as File, + Path as Path, + Choice as Choice, + IntRange as IntRange, + Tuple as Tuple, + STRING as STRING, + INT as INT, + FLOAT as FLOAT, + BOOL as BOOL, + UUID as UUID, + UNPROCESSED as UNPROCESSED, +) + +# Utilities +from .utils import ( + echo as echo, + get_binary_stream as get_binary_stream, + get_text_stream as get_text_stream, + open_file as open_file, + format_filename as format_filename, + get_app_dir as get_app_dir, + get_os_args as get_os_args, +) + +# Terminal functions +from .termui import ( + prompt as prompt, + confirm as confirm, + get_terminal_size as get_terminal_size, + echo_via_pager as echo_via_pager, + progressbar as progressbar, + clear as clear, + style as style, + unstyle as unstyle, + secho as secho, + edit as edit, + launch as launch, + getchar as getchar, + pause as pause, +) + +# Exceptions +from .exceptions import ( + ClickException as ClickException, + UsageError as UsageError, + BadParameter as BadParameter, + FileError as FileError, + Abort as Abort, + NoSuchOption as NoSuchOption, + BadOptionUsage as BadOptionUsage, + BadArgumentUsage as BadArgumentUsage, + MissingParameter as MissingParameter, +) + +# Formatting +from .formatting import HelpFormatter as HelpFormatter, wrap_text as wrap_text + +# Parsing +from .parser import OptionParser as OptionParser + +# Controls if click should emit the warning about the use of unicode +# literals. +disable_unicode_literals_warning: bool + + +__version__: str diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/click/_termui_impl.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/click/_termui_impl.pyi new file mode 100644 index 0000000..f938c1c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/click/_termui_impl.pyi @@ -0,0 +1,14 @@ +from typing import ContextManager, Iterator, Generic, TypeVar, Optional + +_T = TypeVar("_T") + +class ProgressBar(object, Generic[_T]): + def update(self, n_steps: int) -> None: ... + def finish(self) -> None: ... + def __enter__(self) -> ProgressBar[_T]: ... + def __exit__(self, exc_type, exc_value, tb) -> None: ... + def __iter__(self) -> ProgressBar[_T]: ... + def next(self) -> _T: ... + def __next__(self) -> _T: ... + length: Optional[int] + label: str diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/click/core.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/click/core.pyi new file mode 100644 index 0000000..2cc32f0 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/click/core.pyi @@ -0,0 +1,474 @@ +from typing import ( + Any, + Callable, + ContextManager, + Dict, + Generator, + Iterable, + List, + Mapping, + NoReturn, + Optional, + Sequence, + Set, + Tuple, + TypeVar, + Union, +) + +from click.formatting import HelpFormatter +from click.parser import OptionParser + +def invoke_param_callback( + callback: Callable[[Context, Parameter, Optional[str]], Any], + ctx: Context, + param: Parameter, + value: Optional[str] +) -> Any: + ... + + +def augment_usage_errors( + ctx: Context, param: Optional[Parameter] = ... +) -> ContextManager[None]: + ... + + +def iter_params_for_processing( + invocation_order: Sequence[Parameter], + declaration_order: Iterable[Parameter], +) -> Iterable[Parameter]: + ... + + +class Context: + parent: Optional[Context] + command: Command + info_name: Optional[str] + params: Dict + args: List[str] + protected_args: List[str] + obj: Any + default_map: Mapping[str, Any] + invoked_subcommand: Optional[str] + terminal_width: Optional[int] + max_content_width: Optional[int] + allow_extra_args: bool + allow_interspersed_args: bool + ignore_unknown_options: bool + help_option_names: List[str] + token_normalize_func: Optional[Callable[[str], str]] + resilient_parsing: bool + auto_envvar_prefix: Optional[str] + color: Optional[bool] + _meta: Dict[str, Any] + _close_callbacks: List + _depth: int + + # properties + meta: Dict[str, Any] + command_path: str + + def __init__( + self, + command: Command, + parent: Optional[Context] = ..., + info_name: Optional[str] = ..., + obj: Optional[Any] = ..., + auto_envvar_prefix: Optional[str] = ..., + default_map: Optional[Mapping[str, Any]] = ..., + terminal_width: Optional[int] = ..., + max_content_width: Optional[int] = ..., + resilient_parsing: bool = ..., + allow_extra_args: Optional[bool] = ..., + allow_interspersed_args: Optional[bool] = ..., + ignore_unknown_options: Optional[bool] = ..., + help_option_names: Optional[List[str]] = ..., + token_normalize_func: Optional[Callable[[str], str]] = ..., + color: Optional[bool] = ... + ) -> None: + ... + + def scope(self, cleanup: bool = ...) -> ContextManager[Context]: + ... + + def make_formatter(self) -> HelpFormatter: + ... + + def call_on_close(self, f: Callable) -> Callable: + ... + + def close(self) -> None: + ... + + def find_root(self) -> Context: + ... + + def find_object(self, object_type: type) -> Any: + ... + + def ensure_object(self, object_type: type) -> Any: + ... + + def lookup_default(self, name: str) -> Any: + ... + + def fail(self, message: str) -> NoReturn: + ... + + def abort(self) -> NoReturn: + ... + + def exit(self, code: Union[int, str] = ...) -> NoReturn: + ... + + def get_usage(self) -> str: + ... + + def get_help(self) -> str: + ... + + def invoke( + self, callback: Union[Command, Callable], *args, **kwargs + ) -> Any: + ... + + def forward( + self, callback: Union[Command, Callable], *args, **kwargs + ) -> Any: + ... + +class BaseCommand: + allow_extra_args: bool + allow_interspersed_args: bool + ignore_unknown_options: bool + name: str + context_settings: Dict + + def __init__(self, name: str, context_settings: Optional[Dict] = ...) -> None: + ... + + def get_usage(self, ctx: Context) -> str: + ... + + def get_help(self, ctx: Context) -> str: + ... + + def make_context( + self, info_name: str, args: List[str], parent: Optional[Context] = ..., **extra + ) -> Context: + ... + + def parse_args(self, ctx: Context, args: List[str]) -> List[str]: + ... + + def invoke(self, ctx: Context) -> Any: + ... + + def main( + self, + args: Optional[List[str]] = ..., + prog_name: Optional[str] = ..., + complete_var: Optional[str] = ..., + standalone_mode: bool = ..., + **extra + ) -> Any: + ... + + def __call__(self, *args, **kwargs) -> Any: + ... + + +class Command(BaseCommand): + callback: Optional[Callable] + params: List[Parameter] + help: Optional[str] + epilog: Optional[str] + short_help: Optional[str] + options_metavar: str + add_help_option: bool + hidden: bool + deprecated: bool + + def __init__( + self, + name: str, + context_settings: Optional[Dict] = ..., + callback: Optional[Callable] = ..., + params: Optional[List[Parameter]] = ..., + help: Optional[str] = ..., + epilog: Optional[str] = ..., + short_help: Optional[str] = ..., + options_metavar: str = ..., + add_help_option: bool = ..., + hidden: bool = ..., + deprecated: bool = ..., + ) -> None: + ... + + def get_params(self, ctx: Context) -> List[Parameter]: + ... + + def format_usage( + self, + ctx: Context, + formatter: HelpFormatter + ) -> None: + ... + + def collect_usage_pieces(self, ctx: Context) -> List[str]: + ... + + def get_help_option_names(self, ctx: Context) -> Set[str]: + ... + + def get_help_option(self, ctx: Context) -> Optional[Option]: + ... + + def make_parser(self, ctx: Context) -> OptionParser: + ... + + def format_help(self, ctx: Context, formatter: HelpFormatter) -> None: + ... + + def format_help_text(self, ctx: Context, formatter: HelpFormatter) -> None: + ... + + def format_options(self, ctx: Context, formatter: HelpFormatter) -> None: + ... + + def format_epilog(self, ctx: Context, formatter: HelpFormatter) -> None: + ... + + +_T = TypeVar('_T') +_F = TypeVar('_F', bound=Callable[..., Any]) + + +class MultiCommand(Command): + no_args_is_help: bool + invoke_without_command: bool + subcommand_metavar: str + chain: bool + result_callback: Callable + + def __init__( + self, + name: Optional[str] = ..., + invoke_without_command: bool = ..., + no_args_is_help: Optional[bool] = ..., + subcommand_metavar: Optional[str] = ..., + chain: bool = ..., + result_callback: Optional[Callable] = ..., + **attrs + ) -> None: + ... + + def resultcallback( + self, replace: bool = ... + ) -> Callable[[_F], _F]: + ... + + def format_commands(self, ctx: Context, formatter: HelpFormatter) -> None: + ... + + def resolve_command( + self, ctx: Context, args: List[str] + ) -> Tuple[str, Command, List[str]]: + ... + + def get_command(self, ctx: Context, cmd_name: str) -> Optional[Command]: + ... + + def list_commands(self, ctx: Context) -> Iterable[str]: + ... + + +class Group(MultiCommand): + commands: Dict[str, Command] + + def __init__( + self, name: Optional[str] = ..., commands: Optional[Dict[str, Command]] = ..., **attrs + ) -> None: + ... + + def add_command(self, cmd: Command, name: Optional[str] = ...): + ... + + def command(self, *args, **kwargs) -> Callable[[Callable], Command]: + ... + + def group(self, *args, **kwargs) -> Callable[[Callable], Group]: + ... + + +class CommandCollection(MultiCommand): + sources: List[MultiCommand] + + def __init__( + self, name: Optional[str] = ..., sources: Optional[List[MultiCommand]] = ..., **attrs + ) -> None: + ... + + def add_source(self, multi_cmd: MultiCommand) -> None: + ... + + +class _ParamType: + name: str + is_composite: bool + envvar_list_splitter: Optional[str] + + def __call__( + self, + value: Optional[str], + param: Optional[Parameter] = ..., + ctx: Optional[Context] = ..., + ) -> Any: + ... + + def get_metavar(self, param: Parameter) -> str: + ... + + def get_missing_message(self, param: Parameter) -> str: + ... + + def convert( + self, + value: str, + param: Optional[Parameter], + ctx: Optional[Context], + ) -> Any: + ... + + def split_envvar_value(self, rv: str) -> List[str]: + ... + + def fail(self, message: str, param: Optional[Parameter] = ..., ctx: Optional[Context] = ...) -> None: + ... + + +# This type is here to resolve https://github.com/python/mypy/issues/5275 +_ConvertibleType = Union[type, _ParamType, Tuple[type, ...], Callable[[str], Any], Callable[[Optional[str]], Any]] + + +class Parameter: + param_type_name: str + name: str + opts: List[str] + secondary_opts: List[str] + type: _ParamType + required: bool + callback: Optional[Callable[[Context, Parameter, str], Any]] + nargs: int + multiple: bool + expose_value: bool + default: Any + is_eager: bool + metavar: Optional[str] + envvar: Union[str, List[str], None] + # properties + human_readable_name: str + + def __init__( + self, + param_decls: Optional[List[str]] = ..., + type: Optional[_ConvertibleType] = ..., + required: bool = ..., + default: Optional[Any] = ..., + callback: Optional[Callable[[Context, Parameter, str], Any]] = ..., + nargs: Optional[int] = ..., + metavar: Optional[str] = ..., + expose_value: bool = ..., + is_eager: bool = ..., + envvar: Optional[Union[str, List[str]]] = ... + ) -> None: + ... + + def make_metavar(self) -> str: + ... + + def get_default(self, ctx: Context) -> Any: + ... + + def add_to_parser(self, parser: OptionParser, ctx: Context) -> None: + ... + + def consume_value(self, ctx: Context, opts: Dict[str, Any]) -> Any: + ... + + def type_cast_value(self, ctx: Context, value: Any) -> Any: + ... + + def process_value(self, ctx: Context, value: Any) -> Any: + ... + + def value_is_missing(self, value: Any) -> bool: + ... + + def full_process_value(self, ctx: Context, value: Any) -> Any: + ... + + def resolve_envvar_value(self, ctx: Context) -> str: + ... + + def value_from_envvar(self, ctx: Context) -> Union[str, List[str]]: + ... + + def handle_parse_result( + self, ctx: Context, opts: Dict[str, Any], args: List[str] + ) -> Tuple[Any, List[str]]: + ... + + def get_help_record(self, ctx: Context) -> Tuple[str, str]: + ... + + def get_usage_pieces(self, ctx: Context) -> List[str]: + ... + + +class Option(Parameter): + prompt: str # sic + confirmation_prompt: bool + hide_input: bool + is_flag: bool + flag_value: Any + is_bool_flag: bool + count: bool + multiple: bool + allow_from_autoenv: bool + help: Optional[str] + show_default: bool + show_choices: bool + + def __init__( + self, + param_decls: Optional[List[str]] = ..., + show_default: bool = ..., + prompt: Union[bool, str] = ..., + confirmation_prompt: bool = ..., + hide_input: bool = ..., + is_flag: Optional[bool] = ..., + flag_value: Optional[Any] = ..., + multiple: bool = ..., + count: bool = ..., + allow_from_autoenv: bool = ..., + type: Optional[_ConvertibleType] = ..., + help: Optional[str] = ..., + show_choices: bool = ..., + **attrs + ) -> None: + ... + + def prompt_for_value(self, ctx: Context) -> Any: + ... + + +class Argument(Parameter): + def __init__( + self, + param_decls: Optional[List[str]] = ..., + required: Optional[bool] = ..., + **attrs + ) -> None: + ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/click/decorators.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/click/decorators.pyi new file mode 100644 index 0000000..44f4ad7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/click/decorators.pyi @@ -0,0 +1,336 @@ +from distutils.version import Version +from typing import Any, Callable, Dict, List, Optional, Tuple, Type, TypeVar, Union, Text, overload + +from click.core import Command, Group, Argument, Option, Parameter, Context, _ConvertibleType + +_T = TypeVar('_T') +_F = TypeVar('_F', bound=Callable[..., Any]) + +# Until https://github.com/python/mypy/issues/3924 is fixed you can't do the following: +# _Decorator = Callable[[_F], _F] + +_Callback = Callable[ + [Context, Union[Option, Parameter], Any], + Any +] + +def pass_context(_T) -> _T: + ... + + +def pass_obj(_T) -> _T: + ... + + +def make_pass_decorator( + object_type: type, ensure: bool = ... +) -> Callable[[_T], _T]: + ... + + +# NOTE: Decorators below have **attrs converted to concrete constructor +# arguments from core.pyi to help with type checking. + +def command( + name: Optional[str] = ..., + cls: Optional[Type[Command]] = ..., + # Command + context_settings: Optional[Dict] = ..., + help: Optional[str] = ..., + epilog: Optional[str] = ..., + short_help: Optional[str] = ..., + options_metavar: str = ..., + add_help_option: bool = ..., + hidden: bool = ..., + deprecated: bool = ..., +) -> Callable[[Callable], Command]: + ... + + +# This inherits attrs from Group, MultiCommand and Command. + +def group( + name: Optional[str] = ..., + cls: Type[Command] = ..., + # Group + commands: Optional[Dict[str, Command]] = ..., + # MultiCommand + invoke_without_command: bool = ..., + no_args_is_help: Optional[bool] = ..., + subcommand_metavar: Optional[str] = ..., + chain: bool = ..., + result_callback: Optional[Callable] = ..., + # Command + help: Optional[str] = ..., + epilog: Optional[str] = ..., + short_help: Optional[str] = ..., + options_metavar: str = ..., + add_help_option: bool = ..., + hidden: bool = ..., + deprecated: bool = ..., + # User-defined + **kwargs: Any, +) -> Callable[[Callable], Group]: + ... + + +def argument( + *param_decls: str, + cls: Type[Argument] = ..., + # Argument + required: Optional[bool] = ..., + # Parameter + type: Optional[_ConvertibleType] = ..., + default: Optional[Any] = ..., + callback: Optional[_Callback] = ..., + nargs: Optional[int] = ..., + metavar: Optional[str] = ..., + expose_value: bool = ..., + is_eager: bool = ..., + envvar: Optional[Union[str, List[str]]] = ..., + autocompletion: Optional[Callable[[Any, List[str], str], List[Union[str, Tuple[str, str]]]]] = ..., +) -> Callable[[_F], _F]: + ... + + +@overload +def option( + *param_decls: str, + cls: Type[Option] = ..., + # Option + show_default: bool = ..., + prompt: Union[bool, Text] = ..., + confirmation_prompt: bool = ..., + hide_input: bool = ..., + is_flag: Optional[bool] = ..., + flag_value: Optional[Any] = ..., + multiple: bool = ..., + count: bool = ..., + allow_from_autoenv: bool = ..., + type: Optional[_ConvertibleType] = ..., + help: Optional[str] = ..., + show_choices: bool = ..., + # Parameter + default: Optional[Any] = ..., + required: bool = ..., + callback: Optional[_Callback] = ..., + nargs: Optional[int] = ..., + metavar: Optional[str] = ..., + expose_value: bool = ..., + is_eager: bool = ..., + envvar: Optional[Union[str, List[str]]] = ..., + # User-defined + **kwargs: Any, +) -> Callable[[_F], _F]: + ... + + +@overload +def option( + *param_decls: str, + cls: Type[Option] = ..., + # Option + show_default: bool = ..., + prompt: Union[bool, Text] = ..., + confirmation_prompt: bool = ..., + hide_input: bool = ..., + is_flag: Optional[bool] = ..., + flag_value: Optional[Any] = ..., + multiple: bool = ..., + count: bool = ..., + allow_from_autoenv: bool = ..., + type: _T = ..., + help: Optional[str] = ..., + show_choices: bool = ..., + # Parameter + default: Optional[Any] = ..., + required: bool = ..., + callback: Optional[Callable[[Context, Union[Option, Parameter], Union[bool, int, str]], _T]] = ..., + nargs: Optional[int] = ..., + metavar: Optional[str] = ..., + expose_value: bool = ..., + is_eager: bool = ..., + envvar: Optional[Union[str, List[str]]] = ..., + # User-defined + **kwargs: Any, +) -> Callable[[_F], _F]: + ... + + +@overload +def option( + *param_decls: str, + cls: Type[Option] = ..., + # Option + show_default: bool = ..., + prompt: Union[bool, Text] = ..., + confirmation_prompt: bool = ..., + hide_input: bool = ..., + is_flag: Optional[bool] = ..., + flag_value: Optional[Any] = ..., + multiple: bool = ..., + count: bool = ..., + allow_from_autoenv: bool = ..., + type: Type[str] = ..., + help: Optional[str] = ..., + show_choices: bool = ..., + # Parameter + default: Optional[Any] = ..., + required: bool = ..., + callback: Callable[[Context, Union[Option, Parameter], str], Any] = ..., + nargs: Optional[int] = ..., + metavar: Optional[str] = ..., + expose_value: bool = ..., + is_eager: bool = ..., + envvar: Optional[Union[str, List[str]]] = ..., + # User-defined + **kwargs: Any, +) -> Callable[[_F], _F]: + ... + + +@overload +def option( + *param_decls: str, + cls: Type[Option] = ..., + # Option + show_default: bool = ..., + prompt: Union[bool, Text] = ..., + confirmation_prompt: bool = ..., + hide_input: bool = ..., + is_flag: Optional[bool] = ..., + flag_value: Optional[Any] = ..., + multiple: bool = ..., + count: bool = ..., + allow_from_autoenv: bool = ..., + type: Type[int] = ..., + help: Optional[str] = ..., + show_choices: bool = ..., + # Parameter + default: Optional[Any] = ..., + required: bool = ..., + callback: Callable[[Context, Union[Option, Parameter], int], Any] = ..., + nargs: Optional[int] = ..., + metavar: Optional[str] = ..., + expose_value: bool = ..., + is_eager: bool = ..., + envvar: Optional[Union[str, List[str]]] = ..., + # User-defined + **kwargs: Any, +) -> Callable[[_F], _F]: + ... + + +def confirmation_option( + *param_decls: str, + cls: Type[Option] = ..., + # Option + show_default: bool = ..., + prompt: Union[bool, Text] = ..., + confirmation_prompt: bool = ..., + hide_input: bool = ..., + is_flag: bool = ..., + flag_value: Optional[Any] = ..., + multiple: bool = ..., + count: bool = ..., + allow_from_autoenv: bool = ..., + type: Optional[_ConvertibleType] = ..., + help: str = ..., + show_choices: bool = ..., + # Parameter + default: Optional[Any] = ..., + callback: Optional[_Callback] = ..., + nargs: Optional[int] = ..., + metavar: Optional[str] = ..., + expose_value: bool = ..., + is_eager: bool = ..., + envvar: Optional[Union[str, List[str]]] = ... +) -> Callable[[_F], _F]: + ... + + +def password_option( + *param_decls: str, + cls: Type[Option] = ..., + # Option + show_default: bool = ..., + prompt: Union[bool, Text] = ..., + confirmation_prompt: bool = ..., + hide_input: bool = ..., + is_flag: Optional[bool] = ..., + flag_value: Optional[Any] = ..., + multiple: bool = ..., + count: bool = ..., + allow_from_autoenv: bool = ..., + type: Optional[_ConvertibleType] = ..., + help: Optional[str] = ..., + show_choices: bool = ..., + # Parameter + default: Optional[Any] = ..., + callback: Optional[_Callback] = ..., + nargs: Optional[int] = ..., + metavar: Optional[str] = ..., + expose_value: bool = ..., + is_eager: bool = ..., + envvar: Optional[Union[str, List[str]]] = ... +) -> Callable[[_F], _F]: + ... + + +def version_option( + version: Optional[Union[str, Version]] = ..., + *param_decls: str, + cls: Type[Option] = ..., + # Option + prog_name: Optional[str] = ..., + message: Optional[str] = ..., + show_default: bool = ..., + prompt: Union[bool, Text] = ..., + confirmation_prompt: bool = ..., + hide_input: bool = ..., + is_flag: bool = ..., + flag_value: Optional[Any] = ..., + multiple: bool = ..., + count: bool = ..., + allow_from_autoenv: bool = ..., + type: Optional[_ConvertibleType] = ..., + help: str = ..., + show_choices: bool = ..., + # Parameter + default: Optional[Any] = ..., + callback: Optional[_Callback] = ..., + nargs: Optional[int] = ..., + metavar: Optional[str] = ..., + expose_value: bool = ..., + is_eager: bool = ..., + envvar: Optional[Union[str, List[str]]] = ... +) -> Callable[[_F], _F]: + ... + + +def help_option( + *param_decls: str, + cls: Type[Option] = ..., + # Option + show_default: bool = ..., + prompt: Union[bool, Text] = ..., + confirmation_prompt: bool = ..., + hide_input: bool = ..., + is_flag: bool = ..., + flag_value: Optional[Any] = ..., + multiple: bool = ..., + count: bool = ..., + allow_from_autoenv: bool = ..., + type: Optional[_ConvertibleType] = ..., + help: str = ..., + show_choices: bool = ..., + # Parameter + default: Optional[Any] = ..., + callback: Optional[_Callback] = ..., + nargs: Optional[int] = ..., + metavar: Optional[str] = ..., + expose_value: bool = ..., + is_eager: bool = ..., + envvar: Optional[Union[str, List[str]]] = ... +) -> Callable[[_F], _F]: + ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/click/exceptions.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/click/exceptions.pyi new file mode 100644 index 0000000..7e081be --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/click/exceptions.pyi @@ -0,0 +1,96 @@ +from typing import IO, List, Optional, Any + +from click.core import Context, Parameter + + +class ClickException(Exception): + exit_code: int + message: str + + def __init__(self, message: str) -> None: + ... + + def format_message(self) -> str: + ... + + def show(self, file: Optional[Any] = ...) -> None: + ... + + +class UsageError(ClickException): + ctx: Optional[Context] + + def __init__(self, message: str, ctx: Optional[Context] = ...) -> None: + ... + + def show(self, file: Optional[IO] = ...) -> None: + ... + + +class BadParameter(UsageError): + param: Optional[Parameter] + param_hint: Optional[str] + + def __init__( + self, + message: str, + ctx: Optional[Context] = ..., + param: Optional[Parameter] = ..., + param_hint: Optional[str] = ... + ) -> None: + ... + + +class MissingParameter(BadParameter): + param_type: str # valid values: 'parameter', 'option', 'argument' + + def __init__( + self, + message: Optional[str] = ..., + ctx: Optional[Context] = ..., + param: Optional[Parameter] = ..., + param_hint: Optional[str] = ..., + param_type: Optional[str] = ... + ) -> None: + ... + + +class NoSuchOption(UsageError): + option_name: str + possibilities: Optional[List[str]] + + def __init__( + self, + option_name: str, + message: Optional[str] = ..., + possibilities: Optional[List[str]] = ..., + ctx: Optional[Context] = ... + ) -> None: + ... + + +class BadOptionUsage(UsageError): + def __init__(self, message: str, ctx: Optional[Context] = ...) -> None: + ... + + +class BadArgumentUsage(UsageError): + def __init__(self, message: str, ctx: Optional[Context] = ...) -> None: + ... + + +class FileError(ClickException): + ui_filename: str + filename: str + + def __init__(self, filename: str, hint: Optional[str] = ...) -> None: + ... + + +class Abort(RuntimeError): + ... + + +class Exit(RuntimeError): + def __init__(self, code: int = ...) -> None: + ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/click/formatting.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/click/formatting.pyi new file mode 100644 index 0000000..bcd3048 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/click/formatting.pyi @@ -0,0 +1,86 @@ +from typing import ContextManager, Generator, Iterable, List, Optional, Tuple + + +FORCED_WIDTH: Optional[int] + + +def measure_table(rows: Iterable[Iterable[str]]) -> Tuple[int, ...]: + ... + + +def iter_rows( + rows: Iterable[Iterable[str]], col_count: int +) -> Generator[Tuple[str, ...], None, None]: + ... + + +def wrap_text( + text: str, + width: int = ..., + initial_indent: str = ..., + subsequent_indent: str = ..., + preserve_paragraphs: bool = ... +) -> str: + ... + + +class HelpFormatter: + indent_increment: int + width: Optional[int] + current_indent: int + buffer: List[str] + + def __init__( + self, + indent_increment: int = ..., + width: Optional[int] = ..., + max_width: Optional[int] = ..., + ) -> None: + ... + + def write(self, string: str) -> None: + ... + + def indent(self) -> None: + ... + + def dedent(self) -> None: + ... + + def write_usage( + self, + prog: str, + args: str = ..., + prefix: str = ..., + ): + ... + + def write_heading(self, heading: str) -> None: + ... + + def write_paragraph(self) -> None: + ... + + def write_text(self, text: str) -> None: + ... + + def write_dl( + self, + rows: Iterable[Iterable[str]], + col_max: int = ..., + col_spacing: int = ..., + ) -> None: + ... + + def section(self, name) -> ContextManager[None]: + ... + + def indentation(self) -> ContextManager[None]: + ... + + def getvalue(self) -> str: + ... + + +def join_options(options: List[str]) -> Tuple[str, bool]: + ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/click/globals.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/click/globals.pyi new file mode 100644 index 0000000..11adce3 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/click/globals.pyi @@ -0,0 +1,18 @@ +from click.core import Context +from typing import Optional + + +def get_current_context(silent: bool = ...) -> Context: + ... + + +def push_context(ctx: Context) -> None: + ... + + +def pop_context() -> None: + ... + + +def resolve_color_default(color: Optional[bool] = ...) -> Optional[bool]: + ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/click/parser.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/click/parser.pyi new file mode 100644 index 0000000..f5869a2 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/click/parser.pyi @@ -0,0 +1,102 @@ +from typing import Any, Dict, Iterable, List, Optional, Set, Tuple + +from click.core import Context + + +def _unpack_args( + args: Iterable[str], nargs_spec: Iterable[int] +) -> Tuple[Tuple[Optional[Tuple[str, ...]], ...], List[str]]: + ... + + +def split_opt(opt: str) -> Tuple[str, str]: + ... + + +def normalize_opt(opt: str, ctx: Context) -> str: + ... + + +def split_arg_string(string: str) -> List[str]: + ... + + +class Option: + dest: str + action: str + nargs: int + const: Any + obj: Any + prefixes: Set[str] + _short_opts: List[str] + _long_opts: List[str] + # properties + takes_value: bool + + def __init__( + self, + opts: Iterable[str], + dest: str, + action: Optional[str] = ..., + nargs: int = ..., + const: Optional[Any] = ..., + obj: Optional[Any] = ... + ) -> None: + ... + + def process(self, value: Any, state: ParsingState) -> None: + ... + + +class Argument: + dest: str + nargs: int + obj: Any + + def __init__(self, dest: str, nargs: int = ..., obj: Optional[Any] = ...) -> None: + ... + + def process(self, value: Any, state: ParsingState) -> None: + ... + + +class ParsingState: + opts: Dict[str, Any] + largs: List[str] + rargs: List[str] + order: List[Any] + + def __init__(self, rargs: List[str]) -> None: + ... + + +class OptionParser: + ctx: Optional[Context] + allow_interspersed_args: bool + ignore_unknown_options: bool + _short_opt: Dict[str, Option] + _long_opt: Dict[str, Option] + _opt_prefixes: Set[str] + _args: List[Argument] + + def __init__(self, ctx: Optional[Context] = ...) -> None: + ... + + def add_option( + self, + opts: Iterable[str], + dest: str, + action: Optional[str] = ..., + nargs: int = ..., + const: Optional[Any] = ..., + obj: Optional[Any] = ... + ) -> None: + ... + + def add_argument(self, dest: str, nargs: int = ..., obj: Optional[Any] = ...) -> None: + ... + + def parse_args( + self, args: List[str] + ) -> Tuple[Dict[str, Any], List[str], List[Any]]: + ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/click/termui.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/click/termui.pyi new file mode 100644 index 0000000..95b6850 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/click/termui.pyi @@ -0,0 +1,169 @@ +from typing import ( + Any, + Callable, + Generator, + Iterable, + IO, + List, + Optional, + Text, + overload, + Tuple, + TypeVar, +) + +from click.core import _ConvertibleType +from click._termui_impl import ProgressBar as _ProgressBar + + +def hidden_prompt_func(prompt: str) -> str: + ... + + +def _build_prompt( + text: str, + suffix: str, + show_default: bool = ..., + default: Optional[str] = ..., +) -> str: + ... + + +def prompt( + text: str, + default: Optional[str] = ..., + hide_input: bool = ..., + confirmation_prompt: bool = ..., + type: Optional[_ConvertibleType] = ..., + value_proc: Optional[Callable[[Optional[str]], Any]] = ..., + prompt_suffix: str = ..., + show_default: bool = ..., + err: bool = ..., + show_choices: bool = ..., +) -> Any: + ... + + +def confirm( + text: str, + default: bool = ..., + abort: bool = ..., + prompt_suffix: str = ..., + show_default: bool = ..., + err: bool = ..., +) -> bool: + ... + + +def get_terminal_size() -> Tuple[int, int]: + ... + + +def echo_via_pager(text: str, color: Optional[bool] = ...) -> None: + ... + + +_T = TypeVar('_T') + +@overload +def progressbar( + iterable: Iterable[_T], + length: Optional[int] = ..., + label: Optional[str] = ..., + show_eta: bool = ..., + show_percent: Optional[bool] = ..., + show_pos: bool = ..., + item_show_func: Optional[Callable[[_T], str]] = ..., + fill_char: str = ..., + empty_char: str = ..., + bar_template: str = ..., + info_sep: str = ..., + width: int = ..., + file: Optional[IO] = ..., + color: Optional[bool] = ..., +) -> _ProgressBar[_T]: + ... + +@overload +def progressbar( + iterable: None = ..., + length: Optional[int] = ..., + label: Optional[str] = ..., + show_eta: bool = ..., + show_percent: Optional[bool] = ..., + show_pos: bool = ..., + item_show_func: Optional[Callable[[_T], str]] = ..., + fill_char: str = ..., + empty_char: str = ..., + bar_template: str = ..., + info_sep: str = ..., + width: int = ..., + file: Optional[IO] = ..., + color: Optional[bool] = ..., +) -> _ProgressBar[int]: + ... + +def clear() -> None: + ... + + +def style( + text: str, + fg: Optional[str] = ..., + bg: Optional[str] = ..., + bold: Optional[bool] = ..., + dim: Optional[bool] = ..., + underline: Optional[bool] = ..., + blink: Optional[bool] = ..., + reverse: Optional[bool] = ..., + reset: bool = ..., +) -> str: + ... + + +def unstyle(text: str) -> str: + ... + + +# Styling options copied from style() for nicer type checking. +def secho( + text: str, + file: Optional[IO] = ..., + nl: bool = ..., + err: bool = ..., + color: Optional[bool] = ..., + fg: Optional[str] = ..., + bg: Optional[str] = ..., + bold: Optional[bool] = ..., + dim: Optional[bool] = ..., + underline: Optional[bool] = ..., + blink: Optional[bool] = ..., + reverse: Optional[bool] = ..., + reset: bool = ..., +): + ... + + +def edit( + text: Optional[str] = ..., + editor: Optional[str] = ..., + env: Optional[str] = ..., + require_save: bool = ..., + extension: str = ..., + filename: Optional[str] = ..., +) -> str: + ... + + +def launch(url: str, wait: bool = ..., locate: bool = ...) -> int: + ... + + +def getchar(echo: bool = ...) -> Text: + ... + + +def pause( + info: str = ..., err: bool = ... +) -> None: + ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/click/testing.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/click/testing.pyi new file mode 100644 index 0000000..c743516 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/click/testing.pyi @@ -0,0 +1,63 @@ +from typing import (IO, Any, BinaryIO, ContextManager, Dict, Iterable, List, + Mapping, Optional, Text, Tuple, Union) + +from .core import BaseCommand + +clickpkg: Any + +class EchoingStdin: + def __init__(self, input: BinaryIO, output: BinaryIO) -> None: ... + def __getattr__(self, x: str) -> Any: ... + def read(self, n: int = ...) -> bytes: ... + def readline(self, n: int = ...) -> bytes: ... + def readlines(self) -> List[bytes]: ... + def __iter__(self) -> Iterable[bytes]: ... + +def make_input_stream(input: Optional[Union[bytes, Text, IO]], charset: Text) -> BinaryIO: ... + +class Result: + runner: CliRunner + exit_code: int + exception: Any + exc_info: Optional[Any] + def __init__( + self, + runner: CliRunner, + exit_code: int, + exception: Any, + exc_info: Optional[Any] = ..., + ) -> None: ... + @property + def output(self) -> Text: ... + +class CliRunner: + charset: str + env: Mapping[str, str] + echo_stdin: bool + def __init__( + self, + charset: Optional[Text] = ..., + env: Optional[Mapping[str, str]] = ..., + echo_stdin: bool = ..., + ) -> None: + ... + def get_default_prog_name(self, cli: BaseCommand) -> str: ... + def make_env(self, overrides: Optional[Mapping[str, str]] = ...) -> Dict[str, str]: ... + def isolation( + self, + input: Optional[IO] = ..., + env: Optional[Mapping[str, str]] = ..., + color: bool = ..., + ) -> ContextManager[BinaryIO]: ... + def invoke( + self, + cli: BaseCommand, + args: Optional[Union[str, Iterable[str]]] = ..., + input: Optional[IO] = ..., + env: Optional[Mapping[str, str]] = ..., + catch_exceptions: bool = ..., + color: bool = ..., + **extra: Any, + ) -> Result: + ... + def isolated_filesystem(self) -> ContextManager[str]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/click/types.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/click/types.pyi new file mode 100644 index 0000000..7f1e0ba --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/click/types.pyi @@ -0,0 +1,269 @@ +from typing import Any, Callable, IO, Iterable, List, Optional, TypeVar, Union, Tuple as _PyTuple, Type +import datetime +import uuid + +from click.core import Context, Parameter, _ParamType as ParamType, _ConvertibleType + +class BoolParamType(ParamType): + def __call__( + self, + value: Optional[str], + param: Optional[Parameter] = ..., + ctx: Optional[Context] = ..., + ) -> bool: + ... + + def convert( + self, + value: str, + param: Optional[Parameter], + ctx: Optional[Context], + ) -> bool: + ... + + +class CompositeParamType(ParamType): + arity: int + + +class Choice(ParamType): + choices: Iterable[str] + def __init__( + self, + choices: Iterable[str], + case_sensitive: bool = ..., + ) -> None: + ... + + +class DateTime(ParamType): + def __init__( + self, + formats: Optional[List[str]] = ..., + ) -> None: + ... + + def convert( + self, + value: str, + param: Optional[Parameter], + ctx: Optional[Context], + ) -> datetime.datetime: + ... + + +class FloatParamType(ParamType): + def __call__( + self, + value: Optional[str], + param: Optional[Parameter] = ..., + ctx: Optional[Context] = ..., + ) -> float: + ... + + def convert( + self, + value: str, + param: Optional[Parameter], + ctx: Optional[Context], + ) -> float: + ... + + +class FloatRange(FloatParamType): + ... + + +class File(ParamType): + def __init__( + self, + mode: str = ..., + encoding: Optional[str] = ..., + errors: Optional[str] = ..., + lazy: Optional[bool] = ..., + atomic: Optional[bool] = ..., + ) -> None: + ... + + def __call__( + self, + value: Optional[str], + param: Optional[Parameter] = ..., + ctx: Optional[Context] = ..., + ) -> IO: + ... + + def convert( + self, + value: str, + param: Optional[Parameter], + ctx: Optional[Context], + ) -> IO: + ... + + def resolve_lazy_flag(self, value: str) -> bool: + ... + + +_F = TypeVar('_F') # result of the function +_Func = Callable[[Optional[str]], _F] + + +class FuncParamType(ParamType): + func: _Func + + def __init__(self, func: _Func) -> None: + ... + + def __call__( + self, + value: Optional[str], + param: Optional[Parameter] = ..., + ctx: Optional[Context] = ..., + ) -> _F: + ... + + def convert( + self, + value: str, + param: Optional[Parameter], + ctx: Optional[Context], + ) -> _F: + ... + + +class IntParamType(ParamType): + def __call__( + self, + value: Optional[str], + param: Optional[Parameter] = ..., + ctx: Optional[Context] = ..., + ) -> int: + ... + + def convert( + self, + value: str, + param: Optional[Parameter], + ctx: Optional[Context], + ) -> int: + ... + + +class IntRange(IntParamType): + def __init__( + self, min: Optional[int] = ..., max: Optional[int] = ..., clamp: bool = ... + ) -> None: + ... + + +_PathType = TypeVar('_PathType', str, bytes) + + +class Path(ParamType): + def __init__( + self, + exists: bool = ..., + file_okay: bool = ..., + dir_okay: bool = ..., + writable: bool = ..., + readable: bool = ..., + resolve_path: bool = ..., + allow_dash: bool = ..., + path_type: Optional[Type[_PathType]] = ..., + ) -> None: + ... + + def coerce_path_result(self, rv: Union[str, bytes]) -> _PathType: + ... + + def __call__( + self, + value: Optional[str], + param: Optional[Parameter] = ..., + ctx: Optional[Context] = ..., + ) -> _PathType: + ... + + def convert( + self, + value: str, + param: Optional[Parameter], + ctx: Optional[Context], + ) -> _PathType: + ... + +class StringParamType(ParamType): + def __call__( + self, + value: Optional[str], + param: Optional[Parameter] = ..., + ctx: Optional[Context] = ..., + ) -> str: + ... + + def convert( + self, + value: str, + param: Optional[Parameter], + ctx: Optional[Context], + ) -> str: + ... + + +class Tuple(CompositeParamType): + types: List[ParamType] + + def __init__(self, types: Iterable[Any]) -> None: + ... + + def __call__( + self, + value: Optional[str], + param: Optional[Parameter] = ..., + ctx: Optional[Context] = ..., + ) -> Tuple: + ... + + def convert( + self, + value: str, + param: Optional[Parameter], + ctx: Optional[Context], + ) -> Tuple: + ... + + +class UnprocessedParamType(ParamType): + ... + + +class UUIDParameterType(ParamType): + def __call__( + self, + value: Optional[str], + param: Optional[Parameter] = ..., + ctx: Optional[Context] = ..., + ) -> uuid.UUID: + ... + + def convert( + self, + value: str, + param: Optional[Parameter], + ctx: Optional[Context], + ) -> uuid.UUID: + ... + + +def convert_type(ty: Optional[_ConvertibleType], default: Optional[Any] = ...) -> ParamType: + ... + +# parameter type shortcuts + +BOOL: BoolParamType +FLOAT: FloatParamType +INT: IntParamType +STRING: StringParamType +UNPROCESSED: UnprocessedParamType +UUID: UUIDParameterType diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/click/utils.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/click/utils.pyi new file mode 100644 index 0000000..547c5e8 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/click/utils.pyi @@ -0,0 +1,116 @@ +from typing import Any, Callable, Iterator, IO, List, Optional, TypeVar, Union, Text + +_T = TypeVar('_T') + + +def _posixify(name: str) -> str: + ... + + +def safecall(func: _T) -> _T: + ... + + +def make_str(value: Any) -> str: + ... + + +def make_default_short_help(help: str, max_length: int = ...): + ... + + +class LazyFile: + name: str + mode: str + encoding: Optional[str] + errors: str + atomic: bool + + def __init__( + self, + filename: str, + mode: str = ..., + encoding: Optional[str] = ..., + errors: str = ..., + atomic: bool = ... + ) -> None: + ... + + def open(self) -> IO: + ... + + def close(self) -> None: + ... + + def close_intelligently(self) -> None: + ... + + def __enter__(self) -> LazyFile: + ... + + def __exit__(self, exc_type, exc_value, tb): + ... + + def __iter__(self) -> Iterator: + ... + + +class KeepOpenFile: + _file: IO + + def __init__(self, file: IO) -> None: + ... + + def __enter__(self) -> KeepOpenFile: + ... + + def __exit__(self, exc_type, exc_value, tb): + ... + + def __iter__(self) -> Iterator: + ... + + +def echo( + message: object = ..., + file: Optional[IO] = ..., + nl: bool = ..., + err: bool = ..., + color: Optional[bool] = ..., +) -> None: + ... + + +def get_binary_stream(name: str) -> IO[bytes]: + ... + + +def get_text_stream( + name: str, encoding: Optional[str] = ..., errors: str = ... +) -> IO[str]: + ... + + +def open_file( + filename: str, + mode: str = ..., + encoding: Optional[str] = ..., + errors: str = ..., + lazy: bool = ..., + atomic: bool = ... +) -> Union[IO, LazyFile, KeepOpenFile]: + ... + + +def get_os_args() -> List[str]: + ... + + +def format_filename(filename: str, shorten: bool = ...) -> str: + ... + + +def get_app_dir( + app_name: str, roaming: bool = ..., force_posix: bool = ... +) -> str: + ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/croniter.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/croniter.pyi new file mode 100644 index 0000000..0d01b7e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/croniter.pyi @@ -0,0 +1,41 @@ +import datetime +from typing import Any, Dict, Iterator, List, Optional, Text, Tuple, Type, TypeVar, Union + +_RetType = Union[Type[float], Type[datetime.datetime]] +_SelfT = TypeVar('_SelfT', bound=croniter) + +class CroniterError(ValueError): ... +class CroniterBadCronError(CroniterError): ... +class CroniterBadDateError(CroniterError): ... +class CroniterNotAlphaError(CroniterError): ... + +class croniter(Iterator[Any]): + MONTHS_IN_YEAR: int + RANGES: Tuple[Tuple[int, int], ...] + DAYS: Tuple[int, ...] + ALPHACONV: Tuple[Dict[str, Any], ...] + LOWMAP: Tuple[Dict[int, Any], ...] + bad_length: str + tzinfo: Optional[datetime.tzinfo] + cur: float + expanded: List[List[str]] + start_time: float + dst_start_time: float + nth_weekday_of_month: Dict[str, Any] + def __init__(self, expr_format: Text, start_time: Optional[Union[float, datetime.datetime]] = ..., ret_type: Optional[_RetType] = ...) -> None: ... + # Most return value depend on ret_type, which can be passed in both as a method argument and as + # a constructor argument. + def get_next(self, ret_type: Optional[_RetType] = ...) -> Any: ... + def get_prev(self, ret_type: Optional[_RetType] = ...) -> Any: ... + def get_current(self, ret_type: Optional[_RetType] = ...) -> Any: ... + def __iter__(self: _SelfT) -> _SelfT: ... + def __next__(self, ret_type: Optional[_RetType] = ...) -> Any: ... + def next(self, ret_type: Optional[_RetType] = ...) -> Any: ... + def all_next(self, ret_type: Optional[_RetType] = ...) -> Iterator[Any]: ... + def all_prev(self, ret_type: Optional[_RetType] = ...) -> Iterator[Any]: ... + def iter(self, ret_type: Optional[_RetType] = ...) -> Iterator[Any]: ... + def is_leap(self, year: int) -> bool: ... + @classmethod + def expand(cls, expr_format: Text) -> Tuple[List[List[str]], Dict[str, Any]]: ... + @classmethod + def is_valid(cls, expression: Text) -> bool: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/dateutil/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/dateutil/__init__.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/dateutil/_common.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/dateutil/_common.pyi new file mode 100644 index 0000000..1311a17 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/dateutil/_common.pyi @@ -0,0 +1,15 @@ +from typing import Optional + +class weekday(object): + def __init__(self, weekday: int, n: Optional[int] = ...) -> None: ... + + def __call__(self, n: int) -> weekday: ... + + def __eq__(self, other) -> bool: ... + + def __repr__(self) -> str: ... + + def __hash__(self) -> int: ... + + weekday: int + n: int diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/dateutil/parser.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/dateutil/parser.pyi new file mode 100644 index 0000000..045a793 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/dateutil/parser.pyi @@ -0,0 +1,46 @@ +from typing import List, Tuple, Optional, Callable, Union, IO, Any, Dict, Mapping, Text +from datetime import datetime, tzinfo + +_FileOrStr = Union[bytes, Text, IO[str], IO[Any]] + + +class parserinfo(object): + JUMP: List[str] + WEEKDAYS: List[Tuple[str, str]] + MONTHS: List[Tuple[str, str]] + HMS: List[Tuple[str, str, str]] + AMPM: List[Tuple[str, str]] + UTCZONE: List[str] + PERTAIN: List[str] + TZOFFSET: Dict[str, int] + + def __init__(self, dayfirst: bool = ..., yearfirst: bool = ...) -> None: ... + def jump(self, name: Text) -> bool: ... + def weekday(self, name: Text) -> Optional[int]: ... + def month(self, name: Text) -> Optional[int]: ... + def hms(self, name: Text) -> Optional[int]: ... + def ampm(self, name: Text) -> Optional[int]: ... + def pertain(self, name: Text) -> bool: ... + def utczone(self, name: Text) -> bool: ... + def tzoffset(self, name: Text) -> Optional[int]: ... + def convertyear(self, year: int) -> int: ... + def validate(self, res: datetime) -> bool: ... + +class parser(object): + def __init__(self, info: Optional[parserinfo] = ...) -> None: ... + def parse(self, timestr: _FileOrStr, + default: Optional[datetime] = ..., + ignoretz: bool = ..., tzinfos: Optional[Mapping[Text, tzinfo]] = ..., + **kwargs: Any) -> datetime: ... + +def isoparse(dt_str: Union[str, bytes, IO[str], IO[bytes]]) -> datetime: ... + +DEFAULTPARSER: parser +def parse(timestr: _FileOrStr, parserinfo: Optional[parserinfo] = ..., **kwargs: Any) -> datetime: ... +class _tzparser: ... + +DEFAULTTZPARSER: _tzparser + +class InvalidDatetimeError(ValueError): ... +class InvalidDateError(InvalidDatetimeError): ... +class InvalidTimeError(InvalidDatetimeError): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/dateutil/relativedelta.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/dateutil/relativedelta.pyi new file mode 100644 index 0000000..40ee586 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/dateutil/relativedelta.pyi @@ -0,0 +1,91 @@ +from typing import overload, Any, List, Optional, SupportsFloat, TypeVar, Union +from datetime import date, datetime, timedelta + +from ._common import weekday + + +_SelfT = TypeVar('_SelfT', bound=relativedelta) +_DateT = TypeVar('_DateT', date, datetime) +# Work around attribute and type having the same name. +_weekday = weekday + +MO: weekday +TU: weekday +WE: weekday +TH: weekday +FR: weekday +SA: weekday +SU: weekday + + +class relativedelta(object): + years: int + months: int + days: int + leapdays: int + hours: int + minutes: int + seconds: int + microseconds: int + year: Optional[int] + month: Optional[int] + weekday: Optional[_weekday] + day: Optional[int] + hour: Optional[int] + minute: Optional[int] + second: Optional[int] + microsecond: Optional[int] + def __init__(self, + dt1: Optional[date] = ..., + dt2: Optional[date] = ..., + years: Optional[int] = ..., months: Optional[int] = ..., + days: Optional[int] = ..., leapdays: Optional[int] = ..., + weeks: Optional[int] = ..., + hours: Optional[int] = ..., minutes: Optional[int] = ..., + seconds: Optional[int] = ..., microseconds: Optional[int] = ..., + year: Optional[int] = ..., month: Optional[int] = ..., + day: Optional[int] = ..., + weekday: Optional[Union[int, _weekday]] = ..., + yearday: Optional[int] = ..., + nlyearday: Optional[int] = ..., + hour: Optional[int] = ..., minute: Optional[int] = ..., + second: Optional[int] = ..., + microsecond: Optional[int] = ...) -> None: ... + @property + def weeks(self) -> int: ... + @weeks.setter + def weeks(self, value: int) -> None: ... + def normalized(self: _SelfT) -> _SelfT: ... + # TODO: use Union when mypy will handle it properly in overloaded operator + # methods (#2129, #1442, #1264 in mypy) + @overload + def __add__(self: _SelfT, other: relativedelta) -> _SelfT: ... + @overload + def __add__(self: _SelfT, other: timedelta) -> _SelfT: ... + @overload + def __add__(self, other: _DateT) -> _DateT: ... + @overload + def __radd__(self: _SelfT, other: relativedelta) -> _SelfT: ... + @overload + def __radd__(self: _SelfT, other: timedelta) -> _SelfT: ... + @overload + def __radd__(self, other: _DateT) -> _DateT: ... + @overload + def __rsub__(self: _SelfT, other: relativedelta) -> _SelfT: ... + @overload + def __rsub__(self: _SelfT, other: timedelta) -> _SelfT: ... + @overload + def __rsub__(self, other: _DateT) -> _DateT: ... + def __sub__(self: _SelfT, other: relativedelta) -> _SelfT: ... + def __neg__(self: _SelfT) -> _SelfT: ... + def __bool__(self) -> bool: ... + def __nonzero__(self) -> bool: ... + def __mul__(self: _SelfT, other: SupportsFloat) -> _SelfT: ... + def __rmul__(self: _SelfT, other: SupportsFloat) -> _SelfT: ... + def __eq__(self, other) -> bool: ... + def __ne__(self, other: object) -> bool: ... + def __div__(self: _SelfT, other: SupportsFloat) -> _SelfT: ... + def __truediv__(self: _SelfT, other: SupportsFloat) -> _SelfT: ... + def __repr__(self) -> str: ... + def __abs__(self: _SelfT) -> _SelfT: ... + def __hash__(self) -> int: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/dateutil/rrule.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/dateutil/rrule.pyi new file mode 100644 index 0000000..f8ab9d2 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/dateutil/rrule.pyi @@ -0,0 +1,103 @@ +from ._common import weekday as weekdaybase +from typing import Any, Iterable, Optional, Union +import datetime + +YEARLY: int +MONTHLY: int +WEEKLY: int +DAILY: int +HOURLY: int +MINUTELY: int +SECONDLY: int + +class weekday(weekdaybase): + ... + +MO: weekday +TU: weekday +WE: weekday +TH: weekday +FR: weekday +SA: weekday +SU: weekday + +class rrulebase: + def __init__(self, cache: bool = ...) -> None: ... + def __iter__(self): ... + def __getitem__(self, item): ... + def __contains__(self, item): ... + def count(self): ... + def before(self, dt, inc: bool = ...): ... + def after(self, dt, inc: bool = ...): ... + def xafter(self, dt, count: Optional[Any] = ..., inc: bool = ...): ... + def between(self, after, before, inc: bool = ..., count: int = ...): ... + +class rrule(rrulebase): + def __init__(self, + freq, + dtstart: Optional[datetime.datetime] = ..., + interval: int = ..., + wkst: Optional[Union[weekday, int]] = ..., + count: Optional[int] = ..., + until: Optional[Union[datetime.datetime, int]] = ..., + bysetpos: Optional[Union[int, Iterable[int]]] = ..., + bymonth: Optional[Union[int, Iterable[int]]] = ..., + bymonthday: Optional[Union[int, Iterable[int]]] = ..., + byyearday: Optional[Union[int, Iterable[int]]] = ..., + byeaster: Optional[Union[int, Iterable[int]]] = ..., + byweekno: Optional[Union[int, Iterable[int]]] = ..., + byweekday: Optional[Union[int, Iterable[int]]] = ..., + byhour: Optional[Union[int, Iterable[int]]] = ..., + byminute: Optional[Union[int, Iterable[int]]] = ..., + bysecond: Optional[Union[int, Iterable[int]]] = ..., + cache: bool = ...) -> None: ... + def replace(self, **kwargs): ... + +class _iterinfo: + rrule: Any = ... + def __init__(self, rrule) -> None: ... + yearlen: int = ... + nextyearlen: int = ... + yearordinal: int = ... + yearweekday: int = ... + mmask: Any = ... + mdaymask: Any = ... + nmdaymask: Any = ... + wdaymask: Any = ... + mrange: Any = ... + wnomask: Any = ... + nwdaymask: Any = ... + eastermask: Any = ... + lastyear: int = ... + lastmonth: int = ... + def rebuild(self, year, month): ... + def ydayset(self, year, month, day): ... + def mdayset(self, year, month, day): ... + def wdayset(self, year, month, day): ... + def ddayset(self, year, month, day): ... + def htimeset(self, hour, minute, second): ... + def mtimeset(self, hour, minute, second): ... + def stimeset(self, hour, minute, second): ... + +class rruleset(rrulebase): + class _genitem: + dt: Any = ... + genlist: Any = ... + gen: Any = ... + def __init__(self, genlist, gen) -> None: ... + def __next__(self): ... + next: Any = ... + def __lt__(self, other): ... + def __gt__(self, other): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + def __init__(self, cache: bool = ...) -> None: ... + def rrule(self, rrule): ... + def rdate(self, rdate): ... + def exrule(self, exrule): ... + def exdate(self, exdate): ... + +class _rrulestr: + def __call__(self, s, **kwargs): ... + +rrulestr: _rrulestr diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/dateutil/tz/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/dateutil/tz/__init__.pyi new file mode 100644 index 0000000..5a5e45f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/dateutil/tz/__init__.pyi @@ -0,0 +1,15 @@ +from .tz import ( + tzutc as tzutc, + tzoffset as tzoffset, + tzlocal as tzlocal, + tzfile as tzfile, + tzrange as tzrange, + tzstr as tzstr, + tzical as tzical, + gettz as gettz, + datetime_exists as datetime_exists, + datetime_ambiguous as datetime_ambiguous, + resolve_imaginary as resolve_imaginary, +) + +UTC: tzutc diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/dateutil/tz/_common.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/dateutil/tz/_common.pyi new file mode 100644 index 0000000..32b06ed --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/dateutil/tz/_common.pyi @@ -0,0 +1,24 @@ +from typing import Any, Optional +from datetime import datetime, tzinfo, timedelta + +def tzname_in_python2(namefunc): ... +def enfold(dt: datetime, fold: int = ...): ... + +class _DatetimeWithFold(datetime): + @property + def fold(self): ... + +class _tzinfo(tzinfo): + def is_ambiguous(self, dt: datetime) -> bool: ... + def fromutc(self, dt: datetime) -> datetime: ... + +class tzrangebase(_tzinfo): + def __init__(self) -> None: ... + def utcoffset(self, dt: Optional[datetime]) -> Optional[timedelta]: ... + def dst(self, dt: Optional[datetime]) -> Optional[timedelta]: ... + def tzname(self, dt: Optional[datetime]) -> str: ... + def fromutc(self, dt: datetime) -> datetime: ... + def is_ambiguous(self, dt: datetime) -> bool: ... + __hash__: Any + def __ne__(self, other): ... + __reduce__: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/dateutil/tz/tz.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/dateutil/tz/tz.pyi new file mode 100644 index 0000000..7139507 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/dateutil/tz/tz.pyi @@ -0,0 +1,96 @@ +from typing import Any, Optional, Union, IO, Text, Tuple, List +import datetime +from ._common import tzname_in_python2 as tzname_in_python2, _tzinfo as _tzinfo +from ._common import tzrangebase as tzrangebase, enfold as enfold +from ..relativedelta import relativedelta + +_FileObj = Union[str, Text, IO[str], IO[Text]] + +ZERO: datetime.timedelta +EPOCH: datetime.datetime +EPOCHORDINAL: int + +class tzutc(datetime.tzinfo): + def utcoffset(self, dt: Optional[datetime.datetime]) -> Optional[datetime.timedelta]: ... + def dst(self, dt: Optional[datetime.datetime]) -> Optional[datetime.timedelta]: ... + def tzname(self, dt: Optional[datetime.datetime]) -> str: ... + def is_ambiguous(self, dt: Optional[datetime.datetime]) -> bool: ... + def __eq__(self, other): ... + __hash__: Any + def __ne__(self, other): ... + __reduce__: Any + +class tzoffset(datetime.tzinfo): + def __init__(self, name, offset) -> None: ... + def utcoffset(self, dt: Optional[datetime.datetime]) -> Optional[datetime.timedelta]: ... + def dst(self, dt: Optional[datetime.datetime]) -> Optional[datetime.timedelta]: ... + def is_ambiguous(self, dt: Optional[datetime.datetime]) -> bool: ... + def tzname(self, dt: Optional[datetime.datetime]) -> str: ... + def __eq__(self, other): ... + __hash__: Any + def __ne__(self, other): ... + __reduce__: Any + + @classmethod + def instance(cls, name, offset) -> tzoffset: ... + +class tzlocal(_tzinfo): + def __init__(self) -> None: ... + def utcoffset(self, dt: Optional[datetime.datetime]) -> Optional[datetime.timedelta]: ... + def dst(self, dt: Optional[datetime.datetime]) -> Optional[datetime.timedelta]: ... + def tzname(self, dt: Optional[datetime.datetime]) -> str: ... + def is_ambiguous(self, dt: Optional[datetime.datetime]) -> bool: ... + def __eq__(self, other): ... + __hash__: Any + def __ne__(self, other): ... + __reduce__: Any + +class _ttinfo: + def __init__(self) -> None: ... + def __eq__(self, other): ... + __hash__: Any + def __ne__(self, other): ... + +class tzfile(_tzinfo): + def __init__(self, fileobj: _FileObj, filename: Optional[Text] = ...) -> None: ... + def is_ambiguous(self, dt: Optional[datetime.datetime], idx: Optional[int] = ...) -> bool: ... + def utcoffset(self, dt: Optional[datetime.datetime]) -> Optional[datetime.timedelta]: ... + def dst(self, dt: Optional[datetime.datetime]) -> Optional[datetime.timedelta]: ... + def tzname(self, dt: Optional[datetime.datetime]) -> str: ... + def __eq__(self, other): ... + __hash__: Any + def __ne__(self, other): ... + def __reduce__(self): ... + def __reduce_ex__(self, protocol): ... + +class tzrange(tzrangebase): + hasdst: bool + def __init__(self, stdabbr: Text, stdoffset: Union[int, datetime.timedelta, None] = ..., dstabbr: Optional[Text] = ..., dstoffset: Union[int, datetime.timedelta, None] = ..., start: Optional[relativedelta] = ..., end: Optional[relativedelta] = ...) -> None: ... + def transitions(self, year: int) -> Tuple[datetime.datetime, datetime.datetime]: ... + def __eq__(self, other): ... + +class tzstr(tzrange): + hasdst: bool + def __init__(self, s: Union[bytes, _FileObj], posix_offset: bool = ...) -> None: ... + + @classmethod + def instance(cls, name, offset) -> tzoffset: ... + +class tzical: + def __init__(self, fileobj: _FileObj) -> None: ... + def keys(self): ... + def get(self, tzid: Optional[Any] = ...): ... + +TZFILES: List[str] +TZPATHS: List[str] + +def datetime_exists(dt: datetime.datetime, tz: Optional[datetime.tzinfo] = ...) -> bool: ... +def datetime_ambiguous(dt: datetime.datetime, tz: Optional[datetime.tzinfo] = ...) -> bool: ... +def resolve_imaginary(dt: datetime.datetime) -> datetime.datetime: ... + + +class _GetTZ: + def __call__(self, name: Optional[Text] = ...) -> Optional[datetime.tzinfo]: ... + def nocache(self, name: Optional[Text]) -> Optional[datetime.tzinfo]: ... + +gettz: _GetTZ diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/dateutil/utils.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/dateutil/utils.pyi new file mode 100644 index 0000000..b722053 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/dateutil/utils.pyi @@ -0,0 +1,7 @@ +from typing import Optional +from datetime import datetime, tzinfo, timedelta + + +def default_tzinfo(dt: datetime, tzinfo: tzinfo) -> datetime: ... +def today(tzinfo: Optional[tzinfo] = ...) -> datetime: ... +def within_delta(dt1: datetime, dt2: datetime, delta: timedelta) -> bool: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/emoji.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/emoji.pyi new file mode 100644 index 0000000..fe193b1 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/emoji.pyi @@ -0,0 +1,18 @@ +from typing import Tuple, Pattern, List, Dict, Union + +_DEFAULT_DELIMITER: str + +def emojize( + string: str, + use_aliases: bool = ..., + delimiters: Tuple[str, str] = ... +) -> str: ... + +def demojize( + string: str, + delimiters: Tuple[str, str] = ... +) -> str: ... + +def get_emoji_regexp() -> Pattern: ... + +def emoji_lis(string: str) -> List[Dict[str, Union[int, str]]]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/first.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/first.pyi new file mode 100644 index 0000000..f03f3a3 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/first.pyi @@ -0,0 +1,13 @@ +from typing import Any, Callable, Iterable, Optional, overload, TypeVar, Union + +_T = TypeVar('_T') +_S = TypeVar('_S') + +@overload +def first(iterable: Iterable[_T]) -> Optional[_T]: ... +@overload +def first(iterable: Iterable[_T], default: _S) -> Union[_T, _S]: ... +@overload +def first(iterable: Iterable[_T], default: _S, key: Optional[Callable[[_T], Any]]) -> Union[_T, _S]: ... +@overload +def first(iterable: Iterable[_T], *, key: Optional[Callable[[_T], Any]]) -> Optional[_T]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/flask/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/flask/__init__.pyi new file mode 100644 index 0000000..caeac5e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/flask/__init__.pyi @@ -0,0 +1,45 @@ +# Stubs for flask (Python 3.6) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from .app import Flask as Flask +from .blueprints import Blueprint as Blueprint +from .config import Config as Config +from .ctx import after_this_request as after_this_request +from .ctx import copy_current_request_context as copy_current_request_context +from .ctx import has_app_context as has_app_context +from .ctx import has_request_context as has_request_context +from .globals import current_app as current_app +from .globals import g as g +from .globals import request as request +from .globals import session as session +from .helpers import flash as flash +from .helpers import get_flashed_messages as get_flashed_messages +from .helpers import get_template_attribute as get_template_attribute +from .helpers import make_response as make_response +from .helpers import safe_join as safe_join +from .helpers import send_file as send_file +from .helpers import send_from_directory as send_from_directory +from .helpers import stream_with_context as stream_with_context +from .helpers import url_for as url_for +from .json import jsonify as jsonify +from .signals import appcontext_popped as appcontext_popped +from .signals import appcontext_pushed as appcontext_pushed +from .signals import appcontext_tearing_down as appcontext_tearing_down +from .signals import before_render_template as before_render_template +from .signals import got_request_exception as got_request_exception +from .signals import message_flashed as message_flashed +from .signals import request_finished as request_finished +from .signals import request_started as request_started +from .signals import request_tearing_down as request_tearing_down +from .signals import signals_available as signals_available +from .signals import template_rendered as template_rendered +from .templating import render_template as render_template +from .templating import render_template_string as render_template_string +from .wrappers import Request as Request +from .wrappers import Response as Response + +from werkzeug.exceptions import abort as abort +from werkzeug.utils import redirect as redirect +from jinja2 import Markup as Markup +from jinja2 import escape as escape diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/flask/app.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/flask/app.pyi new file mode 100644 index 0000000..5be3d6d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/flask/app.pyi @@ -0,0 +1,148 @@ +# Stubs for flask.app (Python 3.6) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from .blueprints import Blueprint +from .config import Config, ConfigAttribute +from .ctx import AppContext, RequestContext, _AppCtxGlobals +from .globals import _request_ctx_stack, g, request, session +from .helpers import _PackageBoundObject, find_package, get_debug_flag, get_env, get_flashed_messages, get_load_dotenv, locked_cached_property, url_for +from .logging import create_logger +from .sessions import SecureCookieSessionInterface +from .signals import appcontext_tearing_down, got_request_exception, request_finished, request_started, request_tearing_down +from .templating import DispatchingJinjaLoader, Environment +from .wrappers import Request, Response +from .testing import FlaskClient +from typing import Any, Callable, ContextManager, Dict, List, Optional, Type, TypeVar, Union, Text +from datetime import timedelta + +def setupmethod(f: Any): ... + +_T = TypeVar('_T') + +class Flask(_PackageBoundObject): + request_class: type = ... + response_class: type = ... + jinja_environment: type = ... + app_ctx_globals_class: type = ... + config_class: Type[Config] = ... + testing: Any = ... + secret_key: Union[Text, bytes, None] = ... + session_cookie_name: Any = ... + permanent_session_lifetime: timedelta = ... + send_file_max_age_default: timedelta = ... + use_x_sendfile: Any = ... + json_encoder: Any = ... + json_decoder: Any = ... + jinja_options: Any = ... + default_config: Any = ... + url_rule_class: type = ... + test_client_class: type = ... + test_cli_runner_class: type = ... + session_interface: Any = ... + import_name: str = ... + template_folder: str = ... + root_path: Optional[Union[str, Text]] = ... + static_url_path: Any = ... + static_folder: Optional[str] = ... + instance_path: Union[str, Text] = ... + config: Config = ... + view_functions: Any = ... + error_handler_spec: Any = ... + url_build_error_handlers: Any = ... + before_request_funcs: Dict[Optional[str], List[Callable[[], Any]]] = ... + before_first_request_funcs: List[Callable[[], None]] = ... + after_request_funcs: Dict[Optional[str], List[Callable[[Response], Response]]] = ... + teardown_request_funcs: Dict[Optional[str], List[Callable[[Optional[Exception]], Any]]] = ... + teardown_appcontext_funcs: List[Callable[[Optional[Exception]], Any]] = ... + url_value_preprocessors: Any = ... + url_default_functions: Any = ... + template_context_processors: Any = ... + shell_context_processors: Any = ... + blueprints: Any = ... + extensions: Any = ... + url_map: Any = ... + subdomain_matching: Any = ... + cli: Any = ... + def __init__(self, import_name: str, static_url_path: Optional[str] = ..., static_folder: Optional[str] = ..., static_host: Optional[str] = ..., host_matching: bool = ..., subdomain_matching: bool = ..., template_folder: str = ..., instance_path: Optional[str] = ..., instance_relative_config: bool = ..., root_path: Optional[str] = ...) -> None: ... + @property + def name(self) -> str: ... + @property + def propagate_exceptions(self) -> bool: ... + @property + def preserve_context_on_exception(self): ... + @property + def logger(self): ... + @property + def jinja_env(self): ... + @property + def got_first_request(self) -> bool: ... + def make_config(self, instance_relative: bool = ...): ... + def auto_find_instance_path(self): ... + def open_instance_resource(self, resource: Union[str, Text], mode: str = ...): ... + templates_auto_reload: Any = ... + def create_jinja_environment(self): ... + def create_global_jinja_loader(self): ... + def select_jinja_autoescape(self, filename: Any): ... + def update_template_context(self, context: Any) -> None: ... + def make_shell_context(self): ... + env: Optional[str] = ... + debug: bool = ... + def run(self, host: Optional[str] = ..., port: Optional[Union[int, str]] = ..., debug: Optional[bool] = ..., load_dotenv: bool = ..., **options: Any) -> None: ... + def test_client(self, use_cookies: bool = ..., **kwargs: Any) -> FlaskClient: ... + def test_cli_runner(self, **kwargs: Any): ... + def open_session(self, request: Any): ... + def save_session(self, session: Any, response: Any): ... + def make_null_session(self): ... + def register_blueprint(self, blueprint: Blueprint, **options: Any) -> None: ... + def iter_blueprints(self): ... + def add_url_rule(self, rule: str, endpoint: Optional[str] = ..., view_func: Callable[..., Any] = ..., provide_automatic_options: Optional[bool] = ..., **options: Any) -> None: ... + def route(self, rule: str, **options: Any) -> Callable[[Callable[..., _T]], Callable[..., _T]]: ... + def endpoint(self, endpoint: str) -> Callable[[Callable[..., _T]], Callable[..., _T]]: ... + def errorhandler(self, code_or_exception: Union[int, Type[Exception]]) -> Callable[[Callable[..., _T]], Callable[..., _T]]: ... + def register_error_handler(self, code_or_exception: Union[int, Type[Exception]], f: Callable[..., Any]) -> None: ... + def template_filter(self, name: Optional[Any] = ...): ... + def add_template_filter(self, f: Any, name: Optional[Any] = ...) -> None: ... + def template_test(self, name: Optional[Any] = ...): ... + def add_template_test(self, f: Any, name: Optional[Any] = ...) -> None: ... + def template_global(self, name: Optional[Any] = ...): ... + def add_template_global(self, f: Any, name: Optional[Any] = ...) -> None: ... + def before_request(self, f: Callable[[], _T]) -> Callable[[], _T]: ... + def before_first_request(self, f: Callable[[], _T]) -> Callable[[], _T]: ... + def after_request(self, f: Callable[[Response], Response]) -> Callable[[Response], Response]: ... + def teardown_request(self, f: Callable[[Optional[Exception]], _T]) -> Callable[[Optional[Exception]], _T]: ... + def teardown_appcontext(self, f: Callable[[Optional[Exception]], _T]) -> Callable[[Optional[Exception]], _T]: ... + def context_processor(self, f: Any): ... + def shell_context_processor(self, f: Any): ... + def url_value_preprocessor(self, f: Any): ... + def url_defaults(self, f: Any): ... + def handle_http_exception(self, e: Any): ... + def trap_http_exception(self, e: Any): ... + def handle_user_exception(self, e: Any): ... + def handle_exception(self, e: Any): ... + def log_exception(self, exc_info: Any) -> None: ... + def raise_routing_exception(self, request: Any) -> None: ... + def dispatch_request(self): ... + def full_dispatch_request(self): ... + def finalize_request(self, rv: Any, from_error_handler: bool = ...): ... + def try_trigger_before_first_request_functions(self): ... + def make_default_options_response(self): ... + def should_ignore_error(self, error: Any): ... + def make_response(self, rv: Any): ... + def create_url_adapter(self, request: Any): ... + def inject_url_defaults(self, endpoint: Any, values: Any) -> None: ... + def handle_url_build_error(self, error: Any, endpoint: Any, values: Any): ... + def preprocess_request(self): ... + def process_response(self, response: Any): ... + def do_teardown_request(self, exc: Any = ...) -> None: ... + def do_teardown_appcontext(self, exc: Any = ...) -> None: ... + def app_context(self): ... + def request_context(self, environ: Any): ... + def test_request_context(self, *args: Any, **kwargs: Any) -> ContextManager[RequestContext]: ... + def wsgi_app(self, environ: Any, start_response: Any): ... + def __call__(self, environ: Any, start_response: Any): ... + + # These are not preset at runtime but we add them since monkeypatching this + # class is quite common. + def __setattr__(self, name: str, value: Any): ... + def __getattr__(self, name: str): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/flask/blueprints.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/flask/blueprints.pyi new file mode 100644 index 0000000..d43f8e4 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/flask/blueprints.pyi @@ -0,0 +1,64 @@ +# Stubs for flask.blueprints (Python 3.6) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from .helpers import _PackageBoundObject +from typing import Any, Callable, Optional, Type, TypeVar, Union + +_T = TypeVar('_T') + +class BlueprintSetupState: + app: Any = ... + blueprint: Any = ... + options: Any = ... + first_registration: Any = ... + subdomain: Any = ... + url_prefix: Any = ... + url_defaults: Any = ... + def __init__(self, blueprint: Any, app: Any, options: Any, first_registration: Any) -> None: ... + def add_url_rule(self, rule: str, endpoint: Optional[str] = ..., view_func: Callable[..., Any] = ..., **options: Any) -> None: ... + +class Blueprint(_PackageBoundObject): + warn_on_modifications: bool = ... + json_encoder: Any = ... + json_decoder: Any = ... + import_name: str = ... + template_folder: Optional[str] = ... + root_path: str = ... + name: str = ... + url_prefix: Optional[str] = ... + subdomain: Optional[str] = ... + static_folder: Optional[str] = ... + static_url_path: Optional[str] = ... + deferred_functions: Any = ... + url_values_defaults: Any = ... + def __init__(self, name: str, import_name: str, static_folder: Optional[str] = ..., static_url_path: Optional[str] = ..., template_folder: Optional[str] = ..., url_prefix: Optional[str] = ..., subdomain: Optional[str] = ..., url_defaults: Optional[Any] = ..., root_path: Optional[str] = ...) -> None: ... + def record(self, func: Any) -> None: ... + def record_once(self, func: Any): ... + def make_setup_state(self, app: Any, options: Any, first_registration: bool = ...): ... + def register(self, app: Any, options: Any, first_registration: bool = ...) -> None: ... + def route(self, rule: str, **options: Any) -> Callable[[Callable[..., Any]], Callable[..., Any]]: ... + def add_url_rule(self, rule: str, endpoint: Optional[str] = ..., view_func: Callable[..., Any] = ..., **options: Any) -> None: ... + def endpoint(self, endpoint: str) -> Callable[[Callable[..., _T]], Callable[..., _T]]: ... + def app_template_filter(self, name: Optional[Any] = ...): ... + def add_app_template_filter(self, f: Any, name: Optional[Any] = ...) -> None: ... + def app_template_test(self, name: Optional[Any] = ...): ... + def add_app_template_test(self, f: Any, name: Optional[Any] = ...) -> None: ... + def app_template_global(self, name: Optional[Any] = ...): ... + def add_app_template_global(self, f: Any, name: Optional[Any] = ...) -> None: ... + def before_request(self, f: Any): ... + def before_app_request(self, f: Any): ... + def before_app_first_request(self, f: Any): ... + def after_request(self, f: Any): ... + def after_app_request(self, f: Any): ... + def teardown_request(self, f: Any): ... + def teardown_app_request(self, f: Any): ... + def context_processor(self, f: Any): ... + def app_context_processor(self, f: Any): ... + def app_errorhandler(self, code: Any): ... + def url_value_preprocessor(self, f: Any): ... + def url_defaults(self, f: Any): ... + def app_url_value_preprocessor(self, f: Any): ... + def app_url_defaults(self, f: Any): ... + def errorhandler(self, code_or_exception: Union[int, Type[Exception]]) -> Callable[[Callable[..., _T]], Callable[..., _T]]: ... + def register_error_handler(self, code_or_exception: Union[int, Type[Exception]], f: Callable[..., Any]) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/flask/cli.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/flask/cli.pyi new file mode 100644 index 0000000..15d3243 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/flask/cli.pyi @@ -0,0 +1,64 @@ +# Stubs for flask.cli (Python 3.6) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +import click +from .globals import current_app +from .helpers import get_debug_flag, get_env, get_load_dotenv +from typing import Any, Optional + +class NoAppException(click.UsageError): ... + +def find_best_app(script_info: Any, module: Any): ... +def call_factory(script_info: Any, app_factory: Any, arguments: Any = ...): ... +def find_app_by_string(script_info: Any, module: Any, app_name: Any): ... +def prepare_import(path: Any): ... +def locate_app(script_info: Any, module_name: Any, app_name: Any, raise_if_not_found: bool = ...): ... +def get_version(ctx: Any, param: Any, value: Any): ... + +version_option: Any + +class DispatchingApp: + loader: Any = ... + def __init__(self, loader: Any, use_eager_loading: bool = ...) -> None: ... + def __call__(self, environ: Any, start_response: Any): ... + +class ScriptInfo: + app_import_path: Any = ... + create_app: Any = ... + data: Any = ... + def __init__(self, app_import_path: Optional[Any] = ..., create_app: Optional[Any] = ...) -> None: ... + def load_app(self): ... + +pass_script_info: Any + +def with_appcontext(f: Any): ... + +class AppGroup(click.Group): + def command(self, *args: Any, **kwargs: Any): ... + def group(self, *args: Any, **kwargs: Any): ... + +class FlaskGroup(AppGroup): + create_app: Any = ... + load_dotenv: Any = ... + def __init__(self, add_default_commands: bool = ..., create_app: Optional[Any] = ..., add_version_option: bool = ..., load_dotenv: bool = ..., **extra: Any) -> None: ... + def get_command(self, ctx: Any, name: Any): ... + def list_commands(self, ctx: Any): ... + def main(self, *args: Any, **kwargs: Any): ... + +def load_dotenv(path: Optional[Any] = ...): ... +def show_server_banner(env: Any, debug: Any, app_import_path: Any, eager_loading: Any): ... + +class CertParamType(click.ParamType): + name: str = ... + path_type: Any = ... + def __init__(self) -> None: ... + def convert(self, value: Any, param: Any, ctx: Any): ... + +def run_command(info: Any, host: Any, port: Any, reload: Any, debugger: Any, eager_loading: Any, with_threads: Any, cert: Any) -> None: ... +def shell_command() -> None: ... +def routes_command(sort: Any, all_methods: Any): ... + +cli: Any + +def main(as_module: bool = ...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/flask/config.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/flask/config.pyi new file mode 100644 index 0000000..6b925e7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/flask/config.pyi @@ -0,0 +1,22 @@ +# Stubs for flask.config (Python 3.6) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from typing import Any, Optional, Dict + +class ConfigAttribute: + __name__: Any = ... + get_converter: Any = ... + def __init__(self, name: Any, get_converter: Optional[Any] = ...) -> None: ... + def __get__(self, obj: Any, type: Optional[Any] = ...): ... + def __set__(self, obj: Any, value: Any) -> None: ... + +class Config(Dict[str, Any]): + root_path: Any = ... + def __init__(self, root_path: Any, defaults: Optional[Any] = ...) -> None: ... + def from_envvar(self, variable_name: Any, silent: bool = ...): ... + def from_pyfile(self, filename: Any, silent: bool = ...): ... + def from_object(self, obj: Any) -> None: ... + def from_json(self, filename: Any, silent: bool = ...): ... + def from_mapping(self, *mapping: Any, **kwargs: Any): ... + def get_namespace(self, namespace: Any, lowercase: bool = ..., trim_namespace: bool = ...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/flask/ctx.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/flask/ctx.pyi new file mode 100644 index 0000000..09fdea3 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/flask/ctx.pyi @@ -0,0 +1,46 @@ +# Stubs for flask.ctx (Python 3.6) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from .globals import _app_ctx_stack, _request_ctx_stack +from .signals import appcontext_popped, appcontext_pushed +from typing import Any, Optional + +class _AppCtxGlobals: + def get(self, name: Any, default: Optional[Any] = ...): ... + def pop(self, name: Any, default: Any = ...): ... + def setdefault(self, name: Any, default: Optional[Any] = ...): ... + def __contains__(self, item: Any): ... + def __iter__(self): ... + +def after_this_request(f: Any): ... +def copy_current_request_context(f: Any): ... +def has_request_context(): ... +def has_app_context(): ... + +class AppContext: + app: Any = ... + url_adapter: Any = ... + g: Any = ... + def __init__(self, app: Any) -> None: ... + def push(self) -> None: ... + def pop(self, exc: Any = ...) -> None: ... + def __enter__(self): ... + def __exit__(self, exc_type: Any, exc_value: Any, tb: Any) -> None: ... + +class RequestContext: + app: Any = ... + request: Any = ... + url_adapter: Any = ... + flashes: Any = ... + session: Any = ... + preserved: bool = ... + def __init__(self, app: Any, environ: Any, request: Optional[Any] = ...) -> None: ... + g: Any = ... + def copy(self): ... + def match_request(self) -> None: ... + def push(self) -> None: ... + def pop(self, exc: Any = ...) -> None: ... + def auto_pop(self, exc: Any) -> None: ... + def __enter__(self): ... + def __exit__(self, exc_type: Any, exc_value: Any, tb: Any) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/flask/debughelpers.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/flask/debughelpers.pyi new file mode 100644 index 0000000..5a4cbea --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/flask/debughelpers.pyi @@ -0,0 +1,21 @@ +# Stubs for flask.debughelpers (Python 3.6) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from .app import Flask +from .blueprints import Blueprint +from .globals import _request_ctx_stack +from typing import Any + +class UnexpectedUnicodeError(AssertionError, UnicodeError): ... + +class DebugFilesKeyError(KeyError, AssertionError): + msg: Any = ... + def __init__(self, request: Any, key: Any) -> None: ... + +class FormDataRoutingRedirect(AssertionError): + def __init__(self, request: Any) -> None: ... + +def attach_enctype_error_multidict(request: Any): ... +def explain_template_loading_attempts(app: Any, template: Any, attempts: Any) -> None: ... +def explain_ignored_app_run() -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/flask/globals.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/flask/globals.pyi new file mode 100644 index 0000000..8ce1caf --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/flask/globals.pyi @@ -0,0 +1,18 @@ +# Stubs for flask.globals (Python 3.6) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from .app import Flask +from .wrappers import Request +from typing import Any +from werkzeug.local import LocalStack + +class _FlaskLocalProxy(Flask): + def _get_current_object(self) -> Flask: ... + +_request_ctx_stack: LocalStack +_app_ctx_stack: LocalStack +current_app: _FlaskLocalProxy +request: Request +session: Any +g: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/flask/helpers.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/flask/helpers.pyi new file mode 100644 index 0000000..726f8a0 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/flask/helpers.pyi @@ -0,0 +1,48 @@ +# Stubs for flask.helpers (Python 3.6) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from .globals import _app_ctx_stack, _request_ctx_stack, current_app, request, session +from .signals import message_flashed +from typing import Any, Optional + +def get_env(): ... +def get_debug_flag(): ... +def get_load_dotenv(default: bool = ...): ... +def stream_with_context(generator_or_function: Any): ... +def make_response(*args: Any): ... +def url_for(endpoint: Any, **values: Any): ... +def get_template_attribute(template_name: Any, attribute: Any): ... +def flash(message: Any, category: str = ...) -> None: ... +def get_flashed_messages(with_categories: bool = ..., category_filter: Any = ...): ... +def send_file(filename_or_fp: Any, mimetype: Optional[Any] = ..., as_attachment: bool = ..., attachment_filename: Optional[Any] = ..., add_etags: bool = ..., cache_timeout: Optional[Any] = ..., conditional: bool = ..., last_modified: Optional[Any] = ...): ... +def safe_join(directory: Any, *pathnames: Any): ... +def send_from_directory(directory: Any, filename: Any, **options: Any): ... +def get_root_path(import_name: Any): ... +def find_package(import_name: Any): ... + +class locked_cached_property: + __name__: Any = ... + __module__: Any = ... + __doc__: Any = ... + func: Any = ... + lock: Any = ... + def __init__(self, func: Any, name: Optional[Any] = ..., doc: Optional[Any] = ...) -> None: ... + def __get__(self, obj: Any, type: Optional[Any] = ...): ... + +class _PackageBoundObject: + import_name: Any = ... + template_folder: Any = ... + root_path: Any = ... + def __init__(self, import_name: Any, template_folder: Optional[Any] = ..., root_path: Optional[Any] = ...) -> None: ... + static_folder: Any = ... + static_url_path: Any = ... + @property + def has_static_folder(self): ... + def jinja_loader(self): ... + def get_send_file_max_age(self, filename: Any): ... + def send_static_file(self, filename: Any): ... + def open_resource(self, resource: Any, mode: str = ...): ... + +def total_seconds(td: Any): ... +def is_ip(value: Any): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/flask/json/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/flask/json/__init__.pyi new file mode 100644 index 0000000..24047ea --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/flask/json/__init__.pyi @@ -0,0 +1,19 @@ +# Stubs for flask.json (Python 3.6) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +import json as _json +from typing import Any + +class JSONEncoder(_json.JSONEncoder): + def default(self, o: Any): ... + +class JSONDecoder(_json.JSONDecoder): ... + +def dumps(obj: Any, **kwargs: Any): ... +def dump(obj: Any, fp: Any, **kwargs: Any) -> None: ... +def loads(s: Any, **kwargs: Any): ... +def load(fp: Any, **kwargs: Any): ... +def htmlsafe_dumps(obj: Any, **kwargs: Any): ... +def htmlsafe_dump(obj: Any, fp: Any, **kwargs: Any) -> None: ... +def jsonify(*args: Any, **kwargs: Any): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/flask/json/tag.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/flask/json/tag.pyi new file mode 100644 index 0000000..b1648dc --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/flask/json/tag.pyi @@ -0,0 +1,71 @@ +# Stubs for flask.json.tag (Python 3.6) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from typing import Any, Optional + +class JSONTag: + key: Any = ... + serializer: Any = ... + def __init__(self, serializer: Any) -> None: ... + def check(self, value: Any) -> None: ... + def to_json(self, value: Any) -> None: ... + def to_python(self, value: Any) -> None: ... + def tag(self, value: Any): ... + +class TagDict(JSONTag): + key: str = ... + def check(self, value: Any): ... + def to_json(self, value: Any): ... + def to_python(self, value: Any): ... + +class PassDict(JSONTag): + def check(self, value: Any): ... + def to_json(self, value: Any): ... + tag: Any = ... + +class TagTuple(JSONTag): + key: str = ... + def check(self, value: Any): ... + def to_json(self, value: Any): ... + def to_python(self, value: Any): ... + +class PassList(JSONTag): + def check(self, value: Any): ... + def to_json(self, value: Any): ... + tag: Any = ... + +class TagBytes(JSONTag): + key: str = ... + def check(self, value: Any): ... + def to_json(self, value: Any): ... + def to_python(self, value: Any): ... + +class TagMarkup(JSONTag): + key: str = ... + def check(self, value: Any): ... + def to_json(self, value: Any): ... + def to_python(self, value: Any): ... + +class TagUUID(JSONTag): + key: str = ... + def check(self, value: Any): ... + def to_json(self, value: Any): ... + def to_python(self, value: Any): ... + +class TagDateTime(JSONTag): + key: str = ... + def check(self, value: Any): ... + def to_json(self, value: Any): ... + def to_python(self, value: Any): ... + +class TaggedJSONSerializer: + default_tags: Any = ... + tags: Any = ... + order: Any = ... + def __init__(self) -> None: ... + def register(self, tag_class: Any, force: bool = ..., index: Optional[Any] = ...) -> None: ... + def tag(self, value: Any): ... + def untag(self, value: Any): ... + def dumps(self, value: Any): ... + def loads(self, value: Any): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/flask/logging.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/flask/logging.pyi new file mode 100644 index 0000000..e43d51d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/flask/logging.pyi @@ -0,0 +1,13 @@ +# Stubs for flask.logging (Python 3.6) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from .globals import request +from typing import Any + +def wsgi_errors_stream(): ... +def has_level_handler(logger: Any): ... + +default_handler: Any + +def create_logger(app: Any): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/flask/sessions.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/flask/sessions.pyi new file mode 100644 index 0000000..b0d238d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/flask/sessions.pyi @@ -0,0 +1,60 @@ +# Stubs for flask.sessions (Python 3.6) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from abc import ABCMeta +from typing import Any, MutableMapping, Optional +from werkzeug.datastructures import CallbackDict + +class SessionMixin(MutableMapping, metaclass=ABCMeta): + @property + def permanent(self): ... + @permanent.setter + def permanent(self, value: Any) -> None: ... + new: bool = ... + modified: bool = ... + accessed: bool = ... + +class SecureCookieSession(CallbackDict, SessionMixin): + modified: bool = ... + accessed: bool = ... + def __init__(self, initial: Optional[Any] = ...) -> None: ... + def __getitem__(self, key: Any): ... + def get(self, key: Any, default: Optional[Any] = ...): ... + def setdefault(self, key: Any, default: Optional[Any] = ...): ... + +class NullSession(SecureCookieSession): + __setitem__: Any = ... + __delitem__: Any = ... + clear: Any = ... + pop: Any = ... + popitem: Any = ... + update: Any = ... + setdefault: Any = ... + +class SessionInterface: + null_session_class: Any = ... + pickle_based: bool = ... + def make_null_session(self, app: Any): ... + def is_null_session(self, obj: Any): ... + def get_cookie_domain(self, app: Any): ... + def get_cookie_path(self, app: Any): ... + def get_cookie_httponly(self, app: Any): ... + def get_cookie_secure(self, app: Any): ... + def get_cookie_samesite(self, app: Any): ... + def get_expiration_time(self, app: Any, session: Any): ... + def should_set_cookie(self, app: Any, session: Any): ... + def open_session(self, app: Any, request: Any) -> None: ... + def save_session(self, app: Any, session: Any, response: Any) -> None: ... + +session_json_serializer: Any + +class SecureCookieSessionInterface(SessionInterface): + salt: str = ... + digest_method: Any = ... + key_derivation: str = ... + serializer: Any = ... + session_class: Any = ... + def get_signing_serializer(self, app: Any): ... + def open_session(self, app: Any, request: Any): ... + def save_session(self, app: Any, session: Any, response: Any): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/flask/signals.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/flask/signals.pyi new file mode 100644 index 0000000..0aa7ac3 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/flask/signals.pyi @@ -0,0 +1,33 @@ +# Stubs for flask.signals (Python 3.6) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from typing import Any, Optional + +signals_available: bool + +class Namespace: + def signal(self, name: Any, doc: Optional[Any] = ...): ... + +class _FakeSignal: + name: Any = ... + __doc__: Any = ... + def __init__(self, name: Any, doc: Optional[Any] = ...) -> None: ... + send: Any = ... + connect: Any = ... + disconnect: Any = ... + has_receivers_for: Any = ... + receivers_for: Any = ... + temporarily_connected_to: Any = ... + connected_to: Any = ... + +template_rendered: Any +before_render_template: Any +request_started: Any +request_finished: Any +request_tearing_down: Any +got_request_exception: Any +appcontext_tearing_down: Any +appcontext_pushed: Any +appcontext_popped: Any +message_flashed: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/flask/templating.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/flask/templating.pyi new file mode 100644 index 0000000..1da102d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/flask/templating.pyi @@ -0,0 +1,21 @@ +# Stubs for flask.templating (Python 3.6) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from .globals import _app_ctx_stack, _request_ctx_stack +from .signals import before_render_template, template_rendered +from jinja2 import BaseLoader, Environment as BaseEnvironment +from typing import Any + +class Environment(BaseEnvironment): + app: Any = ... + def __init__(self, app: Any, **options: Any) -> None: ... + +class DispatchingJinjaLoader(BaseLoader): + app: Any = ... + def __init__(self, app: Any) -> None: ... + def get_source(self, environment: Any, template: Any): ... + def list_templates(self): ... + +def render_template(template_name_or_list: Any, **context: Any): ... +def render_template_string(source: Any, **context: Any): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/flask/testing.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/flask/testing.pyi new file mode 100644 index 0000000..813eeca --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/flask/testing.pyi @@ -0,0 +1,34 @@ +# Stubs for flask.testing (Python 3.6) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from click import BaseCommand +from click.testing import CliRunner, Result +from typing import Any, IO, Iterable, Mapping, Optional, Union +from werkzeug.test import Client + +def make_test_environ_builder(app: Any, path: str = ..., base_url: Optional[Any] = ..., subdomain: Optional[Any] = ..., url_scheme: Optional[Any] = ..., *args: Any, **kwargs: Any): ... + +class FlaskClient(Client): + preserve_context: bool = ... + environ_base: Any = ... + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + def session_transaction(self, *args: Any, **kwargs: Any) -> None: ... + def open(self, *args: Any, **kwargs: Any): ... + def __enter__(self): ... + def __exit__(self, exc_type: Any, exc_value: Any, tb: Any) -> None: ... + +class FlaskCliRunner(CliRunner): + app: Any = ... + def __init__(self, app: Any, **kwargs: Any) -> None: ... + def invoke( + self, + cli: Optional[BaseCommand] = ..., + args: Optional[Union[str, Iterable[str]]] = ..., + input: Optional[IO] = ..., + env: Optional[Mapping[str, str]] = ..., + catch_exceptions: bool = ..., + color: bool = ..., + **extra: Any, + ) -> Result: + ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/flask/views.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/flask/views.pyi new file mode 100644 index 0000000..a2637b3 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/flask/views.pyi @@ -0,0 +1,22 @@ +# Stubs for flask.views (Python 3.6) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from .globals import request +from typing import Any + +http_method_funcs: Any + +class View: + methods: Any = ... + provide_automatic_options: Any = ... + decorators: Any = ... + def dispatch_request(self, *args: Any, **kwargs: Any) -> Any: ... + @classmethod + def as_view(cls, name: Any, *class_args: Any, **class_kwargs: Any): ... + +class MethodViewType(type): + def __init__(self, name: Any, bases: Any, d: Any) -> None: ... + +class MethodView(View, metaclass=MethodViewType): + def dispatch_request(self, *args: Any, **kwargs: Any) -> Any: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/flask/wrappers.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/flask/wrappers.pyi new file mode 100644 index 0000000..df8869e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/flask/wrappers.pyi @@ -0,0 +1,35 @@ +# Stubs for flask.wrappers (Python 3.6) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from typing import Any, Dict, Optional +from werkzeug.exceptions import HTTPException +from werkzeug.routing import Rule +from werkzeug.wrappers import Request as RequestBase, Response as ResponseBase + +class JSONMixin: + @property + def is_json(self) -> bool: ... + @property + def json(self): ... + def get_json(self, force: bool = ..., silent: bool = ..., cache: bool = ...): ... + def on_json_loading_failed(self, e: Any) -> None: ... + +class Request(RequestBase, JSONMixin): + url_rule: Optional[Rule] = ... + view_args: Dict[str, Any] = ... + routing_exception: Optional[HTTPException] = ... + # Request is making the max_content_length readonly, where it was not the + # case in its supertype. + # We would require something like https://github.com/python/typing/issues/241 + @property + def max_content_length(self) -> Optional[int]: ... # type: ignore + @property + def endpoint(self) -> Optional[str]: ... + @property + def blueprint(self) -> Optional[str]: ... + +class Response(ResponseBase, JSONMixin): + default_mimetype: str = ... + @property + def max_cookie_size(self) -> int: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/__init__.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/__init__.pyi new file mode 100644 index 0000000..aae1f93 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/__init__.pyi @@ -0,0 +1 @@ +__version__: bytes diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/any_pb2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/any_pb2.pyi new file mode 100644 index 0000000..c2a7295 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/any_pb2.pyi @@ -0,0 +1,22 @@ +from google.protobuf.message import ( + Message, +) +from google.protobuf.internal import well_known_types + +from typing import ( + Optional, + Text, +) + + +class Any(Message, well_known_types.Any_): + type_url: Text + value: bytes + + def __init__(self, + type_url: Optional[Text] = ..., + value: Optional[bytes] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> Any: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/any_test_pb2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/any_test_pb2.pyi new file mode 100644 index 0000000..d352bad --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/any_test_pb2.pyi @@ -0,0 +1,32 @@ +from google.protobuf.any_pb2 import ( + Any, +) +from google.protobuf.internal.containers import ( + RepeatedCompositeFieldContainer, +) +from google.protobuf.message import ( + Message, +) +from typing import ( + Iterable, + Optional, +) + + +class TestAny(Message): + int32_value: int + + @property + def any_value(self) -> Any: ... + + @property + def repeated_any_value(self) -> RepeatedCompositeFieldContainer[Any]: ... + + def __init__(self, + int32_value: Optional[int] = ..., + any_value: Optional[Any] = ..., + repeated_any_value: Optional[Iterable[Any]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAny: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/api_pb2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/api_pb2.pyi new file mode 100644 index 0000000..3646878 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/api_pb2.pyi @@ -0,0 +1,87 @@ +from google.protobuf.internal.containers import ( + RepeatedCompositeFieldContainer, +) +from google.protobuf.message import ( + Message, +) +from google.protobuf.source_context_pb2 import ( + SourceContext, +) +from google.protobuf.type_pb2 import ( + Option, + Syntax, +) +from typing import ( + Iterable, + Optional, + Text, +) + + +class Api(Message): + name: Text + version: Text + syntax: Syntax + + @property + def methods(self) -> RepeatedCompositeFieldContainer[Method]: ... + + @property + def options(self) -> RepeatedCompositeFieldContainer[Option]: ... + + @property + def source_context(self) -> SourceContext: ... + + @property + def mixins(self) -> RepeatedCompositeFieldContainer[Mixin]: ... + + def __init__(self, + name: Optional[Text] = ..., + methods: Optional[Iterable[Method]] = ..., + options: Optional[Iterable[Option]] = ..., + version: Optional[Text] = ..., + source_context: Optional[SourceContext] = ..., + mixins: Optional[Iterable[Mixin]] = ..., + syntax: Optional[Syntax] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> Api: ... + + +class Method(Message): + name: Text + request_type_url: Text + request_streaming: bool + response_type_url: Text + response_streaming: bool + syntax: Syntax + + @property + def options(self) -> RepeatedCompositeFieldContainer[Option]: ... + + def __init__(self, + name: Optional[Text] = ..., + request_type_url: Optional[Text] = ..., + request_streaming: Optional[bool] = ..., + response_type_url: Optional[Text] = ..., + response_streaming: Optional[bool] = ..., + options: Optional[Iterable[Option]] = ..., + syntax: Optional[Syntax] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> Method: ... + + +class Mixin(Message): + name: Text + root: Text + + def __init__(self, + name: Optional[Text] = ..., + root: Optional[Text] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> Mixin: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/compiler/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/compiler/__init__.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/compiler/plugin_pb2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/compiler/plugin_pb2.pyi new file mode 100644 index 0000000..d1037fa --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/compiler/plugin_pb2.pyi @@ -0,0 +1,82 @@ +from google.protobuf.descriptor_pb2 import ( + FileDescriptorProto, +) +from google.protobuf.internal.containers import ( + RepeatedCompositeFieldContainer, + RepeatedScalarFieldContainer, +) +from google.protobuf.message import ( + Message, +) +from typing import ( + Iterable, + Optional, + Text, +) + + +class Version(Message): + major: int + minor: int + patch: int + suffix: Text + + def __init__(self, + major: Optional[int] = ..., + minor: Optional[int] = ..., + patch: Optional[int] = ..., + suffix: Optional[Text] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> Version: ... + + +class CodeGeneratorRequest(Message): + file_to_generate: RepeatedScalarFieldContainer[Text] + parameter: Text + + @property + def proto_file(self) -> RepeatedCompositeFieldContainer[FileDescriptorProto]: ... + + @property + def compiler_version(self) -> Version: ... + + def __init__(self, + file_to_generate: Optional[Iterable[Text]] = ..., + parameter: Optional[Text] = ..., + proto_file: Optional[Iterable[FileDescriptorProto]] = ..., + compiler_version: Optional[Version] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> CodeGeneratorRequest: ... + + +class CodeGeneratorResponse(Message): + + class File(Message): + name: Text + insertion_point: Text + content: Text + + def __init__(self, + name: Optional[Text] = ..., + insertion_point: Optional[Text] = ..., + content: Optional[Text] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> CodeGeneratorResponse.File: ... + error: Text + + @property + def file(self) -> RepeatedCompositeFieldContainer[CodeGeneratorResponse.File]: ... + + def __init__(self, + error: Optional[Text] = ..., + file: Optional[Iterable[CodeGeneratorResponse.File]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> CodeGeneratorResponse: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/descriptor.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/descriptor.pyi new file mode 100644 index 0000000..44352c6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/descriptor.pyi @@ -0,0 +1,182 @@ +from typing import Any + +from .message import Message +from .descriptor_pb2 import ( + EnumOptions, + EnumValueOptions, + FieldOptions, + FileOptions, + MessageOptions, + MethodOptions, + OneofOptions, + ServiceOptions, +) + +class Error(Exception): ... +class TypeTransformationError(Error): ... + +class DescriptorMetaclass(type): + def __instancecheck__(self, obj): ... + +class DescriptorBase(metaclass=DescriptorMetaclass): + has_options: Any + def __init__(self, options, options_class_name) -> None: ... + def GetOptions(self): ... + +class _NestedDescriptorBase(DescriptorBase): + name: Any + full_name: Any + file: Any + containing_type: Any + def __init__(self, options, options_class_name, name, full_name, file, containing_type, serialized_start=..., serialized_end=...) -> None: ... + def GetTopLevelContainingType(self): ... + def CopyToProto(self, proto): ... + +class Descriptor(_NestedDescriptorBase): + def __new__(cls, name, full_name, filename, containing_type, fields, nested_types, enum_types, extensions, options=..., is_extendable=..., extension_ranges=..., oneofs=..., file=..., serialized_start=..., serialized_end=..., syntax=...): ... + fields: Any + fields_by_number: Any + fields_by_name: Any + nested_types: Any + nested_types_by_name: Any + enum_types: Any + enum_types_by_name: Any + enum_values_by_name: Any + extensions: Any + extensions_by_name: Any + is_extendable: Any + extension_ranges: Any + oneofs: Any + oneofs_by_name: Any + syntax: Any + def __init__(self, name, full_name, filename, containing_type, fields, nested_types, enum_types, extensions, options=..., is_extendable=..., extension_ranges=..., oneofs=..., file=..., serialized_start=..., serialized_end=..., syntax=...) -> None: ... + def EnumValueName(self, enum, value): ... + def CopyToProto(self, proto): ... + def GetOptions(self) -> MessageOptions: ... + +class FieldDescriptor(DescriptorBase): + TYPE_DOUBLE: Any + TYPE_FLOAT: Any + TYPE_INT64: Any + TYPE_UINT64: Any + TYPE_INT32: Any + TYPE_FIXED64: Any + TYPE_FIXED32: Any + TYPE_BOOL: Any + TYPE_STRING: Any + TYPE_GROUP: Any + TYPE_MESSAGE: Any + TYPE_BYTES: Any + TYPE_UINT32: Any + TYPE_ENUM: Any + TYPE_SFIXED32: Any + TYPE_SFIXED64: Any + TYPE_SINT32: Any + TYPE_SINT64: Any + MAX_TYPE: Any + CPPTYPE_INT32: Any + CPPTYPE_INT64: Any + CPPTYPE_UINT32: Any + CPPTYPE_UINT64: Any + CPPTYPE_DOUBLE: Any + CPPTYPE_FLOAT: Any + CPPTYPE_BOOL: Any + CPPTYPE_ENUM: Any + CPPTYPE_STRING: Any + CPPTYPE_MESSAGE: Any + MAX_CPPTYPE: Any + LABEL_OPTIONAL: Any + LABEL_REQUIRED: Any + LABEL_REPEATED: Any + MAX_LABEL: Any + MAX_FIELD_NUMBER: Any + FIRST_RESERVED_FIELD_NUMBER: Any + LAST_RESERVED_FIELD_NUMBER: Any + def __new__(cls, name, full_name, index, number, type, cpp_type, label, default_value, message_type, enum_type, containing_type, is_extension, extension_scope, options=..., file=..., has_default_value=..., containing_oneof=...): ... + name: Any + full_name: Any + index: Any + number: Any + type: Any + cpp_type: Any + label: Any + has_default_value: Any + default_value: Any + containing_type: Any + message_type: Any + enum_type: Any + is_extension: Any + extension_scope: Any + containing_oneof: Any + def __init__(self, name, full_name, index, number, type, cpp_type, label, default_value, message_type, enum_type, containing_type, is_extension, extension_scope, options=..., file=..., has_default_value=..., containing_oneof=...) -> None: ... + @staticmethod + def ProtoTypeToCppProtoType(proto_type): ... + def GetOptions(self) -> FieldOptions: ... + +class EnumDescriptor(_NestedDescriptorBase): + def __new__(cls, name, full_name, filename, values, containing_type=..., options=..., file=..., serialized_start=..., serialized_end=...): ... + values: Any + values_by_name: Any + values_by_number: Any + def __init__(self, name, full_name, filename, values, containing_type=..., options=..., file=..., serialized_start=..., serialized_end=...) -> None: ... + def CopyToProto(self, proto): ... + def GetOptions(self) -> EnumOptions: ... + +class EnumValueDescriptor(DescriptorBase): + def __new__(cls, name, index, number, type=..., options=...): ... + name: Any + index: Any + number: Any + type: Any + def __init__(self, name, index, number, type=..., options=...) -> None: ... + def GetOptions(self) -> EnumValueOptions: ... + +class OneofDescriptor: + def __new__(cls, name, full_name, index, containing_type, fields): ... + name: Any + full_name: Any + index: Any + containing_type: Any + fields: Any + def __init__(self, name, full_name, index, containing_type, fields) -> None: ... + def GetOptions(self) -> OneofOptions: ... + +class ServiceDescriptor(_NestedDescriptorBase): + index: Any + methods: Any + methods_by_name: Any + def __init__(self, name, full_name, index, methods, options=..., file=..., serialized_start=..., serialized_end=...) -> None: ... + def FindMethodByName(self, name): ... + def CopyToProto(self, proto): ... + def GetOptions(self) -> ServiceOptions: ... + +class MethodDescriptor(DescriptorBase): + name: Any + full_name: Any + index: Any + containing_service: Any + input_type: Any + output_type: Any + def __init__(self, name, full_name, index, containing_service, input_type, output_type, options=...) -> None: ... + def GetOptions(self) -> MethodOptions: ... + +class FileDescriptor(DescriptorBase): + def __new__(cls, name, package, options=..., serialized_pb=..., dependencies=..., public_dependencies=..., syntax=..., pool=...): ... + _options: Any + pool: Any + message_types_by_name: Any + name: Any + package: Any + syntax: Any + serialized_pb: Any + enum_types_by_name: Any + extensions_by_name: Any + services_by_name: Any + dependencies: Any + public_dependencies: Any + def __init__(self, name, package, options=..., serialized_pb=..., dependencies=..., public_dependencies=..., syntax=..., pool=...) -> None: ... + def CopyToProto(self, proto): ... + def GetOptions(self) -> FileOptions: ... + +def MakeDescriptor(desc_proto, package=..., build_file_if_cpp=..., syntax=...): ... +def _ParseOptions(message: Message, string: bytes) -> Message: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/descriptor_pb2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/descriptor_pb2.pyi new file mode 100644 index 0000000..d0fbcdc --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/descriptor_pb2.pyi @@ -0,0 +1,732 @@ +from google.protobuf.internal.containers import ( + RepeatedCompositeFieldContainer, + RepeatedScalarFieldContainer, +) +from google.protobuf.message import ( + Message, +) +from typing import ( + Iterable, + List, + Optional, + Text, + Tuple, + cast, +) + + +class FileDescriptorSet(Message): + + @property + def file(self) -> RepeatedCompositeFieldContainer[FileDescriptorProto]: ... + + def __init__(self, + file: Optional[Iterable[FileDescriptorProto]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> FileDescriptorSet: ... + + +class FileDescriptorProto(Message): + name: Text + package: Text + dependency: RepeatedScalarFieldContainer[Text] + public_dependency: RepeatedScalarFieldContainer[int] + weak_dependency: RepeatedScalarFieldContainer[int] + syntax: Text + + @property + def message_type( + self) -> RepeatedCompositeFieldContainer[DescriptorProto]: ... + + @property + def enum_type( + self) -> RepeatedCompositeFieldContainer[EnumDescriptorProto]: ... + + @property + def service( + self) -> RepeatedCompositeFieldContainer[ServiceDescriptorProto]: ... + + @property + def extension( + self) -> RepeatedCompositeFieldContainer[FieldDescriptorProto]: ... + + @property + def options(self) -> FileOptions: ... + + @property + def source_code_info(self) -> SourceCodeInfo: ... + + def __init__(self, + name: Optional[Text] = ..., + package: Optional[Text] = ..., + dependency: Optional[Iterable[Text]] = ..., + public_dependency: Optional[Iterable[int]] = ..., + weak_dependency: Optional[Iterable[int]] = ..., + message_type: Optional[Iterable[DescriptorProto]] = ..., + enum_type: Optional[Iterable[EnumDescriptorProto]] = ..., + service: Optional[Iterable[ServiceDescriptorProto]] = ..., + extension: Optional[Iterable[FieldDescriptorProto]] = ..., + options: Optional[FileOptions] = ..., + source_code_info: Optional[SourceCodeInfo] = ..., + syntax: Optional[Text] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> FileDescriptorProto: ... + + +class DescriptorProto(Message): + + class ExtensionRange(Message): + start: int + end: int + + @property + def options(self) -> ExtensionRangeOptions: ... + + def __init__(self, + start: Optional[int] = ..., + end: Optional[int] = ..., + options: Optional[ExtensionRangeOptions] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> DescriptorProto.ExtensionRange: ... + + class ReservedRange(Message): + start: int + end: int + + def __init__(self, + start: Optional[int] = ..., + end: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> DescriptorProto.ReservedRange: ... + name: Text + reserved_name: RepeatedScalarFieldContainer[Text] + + @property + def field( + self) -> RepeatedCompositeFieldContainer[FieldDescriptorProto]: ... + + @property + def extension( + self) -> RepeatedCompositeFieldContainer[FieldDescriptorProto]: ... + + @property + def nested_type( + self) -> RepeatedCompositeFieldContainer[DescriptorProto]: ... + + @property + def enum_type( + self) -> RepeatedCompositeFieldContainer[EnumDescriptorProto]: ... + + @property + def extension_range( + self) -> RepeatedCompositeFieldContainer[DescriptorProto.ExtensionRange]: ... + + @property + def oneof_decl( + self) -> RepeatedCompositeFieldContainer[OneofDescriptorProto]: ... + + @property + def options(self) -> MessageOptions: ... + + @property + def reserved_range( + self) -> RepeatedCompositeFieldContainer[DescriptorProto.ReservedRange]: ... + + def __init__(self, + name: Optional[Text] = ..., + field: Optional[Iterable[FieldDescriptorProto]] = ..., + extension: Optional[Iterable[FieldDescriptorProto]] = ..., + nested_type: Optional[Iterable[DescriptorProto]] = ..., + enum_type: Optional[Iterable[EnumDescriptorProto]] = ..., + extension_range: Optional[Iterable[DescriptorProto.ExtensionRange]] = ..., + oneof_decl: Optional[Iterable[OneofDescriptorProto]] = ..., + options: Optional[MessageOptions] = ..., + reserved_range: Optional[Iterable[DescriptorProto.ReservedRange]] = ..., + reserved_name: Optional[Iterable[Text]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> DescriptorProto: ... + + +class ExtensionRangeOptions(Message): + + @property + def uninterpreted_option( + self) -> RepeatedCompositeFieldContainer[UninterpretedOption]: ... + + def __init__(self, + uninterpreted_option: Optional[Iterable[UninterpretedOption]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> ExtensionRangeOptions: ... + + +class FieldDescriptorProto(Message): + + class Type(int): + + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> FieldDescriptorProto.Type: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[FieldDescriptorProto.Type]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, FieldDescriptorProto.Type]]: ... + TYPE_DOUBLE: FieldDescriptorProto.Type + TYPE_FLOAT: FieldDescriptorProto.Type + TYPE_INT64: FieldDescriptorProto.Type + TYPE_UINT64: FieldDescriptorProto.Type + TYPE_INT32: FieldDescriptorProto.Type + TYPE_FIXED64: FieldDescriptorProto.Type + TYPE_FIXED32: FieldDescriptorProto.Type + TYPE_BOOL: FieldDescriptorProto.Type + TYPE_STRING: FieldDescriptorProto.Type + TYPE_GROUP: FieldDescriptorProto.Type + TYPE_MESSAGE: FieldDescriptorProto.Type + TYPE_BYTES: FieldDescriptorProto.Type + TYPE_UINT32: FieldDescriptorProto.Type + TYPE_ENUM: FieldDescriptorProto.Type + TYPE_SFIXED32: FieldDescriptorProto.Type + TYPE_SFIXED64: FieldDescriptorProto.Type + TYPE_SINT32: FieldDescriptorProto.Type + TYPE_SINT64: FieldDescriptorProto.Type + + class Label(int): + + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> FieldDescriptorProto.Label: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[FieldDescriptorProto.Label]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, FieldDescriptorProto.Label]]: ... + LABEL_OPTIONAL: FieldDescriptorProto.Label + LABEL_REQUIRED: FieldDescriptorProto.Label + LABEL_REPEATED: FieldDescriptorProto.Label + name: Text + number: int + label: FieldDescriptorProto.Label + type: FieldDescriptorProto.Type + type_name: Text + extendee: Text + default_value: Text + oneof_index: int + json_name: Text + + @property + def options(self) -> FieldOptions: ... + + def __init__(self, + name: Optional[Text] = ..., + number: Optional[int] = ..., + label: Optional[FieldDescriptorProto.Label] = ..., + type: Optional[FieldDescriptorProto.Type] = ..., + type_name: Optional[Text] = ..., + extendee: Optional[Text] = ..., + default_value: Optional[Text] = ..., + oneof_index: Optional[int] = ..., + json_name: Optional[Text] = ..., + options: Optional[FieldOptions] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> FieldDescriptorProto: ... + + +class OneofDescriptorProto(Message): + name: Text + + @property + def options(self) -> OneofOptions: ... + + def __init__(self, + name: Optional[Text] = ..., + options: Optional[OneofOptions] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> OneofDescriptorProto: ... + + +class EnumDescriptorProto(Message): + + class EnumReservedRange(Message): + start: int + end: int + + def __init__(self, + start: Optional[int] = ..., + end: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> EnumDescriptorProto.EnumReservedRange: ... + name: Text + reserved_name: RepeatedScalarFieldContainer[Text] + + @property + def value( + self) -> RepeatedCompositeFieldContainer[EnumValueDescriptorProto]: ... + + @property + def options(self) -> EnumOptions: ... + + @property + def reserved_range( + self) -> RepeatedCompositeFieldContainer[EnumDescriptorProto.EnumReservedRange]: ... + + def __init__(self, + name: Optional[Text] = ..., + value: Optional[Iterable[EnumValueDescriptorProto]] = ..., + options: Optional[EnumOptions] = ..., + reserved_range: Optional[Iterable[EnumDescriptorProto.EnumReservedRange]] = ..., + reserved_name: Optional[Iterable[Text]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> EnumDescriptorProto: ... + + +class EnumValueDescriptorProto(Message): + name: Text + number: int + + @property + def options(self) -> EnumValueOptions: ... + + def __init__(self, + name: Optional[Text] = ..., + number: Optional[int] = ..., + options: Optional[EnumValueOptions] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> EnumValueDescriptorProto: ... + + +class ServiceDescriptorProto(Message): + name: Text + + @property + def method( + self) -> RepeatedCompositeFieldContainer[MethodDescriptorProto]: ... + + @property + def options(self) -> ServiceOptions: ... + + def __init__(self, + name: Optional[Text] = ..., + method: Optional[Iterable[MethodDescriptorProto]] = ..., + options: Optional[ServiceOptions] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> ServiceDescriptorProto: ... + + +class MethodDescriptorProto(Message): + name: Text + input_type: Text + output_type: Text + client_streaming: bool + server_streaming: bool + + @property + def options(self) -> MethodOptions: ... + + def __init__(self, + name: Optional[Text] = ..., + input_type: Optional[Text] = ..., + output_type: Optional[Text] = ..., + options: Optional[MethodOptions] = ..., + client_streaming: Optional[bool] = ..., + server_streaming: Optional[bool] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> MethodDescriptorProto: ... + + +class FileOptions(Message): + + class OptimizeMode(int): + + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> FileOptions.OptimizeMode: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[FileOptions.OptimizeMode]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, FileOptions.OptimizeMode]]: ... + SPEED: FileOptions.OptimizeMode + CODE_SIZE: FileOptions.OptimizeMode + LITE_RUNTIME: FileOptions.OptimizeMode + java_package: Text + java_outer_classname: Text + java_multiple_files: bool + java_generate_equals_and_hash: bool + java_string_check_utf8: bool + optimize_for: FileOptions.OptimizeMode + go_package: Text + cc_generic_services: bool + java_generic_services: bool + py_generic_services: bool + php_generic_services: bool + deprecated: bool + cc_enable_arenas: bool + objc_class_prefix: Text + csharp_namespace: Text + swift_prefix: Text + php_class_prefix: Text + php_namespace: Text + + @property + def uninterpreted_option( + self) -> RepeatedCompositeFieldContainer[UninterpretedOption]: ... + + def __init__(self, + java_package: Optional[Text] = ..., + java_outer_classname: Optional[Text] = ..., + java_multiple_files: Optional[bool] = ..., + java_generate_equals_and_hash: Optional[bool] = ..., + java_string_check_utf8: Optional[bool] = ..., + optimize_for: Optional[FileOptions.OptimizeMode] = ..., + go_package: Optional[Text] = ..., + cc_generic_services: Optional[bool] = ..., + java_generic_services: Optional[bool] = ..., + py_generic_services: Optional[bool] = ..., + php_generic_services: Optional[bool] = ..., + deprecated: Optional[bool] = ..., + cc_enable_arenas: Optional[bool] = ..., + objc_class_prefix: Optional[Text] = ..., + csharp_namespace: Optional[Text] = ..., + swift_prefix: Optional[Text] = ..., + php_class_prefix: Optional[Text] = ..., + php_namespace: Optional[Text] = ..., + uninterpreted_option: Optional[Iterable[UninterpretedOption]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> FileOptions: ... + + +class MessageOptions(Message): + message_set_wire_format: bool + no_standard_descriptor_accessor: bool + deprecated: bool + map_entry: bool + + @property + def uninterpreted_option( + self) -> RepeatedCompositeFieldContainer[UninterpretedOption]: ... + + def __init__(self, + message_set_wire_format: Optional[bool] = ..., + no_standard_descriptor_accessor: Optional[bool] = ..., + deprecated: Optional[bool] = ..., + map_entry: Optional[bool] = ..., + uninterpreted_option: Optional[Iterable[UninterpretedOption]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> MessageOptions: ... + + +class FieldOptions(Message): + + class CType(int): + + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> FieldOptions.CType: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[FieldOptions.CType]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, FieldOptions.CType]]: ... + STRING: FieldOptions.CType + CORD: FieldOptions.CType + STRING_PIECE: FieldOptions.CType + + class JSType(int): + + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> FieldOptions.JSType: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[FieldOptions.JSType]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, FieldOptions.JSType]]: ... + JS_NORMAL: FieldOptions.JSType + JS_STRING: FieldOptions.JSType + JS_NUMBER: FieldOptions.JSType + ctype: FieldOptions.CType + packed: bool + jstype: FieldOptions.JSType + lazy: bool + deprecated: bool + weak: bool + + @property + def uninterpreted_option( + self) -> RepeatedCompositeFieldContainer[UninterpretedOption]: ... + + def __init__(self, + ctype: Optional[FieldOptions.CType] = ..., + packed: Optional[bool] = ..., + jstype: Optional[FieldOptions.JSType] = ..., + lazy: Optional[bool] = ..., + deprecated: Optional[bool] = ..., + weak: Optional[bool] = ..., + uninterpreted_option: Optional[Iterable[UninterpretedOption]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> FieldOptions: ... + + +class OneofOptions(Message): + + @property + def uninterpreted_option( + self) -> RepeatedCompositeFieldContainer[UninterpretedOption]: ... + + def __init__(self, + uninterpreted_option: Optional[Iterable[UninterpretedOption]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> OneofOptions: ... + + +class EnumOptions(Message): + allow_alias: bool + deprecated: bool + + @property + def uninterpreted_option( + self) -> RepeatedCompositeFieldContainer[UninterpretedOption]: ... + + def __init__(self, + allow_alias: Optional[bool] = ..., + deprecated: Optional[bool] = ..., + uninterpreted_option: Optional[Iterable[UninterpretedOption]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> EnumOptions: ... + + +class EnumValueOptions(Message): + deprecated: bool + + @property + def uninterpreted_option( + self) -> RepeatedCompositeFieldContainer[UninterpretedOption]: ... + + def __init__(self, + deprecated: Optional[bool] = ..., + uninterpreted_option: Optional[Iterable[UninterpretedOption]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> EnumValueOptions: ... + + +class ServiceOptions(Message): + deprecated: bool + + @property + def uninterpreted_option( + self) -> RepeatedCompositeFieldContainer[UninterpretedOption]: ... + + def __init__(self, + deprecated: Optional[bool] = ..., + uninterpreted_option: Optional[Iterable[UninterpretedOption]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> ServiceOptions: ... + + +class MethodOptions(Message): + + class IdempotencyLevel(int): + + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> MethodOptions.IdempotencyLevel: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[MethodOptions.IdempotencyLevel]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, MethodOptions.IdempotencyLevel]]: ... + IDEMPOTENCY_UNKNOWN: MethodOptions.IdempotencyLevel + NO_SIDE_EFFECTS: MethodOptions.IdempotencyLevel + IDEMPOTENT: MethodOptions.IdempotencyLevel + deprecated: bool + idempotency_level: MethodOptions.IdempotencyLevel + + @property + def uninterpreted_option( + self) -> RepeatedCompositeFieldContainer[UninterpretedOption]: ... + + def __init__(self, + deprecated: Optional[bool] = ..., + idempotency_level: Optional[MethodOptions.IdempotencyLevel] = ..., + uninterpreted_option: Optional[Iterable[UninterpretedOption]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> MethodOptions: ... + + +class UninterpretedOption(Message): + + class NamePart(Message): + name_part: Text + is_extension: bool + + def __init__(self, + name_part: Text, + is_extension: bool, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> UninterpretedOption.NamePart: ... + identifier_value: Text + positive_int_value: int + negative_int_value: int + double_value: float + string_value: bytes + aggregate_value: Text + + @property + def name( + self) -> RepeatedCompositeFieldContainer[UninterpretedOption.NamePart]: ... + + def __init__(self, + name: Optional[Iterable[UninterpretedOption.NamePart]] = ..., + identifier_value: Optional[Text] = ..., + positive_int_value: Optional[int] = ..., + negative_int_value: Optional[int] = ..., + double_value: Optional[float] = ..., + string_value: Optional[bytes] = ..., + aggregate_value: Optional[Text] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> UninterpretedOption: ... + + +class SourceCodeInfo(Message): + + class Location(Message): + path: RepeatedScalarFieldContainer[int] + span: RepeatedScalarFieldContainer[int] + leading_comments: Text + trailing_comments: Text + leading_detached_comments: RepeatedScalarFieldContainer[Text] + + def __init__(self, + path: Optional[Iterable[int]] = ..., + span: Optional[Iterable[int]] = ..., + leading_comments: Optional[Text] = ..., + trailing_comments: Optional[Text] = ..., + leading_detached_comments: Optional[Iterable[Text]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> SourceCodeInfo.Location: ... + + @property + def location( + self) -> RepeatedCompositeFieldContainer[SourceCodeInfo.Location]: ... + + def __init__(self, + location: Optional[Iterable[SourceCodeInfo.Location]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> SourceCodeInfo: ... + + +class GeneratedCodeInfo(Message): + + class Annotation(Message): + path: RepeatedScalarFieldContainer[int] + source_file: Text + begin: int + end: int + + def __init__(self, + path: Optional[Iterable[int]] = ..., + source_file: Optional[Text] = ..., + begin: Optional[int] = ..., + end: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> GeneratedCodeInfo.Annotation: ... + + @property + def annotation( + self) -> RepeatedCompositeFieldContainer[GeneratedCodeInfo.Annotation]: ... + + def __init__(self, + annotation: Optional[Iterable[GeneratedCodeInfo.Annotation]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> GeneratedCodeInfo: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/descriptor_pool.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/descriptor_pool.pyi new file mode 100644 index 0000000..f1ade52 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/descriptor_pool.pyi @@ -0,0 +1,18 @@ +from typing import Any, Optional + +class DescriptorPool: + def __new__(cls, descriptor_db: Optional[Any] = ...): ... + def __init__(self, descriptor_db: Optional[Any] = ...) -> None: ... + def Add(self, file_desc_proto): ... + def AddSerializedFile(self, serialized_file_desc_proto): ... + def AddDescriptor(self, desc): ... + def AddEnumDescriptor(self, enum_desc): ... + def AddFileDescriptor(self, file_desc): ... + def FindFileByName(self, file_name): ... + def FindFileContainingSymbol(self, symbol): ... + def FindMessageTypeByName(self, full_name): ... + def FindEnumTypeByName(self, full_name): ... + def FindFieldByName(self, full_name): ... + def FindExtensionByName(self, full_name): ... + +def Default(): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/duration_pb2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/duration_pb2.pyi new file mode 100644 index 0000000..378c2e5 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/duration_pb2.pyi @@ -0,0 +1,21 @@ +from google.protobuf.message import ( + Message, +) +from google.protobuf.internal import well_known_types + +from typing import ( + Optional, +) + + +class Duration(Message, well_known_types.Duration): + seconds: int + nanos: int + + def __init__(self, + seconds: Optional[int] = ..., + nanos: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> Duration: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/empty_pb2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/empty_pb2.pyi new file mode 100644 index 0000000..295ebfa --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/empty_pb2.pyi @@ -0,0 +1,12 @@ +from google.protobuf.message import ( + Message, +) + + +class Empty(Message): + + def __init__(self, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> Empty: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/field_mask_pb2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/field_mask_pb2.pyi new file mode 100644 index 0000000..1c96a02 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/field_mask_pb2.pyi @@ -0,0 +1,24 @@ +from google.protobuf.internal.containers import ( + RepeatedScalarFieldContainer, +) +from google.protobuf.internal import well_known_types + +from google.protobuf.message import ( + Message, +) +from typing import ( + Iterable, + Optional, + Text, +) + + +class FieldMask(Message, well_known_types.FieldMask): + paths: RepeatedScalarFieldContainer[Text] + + def __init__(self, + paths: Optional[Iterable[Text]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> FieldMask: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/__init__.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/containers.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/containers.pyi new file mode 100644 index 0000000..33e603c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/containers.pyi @@ -0,0 +1,54 @@ +from google.protobuf.descriptor import Descriptor +from google.protobuf.internal.message_listener import MessageListener +from google.protobuf.message import Message +from typing import ( + Sequence, TypeVar, Generic, Any, Iterator, Iterable, + Union, Optional, Callable, overload, List +) + +_T = TypeVar('_T') +class BaseContainer(Sequence[_T]): + def __init__(self, message_listener: MessageListener) -> None: ... + def __len__(self) -> int: ... + def __ne__(self, other: object) -> bool: ... + def __hash__(self) -> int: ... + def __repr__(self) -> str: ... + def sort(self, *, key: Optional[Callable[[_T], Any]] = ..., reverse: bool = ...) -> None: ... + @overload + def __getitem__(self, key: int) -> _T: ... + @overload + def __getitem__(self, key: slice) -> List[_T]: ... + +class RepeatedScalarFieldContainer(BaseContainer[_T]): + def __init__(self, message_listener: MessageListener, message_descriptor: Descriptor) -> None: ... + def append(self, value: _T) -> None: ... + def insert(self, key: int, value: _T) -> None: ... + def extend(self, elem_seq: Optional[Iterable[_T]]) -> None: ... + def MergeFrom(self, other: RepeatedScalarFieldContainer[_T]) -> None: ... + def remove(self, elem: _T) -> None: ... + def pop(self, key: int = ...) -> _T: ... + @overload + def __setitem__(self, key: int, value: _T) -> None: ... + @overload + def __setitem__(self, key: slice, value: Iterable[_T]) -> None: ... + def __getslice__(self, start: int, stop: int) -> List[_T]: ... + def __setslice__(self, start: int, stop: int, values: Iterable[_T]) -> None: ... + def __delitem__(self, key: Union[int, slice]) -> None: ... + def __delslice__(self, start: int, stop: int) -> None: ... + +class RepeatedCompositeFieldContainer(BaseContainer[_T]): + def __init__(self, message_listener: MessageListener, type_checker: Any) -> None: ... + def add(self, **kwargs: Any) -> _T: ... + def extend(self, elem_seq: Iterable[_T]) -> None: ... + def MergeFrom(self, other: RepeatedCompositeFieldContainer[_T]) -> None: ... + def remove(self, elem: _T) -> None: ... + def pop(self, key: int = ...) -> _T: ... + def __getslice__(self, start: int, stop: int) -> List[_T]: ... + def __delitem__(self, key: Union[int, slice]) -> None: ... + def __delslice__(self, start: int, stop: int) -> None: ... + +# Classes not yet typed +class Mapping(Any): ... +class MutableMapping(Mapping): ... +class ScalarMap(MutableMapping): ... +class MessageMap(MutableMapping): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/decoder.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/decoder.pyi new file mode 100644 index 0000000..24774ee --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/decoder.pyi @@ -0,0 +1,30 @@ +from typing import Any + +def ReadTag(buffer, pos): ... +def EnumDecoder(field_number, is_repeated, is_packed, key, new_default): ... + +Int32Decoder: Any +Int64Decoder: Any +UInt32Decoder: Any +UInt64Decoder: Any +SInt32Decoder: Any +SInt64Decoder: Any +Fixed32Decoder: Any +Fixed64Decoder: Any +SFixed32Decoder: Any +SFixed64Decoder: Any +FloatDecoder: Any +DoubleDecoder: Any +BoolDecoder: Any + +def StringDecoder(field_number, is_repeated, is_packed, key, new_default): ... +def BytesDecoder(field_number, is_repeated, is_packed, key, new_default): ... +def GroupDecoder(field_number, is_repeated, is_packed, key, new_default): ... +def MessageDecoder(field_number, is_repeated, is_packed, key, new_default): ... + +MESSAGE_SET_ITEM_TAG: Any + +def MessageSetItemDecoder(extensions_by_number): ... +def MapDecoder(field_descriptor, new_default, is_message_map): ... + +SkipField: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/encoder.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/encoder.pyi new file mode 100644 index 0000000..7a7923f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/encoder.pyi @@ -0,0 +1,34 @@ +from typing import Any + +Int32Sizer: Any +UInt32Sizer: Any +SInt32Sizer: Any +Fixed32Sizer: Any +Fixed64Sizer: Any +BoolSizer: Any + +def StringSizer(field_number, is_repeated, is_packed): ... +def BytesSizer(field_number, is_repeated, is_packed): ... +def GroupSizer(field_number, is_repeated, is_packed): ... +def MessageSizer(field_number, is_repeated, is_packed): ... +def MessageSetItemSizer(field_number): ... +def MapSizer(field_descriptor): ... +def TagBytes(field_number, wire_type): ... + +Int32Encoder: Any +UInt32Encoder: Any +SInt32Encoder: Any +Fixed32Encoder: Any +Fixed64Encoder: Any +SFixed32Encoder: Any +SFixed64Encoder: Any +FloatEncoder: Any +DoubleEncoder: Any + +def BoolEncoder(field_number, is_repeated, is_packed): ... +def StringEncoder(field_number, is_repeated, is_packed): ... +def BytesEncoder(field_number, is_repeated, is_packed): ... +def GroupEncoder(field_number, is_repeated, is_packed): ... +def MessageEncoder(field_number, is_repeated, is_packed): ... +def MessageSetItemEncoder(field_number): ... +def MapEncoder(field_descriptor): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/enum_type_wrapper.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/enum_type_wrapper.pyi new file mode 100644 index 0000000..61d6ea1 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/enum_type_wrapper.pyi @@ -0,0 +1,11 @@ +from typing import Any, List, Tuple + +class EnumTypeWrapper(object): + def __init__(self, enum_type: Any) -> None: ... + def Name(self, number: int) -> bytes: ... + def Value(self, name: bytes) -> int: ... + def keys(self) -> List[bytes]: ... + def values(self) -> List[int]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, int]]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/message_listener.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/message_listener.pyi new file mode 100644 index 0000000..e8d33a5 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/message_listener.pyi @@ -0,0 +1,5 @@ +class MessageListener(object): + def Modified(self) -> None: ... + +class NullMessageListener(MessageListener): + def Modified(self) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/well_known_types.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/well_known_types.pyi new file mode 100644 index 0000000..91a42a3 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/well_known_types.pyi @@ -0,0 +1,92 @@ +from typing import Any, Optional +from datetime import datetime + +class Error(Exception): ... +class ParseError(Error): ... + +# This is named 'Any' in the original, but that conflicts with typing.Any, +# and we really only need this file to mix in. +class Any_: + type_url: Any = ... + value: Any = ... + def Pack(self, msg: Any, type_url_prefix: bytes = ..., deterministic: Optional[Any] = ...) -> None: ... + def Unpack(self, msg: Any): ... + def TypeName(self): ... + def Is(self, descriptor: Any): ... + +class Timestamp: + def ToJsonString(self) -> str: ... + seconds: Any = ... + nanos: Any = ... + def FromJsonString(self, value: Any) -> None: ... + def GetCurrentTime(self) -> None: ... + def ToNanoseconds(self): ... + def ToMicroseconds(self): ... + def ToMilliseconds(self): ... + def ToSeconds(self): ... + def FromNanoseconds(self, nanos: Any) -> None: ... + def FromMicroseconds(self, micros: Any) -> None: ... + def FromMilliseconds(self, millis: Any) -> None: ... + def FromSeconds(self, seconds: Any) -> None: ... + def ToDatetime(self) -> datetime: ... + def FromDatetime(self, dt: datetime) -> None: ... + +class Duration: + def ToJsonString(self) -> str: ... + seconds: Any = ... + nanos: Any = ... + def FromJsonString(self, value: Any) -> None: ... + def ToNanoseconds(self): ... + def ToMicroseconds(self): ... + def ToMilliseconds(self): ... + def ToSeconds(self): ... + def FromNanoseconds(self, nanos: Any) -> None: ... + def FromMicroseconds(self, micros: Any) -> None: ... + def FromMilliseconds(self, millis: Any) -> None: ... + def FromSeconds(self, seconds: Any) -> None: ... + def ToTimedelta(self): ... + def FromTimedelta(self, td: Any) -> None: ... + +class FieldMask: + def ToJsonString(self) -> str: ... + def FromJsonString(self, value: Any) -> None: ... + def IsValidForDescriptor(self, message_descriptor: Any): ... + def AllFieldsFromDescriptor(self, message_descriptor: Any) -> None: ... + def CanonicalFormFromMask(self, mask: Any) -> None: ... + def Union(self, mask1: Any, mask2: Any) -> None: ... + def Intersect(self, mask1: Any, mask2: Any) -> None: ... + def MergeMessage(self, source: Any, destination: Any, replace_message_field: bool = ..., replace_repeated_field: bool = ...) -> None: ... + +class _FieldMaskTree: + def __init__(self, field_mask: Optional[Any] = ...) -> None: ... + def MergeFromFieldMask(self, field_mask: Any) -> None: ... + def AddPath(self, path: Any): ... + def ToFieldMask(self, field_mask: Any) -> None: ... + def IntersectPath(self, path: Any, intersection: Any): ... + def AddLeafNodes(self, prefix: Any, node: Any) -> None: ... + def MergeMessage(self, source: Any, destination: Any, replace_message: Any, replace_repeated: Any) -> None: ... + +class Struct: + def __getitem__(self, key: Any): ... + def __contains__(self, item: Any): ... + def __setitem__(self, key: Any, value: Any) -> None: ... + def __delitem__(self, key: Any) -> None: ... + def __len__(self): ... + def __iter__(self): ... + def keys(self): ... + def values(self): ... + def items(self): ... + def get_or_create_list(self, key: Any): ... + def get_or_create_struct(self, key: Any): ... + def update(self, dictionary: Any) -> None: ... + +class ListValue: + def __len__(self): ... + def append(self, value: Any) -> None: ... + def extend(self, elem_seq: Any) -> None: ... + def __getitem__(self, index: Any): ... + def __setitem__(self, index: Any, value: Any) -> None: ... + def __delitem__(self, key: Any) -> None: ... + def items(self) -> None: ... + def add_struct(self): ... + def add_list(self): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/wire_format.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/wire_format.pyi new file mode 100644 index 0000000..3dcbd04 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/wire_format.pyi @@ -0,0 +1,50 @@ +from typing import Any + +TAG_TYPE_BITS: Any +TAG_TYPE_MASK: Any +WIRETYPE_VARINT: Any +WIRETYPE_FIXED64: Any +WIRETYPE_LENGTH_DELIMITED: Any +WIRETYPE_START_GROUP: Any +WIRETYPE_END_GROUP: Any +WIRETYPE_FIXED32: Any +INT32_MAX: Any +INT32_MIN: Any +UINT32_MAX: Any +INT64_MAX: Any +INT64_MIN: Any +UINT64_MAX: Any +FORMAT_UINT32_LITTLE_ENDIAN: Any +FORMAT_UINT64_LITTLE_ENDIAN: Any +FORMAT_FLOAT_LITTLE_ENDIAN: Any +FORMAT_DOUBLE_LITTLE_ENDIAN: Any + +def PackTag(field_number, wire_type): ... +def UnpackTag(tag): ... +def ZigZagEncode(value): ... +def ZigZagDecode(value): ... +def Int32ByteSize(field_number, int32): ... +def Int32ByteSizeNoTag(int32): ... +def Int64ByteSize(field_number, int64): ... +def UInt32ByteSize(field_number, uint32): ... +def UInt64ByteSize(field_number, uint64): ... +def SInt32ByteSize(field_number, int32): ... +def SInt64ByteSize(field_number, int64): ... +def Fixed32ByteSize(field_number, fixed32): ... +def Fixed64ByteSize(field_number, fixed64): ... +def SFixed32ByteSize(field_number, sfixed32): ... +def SFixed64ByteSize(field_number, sfixed64): ... +def FloatByteSize(field_number, flt): ... +def DoubleByteSize(field_number, double): ... +def BoolByteSize(field_number, b): ... +def EnumByteSize(field_number, enum): ... +def StringByteSize(field_number, string): ... +def BytesByteSize(field_number, b): ... +def GroupByteSize(field_number, message): ... +def MessageByteSize(field_number, message): ... +def MessageSetItemByteSize(field_number, msg): ... +def TagByteSize(field_number): ... + +NON_PACKABLE_TYPES: Any + +def IsTypePackable(field_type): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/json_format.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/json_format.pyi new file mode 100644 index 0000000..e61ccb8 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/json_format.pyi @@ -0,0 +1,31 @@ +import sys +from typing import Any, Dict, Text, TypeVar, Union +from google.protobuf.message import Message + +_MessageVar = TypeVar('_MessageVar', bound=Message) + +class Error(Exception): ... + +class ParseError(Error): ... + +class SerializeToJsonError(Error): ... + +def MessageToJson( + message: Message, + including_default_value_fields: bool = ..., + preserving_proto_field_name: bool = ..., + indent: int = ..., + sort_keys: bool = ..., + use_integers_for_enums: bool = ... +) -> str: ... + +def MessageToDict( + message: Message, + including_default_value_fields: bool = ..., + preserving_proto_field_name: bool = ..., + use_integers_for_enums: bool = ... +) -> Dict[Text, Any]: ... + +def Parse(text: Union[bytes, Text], message: _MessageVar, ignore_unknown_fields: bool = ...) -> _MessageVar: ... + +def ParseDict(js_dict: Any, message: _MessageVar, ignore_unknown_fields: bool = ...) -> _MessageVar: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/map_proto2_unittest_pb2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/map_proto2_unittest_pb2.pyi new file mode 100644 index 0000000..fd12d10 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/map_proto2_unittest_pb2.pyi @@ -0,0 +1,428 @@ +from google.protobuf.message import ( + Message, +) +from google.protobuf.unittest_import_pb2 import ( + ImportEnumForMap, +) +from typing import ( + List, + Mapping, + MutableMapping, + Optional, + Text, + Tuple, + cast, +) + + +class Proto2MapEnum(int): + + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> Proto2MapEnum: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[Proto2MapEnum]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, Proto2MapEnum]]: ... +PROTO2_MAP_ENUM_FOO: Proto2MapEnum +PROTO2_MAP_ENUM_BAR: Proto2MapEnum +PROTO2_MAP_ENUM_BAZ: Proto2MapEnum + + +class Proto2MapEnumPlusExtra(int): + + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> Proto2MapEnumPlusExtra: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[Proto2MapEnumPlusExtra]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, Proto2MapEnumPlusExtra]]: ... +E_PROTO2_MAP_ENUM_FOO: Proto2MapEnumPlusExtra +E_PROTO2_MAP_ENUM_BAR: Proto2MapEnumPlusExtra +E_PROTO2_MAP_ENUM_BAZ: Proto2MapEnumPlusExtra +E_PROTO2_MAP_ENUM_EXTRA: Proto2MapEnumPlusExtra + + +class TestEnumMap(Message): + + class KnownMapFieldEntry(Message): + key: int + value: Proto2MapEnum + + def __init__(self, + key: Optional[int] = ..., + value: Optional[Proto2MapEnum] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestEnumMap.KnownMapFieldEntry: ... + + class UnknownMapFieldEntry(Message): + key: int + value: Proto2MapEnum + + def __init__(self, + key: Optional[int] = ..., + value: Optional[Proto2MapEnum] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestEnumMap.UnknownMapFieldEntry: ... + + @property + def known_map_field(self) -> MutableMapping[int, Proto2MapEnum]: ... + + @property + def unknown_map_field(self) -> MutableMapping[int, Proto2MapEnum]: ... + + def __init__(self, + known_map_field: Optional[Mapping[int, Proto2MapEnum]] = ..., + unknown_map_field: Optional[Mapping[int, Proto2MapEnum]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestEnumMap: ... + + +class TestEnumMapPlusExtra(Message): + + class KnownMapFieldEntry(Message): + key: int + value: Proto2MapEnumPlusExtra + + def __init__(self, + key: Optional[int] = ..., + value: Optional[Proto2MapEnumPlusExtra] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestEnumMapPlusExtra.KnownMapFieldEntry: ... + + class UnknownMapFieldEntry(Message): + key: int + value: Proto2MapEnumPlusExtra + + def __init__(self, + key: Optional[int] = ..., + value: Optional[Proto2MapEnumPlusExtra] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestEnumMapPlusExtra.UnknownMapFieldEntry: ... + + @property + def known_map_field(self) -> MutableMapping[int, Proto2MapEnumPlusExtra]: ... + + @property + def unknown_map_field(self) -> MutableMapping[int, Proto2MapEnumPlusExtra]: ... + + def __init__(self, + known_map_field: Optional[Mapping[int, Proto2MapEnumPlusExtra]] = ..., + unknown_map_field: Optional[Mapping[int, Proto2MapEnumPlusExtra]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestEnumMapPlusExtra: ... + + +class TestImportEnumMap(Message): + + class ImportEnumAmpEntry(Message): + key: int + value: ImportEnumForMap + + def __init__(self, + key: Optional[int] = ..., + value: Optional[ImportEnumForMap] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestImportEnumMap.ImportEnumAmpEntry: ... + + @property + def import_enum_amp(self) -> MutableMapping[int, ImportEnumForMap]: ... + + def __init__(self, + import_enum_amp: Optional[Mapping[int, ImportEnumForMap]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestImportEnumMap: ... + + +class TestIntIntMap(Message): + + class MEntry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestIntIntMap.MEntry: ... + + @property + def m(self) -> MutableMapping[int, int]: ... + + def __init__(self, + m: Optional[Mapping[int, int]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestIntIntMap: ... + + +class TestMaps(Message): + + class MInt32Entry(Message): + key: int + + @property + def value(self) -> TestIntIntMap: ... + + def __init__(self, + key: Optional[int] = ..., + value: Optional[TestIntIntMap] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMaps.MInt32Entry: ... + + class MInt64Entry(Message): + key: int + + @property + def value(self) -> TestIntIntMap: ... + + def __init__(self, + key: Optional[int] = ..., + value: Optional[TestIntIntMap] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMaps.MInt64Entry: ... + + class MUint32Entry(Message): + key: int + + @property + def value(self) -> TestIntIntMap: ... + + def __init__(self, + key: Optional[int] = ..., + value: Optional[TestIntIntMap] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMaps.MUint32Entry: ... + + class MUint64Entry(Message): + key: int + + @property + def value(self) -> TestIntIntMap: ... + + def __init__(self, + key: Optional[int] = ..., + value: Optional[TestIntIntMap] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMaps.MUint64Entry: ... + + class MSint32Entry(Message): + key: int + + @property + def value(self) -> TestIntIntMap: ... + + def __init__(self, + key: Optional[int] = ..., + value: Optional[TestIntIntMap] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMaps.MSint32Entry: ... + + class MSint64Entry(Message): + key: int + + @property + def value(self) -> TestIntIntMap: ... + + def __init__(self, + key: Optional[int] = ..., + value: Optional[TestIntIntMap] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMaps.MSint64Entry: ... + + class MFixed32Entry(Message): + key: int + + @property + def value(self) -> TestIntIntMap: ... + + def __init__(self, + key: Optional[int] = ..., + value: Optional[TestIntIntMap] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMaps.MFixed32Entry: ... + + class MFixed64Entry(Message): + key: int + + @property + def value(self) -> TestIntIntMap: ... + + def __init__(self, + key: Optional[int] = ..., + value: Optional[TestIntIntMap] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMaps.MFixed64Entry: ... + + class MSfixed32Entry(Message): + key: int + + @property + def value(self) -> TestIntIntMap: ... + + def __init__(self, + key: Optional[int] = ..., + value: Optional[TestIntIntMap] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMaps.MSfixed32Entry: ... + + class MSfixed64Entry(Message): + key: int + + @property + def value(self) -> TestIntIntMap: ... + + def __init__(self, + key: Optional[int] = ..., + value: Optional[TestIntIntMap] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMaps.MSfixed64Entry: ... + + class MBoolEntry(Message): + key: bool + + @property + def value(self) -> TestIntIntMap: ... + + def __init__(self, + key: Optional[bool] = ..., + value: Optional[TestIntIntMap] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMaps.MBoolEntry: ... + + class MStringEntry(Message): + key: Text + + @property + def value(self) -> TestIntIntMap: ... + + def __init__(self, + key: Optional[Text] = ..., + value: Optional[TestIntIntMap] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMaps.MStringEntry: ... + + @property + def m_int32(self) -> MutableMapping[int, TestIntIntMap]: ... + + @property + def m_int64(self) -> MutableMapping[int, TestIntIntMap]: ... + + @property + def m_uint32(self) -> MutableMapping[int, TestIntIntMap]: ... + + @property + def m_uint64(self) -> MutableMapping[int, TestIntIntMap]: ... + + @property + def m_sint32(self) -> MutableMapping[int, TestIntIntMap]: ... + + @property + def m_sint64(self) -> MutableMapping[int, TestIntIntMap]: ... + + @property + def m_fixed32(self) -> MutableMapping[int, TestIntIntMap]: ... + + @property + def m_fixed64(self) -> MutableMapping[int, TestIntIntMap]: ... + + @property + def m_sfixed32(self) -> MutableMapping[int, TestIntIntMap]: ... + + @property + def m_sfixed64(self) -> MutableMapping[int, TestIntIntMap]: ... + + @property + def m_bool(self) -> MutableMapping[bool, TestIntIntMap]: ... + + @property + def m_string(self) -> MutableMapping[Text, TestIntIntMap]: ... + + def __init__(self, + m_int32: Optional[Mapping[int, TestIntIntMap]] = ..., + m_int64: Optional[Mapping[int, TestIntIntMap]] = ..., + m_uint32: Optional[Mapping[int, TestIntIntMap]] = ..., + m_uint64: Optional[Mapping[int, TestIntIntMap]] = ..., + m_sint32: Optional[Mapping[int, TestIntIntMap]] = ..., + m_sint64: Optional[Mapping[int, TestIntIntMap]] = ..., + m_fixed32: Optional[Mapping[int, TestIntIntMap]] = ..., + m_fixed64: Optional[Mapping[int, TestIntIntMap]] = ..., + m_sfixed32: Optional[Mapping[int, TestIntIntMap]] = ..., + m_sfixed64: Optional[Mapping[int, TestIntIntMap]] = ..., + m_bool: Optional[Mapping[bool, TestIntIntMap]] = ..., + m_string: Optional[Mapping[Text, TestIntIntMap]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMaps: ... + + +class TestSubmessageMaps(Message): + + @property + def m(self) -> TestMaps: ... + + def __init__(self, + m: Optional[TestMaps] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestSubmessageMaps: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/map_unittest_pb2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/map_unittest_pb2.pyi new file mode 100644 index 0000000..25058bb --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/map_unittest_pb2.pyi @@ -0,0 +1,882 @@ +from google.protobuf.message import ( + Message, +) +from google.protobuf.unittest_no_arena_pb2 import ( + ForeignMessage, +) +from google.protobuf.unittest_pb2 import ( + ForeignMessage as ForeignMessage1, + TestAllTypes, + TestRequired, +) +from typing import ( + List, + Mapping, + MutableMapping, + Optional, + Text, + Tuple, + cast, +) + + +class MapEnum(int): + + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> MapEnum: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[MapEnum]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, MapEnum]]: ... + + +MAP_ENUM_FOO: MapEnum +MAP_ENUM_BAR: MapEnum +MAP_ENUM_BAZ: MapEnum + + +class TestMap(Message): + + class MapInt32Int32Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMap.MapInt32Int32Entry: ... + + class MapInt64Int64Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMap.MapInt64Int64Entry: ... + + class MapUint32Uint32Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMap.MapUint32Uint32Entry: ... + + class MapUint64Uint64Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMap.MapUint64Uint64Entry: ... + + class MapSint32Sint32Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMap.MapSint32Sint32Entry: ... + + class MapSint64Sint64Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMap.MapSint64Sint64Entry: ... + + class MapFixed32Fixed32Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMap.MapFixed32Fixed32Entry: ... + + class MapFixed64Fixed64Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMap.MapFixed64Fixed64Entry: ... + + class MapSfixed32Sfixed32Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMap.MapSfixed32Sfixed32Entry: ... + + class MapSfixed64Sfixed64Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMap.MapSfixed64Sfixed64Entry: ... + + class MapInt32FloatEntry(Message): + key: int + value: float + + def __init__(self, + key: Optional[int] = ..., + value: Optional[float] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMap.MapInt32FloatEntry: ... + + class MapInt32DoubleEntry(Message): + key: int + value: float + + def __init__(self, + key: Optional[int] = ..., + value: Optional[float] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMap.MapInt32DoubleEntry: ... + + class MapBoolBoolEntry(Message): + key: bool + value: bool + + def __init__(self, + key: Optional[bool] = ..., + value: Optional[bool] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMap.MapBoolBoolEntry: ... + + class MapStringStringEntry(Message): + key: Text + value: Text + + def __init__(self, + key: Optional[Text] = ..., + value: Optional[Text] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMap.MapStringStringEntry: ... + + class MapInt32BytesEntry(Message): + key: int + value: bytes + + def __init__(self, + key: Optional[int] = ..., + value: Optional[bytes] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMap.MapInt32BytesEntry: ... + + class MapInt32EnumEntry(Message): + key: int + value: MapEnum + + def __init__(self, + key: Optional[int] = ..., + value: Optional[MapEnum] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMap.MapInt32EnumEntry: ... + + class MapInt32ForeignMessageEntry(Message): + key: int + + @property + def value(self) -> ForeignMessage1: ... + + def __init__(self, + key: Optional[int] = ..., + value: Optional[ForeignMessage1] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMap.MapInt32ForeignMessageEntry: ... + + class MapStringForeignMessageEntry(Message): + key: Text + + @property + def value(self) -> ForeignMessage1: ... + + def __init__(self, + key: Optional[Text] = ..., + value: Optional[ForeignMessage1] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestMap.MapStringForeignMessageEntry: ... + + class MapInt32AllTypesEntry(Message): + key: int + + @property + def value(self) -> TestAllTypes: ... + + def __init__(self, + key: Optional[int] = ..., + value: Optional[TestAllTypes] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMap.MapInt32AllTypesEntry: ... + + @property + def map_int32_int32(self) -> MutableMapping[int, int]: ... + + @property + def map_int64_int64(self) -> MutableMapping[int, int]: ... + + @property + def map_uint32_uint32(self) -> MutableMapping[int, int]: ... + + @property + def map_uint64_uint64(self) -> MutableMapping[int, int]: ... + + @property + def map_sint32_sint32(self) -> MutableMapping[int, int]: ... + + @property + def map_sint64_sint64(self) -> MutableMapping[int, int]: ... + + @property + def map_fixed32_fixed32(self) -> MutableMapping[int, int]: ... + + @property + def map_fixed64_fixed64(self) -> MutableMapping[int, int]: ... + + @property + def map_sfixed32_sfixed32(self) -> MutableMapping[int, int]: ... + + @property + def map_sfixed64_sfixed64(self) -> MutableMapping[int, int]: ... + + @property + def map_int32_float(self) -> MutableMapping[int, float]: ... + + @property + def map_int32_double(self) -> MutableMapping[int, float]: ... + + @property + def map_bool_bool(self) -> MutableMapping[bool, bool]: ... + + @property + def map_string_string(self) -> MutableMapping[Text, Text]: ... + + @property + def map_int32_bytes(self) -> MutableMapping[int, bytes]: ... + + @property + def map_int32_enum(self) -> MutableMapping[int, MapEnum]: ... + + @property + def map_int32_foreign_message( + self) -> MutableMapping[int, ForeignMessage1]: ... + + @property + def map_string_foreign_message( + self) -> MutableMapping[Text, ForeignMessage1]: ... + + @property + def map_int32_all_types(self) -> MutableMapping[int, TestAllTypes]: ... + + def __init__(self, + map_int32_int32: Optional[Mapping[int, int]] = ..., + map_int64_int64: Optional[Mapping[int, int]] = ..., + map_uint32_uint32: Optional[Mapping[int, int]] = ..., + map_uint64_uint64: Optional[Mapping[int, int]] = ..., + map_sint32_sint32: Optional[Mapping[int, int]] = ..., + map_sint64_sint64: Optional[Mapping[int, int]] = ..., + map_fixed32_fixed32: Optional[Mapping[int, int]] = ..., + map_fixed64_fixed64: Optional[Mapping[int, int]] = ..., + map_sfixed32_sfixed32: Optional[Mapping[int, int]] = ..., + map_sfixed64_sfixed64: Optional[Mapping[int, int]] = ..., + map_int32_float: Optional[Mapping[int, float]] = ..., + map_int32_double: Optional[Mapping[int, float]] = ..., + map_bool_bool: Optional[Mapping[bool, bool]] = ..., + map_string_string: Optional[Mapping[Text, Text]] = ..., + map_int32_bytes: Optional[Mapping[int, bytes]] = ..., + map_int32_enum: Optional[Mapping[int, MapEnum]] = ..., + map_int32_foreign_message: Optional[Mapping[int, ForeignMessage1]] = ..., + map_string_foreign_message: Optional[Mapping[Text, ForeignMessage1]] = ..., + map_int32_all_types: Optional[Mapping[int, TestAllTypes]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMap: ... + + +class TestMapSubmessage(Message): + + @property + def test_map(self) -> TestMap: ... + + def __init__(self, + test_map: Optional[TestMap] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMapSubmessage: ... + + +class TestMessageMap(Message): + + class MapInt32MessageEntry(Message): + key: int + + @property + def value(self) -> TestAllTypes: ... + + def __init__(self, + key: Optional[int] = ..., + value: Optional[TestAllTypes] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMessageMap.MapInt32MessageEntry: ... + + @property + def map_int32_message(self) -> MutableMapping[int, TestAllTypes]: ... + + def __init__(self, + map_int32_message: Optional[Mapping[int, TestAllTypes]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMessageMap: ... + + +class TestSameTypeMap(Message): + + class Map1Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestSameTypeMap.Map1Entry: ... + + class Map2Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestSameTypeMap.Map2Entry: ... + + @property + def map1(self) -> MutableMapping[int, int]: ... + + @property + def map2(self) -> MutableMapping[int, int]: ... + + def __init__(self, + map1: Optional[Mapping[int, int]] = ..., + map2: Optional[Mapping[int, int]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestSameTypeMap: ... + + +class TestRequiredMessageMap(Message): + + class MapFieldEntry(Message): + key: int + + @property + def value(self) -> TestRequired: ... + + def __init__(self, + key: Optional[int] = ..., + value: Optional[TestRequired] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestRequiredMessageMap.MapFieldEntry: ... + + @property + def map_field(self) -> MutableMapping[int, TestRequired]: ... + + def __init__(self, + map_field: Optional[Mapping[int, TestRequired]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestRequiredMessageMap: ... + + +class TestArenaMap(Message): + + class MapInt32Int32Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestArenaMap.MapInt32Int32Entry: ... + + class MapInt64Int64Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestArenaMap.MapInt64Int64Entry: ... + + class MapUint32Uint32Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestArenaMap.MapUint32Uint32Entry: ... + + class MapUint64Uint64Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestArenaMap.MapUint64Uint64Entry: ... + + class MapSint32Sint32Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestArenaMap.MapSint32Sint32Entry: ... + + class MapSint64Sint64Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestArenaMap.MapSint64Sint64Entry: ... + + class MapFixed32Fixed32Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestArenaMap.MapFixed32Fixed32Entry: ... + + class MapFixed64Fixed64Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestArenaMap.MapFixed64Fixed64Entry: ... + + class MapSfixed32Sfixed32Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestArenaMap.MapSfixed32Sfixed32Entry: ... + + class MapSfixed64Sfixed64Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestArenaMap.MapSfixed64Sfixed64Entry: ... + + class MapInt32FloatEntry(Message): + key: int + value: float + + def __init__(self, + key: Optional[int] = ..., + value: Optional[float] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestArenaMap.MapInt32FloatEntry: ... + + class MapInt32DoubleEntry(Message): + key: int + value: float + + def __init__(self, + key: Optional[int] = ..., + value: Optional[float] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestArenaMap.MapInt32DoubleEntry: ... + + class MapBoolBoolEntry(Message): + key: bool + value: bool + + def __init__(self, + key: Optional[bool] = ..., + value: Optional[bool] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestArenaMap.MapBoolBoolEntry: ... + + class MapStringStringEntry(Message): + key: Text + value: Text + + def __init__(self, + key: Optional[Text] = ..., + value: Optional[Text] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestArenaMap.MapStringStringEntry: ... + + class MapInt32BytesEntry(Message): + key: int + value: bytes + + def __init__(self, + key: Optional[int] = ..., + value: Optional[bytes] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestArenaMap.MapInt32BytesEntry: ... + + class MapInt32EnumEntry(Message): + key: int + value: MapEnum + + def __init__(self, + key: Optional[int] = ..., + value: Optional[MapEnum] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestArenaMap.MapInt32EnumEntry: ... + + class MapInt32ForeignMessageEntry(Message): + key: int + + @property + def value(self) -> ForeignMessage1: ... + + def __init__(self, + key: Optional[int] = ..., + value: Optional[ForeignMessage1] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestArenaMap.MapInt32ForeignMessageEntry: ... + + class MapInt32ForeignMessageNoArenaEntry(Message): + key: int + + @property + def value(self) -> ForeignMessage: ... + + def __init__(self, + key: Optional[int] = ..., + value: Optional[ForeignMessage] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestArenaMap.MapInt32ForeignMessageNoArenaEntry: ... + + @property + def map_int32_int32(self) -> MutableMapping[int, int]: ... + + @property + def map_int64_int64(self) -> MutableMapping[int, int]: ... + + @property + def map_uint32_uint32(self) -> MutableMapping[int, int]: ... + + @property + def map_uint64_uint64(self) -> MutableMapping[int, int]: ... + + @property + def map_sint32_sint32(self) -> MutableMapping[int, int]: ... + + @property + def map_sint64_sint64(self) -> MutableMapping[int, int]: ... + + @property + def map_fixed32_fixed32(self) -> MutableMapping[int, int]: ... + + @property + def map_fixed64_fixed64(self) -> MutableMapping[int, int]: ... + + @property + def map_sfixed32_sfixed32(self) -> MutableMapping[int, int]: ... + + @property + def map_sfixed64_sfixed64(self) -> MutableMapping[int, int]: ... + + @property + def map_int32_float(self) -> MutableMapping[int, float]: ... + + @property + def map_int32_double(self) -> MutableMapping[int, float]: ... + + @property + def map_bool_bool(self) -> MutableMapping[bool, bool]: ... + + @property + def map_string_string(self) -> MutableMapping[Text, Text]: ... + + @property + def map_int32_bytes(self) -> MutableMapping[int, bytes]: ... + + @property + def map_int32_enum(self) -> MutableMapping[int, MapEnum]: ... + + @property + def map_int32_foreign_message( + self) -> MutableMapping[int, ForeignMessage1]: ... + + @property + def map_int32_foreign_message_no_arena( + self) -> MutableMapping[int, ForeignMessage]: ... + + def __init__(self, + map_int32_int32: Optional[Mapping[int, int]] = ..., + map_int64_int64: Optional[Mapping[int, int]] = ..., + map_uint32_uint32: Optional[Mapping[int, int]] = ..., + map_uint64_uint64: Optional[Mapping[int, int]] = ..., + map_sint32_sint32: Optional[Mapping[int, int]] = ..., + map_sint64_sint64: Optional[Mapping[int, int]] = ..., + map_fixed32_fixed32: Optional[Mapping[int, int]] = ..., + map_fixed64_fixed64: Optional[Mapping[int, int]] = ..., + map_sfixed32_sfixed32: Optional[Mapping[int, int]] = ..., + map_sfixed64_sfixed64: Optional[Mapping[int, int]] = ..., + map_int32_float: Optional[Mapping[int, float]] = ..., + map_int32_double: Optional[Mapping[int, float]] = ..., + map_bool_bool: Optional[Mapping[bool, bool]] = ..., + map_string_string: Optional[Mapping[Text, Text]] = ..., + map_int32_bytes: Optional[Mapping[int, bytes]] = ..., + map_int32_enum: Optional[Mapping[int, MapEnum]] = ..., + map_int32_foreign_message: Optional[Mapping[int, ForeignMessage1]] = ..., + map_int32_foreign_message_no_arena: Optional[Mapping[int, ForeignMessage]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestArenaMap: ... + + +class MessageContainingEnumCalledType(Message): + + class Type(int): + + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> MessageContainingEnumCalledType.Type: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[MessageContainingEnumCalledType.Type]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, + MessageContainingEnumCalledType.Type]]: ... + TYPE_FOO: MessageContainingEnumCalledType.Type + + class TypeEntry(Message): + key: Text + + @property + def value(self) -> MessageContainingEnumCalledType: ... + + def __init__(self, + key: Optional[Text] = ..., + value: Optional[MessageContainingEnumCalledType] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> MessageContainingEnumCalledType.TypeEntry: ... + + @property + def type(self) -> MutableMapping[Text, + MessageContainingEnumCalledType]: ... + + def __init__(self, + type: Optional[Mapping[Text, MessageContainingEnumCalledType]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> MessageContainingEnumCalledType: ... + + +class MessageContainingMapCalledEntry(Message): + + class EntryEntry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> MessageContainingMapCalledEntry.EntryEntry: ... + + @property + def entry(self) -> MutableMapping[int, int]: ... + + def __init__(self, + entry: Optional[Mapping[int, int]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> MessageContainingMapCalledEntry: ... + + +class TestRecursiveMapMessage(Message): + + class AEntry(Message): + key: Text + + @property + def value(self) -> TestRecursiveMapMessage: ... + + def __init__(self, + key: Optional[Text] = ..., + value: Optional[TestRecursiveMapMessage] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestRecursiveMapMessage.AEntry: ... + + @property + def a(self) -> MutableMapping[Text, TestRecursiveMapMessage]: ... + + def __init__(self, + a: Optional[Mapping[Text, TestRecursiveMapMessage]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestRecursiveMapMessage: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/message.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/message.pyi new file mode 100644 index 0000000..4bf8cab --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/message.pyi @@ -0,0 +1,46 @@ +from typing import Any, Sequence, Optional, Tuple + +from .descriptor import ( + DescriptorBase, + FieldDescriptor, +) + +class Error(Exception): ... +class DecodeError(Error): ... +class EncodeError(Error): ... + +class _ExtensionDict: + def __getitem__(self, extension_handle: DescriptorBase) -> Any: ... + def __setitem__(self, extension_handle: DescriptorBase, value: Any) -> None: ... + +class Message: + DESCRIPTOR: Any + def __deepcopy__(self, memo=...): ... + def __eq__(self, other_msg): ... + def __ne__(self, other_msg): ... + def MergeFrom(self, other_msg: Message) -> None: ... + def CopyFrom(self, other_msg: Message) -> None: ... + def Clear(self) -> None: ... + def SetInParent(self) -> None: ... + def IsInitialized(self) -> bool: ... + def MergeFromString(self, serialized: Any) -> int: ... # TODO: we need to be able to call buffer() on serialized + def ParseFromString(self, serialized: Any) -> None: ... + def SerializeToString(self, deterministic: bool = ...) -> bytes: ... + def SerializePartialToString(self, deterministic: bool = ...) -> bytes: ... + def ListFields(self) -> Sequence[Tuple[FieldDescriptor, Any]]: ... + def HasExtension(self, extension_handle): ... + def ClearExtension(self, extension_handle): ... + def ByteSize(self) -> int: ... + @property + def Extensions(self) -> _ExtensionDict: ... + + # Intentionally left out typing on these three methods, because they are + # stringly typed and it is not useful to call them on a Message directly. + # We prefer more specific typing on individual subclasses of Message + # See https://github.com/dropbox/mypy-protobuf/issues/62 for details + def HasField(self, field_name: Any) -> bool: ... + def ClearField(self, field_name: Any) -> None: ... + def WhichOneof(self, oneof_group: Any) -> Any: ... + + # TODO: check kwargs + def __init__(self, **kwargs) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/message_factory.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/message_factory.pyi new file mode 100644 index 0000000..ad31e22 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/message_factory.pyi @@ -0,0 +1,13 @@ +from typing import Any, Dict, Iterable, Optional, Type + +from .message import Message +from .descriptor import Descriptor +from .descriptor_pool import DescriptorPool + +class MessageFactory: + pool: Any + def __init__(self, pool: Optional[DescriptorPool] = ...) -> None: ... + def GetPrototype(self, descriptor: Descriptor) -> Type[Message]: ... + def GetMessages(self, files: Iterable[bytes]) -> Dict[bytes, Type[Message]]: ... + +def GetMessages(file_protos: Iterable[bytes]) -> Dict[bytes, Type[Message]]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/reflection.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/reflection.pyi new file mode 100644 index 0000000..3ca5055 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/reflection.pyi @@ -0,0 +1,6 @@ +class GeneratedProtocolMessageType(type): + def __new__(cls, name, bases, dictionary): ... + def __init__(self, name, bases, dictionary) -> None: ... + +def ParseMessage(descriptor, byte_str): ... +def MakeClass(descriptor): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/service.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/service.pyi new file mode 100644 index 0000000..4874d53 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/service.pyi @@ -0,0 +1,39 @@ +from concurrent.futures import Future +from typing import Callable, Optional, Text, Type + +from google.protobuf.descriptor import MethodDescriptor, ServiceDescriptor +from google.protobuf.message import Message + +class RpcException(Exception): ... + +class Service: + @staticmethod + def GetDescriptor() -> ServiceDescriptor: ... + def CallMethod( + self, + method_descriptor: MethodDescriptor, + rpc_controller: RpcController, + request: Message, + done: Optional[Callable[[Message], None]], + ) -> Optional[Future[Message]]: ... + def GetRequestClass(self, method_descriptor: MethodDescriptor) -> Type[Message]: ... + def GetResponseClass(self, method_descriptor: MethodDescriptor) -> Type[Message]: ... + +class RpcController: + def Reset(self) -> None: ... + def Failed(self) -> bool: ... + def ErrorText(self) -> Optional[Text]: ... + def StartCancel(self) -> None: ... + def SetFailed(self, reason: Text) -> None: ... + def IsCanceled(self) -> bool: ... + def NotifyOnCancel(self, callback: Callable[[], None]) -> None: ... + +class RpcChannel: + def CallMethod( + self, + method_descriptor: MethodDescriptor, + rpc_controller: RpcController, + request: Message, + response_class: Type[Message], + done: Optional[Callable[[Message], None]], + ) -> Optional[Future[Message]]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/source_context_pb2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/source_context_pb2.pyi new file mode 100644 index 0000000..527ac1a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/source_context_pb2.pyi @@ -0,0 +1,18 @@ +from google.protobuf.message import ( + Message, +) +from typing import ( + Optional, + Text, +) + + +class SourceContext(Message): + file_name: Text + + def __init__(self, + file_name: Optional[Text] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> SourceContext: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/struct_pb2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/struct_pb2.pyi new file mode 100644 index 0000000..21afcc7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/struct_pb2.pyi @@ -0,0 +1,105 @@ +from google.protobuf.internal.containers import ( + RepeatedCompositeFieldContainer, +) +from google.protobuf.internal import well_known_types + +from google.protobuf.message import ( + Message, +) +from typing import ( + Iterable, + List, + Mapping, + MutableMapping, + Optional, + Text, + Tuple, + cast, +) + + +class NullValue(int): + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> NullValue: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[NullValue]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, NullValue]]: ... + + +NULL_VALUE: NullValue + + +class Struct(Message, well_known_types.Struct): + class FieldsEntry(Message): + key: Text + + @property + def value(self) -> Value: ... + + def __init__(self, + key: Optional[Text] = ..., + value: Optional[Value] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> Struct.FieldsEntry: ... + + @property + def fields(self) -> MutableMapping[Text, Value]: ... + + def __init__(self, + fields: Optional[Mapping[Text, Value]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> Struct: ... + + +class _Value(Message): + null_value: NullValue + number_value: float + string_value: Text + bool_value: bool + + @property + def struct_value(self) -> Struct: ... + + @property + def list_value(self) -> ListValue: ... + + def __init__(self, + null_value: Optional[NullValue] = ..., + number_value: Optional[float] = ..., + string_value: Optional[Text] = ..., + bool_value: Optional[bool] = ..., + struct_value: Optional[Struct] = ..., + list_value: Optional[ListValue] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> _Value: ... + + +Value = _Value + + +class ListValue(Message, well_known_types.ListValue): + + @property + def values(self) -> RepeatedCompositeFieldContainer[Value]: ... + + def __init__(self, + values: Optional[Iterable[Value]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> ListValue: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/symbol_database.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/symbol_database.pyi new file mode 100644 index 0000000..477d80e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/symbol_database.pyi @@ -0,0 +1,14 @@ +from typing import Dict, Iterable, Type + +from .descriptor import EnumDescriptor, FileDescriptor +from .message import Message +from .message_factory import MessageFactory + +class SymbolDatabase(MessageFactory): + def RegisterMessage(self, message: Type[Message]) -> Type[Message]: ... + def RegisterEnumDescriptor(self, enum_descriptor: Type[EnumDescriptor]) -> EnumDescriptor: ... + def RegisterFileDescriptor(self, file_descriptor: Type[FileDescriptor]) -> FileDescriptor: ... + def GetSymbol(self, symbol: bytes) -> Type[Message]: ... + def GetMessages(self, files: Iterable[bytes]) -> Dict[bytes, Type[Message]]: ... + +def Default(): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/test_messages_proto2_pb2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/test_messages_proto2_pb2.pyi new file mode 100644 index 0000000..03e34be --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/test_messages_proto2_pb2.pyi @@ -0,0 +1,627 @@ +from google.protobuf.internal.containers import ( + RepeatedCompositeFieldContainer, + RepeatedScalarFieldContainer, +) +from google.protobuf.message import ( + Message, +) +import builtins +from typing import ( + Iterable, + List, + Mapping, + MutableMapping, + Optional, + Text, + Tuple, + cast, +) + + +class ForeignEnumProto2(int): + + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> ForeignEnumProto2: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[ForeignEnumProto2]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, ForeignEnumProto2]]: ... + + +FOREIGN_FOO: ForeignEnumProto2 +FOREIGN_BAR: ForeignEnumProto2 +FOREIGN_BAZ: ForeignEnumProto2 + + +class TestAllTypesProto2(Message): + + class NestedEnum(int): + + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> TestAllTypesProto2.NestedEnum: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[TestAllTypesProto2.NestedEnum]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, TestAllTypesProto2.NestedEnum]]: ... + FOO: TestAllTypesProto2.NestedEnum + BAR: TestAllTypesProto2.NestedEnum + BAZ: TestAllTypesProto2.NestedEnum + NEG: TestAllTypesProto2.NestedEnum + + class NestedMessage(Message): + a: int + + @property + def corecursive(self) -> TestAllTypesProto2: ... + + def __init__(self, + a: Optional[int] = ..., + corecursive: Optional[TestAllTypesProto2] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllTypesProto2.NestedMessage: ... + + class MapInt32Int32Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestAllTypesProto2.MapInt32Int32Entry: ... + + class MapInt64Int64Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestAllTypesProto2.MapInt64Int64Entry: ... + + class MapUint32Uint32Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestAllTypesProto2.MapUint32Uint32Entry: ... + + class MapUint64Uint64Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestAllTypesProto2.MapUint64Uint64Entry: ... + + class MapSint32Sint32Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestAllTypesProto2.MapSint32Sint32Entry: ... + + class MapSint64Sint64Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestAllTypesProto2.MapSint64Sint64Entry: ... + + class MapFixed32Fixed32Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestAllTypesProto2.MapFixed32Fixed32Entry: ... + + class MapFixed64Fixed64Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestAllTypesProto2.MapFixed64Fixed64Entry: ... + + class MapSfixed32Sfixed32Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestAllTypesProto2.MapSfixed32Sfixed32Entry: ... + + class MapSfixed64Sfixed64Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestAllTypesProto2.MapSfixed64Sfixed64Entry: ... + + class MapInt32FloatEntry(Message): + key: int + value: float + + def __init__(self, + key: Optional[int] = ..., + value: Optional[float] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestAllTypesProto2.MapInt32FloatEntry: ... + + class MapInt32DoubleEntry(Message): + key: int + value: float + + def __init__(self, + key: Optional[int] = ..., + value: Optional[float] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestAllTypesProto2.MapInt32DoubleEntry: ... + + class MapBoolBoolEntry(Message): + key: bool + value: bool + + def __init__(self, + key: Optional[bool] = ..., + value: Optional[bool] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllTypesProto2.MapBoolBoolEntry: ... + + class MapStringStringEntry(Message): + key: Text + value: Text + + def __init__(self, + key: Optional[Text] = ..., + value: Optional[Text] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestAllTypesProto2.MapStringStringEntry: ... + + class MapStringBytesEntry(Message): + key: Text + value: bytes + + def __init__(self, + key: Optional[Text] = ..., + value: Optional[bytes] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestAllTypesProto2.MapStringBytesEntry: ... + + class MapStringNestedMessageEntry(Message): + key: Text + + @property + def value(self) -> TestAllTypesProto2.NestedMessage: ... + + def __init__(self, + key: Optional[Text] = ..., + value: Optional[TestAllTypesProto2.NestedMessage] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestAllTypesProto2.MapStringNestedMessageEntry: ... + + class MapStringForeignMessageEntry(Message): + key: Text + + @property + def value(self) -> ForeignMessageProto2: ... + + def __init__(self, + key: Optional[Text] = ..., + value: Optional[ForeignMessageProto2] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestAllTypesProto2.MapStringForeignMessageEntry: ... + + class MapStringNestedEnumEntry(Message): + key: Text + value: TestAllTypesProto2.NestedEnum + + def __init__(self, + key: Optional[Text] = ..., + value: Optional[TestAllTypesProto2.NestedEnum] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestAllTypesProto2.MapStringNestedEnumEntry: ... + + class MapStringForeignEnumEntry(Message): + key: Text + value: ForeignEnumProto2 + + def __init__(self, + key: Optional[Text] = ..., + value: Optional[ForeignEnumProto2] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestAllTypesProto2.MapStringForeignEnumEntry: ... + + class Data(Message): + group_int32: int + group_uint32: int + + def __init__(self, + group_int32: Optional[int] = ..., + group_uint32: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllTypesProto2.Data: ... + + class MessageSetCorrect(Message): + + def __init__(self, + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestAllTypesProto2.MessageSetCorrect: ... + + class MessageSetCorrectExtension1(Message): + bytes: Text + + def __init__(self, + bytes: Optional[Text] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: builtins.bytes) -> TestAllTypesProto2.MessageSetCorrectExtension1: ... + + class MessageSetCorrectExtension2(Message): + i: int + + def __init__(self, + i: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestAllTypesProto2.MessageSetCorrectExtension2: ... + optional_int32: int + optional_int64: int + optional_uint32: int + optional_uint64: int + optional_sint32: int + optional_sint64: int + optional_fixed32: int + optional_fixed64: int + optional_sfixed32: int + optional_sfixed64: int + optional_float: float + optional_double: float + optional_bool: bool + optional_string: Text + optional_bytes: bytes + optional_nested_enum: TestAllTypesProto2.NestedEnum + optional_foreign_enum: ForeignEnumProto2 + optional_string_piece: Text + optional_cord: Text + repeated_int32: RepeatedScalarFieldContainer[int] + repeated_int64: RepeatedScalarFieldContainer[int] + repeated_uint32: RepeatedScalarFieldContainer[int] + repeated_uint64: RepeatedScalarFieldContainer[int] + repeated_sint32: RepeatedScalarFieldContainer[int] + repeated_sint64: RepeatedScalarFieldContainer[int] + repeated_fixed32: RepeatedScalarFieldContainer[int] + repeated_fixed64: RepeatedScalarFieldContainer[int] + repeated_sfixed32: RepeatedScalarFieldContainer[int] + repeated_sfixed64: RepeatedScalarFieldContainer[int] + repeated_float: RepeatedScalarFieldContainer[float] + repeated_double: RepeatedScalarFieldContainer[float] + repeated_bool: RepeatedScalarFieldContainer[bool] + repeated_string: RepeatedScalarFieldContainer[Text] + repeated_bytes: RepeatedScalarFieldContainer[bytes] + repeated_nested_enum: RepeatedScalarFieldContainer[TestAllTypesProto2.NestedEnum] + repeated_foreign_enum: RepeatedScalarFieldContainer[ForeignEnumProto2] + repeated_string_piece: RepeatedScalarFieldContainer[Text] + repeated_cord: RepeatedScalarFieldContainer[Text] + oneof_uint32: int + oneof_string: Text + oneof_bytes: bytes + oneof_bool: bool + oneof_uint64: int + oneof_float: float + oneof_double: float + oneof_enum: TestAllTypesProto2.NestedEnum + fieldname1: int + field_name2: int + _field_name3: int + field__name4_: int + field0name5: int + field_0_name6: int + fieldName7: int + FieldName8: int + field_Name9: int + Field_Name10: int + FIELD_NAME11: int + FIELD_name12: int + __field_name13: int + __Field_name14: int + field__name15: int + field__Name16: int + field_name17__: int + Field_name18__: int + + @property + def optional_nested_message(self) -> TestAllTypesProto2.NestedMessage: ... + + @property + def optional_foreign_message(self) -> ForeignMessageProto2: ... + + @property + def recursive_message(self) -> TestAllTypesProto2: ... + + @property + def repeated_nested_message( + self) -> RepeatedCompositeFieldContainer[TestAllTypesProto2.NestedMessage]: ... + + @property + def repeated_foreign_message( + self) -> RepeatedCompositeFieldContainer[ForeignMessageProto2]: ... + + @property + def map_int32_int32(self) -> MutableMapping[int, int]: ... + + @property + def map_int64_int64(self) -> MutableMapping[int, int]: ... + + @property + def map_uint32_uint32(self) -> MutableMapping[int, int]: ... + + @property + def map_uint64_uint64(self) -> MutableMapping[int, int]: ... + + @property + def map_sint32_sint32(self) -> MutableMapping[int, int]: ... + + @property + def map_sint64_sint64(self) -> MutableMapping[int, int]: ... + + @property + def map_fixed32_fixed32(self) -> MutableMapping[int, int]: ... + + @property + def map_fixed64_fixed64(self) -> MutableMapping[int, int]: ... + + @property + def map_sfixed32_sfixed32(self) -> MutableMapping[int, int]: ... + + @property + def map_sfixed64_sfixed64(self) -> MutableMapping[int, int]: ... + + @property + def map_int32_float(self) -> MutableMapping[int, float]: ... + + @property + def map_int32_double(self) -> MutableMapping[int, float]: ... + + @property + def map_bool_bool(self) -> MutableMapping[bool, bool]: ... + + @property + def map_string_string(self) -> MutableMapping[Text, Text]: ... + + @property + def map_string_bytes(self) -> MutableMapping[Text, bytes]: ... + + @property + def map_string_nested_message( + self) -> MutableMapping[Text, TestAllTypesProto2.NestedMessage]: ... + + @property + def map_string_foreign_message( + self) -> MutableMapping[Text, ForeignMessageProto2]: ... + + @property + def map_string_nested_enum( + self) -> MutableMapping[Text, TestAllTypesProto2.NestedEnum]: ... + + @property + def map_string_foreign_enum( + self) -> MutableMapping[Text, ForeignEnumProto2]: ... + + @property + def oneof_nested_message(self) -> TestAllTypesProto2.NestedMessage: ... + + @property + def data(self) -> TestAllTypesProto2.Data: ... + + def __init__(self, + optional_int32: Optional[int] = ..., + optional_int64: Optional[int] = ..., + optional_uint32: Optional[int] = ..., + optional_uint64: Optional[int] = ..., + optional_sint32: Optional[int] = ..., + optional_sint64: Optional[int] = ..., + optional_fixed32: Optional[int] = ..., + optional_fixed64: Optional[int] = ..., + optional_sfixed32: Optional[int] = ..., + optional_sfixed64: Optional[int] = ..., + optional_float: Optional[float] = ..., + optional_double: Optional[float] = ..., + optional_bool: Optional[bool] = ..., + optional_string: Optional[Text] = ..., + optional_bytes: Optional[bytes] = ..., + optional_nested_message: Optional[TestAllTypesProto2.NestedMessage] = ..., + optional_foreign_message: Optional[ForeignMessageProto2] = ..., + optional_nested_enum: Optional[TestAllTypesProto2.NestedEnum] = ..., + optional_foreign_enum: Optional[ForeignEnumProto2] = ..., + optional_string_piece: Optional[Text] = ..., + optional_cord: Optional[Text] = ..., + recursive_message: Optional[TestAllTypesProto2] = ..., + repeated_int32: Optional[Iterable[int]] = ..., + repeated_int64: Optional[Iterable[int]] = ..., + repeated_uint32: Optional[Iterable[int]] = ..., + repeated_uint64: Optional[Iterable[int]] = ..., + repeated_sint32: Optional[Iterable[int]] = ..., + repeated_sint64: Optional[Iterable[int]] = ..., + repeated_fixed32: Optional[Iterable[int]] = ..., + repeated_fixed64: Optional[Iterable[int]] = ..., + repeated_sfixed32: Optional[Iterable[int]] = ..., + repeated_sfixed64: Optional[Iterable[int]] = ..., + repeated_float: Optional[Iterable[float]] = ..., + repeated_double: Optional[Iterable[float]] = ..., + repeated_bool: Optional[Iterable[bool]] = ..., + repeated_string: Optional[Iterable[Text]] = ..., + repeated_bytes: Optional[Iterable[bytes]] = ..., + repeated_nested_message: Optional[Iterable[TestAllTypesProto2.NestedMessage]] = ..., + repeated_foreign_message: Optional[Iterable[ForeignMessageProto2]] = ..., + repeated_nested_enum: Optional[Iterable[TestAllTypesProto2.NestedEnum]] = ..., + repeated_foreign_enum: Optional[Iterable[ForeignEnumProto2]] = ..., + repeated_string_piece: Optional[Iterable[Text]] = ..., + repeated_cord: Optional[Iterable[Text]] = ..., + map_int32_int32: Optional[Mapping[int, int]] = ..., + map_int64_int64: Optional[Mapping[int, int]] = ..., + map_uint32_uint32: Optional[Mapping[int, int]] = ..., + map_uint64_uint64: Optional[Mapping[int, int]] = ..., + map_sint32_sint32: Optional[Mapping[int, int]] = ..., + map_sint64_sint64: Optional[Mapping[int, int]] = ..., + map_fixed32_fixed32: Optional[Mapping[int, int]] = ..., + map_fixed64_fixed64: Optional[Mapping[int, int]] = ..., + map_sfixed32_sfixed32: Optional[Mapping[int, int]] = ..., + map_sfixed64_sfixed64: Optional[Mapping[int, int]] = ..., + map_int32_float: Optional[Mapping[int, float]] = ..., + map_int32_double: Optional[Mapping[int, float]] = ..., + map_bool_bool: Optional[Mapping[bool, bool]] = ..., + map_string_string: Optional[Mapping[Text, Text]] = ..., + map_string_bytes: Optional[Mapping[Text, bytes]] = ..., + map_string_nested_message: Optional[Mapping[Text, TestAllTypesProto2.NestedMessage]] = ..., + map_string_foreign_message: Optional[Mapping[Text, ForeignMessageProto2]] = ..., + map_string_nested_enum: Optional[Mapping[Text, TestAllTypesProto2.NestedEnum]] = ..., + map_string_foreign_enum: Optional[Mapping[Text, ForeignEnumProto2]] = ..., + oneof_uint32: Optional[int] = ..., + oneof_nested_message: Optional[TestAllTypesProto2.NestedMessage] = ..., + oneof_string: Optional[Text] = ..., + oneof_bytes: Optional[bytes] = ..., + oneof_bool: Optional[bool] = ..., + oneof_uint64: Optional[int] = ..., + oneof_float: Optional[float] = ..., + oneof_double: Optional[float] = ..., + oneof_enum: Optional[TestAllTypesProto2.NestedEnum] = ..., + data: Optional[TestAllTypesProto2.Data] = ..., + fieldname1: Optional[int] = ..., + field_name2: Optional[int] = ..., + _field_name3: Optional[int] = ..., + field__name4_: Optional[int] = ..., + field0name5: Optional[int] = ..., + field_0_name6: Optional[int] = ..., + fieldName7: Optional[int] = ..., + FieldName8: Optional[int] = ..., + field_Name9: Optional[int] = ..., + Field_Name10: Optional[int] = ..., + FIELD_NAME11: Optional[int] = ..., + FIELD_name12: Optional[int] = ..., + __field_name13: Optional[int] = ..., + __Field_name14: Optional[int] = ..., + field__name15: Optional[int] = ..., + field__Name16: Optional[int] = ..., + field_name17__: Optional[int] = ..., + Field_name18__: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllTypesProto2: ... + + +class ForeignMessageProto2(Message): + c: int + + def __init__(self, + c: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> ForeignMessageProto2: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/test_messages_proto3_pb2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/test_messages_proto3_pb2.pyi new file mode 100644 index 0000000..5a9cce3 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/test_messages_proto3_pb2.pyi @@ -0,0 +1,700 @@ +from google.protobuf.any_pb2 import ( + Any, +) +from google.protobuf.duration_pb2 import ( + Duration, +) +from google.protobuf.field_mask_pb2 import ( + FieldMask, +) +from google.protobuf.internal.containers import ( + RepeatedCompositeFieldContainer, + RepeatedScalarFieldContainer, +) +from google.protobuf.message import ( + Message, +) +from google.protobuf.struct_pb2 import ( + Struct, + Value, +) +from google.protobuf.timestamp_pb2 import ( + Timestamp, +) +from google.protobuf.wrappers_pb2 import ( + BoolValue, + BytesValue, + DoubleValue, + FloatValue, + Int32Value, + Int64Value, + StringValue, + UInt32Value, + UInt64Value, +) +from typing import ( + Iterable, + List, + Mapping, + MutableMapping, + Optional, + Text, + Tuple, + cast, +) + + +class ForeignEnum(int): + + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> ForeignEnum: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[ForeignEnum]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, ForeignEnum]]: ... +FOREIGN_FOO: ForeignEnum +FOREIGN_BAR: ForeignEnum +FOREIGN_BAZ: ForeignEnum + + +class TestAllTypesProto3(Message): + + class NestedEnum(int): + + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> TestAllTypesProto3.NestedEnum: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[TestAllTypesProto3.NestedEnum]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, TestAllTypesProto3.NestedEnum]]: ... + FOO: TestAllTypesProto3.NestedEnum + BAR: TestAllTypesProto3.NestedEnum + BAZ: TestAllTypesProto3.NestedEnum + NEG: TestAllTypesProto3.NestedEnum + + class NestedMessage(Message): + a: int + + @property + def corecursive(self) -> TestAllTypesProto3: ... + + def __init__(self, + a: Optional[int] = ..., + corecursive: Optional[TestAllTypesProto3] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllTypesProto3.NestedMessage: ... + + class MapInt32Int32Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllTypesProto3.MapInt32Int32Entry: ... + + class MapInt64Int64Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllTypesProto3.MapInt64Int64Entry: ... + + class MapUint32Uint32Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllTypesProto3.MapUint32Uint32Entry: ... + + class MapUint64Uint64Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllTypesProto3.MapUint64Uint64Entry: ... + + class MapSint32Sint32Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllTypesProto3.MapSint32Sint32Entry: ... + + class MapSint64Sint64Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllTypesProto3.MapSint64Sint64Entry: ... + + class MapFixed32Fixed32Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllTypesProto3.MapFixed32Fixed32Entry: ... + + class MapFixed64Fixed64Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllTypesProto3.MapFixed64Fixed64Entry: ... + + class MapSfixed32Sfixed32Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllTypesProto3.MapSfixed32Sfixed32Entry: ... + + class MapSfixed64Sfixed64Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllTypesProto3.MapSfixed64Sfixed64Entry: ... + + class MapInt32FloatEntry(Message): + key: int + value: float + + def __init__(self, + key: Optional[int] = ..., + value: Optional[float] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllTypesProto3.MapInt32FloatEntry: ... + + class MapInt32DoubleEntry(Message): + key: int + value: float + + def __init__(self, + key: Optional[int] = ..., + value: Optional[float] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllTypesProto3.MapInt32DoubleEntry: ... + + class MapBoolBoolEntry(Message): + key: bool + value: bool + + def __init__(self, + key: Optional[bool] = ..., + value: Optional[bool] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllTypesProto3.MapBoolBoolEntry: ... + + class MapStringStringEntry(Message): + key: Text + value: Text + + def __init__(self, + key: Optional[Text] = ..., + value: Optional[Text] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllTypesProto3.MapStringStringEntry: ... + + class MapStringBytesEntry(Message): + key: Text + value: bytes + + def __init__(self, + key: Optional[Text] = ..., + value: Optional[bytes] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllTypesProto3.MapStringBytesEntry: ... + + class MapStringNestedMessageEntry(Message): + key: Text + + @property + def value(self) -> TestAllTypesProto3.NestedMessage: ... + + def __init__(self, + key: Optional[Text] = ..., + value: Optional[TestAllTypesProto3.NestedMessage] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllTypesProto3.MapStringNestedMessageEntry: ... + + class MapStringForeignMessageEntry(Message): + key: Text + + @property + def value(self) -> ForeignMessage: ... + + def __init__(self, + key: Optional[Text] = ..., + value: Optional[ForeignMessage] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllTypesProto3.MapStringForeignMessageEntry: ... + + class MapStringNestedEnumEntry(Message): + key: Text + value: TestAllTypesProto3.NestedEnum + + def __init__(self, + key: Optional[Text] = ..., + value: Optional[TestAllTypesProto3.NestedEnum] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllTypesProto3.MapStringNestedEnumEntry: ... + + class MapStringForeignEnumEntry(Message): + key: Text + value: ForeignEnum + + def __init__(self, + key: Optional[Text] = ..., + value: Optional[ForeignEnum] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllTypesProto3.MapStringForeignEnumEntry: ... + optional_int32: int + optional_int64: int + optional_uint32: int + optional_uint64: int + optional_sint32: int + optional_sint64: int + optional_fixed32: int + optional_fixed64: int + optional_sfixed32: int + optional_sfixed64: int + optional_float: float + optional_double: float + optional_bool: bool + optional_string: Text + optional_bytes: bytes + optional_nested_enum: TestAllTypesProto3.NestedEnum + optional_foreign_enum: ForeignEnum + optional_string_piece: Text + optional_cord: Text + repeated_int32: RepeatedScalarFieldContainer[int] + repeated_int64: RepeatedScalarFieldContainer[int] + repeated_uint32: RepeatedScalarFieldContainer[int] + repeated_uint64: RepeatedScalarFieldContainer[int] + repeated_sint32: RepeatedScalarFieldContainer[int] + repeated_sint64: RepeatedScalarFieldContainer[int] + repeated_fixed32: RepeatedScalarFieldContainer[int] + repeated_fixed64: RepeatedScalarFieldContainer[int] + repeated_sfixed32: RepeatedScalarFieldContainer[int] + repeated_sfixed64: RepeatedScalarFieldContainer[int] + repeated_float: RepeatedScalarFieldContainer[float] + repeated_double: RepeatedScalarFieldContainer[float] + repeated_bool: RepeatedScalarFieldContainer[bool] + repeated_string: RepeatedScalarFieldContainer[Text] + repeated_bytes: RepeatedScalarFieldContainer[bytes] + repeated_nested_enum: RepeatedScalarFieldContainer[TestAllTypesProto3.NestedEnum] + repeated_foreign_enum: RepeatedScalarFieldContainer[ForeignEnum] + repeated_string_piece: RepeatedScalarFieldContainer[Text] + repeated_cord: RepeatedScalarFieldContainer[Text] + oneof_uint32: int + oneof_string: Text + oneof_bytes: bytes + oneof_bool: bool + oneof_uint64: int + oneof_float: float + oneof_double: float + oneof_enum: TestAllTypesProto3.NestedEnum + fieldname1: int + field_name2: int + _field_name3: int + field__name4_: int + field0name5: int + field_0_name6: int + fieldName7: int + FieldName8: int + field_Name9: int + Field_Name10: int + FIELD_NAME11: int + FIELD_name12: int + __field_name13: int + __Field_name14: int + field__name15: int + field__Name16: int + field_name17__: int + Field_name18__: int + + @property + def optional_nested_message(self) -> TestAllTypesProto3.NestedMessage: ... + + @property + def optional_foreign_message(self) -> ForeignMessage: ... + + @property + def recursive_message(self) -> TestAllTypesProto3: ... + + @property + def repeated_nested_message(self) -> RepeatedCompositeFieldContainer[TestAllTypesProto3.NestedMessage]: ... + + @property + def repeated_foreign_message(self) -> RepeatedCompositeFieldContainer[ForeignMessage]: ... + + @property + def map_int32_int32(self) -> MutableMapping[int, int]: ... + + @property + def map_int64_int64(self) -> MutableMapping[int, int]: ... + + @property + def map_uint32_uint32(self) -> MutableMapping[int, int]: ... + + @property + def map_uint64_uint64(self) -> MutableMapping[int, int]: ... + + @property + def map_sint32_sint32(self) -> MutableMapping[int, int]: ... + + @property + def map_sint64_sint64(self) -> MutableMapping[int, int]: ... + + @property + def map_fixed32_fixed32(self) -> MutableMapping[int, int]: ... + + @property + def map_fixed64_fixed64(self) -> MutableMapping[int, int]: ... + + @property + def map_sfixed32_sfixed32(self) -> MutableMapping[int, int]: ... + + @property + def map_sfixed64_sfixed64(self) -> MutableMapping[int, int]: ... + + @property + def map_int32_float(self) -> MutableMapping[int, float]: ... + + @property + def map_int32_double(self) -> MutableMapping[int, float]: ... + + @property + def map_bool_bool(self) -> MutableMapping[bool, bool]: ... + + @property + def map_string_string(self) -> MutableMapping[Text, Text]: ... + + @property + def map_string_bytes(self) -> MutableMapping[Text, bytes]: ... + + @property + def map_string_nested_message(self) -> MutableMapping[Text, TestAllTypesProto3.NestedMessage]: ... + + @property + def map_string_foreign_message(self) -> MutableMapping[Text, ForeignMessage]: ... + + @property + def map_string_nested_enum(self) -> MutableMapping[Text, TestAllTypesProto3.NestedEnum]: ... + + @property + def map_string_foreign_enum(self) -> MutableMapping[Text, ForeignEnum]: ... + + @property + def oneof_nested_message(self) -> TestAllTypesProto3.NestedMessage: ... + + @property + def optional_bool_wrapper(self) -> BoolValue: ... + + @property + def optional_int32_wrapper(self) -> Int32Value: ... + + @property + def optional_int64_wrapper(self) -> Int64Value: ... + + @property + def optional_uint32_wrapper(self) -> UInt32Value: ... + + @property + def optional_uint64_wrapper(self) -> UInt64Value: ... + + @property + def optional_float_wrapper(self) -> FloatValue: ... + + @property + def optional_double_wrapper(self) -> DoubleValue: ... + + @property + def optional_string_wrapper(self) -> StringValue: ... + + @property + def optional_bytes_wrapper(self) -> BytesValue: ... + + @property + def repeated_bool_wrapper(self) -> RepeatedCompositeFieldContainer[BoolValue]: ... + + @property + def repeated_int32_wrapper(self) -> RepeatedCompositeFieldContainer[Int32Value]: ... + + @property + def repeated_int64_wrapper(self) -> RepeatedCompositeFieldContainer[Int64Value]: ... + + @property + def repeated_uint32_wrapper(self) -> RepeatedCompositeFieldContainer[UInt32Value]: ... + + @property + def repeated_uint64_wrapper(self) -> RepeatedCompositeFieldContainer[UInt64Value]: ... + + @property + def repeated_float_wrapper(self) -> RepeatedCompositeFieldContainer[FloatValue]: ... + + @property + def repeated_double_wrapper(self) -> RepeatedCompositeFieldContainer[DoubleValue]: ... + + @property + def repeated_string_wrapper(self) -> RepeatedCompositeFieldContainer[StringValue]: ... + + @property + def repeated_bytes_wrapper(self) -> RepeatedCompositeFieldContainer[BytesValue]: ... + + @property + def optional_duration(self) -> Duration: ... + + @property + def optional_timestamp(self) -> Timestamp: ... + + @property + def optional_field_mask(self) -> FieldMask: ... + + @property + def optional_struct(self) -> Struct: ... + + @property + def optional_any(self) -> Any: ... + + @property + def optional_value(self) -> Value: ... + + @property + def repeated_duration(self) -> RepeatedCompositeFieldContainer[Duration]: ... + + @property + def repeated_timestamp(self) -> RepeatedCompositeFieldContainer[Timestamp]: ... + + @property + def repeated_fieldmask(self) -> RepeatedCompositeFieldContainer[FieldMask]: ... + + @property + def repeated_struct(self) -> RepeatedCompositeFieldContainer[Struct]: ... + + @property + def repeated_any(self) -> RepeatedCompositeFieldContainer[Any]: ... + + @property + def repeated_value(self) -> RepeatedCompositeFieldContainer[Value]: ... + + def __init__(self, + optional_int32: Optional[int] = ..., + optional_int64: Optional[int] = ..., + optional_uint32: Optional[int] = ..., + optional_uint64: Optional[int] = ..., + optional_sint32: Optional[int] = ..., + optional_sint64: Optional[int] = ..., + optional_fixed32: Optional[int] = ..., + optional_fixed64: Optional[int] = ..., + optional_sfixed32: Optional[int] = ..., + optional_sfixed64: Optional[int] = ..., + optional_float: Optional[float] = ..., + optional_double: Optional[float] = ..., + optional_bool: Optional[bool] = ..., + optional_string: Optional[Text] = ..., + optional_bytes: Optional[bytes] = ..., + optional_nested_message: Optional[TestAllTypesProto3.NestedMessage] = ..., + optional_foreign_message: Optional[ForeignMessage] = ..., + optional_nested_enum: Optional[TestAllTypesProto3.NestedEnum] = ..., + optional_foreign_enum: Optional[ForeignEnum] = ..., + optional_string_piece: Optional[Text] = ..., + optional_cord: Optional[Text] = ..., + recursive_message: Optional[TestAllTypesProto3] = ..., + repeated_int32: Optional[Iterable[int]] = ..., + repeated_int64: Optional[Iterable[int]] = ..., + repeated_uint32: Optional[Iterable[int]] = ..., + repeated_uint64: Optional[Iterable[int]] = ..., + repeated_sint32: Optional[Iterable[int]] = ..., + repeated_sint64: Optional[Iterable[int]] = ..., + repeated_fixed32: Optional[Iterable[int]] = ..., + repeated_fixed64: Optional[Iterable[int]] = ..., + repeated_sfixed32: Optional[Iterable[int]] = ..., + repeated_sfixed64: Optional[Iterable[int]] = ..., + repeated_float: Optional[Iterable[float]] = ..., + repeated_double: Optional[Iterable[float]] = ..., + repeated_bool: Optional[Iterable[bool]] = ..., + repeated_string: Optional[Iterable[Text]] = ..., + repeated_bytes: Optional[Iterable[bytes]] = ..., + repeated_nested_message: Optional[Iterable[TestAllTypesProto3.NestedMessage]] = ..., + repeated_foreign_message: Optional[Iterable[ForeignMessage]] = ..., + repeated_nested_enum: Optional[Iterable[TestAllTypesProto3.NestedEnum]] = ..., + repeated_foreign_enum: Optional[Iterable[ForeignEnum]] = ..., + repeated_string_piece: Optional[Iterable[Text]] = ..., + repeated_cord: Optional[Iterable[Text]] = ..., + map_int32_int32: Optional[Mapping[int, int]] = ..., + map_int64_int64: Optional[Mapping[int, int]] = ..., + map_uint32_uint32: Optional[Mapping[int, int]] = ..., + map_uint64_uint64: Optional[Mapping[int, int]] = ..., + map_sint32_sint32: Optional[Mapping[int, int]] = ..., + map_sint64_sint64: Optional[Mapping[int, int]] = ..., + map_fixed32_fixed32: Optional[Mapping[int, int]] = ..., + map_fixed64_fixed64: Optional[Mapping[int, int]] = ..., + map_sfixed32_sfixed32: Optional[Mapping[int, int]] = ..., + map_sfixed64_sfixed64: Optional[Mapping[int, int]] = ..., + map_int32_float: Optional[Mapping[int, float]] = ..., + map_int32_double: Optional[Mapping[int, float]] = ..., + map_bool_bool: Optional[Mapping[bool, bool]] = ..., + map_string_string: Optional[Mapping[Text, Text]] = ..., + map_string_bytes: Optional[Mapping[Text, bytes]] = ..., + map_string_nested_message: Optional[Mapping[Text, TestAllTypesProto3.NestedMessage]] = ..., + map_string_foreign_message: Optional[Mapping[Text, ForeignMessage]] = ..., + map_string_nested_enum: Optional[Mapping[Text, TestAllTypesProto3.NestedEnum]] = ..., + map_string_foreign_enum: Optional[Mapping[Text, ForeignEnum]] = ..., + oneof_uint32: Optional[int] = ..., + oneof_nested_message: Optional[TestAllTypesProto3.NestedMessage] = ..., + oneof_string: Optional[Text] = ..., + oneof_bytes: Optional[bytes] = ..., + oneof_bool: Optional[bool] = ..., + oneof_uint64: Optional[int] = ..., + oneof_float: Optional[float] = ..., + oneof_double: Optional[float] = ..., + oneof_enum: Optional[TestAllTypesProto3.NestedEnum] = ..., + optional_bool_wrapper: Optional[BoolValue] = ..., + optional_int32_wrapper: Optional[Int32Value] = ..., + optional_int64_wrapper: Optional[Int64Value] = ..., + optional_uint32_wrapper: Optional[UInt32Value] = ..., + optional_uint64_wrapper: Optional[UInt64Value] = ..., + optional_float_wrapper: Optional[FloatValue] = ..., + optional_double_wrapper: Optional[DoubleValue] = ..., + optional_string_wrapper: Optional[StringValue] = ..., + optional_bytes_wrapper: Optional[BytesValue] = ..., + repeated_bool_wrapper: Optional[Iterable[BoolValue]] = ..., + repeated_int32_wrapper: Optional[Iterable[Int32Value]] = ..., + repeated_int64_wrapper: Optional[Iterable[Int64Value]] = ..., + repeated_uint32_wrapper: Optional[Iterable[UInt32Value]] = ..., + repeated_uint64_wrapper: Optional[Iterable[UInt64Value]] = ..., + repeated_float_wrapper: Optional[Iterable[FloatValue]] = ..., + repeated_double_wrapper: Optional[Iterable[DoubleValue]] = ..., + repeated_string_wrapper: Optional[Iterable[StringValue]] = ..., + repeated_bytes_wrapper: Optional[Iterable[BytesValue]] = ..., + optional_duration: Optional[Duration] = ..., + optional_timestamp: Optional[Timestamp] = ..., + optional_field_mask: Optional[FieldMask] = ..., + optional_struct: Optional[Struct] = ..., + optional_any: Optional[Any] = ..., + optional_value: Optional[Value] = ..., + repeated_duration: Optional[Iterable[Duration]] = ..., + repeated_timestamp: Optional[Iterable[Timestamp]] = ..., + repeated_fieldmask: Optional[Iterable[FieldMask]] = ..., + repeated_struct: Optional[Iterable[Struct]] = ..., + repeated_any: Optional[Iterable[Any]] = ..., + repeated_value: Optional[Iterable[Value]] = ..., + fieldname1: Optional[int] = ..., + field_name2: Optional[int] = ..., + _field_name3: Optional[int] = ..., + field__name4_: Optional[int] = ..., + field0name5: Optional[int] = ..., + field_0_name6: Optional[int] = ..., + fieldName7: Optional[int] = ..., + FieldName8: Optional[int] = ..., + field_Name9: Optional[int] = ..., + Field_Name10: Optional[int] = ..., + FIELD_NAME11: Optional[int] = ..., + FIELD_name12: Optional[int] = ..., + __field_name13: Optional[int] = ..., + __Field_name14: Optional[int] = ..., + field__name15: Optional[int] = ..., + field__Name16: Optional[int] = ..., + field_name17__: Optional[int] = ..., + Field_name18__: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllTypesProto3: ... + + +class ForeignMessage(Message): + c: int + + def __init__(self, + c: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> ForeignMessage: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/timestamp_pb2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/timestamp_pb2.pyi new file mode 100644 index 0000000..77ae305 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/timestamp_pb2.pyi @@ -0,0 +1,21 @@ +from google.protobuf.message import ( + Message, +) +from google.protobuf.internal import well_known_types + +from typing import ( + Optional, +) + + +class Timestamp(Message, well_known_types.Timestamp): + seconds: int + nanos: int + + def __init__(self, + seconds: Optional[int] = ..., + nanos: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> Timestamp: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/type_pb2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/type_pb2.pyi new file mode 100644 index 0000000..e3ff9b1 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/type_pb2.pyi @@ -0,0 +1,215 @@ +from google.protobuf.any_pb2 import ( + Any, +) +from google.protobuf.internal.containers import ( + RepeatedCompositeFieldContainer, + RepeatedScalarFieldContainer, +) +from google.protobuf.message import ( + Message, +) +from google.protobuf.source_context_pb2 import ( + SourceContext, +) +from typing import ( + Iterable, + List, + Optional, + Text, + Tuple, + cast, +) + + +class Syntax(int): + + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> Syntax: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[Syntax]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, Syntax]]: ... + + +SYNTAX_PROTO2: Syntax +SYNTAX_PROTO3: Syntax + + +class Type(Message): + name: Text + oneofs: RepeatedScalarFieldContainer[Text] + syntax: Syntax + + @property + def fields(self) -> RepeatedCompositeFieldContainer[Field]: ... + + @property + def options(self) -> RepeatedCompositeFieldContainer[Option]: ... + + @property + def source_context(self) -> SourceContext: ... + + def __init__(self, + name: Optional[Text] = ..., + fields: Optional[Iterable[Field]] = ..., + oneofs: Optional[Iterable[Text]] = ..., + options: Optional[Iterable[Option]] = ..., + source_context: Optional[SourceContext] = ..., + syntax: Optional[Syntax] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> Type: ... + + +class Field(Message): + + class Kind(int): + + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> Field.Kind: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[Field.Kind]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, Field.Kind]]: ... + TYPE_UNKNOWN: Field.Kind + TYPE_DOUBLE: Field.Kind + TYPE_FLOAT: Field.Kind + TYPE_INT64: Field.Kind + TYPE_UINT64: Field.Kind + TYPE_INT32: Field.Kind + TYPE_FIXED64: Field.Kind + TYPE_FIXED32: Field.Kind + TYPE_BOOL: Field.Kind + TYPE_STRING: Field.Kind + TYPE_GROUP: Field.Kind + TYPE_MESSAGE: Field.Kind + TYPE_BYTES: Field.Kind + TYPE_UINT32: Field.Kind + TYPE_ENUM: Field.Kind + TYPE_SFIXED32: Field.Kind + TYPE_SFIXED64: Field.Kind + TYPE_SINT32: Field.Kind + TYPE_SINT64: Field.Kind + + class Cardinality(int): + + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> Field.Cardinality: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[Field.Cardinality]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, Field.Cardinality]]: ... + CARDINALITY_UNKNOWN: Field.Cardinality + CARDINALITY_OPTIONAL: Field.Cardinality + CARDINALITY_REQUIRED: Field.Cardinality + CARDINALITY_REPEATED: Field.Cardinality + kind: Field.Kind + cardinality: Field.Cardinality + number: int + name: Text + type_url: Text + oneof_index: int + packed: bool + json_name: Text + default_value: Text + + @property + def options(self) -> RepeatedCompositeFieldContainer[Option]: ... + + def __init__(self, + kind: Optional[Field.Kind] = ..., + cardinality: Optional[Field.Cardinality] = ..., + number: Optional[int] = ..., + name: Optional[Text] = ..., + type_url: Optional[Text] = ..., + oneof_index: Optional[int] = ..., + packed: Optional[bool] = ..., + options: Optional[Iterable[Option]] = ..., + json_name: Optional[Text] = ..., + default_value: Optional[Text] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> Field: ... + + +class Enum(Message): + name: Text + syntax: Syntax + + @property + def enumvalue(self) -> RepeatedCompositeFieldContainer[EnumValue]: ... + + @property + def options(self) -> RepeatedCompositeFieldContainer[Option]: ... + + @property + def source_context(self) -> SourceContext: ... + + def __init__(self, + name: Optional[Text] = ..., + enumvalue: Optional[Iterable[EnumValue]] = ..., + options: Optional[Iterable[Option]] = ..., + source_context: Optional[SourceContext] = ..., + syntax: Optional[Syntax] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> Enum: ... + + +class EnumValue(Message): + name: Text + number: int + + @property + def options(self) -> RepeatedCompositeFieldContainer[Option]: ... + + def __init__(self, + name: Optional[Text] = ..., + number: Optional[int] = ..., + options: Optional[Iterable[Option]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> EnumValue: ... + + +class Option(Message): + name: Text + + @property + def value(self) -> Any: ... + + def __init__(self, + name: Optional[Text] = ..., + value: Optional[Any] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> Option: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_arena_pb2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_arena_pb2.pyi new file mode 100644 index 0000000..89d6042 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_arena_pb2.pyi @@ -0,0 +1,43 @@ +from google.protobuf.internal.containers import ( + RepeatedCompositeFieldContainer, +) +from google.protobuf.message import ( + Message, +) +from google.protobuf.unittest_no_arena_import_pb2 import ( + ImportNoArenaNestedMessage, +) +from typing import ( + Iterable, + Optional, +) + + +class NestedMessage(Message): + d: int + + def __init__(self, + d: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> NestedMessage: ... + + +class ArenaMessage(Message): + + @property + def repeated_nested_message( + self) -> RepeatedCompositeFieldContainer[NestedMessage]: ... + + @property + def repeated_import_no_arena_message( + self) -> RepeatedCompositeFieldContainer[ImportNoArenaNestedMessage]: ... + + def __init__(self, + repeated_nested_message: Optional[Iterable[NestedMessage]] = ..., + repeated_import_no_arena_message: Optional[Iterable[ImportNoArenaNestedMessage]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> ArenaMessage: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_custom_options_pb2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_custom_options_pb2.pyi new file mode 100644 index 0000000..5028e07 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_custom_options_pb2.pyi @@ -0,0 +1,472 @@ +from google.protobuf.descriptor_pb2 import ( + FileOptions, +) +from google.protobuf.internal.containers import ( + RepeatedCompositeFieldContainer, + RepeatedScalarFieldContainer, +) +from google.protobuf.message import ( + Message, +) +from typing import ( + Iterable, + List, + Optional, + Text, + Tuple, + cast, +) + + +class MethodOpt1(int): + + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> MethodOpt1: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[MethodOpt1]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, MethodOpt1]]: ... + + +METHODOPT1_VAL1: MethodOpt1 +METHODOPT1_VAL2: MethodOpt1 + + +class AggregateEnum(int): + + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> AggregateEnum: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[AggregateEnum]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, AggregateEnum]]: ... + + +VALUE: AggregateEnum + + +class TestMessageWithCustomOptions(Message): + + class AnEnum(int): + + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> TestMessageWithCustomOptions.AnEnum: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[TestMessageWithCustomOptions.AnEnum]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, + TestMessageWithCustomOptions.AnEnum]]: ... + ANENUM_VAL1: TestMessageWithCustomOptions.AnEnum + ANENUM_VAL2: TestMessageWithCustomOptions.AnEnum + field1: Text + oneof_field: int + + def __init__(self, + field1: Optional[Text] = ..., + oneof_field: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMessageWithCustomOptions: ... + + +class CustomOptionFooRequest(Message): + + def __init__(self, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> CustomOptionFooRequest: ... + + +class CustomOptionFooResponse(Message): + + def __init__(self, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> CustomOptionFooResponse: ... + + +class CustomOptionFooClientMessage(Message): + + def __init__(self, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> CustomOptionFooClientMessage: ... + + +class CustomOptionFooServerMessage(Message): + + def __init__(self, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> CustomOptionFooServerMessage: ... + + +class DummyMessageContainingEnum(Message): + + class TestEnumType(int): + + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> DummyMessageContainingEnum.TestEnumType: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[DummyMessageContainingEnum.TestEnumType]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, + DummyMessageContainingEnum.TestEnumType]]: ... + TEST_OPTION_ENUM_TYPE1: DummyMessageContainingEnum.TestEnumType + TEST_OPTION_ENUM_TYPE2: DummyMessageContainingEnum.TestEnumType + + def __init__(self, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> DummyMessageContainingEnum: ... + + +class DummyMessageInvalidAsOptionType(Message): + + def __init__(self, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> DummyMessageInvalidAsOptionType: ... + + +class CustomOptionMinIntegerValues(Message): + + def __init__(self, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> CustomOptionMinIntegerValues: ... + + +class CustomOptionMaxIntegerValues(Message): + + def __init__(self, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> CustomOptionMaxIntegerValues: ... + + +class CustomOptionOtherValues(Message): + + def __init__(self, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> CustomOptionOtherValues: ... + + +class SettingRealsFromPositiveInts(Message): + + def __init__(self, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> SettingRealsFromPositiveInts: ... + + +class SettingRealsFromNegativeInts(Message): + + def __init__(self, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> SettingRealsFromNegativeInts: ... + + +class ComplexOptionType1(Message): + foo: int + foo2: int + foo3: int + foo4: RepeatedScalarFieldContainer[int] + + def __init__(self, + foo: Optional[int] = ..., + foo2: Optional[int] = ..., + foo3: Optional[int] = ..., + foo4: Optional[Iterable[int]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> ComplexOptionType1: ... + + +class ComplexOptionType2(Message): + + class ComplexOptionType4(Message): + waldo: int + + def __init__(self, + waldo: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> ComplexOptionType2.ComplexOptionType4: ... + baz: int + + @property + def bar(self) -> ComplexOptionType1: ... + + @property + def fred(self) -> ComplexOptionType2.ComplexOptionType4: ... + + @property + def barney( + self) -> RepeatedCompositeFieldContainer[ComplexOptionType2.ComplexOptionType4]: ... + + def __init__(self, + bar: Optional[ComplexOptionType1] = ..., + baz: Optional[int] = ..., + fred: Optional[ComplexOptionType2.ComplexOptionType4] = ..., + barney: Optional[Iterable[ComplexOptionType2.ComplexOptionType4]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> ComplexOptionType2: ... + + +class ComplexOptionType3(Message): + + class ComplexOptionType5(Message): + plugh: int + + def __init__(self, + plugh: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> ComplexOptionType3.ComplexOptionType5: ... + qux: int + + @property + def complexoptiontype5(self) -> ComplexOptionType3.ComplexOptionType5: ... + + def __init__(self, + qux: Optional[int] = ..., + complexoptiontype5: Optional[ComplexOptionType3.ComplexOptionType5] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> ComplexOptionType3: ... + + +class ComplexOpt6(Message): + xyzzy: int + + def __init__(self, + xyzzy: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> ComplexOpt6: ... + + +class VariousComplexOptions(Message): + + def __init__(self, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> VariousComplexOptions: ... + + +class AggregateMessageSet(Message): + + def __init__(self, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> AggregateMessageSet: ... + + +class AggregateMessageSetElement(Message): + s: Text + + def __init__(self, + s: Optional[Text] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> AggregateMessageSetElement: ... + + +class Aggregate(Message): + i: int + s: Text + + @property + def sub(self) -> Aggregate: ... + + @property + def file(self) -> FileOptions: ... + + @property + def mset(self) -> AggregateMessageSet: ... + + def __init__(self, + i: Optional[int] = ..., + s: Optional[Text] = ..., + sub: Optional[Aggregate] = ..., + file: Optional[FileOptions] = ..., + mset: Optional[AggregateMessageSet] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> Aggregate: ... + + +class AggregateMessage(Message): + fieldname: int + + def __init__(self, + fieldname: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> AggregateMessage: ... + + +class NestedOptionType(Message): + + class NestedEnum(int): + + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> NestedOptionType.NestedEnum: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[NestedOptionType.NestedEnum]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, NestedOptionType.NestedEnum]]: ... + NESTED_ENUM_VALUE: NestedOptionType.NestedEnum + + class NestedMessage(Message): + nested_field: int + + def __init__(self, + nested_field: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> NestedOptionType.NestedMessage: ... + + def __init__(self, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> NestedOptionType: ... + + +class OldOptionType(Message): + + class TestEnum(int): + + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> OldOptionType.TestEnum: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[OldOptionType.TestEnum]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, OldOptionType.TestEnum]]: ... + OLD_VALUE: OldOptionType.TestEnum + value: OldOptionType.TestEnum + + def __init__(self, + value: OldOptionType.TestEnum, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> OldOptionType: ... + + +class NewOptionType(Message): + + class TestEnum(int): + + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> NewOptionType.TestEnum: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[NewOptionType.TestEnum]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, NewOptionType.TestEnum]]: ... + OLD_VALUE: NewOptionType.TestEnum + NEW_VALUE: NewOptionType.TestEnum + value: NewOptionType.TestEnum + + def __init__(self, + value: NewOptionType.TestEnum, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> NewOptionType: ... + + +class TestMessageWithRequiredEnumOption(Message): + + def __init__(self, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMessageWithRequiredEnumOption: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_import_pb2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_import_pb2.pyi new file mode 100644 index 0000000..92f1914 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_import_pb2.pyi @@ -0,0 +1,66 @@ +from google.protobuf.message import ( + Message, +) +from typing import ( + List, + Optional, + Tuple, + cast, +) + + +class ImportEnum(int): + + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> ImportEnum: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[ImportEnum]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, ImportEnum]]: ... + + +IMPORT_FOO: ImportEnum +IMPORT_BAR: ImportEnum +IMPORT_BAZ: ImportEnum + + +class ImportEnumForMap(int): + + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> ImportEnumForMap: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[ImportEnumForMap]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, ImportEnumForMap]]: ... + + +UNKNOWN: ImportEnumForMap +FOO: ImportEnumForMap +BAR: ImportEnumForMap + + +class ImportMessage(Message): + d: int + + def __init__(self, + d: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> ImportMessage: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_import_public_pb2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_import_public_pb2.pyi new file mode 100644 index 0000000..c8e13ff --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_import_public_pb2.pyi @@ -0,0 +1,17 @@ +from google.protobuf.message import ( + Message, +) +from typing import ( + Optional, +) + + +class PublicImportMessage(Message): + e: int + + def __init__(self, + e: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> PublicImportMessage: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_mset_pb2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_mset_pb2.pyi new file mode 100644 index 0000000..6366320 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_mset_pb2.pyi @@ -0,0 +1,75 @@ +from google.protobuf.internal.containers import ( + RepeatedCompositeFieldContainer, +) +from google.protobuf.message import ( + Message, +) +from google.protobuf.unittest_mset_wire_format_pb2 import ( + TestMessageSet, +) +import builtins +from typing import ( + Iterable, + Optional, + Text, +) + + +class TestMessageSetContainer(Message): + + @property + def message_set(self) -> TestMessageSet: ... + + def __init__(self, + message_set: Optional[TestMessageSet] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMessageSetContainer: ... + + +class TestMessageSetExtension1(Message): + i: int + + def __init__(self, + i: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMessageSetExtension1: ... + + +class TestMessageSetExtension2(Message): + str: Text + + def __init__(self, + bytes: Optional[Text] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: builtins.bytes) -> TestMessageSetExtension2: ... + + +class RawMessageSet(Message): + + class Item(Message): + type_id: int + message: bytes + + def __init__(self, + type_id: int, + message: bytes, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> RawMessageSet.Item: ... + + @property + def item(self) -> RepeatedCompositeFieldContainer[RawMessageSet.Item]: ... + + def __init__(self, + item: Optional[Iterable[RawMessageSet.Item]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> RawMessageSet: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_mset_wire_format_pb2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_mset_wire_format_pb2.pyi new file mode 100644 index 0000000..acb24a4 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_mset_wire_format_pb2.pyi @@ -0,0 +1,28 @@ +from google.protobuf.message import ( + Message, +) +from typing import ( + Optional, +) + + +class TestMessageSet(Message): + + def __init__(self, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMessageSet: ... + + +class TestMessageSetWireFormatContainer(Message): + + @property + def message_set(self) -> TestMessageSet: ... + + def __init__(self, + message_set: Optional[TestMessageSet] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMessageSetWireFormatContainer: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_no_arena_import_pb2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_no_arena_import_pb2.pyi new file mode 100644 index 0000000..c02e4d3 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_no_arena_import_pb2.pyi @@ -0,0 +1,17 @@ +from google.protobuf.message import ( + Message, +) +from typing import ( + Optional, +) + + +class ImportNoArenaNestedMessage(Message): + d: int + + def __init__(self, + d: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> ImportNoArenaNestedMessage: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_no_arena_pb2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_no_arena_pb2.pyi new file mode 100644 index 0000000..8a25622 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_no_arena_pb2.pyi @@ -0,0 +1,315 @@ +from google.protobuf.internal.containers import ( + RepeatedCompositeFieldContainer, + RepeatedScalarFieldContainer, +) +from google.protobuf.message import ( + Message, +) +from google.protobuf.unittest_arena_pb2 import ( + ArenaMessage, +) +from google.protobuf.unittest_import_pb2 import ( + ImportEnum, + ImportMessage, +) +from google.protobuf.unittest_import_public_pb2 import ( + PublicImportMessage, +) +from typing import ( + Iterable, + List, + Optional, + Text, + Tuple, + cast, +) + + +class ForeignEnum(int): + + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> ForeignEnum: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[ForeignEnum]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, ForeignEnum]]: ... + + +FOREIGN_FOO: ForeignEnum +FOREIGN_BAR: ForeignEnum +FOREIGN_BAZ: ForeignEnum + + +class TestAllTypes(Message): + + class NestedEnum(int): + + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> TestAllTypes.NestedEnum: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[TestAllTypes.NestedEnum]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, TestAllTypes.NestedEnum]]: ... + FOO: TestAllTypes.NestedEnum + BAR: TestAllTypes.NestedEnum + BAZ: TestAllTypes.NestedEnum + NEG: TestAllTypes.NestedEnum + + class NestedMessage(Message): + bb: int + + def __init__(self, + bb: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllTypes.NestedMessage: ... + + class OptionalGroup(Message): + a: int + + def __init__(self, + a: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllTypes.OptionalGroup: ... + + class RepeatedGroup(Message): + a: int + + def __init__(self, + a: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllTypes.RepeatedGroup: ... + optional_int32: int + optional_int64: int + optional_uint32: int + optional_uint64: int + optional_sint32: int + optional_sint64: int + optional_fixed32: int + optional_fixed64: int + optional_sfixed32: int + optional_sfixed64: int + optional_float: float + optional_double: float + optional_bool: bool + optional_string: Text + optional_bytes: bytes + optional_nested_enum: TestAllTypes.NestedEnum + optional_foreign_enum: ForeignEnum + optional_import_enum: ImportEnum + optional_string_piece: Text + optional_cord: Text + repeated_int32: RepeatedScalarFieldContainer[int] + repeated_int64: RepeatedScalarFieldContainer[int] + repeated_uint32: RepeatedScalarFieldContainer[int] + repeated_uint64: RepeatedScalarFieldContainer[int] + repeated_sint32: RepeatedScalarFieldContainer[int] + repeated_sint64: RepeatedScalarFieldContainer[int] + repeated_fixed32: RepeatedScalarFieldContainer[int] + repeated_fixed64: RepeatedScalarFieldContainer[int] + repeated_sfixed32: RepeatedScalarFieldContainer[int] + repeated_sfixed64: RepeatedScalarFieldContainer[int] + repeated_float: RepeatedScalarFieldContainer[float] + repeated_double: RepeatedScalarFieldContainer[float] + repeated_bool: RepeatedScalarFieldContainer[bool] + repeated_string: RepeatedScalarFieldContainer[Text] + repeated_bytes: RepeatedScalarFieldContainer[bytes] + repeated_nested_enum: RepeatedScalarFieldContainer[TestAllTypes.NestedEnum] + repeated_foreign_enum: RepeatedScalarFieldContainer[ForeignEnum] + repeated_import_enum: RepeatedScalarFieldContainer[ImportEnum] + repeated_string_piece: RepeatedScalarFieldContainer[Text] + repeated_cord: RepeatedScalarFieldContainer[Text] + default_int32: int + default_int64: int + default_uint32: int + default_uint64: int + default_sint32: int + default_sint64: int + default_fixed32: int + default_fixed64: int + default_sfixed32: int + default_sfixed64: int + default_float: float + default_double: float + default_bool: bool + default_string: Text + default_bytes: bytes + default_nested_enum: TestAllTypes.NestedEnum + default_foreign_enum: ForeignEnum + default_import_enum: ImportEnum + default_string_piece: Text + default_cord: Text + oneof_uint32: int + oneof_string: Text + oneof_bytes: bytes + + @property + def optionalgroup(self) -> TestAllTypes.OptionalGroup: ... + + @property + def optional_nested_message(self) -> TestAllTypes.NestedMessage: ... + + @property + def optional_foreign_message(self) -> ForeignMessage: ... + + @property + def optional_import_message(self) -> ImportMessage: ... + + @property + def optional_public_import_message(self) -> PublicImportMessage: ... + + @property + def optional_message(self) -> TestAllTypes.NestedMessage: ... + + @property + def repeatedgroup( + self) -> RepeatedCompositeFieldContainer[TestAllTypes.RepeatedGroup]: ... + + @property + def repeated_nested_message( + self) -> RepeatedCompositeFieldContainer[TestAllTypes.NestedMessage]: ... + + @property + def repeated_foreign_message( + self) -> RepeatedCompositeFieldContainer[ForeignMessage]: ... + + @property + def repeated_import_message( + self) -> RepeatedCompositeFieldContainer[ImportMessage]: ... + + @property + def repeated_lazy_message( + self) -> RepeatedCompositeFieldContainer[TestAllTypes.NestedMessage]: ... + + @property + def oneof_nested_message(self) -> TestAllTypes.NestedMessage: ... + + @property + def lazy_oneof_nested_message(self) -> TestAllTypes.NestedMessage: ... + + def __init__(self, + optional_int32: Optional[int] = ..., + optional_int64: Optional[int] = ..., + optional_uint32: Optional[int] = ..., + optional_uint64: Optional[int] = ..., + optional_sint32: Optional[int] = ..., + optional_sint64: Optional[int] = ..., + optional_fixed32: Optional[int] = ..., + optional_fixed64: Optional[int] = ..., + optional_sfixed32: Optional[int] = ..., + optional_sfixed64: Optional[int] = ..., + optional_float: Optional[float] = ..., + optional_double: Optional[float] = ..., + optional_bool: Optional[bool] = ..., + optional_string: Optional[Text] = ..., + optional_bytes: Optional[bytes] = ..., + optionalgroup: Optional[TestAllTypes.OptionalGroup] = ..., + optional_nested_message: Optional[TestAllTypes.NestedMessage] = ..., + optional_foreign_message: Optional[ForeignMessage] = ..., + optional_import_message: Optional[ImportMessage] = ..., + optional_nested_enum: Optional[TestAllTypes.NestedEnum] = ..., + optional_foreign_enum: Optional[ForeignEnum] = ..., + optional_import_enum: Optional[ImportEnum] = ..., + optional_string_piece: Optional[Text] = ..., + optional_cord: Optional[Text] = ..., + optional_public_import_message: Optional[PublicImportMessage] = ..., + optional_message: Optional[TestAllTypes.NestedMessage] = ..., + repeated_int32: Optional[Iterable[int]] = ..., + repeated_int64: Optional[Iterable[int]] = ..., + repeated_uint32: Optional[Iterable[int]] = ..., + repeated_uint64: Optional[Iterable[int]] = ..., + repeated_sint32: Optional[Iterable[int]] = ..., + repeated_sint64: Optional[Iterable[int]] = ..., + repeated_fixed32: Optional[Iterable[int]] = ..., + repeated_fixed64: Optional[Iterable[int]] = ..., + repeated_sfixed32: Optional[Iterable[int]] = ..., + repeated_sfixed64: Optional[Iterable[int]] = ..., + repeated_float: Optional[Iterable[float]] = ..., + repeated_double: Optional[Iterable[float]] = ..., + repeated_bool: Optional[Iterable[bool]] = ..., + repeated_string: Optional[Iterable[Text]] = ..., + repeated_bytes: Optional[Iterable[bytes]] = ..., + repeatedgroup: Optional[Iterable[TestAllTypes.RepeatedGroup]] = ..., + repeated_nested_message: Optional[Iterable[TestAllTypes.NestedMessage]] = ..., + repeated_foreign_message: Optional[Iterable[ForeignMessage]] = ..., + repeated_import_message: Optional[Iterable[ImportMessage]] = ..., + repeated_nested_enum: Optional[Iterable[TestAllTypes.NestedEnum]] = ..., + repeated_foreign_enum: Optional[Iterable[ForeignEnum]] = ..., + repeated_import_enum: Optional[Iterable[ImportEnum]] = ..., + repeated_string_piece: Optional[Iterable[Text]] = ..., + repeated_cord: Optional[Iterable[Text]] = ..., + repeated_lazy_message: Optional[Iterable[TestAllTypes.NestedMessage]] = ..., + default_int32: Optional[int] = ..., + default_int64: Optional[int] = ..., + default_uint32: Optional[int] = ..., + default_uint64: Optional[int] = ..., + default_sint32: Optional[int] = ..., + default_sint64: Optional[int] = ..., + default_fixed32: Optional[int] = ..., + default_fixed64: Optional[int] = ..., + default_sfixed32: Optional[int] = ..., + default_sfixed64: Optional[int] = ..., + default_float: Optional[float] = ..., + default_double: Optional[float] = ..., + default_bool: Optional[bool] = ..., + default_string: Optional[Text] = ..., + default_bytes: Optional[bytes] = ..., + default_nested_enum: Optional[TestAllTypes.NestedEnum] = ..., + default_foreign_enum: Optional[ForeignEnum] = ..., + default_import_enum: Optional[ImportEnum] = ..., + default_string_piece: Optional[Text] = ..., + default_cord: Optional[Text] = ..., + oneof_uint32: Optional[int] = ..., + oneof_nested_message: Optional[TestAllTypes.NestedMessage] = ..., + oneof_string: Optional[Text] = ..., + oneof_bytes: Optional[bytes] = ..., + lazy_oneof_nested_message: Optional[TestAllTypes.NestedMessage] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllTypes: ... + + +class ForeignMessage(Message): + c: int + + def __init__(self, + c: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> ForeignMessage: ... + + +class TestNoArenaMessage(Message): + + @property + def arena_message(self) -> ArenaMessage: ... + + def __init__(self, + arena_message: Optional[ArenaMessage] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestNoArenaMessage: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_no_generic_services_pb2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_no_generic_services_pb2.pyi new file mode 100644 index 0000000..b65863b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_no_generic_services_pb2.pyi @@ -0,0 +1,40 @@ +from google.protobuf.message import ( + Message, +) +from typing import ( + List, + Optional, + Tuple, + cast, +) + + +class TestEnum(int): + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> TestEnum: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[TestEnum]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, TestEnum]]: ... + + +FOO: TestEnum + + +class TestMessage(Message): + a: int + + def __init__(self, + a: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMessage: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_pb2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_pb2.pyi new file mode 100644 index 0000000..7f05257 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_pb2.pyi @@ -0,0 +1,1777 @@ +from google.protobuf.internal.containers import ( + RepeatedCompositeFieldContainer, + RepeatedScalarFieldContainer, +) +from google.protobuf.message import ( + Message, +) +from google.protobuf.unittest_import_pb2 import ( + ImportEnum, + ImportMessage, +) +from google.protobuf.unittest_import_public_pb2 import ( + PublicImportMessage, +) +from typing import ( + Iterable, + List, + Mapping, + MutableMapping, + Optional, + Text, + Tuple, + cast, +) + + +class ForeignEnum(int): + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> ForeignEnum: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[ForeignEnum]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, ForeignEnum]]: ... + + +FOREIGN_FOO: ForeignEnum +FOREIGN_BAR: ForeignEnum +FOREIGN_BAZ: ForeignEnum + + +class TestEnumWithDupValue(int): + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> TestEnumWithDupValue: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[TestEnumWithDupValue]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, TestEnumWithDupValue]]: ... + + +FOO1: TestEnumWithDupValue +BAR1: TestEnumWithDupValue +BAZ: TestEnumWithDupValue +FOO2: TestEnumWithDupValue +BAR2: TestEnumWithDupValue + + +class TestSparseEnum(int): + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> TestSparseEnum: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[TestSparseEnum]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, TestSparseEnum]]: ... + + +SPARSE_A: TestSparseEnum +SPARSE_B: TestSparseEnum +SPARSE_C: TestSparseEnum +SPARSE_D: TestSparseEnum +SPARSE_E: TestSparseEnum +SPARSE_F: TestSparseEnum +SPARSE_G: TestSparseEnum + + +class TestAllTypes(Message): + class NestedEnum(int): + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> TestAllTypes.NestedEnum: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[TestAllTypes.NestedEnum]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, TestAllTypes.NestedEnum]]: ... + FOO: TestAllTypes.NestedEnum + BAR: TestAllTypes.NestedEnum + BAZ: TestAllTypes.NestedEnum + NEG: TestAllTypes.NestedEnum + + class NestedMessage(Message): + bb: int + + def __init__(self, + bb: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllTypes.NestedMessage: ... + + class OptionalGroup(Message): + a: int + + def __init__(self, + a: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllTypes.OptionalGroup: ... + + class RepeatedGroup(Message): + a: int + + def __init__(self, + a: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllTypes.RepeatedGroup: ... + optional_int32: int + optional_int64: int + optional_uint32: int + optional_uint64: int + optional_sint32: int + optional_sint64: int + optional_fixed32: int + optional_fixed64: int + optional_sfixed32: int + optional_sfixed64: int + optional_float: float + optional_double: float + optional_bool: bool + optional_string: Text + optional_bytes: bytes + optional_nested_enum: TestAllTypes.NestedEnum + optional_foreign_enum: ForeignEnum + optional_import_enum: ImportEnum + optional_string_piece: Text + optional_cord: Text + repeated_int32: RepeatedScalarFieldContainer[int] + repeated_int64: RepeatedScalarFieldContainer[int] + repeated_uint32: RepeatedScalarFieldContainer[int] + repeated_uint64: RepeatedScalarFieldContainer[int] + repeated_sint32: RepeatedScalarFieldContainer[int] + repeated_sint64: RepeatedScalarFieldContainer[int] + repeated_fixed32: RepeatedScalarFieldContainer[int] + repeated_fixed64: RepeatedScalarFieldContainer[int] + repeated_sfixed32: RepeatedScalarFieldContainer[int] + repeated_sfixed64: RepeatedScalarFieldContainer[int] + repeated_float: RepeatedScalarFieldContainer[float] + repeated_double: RepeatedScalarFieldContainer[float] + repeated_bool: RepeatedScalarFieldContainer[bool] + repeated_string: RepeatedScalarFieldContainer[Text] + repeated_bytes: RepeatedScalarFieldContainer[bytes] + repeated_nested_enum: RepeatedScalarFieldContainer[TestAllTypes.NestedEnum] + repeated_foreign_enum: RepeatedScalarFieldContainer[ForeignEnum] + repeated_import_enum: RepeatedScalarFieldContainer[ImportEnum] + repeated_string_piece: RepeatedScalarFieldContainer[Text] + repeated_cord: RepeatedScalarFieldContainer[Text] + default_int32: int + default_int64: int + default_uint32: int + default_uint64: int + default_sint32: int + default_sint64: int + default_fixed32: int + default_fixed64: int + default_sfixed32: int + default_sfixed64: int + default_float: float + default_double: float + default_bool: bool + default_string: Text + default_bytes: bytes + default_nested_enum: TestAllTypes.NestedEnum + default_foreign_enum: ForeignEnum + default_import_enum: ImportEnum + default_string_piece: Text + default_cord: Text + oneof_uint32: int + oneof_string: Text + oneof_bytes: bytes + + @property + def optionalgroup(self) -> TestAllTypes.OptionalGroup: ... + + @property + def optional_nested_message(self) -> TestAllTypes.NestedMessage: ... + + @property + def optional_foreign_message(self) -> ForeignMessage: ... + + @property + def optional_import_message(self) -> ImportMessage: ... + + @property + def optional_public_import_message(self) -> PublicImportMessage: ... + + @property + def optional_lazy_message(self) -> TestAllTypes.NestedMessage: ... + + @property + def repeatedgroup( + self) -> RepeatedCompositeFieldContainer[TestAllTypes.RepeatedGroup]: ... + + @property + def repeated_nested_message( + self) -> RepeatedCompositeFieldContainer[TestAllTypes.NestedMessage]: ... + + @property + def repeated_foreign_message( + self) -> RepeatedCompositeFieldContainer[ForeignMessage]: ... + + @property + def repeated_import_message( + self) -> RepeatedCompositeFieldContainer[ImportMessage]: ... + + @property + def repeated_lazy_message( + self) -> RepeatedCompositeFieldContainer[TestAllTypes.NestedMessage]: ... + + @property + def oneof_nested_message(self) -> TestAllTypes.NestedMessage: ... + + def __init__(self, + optional_int32: Optional[int] = ..., + optional_int64: Optional[int] = ..., + optional_uint32: Optional[int] = ..., + optional_uint64: Optional[int] = ..., + optional_sint32: Optional[int] = ..., + optional_sint64: Optional[int] = ..., + optional_fixed32: Optional[int] = ..., + optional_fixed64: Optional[int] = ..., + optional_sfixed32: Optional[int] = ..., + optional_sfixed64: Optional[int] = ..., + optional_float: Optional[float] = ..., + optional_double: Optional[float] = ..., + optional_bool: Optional[bool] = ..., + optional_string: Optional[Text] = ..., + optional_bytes: Optional[bytes] = ..., + optionalgroup: Optional[TestAllTypes.OptionalGroup] = ..., + optional_nested_message: Optional[TestAllTypes.NestedMessage] = ..., + optional_foreign_message: Optional[ForeignMessage] = ..., + optional_import_message: Optional[ImportMessage] = ..., + optional_nested_enum: Optional[TestAllTypes.NestedEnum] = ..., + optional_foreign_enum: Optional[ForeignEnum] = ..., + optional_import_enum: Optional[ImportEnum] = ..., + optional_string_piece: Optional[Text] = ..., + optional_cord: Optional[Text] = ..., + optional_public_import_message: Optional[PublicImportMessage] = ..., + optional_lazy_message: Optional[TestAllTypes.NestedMessage] = ..., + repeated_int32: Optional[Iterable[int]] = ..., + repeated_int64: Optional[Iterable[int]] = ..., + repeated_uint32: Optional[Iterable[int]] = ..., + repeated_uint64: Optional[Iterable[int]] = ..., + repeated_sint32: Optional[Iterable[int]] = ..., + repeated_sint64: Optional[Iterable[int]] = ..., + repeated_fixed32: Optional[Iterable[int]] = ..., + repeated_fixed64: Optional[Iterable[int]] = ..., + repeated_sfixed32: Optional[Iterable[int]] = ..., + repeated_sfixed64: Optional[Iterable[int]] = ..., + repeated_float: Optional[Iterable[float]] = ..., + repeated_double: Optional[Iterable[float]] = ..., + repeated_bool: Optional[Iterable[bool]] = ..., + repeated_string: Optional[Iterable[Text]] = ..., + repeated_bytes: Optional[Iterable[bytes]] = ..., + repeatedgroup: Optional[Iterable[TestAllTypes.RepeatedGroup]] = ..., + repeated_nested_message: Optional[Iterable[TestAllTypes.NestedMessage]] = ..., + repeated_foreign_message: Optional[Iterable[ForeignMessage]] = ..., + repeated_import_message: Optional[Iterable[ImportMessage]] = ..., + repeated_nested_enum: Optional[Iterable[TestAllTypes.NestedEnum]] = ..., + repeated_foreign_enum: Optional[Iterable[ForeignEnum]] = ..., + repeated_import_enum: Optional[Iterable[ImportEnum]] = ..., + repeated_string_piece: Optional[Iterable[Text]] = ..., + repeated_cord: Optional[Iterable[Text]] = ..., + repeated_lazy_message: Optional[Iterable[TestAllTypes.NestedMessage]] = ..., + default_int32: Optional[int] = ..., + default_int64: Optional[int] = ..., + default_uint32: Optional[int] = ..., + default_uint64: Optional[int] = ..., + default_sint32: Optional[int] = ..., + default_sint64: Optional[int] = ..., + default_fixed32: Optional[int] = ..., + default_fixed64: Optional[int] = ..., + default_sfixed32: Optional[int] = ..., + default_sfixed64: Optional[int] = ..., + default_float: Optional[float] = ..., + default_double: Optional[float] = ..., + default_bool: Optional[bool] = ..., + default_string: Optional[Text] = ..., + default_bytes: Optional[bytes] = ..., + default_nested_enum: Optional[TestAllTypes.NestedEnum] = ..., + default_foreign_enum: Optional[ForeignEnum] = ..., + default_import_enum: Optional[ImportEnum] = ..., + default_string_piece: Optional[Text] = ..., + default_cord: Optional[Text] = ..., + oneof_uint32: Optional[int] = ..., + oneof_nested_message: Optional[TestAllTypes.NestedMessage] = ..., + oneof_string: Optional[Text] = ..., + oneof_bytes: Optional[bytes] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllTypes: ... + + +class NestedTestAllTypes(Message): + + @property + def child(self) -> NestedTestAllTypes: ... + + @property + def payload(self) -> TestAllTypes: ... + + @property + def repeated_child( + self) -> RepeatedCompositeFieldContainer[NestedTestAllTypes]: ... + + def __init__(self, + child: Optional[NestedTestAllTypes] = ..., + payload: Optional[TestAllTypes] = ..., + repeated_child: Optional[Iterable[NestedTestAllTypes]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> NestedTestAllTypes: ... + + +class TestDeprecatedFields(Message): + deprecated_int32: int + deprecated_int32_in_oneof: int + + def __init__(self, + deprecated_int32: Optional[int] = ..., + deprecated_int32_in_oneof: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestDeprecatedFields: ... + + +class TestDeprecatedMessage(Message): + + def __init__(self, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestDeprecatedMessage: ... + + +class ForeignMessage(Message): + c: int + d: int + + def __init__(self, + c: Optional[int] = ..., + d: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> ForeignMessage: ... + + +class TestReservedFields(Message): + + def __init__(self, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestReservedFields: ... + + +class TestAllExtensions(Message): + + def __init__(self, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllExtensions: ... + + +class OptionalGroup_extension(Message): + a: int + + def __init__(self, + a: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> OptionalGroup_extension: ... + + +class RepeatedGroup_extension(Message): + a: int + + def __init__(self, + a: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> RepeatedGroup_extension: ... + + +class TestGroup(Message): + class OptionalGroup(Message): + a: int + + def __init__(self, + a: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestGroup.OptionalGroup: ... + optional_foreign_enum: ForeignEnum + + @property + def optionalgroup(self) -> TestGroup.OptionalGroup: ... + + def __init__(self, + optionalgroup: Optional[TestGroup.OptionalGroup] = ..., + optional_foreign_enum: Optional[ForeignEnum] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestGroup: ... + + +class TestGroupExtension(Message): + + def __init__(self, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestGroupExtension: ... + + +class TestNestedExtension(Message): + class OptionalGroup_extension(Message): + a: int + + def __init__(self, + a: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestNestedExtension.OptionalGroup_extension: ... + + def __init__(self, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestNestedExtension: ... + + +class TestRequired(Message): + a: int + dummy2: int + b: int + dummy4: int + dummy5: int + dummy6: int + dummy7: int + dummy8: int + dummy9: int + dummy10: int + dummy11: int + dummy12: int + dummy13: int + dummy14: int + dummy15: int + dummy16: int + dummy17: int + dummy18: int + dummy19: int + dummy20: int + dummy21: int + dummy22: int + dummy23: int + dummy24: int + dummy25: int + dummy26: int + dummy27: int + dummy28: int + dummy29: int + dummy30: int + dummy31: int + dummy32: int + c: int + + def __init__(self, + a: int, + b: int, + c: int, + dummy2: Optional[int] = ..., + dummy4: Optional[int] = ..., + dummy5: Optional[int] = ..., + dummy6: Optional[int] = ..., + dummy7: Optional[int] = ..., + dummy8: Optional[int] = ..., + dummy9: Optional[int] = ..., + dummy10: Optional[int] = ..., + dummy11: Optional[int] = ..., + dummy12: Optional[int] = ..., + dummy13: Optional[int] = ..., + dummy14: Optional[int] = ..., + dummy15: Optional[int] = ..., + dummy16: Optional[int] = ..., + dummy17: Optional[int] = ..., + dummy18: Optional[int] = ..., + dummy19: Optional[int] = ..., + dummy20: Optional[int] = ..., + dummy21: Optional[int] = ..., + dummy22: Optional[int] = ..., + dummy23: Optional[int] = ..., + dummy24: Optional[int] = ..., + dummy25: Optional[int] = ..., + dummy26: Optional[int] = ..., + dummy27: Optional[int] = ..., + dummy28: Optional[int] = ..., + dummy29: Optional[int] = ..., + dummy30: Optional[int] = ..., + dummy31: Optional[int] = ..., + dummy32: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestRequired: ... + + +class TestRequiredForeign(Message): + dummy: int + + @property + def optional_message(self) -> TestRequired: ... + + @property + def repeated_message( + self) -> RepeatedCompositeFieldContainer[TestRequired]: ... + + def __init__(self, + optional_message: Optional[TestRequired] = ..., + repeated_message: Optional[Iterable[TestRequired]] = ..., + dummy: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestRequiredForeign: ... + + +class TestRequiredMessage(Message): + + @property + def optional_message(self) -> TestRequired: ... + + @property + def repeated_message( + self) -> RepeatedCompositeFieldContainer[TestRequired]: ... + + @property + def required_message(self) -> TestRequired: ... + + def __init__(self, + required_message: TestRequired, + optional_message: Optional[TestRequired] = ..., + repeated_message: Optional[Iterable[TestRequired]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestRequiredMessage: ... + + +class TestForeignNested(Message): + + @property + def foreign_nested(self) -> TestAllTypes.NestedMessage: ... + + def __init__(self, + foreign_nested: Optional[TestAllTypes.NestedMessage] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestForeignNested: ... + + +class TestEmptyMessage(Message): + + def __init__(self, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestEmptyMessage: ... + + +class TestEmptyMessageWithExtensions(Message): + + def __init__(self, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestEmptyMessageWithExtensions: ... + + +class TestMultipleExtensionRanges(Message): + + def __init__(self, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMultipleExtensionRanges: ... + + +class TestReallyLargeTagNumber(Message): + a: int + bb: int + + def __init__(self, + a: Optional[int] = ..., + bb: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestReallyLargeTagNumber: ... + + +class TestRecursiveMessage(Message): + i: int + + @property + def a(self) -> TestRecursiveMessage: ... + + def __init__(self, + a: Optional[TestRecursiveMessage] = ..., + i: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestRecursiveMessage: ... + + +class TestMutualRecursionA(Message): + class SubMessage(Message): + + @property + def b(self) -> TestMutualRecursionB: ... + + def __init__(self, + b: Optional[TestMutualRecursionB] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMutualRecursionA.SubMessage: ... + + class SubGroup(Message): + + @property + def sub_message(self) -> TestMutualRecursionA.SubMessage: ... + + @property + def not_in_this_scc(self) -> TestAllTypes: ... + + def __init__(self, + sub_message: Optional[TestMutualRecursionA.SubMessage] = ..., + not_in_this_scc: Optional[TestAllTypes] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMutualRecursionA.SubGroup: ... + + @property + def bb(self) -> TestMutualRecursionB: ... + + @property + def subgroup(self) -> TestMutualRecursionA.SubGroup: ... + + def __init__(self, + bb: Optional[TestMutualRecursionB] = ..., + subgroup: Optional[TestMutualRecursionA.SubGroup] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMutualRecursionA: ... + + +class TestMutualRecursionB(Message): + optional_int32: int + + @property + def a(self) -> TestMutualRecursionA: ... + + def __init__(self, + a: Optional[TestMutualRecursionA] = ..., + optional_int32: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMutualRecursionB: ... + + +class TestIsInitialized(Message): + class SubMessage(Message): + class SubGroup(Message): + i: int + + def __init__(self, + i: int, + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestIsInitialized.SubMessage.SubGroup: ... + + @property + def subgroup(self) -> TestIsInitialized.SubMessage.SubGroup: ... + + def __init__(self, + subgroup: Optional[TestIsInitialized.SubMessage.SubGroup] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestIsInitialized.SubMessage: ... + + @property + def sub_message(self) -> TestIsInitialized.SubMessage: ... + + def __init__(self, + sub_message: Optional[TestIsInitialized.SubMessage] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestIsInitialized: ... + + +class TestDupFieldNumber(Message): + class Foo(Message): + a: int + + def __init__(self, + a: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestDupFieldNumber.Foo: ... + + class Bar(Message): + a: int + + def __init__(self, + a: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestDupFieldNumber.Bar: ... + a: int + + @property + def foo(self) -> TestDupFieldNumber.Foo: ... + + @property + def bar(self) -> TestDupFieldNumber.Bar: ... + + def __init__(self, + a: Optional[int] = ..., + foo: Optional[TestDupFieldNumber.Foo] = ..., + bar: Optional[TestDupFieldNumber.Bar] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestDupFieldNumber: ... + + +class TestEagerMessage(Message): + + @property + def sub_message(self) -> TestAllTypes: ... + + def __init__(self, + sub_message: Optional[TestAllTypes] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestEagerMessage: ... + + +class TestLazyMessage(Message): + + @property + def sub_message(self) -> TestAllTypes: ... + + def __init__(self, + sub_message: Optional[TestAllTypes] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestLazyMessage: ... + + +class TestNestedMessageHasBits(Message): + class NestedMessage(Message): + nestedmessage_repeated_int32: RepeatedScalarFieldContainer[int] + + @property + def nestedmessage_repeated_foreignmessage( + self) -> RepeatedCompositeFieldContainer[ForeignMessage]: ... + + def __init__(self, + nestedmessage_repeated_int32: Optional[Iterable[int]] = ..., + nestedmessage_repeated_foreignmessage: Optional[Iterable[ForeignMessage]] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestNestedMessageHasBits.NestedMessage: ... + + @property + def optional_nested_message( + self) -> TestNestedMessageHasBits.NestedMessage: ... + + def __init__(self, + optional_nested_message: Optional[TestNestedMessageHasBits.NestedMessage] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestNestedMessageHasBits: ... + + +class TestCamelCaseFieldNames(Message): + PrimitiveField: int + StringField: Text + EnumField: ForeignEnum + StringPieceField: Text + CordField: Text + RepeatedPrimitiveField: RepeatedScalarFieldContainer[int] + RepeatedStringField: RepeatedScalarFieldContainer[Text] + RepeatedEnumField: RepeatedScalarFieldContainer[ForeignEnum] + RepeatedStringPieceField: RepeatedScalarFieldContainer[Text] + RepeatedCordField: RepeatedScalarFieldContainer[Text] + + @property + def MessageField(self) -> ForeignMessage: ... + + @property + def RepeatedMessageField( + self) -> RepeatedCompositeFieldContainer[ForeignMessage]: ... + + def __init__(self, + PrimitiveField: Optional[int] = ..., + StringField: Optional[Text] = ..., + EnumField: Optional[ForeignEnum] = ..., + MessageField: Optional[ForeignMessage] = ..., + StringPieceField: Optional[Text] = ..., + CordField: Optional[Text] = ..., + RepeatedPrimitiveField: Optional[Iterable[int]] = ..., + RepeatedStringField: Optional[Iterable[Text]] = ..., + RepeatedEnumField: Optional[Iterable[ForeignEnum]] = ..., + RepeatedMessageField: Optional[Iterable[ForeignMessage]] = ..., + RepeatedStringPieceField: Optional[Iterable[Text]] = ..., + RepeatedCordField: Optional[Iterable[Text]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestCamelCaseFieldNames: ... + + +class TestFieldOrderings(Message): + class NestedMessage(Message): + oo: int + bb: int + + def __init__(self, + oo: Optional[int] = ..., + bb: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestFieldOrderings.NestedMessage: ... + my_string: Text + my_int: int + my_float: float + + @property + def optional_nested_message(self) -> TestFieldOrderings.NestedMessage: ... + + def __init__(self, + my_string: Optional[Text] = ..., + my_int: Optional[int] = ..., + my_float: Optional[float] = ..., + optional_nested_message: Optional[TestFieldOrderings.NestedMessage] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestFieldOrderings: ... + + +class TestExtensionOrderings1(Message): + my_string: Text + + def __init__(self, + my_string: Optional[Text] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestExtensionOrderings1: ... + + +class TestExtensionOrderings2(Message): + class TestExtensionOrderings3(Message): + my_string: Text + + def __init__(self, + my_string: Optional[Text] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestExtensionOrderings2.TestExtensionOrderings3: ... + my_string: Text + + def __init__(self, + my_string: Optional[Text] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestExtensionOrderings2: ... + + +class TestExtremeDefaultValues(Message): + escaped_bytes: bytes + large_uint32: int + large_uint64: int + small_int32: int + small_int64: int + really_small_int32: int + really_small_int64: int + utf8_string: Text + zero_float: float + one_float: float + small_float: float + negative_one_float: float + negative_float: float + large_float: float + small_negative_float: float + inf_double: float + neg_inf_double: float + nan_double: float + inf_float: float + neg_inf_float: float + nan_float: float + cpp_trigraph: Text + string_with_zero: Text + bytes_with_zero: bytes + string_piece_with_zero: Text + cord_with_zero: Text + replacement_string: Text + + def __init__(self, + escaped_bytes: Optional[bytes] = ..., + large_uint32: Optional[int] = ..., + large_uint64: Optional[int] = ..., + small_int32: Optional[int] = ..., + small_int64: Optional[int] = ..., + really_small_int32: Optional[int] = ..., + really_small_int64: Optional[int] = ..., + utf8_string: Optional[Text] = ..., + zero_float: Optional[float] = ..., + one_float: Optional[float] = ..., + small_float: Optional[float] = ..., + negative_one_float: Optional[float] = ..., + negative_float: Optional[float] = ..., + large_float: Optional[float] = ..., + small_negative_float: Optional[float] = ..., + inf_double: Optional[float] = ..., + neg_inf_double: Optional[float] = ..., + nan_double: Optional[float] = ..., + inf_float: Optional[float] = ..., + neg_inf_float: Optional[float] = ..., + nan_float: Optional[float] = ..., + cpp_trigraph: Optional[Text] = ..., + string_with_zero: Optional[Text] = ..., + bytes_with_zero: Optional[bytes] = ..., + string_piece_with_zero: Optional[Text] = ..., + cord_with_zero: Optional[Text] = ..., + replacement_string: Optional[Text] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestExtremeDefaultValues: ... + + +class SparseEnumMessage(Message): + sparse_enum: TestSparseEnum + + def __init__(self, + sparse_enum: Optional[TestSparseEnum] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> SparseEnumMessage: ... + + +class OneString(Message): + data: Text + + def __init__(self, + data: Optional[Text] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> OneString: ... + + +class MoreString(Message): + data: RepeatedScalarFieldContainer[Text] + + def __init__(self, + data: Optional[Iterable[Text]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> MoreString: ... + + +class OneBytes(Message): + data: bytes + + def __init__(self, + data: Optional[bytes] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> OneBytes: ... + + +class MoreBytes(Message): + data: RepeatedScalarFieldContainer[bytes] + + def __init__(self, + data: Optional[Iterable[bytes]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> MoreBytes: ... + + +class Int32Message(Message): + data: int + + def __init__(self, + data: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> Int32Message: ... + + +class Uint32Message(Message): + data: int + + def __init__(self, + data: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> Uint32Message: ... + + +class Int64Message(Message): + data: int + + def __init__(self, + data: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> Int64Message: ... + + +class Uint64Message(Message): + data: int + + def __init__(self, + data: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> Uint64Message: ... + + +class BoolMessage(Message): + data: bool + + def __init__(self, + data: Optional[bool] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> BoolMessage: ... + + +class TestOneof(Message): + class FooGroup(Message): + a: int + b: Text + + def __init__(self, + a: Optional[int] = ..., + b: Optional[Text] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestOneof.FooGroup: ... + foo_int: int + foo_string: Text + + @property + def foo_message(self) -> TestAllTypes: ... + + @property + def foogroup(self) -> TestOneof.FooGroup: ... + + def __init__(self, + foo_int: Optional[int] = ..., + foo_string: Optional[Text] = ..., + foo_message: Optional[TestAllTypes] = ..., + foogroup: Optional[TestOneof.FooGroup] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestOneof: ... + + +class TestOneofBackwardsCompatible(Message): + class FooGroup(Message): + a: int + b: Text + + def __init__(self, + a: Optional[int] = ..., + b: Optional[Text] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestOneofBackwardsCompatible.FooGroup: ... + foo_int: int + foo_string: Text + + @property + def foo_message(self) -> TestAllTypes: ... + + @property + def foogroup(self) -> TestOneofBackwardsCompatible.FooGroup: ... + + def __init__(self, + foo_int: Optional[int] = ..., + foo_string: Optional[Text] = ..., + foo_message: Optional[TestAllTypes] = ..., + foogroup: Optional[TestOneofBackwardsCompatible.FooGroup] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestOneofBackwardsCompatible: ... + + +class TestOneof2(Message): + class NestedEnum(int): + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> TestOneof2.NestedEnum: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[TestOneof2.NestedEnum]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, TestOneof2.NestedEnum]]: ... + FOO: TestOneof2.NestedEnum + BAR: TestOneof2.NestedEnum + BAZ: TestOneof2.NestedEnum + + class FooGroup(Message): + a: int + b: Text + + def __init__(self, + a: Optional[int] = ..., + b: Optional[Text] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestOneof2.FooGroup: ... + + class NestedMessage(Message): + qux_int: int + corge_int: RepeatedScalarFieldContainer[int] + + def __init__(self, + qux_int: Optional[int] = ..., + corge_int: Optional[Iterable[int]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestOneof2.NestedMessage: ... + foo_int: int + foo_string: Text + foo_cord: Text + foo_string_piece: Text + foo_bytes: bytes + foo_enum: TestOneof2.NestedEnum + bar_int: int + bar_string: Text + bar_cord: Text + bar_string_piece: Text + bar_bytes: bytes + bar_enum: TestOneof2.NestedEnum + baz_int: int + baz_string: Text + + @property + def foo_message(self) -> TestOneof2.NestedMessage: ... + + @property + def foogroup(self) -> TestOneof2.FooGroup: ... + + @property + def foo_lazy_message(self) -> TestOneof2.NestedMessage: ... + + def __init__(self, + foo_int: Optional[int] = ..., + foo_string: Optional[Text] = ..., + foo_cord: Optional[Text] = ..., + foo_string_piece: Optional[Text] = ..., + foo_bytes: Optional[bytes] = ..., + foo_enum: Optional[TestOneof2.NestedEnum] = ..., + foo_message: Optional[TestOneof2.NestedMessage] = ..., + foogroup: Optional[TestOneof2.FooGroup] = ..., + foo_lazy_message: Optional[TestOneof2.NestedMessage] = ..., + bar_int: Optional[int] = ..., + bar_string: Optional[Text] = ..., + bar_cord: Optional[Text] = ..., + bar_string_piece: Optional[Text] = ..., + bar_bytes: Optional[bytes] = ..., + bar_enum: Optional[TestOneof2.NestedEnum] = ..., + baz_int: Optional[int] = ..., + baz_string: Optional[Text] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestOneof2: ... + + +class TestRequiredOneof(Message): + class NestedMessage(Message): + required_double: float + + def __init__(self, + required_double: float, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestRequiredOneof.NestedMessage: ... + foo_int: int + foo_string: Text + + @property + def foo_message(self) -> TestRequiredOneof.NestedMessage: ... + + def __init__(self, + foo_int: Optional[int] = ..., + foo_string: Optional[Text] = ..., + foo_message: Optional[TestRequiredOneof.NestedMessage] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestRequiredOneof: ... + + +class TestPackedTypes(Message): + packed_int32: RepeatedScalarFieldContainer[int] + packed_int64: RepeatedScalarFieldContainer[int] + packed_uint32: RepeatedScalarFieldContainer[int] + packed_uint64: RepeatedScalarFieldContainer[int] + packed_sint32: RepeatedScalarFieldContainer[int] + packed_sint64: RepeatedScalarFieldContainer[int] + packed_fixed32: RepeatedScalarFieldContainer[int] + packed_fixed64: RepeatedScalarFieldContainer[int] + packed_sfixed32: RepeatedScalarFieldContainer[int] + packed_sfixed64: RepeatedScalarFieldContainer[int] + packed_float: RepeatedScalarFieldContainer[float] + packed_double: RepeatedScalarFieldContainer[float] + packed_bool: RepeatedScalarFieldContainer[bool] + packed_enum: RepeatedScalarFieldContainer[ForeignEnum] + + def __init__(self, + packed_int32: Optional[Iterable[int]] = ..., + packed_int64: Optional[Iterable[int]] = ..., + packed_uint32: Optional[Iterable[int]] = ..., + packed_uint64: Optional[Iterable[int]] = ..., + packed_sint32: Optional[Iterable[int]] = ..., + packed_sint64: Optional[Iterable[int]] = ..., + packed_fixed32: Optional[Iterable[int]] = ..., + packed_fixed64: Optional[Iterable[int]] = ..., + packed_sfixed32: Optional[Iterable[int]] = ..., + packed_sfixed64: Optional[Iterable[int]] = ..., + packed_float: Optional[Iterable[float]] = ..., + packed_double: Optional[Iterable[float]] = ..., + packed_bool: Optional[Iterable[bool]] = ..., + packed_enum: Optional[Iterable[ForeignEnum]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestPackedTypes: ... + + +class TestUnpackedTypes(Message): + unpacked_int32: RepeatedScalarFieldContainer[int] + unpacked_int64: RepeatedScalarFieldContainer[int] + unpacked_uint32: RepeatedScalarFieldContainer[int] + unpacked_uint64: RepeatedScalarFieldContainer[int] + unpacked_sint32: RepeatedScalarFieldContainer[int] + unpacked_sint64: RepeatedScalarFieldContainer[int] + unpacked_fixed32: RepeatedScalarFieldContainer[int] + unpacked_fixed64: RepeatedScalarFieldContainer[int] + unpacked_sfixed32: RepeatedScalarFieldContainer[int] + unpacked_sfixed64: RepeatedScalarFieldContainer[int] + unpacked_float: RepeatedScalarFieldContainer[float] + unpacked_double: RepeatedScalarFieldContainer[float] + unpacked_bool: RepeatedScalarFieldContainer[bool] + unpacked_enum: RepeatedScalarFieldContainer[ForeignEnum] + + def __init__(self, + unpacked_int32: Optional[Iterable[int]] = ..., + unpacked_int64: Optional[Iterable[int]] = ..., + unpacked_uint32: Optional[Iterable[int]] = ..., + unpacked_uint64: Optional[Iterable[int]] = ..., + unpacked_sint32: Optional[Iterable[int]] = ..., + unpacked_sint64: Optional[Iterable[int]] = ..., + unpacked_fixed32: Optional[Iterable[int]] = ..., + unpacked_fixed64: Optional[Iterable[int]] = ..., + unpacked_sfixed32: Optional[Iterable[int]] = ..., + unpacked_sfixed64: Optional[Iterable[int]] = ..., + unpacked_float: Optional[Iterable[float]] = ..., + unpacked_double: Optional[Iterable[float]] = ..., + unpacked_bool: Optional[Iterable[bool]] = ..., + unpacked_enum: Optional[Iterable[ForeignEnum]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestUnpackedTypes: ... + + +class TestPackedExtensions(Message): + + def __init__(self, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestPackedExtensions: ... + + +class TestUnpackedExtensions(Message): + + def __init__(self, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestUnpackedExtensions: ... + + +class TestDynamicExtensions(Message): + class DynamicEnumType(int): + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> TestDynamicExtensions.DynamicEnumType: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[TestDynamicExtensions.DynamicEnumType]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, + TestDynamicExtensions.DynamicEnumType]]: ... + DYNAMIC_FOO: TestDynamicExtensions.DynamicEnumType + DYNAMIC_BAR: TestDynamicExtensions.DynamicEnumType + DYNAMIC_BAZ: TestDynamicExtensions.DynamicEnumType + + class DynamicMessageType(Message): + dynamic_field: int + + def __init__(self, + dynamic_field: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestDynamicExtensions.DynamicMessageType: ... + scalar_extension: int + enum_extension: ForeignEnum + dynamic_enum_extension: TestDynamicExtensions.DynamicEnumType + repeated_extension: RepeatedScalarFieldContainer[Text] + packed_extension: RepeatedScalarFieldContainer[int] + + @property + def message_extension(self) -> ForeignMessage: ... + + @property + def dynamic_message_extension( + self) -> TestDynamicExtensions.DynamicMessageType: ... + + def __init__(self, + scalar_extension: Optional[int] = ..., + enum_extension: Optional[ForeignEnum] = ..., + dynamic_enum_extension: Optional[TestDynamicExtensions.DynamicEnumType] = ..., + message_extension: Optional[ForeignMessage] = ..., + dynamic_message_extension: Optional[TestDynamicExtensions.DynamicMessageType] = ..., + repeated_extension: Optional[Iterable[Text]] = ..., + packed_extension: Optional[Iterable[int]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestDynamicExtensions: ... + + +class TestRepeatedScalarDifferentTagSizes(Message): + repeated_fixed32: RepeatedScalarFieldContainer[int] + repeated_int32: RepeatedScalarFieldContainer[int] + repeated_fixed64: RepeatedScalarFieldContainer[int] + repeated_int64: RepeatedScalarFieldContainer[int] + repeated_float: RepeatedScalarFieldContainer[float] + repeated_uint64: RepeatedScalarFieldContainer[int] + + def __init__(self, + repeated_fixed32: Optional[Iterable[int]] = ..., + repeated_int32: Optional[Iterable[int]] = ..., + repeated_fixed64: Optional[Iterable[int]] = ..., + repeated_int64: Optional[Iterable[int]] = ..., + repeated_float: Optional[Iterable[float]] = ..., + repeated_uint64: Optional[Iterable[int]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestRepeatedScalarDifferentTagSizes: ... + + +class TestParsingMerge(Message): + class RepeatedFieldsGenerator(Message): + class Group1(Message): + + @property + def field1(self) -> TestAllTypes: ... + + def __init__(self, + field1: Optional[TestAllTypes] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestParsingMerge.RepeatedFieldsGenerator.Group1: ... + + class Group2(Message): + + @property + def field1(self) -> TestAllTypes: ... + + def __init__(self, + field1: Optional[TestAllTypes] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestParsingMerge.RepeatedFieldsGenerator.Group2: ... + + @property + def field1(self) -> RepeatedCompositeFieldContainer[TestAllTypes]: ... + + @property + def field2(self) -> RepeatedCompositeFieldContainer[TestAllTypes]: ... + + @property + def field3(self) -> RepeatedCompositeFieldContainer[TestAllTypes]: ... + + @property + def group1( + self) -> RepeatedCompositeFieldContainer[TestParsingMerge.RepeatedFieldsGenerator.Group1]: ... + + @property + def group2( + self) -> RepeatedCompositeFieldContainer[TestParsingMerge.RepeatedFieldsGenerator.Group2]: ... + + @property + def ext1(self) -> RepeatedCompositeFieldContainer[TestAllTypes]: ... + + @property + def ext2(self) -> RepeatedCompositeFieldContainer[TestAllTypes]: ... + + def __init__(self, + field1: Optional[Iterable[TestAllTypes]] = ..., + field2: Optional[Iterable[TestAllTypes]] = ..., + field3: Optional[Iterable[TestAllTypes]] = ..., + group1: Optional[Iterable[TestParsingMerge.RepeatedFieldsGenerator.Group1]] = ..., + group2: Optional[Iterable[TestParsingMerge.RepeatedFieldsGenerator.Group2]] = ..., + ext1: Optional[Iterable[TestAllTypes]] = ..., + ext2: Optional[Iterable[TestAllTypes]] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestParsingMerge.RepeatedFieldsGenerator: ... + + class OptionalGroup(Message): + + @property + def optional_group_all_types(self) -> TestAllTypes: ... + + def __init__(self, + optional_group_all_types: Optional[TestAllTypes] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestParsingMerge.OptionalGroup: ... + + class RepeatedGroup(Message): + + @property + def repeated_group_all_types(self) -> TestAllTypes: ... + + def __init__(self, + repeated_group_all_types: Optional[TestAllTypes] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestParsingMerge.RepeatedGroup: ... + + @property + def required_all_types(self) -> TestAllTypes: ... + + @property + def optional_all_types(self) -> TestAllTypes: ... + + @property + def repeated_all_types( + self) -> RepeatedCompositeFieldContainer[TestAllTypes]: ... + + @property + def optionalgroup(self) -> TestParsingMerge.OptionalGroup: ... + + @property + def repeatedgroup( + self) -> RepeatedCompositeFieldContainer[TestParsingMerge.RepeatedGroup]: ... + + def __init__(self, + required_all_types: TestAllTypes, + optional_all_types: Optional[TestAllTypes] = ..., + repeated_all_types: Optional[Iterable[TestAllTypes]] = ..., + optionalgroup: Optional[TestParsingMerge.OptionalGroup] = ..., + repeatedgroup: Optional[Iterable[TestParsingMerge.RepeatedGroup]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestParsingMerge: ... + + +class TestCommentInjectionMessage(Message): + a: Text + + def __init__(self, + a: Optional[Text] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestCommentInjectionMessage: ... + + +class FooRequest(Message): + + def __init__(self, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> FooRequest: ... + + +class FooResponse(Message): + + def __init__(self, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> FooResponse: ... + + +class FooClientMessage(Message): + + def __init__(self, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> FooClientMessage: ... + + +class FooServerMessage(Message): + + def __init__(self, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> FooServerMessage: ... + + +class BarRequest(Message): + + def __init__(self, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> BarRequest: ... + + +class BarResponse(Message): + + def __init__(self, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> BarResponse: ... + + +class TestJsonName(Message): + field_name1: int + fieldName2: int + FieldName3: int + _field_name4: int + FIELD_NAME5: int + field_name6: int + + def __init__(self, + field_name1: Optional[int] = ..., + fieldName2: Optional[int] = ..., + FieldName3: Optional[int] = ..., + _field_name4: Optional[int] = ..., + FIELD_NAME5: Optional[int] = ..., + field_name6: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestJsonName: ... + + +class TestHugeFieldNumbers(Message): + class OptionalGroup(Message): + group_a: int + + def __init__(self, + group_a: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestHugeFieldNumbers.OptionalGroup: ... + + class StringStringMapEntry(Message): + key: Text + value: Text + + def __init__(self, + key: Optional[Text] = ..., + value: Optional[Text] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestHugeFieldNumbers.StringStringMapEntry: ... + optional_int32: int + fixed_32: int + repeated_int32: RepeatedScalarFieldContainer[int] + packed_int32: RepeatedScalarFieldContainer[int] + optional_enum: ForeignEnum + optional_string: Text + optional_bytes: bytes + oneof_uint32: int + oneof_string: Text + oneof_bytes: bytes + + @property + def optional_message(self) -> ForeignMessage: ... + + @property + def optionalgroup(self) -> TestHugeFieldNumbers.OptionalGroup: ... + + @property + def string_string_map(self) -> MutableMapping[Text, Text]: ... + + @property + def oneof_test_all_types(self) -> TestAllTypes: ... + + def __init__(self, + optional_int32: Optional[int] = ..., + fixed_32: Optional[int] = ..., + repeated_int32: Optional[Iterable[int]] = ..., + packed_int32: Optional[Iterable[int]] = ..., + optional_enum: Optional[ForeignEnum] = ..., + optional_string: Optional[Text] = ..., + optional_bytes: Optional[bytes] = ..., + optional_message: Optional[ForeignMessage] = ..., + optionalgroup: Optional[TestHugeFieldNumbers.OptionalGroup] = ..., + string_string_map: Optional[Mapping[Text, Text]] = ..., + oneof_uint32: Optional[int] = ..., + oneof_test_all_types: Optional[TestAllTypes] = ..., + oneof_string: Optional[Text] = ..., + oneof_bytes: Optional[bytes] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestHugeFieldNumbers: ... + + +class TestExtensionInsideTable(Message): + field1: int + field2: int + field3: int + field4: int + field6: int + field7: int + field8: int + field9: int + field10: int + + def __init__(self, + field1: Optional[int] = ..., + field2: Optional[int] = ..., + field3: Optional[int] = ..., + field4: Optional[int] = ..., + field6: Optional[int] = ..., + field7: Optional[int] = ..., + field8: Optional[int] = ..., + field9: Optional[int] = ..., + field10: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestExtensionInsideTable: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_proto3_arena_pb2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_proto3_arena_pb2.pyi new file mode 100644 index 0000000..9464062 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_proto3_arena_pb2.pyi @@ -0,0 +1,332 @@ +from google.protobuf.internal.containers import ( + RepeatedCompositeFieldContainer, + RepeatedScalarFieldContainer, +) +from google.protobuf.message import ( + Message, +) +from google.protobuf.unittest_import_pb2 import ( + ImportMessage, +) +from google.protobuf.unittest_import_public_pb2 import ( + PublicImportMessage, +) +from typing import ( + Iterable, + List, + Optional, + Text, + Tuple, + cast, +) + + +class ForeignEnum(int): + + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> ForeignEnum: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[ForeignEnum]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, ForeignEnum]]: ... + + +FOREIGN_ZERO: ForeignEnum +FOREIGN_FOO: ForeignEnum +FOREIGN_BAR: ForeignEnum +FOREIGN_BAZ: ForeignEnum + + +class TestAllTypes(Message): + + class NestedEnum(int): + + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> TestAllTypes.NestedEnum: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[TestAllTypes.NestedEnum]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, TestAllTypes.NestedEnum]]: ... + ZERO: TestAllTypes.NestedEnum + FOO: TestAllTypes.NestedEnum + BAR: TestAllTypes.NestedEnum + BAZ: TestAllTypes.NestedEnum + NEG: TestAllTypes.NestedEnum + + class NestedMessage(Message): + bb: int + + def __init__(self, + bb: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllTypes.NestedMessage: ... + optional_int32: int + optional_int64: int + optional_uint32: int + optional_uint64: int + optional_sint32: int + optional_sint64: int + optional_fixed32: int + optional_fixed64: int + optional_sfixed32: int + optional_sfixed64: int + optional_float: float + optional_double: float + optional_bool: bool + optional_string: Text + optional_bytes: bytes + optional_nested_enum: TestAllTypes.NestedEnum + optional_foreign_enum: ForeignEnum + optional_string_piece: Text + optional_cord: Text + repeated_int32: RepeatedScalarFieldContainer[int] + repeated_int64: RepeatedScalarFieldContainer[int] + repeated_uint32: RepeatedScalarFieldContainer[int] + repeated_uint64: RepeatedScalarFieldContainer[int] + repeated_sint32: RepeatedScalarFieldContainer[int] + repeated_sint64: RepeatedScalarFieldContainer[int] + repeated_fixed32: RepeatedScalarFieldContainer[int] + repeated_fixed64: RepeatedScalarFieldContainer[int] + repeated_sfixed32: RepeatedScalarFieldContainer[int] + repeated_sfixed64: RepeatedScalarFieldContainer[int] + repeated_float: RepeatedScalarFieldContainer[float] + repeated_double: RepeatedScalarFieldContainer[float] + repeated_bool: RepeatedScalarFieldContainer[bool] + repeated_string: RepeatedScalarFieldContainer[Text] + repeated_bytes: RepeatedScalarFieldContainer[bytes] + repeated_nested_enum: RepeatedScalarFieldContainer[TestAllTypes.NestedEnum] + repeated_foreign_enum: RepeatedScalarFieldContainer[ForeignEnum] + repeated_string_piece: RepeatedScalarFieldContainer[Text] + repeated_cord: RepeatedScalarFieldContainer[Text] + oneof_uint32: int + oneof_string: Text + oneof_bytes: bytes + + @property + def optional_nested_message(self) -> TestAllTypes.NestedMessage: ... + + @property + def optional_foreign_message(self) -> ForeignMessage: ... + + @property + def optional_import_message(self) -> ImportMessage: ... + + @property + def optional_public_import_message(self) -> PublicImportMessage: ... + + @property + def optional_lazy_message(self) -> TestAllTypes.NestedMessage: ... + + @property + def optional_lazy_import_message(self) -> ImportMessage: ... + + @property + def repeated_nested_message( + self) -> RepeatedCompositeFieldContainer[TestAllTypes.NestedMessage]: ... + + @property + def repeated_foreign_message( + self) -> RepeatedCompositeFieldContainer[ForeignMessage]: ... + + @property + def repeated_import_message( + self) -> RepeatedCompositeFieldContainer[ImportMessage]: ... + + @property + def repeated_lazy_message( + self) -> RepeatedCompositeFieldContainer[TestAllTypes.NestedMessage]: ... + + @property + def oneof_nested_message(self) -> TestAllTypes.NestedMessage: ... + + def __init__(self, + optional_int32: Optional[int] = ..., + optional_int64: Optional[int] = ..., + optional_uint32: Optional[int] = ..., + optional_uint64: Optional[int] = ..., + optional_sint32: Optional[int] = ..., + optional_sint64: Optional[int] = ..., + optional_fixed32: Optional[int] = ..., + optional_fixed64: Optional[int] = ..., + optional_sfixed32: Optional[int] = ..., + optional_sfixed64: Optional[int] = ..., + optional_float: Optional[float] = ..., + optional_double: Optional[float] = ..., + optional_bool: Optional[bool] = ..., + optional_string: Optional[Text] = ..., + optional_bytes: Optional[bytes] = ..., + optional_nested_message: Optional[TestAllTypes.NestedMessage] = ..., + optional_foreign_message: Optional[ForeignMessage] = ..., + optional_import_message: Optional[ImportMessage] = ..., + optional_nested_enum: Optional[TestAllTypes.NestedEnum] = ..., + optional_foreign_enum: Optional[ForeignEnum] = ..., + optional_string_piece: Optional[Text] = ..., + optional_cord: Optional[Text] = ..., + optional_public_import_message: Optional[PublicImportMessage] = ..., + optional_lazy_message: Optional[TestAllTypes.NestedMessage] = ..., + optional_lazy_import_message: Optional[ImportMessage] = ..., + repeated_int32: Optional[Iterable[int]] = ..., + repeated_int64: Optional[Iterable[int]] = ..., + repeated_uint32: Optional[Iterable[int]] = ..., + repeated_uint64: Optional[Iterable[int]] = ..., + repeated_sint32: Optional[Iterable[int]] = ..., + repeated_sint64: Optional[Iterable[int]] = ..., + repeated_fixed32: Optional[Iterable[int]] = ..., + repeated_fixed64: Optional[Iterable[int]] = ..., + repeated_sfixed32: Optional[Iterable[int]] = ..., + repeated_sfixed64: Optional[Iterable[int]] = ..., + repeated_float: Optional[Iterable[float]] = ..., + repeated_double: Optional[Iterable[float]] = ..., + repeated_bool: Optional[Iterable[bool]] = ..., + repeated_string: Optional[Iterable[Text]] = ..., + repeated_bytes: Optional[Iterable[bytes]] = ..., + repeated_nested_message: Optional[Iterable[TestAllTypes.NestedMessage]] = ..., + repeated_foreign_message: Optional[Iterable[ForeignMessage]] = ..., + repeated_import_message: Optional[Iterable[ImportMessage]] = ..., + repeated_nested_enum: Optional[Iterable[TestAllTypes.NestedEnum]] = ..., + repeated_foreign_enum: Optional[Iterable[ForeignEnum]] = ..., + repeated_string_piece: Optional[Iterable[Text]] = ..., + repeated_cord: Optional[Iterable[Text]] = ..., + repeated_lazy_message: Optional[Iterable[TestAllTypes.NestedMessage]] = ..., + oneof_uint32: Optional[int] = ..., + oneof_nested_message: Optional[TestAllTypes.NestedMessage] = ..., + oneof_string: Optional[Text] = ..., + oneof_bytes: Optional[bytes] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllTypes: ... + + +class TestPackedTypes(Message): + packed_int32: RepeatedScalarFieldContainer[int] + packed_int64: RepeatedScalarFieldContainer[int] + packed_uint32: RepeatedScalarFieldContainer[int] + packed_uint64: RepeatedScalarFieldContainer[int] + packed_sint32: RepeatedScalarFieldContainer[int] + packed_sint64: RepeatedScalarFieldContainer[int] + packed_fixed32: RepeatedScalarFieldContainer[int] + packed_fixed64: RepeatedScalarFieldContainer[int] + packed_sfixed32: RepeatedScalarFieldContainer[int] + packed_sfixed64: RepeatedScalarFieldContainer[int] + packed_float: RepeatedScalarFieldContainer[float] + packed_double: RepeatedScalarFieldContainer[float] + packed_bool: RepeatedScalarFieldContainer[bool] + packed_enum: RepeatedScalarFieldContainer[ForeignEnum] + + def __init__(self, + packed_int32: Optional[Iterable[int]] = ..., + packed_int64: Optional[Iterable[int]] = ..., + packed_uint32: Optional[Iterable[int]] = ..., + packed_uint64: Optional[Iterable[int]] = ..., + packed_sint32: Optional[Iterable[int]] = ..., + packed_sint64: Optional[Iterable[int]] = ..., + packed_fixed32: Optional[Iterable[int]] = ..., + packed_fixed64: Optional[Iterable[int]] = ..., + packed_sfixed32: Optional[Iterable[int]] = ..., + packed_sfixed64: Optional[Iterable[int]] = ..., + packed_float: Optional[Iterable[float]] = ..., + packed_double: Optional[Iterable[float]] = ..., + packed_bool: Optional[Iterable[bool]] = ..., + packed_enum: Optional[Iterable[ForeignEnum]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestPackedTypes: ... + + +class TestUnpackedTypes(Message): + repeated_int32: RepeatedScalarFieldContainer[int] + repeated_int64: RepeatedScalarFieldContainer[int] + repeated_uint32: RepeatedScalarFieldContainer[int] + repeated_uint64: RepeatedScalarFieldContainer[int] + repeated_sint32: RepeatedScalarFieldContainer[int] + repeated_sint64: RepeatedScalarFieldContainer[int] + repeated_fixed32: RepeatedScalarFieldContainer[int] + repeated_fixed64: RepeatedScalarFieldContainer[int] + repeated_sfixed32: RepeatedScalarFieldContainer[int] + repeated_sfixed64: RepeatedScalarFieldContainer[int] + repeated_float: RepeatedScalarFieldContainer[float] + repeated_double: RepeatedScalarFieldContainer[float] + repeated_bool: RepeatedScalarFieldContainer[bool] + repeated_nested_enum: RepeatedScalarFieldContainer[TestAllTypes.NestedEnum] + + def __init__(self, + repeated_int32: Optional[Iterable[int]] = ..., + repeated_int64: Optional[Iterable[int]] = ..., + repeated_uint32: Optional[Iterable[int]] = ..., + repeated_uint64: Optional[Iterable[int]] = ..., + repeated_sint32: Optional[Iterable[int]] = ..., + repeated_sint64: Optional[Iterable[int]] = ..., + repeated_fixed32: Optional[Iterable[int]] = ..., + repeated_fixed64: Optional[Iterable[int]] = ..., + repeated_sfixed32: Optional[Iterable[int]] = ..., + repeated_sfixed64: Optional[Iterable[int]] = ..., + repeated_float: Optional[Iterable[float]] = ..., + repeated_double: Optional[Iterable[float]] = ..., + repeated_bool: Optional[Iterable[bool]] = ..., + repeated_nested_enum: Optional[Iterable[TestAllTypes.NestedEnum]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestUnpackedTypes: ... + + +class NestedTestAllTypes(Message): + + @property + def child(self) -> NestedTestAllTypes: ... + + @property + def payload(self) -> TestAllTypes: ... + + @property + def repeated_child( + self) -> RepeatedCompositeFieldContainer[NestedTestAllTypes]: ... + + def __init__(self, + child: Optional[NestedTestAllTypes] = ..., + payload: Optional[TestAllTypes] = ..., + repeated_child: Optional[Iterable[NestedTestAllTypes]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> NestedTestAllTypes: ... + + +class ForeignMessage(Message): + c: int + + def __init__(self, + c: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> ForeignMessage: ... + + +class TestEmptyMessage(Message): + + def __init__(self, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestEmptyMessage: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/util/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/util/__init__.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/util/json_format_proto3_pb2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/util/json_format_proto3_pb2.pyi new file mode 100644 index 0000000..0462313 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/util/json_format_proto3_pb2.pyi @@ -0,0 +1,659 @@ +from google.protobuf.any_pb2 import ( + Any, +) +from google.protobuf.duration_pb2 import ( + Duration, +) +from google.protobuf.field_mask_pb2 import ( + FieldMask, +) +from google.protobuf.internal.containers import ( + RepeatedCompositeFieldContainer, + RepeatedScalarFieldContainer, +) +from google.protobuf.message import ( + Message, +) +from google.protobuf.struct_pb2 import ( + ListValue, + Struct, + Value, +) +from google.protobuf.timestamp_pb2 import ( + Timestamp, +) +from google.protobuf.unittest_pb2 import ( + TestAllExtensions, +) +from google.protobuf.wrappers_pb2 import ( + BoolValue, + BytesValue, + DoubleValue, + FloatValue, + Int32Value, + Int64Value, + StringValue, + UInt32Value, + UInt64Value, +) +from typing import ( + Iterable, + List, + Mapping, + MutableMapping, + Optional, + Text, + Tuple, + cast, +) + + +class EnumType(int): + + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> EnumType: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[EnumType]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, EnumType]]: ... + + +FOO: EnumType +BAR: EnumType + + +class MessageType(Message): + value: int + + def __init__(self, + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> MessageType: ... + + +class TestMessage(Message): + bool_value: bool + int32_value: int + int64_value: int + uint32_value: int + uint64_value: int + float_value: float + double_value: float + string_value: Text + bytes_value: bytes + enum_value: EnumType + repeated_bool_value: RepeatedScalarFieldContainer[bool] + repeated_int32_value: RepeatedScalarFieldContainer[int] + repeated_int64_value: RepeatedScalarFieldContainer[int] + repeated_uint32_value: RepeatedScalarFieldContainer[int] + repeated_uint64_value: RepeatedScalarFieldContainer[int] + repeated_float_value: RepeatedScalarFieldContainer[float] + repeated_double_value: RepeatedScalarFieldContainer[float] + repeated_string_value: RepeatedScalarFieldContainer[Text] + repeated_bytes_value: RepeatedScalarFieldContainer[bytes] + repeated_enum_value: RepeatedScalarFieldContainer[EnumType] + + @property + def message_value(self) -> MessageType: ... + + @property + def repeated_message_value( + self) -> RepeatedCompositeFieldContainer[MessageType]: ... + + def __init__(self, + bool_value: Optional[bool] = ..., + int32_value: Optional[int] = ..., + int64_value: Optional[int] = ..., + uint32_value: Optional[int] = ..., + uint64_value: Optional[int] = ..., + float_value: Optional[float] = ..., + double_value: Optional[float] = ..., + string_value: Optional[Text] = ..., + bytes_value: Optional[bytes] = ..., + enum_value: Optional[EnumType] = ..., + message_value: Optional[MessageType] = ..., + repeated_bool_value: Optional[Iterable[bool]] = ..., + repeated_int32_value: Optional[Iterable[int]] = ..., + repeated_int64_value: Optional[Iterable[int]] = ..., + repeated_uint32_value: Optional[Iterable[int]] = ..., + repeated_uint64_value: Optional[Iterable[int]] = ..., + repeated_float_value: Optional[Iterable[float]] = ..., + repeated_double_value: Optional[Iterable[float]] = ..., + repeated_string_value: Optional[Iterable[Text]] = ..., + repeated_bytes_value: Optional[Iterable[bytes]] = ..., + repeated_enum_value: Optional[Iterable[EnumType]] = ..., + repeated_message_value: Optional[Iterable[MessageType]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMessage: ... + + +class TestOneof(Message): + oneof_int32_value: int + oneof_string_value: Text + oneof_bytes_value: bytes + oneof_enum_value: EnumType + + @property + def oneof_message_value(self) -> MessageType: ... + + def __init__(self, + oneof_int32_value: Optional[int] = ..., + oneof_string_value: Optional[Text] = ..., + oneof_bytes_value: Optional[bytes] = ..., + oneof_enum_value: Optional[EnumType] = ..., + oneof_message_value: Optional[MessageType] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestOneof: ... + + +class TestMap(Message): + + class BoolMapEntry(Message): + key: bool + value: int + + def __init__(self, + key: Optional[bool] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMap.BoolMapEntry: ... + + class Int32MapEntry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMap.Int32MapEntry: ... + + class Int64MapEntry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMap.Int64MapEntry: ... + + class Uint32MapEntry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMap.Uint32MapEntry: ... + + class Uint64MapEntry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMap.Uint64MapEntry: ... + + class StringMapEntry(Message): + key: Text + value: int + + def __init__(self, + key: Optional[Text] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMap.StringMapEntry: ... + + @property + def bool_map(self) -> MutableMapping[bool, int]: ... + + @property + def int32_map(self) -> MutableMapping[int, int]: ... + + @property + def int64_map(self) -> MutableMapping[int, int]: ... + + @property + def uint32_map(self) -> MutableMapping[int, int]: ... + + @property + def uint64_map(self) -> MutableMapping[int, int]: ... + + @property + def string_map(self) -> MutableMapping[Text, int]: ... + + def __init__(self, + bool_map: Optional[Mapping[bool, int]] = ..., + int32_map: Optional[Mapping[int, int]] = ..., + int64_map: Optional[Mapping[int, int]] = ..., + uint32_map: Optional[Mapping[int, int]] = ..., + uint64_map: Optional[Mapping[int, int]] = ..., + string_map: Optional[Mapping[Text, int]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMap: ... + + +class TestNestedMap(Message): + + class BoolMapEntry(Message): + key: bool + value: int + + def __init__(self, + key: Optional[bool] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestNestedMap.BoolMapEntry: ... + + class Int32MapEntry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestNestedMap.Int32MapEntry: ... + + class Int64MapEntry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestNestedMap.Int64MapEntry: ... + + class Uint32MapEntry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestNestedMap.Uint32MapEntry: ... + + class Uint64MapEntry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestNestedMap.Uint64MapEntry: ... + + class StringMapEntry(Message): + key: Text + value: int + + def __init__(self, + key: Optional[Text] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestNestedMap.StringMapEntry: ... + + class MapMapEntry(Message): + key: Text + + @property + def value(self) -> TestNestedMap: ... + + def __init__(self, + key: Optional[Text] = ..., + value: Optional[TestNestedMap] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestNestedMap.MapMapEntry: ... + + @property + def bool_map(self) -> MutableMapping[bool, int]: ... + + @property + def int32_map(self) -> MutableMapping[int, int]: ... + + @property + def int64_map(self) -> MutableMapping[int, int]: ... + + @property + def uint32_map(self) -> MutableMapping[int, int]: ... + + @property + def uint64_map(self) -> MutableMapping[int, int]: ... + + @property + def string_map(self) -> MutableMapping[Text, int]: ... + + @property + def map_map(self) -> MutableMapping[Text, TestNestedMap]: ... + + def __init__(self, + bool_map: Optional[Mapping[bool, int]] = ..., + int32_map: Optional[Mapping[int, int]] = ..., + int64_map: Optional[Mapping[int, int]] = ..., + uint32_map: Optional[Mapping[int, int]] = ..., + uint64_map: Optional[Mapping[int, int]] = ..., + string_map: Optional[Mapping[Text, int]] = ..., + map_map: Optional[Mapping[Text, TestNestedMap]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestNestedMap: ... + + +class TestWrapper(Message): + + @property + def bool_value(self) -> BoolValue: ... + + @property + def int32_value(self) -> Int32Value: ... + + @property + def int64_value(self) -> Int64Value: ... + + @property + def uint32_value(self) -> UInt32Value: ... + + @property + def uint64_value(self) -> UInt64Value: ... + + @property + def float_value(self) -> FloatValue: ... + + @property + def double_value(self) -> DoubleValue: ... + + @property + def string_value(self) -> StringValue: ... + + @property + def bytes_value(self) -> BytesValue: ... + + @property + def repeated_bool_value( + self) -> RepeatedCompositeFieldContainer[BoolValue]: ... + + @property + def repeated_int32_value( + self) -> RepeatedCompositeFieldContainer[Int32Value]: ... + + @property + def repeated_int64_value( + self) -> RepeatedCompositeFieldContainer[Int64Value]: ... + + @property + def repeated_uint32_value( + self) -> RepeatedCompositeFieldContainer[UInt32Value]: ... + + @property + def repeated_uint64_value( + self) -> RepeatedCompositeFieldContainer[UInt64Value]: ... + + @property + def repeated_float_value( + self) -> RepeatedCompositeFieldContainer[FloatValue]: ... + + @property + def repeated_double_value( + self) -> RepeatedCompositeFieldContainer[DoubleValue]: ... + + @property + def repeated_string_value( + self) -> RepeatedCompositeFieldContainer[StringValue]: ... + + @property + def repeated_bytes_value( + self) -> RepeatedCompositeFieldContainer[BytesValue]: ... + + def __init__(self, + bool_value: Optional[BoolValue] = ..., + int32_value: Optional[Int32Value] = ..., + int64_value: Optional[Int64Value] = ..., + uint32_value: Optional[UInt32Value] = ..., + uint64_value: Optional[UInt64Value] = ..., + float_value: Optional[FloatValue] = ..., + double_value: Optional[DoubleValue] = ..., + string_value: Optional[StringValue] = ..., + bytes_value: Optional[BytesValue] = ..., + repeated_bool_value: Optional[Iterable[BoolValue]] = ..., + repeated_int32_value: Optional[Iterable[Int32Value]] = ..., + repeated_int64_value: Optional[Iterable[Int64Value]] = ..., + repeated_uint32_value: Optional[Iterable[UInt32Value]] = ..., + repeated_uint64_value: Optional[Iterable[UInt64Value]] = ..., + repeated_float_value: Optional[Iterable[FloatValue]] = ..., + repeated_double_value: Optional[Iterable[DoubleValue]] = ..., + repeated_string_value: Optional[Iterable[StringValue]] = ..., + repeated_bytes_value: Optional[Iterable[BytesValue]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestWrapper: ... + + +class TestTimestamp(Message): + + @property + def value(self) -> Timestamp: ... + + @property + def repeated_value(self) -> RepeatedCompositeFieldContainer[Timestamp]: ... + + def __init__(self, + value: Optional[Timestamp] = ..., + repeated_value: Optional[Iterable[Timestamp]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestTimestamp: ... + + +class TestDuration(Message): + + @property + def value(self) -> Duration: ... + + @property + def repeated_value(self) -> RepeatedCompositeFieldContainer[Duration]: ... + + def __init__(self, + value: Optional[Duration] = ..., + repeated_value: Optional[Iterable[Duration]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestDuration: ... + + +class TestFieldMask(Message): + + @property + def value(self) -> FieldMask: ... + + def __init__(self, + value: Optional[FieldMask] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestFieldMask: ... + + +class TestStruct(Message): + + @property + def value(self) -> Struct: ... + + @property + def repeated_value(self) -> RepeatedCompositeFieldContainer[Struct]: ... + + def __init__(self, + value: Optional[Struct] = ..., + repeated_value: Optional[Iterable[Struct]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestStruct: ... + + +class TestAny(Message): + + @property + def value(self) -> Any: ... + + @property + def repeated_value(self) -> RepeatedCompositeFieldContainer[Any]: ... + + def __init__(self, + value: Optional[Any] = ..., + repeated_value: Optional[Iterable[Any]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAny: ... + + +class TestValue(Message): + + @property + def value(self) -> Value: ... + + @property + def repeated_value(self) -> RepeatedCompositeFieldContainer[Value]: ... + + def __init__(self, + value: Optional[Value] = ..., + repeated_value: Optional[Iterable[Value]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestValue: ... + + +class TestListValue(Message): + + @property + def value(self) -> ListValue: ... + + @property + def repeated_value(self) -> RepeatedCompositeFieldContainer[ListValue]: ... + + def __init__(self, + value: Optional[ListValue] = ..., + repeated_value: Optional[Iterable[ListValue]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestListValue: ... + + +class TestBoolValue(Message): + + class BoolMapEntry(Message): + key: bool + value: int + + def __init__(self, + key: Optional[bool] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestBoolValue.BoolMapEntry: ... + bool_value: bool + + @property + def bool_map(self) -> MutableMapping[bool, int]: ... + + def __init__(self, + bool_value: Optional[bool] = ..., + bool_map: Optional[Mapping[bool, int]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestBoolValue: ... + + +class TestCustomJsonName(Message): + value: int + + def __init__(self, + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestCustomJsonName: ... + + +class TestExtensions(Message): + + @property + def extensions(self) -> TestAllExtensions: ... + + def __init__(self, + extensions: Optional[TestAllExtensions] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestExtensions: ... + + +class TestEnumValue(Message): + enum_value1: EnumType + enum_value2: EnumType + enum_value3: EnumType + + def __init__(self, + enum_value1: Optional[EnumType] = ..., + enum_value2: Optional[EnumType] = ..., + enum_value3: Optional[EnumType] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestEnumValue: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/wrappers_pb2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/wrappers_pb2.pyi new file mode 100644 index 0000000..6ff865d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/wrappers_pb2.pyi @@ -0,0 +1,106 @@ +from google.protobuf.message import ( + Message, +) +from typing import ( + Optional, + Text, +) + + +class DoubleValue(Message): + value: float + + def __init__(self, + value: Optional[float] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> DoubleValue: ... + + +class FloatValue(Message): + value: float + + def __init__(self, + value: Optional[float] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> FloatValue: ... + + +class Int64Value(Message): + value: int + + def __init__(self, + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> Int64Value: ... + + +class UInt64Value(Message): + value: int + + def __init__(self, + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> UInt64Value: ... + + +class Int32Value(Message): + value: int + + def __init__(self, + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> Int32Value: ... + + +class UInt32Value(Message): + value: int + + def __init__(self, + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> UInt32Value: ... + + +class BoolValue(Message): + value: bool + + def __init__(self, + value: Optional[bool] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> BoolValue: ... + + +class StringValue(Message): + value: Text + + def __init__(self, + value: Optional[Text] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> StringValue: ... + + +class BytesValue(Message): + value: bytes + + def __init__(self, + value: Optional[bytes] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> BytesValue: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/itsdangerous.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/itsdangerous.pyi new file mode 100644 index 0000000..32bbf2b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/itsdangerous.pyi @@ -0,0 +1,153 @@ +from datetime import datetime +from typing import Any, Callable, IO, Mapping, MutableMapping, Optional, Tuple, Union, Text, Generator + +_serializer = Any # must be an object that has "dumps" and "loads" attributes (e.g. the json module) + +def want_bytes(s: Union[Text, bytes], encoding: Text = ..., errors: Text = ...) -> bytes: ... + +class BadData(Exception): + message: str + def __init__(self, message: str) -> None: ... + +class BadPayload(BadData): + original_error: Optional[Exception] + def __init__(self, message: str, original_error: Optional[Exception] = ...) -> None: ... + +class BadSignature(BadData): + payload: Optional[Any] + def __init__(self, message: str, payload: Optional[Any] = ...) -> None: ... + +class BadTimeSignature(BadSignature): + date_signed: Optional[int] + def __init__(self, message: str, payload: Optional[Any] = ..., date_signed: Optional[int] = ...) -> None: ... + +class BadHeader(BadSignature): + header: Any + original_error: Any + def __init__(self, message, payload: Optional[Any] = ..., header: Optional[Any] = ..., original_error: Optional[Any] = ...) -> None: ... + +class SignatureExpired(BadTimeSignature): ... + +def base64_encode(string: Union[Text, bytes]) -> bytes: ... +def base64_decode(string: Union[Text, bytes]) -> bytes: ... + +class SigningAlgorithm(object): + def get_signature(self, key: bytes, value: bytes) -> bytes: ... + def verify_signature(self, key: bytes, value: bytes, sig: bytes) -> bool: ... + +class NoneAlgorithm(SigningAlgorithm): + def get_signature(self, key: bytes, value: bytes) -> bytes: ... + +class HMACAlgorithm(SigningAlgorithm): + default_digest_method: Callable + digest_method: Callable + def __init__(self, digest_method: Optional[Callable] = ...) -> None: ... + def get_signature(self, key: bytes, value: bytes) -> bytes: ... + +class Signer(object): + default_digest_method: Callable = ... + default_key_derivation: str = ... + + secret_key: bytes + sep: bytes + salt: Union[Text, bytes] + key_derivation: str + digest_method: Callable + algorithm: SigningAlgorithm + + def __init__(self, + secret_key: Union[Text, bytes], + salt: Optional[Union[Text, bytes]] = ..., + sep: Optional[Union[Text, bytes]] = ..., + key_derivation: Optional[str] = ..., + digest_method: Optional[Callable] = ..., + algorithm: Optional[SigningAlgorithm] = ...) -> None: ... + def derive_key(self) -> bytes: ... + def get_signature(self, value: Union[Text, bytes]) -> bytes: ... + def sign(self, value: Union[Text, bytes]) -> bytes: ... + def verify_signature(self, value: bytes, sig: Union[Text, bytes]) -> bool: ... + def unsign(self, signed_value: Union[Text, bytes]) -> bytes: ... + def validate(self, signed_value: Union[Text, bytes]) -> bool: ... + +class TimestampSigner(Signer): + def get_timestamp(self) -> int: ... + def timestamp_to_datetime(self, ts: float) -> datetime: ... + def sign(self, value: Union[Text, bytes]) -> bytes: ... + def unsign(self, value: Union[Text, bytes], max_age: Optional[int] = ..., + return_timestamp: bool = ...) -> Any: ... # morally -> Union[bytes, Tuple[bytes, datetime]] + def validate(self, signed_value: Union[Text, bytes], max_age: Optional[int] = ...) -> bool: ... + +class Serializer(object): + default_serializer: _serializer = ... + default_signer: Callable[..., Signer] = ... + + secret_key: bytes + salt: bytes + serializer: _serializer + is_text_serializer: bool + signer: Callable[..., Signer] + signer_kwargs: MutableMapping[str, Any] + + def __init__(self, secret_key: Union[Text, bytes], salt: Optional[Union[Text, bytes]] = ..., + serializer: Optional[_serializer] = ..., signer: Optional[Callable[..., Signer]] = ..., + signer_kwargs: Optional[MutableMapping[str, Any]] = ...) -> None: ... + def load_payload(self, payload: bytes, serializer: Optional[_serializer] = ...) -> Any: ... + def dump_payload(self, obj: Any) -> bytes: ... + def make_signer(self, salt: Optional[Union[Text, bytes]] = ...) -> Signer: ... + def iter_unsigners(self, salt: Optional[Union[Text, bytes]] = ...) -> Generator[Any, None, None]: ... + def dumps(self, obj: Any, salt: Optional[Union[Text, bytes]] = ...) -> Any: ... # morally -> Union[str, bytes] + def dump(self, obj: Any, f: IO[Any], salt: Optional[Union[Text, bytes]] = ...) -> None: ... + def loads(self, s: Union[Text, bytes], salt: Optional[Union[Text, bytes]] = ...) -> Any: ... + def load(self, f: IO[Any], salt: Optional[Union[Text, bytes]] = ...): ... + def loads_unsafe(self, s: Union[Text, bytes], salt: Optional[Union[Text, bytes]] = ...) -> Tuple[bool, Optional[Any]]: ... + def load_unsafe(self, f: IO[Any], salt: Optional[Union[Text, bytes]] = ...) -> Tuple[bool, Optional[Any]]: ... + +class TimedSerializer(Serializer): + def loads(self, s: Union[Text, bytes], salt: Optional[Union[Text, bytes]] = ..., max_age: Optional[int] = ..., + return_timestamp: bool = ...) -> Any: ... # morally -> Union[Any, Tuple[Any, datetime]] + def loads_unsafe(self, s: Union[Text, bytes], salt: Optional[Union[Text, bytes]] = ..., + max_age: Optional[int] = ...) -> Tuple[bool, Any]: ... + +class JSONWebSignatureSerializer(Serializer): + jws_algorithms: MutableMapping[Text, SigningAlgorithm] = ... + default_algorithm: Text = ... + default_serializer: Any = ... + + algorithm_name: Text + algorithm: SigningAlgorithm + + def __init__(self, secret_key: Union[Text, bytes], salt: Optional[Union[Text, bytes]] = ..., + serializer: Optional[_serializer] = ..., signer: Optional[Callable[..., Signer]] = ..., + signer_kwargs: Optional[MutableMapping[str, Any]] = ..., algorithm_name: Optional[Text] = ...) -> None: ... + def load_payload(self, payload: Union[Text, bytes], serializer: Optional[_serializer] = ..., + return_header: bool = ...) -> Any: ... # morally -> Union[Any, Tuple[Any, MutableMapping[str, Any]]] + def dump_payload(self, header: Mapping[str, Any], obj: Any) -> bytes: ... # type: ignore + def make_algorithm(self, algorithm_name: Text) -> SigningAlgorithm: ... + def make_signer(self, salt: Optional[Union[Text, bytes]] = ..., algorithm: SigningAlgorithm = ...) -> Signer: ... + def make_header(self, header_fields: Optional[Mapping[str, Any]]) -> MutableMapping[str, Any]: ... + def dumps(self, obj: Any, salt: Optional[Union[Text, bytes]] = ..., + header_fields: Optional[Mapping[str, Any]] = ...) -> str: ... + def loads(self, s: Union[Text, bytes], salt: Optional[Union[Text, bytes]] = ..., + return_header: bool = ...) -> Any: ... # morally -> Union[Any, Tuple[Any, MutableMapping[str, Any]]] + def loads_unsafe(self, s: Union[Text, bytes], salt: Optional[Union[Text, bytes]] = ..., + return_header: bool = ...) -> Tuple[bool, Any]: ... + +class TimedJSONWebSignatureSerializer(JSONWebSignatureSerializer): + DEFAULT_EXPIRES_IN: int = ... + expires_in: int + def __init__(self, secret_key: Union[Text, bytes], expires_in: Optional[int] = ..., salt: Optional[Union[Text, bytes]] = ..., + serializer: Optional[_serializer] = ..., signer: Optional[Callable[..., Signer]] = ..., + signer_kwargs: Optional[MutableMapping[str, Any]] = ..., algorithm_name: Optional[Text] = ...) -> None: ... + def make_header(self, header_fields: Optional[Mapping[str, Any]]) -> MutableMapping[str, Any]: ... + def loads(self, s: Union[Text, bytes], salt: Optional[Union[Text, bytes]] = ..., + return_header: bool = ...) -> Any: ... # morally -> Union[Any, Tuple[Any, MutableMapping[str, Any]]] + def get_issue_date(self, header: Mapping[str, Any]) -> Optional[datetime]: ... + def now(self) -> int: ... + +class _URLSafeSerializerMixin(object): + default_serializer: _serializer = ... + def load_payload(self, payload: bytes, serializer: Optional[_serializer] = ...) -> Any: ... + def dump_payload(self, obj: Any) -> bytes: ... + +class URLSafeSerializer(_URLSafeSerializerMixin, Serializer): ... +class URLSafeTimedSerializer(_URLSafeSerializerMixin, TimedSerializer): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/jinja2/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/jinja2/__init__.pyi new file mode 100644 index 0000000..063f73d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/jinja2/__init__.pyi @@ -0,0 +1,7 @@ +from jinja2.environment import Environment as Environment, Template as Template +from jinja2.loaders import BaseLoader as BaseLoader, FileSystemLoader as FileSystemLoader, PackageLoader as PackageLoader, DictLoader as DictLoader, FunctionLoader as FunctionLoader, PrefixLoader as PrefixLoader, ChoiceLoader as ChoiceLoader, ModuleLoader as ModuleLoader +from jinja2.bccache import BytecodeCache as BytecodeCache, FileSystemBytecodeCache as FileSystemBytecodeCache, MemcachedBytecodeCache as MemcachedBytecodeCache +from jinja2.runtime import Undefined as Undefined, DebugUndefined as DebugUndefined, StrictUndefined as StrictUndefined, make_logging_undefined as make_logging_undefined +from jinja2.exceptions import TemplateError as TemplateError, UndefinedError as UndefinedError, TemplateNotFound as TemplateNotFound, TemplatesNotFound as TemplatesNotFound, TemplateSyntaxError as TemplateSyntaxError, TemplateAssertionError as TemplateAssertionError +from jinja2.filters import environmentfilter as environmentfilter, contextfilter as contextfilter, evalcontextfilter as evalcontextfilter +from jinja2.utils import Markup as Markup, escape as escape, clear_caches as clear_caches, environmentfunction as environmentfunction, evalcontextfunction as evalcontextfunction, contextfunction as contextfunction, is_undefined as is_undefined, select_autoescape as select_autoescape diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/jinja2/_compat.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/jinja2/_compat.pyi new file mode 100644 index 0000000..1e37a7a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/jinja2/_compat.pyi @@ -0,0 +1,34 @@ +from typing import Any, Optional +import sys + +if sys.version_info[0] >= 3: + from io import BytesIO + from urllib.parse import quote_from_bytes as url_quote +else: + from cStringIO import StringIO as BytesIO + from urllib import quote as url_quote + +PY2: Any +PYPY: Any +unichr: Any +range_type: Any +text_type: Any +string_types: Any +integer_types: Any +iterkeys: Any +itervalues: Any +iteritems: Any +NativeStringIO: Any + +def reraise(tp, value, tb: Optional[Any] = ...): ... + +ifilter: Any +imap: Any +izip: Any +intern: Any +implements_iterator: Any +implements_to_string: Any +encode_filename: Any +get_next: Any + +def with_metaclass(meta, *bases): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/jinja2/_stringdefs.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/jinja2/_stringdefs.pyi new file mode 100644 index 0000000..060f888 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/jinja2/_stringdefs.pyi @@ -0,0 +1,40 @@ +from typing import Any + +Cc: str +Cf: str +Cn: str +Co: str +Cs: Any +Ll: str +Lm: str +Lo: str +Lt: str +Lu: str +Mc: str +Me: str +Mn: str +Nd: str +Nl: str +No: str +Pc: str +Pd: str +Pe: str +Pf: str +Pi: str +Po: str +Ps: str +Sc: str +Sk: str +Sm: str +So: str +Zl: str +Zp: str +Zs: str +cats: Any + +def combine(*args): ... + +xid_start: str +xid_continue: str + +def allexcept(*args): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/jinja2/bccache.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/jinja2/bccache.pyi new file mode 100644 index 0000000..754736a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/jinja2/bccache.pyi @@ -0,0 +1,44 @@ +from typing import Any, Optional + +marshal_dump: Any +marshal_load: Any +bc_version: int +bc_magic: Any + +class Bucket: + environment: Any + key: Any + checksum: Any + def __init__(self, environment, key, checksum) -> None: ... + code: Any + def reset(self): ... + def load_bytecode(self, f): ... + def write_bytecode(self, f): ... + def bytecode_from_string(self, string): ... + def bytecode_to_string(self): ... + +class BytecodeCache: + def load_bytecode(self, bucket): ... + def dump_bytecode(self, bucket): ... + def clear(self): ... + def get_cache_key(self, name, filename: Optional[Any] = ...): ... + def get_source_checksum(self, source): ... + def get_bucket(self, environment, name, filename, source): ... + def set_bucket(self, bucket): ... + +class FileSystemBytecodeCache(BytecodeCache): + directory: Any + pattern: Any + def __init__(self, directory: Optional[Any] = ..., pattern: str = ...) -> None: ... + def load_bytecode(self, bucket): ... + def dump_bytecode(self, bucket): ... + def clear(self): ... + +class MemcachedBytecodeCache(BytecodeCache): + client: Any + prefix: Any + timeout: Any + ignore_memcache_errors: Any + def __init__(self, client, prefix: str = ..., timeout: Optional[Any] = ..., ignore_memcache_errors: bool = ...) -> None: ... + def load_bytecode(self, bucket): ... + def dump_bytecode(self, bucket): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/jinja2/compiler.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/jinja2/compiler.pyi new file mode 100644 index 0000000..7b1a537 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/jinja2/compiler.pyi @@ -0,0 +1,176 @@ +from typing import Any, Optional +from keyword import iskeyword as is_python_keyword +from jinja2.visitor import NodeVisitor + +operators: Any +dict_item_iter: str + +unoptimize_before_dead_code: bool + +def generate(node, environment, name, filename, stream: Optional[Any] = ..., defer_init: bool = ...): ... +def has_safe_repr(value): ... +def find_undeclared(nodes, names): ... + +class Identifiers: + declared: Any + outer_undeclared: Any + undeclared: Any + declared_locally: Any + declared_parameter: Any + def __init__(self) -> None: ... + def add_special(self, name): ... + def is_declared(self, name): ... + def copy(self): ... + +class Frame: + eval_ctx: Any + identifiers: Any + toplevel: bool + rootlevel: bool + require_output_check: Any + buffer: Any + block: Any + assigned_names: Any + parent: Any + def __init__(self, eval_ctx, parent: Optional[Any] = ...) -> None: ... + def copy(self): ... + def inspect(self, nodes): ... + def find_shadowed(self, extra: Any = ...): ... + def inner(self): ... + def soft(self): ... + __copy__: Any + +class VisitorExit(RuntimeError): ... + +class DependencyFinderVisitor(NodeVisitor): + filters: Any + tests: Any + def __init__(self) -> None: ... + def visit_Filter(self, node): ... + def visit_Test(self, node): ... + def visit_Block(self, node): ... + +class UndeclaredNameVisitor(NodeVisitor): + names: Any + undeclared: Any + def __init__(self, names) -> None: ... + def visit_Name(self, node): ... + def visit_Block(self, node): ... + +class FrameIdentifierVisitor(NodeVisitor): + identifiers: Any + def __init__(self, identifiers) -> None: ... + def visit_Name(self, node): ... + def visit_If(self, node): ... + def visit_Macro(self, node): ... + def visit_Import(self, node): ... + def visit_FromImport(self, node): ... + def visit_Assign(self, node): ... + def visit_For(self, node): ... + def visit_CallBlock(self, node): ... + def visit_FilterBlock(self, node): ... + def visit_AssignBlock(self, node): ... + def visit_Scope(self, node): ... + def visit_Block(self, node): ... + +class CompilerExit(Exception): ... + +class CodeGenerator(NodeVisitor): + environment: Any + name: Any + filename: Any + stream: Any + created_block_context: bool + defer_init: Any + import_aliases: Any + blocks: Any + extends_so_far: int + has_known_extends: bool + code_lineno: int + tests: Any + filters: Any + debug_info: Any + def __init__(self, environment, name, filename, stream: Optional[Any] = ..., defer_init: bool = ...) -> None: ... + def fail(self, msg, lineno): ... + def temporary_identifier(self): ... + def buffer(self, frame): ... + def return_buffer_contents(self, frame): ... + def indent(self): ... + def outdent(self, step: int = ...): ... + def start_write(self, frame, node: Optional[Any] = ...): ... + def end_write(self, frame): ... + def simple_write(self, s, frame, node: Optional[Any] = ...): ... + def blockvisit(self, nodes, frame): ... + def write(self, x): ... + def writeline(self, x, node: Optional[Any] = ..., extra: int = ...): ... + def newline(self, node: Optional[Any] = ..., extra: int = ...): ... + def signature(self, node, frame, extra_kwargs: Optional[Any] = ...): ... + def pull_locals(self, frame): ... + def pull_dependencies(self, nodes): ... + def unoptimize_scope(self, frame): ... + def push_scope(self, frame, extra_vars: Any = ...): ... + def pop_scope(self, aliases, frame): ... + def function_scoping(self, node, frame, children: Optional[Any] = ..., find_special: bool = ...): ... + def macro_body(self, node, frame, children: Optional[Any] = ...): ... + def macro_def(self, node, frame): ... + def position(self, node): ... + def visit_Template(self, node, frame: Optional[Any] = ...): ... + def visit_Block(self, node, frame): ... + def visit_Extends(self, node, frame): ... + def visit_Include(self, node, frame): ... + def visit_Import(self, node, frame): ... + def visit_FromImport(self, node, frame): ... + def visit_For(self, node, frame): ... + def visit_If(self, node, frame): ... + def visit_Macro(self, node, frame): ... + def visit_CallBlock(self, node, frame): ... + def visit_FilterBlock(self, node, frame): ... + def visit_ExprStmt(self, node, frame): ... + def visit_Output(self, node, frame): ... + def make_assignment_frame(self, frame): ... + def export_assigned_vars(self, frame, assignment_frame): ... + def visit_Assign(self, node, frame): ... + def visit_AssignBlock(self, node, frame): ... + def visit_Name(self, node, frame): ... + def visit_Const(self, node, frame): ... + def visit_TemplateData(self, node, frame): ... + def visit_Tuple(self, node, frame): ... + def visit_List(self, node, frame): ... + def visit_Dict(self, node, frame): ... + def binop(self, interceptable: bool = ...): ... + def uaop(self, interceptable: bool = ...): ... + visit_Add: Any + visit_Sub: Any + visit_Mul: Any + visit_Div: Any + visit_FloorDiv: Any + visit_Pow: Any + visit_Mod: Any + visit_And: Any + visit_Or: Any + visit_Pos: Any + visit_Neg: Any + visit_Not: Any + def visit_Concat(self, node, frame): ... + def visit_Compare(self, node, frame): ... + def visit_Operand(self, node, frame): ... + def visit_Getattr(self, node, frame): ... + def visit_Getitem(self, node, frame): ... + def visit_Slice(self, node, frame): ... + def visit_Filter(self, node, frame): ... + def visit_Test(self, node, frame): ... + def visit_CondExpr(self, node, frame): ... + def visit_Call(self, node, frame, forward_caller: bool = ...): ... + def visit_Keyword(self, node, frame): ... + def visit_MarkSafe(self, node, frame): ... + def visit_MarkSafeIfAutoescape(self, node, frame): ... + def visit_EnvironmentAttribute(self, node, frame): ... + def visit_ExtensionAttribute(self, node, frame): ... + def visit_ImportedName(self, node, frame): ... + def visit_InternalName(self, node, frame): ... + def visit_ContextReference(self, node, frame): ... + def visit_Continue(self, node, frame): ... + def visit_Break(self, node, frame): ... + def visit_Scope(self, node, frame): ... + def visit_EvalContextModifier(self, node, frame): ... + def visit_ScopedEvalContextModifier(self, node, frame): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/jinja2/constants.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/jinja2/constants.pyi new file mode 100644 index 0000000..55ea3ea --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/jinja2/constants.pyi @@ -0,0 +1 @@ +LOREM_IPSUM_WORDS: str diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/jinja2/debug.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/jinja2/debug.pyi new file mode 100644 index 0000000..f495a4d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/jinja2/debug.pyi @@ -0,0 +1,37 @@ +from typing import Any, Optional + +tproxy: Any +raise_helper: str + +class TracebackFrameProxy: + tb: Any + def __init__(self, tb) -> None: ... + @property + def tb_next(self): ... + def set_next(self, next): ... + @property + def is_jinja_frame(self): ... + def __getattr__(self, name): ... + +def make_frame_proxy(frame): ... + +class ProcessedTraceback: + exc_type: Any + exc_value: Any + frames: Any + def __init__(self, exc_type, exc_value, frames) -> None: ... + def render_as_text(self, limit: Optional[Any] = ...): ... + def render_as_html(self, full: bool = ...): ... + @property + def is_template_syntax_error(self): ... + @property + def exc_info(self): ... + @property + def standard_exc_info(self): ... + +def make_traceback(exc_info, source_hint: Optional[Any] = ...): ... +def translate_syntax_error(error, source: Optional[Any] = ...): ... +def translate_exception(exc_info, initial_skip: int = ...): ... +def fake_exc_info(exc_info, filename, lineno): ... + +tb_set_next: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/jinja2/defaults.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/jinja2/defaults.pyi new file mode 100644 index 0000000..e89d3ce --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/jinja2/defaults.pyi @@ -0,0 +1,21 @@ +from typing import Any +from jinja2.filters import FILTERS as DEFAULT_FILTERS +from jinja2.tests import TESTS as DEFAULT_TESTS + +BLOCK_START_STRING: str +BLOCK_END_STRING: str +VARIABLE_START_STRING: str +VARIABLE_END_STRING: str +COMMENT_START_STRING: str +COMMENT_END_STRING: str +LINE_STATEMENT_PREFIX: Any +LINE_COMMENT_PREFIX: Any +TRIM_BLOCKS: bool +LSTRIP_BLOCKS: bool +NEWLINE_SEQUENCE: str +KEEP_TRAILING_NEWLINE: bool +DEFAULT_NAMESPACE: Any + +# Names in __all__ with no definition: +# DEFAULT_FILTERS +# DEFAULT_TESTS diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/jinja2/environment.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/jinja2/environment.pyi new file mode 100644 index 0000000..f5997a3 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/jinja2/environment.pyi @@ -0,0 +1,125 @@ +import sys +from typing import Any, Callable, Dict, Iterator, List, Optional, Text, Type, Union + +from .bccache import BytecodeCache +from .loaders import BaseLoader +from .runtime import Context, Undefined + +if sys.version_info >= (3, 6): + from typing import Awaitable, AsyncIterator + +def get_spontaneous_environment(*args): ... +def create_cache(size): ... +def copy_cache(cache): ... +def load_extensions(environment, extensions): ... + +class Environment: + sandboxed: bool + overlayed: bool + linked_to: Any + shared: bool + exception_handler: Any + exception_formatter: Any + code_generator_class: Any + context_class: Any + block_start_string: Text + block_end_string: Text + variable_start_string: Text + variable_end_string: Text + comment_start_string: Text + comment_end_string: Text + line_statement_prefix: Text + line_comment_prefix: Text + trim_blocks: bool + lstrip_blocks: Any + newline_sequence: Text + keep_trailing_newline: bool + undefined: Type[Undefined] + optimized: bool + finalize: Callable + autoescape: Any + filters: Any + tests: Any + globals: Dict[str, Any] + loader: BaseLoader + cache: Any + bytecode_cache: BytecodeCache + auto_reload: bool + extensions: List + def __init__(self, block_start_string: Text = ..., block_end_string: Text = ..., variable_start_string: Text = ..., variable_end_string: Text = ..., comment_start_string: Any = ..., comment_end_string: Text = ..., line_statement_prefix: Text = ..., line_comment_prefix: Text = ..., trim_blocks: bool = ..., lstrip_blocks: bool = ..., newline_sequence: Text = ..., keep_trailing_newline: bool = ..., extensions: List = ..., optimized: bool = ..., undefined: Type[Undefined] = ..., finalize: Optional[Callable] = ..., autoescape: Union[bool, Callable[[str], bool]] = ..., loader: Optional[BaseLoader] = ..., cache_size: int = ..., auto_reload: bool = ..., bytecode_cache: Optional[BytecodeCache] = ..., enable_async: bool = ...) -> None: ... + def add_extension(self, extension): ... + def extend(self, **attributes): ... + def overlay(self, block_start_string: Text = ..., block_end_string: Text = ..., variable_start_string: Text = ..., variable_end_string: Text = ..., comment_start_string: Any = ..., comment_end_string: Text = ..., line_statement_prefix: Text = ..., line_comment_prefix: Text = ..., trim_blocks: bool = ..., lstrip_blocks: bool = ..., extensions: List = ..., optimized: bool = ..., undefined: Type[Undefined] = ..., finalize: Callable = ..., autoescape: bool = ..., loader: Optional[BaseLoader] = ..., cache_size: int = ..., auto_reload: bool = ..., bytecode_cache: Optional[BytecodeCache] = ...): ... + lexer: Any + def iter_extensions(self): ... + def getitem(self, obj, argument): ... + def getattr(self, obj, attribute): ... + def call_filter(self, name, value, args: Optional[Any] = ..., kwargs: Optional[Any] = ..., context: Optional[Any] = ..., eval_ctx: Optional[Any] = ...): ... + def call_test(self, name, value, args: Optional[Any] = ..., kwargs: Optional[Any] = ...): ... + def parse(self, source, name: Optional[Any] = ..., filename: Optional[Any] = ...): ... + def lex(self, source, name: Optional[Any] = ..., filename: Optional[Any] = ...): ... + def preprocess(self, source: Text, name: Optional[Any] = ..., filename: Optional[Any] = ...): ... + def compile(self, source, name: Optional[Any] = ..., filename: Optional[Any] = ..., raw: bool = ..., defer_init: bool = ...): ... + def compile_expression(self, source: Text, undefined_to_none: bool = ...): ... + def compile_templates(self, target, extensions: Optional[Any] = ..., filter_func: Optional[Any] = ..., zip: str = ..., log_function: Optional[Any] = ..., ignore_errors: bool = ..., py_compile: bool = ...): ... + def list_templates(self, extensions: Optional[Any] = ..., filter_func: Optional[Any] = ...): ... + def handle_exception(self, exc_info: Optional[Any] = ..., rendered: bool = ..., source_hint: Optional[Any] = ...): ... + def join_path(self, template: Union[Template, Text], parent: Text) -> Text: ... + def get_template(self, name: Union[Template, Text], parent: Optional[Text] = ..., globals: Optional[Any] = ...) -> Template: ... + def select_template(self, names: List[Union[Template, Text]], parent: Optional[Text] = ..., globals: Optional[Dict[str, Any]] = ...) -> Template: ... + def get_or_select_template(self, template_name_or_list: Union[Union[Template, Text], List[Union[Template, Text]]], parent: Optional[Text] = ..., globals: Optional[Dict[str, Any]] = ...) -> Template: ... + def from_string(self, source: Text, globals: Optional[Dict[str, Any]] = ..., template_class: Optional[Type[Template]] = ...) -> Template: ... + def make_globals(self, d: Optional[Dict[str, Any]]) -> Dict[str, Any]: ... + + # Frequently added extensions are included here: + # from InternationalizationExtension: + def install_gettext_translations(self, translations: Any, newstyle: Optional[bool]): ... + def install_null_translations(self, newstyle: Optional[bool]): ... + def install_gettext_callables(self, gettext: Callable, ngettext: Callable, + newstyle: Optional[bool]): ... + def uninstall_gettext_translations(self, translations: Any): ... + def extract_translations(self, source: Any, gettext_functions: Any): ... + newstyle_gettext: bool + +class Template: + def __new__(cls, source, block_start_string: Any = ..., block_end_string: Any = ..., variable_start_string: Any = ..., variable_end_string: Any = ..., comment_start_string: Any = ..., comment_end_string: Any = ..., line_statement_prefix: Any = ..., line_comment_prefix: Any = ..., trim_blocks: Any = ..., lstrip_blocks: Any = ..., newline_sequence: Any = ..., keep_trailing_newline: Any = ..., extensions: Any = ..., optimized: bool = ..., undefined: Any = ..., finalize: Optional[Any] = ..., autoescape: bool = ...): ... + environment: Environment = ... + @classmethod + def from_code(cls, environment, code, globals, uptodate: Optional[Any] = ...): ... + @classmethod + def from_module_dict(cls, environment, module_dict, globals): ... + def render(self, *args, **kwargs) -> Text: ... + def stream(self, *args, **kwargs) -> TemplateStream: ... + def generate(self, *args, **kwargs) -> Iterator[Text]: ... + def new_context(self, vars: Optional[Dict[str, Any]] = ..., shared: bool = ..., locals: Optional[Dict[str, Any]] = ...) -> Context: ... + def make_module(self, vars: Optional[Dict[str, Any]] = ..., shared: bool = ..., locals: Optional[Dict[str, Any]] = ...) -> Context: ... + @property + def module(self) -> Any: ... + def get_corresponding_lineno(self, lineno): ... + @property + def is_up_to_date(self) -> bool: ... + @property + def debug_info(self): ... + + if sys.version_info >= (3, 6): + def render_async(self, *args, **kwargs) -> Awaitable[Text]: ... + def generate_async(self, *args, **kwargs) -> AsyncIterator[Text]: ... + + +class TemplateModule: + __name__: Any + def __init__(self, template, context) -> None: ... + def __html__(self): ... + +class TemplateExpression: + def __init__(self, template, undefined_to_none) -> None: ... + def __call__(self, *args, **kwargs): ... + +class TemplateStream: + def __init__(self, gen) -> None: ... + def dump(self, fp, encoding: Optional[Text] = ..., errors: Text = ...): ... + buffered: bool + def disable_buffering(self) -> None: ... + def enable_buffering(self, size: int = ...) -> None: ... + def __iter__(self): ... + def __next__(self): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/jinja2/exceptions.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/jinja2/exceptions.pyi new file mode 100644 index 0000000..8f6be75 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/jinja2/exceptions.pyi @@ -0,0 +1,31 @@ +from typing import Any, Optional, Text + +class TemplateError(Exception): + def __init__(self, message: Optional[Text] = ...) -> None: ... + @property + def message(self): ... + def __unicode__(self): ... + +class TemplateNotFound(IOError, LookupError, TemplateError): + message: Any + name: Any + templates: Any + def __init__(self, name, message: Optional[Text] = ...) -> None: ... + +class TemplatesNotFound(TemplateNotFound): + templates: Any + def __init__(self, names: Any = ..., message: Optional[Text] = ...) -> None: ... + +class TemplateSyntaxError(TemplateError): + lineno: int + name: Text + filename: Text + source: Text + translated: bool + def __init__(self, message: Text, lineno: int, name: Optional[Text] = ..., filename: Optional[Text] = ...) -> None: ... + +class TemplateAssertionError(TemplateSyntaxError): ... +class TemplateRuntimeError(TemplateError): ... +class UndefinedError(TemplateRuntimeError): ... +class SecurityError(TemplateRuntimeError): ... +class FilterArgumentError(TemplateRuntimeError): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/jinja2/ext.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/jinja2/ext.pyi new file mode 100644 index 0000000..2835860 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/jinja2/ext.pyi @@ -0,0 +1,58 @@ +from typing import Any, Optional + +GETTEXT_FUNCTIONS: Any + +class ExtensionRegistry(type): + def __new__(cls, name, bases, d): ... + +class Extension: + tags: Any + priority: int + environment: Any + def __init__(self, environment) -> None: ... + def bind(self, environment): ... + def preprocess(self, source, name, filename: Optional[Any] = ...): ... + def filter_stream(self, stream): ... + def parse(self, parser): ... + def attr(self, name, lineno: Optional[Any] = ...): ... + def call_method(self, name, args: Optional[Any] = ..., kwargs: Optional[Any] = ..., dyn_args: Optional[Any] = ..., dyn_kwargs: Optional[Any] = ..., lineno: Optional[Any] = ...): ... + +class InternationalizationExtension(Extension): + tags: Any + def __init__(self, environment) -> None: ... + def parse(self, parser): ... + +class ExprStmtExtension(Extension): + tags: Any + def parse(self, parser): ... + +class LoopControlExtension(Extension): + tags: Any + def parse(self, parser): ... + +class WithExtension(Extension): + tags: Any + def parse(self, parser): ... + +class AutoEscapeExtension(Extension): + tags: Any + def parse(self, parser): ... + +def extract_from_ast(node, gettext_functions: Any = ..., babel_style: bool = ...): ... + +class _CommentFinder: + tokens: Any + comment_tags: Any + offset: int + last_lineno: int + def __init__(self, tokens, comment_tags) -> None: ... + def find_backwards(self, offset): ... + def find_comments(self, lineno): ... + +def babel_extract(fileobj, keywords, comment_tags, options): ... + +i18n: Any +do: Any +loopcontrols: Any +with_: Any +autoescape: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/jinja2/filters.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/jinja2/filters.pyi new file mode 100644 index 0000000..e0d9c8e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/jinja2/filters.pyi @@ -0,0 +1,57 @@ +from typing import Any, Optional + +def contextfilter(f): ... +def evalcontextfilter(f): ... +def environmentfilter(f): ... +def make_attrgetter(environment, attribute): ... +def do_forceescape(value): ... +def do_urlencode(value): ... +def do_replace(eval_ctx, s, old, new, count: Optional[Any] = ...): ... +def do_upper(s): ... +def do_lower(s): ... +def do_xmlattr(_eval_ctx, d, autospace: bool = ...): ... +def do_capitalize(s): ... +def do_title(s): ... +def do_dictsort(value, case_sensitive: bool = ..., by: str = ...): ... +def do_sort(environment, value, reverse: bool = ..., case_sensitive: bool = ..., attribute: Optional[Any] = ...): ... +def do_default(value, default_value: str = ..., boolean: bool = ...): ... +def do_join(eval_ctx, value, d: str = ..., attribute: Optional[Any] = ...): ... +def do_center(value, width: int = ...): ... +def do_first(environment, seq): ... +def do_last(environment, seq): ... +def do_random(environment, seq): ... +def do_filesizeformat(value, binary: bool = ...): ... +def do_pprint(value, verbose: bool = ...): ... +def do_urlize(eval_ctx, value, trim_url_limit: Optional[Any] = ..., nofollow: bool = ..., target: Optional[Any] = ...): ... +def do_indent(s, width: int = ..., indentfirst: bool = ...): ... +def do_truncate(s, length: int = ..., killwords: bool = ..., end: str = ...): ... +def do_wordwrap(environment, s, width: int = ..., break_long_words: bool = ..., wrapstring: Optional[Any] = ...): ... +def do_wordcount(s): ... +def do_int(value, default: int = ..., base: int = ...): ... +def do_float(value, default: float = ...): ... +def do_format(value, *args, **kwargs): ... +def do_trim(value): ... +def do_striptags(value): ... +def do_slice(value, slices, fill_with: Optional[Any] = ...): ... +def do_batch(value, linecount, fill_with: Optional[Any] = ...): ... +def do_round(value, precision: int = ..., method: str = ...): ... +def do_groupby(environment, value, attribute): ... + +class _GroupTuple(tuple): + grouper: Any + list: Any + def __new__(cls, xxx_todo_changeme): ... + +def do_sum(environment, iterable, attribute: Optional[Any] = ..., start: int = ...): ... +def do_list(value): ... +def do_mark_safe(value): ... +def do_mark_unsafe(value): ... +def do_reverse(value): ... +def do_attr(environment, obj, name): ... +def do_map(*args, **kwargs): ... +def do_select(*args, **kwargs): ... +def do_reject(*args, **kwargs): ... +def do_selectattr(*args, **kwargs): ... +def do_rejectattr(*args, **kwargs): ... + +FILTERS: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/jinja2/lexer.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/jinja2/lexer.pyi new file mode 100644 index 0000000..182a2fb --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/jinja2/lexer.pyi @@ -0,0 +1,117 @@ +from typing import Any, Optional + +whitespace_re: Any +string_re: Any +integer_re: Any +name_re: Any +float_re: Any +newline_re: Any +TOKEN_ADD: Any +TOKEN_ASSIGN: Any +TOKEN_COLON: Any +TOKEN_COMMA: Any +TOKEN_DIV: Any +TOKEN_DOT: Any +TOKEN_EQ: Any +TOKEN_FLOORDIV: Any +TOKEN_GT: Any +TOKEN_GTEQ: Any +TOKEN_LBRACE: Any +TOKEN_LBRACKET: Any +TOKEN_LPAREN: Any +TOKEN_LT: Any +TOKEN_LTEQ: Any +TOKEN_MOD: Any +TOKEN_MUL: Any +TOKEN_NE: Any +TOKEN_PIPE: Any +TOKEN_POW: Any +TOKEN_RBRACE: Any +TOKEN_RBRACKET: Any +TOKEN_RPAREN: Any +TOKEN_SEMICOLON: Any +TOKEN_SUB: Any +TOKEN_TILDE: Any +TOKEN_WHITESPACE: Any +TOKEN_FLOAT: Any +TOKEN_INTEGER: Any +TOKEN_NAME: Any +TOKEN_STRING: Any +TOKEN_OPERATOR: Any +TOKEN_BLOCK_BEGIN: Any +TOKEN_BLOCK_END: Any +TOKEN_VARIABLE_BEGIN: Any +TOKEN_VARIABLE_END: Any +TOKEN_RAW_BEGIN: Any +TOKEN_RAW_END: Any +TOKEN_COMMENT_BEGIN: Any +TOKEN_COMMENT_END: Any +TOKEN_COMMENT: Any +TOKEN_LINESTATEMENT_BEGIN: Any +TOKEN_LINESTATEMENT_END: Any +TOKEN_LINECOMMENT_BEGIN: Any +TOKEN_LINECOMMENT_END: Any +TOKEN_LINECOMMENT: Any +TOKEN_DATA: Any +TOKEN_INITIAL: Any +TOKEN_EOF: Any +operators: Any +reverse_operators: Any +operator_re: Any +ignored_tokens: Any +ignore_if_empty: Any + +def describe_token(token): ... +def describe_token_expr(expr): ... +def count_newlines(value): ... +def compile_rules(environment): ... + +class Failure: + message: Any + error_class: Any + def __init__(self, message, cls: Any = ...) -> None: ... + def __call__(self, lineno, filename): ... + +class Token(tuple): + lineno: Any + type: Any + value: Any + def __new__(cls, lineno, type, value): ... + def test(self, expr): ... + def test_any(self, *iterable): ... + +class TokenStreamIterator: + stream: Any + def __init__(self, stream) -> None: ... + def __iter__(self): ... + def __next__(self): ... + +class TokenStream: + name: Any + filename: Any + closed: bool + current: Any + def __init__(self, generator, name, filename) -> None: ... + def __iter__(self): ... + def __bool__(self): ... + __nonzero__: Any + eos: Any + def push(self, token): ... + def look(self): ... + def skip(self, n: int = ...): ... + def next_if(self, expr): ... + def skip_if(self, expr): ... + def __next__(self): ... + def close(self): ... + def expect(self, expr): ... + +def get_lexer(environment): ... + +class Lexer: + newline_sequence: Any + keep_trailing_newline: Any + rules: Any + def __init__(self, environment) -> None: ... + def tokenize(self, source, name: Optional[Any] = ..., filename: Optional[Any] = ..., state: Optional[Any] = ...): ... + def wrap(self, stream, name: Optional[Any] = ..., filename: Optional[Any] = ...): ... + def tokeniter(self, source, name, filename: Optional[Any] = ..., state: Optional[Any] = ...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/jinja2/loaders.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/jinja2/loaders.pyi new file mode 100644 index 0000000..330de41 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/jinja2/loaders.pyi @@ -0,0 +1,70 @@ +from typing import Any, Callable, Iterable, List, Optional, Text, Tuple, Union +from types import ModuleType + +from .environment import Environment + +def split_template_path(template: Text) -> List[Text]: ... + +class BaseLoader: + has_source_access: bool + def get_source(self, environment, template): ... + def list_templates(self): ... + def load(self, environment, name, globals: Optional[Any] = ...): ... + +class FileSystemLoader(BaseLoader): + searchpath: Text + encoding: Any + followlinks: Any + def __init__(self, searchpath: Union[Text, Iterable[Text]], encoding: Text = ..., followlinks: bool = ...) -> None: ... + def get_source(self, environment: Environment, template: Text) -> Tuple[Text, Text, Callable]: ... + def list_templates(self): ... + +class PackageLoader(BaseLoader): + encoding: Text + manager: Any + filesystem_bound: Any + provider: Any + package_path: Any + def __init__(self, package_name: Text, package_path: Text = ..., encoding: Text = ...) -> None: ... + def get_source(self, environment: Environment, template: Text) -> Tuple[Text, Text, Callable]: ... + def list_templates(self): ... + +class DictLoader(BaseLoader): + mapping: Any + def __init__(self, mapping) -> None: ... + def get_source(self, environment: Environment, template: Text) -> Tuple[Text, Text, Callable]: ... + def list_templates(self): ... + +class FunctionLoader(BaseLoader): + load_func: Any + def __init__(self, load_func) -> None: ... + def get_source(self, environment: Environment, template: Text) -> Tuple[Text, Optional[Text], Optional[Callable]]: ... + +class PrefixLoader(BaseLoader): + mapping: Any + delimiter: Any + def __init__(self, mapping, delimiter: str = ...) -> None: ... + def get_loader(self, template): ... + def get_source(self, environment: Environment, template: Text) -> Tuple[Text, Text, Callable]: ... + def load(self, environment, name, globals: Optional[Any] = ...): ... + def list_templates(self): ... + +class ChoiceLoader(BaseLoader): + loaders: Any + def __init__(self, loaders) -> None: ... + def get_source(self, environment: Environment, template: Text) -> Tuple[Text, Text, Callable]: ... + def load(self, environment, name, globals: Optional[Any] = ...): ... + def list_templates(self): ... + +class _TemplateModule(ModuleType): ... + +class ModuleLoader(BaseLoader): + has_source_access: bool + module: Any + package_name: Any + def __init__(self, path) -> None: ... + @staticmethod + def get_template_key(name): ... + @staticmethod + def get_module_filename(name): ... + def load(self, environment, name, globals: Optional[Any] = ...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/jinja2/meta.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/jinja2/meta.pyi new file mode 100644 index 0000000..46ca83b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/jinja2/meta.pyi @@ -0,0 +1,11 @@ +from typing import Any +from jinja2.compiler import CodeGenerator + +class TrackingCodeGenerator(CodeGenerator): + undeclared_identifiers: Any + def __init__(self, environment) -> None: ... + def write(self, x): ... + def pull_locals(self, frame): ... + +def find_undeclared_variables(ast): ... +def find_referenced_templates(ast): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/jinja2/nodes.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/jinja2/nodes.pyi new file mode 100644 index 0000000..4fb410d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/jinja2/nodes.pyi @@ -0,0 +1,250 @@ +from typing import Any, Optional + +class Impossible(Exception): ... + +class NodeType(type): + def __new__(cls, name, bases, d): ... + +class EvalContext: + environment: Any + autoescape: Any + volatile: bool + def __init__(self, environment, template_name: Optional[Any] = ...) -> None: ... + def save(self): ... + def revert(self, old): ... + +def get_eval_context(node, ctx): ... + +class Node: + fields: Any + attributes: Any + abstract: bool + def __init__(self, *fields, **attributes) -> None: ... + def iter_fields(self, exclude: Optional[Any] = ..., only: Optional[Any] = ...): ... + def iter_child_nodes(self, exclude: Optional[Any] = ..., only: Optional[Any] = ...): ... + def find(self, node_type): ... + def find_all(self, node_type): ... + def set_ctx(self, ctx): ... + def set_lineno(self, lineno, override: bool = ...): ... + def set_environment(self, environment): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + __hash__: Any + +class Stmt(Node): + abstract: bool + +class Helper(Node): + abstract: bool + +class Template(Node): + fields: Any + +class Output(Stmt): + fields: Any + +class Extends(Stmt): + fields: Any + +class For(Stmt): + fields: Any + +class If(Stmt): + fields: Any + +class Macro(Stmt): + fields: Any + +class CallBlock(Stmt): + fields: Any + +class FilterBlock(Stmt): + fields: Any + +class Block(Stmt): + fields: Any + +class Include(Stmt): + fields: Any + +class Import(Stmt): + fields: Any + +class FromImport(Stmt): + fields: Any + +class ExprStmt(Stmt): + fields: Any + +class Assign(Stmt): + fields: Any + +class AssignBlock(Stmt): + fields: Any + +class Expr(Node): + abstract: bool + def as_const(self, eval_ctx: Optional[Any] = ...): ... + def can_assign(self): ... + +class BinExpr(Expr): + fields: Any + operator: Any + abstract: bool + def as_const(self, eval_ctx: Optional[Any] = ...): ... + +class UnaryExpr(Expr): + fields: Any + operator: Any + abstract: bool + def as_const(self, eval_ctx: Optional[Any] = ...): ... + +class Name(Expr): + fields: Any + def can_assign(self): ... + +class Literal(Expr): + abstract: bool + +class Const(Literal): + fields: Any + def as_const(self, eval_ctx: Optional[Any] = ...): ... + @classmethod + def from_untrusted(cls, value, lineno: Optional[Any] = ..., environment: Optional[Any] = ...): ... + +class TemplateData(Literal): + fields: Any + def as_const(self, eval_ctx: Optional[Any] = ...): ... + +class Tuple(Literal): + fields: Any + def as_const(self, eval_ctx: Optional[Any] = ...): ... + def can_assign(self): ... + +class List(Literal): + fields: Any + def as_const(self, eval_ctx: Optional[Any] = ...): ... + +class Dict(Literal): + fields: Any + def as_const(self, eval_ctx: Optional[Any] = ...): ... + +class Pair(Helper): + fields: Any + def as_const(self, eval_ctx: Optional[Any] = ...): ... + +class Keyword(Helper): + fields: Any + def as_const(self, eval_ctx: Optional[Any] = ...): ... + +class CondExpr(Expr): + fields: Any + def as_const(self, eval_ctx: Optional[Any] = ...): ... + +class Filter(Expr): + fields: Any + def as_const(self, eval_ctx: Optional[Any] = ...): ... + +class Test(Expr): + fields: Any + +class Call(Expr): + fields: Any + def as_const(self, eval_ctx: Optional[Any] = ...): ... + +class Getitem(Expr): + fields: Any + def as_const(self, eval_ctx: Optional[Any] = ...): ... + def can_assign(self): ... + +class Getattr(Expr): + fields: Any + def as_const(self, eval_ctx: Optional[Any] = ...): ... + def can_assign(self): ... + +class Slice(Expr): + fields: Any + def as_const(self, eval_ctx: Optional[Any] = ...): ... + +class Concat(Expr): + fields: Any + def as_const(self, eval_ctx: Optional[Any] = ...): ... + +class Compare(Expr): + fields: Any + def as_const(self, eval_ctx: Optional[Any] = ...): ... + +class Operand(Helper): + fields: Any + +class Mul(BinExpr): + operator: str + +class Div(BinExpr): + operator: str + +class FloorDiv(BinExpr): + operator: str + +class Add(BinExpr): + operator: str + +class Sub(BinExpr): + operator: str + +class Mod(BinExpr): + operator: str + +class Pow(BinExpr): + operator: str + +class And(BinExpr): + operator: str + def as_const(self, eval_ctx: Optional[Any] = ...): ... + +class Or(BinExpr): + operator: str + def as_const(self, eval_ctx: Optional[Any] = ...): ... + +class Not(UnaryExpr): + operator: str + +class Neg(UnaryExpr): + operator: str + +class Pos(UnaryExpr): + operator: str + +class EnvironmentAttribute(Expr): + fields: Any + +class ExtensionAttribute(Expr): + fields: Any + +class ImportedName(Expr): + fields: Any + +class InternalName(Expr): + fields: Any + def __init__(self) -> None: ... + +class MarkSafe(Expr): + fields: Any + def as_const(self, eval_ctx: Optional[Any] = ...): ... + +class MarkSafeIfAutoescape(Expr): + fields: Any + def as_const(self, eval_ctx: Optional[Any] = ...): ... + +class ContextReference(Expr): ... +class Continue(Stmt): ... +class Break(Stmt): ... + +class Scope(Stmt): + fields: Any + +class EvalContextModifier(Stmt): + fields: Any + +class ScopedEvalContextModifier(EvalContextModifier): + fields: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/jinja2/optimizer.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/jinja2/optimizer.pyi new file mode 100644 index 0000000..b55b08a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/jinja2/optimizer.pyi @@ -0,0 +1,29 @@ +from typing import Any +from jinja2.visitor import NodeTransformer + +def optimize(node, environment): ... + +class Optimizer(NodeTransformer): + environment: Any + def __init__(self, environment) -> None: ... + def visit_If(self, node): ... + def fold(self, node): ... + visit_Add: Any + visit_Sub: Any + visit_Mul: Any + visit_Div: Any + visit_FloorDiv: Any + visit_Pow: Any + visit_Mod: Any + visit_And: Any + visit_Or: Any + visit_Pos: Any + visit_Neg: Any + visit_Not: Any + visit_Compare: Any + visit_Getitem: Any + visit_Getattr: Any + visit_Call: Any + visit_Filter: Any + visit_Test: Any + visit_CondExpr: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/jinja2/parser.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/jinja2/parser.pyi new file mode 100644 index 0000000..a16ae8d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/jinja2/parser.pyi @@ -0,0 +1,60 @@ +from typing import Any, Optional + +class Parser: + environment: Any + stream: Any + name: Any + filename: Any + closed: bool + extensions: Any + def __init__(self, environment, source, name: Optional[Any] = ..., filename: Optional[Any] = ..., state: Optional[Any] = ...) -> None: ... + def fail(self, msg, lineno: Optional[Any] = ..., exc: Any = ...): ... + def fail_unknown_tag(self, name, lineno: Optional[Any] = ...): ... + def fail_eof(self, end_tokens: Optional[Any] = ..., lineno: Optional[Any] = ...): ... + def is_tuple_end(self, extra_end_rules: Optional[Any] = ...): ... + def free_identifier(self, lineno: Optional[Any] = ...): ... + def parse_statement(self): ... + def parse_statements(self, end_tokens, drop_needle: bool = ...): ... + def parse_set(self): ... + def parse_for(self): ... + def parse_if(self): ... + def parse_block(self): ... + def parse_extends(self): ... + def parse_import_context(self, node, default): ... + def parse_include(self): ... + def parse_import(self): ... + def parse_from(self): ... + def parse_signature(self, node): ... + def parse_call_block(self): ... + def parse_filter_block(self): ... + def parse_macro(self): ... + def parse_print(self): ... + def parse_assign_target(self, with_tuple: bool = ..., name_only: bool = ..., extra_end_rules: Optional[Any] = ...): ... + def parse_expression(self, with_condexpr: bool = ...): ... + def parse_condexpr(self): ... + def parse_or(self): ... + def parse_and(self): ... + def parse_not(self): ... + def parse_compare(self): ... + def parse_add(self): ... + def parse_sub(self): ... + def parse_concat(self): ... + def parse_mul(self): ... + def parse_div(self): ... + def parse_floordiv(self): ... + def parse_mod(self): ... + def parse_pow(self): ... + def parse_unary(self, with_filter: bool = ...): ... + def parse_primary(self): ... + def parse_tuple(self, simplified: bool = ..., with_condexpr: bool = ..., extra_end_rules: Optional[Any] = ..., explicit_parentheses: bool = ...): ... + def parse_list(self): ... + def parse_dict(self): ... + def parse_postfix(self, node): ... + def parse_filter_expr(self, node): ... + def parse_subscript(self, node): ... + def parse_subscribed(self): ... + def parse_call(self, node): ... + def parse_filter(self, node, start_inline: bool = ...): ... + def parse_test(self, node): ... + def subparse(self, end_tokens: Optional[Any] = ...): ... + def parse(self): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/jinja2/runtime.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/jinja2/runtime.pyi new file mode 100644 index 0000000..271c0ef --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/jinja2/runtime.pyi @@ -0,0 +1,130 @@ +from typing import Any, Dict, Optional, Text, Union +from jinja2.utils import Markup as Markup, escape as escape, missing as missing, concat as concat +from jinja2.exceptions import TemplateRuntimeError as TemplateRuntimeError, TemplateNotFound as TemplateNotFound + +from jinja2.environment import Environment + +to_string: Any +identity: Any + +def markup_join(seq): ... +def unicode_join(seq): ... + +class TemplateReference: + def __init__(self, context) -> None: ... + def __getitem__(self, name): ... + +class Context: + parent: Union[Context, Dict[str, Any]] + vars: Dict[str, Any] + environment: Environment + eval_ctx: Any + exported_vars: Any + name: Text + blocks: Dict[str, Any] + def __init__(self, environment: Environment, parent: Union[Context, Dict[str, Any]], name: Text, blocks: Dict[str, Any]) -> None: ... + def super(self, name, current): ... + def get(self, key, default: Optional[Any] = ...): ... + def resolve(self, key): ... + def get_exported(self): ... + def get_all(self): ... + def call(__self, __obj, *args, **kwargs): ... + def derived(self, locals: Optional[Any] = ...): ... + keys: Any + values: Any + items: Any + iterkeys: Any + itervalues: Any + iteritems: Any + def __contains__(self, name): ... + def __getitem__(self, key): ... + +class BlockReference: + name: Any + def __init__(self, name, context, stack, depth) -> None: ... + @property + def super(self): ... + def __call__(self): ... + +class LoopContext: + index0: int + depth0: Any + def __init__(self, iterable, recurse: Optional[Any] = ..., depth0: int = ...) -> None: ... + def cycle(self, *args): ... + first: Any + last: Any + index: Any + revindex: Any + revindex0: Any + depth: Any + def __len__(self): ... + def __iter__(self): ... + def loop(self, iterable): ... + __call__: Any + @property + def length(self): ... + +class LoopContextIterator: + context: Any + def __init__(self, context) -> None: ... + def __iter__(self): ... + def __next__(self): ... + +class Macro: + name: Any + arguments: Any + defaults: Any + catch_kwargs: Any + catch_varargs: Any + caller: Any + def __init__(self, environment, func, name, arguments, defaults, catch_kwargs, catch_varargs, caller) -> None: ... + def __call__(self, *args, **kwargs): ... + +class Undefined: + def __init__(self, hint: Optional[Any] = ..., obj: Any = ..., name: Optional[Any] = ..., exc: Any = ...) -> None: ... + def __getattr__(self, name): ... + __add__: Any + __radd__: Any + __mul__: Any + __rmul__: Any + __div__: Any + __rdiv__: Any + __truediv__: Any + __rtruediv__: Any + __floordiv__: Any + __rfloordiv__: Any + __mod__: Any + __rmod__: Any + __pos__: Any + __neg__: Any + __call__: Any + __getitem__: Any + __lt__: Any + __le__: Any + __gt__: Any + __ge__: Any + __int__: Any + __float__: Any + __complex__: Any + __pow__: Any + __rpow__: Any + def __eq__(self, other): ... + def __ne__(self, other): ... + def __hash__(self): ... + def __len__(self): ... + def __iter__(self): ... + def __nonzero__(self): ... + __bool__: Any + +def make_logging_undefined(logger: Optional[Any] = ..., base: Optional[Any] = ...): ... + +class DebugUndefined(Undefined): ... + +class StrictUndefined(Undefined): + __iter__: Any + __len__: Any + __nonzero__: Any + __eq__: Any + __ne__: Any + __bool__: Any + __hash__: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/jinja2/sandbox.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/jinja2/sandbox.pyi new file mode 100644 index 0000000..518deca --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/jinja2/sandbox.pyi @@ -0,0 +1,34 @@ +from typing import Any +from jinja2.environment import Environment + +MAX_RANGE: int +UNSAFE_FUNCTION_ATTRIBUTES: Any +UNSAFE_METHOD_ATTRIBUTES: Any +UNSAFE_GENERATOR_ATTRIBUTES: Any + +def safe_range(*args): ... +def unsafe(f): ... +def is_internal_attribute(obj, attr): ... +def modifies_known_mutable(obj, attr): ... + +class SandboxedEnvironment(Environment): + sandboxed: bool + default_binop_table: Any + default_unop_table: Any + intercepted_binops: Any + intercepted_unops: Any + def intercept_unop(self, operator): ... + binop_table: Any + unop_table: Any + def __init__(self, *args, **kwargs) -> None: ... + def is_safe_attribute(self, obj, attr, value): ... + def is_safe_callable(self, obj): ... + def call_binop(self, context, operator, left, right): ... + def call_unop(self, context, operator, arg): ... + def getitem(self, obj, argument): ... + def getattr(self, obj, attribute): ... + def unsafe_undefined(self, obj, attribute): ... + def call(__self, __context, __obj, *args, **kwargs): ... + +class ImmutableSandboxedEnvironment(SandboxedEnvironment): + def is_safe_attribute(self, obj, attr, value): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/jinja2/tests.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/jinja2/tests.pyi new file mode 100644 index 0000000..2645fe9 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/jinja2/tests.pyi @@ -0,0 +1,24 @@ +from typing import Any + +number_re: Any +regex_type: Any +test_callable: Any + +def test_odd(value): ... +def test_even(value): ... +def test_divisibleby(value, num): ... +def test_defined(value): ... +def test_undefined(value): ... +def test_none(value): ... +def test_lower(value): ... +def test_upper(value): ... +def test_string(value): ... +def test_mapping(value): ... +def test_number(value): ... +def test_sequence(value): ... +def test_equalto(value, other): ... +def test_sameas(value, other): ... +def test_iterable(value): ... +def test_escaped(value): ... + +TESTS: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/jinja2/utils.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/jinja2/utils.pyi new file mode 100644 index 0000000..bf5ff83 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/jinja2/utils.pyi @@ -0,0 +1,61 @@ +from typing import Any, Callable, Iterable, Optional + +from markupsafe import Markup as Markup, escape as escape, soft_unicode as soft_unicode + +missing: Any +internal_code: Any +concat: Any + +def contextfunction(f): ... +def evalcontextfunction(f): ... +def environmentfunction(f): ... +def internalcode(f): ... +def is_undefined(obj): ... +def select_autoescape(enabled_extensions: Iterable[str] = ..., disabled_extensions: Iterable[str] = ..., default_for_string: bool = ..., default: bool = ...) -> Callable[[str], bool]: ... +def consume(iterable): ... +def clear_caches(): ... +def import_string(import_name, silent: bool = ...): ... +def open_if_exists(filename, mode: str = ...): ... +def object_type_repr(obj): ... +def pformat(obj, verbose: bool = ...): ... +def urlize(text, trim_url_limit: Optional[Any] = ..., nofollow: bool = ..., target: Optional[Any] = ...): ... +def generate_lorem_ipsum(n: int = ..., html: bool = ..., min: int = ..., max: int = ...): ... +def unicode_urlencode(obj, charset: str = ..., for_qs: bool = ...): ... + +class LRUCache: + capacity: Any + def __init__(self, capacity) -> None: ... + def __getnewargs__(self): ... + def copy(self): ... + def get(self, key, default: Optional[Any] = ...): ... + def setdefault(self, key, default: Optional[Any] = ...): ... + def clear(self): ... + def __contains__(self, key): ... + def __len__(self): ... + def __getitem__(self, key): ... + def __setitem__(self, key, value): ... + def __delitem__(self, key): ... + def items(self): ... + def iteritems(self): ... + def values(self): ... + def itervalue(self): ... + def keys(self): ... + def iterkeys(self): ... + __iter__: Any + def __reversed__(self): ... + __copy__: Any + +class Cycler: + items: Any + def __init__(self, *items) -> None: ... + pos: int + def reset(self): ... + @property + def current(self): ... + def __next__(self): ... + +class Joiner: + sep: Any + used: bool + def __init__(self, sep: str = ...) -> None: ... + def __call__(self): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/jinja2/visitor.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/jinja2/visitor.pyi new file mode 100644 index 0000000..ef34328 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/jinja2/visitor.pyi @@ -0,0 +1,8 @@ +class NodeVisitor: + def get_visitor(self, node): ... + def visit(self, node, *args, **kwargs): ... + def generic_visit(self, node, *args, **kwargs): ... + +class NodeTransformer(NodeVisitor): + def generic_visit(self, node, *args, **kwargs): ... + def visit_list(self, node, *args, **kwargs): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/markupsafe/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/markupsafe/__init__.pyi new file mode 100644 index 0000000..44d15da --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/markupsafe/__init__.pyi @@ -0,0 +1,53 @@ +import sys + +from typing import Any, Callable, Dict, Iterable, List, Optional, Sequence, Text, Tuple, Union +from collections import Mapping +from markupsafe._compat import text_type +import string +from markupsafe._native import escape as escape, escape_silent as escape_silent, soft_unicode as soft_unicode + +class Markup(text_type): + def __new__(cls, base: Text = ..., encoding: Optional[Text] = ..., errors: Text = ...) -> Markup: ... + def __html__(self) -> Markup: ... + def __add__(self, other: text_type) -> Markup: ... + def __radd__(self, other: text_type) -> Markup: ... + def __mul__(self, num: int) -> Markup: ... + def __rmul__(self, num: int) -> Markup: ... + def __mod__(self, *args: Any) -> Markup: ... + def join(self, seq: Iterable[text_type]): ... + def split(self, sep: Optional[text_type] = ..., maxsplit: int = ...) -> List[text_type]: ... + def rsplit(self, sep: Optional[text_type] = ..., maxsplit: int = ...) -> List[text_type]: ... + def splitlines(self, keepends: bool = ...) -> List[text_type]: ... + def unescape(self) -> Text: ... + def striptags(self) -> Text: ... + @classmethod + def escape(cls, s: text_type) -> Markup: ... + def partition(self, sep: text_type) -> Tuple[Markup, Markup, Markup]: ... + def rpartition(self, sep: text_type) -> Tuple[Markup, Markup, Markup]: ... + def format(self, *args, **kwargs) -> Markup: ... + def __html_format__(self, format_spec) -> Markup: ... + def __getslice__(self, start: int, stop: int) -> Markup: ... + def __getitem__(self, i: Union[int, slice]) -> Markup: ... + def capitalize(self) -> Markup: ... + def title(self) -> Markup: ... + def lower(self) -> Markup: ... + def upper(self) -> Markup: ... + def swapcase(self) -> Markup: ... + def replace(self, old: text_type, new: text_type, count: int = ...) -> Markup: ... + def ljust(self, width: int, fillchar: text_type = ...) -> Markup: ... + def rjust(self, width: int, fillchar: text_type = ...) -> Markup: ... + def lstrip(self, chars: Optional[text_type] = ...) -> Markup: ... + def rstrip(self, chars: Optional[text_type] = ...) -> Markup: ... + def strip(self, chars: Optional[text_type] = ...) -> Markup: ... + def center(self, width: int, fillchar: text_type = ...) -> Markup: ... + def zfill(self, width: int) -> Markup: ... + def translate(self, table: Union[Mapping[int, Union[int, text_type, None]], Sequence[Union[int, text_type, None]]]) -> Markup: ... + def expandtabs(self, tabsize: int = ...) -> Markup: ... + +class EscapeFormatter(string.Formatter): + escape: Callable[[text_type], Markup] + def __init__(self, escape: Callable[[text_type], Markup]) -> None: ... + def format_field(self, value: text_type, format_spec: text_type) -> Markup: ... + +if sys.version_info[0] >= 3: + soft_str = soft_unicode diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/markupsafe/_compat.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/markupsafe/_compat.pyi new file mode 100644 index 0000000..7257425 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/markupsafe/_compat.pyi @@ -0,0 +1,19 @@ +import sys + +from typing import Any, Iterator, Mapping, Text, Tuple, TypeVar + +_K = TypeVar('_K') +_V = TypeVar('_V') + +PY2: bool +def iteritems(d: Mapping[_K, _V]) -> Iterator[Tuple[_K, _V]]: ... +if sys.version_info[0] >= 3: + text_type = str + string_types = str, + unichr = chr + int_types = int, +else: + from __builtin__ import unichr as unichr + text_type = unicode + string_types = (str, unicode) + int_types = (int, long) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/markupsafe/_constants.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/markupsafe/_constants.pyi new file mode 100644 index 0000000..a0d67ed --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/markupsafe/_constants.pyi @@ -0,0 +1,3 @@ +from typing import Any, Dict, Text + +HTML_ENTITIES: Dict[Text, int] diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/markupsafe/_native.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/markupsafe/_native.pyi new file mode 100644 index 0000000..ecf20c6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/markupsafe/_native.pyi @@ -0,0 +1,7 @@ +from . import Markup +from ._compat import text_type, string_types +from typing import Union, Text + +def escape(s: Union[Markup, Text]) -> Markup: ... +def escape_silent(s: Union[None, Markup, Text]) -> Markup: ... +def soft_unicode(s: Text) -> text_type: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/markupsafe/_speedups.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/markupsafe/_speedups.pyi new file mode 100644 index 0000000..ecf20c6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/markupsafe/_speedups.pyi @@ -0,0 +1,7 @@ +from . import Markup +from ._compat import text_type, string_types +from typing import Union, Text + +def escape(s: Union[Markup, Text]) -> Markup: ... +def escape_silent(s: Union[None, Markup, Text]) -> Markup: ... +def soft_unicode(s: Text) -> text_type: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/mock.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/mock.pyi new file mode 100644 index 0000000..cb3db61 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/mock.pyi @@ -0,0 +1,146 @@ +# Stubs for mock + +import sys +from typing import Any, Optional, Text, Type + +FILTER_DIR: Any + +class _slotted: ... + +class _SentinelObject: + name: Any + def __init__(self, name: Any) -> None: ... + +class _Sentinel: + def __init__(self) -> None: ... + def __getattr__(self, name: str) -> Any: ... + +sentinel: Any +DEFAULT: Any + +class _CallList(list): + def __contains__(self, value: Any) -> bool: ... + +class _MockIter: + obj: Any + def __init__(self, obj: Any) -> None: ... + def __iter__(self) -> Any: ... + def __next__(self) -> Any: ... + +class Base: + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + +# TODO: Defining this and other mock classes as classes in this stub causes +# many false positives with mypy and production code. See if we can +# improve mypy somehow and use a class with an "Any" base class. +NonCallableMock: Any + +class CallableMixin(Base): + side_effect: Any + def __init__(self, spec: Optional[Any] = ..., side_effect: Optional[Any] = ..., return_value: Any = ..., wraps: Optional[Any] = ..., name: Optional[Any] = ..., spec_set: Optional[Any] = ..., parent: Optional[Any] = ..., _spec_state: Optional[Any] = ..., _new_name: Any = ..., _new_parent: Optional[Any] = ..., **kwargs: Any) -> None: ... + def __call__(_mock_self, *args: Any, **kwargs: Any) -> Any: ... + +Mock: Any + +class _patch: + attribute_name: Any + getter: Any + attribute: Any + new: Any + new_callable: Any + spec: Any + create: bool + has_local: Any + spec_set: Any + autospec: Any + kwargs: Any + additional_patchers: Any + def __init__(self, getter: Any, attribute: Any, new: Any, spec: Any, create: Any, spec_set: Any, autospec: Any, new_callable: Any, kwargs: Any) -> None: ... + def copy(self) -> Any: ... + def __call__(self, func: Any) -> Any: ... + def decorate_class(self, klass: Any) -> Any: ... + def decorate_callable(self, func: Any) -> Any: ... + def get_original(self) -> Any: ... + target: Any + temp_original: Any + is_local: Any + def __enter__(self) -> Any: ... + def __exit__(self, *exc_info: Any) -> Any: ... + def start(self) -> Any: ... + def stop(self) -> Any: ... + +class _patch_dict: + in_dict: Any + values: Any + clear: Any + def __init__(self, in_dict: Any, values: Any = ..., clear: Any = ..., **kwargs: Any) -> None: ... + def __call__(self, f: Any) -> Any: ... + def decorate_class(self, klass: Any) -> Any: ... + def __enter__(self) -> Any: ... + def __exit__(self, *args: Any) -> Any: ... + start: Any + stop: Any + +class _patcher: + TEST_PREFIX: str + dict: Type[_patch_dict] + def __call__(self, target: Any, new: Optional[Any] = ..., spec: Optional[Any] = ..., create: bool = ..., spec_set: Optional[Any] = ..., autospec: Optional[Any] = ..., new_callable: Optional[Any] = ..., **kwargs: Any) -> _patch: ... + def object(self, target: Any, attribute: Text, new: Optional[Any] = ..., spec: Optional[Any] = ..., create: bool = ..., spec_set: Optional[Any] = ..., autospec: Optional[Any] = ..., new_callable: Optional[Any] = ..., **kwargs: Any) -> _patch: ... + def multiple(self, target: Any, spec: Optional[Any] = ..., create: bool = ..., spec_set: Optional[Any] = ..., autospec: Optional[Any] = ..., new_callable: Optional[Any] = ..., **kwargs: Any) -> _patch: ... + def stopall(self) -> None: ... + +patch: _patcher + +class MagicMixin: + def __init__(self, *args: Any, **kw: Any) -> None: ... + +NonCallableMagicMock: Any +MagicMock: Any + +class MagicProxy: + name: Any + parent: Any + def __init__(self, name: Any, parent: Any) -> None: ... + def __call__(self, *args: Any, **kwargs: Any) -> Any: ... + def create_mock(self) -> Any: ... + def __get__(self, obj: Any, _type: Optional[Any] = ...) -> Any: ... + +class _ANY: + def __eq__(self, other: Any) -> bool: ... + def __ne__(self, other: Any) -> bool: ... + +ANY: Any + +class _Call(tuple): + def __new__(cls, value: Any = ..., name: Optional[Any] = ..., parent: Optional[Any] = ..., two: bool = ..., from_kall: bool = ...) -> Any: ... + name: Any + parent: Any + from_kall: Any + def __init__(self, value: Any = ..., name: Optional[Any] = ..., parent: Optional[Any] = ..., two: bool = ..., from_kall: bool = ...) -> None: ... + def __eq__(self, other: Any) -> bool: ... + __ne__: Any + def __call__(self, *args: Any, **kwargs: Any) -> Any: ... + def __getattr__(self, attr: Any) -> Any: ... + def count(self, *args: Any, **kwargs: Any) -> Any: ... + def index(self, *args: Any, **kwargs: Any) -> Any: ... + def call_list(self) -> Any: ... + +call: Any + +def create_autospec(spec: Any, spec_set: Any = ..., instance: Any = ..., _parent: Optional[Any] = ..., _name: Optional[Any] = ..., **kwargs: Any) -> Any: ... + +class _SpecState: + spec: Any + ids: Any + spec_set: Any + parent: Any + instance: Any + name: Any + def __init__(self, spec: Any, spec_set: Any = ..., parent: Optional[Any] = ..., name: Optional[Any] = ..., ids: Optional[Any] = ..., instance: Any = ...) -> None: ... + +def mock_open(mock: Optional[Any] = ..., read_data: Any = ...) -> Any: ... + +PropertyMock: Any + +if sys.version_info >= (3, 7): + def seal(mock: Any) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/mypy_extensions.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/mypy_extensions.pyi new file mode 100644 index 0000000..f9c9ff6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/mypy_extensions.pyi @@ -0,0 +1,44 @@ +import abc +import sys +from typing import ( + Dict, Type, TypeVar, Optional, Union, Any, Generic, Mapping, ItemsView, KeysView, ValuesView +) + +_T = TypeVar('_T') +_U = TypeVar('_U') + +# Internal mypy fallback type for all typed dicts (does not exist at runtime) +class _TypedDict(Mapping[str, object], metaclass=abc.ABCMeta): + def copy(self: _T) -> _T: ... + # Using NoReturn so that only calls using mypy plugin hook that specialize the signature + # can go through. + def setdefault(self, k: NoReturn, default: object) -> object: ... + # Mypy plugin hook for 'pop' expects that 'default' has a type variable type. + def pop(self, k: NoReturn, default: _T = ...) -> object: ... + def update(self: _T, __m: _T) -> None: ... + if sys.version_info < (3, 0): + def has_key(self, k: str) -> bool: ... + def viewitems(self) -> ItemsView[str, object]: ... + def viewkeys(self) -> KeysView[str]: ... + def viewvalues(self) -> ValuesView[object]: ... + def __delitem__(self, k: NoReturn) -> None: ... + +def TypedDict(typename: str, fields: Dict[str, Type[_T]], total: bool = ...) -> Type[dict]: ... + +def Arg(type: _T = ..., name: Optional[str] = ...) -> _T: ... +def DefaultArg(type: _T = ..., name: Optional[str] = ...) -> _T: ... +def NamedArg(type: _T = ..., name: Optional[str] = ...) -> _T: ... +def DefaultNamedArg(type: _T = ..., name: Optional[str] = ...) -> _T: ... +def VarArg(type: _T = ...) -> _T: ... +def KwArg(type: _T = ...) -> _T: ... + +# Return type that indicates a function does not return. +# This type is equivalent to the None type, but the no-op Union is necessary to +# distinguish the None type from the None value. +NoReturn = Union[None] # Deprecated: Use typing.NoReturn instead. + +# This is intended as a class decorator, but mypy rejects abstract classes +# when a Type[_T] is expected, so we can't give it the type we want +def trait(cls: Any) -> Any: ... + +class FlexibleAlias(Generic[_T, _U]): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pycurl.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pycurl.pyi new file mode 100644 index 0000000..0d9da02 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pycurl.pyi @@ -0,0 +1,605 @@ +# TODO(MichalPokorny): more precise types + +from typing import Any, Tuple + +GLOBAL_ACK_EINTR: int +GLOBAL_ALL: int +GLOBAL_DEFAULT: int +GLOBAL_NOTHING: int +GLOBAL_SSL: int +GLOBAL_WIN32: int + +def global_init(option: int) -> None: ... +def global_cleanup() -> None: ... + +version: str + +def version_info() -> Tuple[int, str, int, str, int, str, + int, str, tuple, Any, int, Any]: ... + +class error(Exception): ... + +class Curl(object): + def close(self) -> None: ... + def setopt(self, option: int, value: Any) -> None: ... + def perform(self) -> None: ... + def getinfo(self, info: Any) -> Any: ... + def reset(self) -> None: ... + def unsetopt(self, option: int) -> Any: ... + def pause(self, bitmask: Any) -> Any: ... + def errstr(self) -> str: ... + + # TODO(MichalPokorny): wat? + USERPWD: int + +class CurlMulti(object): + def close(self) -> None: ... + def add_handle(self, obj: Curl) -> None: ... + def remove_handle(self, obj: Curl) -> None: ... + def perform(self) -> Tuple[Any, int]: ... + def fdset(self) -> tuple: ... + def select(self, timeout: float = ...) -> int: ... + def info_read(self, max_objects: int = ...) -> tuple: ... + +class CurlShare(object): + def close(self) -> None: ... + def setopt(self, option: int, value: Any) -> Any: ... + +ACCEPTTIMEOUT_MS: int +ACCEPT_ENCODING: int +ADDRESS_SCOPE: int +APPCONNECT_TIME: int +APPEND: int +AUTOREFERER: int +BUFFERSIZE: int +CAINFO: int +CAPATH: int +CLOSESOCKETFUNCTION: int +COMPILE_DATE: str +COMPILE_LIBCURL_VERSION_NUM: int +COMPILE_PY_VERSION_HEX: int +CONDITION_UNMET: int +CONNECTTIMEOUT: int +CONNECTTIMEOUT_MS: int +CONNECT_ONLY: int +CONNECT_TIME: int +CONTENT_LENGTH_DOWNLOAD: int +CONTENT_LENGTH_UPLOAD: int +CONTENT_TYPE: int +COOKIE: int +COOKIEFILE: int +COOKIEJAR: int +COOKIELIST: int +COOKIESESSION: int +COPYPOSTFIELDS: int +CRLF: int +CRLFILE: int +CSELECT_ERR: int +CSELECT_IN: int +CSELECT_OUT: int +CURL_HTTP_VERSION_1_0: int +CURL_HTTP_VERSION_1_1: int +CURL_HTTP_VERSION_2: int +CURL_HTTP_VERSION_2_0: int +CURL_HTTP_VERSION_LAST: int +CURL_HTTP_VERSION_NONE: int +CUSTOMREQUEST: int +DEBUGFUNCTION: int +DIRLISTONLY: int +DNS_CACHE_TIMEOUT: int +DNS_SERVERS: int +DNS_USE_GLOBAL_CACHE: int +EFFECTIVE_URL: int +EGDSOCKET: int +ENCODING: int +EXPECT_100_TIMEOUT_MS: int +FAILONERROR: int +FILE: int +FOLLOWLOCATION: int +FORBID_REUSE: int +FORM_BUFFER: int +FORM_BUFFERPTR: int +FORM_CONTENTS: int +FORM_CONTENTTYPE: int +FORM_FILE: int +FORM_FILENAME: int +FRESH_CONNECT: int +FTPAPPEND: int +FTPAUTH_DEFAULT: int +FTPAUTH_SSL: int +FTPAUTH_TLS: int +FTPLISTONLY: int +FTPMETHOD_DEFAULT: int +FTPMETHOD_MULTICWD: int +FTPMETHOD_NOCWD: int +FTPMETHOD_SINGLECWD: int +FTPPORT: int +FTPSSLAUTH: int +FTPSSL_ALL: int +FTPSSL_CONTROL: int +FTPSSL_NONE: int +FTPSSL_TRY: int +FTP_ACCOUNT: int +FTP_ALTERNATIVE_TO_USER: int +FTP_CREATE_MISSING_DIRS: int +FTP_ENTRY_PATH: int +FTP_FILEMETHOD: int +FTP_RESPONSE_TIMEOUT: int +FTP_SKIP_PASV_IP: int +FTP_SSL: int +FTP_SSL_CCC: int +FTP_USE_EPRT: int +FTP_USE_EPSV: int +FTP_USE_PRET: int +GSSAPI_DELEGATION: int +GSSAPI_DELEGATION_FLAG: int +GSSAPI_DELEGATION_NONE: int +GSSAPI_DELEGATION_POLICY_FLAG: int +HEADER: int +HEADERFUNCTION: int +HEADEROPT: int +HEADER_SEPARATE: int +HEADER_SIZE: int +HEADER_UNIFIED: int +HTTP200ALIASES: int +HTTPAUTH: int +HTTPAUTH_ANY: int +HTTPAUTH_ANYSAFE: int +HTTPAUTH_AVAIL: int +HTTPAUTH_BASIC: int +HTTPAUTH_DIGEST: int +HTTPAUTH_DIGEST_IE: int +HTTPAUTH_GSSNEGOTIATE: int +HTTPAUTH_NEGOTIATE: int +HTTPAUTH_NONE: int +HTTPAUTH_NTLM: int +HTTPAUTH_NTLM_WB: int +HTTPAUTH_ONLY: int +HTTPGET: int +HTTPHEADER: int +HTTPPOST: int +HTTPPROXYTUNNEL: int +HTTP_CODE: int +HTTP_CONNECTCODE: int +HTTP_CONTENT_DECODING: int +HTTP_TRANSFER_DECODING: int +HTTP_VERSION: int +IGNORE_CONTENT_LENGTH: int +INFILE: int +INFILESIZE: int +INFILESIZE_LARGE: int +INFOTYPE_DATA_IN: int +INFOTYPE_DATA_OUT: int +INFOTYPE_HEADER_IN: int +INFOTYPE_HEADER_OUT: int +INFOTYPE_SSL_DATA_IN: int +INFOTYPE_SSL_DATA_OUT: int +INFOTYPE_TEXT: int +INFO_CERTINFO: int +INFO_COOKIELIST: int +INFO_FILETIME: int +INFO_RTSP_CLIENT_CSEQ: int +INFO_RTSP_CSEQ_RECV: int +INFO_RTSP_SERVER_CSEQ: int +INFO_RTSP_SESSION_ID: int +INTERFACE: int +IOCMD_NOP: int +IOCMD_RESTARTREAD: int +IOCTLDATA: int +IOCTLFUNCTION: int +IOE_FAILRESTART: int +IOE_OK: int +IOE_UNKNOWNCMD: int +IPRESOLVE: int +IPRESOLVE_V4: int +IPRESOLVE_V6: int +IPRESOLVE_WHATEVER: int +ISSUERCERT: int +KEYPASSWD: int +KHMATCH_MISMATCH: int +KHMATCH_MISSING: int +KHMATCH_OK: int +KHSTAT_DEFER: int +KHSTAT_FINE: int +KHSTAT_FINE_ADD_TO_FILE: int +KHSTAT_REJECT: int +KHTYPE_DSS: int +KHTYPE_RSA: int +KHTYPE_RSA1: int +KHTYPE_UNKNOWN: int +KRB4LEVEL: int +KRBLEVEL: int +LASTSOCKET: int +LOCALPORT: int +LOCALPORTRANGE: int +LOCAL_IP: int +LOCAL_PORT: int +LOCK_DATA_COOKIE: int +LOCK_DATA_DNS: int +LOCK_DATA_SSL_SESSION: int +LOGIN_OPTIONS: int +LOW_SPEED_LIMIT: int +LOW_SPEED_TIME: int +MAIL_AUTH: int +MAIL_FROM: int +MAIL_RCPT: int +MAXCONNECTS: int +MAXFILESIZE: int +MAXFILESIZE_LARGE: int +MAXREDIRS: int +MAX_RECV_SPEED_LARGE: int +MAX_SEND_SPEED_LARGE: int +M_CHUNK_LENGTH_PENALTY_SIZE: int +M_CONTENT_LENGTH_PENALTY_SIZE: int +M_MAXCONNECTS: int +M_MAX_HOST_CONNECTIONS: int +M_MAX_PIPELINE_LENGTH: int +M_MAX_TOTAL_CONNECTIONS: int +M_PIPELINING: int +M_PIPELINING_SERVER_BL: int +M_PIPELINING_SITE_BL: int +M_SOCKETFUNCTION: int +M_TIMERFUNCTION: int +NAMELOOKUP_TIME: int +NETRC: int +NETRC_FILE: int +NETRC_IGNORED: int +NETRC_OPTIONAL: int +NETRC_REQUIRED: int +NEW_DIRECTORY_PERMS: int +NEW_FILE_PERMS: int +NOBODY: int +NOPROGRESS: int +NOPROXY: int +NOSIGNAL: int +NUM_CONNECTS: int +OPENSOCKETFUNCTION: int +OPT_CERTINFO: int +OPT_FILETIME: int +OS_ERRNO: int +PASSWORD: int +PATH_AS_IS: int +PAUSE_ALL: int +PAUSE_CONT: int +PAUSE_RECV: int +PAUSE_SEND: int +PINNEDPUBLICKEY: int +PIPEWAIT: int +PIPE_HTTP1: int +PIPE_MULTIPLEX: int +PIPE_NOTHING: int +POLL_IN: int +POLL_INOUT: int +POLL_NONE: int +POLL_OUT: int +POLL_REMOVE: int +PORT: int +POST: int +POST301: int +POSTFIELDS: int +POSTFIELDSIZE: int +POSTFIELDSIZE_LARGE: int +POSTQUOTE: int +POSTREDIR: int +PREQUOTE: int +PRETRANSFER_TIME: int +PRIMARY_IP: int +PRIMARY_PORT: int +PROGRESSFUNCTION: int +PROTOCOLS: int +PROTO_ALL: int +PROTO_DICT: int +PROTO_FILE: int +PROTO_FTP: int +PROTO_FTPS: int +PROTO_GOPHER: int +PROTO_HTTP: int +PROTO_HTTPS: int +PROTO_IMAP: int +PROTO_IMAPS: int +PROTO_LDAP: int +PROTO_LDAPS: int +PROTO_POP3: int +PROTO_POP3S: int +PROTO_RTMP: int +PROTO_RTMPE: int +PROTO_RTMPS: int +PROTO_RTMPT: int +PROTO_RTMPTE: int +PROTO_RTMPTS: int +PROTO_RTSP: int +PROTO_SCP: int +PROTO_SFTP: int +PROTO_SMB: int +PROTO_SMBS: int +PROTO_SMTP: int +PROTO_SMTPS: int +PROTO_TELNET: int +PROTO_TFTP: int +PROXY: int +PROXYAUTH: int +PROXYAUTH_AVAIL: int +PROXYHEADER: int +PROXYPASSWORD: int +PROXYPORT: int +PROXYTYPE: int +PROXYTYPE_HTTP: int +PROXYTYPE_HTTP_1_0: int +PROXYTYPE_SOCKS4: int +PROXYTYPE_SOCKS4A: int +PROXYTYPE_SOCKS5: int +PROXYTYPE_SOCKS5_HOSTNAME: int +PROXYUSERNAME: int +PROXYUSERPWD: int +PROXY_SERVICE_NAME: int +PROXY_TRANSFER_MODE: int +PUT: int +QUOTE: int +RANDOM_FILE: int +RANGE: int +READDATA: int +READFUNCTION: int +READFUNC_ABORT: int +READFUNC_PAUSE: int +REDIRECT_COUNT: int +REDIRECT_TIME: int +REDIRECT_URL: int +REDIR_POST_301: int +REDIR_POST_302: int +REDIR_POST_303: int +REDIR_POST_ALL: int +REDIR_PROTOCOLS: int +REFERER: int +REQUEST_SIZE: int +RESOLVE: int +RESPONSE_CODE: int +RESUME_FROM: int +RESUME_FROM_LARGE: int +SASL_IR: int +SEEKFUNCTION: int +SEEKFUNC_CANTSEEK: int +SEEKFUNC_FAIL: int +SEEKFUNC_OK: int +SERVICE_NAME: int +SHARE: int +SH_SHARE: int +SH_UNSHARE: int +SIZE_DOWNLOAD: int +SIZE_UPLOAD: int +SOCKET_TIMEOUT: int +SOCKOPTFUNCTION: int +SOCKOPT_ALREADY_CONNECTED: int +SOCKOPT_ERROR: int +SOCKOPT_OK: int +SOCKS5_GSSAPI_NEC: int +SOCKS5_GSSAPI_SERVICE: int +SOCKTYPE_ACCEPT: int +SOCKTYPE_IPCXN: int +SPEED_DOWNLOAD: int +SPEED_UPLOAD: int +SSH_AUTH_ANY: int +SSH_AUTH_DEFAULT: int +SSH_AUTH_HOST: int +SSH_AUTH_KEYBOARD: int +SSH_AUTH_NONE: int +SSH_AUTH_PASSWORD: int +SSH_AUTH_PUBLICKEY: int +SSH_AUTH_TYPES: int +SSH_HOST_PUBLIC_KEY_MD5: int +SSH_KEYFUNCTION: int +SSH_KNOWNHOSTS: int +SSH_PRIVATE_KEYFILE: int +SSH_PUBLIC_KEYFILE: int +SSLCERT: int +SSLCERTPASSWD: int +SSLCERTTYPE: int +SSLENGINE: int +SSLENGINE_DEFAULT: int +SSLKEY: int +SSLKEYPASSWD: int +SSLKEYTYPE: int +SSLOPT_ALLOW_BEAST: int +SSLVERSION: int +SSLVERSION_DEFAULT: int +SSLVERSION_SSLv2: int +SSLVERSION_SSLv3: int +SSLVERSION_TLSv1: int +SSLVERSION_TLSv1_0: int +SSLVERSION_TLSv1_1: int +SSLVERSION_TLSv1_2: int +SSL_CIPHER_LIST: int +SSL_ENABLE_ALPN: int +SSL_ENABLE_NPN: int +SSL_ENGINES: int +SSL_FALSESTART: int +SSL_OPTIONS: int +SSL_SESSIONID_CACHE: int +SSL_VERIFYHOST: int +SSL_VERIFYPEER: int +SSL_VERIFYRESULT: int +SSL_VERIFYSTATUS: int +STARTTRANSFER_TIME: int +STDERR: int +TCP_KEEPALIVE: int +TCP_KEEPIDLE: int +TCP_KEEPINTVL: int +TCP_NODELAY: int +TELNETOPTIONS: int +TFTP_BLKSIZE: int +TIMECONDITION: int +TIMECONDITION_IFMODSINCE: int +TIMECONDITION_IFUNMODSINCE: int +TIMECONDITION_LASTMOD: int +TIMECONDITION_NONE: int +TIMEOUT: int +TIMEOUT_MS: int +TIMEVALUE: int +TLSAUTH_PASSWORD: int +TLSAUTH_TYPE: int +TLSAUTH_USERNAME: int +TOTAL_TIME: int +TRANSFERTEXT: int +TRANSFER_ENCODING: int +UNIX_SOCKET_PATH: int +UNRESTRICTED_AUTH: int +UPLOAD: int +URL: int +USERAGENT: int +USERNAME: int +USERPWD: int +USESSL_ALL: int +USESSL_CONTROL: int +USESSL_NONE: int +USESSL_TRY: int +USE_SSL: int +VERBOSE: int +VERSION_ASYNCHDNS: int +VERSION_CONV: int +VERSION_CURLDEBUG: int +VERSION_DEBUG: int +VERSION_GSSAPI: int +VERSION_GSSNEGOTIATE: int +VERSION_HTTP2: int +VERSION_IDN: int +VERSION_IPV6: int +VERSION_KERBEROS4: int +VERSION_KERBEROS5: int +VERSION_LARGEFILE: int +VERSION_LIBZ: int +VERSION_NTLM: int +VERSION_NTLM_WB: int +VERSION_SPNEGO: int +VERSION_SSL: int +VERSION_SSPI: int +VERSION_TLSAUTH_SRP: int +VERSION_UNIX_SOCKETS: int +WILDCARDMATCH: int +WRITEDATA: int +WRITEFUNCTION: int +WRITEFUNC_PAUSE: int +WRITEHEADER: int +XFERINFOFUNCTION: int +XOAUTH2_BEARER: int + +E_ABORTED_BY_CALLBACK: int +E_AGAIN: int +E_ALREADY_COMPLETE: int +E_BAD_CALLING_ORDER: int +E_BAD_CONTENT_ENCODING: int +E_BAD_DOWNLOAD_RESUME: int +E_BAD_FUNCTION_ARGUMENT: int +E_BAD_PASSWORD_ENTERED: int +E_CALL_MULTI_PERFORM: int +E_CHUNK_FAILED: int +E_CONV_FAILED: int +E_CONV_REQD: int +E_COULDNT_CONNECT: int +E_COULDNT_RESOLVE_HOST: int +E_COULDNT_RESOLVE_PROXY: int +E_FAILED_INIT: int +E_FILESIZE_EXCEEDED: int +E_FILE_COULDNT_READ_FILE: int +E_FTP_ACCEPT_FAILED: int +E_FTP_ACCEPT_TIMEOUT: int +E_FTP_ACCESS_DENIED: int +E_FTP_BAD_DOWNLOAD_RESUME: int +E_FTP_BAD_FILE_LIST: int +E_FTP_CANT_GET_HOST: int +E_FTP_CANT_RECONNECT: int +E_FTP_COULDNT_GET_SIZE: int +E_FTP_COULDNT_RETR_FILE: int +E_FTP_COULDNT_SET_ASCII: int +E_FTP_COULDNT_SET_BINARY: int +E_FTP_COULDNT_SET_TYPE: int +E_FTP_COULDNT_STOR_FILE: int +E_FTP_COULDNT_USE_REST: int +E_FTP_PARTIAL_FILE: int +E_FTP_PORT_FAILED: int +E_FTP_PRET_FAILED: int +E_FTP_QUOTE_ERROR: int +E_FTP_SSL_FAILED: int +E_FTP_USER_PASSWORD_INCORRECT: int +E_FTP_WEIRD_227_FORMAT: int +E_FTP_WEIRD_PASS_REPLY: int +E_FTP_WEIRD_PASV_REPLY: int +E_FTP_WEIRD_SERVER_REPLY: int +E_FTP_WEIRD_USER_REPLY: int +E_FTP_WRITE_ERROR: int +E_FUNCTION_NOT_FOUND: int +E_GOT_NOTHING: int +E_HTTP2: int +E_HTTP_NOT_FOUND: int +E_HTTP_PORT_FAILED: int +E_HTTP_POST_ERROR: int +E_HTTP_RANGE_ERROR: int +E_HTTP_RETURNED_ERROR: int +E_INTERFACE_FAILED: int +E_LDAP_CANNOT_BIND: int +E_LDAP_INVALID_URL: int +E_LDAP_SEARCH_FAILED: int +E_LIBRARY_NOT_FOUND: int +E_LOGIN_DENIED: int +E_MALFORMAT_USER: int +E_MULTI_ADDED_ALREADY: int +E_MULTI_BAD_EASY_HANDLE: int +E_MULTI_BAD_HANDLE: int +E_MULTI_BAD_SOCKET: int +E_MULTI_CALL_MULTI_PERFORM: int +E_MULTI_CALL_MULTI_SOCKET: int +E_MULTI_INTERNAL_ERROR: int +E_MULTI_OK: int +E_MULTI_OUT_OF_MEMORY: int +E_MULTI_UNKNOWN_OPTION: int +E_NOT_BUILT_IN: int +E_NO_CONNECTION_AVAILABLE: int +E_OK: int +E_OPERATION_TIMEDOUT: int +E_OPERATION_TIMEOUTED: int +E_OUT_OF_MEMORY: int +E_PARTIAL_FILE: int +E_PEER_FAILED_VERIFICATION: int +E_QUOTE_ERROR: int +E_RANGE_ERROR: int +E_READ_ERROR: int +E_RECV_ERROR: int +E_REMOTE_ACCESS_DENIED: int +E_REMOTE_DISK_FULL: int +E_REMOTE_FILE_EXISTS: int +E_REMOTE_FILE_NOT_FOUND: int +E_RTSP_CSEQ_ERROR: int +E_RTSP_SESSION_ERROR: int +E_SEND_ERROR: int +E_SEND_FAIL_REWIND: int +E_SHARE_IN_USE: int +E_SSH: int +E_SSL_CACERT: int +E_SSL_CACERT_BADFILE: int +E_SSL_CERTPROBLEM: int +E_SSL_CIPHER: int +E_SSL_CONNECT_ERROR: int +E_SSL_CRL_BADFILE: int +E_SSL_ENGINE_INITFAILED: int +E_SSL_ENGINE_NOTFOUND: int +E_SSL_ENGINE_SETFAILED: int +E_SSL_INVALIDCERTSTATUS: int +E_SSL_ISSUER_ERROR: int +E_SSL_PEER_CERTIFICATE: int +E_SSL_PINNEDPUBKEYNOTMATCH: int +E_SSL_SHUTDOWN_FAILED: int +E_TELNET_OPTION_SYNTAX: int +E_TFTP_DISKFULL: int +E_TFTP_EXISTS: int +E_TFTP_ILLEGAL: int +E_TFTP_NOSUCHUSER: int +E_TFTP_NOTFOUND: int +E_TFTP_PERM: int +E_TFTP_UNKNOWNID: int +E_TOO_MANY_REDIRECTS: int +E_UNKNOWN_OPTION: int +E_UNKNOWN_TELNET_OPTION: int +E_UNSUPPORTED_PROTOCOL: int +E_UPLOAD_FAILED: int +E_URL_MALFORMAT: int +E_URL_MALFORMAT_USER: int +E_USE_SSL_FAILED: int +E_WRITE_ERROR: int diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pymysql/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pymysql/__init__.pyi new file mode 100644 index 0000000..523c601 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pymysql/__init__.pyi @@ -0,0 +1,61 @@ +import sys +from typing import Union, Tuple, Callable, FrozenSet + +from .connections import Connection as _Connection +from .constants import FIELD_TYPE as FIELD_TYPE +from .converters import escape_dict as escape_dict, escape_sequence as escape_sequence, escape_string as escape_string +from .err import ( + Warning as Warning, + Error as Error, + InterfaceError as InterfaceError, + DataError as DataError, + DatabaseError as DatabaseError, + OperationalError as OperationalError, + IntegrityError as IntegrityError, + InternalError as InternalError, + NotSupportedError as NotSupportedError, + ProgrammingError as ProgrammingError, + MySQLError as MySQLError, +) +from .times import ( + Date as Date, + Time as Time, + Timestamp as Timestamp, + DateFromTicks as DateFromTicks, + TimeFromTicks as TimeFromTicks, + TimestampFromTicks as TimestampFromTicks, +) + +threadsafety: int +apilevel: str +paramstyle: str + +class DBAPISet(FrozenSet[int]): + def __ne__(self, other) -> bool: ... + def __eq__(self, other) -> bool: ... + def __hash__(self) -> int: ... + +STRING: DBAPISet +BINARY: DBAPISet +NUMBER: DBAPISet +DATE: DBAPISet +TIME: DBAPISet +TIMESTAMP: DBAPISet +DATETIME: DBAPISet +ROWID: DBAPISet + +if sys.version_info >= (3, 0): + def Binary(x) -> bytes: ... +else: + def Binary(x) -> bytearray: ... +def Connect(*args, **kwargs) -> _Connection: ... +def get_client_info() -> str: ... + +connect: Callable[..., _Connection] +Connection: Callable[..., _Connection] +__version__: str +version_info: Tuple[int, int, int, str, int] +NULL: str + +def thread_safe() -> bool: ... +def install_as_MySQLdb() -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pymysql/charset.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pymysql/charset.pyi new file mode 100644 index 0000000..c47679a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pymysql/charset.pyi @@ -0,0 +1,16 @@ +from typing import Any + +MBLENGTH: Any + +class Charset: + is_default: Any + def __init__(self, id, name, collation, is_default): ... + +class Charsets: + def __init__(self): ... + def add(self, c): ... + def by_id(self, id): ... + def by_name(self, name): ... + +def charset_by_name(name): ... +def charset_by_id(id): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pymysql/connections.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pymysql/connections.pyi new file mode 100644 index 0000000..4f1cd04 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pymysql/connections.pyi @@ -0,0 +1,145 @@ +from typing import Any, Optional, Type +from .charset import MBLENGTH as MBLENGTH, charset_by_name as charset_by_name, charset_by_id as charset_by_id +from .cursors import Cursor as Cursor +from .constants import FIELD_TYPE as FIELD_TYPE, FLAG as FLAG +from .constants import SERVER_STATUS as SERVER_STATUS +from .constants import CLIENT as CLIENT +from .constants import COMMAND as COMMAND +from .util import join_bytes as join_bytes, byte2int as byte2int, int2byte as int2byte +from .converters import escape_item as escape_item, encoders as encoders, decoders as decoders +from .err import raise_mysql_exception as raise_mysql_exception, Warning as Warning, Error as Error, InterfaceError as InterfaceError, DataError as DataError, DatabaseError as DatabaseError, OperationalError as OperationalError, IntegrityError as IntegrityError, InternalError as InternalError, NotSupportedError as NotSupportedError, ProgrammingError as ProgrammingError + +sha_new: Any +SSL_ENABLED: Any +DEFAULT_USER: Any +DEBUG: Any +NULL_COLUMN: Any +UNSIGNED_CHAR_COLUMN: Any +UNSIGNED_SHORT_COLUMN: Any +UNSIGNED_INT24_COLUMN: Any +UNSIGNED_INT64_COLUMN: Any +UNSIGNED_CHAR_LENGTH: Any +UNSIGNED_SHORT_LENGTH: Any +UNSIGNED_INT24_LENGTH: Any +UNSIGNED_INT64_LENGTH: Any +DEFAULT_CHARSET: Any + +def dump_packet(data): ... + +SCRAMBLE_LENGTH_323: Any + +class RandStruct_323: + max_value: Any + seed1: Any + seed2: Any + def __init__(self, seed1, seed2): ... + def my_rnd(self): ... + +def pack_int24(n): ... +def unpack_uint16(n): ... +def unpack_int24(n): ... +def unpack_int32(n): ... +def unpack_int64(n): ... +def defaulterrorhandler(connection, cursor, errorclass, errorvalue): ... + +class MysqlPacket: + connection: Any + def __init__(self, connection): ... + def packet_number(self): ... + def get_all_data(self): ... + def read(self, size): ... + def read_all(self): ... + def advance(self, length): ... + def rewind(self, position: int = ...): ... + def peek(self, size): ... + def get_bytes(self, position, length: int = ...): ... + def read_length_coded_binary(self): ... + def read_length_coded_string(self): ... + def is_ok_packet(self): ... + def is_eof_packet(self): ... + def is_resultset_packet(self): ... + def is_error_packet(self): ... + def check_error(self): ... + def dump(self): ... + +class FieldDescriptorPacket(MysqlPacket): + def __init__(self, *args): ... + def description(self): ... + def get_column_length(self): ... + +class Connection: + errorhandler: Any + ssl: Any + host: Any + port: Any + user: Any + password: Any + db: Any + unix_socket: Any + charset: Any + use_unicode: Any + client_flag: Any + cursorclass: Any + connect_timeout: Any + messages: Any + encoders: Any + decoders: Any + host_info: Any + def __init__(self, host: str = ..., user: Optional[Any] = ..., passwd: str = ..., db: Optional[Any] = ..., + port: int = ..., unix_socket: Optional[Any] = ..., charset: str = ..., sql_mode: Optional[Any] = ..., + read_default_file: Optional[Any] = ..., conv=..., use_unicode: Optional[Any] = ..., client_flag: int = ..., + cursorclass=..., init_command: Optional[Any] = ..., connect_timeout: Optional[Any] = ..., + ssl: Optional[Any] = ..., read_default_group: Optional[Any] = ..., compress: Optional[Any] = ..., + named_pipe: Optional[Any] = ...): ... + socket: Any + rfile: Any + wfile: Any + def close(self): ... + def autocommit(self, value): ... + def commit(self): ... + def begin(self) -> None: ... + def rollback(self): ... + def escape(self, obj): ... + def literal(self, obj): ... + def cursor(self, cursor: Optional[Type[Cursor]] = ...): ... + def __enter__(self): ... + def __exit__(self, exc, value, traceback): ... + def query(self, sql): ... + def next_result(self, unbuffered: bool = ...): ... + def affected_rows(self): ... + def kill(self, thread_id): ... + def ping(self, reconnect: bool = ...): ... + def set_charset(self, charset): ... + def read_packet(self, packet_type=...): ... + def insert_id(self): ... + def thread_id(self): ... + def character_set_name(self): ... + def get_host_info(self): ... + def get_proto_info(self): ... + def get_server_info(self): ... + def show_warnings(self): ... + Warning: Any + Error: Any + InterfaceError: Any + DatabaseError: Any + DataError: Any + OperationalError: Any + IntegrityError: Any + InternalError: Any + ProgrammingError: Any + NotSupportedError: Any + +class MySQLResult: + connection: Any + affected_rows: Any + insert_id: Any + server_status: Any + warning_count: Any + message: Any + field_count: Any + description: Any + rows: Any + has_next: Any + def __init__(self, connection): ... + first_packet: Any + def read(self): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/CLIENT.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/CLIENT.pyi new file mode 100644 index 0000000..ac8fb55 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/CLIENT.pyi @@ -0,0 +1,18 @@ +LONG_PASSWORD: int +FOUND_ROWS: int +LONG_FLAG: int +CONNECT_WITH_DB: int +NO_SCHEMA: int +COMPRESS: int +ODBC: int +LOCAL_FILES: int +IGNORE_SPACE: int +PROTOCOL_41: int +INTERACTIVE: int +SSL: int +IGNORE_SIGPIPE: int +TRANSACTIONS: int +SECURE_CONNECTION: int +MULTI_STATEMENTS: int +MULTI_RESULTS: int +CAPABILITIES: int diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/COMMAND.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/COMMAND.pyi new file mode 100644 index 0000000..1163e6b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/COMMAND.pyi @@ -0,0 +1,22 @@ +COM_SLEEP: int +COM_QUIT: int +COM_INIT_DB: int +COM_QUERY: int +COM_FIELD_LIST: int +COM_CREATE_DB: int +COM_DROP_DB: int +COM_REFRESH: int +COM_SHUTDOWN: int +COM_STATISTICS: int +COM_PROCESS_INFO: int +COM_CONNECT: int +COM_PROCESS_KILL: int +COM_DEBUG: int +COM_PING: int +COM_TIME: int +COM_DELAYED_INSERT: int +COM_CHANGE_USER: int +COM_BINLOG_DUMP: int +COM_TABLE_DUMP: int +COM_CONNECT_OUT: int +COM_REGISTER_SLAVE: int diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/ER.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/ER.pyi new file mode 100644 index 0000000..5f0a432 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/ER.pyi @@ -0,0 +1,471 @@ +ERROR_FIRST: int +HASHCHK: int +NISAMCHK: int +NO: int +YES: int +CANT_CREATE_FILE: int +CANT_CREATE_TABLE: int +CANT_CREATE_DB: int +DB_CREATE_EXISTS: int +DB_DROP_EXISTS: int +DB_DROP_DELETE: int +DB_DROP_RMDIR: int +CANT_DELETE_FILE: int +CANT_FIND_SYSTEM_REC: int +CANT_GET_STAT: int +CANT_GET_WD: int +CANT_LOCK: int +CANT_OPEN_FILE: int +FILE_NOT_FOUND: int +CANT_READ_DIR: int +CANT_SET_WD: int +CHECKREAD: int +DISK_FULL: int +DUP_KEY: int +ERROR_ON_CLOSE: int +ERROR_ON_READ: int +ERROR_ON_RENAME: int +ERROR_ON_WRITE: int +FILE_USED: int +FILSORT_ABORT: int +FORM_NOT_FOUND: int +GET_ERRNO: int +ILLEGAL_HA: int +KEY_NOT_FOUND: int +NOT_FORM_FILE: int +NOT_KEYFILE: int +OLD_KEYFILE: int +OPEN_AS_READONLY: int +OUTOFMEMORY: int +OUT_OF_SORTMEMORY: int +UNEXPECTED_EOF: int +CON_COUNT_ERROR: int +OUT_OF_RESOURCES: int +BAD_HOST_ERROR: int +HANDSHAKE_ERROR: int +DBACCESS_DENIED_ERROR: int +ACCESS_DENIED_ERROR: int +NO_DB_ERROR: int +UNKNOWN_COM_ERROR: int +BAD_NULL_ERROR: int +BAD_DB_ERROR: int +TABLE_EXISTS_ERROR: int +BAD_TABLE_ERROR: int +NON_UNIQ_ERROR: int +SERVER_SHUTDOWN: int +BAD_FIELD_ERROR: int +WRONG_FIELD_WITH_GROUP: int +WRONG_GROUP_FIELD: int +WRONG_SUM_SELECT: int +WRONG_VALUE_COUNT: int +TOO_LONG_IDENT: int +DUP_FIELDNAME: int +DUP_KEYNAME: int +DUP_ENTRY: int +WRONG_FIELD_SPEC: int +PARSE_ERROR: int +EMPTY_QUERY: int +NONUNIQ_TABLE: int +INVALID_DEFAULT: int +MULTIPLE_PRI_KEY: int +TOO_MANY_KEYS: int +TOO_MANY_KEY_PARTS: int +TOO_LONG_KEY: int +KEY_COLUMN_DOES_NOT_EXITS: int +BLOB_USED_AS_KEY: int +TOO_BIG_FIELDLENGTH: int +WRONG_AUTO_KEY: int +READY: int +NORMAL_SHUTDOWN: int +GOT_SIGNAL: int +SHUTDOWN_COMPLETE: int +FORCING_CLOSE: int +IPSOCK_ERROR: int +NO_SUCH_INDEX: int +WRONG_FIELD_TERMINATORS: int +BLOBS_AND_NO_TERMINATED: int +TEXTFILE_NOT_READABLE: int +FILE_EXISTS_ERROR: int +LOAD_INFO: int +ALTER_INFO: int +WRONG_SUB_KEY: int +CANT_REMOVE_ALL_FIELDS: int +CANT_DROP_FIELD_OR_KEY: int +INSERT_INFO: int +UPDATE_TABLE_USED: int +NO_SUCH_THREAD: int +KILL_DENIED_ERROR: int +NO_TABLES_USED: int +TOO_BIG_SET: int +NO_UNIQUE_LOGFILE: int +TABLE_NOT_LOCKED_FOR_WRITE: int +TABLE_NOT_LOCKED: int +BLOB_CANT_HAVE_DEFAULT: int +WRONG_DB_NAME: int +WRONG_TABLE_NAME: int +TOO_BIG_SELECT: int +UNKNOWN_ERROR: int +UNKNOWN_PROCEDURE: int +WRONG_PARAMCOUNT_TO_PROCEDURE: int +WRONG_PARAMETERS_TO_PROCEDURE: int +UNKNOWN_TABLE: int +FIELD_SPECIFIED_TWICE: int +INVALID_GROUP_FUNC_USE: int +UNSUPPORTED_EXTENSION: int +TABLE_MUST_HAVE_COLUMNS: int +RECORD_FILE_FULL: int +UNKNOWN_CHARACTER_SET: int +TOO_MANY_TABLES: int +TOO_MANY_FIELDS: int +TOO_BIG_ROWSIZE: int +STACK_OVERRUN: int +WRONG_OUTER_JOIN: int +NULL_COLUMN_IN_INDEX: int +CANT_FIND_UDF: int +CANT_INITIALIZE_UDF: int +UDF_NO_PATHS: int +UDF_EXISTS: int +CANT_OPEN_LIBRARY: int +CANT_FIND_DL_ENTRY: int +FUNCTION_NOT_DEFINED: int +HOST_IS_BLOCKED: int +HOST_NOT_PRIVILEGED: int +PASSWORD_ANONYMOUS_USER: int +PASSWORD_NOT_ALLOWED: int +PASSWORD_NO_MATCH: int +UPDATE_INFO: int +CANT_CREATE_THREAD: int +WRONG_VALUE_COUNT_ON_ROW: int +CANT_REOPEN_TABLE: int +INVALID_USE_OF_NULL: int +REGEXP_ERROR: int +MIX_OF_GROUP_FUNC_AND_FIELDS: int +NONEXISTING_GRANT: int +TABLEACCESS_DENIED_ERROR: int +COLUMNACCESS_DENIED_ERROR: int +ILLEGAL_GRANT_FOR_TABLE: int +GRANT_WRONG_HOST_OR_USER: int +NO_SUCH_TABLE: int +NONEXISTING_TABLE_GRANT: int +NOT_ALLOWED_COMMAND: int +SYNTAX_ERROR: int +DELAYED_CANT_CHANGE_LOCK: int +TOO_MANY_DELAYED_THREADS: int +ABORTING_CONNECTION: int +NET_PACKET_TOO_LARGE: int +NET_READ_ERROR_FROM_PIPE: int +NET_FCNTL_ERROR: int +NET_PACKETS_OUT_OF_ORDER: int +NET_UNCOMPRESS_ERROR: int +NET_READ_ERROR: int +NET_READ_INTERRUPTED: int +NET_ERROR_ON_WRITE: int +NET_WRITE_INTERRUPTED: int +TOO_LONG_STRING: int +TABLE_CANT_HANDLE_BLOB: int +TABLE_CANT_HANDLE_AUTO_INCREMENT: int +DELAYED_INSERT_TABLE_LOCKED: int +WRONG_COLUMN_NAME: int +WRONG_KEY_COLUMN: int +WRONG_MRG_TABLE: int +DUP_UNIQUE: int +BLOB_KEY_WITHOUT_LENGTH: int +PRIMARY_CANT_HAVE_NULL: int +TOO_MANY_ROWS: int +REQUIRES_PRIMARY_KEY: int +NO_RAID_COMPILED: int +UPDATE_WITHOUT_KEY_IN_SAFE_MODE: int +KEY_DOES_NOT_EXITS: int +CHECK_NO_SUCH_TABLE: int +CHECK_NOT_IMPLEMENTED: int +CANT_DO_THIS_DURING_AN_TRANSACTION: int +ERROR_DURING_COMMIT: int +ERROR_DURING_ROLLBACK: int +ERROR_DURING_FLUSH_LOGS: int +ERROR_DURING_CHECKPOINT: int +NEW_ABORTING_CONNECTION: int +DUMP_NOT_IMPLEMENTED: int +FLUSH_MASTER_BINLOG_CLOSED: int +INDEX_REBUILD: int +MASTER: int +MASTER_NET_READ: int +MASTER_NET_WRITE: int +FT_MATCHING_KEY_NOT_FOUND: int +LOCK_OR_ACTIVE_TRANSACTION: int +UNKNOWN_SYSTEM_VARIABLE: int +CRASHED_ON_USAGE: int +CRASHED_ON_REPAIR: int +WARNING_NOT_COMPLETE_ROLLBACK: int +TRANS_CACHE_FULL: int +SLAVE_MUST_STOP: int +SLAVE_NOT_RUNNING: int +BAD_SLAVE: int +MASTER_INFO: int +SLAVE_THREAD: int +TOO_MANY_USER_CONNECTIONS: int +SET_CONSTANTS_ONLY: int +LOCK_WAIT_TIMEOUT: int +LOCK_TABLE_FULL: int +READ_ONLY_TRANSACTION: int +DROP_DB_WITH_READ_LOCK: int +CREATE_DB_WITH_READ_LOCK: int +WRONG_ARGUMENTS: int +NO_PERMISSION_TO_CREATE_USER: int +UNION_TABLES_IN_DIFFERENT_DIR: int +LOCK_DEADLOCK: int +TABLE_CANT_HANDLE_FT: int +CANNOT_ADD_FOREIGN: int +NO_REFERENCED_ROW: int +ROW_IS_REFERENCED: int +CONNECT_TO_MASTER: int +QUERY_ON_MASTER: int +ERROR_WHEN_EXECUTING_COMMAND: int +WRONG_USAGE: int +WRONG_NUMBER_OF_COLUMNS_IN_SELECT: int +CANT_UPDATE_WITH_READLOCK: int +MIXING_NOT_ALLOWED: int +DUP_ARGUMENT: int +USER_LIMIT_REACHED: int +SPECIFIC_ACCESS_DENIED_ERROR: int +LOCAL_VARIABLE: int +GLOBAL_VARIABLE: int +NO_DEFAULT: int +WRONG_VALUE_FOR_VAR: int +WRONG_TYPE_FOR_VAR: int +VAR_CANT_BE_READ: int +CANT_USE_OPTION_HERE: int +NOT_SUPPORTED_YET: int +MASTER_FATAL_ERROR_READING_BINLOG: int +SLAVE_IGNORED_TABLE: int +INCORRECT_GLOBAL_LOCAL_VAR: int +WRONG_FK_DEF: int +KEY_REF_DO_NOT_MATCH_TABLE_REF: int +OPERAND_COLUMNS: int +SUBQUERY_NO_1_ROW: int +UNKNOWN_STMT_HANDLER: int +CORRUPT_HELP_DB: int +CYCLIC_REFERENCE: int +AUTO_CONVERT: int +ILLEGAL_REFERENCE: int +DERIVED_MUST_HAVE_ALIAS: int +SELECT_REDUCED: int +TABLENAME_NOT_ALLOWED_HERE: int +NOT_SUPPORTED_AUTH_MODE: int +SPATIAL_CANT_HAVE_NULL: int +COLLATION_CHARSET_MISMATCH: int +SLAVE_WAS_RUNNING: int +SLAVE_WAS_NOT_RUNNING: int +TOO_BIG_FOR_UNCOMPRESS: int +ZLIB_Z_MEM_ERROR: int +ZLIB_Z_BUF_ERROR: int +ZLIB_Z_DATA_ERROR: int +CUT_VALUE_GROUP_CONCAT: int +WARN_TOO_FEW_RECORDS: int +WARN_TOO_MANY_RECORDS: int +WARN_NULL_TO_NOTNULL: int +WARN_DATA_OUT_OF_RANGE: int +WARN_DATA_TRUNCATED: int +WARN_USING_OTHER_HANDLER: int +CANT_AGGREGATE_2COLLATIONS: int +DROP_USER: int +REVOKE_GRANTS: int +CANT_AGGREGATE_3COLLATIONS: int +CANT_AGGREGATE_NCOLLATIONS: int +VARIABLE_IS_NOT_STRUCT: int +UNKNOWN_COLLATION: int +SLAVE_IGNORED_SSL_PARAMS: int +SERVER_IS_IN_SECURE_AUTH_MODE: int +WARN_FIELD_RESOLVED: int +BAD_SLAVE_UNTIL_COND: int +MISSING_SKIP_SLAVE: int +UNTIL_COND_IGNORED: int +WRONG_NAME_FOR_INDEX: int +WRONG_NAME_FOR_CATALOG: int +WARN_QC_RESIZE: int +BAD_FT_COLUMN: int +UNKNOWN_KEY_CACHE: int +WARN_HOSTNAME_WONT_WORK: int +UNKNOWN_STORAGE_ENGINE: int +WARN_DEPRECATED_SYNTAX: int +NON_UPDATABLE_TABLE: int +FEATURE_DISABLED: int +OPTION_PREVENTS_STATEMENT: int +DUPLICATED_VALUE_IN_TYPE: int +TRUNCATED_WRONG_VALUE: int +TOO_MUCH_AUTO_TIMESTAMP_COLS: int +INVALID_ON_UPDATE: int +UNSUPPORTED_PS: int +GET_ERRMSG: int +GET_TEMPORARY_ERRMSG: int +UNKNOWN_TIME_ZONE: int +WARN_INVALID_TIMESTAMP: int +INVALID_CHARACTER_STRING: int +WARN_ALLOWED_PACKET_OVERFLOWED: int +CONFLICTING_DECLARATIONS: int +SP_NO_RECURSIVE_CREATE: int +SP_ALREADY_EXISTS: int +SP_DOES_NOT_EXIST: int +SP_DROP_FAILED: int +SP_STORE_FAILED: int +SP_LILABEL_MISMATCH: int +SP_LABEL_REDEFINE: int +SP_LABEL_MISMATCH: int +SP_UNINIT_VAR: int +SP_BADSELECT: int +SP_BADRETURN: int +SP_BADSTATEMENT: int +UPDATE_LOG_DEPRECATED_IGNORED: int +UPDATE_LOG_DEPRECATED_TRANSLATED: int +QUERY_INTERRUPTED: int +SP_WRONG_NO_OF_ARGS: int +SP_COND_MISMATCH: int +SP_NORETURN: int +SP_NORETURNEND: int +SP_BAD_CURSOR_QUERY: int +SP_BAD_CURSOR_SELECT: int +SP_CURSOR_MISMATCH: int +SP_CURSOR_ALREADY_OPEN: int +SP_CURSOR_NOT_OPEN: int +SP_UNDECLARED_VAR: int +SP_WRONG_NO_OF_FETCH_ARGS: int +SP_FETCH_NO_DATA: int +SP_DUP_PARAM: int +SP_DUP_VAR: int +SP_DUP_COND: int +SP_DUP_CURS: int +SP_CANT_ALTER: int +SP_SUBSELECT_NYI: int +STMT_NOT_ALLOWED_IN_SF_OR_TRG: int +SP_VARCOND_AFTER_CURSHNDLR: int +SP_CURSOR_AFTER_HANDLER: int +SP_CASE_NOT_FOUND: int +FPARSER_TOO_BIG_FILE: int +FPARSER_BAD_HEADER: int +FPARSER_EOF_IN_COMMENT: int +FPARSER_ERROR_IN_PARAMETER: int +FPARSER_EOF_IN_UNKNOWN_PARAMETER: int +VIEW_NO_EXPLAIN: int +FRM_UNKNOWN_TYPE: int +WRONG_OBJECT: int +NONUPDATEABLE_COLUMN: int +VIEW_SELECT_DERIVED: int +VIEW_SELECT_CLAUSE: int +VIEW_SELECT_VARIABLE: int +VIEW_SELECT_TMPTABLE: int +VIEW_WRONG_LIST: int +WARN_VIEW_MERGE: int +WARN_VIEW_WITHOUT_KEY: int +VIEW_INVALID: int +SP_NO_DROP_SP: int +SP_GOTO_IN_HNDLR: int +TRG_ALREADY_EXISTS: int +TRG_DOES_NOT_EXIST: int +TRG_ON_VIEW_OR_TEMP_TABLE: int +TRG_CANT_CHANGE_ROW: int +TRG_NO_SUCH_ROW_IN_TRG: int +NO_DEFAULT_FOR_FIELD: int +DIVISION_BY_ZERO: int +TRUNCATED_WRONG_VALUE_FOR_FIELD: int +ILLEGAL_VALUE_FOR_TYPE: int +VIEW_NONUPD_CHECK: int +VIEW_CHECK_FAILED: int +PROCACCESS_DENIED_ERROR: int +RELAY_LOG_FAIL: int +PASSWD_LENGTH: int +UNKNOWN_TARGET_BINLOG: int +IO_ERR_LOG_INDEX_READ: int +BINLOG_PURGE_PROHIBITED: int +FSEEK_FAIL: int +BINLOG_PURGE_FATAL_ERR: int +LOG_IN_USE: int +LOG_PURGE_UNKNOWN_ERR: int +RELAY_LOG_INIT: int +NO_BINARY_LOGGING: int +RESERVED_SYNTAX: int +WSAS_FAILED: int +DIFF_GROUPS_PROC: int +NO_GROUP_FOR_PROC: int +ORDER_WITH_PROC: int +LOGGING_PROHIBIT_CHANGING_OF: int +NO_FILE_MAPPING: int +WRONG_MAGIC: int +PS_MANY_PARAM: int +KEY_PART_0: int +VIEW_CHECKSUM: int +VIEW_MULTIUPDATE: int +VIEW_NO_INSERT_FIELD_LIST: int +VIEW_DELETE_MERGE_VIEW: int +CANNOT_USER: int +XAER_NOTA: int +XAER_INVAL: int +XAER_RMFAIL: int +XAER_OUTSIDE: int +XAER_RMERR: int +XA_RBROLLBACK: int +NONEXISTING_PROC_GRANT: int +PROC_AUTO_GRANT_FAIL: int +PROC_AUTO_REVOKE_FAIL: int +DATA_TOO_LONG: int +SP_BAD_SQLSTATE: int +STARTUP: int +LOAD_FROM_FIXED_SIZE_ROWS_TO_VAR: int +CANT_CREATE_USER_WITH_GRANT: int +WRONG_VALUE_FOR_TYPE: int +TABLE_DEF_CHANGED: int +SP_DUP_HANDLER: int +SP_NOT_VAR_ARG: int +SP_NO_RETSET: int +CANT_CREATE_GEOMETRY_OBJECT: int +FAILED_ROUTINE_BREAK_BINLOG: int +BINLOG_UNSAFE_ROUTINE: int +BINLOG_CREATE_ROUTINE_NEED_SUPER: int +EXEC_STMT_WITH_OPEN_CURSOR: int +STMT_HAS_NO_OPEN_CURSOR: int +COMMIT_NOT_ALLOWED_IN_SF_OR_TRG: int +NO_DEFAULT_FOR_VIEW_FIELD: int +SP_NO_RECURSION: int +TOO_BIG_SCALE: int +TOO_BIG_PRECISION: int +M_BIGGER_THAN_D: int +WRONG_LOCK_OF_SYSTEM_TABLE: int +CONNECT_TO_FOREIGN_DATA_SOURCE: int +QUERY_ON_FOREIGN_DATA_SOURCE: int +FOREIGN_DATA_SOURCE_DOESNT_EXIST: int +FOREIGN_DATA_STRING_INVALID_CANT_CREATE: int +FOREIGN_DATA_STRING_INVALID: int +CANT_CREATE_FEDERATED_TABLE: int +TRG_IN_WRONG_SCHEMA: int +STACK_OVERRUN_NEED_MORE: int +TOO_LONG_BODY: int +WARN_CANT_DROP_DEFAULT_KEYCACHE: int +TOO_BIG_DISPLAYWIDTH: int +XAER_DUPID: int +DATETIME_FUNCTION_OVERFLOW: int +CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG: int +VIEW_PREVENT_UPDATE: int +PS_NO_RECURSION: int +SP_CANT_SET_AUTOCOMMIT: int +MALFORMED_DEFINER: int +VIEW_FRM_NO_USER: int +VIEW_OTHER_USER: int +NO_SUCH_USER: int +FORBID_SCHEMA_CHANGE: int +ROW_IS_REFERENCED_2: int +NO_REFERENCED_ROW_2: int +SP_BAD_VAR_SHADOW: int +TRG_NO_DEFINER: int +OLD_FILE_FORMAT: int +SP_RECURSION_LIMIT: int +SP_PROC_TABLE_CORRUPT: int +SP_WRONG_NAME: int +TABLE_NEEDS_UPGRADE: int +SP_NO_AGGREGATE: int +MAX_PREPARED_STMT_COUNT_REACHED: int +VIEW_RECURSIVE: int +NON_GROUPING_FIELD_USED: int +TABLE_CANT_HANDLE_SPKEYS: int +NO_TRIGGERS_ON_SYSTEM_SCHEMA: int +USERNAME: int +HOSTNAME: int +WRONG_STRING_LENGTH: int +ERROR_LAST: int diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/FIELD_TYPE.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/FIELD_TYPE.pyi new file mode 100644 index 0000000..f1938b0 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/FIELD_TYPE.pyi @@ -0,0 +1,29 @@ +DECIMAL: int +TINY: int +SHORT: int +LONG: int +FLOAT: int +DOUBLE: int +NULL: int +TIMESTAMP: int +LONGLONG: int +INT24: int +DATE: int +TIME: int +DATETIME: int +YEAR: int +NEWDATE: int +VARCHAR: int +BIT: int +NEWDECIMAL: int +ENUM: int +SET: int +TINY_BLOB: int +MEDIUM_BLOB: int +LONG_BLOB: int +BLOB: int +VAR_STRING: int +STRING: int +GEOMETRY: int +CHAR: int +INTERVAL: int diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/FLAG.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/FLAG.pyi new file mode 100644 index 0000000..04b99fa --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/FLAG.pyi @@ -0,0 +1,17 @@ +from typing import Any + +NOT_NULL: Any +PRI_KEY: Any +UNIQUE_KEY: Any +MULTIPLE_KEY: Any +BLOB: Any +UNSIGNED: Any +ZEROFILL: Any +BINARY: Any +ENUM: Any +AUTO_INCREMENT: Any +TIMESTAMP: Any +SET: Any +PART_KEY: Any +GROUP: Any +UNIQUE: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/SERVER_STATUS.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/SERVER_STATUS.pyi new file mode 100644 index 0000000..437b893 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/SERVER_STATUS.pyi @@ -0,0 +1,10 @@ +SERVER_STATUS_IN_TRANS: int +SERVER_STATUS_AUTOCOMMIT: int +SERVER_MORE_RESULTS_EXISTS: int +SERVER_QUERY_NO_GOOD_INDEX_USED: int +SERVER_QUERY_NO_INDEX_USED: int +SERVER_STATUS_CURSOR_EXISTS: int +SERVER_STATUS_LAST_ROW_SENT: int +SERVER_STATUS_DB_DROPPED: int +SERVER_STATUS_NO_BACKSLASH_ESCAPES: int +SERVER_STATUS_METADATA_CHANGED: int diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/__init__.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pymysql/converters.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pymysql/converters.pyi new file mode 100644 index 0000000..fdd7602 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pymysql/converters.pyi @@ -0,0 +1,46 @@ +from typing import Any +from .constants import FIELD_TYPE as FIELD_TYPE, FLAG as FLAG +from .charset import charset_by_id as charset_by_id + +PYTHON3: Any +ESCAPE_REGEX: Any +ESCAPE_MAP: Any + +def escape_item(val, charset): ... +def escape_dict(val, charset): ... +def escape_sequence(val, charset): ... +def escape_set(val, charset): ... +def escape_bool(value): ... +def escape_object(value): ... + +escape_int: Any + +escape_long: Any + +def escape_float(value): ... +def escape_string(value): ... +def escape_unicode(value): ... +def escape_None(value): ... +def escape_timedelta(obj): ... +def escape_time(obj): ... +def escape_datetime(obj): ... +def escape_date(obj): ... +def escape_struct_time(obj): ... +def convert_datetime(connection, field, obj): ... +def convert_timedelta(connection, field, obj): ... +def convert_time(connection, field, obj): ... +def convert_date(connection, field, obj): ... +def convert_mysql_timestamp(connection, field, timestamp): ... +def convert_set(s): ... +def convert_bit(connection, field, b): ... +def convert_characters(connection, field, data): ... +def convert_int(connection, field, data): ... +def convert_long(connection, field, data): ... +def convert_float(connection, field, data): ... + +encoders: Any +decoders: Any +conversions: Any + +def convert_decimal(connection, field, data): ... +def escape_decimal(obj): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pymysql/cursors.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pymysql/cursors.pyi new file mode 100644 index 0000000..e080085 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pymysql/cursors.pyi @@ -0,0 +1,46 @@ +from typing import Union, Tuple, Any, Dict, Optional, Text, Iterator, List +from .connections import Connection + +Gen = Union[Tuple[Any, ...], Dict[str, Any]] + +class Cursor: + connection: Connection + description: Tuple[Text, ...] + rownumber: int + rowcount: int + arraysize: int + messages: Any + errorhandler: Any + lastrowid: int + def __init__(self, connection: Connection) -> None: ... + def __del__(self) -> None: ... + def close(self) -> None: ... + def setinputsizes(self, *args): ... + def setoutputsizes(self, *args): ... + def nextset(self): ... + def execute(self, query: str, args: Optional[Any] = ...) -> int: ... + def executemany(self, query: str, args) -> int: ... + def callproc(self, procname, args=...): ... + def fetchone(self) -> Optional[Gen]: ... + def fetchmany(self, size: Optional[int] = ...) -> Union[Optional[Gen], List[Gen]]: ... + def fetchall(self) -> Optional[Tuple[Gen, ...]]: ... + def scroll(self, value: int, mode: str = ...): ... + def __iter__(self): ... + +class DictCursor(Cursor): + def fetchone(self) -> Optional[Dict[str, Any]]: ... + def fetchmany(self, size: Optional[int] = ...) -> Optional[Tuple[Dict[str, Any], ...]]: ... + def fetchall(self) -> Optional[Tuple[Dict[str, Any], ...]]: ... + +class DictCursorMixin: + dict_type: Any + +class SSCursor(Cursor): + # fetchall return type is incompatible with the supertype. + def fetchall(self) -> List[Gen]: ... # type: ignore + def fetchall_unbuffered(self) -> Iterator[Tuple[Gen, ...]]: ... + def __iter__(self) -> Iterator[Tuple[Gen, ...]]: ... + def fetchmany(self, size: Optional[int] = ...) -> List[Gen]: ... + def scroll(self, value: int, mode: str = ...) -> None: ... + +class SSDictCursor(DictCursorMixin, SSCursor): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pymysql/err.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pymysql/err.pyi new file mode 100644 index 0000000..29d4f55 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pymysql/err.pyi @@ -0,0 +1,18 @@ +from typing import Dict +from .constants import ER as ER + +class MySQLError(Exception): ... +class Warning(MySQLError): ... +class Error(MySQLError): ... +class InterfaceError(Error): ... +class DatabaseError(Error): ... +class DataError(DatabaseError): ... +class OperationalError(DatabaseError): ... +class IntegrityError(DatabaseError): ... +class InternalError(DatabaseError): ... +class ProgrammingError(DatabaseError): ... +class NotSupportedError(DatabaseError): ... + +error_map: Dict + +def raise_mysql_exception(data) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pymysql/times.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pymysql/times.pyi new file mode 100644 index 0000000..c798e65 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pymysql/times.pyi @@ -0,0 +1,10 @@ +from typing import Any + +Date: Any +Time: Any +TimeDelta: Any +Timestamp: Any + +def DateFromTicks(ticks): ... +def TimeFromTicks(ticks): ... +def TimestampFromTicks(ticks): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pymysql/util.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pymysql/util.pyi new file mode 100644 index 0000000..3d9a65b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pymysql/util.pyi @@ -0,0 +1,3 @@ +def byte2int(b): ... +def int2byte(i): ... +def join_bytes(bs): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/__init__.pyi new file mode 100644 index 0000000..83e691d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/__init__.pyi @@ -0,0 +1 @@ +__license__: str diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/attributes.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/attributes.pyi new file mode 100644 index 0000000..3c82474 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/attributes.pyi @@ -0,0 +1,96 @@ +from typing import Any, Callable, Dict, Generic, Iterable, List, Mapping, Optional, Text, Type, TypeVar, Union, Set + +from datetime import datetime + +_T = TypeVar('_T') +_KT = TypeVar('_KT') +_VT = TypeVar('_VT') +_MT = TypeVar('_MT', bound='MapAttribute') + +class Attribute(Generic[_T]): + attr_name: Optional[Text] + attr_type: Text + null: bool + default: Any + is_hash_key: bool + is_range_key: bool + def __init__(self, hash_key: bool = ..., range_key: bool = ..., null: Optional[bool] = ..., default: Optional[Union[_T, Callable[..., _T]]] = ..., attr_name: Optional[Text] = ...) -> None: ... + def __set__(self, instance: Any, value: Optional[_T]) -> None: ... + def serialize(self, value: Any) -> Any: ... + def deserialize(self, value: Any) -> Any: ... + def get_value(self, value: Any) -> Any: ... + def between(self, lower: Any, upper: Any) -> Any: ... + def is_in(self, *values: Any) -> Any: ... + def exists(self) -> Any: ... + def does_not_exist(self) -> Any: ... + def is_type(self) -> Any: ... + def startswith(self, prefix: str) -> Any: ... + def contains(self, item: Any) -> Any: ... + def append(self, other: Any) -> Any: ... + def prepend(self, other: Any) -> Any: ... + def set(self, value: Any) -> Any: ... + def remove(self) -> Any: ... + def add(self, *values: Any) -> Any: ... + def delete(self, *values: Any) -> Any: ... + +class SetMixin(object): + def serialize(self, value): ... + def deserialize(self, value): ... + +class BinaryAttribute(Attribute[bytes]): + def __get__(self, instance: Any, owner: Any) -> bytes: ... + +class BinarySetAttribute(SetMixin, Attribute[Set[bytes]]): + def __get__(self, instance: Any, owner: Any) -> Set[bytes]: ... + +class UnicodeSetAttribute(SetMixin, Attribute[Set[Text]]): + def element_serialize(self, value: Any) -> Any: ... + def element_deserialize(self, value: Any) -> Any: ... + def __get__(self, instance: Any, owner: Any) -> Set[Text]: ... + +class UnicodeAttribute(Attribute[Text]): + def __get__(self, instance: Any, owner: Any) -> Text: ... + +class JSONAttribute(Attribute[Any]): + def __get__(self, instance: Any, owner: Any) -> Any: ... + +class LegacyBooleanAttribute(Attribute[bool]): + def __get__(self, instance: Any, owner: Any) -> bool: ... + +class BooleanAttribute(Attribute[bool]): + def __get__(self, instance: Any, owner: Any) -> bool: ... + +class NumberSetAttribute(SetMixin, Attribute[Set[float]]): + def __get__(self, instance: Any, owner: Any) -> Set[float]: ... + +class NumberAttribute(Attribute[float]): + def __get__(self, instance: Any, owner: Any) -> float: ... + +class UTCDateTimeAttribute(Attribute[datetime]): + def __get__(self, instance: Any, owner: Any) -> datetime: ... + +class NullAttribute(Attribute[None]): + def __get__(self, instance: Any, owner: Any) -> None: ... + +class MapAttributeMeta(type): + def __init__(self, name, bases, attrs) -> None: ... + +class MapAttribute(Generic[_KT, _VT], Attribute[Mapping[_KT, _VT]], metaclass=MapAttributeMeta): + attribute_values: Any + def __init__(self, hash_key: bool = ..., range_key: bool = ..., null: Optional[bool] = ..., default: Optional[Union[Any, Callable[..., Any]]] = ..., attr_name: Optional[Text] = ..., **attrs) -> None: ... + def __iter__(self) -> Iterable[_VT]: ... + def __getattr__(self, attr: str) -> _VT: ... + def __getitem__(self, item: _KT) -> _VT: ... + def __set__(self, instance: Any, value: Union[None, MapAttribute[_KT, _VT], Mapping[_KT, _VT]]) -> None: ... + def __get__(self: _MT, instance: Any, owner: Any) -> _MT: ... + def is_type_safe(self, key: Any, value: Any) -> bool: ... + def validate(self) -> bool: ... + +class ListAttribute(Generic[_T], Attribute[List[_T]]): + element_type: Any + def __init__(self, hash_key: bool = ..., range_key: bool = ..., null: Optional[bool] = ..., default: Optional[Union[Any, Callable[..., Any]]] = ..., attr_name: Optional[Text] = ..., of: Optional[Type[_T]] = ...) -> None: ... + def __get__(self, instance: Any, owner: Any) -> List[_T]: ... + +DESERIALIZE_CLASS_MAP: Dict[Text, Attribute] +SERIALIZE_CLASS_MAP: Dict[Type, Attribute] +SERIALIZE_KEY_MAP: Dict[Type, Text] diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/connection/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/connection/__init__.pyi new file mode 100644 index 0000000..1860736 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/connection/__init__.pyi @@ -0,0 +1,2 @@ +from pynamodb.connection.base import Connection as Connection +from pynamodb.connection.table import TableConnection as TableConnection diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/connection/base.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/connection/base.pyi new file mode 100644 index 0000000..9c75150 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/connection/base.pyi @@ -0,0 +1,78 @@ +from typing import Any, Dict, Optional, Text + +BOTOCORE_EXCEPTIONS: Any +log: Any + +class MetaTable: + data: Dict + def __init__(self, data: Dict) -> None: ... + @property + def range_keyname(self) -> Optional[Text]: ... + @property + def hash_keyname(self) -> Text: ... + def get_index_hash_keyname(self, index_name: Text) -> Optional[Text]: ... + def get_item_attribute_map(self, attributes, item_key: Any = ..., pythonic_key: bool = ...): ... + def get_attribute_type(self, attribute_name, value: Optional[Any] = ...): ... + def get_identifier_map(self, hash_key, range_key: Optional[Any] = ..., key: Any = ...): ... + def get_exclusive_start_key_map(self, exclusive_start_key): ... + +class Connection: + host: Any + region: Any + session_cls: Any + def __init__(self, region: Optional[Any] = ..., host: Optional[Any] = ..., session_cls: Optional[Any] = ..., + request_timeout_seconds: Optional[Any] = ..., max_retry_attempts: Optional[Any] = ..., + base_backoff_ms: Optional[Any] = ...) -> None: ... + def dispatch(self, operation_name, operation_kwargs): ... + @property + def session(self): ... + @property + def requests_session(self): ... + @property + def client(self): ... + def get_meta_table(self, table_name: Text, refresh: bool = ...): ... + def create_table(self, table_name: Text, attribute_definitions: Optional[Any] = ..., key_schema: Optional[Any] = ..., + read_capacity_units: Optional[Any] = ..., write_capacity_units: Optional[Any] = ..., + global_secondary_indexes: Optional[Any] = ..., local_secondary_indexes: Optional[Any] = ..., + stream_specification: Optional[Any] = ...): ... + def delete_table(self, table_name: Text): ... + def update_table(self, table_name: Text, read_capacity_units: Optional[Any] = ..., write_capacity_units: Optional[Any] = ..., + global_secondary_index_updates: Optional[Any] = ...): ... + def list_tables(self, exclusive_start_table_name: Optional[Any] = ..., limit: Optional[Any] = ...): ... + def describe_table(self, table_name: Text): ... + def get_conditional_operator(self, operator): ... + def get_item_attribute_map(self, table_name: Text, attributes, item_key: Any = ..., pythonic_key: bool = ...): ... + def get_expected_map(self, table_name: Text, expected): ... + def parse_attribute(self, attribute, return_type: bool = ...): ... + def get_attribute_type(self, table_name: Text, attribute_name, value: Optional[Any] = ...): ... + def get_identifier_map(self, table_name: Text, hash_key, range_key: Optional[Any] = ..., key: Any = ...): ... + def get_query_filter_map(self, table_name: Text, query_filters): ... + def get_consumed_capacity_map(self, return_consumed_capacity): ... + def get_return_values_map(self, return_values): ... + def get_item_collection_map(self, return_item_collection_metrics): ... + def get_exclusive_start_key_map(self, table_name: Text, exclusive_start_key): ... + def delete_item(self, table_name: Text, hash_key, range_key: Optional[Any] = ..., expected: Optional[Any] = ..., + conditional_operator: Optional[Any] = ..., return_values: Optional[Any] = ..., + return_consumed_capacity: Optional[Any] = ..., return_item_collection_metrics: Optional[Any] = ...): ... + def update_item(self, table_name: Text, hash_key, range_key: Optional[Any] = ..., attribute_updates: Optional[Any] = ..., + expected: Optional[Any] = ..., return_consumed_capacity: Optional[Any] = ..., + conditional_operator: Optional[Any] = ..., return_item_collection_metrics: Optional[Any] = ..., + return_values: Optional[Any] = ...): ... + def put_item(self, table_name: Text, hash_key, range_key: Optional[Any] = ..., attributes: Optional[Any] = ..., + expected: Optional[Any] = ..., conditional_operator: Optional[Any] = ..., return_values: Optional[Any] = ..., + return_consumed_capacity: Optional[Any] = ..., return_item_collection_metrics: Optional[Any] = ...): ... + def batch_write_item(self, table_name: Text, put_items: Optional[Any] = ..., delete_items: Optional[Any] = ..., + return_consumed_capacity: Optional[Any] = ..., return_item_collection_metrics: Optional[Any] = ...): ... + def batch_get_item(self, table_name: Text, keys, consistent_read: Optional[Any] = ..., + return_consumed_capacity: Optional[Any] = ..., attributes_to_get: Optional[Any] = ...): ... + def get_item(self, table_name: Text, hash_key, range_key: Optional[Any] = ..., consistent_read: bool = ..., + attributes_to_get: Optional[Any] = ...): ... + def scan(self, table_name: Text, attributes_to_get: Optional[Any] = ..., limit: Optional[Any] = ..., + conditional_operator: Optional[Any] = ..., scan_filter: Optional[Any] = ..., + return_consumed_capacity: Optional[Any] = ..., exclusive_start_key: Optional[Any] = ..., + segment: Optional[Any] = ..., total_segments: Optional[Any] = ...): ... + def query(self, table_name: Text, hash_key, attributes_to_get: Optional[Any] = ..., consistent_read: bool = ..., + exclusive_start_key: Optional[Any] = ..., index_name: Optional[Any] = ..., key_conditions: Optional[Any] = ..., + query_filters: Optional[Any] = ..., conditional_operator: Optional[Any] = ..., limit: Optional[Any] = ..., + return_consumed_capacity: Optional[Any] = ..., scan_index_forward: Optional[Any] = ..., + select: Optional[Any] = ...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/connection/table.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/connection/table.pyi new file mode 100644 index 0000000..0f820af --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/connection/table.pyi @@ -0,0 +1,18 @@ +from typing import Any, Optional + +class TableConnection: + table_name: Any + connection: Any + def __init__(self, table_name, region: Optional[Any] = ..., host: Optional[Any] = ..., session_cls: Optional[Any] = ..., request_timeout_seconds: Optional[Any] = ..., max_retry_attempts: Optional[Any] = ..., base_backoff_ms: Optional[Any] = ...) -> None: ... + def delete_item(self, hash_key, range_key: Optional[Any] = ..., expected: Optional[Any] = ..., conditional_operator: Optional[Any] = ..., return_values: Optional[Any] = ..., return_consumed_capacity: Optional[Any] = ..., return_item_collection_metrics: Optional[Any] = ...): ... + def update_item(self, hash_key, range_key: Optional[Any] = ..., attribute_updates: Optional[Any] = ..., expected: Optional[Any] = ..., conditional_operator: Optional[Any] = ..., return_consumed_capacity: Optional[Any] = ..., return_item_collection_metrics: Optional[Any] = ..., return_values: Optional[Any] = ...): ... + def put_item(self, hash_key, range_key: Optional[Any] = ..., attributes: Optional[Any] = ..., expected: Optional[Any] = ..., conditional_operator: Optional[Any] = ..., return_values: Optional[Any] = ..., return_consumed_capacity: Optional[Any] = ..., return_item_collection_metrics: Optional[Any] = ...): ... + def batch_write_item(self, put_items: Optional[Any] = ..., delete_items: Optional[Any] = ..., return_consumed_capacity: Optional[Any] = ..., return_item_collection_metrics: Optional[Any] = ...): ... + def batch_get_item(self, keys, consistent_read: Optional[Any] = ..., return_consumed_capacity: Optional[Any] = ..., attributes_to_get: Optional[Any] = ...): ... + def get_item(self, hash_key, range_key: Optional[Any] = ..., consistent_read: bool = ..., attributes_to_get: Optional[Any] = ...): ... + def scan(self, attributes_to_get: Optional[Any] = ..., limit: Optional[Any] = ..., conditional_operator: Optional[Any] = ..., scan_filter: Optional[Any] = ..., return_consumed_capacity: Optional[Any] = ..., segment: Optional[Any] = ..., total_segments: Optional[Any] = ..., exclusive_start_key: Optional[Any] = ...): ... + def query(self, hash_key, attributes_to_get: Optional[Any] = ..., consistent_read: bool = ..., exclusive_start_key: Optional[Any] = ..., index_name: Optional[Any] = ..., key_conditions: Optional[Any] = ..., query_filters: Optional[Any] = ..., limit: Optional[Any] = ..., return_consumed_capacity: Optional[Any] = ..., scan_index_forward: Optional[Any] = ..., conditional_operator: Optional[Any] = ..., select: Optional[Any] = ...): ... + def describe_table(self): ... + def delete_table(self): ... + def update_table(self, read_capacity_units: Optional[Any] = ..., write_capacity_units: Optional[Any] = ..., global_secondary_index_updates: Optional[Any] = ...): ... + def create_table(self, attribute_definitions: Optional[Any] = ..., key_schema: Optional[Any] = ..., read_capacity_units: Optional[Any] = ..., write_capacity_units: Optional[Any] = ..., global_secondary_indexes: Optional[Any] = ..., local_secondary_indexes: Optional[Any] = ..., stream_specification: Optional[Any] = ...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/connection/util.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/connection/util.pyi new file mode 100644 index 0000000..20635c6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/connection/util.pyi @@ -0,0 +1,3 @@ +from typing import Text + +def pythonic(var_name: Text) -> Text: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/constants.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/constants.pyi new file mode 100644 index 0000000..7c26cd6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/constants.pyi @@ -0,0 +1,166 @@ +from typing import Any + +BATCH_WRITE_ITEM: str +DESCRIBE_TABLE: str +BATCH_GET_ITEM: str +CREATE_TABLE: str +UPDATE_TABLE: str +DELETE_TABLE: str +LIST_TABLES: str +UPDATE_ITEM: str +DELETE_ITEM: str +GET_ITEM: str +PUT_ITEM: str +QUERY: str +SCAN: str +GLOBAL_SECONDARY_INDEX_UPDATES: str +RETURN_ITEM_COLL_METRICS: str +EXCLUSIVE_START_TABLE_NAME: str +RETURN_CONSUMED_CAPACITY: str +COMPARISON_OPERATOR: str +SCAN_INDEX_FORWARD: str +ATTR_DEFINITIONS: str +ATTR_VALUE_LIST: str +TABLE_DESCRIPTION: str +UNPROCESSED_KEYS: str +UNPROCESSED_ITEMS: str +CONSISTENT_READ: str +DELETE_REQUEST: str +RETURN_VALUES: str +REQUEST_ITEMS: str +ATTRS_TO_GET: str +ATTR_UPDATES: str +TABLE_STATUS: str +SCAN_FILTER: str +TABLE_NAME: str +KEY_SCHEMA: str +ATTR_NAME: str +ATTR_TYPE: str +ITEM_COUNT: str +CAMEL_COUNT: str +PUT_REQUEST: str +INDEX_NAME: str +ATTRIBUTES: str +TABLE_KEY: str +RESPONSES: str +RANGE_KEY: str +KEY_TYPE: str +ACTION: str +UPDATE: str +EXISTS: str +SELECT: str +ACTIVE: str +LIMIT: str +ITEMS: str +ITEM: str +KEYS: str +UTC: str +KEY: str +DEFAULT_ENCODING: str +DEFAULT_REGION: str +DATETIME_FORMAT: str +SERVICE_NAME: str +HTTP_OK: int +HTTP_BAD_REQUEST: int +PROVISIONED_THROUGHPUT: str +READ_CAPACITY_UNITS: str +WRITE_CAPACITY_UNITS: str +STRING_SHORT: str +STRING_SET_SHORT: str +NUMBER_SHORT: str +NUMBER_SET_SHORT: str +BINARY_SHORT: str +BINARY_SET_SHORT: str +MAP_SHORT: str +LIST_SHORT: str +BOOLEAN: str +BOOLEAN_SHORT: str +STRING: str +STRING_SET: str +NUMBER: str +NUMBER_SET: str +BINARY: str +BINARY_SET: str +MAP: str +LIST: str +SHORT_ATTR_TYPES: Any +ATTR_TYPE_MAP: Any +LOCAL_SECONDARY_INDEX: str +LOCAL_SECONDARY_INDEXES: str +GLOBAL_SECONDARY_INDEX: str +GLOBAL_SECONDARY_INDEXES: str +PROJECTION: str +PROJECTION_TYPE: str +NON_KEY_ATTRIBUTES: str +KEYS_ONLY: str +ALL: str +INCLUDE: str +STREAM_VIEW_TYPE: str +STREAM_SPECIFICATION: str +STREAM_ENABLED: str +STREAM_NEW_IMAGE: str +STREAM_OLD_IMAGE: str +STREAM_NEW_AND_OLD_IMAGE: str +STREAM_KEYS_ONLY: str +EXCLUSIVE_START_KEY: str +LAST_EVALUATED_KEY: str +QUERY_FILTER: str +BEGINS_WITH: str +BETWEEN: str +EQ: str +NE: str +LE: str +LT: str +GE: str +GT: str +IN: str +KEY_CONDITIONS: str +COMPARISON_OPERATOR_VALUES: Any +QUERY_OPERATOR_MAP: Any +NOT_NULL: str +NULL: str +CONTAINS: str +NOT_CONTAINS: str +ALL_ATTRIBUTES: str +ALL_PROJECTED_ATTRIBUTES: str +SPECIFIC_ATTRIBUTES: str +COUNT: str +SELECT_VALUES: Any +SCAN_OPERATOR_MAP: Any +QUERY_FILTER_OPERATOR_MAP: Any +DELETE_FILTER_OPERATOR_MAP: Any +UPDATE_FILTER_OPERATOR_MAP: Any +PUT_FILTER_OPERATOR_MAP: Any +SEGMENT: str +TOTAL_SEGMENTS: str +SCAN_FILTER_VALUES: Any +QUERY_FILTER_VALUES: Any +DELETE_FILTER_VALUES: Any +VALUE: str +EXPECTED: str +CONSUMED_CAPACITY: str +CAPACITY_UNITS: str +INDEXES: str +TOTAL: str +NONE: str +RETURN_CONSUMED_CAPACITY_VALUES: Any +SIZE: str +RETURN_ITEM_COLL_METRICS_VALUES: Any +ALL_OLD: str +UPDATED_OLD: str +ALL_NEW: str +UPDATED_NEW: str +RETURN_VALUES_VALUES: Any +PUT: str +DELETE: str +ADD: str +ATTR_UPDATE_ACTIONS: Any +BATCH_GET_PAGE_LIMIT: int +BATCH_WRITE_PAGE_LIMIT: int +META_CLASS_NAME: str +REGION: str +HOST: str +CONDITIONAL_OPERATOR: str +AND: str +OR: str +CONDITIONAL_OPERATORS: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/exceptions.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/exceptions.pyi new file mode 100644 index 0000000..728db4a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/exceptions.pyi @@ -0,0 +1,23 @@ +from typing import Any, Optional, Text + +class PynamoDBException(Exception): + msg: str + cause: Any + def __init__(self, msg: Optional[Text] = ..., cause: Optional[Exception] = ...) -> None: ... + +class PynamoDBConnectionError(PynamoDBException): ... +class DeleteError(PynamoDBConnectionError): ... +class QueryError(PynamoDBConnectionError): ... +class ScanError(PynamoDBConnectionError): ... +class PutError(PynamoDBConnectionError): ... +class UpdateError(PynamoDBConnectionError): ... +class GetError(PynamoDBConnectionError): ... +class TableError(PynamoDBConnectionError): ... +class DoesNotExist(PynamoDBException): ... + +class TableDoesNotExist(PynamoDBException): + def __init__(self, table_name) -> None: ... + +class VerboseClientError(Exception): + MSG_TEMPLATE: Any + def __init__(self, error_response, operation_name, verbose_properties: Optional[Any] = ...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/indexes.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/indexes.pyi new file mode 100644 index 0000000..66e8ae7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/indexes.pyi @@ -0,0 +1,30 @@ +from typing import Any, Optional + +class IndexMeta(type): + def __init__(self, name, bases, attrs) -> None: ... + +class Index(metaclass=IndexMeta): + Meta: Any + def __init__(self) -> None: ... + @classmethod + def count(cls, hash_key, consistent_read: bool = ..., **filters) -> int: ... + @classmethod + def query(self, hash_key, scan_index_forward: Optional[Any] = ..., consistent_read: bool = ..., limit: Optional[Any] = ..., last_evaluated_key: Optional[Any] = ..., attributes_to_get: Optional[Any] = ..., **filters): ... + +class GlobalSecondaryIndex(Index): ... +class LocalSecondaryIndex(Index): ... + +class Projection(object): + projection_type: Any + non_key_attributes: Any + +class KeysOnlyProjection(Projection): + projection_type: Any + +class IncludeProjection(Projection): + projection_type: Any + non_key_attributes: Any + def __init__(self, non_attr_keys: Optional[Any] = ...) -> None: ... + +class AllProjection(Projection): + projection_type: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/models.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/models.pyi new file mode 100644 index 0000000..5943a58 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/models.pyi @@ -0,0 +1,107 @@ +from .attributes import Attribute +from .exceptions import DoesNotExist as DoesNotExist +from typing import Any, Dict, Generic, Iterable, Iterator, List, Optional, Sequence, Tuple, Type, TypeVar, Text, Union + +log: Any + +class DefaultMeta: ... + +class ResultSet(Iterable): + results: Any + operation: Any + arguments: Any + def __init__(self, results, operation, arguments) -> None: ... + def __iter__(self): ... + +class MetaModel(type): + def __init__(self, name: Text, bases: Tuple[type, ...], attrs: Dict[Any, Any]) -> None: ... + +_T = TypeVar('_T', bound='Model') +KeyType = Union[Text, bytes, float, int, Tuple] + +class Model(metaclass=MetaModel): + DoesNotExist = DoesNotExist + attribute_values: Dict[Text, Any] + def __init__(self, hash_key: Optional[KeyType] = ..., range_key: Optional[Any] = ..., **attrs) -> None: ... + @classmethod + def has_map_or_list_attributes(cls: Type[_T]) -> bool: ... + @classmethod + def batch_get(cls: Type[_T], items: Iterable[Union[KeyType, Iterable[KeyType]]], consistent_read: Optional[bool] = ..., attributes_to_get: Optional[Sequence[Text]] = ...) -> Iterator[_T]: ... + @classmethod + def batch_write(cls: Type[_T], auto_commit: bool = ...) -> BatchWrite[_T]: ... + def delete(self, condition: Optional[Any] = ..., conditional_operator: Optional[Text] = ..., **expected_values) -> Any: ... + def update(self, attributes: Optional[Dict[Text, Dict[Text, Any]]] = ..., actions: Optional[List[Any]] = ..., condition: Optional[Any] = ..., conditional_operator: Optional[Text] = ..., **expected_values) -> Any: ... + def update_item(self, attribute: Text, value: Optional[Any] = ..., action: Optional[Text] = ..., conditional_operator: Optional[Text] = ..., **expected_values): ... + def save(self, condition: Optional[Any] = ..., conditional_operator: Optional[Text] = ..., **expected_values) -> Dict[str, Any]: ... + def refresh(self, consistent_read: bool = ...): ... + @classmethod + def get(cls: Type[_T], hash_key: KeyType, range_key: Optional[KeyType] = ..., consistent_read: bool = ...) -> _T: ... + @classmethod + def from_raw_data(cls: Type[_T], data) -> _T: ... + @classmethod + def count(cls: Type[_T], hash_key: Optional[KeyType] = ..., consistent_read: bool = ..., index_name: Optional[Text] = ..., limit: Optional[int] = ..., **filters) -> int: ... + @classmethod + def query(cls: Type[_T], hash_key: KeyType, consistent_read: bool = ..., index_name: Optional[Text] = ..., scan_index_forward: Optional[Any] = ..., conditional_operator: Optional[Text] = ..., limit: Optional[int] = ..., last_evaluated_key: Optional[Any] = ..., attributes_to_get: Optional[Iterable[Text]] = ..., page_size: Optional[int] = ..., **filters) -> Iterator[_T]: ... + @classmethod + def rate_limited_scan( + cls: Type[_T], + # TODO: annotate Condition class + filter_condition: Optional[Any] = ..., + attributes_to_get: Optional[Sequence[Text]] = ..., + segment: Optional[int] = ..., + total_segments: Optional[int] = ..., + limit: Optional[int] = ..., + conditional_operator: Optional[Text] = ..., + last_evaluated_key: Optional[Any] = ..., + page_size: Optional[int] = ..., + timeout_seconds: Optional[int] = ..., + read_capacity_to_consume_per_second: int = ..., + allow_rate_limited_scan_without_consumed_capacity: Optional[bool] = ..., + max_sleep_between_retry: int = ..., + max_consecutive_exceptions: int = ..., + consistent_read: Optional[bool] = ..., + index_name: Optional[str] = ..., + **filters: Any + ) -> Iterator[_T]: ... + @classmethod + def scan(cls: Type[_T], segment: Optional[int] = ..., total_segments: Optional[int] = ..., limit: Optional[int] = ..., conditional_operator: Optional[Text] = ..., last_evaluated_key: Optional[Any] = ..., page_size: Optional[int] = ..., **filters) -> Iterator[_T]: ... + @classmethod + def exists(cls: Type[_T]) -> bool: ... + @classmethod + def delete_table(cls): ... + @classmethod + def describe_table(cls): ... + @classmethod + def create_table(cls: Type[_T], wait: bool = ..., read_capacity_units: Optional[Any] = ..., write_capacity_units: Optional[Any] = ...): ... + @classmethod + def dumps(cls): ... + @classmethod + def dump(cls, filename): ... + @classmethod + def loads(cls, data): ... + @classmethod + def load(cls, filename): ... + @classmethod + def add_throttle_record(cls, records): ... + @classmethod + def get_throttle(cls): ... + @classmethod + def get_attributes(cls) -> Dict[str, Attribute]: ... + @classmethod + def _get_attributes(cls) -> Dict[str, Attribute]: ... + +class ModelContextManager(Generic[_T]): + model: Type[_T] + auto_commit: bool + max_operations: int + pending_operations: List[Dict[Text, Any]] + def __init__(self, model: Type[_T], auto_commit: bool = ...) -> None: ... + def __enter__(self) -> ModelContextManager[_T]: ... + +class BatchWrite(Generic[_T], ModelContextManager[_T]): + def save(self, put_item: _T) -> None: ... + def delete(self, del_item: _T) -> None: ... + def __enter__(self) -> BatchWrite[_T]: ... + def __exit__(self, exc_type, exc_val, exc_tb) -> None: ... + pending_operations: Any + def commit(self) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/settings.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/settings.pyi new file mode 100644 index 0000000..76fc417 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/settings.pyi @@ -0,0 +1,8 @@ +from typing import Any + +log: Any +default_settings_dict: Any +OVERRIDE_SETTINGS_PATH: Any +override_settings: Any + +def get_settings_value(key): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/throttle.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/throttle.pyi new file mode 100644 index 0000000..6948b68 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/throttle.pyi @@ -0,0 +1,19 @@ +from typing import Any, Optional + +log: Any + +class ThrottleBase: + capacity: Any + window: Any + records: Any + sleep_interval: Any + def __init__(self, capacity, window: int = ..., initial_sleep: Optional[Any] = ...) -> None: ... + def add_record(self, record): ... + def throttle(self): ... + +class NoThrottle(ThrottleBase): + def __init__(self) -> None: ... + def add_record(self, record): ... + +class Throttle(ThrottleBase): + def throttle(self): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/types.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/types.pyi new file mode 100644 index 0000000..14195f0 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/types.pyi @@ -0,0 +1,5 @@ +STRING: str +NUMBER: str +BINARY: str +HASH: str +RANGE: str diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pytz/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pytz/__init__.pyi new file mode 100644 index 0000000..20655d1 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/pytz/__init__.pyi @@ -0,0 +1,41 @@ +from typing import Optional, List, Set, Mapping, Union +import datetime + +class BaseTzInfo(datetime.tzinfo): + zone: str = ... + def localize(self, dt: datetime.datetime, is_dst: bool = ...) -> datetime.datetime: ... + def normalize(self, dt: datetime.datetime) -> datetime.datetime: ... + +class _UTCclass(BaseTzInfo): + def tzname(self, dt: Optional[datetime.datetime]) -> str: ... + def utcoffset(self, dt: Optional[datetime.datetime]) -> datetime.timedelta: ... + def dst(self, dt: Optional[datetime.datetime]) -> datetime.timedelta: ... + +class _StaticTzInfo(BaseTzInfo): + def tzname(self, dt: Optional[datetime.datetime], is_dst: Optional[bool] = ...) -> str: ... + def utcoffset(self, dt: Optional[datetime.datetime], is_dst: Optional[bool] = ...) -> datetime.timedelta: ... + def dst(self, dt: Optional[datetime.datetime], is_dst: Optional[bool] = ...) -> datetime.timedelta: ... + +class _DstTzInfo(BaseTzInfo): + def tzname(self, dt: Optional[datetime.datetime], is_dst: Optional[bool] = ...) -> str: ... + def utcoffset(self, dt: Optional[datetime.datetime], is_dst: Optional[bool] = ...) -> Optional[datetime.timedelta]: ... + def dst(self, dt: Optional[datetime.datetime], is_dst: Optional[bool] = ...) -> Optional[datetime.timedelta]: ... + +class UnknownTimeZoneError(KeyError): ... +class InvalidTimeError(Exception): ... +class AmbiguousTimeError(InvalidTimeError): ... +class NonExistentTimeError(InvalidTimeError): ... + +utc: _UTCclass +UTC: _UTCclass +def timezone(zone: str) -> Union[_UTCclass, _StaticTzInfo, _DstTzInfo]: ... + +all_timezones: List[str] +all_timezones_set: Set[str] +common_timezones: List[str] +common_timezones_set: Set[str] +country_timezones: Mapping[str, List[str]] +country_names: Mapping[str, str] +ZERO: datetime.timedelta +HOUR: datetime.timedelta +VERSION: str diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/__init__.pyi new file mode 100644 index 0000000..7705d78 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/__init__.pyi @@ -0,0 +1,40 @@ +# Stubs for requests (based on version 2.6.0, Python 3) + +from typing import Any +from . import models +from . import api +from . import sessions +from . import status_codes +from . import exceptions +from . import packages +import logging + +__title__: Any +__build__: Any +__license__: Any +__copyright__: Any +__version__: Any + +Request = models.Request +Response = models.Response +PreparedRequest = models.PreparedRequest +request = api.request +get = api.get +head = api.head +post = api.post +patch = api.patch +put = api.put +delete = api.delete +options = api.options +session = sessions.session +Session = sessions.Session +codes = status_codes.codes +RequestException = exceptions.RequestException +Timeout = exceptions.Timeout +URLRequired = exceptions.URLRequired +TooManyRedirects = exceptions.TooManyRedirects +HTTPError = exceptions.HTTPError +ConnectionError = exceptions.ConnectionError + +class NullHandler(logging.Handler): + def emit(self, record): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/adapters.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/adapters.pyi new file mode 100644 index 0000000..1900567 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/adapters.pyi @@ -0,0 +1,79 @@ +# Stubs for requests.adapters (Python 3) + +from typing import Any, Container, Union, Text, Tuple, Optional, Mapping +from . import models +from .packages.urllib3 import poolmanager +from .packages.urllib3 import response +from .packages.urllib3.util import retry +from . import compat +from . import utils +from . import structures +from .packages.urllib3 import exceptions as urllib3_exceptions +from . import cookies +from . import exceptions +from . import auth + +PreparedRequest = models.PreparedRequest +Response = models.Response +PoolManager = poolmanager.PoolManager +proxy_from_url = poolmanager.proxy_from_url +HTTPResponse = response.HTTPResponse +Retry = retry.Retry +DEFAULT_CA_BUNDLE_PATH = utils.DEFAULT_CA_BUNDLE_PATH +get_encoding_from_headers = utils.get_encoding_from_headers +prepend_scheme_if_needed = utils.prepend_scheme_if_needed +get_auth_from_url = utils.get_auth_from_url +urldefragauth = utils.urldefragauth +CaseInsensitiveDict = structures.CaseInsensitiveDict +ConnectTimeoutError = urllib3_exceptions.ConnectTimeoutError +MaxRetryError = urllib3_exceptions.MaxRetryError +ProtocolError = urllib3_exceptions.ProtocolError +ReadTimeoutError = urllib3_exceptions.ReadTimeoutError +ResponseError = urllib3_exceptions.ResponseError +extract_cookies_to_jar = cookies.extract_cookies_to_jar +ConnectionError = exceptions.ConnectionError +ConnectTimeout = exceptions.ConnectTimeout +ReadTimeout = exceptions.ReadTimeout +SSLError = exceptions.SSLError +ProxyError = exceptions.ProxyError +RetryError = exceptions.RetryError + +DEFAULT_POOLBLOCK: Any +DEFAULT_POOLSIZE: Any +DEFAULT_RETRIES: Any + +class BaseAdapter: + def __init__(self) -> None: ... + def send(self, + request: PreparedRequest, + stream: bool = ..., + timeout: Union[None, float, Tuple[float, float]] = ..., + verify: Union[bool, str] = ..., + cert: Union[None, Union[bytes, Text], Container[Union[bytes, Text]]] = ..., + proxies: Optional[Mapping[str, str]] = ...) -> Response: ... + def close(self) -> None: ... + +class HTTPAdapter(BaseAdapter): + __attrs__: Any + max_retries: Any + config: Any + proxy_manager: Any + def __init__(self, pool_connections=..., pool_maxsize=..., max_retries=..., + pool_block=...) -> None: ... + poolmanager: Any + def init_poolmanager(self, connections, maxsize, block=..., **pool_kwargs): ... + def proxy_manager_for(self, proxy, **proxy_kwargs): ... + def cert_verify(self, conn, url, verify, cert): ... + def build_response(self, req, resp): ... + def get_connection(self, url, proxies=...): ... + def close(self): ... + def request_url(self, request, proxies): ... + def add_headers(self, request, **kwargs): ... + def proxy_headers(self, proxy): ... + def send(self, + request: PreparedRequest, + stream: bool = ..., + timeout: Union[None, float, Tuple[float, float]] = ..., + verify: Union[bool, str] = ..., + cert: Union[None, Union[bytes, Text], Container[Union[bytes, Text]]] = ..., + proxies: Optional[Mapping[str, str]] = ...) -> Response: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/api.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/api.pyi new file mode 100644 index 0000000..df3003c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/api.pyi @@ -0,0 +1,40 @@ +# Stubs for requests.api (Python 3) + +import sys +from typing import Optional, Union, Any, Iterable, Mapping, MutableMapping, Tuple, IO, Text + +from .models import Response + +if sys.version_info >= (3,): + _Text = str +else: + _Text = Union[str, Text] + +_ParamsMappingValueType = Union[_Text, bytes, int, float, Iterable[Union[_Text, bytes, int, float]]] +_Data = Union[ + None, + _Text, + bytes, + MutableMapping[str, Any], + MutableMapping[Text, Any], + Iterable[Tuple[_Text, Optional[_Text]]], + IO +] + +def request(method: str, url: str, **kwargs) -> Response: ... +def get(url: Union[_Text, bytes], + params: Optional[ + Union[Mapping[Union[_Text, bytes, int, float], _ParamsMappingValueType], + Union[_Text, bytes], + Tuple[Union[_Text, bytes, int, float], _ParamsMappingValueType], + Mapping[_Text, _ParamsMappingValueType], + Mapping[bytes, _ParamsMappingValueType], + Mapping[int, _ParamsMappingValueType], + Mapping[float, _ParamsMappingValueType]]] = ..., + **kwargs) -> Response: ... +def options(url: _Text, **kwargs) -> Response: ... +def head(url: _Text, **kwargs) -> Response: ... +def post(url: _Text, data: _Data = ..., json=..., **kwargs) -> Response: ... +def put(url: _Text, data: _Data = ..., json=..., **kwargs) -> Response: ... +def patch(url: _Text, data: _Data = ..., json=..., **kwargs) -> Response: ... +def delete(url: _Text, **kwargs) -> Response: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/auth.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/auth.pyi new file mode 100644 index 0000000..48d4b08 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/auth.pyi @@ -0,0 +1,44 @@ +# Stubs for requests.auth (Python 3) + +from typing import Any, Text, Union +from . import compat +from . import cookies +from . import models +from . import utils +from . import status_codes + +extract_cookies_to_jar = cookies.extract_cookies_to_jar +parse_dict_header = utils.parse_dict_header +to_native_string = utils.to_native_string +codes = status_codes.codes + +CONTENT_TYPE_FORM_URLENCODED: Any +CONTENT_TYPE_MULTI_PART: Any + +def _basic_auth_str(username: Union[bytes, Text], password: Union[bytes, Text]) -> str: ... + +class AuthBase: + def __call__(self, r: models.PreparedRequest) -> models.PreparedRequest: ... + +class HTTPBasicAuth(AuthBase): + username: Any + password: Any + def __init__(self, username, password) -> None: ... + def __call__(self, r): ... + +class HTTPProxyAuth(HTTPBasicAuth): + def __call__(self, r): ... + +class HTTPDigestAuth(AuthBase): + username: Any + password: Any + last_nonce: Any + nonce_count: Any + chal: Any + pos: Any + num_401_calls: Any + def __init__(self, username, password) -> None: ... + def build_digest_header(self, method, url): ... + def handle_redirect(self, r, **kwargs): ... + def handle_401(self, r, **kwargs): ... + def __call__(self, r): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/compat.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/compat.pyi new file mode 100644 index 0000000..63b92f6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/compat.pyi @@ -0,0 +1,6 @@ +# Stubs for requests.compat (Python 3.4) + +from typing import Any +import collections + +OrderedDict = collections.OrderedDict diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/cookies.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/cookies.pyi new file mode 100644 index 0000000..1208dce --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/cookies.pyi @@ -0,0 +1,67 @@ +# Stubs for requests.cookies (Python 3) + +import sys +from typing import Any, MutableMapping +import collections +from . import compat + +if sys.version_info < (3, 0): + from cookielib import CookieJar +else: + from http.cookiejar import CookieJar + +class MockRequest: + type: Any + def __init__(self, request) -> None: ... + def get_type(self): ... + def get_host(self): ... + def get_origin_req_host(self): ... + def get_full_url(self): ... + def is_unverifiable(self): ... + def has_header(self, name): ... + def get_header(self, name, default=...): ... + def add_header(self, key, val): ... + def add_unredirected_header(self, name, value): ... + def get_new_headers(self): ... + @property + def unverifiable(self): ... + @property + def origin_req_host(self): ... + @property + def host(self): ... + +class MockResponse: + def __init__(self, headers) -> None: ... + def info(self): ... + def getheaders(self, name): ... + +def extract_cookies_to_jar(jar, request, response): ... +def get_cookie_header(jar, request): ... +def remove_cookie_by_name(cookiejar, name, domain=..., path=...): ... + +class CookieConflictError(RuntimeError): ... + +class RequestsCookieJar(CookieJar, MutableMapping): + def get(self, name, default=..., domain=..., path=...): ... + def set(self, name, value, **kwargs): ... + def iterkeys(self): ... + def keys(self): ... + def itervalues(self): ... + def values(self): ... + def iteritems(self): ... + def items(self): ... + def list_domains(self): ... + def list_paths(self): ... + def multiple_domains(self): ... + def get_dict(self, domain=..., path=...): ... + def __getitem__(self, name): ... + def __setitem__(self, name, value): ... + def __delitem__(self, name): ... + def set_cookie(self, cookie, *args, **kwargs): ... + def update(self, other): ... + def copy(self): ... + +def create_cookie(name, value, **kwargs): ... +def morsel_to_cookie(morsel): ... +def cookiejar_from_dict(cookie_dict, cookiejar=..., overwrite=...): ... +def merge_cookies(cookiejar, cookies): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/exceptions.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/exceptions.pyi new file mode 100644 index 0000000..3669692 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/exceptions.pyi @@ -0,0 +1,26 @@ +# Stubs for requests.exceptions (Python 3) + +from typing import Any +from .packages.urllib3.exceptions import HTTPError as BaseHTTPError + +class RequestException(IOError): + response: Any + request: Any + def __init__(self, *args, **kwargs) -> None: ... + +class HTTPError(RequestException): ... +class ConnectionError(RequestException): ... +class ProxyError(ConnectionError): ... +class SSLError(ConnectionError): ... +class Timeout(RequestException): ... +class ConnectTimeout(ConnectionError, Timeout): ... +class ReadTimeout(Timeout): ... +class URLRequired(RequestException): ... +class TooManyRedirects(RequestException): ... +class MissingSchema(RequestException, ValueError): ... +class InvalidSchema(RequestException, ValueError): ... +class InvalidURL(RequestException, ValueError): ... +class ChunkedEncodingError(RequestException): ... +class ContentDecodingError(RequestException, BaseHTTPError): ... +class StreamConsumedError(RequestException, TypeError): ... +class RetryError(RequestException): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/hooks.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/hooks.pyi new file mode 100644 index 0000000..278076a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/hooks.pyi @@ -0,0 +1,8 @@ +# Stubs for requests.hooks (Python 3) + +from typing import Any + +HOOKS: Any + +def default_hooks(): ... +def dispatch_hook(key, hooks, hook_data, **kwargs): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/models.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/models.pyi new file mode 100644 index 0000000..2bcea94 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/models.pyi @@ -0,0 +1,142 @@ +# Stubs for requests.models (Python 3) + +from typing import (Any, Dict, Iterator, List, MutableMapping, Optional, Text, + Union) +import datetime +import types + +from . import hooks +from . import structures +from . import auth +from . import cookies +from .cookies import RequestsCookieJar +from .packages.urllib3 import fields +from .packages.urllib3 import filepost +from .packages.urllib3 import util +from .packages.urllib3 import exceptions as urllib3_exceptions +from . import exceptions +from . import utils +from . import compat +from . import status_codes + + +default_hooks = hooks.default_hooks +CaseInsensitiveDict = structures.CaseInsensitiveDict +HTTPBasicAuth = auth.HTTPBasicAuth +cookiejar_from_dict = cookies.cookiejar_from_dict +get_cookie_header = cookies.get_cookie_header +RequestField = fields.RequestField +encode_multipart_formdata = filepost.encode_multipart_formdata +parse_url = util.parse_url +DecodeError = urllib3_exceptions.DecodeError +ReadTimeoutError = urllib3_exceptions.ReadTimeoutError +ProtocolError = urllib3_exceptions.ProtocolError +LocationParseError = urllib3_exceptions.LocationParseError +HTTPError = exceptions.HTTPError +MissingSchema = exceptions.MissingSchema +InvalidURL = exceptions.InvalidURL +ChunkedEncodingError = exceptions.ChunkedEncodingError +ContentDecodingError = exceptions.ContentDecodingError +ConnectionError = exceptions.ConnectionError +StreamConsumedError = exceptions.StreamConsumedError +guess_filename = utils.guess_filename +get_auth_from_url = utils.get_auth_from_url +requote_uri = utils.requote_uri +stream_decode_response_unicode = utils.stream_decode_response_unicode +to_key_val_list = utils.to_key_val_list +parse_header_links = utils.parse_header_links +iter_slices = utils.iter_slices +guess_json_utf = utils.guess_json_utf +super_len = utils.super_len +to_native_string = utils.to_native_string +codes = status_codes.codes + +REDIRECT_STATI: Any +DEFAULT_REDIRECT_LIMIT: Any +CONTENT_CHUNK_SIZE: Any +ITER_CHUNK_SIZE: Any +json_dumps: Any + +class RequestEncodingMixin: + @property + def path_url(self): ... + +class RequestHooksMixin: + def register_hook(self, event, hook): ... + def deregister_hook(self, event, hook): ... + +class Request(RequestHooksMixin): + hooks: Any + method: Any + url: Any + headers: Any + files: Any + data: Any + json: Any + params: Any + auth: Any + cookies: Any + def __init__(self, method=..., url=..., headers=..., files=..., data=..., params=..., + auth=..., cookies=..., hooks=..., json=...) -> None: ... + def prepare(self): ... + +class PreparedRequest(RequestEncodingMixin, RequestHooksMixin): + method: Optional[Union[str, Text]] + url: Optional[Union[str, Text]] + headers: CaseInsensitiveDict + body: Optional[Union[bytes, Text]] + hooks: Any + def __init__(self) -> None: ... + def prepare(self, method=..., url=..., headers=..., files=..., data=..., params=..., + auth=..., cookies=..., hooks=..., json=...): ... + def copy(self): ... + def prepare_method(self, method): ... + def prepare_url(self, url, params): ... + def prepare_headers(self, headers): ... + def prepare_body(self, data, files, json=...): ... + def prepare_content_length(self, body): ... + def prepare_auth(self, auth, url=...): ... + def prepare_cookies(self, cookies): ... + def prepare_hooks(self, hooks): ... + +class Response: + __attrs__: Any + status_code: int + headers: MutableMapping[str, str] + raw: Any + url: str + encoding: str + history: List[Response] + reason: str + cookies: RequestsCookieJar + elapsed: datetime.timedelta + request: PreparedRequest + def __init__(self) -> None: ... + def __bool__(self) -> bool: ... + def __nonzero__(self) -> bool: ... + def __iter__(self) -> Iterator[bytes]: ... + def __enter__(self) -> Response: ... + def __exit__(self, *args: Any) -> None: ... + @property + def ok(self) -> bool: ... + @property + def is_redirect(self) -> bool: ... + @property + def is_permanent_redirect(self) -> bool: ... + @property + def apparent_encoding(self) -> str: ... + def iter_content(self, chunk_size: Optional[int] = ..., + decode_unicode: bool = ...) -> Iterator[Any]: ... + def iter_lines(self, + chunk_size: Optional[int] = ..., + decode_unicode: bool = ..., + delimiter: Union[Text, bytes] = ...) -> Iterator[Any]: ... + @property + def content(self) -> bytes: ... + @property + def text(self) -> str: ... + def json(self, **kwargs) -> Any: ... + @property + def links(self) -> Dict[Any, Any]: ... + def raise_for_status(self) -> None: ... + def close(self) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/__init__.pyi new file mode 100644 index 0000000..b50dba3 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/__init__.pyi @@ -0,0 +1,4 @@ +class VendorAlias: + def __init__(self, package_names) -> None: ... + def find_module(self, fullname, path=...): ... + def load_module(self, name): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/__init__.pyi new file mode 100644 index 0000000..f575800 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/__init__.pyi @@ -0,0 +1,31 @@ +from typing import Any +from . import connectionpool +from . import filepost +from . import poolmanager +from . import response +from .util import request as _request +from .util import url +from .util import timeout +from .util import retry +import logging + +__license__: Any + +HTTPConnectionPool = connectionpool.HTTPConnectionPool +HTTPSConnectionPool = connectionpool.HTTPSConnectionPool +connection_from_url = connectionpool.connection_from_url +encode_multipart_formdata = filepost.encode_multipart_formdata +PoolManager = poolmanager.PoolManager +ProxyManager = poolmanager.ProxyManager +proxy_from_url = poolmanager.proxy_from_url +HTTPResponse = response.HTTPResponse +make_headers = _request.make_headers +get_host = url.get_host +Timeout = timeout.Timeout +Retry = retry.Retry + +class NullHandler(logging.Handler): + def emit(self, record): ... + +def add_stderr_logger(level=...): ... +def disable_warnings(category=...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/_collections.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/_collections.pyi new file mode 100644 index 0000000..64e3d22 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/_collections.pyi @@ -0,0 +1,47 @@ +from typing import Any +from collections import MutableMapping + +class RLock: + def __enter__(self): ... + def __exit__(self, exc_type, exc_value, traceback): ... + +class RecentlyUsedContainer(MutableMapping): + ContainerCls: Any + dispose_func: Any + lock: Any + def __init__(self, maxsize=..., dispose_func=...) -> None: ... + def __getitem__(self, key): ... + def __setitem__(self, key, value): ... + def __delitem__(self, key): ... + def __len__(self): ... + def __iter__(self): ... + def clear(self): ... + def keys(self): ... + +class HTTPHeaderDict(dict): + def __init__(self, headers=..., **kwargs) -> None: ... + def __setitem__(self, key, val): ... + def __getitem__(self, key): ... + def __delitem__(self, key): ... + def __contains__(self, key): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + values: Any + get: Any + update: Any + iterkeys: Any + itervalues: Any + def pop(self, key, default=...): ... + def discard(self, key): ... + def add(self, key, val): ... + def extend(self, *args, **kwargs): ... + def getlist(self, key): ... + getheaders: Any + getallmatchingheaders: Any + iget: Any + def copy(self): ... + def iteritems(self): ... + def itermerged(self): ... + def items(self): ... + @classmethod + def from_httplib(cls, message, duplicates=...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/connection.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/connection.pyi new file mode 100644 index 0000000..99af027 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/connection.pyi @@ -0,0 +1,71 @@ +# Stubs for requests.packages.urllib3.connection (Python 3.4) + +import sys +from typing import Any +from . import packages +import ssl +from . import exceptions +from .packages import ssl_match_hostname +from .util import ssl_ +from . import util + +if sys.version_info < (3, 0): + from httplib import HTTPConnection as _HTTPConnection + from httplib import HTTPException as HTTPException + + class ConnectionError(Exception): ... +else: + from http.client import HTTPConnection as _HTTPConnection + from http.client import HTTPException as HTTPException + from builtins import ConnectionError as ConnectionError + + +class DummyConnection: ... + +BaseSSLError = ssl.SSLError + +ConnectTimeoutError = exceptions.ConnectTimeoutError +SystemTimeWarning = exceptions.SystemTimeWarning +SecurityWarning = exceptions.SecurityWarning +match_hostname = ssl_match_hostname.match_hostname +resolve_cert_reqs = ssl_.resolve_cert_reqs +resolve_ssl_version = ssl_.resolve_ssl_version +ssl_wrap_socket = ssl_.ssl_wrap_socket +assert_fingerprint = ssl_.assert_fingerprint +connection = util.connection + +port_by_scheme: Any +RECENT_DATE: Any + +class HTTPConnection(_HTTPConnection): + default_port: Any + default_socket_options: Any + is_verified: Any + source_address: Any + socket_options: Any + def __init__(self, *args, **kw) -> None: ... + def connect(self): ... + +class HTTPSConnection(HTTPConnection): + default_port: Any + key_file: Any + cert_file: Any + def __init__(self, host, port=..., key_file=..., cert_file=..., strict=..., timeout=..., **kw) -> None: ... + sock: Any + def connect(self): ... + +class VerifiedHTTPSConnection(HTTPSConnection): + cert_reqs: Any + ca_certs: Any + ssl_version: Any + assert_fingerprint: Any + key_file: Any + cert_file: Any + assert_hostname: Any + def set_cert(self, key_file=..., cert_file=..., cert_reqs=..., ca_certs=..., assert_hostname=..., assert_fingerprint=...): ... + sock: Any + auto_open: Any + is_verified: Any + def connect(self): ... + +UnverifiedHTTPSConnection = HTTPSConnection diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/connectionpool.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/connectionpool.pyi new file mode 100644 index 0000000..a4e8ac1 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/connectionpool.pyi @@ -0,0 +1,85 @@ +from typing import Any +from . import exceptions +from .packages import ssl_match_hostname +from . import packages +from .connection import ( + HTTPException as HTTPException, + BaseSSLError as BaseSSLError, + ConnectionError as ConnectionError, +) +from . import request +from . import response +from . import connection +from .util import connection as _connection +from .util import retry +from .util import timeout +from .util import url + +ClosedPoolError = exceptions.ClosedPoolError +ProtocolError = exceptions.ProtocolError +EmptyPoolError = exceptions.EmptyPoolError +HostChangedError = exceptions.HostChangedError +LocationValueError = exceptions.LocationValueError +MaxRetryError = exceptions.MaxRetryError +ProxyError = exceptions.ProxyError +ReadTimeoutError = exceptions.ReadTimeoutError +SSLError = exceptions.SSLError +TimeoutError = exceptions.TimeoutError +InsecureRequestWarning = exceptions.InsecureRequestWarning +CertificateError = ssl_match_hostname.CertificateError +port_by_scheme = connection.port_by_scheme +DummyConnection = connection.DummyConnection +HTTPConnection = connection.HTTPConnection +HTTPSConnection = connection.HTTPSConnection +VerifiedHTTPSConnection = connection.VerifiedHTTPSConnection +RequestMethods = request.RequestMethods +HTTPResponse = response.HTTPResponse +is_connection_dropped = _connection.is_connection_dropped +Retry = retry.Retry +Timeout = timeout.Timeout +get_host = url.get_host + +xrange: Any +log: Any + +class ConnectionPool: + scheme: Any + QueueCls: Any + host: Any + port: Any + def __init__(self, host, port=...) -> None: ... + def __enter__(self): ... + def __exit__(self, exc_type, exc_val, exc_tb): ... + def close(self): ... + +class HTTPConnectionPool(ConnectionPool, RequestMethods): + scheme: Any + ConnectionCls: Any + strict: Any + timeout: Any + retries: Any + pool: Any + block: Any + proxy: Any + proxy_headers: Any + num_connections: Any + num_requests: Any + conn_kw: Any + def __init__(self, host, port=..., strict=..., timeout=..., maxsize=..., block=..., headers=..., retries=..., _proxy=..., _proxy_headers=..., **conn_kw) -> None: ... + def close(self): ... + def is_same_host(self, url): ... + def urlopen(self, method, url, body=..., headers=..., retries=..., redirect=..., assert_same_host=..., timeout=..., pool_timeout=..., release_conn=..., **response_kw): ... + +class HTTPSConnectionPool(HTTPConnectionPool): + scheme: Any + ConnectionCls: Any + key_file: Any + cert_file: Any + cert_reqs: Any + ca_certs: Any + ssl_version: Any + assert_hostname: Any + assert_fingerprint: Any + def __init__(self, host, port=..., strict=..., timeout=..., maxsize=..., block=..., headers=..., retries=..., _proxy=..., _proxy_headers=..., key_file=..., cert_file=..., cert_reqs=..., ca_certs=..., ssl_version=..., assert_hostname=..., assert_fingerprint=..., **conn_kw) -> None: ... + +def connection_from_url(url, **kw): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/contrib/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/contrib/__init__.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/exceptions.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/exceptions.pyi new file mode 100644 index 0000000..ddb4e83 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/exceptions.pyi @@ -0,0 +1,50 @@ +from typing import Any + +class HTTPError(Exception): ... +class HTTPWarning(Warning): ... + +class PoolError(HTTPError): + pool: Any + def __init__(self, pool, message) -> None: ... + def __reduce__(self): ... + +class RequestError(PoolError): + url: Any + def __init__(self, pool, url, message) -> None: ... + def __reduce__(self): ... + +class SSLError(HTTPError): ... +class ProxyError(HTTPError): ... +class DecodeError(HTTPError): ... +class ProtocolError(HTTPError): ... + +ConnectionError: Any + +class MaxRetryError(RequestError): + reason: Any + def __init__(self, pool, url, reason=...) -> None: ... + +class HostChangedError(RequestError): + retries: Any + def __init__(self, pool, url, retries=...) -> None: ... + +class TimeoutStateError(HTTPError): ... +class TimeoutError(HTTPError): ... +class ReadTimeoutError(TimeoutError, RequestError): ... +class ConnectTimeoutError(TimeoutError): ... +class EmptyPoolError(PoolError): ... +class ClosedPoolError(PoolError): ... +class LocationValueError(ValueError, HTTPError): ... + +class LocationParseError(LocationValueError): + location: Any + def __init__(self, location) -> None: ... + +class ResponseError(HTTPError): + GENERIC_ERROR: Any + SPECIFIC_ERROR: Any + +class SecurityWarning(HTTPWarning): ... +class InsecureRequestWarning(SecurityWarning): ... +class SystemTimeWarning(SecurityWarning): ... +class InsecurePlatformWarning(SecurityWarning): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/fields.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/fields.pyi new file mode 100644 index 0000000..9d691dc --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/fields.pyi @@ -0,0 +1,16 @@ +# Stubs for requests.packages.urllib3.fields (Python 3.4) + +from typing import Any +from . import packages + +def guess_content_type(filename, default=...): ... +def format_header_param(name, value): ... + +class RequestField: + data: Any + headers: Any + def __init__(self, name, data, filename=..., headers=...) -> None: ... + @classmethod + def from_tuples(cls, fieldname, value): ... + def render_headers(self): ... + def make_multipart(self, content_disposition=..., content_type=..., content_location=...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/filepost.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/filepost.pyi new file mode 100644 index 0000000..afcc837 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/filepost.pyi @@ -0,0 +1,15 @@ +from typing import Any +from . import packages +# from .packages import six +from . import fields + +# six = packages.six +# b = six.b +RequestField = fields.RequestField + +writer: Any + +def choose_boundary(): ... +def iter_field_objects(fields): ... +def iter_fields(fields): ... +def encode_multipart_formdata(fields, boundary=...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/packages/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/packages/__init__.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/packages/ssl_match_hostname/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/packages/ssl_match_hostname/__init__.pyi new file mode 100644 index 0000000..1915c0e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/packages/ssl_match_hostname/__init__.pyi @@ -0,0 +1,4 @@ +import ssl + +CertificateError = ssl.CertificateError +match_hostname = ssl.match_hostname diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.pyi new file mode 100644 index 0000000..c219980 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.pyi @@ -0,0 +1,3 @@ +class CertificateError(ValueError): ... + +def match_hostname(cert, hostname): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/poolmanager.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/poolmanager.pyi new file mode 100644 index 0000000..9568488 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/poolmanager.pyi @@ -0,0 +1,27 @@ +from typing import Any +from .request import RequestMethods + +class PoolManager(RequestMethods): + proxy: Any + connection_pool_kw: Any + pools: Any + def __init__(self, num_pools=..., headers=..., **connection_pool_kw) -> None: ... + def __enter__(self): ... + def __exit__(self, exc_type, exc_val, exc_tb): ... + def clear(self): ... + def connection_from_host(self, host, port=..., scheme=...): ... + def connection_from_url(self, url): ... + # TODO: This was the original signature -- copied another one from base class to fix complaint. + # def urlopen(self, method, url, redirect=True, **kw): ... + def urlopen(self, method, url, body=..., headers=..., encode_multipart=..., multipart_boundary=..., **kw): ... + +class ProxyManager(PoolManager): + proxy: Any + proxy_headers: Any + def __init__(self, proxy_url, num_pools=..., headers=..., proxy_headers=..., **connection_pool_kw) -> None: ... + def connection_from_host(self, host, port=..., scheme=...): ... + # TODO: This was the original signature -- copied another one from base class to fix complaint. + # def urlopen(self, method, url, redirect=True, **kw): ... + def urlopen(self, method, url, body=..., headers=..., encode_multipart=..., multipart_boundary=..., **kw): ... + +def proxy_from_url(url, **kw): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/request.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/request.pyi new file mode 100644 index 0000000..fd79126 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/request.pyi @@ -0,0 +1,9 @@ +from typing import Any + +class RequestMethods: + headers: Any + def __init__(self, headers=...) -> None: ... + def urlopen(self, method, url, body=..., headers=..., encode_multipart=..., multipart_boundary=..., **kw): ... + def request(self, method, url, fields=..., headers=..., **urlopen_kw): ... + def request_encode_url(self, method, url, fields=..., **urlopen_kw): ... + def request_encode_body(self, method, url, fields=..., headers=..., encode_multipart=..., multipart_boundary=..., **urlopen_kw): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/response.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/response.pyi new file mode 100644 index 0000000..de0aa33 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/response.pyi @@ -0,0 +1,53 @@ +from typing import Any +import io +from . import _collections +from . import exceptions +from .connection import HTTPException as HTTPException, BaseSSLError as BaseSSLError +from .util import response + +HTTPHeaderDict = _collections.HTTPHeaderDict +ProtocolError = exceptions.ProtocolError +DecodeError = exceptions.DecodeError +ReadTimeoutError = exceptions.ReadTimeoutError +binary_type = bytes # six.binary_type +PY3 = True # six.PY3 +is_fp_closed = response.is_fp_closed + +class DeflateDecoder: + def __init__(self) -> None: ... + def __getattr__(self, name): ... + def decompress(self, data): ... + +class GzipDecoder: + def __init__(self) -> None: ... + def __getattr__(self, name): ... + def decompress(self, data): ... + +class HTTPResponse(io.IOBase): + CONTENT_DECODERS: Any + REDIRECT_STATUSES: Any + headers: Any + status: Any + version: Any + reason: Any + strict: Any + decode_content: Any + def __init__(self, body=..., headers=..., status=..., version=..., reason=..., strict=..., preload_content=..., decode_content=..., original_response=..., pool=..., connection=...) -> None: ... + def get_redirect_location(self): ... + def release_conn(self): ... + @property + def data(self): ... + def tell(self): ... + def read(self, amt=..., decode_content=..., cache_content=...): ... + def stream(self, amt=..., decode_content=...): ... + @classmethod + def from_httplib(cls, r, **response_kw): ... + def getheaders(self): ... + def getheader(self, name, default=...): ... + def close(self): ... + @property + def closed(self): ... + def fileno(self): ... + def flush(self): ... + def readable(self): ... + def readinto(self, b): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/__init__.pyi new file mode 100644 index 0000000..53bdac9 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/__init__.pyi @@ -0,0 +1,25 @@ +from . import connection +from . import request +from . import response +from . import ssl_ +from . import timeout +from . import retry +from . import url +import ssl + +is_connection_dropped = connection.is_connection_dropped +make_headers = request.make_headers +is_fp_closed = response.is_fp_closed +SSLContext = ssl.SSLContext +HAS_SNI = ssl_.HAS_SNI +assert_fingerprint = ssl_.assert_fingerprint +resolve_cert_reqs = ssl_.resolve_cert_reqs +resolve_ssl_version = ssl_.resolve_ssl_version +ssl_wrap_socket = ssl_.ssl_wrap_socket +current_time = timeout.current_time +Timeout = timeout.Timeout +Retry = retry.Retry +get_host = url.get_host +parse_url = url.parse_url +split_first = url.split_first +Url = url.Url diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/connection.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/connection.pyi new file mode 100644 index 0000000..db77bd0 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/connection.pyi @@ -0,0 +1,8 @@ +from typing import Any + +poll: Any +select: Any +HAS_IPV6: bool + +def is_connection_dropped(conn): ... +def create_connection(address, timeout=..., source_address=..., socket_options=...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/request.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/request.pyi new file mode 100644 index 0000000..a7e112f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/request.pyi @@ -0,0 +1,8 @@ +from typing import Any +# from ..packages import six + +# b = six.b + +ACCEPT_ENCODING: Any + +def make_headers(keep_alive=..., accept_encoding=..., user_agent=..., basic_auth=..., proxy_basic_auth=..., disable_cache=...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/response.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/response.pyi new file mode 100644 index 0000000..30463da --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/response.pyi @@ -0,0 +1 @@ +def is_fp_closed(obj): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/retry.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/retry.pyi new file mode 100644 index 0000000..c7c2178 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/retry.pyi @@ -0,0 +1,32 @@ +from typing import Any +from .. import exceptions +from .. import packages + +ConnectTimeoutError = exceptions.ConnectTimeoutError +MaxRetryError = exceptions.MaxRetryError +ProtocolError = exceptions.ProtocolError +ReadTimeoutError = exceptions.ReadTimeoutError +ResponseError = exceptions.ResponseError + +log: Any + +class Retry: + DEFAULT_METHOD_WHITELIST: Any + BACKOFF_MAX: Any + total: Any + connect: Any + read: Any + redirect: Any + status_forcelist: Any + method_whitelist: Any + backoff_factor: Any + raise_on_redirect: Any + def __init__(self, total=..., connect=..., read=..., redirect=..., method_whitelist=..., status_forcelist=..., backoff_factor=..., raise_on_redirect=..., _observed_errors=...) -> None: ... + def new(self, **kw): ... + @classmethod + def from_int(cls, retries, redirect=..., default=...): ... + def get_backoff_time(self): ... + def sleep(self): ... + def is_forced_retry(self, method, status_code): ... + def is_exhausted(self): ... + def increment(self, method=..., url=..., response=..., error=..., _pool=..., _stacktrace=...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/ssl_.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/ssl_.pyi new file mode 100644 index 0000000..fe1a3a0 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/ssl_.pyi @@ -0,0 +1,20 @@ +from typing import Any +from .. import exceptions +import ssl + +SSLError = exceptions.SSLError +InsecurePlatformWarning = exceptions.InsecurePlatformWarning +SSLContext = ssl.SSLContext + +HAS_SNI: Any +create_default_context: Any +OP_NO_SSLv2: Any +OP_NO_SSLv3: Any +OP_NO_COMPRESSION: Any + +def assert_fingerprint(cert, fingerprint): ... +def resolve_cert_reqs(candidate): ... +def resolve_ssl_version(candidate): ... +def create_urllib3_context(ssl_version=..., cert_reqs=..., options=..., ciphers=...): ... +def ssl_wrap_socket(sock, keyfile=..., certfile=..., cert_reqs=..., ca_certs=..., + server_hostname=..., ssl_version=..., ciphers=..., ssl_context=...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/timeout.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/timeout.pyi new file mode 100644 index 0000000..0f3c97c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/timeout.pyi @@ -0,0 +1,20 @@ +from typing import Any +from .. import exceptions + +TimeoutStateError = exceptions.TimeoutStateError + +def current_time(): ... + +class Timeout: + DEFAULT_TIMEOUT: Any + total: Any + def __init__(self, total=..., connect=..., read=...) -> None: ... + @classmethod + def from_float(cls, timeout): ... + def clone(self): ... + def start_connect(self): ... + def get_connect_duration(self): ... + @property + def connect_timeout(self): ... + @property + def read_timeout(self): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/url.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/url.pyi new file mode 100644 index 0000000..0e40ba5 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/url.pyi @@ -0,0 +1,22 @@ +from typing import Any +from .. import exceptions + +LocationParseError = exceptions.LocationParseError + +url_attrs: Any + +class Url: + slots: Any + def __new__(cls, scheme=..., auth=..., host=..., port=..., path=..., query=..., fragment=...): ... + @property + def hostname(self): ... + @property + def request_uri(self): ... + @property + def netloc(self): ... + @property + def url(self): ... + +def split_first(s, delims): ... +def parse_url(url): ... +def get_host(url): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/sessions.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/sessions.pyi new file mode 100644 index 0000000..33c7b79 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/sessions.pyi @@ -0,0 +1,113 @@ +# Stubs for requests.sessions (Python 3) + +from typing import Any, Union, List, MutableMapping, Text, Optional, IO, Tuple, Callable, Iterable +from . import adapters +from . import auth as _auth +from . import compat +from . import cookies +from . import models +from .models import Response +from . import hooks +from . import utils +from . import exceptions +from .packages.urllib3 import _collections +from . import structures +from . import status_codes + +BaseAdapter = adapters.BaseAdapter +OrderedDict = compat.OrderedDict +cookiejar_from_dict = cookies.cookiejar_from_dict +extract_cookies_to_jar = cookies.extract_cookies_to_jar +RequestsCookieJar = cookies.RequestsCookieJar +merge_cookies = cookies.merge_cookies +Request = models.Request +PreparedRequest = models.PreparedRequest +DEFAULT_REDIRECT_LIMIT = models.DEFAULT_REDIRECT_LIMIT +default_hooks = hooks.default_hooks +dispatch_hook = hooks.dispatch_hook +to_key_val_list = utils.to_key_val_list +default_headers = utils.default_headers +to_native_string = utils.to_native_string +TooManyRedirects = exceptions.TooManyRedirects +InvalidSchema = exceptions.InvalidSchema +ChunkedEncodingError = exceptions.ChunkedEncodingError +ContentDecodingError = exceptions.ContentDecodingError +RecentlyUsedContainer = _collections.RecentlyUsedContainer +CaseInsensitiveDict = structures.CaseInsensitiveDict +HTTPAdapter = adapters.HTTPAdapter +requote_uri = utils.requote_uri +get_environ_proxies = utils.get_environ_proxies +get_netrc_auth = utils.get_netrc_auth +should_bypass_proxies = utils.should_bypass_proxies +get_auth_from_url = utils.get_auth_from_url +codes = status_codes.codes +REDIRECT_STATI = models.REDIRECT_STATI + +REDIRECT_CACHE_SIZE: Any + +def merge_setting(request_setting, session_setting, dict_class=...): ... +def merge_hooks(request_hooks, session_hooks, dict_class=...): ... + +class SessionRedirectMixin: + def resolve_redirects(self, resp, req, stream=..., timeout=..., verify=..., cert=..., + proxies=...): ... + def rebuild_auth(self, prepared_request, response): ... + def rebuild_proxies(self, prepared_request, proxies): ... + +_Data = Union[None, bytes, MutableMapping[Text, Text], IO] + +_Hook = Callable[[Response], Any] +_Hooks = MutableMapping[Text, List[_Hook]] +_HooksInput = MutableMapping[Text, Union[Iterable[_Hook], _Hook]] + +class Session(SessionRedirectMixin): + __attrs__: Any + headers: MutableMapping[Text, Text] + auth: Union[None, Tuple[Text, Text], _auth.AuthBase, Callable[[Request], Request]] + proxies: MutableMapping[Text, Text] + hooks: _Hooks + params: Union[bytes, MutableMapping[Text, Text]] + stream: bool + verify: Union[None, bool, Text] + cert: Union[None, Text, Tuple[Text, Text]] + max_redirects: int + trust_env: bool + cookies: RequestsCookieJar + adapters: MutableMapping + redirect_cache: RecentlyUsedContainer + def __init__(self) -> None: ... + def __enter__(self) -> Session: ... + def __exit__(self, *args) -> None: ... + def prepare_request(self, request): ... + def request(self, method: str, url: str, + params: Union[None, bytes, MutableMapping[Text, Text]] = ..., + data: _Data = ..., + headers: Optional[MutableMapping[Text, Text]] = ..., + cookies: Union[None, RequestsCookieJar, MutableMapping[Text, Text]] = ..., + files: Optional[MutableMapping[Text, IO]] = ..., + auth: Union[None, Tuple[Text, Text], _auth.AuthBase, Callable[[Request], Request]] = ..., + timeout: Union[None, float, Tuple[float, float]] = ..., + allow_redirects: Optional[bool] = ..., + proxies: Optional[MutableMapping[Text, Text]] = ..., + hooks: Optional[_HooksInput] = ..., + stream: Optional[bool] = ..., + verify: Union[None, bool, Text] = ..., + cert: Union[Text, Tuple[Text, Text], None] = ..., + json: Optional[Any] = ..., + ) -> Response: ... + def get(self, url: Union[Text, bytes], **kwargs) -> Response: ... + def options(self, url: Union[Text, bytes], **kwargs) -> Response: ... + def head(self, url: Union[Text, bytes], **kwargs) -> Response: ... + def post(self, url: Union[Text, bytes], data: _Data = ..., json: Optional[Any] = ..., **kwargs) -> Response: ... + def put(self, url: Union[Text, bytes], data: _Data = ..., **kwargs) -> Response: ... + def patch(self, url: Union[Text, bytes], data: _Data = ..., **kwargs) -> Response: ... + def delete(self, url: Union[Text, bytes], **kwargs) -> Response: ... + def send(self, request, **kwargs): ... + def merge_environment_settings(self, url, proxies, stream, verify, cert): ... + def get_adapter(self, url): ... + def close(self) -> None: ... + def mount(self, prefix: + Union[Text, bytes], + adapter: BaseAdapter) -> None: ... + +def session() -> Session: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/status_codes.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/status_codes.pyi new file mode 100644 index 0000000..f9bf820 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/status_codes.pyi @@ -0,0 +1,4 @@ +from typing import Any +from .structures import LookupDict + +codes: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/structures.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/structures.pyi new file mode 100644 index 0000000..92cf27a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/structures.pyi @@ -0,0 +1,19 @@ +from typing import Any, Dict, Iterable, Iterator, Mapping, MutableMapping, Optional, Tuple, TypeVar, Union, Generic + +_VT = TypeVar('_VT') + +class CaseInsensitiveDict(MutableMapping[str, _VT], Generic[_VT]): + def __init__(self, data: Optional[Union[Mapping[str, _VT], Iterable[Tuple[str, _VT]]]] = ..., **kwargs: _VT) -> None: ... + def lower_items(self) -> Iterator[Tuple[str, _VT]]: ... + def __setitem__(self, key: str, value: _VT) -> None: ... + def __getitem__(self, key: str) -> _VT: ... + def __delitem__(self, key: str) -> None: ... + def __iter__(self) -> Iterator[str]: ... + def __len__(self) -> int: ... + +class LookupDict(Dict[str, _VT]): + name: Any + def __init__(self, name: Any = ...) -> None: ... + def __getitem__(self, key: str) -> Optional[_VT]: ... # type: ignore + def __getattr__(self, attr: str) -> _VT: ... + def __setattr__(self, attr: str, value: _VT) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/utils.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/utils.pyi new file mode 100644 index 0000000..396a374 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/requests/utils.pyi @@ -0,0 +1,53 @@ +# Stubs for requests.utils (Python 3) + +from typing import Any +from . import compat +from . import cookies +from . import structures +from . import exceptions + +OrderedDict = compat.OrderedDict +RequestsCookieJar = cookies.RequestsCookieJar +cookiejar_from_dict = cookies.cookiejar_from_dict +CaseInsensitiveDict = structures.CaseInsensitiveDict +InvalidURL = exceptions.InvalidURL + +NETRC_FILES: Any +DEFAULT_CA_BUNDLE_PATH: Any + +def dict_to_sequence(d): ... +def super_len(o): ... +def get_netrc_auth(url): ... +def guess_filename(obj): ... +def from_key_val_list(value): ... +def to_key_val_list(value): ... +def parse_list_header(value): ... +def parse_dict_header(value): ... +def unquote_header_value(value, is_filename=...): ... +def dict_from_cookiejar(cj): ... +def add_dict_to_cookiejar(cj, cookie_dict): ... +def get_encodings_from_content(content): ... +def get_encoding_from_headers(headers): ... +def stream_decode_response_unicode(iterator, r): ... +def iter_slices(string, slice_length): ... +def get_unicode_from_response(r): ... + +UNRESERVED_SET: Any + +def unquote_unreserved(uri): ... +def requote_uri(uri): ... +def address_in_network(ip, net): ... +def dotted_netmask(mask): ... +def is_ipv4_address(string_ip): ... +def is_valid_cidr(string_network): ... +def set_environ(env_name, value): ... +def should_bypass_proxies(url): ... +def get_environ_proxies(url): ... +def default_user_agent(name=...): ... +def default_headers(): ... +def parse_header_links(value): ... +def guess_json_utf(data): ... +def prepend_scheme_if_needed(url, new_scheme): ... +def get_auth_from_url(url): ... +def to_native_string(string, encoding=...): ... +def urldefragauth(url): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/simplejson/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/simplejson/__init__.pyi new file mode 100644 index 0000000..6221b4e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/simplejson/__init__.pyi @@ -0,0 +1,13 @@ +from typing import Any, IO, Text, Union + +from simplejson.scanner import JSONDecodeError as JSONDecodeError +from simplejson.decoder import JSONDecoder as JSONDecoder +from simplejson.encoder import JSONEncoder as JSONEncoder, JSONEncoderForHTML as JSONEncoderForHTML + +_LoadsString = Union[Text, bytes, bytearray] + + +def dumps(obj: Any, *args: Any, **kwds: Any) -> str: ... +def dump(obj: Any, fp: IO[str], *args: Any, **kwds: Any) -> None: ... +def loads(s: _LoadsString, **kwds: Any) -> Any: ... +def load(fp: IO[str], **kwds: Any) -> Any: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/simplejson/decoder.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/simplejson/decoder.pyi new file mode 100644 index 0000000..59111ce --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/simplejson/decoder.pyi @@ -0,0 +1,6 @@ +from typing import Any, Match + +class JSONDecoder(object): + def __init__(self, **kwargs): ... + def decode(self, s: str, _w: Match[str], _PY3: bool): ... + def raw_decode(self, s: str, idx: int, _w: Match[str], _PY3: bool): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/simplejson/encoder.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/simplejson/encoder.pyi new file mode 100644 index 0000000..0e31806 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/simplejson/encoder.pyi @@ -0,0 +1,9 @@ +from typing import Any, IO + +class JSONEncoder(object): + def __init__(self, *args, **kwargs): ... + def encode(self, o: Any): ... + def default(self, o: Any): ... + def iterencode(self, o: Any, _one_shot: bool): ... + +class JSONEncoderForHTML(JSONEncoder): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/simplejson/scanner.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/simplejson/scanner.pyi new file mode 100644 index 0000000..5de484a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/simplejson/scanner.pyi @@ -0,0 +1,11 @@ +from typing import Optional + +class JSONDecodeError(ValueError): + msg: str = ... + doc: str = ... + pos: int = ... + end: Optional[int] = ... + lineno: int = ... + colno: int = ... + endlineno: Optional[int] = ... + endcolno: Optional[int] = ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/singledispatch.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/singledispatch.pyi new file mode 100644 index 0000000..e89ac12 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/singledispatch.pyi @@ -0,0 +1,17 @@ +from typing import Any, Callable, Generic, Mapping, Optional, TypeVar, overload + + +_T = TypeVar("_T") + + +class _SingleDispatchCallable(Generic[_T]): + registry: Mapping[Any, Callable[..., _T]] + def dispatch(self, cls: Any) -> Callable[..., _T]: ... + @overload + def register(self, cls: Any) -> Callable[[Callable[..., _T]], Callable[..., _T]]: ... + @overload + def register(self, cls: Any, func: Callable[..., _T]) -> Callable[..., _T]: ... + def _clear_cache(self) -> None: ... + def __call__(self, *args: Any, **kwargs: Any) -> _T: ... + +def singledispatch(func: Callable[..., _T]) -> _SingleDispatchCallable[_T]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/tabulate.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/tabulate.pyi new file mode 100644 index 0000000..a360515 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/tabulate.pyi @@ -0,0 +1,18 @@ +# Stub for tabulate: https://bitbucket.org/astanin/python-tabulate +from typing import Any, Dict, Iterable, Sequence, Union + + +def __getattr__(name: str) -> Any: ... + +def tabulate( + tabular_data: Iterable[Iterable[Any]], + headers: Union[str, Dict[str, str], Sequence[str]] = ..., + tablefmt: str = ..., + floatfmt: str = ..., + numalign: str = ..., + stralign: str = ..., + missingval: str = ..., + showindex: str = ..., + disable_numparse: bool = ... +) -> str: + ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/termcolor.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/termcolor.pyi new file mode 100644 index 0000000..e1ad18b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/termcolor.pyi @@ -0,0 +1,21 @@ +# Stub for termcolor: https://pypi.python.org/pypi/termcolor +from typing import Any, Iterable, Optional, Text + + +def colored( + text: Text, + color: Optional[Text] = ..., + on_color: Optional[Text] = ..., + attrs: Optional[Iterable[Text]] = ..., +) -> Text: + ... + + +def cprint( + text: Text, + color: Optional[Text] = ..., + on_color: Optional[Text] = ..., + attrs: Optional[Iterable[Text]] = ..., + **kwargs: Any, +) -> None: + ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/toml.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/toml.pyi new file mode 100644 index 0000000..2639178 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/toml.pyi @@ -0,0 +1,24 @@ +from typing import Any, IO, List, Mapping, MutableMapping, Optional, Protocol, Text, Type, Union +import datetime +import sys + +if sys.version_info >= (3, 4): + import pathlib + if sys.version_info >= (3, 6): + import os + _PathLike = Union[Text, pathlib.PurePath, os.PathLike] + else: + _PathLike = Union[Text, pathlib.PurePath] +else: + _PathLike = Text + +class _Writable(Protocol): + def write(self, obj: str) -> Any: ... + +class TomlDecodeError(Exception): ... + +def load(f: Union[_PathLike, List[Text], IO[str]], _dict: Type[MutableMapping[str, Any]] = ...) -> MutableMapping[str, Any]: ... +def loads(s: Text, _dict: Type[MutableMapping[str, Any]] = ...) -> MutableMapping[str, Any]: ... + +def dump(o: Mapping[str, Any], f: _Writable) -> str: ... +def dumps(o: Mapping[str, Any]) -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/typing_extensions.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/typing_extensions.pyi new file mode 100644 index 0000000..fdc9d87 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/typing_extensions.pyi @@ -0,0 +1,58 @@ +import abc +import sys +from typing import Callable +from typing import ClassVar as ClassVar +from typing import ContextManager as ContextManager +from typing import Counter as Counter +from typing import DefaultDict as DefaultDict +from typing import Deque as Deque +from typing import NewType as NewType +from typing import NoReturn as NoReturn +from typing import overload as overload +from typing import Text as Text +from typing import Type as Type +from typing import TYPE_CHECKING as TYPE_CHECKING +from typing import TypeVar, Any, Mapping, ItemsView, KeysView, ValuesView, Dict, Type + +_T = TypeVar('_T') +_F = TypeVar('_F', bound=Callable[..., Any]) +_TC = TypeVar('_TC', bound=Type[object]) +class _SpecialForm: + def __getitem__(self, typeargs: Any) -> Any: ... +def runtime(cls: _TC) -> _TC: ... +Protocol: _SpecialForm = ... +Final: _SpecialForm = ... +def final(f: _F) -> _F: ... +Literal: _SpecialForm = ... + +# Internal mypy fallback type for all typed dicts (does not exist at runtime) +class _TypedDict(Mapping[str, object], metaclass=abc.ABCMeta): + def copy(self: _T) -> _T: ... + # Using NoReturn so that only calls using mypy plugin hook that specialize the signature + # can go through. + def setdefault(self, k: NoReturn, default: object) -> object: ... + # Mypy plugin hook for 'pop' expects that 'default' has a type variable type. + def pop(self, k: NoReturn, default: _T = ...) -> object: ... + def update(self: _T, __m: _T) -> None: ... + if sys.version_info < (3, 0): + def has_key(self, k: str) -> bool: ... + def viewitems(self) -> ItemsView[str, object]: ... + def viewkeys(self) -> KeysView[str]: ... + def viewvalues(self) -> ValuesView[object]: ... + def __delitem__(self, k: NoReturn) -> None: ... + +# TypedDict is a (non-subscriptable) special form. +TypedDict: object = ... + +if sys.version_info >= (3, 3): + from typing import ChainMap as ChainMap + +if sys.version_info >= (3, 5): + from typing import AsyncIterable as AsyncIterable + from typing import AsyncIterator as AsyncIterator + from typing import AsyncContextManager as AsyncContextManager + from typing import Awaitable as Awaitable + from typing import Coroutine as Coroutine + +if sys.version_info >= (3, 6): + from typing import AsyncGenerator as AsyncGenerator diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/ujson.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/ujson.pyi new file mode 100644 index 0000000..7e00659 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/ujson.pyi @@ -0,0 +1,51 @@ +# Stubs for ujson +# See: https://pypi.python.org/pypi/ujson +from typing import Any, AnyStr, IO, Optional + +__version__: str + +def encode( + obj: Any, + ensure_ascii: bool = ..., + double_precision: int = ..., + encode_html_chars: bool = ..., + escape_forward_slashes: bool = ..., + sort_keys: bool = ..., + indent: int = ..., +) -> str: ... + +def dumps( + obj: Any, + ensure_ascii: bool = ..., + double_precision: int = ..., + encode_html_chars: bool = ..., + escape_forward_slashes: bool = ..., + sort_keys: bool = ..., + indent: int = ..., +) -> str: ... + +def dump( + obj: Any, + fp: IO[str], + ensure_ascii: bool = ..., + double_precision: int = ..., + encode_html_chars: bool = ..., + escape_forward_slashes: bool = ..., + sort_keys: bool = ..., + indent: int = ..., +) -> None: ... + +def decode( + s: AnyStr, + precise_float: bool = ..., +) -> Any: ... + +def loads( + s: AnyStr, + precise_float: bool = ..., +) -> Any: ... + +def load( + fp: IO[AnyStr], + precise_float: bool = ..., +) -> Any: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/__init__.pyi new file mode 100644 index 0000000..2de398a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/__init__.pyi @@ -0,0 +1,150 @@ +from types import ModuleType +from typing import Any + +from werkzeug import _internal +from werkzeug import datastructures +from werkzeug import debug +from werkzeug import exceptions +from werkzeug import formparser +from werkzeug import http +from werkzeug import local +from werkzeug import security +from werkzeug import serving +from werkzeug import test +from werkzeug import testapp +from werkzeug import urls +from werkzeug import useragents +from werkzeug import utils +from werkzeug import wrappers +from werkzeug import wsgi + +class module(ModuleType): + def __getattr__(self, name): ... + def __dir__(self): ... + + +__version__: Any + +run_simple = serving.run_simple +test_app = testapp.test_app +UserAgent = useragents.UserAgent +_easteregg = _internal._easteregg +DebuggedApplication = debug.DebuggedApplication +MultiDict = datastructures.MultiDict +CombinedMultiDict = datastructures.CombinedMultiDict +Headers = datastructures.Headers +EnvironHeaders = datastructures.EnvironHeaders +ImmutableList = datastructures.ImmutableList +ImmutableDict = datastructures.ImmutableDict +ImmutableMultiDict = datastructures.ImmutableMultiDict +TypeConversionDict = datastructures.TypeConversionDict +ImmutableTypeConversionDict = datastructures.ImmutableTypeConversionDict +Accept = datastructures.Accept +MIMEAccept = datastructures.MIMEAccept +CharsetAccept = datastructures.CharsetAccept +LanguageAccept = datastructures.LanguageAccept +RequestCacheControl = datastructures.RequestCacheControl +ResponseCacheControl = datastructures.ResponseCacheControl +ETags = datastructures.ETags +HeaderSet = datastructures.HeaderSet +WWWAuthenticate = datastructures.WWWAuthenticate +Authorization = datastructures.Authorization +FileMultiDict = datastructures.FileMultiDict +CallbackDict = datastructures.CallbackDict +FileStorage = datastructures.FileStorage +OrderedMultiDict = datastructures.OrderedMultiDict +ImmutableOrderedMultiDict = datastructures.ImmutableOrderedMultiDict +escape = utils.escape +environ_property = utils.environ_property +append_slash_redirect = utils.append_slash_redirect +redirect = utils.redirect +cached_property = utils.cached_property +import_string = utils.import_string +dump_cookie = http.dump_cookie +parse_cookie = http.parse_cookie +unescape = utils.unescape +format_string = utils.format_string +find_modules = utils.find_modules +header_property = utils.header_property +html = utils.html +xhtml = utils.xhtml +HTMLBuilder = utils.HTMLBuilder +validate_arguments = utils.validate_arguments +ArgumentValidationError = utils.ArgumentValidationError +bind_arguments = utils.bind_arguments +secure_filename = utils.secure_filename +BaseResponse = wrappers.BaseResponse +BaseRequest = wrappers.BaseRequest +Request = wrappers.Request +Response = wrappers.Response +AcceptMixin = wrappers.AcceptMixin +ETagRequestMixin = wrappers.ETagRequestMixin +ETagResponseMixin = wrappers.ETagResponseMixin +ResponseStreamMixin = wrappers.ResponseStreamMixin +CommonResponseDescriptorsMixin = wrappers.CommonResponseDescriptorsMixin +UserAgentMixin = wrappers.UserAgentMixin +AuthorizationMixin = wrappers.AuthorizationMixin +WWWAuthenticateMixin = wrappers.WWWAuthenticateMixin +CommonRequestDescriptorsMixin = wrappers.CommonRequestDescriptorsMixin +Local = local.Local +LocalManager = local.LocalManager +LocalProxy = local.LocalProxy +LocalStack = local.LocalStack +release_local = local.release_local +generate_password_hash = security.generate_password_hash +check_password_hash = security.check_password_hash +Client = test.Client +EnvironBuilder = test.EnvironBuilder +create_environ = test.create_environ +run_wsgi_app = test.run_wsgi_app +get_current_url = wsgi.get_current_url +get_host = wsgi.get_host +pop_path_info = wsgi.pop_path_info +peek_path_info = wsgi.peek_path_info +SharedDataMiddleware = wsgi.SharedDataMiddleware +DispatcherMiddleware = wsgi.DispatcherMiddleware +ClosingIterator = wsgi.ClosingIterator +FileWrapper = wsgi.FileWrapper +make_line_iter = wsgi.make_line_iter +LimitedStream = wsgi.LimitedStream +responder = wsgi.responder +wrap_file = wsgi.wrap_file +extract_path_info = wsgi.extract_path_info +parse_etags = http.parse_etags +parse_date = http.parse_date +http_date = http.http_date +cookie_date = http.cookie_date +parse_cache_control_header = http.parse_cache_control_header +is_resource_modified = http.is_resource_modified +parse_accept_header = http.parse_accept_header +parse_set_header = http.parse_set_header +quote_etag = http.quote_etag +unquote_etag = http.unquote_etag +generate_etag = http.generate_etag +dump_header = http.dump_header +parse_list_header = http.parse_list_header +parse_dict_header = http.parse_dict_header +parse_authorization_header = http.parse_authorization_header +parse_www_authenticate_header = http.parse_www_authenticate_header +remove_entity_headers = http.remove_entity_headers +is_entity_header = http.is_entity_header +remove_hop_by_hop_headers = http.remove_hop_by_hop_headers +parse_options_header = http.parse_options_header +dump_options_header = http.dump_options_header +is_hop_by_hop_header = http.is_hop_by_hop_header +unquote_header_value = http.unquote_header_value +quote_header_value = http.quote_header_value +HTTP_STATUS_CODES = http.HTTP_STATUS_CODES +url_decode = urls.url_decode +url_encode = urls.url_encode +url_quote = urls.url_quote +url_quote_plus = urls.url_quote_plus +url_unquote = urls.url_unquote +url_unquote_plus = urls.url_unquote_plus +url_fix = urls.url_fix +Href = urls.Href +iri_to_uri = urls.iri_to_uri +uri_to_iri = urls.uri_to_iri +parse_form_data = formparser.parse_form_data +abort = exceptions.Aborter +Aborter = exceptions.Aborter diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/_compat.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/_compat.pyi new file mode 100644 index 0000000..bc4340d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/_compat.pyi @@ -0,0 +1,48 @@ +import sys +from typing import Any, Optional, Text + +if sys.version_info < (3,): + import StringIO as BytesIO +else: + from io import StringIO as BytesIO + +PY2: Any +WIN: Any +unichr: Any +text_type: Any +string_types: Any +integer_types: Any +iterkeys: Any +itervalues: Any +iteritems: Any +iterlists: Any +iterlistvalues: Any +int_to_byte: Any +iter_bytes: Any + +def fix_tuple_repr(obj): ... +def implements_iterator(cls): ... +def implements_to_string(cls): ... +def native_string_result(func): ... +def implements_bool(cls): ... + +range_type: Any +NativeStringIO: Any + +def make_literal_wrapper(reference): ... +def normalize_string_tuple(tup): ... +def try_coerce_native(s): ... + +wsgi_get_bytes: Any + +def wsgi_decoding_dance(s, charset: Text = ..., errors: Text = ...): ... +def wsgi_encoding_dance(s, charset: Text = ..., errors: Text = ...): ... +def to_bytes(x, charset: Text = ..., errors: Text = ...): ... +def to_native(x, charset: Text = ..., errors: Text = ...): ... +def reraise(tp, value, tb: Optional[Any] = ...): ... + +imap: Any +izip: Any +ifilter: Any + +def to_unicode(x, charset: Text = ..., errors: Text = ..., allow_none_charset: bool = ...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/_internal.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/_internal.pyi new file mode 100644 index 0000000..64f63a1 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/_internal.pyi @@ -0,0 +1,19 @@ +from typing import Any, Optional + +class _Missing: + def __reduce__(self): ... + +class _DictAccessorProperty: + read_only: Any + name: Any + default: Any + load_func: Any + dump_func: Any + __doc__: Any + def __init__(self, name, default: Optional[Any] = ..., load_func: Optional[Any] = ..., dump_func: Optional[Any] = ..., + read_only: Optional[Any] = ..., doc: Optional[Any] = ...): ... + def __get__(self, obj, type: Optional[Any] = ...): ... + def __set__(self, obj, value): ... + def __delete__(self, obj): ... + +def _easteregg(app: Optional[Any] = ...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/_reloader.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/_reloader.pyi new file mode 100644 index 0000000..be23222 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/_reloader.pyi @@ -0,0 +1,29 @@ +from typing import Any, Optional + +class ReloaderLoop: + name: Any + extra_files: Any + interval: float + def __init__(self, extra_files: Optional[Any] = ..., interval: float = ...): ... + def run(self): ... + def restart_with_reloader(self): ... + def trigger_reload(self, filename): ... + def log_reload(self, filename): ... + +class StatReloaderLoop(ReloaderLoop): + name: Any + def run(self): ... + +class WatchdogReloaderLoop(ReloaderLoop): + observable_paths: Any + name: Any + observer_class: Any + event_handler: Any + should_reload: Any + def __init__(self, *args, **kwargs): ... + def trigger_reload(self, filename): ... + def run(self): ... + +reloader_loops: Any + +def run_with_reloader(main_func, extra_files: Optional[Any] = ..., interval: float = ..., reloader_type: str = ...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/__init__.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/atom.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/atom.pyi new file mode 100644 index 0000000..d02a482 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/atom.pyi @@ -0,0 +1,50 @@ +from typing import Any, Optional + +XHTML_NAMESPACE: Any + +def format_iso8601(obj): ... + +class AtomFeed: + default_generator: Any + title: Any + title_type: Any + url: Any + feed_url: Any + id: Any + updated: Any + author: Any + icon: Any + logo: Any + rights: Any + rights_type: Any + subtitle: Any + subtitle_type: Any + generator: Any + links: Any + entries: Any + def __init__(self, title: Optional[Any] = ..., entries: Optional[Any] = ..., **kwargs): ... + def add(self, *args, **kwargs): ... + def generate(self): ... + def to_string(self): ... + def get_response(self): ... + def __call__(self, environ, start_response): ... + +class FeedEntry: + title: Any + title_type: Any + content: Any + content_type: Any + url: Any + id: Any + updated: Any + summary: Any + summary_type: Any + author: Any + published: Any + rights: Any + links: Any + categories: Any + xml_base: Any + def __init__(self, title: Optional[Any] = ..., content: Optional[Any] = ..., feed_url: Optional[Any] = ..., **kwargs): ... + def generate(self): ... + def to_string(self): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/cache.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/cache.pyi new file mode 100644 index 0000000..9ef76da --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/cache.pyi @@ -0,0 +1,84 @@ +from typing import Any, Optional + +class BaseCache: + default_timeout: float + def __init__(self, default_timeout: float = ...): ... + def get(self, key): ... + def delete(self, key): ... + def get_many(self, *keys): ... + def get_dict(self, *keys): ... + def set(self, key, value, timeout: Optional[float] = ...): ... + def add(self, key, value, timeout: Optional[float] = ...): ... + def set_many(self, mapping, timeout: Optional[float] = ...): ... + def delete_many(self, *keys): ... + def has(self, key): ... + def clear(self): ... + def inc(self, key, delta=...): ... + def dec(self, key, delta=...): ... + +class NullCache(BaseCache): ... + +class SimpleCache(BaseCache): + clear: Any + def __init__(self, threshold: int = ..., default_timeout: float = ...): ... + def get(self, key): ... + def set(self, key, value, timeout: Optional[float] = ...): ... + def add(self, key, value, timeout: Optional[float] = ...): ... + def delete(self, key): ... + def has(self, key): ... + +class MemcachedCache(BaseCache): + key_prefix: Any + def __init__(self, servers: Optional[Any] = ..., default_timeout: float = ..., key_prefix: Optional[Any] = ...): ... + def get(self, key): ... + def get_dict(self, *keys): ... + def add(self, key, value, timeout: Optional[float] = ...): ... + def set(self, key, value, timeout: Optional[float] = ...): ... + def get_many(self, *keys): ... + def set_many(self, mapping, timeout: Optional[float] = ...): ... + def delete(self, key): ... + def delete_many(self, *keys): ... + def has(self, key): ... + def clear(self): ... + def inc(self, key, delta=...): ... + def dec(self, key, delta=...): ... + def import_preferred_memcache_lib(self, servers): ... + +GAEMemcachedCache: Any + +class RedisCache(BaseCache): + key_prefix: Any + def __init__(self, host: str = ..., port: int = ..., password: Optional[Any] = ..., db: int = ..., + default_timeout: float = ..., key_prefix: Optional[Any] = ..., **kwargs): ... + def dump_object(self, value): ... + def load_object(self, value): ... + def get(self, key): ... + def get_many(self, *keys): ... + def set(self, key, value, timeout: Optional[float] = ...): ... + def add(self, key, value, timeout: Optional[float] = ...): ... + def set_many(self, mapping, timeout: Optional[float] = ...): ... + def delete(self, key): ... + def delete_many(self, *keys): ... + def has(self, key): ... + def clear(self): ... + def inc(self, key, delta=...): ... + def dec(self, key, delta=...): ... + +class FileSystemCache(BaseCache): + def __init__(self, cache_dir, threshold: int = ..., default_timeout: float = ..., mode: int = ...): ... + def clear(self): ... + def get(self, key): ... + def add(self, key, value, timeout: Optional[float] = ...): ... + def set(self, key, value, timeout: Optional[float] = ...): ... + def delete(self, key): ... + def has(self, key): ... + +class UWSGICache(BaseCache): + cache: Any + def __init__(self, default_timeout: float = ..., cache: str = ...): ... + def get(self, key): ... + def delete(self, key): ... + def set(self, key, value, timeout: Optional[float] = ...): ... + def add(self, key, value, timeout: Optional[float] = ...): ... + def clear(self): ... + def has(self, key): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/fixers.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/fixers.pyi new file mode 100644 index 0000000..97c6e56 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/fixers.pyi @@ -0,0 +1,38 @@ +from typing import Any, Sequence, Optional, Iterable +from wsgiref.types import WSGIApplication, WSGIEnvironment, StartResponse + +class CGIRootFix: + app: Any + app_root: Any + def __init__(self, app, app_root: str = ...): ... + def __call__(self, environ, start_response): ... + +LighttpdCGIRootFix: Any + +class PathInfoFromRequestUriFix: + app: Any + def __init__(self, app): ... + def __call__(self, environ, start_response): ... + +class ProxyFix(object): + app: WSGIApplication + num_proxies: int + def __init__(self, app: WSGIApplication, num_proxies: int = ...) -> None: ... + def get_remote_addr(self, forwarded_for: Sequence[str]) -> Optional[str]: ... + def __call__(self, environ: WSGIEnvironment, start_response: StartResponse) -> Iterable[bytes]: ... + +class HeaderRewriterFix: + app: Any + remove_headers: Any + add_headers: Any + def __init__(self, app, remove_headers: Optional[Any] = ..., add_headers: Optional[Any] = ...): ... + def __call__(self, environ, start_response): ... + +class InternetExplorerFix: + app: Any + fix_vary: Any + fix_attach: Any + def __init__(self, app, fix_vary: bool = ..., fix_attach: bool = ...): ... + def fix_headers(self, environ, headers, status: Optional[Any] = ...): ... + def run_fixed(self, environ, start_response): ... + def __call__(self, environ, start_response): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/iterio.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/iterio.pyi new file mode 100644 index 0000000..c7ce70c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/iterio.pyi @@ -0,0 +1,39 @@ +from typing import Any, Optional, Text, Union + +greenlet: Any + +class IterIO: + def __new__(cls, obj, sentinel: Union[Text, bytes] = ...): ... + def __iter__(self): ... + def tell(self): ... + def isatty(self): ... + def seek(self, pos, mode: int = ...): ... + def truncate(self, size: Optional[Any] = ...): ... + def write(self, s): ... + def writelines(self, list): ... + def read(self, n: int = ...): ... + def readlines(self, sizehint: int = ...): ... + def readline(self, length: Optional[Any] = ...): ... + def flush(self): ... + def __next__(self): ... + +class IterI(IterIO): + sentinel: Any + def __new__(cls, func, sentinel: Union[Text, bytes] = ...): ... + closed: Any + def close(self): ... + def write(self, s): ... + def writelines(self, list): ... + def flush(self): ... + +class IterO(IterIO): + sentinel: Any + closed: Any + pos: Any + def __new__(cls, gen, sentinel: Union[Text, bytes] = ...): ... + def __iter__(self): ... + def close(self): ... + def seek(self, pos, mode: int = ...): ... + def read(self, n: int = ...): ... + def readline(self, length: Optional[Any] = ...): ... + def readlines(self, sizehint: int = ...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/jsrouting.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/jsrouting.pyi new file mode 100644 index 0000000..46f1972 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/jsrouting.pyi @@ -0,0 +1,10 @@ +from typing import Any + +def dumps(*args): ... +def render_template(name_parts, rules, converters): ... +def generate_map(map, name: str = ...): ... +def generate_adapter(adapter, name: str = ..., map_name: str = ...): ... +def js_to_url_function(converter): ... +def NumberConverter_js_to_url(conv): ... + +js_to_url_functions: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/limiter.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/limiter.pyi new file mode 100644 index 0000000..0734a24 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/limiter.pyi @@ -0,0 +1,7 @@ +from typing import Any + +class StreamLimitMiddleware: + app: Any + maximum_size: Any + def __init__(self, app, maximum_size=...): ... + def __call__(self, environ, start_response): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/lint.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/lint.pyi new file mode 100644 index 0000000..7fd7c6a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/lint.pyi @@ -0,0 +1,43 @@ +from typing import Any + +class WSGIWarning(Warning): ... +class HTTPWarning(Warning): ... + +def check_string(context, obj, stacklevel: int = ...): ... + +class InputStream: + def __init__(self, stream): ... + def read(self, *args): ... + def readline(self, *args): ... + def __iter__(self): ... + def close(self): ... + +class ErrorStream: + def __init__(self, stream): ... + def write(self, s): ... + def flush(self): ... + def writelines(self, seq): ... + def close(self): ... + +class GuardedWrite: + def __init__(self, write, chunks): ... + def __call__(self, s): ... + +class GuardedIterator: + closed: Any + headers_set: Any + chunks: Any + def __init__(self, iterator, headers_set, chunks): ... + def __iter__(self): ... + def next(self): ... + def close(self): ... + def __del__(self): ... + +class LintMiddleware: + app: Any + def __init__(self, app): ... + def check_environ(self, environ): ... + def check_start_response(self, status, headers, exc_info): ... + def check_headers(self, headers): ... + def check_iterator(self, app_iter): ... + def __call__(self, *args, **kwargs): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/profiler.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/profiler.pyi new file mode 100644 index 0000000..601c4f1 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/profiler.pyi @@ -0,0 +1,15 @@ +from typing import Any, Optional + +available: Any + +class MergeStream: + streams: Any + def __init__(self, *streams): ... + def write(self, data): ... + +class ProfilerMiddleware: + def __init__(self, app, stream: Optional[Any] = ..., sort_by=..., restrictions=..., profile_dir: Optional[Any] = ...): ... + def __call__(self, environ, start_response): ... + +def make_action(app_factory, hostname: str = ..., port: int = ..., threaded: bool = ..., processes: int = ..., + stream: Optional[Any] = ..., sort_by=..., restrictions=...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/securecookie.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/securecookie.pyi new file mode 100644 index 0000000..009ad2d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/securecookie.pyi @@ -0,0 +1,28 @@ +from typing import Any, Optional +from hmac import new as hmac +from hashlib import sha1 as _default_hash +from werkzeug.contrib.sessions import ModificationTrackingDict + +class UnquoteError(Exception): ... + +class SecureCookie(ModificationTrackingDict): + hash_method: Any + serialization_method: Any + quote_base64: Any + secret_key: Any + new: Any + def __init__(self, data: Optional[Any] = ..., secret_key: Optional[Any] = ..., new: bool = ...): ... + @property + def should_save(self): ... + @classmethod + def quote(cls, value): ... + @classmethod + def unquote(cls, value): ... + def serialize(self, expires: Optional[Any] = ...): ... + @classmethod + def unserialize(cls, string, secret_key): ... + @classmethod + def load_cookie(cls, request, key: str = ..., secret_key: Optional[Any] = ...): ... + def save_cookie(self, response, key: str = ..., expires: Optional[Any] = ..., session_expires: Optional[Any] = ..., + max_age: Optional[Any] = ..., path: str = ..., domain: Optional[Any] = ..., secure: Optional[Any] = ..., + httponly: bool = ..., force: bool = ...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/sessions.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/sessions.pyi new file mode 100644 index 0000000..b4b4ec2 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/sessions.pyi @@ -0,0 +1,57 @@ +from typing import Any, Optional, Text +from werkzeug.datastructures import CallbackDict + +def generate_key(salt: Optional[Any] = ...): ... + +class ModificationTrackingDict(CallbackDict): + modified: Any + def __init__(self, *args, **kwargs): ... + def copy(self): ... + def __copy__(self): ... + +class Session(ModificationTrackingDict): + sid: Any + new: Any + def __init__(self, data, sid, new: bool = ...): ... + @property + def should_save(self): ... + +class SessionStore: + session_class: Any + def __init__(self, session_class: Optional[Any] = ...): ... + def is_valid_key(self, key): ... + def generate_key(self, salt: Optional[Any] = ...): ... + def new(self): ... + def save(self, session): ... + def save_if_modified(self, session): ... + def delete(self, session): ... + def get(self, sid): ... + +class FilesystemSessionStore(SessionStore): + path: Any + filename_template: str + renew_missing: Any + mode: Any + def __init__(self, path: Optional[Any] = ..., filename_template: Text = ..., session_class: Optional[Any] = ..., + renew_missing: bool = ..., mode: int = ...): ... + def get_session_filename(self, sid): ... + def save(self, session): ... + def delete(self, session): ... + def get(self, sid): ... + def list(self): ... + +class SessionMiddleware: + app: Any + store: Any + cookie_name: Any + cookie_age: Any + cookie_expires: Any + cookie_path: Any + cookie_domain: Any + cookie_secure: Any + cookie_httponly: Any + environ_key: Any + def __init__(self, app, store, cookie_name: str = ..., cookie_age: Optional[Any] = ..., cookie_expires: Optional[Any] = ..., + cookie_path: str = ..., cookie_domain: Optional[Any] = ..., cookie_secure: Optional[Any] = ..., + cookie_httponly: bool = ..., environ_key: str = ...): ... + def __call__(self, environ, start_response): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/testtools.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/testtools.pyi new file mode 100644 index 0000000..860ebb7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/testtools.pyi @@ -0,0 +1,9 @@ +from typing import Any +from werkzeug.wrappers import Response + +class ContentAccessors: + def xml(self): ... + def lxml(self): ... + def json(self): ... + +class TestResponse(Response, ContentAccessors): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/wrappers.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/wrappers.pyi new file mode 100644 index 0000000..683eda0 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/wrappers.pyi @@ -0,0 +1,27 @@ +from typing import Any + +def is_known_charset(charset): ... + +class JSONRequestMixin: + def json(self): ... + +class ProtobufRequestMixin: + protobuf_check_initialization: Any + def parse_protobuf(self, proto_type): ... + +class RoutingArgsRequestMixin: + routing_args: Any + routing_vars: Any + +class ReverseSlashBehaviorRequestMixin: + def path(self): ... + def script_root(self): ... + +class DynamicCharsetRequestMixin: + default_charset: Any + def unknown_charset(self, charset): ... + def charset(self): ... + +class DynamicCharsetResponseMixin: + default_charset: Any + charset: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/datastructures.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/datastructures.pyi new file mode 100644 index 0000000..f10665f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/datastructures.pyi @@ -0,0 +1,425 @@ +import collections +from typing import Any, Optional, Mapping, Dict, TypeVar, Callable, Union, overload, Text +from collections import Container, Iterable, MutableSet + +_K = TypeVar("_K") +_V = TypeVar("_V") +_R = TypeVar("_R") +_D = TypeVar("_D") + +def is_immutable(self): ... +def iter_multi_items(mapping): ... +def native_itermethods(names): ... + +class ImmutableListMixin: + def __hash__(self): ... + def __reduce_ex__(self, protocol): ... + def __delitem__(self, key): ... + def __delslice__(self, i, j): ... + def __iadd__(self, other): ... + __imul__: Any + def __setitem__(self, key, value): ... + def __setslice__(self, i, j, value): ... + def append(self, item): ... + remove: Any + def extend(self, iterable): ... + def insert(self, pos, value): ... + def pop(self, index: int = ...): ... + def reverse(self): ... + def sort(self, cmp: Optional[Any] = ..., key: Optional[Any] = ..., reverse: Optional[Any] = ...): ... + +class ImmutableList(ImmutableListMixin, list): ... + +class ImmutableDictMixin: + @classmethod + def fromkeys(cls, *args, **kwargs): ... + def __reduce_ex__(self, protocol): ... + def __hash__(self): ... + def setdefault(self, key, default: Optional[Any] = ...): ... + def update(self, *args, **kwargs): ... + def pop(self, key, default: Optional[Any] = ...): ... + def popitem(self): ... + def __setitem__(self, key, value): ... + def __delitem__(self, key): ... + def clear(self): ... + +class ImmutableMultiDictMixin(ImmutableDictMixin): + def __reduce_ex__(self, protocol): ... + def add(self, key, value): ... + def popitemlist(self): ... + def poplist(self, key): ... + def setlist(self, key, new_list): ... + def setlistdefault(self, key, default_list: Optional[Any] = ...): ... + +class UpdateDictMixin: + on_update: Any + def setdefault(self, key, default: Optional[Any] = ...): ... + def pop(self, key, default=...): ... + __setitem__: Any + __delitem__: Any + clear: Any + popitem: Any + update: Any + +class TypeConversionDict(Dict[_K, _V]): + @overload + def get(self, key: _K, *, type: None = ...) -> Optional[_V]: ... + @overload + def get(self, key: _K, default: _D, type: None = ...) -> Union[_V, _D]: ... + @overload + def get(self, key: _K, *, type: Callable[[_V], _R]) -> Optional[_R]: ... + @overload + def get(self, key: _K, default: _D, type: Callable[[_V], _R]) -> Union[_R, _D]: ... + +class ImmutableTypeConversionDict(ImmutableDictMixin, TypeConversionDict[_K, _V]): + def copy(self) -> TypeConversionDict[_K, _V]: ... + def __copy__(self) -> ImmutableTypeConversionDict[_K, _V]: ... + +class ViewItems: + def __init__(self, multi_dict, method, repr_name, *a, **kw): ... + def __iter__(self): ... + +class MultiDict(TypeConversionDict): + def __init__(self, mapping: Optional[Any] = ...): ... + def __getitem__(self, key): ... + def __setitem__(self, key, value): ... + def add(self, key, value): ... + def getlist(self, key, type: Optional[Any] = ...): ... + def setlist(self, key, new_list): ... + def setdefault(self, key, default: Optional[Any] = ...): ... + def setlistdefault(self, key, default_list: Optional[Any] = ...): ... + def items(self, multi: bool = ...): ... + def lists(self): ... + def keys(self): ... + __iter__: Any + def values(self): ... + def listvalues(self): ... + def copy(self): ... + def deepcopy(self, memo: Optional[Any] = ...): ... + def to_dict(self, flat: bool = ...): ... + def update(self, other_dict): ... + def pop(self, key, default=...): ... + def popitem(self): ... + def poplist(self, key): ... + def popitemlist(self): ... + def __copy__(self): ... + def __deepcopy__(self, memo): ... + +class _omd_bucket: + prev: Any + key: Any + value: Any + next: Any + def __init__(self, omd, key, value): ... + def unlink(self, omd): ... + +class OrderedMultiDict(MultiDict): + def __init__(self, mapping: Optional[Any] = ...): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + def __reduce_ex__(self, protocol): ... + def __getitem__(self, key): ... + def __setitem__(self, key, value): ... + def __delitem__(self, key): ... + def keys(self): ... + __iter__: Any + def values(self): ... + def items(self, multi: bool = ...): ... + def lists(self): ... + def listvalues(self): ... + def add(self, key, value): ... + def getlist(self, key, type: Optional[Any] = ...): ... + def setlist(self, key, new_list): ... + def setlistdefault(self, key, default_list: Optional[Any] = ...): ... + def update(self, mapping): ... + def poplist(self, key): ... + def pop(self, key, default=...): ... + def popitem(self): ... + def popitemlist(self): ... + +class Headers(collections.Mapping): + def __init__(self, defaults: Optional[Any] = ...): ... + def __getitem__(self, key, _get_mode: bool = ...): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + @overload + def get(self, key: str, *, type: None = ...) -> Optional[str]: ... + @overload + def get(self, key: str, default: _D, type: None = ...) -> Union[str, _D]: ... + @overload + def get(self, key: str, *, type: Callable[[str], _R]) -> Optional[_R]: ... + @overload + def get(self, key: str, default: _D, type: Callable[[str], _R]) -> Union[_R, _D]: ... + @overload + def get(self, key: str, *, as_bytes: bool) -> Any: ... + @overload + def get(self, key: str, *, type: None, as_bytes: bool) -> Any: ... + @overload + def get(self, key: str, *, type: Callable[[Any], _R], as_bytes: bool) -> Optional[_R]: ... + @overload + def get(self, key: str, default: Any, type: None, as_bytes: bool) -> Any: ... + @overload + def get(self, key: str, default: _D, type: Callable[[Any], _R], as_bytes: bool) -> Union[_R, _D]: ... + def getlist(self, key, type: Optional[Any] = ..., as_bytes: bool = ...): ... + def get_all(self, name): ... + def items(self, lower: bool = ...): ... + def keys(self, lower: bool = ...): ... + def values(self): ... + def extend(self, iterable): ... + def __delitem__(self, key: Any) -> None: ... + def remove(self, key): ... + def pop(self, **kwargs): ... + def popitem(self): ... + def __contains__(self, key): ... + has_key: Any + def __iter__(self): ... + def __len__(self): ... + def add(self, _key, _value, **kw): ... + def add_header(self, _key, _value, **_kw): ... + def clear(self): ... + def set(self, _key, _value, **kw): ... + def setdefault(self, key, value): ... + def __setitem__(self, key, value): ... + def to_list(self, charset: Text = ...): ... + def to_wsgi_list(self): ... + def copy(self): ... + def __copy__(self): ... + +class ImmutableHeadersMixin: + def __delitem__(self, key: str) -> None: ... + def __setitem__(self, key, value): ... + set: Any + def add(self, *args, **kwargs): ... + remove: Any + add_header: Any + def extend(self, iterable): ... + def insert(self, pos, value): ... + def pop(self, **kwargs): ... + def popitem(self): ... + def setdefault(self, key, default): ... + +class EnvironHeaders(ImmutableHeadersMixin, Headers): + environ: Any + def __init__(self, environ): ... + def __eq__(self, other): ... + def __getitem__(self, key, _get_mode: bool = ...): ... + def __len__(self): ... + def __iter__(self): ... + def copy(self): ... + +class CombinedMultiDict(ImmutableMultiDictMixin, MultiDict): + def __reduce_ex__(self, protocol): ... + dicts: Any + def __init__(self, dicts: Optional[Any] = ...): ... + @classmethod + def fromkeys(cls): ... + def __getitem__(self, key): ... + def get(self, key, default: Optional[Any] = ..., type: Optional[Any] = ...): ... + def getlist(self, key, type: Optional[Any] = ...): ... + def keys(self): ... + __iter__: Any + def items(self, multi: bool = ...): ... + def values(self): ... + def lists(self): ... + def listvalues(self): ... + def copy(self): ... + def to_dict(self, flat: bool = ...): ... + def __len__(self): ... + def __contains__(self, key): ... + has_key: Any + +class FileMultiDict(MultiDict): + def add_file(self, name, file, filename: Optional[Any] = ..., content_type: Optional[Any] = ...): ... + +class ImmutableDict(ImmutableDictMixin, dict): + def copy(self): ... + def __copy__(self): ... + +class ImmutableMultiDict(ImmutableMultiDictMixin, MultiDict): + def copy(self): ... + def __copy__(self): ... + +class ImmutableOrderedMultiDict(ImmutableMultiDictMixin, OrderedMultiDict): + def copy(self): ... + def __copy__(self): ... + +class Accept(ImmutableList): + provided: Any + def __init__(self, values=...): ... + def __getitem__(self, key): ... + def quality(self, key): ... + def __contains__(self, value): ... + def index(self, key): ... + def find(self, key): ... + def values(self): ... + def to_header(self): ... + def best_match(self, matches, default: Optional[Any] = ...): ... + @property + def best(self): ... + +class MIMEAccept(Accept): + @property + def accept_html(self): ... + @property + def accept_xhtml(self): ... + @property + def accept_json(self): ... + +class LanguageAccept(Accept): ... +class CharsetAccept(Accept): ... + +def cache_property(key, empty, type): ... + +class _CacheControl(UpdateDictMixin, dict): + no_cache: Any + no_store: Any + max_age: Any + no_transform: Any + on_update: Any + provided: Any + def __init__(self, values=..., on_update: Optional[Any] = ...): ... + def to_header(self): ... + +class RequestCacheControl(ImmutableDictMixin, _CacheControl): + max_stale: Any + min_fresh: Any + no_transform: Any + only_if_cached: Any + +class ResponseCacheControl(_CacheControl): + public: Any + private: Any + must_revalidate: Any + proxy_revalidate: Any + s_maxage: Any + +class CallbackDict(UpdateDictMixin, dict): + on_update: Any + def __init__(self, initial: Optional[Any] = ..., on_update: Optional[Any] = ...): ... + +class HeaderSet(MutableSet): + on_update: Any + def __init__(self, headers: Optional[Any] = ..., on_update: Optional[Any] = ...): ... + def add(self, header): ... + def remove(self, header): ... + def update(self, iterable): ... + def discard(self, header): ... + def find(self, header): ... + def index(self, header): ... + def clear(self): ... + def as_set(self, preserve_casing: bool = ...): ... + def to_header(self): ... + def __getitem__(self, idx): ... + def __delitem__(self, idx): ... + def __setitem__(self, idx, value): ... + def __contains__(self, header): ... + def __len__(self): ... + def __iter__(self): ... + def __nonzero__(self): ... + +class ETags(Container, Iterable): + star_tag: Any + def __init__(self, strong_etags: Optional[Any] = ..., weak_etags: Optional[Any] = ..., star_tag: bool = ...): ... + def as_set(self, include_weak: bool = ...): ... + def is_weak(self, etag): ... + def contains_weak(self, etag): ... + def contains(self, etag): ... + def contains_raw(self, etag): ... + def to_header(self): ... + def __call__(self, etag: Optional[Any] = ..., data: Optional[Any] = ..., include_weak: bool = ...): ... + def __bool__(self): ... + __nonzero__: Any + def __iter__(self): ... + def __contains__(self, etag): ... + +class IfRange: + etag: Any + date: Any + def __init__(self, etag: Optional[Any] = ..., date: Optional[Any] = ...): ... + def to_header(self): ... + +class Range: + units: Any + ranges: Any + def __init__(self, units, ranges): ... + def range_for_length(self, length): ... + def make_content_range(self, length): ... + def to_header(self): ... + def to_content_range_header(self, length): ... + +class ContentRange: + on_update: Any + units: Optional[str] + start: Any + stop: Any + length: Any + def __init__(self, units: Optional[str], start, stop, length: Optional[Any] = ..., on_update: Optional[Any] = ...): ... + def set(self, start, stop, length: Optional[Any] = ..., units: Optional[str] = ...): ... + def unset(self) -> None: ... + def to_header(self): ... + def __nonzero__(self): ... + __bool__: Any + +class Authorization(ImmutableDictMixin, Dict[str, Any]): + type: str + def __init__(self, auth_type: str, data: Optional[Mapping[str, Any]] = ...) -> None: ... + @property + def username(self) -> Optional[str]: ... + @property + def password(self) -> Optional[str]: ... + @property + def realm(self) -> Optional[str]: ... + @property + def nonce(self) -> Optional[str]: ... + @property + def uri(self) -> Optional[str]: ... + @property + def nc(self) -> Optional[str]: ... + @property + def cnonce(self) -> Optional[str]: ... + @property + def response(self) -> Optional[str]: ... + @property + def opaque(self) -> Optional[str]: ... + @property + def qop(self) -> Optional[str]: ... + +class WWWAuthenticate(UpdateDictMixin, dict): + on_update: Any + def __init__(self, auth_type: Optional[Any] = ..., values: Optional[Any] = ..., on_update: Optional[Any] = ...): ... + def set_basic(self, realm: str = ...): ... + def set_digest(self, realm, nonce, qop=..., opaque: Optional[Any] = ..., algorithm: Optional[Any] = ..., + stale: bool = ...): ... + def to_header(self): ... + @staticmethod + def auth_property(name, doc: Optional[Any] = ...): ... + type: Any + realm: Any + domain: Any + nonce: Any + opaque: Any + algorithm: Any + qop: Any + stale: Any + +class FileStorage: + name: Any + stream: Any + filename: Any + headers: Any + def __init__(self, stream: Optional[Any] = ..., filename: Optional[Any] = ..., name: Optional[Any] = ..., + content_type: Optional[Any] = ..., content_length: Optional[Any] = ..., headers: Optional[Any] = ...): ... + @property + def content_type(self): ... + @property + def content_length(self): ... + @property + def mimetype(self): ... + @property + def mimetype_params(self): ... + def save(self, dst, buffer_size: int = ...): ... + def close(self): ... + def __nonzero__(self): ... + __bool__: Any + def __getattr__(self, name): ... + def __iter__(self): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/debug/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/debug/__init__.pyi new file mode 100644 index 0000000..d920ed0 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/debug/__init__.pyi @@ -0,0 +1,41 @@ +from typing import Any, Optional +from werkzeug.wrappers import BaseRequest as Request, BaseResponse as Response + +PIN_TIME: Any + +def hash_pin(pin): ... +def get_machine_id(): ... + +class _ConsoleFrame: + console: Any + id: Any + def __init__(self, namespace): ... + +def get_pin_and_cookie_name(app): ... + +class DebuggedApplication: + app: Any + evalex: Any + frames: Any + tracebacks: Any + request_key: Any + console_path: Any + console_init_func: Any + show_hidden_frames: Any + secret: Any + pin_logging: Any + pin: Any + def __init__(self, app, evalex: bool = ..., request_key: str = ..., console_path: str = ..., + console_init_func: Optional[Any] = ..., show_hidden_frames: bool = ..., lodgeit_url: Optional[Any] = ..., + pin_security: bool = ..., pin_logging: bool = ...): ... + @property + def pin_cookie_name(self): ... + def debug_application(self, environ, start_response): ... + def execute_command(self, request, command, frame): ... + def display_console(self, request): ... + def paste_traceback(self, request, traceback): ... + def get_resource(self, request, filename): ... + def check_pin_trust(self, environ): ... + def pin_auth(self, request): ... + def log_pin_request(self): ... + def __call__(self, environ, start_response): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/debug/console.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/debug/console.pyi new file mode 100644 index 0000000..0323377 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/debug/console.pyi @@ -0,0 +1,44 @@ +from typing import Any, Optional +import code + +class HTMLStringO: + def __init__(self): ... + def isatty(self): ... + def close(self): ... + def flush(self): ... + def seek(self, n, mode: int = ...): ... + def readline(self): ... + def reset(self): ... + def write(self, x): ... + def writelines(self, x): ... + +class ThreadedStream: + @staticmethod + def push(): ... + @staticmethod + def fetch(): ... + @staticmethod + def displayhook(obj): ... + def __setattr__(self, name, value): ... + def __dir__(self): ... + def __getattribute__(self, name): ... + +class _ConsoleLoader: + def __init__(self): ... + def register(self, code, source): ... + def get_source_by_code(self, code): ... + +class _InteractiveConsole(code.InteractiveInterpreter): + globals: Any + more: Any + buffer: Any + def __init__(self, globals, locals): ... + def runsource(self, source): ... + def runcode(self, code): ... + def showtraceback(self): ... + def showsyntaxerror(self, filename: Optional[Any] = ...): ... + def write(self, data): ... + +class Console: + def __init__(self, globals: Optional[Any] = ..., locals: Optional[Any] = ...): ... + def eval(self, code): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/debug/repr.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/debug/repr.pyi new file mode 100644 index 0000000..4955919 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/debug/repr.pyi @@ -0,0 +1,33 @@ +from typing import Any, Optional + +deque: Any +missing: Any +RegexType: Any +HELP_HTML: Any +OBJECT_DUMP_HTML: Any + +def debug_repr(obj): ... +def dump(obj=...): ... + +class _Helper: + def __call__(self, topic: Optional[Any] = ...): ... + +helper: Any + +class DebugReprGenerator: + def __init__(self): ... + list_repr: Any + tuple_repr: Any + set_repr: Any + frozenset_repr: Any + deque_repr: Any + def regex_repr(self, obj): ... + def string_repr(self, obj, limit: int = ...): ... + def dict_repr(self, d, recursive, limit: int = ...): ... + def object_repr(self, obj): ... + def dispatch_repr(self, obj, recursive): ... + def fallback_repr(self): ... + def repr(self, obj): ... + def dump_object(self, obj): ... + def dump_locals(self, d): ... + def render_object_dump(self, items, title, repr: Optional[Any] = ...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/debug/tbtools.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/debug/tbtools.pyi new file mode 100644 index 0000000..90beed9 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/debug/tbtools.pyi @@ -0,0 +1,63 @@ +from typing import Any, Optional + +UTF8_COOKIE: Any +system_exceptions: Any +HEADER: Any +FOOTER: Any +PAGE_HTML: Any +CONSOLE_HTML: Any +SUMMARY_HTML: Any +FRAME_HTML: Any +SOURCE_LINE_HTML: Any + +def render_console_html(secret, evalex_trusted: bool = ...): ... +def get_current_traceback(ignore_system_exceptions: bool = ..., show_hidden_frames: bool = ..., skip: int = ...): ... + +class Line: + lineno: Any + code: Any + in_frame: Any + current: Any + def __init__(self, lineno, code): ... + def classes(self): ... + def render(self): ... + +class Traceback: + exc_type: Any + exc_value: Any + exception_type: Any + frames: Any + def __init__(self, exc_type, exc_value, tb): ... + def filter_hidden_frames(self): ... + def is_syntax_error(self): ... + def exception(self): ... + def log(self, logfile: Optional[Any] = ...): ... + def paste(self): ... + def render_summary(self, include_title: bool = ...): ... + def render_full(self, evalex: bool = ..., secret: Optional[Any] = ..., evalex_trusted: bool = ...): ... + def generate_plaintext_traceback(self): ... + def plaintext(self): ... + id: Any + +class Frame: + lineno: Any + function_name: Any + locals: Any + globals: Any + filename: Any + module: Any + loader: Any + code: Any + hide: Any + info: Any + def __init__(self, exc_type, exc_value, tb): ... + def render(self): ... + def render_line_context(self): ... + def get_annotated_lines(self): ... + def eval(self, code, mode: str = ...): ... + def sourcelines(self): ... + def get_context_lines(self, context: int = ...): ... + @property + def current_line(self): ... + def console(self): ... + id: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/exceptions.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/exceptions.pyi new file mode 100644 index 0000000..3686046 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/exceptions.pyi @@ -0,0 +1,161 @@ +from typing import Any, Dict, Tuple, List, Text, NoReturn, Optional, Protocol, Type, Union, Iterable + +from wsgiref.types import WSGIEnvironment, StartResponse +from werkzeug.wrappers import Response + +class _EnvironContainer(Protocol): + @property + def environ(self) -> WSGIEnvironment: ... + +class HTTPException(Exception): + code: Optional[int] + description: Optional[str] + response: Optional[Response] + def __init__(self, description: Optional[str] = ..., response: Optional[Response] = ...) -> None: ... + @classmethod + def wrap(cls, exception: Type[Exception], name: Optional[str] = ...) -> Any: ... + @property + def name(self) -> str: ... + def get_description(self, environ: Optional[WSGIEnvironment] = ...) -> Text: ... + def get_body(self, environ: Optional[WSGIEnvironment] = ...) -> Text: ... + def get_headers(self, environ: Optional[WSGIEnvironment] = ...) -> List[Tuple[str, str]]: ... + def get_response(self, environ: Optional[Union[WSGIEnvironment, _EnvironContainer]] = ...) -> Response: ... + def __call__(self, environ: WSGIEnvironment, start_response: StartResponse) -> Iterable[bytes]: ... + +default_exceptions: Dict[int, Type[HTTPException]] + +class BadRequest(HTTPException): + code: int + description: str + +class ClientDisconnected(BadRequest): ... +class SecurityError(BadRequest): ... +class BadHost(BadRequest): ... + +class Unauthorized(HTTPException): + code: int + description: str + +class Forbidden(HTTPException): + code: int + description: str + +class NotFound(HTTPException): + code: int + description: str + +class MethodNotAllowed(HTTPException): + code: int + description: str + valid_methods: Any + def __init__(self, valid_methods: Optional[Any] = ..., description: Optional[Any] = ...): ... + def get_headers(self, environ): ... + +class NotAcceptable(HTTPException): + code: int + description: str + +class RequestTimeout(HTTPException): + code: int + description: str + +class Conflict(HTTPException): + code: int + description: str + +class Gone(HTTPException): + code: int + description: str + +class LengthRequired(HTTPException): + code: int + description: str + +class PreconditionFailed(HTTPException): + code: int + description: str + +class RequestEntityTooLarge(HTTPException): + code: int + description: str + +class RequestURITooLarge(HTTPException): + code: int + description: str + +class UnsupportedMediaType(HTTPException): + code: int + description: str + +class RequestedRangeNotSatisfiable(HTTPException): + code: int + description: str + length: Any + units: str + def __init__(self, length: Optional[Any] = ..., units: str = ..., description: Optional[Any] = ...): ... + def get_headers(self, environ): ... + +class ExpectationFailed(HTTPException): + code: int + description: str + +class ImATeapot(HTTPException): + code: int + description: str + +class UnprocessableEntity(HTTPException): + code: int + description: str + +class Locked(HTTPException): + code: int + description: str + +class PreconditionRequired(HTTPException): + code: int + description: str + +class TooManyRequests(HTTPException): + code: int + description: str + +class RequestHeaderFieldsTooLarge(HTTPException): + code: int + description: str + +class UnavailableForLegalReasons(HTTPException): + code: int + description: str + +class InternalServerError(HTTPException): + code: int + description: str + +class NotImplemented(HTTPException): + code: int + description: str + +class BadGateway(HTTPException): + code: int + description: str + +class ServiceUnavailable(HTTPException): + code: int + description: str + +class GatewayTimeout(HTTPException): + code: int + description: str + +class HTTPVersionNotSupported(HTTPException): + code: int + description: str + +class Aborter: + mapping: Any + def __init__(self, mapping: Optional[Any] = ..., extra: Optional[Any] = ...) -> None: ... + def __call__(self, code: Union[int, Response], *args: Any, **kwargs: Any) -> NoReturn: ... + +def abort(status: Union[int, Response], *args: Any, **kwargs: Any) -> NoReturn: ... + +class BadRequestKeyError(BadRequest, KeyError): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/filesystem.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/filesystem.pyi new file mode 100644 index 0000000..58695fa --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/filesystem.pyi @@ -0,0 +1,7 @@ +from typing import Any + +has_likely_buggy_unicode_filesystem: Any + +class BrokenFilesystemWarning(RuntimeWarning, UnicodeWarning): ... + +def get_filesystem_encoding(): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/formparser.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/formparser.pyi new file mode 100644 index 0000000..d0e6a73 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/formparser.pyi @@ -0,0 +1,45 @@ +from typing import Any, Optional, Text + +def default_stream_factory(total_content_length, filename, content_type, content_length: Optional[Any] = ...): ... +def parse_form_data(environ, stream_factory: Optional[Any] = ..., charset: Text = ..., errors: Text = ..., + max_form_memory_size: Optional[Any] = ..., max_content_length: Optional[Any] = ..., + cls: Optional[Any] = ..., silent: bool = ...): ... +def exhaust_stream(f): ... + +class FormDataParser: + stream_factory: Any + charset: Text + errors: Text + max_form_memory_size: Any + max_content_length: Any + cls: Any + silent: Any + def __init__(self, stream_factory: Optional[Any] = ..., charset: Text = ..., errors: Text = ..., + max_form_memory_size: Optional[Any] = ..., max_content_length: Optional[Any] = ..., cls: Optional[Any] = ..., + silent: bool = ...): ... + def get_parse_func(self, mimetype, options): ... + def parse_from_environ(self, environ): ... + def parse(self, stream, mimetype, content_length, options: Optional[Any] = ...): ... + parse_functions: Any + +def is_valid_multipart_boundary(boundary): ... +def parse_multipart_headers(iterable): ... + +class MultiPartParser: + charset: Text + errors: Text + max_form_memory_size: Any + stream_factory: Any + cls: Any + buffer_size: Any + def __init__(self, stream_factory: Optional[Any] = ..., charset: Text = ..., errors: Text = ..., + max_form_memory_size: Optional[Any] = ..., cls: Optional[Any] = ..., buffer_size=...): ... + def fail(self, message): ... + def get_part_encoding(self, headers): ... + def get_part_charset(self, headers) -> Text: ... + def start_file_streaming(self, filename, headers, total_content_length): ... + def in_memory_threshold_reached(self, bytes): ... + def validate_boundary(self, boundary): ... + def parse_lines(self, file, boundary, content_length, cap_at_buffer: bool = ...): ... + def parse_parts(self, file, boundary, content_length): ... + def parse(self, file, boundary, content_length): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/http.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/http.pyi new file mode 100644 index 0000000..2e078ff --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/http.pyi @@ -0,0 +1,92 @@ +import sys +from datetime import datetime, timedelta +from typing import ( + Dict, Text, Union, Tuple, Any, Optional, Mapping, Iterable, Callable, List, Type, + TypeVar, Protocol, overload, SupportsInt, +) +from wsgiref.types import WSGIEnvironment + +from .datastructures import ( + Headers, Accept, RequestCacheControl, HeaderSet, Authorization, WWWAuthenticate, + IfRange, Range, ContentRange, ETags, TypeConversionDict, +) + +if sys.version_info < (3,): + _Str = TypeVar('_Str', str, unicode) + _ToBytes = Union[bytes, bytearray, buffer, unicode] + _ETagData = Union[str, unicode, bytearray, buffer, memoryview] +else: + _Str = str + _ToBytes = Union[bytes, bytearray, memoryview, str] + _ETagData = Union[bytes, bytearray, memoryview] + +_T = TypeVar("_T") +_U = TypeVar("_U") + +HTTP_STATUS_CODES: Dict[int, str] + +def wsgi_to_bytes(data: Union[bytes, Text]) -> bytes: ... +def bytes_to_wsgi(data: bytes) -> str: ... +def quote_header_value(value: Any, extra_chars: str = ..., allow_token: bool = ...) -> str: ... +def unquote_header_value(value: _Str, is_filename: bool = ...) -> _Str: ... +def dump_options_header(header: Optional[_Str], options: Mapping[_Str, Any]) -> _Str: ... +def dump_header(iterable: Union[Iterable[Any], Dict[_Str, Any]], allow_token: bool = ...) -> _Str: ... +def parse_list_header(value: _Str) -> List[_Str]: ... +@overload +def parse_dict_header(value: Union[bytes, Text]) -> Dict[Text, Optional[Text]]: ... +@overload +def parse_dict_header(value: Union[bytes, Text], cls: Type[_T]) -> _T: ... +@overload +def parse_options_header(value: None, multiple: bool = ...) -> Tuple[str, Dict[str, Optional[str]]]: ... +@overload +def parse_options_header(value: _Str) -> Tuple[_Str, Dict[_Str, Optional[_Str]]]: ... +# actually returns Tuple[_Str, Dict[_Str, Optional[_Str]], ...] +@overload +def parse_options_header(value: _Str, multiple: bool = ...) -> Tuple[Any, ...]: ... +@overload +def parse_accept_header(value: Optional[Text]) -> Accept: ... +@overload +def parse_accept_header(value: Optional[_Str], cls: Callable[[Optional[_Str]], _T]) -> _T: ... +@overload +def parse_cache_control_header(value: Union[None, bytes, Text], + on_update: Optional[Callable[[RequestCacheControl], Any]] = ...) -> RequestCacheControl: ... +@overload +def parse_cache_control_header(value: Union[None, bytes, Text], on_update: _T, + cls: Callable[[Dict[Text, Optional[Text]], _T], _U]) -> _U: ... +@overload +def parse_cache_control_header(value: Union[None, bytes, Text], *, + cls: Callable[[Dict[Text, Optional[Text]], None], _U]) -> _U: ... +def parse_set_header(value: Text, on_update: Optional[Callable[[HeaderSet], Any]] = ...) -> HeaderSet: ... +def parse_authorization_header(value: Union[None, bytes, Text]) -> Optional[Authorization]: ... +def parse_www_authenticate_header(value: Union[None, bytes, Text], + on_update: Optional[Callable[[WWWAuthenticate], Any]] = ...) -> WWWAuthenticate: ... +def parse_if_range_header(value: Optional[Text]) -> IfRange: ... +def parse_range_header(value: Optional[Text], make_inclusive: bool = ...) -> Optional[Range]: ... +def parse_content_range_header(value: Optional[Text], + on_update: Optional[Callable[[ContentRange], Any]] = ...) -> Optional[ContentRange]: ... +def quote_etag(etag: _Str, weak: bool = ...) -> _Str: ... +def unquote_etag(etag: Optional[_Str]) -> Tuple[Optional[_Str], Optional[_Str]]: ... +def parse_etags(value: Optional[Text]) -> ETags: ... +def generate_etag(data: _ETagData) -> str: ... +def parse_date(value: Optional[str]) -> Optional[datetime]: ... +def cookie_date(expires: Union[None, float, datetime] = ...) -> str: ... +def http_date(timestamp: Union[None, float, datetime] = ...) -> str: ... +def parse_age(value: Optional[SupportsInt] = ...) -> Optional[timedelta]: ... +def dump_age(age: Union[None, timedelta, SupportsInt]) -> Optional[str]: ... +def is_resource_modified(environ: WSGIEnvironment, etag: Optional[Text] = ..., data: Optional[_ETagData] = ..., + last_modified: Union[None, Text, datetime] = ..., ignore_if_range: bool = ...) -> bool: ... +def remove_entity_headers(headers: Union[List[Tuple[Text, Text]], Headers], allowed: Iterable[Text] = ...) -> None: ... +def remove_hop_by_hop_headers(headers: Union[List[Tuple[Text, Text]], Headers]) -> None: ... +def is_entity_header(header: Text) -> bool: ... +def is_hop_by_hop_header(header: Text) -> bool: ... +@overload +def parse_cookie(header: Union[None, WSGIEnvironment, Text, bytes], charset: Text = ..., + errors: Text = ...) -> TypeConversionDict: ... +@overload +def parse_cookie(header: Union[None, WSGIEnvironment, Text, bytes], charset: Text = ..., + errors: Text = ..., cls: Optional[Callable[[Iterable[Tuple[Text, Text]]], _T]] = ...) -> _T: ... +def dump_cookie(key: _ToBytes, value: _ToBytes = ..., max_age: Union[None, float, timedelta] = ..., + expires: Union[None, Text, float, datetime] = ..., path: Union[None, tuple, str, bytes] = ..., + domain: Union[None, str, bytes] = ..., secure: bool = ..., httponly: bool = ..., charset: Text = ..., + sync_expires: bool = ...) -> str: ... +def is_byte_range_valid(start: Optional[int], stop: Optional[int], length: Optional[int]) -> bool: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/local.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/local.pyi new file mode 100644 index 0000000..0fe642d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/local.pyi @@ -0,0 +1,100 @@ +from typing import Any, Optional + +def release_local(local): ... + +class Local: + def __init__(self): ... + def __iter__(self): ... + def __call__(self, proxy): ... + def __release_local__(self): ... + def __getattr__(self, name): ... + def __setattr__(self, name, value): ... + def __delattr__(self, name): ... + +class LocalStack: + def __init__(self): ... + def __release_local__(self): ... + def _get__ident_func__(self): ... + def _set__ident_func__(self, value): ... + __ident_func__: Any + def __call__(self): ... + def push(self, obj): ... + def pop(self): ... + @property + def top(self): ... + +class LocalManager: + locals: Any + ident_func: Any + def __init__(self, locals: Optional[Any] = ..., ident_func: Optional[Any] = ...): ... + def get_ident(self): ... + def cleanup(self): ... + def make_middleware(self, app): ... + def middleware(self, func): ... + +class LocalProxy: + def __init__(self, local, name: Optional[Any] = ...): ... + @property + def __dict__(self): ... + def __bool__(self): ... + def __unicode__(self): ... + def __dir__(self): ... + def __getattr__(self, name): ... + def __setitem__(self, key, value): ... + def __delitem__(self, key): ... + __getslice__: Any + def __setslice__(self, i, j, seq): ... + def __delslice__(self, i, j): ... + __setattr__: Any + __delattr__: Any + __lt__: Any + __le__: Any + __eq__: Any + __ne__: Any + __gt__: Any + __ge__: Any + __cmp__: Any + __hash__: Any + __call__: Any + __len__: Any + __getitem__: Any + __iter__: Any + __contains__: Any + __add__: Any + __sub__: Any + __mul__: Any + __floordiv__: Any + __mod__: Any + __divmod__: Any + __pow__: Any + __lshift__: Any + __rshift__: Any + __and__: Any + __xor__: Any + __or__: Any + __div__: Any + __truediv__: Any + __neg__: Any + __pos__: Any + __abs__: Any + __invert__: Any + __complex__: Any + __int__: Any + __long__: Any + __float__: Any + __oct__: Any + __hex__: Any + __index__: Any + __coerce__: Any + __enter__: Any + __exit__: Any + __radd__: Any + __rsub__: Any + __rmul__: Any + __rdiv__: Any + __rtruediv__: Any + __rfloordiv__: Any + __rmod__: Any + __rdivmod__: Any + __copy__: Any + __deepcopy__: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/posixemulation.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/posixemulation.pyi new file mode 100644 index 0000000..f666929 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/posixemulation.pyi @@ -0,0 +1,7 @@ +from typing import Any +from ._compat import to_unicode as to_unicode +from .filesystem import get_filesystem_encoding as get_filesystem_encoding + +can_rename_open_file: Any + +def rename(src, dst): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/routing.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/routing.pyi new file mode 100644 index 0000000..347af55 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/routing.pyi @@ -0,0 +1,189 @@ +from typing import Any, Optional, Text +from werkzeug.exceptions import HTTPException + +def parse_converter_args(argstr): ... +def parse_rule(rule): ... + +class RoutingException(Exception): ... + +class RequestRedirect(HTTPException, RoutingException): + code: Any + new_url: Any + def __init__(self, new_url): ... + def get_response(self, environ): ... + +class RequestSlash(RoutingException): ... + +class RequestAliasRedirect(RoutingException): + matched_values: Any + def __init__(self, matched_values): ... + +class BuildError(RoutingException, LookupError): + endpoint: Any + values: Any + method: Any + adapter: Optional[MapAdapter] + def __init__(self, endpoint, values, method, adapter: Optional[MapAdapter] = ...) -> None: ... + @property + def suggested(self) -> Optional[Rule]: ... + def closest_rule(self, adapter: Optional[MapAdapter]) -> Optional[Rule]: ... + +class ValidationError(ValueError): ... + +class RuleFactory: + def get_rules(self, map): ... + +class Subdomain(RuleFactory): + subdomain: Any + rules: Any + def __init__(self, subdomain, rules): ... + def get_rules(self, map): ... + +class Submount(RuleFactory): + path: Any + rules: Any + def __init__(self, path, rules): ... + def get_rules(self, map): ... + +class EndpointPrefix(RuleFactory): + prefix: Any + rules: Any + def __init__(self, prefix, rules): ... + def get_rules(self, map): ... + +class RuleTemplate: + rules: Any + def __init__(self, rules): ... + def __call__(self, *args, **kwargs): ... + +class RuleTemplateFactory(RuleFactory): + rules: Any + context: Any + def __init__(self, rules, context): ... + def get_rules(self, map): ... + +class Rule(RuleFactory): + rule: Any + is_leaf: Any + map: Any + strict_slashes: Any + subdomain: Any + host: Any + defaults: Any + build_only: Any + alias: Any + methods: Any + endpoint: Any + redirect_to: Any + arguments: Any + def __init__(self, string, defaults: Optional[Any] = ..., subdomain: Optional[Any] = ..., methods: Optional[Any] = ..., + build_only: bool = ..., endpoint: Optional[Any] = ..., strict_slashes: Optional[Any] = ..., + redirect_to: Optional[Any] = ..., alias: bool = ..., host: Optional[Any] = ...): ... + def empty(self): ... + def get_empty_kwargs(self): ... + def get_rules(self, map): ... + def refresh(self): ... + def bind(self, map, rebind: bool = ...): ... + def get_converter(self, variable_name, converter_name, args, kwargs): ... + def compile(self): ... + def match(self, path, method: Optional[Any] = ...): ... + def build(self, values, append_unknown: bool = ...): ... + def provides_defaults_for(self, rule): ... + def suitable_for(self, values, method: Optional[Any] = ...): ... + def match_compare_key(self): ... + def build_compare_key(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class BaseConverter: + regex: Any + weight: Any + map: Any + def __init__(self, map): ... + def to_python(self, value): ... + def to_url(self, value): ... + +class UnicodeConverter(BaseConverter): + regex: Any + def __init__(self, map, minlength: int = ..., maxlength: Optional[Any] = ..., length: Optional[Any] = ...): ... + +class AnyConverter(BaseConverter): + regex: Any + def __init__(self, map, *items): ... + +class PathConverter(BaseConverter): + regex: Any + weight: Any + +class NumberConverter(BaseConverter): + weight: Any + fixed_digits: Any + min: Any + max: Any + def __init__(self, map, fixed_digits: int = ..., min: Optional[Any] = ..., max: Optional[Any] = ...): ... + def to_python(self, value): ... + def to_url(self, value): ... + +class IntegerConverter(NumberConverter): + regex: Any + num_convert: Any + +class FloatConverter(NumberConverter): + regex: Any + num_convert: Any + def __init__(self, map, min: Optional[Any] = ..., max: Optional[Any] = ...): ... + +class UUIDConverter(BaseConverter): + regex: Any + def to_python(self, value): ... + def to_url(self, value): ... + +DEFAULT_CONVERTERS: Any + +class Map: + default_converters: Any + default_subdomain: Any + charset: Text + encoding_errors: Text + strict_slashes: Any + redirect_defaults: Any + host_matching: Any + converters: Any + sort_parameters: Any + sort_key: Any + def __init__(self, rules: Optional[Any] = ..., default_subdomain: str = ..., charset: Text = ..., + strict_slashes: bool = ..., redirect_defaults: bool = ..., converters: Optional[Any] = ..., + sort_parameters: bool = ..., sort_key: Optional[Any] = ..., encoding_errors: Text = ..., + host_matching: bool = ...): ... + def is_endpoint_expecting(self, endpoint, *arguments): ... + def iter_rules(self, endpoint: Optional[Any] = ...): ... + def add(self, rulefactory): ... + def bind(self, server_name, script_name: Optional[Any] = ..., subdomain: Optional[Any] = ..., url_scheme: str = ..., + default_method: str = ..., path_info: Optional[Any] = ..., query_args: Optional[Any] = ...): ... + def bind_to_environ(self, environ, server_name: Optional[Any] = ..., subdomain: Optional[Any] = ...): ... + def update(self): ... + +class MapAdapter: + map: Any + server_name: Any + script_name: Any + subdomain: Any + url_scheme: Any + path_info: Any + default_method: Any + query_args: Any + def __init__(self, map, server_name, script_name, subdomain, url_scheme, path_info, default_method, + query_args: Optional[Any] = ...): ... + def dispatch(self, view_func, path_info: Optional[Any] = ..., method: Optional[Any] = ..., + catch_http_exceptions: bool = ...): ... + def match(self, path_info: Optional[Any] = ..., method: Optional[Any] = ..., return_rule: bool = ..., + query_args: Optional[Any] = ...): ... + def test(self, path_info: Optional[Any] = ..., method: Optional[Any] = ...): ... + def allowed_methods(self, path_info: Optional[Any] = ...): ... + def get_host(self, domain_part): ... + def get_default_redirect(self, rule, method, values, query_args): ... + def encode_query_args(self, query_args): ... + def make_redirect_url(self, path_info, query_args: Optional[Any] = ..., domain_part: Optional[Any] = ...): ... + def make_alias_redirect_url(self, path, endpoint, values, method, query_args): ... + def build(self, endpoint, values: Optional[Any] = ..., method: Optional[Any] = ..., force_external: bool = ..., + append_unknown: bool = ...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/script.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/script.pyi new file mode 100644 index 0000000..b9db97a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/script.pyi @@ -0,0 +1,14 @@ +from typing import Any, Optional + +argument_types: Any +converters: Any + +def run(namespace: Optional[Any] = ..., action_prefix: str = ..., args: Optional[Any] = ...): ... +def fail(message, code: int = ...): ... +def find_actions(namespace, action_prefix): ... +def print_usage(actions): ... +def analyse_action(func): ... +def make_shell(init_func: Optional[Any] = ..., banner: Optional[Any] = ..., use_ipython: bool = ...): ... +def make_runserver(app_factory, hostname: str = ..., port: int = ..., use_reloader: bool = ..., use_debugger: bool = ..., + use_evalex: bool = ..., threaded: bool = ..., processes: int = ..., static_files: Optional[Any] = ..., + extra_files: Optional[Any] = ..., ssl_context: Optional[Any] = ...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/security.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/security.pyi new file mode 100644 index 0000000..fcb2652 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/security.pyi @@ -0,0 +1,12 @@ +from typing import Any, Optional + +SALT_CHARS: Any +DEFAULT_PBKDF2_ITERATIONS: Any + +def pbkdf2_hex(data, salt, iterations=..., keylen: Optional[Any] = ..., hashfunc: Optional[Any] = ...): ... +def pbkdf2_bin(data, salt, iterations=..., keylen: Optional[Any] = ..., hashfunc: Optional[Any] = ...): ... +def safe_str_cmp(a, b): ... +def gen_salt(length): ... +def generate_password_hash(password, method: str = ..., salt_length: int = ...): ... +def check_password_hash(pwhash, password): ... +def safe_join(directory, filename): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/serving.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/serving.pyi new file mode 100644 index 0000000..54bce97 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/serving.pyi @@ -0,0 +1,93 @@ +import sys +from typing import Any, Optional + +if sys.version_info < (3,): + from SocketServer import ThreadingMixIn, ForkingMixIn + from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler +else: + from socketserver import ThreadingMixIn, ForkingMixIn + from http.server import HTTPServer, BaseHTTPRequestHandler + +class _SslDummy: + def __getattr__(self, name): ... + +ssl: Any +LISTEN_QUEUE: Any +can_open_by_fd: Any + +class WSGIRequestHandler(BaseHTTPRequestHandler): + @property + def server_version(self): ... + def make_environ(self): ... + environ: Any + close_connection: Any + def run_wsgi(self): ... + def handle(self): ... + def initiate_shutdown(self): ... + def connection_dropped(self, error, environ: Optional[Any] = ...): ... + raw_requestline: Any + def handle_one_request(self): ... + def send_response(self, code, message: Optional[Any] = ...): ... + def version_string(self): ... + def address_string(self): ... + def port_integer(self): ... + def log_request(self, code: object = ..., size: object = ...) -> None: ... + def log_error(self, *args): ... + def log_message(self, format, *args): ... + def log(self, type, message, *args): ... + +BaseRequestHandler: Any + +def generate_adhoc_ssl_pair(cn: Optional[Any] = ...): ... +def make_ssl_devcert(base_path, host: Optional[Any] = ..., cn: Optional[Any] = ...): ... +def generate_adhoc_ssl_context(): ... +def load_ssl_context(cert_file, pkey_file: Optional[Any] = ..., protocol: Optional[Any] = ...): ... + +class _SSLContext: + def __init__(self, protocol): ... + def load_cert_chain(self, certfile, keyfile: Optional[Any] = ..., password: Optional[Any] = ...): ... + def wrap_socket(self, sock, **kwargs): ... + +def is_ssl_error(error: Optional[Any] = ...): ... +def select_ip_version(host, port): ... + +class BaseWSGIServer(HTTPServer): + multithread: Any + multiprocess: Any + request_queue_size: Any + address_family: Any + app: Any + passthrough_errors: Any + shutdown_signal: Any + host: Any + port: Any + socket: Any + server_address: Any + ssl_context: Any + def __init__(self, host, port, app, handler: Optional[Any] = ..., passthrough_errors: bool = ..., + ssl_context: Optional[Any] = ..., fd: Optional[Any] = ...): ... + def log(self, type, message, *args): ... + def serve_forever(self): ... + def handle_error(self, request, client_address): ... + def get_request(self): ... + +class ThreadedWSGIServer(ThreadingMixIn, BaseWSGIServer): + multithread: Any + daemon_threads: Any + +class ForkingWSGIServer(ForkingMixIn, BaseWSGIServer): + multiprocess: Any + max_children: Any + def __init__(self, host, port, app, processes: int = ..., handler: Optional[Any] = ..., passthrough_errors: bool = ..., + ssl_context: Optional[Any] = ..., fd: Optional[Any] = ...): ... + +def make_server(host: Optional[Any] = ..., port: Optional[Any] = ..., app: Optional[Any] = ..., threaded: bool = ..., + processes: int = ..., request_handler: Optional[Any] = ..., passthrough_errors: bool = ..., + ssl_context: Optional[Any] = ..., fd: Optional[Any] = ...): ... +def is_running_from_reloader(): ... +def run_simple(hostname, port, application, use_reloader: bool = ..., use_debugger: bool = ..., use_evalex: bool = ..., + extra_files: Optional[Any] = ..., reloader_interval: int = ..., reloader_type: str = ..., threaded: bool = ..., + processes: int = ..., request_handler: Optional[Any] = ..., static_files: Optional[Any] = ..., + passthrough_errors: bool = ..., ssl_context: Optional[Any] = ...): ... +def run_with_reloader(*args, **kwargs): ... +def main(): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/test.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/test.pyi new file mode 100644 index 0000000..c67189e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/test.pyi @@ -0,0 +1,94 @@ +import sys +from typing import Any, Optional, Text + +if sys.version_info < (3,): + from urllib2 import Request as U2Request + from cookielib import CookieJar +else: + from urllib.request import Request as U2Request + from http.cookiejar import CookieJar + +def stream_encode_multipart(values, use_tempfile: int = ..., threshold=..., boundary: Optional[Any] = ..., + charset: Text = ...): ... +def encode_multipart(values, boundary: Optional[Any] = ..., charset: Text = ...): ... +def File(fd, filename: Optional[Any] = ..., mimetype: Optional[Any] = ...): ... + +class _TestCookieHeaders: + headers: Any + def __init__(self, headers): ... + def getheaders(self, name): ... + def get_all(self, name, default: Optional[Any] = ...): ... + +class _TestCookieResponse: + headers: Any + def __init__(self, headers): ... + def info(self): ... + +class _TestCookieJar(CookieJar): + def inject_wsgi(self, environ): ... + def extract_wsgi(self, environ, headers): ... + +class EnvironBuilder: + server_protocol: Any + wsgi_version: Any + request_class: Any + charset: Text + path: Any + base_url: Any + query_string: Any + args: Any + method: Any + headers: Any + content_type: Any + errors_stream: Any + multithread: Any + multiprocess: Any + run_once: Any + environ_base: Any + environ_overrides: Any + input_stream: Any + content_length: Any + closed: Any + def __init__(self, path: str = ..., base_url: Optional[Any] = ..., query_string: Optional[Any] = ..., + method: str = ..., input_stream: Optional[Any] = ..., content_type: Optional[Any] = ..., + content_length: Optional[Any] = ..., errors_stream: Optional[Any] = ..., multithread: bool = ..., + multiprocess: bool = ..., run_once: bool = ..., headers: Optional[Any] = ..., data: Optional[Any] = ..., + environ_base: Optional[Any] = ..., environ_overrides: Optional[Any] = ..., charset: Text = ...): ... + form: Any + files: Any + @property + def server_name(self): ... + @property + def server_port(self): ... + def __del__(self): ... + def close(self): ... + def get_environ(self): ... + def get_request(self, cls: Optional[Any] = ...): ... + +class ClientRedirectError(Exception): ... + +class Client: + application: Any + response_wrapper: Any + cookie_jar: Any + allow_subdomain_redirects: Any + def __init__(self, application, response_wrapper: Optional[Any] = ..., use_cookies: bool = ..., + allow_subdomain_redirects: bool = ...): ... + def set_cookie(self, server_name, key, value: str = ..., max_age: Optional[Any] = ..., expires: Optional[Any] = ..., + path: str = ..., domain: Optional[Any] = ..., secure: Optional[Any] = ..., httponly: bool = ..., + charset: Text = ...): ... + def delete_cookie(self, server_name, key, path: str = ..., domain: Optional[Any] = ...): ... + def run_wsgi_app(self, environ, buffered: bool = ...): ... + def resolve_redirect(self, response, new_location, environ, buffered: bool = ...): ... + def open(self, *args, **kwargs): ... + def get(self, *args, **kw): ... + def patch(self, *args, **kw): ... + def post(self, *args, **kw): ... + def head(self, *args, **kw): ... + def put(self, *args, **kw): ... + def delete(self, *args, **kw): ... + def options(self, *args, **kw): ... + def trace(self, *args, **kw): ... + +def create_environ(*args, **kwargs): ... +def run_wsgi_app(app, environ, buffered: bool = ...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/testapp.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/testapp.pyi new file mode 100644 index 0000000..e45ea4a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/testapp.pyi @@ -0,0 +1,9 @@ +from typing import Any +from werkzeug.wrappers import BaseRequest as Request, BaseResponse as Response + +logo: Any +TEMPLATE: Any + +def iter_sys_path(): ... +def render_testapp(req): ... +def test_app(environ, start_response): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/urls.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/urls.pyi new file mode 100644 index 0000000..e0b1306 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/urls.pyi @@ -0,0 +1,72 @@ +from collections import namedtuple +from typing import Any, Optional, Text + + +_URLTuple = namedtuple( + '_URLTuple', + ['scheme', 'netloc', 'path', 'query', 'fragment'] +) + + +class BaseURL(_URLTuple): + def replace(self, **kwargs): ... + @property + def host(self): ... + @property + def ascii_host(self): ... + @property + def port(self): ... + @property + def auth(self): ... + @property + def username(self): ... + @property + def raw_username(self): ... + @property + def password(self): ... + @property + def raw_password(self): ... + def decode_query(self, *args, **kwargs): ... + def join(self, *args, **kwargs): ... + def to_url(self): ... + def decode_netloc(self): ... + def to_uri_tuple(self): ... + def to_iri_tuple(self): ... + def get_file_location(self, pathformat: Optional[Any] = ...): ... + +class URL(BaseURL): + def encode_netloc(self): ... + def encode(self, charset: Text = ..., errors: Text = ...): ... + +class BytesURL(BaseURL): + def encode_netloc(self): ... + def decode(self, charset: Text = ..., errors: Text = ...): ... + +def url_parse(url, scheme: Optional[Any] = ..., allow_fragments: bool = ...): ... +def url_quote(string, charset: Text = ..., errors: Text = ..., safe: str = ..., unsafe: str = ...): ... +def url_quote_plus(string, charset: Text = ..., errors: Text = ..., safe: str = ...): ... +def url_unparse(components): ... +def url_unquote(string, charset: Text = ..., errors: Text = ..., unsafe: str = ...): ... +def url_unquote_plus(s, charset: Text = ..., errors: Text = ...): ... +def url_fix(s, charset: Text = ...): ... +def uri_to_iri(uri, charset: Text = ..., errors: Text = ...): ... +def iri_to_uri(iri, charset: Text = ..., errors: Text = ..., safe_conversion: bool = ...): ... +def url_decode(s, charset: Text = ..., decode_keys: bool = ..., include_empty: bool = ..., errors: Text = ..., + separator: str = ..., cls: Optional[Any] = ...): ... +def url_decode_stream(stream, charset: Text = ..., decode_keys: bool = ..., include_empty: bool = ..., errors: Text = ..., + separator: str = ..., cls: Optional[Any] = ..., limit: Optional[Any] = ..., + return_iterator: bool = ...): ... +def url_encode(obj, charset: Text = ..., encode_keys: bool = ..., sort: bool = ..., key: Optional[Any] = ..., + separator: bytes = ...): ... +def url_encode_stream(obj, stream: Optional[Any] = ..., charset: Text = ..., encode_keys: bool = ..., sort: bool = ..., + key: Optional[Any] = ..., separator: bytes = ...): ... +def url_join(base, url, allow_fragments: bool = ...): ... + +class Href: + base: Any + charset: Text + sort: Any + key: Any + def __init__(self, base: str = ..., charset: Text = ..., sort: bool = ..., key: Optional[Any] = ...): ... + def __getattr__(self, name): ... + def __call__(self, *path, **query): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/useragents.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/useragents.pyi new file mode 100644 index 0000000..c7e8363 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/useragents.pyi @@ -0,0 +1,14 @@ +from typing import Any + +class UserAgentParser: + platforms: Any + browsers: Any + def __init__(self): ... + def __call__(self, user_agent): ... + +class UserAgent: + string: Any + def __init__(self, environ_or_string): ... + def to_header(self): ... + def __nonzero__(self): ... + __bool__: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/utils.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/utils.pyi new file mode 100644 index 0000000..92465ef --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/utils.pyi @@ -0,0 +1,58 @@ +from typing import Any, Optional, overload, Type, TypeVar +from werkzeug._internal import _DictAccessorProperty +from werkzeug.wrappers import Response + +class cached_property(property): + __name__: Any + __module__: Any + __doc__: Any + func: Any + def __init__(self, func, name: Optional[Any] = ..., doc: Optional[Any] = ...): ... + def __set__(self, obj, value): ... + def __get__(self, obj, type: Optional[Any] = ...): ... + +class environ_property(_DictAccessorProperty): + read_only: Any + def lookup(self, obj): ... + +class header_property(_DictAccessorProperty): + def lookup(self, obj): ... + +class HTMLBuilder: + def __init__(self, dialect): ... + def __call__(self, s): ... + def __getattr__(self, tag): ... + +html: Any +xhtml: Any + +def get_content_type(mimetype, charset): ... +def format_string(string, context): ... +def secure_filename(filename): ... +def escape(s, quote: Optional[Any] = ...): ... +def unescape(s): ... + +# 'redirect' returns a werkzeug Response, unless you give it +# another Response type to use instead. +_RC = TypeVar("_RC", bound=Response) +@overload +def redirect(location, code: int = ..., Response: None = ...) -> Response: ... +@overload +def redirect(location, code: int = ..., Response: Type[_RC] = ...) -> _RC: ... + +def append_slash_redirect(environ, code: int = ...): ... +def import_string(import_name, silent: bool = ...): ... +def find_modules(import_path, include_packages: bool = ..., recursive: bool = ...): ... +def validate_arguments(func, args, kwargs, drop_extra: bool = ...): ... +def bind_arguments(func, args, kwargs): ... + +class ArgumentValidationError(ValueError): + missing: Any + extra: Any + extra_positional: Any + def __init__(self, missing: Optional[Any] = ..., extra: Optional[Any] = ..., extra_positional: Optional[Any] = ...): ... + +class ImportStringError(ImportError): + import_name: Any + exception: Any + def __init__(self, import_name, exception): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/wrappers.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/wrappers.pyi new file mode 100644 index 0000000..74cb6ff --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/wrappers.pyi @@ -0,0 +1,249 @@ +from datetime import datetime +from typing import ( + Any, Callable, Iterable, Iterator, Mapping, MutableMapping, Optional, Sequence, Text, Tuple, Type, TypeVar, Union, +) + +from wsgiref.types import WSGIEnvironment, InputStream + +from .datastructures import ( + Authorization, CombinedMultiDict, EnvironHeaders, Headers, ImmutableMultiDict, + MultiDict, ImmutableTypeConversionDict, HeaderSet, + Accept, MIMEAccept, CharsetAccept, LanguageAccept, +) +from .useragents import UserAgent + +class BaseRequest: + charset: str + encoding_errors: str + max_content_length: Optional[int] + max_form_memory_size: int + parameter_storage_class: Type + list_storage_class: Type + dict_storage_class: Type + form_data_parser_class: Type + trusted_hosts: Optional[Sequence[Text]] + disable_data_descriptor: Any + environ: WSGIEnvironment = ... + shallow: Any + def __init__(self, environ: WSGIEnvironment, populate_request: bool = ..., shallow: bool = ...) -> None: ... + @property + def url_charset(self) -> str: ... + @classmethod + def from_values(cls, *args, **kwargs) -> BaseRequest: ... + @classmethod + def application(cls, f): ... + @property + def want_form_data_parsed(self): ... + def make_form_data_parser(self): ... + def close(self) -> None: ... + def __enter__(self): ... + def __exit__(self, exc_type, exc_value, tb): ... + @property + def stream(self) -> InputStream: ... + input_stream: InputStream + args: ImmutableMultiDict + @property + def data(self) -> bytes: ... + # TODO: once Literal types are supported, overload with as_text + def get_data(self, cache: bool = ..., as_text: bool = ..., parse_form_data: bool = ...) -> Any: ... # returns bytes if as_text is False (the default), else Text + form: ImmutableMultiDict + values: CombinedMultiDict + files: MultiDict + @property + def cookies(self) -> ImmutableTypeConversionDict[str, str]: ... + headers: EnvironHeaders + path: Text + full_path: Text + script_root: Text + url: Text + base_url: Text + url_root: Text + host_url: Text + host: Text + query_string: bytes + method: Text + @property + def access_route(self) -> Sequence[str]: ... + @property + def remote_addr(self) -> str: ... + remote_user: Text + scheme: str + is_xhr: bool + is_secure: bool + is_multithread: bool + is_multiprocess: bool + is_run_once: bool + + # These are not preset at runtime but we add them since monkeypatching this + # class is quite common. + def __setattr__(self, name: str, value: Any): ... + def __getattr__(self, name: str): ... + +_OnCloseT = TypeVar('_OnCloseT', bound=Callable[[], Any]) +_SelfT = TypeVar('_SelfT', bound=BaseResponse) + +class BaseResponse: + charset: str + default_status: int + default_mimetype: str + implicit_sequence_conversion: bool + autocorrect_location_header: bool + automatically_set_content_length: bool + headers: Headers + status_code: int + status: str + direct_passthrough: bool + response: Iterable[bytes] + def __init__(self, response: Optional[Union[str, bytes, bytearray, Iterable[str], Iterable[bytes]]] = ..., + status: Optional[Union[Text, int]] = ..., + headers: Optional[Union[Headers, + Mapping[Text, Text], + Sequence[Tuple[Text, Text]]]] = ..., + mimetype: Optional[Text] = ..., + content_type: Optional[Text] = ..., + direct_passthrough: bool = ...) -> None: ... + def call_on_close(self, func: _OnCloseT) -> _OnCloseT: ... + @classmethod + def force_type(cls: Type[_SelfT], response: object, environ: Optional[WSGIEnvironment] = ...) -> _SelfT: ... + @classmethod + def from_app(cls: Type[_SelfT], app: Any, environ: WSGIEnvironment, buffered: bool = ...) -> _SelfT: ... + # TODO: once Literal types are supported, overload with as_text + def get_data(self, as_text: bool = ...) -> Any: ... # returns bytes if as_text is False (the default), else Text + def set_data(self, value: Union[bytes, Text]) -> None: ... + data: Any + def calculate_content_length(self) -> Optional[int]: ... + def make_sequence(self) -> None: ... + def iter_encoded(self) -> Iterator[bytes]: ... + def set_cookie(self, key, value: str = ..., max_age: Optional[Any] = ..., expires: Optional[Any] = ..., + path: str = ..., domain: Optional[Any] = ..., secure: bool = ..., httponly: bool = ...): ... + def delete_cookie(self, key, path: str = ..., domain: Optional[Any] = ...): ... + @property + def is_streamed(self) -> bool: ... + @property + def is_sequence(self) -> bool: ... + def close(self) -> None: ... + def __enter__(self): ... + def __exit__(self, exc_type, exc_value, tb): ... + # The no_etag argument if fictional, but required for compatibility with + # ETagResponseMixin + def freeze(self, no_etag: bool = ...) -> None: ... + def get_wsgi_headers(self, environ): ... + def get_app_iter(self, environ): ... + def get_wsgi_response(self, environ): ... + def __call__(self, environ, start_response): ... + +class AcceptMixin(object): + @property + def accept_mimetypes(self) -> MIMEAccept: ... + @property + def accept_charsets(self) -> CharsetAccept: ... + @property + def accept_encodings(self) -> Accept: ... + @property + def accept_languages(self) -> LanguageAccept: ... + +class ETagRequestMixin: + @property + def cache_control(self): ... + @property + def if_match(self): ... + @property + def if_none_match(self): ... + @property + def if_modified_since(self): ... + @property + def if_unmodified_since(self): ... + @property + def if_range(self): ... + @property + def range(self): ... + +class UserAgentMixin: + @property + def user_agent(self) -> UserAgent: ... + +class AuthorizationMixin: + @property + def authorization(self) -> Optional[Authorization]: ... + +class StreamOnlyMixin: + disable_data_descriptor: Any + want_form_data_parsed: Any + +class ETagResponseMixin: + @property + def cache_control(self): ... + status_code: Any + def make_conditional(self, request_or_environ, accept_ranges: bool = ..., complete_length: Optional[Any] = ...): ... + def add_etag(self, overwrite: bool = ..., weak: bool = ...): ... + def set_etag(self, etag, weak: bool = ...): ... + def get_etag(self): ... + def freeze(self, no_etag: bool = ...) -> None: ... + accept_ranges: Any + content_range: Any + +class ResponseStream: + mode: Any + response: Any + closed: Any + def __init__(self, response): ... + def write(self, value): ... + def writelines(self, seq): ... + def close(self): ... + def flush(self): ... + def isatty(self): ... + @property + def encoding(self): ... + +class ResponseStreamMixin: + @property + def stream(self) -> ResponseStream: ... + +class CommonRequestDescriptorsMixin: + @property + def content_type(self) -> Optional[str]: ... + @property + def content_length(self) -> Optional[int]: ... + @property + def content_encoding(self) -> Optional[str]: ... + @property + def content_md5(self) -> Optional[str]: ... + @property + def referrer(self) -> Optional[str]: ... + @property + def date(self) -> Optional[datetime]: ... + @property + def max_forwards(self) -> Optional[int]: ... + @property + def mimetype(self) -> str: ... + @property + def mimetype_params(self) -> Mapping[str, str]: ... + @property + def pragma(self) -> HeaderSet: ... + +class CommonResponseDescriptorsMixin: + mimetype: Optional[str] = ... + @property + def mimetype_params(self) -> MutableMapping[str, str]: ... + location: Optional[str] = ... + age: Any = ... # get: Optional[datetime.timedelta] + content_type: Optional[str] = ... + content_length: Optional[int] = ... + content_location: Optional[str] = ... + content_encoding: Optional[str] = ... + content_md5: Optional[str] = ... + date: Any = ... # get: Optional[datetime.datetime] + expires: Any = ... # get: Optional[datetime.datetime] + last_modified: Any = ... # get: Optional[datetime.datetime] + retry_after: Any = ... # get: Optional[datetime.datetime] + vary: Optional[str] = ... + content_language: Optional[str] = ... + allow: Optional[str] = ... + +class WWWAuthenticateMixin: + @property + def www_authenticate(self): ... + +class Request(BaseRequest, AcceptMixin, ETagRequestMixin, UserAgentMixin, AuthorizationMixin, CommonRequestDescriptorsMixin): ... +class PlainRequest(StreamOnlyMixin, Request): ... +class Response(BaseResponse, ETagResponseMixin, ResponseStreamMixin, CommonResponseDescriptorsMixin, WWWAuthenticateMixin): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/wsgi.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/wsgi.pyi new file mode 100644 index 0000000..87deff4 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/wsgi.pyi @@ -0,0 +1,91 @@ +from typing import Any, Optional, Protocol, Iterable, Text +from wsgiref.types import WSGIEnvironment, InputStream + +def responder(f): ... +def get_current_url(environ, root_only: bool = ..., strip_querystring: bool = ..., host_only: bool = ..., + trusted_hosts: Optional[Any] = ...): ... +def host_is_trusted(hostname, trusted_list): ... +def get_host(environ, trusted_hosts: Optional[Any] = ...): ... +def get_content_length(environ: WSGIEnvironment) -> Optional[int]: ... +def get_input_stream(environ: WSGIEnvironment, safe_fallback: bool = ...) -> InputStream: ... +def get_query_string(environ): ... +def get_path_info(environ, charset: Text = ..., errors: Text = ...): ... +def get_script_name(environ, charset: Text = ..., errors: Text = ...): ... +def pop_path_info(environ, charset: Text = ..., errors: Text = ...): ... +def peek_path_info(environ, charset: Text = ..., errors: Text = ...): ... +def extract_path_info(environ_or_baseurl, path_or_url, charset: Text = ..., errors: Text = ..., + collapse_http_schemes: bool = ...): ... + +class SharedDataMiddleware: + app: Any + exports: Any + cache: Any + cache_timeout: Any + fallback_mimetype: Any + def __init__(self, app, exports, disallow: Optional[Any] = ..., cache: bool = ..., cache_timeout=..., + fallback_mimetype: str = ...): ... + def is_allowed(self, filename): ... + def get_file_loader(self, filename): ... + def get_package_loader(self, package, package_path): ... + def get_directory_loader(self, directory): ... + def generate_etag(self, mtime, file_size, real_filename): ... + def __call__(self, environ, start_response): ... + +class DispatcherMiddleware: + app: Any + mounts: Any + def __init__(self, app, mounts: Optional[Any] = ...): ... + def __call__(self, environ, start_response): ... + +class ClosingIterator: + def __init__(self, iterable, callbacks: Optional[Any] = ...): ... + def __iter__(self): ... + def __next__(self): ... + def close(self): ... + +class _Readable(Protocol): + def read(self, size: int = ...) -> bytes: ... + +def wrap_file(environ: WSGIEnvironment, file: _Readable, buffer_size: int = ...) -> Iterable[bytes]: ... + +class FileWrapper: + file: _Readable + buffer_size: int + def __init__(self, file: _Readable, buffer_size: int = ...) -> None: ... + def close(self) -> None: ... + def seekable(self) -> bool: ... + def seek(self, offset: int, whence: int = ...) -> None: ... + def tell(self) -> Optional[int]: ... + def __iter__(self) -> FileWrapper: ... + def __next__(self) -> bytes: ... + +class _RangeWrapper: + iterable: Any + byte_range: Any + start_byte: Any + end_byte: Any + read_length: Any + seekable: Any + end_reached: Any + def __init__(self, iterable, start_byte: int = ..., byte_range: Optional[Any] = ...): ... + def __iter__(self): ... + def __next__(self): ... + def close(self): ... + +def make_line_iter(stream, limit: Optional[Any] = ..., buffer_size=..., cap_at_buffer: bool = ...): ... +def make_chunk_iter(stream, separator, limit: Optional[Any] = ..., buffer_size=..., cap_at_buffer: bool = ...): ... + +class LimitedStream: + limit: Any + def __init__(self, stream, limit): ... + def __iter__(self): ... + @property + def is_exhausted(self): ... + def on_exhausted(self): ... + def on_disconnect(self): ... + def exhaust(self, chunk_size=...): ... + def read(self, size: Optional[Any] = ...): ... + def readline(self, size: Optional[Any] = ...): ... + def readlines(self, size: Optional[Any] = ...): ... + def tell(self): ... + def __next__(self): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/yaml/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/yaml/__init__.pyi new file mode 100644 index 0000000..c0fc6a9 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/yaml/__init__.pyi @@ -0,0 +1,82 @@ +from typing import Any, IO, Iterator, Optional, overload, Sequence, Text, Union +import sys +from yaml.error import * # noqa: F403 +from yaml.tokens import * # noqa: F403 +from yaml.events import * # noqa: F403 +from yaml.nodes import * # noqa: F403 +from yaml.loader import * # noqa: F403 +from yaml.dumper import * # noqa: F403 +from . import resolver # Help mypy a bit; this is implied by loader and dumper +from .cyaml import * + +if sys.version_info < (3,): + _Str = Union[Text, str] +else: + _Str = str +# FIXME: the functions really return py2:unicode/py3:str if encoding is None, otherwise py2:str/py3:bytes. Waiting for python/mypy#5621 +_Yaml = Any + +__with_libyaml__: Any +__version__: str + +def scan(stream, Loader=...): ... +def parse(stream, Loader=...): ... +def compose(stream, Loader=...): ... +def compose_all(stream, Loader=...): ... +def load(stream: Union[str, IO[str]], Loader=...) -> Any: ... +def load_all(stream: Union[str, IO[str]], Loader=...) -> Iterator[Any]: ... +def full_load(stream: Union[str, IO[str]]) -> Any: ... +def full_load_all(stream: Union[str, IO[str]]) -> Iterator[Any]: ... +def safe_load(stream: Union[str, IO[str]]) -> Any: ... +def safe_load_all(stream: Union[str, IO[str]]) -> Iterator[Any]: ... +def emit(events, stream=..., Dumper=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=...): ... + +@overload +def serialize_all(nodes, stream: IO[str], Dumper=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=..., encoding=..., explicit_start=..., explicit_end=..., version=..., tags=...) -> None: ... +@overload +def serialize_all(nodes, stream: None = ..., Dumper=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=..., encoding: Optional[_Str] = ..., explicit_start=..., explicit_end=..., version=..., tags=...) -> _Yaml: ... + +@overload +def serialize(node, stream: IO[str], Dumper=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=..., encoding=..., explicit_start=..., explicit_end=..., version=..., tags=...) -> None: ... +@overload +def serialize(node, stream: None = ..., Dumper=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=..., encoding: Optional[_Str] = ..., explicit_start=..., explicit_end=..., version=..., tags=...) -> _Yaml: ... + +@overload +def dump_all(documents: Sequence[Any], stream: IO[str], Dumper=..., default_style=..., default_flow_style=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=..., encoding=..., explicit_start=..., explicit_end=..., version=..., tags=...) -> None: ... +@overload +def dump_all(documents: Sequence[Any], stream: None = ..., Dumper=..., default_style=..., default_flow_style=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=..., encoding: Optional[_Str] = ..., explicit_start=..., explicit_end=..., version=..., tags=...) -> _Yaml: ... + +@overload +def dump(data: Any, stream: IO[str], Dumper=..., default_style=..., default_flow_style=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=..., encoding=..., explicit_start=..., explicit_end=..., version=..., tags=...) -> None: ... +@overload +def dump(data: Any, stream: None = ..., Dumper=..., default_style=..., default_flow_style=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=..., encoding: Optional[_Str] = ..., explicit_start=..., explicit_end=..., version=..., tags=...) -> _Yaml: ... + +@overload +def safe_dump_all(documents: Sequence[Any], stream: IO[str], default_style=..., default_flow_style=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=..., encoding=..., explicit_start=..., explicit_end=..., version=..., tags=...) -> None: ... +@overload +def safe_dump_all(documents: Sequence[Any], stream: None = ..., default_style=..., default_flow_style=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=..., encoding: Optional[_Str] = ..., explicit_start=..., explicit_end=..., version=..., tags=...) -> _Yaml: ... + +@overload +def safe_dump(data: Any, stream: IO[str], default_style=..., default_flow_style=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=..., encoding=..., explicit_start=..., explicit_end=..., version=..., tags=...) -> None: ... +@overload +def safe_dump(data: Any, stream: None = ..., default_style=..., default_flow_style=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=..., encoding: Optional[_Str] = ..., explicit_start=..., explicit_end=..., version=..., tags=...) -> _Yaml: ... + +def add_implicit_resolver(tag, regexp, first=..., Loader=..., Dumper=...): ... +def add_path_resolver(tag, path, kind=..., Loader=..., Dumper=...): ... +def add_constructor(tag, constructor, Loader=...): ... +def add_multi_constructor(tag_prefix, multi_constructor, Loader=...): ... +def add_representer(data_type, representer, Dumper=...): ... +def add_multi_representer(data_type, multi_representer, Dumper=...): ... + +class YAMLObjectMetaclass(type): + def __init__(self, name, bases, kwds) -> None: ... + +class YAMLObject(metaclass=YAMLObjectMetaclass): + yaml_loader: Any + yaml_dumper: Any + yaml_tag: Any + yaml_flow_style: Any + @classmethod + def from_yaml(cls, loader, node): ... + @classmethod + def to_yaml(cls, dumper, data): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/yaml/composer.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/yaml/composer.pyi new file mode 100644 index 0000000..f1e2c03 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/yaml/composer.pyi @@ -0,0 +1,17 @@ +from typing import Any +from yaml.error import Mark, YAMLError, MarkedYAMLError +from yaml.nodes import Node, ScalarNode, CollectionNode, SequenceNode, MappingNode + +class ComposerError(MarkedYAMLError): ... + +class Composer: + anchors: Any + def __init__(self) -> None: ... + def check_node(self): ... + def get_node(self): ... + def get_single_node(self): ... + def compose_document(self): ... + def compose_node(self, parent, index): ... + def compose_scalar_node(self, anchor): ... + def compose_sequence_node(self, anchor): ... + def compose_mapping_node(self, anchor): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/yaml/constructor.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/yaml/constructor.pyi new file mode 100644 index 0000000..27bcdbe --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/yaml/constructor.pyi @@ -0,0 +1,68 @@ +from yaml.error import Mark, YAMLError, MarkedYAMLError +from yaml.nodes import Node, ScalarNode, CollectionNode, SequenceNode, MappingNode + +from typing import Any + +class ConstructorError(MarkedYAMLError): ... + +class BaseConstructor: + yaml_constructors: Any + yaml_multi_constructors: Any + constructed_objects: Any + recursive_objects: Any + state_generators: Any + deep_construct: Any + def __init__(self) -> None: ... + def check_data(self): ... + def get_data(self): ... + def get_single_data(self): ... + def construct_document(self, node): ... + def construct_object(self, node, deep=...): ... + def construct_scalar(self, node): ... + def construct_sequence(self, node, deep=...): ... + def construct_mapping(self, node, deep=...): ... + def construct_pairs(self, node, deep=...): ... + @classmethod + def add_constructor(cls, tag, constructor): ... + @classmethod + def add_multi_constructor(cls, tag_prefix, multi_constructor): ... + +class SafeConstructor(BaseConstructor): + def construct_scalar(self, node): ... + def flatten_mapping(self, node): ... + def construct_mapping(self, node, deep=...): ... + def construct_yaml_null(self, node): ... + bool_values: Any + def construct_yaml_bool(self, node): ... + def construct_yaml_int(self, node): ... + inf_value: Any + nan_value: Any + def construct_yaml_float(self, node): ... + def construct_yaml_binary(self, node): ... + timestamp_regexp: Any + def construct_yaml_timestamp(self, node): ... + def construct_yaml_omap(self, node): ... + def construct_yaml_pairs(self, node): ... + def construct_yaml_set(self, node): ... + def construct_yaml_str(self, node): ... + def construct_yaml_seq(self, node): ... + def construct_yaml_map(self, node): ... + def construct_yaml_object(self, node, cls): ... + def construct_undefined(self, node): ... + +class Constructor(SafeConstructor): + def construct_python_str(self, node): ... + def construct_python_unicode(self, node): ... + def construct_python_long(self, node): ... + def construct_python_complex(self, node): ... + def construct_python_tuple(self, node): ... + def find_python_module(self, name, mark): ... + def find_python_name(self, name, mark): ... + def construct_python_name(self, suffix, node): ... + def construct_python_module(self, suffix, node): ... + class classobj: ... + def make_python_instance(self, suffix, node, args=..., kwds=..., newobj=...): ... + def set_python_instance_state(self, instance, state): ... + def construct_python_object(self, suffix, node): ... + def construct_python_object_apply(self, suffix, node, newobj=...): ... + def construct_python_object_new(self, suffix, node): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/yaml/cyaml.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/yaml/cyaml.pyi new file mode 100644 index 0000000..0eef815 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/yaml/cyaml.pyi @@ -0,0 +1,47 @@ +from typing import Any, IO, Mapping, Optional, Sequence, Text, Union +from typing_extensions import Protocol + +from yaml.constructor import BaseConstructor, Constructor, SafeConstructor +from yaml.representer import BaseRepresenter, Representer, SafeRepresenter +from yaml.resolver import BaseResolver, Resolver +from yaml.serializer import Serializer + +class _Readable(Protocol): + def read(self, size: int) -> Union[Text, bytes]: ... + +class CParser: + def __init__(self, stream: Union[str, bytes, _Readable]) -> None: ... + +class CBaseLoader(CParser, BaseConstructor, BaseResolver): + def __init__(self, stream: Union[str, bytes, _Readable]) -> None: ... + +class CLoader(CParser, SafeConstructor, Resolver): + def __init__(self, stream: Union[str, bytes, _Readable]) -> None: ... + +class CSafeLoader(CParser, SafeConstructor, Resolver): + def __init__(self, stream: Union[str, bytes, _Readable]) -> None: ... + +class CDangerLoader(CParser, Constructor, Resolver): ... # undocumented + +class CEmitter(object): + def __init__(self, stream: IO[Any], canonical: Optional[Any] = ..., + indent: Optional[int] = ..., width: Optional[int] = ..., + allow_unicode: Optional[Any] = ..., line_break: Optional[str] = ..., + encoding: Optional[Text] = ..., explicit_start: Optional[Any] = ..., + explicit_end: Optional[Any] = ..., version: Optional[Sequence[int]] = ..., + tags: Optional[Mapping[Text, Text]] = ...) -> None: ... + +class CBaseDumper(CEmitter, BaseRepresenter, BaseResolver): + def __init__(self, stream: IO[Any], default_style: Optional[str] = ..., + default_flow_style: Optional[bool] = ..., canonical: Optional[Any] = ..., + indent: Optional[int] = ..., width: Optional[int] = ..., + allow_unicode: Optional[Any] = ..., line_break: Optional[str] = ..., + encoding: Optional[Text] = ..., explicit_start: Optional[Any] = ..., + explicit_end: Optional[Any] = ..., version: Optional[Sequence[int]] = ..., + tags: Optional[Mapping[Text, Text]] = ...) -> None: ... + +class CDumper(CEmitter, SafeRepresenter, Resolver): ... + +CSafeDumper = CDumper + +class CDangerDumper(CEmitter, Serializer, Representer, Resolver): ... # undocumented diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/yaml/dumper.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/yaml/dumper.pyi new file mode 100644 index 0000000..0586f13 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/yaml/dumper.pyi @@ -0,0 +1,13 @@ +from yaml.emitter import Emitter +from yaml.serializer import Serializer +from yaml.representer import BaseRepresenter, Representer, SafeRepresenter +from yaml.resolver import BaseResolver, Resolver + +class BaseDumper(Emitter, Serializer, BaseRepresenter, BaseResolver): + def __init__(self, stream, default_style=..., default_flow_style=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=..., encoding=..., explicit_start=..., explicit_end=..., version=..., tags=...) -> None: ... + +class SafeDumper(Emitter, Serializer, SafeRepresenter, Resolver): + def __init__(self, stream, default_style=..., default_flow_style=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=..., encoding=..., explicit_start=..., explicit_end=..., version=..., tags=...) -> None: ... + +class Dumper(Emitter, Serializer, Representer, Resolver): + def __init__(self, stream, default_style=..., default_flow_style=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=..., encoding=..., explicit_start=..., explicit_end=..., version=..., tags=...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/yaml/emitter.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/yaml/emitter.pyi new file mode 100644 index 0000000..5ca9cbb --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/yaml/emitter.pyi @@ -0,0 +1,106 @@ +from typing import Any +from yaml.error import YAMLError + +class EmitterError(YAMLError): ... + +class ScalarAnalysis: + scalar: Any + empty: Any + multiline: Any + allow_flow_plain: Any + allow_block_plain: Any + allow_single_quoted: Any + allow_double_quoted: Any + allow_block: Any + def __init__(self, scalar, empty, multiline, allow_flow_plain, allow_block_plain, allow_single_quoted, allow_double_quoted, allow_block) -> None: ... + +class Emitter: + DEFAULT_TAG_PREFIXES: Any + stream: Any + encoding: Any + states: Any + state: Any + events: Any + event: Any + indents: Any + indent: Any + flow_level: Any + root_context: Any + sequence_context: Any + mapping_context: Any + simple_key_context: Any + line: Any + column: Any + whitespace: Any + indention: Any + open_ended: Any + canonical: Any + allow_unicode: Any + best_indent: Any + best_width: Any + best_line_break: Any + tag_prefixes: Any + prepared_anchor: Any + prepared_tag: Any + analysis: Any + style: Any + def __init__(self, stream, canonical=..., indent=..., width=..., allow_unicode=..., line_break=...) -> None: ... + def dispose(self): ... + def emit(self, event): ... + def need_more_events(self): ... + def need_events(self, count): ... + def increase_indent(self, flow=..., indentless=...): ... + def expect_stream_start(self): ... + def expect_nothing(self): ... + def expect_first_document_start(self): ... + def expect_document_start(self, first=...): ... + def expect_document_end(self): ... + def expect_document_root(self): ... + def expect_node(self, root=..., sequence=..., mapping=..., simple_key=...): ... + def expect_alias(self): ... + def expect_scalar(self): ... + def expect_flow_sequence(self): ... + def expect_first_flow_sequence_item(self): ... + def expect_flow_sequence_item(self): ... + def expect_flow_mapping(self): ... + def expect_first_flow_mapping_key(self): ... + def expect_flow_mapping_key(self): ... + def expect_flow_mapping_simple_value(self): ... + def expect_flow_mapping_value(self): ... + def expect_block_sequence(self): ... + def expect_first_block_sequence_item(self): ... + def expect_block_sequence_item(self, first=...): ... + def expect_block_mapping(self): ... + def expect_first_block_mapping_key(self): ... + def expect_block_mapping_key(self, first=...): ... + def expect_block_mapping_simple_value(self): ... + def expect_block_mapping_value(self): ... + def check_empty_sequence(self): ... + def check_empty_mapping(self): ... + def check_empty_document(self): ... + def check_simple_key(self): ... + def process_anchor(self, indicator): ... + def process_tag(self): ... + def choose_scalar_style(self): ... + def process_scalar(self): ... + def prepare_version(self, version): ... + def prepare_tag_handle(self, handle): ... + def prepare_tag_prefix(self, prefix): ... + def prepare_tag(self, tag): ... + def prepare_anchor(self, anchor): ... + def analyze_scalar(self, scalar): ... + def flush_stream(self): ... + def write_stream_start(self): ... + def write_stream_end(self): ... + def write_indicator(self, indicator, need_whitespace, whitespace=..., indention=...): ... + def write_indent(self): ... + def write_line_break(self, data=...): ... + def write_version_directive(self, version_text): ... + def write_tag_directive(self, handle_text, prefix_text): ... + def write_single_quoted(self, text, split=...): ... + ESCAPE_REPLACEMENTS: Any + def write_double_quoted(self, text, split=...): ... + def determine_block_hints(self, text): ... + def write_folded(self, text): ... + def write_literal(self, text): ... + def write_plain(self, text, split=...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/yaml/error.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/yaml/error.pyi new file mode 100644 index 0000000..e567dd0 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/yaml/error.pyi @@ -0,0 +1,21 @@ +from typing import Any + +class Mark: + name: Any + index: Any + line: Any + column: Any + buffer: Any + pointer: Any + def __init__(self, name, index, line, column, buffer, pointer) -> None: ... + def get_snippet(self, indent=..., max_length=...): ... + +class YAMLError(Exception): ... + +class MarkedYAMLError(YAMLError): + context: Any + context_mark: Any + problem: Any + problem_mark: Any + note: Any + def __init__(self, context=..., context_mark=..., problem=..., problem_mark=..., note=...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/yaml/events.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/yaml/events.pyi new file mode 100644 index 0000000..7096d15 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/yaml/events.pyi @@ -0,0 +1,62 @@ +from typing import Any + +class Event: + start_mark: Any + end_mark: Any + def __init__(self, start_mark=..., end_mark=...) -> None: ... + +class NodeEvent(Event): + anchor: Any + start_mark: Any + end_mark: Any + def __init__(self, anchor, start_mark=..., end_mark=...) -> None: ... + +class CollectionStartEvent(NodeEvent): + anchor: Any + tag: Any + implicit: Any + start_mark: Any + end_mark: Any + flow_style: Any + def __init__(self, anchor, tag, implicit, start_mark=..., end_mark=..., flow_style=...) -> None: ... + +class CollectionEndEvent(Event): ... + +class StreamStartEvent(Event): + start_mark: Any + end_mark: Any + encoding: Any + def __init__(self, start_mark=..., end_mark=..., encoding=...) -> None: ... + +class StreamEndEvent(Event): ... + +class DocumentStartEvent(Event): + start_mark: Any + end_mark: Any + explicit: Any + version: Any + tags: Any + def __init__(self, start_mark=..., end_mark=..., explicit=..., version=..., tags=...) -> None: ... + +class DocumentEndEvent(Event): + start_mark: Any + end_mark: Any + explicit: Any + def __init__(self, start_mark=..., end_mark=..., explicit=...) -> None: ... + +class AliasEvent(NodeEvent): ... + +class ScalarEvent(NodeEvent): + anchor: Any + tag: Any + implicit: Any + value: Any + start_mark: Any + end_mark: Any + style: Any + def __init__(self, anchor, tag, implicit, value, start_mark=..., end_mark=..., style=...) -> None: ... + +class SequenceStartEvent(CollectionStartEvent): ... +class SequenceEndEvent(CollectionEndEvent): ... +class MappingStartEvent(CollectionStartEvent): ... +class MappingEndEvent(CollectionEndEvent): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/yaml/loader.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/yaml/loader.pyi new file mode 100644 index 0000000..0e9afea --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/yaml/loader.pyi @@ -0,0 +1,15 @@ +from yaml.reader import Reader +from yaml.scanner import Scanner +from yaml.parser import Parser +from yaml.composer import Composer +from yaml.constructor import BaseConstructor, SafeConstructor, Constructor +from yaml.resolver import BaseResolver, Resolver + +class BaseLoader(Reader, Scanner, Parser, Composer, BaseConstructor, BaseResolver): + def __init__(self, stream) -> None: ... + +class SafeLoader(Reader, Scanner, Parser, Composer, SafeConstructor, Resolver): + def __init__(self, stream) -> None: ... + +class Loader(Reader, Scanner, Parser, Composer, Constructor, Resolver): + def __init__(self, stream) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/yaml/nodes.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/yaml/nodes.pyi new file mode 100644 index 0000000..f31fa7d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/yaml/nodes.pyi @@ -0,0 +1,31 @@ +from typing import Any + +class Node: + tag: Any + value: Any + start_mark: Any + end_mark: Any + def __init__(self, tag, value, start_mark, end_mark) -> None: ... + +class ScalarNode(Node): + id: Any + tag: Any + value: Any + start_mark: Any + end_mark: Any + style: Any + def __init__(self, tag, value, start_mark=..., end_mark=..., style=...) -> None: ... + +class CollectionNode(Node): + tag: Any + value: Any + start_mark: Any + end_mark: Any + flow_style: Any + def __init__(self, tag, value, start_mark=..., end_mark=..., flow_style=...) -> None: ... + +class SequenceNode(CollectionNode): + id: Any + +class MappingNode(CollectionNode): + id: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/yaml/parser.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/yaml/parser.pyi new file mode 100644 index 0000000..4253e11 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/yaml/parser.pyi @@ -0,0 +1,44 @@ +from typing import Any +from yaml.error import MarkedYAMLError + +class ParserError(MarkedYAMLError): ... + +class Parser: + DEFAULT_TAGS: Any + current_event: Any + yaml_version: Any + tag_handles: Any + states: Any + marks: Any + state: Any + def __init__(self) -> None: ... + def dispose(self): ... + def check_event(self, *choices): ... + def peek_event(self): ... + def get_event(self): ... + def parse_stream_start(self): ... + def parse_implicit_document_start(self): ... + def parse_document_start(self): ... + def parse_document_end(self): ... + def parse_document_content(self): ... + def process_directives(self): ... + def parse_block_node(self): ... + def parse_flow_node(self): ... + def parse_block_node_or_indentless_sequence(self): ... + def parse_node(self, block=..., indentless_sequence=...): ... + def parse_block_sequence_first_entry(self): ... + def parse_block_sequence_entry(self): ... + def parse_indentless_sequence_entry(self): ... + def parse_block_mapping_first_key(self): ... + def parse_block_mapping_key(self): ... + def parse_block_mapping_value(self): ... + def parse_flow_sequence_first_entry(self): ... + def parse_flow_sequence_entry(self, first=...): ... + def parse_flow_sequence_entry_mapping_key(self): ... + def parse_flow_sequence_entry_mapping_value(self): ... + def parse_flow_sequence_entry_mapping_end(self): ... + def parse_flow_mapping_first_key(self): ... + def parse_flow_mapping_key(self, first=...): ... + def parse_flow_mapping_value(self): ... + def parse_flow_mapping_empty_value(self): ... + def process_empty_scalar(self, mark): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/yaml/reader.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/yaml/reader.pyi new file mode 100644 index 0000000..05adf0c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/yaml/reader.pyi @@ -0,0 +1,34 @@ +from typing import Any +from yaml.error import YAMLError + +class ReaderError(YAMLError): + name: Any + character: Any + position: Any + encoding: Any + reason: Any + def __init__(self, name, position, character, encoding, reason) -> None: ... + +class Reader: + name: Any + stream: Any + stream_pointer: Any + eof: Any + buffer: Any + pointer: Any + raw_buffer: Any + raw_decode: Any + encoding: Any + index: Any + line: Any + column: Any + def __init__(self, stream) -> None: ... + def peek(self, index=...): ... + def prefix(self, length=...): ... + def forward(self, length=...): ... + def get_mark(self): ... + def determine_encoding(self): ... + NON_PRINTABLE: Any + def check_printable(self, data): ... + def update(self, length): ... + def update_raw(self, size=...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/yaml/representer.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/yaml/representer.pyi new file mode 100644 index 0000000..7d4bbcc --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/yaml/representer.pyi @@ -0,0 +1,54 @@ +from typing import Any +from yaml.error import YAMLError + +class RepresenterError(YAMLError): ... + +class BaseRepresenter: + yaml_representers: Any + yaml_multi_representers: Any + default_style: Any + default_flow_style: Any + represented_objects: Any + object_keeper: Any + alias_key: Any + def __init__(self, default_style=..., default_flow_style=...) -> None: ... + def represent(self, data): ... + def get_classobj_bases(self, cls): ... + def represent_data(self, data): ... + @classmethod + def add_representer(cls, data_type, representer): ... + @classmethod + def add_multi_representer(cls, data_type, representer): ... + def represent_scalar(self, tag, value, style=...): ... + def represent_sequence(self, tag, sequence, flow_style=...): ... + def represent_mapping(self, tag, mapping, flow_style=...): ... + def ignore_aliases(self, data): ... + +class SafeRepresenter(BaseRepresenter): + def ignore_aliases(self, data): ... + def represent_none(self, data): ... + def represent_str(self, data): ... + def represent_unicode(self, data): ... + def represent_bool(self, data): ... + def represent_int(self, data): ... + def represent_long(self, data): ... + inf_value: Any + def represent_float(self, data): ... + def represent_list(self, data): ... + def represent_dict(self, data): ... + def represent_set(self, data): ... + def represent_date(self, data): ... + def represent_datetime(self, data): ... + def represent_yaml_object(self, tag, data, cls, flow_style=...): ... + def represent_undefined(self, data): ... + +class Representer(SafeRepresenter): + def represent_str(self, data): ... + def represent_unicode(self, data): ... + def represent_long(self, data): ... + def represent_complex(self, data): ... + def represent_tuple(self, data): ... + def represent_name(self, data): ... + def represent_module(self, data): ... + def represent_instance(self, data): ... + def represent_object(self, data): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/yaml/resolver.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/yaml/resolver.pyi new file mode 100644 index 0000000..7297560 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/yaml/resolver.pyi @@ -0,0 +1,24 @@ +from typing import Any +from yaml.error import YAMLError + +class ResolverError(YAMLError): ... + +class BaseResolver: + DEFAULT_SCALAR_TAG: Any + DEFAULT_SEQUENCE_TAG: Any + DEFAULT_MAPPING_TAG: Any + yaml_implicit_resolvers: Any + yaml_path_resolvers: Any + resolver_exact_paths: Any + resolver_prefix_paths: Any + def __init__(self) -> None: ... + @classmethod + def add_implicit_resolver(cls, tag, regexp, first): ... + @classmethod + def add_path_resolver(cls, tag, path, kind=...): ... + def descend_resolver(self, current_node, current_index): ... + def ascend_resolver(self): ... + def check_resolver_prefix(self, depth, path, kind, current_node, current_index): ... + def resolve(self, kind, value, implicit): ... + +class Resolver(BaseResolver): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/yaml/scanner.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/yaml/scanner.pyi new file mode 100644 index 0000000..33f45da --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/yaml/scanner.pyi @@ -0,0 +1,96 @@ +from typing import Any +from yaml.error import MarkedYAMLError + +class ScannerError(MarkedYAMLError): ... + +class SimpleKey: + token_number: Any + required: Any + index: Any + line: Any + column: Any + mark: Any + def __init__(self, token_number, required, index, line, column, mark) -> None: ... + +class Scanner: + done: Any + flow_level: Any + tokens: Any + tokens_taken: Any + indent: Any + indents: Any + allow_simple_key: Any + possible_simple_keys: Any + def __init__(self) -> None: ... + def check_token(self, *choices): ... + def peek_token(self): ... + def get_token(self): ... + def need_more_tokens(self): ... + def fetch_more_tokens(self): ... + def next_possible_simple_key(self): ... + def stale_possible_simple_keys(self): ... + def save_possible_simple_key(self): ... + def remove_possible_simple_key(self): ... + def unwind_indent(self, column): ... + def add_indent(self, column): ... + def fetch_stream_start(self): ... + def fetch_stream_end(self): ... + def fetch_directive(self): ... + def fetch_document_start(self): ... + def fetch_document_end(self): ... + def fetch_document_indicator(self, TokenClass): ... + def fetch_flow_sequence_start(self): ... + def fetch_flow_mapping_start(self): ... + def fetch_flow_collection_start(self, TokenClass): ... + def fetch_flow_sequence_end(self): ... + def fetch_flow_mapping_end(self): ... + def fetch_flow_collection_end(self, TokenClass): ... + def fetch_flow_entry(self): ... + def fetch_block_entry(self): ... + def fetch_key(self): ... + def fetch_value(self): ... + def fetch_alias(self): ... + def fetch_anchor(self): ... + def fetch_tag(self): ... + def fetch_literal(self): ... + def fetch_folded(self): ... + def fetch_block_scalar(self, style): ... + def fetch_single(self): ... + def fetch_double(self): ... + def fetch_flow_scalar(self, style): ... + def fetch_plain(self): ... + def check_directive(self): ... + def check_document_start(self): ... + def check_document_end(self): ... + def check_block_entry(self): ... + def check_key(self): ... + def check_value(self): ... + def check_plain(self): ... + def scan_to_next_token(self): ... + def scan_directive(self): ... + def scan_directive_name(self, start_mark): ... + def scan_yaml_directive_value(self, start_mark): ... + def scan_yaml_directive_number(self, start_mark): ... + def scan_tag_directive_value(self, start_mark): ... + def scan_tag_directive_handle(self, start_mark): ... + def scan_tag_directive_prefix(self, start_mark): ... + def scan_directive_ignored_line(self, start_mark): ... + def scan_anchor(self, TokenClass): ... + def scan_tag(self): ... + def scan_block_scalar(self, style): ... + def scan_block_scalar_indicators(self, start_mark): ... + def scan_block_scalar_ignored_line(self, start_mark): ... + def scan_block_scalar_indentation(self): ... + def scan_block_scalar_breaks(self, indent): ... + def scan_flow_scalar(self, style): ... + ESCAPE_REPLACEMENTS: Any + ESCAPE_CODES: Any + def scan_flow_scalar_non_spaces(self, double, start_mark): ... + def scan_flow_scalar_spaces(self, double, start_mark): ... + def scan_flow_scalar_breaks(self, double, start_mark): ... + def scan_plain(self): ... + def scan_plain_spaces(self, indent, start_mark): ... + def scan_tag_handle(self, name, start_mark): ... + def scan_tag_uri(self, name, start_mark): ... + def scan_uri_escapes(self, name, start_mark): ... + def scan_line_break(self): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/yaml/serializer.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/yaml/serializer.pyi new file mode 100644 index 0000000..0c169e8 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/yaml/serializer.pyi @@ -0,0 +1,23 @@ +from typing import Any +from yaml.error import YAMLError + +class SerializerError(YAMLError): ... + +class Serializer: + ANCHOR_TEMPLATE: Any + use_encoding: Any + use_explicit_start: Any + use_explicit_end: Any + use_version: Any + use_tags: Any + serialized_nodes: Any + anchors: Any + last_anchor_id: Any + closed: Any + def __init__(self, encoding=..., explicit_start=..., explicit_end=..., version=..., tags=...) -> None: ... + def open(self): ... + def close(self): ... + def serialize(self, node): ... + def anchor_node(self, node): ... + def generate_anchor(self, node): ... + def serialize_node(self, node, parent, index): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/yaml/tokens.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/yaml/tokens.pyi new file mode 100644 index 0000000..b258ec7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/2and3/yaml/tokens.pyi @@ -0,0 +1,93 @@ +from typing import Any + +class Token: + start_mark: Any + end_mark: Any + def __init__(self, start_mark, end_mark) -> None: ... + +class DirectiveToken(Token): + id: Any + name: Any + value: Any + start_mark: Any + end_mark: Any + def __init__(self, name, value, start_mark, end_mark) -> None: ... + +class DocumentStartToken(Token): + id: Any + +class DocumentEndToken(Token): + id: Any + +class StreamStartToken(Token): + id: Any + start_mark: Any + end_mark: Any + encoding: Any + def __init__(self, start_mark=..., end_mark=..., encoding=...) -> None: ... + +class StreamEndToken(Token): + id: Any + +class BlockSequenceStartToken(Token): + id: Any + +class BlockMappingStartToken(Token): + id: Any + +class BlockEndToken(Token): + id: Any + +class FlowSequenceStartToken(Token): + id: Any + +class FlowMappingStartToken(Token): + id: Any + +class FlowSequenceEndToken(Token): + id: Any + +class FlowMappingEndToken(Token): + id: Any + +class KeyToken(Token): + id: Any + +class ValueToken(Token): + id: Any + +class BlockEntryToken(Token): + id: Any + +class FlowEntryToken(Token): + id: Any + +class AliasToken(Token): + id: Any + value: Any + start_mark: Any + end_mark: Any + def __init__(self, value, start_mark, end_mark) -> None: ... + +class AnchorToken(Token): + id: Any + value: Any + start_mark: Any + end_mark: Any + def __init__(self, value, start_mark, end_mark) -> None: ... + +class TagToken(Token): + id: Any + value: Any + start_mark: Any + end_mark: Any + def __init__(self, value, start_mark, end_mark) -> None: ... + +class ScalarToken(Token): + id: Any + value: Any + plain: Any + start_mark: Any + end_mark: Any + style: Any + def __init__(self, value, plain, start_mark, end_mark, style=...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3.5/contextvars.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3.5/contextvars.pyi new file mode 100644 index 0000000..ab2ae9e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3.5/contextvars.pyi @@ -0,0 +1,30 @@ +from typing import Any, Callable, ClassVar, Generic, Iterator, Mapping, TypeVar, Union + +_T = TypeVar('_T') + +class ContextVar(Generic[_T]): + def __init__(self, name: str, *, default: _T = ...) -> None: ... + @property + def name(self) -> str: ... + def get(self, default: _T = ...) -> _T: ... + def set(self, value: _T) -> Token[_T]: ... + def reset(self, token: Token[_T]) -> None: ... + +class Token(Generic[_T]): + @property + def var(self) -> ContextVar[_T]: ... + @property + def old_value(self) -> Any: ... # returns either _T or MISSING, but that's hard to express + MISSING: ClassVar[object] + +def copy_context() -> Context: ... + +# It doesn't make sense to make this generic, because for most Contexts each ContextVar will have +# a different value. +class Context(Mapping[ContextVar[Any], Any]): + def __init__(self) -> None: ... + def run(self, callable: Callable[..., _T], *args: Any, **kwargs: Any) -> _T: ... + def copy(self) -> Context: ... + def __getitem__(self, key: ContextVar[Any]) -> Any: ... + def __iter__(self) -> Iterator[ContextVar[Any]]: ... + def __len__(self) -> int: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/dataclasses.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/dataclasses.pyi new file mode 100644 index 0000000..f8bcd52 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/dataclasses.pyi @@ -0,0 +1,71 @@ +from typing import overload, Any, Callable, Dict, Generic, Iterable, List, Mapping, Optional, Tuple, Type, TypeVar, Union + + +_T = TypeVar('_T') + +class _MISSING_TYPE: ... +MISSING: _MISSING_TYPE + +@overload +def asdict(obj: Any) -> Dict[str, Any]: ... +@overload +def asdict(obj: Any, *, dict_factory: Callable[[List[Tuple[str, Any]]], _T]) -> _T: ... + +@overload +def astuple(obj: Any) -> Tuple[Any, ...]: ... +@overload +def astuple(obj: Any, *, tuple_factory: Callable[[List[Any]], _T]) -> _T: ... + + +@overload +def dataclass(_cls: Type[_T]) -> Type[_T]: ... + +@overload +def dataclass(*, init: bool = ..., repr: bool = ..., eq: bool = ..., order: bool = ..., + unsafe_hash: bool = ..., frozen: bool = ...) -> Callable[[Type[_T]], Type[_T]]: ... + + +class Field(Generic[_T]): + name: str + type: Type[_T] + default: _T + default_factory: Callable[[], _T] + repr: bool + hash: Optional[bool] + init: bool + compare: bool + metadata: Optional[Mapping[str, Any]] + + +# NOTE: Actual return type is 'Field[_T]', but we want to help type checkers +# to understand the magic that happens at runtime. +@overload # `default` and `default_factory` are optional and mutually exclusive. +def field(*, default: _T, + init: bool = ..., repr: bool = ..., hash: Optional[bool] = ..., compare: bool = ..., + metadata: Optional[Mapping[str, Any]] = ...) -> _T: ... + +@overload +def field(*, default_factory: Callable[[], _T], + init: bool = ..., repr: bool = ..., hash: Optional[bool] = ..., compare: bool = ..., + metadata: Optional[Mapping[str, Any]] = ...) -> _T: ... + +@overload +def field(*, + init: bool = ..., repr: bool = ..., hash: Optional[bool] = ..., compare: bool = ..., + metadata: Optional[Mapping[str, Any]] = ...) -> Any: ... + + +def fields(class_or_instance: Any) -> Tuple[Field[Any], ...]: ... + +def is_dataclass(obj: Any) -> bool: ... + +class FrozenInstanceError(AttributeError): ... + +class InitVar(Generic[_T]): ... + +def make_dataclass(cls_name: str, fields: Iterable[Union[str, Tuple[str, type], Tuple[str, type, Field[Any]]]], *, + bases: Tuple[type, ...] = ..., namespace: Optional[Dict[str, Any]] = ..., + init: bool = ..., repr: bool = ..., eq: bool = ..., order: bool = ..., hash: bool = ..., + frozen: bool = ...): ... + +def replace(obj: _T, **changes: Any) -> _T: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/docutils/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/docutils/__init__.pyi new file mode 100644 index 0000000..024e962 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/docutils/__init__.pyi @@ -0,0 +1,3 @@ +from typing import Any + +def __getattr__(name) -> Any: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/docutils/examples.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/docutils/examples.pyi new file mode 100644 index 0000000..ec73a29 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/docutils/examples.pyi @@ -0,0 +1,5 @@ +from typing import Any + +html_parts: Any + +def __getattr__(name) -> Any: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/docutils/nodes.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/docutils/nodes.pyi new file mode 100644 index 0000000..382112b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/docutils/nodes.pyi @@ -0,0 +1,10 @@ +from typing import Any, List + +class reference: + def __init__(self, + rawsource: str = ..., + text: str = ..., + *children: List[Any], + **attributes) -> None: ... + +def __getattr__(name) -> Any: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/docutils/parsers/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/docutils/parsers/__init__.pyi new file mode 100644 index 0000000..024e962 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/docutils/parsers/__init__.pyi @@ -0,0 +1,3 @@ +from typing import Any + +def __getattr__(name) -> Any: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/docutils/parsers/rst/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/docutils/parsers/rst/__init__.pyi new file mode 100644 index 0000000..024e962 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/docutils/parsers/rst/__init__.pyi @@ -0,0 +1,3 @@ +from typing import Any + +def __getattr__(name) -> Any: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/docutils/parsers/rst/nodes.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/docutils/parsers/rst/nodes.pyi new file mode 100644 index 0000000..024e962 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/docutils/parsers/rst/nodes.pyi @@ -0,0 +1,3 @@ +from typing import Any + +def __getattr__(name) -> Any: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/docutils/parsers/rst/roles.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/docutils/parsers/rst/roles.pyi new file mode 100644 index 0000000..58b9cd7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/docutils/parsers/rst/roles.pyi @@ -0,0 +1,12 @@ +import docutils.nodes +import docutils.parsers.rst.states + +from typing import Callable, Any, List, Dict, Tuple + +def register_local_role(name: str, + role_fn: Callable[[str, str, str, int, docutils.parsers.rst.states.Inliner, Dict, List], + Tuple[List[docutils.nodes.reference], List[docutils.nodes.reference]]] + ) -> None: + ... + +def __getattr__(name) -> Any: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/docutils/parsers/rst/states.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/docutils/parsers/rst/states.pyi new file mode 100644 index 0000000..ac00fe1 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/docutils/parsers/rst/states.pyi @@ -0,0 +1,8 @@ +import typing +from typing import Any + +class Inliner: + def __init__(self) -> None: + ... + +def __getattr__(name) -> Any: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/jwt/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/jwt/__init__.pyi new file mode 100644 index 0000000..da8eb40 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/jwt/__init__.pyi @@ -0,0 +1,43 @@ +from typing import Mapping, Any, Optional, Union, Dict + +from . import algorithms + +def decode(jwt: Union[str, bytes], key: Union[str, bytes] = ..., + verify: bool = ..., algorithms: Optional[Any] = ..., + options: Optional[Mapping[Any, Any]] = ..., + **kwargs: Any) -> Dict[str, Any]: ... + +def encode(payload: Mapping[str, Any], key: Union[str, bytes], + algorithm: str = ..., headers: Optional[Mapping[str, Any]] = ..., + json_encoder: Optional[Any] = ...) -> bytes: ... + +def register_algorithm(alg_id: str, + alg_obj: algorithms.Algorithm) -> None: ... + +def unregister_algorithm(alg_id: str) -> None: ... + +class PyJWTError(Exception): ... +class InvalidTokenError(PyJWTError): ... +class DecodeError(InvalidTokenError): ... +class ExpiredSignatureError(InvalidTokenError): ... +class InvalidAudienceError(InvalidTokenError): ... +class InvalidIssuerError(InvalidTokenError): ... +class InvalidIssuedAtError(InvalidTokenError): ... +class ImmatureSignatureError(InvalidTokenError): ... +class InvalidKeyError(PyJWTError): ... +class InvalidAlgorithmError(InvalidTokenError): ... +class MissingRequiredClaimError(InvalidTokenError): ... +class InvalidSignatureError(DecodeError): ... + +# Compatibility aliases (deprecated) +ExpiredSignature = ExpiredSignatureError +InvalidAudience = InvalidAudienceError +InvalidIssuer = InvalidIssuerError + +# These aren't actually documented, but the package +# exports them in __init__.py, so we should at least +# make sure that mypy doesn't raise spurious errors +# if they're used. +get_unverified_header: Any +PyJWT: Any +PyJWS: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/jwt/algorithms.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/jwt/algorithms.pyi new file mode 100644 index 0000000..7177dc7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/jwt/algorithms.pyi @@ -0,0 +1,83 @@ +import sys +from hashlib import _Hash +from typing import Any, Set, Dict, Optional, ClassVar, Union, Generic, TypeVar + +requires_cryptography = Set[str] + +def get_default_algorithms() -> Dict[str, Algorithm]: ... + +_K = TypeVar("_K") + +class Algorithm(Generic[_K]): + def prepare_key(self, key: _K) -> _K: ... + def sign(self, msg: bytes, key: _K) -> bytes: ... + def verify(self, msg: bytes, key: _K, sig: bytes) -> bool: ... + @staticmethod + def to_jwk(key_obj: Any) -> str: ... # should be key_obj: _K, see python/mypy#1337 + @staticmethod + def from_jwk(jwk: str) -> Any: ... # should return _K, see python/mypy#1337 + + +class NoneAlgorithm(Algorithm[None]): + def prepare_key(self, key: Optional[str]) -> None: ... + +class _HashAlg: + def __call__(self, arg: Union[bytes, bytearray, memoryview] = ...) -> _Hash: ... + +if sys.version_info >= (3, 6): + _LoadsString = Union[str, bytes, bytearray] +else: + _LoadsString = str + +class HMACAlgorithm(Algorithm[bytes]): + SHA256: ClassVar[_HashAlg] + SHA384: ClassVar[_HashAlg] + SHA512: ClassVar[_HashAlg] + hash_alg: _HashAlg + def __init__(self, _HashAlg) -> None: ... + def prepare_key(self, key: Union[str, bytes]) -> bytes: ... + @staticmethod + def to_jwk(key_obj: Union[str, bytes]) -> str: ... + @staticmethod + def from_jwk(jwk: _LoadsString) -> bytes: ... + +# Only defined if cryptography is installed. Types should be tightened when +# cryptography gets type hints. +# See https://github.com/python/typeshed/issues/2542 +class RSAAlgorithm(Algorithm): + SHA256: ClassVar[Any] + SHA384: ClassVar[Any] + SHA512: ClassVar[Any] + hash_alg: Any + def __init__(self, hash_alg: Any) -> None: ... + def prepare_key(self, key: Any) -> Any: ... + @staticmethod + def to_jwk(key_obj: Any) -> str: ... + @staticmethod + def from_jwk(jwk: _LoadsString) -> Any: ... + def sign(self, msg: bytes, key: Any) -> bytes: ... + def verify(self, msg: bytes, key: Any, sig: bytes) -> bool: ... + +# Only defined if cryptography is installed. Types should be tightened when +# cryptography gets type hints. +# See https://github.com/python/typeshed/issues/2542 +class ECAlgorithm(Algorithm): + SHA256: ClassVar[Any] + SHA384: ClassVar[Any] + SHA512: ClassVar[Any] + hash_alg: Any + def __init__(self, hash_alg: Any) -> None: ... + def prepare_key(self, key: Any) -> Any: ... + @staticmethod + def to_jwk(key_obj: Any) -> str: ... + @staticmethod + def from_jwk(jwk: _LoadsString) -> Any: ... + def sign(self, msg: bytes, key: Any) -> bytes: ... + def verify(self, msg: bytes, key: Any, sig: bytes) -> bool: ... + +# Only defined if cryptography is installed. Types should be tightened when +# cryptography gets type hints. +# See https://github.com/python/typeshed/issues/2542 +class RSAPSSAlgorithm(RSAAlgorithm): + def sign(self, msg: bytes, key: Any) -> bytes: ... + def verify(self, msg: bytes, key: Any, sig: bytes) -> bool: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/jwt/contrib/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/jwt/contrib/__init__.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/jwt/contrib/algorithms/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/jwt/contrib/algorithms/__init__.pyi new file mode 100644 index 0000000..b2bb1f6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/jwt/contrib/algorithms/__init__.pyi @@ -0,0 +1 @@ +from hashlib import _Hash as _HashAlg diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/jwt/contrib/algorithms/py_ecdsa.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/jwt/contrib/algorithms/py_ecdsa.pyi new file mode 100644 index 0000000..e1342cc --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/jwt/contrib/algorithms/py_ecdsa.pyi @@ -0,0 +1,10 @@ +from typing import Any +from jwt.algorithms import Algorithm + +from . import _HashAlg + +class ECAlgorithm(Algorithm): + SHA256: _HashAlg + SHA384: _HashAlg + SHA512: _HashAlg + def __init__(self, hash_alg: _HashAlg) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/jwt/contrib/algorithms/pycrypto.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/jwt/contrib/algorithms/pycrypto.pyi new file mode 100644 index 0000000..763b46a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/jwt/contrib/algorithms/pycrypto.pyi @@ -0,0 +1,10 @@ +from typing import Any +from jwt.algorithms import Algorithm + +from . import _HashAlg + +class RSAAlgorithm(Algorithm): + SHA256: _HashAlg + SHA384: _HashAlg + SHA512: _HashAlg + def __init__(self, hash_alg: _HashAlg) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/orjson.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/orjson.pyi new file mode 100644 index 0000000..9c1cdc1 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/orjson.pyi @@ -0,0 +1,14 @@ +# https://github.com/ijl/orjson/blob/master/orjson.pyi + +from typing import Any, Callable, Optional, Union + +def dumps( + __obj: Any, default: Optional[Callable[[Any], Any]] = ..., option: Optional[int] = ... +) -> bytes: ... +def loads(__obj: Union[bytes, str]) -> Any: ... + +class JSONDecodeError(ValueError): ... +class JSONEncodeError(TypeError): ... + +OPT_STRICT_INTEGER: int +OPT_NAIVE_UTC: int diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/pkg_resources/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/pkg_resources/__init__.pyi new file mode 100644 index 0000000..55914e1 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/pkg_resources/__init__.pyi @@ -0,0 +1,253 @@ +# Stubs for pkg_resources (Python 3.4) + +from typing import Any, Callable, Dict, IO, Iterable, Generator, Optional, Sequence, Tuple, List, Union, TypeVar, overload +from abc import ABCMeta +import importlib.abc +import types +import zipimport + +_T = TypeVar("_T") +_NestedStr = Union[str, Iterable[Union[str, Iterable[Any]]]] +_InstallerType = Callable[[Requirement], Optional[Distribution]] +_EPDistType = Union[Distribution, Requirement, str] +_MetadataType = Optional[IResourceProvider] +_PkgReqType = Union[str, Requirement] +_DistFinderType = Callable[[str, _Importer, bool], Generator[Distribution, None, None]] +_NSHandlerType = Callable[[_Importer, str, str, types.ModuleType], str] + +def declare_namespace(name: str) -> None: ... +def fixup_namespace_packages(path_item: str) -> None: ... + +class WorkingSet: + entries: List[str] + def __init__(self, entries: Optional[Iterable[str]] = ...) -> None: ... + def require(self, *requirements: _NestedStr) -> Sequence[Distribution]: ... + def run_script(self, requires: str, script_name: str) -> None: ... + def iter_entry_points(self, group: str, name: Optional[str] = ...) -> Generator[EntryPoint, None, None]: ... + def add_entry(self, entry: str) -> None: ... + def __contains__(self, dist: Distribution) -> bool: ... + def __iter__(self) -> Generator[Distribution, None, None]: ... + def find(self, req: Requirement) -> Optional[Distribution]: ... + def resolve( + self, requirements: Sequence[Requirement], env: Optional[Environment] = ..., installer: Optional[_InstallerType] = ... + ) -> List[Distribution]: ... + def add(self, dist: Distribution, entry: Optional[str] = ..., insert: bool = ..., replace: bool = ...) -> None: ... + def subscribe(self, callback: Callable[[Distribution], None]) -> None: ... + def find_plugins( + self, plugin_env: Environment, full_env: Optional[Environment] = ..., fallback: bool = ... + ) -> Tuple[List[Distribution], Dict[Distribution, Exception]]: ... + +working_set: WorkingSet + +def require(*requirements: Union[str, Sequence[str]]) -> Sequence[Distribution]: ... +def run_script(requires: str, script_name: str) -> None: ... +def iter_entry_points(group: str, name: Optional[str] = ...) -> Generator[EntryPoint, None, None]: ... +def add_activation_listener(callback: Callable[[Distribution], None]) -> None: ... + +class Environment: + def __init__( + self, search_path: Optional[Sequence[str]] = ..., platform: Optional[str] = ..., python: Optional[str] = ... + ) -> None: ... + def __getitem__(self, project_name: str) -> List[Distribution]: ... + def __iter__(self) -> Generator[str, None, None]: ... + def add(self, dist: Distribution) -> None: ... + def remove(self, dist: Distribution) -> None: ... + def can_add(self, dist: Distribution) -> bool: ... + def __add__(self, other: Union[Distribution, Environment]) -> Environment: ... + def __iadd__(self, other: Union[Distribution, Environment]) -> Environment: ... + @overload + def best_match(self, req: Requirement, working_set: WorkingSet) -> Distribution: ... + @overload + def best_match(self, req: Requirement, working_set: WorkingSet, installer: Callable[[Requirement], _T] = ...) -> _T: ... + @overload + def obtain(self, requirement: Requirement) -> None: ... + @overload + def obtain(self, requirement: Requirement, installer: Callable[[Requirement], _T] = ...) -> _T: ... + def scan(self, search_path: Optional[Sequence[str]] = ...) -> None: ... + +def parse_requirements(strs: Union[str, Iterable[str]]) -> Generator[Requirement, None, None]: ... + +class Requirement: + unsafe_name: str + project_name: str + key: str + extras: Tuple[str, ...] + specs: List[Tuple[str, str]] + # TODO: change this to Optional[packaging.markers.Marker] once we can import + # packaging.markers + marker: Optional[Any] + @staticmethod + def parse(s: Union[str, Iterable[str]]) -> Requirement: ... + def __contains__(self, item: Union[Distribution, str, Tuple[str, ...]]) -> bool: ... + def __eq__(self, other_requirement: Any) -> bool: ... + +def load_entry_point(dist: _EPDistType, group: str, name: str) -> None: ... +def get_entry_info(dist: _EPDistType, group: str, name: str) -> Optional[EntryPoint]: ... +@overload +def get_entry_map(dist: _EPDistType) -> Dict[str, Dict[str, EntryPoint]]: ... +@overload +def get_entry_map(dist: _EPDistType, group: str) -> Dict[str, EntryPoint]: ... + +class EntryPoint: + name: str + module_name: str + attrs: Tuple[str, ...] + extras: Tuple[str, ...] + dist: Optional[Distribution] + def __init__( + self, + name: str, + module_name: str, + attrs: Tuple[str, ...] = ..., + extras: Tuple[str, ...] = ..., + dist: Optional[Distribution] = ..., + ) -> None: ... + @classmethod + def parse(cls, src: str, dist: Optional[Distribution] = ...) -> EntryPoint: ... + @classmethod + def parse_group( + cls, group: str, lines: Union[str, Sequence[str]], dist: Optional[Distribution] = ... + ) -> Dict[str, EntryPoint]: ... + @classmethod + def parse_map( + cls, data: Union[Dict[str, Union[str, Sequence[str]]], str, Sequence[str]], dist: Optional[Distribution] = ... + ) -> Dict[str, EntryPoint]: ... + def load(self, require: bool = ..., env: Optional[Environment] = ..., installer: Optional[_InstallerType] = ...) -> Any: ... + def require(self, env: Optional[Environment] = ..., installer: Optional[_InstallerType] = ...) -> None: ... + def resolve(self) -> Any: ... + +def find_distributions(path_item: str, only: bool = ...) -> Generator[Distribution, None, None]: ... +def get_distribution(dist: Union[Requirement, str, Distribution]) -> Distribution: ... + +class Distribution(IResourceProvider, IMetadataProvider): + PKG_INFO: str + location: str + project_name: str + key: str + extras: List[str] + version: str + parsed_version: Tuple[str, ...] + py_version: str + platform: Optional[str] + precedence: int + def __init__( + self, + location: Optional[str] = ..., + metadata: Optional[str] = ..., + project_name: Optional[str] = ..., + version: Optional[str] = ..., + py_version: str = ..., + platform: Optional[str] = ..., + precedence: int = ..., + ) -> None: ... + @classmethod + def from_location( + cls, location: str, basename: str, metadata: Optional[str] = ..., **kw: Union[str, None, int] + ) -> Distribution: ... + @classmethod + def from_filename(cls, filename: str, metadata: Optional[str] = ..., **kw: Union[str, None, int]) -> Distribution: ... + def activate(self, path: Optional[List[str]] = ...) -> None: ... + def as_requirement(self) -> Requirement: ... + def requires(self, extras: Tuple[str, ...] = ...) -> List[Requirement]: ... + def clone(self, **kw: Union[str, int, None]) -> Requirement: ... + def egg_name(self) -> str: ... + def __cmp__(self, other: Any) -> bool: ... + def get_entry_info(self, group: str, name: str) -> Optional[EntryPoint]: ... + @overload + def get_entry_map(self) -> Dict[str, Dict[str, EntryPoint]]: ... + @overload + def get_entry_map(self, group: str) -> Dict[str, EntryPoint]: ... + def load_entry_point(self, group: str, name: str) -> None: ... + +EGG_DIST: int +BINARY_DIST: int +SOURCE_DIST: int +CHECKOUT_DIST: int +DEVELOP_DIST: int + +def resource_exists(package_or_requirement: _PkgReqType, resource_name: str) -> bool: ... +def resource_stream(package_or_requirement: _PkgReqType, resource_name: str) -> IO[bytes]: ... +def resource_string(package_or_requirement: _PkgReqType, resource_name: str) -> bytes: ... +def resource_isdir(package_or_requirement: _PkgReqType, resource_name: str) -> bool: ... +def resource_listdir(package_or_requirement: _PkgReqType, resource_name: str) -> List[str]: ... +def resource_filename(package_or_requirement: _PkgReqType, resource_name: str) -> str: ... +def set_extraction_path(path: str) -> None: ... +def cleanup_resources(force: bool = ...) -> List[str]: ... + +class IResourceManager: + def resource_exists(self, package_or_requirement: _PkgReqType, resource_name: str) -> bool: ... + def resource_stream(self, package_or_requirement: _PkgReqType, resource_name: str) -> IO[bytes]: ... + def resource_string(self, package_or_requirement: _PkgReqType, resource_name: str) -> bytes: ... + def resource_isdir(self, package_or_requirement: _PkgReqType, resource_name: str) -> bool: ... + def resource_listdir(self, package_or_requirement: _PkgReqType, resource_name: str) -> List[str]: ... + def resource_filename(self, package_or_requirement: _PkgReqType, resource_name: str) -> str: ... + def set_extraction_path(self, path: str) -> None: ... + def cleanup_resources(self, force: bool = ...) -> List[str]: ... + def get_cache_path(self, archive_name: str, names: Tuple[str, ...] = ...) -> str: ... + def extraction_error(self) -> None: ... + def postprocess(self, tempname: str, filename: str) -> None: ... + +@overload +def get_provider(package_or_requirement: str) -> IResourceProvider: ... +@overload +def get_provider(package_or_requirement: Requirement) -> Distribution: ... + +class IMetadataProvider: + def has_metadata(self, name: str) -> bool: ... + def metadata_isdir(self, name: str) -> bool: ... + def metadata_listdir(self, name: str) -> List[str]: ... + def get_metadata(self, name: str) -> str: ... + def get_metadata_lines(self, name: str) -> Generator[str, None, None]: ... + def run_script(self, script_name: str, namespace: Dict[str, Any]) -> None: ... + +class ResolutionError(Exception): ... +class DistributionNotFound(ResolutionError): ... +class VersionConflict(ResolutionError): ... +class UnknownExtra(ResolutionError): ... + +class ExtractionError(Exception): + manager: IResourceManager + cache_path: str + original_error: Exception + +class _Importer(importlib.abc.MetaPathFinder, importlib.abc.InspectLoader, metaclass=ABCMeta): ... + +def register_finder(importer_type: type, distribution_finder: _DistFinderType) -> None: ... +def register_loader_type(loader_type: type, provider_factory: Callable[[types.ModuleType], IResourceProvider]) -> None: ... +def register_namespace_handler(importer_type: type, namespace_handler: _NSHandlerType) -> None: ... + +class IResourceProvider(IMetadataProvider): ... +class NullProvider: ... +class EggProvider(NullProvider): ... +class DefaultProvider(EggProvider): ... + +class PathMetadata(DefaultProvider, IResourceProvider): + def __init__(self, path: str, egg_info: str) -> None: ... + +class ZipProvider(EggProvider): ... + +class EggMetadata(ZipProvider, IResourceProvider): + def __init__(self, zipimporter: zipimport.zipimporter) -> None: ... + +class EmptyProvider(NullProvider): ... + +empty_provider: EmptyProvider + +class FileMetadata(EmptyProvider, IResourceProvider): + def __init__(self, path_to_pkg_info: str) -> None: ... + +def parse_version(v: str) -> Tuple[str, ...]: ... +def yield_lines(strs: _NestedStr) -> Generator[str, None, None]: ... +def split_sections(strs: _NestedStr) -> Generator[Tuple[Optional[str], str], None, None]: ... +def safe_name(name: str) -> str: ... +def safe_version(version: str) -> str: ... +def safe_extra(extra: str) -> str: ... +def to_filename(name_or_version: str) -> str: ... +def get_build_platform() -> str: ... +def get_platform() -> str: ... +def get_supported_platform() -> str: ... +def compatible_platforms(provided: Optional[str], required: Optional[str]) -> bool: ... +def get_default_cache() -> str: ... +def get_importer(path_item: str) -> _Importer: ... +def ensure_directory(path: str) -> None: ... +def normalize_path(filename: str) -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/pkg_resources/py31compat.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/pkg_resources/py31compat.pyi new file mode 100644 index 0000000..e7b17a3 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/pkg_resources/py31compat.pyi @@ -0,0 +1,14 @@ +from typing import Text +import os +import sys + +needs_makedirs: bool + +def _makedirs_31(path: Text, exist_ok: bool = ...) -> None: ... + +# _makedirs_31 has special behavior to handle an edge case that was removed in +# 3.4.1. No one should be using 3.4 instead of 3.4.1, so this should be fine. +if sys.version_info >= (3,): + makedirs = os.makedirs +else: + makedirs = _makedirs_31 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/__init__.pyi new file mode 100644 index 0000000..b785eac --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/__init__.pyi @@ -0,0 +1,108 @@ +# Stubs for six (Python 3.5) + +from __future__ import print_function + +from typing import ( + Any, + AnyStr, + Callable, + Dict, + ItemsView, + Iterable, + KeysView, + Mapping, + NoReturn, + Optional, + Pattern, + Text, + Tuple, + Type, + TypeVar, + Union, + ValuesView, + overload, +) +import types +import typing +import unittest + +# Exports +from io import StringIO as StringIO, BytesIO as BytesIO +from builtins import next as next +from functools import wraps as wraps +from . import moves + +_T = TypeVar('_T') +_K = TypeVar('_K') +_V = TypeVar('_V') + +# TODO make constant, then move this stub to 2and3 +# https://github.com/python/typeshed/issues/17 +PY2 = False +PY3 = True +PY34: bool + +string_types = str, +integer_types = int, +class_types = type, +text_type = str +binary_type = bytes + +MAXSIZE: int + +# def add_move +# def remove_move + +def callable(obj: object) -> bool: ... + +def get_unbound_function(unbound: types.FunctionType) -> types.FunctionType: ... +def create_bound_method(func: types.FunctionType, obj: object) -> types.MethodType: ... +def create_unbound_method(func: types.FunctionType, cls: type) -> types.FunctionType: ... + +Iterator = object + +def get_method_function(meth: types.MethodType) -> types.FunctionType: ... +def get_method_self(meth: types.MethodType) -> Optional[object]: ... +def get_function_closure(fun: types.FunctionType) -> Optional[Tuple[types._Cell, ...]]: ... +def get_function_code(fun: types.FunctionType) -> types.CodeType: ... +def get_function_defaults(fun: types.FunctionType) -> Optional[Tuple[Any, ...]]: ... +def get_function_globals(fun: types.FunctionType) -> Dict[str, Any]: ... + +def iterkeys(d: Mapping[_K, _V]) -> typing.Iterator[_K]: ... +def itervalues(d: Mapping[_K, _V]) -> typing.Iterator[_V]: ... +def iteritems(d: Mapping[_K, _V]) -> typing.Iterator[Tuple[_K, _V]]: ... +# def iterlists + +def viewkeys(d: Mapping[_K, _V]) -> KeysView[_K]: ... +def viewvalues(d: Mapping[_K, _V]) -> ValuesView[_V]: ... +def viewitems(d: Mapping[_K, _V]) -> ItemsView[_K, _V]: ... + +def b(s: str) -> binary_type: ... +def u(s: str) -> text_type: ... + +unichr = chr +def int2byte(i: int) -> bytes: ... +def byte2int(bs: binary_type) -> int: ... +def indexbytes(buf: binary_type, i: int) -> int: ... +def iterbytes(buf: binary_type) -> typing.Iterator[int]: ... + +def assertCountEqual(self: unittest.TestCase, first: Iterable[_T], second: Iterable[_T], msg: Optional[str] = ...) -> None: ... +@overload +def assertRaisesRegex(self: unittest.TestCase, msg: Optional[str] = ...) -> Any: ... +@overload +def assertRaisesRegex(self: unittest.TestCase, callable_obj: Callable[..., Any], *args: Any, **kwargs: Any) -> Any: ... +def assertRegex(self: unittest.TestCase, text: AnyStr, expected_regex: Union[AnyStr, Pattern[AnyStr]], msg: Optional[str] = ...) -> None: ... + +exec_ = exec + +def reraise(tp: Optional[Type[BaseException]], value: Optional[BaseException], tb: Optional[types.TracebackType] = ...) -> NoReturn: ... +def raise_from(value: Union[BaseException, Type[BaseException]], from_value: Optional[BaseException]) -> NoReturn: ... + +print_ = print + +def with_metaclass(meta: type, *bases: type) -> type: ... +def add_metaclass(metaclass: type) -> Callable[[_T], _T]: ... +def ensure_binary(s: Union[bytes, Text], encoding: str = ..., errors: str = ...) -> bytes: ... +def ensure_str(s: Union[bytes, Text], encoding: str = ..., errors: str = ...) -> str: ... +def ensure_text(s: Union[bytes, Text], encoding: str = ..., errors: str = ...) -> Text: ... +def python_2_unicode_compatible(klass: _T) -> _T: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/BaseHTTPServer.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/BaseHTTPServer.pyi new file mode 100644 index 0000000..0e1ad71 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/BaseHTTPServer.pyi @@ -0,0 +1 @@ +from http.server import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/CGIHTTPServer.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/CGIHTTPServer.pyi new file mode 100644 index 0000000..0e1ad71 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/CGIHTTPServer.pyi @@ -0,0 +1 @@ +from http.server import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/SimpleHTTPServer.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/SimpleHTTPServer.pyi new file mode 100644 index 0000000..0e1ad71 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/SimpleHTTPServer.pyi @@ -0,0 +1 @@ +from http.server import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/__init__.pyi new file mode 100644 index 0000000..3d6efce --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/__init__.pyi @@ -0,0 +1,69 @@ +# Stubs for six.moves +# +# Note: Commented out items means they weren't implemented at the time. +# Uncomment them when the modules have been added to the typeshed. +import sys + +from io import StringIO as cStringIO +from builtins import filter as filter +from itertools import filterfalse as filterfalse +from builtins import input as input +from sys import intern as intern +from builtins import map as map +from os import getcwd as getcwd +from os import getcwdb as getcwdb +from builtins import range as range +from functools import reduce as reduce +from shlex import quote as shlex_quote +from io import StringIO as StringIO +from collections import UserDict as UserDict +from collections import UserList as UserList +from collections import UserString as UserString +from builtins import range as xrange +from builtins import zip as zip +from itertools import zip_longest as zip_longest +from . import builtins +from . import configparser +# import copyreg as copyreg +# import dbm.gnu as dbm_gnu +from . import _dummy_thread +from . import http_cookiejar +from . import http_cookies +from . import html_entities +from . import html_parser +from . import http_client +from . import email_mime_multipart +from . import email_mime_nonmultipart +from . import email_mime_text +from . import email_mime_base +from . import BaseHTTPServer +from . import CGIHTTPServer +from . import SimpleHTTPServer +from . import cPickle +from . import queue +from . import reprlib +from . import socketserver +from . import _thread +from . import tkinter +from . import tkinter_dialog +from . import tkinter_filedialog +# import tkinter.scrolledtext as tkinter_scrolledtext +# import tkinter.simpledialog as tkinter_simpledialog +# import tkinter.tix as tkinter_tix +from . import tkinter_ttk +from . import tkinter_constants +# import tkinter.dnd as tkinter_dnd +# import tkinter.colorchooser as tkinter_colorchooser +from . import tkinter_commondialog +from . import tkinter_tkfiledialog +# import tkinter.font as tkinter_font +# import tkinter.messagebox as tkinter_messagebox +# import tkinter.simpledialog as tkinter_tksimpledialog +from . import urllib_parse +from . import urllib_error +from . import urllib +from . import urllib_robotparser +# import xmlrpc.client as xmlrpc_client +# import xmlrpc.server as xmlrpc_server + +from importlib import reload as reload_module diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/_dummy_thread.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/_dummy_thread.pyi new file mode 100644 index 0000000..2487961 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/_dummy_thread.pyi @@ -0,0 +1 @@ +from _dummy_thread import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/_thread.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/_thread.pyi new file mode 100644 index 0000000..25952a6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/_thread.pyi @@ -0,0 +1 @@ +from _thread import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/builtins.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/builtins.pyi new file mode 100644 index 0000000..9596ba0 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/builtins.pyi @@ -0,0 +1 @@ +from builtins import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/cPickle.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/cPickle.pyi new file mode 100644 index 0000000..2b944b5 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/cPickle.pyi @@ -0,0 +1 @@ +from pickle import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/configparser.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/configparser.pyi new file mode 100644 index 0000000..044861c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/configparser.pyi @@ -0,0 +1 @@ +from configparser import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/email_mime_base.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/email_mime_base.pyi new file mode 100644 index 0000000..4df155c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/email_mime_base.pyi @@ -0,0 +1 @@ +from email.mime.base import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/email_mime_multipart.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/email_mime_multipart.pyi new file mode 100644 index 0000000..4f31241 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/email_mime_multipart.pyi @@ -0,0 +1 @@ +from email.mime.multipart import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/email_mime_nonmultipart.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/email_mime_nonmultipart.pyi new file mode 100644 index 0000000..c15c8c0 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/email_mime_nonmultipart.pyi @@ -0,0 +1 @@ +from email.mime.nonmultipart import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/email_mime_text.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/email_mime_text.pyi new file mode 100644 index 0000000..51e1473 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/email_mime_text.pyi @@ -0,0 +1 @@ +from email.mime.text import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/html_entities.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/html_entities.pyi new file mode 100644 index 0000000..c1244dd --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/html_entities.pyi @@ -0,0 +1 @@ +from html.entities import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/html_parser.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/html_parser.pyi new file mode 100644 index 0000000..6db6dd8 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/html_parser.pyi @@ -0,0 +1 @@ +from html.parser import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/http_client.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/http_client.pyi new file mode 100644 index 0000000..36d29b9 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/http_client.pyi @@ -0,0 +1 @@ +from http.client import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/http_cookiejar.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/http_cookiejar.pyi new file mode 100644 index 0000000..88a1aed --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/http_cookiejar.pyi @@ -0,0 +1 @@ +from http.cookiejar import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/http_cookies.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/http_cookies.pyi new file mode 100644 index 0000000..9c59a53 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/http_cookies.pyi @@ -0,0 +1 @@ +from http.cookies import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/queue.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/queue.pyi new file mode 100644 index 0000000..fe7be53 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/queue.pyi @@ -0,0 +1 @@ +from queue import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/reprlib.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/reprlib.pyi new file mode 100644 index 0000000..c329846 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/reprlib.pyi @@ -0,0 +1 @@ +from reprlib import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/socketserver.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/socketserver.pyi new file mode 100644 index 0000000..6101c8b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/socketserver.pyi @@ -0,0 +1 @@ +from socketserver import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/tkinter.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/tkinter.pyi new file mode 100644 index 0000000..fc4d53a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/tkinter.pyi @@ -0,0 +1 @@ +from tkinter import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_commondialog.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_commondialog.pyi new file mode 100644 index 0000000..34eb419 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_commondialog.pyi @@ -0,0 +1 @@ +from tkinter.commondialog import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_constants.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_constants.pyi new file mode 100644 index 0000000..3c04f6d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_constants.pyi @@ -0,0 +1 @@ +from tkinter.constants import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_dialog.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_dialog.pyi new file mode 100644 index 0000000..0da73c2 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_dialog.pyi @@ -0,0 +1 @@ +from tkinter.dialog import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_filedialog.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_filedialog.pyi new file mode 100644 index 0000000..c4cc7c4 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_filedialog.pyi @@ -0,0 +1 @@ +from tkinter.filedialog import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_tkfiledialog.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_tkfiledialog.pyi new file mode 100644 index 0000000..c4cc7c4 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_tkfiledialog.pyi @@ -0,0 +1 @@ +from tkinter.filedialog import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_ttk.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_ttk.pyi new file mode 100644 index 0000000..14576f6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_ttk.pyi @@ -0,0 +1 @@ +from tkinter.ttk import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib/__init__.pyi new file mode 100644 index 0000000..d08209c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib/__init__.pyi @@ -0,0 +1,5 @@ +import six.moves.urllib.error as error +import six.moves.urllib.parse as parse +import six.moves.urllib.request as request +import six.moves.urllib.response as response +import six.moves.urllib.robotparser as robotparser diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib/error.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib/error.pyi new file mode 100644 index 0000000..83f0d22 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib/error.pyi @@ -0,0 +1,3 @@ +from urllib.error import URLError as URLError +from urllib.error import HTTPError as HTTPError +from urllib.error import ContentTooShortError as ContentTooShortError diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib/parse.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib/parse.pyi new file mode 100644 index 0000000..8b4310a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib/parse.pyi @@ -0,0 +1,27 @@ +# Stubs for six.moves.urllib.parse +# +# Note: Commented out items means they weren't implemented at the time. +# Uncomment them when the modules have been added to the typeshed. +from urllib.parse import ParseResult as ParseResult +from urllib.parse import SplitResult as SplitResult +from urllib.parse import parse_qs as parse_qs +from urllib.parse import parse_qsl as parse_qsl +from urllib.parse import urldefrag as urldefrag +from urllib.parse import urljoin as urljoin +from urllib.parse import urlparse as urlparse +from urllib.parse import urlsplit as urlsplit +from urllib.parse import urlunparse as urlunparse +from urllib.parse import urlunsplit as urlunsplit +from urllib.parse import quote as quote +from urllib.parse import quote_plus as quote_plus +from urllib.parse import unquote as unquote +from urllib.parse import unquote_plus as unquote_plus +from urllib.parse import urlencode as urlencode +# from urllib.parse import splitquery as splitquery +# from urllib.parse import splittag as splittag +# from urllib.parse import splituser as splituser +from urllib.parse import uses_fragment as uses_fragment +from urllib.parse import uses_netloc as uses_netloc +from urllib.parse import uses_params as uses_params +from urllib.parse import uses_query as uses_query +from urllib.parse import uses_relative as uses_relative diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib/request.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib/request.pyi new file mode 100644 index 0000000..b01dea7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib/request.pyi @@ -0,0 +1,39 @@ +# Stubs for six.moves.urllib.request +# +# Note: Commented out items means they weren't implemented at the time. +# Uncomment them when the modules have been added to the typeshed. +from urllib.request import urlopen as urlopen +from urllib.request import install_opener as install_opener +from urllib.request import build_opener as build_opener +from urllib.request import pathname2url as pathname2url +from urllib.request import url2pathname as url2pathname +from urllib.request import getproxies as getproxies +from urllib.request import Request as Request +from urllib.request import OpenerDirector as OpenerDirector +from urllib.request import HTTPDefaultErrorHandler as HTTPDefaultErrorHandler +from urllib.request import HTTPRedirectHandler as HTTPRedirectHandler +from urllib.request import HTTPCookieProcessor as HTTPCookieProcessor +from urllib.request import ProxyHandler as ProxyHandler +from urllib.request import BaseHandler as BaseHandler +from urllib.request import HTTPPasswordMgr as HTTPPasswordMgr +from urllib.request import HTTPPasswordMgrWithDefaultRealm as HTTPPasswordMgrWithDefaultRealm +from urllib.request import AbstractBasicAuthHandler as AbstractBasicAuthHandler +from urllib.request import HTTPBasicAuthHandler as HTTPBasicAuthHandler +from urllib.request import ProxyBasicAuthHandler as ProxyBasicAuthHandler +from urllib.request import AbstractDigestAuthHandler as AbstractDigestAuthHandler +from urllib.request import HTTPDigestAuthHandler as HTTPDigestAuthHandler +from urllib.request import ProxyDigestAuthHandler as ProxyDigestAuthHandler +from urllib.request import HTTPHandler as HTTPHandler +from urllib.request import HTTPSHandler as HTTPSHandler +from urllib.request import FileHandler as FileHandler +from urllib.request import FTPHandler as FTPHandler +from urllib.request import CacheFTPHandler as CacheFTPHandler +from urllib.request import UnknownHandler as UnknownHandler +from urllib.request import HTTPErrorProcessor as HTTPErrorProcessor +from urllib.request import urlretrieve as urlretrieve +from urllib.request import urlcleanup as urlcleanup +from urllib.request import URLopener as URLopener +from urllib.request import FancyURLopener as FancyURLopener +# from urllib.request import proxy_bypass as proxy_bypass +from urllib.request import parse_http_list as parse_http_list +from urllib.request import parse_keqv_list as parse_keqv_list diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib/response.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib/response.pyi new file mode 100644 index 0000000..9f681ea --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib/response.pyi @@ -0,0 +1,8 @@ +# Stubs for six.moves.urllib.response +# +# Note: Commented out items means they weren't implemented at the time. +# Uncomment them when the modules have been added to the typeshed. +# from urllib.response import addbase as addbase +# from urllib.response import addclosehook as addclosehook +# from urllib.response import addinfo as addinfo +from urllib.response import addinfourl as addinfourl diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib/robotparser.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib/robotparser.pyi new file mode 100644 index 0000000..bccda14 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib/robotparser.pyi @@ -0,0 +1 @@ +from urllib.robotparser import RobotFileParser as RobotFileParser diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib_error.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib_error.pyi new file mode 100644 index 0000000..2720072 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib_error.pyi @@ -0,0 +1 @@ +from urllib.error import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib_parse.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib_parse.pyi new file mode 100644 index 0000000..b557bbb --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib_parse.pyi @@ -0,0 +1 @@ +from urllib.parse import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib_request.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib_request.pyi new file mode 100644 index 0000000..dc03dce --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib_request.pyi @@ -0,0 +1 @@ +from .urllib.request import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib_response.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib_response.pyi new file mode 100644 index 0000000..bbee522 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib_response.pyi @@ -0,0 +1 @@ +from .urllib.response import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib_robotparser.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib_robotparser.pyi new file mode 100644 index 0000000..bbf5c3c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib_robotparser.pyi @@ -0,0 +1 @@ +from urllib.robotparser import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/typed_ast/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/typed_ast/__init__.pyi new file mode 100644 index 0000000..f260032 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/typed_ast/__init__.pyi @@ -0,0 +1,2 @@ +# This module is a fork of the CPython 2 and 3 ast modules with PEP 484 support. +# See: https://github.com/python/typed_ast diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/typed_ast/ast27.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/typed_ast/ast27.pyi new file mode 100644 index 0000000..c564342 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/typed_ast/ast27.pyi @@ -0,0 +1,361 @@ +import typing +from typing import Any, Optional, Union, Generic, Iterator + +class NodeVisitor(): + def visit(self, node: AST) -> Any: ... + def generic_visit(self, node: AST) -> None: ... + +class NodeTransformer(NodeVisitor): + def generic_visit(self, node: AST) -> None: ... + +def parse(source: Union[str, bytes], filename: Union[str, bytes] = ..., mode: str = ...) -> AST: ... +def copy_location(new_node: AST, old_node: AST) -> AST: ... +def dump(node: AST, annotate_fields: bool = ..., include_attributes: bool = ...) -> str: ... +def fix_missing_locations(node: AST) -> AST: ... +def get_docstring(node: AST, clean: bool = ...) -> Optional[bytes]: ... +def increment_lineno(node: AST, n: int = ...) -> AST: ... +def iter_child_nodes(node: AST) -> Iterator[AST]: ... +def iter_fields(node: AST) -> Iterator[typing.Tuple[str, Any]]: ... +def literal_eval(node_or_string: Union[str, AST]) -> Any: ... +def walk(node: AST) -> Iterator[AST]: ... + +PyCF_ONLY_AST: int + +# ast classes + +identifier = str + +class AST: + _attributes: typing.Tuple[str, ...] + _fields: typing.Tuple[str, ...] + def __init__(self, *args, **kwargs) -> None: ... + +class mod(AST): + ... + +class Module(mod): + body: typing.List[stmt] + type_ignores: typing.List[TypeIgnore] + +class Interactive(mod): + body: typing.List[stmt] + +class Expression(mod): + body: expr + +class FunctionType(mod): + argtypes: typing.List[expr] + returns: expr + +class Suite(mod): + body: typing.List[stmt] + + +class stmt(AST): + lineno: int + col_offset: int + +class FunctionDef(stmt): + name: identifier + args: arguments + body: typing.List[stmt] + decorator_list: typing.List[expr] + type_comment: Optional[str] + +class ClassDef(stmt): + name: identifier + bases: typing.List[expr] + body: typing.List[stmt] + decorator_list: typing.List[expr] + +class Return(stmt): + value: Optional[expr] + +class Delete(stmt): + targets: typing.List[expr] + +class Assign(stmt): + targets: typing.List[expr] + value: expr + type_comment: Optional[str] + +class AugAssign(stmt): + target: expr + op: operator + value: expr + +class Print(stmt): + dest: Optional[expr] + values: typing.List[expr] + nl: bool + +class For(stmt): + target: expr + iter: expr + body: typing.List[stmt] + orelse: typing.List[stmt] + type_comment: Optional[str] + +class While(stmt): + test: expr + body: typing.List[stmt] + orelse: typing.List[stmt] + +class If(stmt): + test: expr + body: typing.List[stmt] + orelse: typing.List[stmt] + +class With(stmt): + context_expr: expr + optional_vars: Optional[expr] + body: typing.List[stmt] + type_comment: Optional[str] + +class Raise(stmt): + type: Optional[expr] + inst: Optional[expr] + tback: Optional[expr] + +class TryExcept(stmt): + body: typing.List[stmt] + handlers: typing.List[ExceptHandler] + orelse: typing.List[stmt] + +class TryFinally(stmt): + body: typing.List[stmt] + finalbody: typing.List[stmt] + +class Assert(stmt): + test: expr + msg: Optional[expr] + +class Import(stmt): + names: typing.List[alias] + +class ImportFrom(stmt): + module: Optional[identifier] + names: typing.List[alias] + level: Optional[int] + +class Exec(stmt): + body: expr + globals: Optional[expr] + locals: Optional[expr] + +class Global(stmt): + names: typing.List[identifier] + +class Expr(stmt): + value: expr + +class Pass(stmt): ... +class Break(stmt): ... +class Continue(stmt): ... + + +class slice(AST): + ... + +_slice = slice # this lets us type the variable named 'slice' below + +class Slice(slice): + lower: Optional[expr] + upper: Optional[expr] + step: Optional[expr] + +class ExtSlice(slice): + dims: typing.List[slice] + +class Index(slice): + value: expr + +class Ellipsis(slice): ... + + +class expr(AST): + lineno: int + col_offset: int + +class BoolOp(expr): + op: boolop + values: typing.List[expr] + +class BinOp(expr): + left: expr + op: operator + right: expr + +class UnaryOp(expr): + op: unaryop + operand: expr + +class Lambda(expr): + args: arguments + body: expr + +class IfExp(expr): + test: expr + body: expr + orelse: expr + +class Dict(expr): + keys: typing.List[expr] + values: typing.List[expr] + +class Set(expr): + elts: typing.List[expr] + +class ListComp(expr): + elt: expr + generators: typing.List[comprehension] + +class SetComp(expr): + elt: expr + generators: typing.List[comprehension] + +class DictComp(expr): + key: expr + value: expr + generators: typing.List[comprehension] + +class GeneratorExp(expr): + elt: expr + generators: typing.List[comprehension] + +class Yield(expr): + value: Optional[expr] + +class Compare(expr): + left: expr + ops: typing.List[cmpop] + comparators: typing.List[expr] + +class Call(expr): + func: expr + args: typing.List[expr] + keywords: typing.List[keyword] + starargs: Optional[expr] + kwargs: Optional[expr] + +class Repr(expr): + value: expr + +class Num(expr): + n: Union[int, float, complex] + +class Str(expr): + s: bytes + kind: str + +class Attribute(expr): + value: expr + attr: identifier + ctx: expr_context + +class Subscript(expr): + value: expr + slice: _slice + ctx: expr_context + +class Name(expr): + id: identifier + ctx: expr_context + +class List(expr): + elts: typing.List[expr] + ctx: expr_context + +class Tuple(expr): + elts: typing.List[expr] + ctx: expr_context + + +class expr_context(AST): + ... + +class AugLoad(expr_context): ... +class AugStore(expr_context): ... +class Del(expr_context): ... +class Load(expr_context): ... +class Param(expr_context): ... +class Store(expr_context): ... + + +class boolop(AST): + ... + +class And(boolop): ... +class Or(boolop): ... + +class operator(AST): + ... + +class Add(operator): ... +class BitAnd(operator): ... +class BitOr(operator): ... +class BitXor(operator): ... +class Div(operator): ... +class FloorDiv(operator): ... +class LShift(operator): ... +class Mod(operator): ... +class Mult(operator): ... +class Pow(operator): ... +class RShift(operator): ... +class Sub(operator): ... + +class unaryop(AST): + ... + +class Invert(unaryop): ... +class Not(unaryop): ... +class UAdd(unaryop): ... +class USub(unaryop): ... + +class cmpop(AST): + ... + +class Eq(cmpop): ... +class Gt(cmpop): ... +class GtE(cmpop): ... +class In(cmpop): ... +class Is(cmpop): ... +class IsNot(cmpop): ... +class Lt(cmpop): ... +class LtE(cmpop): ... +class NotEq(cmpop): ... +class NotIn(cmpop): ... + + +class comprehension(AST): + target: expr + iter: expr + ifs: typing.List[expr] + + +class ExceptHandler(AST): + type: Optional[expr] + name: Optional[expr] + body: typing.List[stmt] + lineno: int + col_offset: int + + +class arguments(AST): + args: typing.List[expr] + vararg: Optional[identifier] + kwarg: Optional[identifier] + defaults: typing.List[expr] + type_comments: typing.List[Optional[str]] + +class keyword(AST): + arg: identifier + value: expr + +class alias(AST): + name: identifier + asname: Optional[identifier] + + +class TypeIgnore(AST): + lineno: int diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/typed_ast/ast3.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/typed_ast/ast3.pyi new file mode 100644 index 0000000..1962b46 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/typed_ast/ast3.pyi @@ -0,0 +1,413 @@ +import typing +from typing import Any, Optional, Union, Generic, Iterator + +class NodeVisitor(): + def visit(self, node: AST) -> Any: ... + def generic_visit(self, node: AST) -> None: ... + +class NodeTransformer(NodeVisitor): + def generic_visit(self, node: AST) -> None: ... + +def parse(source: Union[str, bytes], + filename: Union[str, bytes] = ..., + mode: str = ..., + feature_version: int = ...) -> AST: ... +def copy_location(new_node: AST, old_node: AST) -> AST: ... +def dump(node: AST, annotate_fields: bool = ..., include_attributes: bool = ...) -> str: ... +def fix_missing_locations(node: AST) -> AST: ... +def get_docstring(node: AST, clean: bool = ...) -> str: ... +def increment_lineno(node: AST, n: int = ...) -> AST: ... +def iter_child_nodes(node: AST) -> Iterator[AST]: ... +def iter_fields(node: AST) -> Iterator[typing.Tuple[str, Any]]: ... +def literal_eval(node_or_string: Union[str, AST]) -> Any: ... +def walk(node: AST) -> Iterator[AST]: ... + +PyCF_ONLY_AST: int + +# ast classes + +identifier = str + +class AST: + _attributes: typing.Tuple[str, ...] + _fields: typing.Tuple[str, ...] + def __init__(self, *args, **kwargs) -> None: ... + +class mod(AST): + ... + +class Module(mod): + body: typing.List[stmt] + type_ignores: typing.List[TypeIgnore] + +class Interactive(mod): + body: typing.List[stmt] + +class Expression(mod): + body: expr + +class FunctionType(mod): + argtypes: typing.List[expr] + returns: expr + +class Suite(mod): + body: typing.List[stmt] + + +class stmt(AST): + lineno: int + col_offset: int + +class FunctionDef(stmt): + name: identifier + args: arguments + body: typing.List[stmt] + decorator_list: typing.List[expr] + returns: Optional[expr] + type_comment: Optional[str] + +class AsyncFunctionDef(stmt): + name: identifier + args: arguments + body: typing.List[stmt] + decorator_list: typing.List[expr] + returns: Optional[expr] + type_comment: Optional[str] + +class ClassDef(stmt): + name: identifier + bases: typing.List[expr] + keywords: typing.List[keyword] + body: typing.List[stmt] + decorator_list: typing.List[expr] + +class Return(stmt): + value: Optional[expr] + +class Delete(stmt): + targets: typing.List[expr] + +class Assign(stmt): + targets: typing.List[expr] + value: expr + type_comment: Optional[str] + +class AugAssign(stmt): + target: expr + op: operator + value: expr + +class AnnAssign(stmt): + target: expr + annotation: expr + value: Optional[expr] + simple: int + +class For(stmt): + target: expr + iter: expr + body: typing.List[stmt] + orelse: typing.List[stmt] + type_comment: Optional[str] + +class AsyncFor(stmt): + target: expr + iter: expr + body: typing.List[stmt] + orelse: typing.List[stmt] + type_comment: Optional[str] + +class While(stmt): + test: expr + body: typing.List[stmt] + orelse: typing.List[stmt] + +class If(stmt): + test: expr + body: typing.List[stmt] + orelse: typing.List[stmt] + +class With(stmt): + items: typing.List[withitem] + body: typing.List[stmt] + type_comment: Optional[str] + +class AsyncWith(stmt): + items: typing.List[withitem] + body: typing.List[stmt] + type_comment: Optional[str] + +class Raise(stmt): + exc: Optional[expr] + cause: Optional[expr] + +class Try(stmt): + body: typing.List[stmt] + handlers: typing.List[ExceptHandler] + orelse: typing.List[stmt] + finalbody: typing.List[stmt] + +class Assert(stmt): + test: expr + msg: Optional[expr] + +class Import(stmt): + names: typing.List[alias] + +class ImportFrom(stmt): + module: Optional[identifier] + names: typing.List[alias] + level: Optional[int] + +class Global(stmt): + names: typing.List[identifier] + +class Nonlocal(stmt): + names: typing.List[identifier] + +class Expr(stmt): + value: expr + +class Pass(stmt): ... +class Break(stmt): ... +class Continue(stmt): ... + + +class slice(AST): + ... + +_slice = slice # this lets us type the variable named 'slice' below + +class Slice(slice): + lower: Optional[expr] + upper: Optional[expr] + step: Optional[expr] + +class ExtSlice(slice): + dims: typing.List[slice] + +class Index(slice): + value: expr + + +class expr(AST): + lineno: int + col_offset: int + +class BoolOp(expr): + op: boolop + values: typing.List[expr] + +class BinOp(expr): + left: expr + op: operator + right: expr + +class UnaryOp(expr): + op: unaryop + operand: expr + +class Lambda(expr): + args: arguments + body: expr + +class IfExp(expr): + test: expr + body: expr + orelse: expr + +class Dict(expr): + keys: typing.List[expr] + values: typing.List[expr] + +class Set(expr): + elts: typing.List[expr] + +class ListComp(expr): + elt: expr + generators: typing.List[comprehension] + +class SetComp(expr): + elt: expr + generators: typing.List[comprehension] + +class DictComp(expr): + key: expr + value: expr + generators: typing.List[comprehension] + +class GeneratorExp(expr): + elt: expr + generators: typing.List[comprehension] + +class Await(expr): + value: expr + +class Yield(expr): + value: Optional[expr] + +class YieldFrom(expr): + value: expr + +class Compare(expr): + left: expr + ops: typing.List[cmpop] + comparators: typing.List[expr] + +class Call(expr): + func: expr + args: typing.List[expr] + keywords: typing.List[keyword] + +class Num(expr): + n: Union[float, int, complex] + +class Str(expr): + s: str + kind: str + +class FormattedValue(expr): + value: expr + conversion: typing.Optional[int] + format_spec: typing.Optional[expr] + +class JoinedStr(expr): + values: typing.List[expr] + +class Bytes(expr): + s: bytes + +class NameConstant(expr): + value: Any + +class Ellipsis(expr): ... + +class Attribute(expr): + value: expr + attr: identifier + ctx: expr_context + +class Subscript(expr): + value: expr + slice: _slice + ctx: expr_context + +class Starred(expr): + value: expr + ctx: expr_context + +class Name(expr): + id: identifier + ctx: expr_context + +class List(expr): + elts: typing.List[expr] + ctx: expr_context + +class Tuple(expr): + elts: typing.List[expr] + ctx: expr_context + + +class expr_context(AST): + ... + +class AugLoad(expr_context): ... +class AugStore(expr_context): ... +class Del(expr_context): ... +class Load(expr_context): ... +class Param(expr_context): ... +class Store(expr_context): ... + + +class boolop(AST): + ... + +class And(boolop): ... +class Or(boolop): ... + +class operator(AST): + ... + +class Add(operator): ... +class BitAnd(operator): ... +class BitOr(operator): ... +class BitXor(operator): ... +class Div(operator): ... +class FloorDiv(operator): ... +class LShift(operator): ... +class Mod(operator): ... +class Mult(operator): ... +class MatMult(operator): ... +class Pow(operator): ... +class RShift(operator): ... +class Sub(operator): ... + +class unaryop(AST): + ... + +class Invert(unaryop): ... +class Not(unaryop): ... +class UAdd(unaryop): ... +class USub(unaryop): ... + +class cmpop(AST): + ... + +class Eq(cmpop): ... +class Gt(cmpop): ... +class GtE(cmpop): ... +class In(cmpop): ... +class Is(cmpop): ... +class IsNot(cmpop): ... +class Lt(cmpop): ... +class LtE(cmpop): ... +class NotEq(cmpop): ... +class NotIn(cmpop): ... + + +class comprehension(AST): + target: expr + iter: expr + ifs: typing.List[expr] + is_async: int + + +class ExceptHandler(AST): + type: Optional[expr] + name: Optional[identifier] + body: typing.List[stmt] + lineno: int + col_offset: int + + +class arguments(AST): + args: typing.List[arg] + vararg: Optional[arg] + kwonlyargs: typing.List[arg] + kw_defaults: typing.List[expr] + kwarg: Optional[arg] + defaults: typing.List[expr] + +class arg(AST): + arg: identifier + annotation: Optional[expr] + lineno: int + col_offset: int + type_comment: typing.Optional[str] + +class keyword(AST): + arg: Optional[identifier] + value: expr + +class alias(AST): + name: identifier + asname: Optional[identifier] + +class withitem(AST): + context_expr: expr + optional_vars: Optional[expr] + + +class TypeIgnore(AST): + lineno: int diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/typed_ast/conversions.pyi b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/typed_ast/conversions.pyi new file mode 100644 index 0000000..d5f1829 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/third_party/typeshed/third_party/3/typed_ast/conversions.pyi @@ -0,0 +1,4 @@ +from . import ast27 +from . import ast3 + +def py2to3(ast: ast27.AST) -> ast3.AST: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/utils.py b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/utils.py new file mode 100644 index 0000000..a5cf84b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/build/lib/jedi/utils.py @@ -0,0 +1,134 @@ +""" +Utilities for end-users. +""" + +from __future__ import absolute_import +import __main__ +from collections import namedtuple +import logging +import traceback +import re +import os +import sys + +from jedi import Interpreter + + +READLINE_DEBUG = False + + +def setup_readline(namespace_module=__main__): + """ + Install Jedi completer to :mod:`readline`. + + This function setups :mod:`readline` to use Jedi in Python interactive + shell. If you want to use a custom ``PYTHONSTARTUP`` file (typically + ``$HOME/.pythonrc.py``), you can add this piece of code:: + + try: + from jedi.utils import setup_readline + setup_readline() + except ImportError: + # Fallback to the stdlib readline completer if it is installed. + # Taken from http://docs.python.org/2/library/rlcompleter.html + print("Jedi is not installed, falling back to readline") + try: + import readline + import rlcompleter + readline.parse_and_bind("tab: complete") + except ImportError: + print("Readline is not installed either. No tab completion is enabled.") + + This will fallback to the readline completer if Jedi is not installed. + The readline completer will only complete names in the global namespace, + so for example:: + + ran + + will complete to ``range`` + + with both Jedi and readline, but:: + + range(10).cou + + will show complete to ``range(10).count`` only with Jedi. + + You'll also need to add ``export PYTHONSTARTUP=$HOME/.pythonrc.py`` to + your shell profile (usually ``.bash_profile`` or ``.profile`` if you use + bash). + + """ + if READLINE_DEBUG: + logging.basicConfig( + filename='/tmp/jedi.log', + filemode='a', + level=logging.DEBUG + ) + + class JediRL(object): + def complete(self, text, state): + """ + This complete stuff is pretty weird, a generator would make + a lot more sense, but probably due to backwards compatibility + this is still the way how it works. + + The only important part is stuff in the ``state == 0`` flow, + everything else has been copied from the ``rlcompleter`` std. + library module. + """ + if state == 0: + sys.path.insert(0, os.getcwd()) + # Calling python doesn't have a path, so add to sys.path. + try: + logging.debug("Start REPL completion: " + repr(text)) + interpreter = Interpreter(text, [namespace_module.__dict__]) + + completions = interpreter.completions() + logging.debug("REPL completions: %s", completions) + + self.matches = [ + text[:len(text) - c._like_name_length] + c.name_with_symbols + for c in completions + ] + except: + logging.error("REPL Completion error:\n" + traceback.format_exc()) + raise + finally: + sys.path.pop(0) + try: + return self.matches[state] + except IndexError: + return None + + try: + # Need to import this one as well to make sure it's executed before + # this code. This didn't use to be an issue until 3.3. Starting with + # 3.4 this is different, it always overwrites the completer if it's not + # already imported here. + import rlcompleter # noqa: F401 + import readline + except ImportError: + print("Jedi: Module readline not available.") + else: + readline.set_completer(JediRL().complete) + readline.parse_and_bind("tab: complete") + # jedi itself does the case matching + readline.parse_and_bind("set completion-ignore-case on") + # because it's easier to hit the tab just once + readline.parse_and_bind("set show-all-if-unmodified") + readline.parse_and_bind("set show-all-if-ambiguous on") + # don't repeat all the things written in the readline all the time + readline.parse_and_bind("set completion-prefix-display-length 2") + # No delimiters, Jedi handles that. + readline.set_completer_delims('') + + +def version_info(): + """ + Returns a namedtuple of Jedi's version, similar to Python's + ``sys.version_info``. + """ + Version = namedtuple('Version', 'major, minor, micro') + from jedi import __version__ + tupl = re.findall(r'[a-z]+|\d+', __version__) + return Version(*[x if i == 3 else int(x) for i, x in enumerate(tupl)]) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/conftest.py b/vim/bundle/jedi-vim/pythonx/jedi/conftest.py new file mode 100644 index 0000000..765c865 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/conftest.py @@ -0,0 +1,158 @@ +import tempfile +import shutil +import os +from functools import partial + +import pytest + +import jedi +from jedi.api.environment import get_system_environment, InterpreterEnvironment +from jedi._compatibility import py_version + +collect_ignore = [ + 'setup.py', + '__main__.py', + 'jedi/evaluate/compiled/subprocess/__main__.py', + 'build/', + 'test/examples', +] + + +# The following hooks (pytest_configure, pytest_unconfigure) are used +# to modify `jedi.settings.cache_directory` because `clean_jedi_cache` +# has no effect during doctests. Without these hooks, doctests uses +# user's cache (e.g., ~/.cache/jedi/). We should remove this +# workaround once the problem is fixed in pytest. +# +# See: +# - https://github.com/davidhalter/jedi/pull/168 +# - https://bitbucket.org/hpk42/pytest/issue/275/ + +jedi_cache_directory_orig = None +jedi_cache_directory_temp = None + + +def pytest_addoption(parser): + parser.addoption("--jedi-debug", "-D", action='store_true', + help="Enables Jedi's debug output.") + + parser.addoption("--warning-is-error", action='store_true', + help="Warnings are treated as errors.") + + parser.addoption("--env", action='store', + help="Execute the tests in that environment (e.g. 35 for python3.5).") + parser.addoption("--interpreter-env", "-I", action='store_true', + help="Don't use subprocesses to guarantee having safe " + "code execution. Useful for debugging.") + + +def pytest_configure(config): + global jedi_cache_directory_orig, jedi_cache_directory_temp + jedi_cache_directory_orig = jedi.settings.cache_directory + jedi_cache_directory_temp = tempfile.mkdtemp(prefix='jedi-test-') + jedi.settings.cache_directory = jedi_cache_directory_temp + + if config.option.jedi_debug: + jedi.set_debug_function() + + if config.option.warning_is_error: + import warnings + warnings.simplefilter("error") + + +def pytest_unconfigure(config): + global jedi_cache_directory_orig, jedi_cache_directory_temp + jedi.settings.cache_directory = jedi_cache_directory_orig + shutil.rmtree(jedi_cache_directory_temp) + + +@pytest.fixture(scope='session') +def clean_jedi_cache(request): + """ + Set `jedi.settings.cache_directory` to a temporary directory during test. + + Note that you can't use built-in `tmpdir` and `monkeypatch` + fixture here because their scope is 'function', which is not used + in 'session' scope fixture. + + This fixture is activated in ../pytest.ini. + """ + from jedi import settings + old = settings.cache_directory + tmp = tempfile.mkdtemp(prefix='jedi-test-') + settings.cache_directory = tmp + + @request.addfinalizer + def restore(): + settings.cache_directory = old + shutil.rmtree(tmp) + + +@pytest.fixture(scope='session') +def environment(request): + if request.config.option.interpreter_env: + return InterpreterEnvironment() + + version = request.config.option.env + if version is None: + version = os.environ.get('JEDI_TEST_ENVIRONMENT', str(py_version)) + + return get_system_environment(version[0] + '.' + version[1:]) + + +@pytest.fixture(scope='session') +def Script(environment): + return partial(jedi.Script, environment=environment) + + +@pytest.fixture(scope='session') +def names(environment): + return partial(jedi.names, environment=environment) + + +@pytest.fixture(scope='session') +def has_typing(environment): + if environment.version_info >= (3, 5, 0): + # This if is just needed to avoid that tests ever skip way more than + # they should for all Python versions. + return True + + script = jedi.Script('import typing', environment=environment) + return bool(script.goto_definitions()) + + +@pytest.fixture(scope='session') +def jedi_path(): + return os.path.dirname(__file__) + + +@pytest.fixture() +def skip_python2(environment): + if environment.version_info.major == 2: + # This if is just needed to avoid that tests ever skip way more than + # they should for all Python versions. + pytest.skip() + + +@pytest.fixture() +def skip_pre_python38(environment): + if environment.version_info < (3, 8): + # This if is just needed to avoid that tests ever skip way more than + # they should for all Python versions. + pytest.skip() + + +@pytest.fixture() +def skip_pre_python37(environment): + if environment.version_info < (3, 7): + # This if is just needed to avoid that tests ever skip way more than + # they should for all Python versions. + pytest.skip() + + +@pytest.fixture() +def skip_pre_python35(environment): + if environment.version_info < (3, 5): + # This if is just needed to avoid that tests ever skip way more than + # they should for all Python versions. + pytest.skip() diff --git a/vim/bundle/jedi-vim/pythonx/jedi/deploy-master.sh b/vim/bundle/jedi-vim/pythonx/jedi/deploy-master.sh new file mode 100755 index 0000000..eadddfe --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/deploy-master.sh @@ -0,0 +1,53 @@ +#!/usr/bin/env bash +# The script creates a separate folder in build/ and creates tags there, pushes +# them and then uploads the package to PyPI. + +set -eu -o pipefail + +BASE_DIR=$(dirname $(readlink -f "$0")) +cd $BASE_DIR + +git fetch --tags + +PROJECT_NAME=jedi +BRANCH=master +BUILD_FOLDER=build + +[ -d $BUILD_FOLDER ] || mkdir $BUILD_FOLDER +# Remove the previous deployment first. +# Checkout the right branch +cd $BUILD_FOLDER +rm -rf $PROJECT_NAME +git clone .. $PROJECT_NAME +cd $PROJECT_NAME +git checkout $BRANCH +git submodule update --init + +# Test first. +tox + +# Create tag +tag=v$(python -c "import $PROJECT_NAME; print($PROJECT_NAME.__version__)") + +master_ref=$(git show-ref -s heads/$BRANCH) +tag_ref=$(git show-ref -s $tag || true) +if [[ $tag_ref ]]; then + if [[ $tag_ref != $master_ref ]]; then + echo 'Cannot tag something that has already been tagged with another commit.' + exit 1 + fi +else + git tag -a $tag + git push --tags +fi + +# Package and upload to PyPI +#rm -rf dist/ - Not needed anymore, because the folder is never reused. +echo `pwd` +python setup.py sdist bdist_wheel +# Maybe do a pip install twine before. +twine upload dist/* + +cd $BASE_DIR +# The tags have been pushed to this repo. Push the tags to github, now. +git push --tags diff --git a/vim/bundle/jedi-vim/pythonx/jedi/dist/jedi-0.15.1-py3.6.egg b/vim/bundle/jedi-vim/pythonx/jedi/dist/jedi-0.15.1-py3.6.egg new file mode 100644 index 0000000..935e7ef Binary files /dev/null and b/vim/bundle/jedi-vim/pythonx/jedi/dist/jedi-0.15.1-py3.6.egg differ diff --git a/vim/bundle/jedi-vim/pythonx/jedi/docs/Makefile b/vim/bundle/jedi-vim/pythonx/jedi/docs/Makefile new file mode 100644 index 0000000..14cfdf4 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/docs/Makefile @@ -0,0 +1,153 @@ +# Makefile for Sphinx documentation +# + +# You can set these variables from the command line. +SPHINXOPTS = +SPHINXBUILD = sphinx-build +PAPER = +BUILDDIR = _build + +# Internal variables. +PAPEROPT_a4 = -D latex_paper_size=a4 +PAPEROPT_letter = -D latex_paper_size=letter +ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . +# the i18n builder cannot share the environment and doctrees with the others +I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . + +.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext + +help: + @echo "Please use \`make ' where is one of" + @echo " html to make standalone HTML files" + @echo " dirhtml to make HTML files named index.html in directories" + @echo " singlehtml to make a single large HTML file" + @echo " pickle to make pickle files" + @echo " json to make JSON files" + @echo " htmlhelp to make HTML files and a HTML help project" + @echo " qthelp to make HTML files and a qthelp project" + @echo " devhelp to make HTML files and a Devhelp project" + @echo " epub to make an epub" + @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" + @echo " latexpdf to make LaTeX files and run them through pdflatex" + @echo " text to make text files" + @echo " man to make manual pages" + @echo " texinfo to make Texinfo files" + @echo " info to make Texinfo files and run them through makeinfo" + @echo " gettext to make PO message catalogs" + @echo " changes to make an overview of all changed/added/deprecated items" + @echo " linkcheck to check all external links for integrity" + @echo " doctest to run all doctests embedded in the documentation (if enabled)" + +clean: + -rm -rf $(BUILDDIR)/* + +html: + $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." + +dirhtml: + $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." + +singlehtml: + $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml + @echo + @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." + +pickle: + $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle + @echo + @echo "Build finished; now you can process the pickle files." + +json: + $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json + @echo + @echo "Build finished; now you can process the JSON files." + +htmlhelp: + $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp + @echo + @echo "Build finished; now you can run HTML Help Workshop with the" \ + ".hhp project file in $(BUILDDIR)/htmlhelp." + +qthelp: + $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp + @echo + @echo "Build finished; now you can run "qcollectiongenerator" with the" \ + ".qhcp project file in $(BUILDDIR)/qthelp, like this:" + @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Jedi.qhcp" + @echo "To view the help file:" + @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Jedi.qhc" + +devhelp: + $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp + @echo + @echo "Build finished." + @echo "To view the help file:" + @echo "# mkdir -p $$HOME/.local/share/devhelp/Jedi" + @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Jedi" + @echo "# devhelp" + +epub: + $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub + @echo + @echo "Build finished. The epub file is in $(BUILDDIR)/epub." + +latex: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo + @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." + @echo "Run \`make' in that directory to run these through (pdf)latex" \ + "(use \`make latexpdf' here to do that automatically)." + +latexpdf: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo "Running LaTeX files through pdflatex..." + $(MAKE) -C $(BUILDDIR)/latex all-pdf + @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." + +text: + $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text + @echo + @echo "Build finished. The text files are in $(BUILDDIR)/text." + +man: + $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man + @echo + @echo "Build finished. The manual pages are in $(BUILDDIR)/man." + +texinfo: + $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo + @echo + @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." + @echo "Run \`make' in that directory to run these through makeinfo" \ + "(use \`make info' here to do that automatically)." + +info: + $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo + @echo "Running Texinfo files through makeinfo..." + make -C $(BUILDDIR)/texinfo info + @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." + +gettext: + $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale + @echo + @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." + +changes: + $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes + @echo + @echo "The overview file is in $(BUILDDIR)/changes." + +linkcheck: + $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck + @echo + @echo "Link check complete; look for any errors in the above output " \ + "or in $(BUILDDIR)/linkcheck/output.txt." + +doctest: + $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest + @echo "Testing of doctests in the sources finished, look at the " \ + "results in $(BUILDDIR)/doctest/output.txt." diff --git a/vim/bundle/jedi-vim/pythonx/jedi/docs/README.md b/vim/bundle/jedi-vim/pythonx/jedi/docs/README.md new file mode 100644 index 0000000..5eac8a2 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/docs/README.md @@ -0,0 +1,14 @@ +Installation +------------ + +Install the graphviz library:: + + sudo apt-get install graphviz + +Install sphinx:: + + sudo pip install sphinx + +You might also need to install the Python graphviz interface:: + + sudo pip install graphviz diff --git a/vim/bundle/jedi-vim/pythonx/jedi/docs/_screenshots/screenshot_complete.png b/vim/bundle/jedi-vim/pythonx/jedi/docs/_screenshots/screenshot_complete.png new file mode 100644 index 0000000..2bafad6 Binary files /dev/null and b/vim/bundle/jedi-vim/pythonx/jedi/docs/_screenshots/screenshot_complete.png differ diff --git a/vim/bundle/jedi-vim/pythonx/jedi/docs/_screenshots/screenshot_function.png b/vim/bundle/jedi-vim/pythonx/jedi/docs/_screenshots/screenshot_function.png new file mode 100644 index 0000000..6109703 Binary files /dev/null and b/vim/bundle/jedi-vim/pythonx/jedi/docs/_screenshots/screenshot_function.png differ diff --git a/vim/bundle/jedi-vim/pythonx/jedi/docs/_screenshots/screenshot_pydoc.png b/vim/bundle/jedi-vim/pythonx/jedi/docs/_screenshots/screenshot_pydoc.png new file mode 100644 index 0000000..a399d5f Binary files /dev/null and b/vim/bundle/jedi-vim/pythonx/jedi/docs/_screenshots/screenshot_pydoc.png differ diff --git a/vim/bundle/jedi-vim/pythonx/jedi/docs/_static/logo-src.txt b/vim/bundle/jedi-vim/pythonx/jedi/docs/_static/logo-src.txt new file mode 100644 index 0000000..59aa4f6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/docs/_static/logo-src.txt @@ -0,0 +1,3 @@ +The source of the logo is a photoshop file hosted here: + +https://dl.dropboxusercontent.com/u/170011615/Jedi12_Logo.psd.xz diff --git a/vim/bundle/jedi-vim/pythonx/jedi/docs/_static/logo.png b/vim/bundle/jedi-vim/pythonx/jedi/docs/_static/logo.png new file mode 100644 index 0000000..9f3d244 Binary files /dev/null and b/vim/bundle/jedi-vim/pythonx/jedi/docs/_static/logo.png differ diff --git a/vim/bundle/jedi-vim/pythonx/jedi/docs/_templates/ghbuttons.html b/vim/bundle/jedi-vim/pythonx/jedi/docs/_templates/ghbuttons.html new file mode 100644 index 0000000..07292e1 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/docs/_templates/ghbuttons.html @@ -0,0 +1,4 @@ +

Github

+ +

diff --git a/vim/bundle/jedi-vim/pythonx/jedi/docs/_templates/sidebarlogo.html b/vim/bundle/jedi-vim/pythonx/jedi/docs/_templates/sidebarlogo.html new file mode 100644 index 0000000..d9243c4 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/docs/_templates/sidebarlogo.html @@ -0,0 +1,3 @@ + diff --git a/vim/bundle/jedi-vim/pythonx/jedi/docs/_themes/flask/LICENSE b/vim/bundle/jedi-vim/pythonx/jedi/docs/_themes/flask/LICENSE new file mode 100644 index 0000000..8daab7e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/docs/_themes/flask/LICENSE @@ -0,0 +1,37 @@ +Copyright (c) 2010 by Armin Ronacher. + +Some rights reserved. + +Redistribution and use in source and binary forms of the theme, with or +without modification, are permitted provided that the following conditions +are met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + +* The names of the contributors may not be used to endorse or + promote products derived from this software without specific + prior written permission. + +We kindly ask you to only use these themes in an unmodified manner just +for Flask and Flask-related products, not for unrelated projects. If you +like the visual style and want to use it for your own projects, please +consider making some larger changes to the themes (such as changing +font faces, sizes, colors or margins). + +THIS THEME IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS THEME, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/vim/bundle/jedi-vim/pythonx/jedi/docs/_themes/flask/layout.html b/vim/bundle/jedi-vim/pythonx/jedi/docs/_themes/flask/layout.html new file mode 100644 index 0000000..48cb4d5 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/docs/_themes/flask/layout.html @@ -0,0 +1,27 @@ +{%- extends "basic/layout.html" %} +{%- block extrahead %} + {{ super() }} + {% if theme_touch_icon %} + + {% endif %} + + + Fork me on GitHub + +{% endblock %} +{%- block relbar2 %}{% endblock %} +{% block header %} + {{ super() }} + {% if pagename == 'index' %} +
+ {% endif %} +{% endblock %} +{%- block footer %} + + {% if pagename == 'index' %} +
+ {% endif %} +{%- endblock %} diff --git a/vim/bundle/jedi-vim/pythonx/jedi/docs/_themes/flask/relations.html b/vim/bundle/jedi-vim/pythonx/jedi/docs/_themes/flask/relations.html new file mode 100644 index 0000000..3bbcde8 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/docs/_themes/flask/relations.html @@ -0,0 +1,19 @@ +

Related Topics

+ diff --git a/vim/bundle/jedi-vim/pythonx/jedi/docs/_themes/flask/static/flasky.css_t b/vim/bundle/jedi-vim/pythonx/jedi/docs/_themes/flask/static/flasky.css_t new file mode 100644 index 0000000..79ab478 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/docs/_themes/flask/static/flasky.css_t @@ -0,0 +1,394 @@ +/* + * flasky.css_t + * ~~~~~~~~~~~~ + * + * :copyright: Copyright 2010 by Armin Ronacher. + * :license: Flask Design License, see LICENSE for details. + */ + +{% set page_width = '940px' %} +{% set sidebar_width = '220px' %} + +@import url("basic.css"); + +/* -- page layout ----------------------------------------------------------- */ + +body { + font-family: 'Georgia', serif; + font-size: 17px; + background-color: white; + color: #000; + margin: 0; + padding: 0; +} + +div.document { + width: {{ page_width }}; + margin: 30px auto 0 auto; +} + +div.documentwrapper { + float: left; + width: 100%; +} + +div.bodywrapper { + margin: 0 0 0 {{ sidebar_width }}; +} + +div.sphinxsidebar { + width: {{ sidebar_width }}; +} + +hr { + border: 1px solid #B1B4B6; +} + +div.body { + background-color: #ffffff; + color: #3E4349; + padding: 0 30px 0 30px; +} + +img.floatingflask { + padding: 0 0 10px 10px; + float: right; +} + +div.footer { + width: {{ page_width }}; + margin: 20px auto 30px auto; + font-size: 14px; + color: #888; + text-align: right; +} + +div.footer a { + color: #888; +} + +div.related { + display: none; +} + +div.sphinxsidebar a { + color: #444; + text-decoration: none; + border-bottom: 1px dotted #999; +} + +div.sphinxsidebar a:hover { + border-bottom: 1px solid #999; +} + +div.sphinxsidebar { + font-size: 14px; + line-height: 1.5; +} + +div.sphinxsidebarwrapper { + padding: 18px 10px; +} + +div.sphinxsidebarwrapper p.logo { + padding: 0 0 20px 0; + margin: 0; + text-align: center; +} + +div.sphinxsidebar h3, +div.sphinxsidebar h4 { + font-family: 'Garamond', 'Georgia', serif; + color: #444; + font-size: 24px; + font-weight: normal; + margin: 0 0 5px 0; + padding: 0; +} + +div.sphinxsidebar h4 { + font-size: 20px; +} + +div.sphinxsidebar h3 a { + color: #444; +} + +div.sphinxsidebar p.logo a, +div.sphinxsidebar h3 a, +div.sphinxsidebar p.logo a:hover, +div.sphinxsidebar h3 a:hover { + border: none; +} + +div.sphinxsidebar p { + color: #555; + margin: 10px 0; +} + +div.sphinxsidebar ul { + margin: 10px 0; + padding: 0; + color: #000; +} + +div.sphinxsidebar input { + border: 1px solid #ccc; + font-family: 'Georgia', serif; + font-size: 1em; +} + +/* -- body styles ----------------------------------------------------------- */ + +a { + color: #004B6B; + text-decoration: underline; +} + +a:hover { + color: #6D4100; + text-decoration: underline; +} + +div.body h1, +div.body h2, +div.body h3, +div.body h4, +div.body h5, +div.body h6 { + font-family: 'Garamond', 'Georgia', serif; + font-weight: normal; + margin: 30px 0px 10px 0px; + padding: 0; +} + +{% if theme_index_logo %} +div.indexwrapper h1 { + text-indent: -999999px; + background: url({{ theme_index_logo }}) no-repeat center center; + height: {{ theme_index_logo_height }}; +} +{% endif %} + +div.body h1 { margin-top: 0; padding-top: 0; font-size: 240%; } +div.body h2 { font-size: 180%; } +div.body h3 { font-size: 150%; } +div.body h4 { font-size: 130%; } +div.body h5 { font-size: 100%; } +div.body h6 { font-size: 100%; } + +a.headerlink { + color: #ddd; + padding: 0 4px; + text-decoration: none; +} + +a.headerlink:hover { + color: #444; +} + +div.body p, div.body dd, div.body li { + line-height: 1.4em; +} + +div.admonition { + background: #fafafa; + margin: 20px -30px; + padding: 10px 30px; + border-top: 1px solid #ccc; + border-bottom: 1px solid #ccc; +} + +div.admonition tt.xref, div.admonition a tt { + border-bottom: 1px solid #fafafa; +} + +dd div.admonition { + margin-left: -60px; + padding-left: 60px; +} + +div.admonition p.admonition-title { + font-family: 'Garamond', 'Georgia', serif; + font-weight: normal; + font-size: 24px; + margin: 0 0 10px 0; + padding: 0; + line-height: 1; +} + +div.admonition p.last { + margin-bottom: 0; +} + +div.highlight { + background-color: white; +} + +dt:target, .highlight { + background: #FAF3E8; +} + +div.note { + background-color: #eee; + border: 1px solid #ccc; +} + +div.seealso { + background-color: #ffc; + border: 1px solid #ff6; +} + +div.topic { + background-color: #eee; +} + +p.admonition-title { + display: inline; +} + +p.admonition-title:after { + content: ":"; +} + +pre, tt { + font-family: 'Consolas', 'Menlo', 'Deja Vu Sans Mono', 'Bitstream Vera Sans Mono', monospace; + font-size: 0.9em; +} + +img.screenshot { +} + +tt.descname, tt.descclassname { + font-size: 0.95em; +} + +tt.descname { + padding-right: 0.08em; +} + +img.screenshot { + -moz-box-shadow: 2px 2px 4px #eee; + -webkit-box-shadow: 2px 2px 4px #eee; + box-shadow: 2px 2px 4px #eee; +} + +table.docutils { + border: 1px solid #888; + -moz-box-shadow: 2px 2px 4px #eee; + -webkit-box-shadow: 2px 2px 4px #eee; + box-shadow: 2px 2px 4px #eee; +} + +table.docutils td, table.docutils th { + border: 1px solid #888; + padding: 0.25em 0.7em; +} + +table.field-list, table.footnote { + border: none; + -moz-box-shadow: none; + -webkit-box-shadow: none; + box-shadow: none; +} + +table.footnote { + margin: 15px 0; + width: 100%; + border: 1px solid #eee; + background: #fdfdfd; + font-size: 0.9em; +} + +table.footnote + table.footnote { + margin-top: -15px; + border-top: none; +} + +table.field-list th { + padding: 0 0.8em 0 0; +} + +table.field-list td { + padding: 0; +} + +table.footnote td.label { + width: 0px; + padding: 0.3em 0 0.3em 0.5em; +} + +table.footnote td { + padding: 0.3em 0.5em; +} + +dl { + margin: 0; + padding: 0; +} + +dl dd { + margin-left: 30px; +} + +blockquote { + margin: 0 0 0 30px; + padding: 0; +} + +ul, ol { + margin: 10px 0 10px 30px; + padding: 0; +} + +pre { + background: #eee; + padding: 7px 30px; + margin: 15px -30px; + line-height: 1.3em; +} + +dl pre, blockquote pre, li pre { + margin-left: -60px; + padding-left: 60px; +} + +dl dl pre { + margin-left: -90px; + padding-left: 90px; +} + +tt { + background-color: #ecf0f3; + color: #222; + /* padding: 1px 2px; */ +} + +tt.xref, a tt { + background-color: #FBFBFB; + border-bottom: 1px solid white; +} + +a.reference { + text-decoration: none; + border-bottom: 1px dotted #004B6B; +} + +a.reference:hover { + border-bottom: 1px solid #6D4100; +} + +a.footnote-reference { + text-decoration: none; + font-size: 0.7em; + vertical-align: top; + border-bottom: 1px dotted #004B6B; +} + +a.footnote-reference:hover { + border-bottom: 1px solid #6D4100; +} + +a:hover tt { + background: #EEE; +} diff --git a/vim/bundle/jedi-vim/pythonx/jedi/docs/_themes/flask/static/small_flask.css b/vim/bundle/jedi-vim/pythonx/jedi/docs/_themes/flask/static/small_flask.css new file mode 100644 index 0000000..1c6df30 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/docs/_themes/flask/static/small_flask.css @@ -0,0 +1,70 @@ +/* + * small_flask.css_t + * ~~~~~~~~~~~~~~~~~ + * + * :copyright: Copyright 2010 by Armin Ronacher. + * :license: Flask Design License, see LICENSE for details. + */ + +body { + margin: 0; + padding: 20px 30px; +} + +div.documentwrapper { + float: none; + background: white; +} + +div.sphinxsidebar { + display: block; + float: none; + width: 102.5%; + margin: 50px -30px -20px -30px; + padding: 10px 20px; + background: #333; + color: white; +} + +div.sphinxsidebar h3, div.sphinxsidebar h4, div.sphinxsidebar p, +div.sphinxsidebar h3 a { + color: white; +} + +div.sphinxsidebar a { + color: #aaa; +} + +div.sphinxsidebar p.logo { + display: none; +} + +div.document { + width: 100%; + margin: 0; +} + +div.related { + display: block; + margin: 0; + padding: 10px 0 20px 0; +} + +div.related ul, +div.related ul li { + margin: 0; + padding: 0; +} + +div.footer { + display: none; +} + +div.bodywrapper { + margin: 0; +} + +div.body { + min-height: 0; + padding: 0; +} diff --git a/vim/bundle/jedi-vim/pythonx/jedi/docs/_themes/flask/theme.conf b/vim/bundle/jedi-vim/pythonx/jedi/docs/_themes/flask/theme.conf new file mode 100644 index 0000000..1d5657f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/docs/_themes/flask/theme.conf @@ -0,0 +1,9 @@ +[theme] +inherit = basic +stylesheet = flasky.css +pygments_style = flask_theme_support.FlaskyStyle + +[options] +index_logo = +index_logo_height = 120px +touch_icon = diff --git a/vim/bundle/jedi-vim/pythonx/jedi/docs/_themes/flask_theme_support.py b/vim/bundle/jedi-vim/pythonx/jedi/docs/_themes/flask_theme_support.py new file mode 100644 index 0000000..d3e33c0 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/docs/_themes/flask_theme_support.py @@ -0,0 +1,125 @@ +""" +Copyright (c) 2010 by Armin Ronacher. + +Some rights reserved. + +Redistribution and use in source and binary forms of the theme, with or +without modification, are permitted provided that the following conditions +are met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + +* The names of the contributors may not be used to endorse or + promote products derived from this software without specific + prior written permission. + +We kindly ask you to only use these themes in an unmodified manner just +for Flask and Flask-related products, not for unrelated projects. If you +like the visual style and want to use it for your own projects, please +consider making some larger changes to the themes (such as changing +font faces, sizes, colors or margins). + +THIS THEME IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS THEME, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +""" +# flasky extensions. flasky pygments style based on tango style +from pygments.style import Style +from pygments.token import Keyword, Name, Comment, String, Error, \ + Number, Operator, Generic, Whitespace, Punctuation, Other, Literal + + +class FlaskyStyle(Style): + background_color = "#f8f8f8" + default_style = "" + + styles = { + # No corresponding class for the following: + #Text: "", # class: '' + Whitespace: "underline #f8f8f8", # class: 'w' + Error: "#a40000 border:#ef2929", # class: 'err' + Other: "#000000", # class 'x' + + Comment: "italic #8f5902", # class: 'c' + Comment.Preproc: "noitalic", # class: 'cp' + + Keyword: "bold #004461", # class: 'k' + Keyword.Constant: "bold #004461", # class: 'kc' + Keyword.Declaration: "bold #004461", # class: 'kd' + Keyword.Namespace: "bold #004461", # class: 'kn' + Keyword.Pseudo: "bold #004461", # class: 'kp' + Keyword.Reserved: "bold #004461", # class: 'kr' + Keyword.Type: "bold #004461", # class: 'kt' + + Operator: "#582800", # class: 'o' + Operator.Word: "bold #004461", # class: 'ow' - like keywords + + Punctuation: "bold #000000", # class: 'p' + + # because special names such as Name.Class, Name.Function, etc. + # are not recognized as such later in the parsing, we choose them + # to look the same as ordinary variables. + Name: "#000000", # class: 'n' + Name.Attribute: "#c4a000", # class: 'na' - to be revised + Name.Builtin: "#004461", # class: 'nb' + Name.Builtin.Pseudo: "#3465a4", # class: 'bp' + Name.Class: "#000000", # class: 'nc' - to be revised + Name.Constant: "#000000", # class: 'no' - to be revised + Name.Decorator: "#888", # class: 'nd' - to be revised + Name.Entity: "#ce5c00", # class: 'ni' + Name.Exception: "bold #cc0000", # class: 'ne' + Name.Function: "#000000", # class: 'nf' + Name.Property: "#000000", # class: 'py' + Name.Label: "#f57900", # class: 'nl' + Name.Namespace: "#000000", # class: 'nn' - to be revised + Name.Other: "#000000", # class: 'nx' + Name.Tag: "bold #004461", # class: 'nt' - like a keyword + Name.Variable: "#000000", # class: 'nv' - to be revised + Name.Variable.Class: "#000000", # class: 'vc' - to be revised + Name.Variable.Global: "#000000", # class: 'vg' - to be revised + Name.Variable.Instance: "#000000", # class: 'vi' - to be revised + + Number: "#990000", # class: 'm' + + Literal: "#000000", # class: 'l' + Literal.Date: "#000000", # class: 'ld' + + String: "#4e9a06", # class: 's' + String.Backtick: "#4e9a06", # class: 'sb' + String.Char: "#4e9a06", # class: 'sc' + String.Doc: "italic #8f5902", # class: 'sd' - like a comment + String.Double: "#4e9a06", # class: 's2' + String.Escape: "#4e9a06", # class: 'se' + String.Heredoc: "#4e9a06", # class: 'sh' + String.Interpol: "#4e9a06", # class: 'si' + String.Other: "#4e9a06", # class: 'sx' + String.Regex: "#4e9a06", # class: 'sr' + String.Single: "#4e9a06", # class: 's1' + String.Symbol: "#4e9a06", # class: 'ss' + + Generic: "#000000", # class: 'g' + Generic.Deleted: "#a40000", # class: 'gd' + Generic.Emph: "italic #000000", # class: 'ge' + Generic.Error: "#ef2929", # class: 'gr' + Generic.Heading: "bold #000080", # class: 'gh' + Generic.Inserted: "#00A000", # class: 'gi' + Generic.Output: "#888", # class: 'go' + Generic.Prompt: "#745334", # class: 'gp' + Generic.Strong: "bold #000000", # class: 'gs' + Generic.Subheading: "bold #800080", # class: 'gu' + Generic.Traceback: "bold #a40000", # class: 'gt' + } diff --git a/vim/bundle/jedi-vim/pythonx/jedi/docs/conf.py b/vim/bundle/jedi-vim/pythonx/jedi/docs/conf.py new file mode 100644 index 0000000..4199bca --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/docs/conf.py @@ -0,0 +1,291 @@ +# -*- coding: utf-8 -*- +# +# Jedi documentation build configuration file, created by +# sphinx-quickstart on Wed Dec 26 00:11:34 2012. +# +# This file is execfile()d with the current directory set to its containing dir. +# +# Note that not all possible configuration values are present in this +# autogenerated file. +# +# All configuration values have a default; values that are commented out +# serve to show the default. + +import sys +import os +import datetime + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +sys.path.insert(0, os.path.abspath('..')) +sys.path.append(os.path.abspath('_themes')) + +# -- General configuration ----------------------------------------------------- + +# If your documentation needs a minimal Sphinx version, state it here. +#needs_sphinx = '1.0' + +# Add any Sphinx extension module names here, as strings. They can be extensions +# coming with Sphinx (named 'sphinx.ext.*') or your custom ones. +extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode', 'sphinx.ext.todo', + 'sphinx.ext.intersphinx', 'sphinx.ext.inheritance_diagram'] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# The suffix of source filenames. +source_suffix = '.rst' + +# The encoding of source files. +source_encoding = 'utf-8' + +# The master toctree document. +master_doc = 'index' + +# General information about the project. +project = u'Jedi' +copyright = u'jedi contributors' + +import jedi +from jedi.utils import version_info + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. +# +# The short X.Y version. +version = '.'.join(str(x) for x in version_info()[:2]) +# The full version, including alpha/beta/rc tags. +release = jedi.__version__ + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +#language = None + +# There are two options for replacing |today|: either, you set today to some +# non-false value, then it is used: +#today = '' +# Else, today_fmt is used as the format for a strftime call. +#today_fmt = '%B %d, %Y' + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +exclude_patterns = [] + +# The reST default role (used for this markup: `text`) to use for all documents. +#default_role = None + +# If true, '()' will be appended to :func: etc. cross-reference text. +#add_function_parentheses = True + +# If true, the current module name will be prepended to all description +# unit titles (such as .. function::). +#add_module_names = True + +# If true, sectionauthor and moduleauthor directives will be shown in the +# output. They are ignored by default. +#show_authors = False + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'sphinx' + +# A list of ignored prefixes for module index sorting. +#modindex_common_prefix = [] + + +# -- Options for HTML output --------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +html_theme = 'flask' + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +#html_theme_options = {} + +# Add any paths that contain custom themes here, relative to this directory. +html_theme_path = ['_themes'] + +# The name for this set of Sphinx documents. If None, it defaults to +# " v documentation". +#html_title = None + +# A shorter title for the navigation bar. Default is the same as html_title. +#html_short_title = None + +# The name of an image file (relative to this directory) to place at the top +# of the sidebar. +#html_logo = None + +# The name of an image file (within the static path) to use as favicon of the +# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 +# pixels large. +#html_favicon = None + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['_static'] + +# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, +# using the given strftime format. +#html_last_updated_fmt = '%b %d, %Y' + +# If true, SmartyPants will be used to convert quotes and dashes to +# typographically correct entities. +#html_use_smartypants = True + +# Custom sidebar templates, maps document names to template names. +html_sidebars = { + '**': [ + 'sidebarlogo.html', + 'localtoc.html', + #'relations.html', + 'ghbuttons.html', + #'sourcelink.html', + #'searchbox.html' + ] +} + +# Additional templates that should be rendered to pages, maps page names to +# template names. +#html_additional_pages = {} + +# If false, no module index is generated. +#html_domain_indices = True + +# If false, no index is generated. +#html_use_index = True + +# If true, the index is split into individual pages for each letter. +#html_split_index = False + +# If true, links to the reST sources are added to the pages. +#html_show_sourcelink = True + +# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. +#html_show_sphinx = True + +# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. +#html_show_copyright = True + +# If true, an OpenSearch description file will be output, and all pages will +# contain a tag referring to it. The value of this option must be the +# base URL from which the finished HTML is served. +#html_use_opensearch = '' + +# This is the file name suffix for HTML files (e.g. ".xhtml"). +#html_file_suffix = None + +# Output file base name for HTML help builder. +htmlhelp_basename = 'Jedidoc' + +#html_style = 'default.css' # Force usage of default template on RTD + + +# -- Options for LaTeX output -------------------------------------------------- + +latex_elements = { + # The paper size ('letterpaper' or 'a4paper'). + #'papersize': 'letterpaper', + + # The font size ('10pt', '11pt' or '12pt'). + #'pointsize': '10pt', + + # Additional stuff for the LaTeX preamble. + #'preamble': '', +} + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, author, documentclass [howto/manual]). +latex_documents = [ + ('index', 'Jedi.tex', u'Jedi Documentation', + u'Jedi contributors', 'manual'), +] + +# The name of an image file (relative to this directory) to place at the top of +# the title page. +#latex_logo = None + +# For "manual" documents, if this is true, then toplevel headings are parts, +# not chapters. +#latex_use_parts = False + +# If true, show page references after internal links. +#latex_show_pagerefs = False + +# If true, show URL addresses after external links. +#latex_show_urls = False + +# Documents to append as an appendix to all manuals. +#latex_appendices = [] + +# If false, no module index is generated. +#latex_domain_indices = True + + +# -- Options for manual page output -------------------------------------------- + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + ('index', 'jedi', u'Jedi Documentation', + [u'Jedi contributors'], 1) +] + +# If true, show URL addresses after external links. +#man_show_urls = False + + +# -- Options for Texinfo output ------------------------------------------------ + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + ('index', 'Jedi', u'Jedi Documentation', + u'Jedi contributors', 'Jedi', 'Awesome Python autocompletion library.', + 'Miscellaneous'), +] + +# Documents to append as an appendix to all manuals. +#texinfo_appendices = [] + +# If false, no module index is generated. +#texinfo_domain_indices = True + +# How to display URL addresses: 'footnote', 'no', or 'inline'. +#texinfo_show_urls = 'footnote' + +# -- Options for todo module --------------------------------------------------- + +todo_include_todos = False + +# -- Options for autodoc module ------------------------------------------------ + +autoclass_content = 'both' +autodoc_member_order = 'bysource' +autodoc_default_flags = [] +#autodoc_default_flags = ['members', 'undoc-members'] + + +# -- Options for intersphinx module -------------------------------------------- + +intersphinx_mapping = { + 'https://docs.python.org/': None, +} + + +def skip_deprecated(app, what, name, obj, skip, options): + """ + All attributes containing a deprecated note shouldn't be documented + anymore. This makes it even clearer that they are not supported anymore. + """ + doc = obj.__doc__ + return skip or doc and '.. deprecated::' in doc + + +def setup(app): + app.connect('autodoc-skip-member', skip_deprecated) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/docs/docs/api-classes.rst b/vim/bundle/jedi-vim/pythonx/jedi/docs/docs/api-classes.rst new file mode 100644 index 0000000..9feec1c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/docs/docs/api-classes.rst @@ -0,0 +1,10 @@ +.. include:: ../global.rst + +.. _api-classes: + +API Return Classes +------------------ + +.. automodule:: jedi.api.classes + :members: + :undoc-members: diff --git a/vim/bundle/jedi-vim/pythonx/jedi/docs/docs/api.rst b/vim/bundle/jedi-vim/pythonx/jedi/docs/docs/api.rst new file mode 100644 index 0000000..58c88ef --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/docs/docs/api.rst @@ -0,0 +1,132 @@ +.. include:: ../global.rst + +API Overview +============ + +.. currentmodule:: jedi + +Note: This documentation is for Plugin developers, who want to improve their +editors/IDE autocompletion + +If you want to use |jedi|, you first need to ``import jedi``. You then have +direct access to the :class:`.Script`. You can then call the functions +documented here. These functions return :ref:`API classes +`. + + +Deprecations +------------ + +The deprecation process is as follows: + +1. A deprecation is announced in the next major/minor release. +2. We wait either at least a year & at least two minor releases until we remove + the deprecated functionality. + + +API Documentation +----------------- + +The API consists of a few different parts: + +- The main starting points for completions/goto: :class:`.Script` and :class:`.Interpreter` +- Helpful functions: :func:`.names`, :func:`.preload_module` and + :func:`.set_debug_function` +- :ref:`API Result Classes ` +- :ref:`Python Versions/Virtualenv Support ` with functions like + :func:`.find_system_environments` and :func:`.find_virtualenvs` + +.. _api: + +Static Analysis Interface +~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. automodule:: jedi + +.. autoclass:: jedi.Script + :members: +.. autoclass:: jedi.Interpreter + :members: +.. autofunction:: jedi.names +.. autofunction:: jedi.preload_module +.. autofunction:: jedi.set_debug_function + +.. _environments: + +Environments +~~~~~~~~~~~~ + +.. automodule:: jedi.api.environment + +.. autofunction:: jedi.find_system_environments +.. autofunction:: jedi.find_virtualenvs +.. autofunction:: jedi.get_system_environment +.. autofunction:: jedi.create_environment +.. autofunction:: jedi.get_default_environment +.. autoexception:: jedi.InvalidPythonEnvironment +.. autoclass:: jedi.api.environment.Environment + :members: + +Examples +-------- + +Completions: + +.. sourcecode:: python + + >>> import jedi + >>> source = '''import json; json.l''' + >>> script = jedi.Script(source, 1, 19, '') + >>> script + + >>> completions = script.completions() + >>> completions + [, ] + >>> completions[1] + + >>> completions[1].complete + 'oads' + >>> completions[1].name + 'loads' + +Definitions / Goto: + +.. sourcecode:: python + + >>> import jedi + >>> source = '''def my_func(): + ... print 'called' + ... + ... alias = my_func + ... my_list = [1, None, alias] + ... inception = my_list[2] + ... + ... inception()''' + >>> script = jedi.Script(source, 8, 1, '') + >>> + >>> script.goto_assignments() + [] + >>> + >>> script.goto_definitions() + [] + +Related names: + +.. sourcecode:: python + + >>> import jedi + >>> source = '''x = 3 + ... if 1 == 2: + ... x = 4 + ... else: + ... del x''' + >>> script = jedi.Script(source, 5, 8, '') + >>> rns = script.related_names() + >>> rns + [, ] + >>> rns[0].start_pos + (3, 4) + >>> rns[0].is_keyword + False + >>> rns[0].text + 'x' diff --git a/vim/bundle/jedi-vim/pythonx/jedi/docs/docs/development.rst b/vim/bundle/jedi-vim/pythonx/jedi/docs/docs/development.rst new file mode 100644 index 0000000..1b9e1f5 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/docs/docs/development.rst @@ -0,0 +1,222 @@ +.. include:: ../global.rst + +Jedi Development +================ + +.. currentmodule:: jedi + +.. note:: This documentation is for Jedi developers who want to improve Jedi + itself, but have no idea how Jedi works. If you want to use Jedi for + your IDE, look at the `plugin api `_. + It is also important to note that it's a pretty old version and some things + might not apply anymore. + + +Introduction +------------ + +This page tries to address the fundamental demand for documentation of the +|jedi| internals. Understanding a dynamic language is a complex task. Especially +because type inference in Python can be a very recursive task. Therefore |jedi| +couldn't get rid of complexity. I know that **simple is better than complex**, +but unfortunately it sometimes requires complex solutions to understand complex +systems. + +Since most of the Jedi internals have been written by me (David Halter), this +introduction will be written mostly by me, because no one else understands to +the same level how Jedi works. Actually this is also the reason for exactly this +part of the documentation. To make multiple people able to edit the Jedi core. + +In five chapters I'm trying to describe the internals of |jedi|: + +- :ref:`The Jedi Core ` +- :ref:`Core Extensions ` +- :ref:`Imports & Modules ` +- :ref:`Caching & Recursions ` +- :ref:`Helper modules ` + +.. note:: Testing is not documented here, you'll find that + `right here `_. + + +.. _core: + +The Jedi Core +------------- + +The core of Jedi consists of three parts: + +- :ref:`Parser ` +- :ref:`Python code evaluation ` +- :ref:`API ` + +Most people are probably interested in :ref:`code evaluation `, +because that's where all the magic happens. I need to introduce the :ref:`parser +` first, because :mod:`jedi.evaluate` uses it extensively. + +.. _parser: + +Parser +~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Jedi used to have it's internal parser, however this is now a separate project +and is called `parso `_. + +The parser creates a syntax tree that |jedi| analyses and tries to understand. +The grammar that this parsers uses is very similar to the official Python +`grammar files `_. + +.. _evaluate: + +Evaluation of python code (evaluate/__init__.py) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. automodule:: jedi.evaluate + +Evaluation Contexts (evaluate/base_context.py) +++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +.. automodule:: jedi.evaluate.base_context + +.. inheritance-diagram:: + jedi.evaluate.context.instance.TreeInstance + jedi.evaluate.context.klass.ClassContext + jedi.evaluate.context.function.FunctionContext + jedi.evaluate.context.function.FunctionExecutionContext + :parts: 1 + + +.. _name_resolution: + +Name resolution (evaluate/finder.py) +++++++++++++++++++++++++++++++++++++ + +.. automodule:: jedi.evaluate.finder + + +.. _dev-api: + +API (api/__init__.py and api/classes.py) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The API has been designed to be as easy to use as possible. The API +documentation can be found `here `_. The API itself contains +little code that needs to be mentioned here. Generally I'm trying to be +conservative with the API. I'd rather not add new API features if they are not +necessary, because it's much harder to deprecate stuff than to add it later. + + +.. _core-extensions: + +Core Extensions +--------------- + +Core Extensions is a summary of the following topics: + +- :ref:`Iterables & Dynamic Arrays ` +- :ref:`Dynamic Parameters ` +- :ref:`Docstrings ` +- :ref:`Refactoring ` + +These topics are very important to understand what Jedi additionally does, but +they could be removed from Jedi and Jedi would still work. But slower and +without some features. + +.. _iterables: + +Iterables & Dynamic Arrays (evaluate/context/iterable.py) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +To understand Python on a deeper level, |jedi| needs to understand some of the +dynamic features of Python like lists that are filled after creation: + +.. automodule:: jedi.evaluate.context.iterable + + +.. _dynamic: + +Parameter completion (evaluate/dynamic.py) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. automodule:: jedi.evaluate.dynamic + + +.. _docstrings: + +Docstrings (evaluate/docstrings.py) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. automodule:: jedi.evaluate.docstrings + +.. _refactoring: + +Refactoring (evaluate/refactoring.py) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. automodule:: jedi.refactoring + + +.. _imports-modules: + +Imports & Modules +------------------- + + +- :ref:`Modules ` +- :ref:`Builtin Modules ` +- :ref:`Imports ` + + +.. _builtin: + +Compiled Modules (evaluate/compiled.py) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. automodule:: jedi.evaluate.compiled + + +.. _imports: + +Imports (evaluate/imports.py) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. automodule:: jedi.evaluate.imports + + +.. _caching-recursions: + +Caching & Recursions +-------------------- + + +- :ref:`Caching ` +- :ref:`Recursions ` + +.. _cache: + +Caching (cache.py) +~~~~~~~~~~~~~~~~~~ + +.. automodule:: jedi.cache + +.. _recursion: + +Recursions (recursion.py) +~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. automodule:: jedi.evaluate.recursion + + +.. _dev-helpers: + +Helper Modules +--------------- + +Most other modules are not really central to how Jedi works. They all contain +relevant code, but you if you understand the modules above, you pretty much +understand Jedi. + +Python 2/3 compatibility (_compatibility.py) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. automodule:: jedi._compatibility diff --git a/vim/bundle/jedi-vim/pythonx/jedi/docs/docs/features.rst b/vim/bundle/jedi-vim/pythonx/jedi/docs/docs/features.rst new file mode 100644 index 0000000..d393175 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/docs/docs/features.rst @@ -0,0 +1,236 @@ +.. include:: ../global.rst + +Features and Caveats +==================== + +Jedi obviously supports autocompletion. It's also possible to get it working in +(:ref:`your REPL (IPython, etc.) `). + +Static analysis is also possible by using the command ``jedi.names``. + +Jedi would in theory support refactoring, but we have never publicized it, +because it's not production ready. If you're interested in helping out here, +let me know. With the latest parser changes, it should be very easy to actually +make it work. + + +General Features +---------------- + +- Python 2.7 and 3.4+ support +- Ignores syntax errors and wrong indentation +- Can deal with complex module / function / class structures +- Great Virtualenv support +- Can infer function arguments from sphinx, epydoc and basic numpydoc docstrings, + and PEP0484-style type hints (:ref:`type hinting `) +- Stub files + + +Supported Python Features +------------------------- + +|jedi| supports many of the widely used Python features: + +- builtins +- returns, yields, yield from +- tuple assignments / array indexing / dictionary indexing / star unpacking +- with-statement / exception handling +- ``*args`` / ``**kwargs`` +- decorators / lambdas / closures +- generators / iterators +- some descriptors: property / staticmethod / classmethod +- some magic methods: ``__call__``, ``__iter__``, ``__next__``, ``__get__``, + ``__getitem__``, ``__init__`` +- ``list.append()``, ``set.add()``, ``list.extend()``, etc. +- (nested) list comprehensions / ternary expressions +- relative imports +- ``getattr()`` / ``__getattr__`` / ``__getattribute__`` +- function annotations +- class decorators (py3k feature, are being ignored too, until I find a use + case, that doesn't work with |jedi|) +- simple/usual ``sys.path`` modifications +- ``isinstance`` checks for if/while/assert +- namespace packages (includes ``pkgutil``, ``pkg_resources`` and PEP420 namespaces) +- Django / Flask / Buildout support + + +Not Supported +------------- + +Not yet implemented: + +- manipulations of instances outside the instance variables without using + methods + +Will probably never be implemented: + +- metaclasses (how could an auto-completion ever support this) +- ``setattr()``, ``__import__()`` +- writing to some dicts: ``globals()``, ``locals()``, ``object.__dict__`` +- evaluating ``if`` / ``while`` / ``del`` + + +Caveats +------- + +**Slow Performance** + +Importing ``numpy`` can be quite slow sometimes, as well as loading the +builtins the first time. If you want to speed things up, you could write import +hooks in |jedi|, which preload stuff. However, once loaded, this is not a +problem anymore. The same is true for huge modules like ``PySide``, ``wx``, +etc. + +**Security** + +Security is an important issue for |jedi|. Therefore no Python code is +executed. As long as you write pure Python, everything is evaluated +statically. But: If you use builtin modules (``c_builtin``) there is no other +option than to execute those modules. However: Execute isn't that critical (as +e.g. in pythoncomplete, which used to execute *every* import!), because it +means one import and no more. So basically the only dangerous thing is using +the import itself. If your ``c_builtin`` uses some strange initializations, it +might be dangerous. But if it does you're screwed anyways, because eventually +you're going to execute your code, which executes the import. + + +Recipes +------- + +Here are some tips on how to use |jedi| efficiently. + + +.. _type-hinting: + +Type Hinting +~~~~~~~~~~~~ + +If |jedi| cannot detect the type of a function argument correctly (due to the +dynamic nature of Python), you can help it by hinting the type using +one of the following docstring/annotation syntax styles: + +**PEP-0484 style** + +https://www.python.org/dev/peps/pep-0484/ + +function annotations + +:: + + def myfunction(node: ProgramNode, foo: str) -> None: + """Do something with a ``node``. + + """ + node.| # complete here + + +assignment, for-loop and with-statement type hints (all Python versions). +Note that the type hints must be on the same line as the statement + +:: + + x = foo() # type: int + x, y = 2, 3 # type: typing.Optional[int], typing.Union[int, str] # typing module is mostly supported + for key, value in foo.items(): # type: str, Employee # note that Employee must be in scope + pass + with foo() as f: # type: int + print(f + 3) + +Most of the features in PEP-0484 are supported including the typing module +(for Python < 3.5 you have to do ``pip install typing`` to use these), +and forward references. + +You can also use stub files. + + +**Sphinx style** + +http://www.sphinx-doc.org/en/stable/domains.html#info-field-lists + +:: + + def myfunction(node, foo): + """Do something with a ``node``. + + :type node: ProgramNode + :param str foo: foo parameter description + + """ + node.| # complete here + +**Epydoc** + +http://epydoc.sourceforge.net/manual-fields.html + +:: + + def myfunction(node): + """Do something with a ``node``. + + @type node: ProgramNode + + """ + node.| # complete here + +**Numpydoc** + +https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt + +In order to support the numpydoc format, you need to install the `numpydoc +`__ package. + +:: + + def foo(var1, var2, long_var_name='hi'): + r"""A one-line summary that does not use variable names or the + function name. + + ... + + Parameters + ---------- + var1 : array_like + Array_like means all those objects -- lists, nested lists, + etc. -- that can be converted to an array. We can also + refer to variables like `var1`. + var2 : int + The type above can either refer to an actual Python type + (e.g. ``int``), or describe the type of the variable in more + detail, e.g. ``(N,) ndarray`` or ``array_like``. + long_variable_name : {'hi', 'ho'}, optional + Choices in brackets, default first when optional. + + ... + + """ + var2.| # complete here + +A little history +---------------- + +The Star Wars Jedi are awesome. My Jedi software tries to imitate a little bit +of the precognition the Jedi have. There's even an awesome `scene +`_ of Monty Python Jedis :-). + +But actually the name hasn't so much to do with Star Wars. It's part of my +second name. + +After I explained Guido van Rossum, how some parts of my auto-completion work, +he said (we drank a beer or two): + + *"Oh, that worries me..."* + +When it's finished, I hope he'll like it :-) + +I actually started Jedi, because there were no good solutions available for VIM. +Most auto-completions just didn't work well. The only good solution was PyCharm. +But I like my good old VIM. Rope was never really intended to be an +auto-completion (and also I really hate project folders for my Python scripts). +It's more of a refactoring suite. So I decided to do my own version of a +completion, which would execute non-dangerous code. But I soon realized, that +this wouldn't work. So I built an extremely recursive thing which understands +many of Python's key features. + +By the way, I really tried to program it as understandable as possible. But I +think understanding it might need quite some time, because of its recursive +nature. diff --git a/vim/bundle/jedi-vim/pythonx/jedi/docs/docs/installation.rst b/vim/bundle/jedi-vim/pythonx/jedi/docs/docs/installation.rst new file mode 100644 index 0000000..e3e16e9 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/docs/docs/installation.rst @@ -0,0 +1,87 @@ +.. include:: ../global.rst + +Installation and Configuration +============================== + +You can either include |jedi| as a submodule in your text editor plugin (like +jedi-vim_ does by default), or you can install it systemwide. + +.. note:: This just installs the |jedi| library, not the :ref:`editor plugins + `. For information about how to make it work with your + editor, refer to the corresponding documentation. + + +The normal way +-------------- + +Most people use Jedi with a :ref:`editor plugins`. Typically +you install Jedi by installing an editor plugin. No necessary steps are needed. +Just take a look at the instructions for the plugin. + + +With pip +-------- + +On any system you can install |jedi| directly from the Python package index +using pip:: + + sudo pip install jedi + +If you want to install the current development version (master branch):: + + sudo pip install -e git://github.com/davidhalter/jedi.git#egg=jedi + + +System-wide installation via a package manager +---------------------------------------------- + +Arch Linux +~~~~~~~~~~ + +You can install |jedi| directly from official Arch Linux packages: + +- `python-jedi `__ + (Python 3) +- `python2-jedi `__ + (Python 2) + +The specified Python version just refers to the *runtime environment* for +|jedi|. Use the Python 2 version if you're running vim (or whatever editor you +use) under Python 2. Otherwise, use the Python 3 version. But whatever version +you choose, both are able to complete both Python 2 and 3 *code*. + +(There is also a packaged version of the vim plugin available: +`vim-jedi at Arch Linux `__.) + +Debian +~~~~~~ + +Debian packages are available in the `unstable repository +`__. + +Others +~~~~~~ + +We are in the discussion of adding |jedi| to the Fedora repositories. + + +Manual installation from GitHub +--------------------------------------------- + +If you prefer not to use an automated package installer, you can clone the source from GitHub and install it manually. To install it, run these commands:: + + git clone --recurse-submodules https://github.com/davidhalter/jedi + cd jedi + sudo python setup.py install + +Inclusion as a submodule +------------------------ + +If you use an editor plugin like jedi-vim_, you can simply include |jedi| as a +git submodule of the plugin directory. Vim plugin managers like Vundle_ or +Pathogen_ make it very easy to keep submodules up to date. + + +.. _jedi-vim: https://github.com/davidhalter/jedi-vim +.. _vundle: https://github.com/gmarik/vundle +.. _pathogen: https://github.com/tpope/vim-pathogen diff --git a/vim/bundle/jedi-vim/pythonx/jedi/docs/docs/settings.rst b/vim/bundle/jedi-vim/pythonx/jedi/docs/docs/settings.rst new file mode 100644 index 0000000..640a110 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/docs/docs/settings.rst @@ -0,0 +1,6 @@ +.. include:: ../global.rst + +Settings +======== + +.. automodule:: jedi.settings diff --git a/vim/bundle/jedi-vim/pythonx/jedi/docs/docs/testing.rst b/vim/bundle/jedi-vim/pythonx/jedi/docs/docs/testing.rst new file mode 100644 index 0000000..0c666a1 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/docs/docs/testing.rst @@ -0,0 +1,40 @@ +.. include:: ../global.rst + +Jedi Testing +============ + +The test suite depends on ``tox`` and ``pytest``:: + + pip install tox pytest + +To run the tests for all supported Python versions:: + + tox + +If you want to test only a specific Python version (e.g. Python 2.7), it's as +easy as:: + + tox -e py27 + +Tests are also run automatically on `Travis CI +`_. + +You want to add a test for |jedi|? Great! We love that. Normally you should +write your tests as :ref:`Blackbox Tests `. Most tests would +fit right in there. + +For specific API testing we're using simple unit tests, with a focus on a +simple and readable testing structure. + +.. _blackbox: + +Blackbox Tests (run.py) +~~~~~~~~~~~~~~~~~~~~~~~ + +.. automodule:: test.run + +Refactoring Tests (refactor.py) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. automodule:: test.refactor + diff --git a/vim/bundle/jedi-vim/pythonx/jedi/docs/docs/usage.rst b/vim/bundle/jedi-vim/pythonx/jedi/docs/docs/usage.rst new file mode 100644 index 0000000..bc30af3 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/docs/docs/usage.rst @@ -0,0 +1,117 @@ +.. include:: ../global.rst + +End User Usage +============== + +If you are a not an IDE Developer, the odds are that you just want to use +|jedi| as a browser plugin or in the shell. Yes that's :ref:`also possible +`! + +|jedi| is relatively young and can be used in a variety of Plugins and +Software. If your Editor/IDE is not among them, recommend |jedi| to your IDE +developers. + + +.. _editor-plugins: + +Editor Plugins +-------------- + +Vim: + +- jedi-vim_ +- YouCompleteMe_ +- deoplete-jedi_ + +Emacs: + +- Jedi.el_ +- elpy_ +- anaconda-mode_ + +Sublime Text 2/3: + +- SublimeJEDI_ (ST2 & ST3) +- anaconda_ (only ST3) + +SynWrite: + +- SynJedi_ + +TextMate: + +- Textmate_ (Not sure if it's actually working) + +Kate: + +- Kate_ version 4.13+ `supports it natively + `__, + you have to enable it, though. + +Visual Studio Code: + +- `Python Extension`_ + +Atom: + +- autocomplete-python-jedi_ + +GNOME Builder: + +- `GNOME Builder`_ `supports it natively + `__, + and is enabled by default. + +Gedit: + +- gedi_ + +Eric IDE: + +- `Eric IDE`_ (Available as a plugin) + +Web Debugger: + +- wdb_ + +and many more! + +.. _repl-completion: + +Tab Completion in the Python Shell +---------------------------------- + +Starting with Ipython `6.0.0` Jedi is a dependency of IPython. Autocompletion +in IPython is therefore possible without additional configuration. + +There are two different options how you can use Jedi autocompletion in +your Python interpreter. One with your custom ``$HOME/.pythonrc.py`` file +and one that uses ``PYTHONSTARTUP``. + +Using ``PYTHONSTARTUP`` +~~~~~~~~~~~~~~~~~~~~~~~ + +.. automodule:: jedi.api.replstartup + +Using a custom ``$HOME/.pythonrc.py`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. autofunction:: jedi.utils.setup_readline + +.. _jedi-vim: https://github.com/davidhalter/jedi-vim +.. _youcompleteme: https://valloric.github.io/YouCompleteMe/ +.. _deoplete-jedi: https://github.com/zchee/deoplete-jedi +.. _Jedi.el: https://github.com/tkf/emacs-jedi +.. _elpy: https://github.com/jorgenschaefer/elpy +.. _anaconda-mode: https://github.com/proofit404/anaconda-mode +.. _sublimejedi: https://github.com/srusskih/SublimeJEDI +.. _anaconda: https://github.com/DamnWidget/anaconda +.. _SynJedi: http://uvviewsoft.com/synjedi/ +.. _wdb: https://github.com/Kozea/wdb +.. _TextMate: https://github.com/lawrenceakka/python-jedi.tmbundle +.. _kate: https://kate-editor.org/ +.. _autocomplete-python-jedi: https://atom.io/packages/autocomplete-python-jedi +.. _GNOME Builder: https://wiki.gnome.org/Apps/Builder/ +.. _gedi: https://github.com/isamert/gedi +.. _Eric IDE: https://eric-ide.python-projects.org +.. _Python Extension: https://marketplace.visualstudio.com/items?itemName=donjayamanne.python diff --git a/vim/bundle/jedi-vim/pythonx/jedi/docs/global.rst b/vim/bundle/jedi-vim/pythonx/jedi/docs/global.rst new file mode 100644 index 0000000..0279842 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/docs/global.rst @@ -0,0 +1,3 @@ +:orphan: + +.. |jedi| replace:: *Jedi* diff --git a/vim/bundle/jedi-vim/pythonx/jedi/docs/index.rst b/vim/bundle/jedi-vim/pythonx/jedi/docs/index.rst new file mode 100644 index 0000000..57072ab --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/docs/index.rst @@ -0,0 +1,40 @@ +.. include global.rst + +Jedi - an awesome autocompletion/static analysis library for Python +=================================================================== + +Release v\ |release|. (:doc:`Installation `) + +.. automodule:: jedi + +Autocompletion can look like this (e.g. VIM plugin): + +.. figure:: _screenshots/screenshot_complete.png + + +.. _toc: + +Docs +---- + +.. toctree:: + :maxdepth: 2 + + docs/usage + docs/installation + docs/features + docs/api + docs/api-classes + docs/settings + docs/development + docs/testing + + +.. _resources: + +Resources +--------- + +- `Source Code on Github `_ +- `Travis Testing `_ +- `Python Package Index `_ diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi.egg-info/PKG-INFO b/vim/bundle/jedi-vim/pythonx/jedi/jedi.egg-info/PKG-INFO new file mode 100644 index 0000000..19f732e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi.egg-info/PKG-INFO @@ -0,0 +1,439 @@ +Metadata-Version: 2.1 +Name: jedi +Version: 0.15.1 +Summary: An autocompletion tool for Python that can be used for text editors. +Home-page: https://github.com/davidhalter/jedi +Author: David Halter +Author-email: davidhalter88@gmail.com +Maintainer: David Halter +Maintainer-email: davidhalter88@gmail.com +License: MIT +Description: ################################################################### + Jedi - an awesome autocompletion/static analysis library for Python + ################################################################### + + .. image:: https://img.shields.io/pypi/v/jedi.svg?style=flat + :target: https://pypi.python.org/pypi/jedi + :alt: PyPI version + + .. image:: https://img.shields.io/pypi/pyversions/jedi.svg + :target: https://pypi.python.org/pypi/jedi + :alt: Supported Python versions + + .. image:: https://travis-ci.org/davidhalter/jedi.svg?branch=master + :target: https://travis-ci.org/davidhalter/jedi + :alt: Linux Tests + + .. image:: https://ci.appveyor.com/api/projects/status/mgva3bbawyma1new/branch/master?svg=true + :target: https://ci.appveyor.com/project/davidhalter/jedi/branch/master + :alt: Windows Tests + + .. image:: https://coveralls.io/repos/davidhalter/jedi/badge.svg?branch=master + :target: https://coveralls.io/r/davidhalter/jedi + :alt: Coverage status + + + *If you have specific questions, please add an issue or ask on* `Stack Overflow + `_ *with the label* ``python-jedi``. + + + Jedi is a static analysis tool for Python that can be used in IDEs/editors. + Jedi has a focus on autocompletion and goto functionality. Jedi is fast and is + very well tested. It understands Python and stubs on a deep level. + + Jedi has support for different goto functions. It's possible to search for + usages and list names in a Python file to get information about them. + + Jedi uses a very simple API to connect with IDE's. There's a reference + implementation as a `VIM-Plugin `_, + which uses Jedi's autocompletion. We encourage you to use Jedi in your IDEs. + Autocompletion in your REPL is also possible, IPython uses it natively and for + the CPython REPL you have to install it. + + Jedi can currently be used with the following editors/projects: + + - Vim (jedi-vim_, YouCompleteMe_, deoplete-jedi_, completor.vim_) + - Emacs (Jedi.el_, company-mode_, elpy_, anaconda-mode_, ycmd_) + - Sublime Text (SublimeJEDI_ [ST2 + ST3], anaconda_ [only ST3]) + - TextMate_ (Not sure if it's actually working) + - Kate_ version 4.13+ supports it natively, you have to enable it, though. [`proof + `_] + - Atom_ (autocomplete-python-jedi_) + - `GNOME Builder`_ (with support for GObject Introspection) + - `Visual Studio Code`_ (via `Python Extension `_) + - Gedit (gedi_) + - wdb_ - Web Debugger + - `Eric IDE`_ (Available as a plugin) + - `IPython 6.0.0+ `_ + + and many more! + + + Here are some pictures taken from jedi-vim_: + + .. image:: https://github.com/davidhalter/jedi/raw/master/docs/_screenshots/screenshot_complete.png + + Completion for almost anything (Ctrl+Space). + + .. image:: https://github.com/davidhalter/jedi/raw/master/docs/_screenshots/screenshot_function.png + + Display of function/class bodies, docstrings. + + .. image:: https://github.com/davidhalter/jedi/raw/master/docs/_screenshots/screenshot_pydoc.png + + Pydoc support (Shift+k). + + There is also support for goto and renaming. + + Get the latest version from `github `_ + (master branch should always be kind of stable/working). + + Docs are available at `https://jedi.readthedocs.org/en/latest/ + `_. Pull requests with documentation + enhancements and/or fixes are awesome and most welcome. Jedi uses `semantic + versioning `_. + + If you want to stay up-to-date (News / RFCs), please subscribe to this `github + thread `_.: + + + + Installation + ============ + + pip install jedi + + Note: This just installs the Jedi library, not the editor plugins. For + information about how to make it work with your editor, refer to the + corresponding documentation. + + You don't want to use ``pip``? Please refer to the `manual + `_. + + + Feature Support and Caveats + =========================== + + Jedi really understands your Python code. For a comprehensive list what Jedi + understands, see: `Features + `_. A list of + caveats can be found on the same page. + + You can run Jedi on CPython 2.7 or 3.4+ but it should also + understand/parse code older than those versions. Additionally you should be able + to use `Virtualenvs `_ + very well. + + Tips on how to use Jedi efficiently can be found `here + `_. + + API + --- + + You can find the documentation for the `API here `_. + + + Autocompletion / Goto / Pydoc + ----------------------------- + + Please check the API for a good explanation. There are the following commands: + + - ``jedi.Script.goto_assignments`` + - ``jedi.Script.completions`` + - ``jedi.Script.usages`` + + The returned objects are very powerful and really all you might need. + + + Autocompletion in your REPL (IPython, etc.) + ------------------------------------------- + + Starting with IPython `6.0.0` Jedi is a dependency of IPython. Autocompletion + in IPython is therefore possible without additional configuration. + + It's possible to have Jedi autocompletion in REPL modes - `example video `_. + This means that in Python you can enable tab completion in a `REPL + `_. + + + Static Analysis + ------------------------ + + To do all forms of static analysis, please try to use ``jedi.names``. It will + return a list of names that you can use to infer types and so on. + + + Refactoring + ----------- + + Jedi's parser would support refactoring, but there's no API to use it right + now. If you're interested in helping out here, let me know. With the latest + parser changes, it should be very easy to actually make it work. + + + Development + =========== + + There's a pretty good and extensive `development documentation + `_. + + + Testing + ======= + + The test suite depends on ``tox`` and ``pytest``:: + + pip install tox pytest + + To run the tests for all supported Python versions:: + + tox + + If you want to test only a specific Python version (e.g. Python 2.7), it's as + easy as :: + + tox -e py27 + + Tests are also run automatically on `Travis CI + `_. + + For more detailed information visit the `testing documentation + `_. + + + Acknowledgements + ================ + + - Takafumi Arakaki (@tkf) for creating a solid test environment and a lot of + other things. + - Danilo Bargen (@dbrgn) for general housekeeping and being a good friend :). + - Guido van Rossum (@gvanrossum) for creating the parser generator pgen2 + (originally used in lib2to3). + + + + .. _jedi-vim: https://github.com/davidhalter/jedi-vim + .. _youcompleteme: https://github.com/ycm-core/YouCompleteMe + .. _deoplete-jedi: https://github.com/zchee/deoplete-jedi + .. _completor.vim: https://github.com/maralla/completor.vim + .. _Jedi.el: https://github.com/tkf/emacs-jedi + .. _company-mode: https://github.com/syohex/emacs-company-jedi + .. _elpy: https://github.com/jorgenschaefer/elpy + .. _anaconda-mode: https://github.com/proofit404/anaconda-mode + .. _ycmd: https://github.com/abingham/emacs-ycmd + .. _sublimejedi: https://github.com/srusskih/SublimeJEDI + .. _anaconda: https://github.com/DamnWidget/anaconda + .. _wdb: https://github.com/Kozea/wdb + .. _TextMate: https://github.com/lawrenceakka/python-jedi.tmbundle + .. _Kate: https://kate-editor.org + .. _Atom: https://atom.io/ + .. _autocomplete-python-jedi: https://atom.io/packages/autocomplete-python-jedi + .. _GNOME Builder: https://wiki.gnome.org/Apps/Builder + .. _Visual Studio Code: https://code.visualstudio.com/ + .. _gedi: https://github.com/isamert/gedi + .. _Eric IDE: https://eric-ide.python-projects.org + + + .. :changelog: + + Changelog + --------- + + 0.15.1 (2019-08-13) + +++++++++++++++++++ + + - Small bugfix and removal of a print statement + + 0.15.0 (2019-08-11) + +++++++++++++++++++ + + - Added file path completions, there's a **new ``Completion.type``** ``path``, + now. Example: ``'/ho`` -> ``'/home/`` + - ``*args``/``**kwargs`` resolving. If possible Jedi replaces the parameters + with the actual alternatives. + - Better support for enums/dataclasses + - When using Interpreter, properties are now executed, since a lot of people + have complained about this. Discussion in #1299, #1347. + + New APIs: + + - ``Definition.get_signatures() -> List[Signature]``. Signatures are similar to + ``CallSignature``. ``Definition.params`` is therefore deprecated. + - ``Signature.to_string()`` to format call signatures. + - ``Signature.params -> List[ParamDefinition]``, ParamDefinition has the + following additional attributes ``infer_default()``, ``infer_annotation()``, + ``to_string()``, and ``kind``. + - ``Definition.execute() -> List[Definition]``, makes it possible to infer + return values of functions. + + + 0.14.1 (2019-07-13) + +++++++++++++++++++ + + - CallSignature.index should now be working a lot better + - A couple of smaller bugfixes + + 0.14.0 (2019-06-20) + +++++++++++++++++++ + + - Added ``goto_*(prefer_stubs=True)`` as well as ``goto_*(prefer_stubs=True)`` + - Stubs are used now for type inference + - Typeshed is used for better type inference + - Reworked Definition.full_name, should have more correct return values + + 0.13.3 (2019-02-24) + +++++++++++++++++++ + + - Fixed an issue with embedded Python, see https://github.com/davidhalter/jedi-vim/issues/870 + + 0.13.2 (2018-12-15) + +++++++++++++++++++ + + - Fixed a bug that led to Jedi spawning a lot of subprocesses. + + 0.13.1 (2018-10-02) + +++++++++++++++++++ + + - Bugfixes, because tensorflow completions were still slow. + + 0.13.0 (2018-10-02) + +++++++++++++++++++ + + - A small release. Some bug fixes. + - Remove Python 3.3 support. Python 3.3 support has been dropped by the Python + foundation. + - Default environments are now using the same Python version as the Python + process. In 0.12.x, we used to load the latest Python version on the system. + - Added ``include_builtins`` as a parameter to usages. + - ``goto_assignments`` has a new ``follow_builtin_imports`` parameter that + changes the previous behavior slightly. + + 0.12.1 (2018-06-30) + +++++++++++++++++++ + + - This release forces you to upgrade parso. If you don't, nothing will work + anymore. Otherwise changes should be limited to bug fixes. Unfortunately Jedi + still uses a few internals of parso that make it hard to keep compatibility + over multiple releases. Parso >=0.3.0 is going to be needed. + + 0.12.0 (2018-04-15) + +++++++++++++++++++ + + - Virtualenv/Environment support + - F-String Completion/Goto Support + - Cannot crash with segfaults anymore + - Cleaned up import logic + - Understand async/await and autocomplete it (including async generators) + - Better namespace completions + - Passing tests for Windows (including CI for Windows) + - Remove Python 2.6 support + + 0.11.1 (2017-12-14) + +++++++++++++++++++ + + - Parso update - the caching layer was broken + - Better usages - a lot of internal code was ripped out and improved. + + 0.11.0 (2017-09-20) + +++++++++++++++++++ + + - Split Jedi's parser into a separate project called ``parso``. + - Avoiding side effects in REPL completion. + - Numpy docstring support should be much better. + - Moved the `settings.*recursion*` away, they are no longer usable. + + 0.10.2 (2017-04-05) + +++++++++++++++++++ + + - Python Packaging sucks. Some files were not included in 0.10.1. + + 0.10.1 (2017-04-05) + +++++++++++++++++++ + + - Fixed a few very annoying bugs. + - Prepared the parser to be factored out of Jedi. + + 0.10.0 (2017-02-03) + +++++++++++++++++++ + + - Actual semantic completions for the complete Python syntax. + - Basic type inference for ``yield from`` PEP 380. + - PEP 484 support (most of the important features of it). Thanks Claude! (@reinhrst) + - Added ``get_line_code`` to ``Definition`` and ``Completion`` objects. + - Completely rewritten the type inference engine. + - A new and better parser for (fast) parsing diffs of Python code. + + 0.9.0 (2015-04-10) + ++++++++++++++++++ + + - The import logic has been rewritten to look more like Python's. There is now + an ``Evaluator.modules`` import cache, which resembles ``sys.modules``. + - Integrated the parser of 2to3. This will make refactoring possible. It will + also be possible to check for error messages (like compiling an AST would give) + in the future. + - With the new parser, the evaluation also completely changed. It's now simpler + and more readable. + - Completely rewritten REPL completion. + - Added ``jedi.names``, a command to do static analysis. Thanks to that + sourcegraph guys for sponsoring this! + - Alpha version of the linter. + + + 0.8.1 (2014-07-23) + +++++++++++++++++++ + + - Bugfix release, the last release forgot to include files that improve + autocompletion for builtin libraries. Fixed. + + 0.8.0 (2014-05-05) + +++++++++++++++++++ + + - Memory Consumption for compiled modules (e.g. builtins, sys) has been reduced + drastically. Loading times are down as well (it takes basically as long as an + import). + - REPL completion is starting to become usable. + - Various small API changes. Generally this release focuses on stability and + refactoring of internal APIs. + - Introducing operator precedence, which makes calculating correct Array + indices and ``__getattr__`` strings possible. + + 0.7.0 (2013-08-09) + ++++++++++++++++++ + + - Switched from LGPL to MIT license. + - Added an Interpreter class to the API to make autocompletion in REPL + possible. + - Added autocompletion support for namespace packages. + - Add sith.py, a new random testing method. + + 0.6.0 (2013-05-14) + ++++++++++++++++++ + + - Much faster parser with builtin part caching. + - A test suite, thanks @tkf. + + 0.5 versions (2012) + +++++++++++++++++++ + + - Initial development. + +Keywords: python completion refactoring vim +Platform: any +Classifier: Development Status :: 4 - Beta +Classifier: Environment :: Plugins +Classifier: Intended Audience :: Developers +Classifier: License :: OSI Approved :: MIT License +Classifier: Operating System :: OS Independent +Classifier: Programming Language :: Python :: 2 +Classifier: Programming Language :: Python :: 2.7 +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3.4 +Classifier: Programming Language :: Python :: 3.5 +Classifier: Programming Language :: Python :: 3.6 +Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 +Classifier: Topic :: Software Development :: Libraries :: Python Modules +Classifier: Topic :: Text Editors :: Integrated Development Environments (IDE) +Classifier: Topic :: Utilities +Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.* +Provides-Extra: testing diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi.egg-info/SOURCES.txt b/vim/bundle/jedi-vim/pythonx/jedi/jedi.egg-info/SOURCES.txt new file mode 100644 index 0000000..09aab49 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi.egg-info/SOURCES.txt @@ -0,0 +1,1369 @@ +.coveragerc +AUTHORS.txt +CHANGELOG.rst +LICENSE.txt +MANIFEST.in +README.rst +conftest.py +pytest.ini +requirements.txt +setup.cfg +setup.py +sith.py +tox.ini +docs/Makefile +docs/README.md +docs/conf.py +docs/global.rst +docs/index.rst +docs/_screenshots/screenshot_complete.png +docs/_screenshots/screenshot_function.png +docs/_screenshots/screenshot_pydoc.png +docs/_static/logo-src.txt +docs/_static/logo.png +docs/_templates/ghbuttons.html +docs/_templates/sidebarlogo.html +docs/_themes/flask_theme_support.py +docs/_themes/flask/LICENSE +docs/_themes/flask/layout.html +docs/_themes/flask/relations.html +docs/_themes/flask/theme.conf +docs/_themes/flask/static/flasky.css_t +docs/_themes/flask/static/small_flask.css +docs/docs/api-classes.rst +docs/docs/api.rst +docs/docs/development.rst +docs/docs/features.rst +docs/docs/installation.rst +docs/docs/settings.rst +docs/docs/testing.rst +docs/docs/usage.rst +jedi/__init__.py +jedi/__main__.py +jedi/_compatibility.py +jedi/cache.py +jedi/debug.py +jedi/file_io.py +jedi/parser_utils.py +jedi/refactoring.py +jedi/settings.py +jedi/utils.py +jedi.egg-info/PKG-INFO +jedi.egg-info/SOURCES.txt +jedi.egg-info/dependency_links.txt +jedi.egg-info/requires.txt +jedi.egg-info/top_level.txt +jedi/api/__init__.py +jedi/api/classes.py +jedi/api/completion.py +jedi/api/environment.py +jedi/api/exceptions.py +jedi/api/file_name.py +jedi/api/helpers.py +jedi/api/interpreter.py +jedi/api/keywords.py +jedi/api/project.py +jedi/api/replstartup.py +jedi/common/__init__.py +jedi/common/context.py +jedi/common/utils.py +jedi/evaluate/__init__.py +jedi/evaluate/analysis.py +jedi/evaluate/arguments.py +jedi/evaluate/base_context.py +jedi/evaluate/cache.py +jedi/evaluate/docstrings.py +jedi/evaluate/dynamic.py +jedi/evaluate/filters.py +jedi/evaluate/finder.py +jedi/evaluate/flow_analysis.py +jedi/evaluate/helpers.py +jedi/evaluate/imports.py +jedi/evaluate/lazy_context.py +jedi/evaluate/names.py +jedi/evaluate/param.py +jedi/evaluate/parser_cache.py +jedi/evaluate/recursion.py +jedi/evaluate/signature.py +jedi/evaluate/star_args.py +jedi/evaluate/syntax_tree.py +jedi/evaluate/sys_path.py +jedi/evaluate/usages.py +jedi/evaluate/utils.py +jedi/evaluate/compiled/__init__.py +jedi/evaluate/compiled/access.py +jedi/evaluate/compiled/context.py +jedi/evaluate/compiled/getattr_static.py +jedi/evaluate/compiled/mixed.py +jedi/evaluate/compiled/subprocess/__init__.py +jedi/evaluate/compiled/subprocess/__main__.py +jedi/evaluate/compiled/subprocess/functions.py +jedi/evaluate/context/__init__.py +jedi/evaluate/context/decorator.py +jedi/evaluate/context/function.py +jedi/evaluate/context/instance.py +jedi/evaluate/context/iterable.py +jedi/evaluate/context/klass.py +jedi/evaluate/context/module.py +jedi/evaluate/context/namespace.py +jedi/evaluate/gradual/__init__.py +jedi/evaluate/gradual/annotation.py +jedi/evaluate/gradual/conversion.py +jedi/evaluate/gradual/stub_context.py +jedi/evaluate/gradual/typeshed.py +jedi/evaluate/gradual/typing.py +jedi/evaluate/gradual/utils.py +jedi/plugins/__init__.py +jedi/plugins/flask.py +jedi/plugins/registry.py +jedi/plugins/stdlib.py +jedi/third_party/typeshed/LICENSE +jedi/third_party/typeshed/stdlib/2/BaseHTTPServer.pyi +jedi/third_party/typeshed/stdlib/2/ConfigParser.pyi +jedi/third_party/typeshed/stdlib/2/Cookie.pyi +jedi/third_party/typeshed/stdlib/2/HTMLParser.pyi +jedi/third_party/typeshed/stdlib/2/Queue.pyi +jedi/third_party/typeshed/stdlib/2/SimpleHTTPServer.pyi +jedi/third_party/typeshed/stdlib/2/SocketServer.pyi +jedi/third_party/typeshed/stdlib/2/StringIO.pyi +jedi/third_party/typeshed/stdlib/2/UserDict.pyi +jedi/third_party/typeshed/stdlib/2/UserList.pyi +jedi/third_party/typeshed/stdlib/2/UserString.pyi +jedi/third_party/typeshed/stdlib/2/__builtin__.pyi +jedi/third_party/typeshed/stdlib/2/_ast.pyi +jedi/third_party/typeshed/stdlib/2/_collections.pyi +jedi/third_party/typeshed/stdlib/2/_functools.pyi +jedi/third_party/typeshed/stdlib/2/_hotshot.pyi +jedi/third_party/typeshed/stdlib/2/_io.pyi +jedi/third_party/typeshed/stdlib/2/_json.pyi +jedi/third_party/typeshed/stdlib/2/_md5.pyi +jedi/third_party/typeshed/stdlib/2/_sha.pyi +jedi/third_party/typeshed/stdlib/2/_sha256.pyi +jedi/third_party/typeshed/stdlib/2/_sha512.pyi +jedi/third_party/typeshed/stdlib/2/_socket.pyi +jedi/third_party/typeshed/stdlib/2/_sre.pyi +jedi/third_party/typeshed/stdlib/2/_struct.pyi +jedi/third_party/typeshed/stdlib/2/_symtable.pyi +jedi/third_party/typeshed/stdlib/2/_threading_local.pyi +jedi/third_party/typeshed/stdlib/2/_warnings.pyi +jedi/third_party/typeshed/stdlib/2/abc.pyi +jedi/third_party/typeshed/stdlib/2/ast.pyi +jedi/third_party/typeshed/stdlib/2/atexit.pyi +jedi/third_party/typeshed/stdlib/2/cPickle.pyi +jedi/third_party/typeshed/stdlib/2/cStringIO.pyi +jedi/third_party/typeshed/stdlib/2/collections.pyi +jedi/third_party/typeshed/stdlib/2/commands.pyi +jedi/third_party/typeshed/stdlib/2/compileall.pyi +jedi/third_party/typeshed/stdlib/2/cookielib.pyi +jedi/third_party/typeshed/stdlib/2/dircache.pyi +jedi/third_party/typeshed/stdlib/2/dummy_thread.pyi +jedi/third_party/typeshed/stdlib/2/exceptions.pyi +jedi/third_party/typeshed/stdlib/2/fcntl.pyi +jedi/third_party/typeshed/stdlib/2/fnmatch.pyi +jedi/third_party/typeshed/stdlib/2/functools.pyi +jedi/third_party/typeshed/stdlib/2/future_builtins.pyi +jedi/third_party/typeshed/stdlib/2/gc.pyi +jedi/third_party/typeshed/stdlib/2/getopt.pyi +jedi/third_party/typeshed/stdlib/2/getpass.pyi +jedi/third_party/typeshed/stdlib/2/gettext.pyi +jedi/third_party/typeshed/stdlib/2/glob.pyi +jedi/third_party/typeshed/stdlib/2/gzip.pyi +jedi/third_party/typeshed/stdlib/2/hashlib.pyi +jedi/third_party/typeshed/stdlib/2/heapq.pyi +jedi/third_party/typeshed/stdlib/2/htmlentitydefs.pyi +jedi/third_party/typeshed/stdlib/2/httplib.pyi +jedi/third_party/typeshed/stdlib/2/imp.pyi +jedi/third_party/typeshed/stdlib/2/importlib.pyi +jedi/third_party/typeshed/stdlib/2/inspect.pyi +jedi/third_party/typeshed/stdlib/2/io.pyi +jedi/third_party/typeshed/stdlib/2/itertools.pyi +jedi/third_party/typeshed/stdlib/2/json.pyi +jedi/third_party/typeshed/stdlib/2/markupbase.pyi +jedi/third_party/typeshed/stdlib/2/md5.pyi +jedi/third_party/typeshed/stdlib/2/mimetools.pyi +jedi/third_party/typeshed/stdlib/2/mutex.pyi +jedi/third_party/typeshed/stdlib/2/nturl2path.pyi +jedi/third_party/typeshed/stdlib/2/os2emxpath.pyi +jedi/third_party/typeshed/stdlib/2/pipes.pyi +jedi/third_party/typeshed/stdlib/2/platform.pyi +jedi/third_party/typeshed/stdlib/2/popen2.pyi +jedi/third_party/typeshed/stdlib/2/posix.pyi +jedi/third_party/typeshed/stdlib/2/random.pyi +jedi/third_party/typeshed/stdlib/2/re.pyi +jedi/third_party/typeshed/stdlib/2/repr.pyi +jedi/third_party/typeshed/stdlib/2/resource.pyi +jedi/third_party/typeshed/stdlib/2/rfc822.pyi +jedi/third_party/typeshed/stdlib/2/robotparser.pyi +jedi/third_party/typeshed/stdlib/2/runpy.pyi +jedi/third_party/typeshed/stdlib/2/sets.pyi +jedi/third_party/typeshed/stdlib/2/sha.pyi +jedi/third_party/typeshed/stdlib/2/shelve.pyi +jedi/third_party/typeshed/stdlib/2/shlex.pyi +jedi/third_party/typeshed/stdlib/2/signal.pyi +jedi/third_party/typeshed/stdlib/2/smtplib.pyi +jedi/third_party/typeshed/stdlib/2/spwd.pyi +jedi/third_party/typeshed/stdlib/2/sre_constants.pyi +jedi/third_party/typeshed/stdlib/2/sre_parse.pyi +jedi/third_party/typeshed/stdlib/2/stat.pyi +jedi/third_party/typeshed/stdlib/2/string.pyi +jedi/third_party/typeshed/stdlib/2/stringold.pyi +jedi/third_party/typeshed/stdlib/2/strop.pyi +jedi/third_party/typeshed/stdlib/2/subprocess.pyi +jedi/third_party/typeshed/stdlib/2/symbol.pyi +jedi/third_party/typeshed/stdlib/2/sys.pyi +jedi/third_party/typeshed/stdlib/2/tempfile.pyi +jedi/third_party/typeshed/stdlib/2/textwrap.pyi +jedi/third_party/typeshed/stdlib/2/thread.pyi +jedi/third_party/typeshed/stdlib/2/toaiff.pyi +jedi/third_party/typeshed/stdlib/2/tokenize.pyi +jedi/third_party/typeshed/stdlib/2/types.pyi +jedi/third_party/typeshed/stdlib/2/typing.pyi +jedi/third_party/typeshed/stdlib/2/unittest.pyi +jedi/third_party/typeshed/stdlib/2/urllib.pyi +jedi/third_party/typeshed/stdlib/2/urllib2.pyi +jedi/third_party/typeshed/stdlib/2/urlparse.pyi +jedi/third_party/typeshed/stdlib/2/user.pyi +jedi/third_party/typeshed/stdlib/2/whichdb.pyi +jedi/third_party/typeshed/stdlib/2/xmlrpclib.pyi +jedi/third_party/typeshed/stdlib/2/distutils/__init__.pyi +jedi/third_party/typeshed/stdlib/2/distutils/emxccompiler.pyi +jedi/third_party/typeshed/stdlib/2/email/MIMEText.pyi +jedi/third_party/typeshed/stdlib/2/email/__init__.pyi +jedi/third_party/typeshed/stdlib/2/email/_parseaddr.pyi +jedi/third_party/typeshed/stdlib/2/email/base64mime.pyi +jedi/third_party/typeshed/stdlib/2/email/charset.pyi +jedi/third_party/typeshed/stdlib/2/email/encoders.pyi +jedi/third_party/typeshed/stdlib/2/email/feedparser.pyi +jedi/third_party/typeshed/stdlib/2/email/generator.pyi +jedi/third_party/typeshed/stdlib/2/email/header.pyi +jedi/third_party/typeshed/stdlib/2/email/iterators.pyi +jedi/third_party/typeshed/stdlib/2/email/message.pyi +jedi/third_party/typeshed/stdlib/2/email/parser.pyi +jedi/third_party/typeshed/stdlib/2/email/quoprimime.pyi +jedi/third_party/typeshed/stdlib/2/email/utils.pyi +jedi/third_party/typeshed/stdlib/2/email/mime/__init__.pyi +jedi/third_party/typeshed/stdlib/2/email/mime/application.pyi +jedi/third_party/typeshed/stdlib/2/email/mime/audio.pyi +jedi/third_party/typeshed/stdlib/2/email/mime/base.pyi +jedi/third_party/typeshed/stdlib/2/email/mime/image.pyi +jedi/third_party/typeshed/stdlib/2/email/mime/message.pyi +jedi/third_party/typeshed/stdlib/2/email/mime/multipart.pyi +jedi/third_party/typeshed/stdlib/2/email/mime/nonmultipart.pyi +jedi/third_party/typeshed/stdlib/2/email/mime/text.pyi +jedi/third_party/typeshed/stdlib/2/encodings/__init__.pyi +jedi/third_party/typeshed/stdlib/2/encodings/utf_8.pyi +jedi/third_party/typeshed/stdlib/2/multiprocessing/__init__.pyi +jedi/third_party/typeshed/stdlib/2/multiprocessing/pool.pyi +jedi/third_party/typeshed/stdlib/2/multiprocessing/process.pyi +jedi/third_party/typeshed/stdlib/2/multiprocessing/util.pyi +jedi/third_party/typeshed/stdlib/2/multiprocessing/dummy/__init__.pyi +jedi/third_party/typeshed/stdlib/2/multiprocessing/dummy/connection.pyi +jedi/third_party/typeshed/stdlib/2/os/__init__.pyi +jedi/third_party/typeshed/stdlib/2/os/path.pyi +jedi/third_party/typeshed/stdlib/2and3/__future__.pyi +jedi/third_party/typeshed/stdlib/2and3/_bisect.pyi +jedi/third_party/typeshed/stdlib/2and3/_codecs.pyi +jedi/third_party/typeshed/stdlib/2and3/_csv.pyi +jedi/third_party/typeshed/stdlib/2and3/_heapq.pyi +jedi/third_party/typeshed/stdlib/2and3/_random.pyi +jedi/third_party/typeshed/stdlib/2and3/_weakref.pyi +jedi/third_party/typeshed/stdlib/2and3/_weakrefset.pyi +jedi/third_party/typeshed/stdlib/2and3/argparse.pyi +jedi/third_party/typeshed/stdlib/2and3/array.pyi +jedi/third_party/typeshed/stdlib/2and3/asynchat.pyi +jedi/third_party/typeshed/stdlib/2and3/asyncore.pyi +jedi/third_party/typeshed/stdlib/2and3/base64.pyi +jedi/third_party/typeshed/stdlib/2and3/binascii.pyi +jedi/third_party/typeshed/stdlib/2and3/binhex.pyi +jedi/third_party/typeshed/stdlib/2and3/bisect.pyi +jedi/third_party/typeshed/stdlib/2and3/builtins.pyi +jedi/third_party/typeshed/stdlib/2and3/bz2.pyi +jedi/third_party/typeshed/stdlib/2and3/cProfile.pyi +jedi/third_party/typeshed/stdlib/2and3/calendar.pyi +jedi/third_party/typeshed/stdlib/2and3/cgi.pyi +jedi/third_party/typeshed/stdlib/2and3/chunk.pyi +jedi/third_party/typeshed/stdlib/2and3/cmath.pyi +jedi/third_party/typeshed/stdlib/2and3/cmd.pyi +jedi/third_party/typeshed/stdlib/2and3/code.pyi +jedi/third_party/typeshed/stdlib/2and3/codecs.pyi +jedi/third_party/typeshed/stdlib/2and3/codeop.pyi +jedi/third_party/typeshed/stdlib/2and3/colorsys.pyi +jedi/third_party/typeshed/stdlib/2and3/contextlib.pyi +jedi/third_party/typeshed/stdlib/2and3/copy.pyi +jedi/third_party/typeshed/stdlib/2and3/crypt.pyi +jedi/third_party/typeshed/stdlib/2and3/csv.pyi +jedi/third_party/typeshed/stdlib/2and3/datetime.pyi +jedi/third_party/typeshed/stdlib/2and3/decimal.pyi +jedi/third_party/typeshed/stdlib/2and3/difflib.pyi +jedi/third_party/typeshed/stdlib/2and3/dis.pyi +jedi/third_party/typeshed/stdlib/2and3/doctest.pyi +jedi/third_party/typeshed/stdlib/2and3/errno.pyi +jedi/third_party/typeshed/stdlib/2and3/filecmp.pyi +jedi/third_party/typeshed/stdlib/2and3/fileinput.pyi +jedi/third_party/typeshed/stdlib/2and3/formatter.pyi +jedi/third_party/typeshed/stdlib/2and3/fractions.pyi +jedi/third_party/typeshed/stdlib/2and3/ftplib.pyi +jedi/third_party/typeshed/stdlib/2and3/genericpath.pyi +jedi/third_party/typeshed/stdlib/2and3/grp.pyi +jedi/third_party/typeshed/stdlib/2and3/hmac.pyi +jedi/third_party/typeshed/stdlib/2and3/imaplib.pyi +jedi/third_party/typeshed/stdlib/2and3/imghdr.pyi +jedi/third_party/typeshed/stdlib/2and3/keyword.pyi +jedi/third_party/typeshed/stdlib/2and3/linecache.pyi +jedi/third_party/typeshed/stdlib/2and3/locale.pyi +jedi/third_party/typeshed/stdlib/2and3/macpath.pyi +jedi/third_party/typeshed/stdlib/2and3/marshal.pyi +jedi/third_party/typeshed/stdlib/2and3/math.pyi +jedi/third_party/typeshed/stdlib/2and3/mimetypes.pyi +jedi/third_party/typeshed/stdlib/2and3/mmap.pyi +jedi/third_party/typeshed/stdlib/2and3/netrc.pyi +jedi/third_party/typeshed/stdlib/2and3/nis.pyi +jedi/third_party/typeshed/stdlib/2and3/ntpath.pyi +jedi/third_party/typeshed/stdlib/2and3/numbers.pyi +jedi/third_party/typeshed/stdlib/2and3/opcode.pyi +jedi/third_party/typeshed/stdlib/2and3/operator.pyi +jedi/third_party/typeshed/stdlib/2and3/optparse.pyi +jedi/third_party/typeshed/stdlib/2and3/pdb.pyi +jedi/third_party/typeshed/stdlib/2and3/pickle.pyi +jedi/third_party/typeshed/stdlib/2and3/pickletools.pyi +jedi/third_party/typeshed/stdlib/2and3/pkgutil.pyi +jedi/third_party/typeshed/stdlib/2and3/plistlib.pyi +jedi/third_party/typeshed/stdlib/2and3/poplib.pyi +jedi/third_party/typeshed/stdlib/2and3/posixpath.pyi +jedi/third_party/typeshed/stdlib/2and3/pprint.pyi +jedi/third_party/typeshed/stdlib/2and3/profile.pyi +jedi/third_party/typeshed/stdlib/2and3/pstats.pyi +jedi/third_party/typeshed/stdlib/2and3/pty.pyi +jedi/third_party/typeshed/stdlib/2and3/pwd.pyi +jedi/third_party/typeshed/stdlib/2and3/py_compile.pyi +jedi/third_party/typeshed/stdlib/2and3/pyclbr.pyi +jedi/third_party/typeshed/stdlib/2and3/pydoc.pyi +jedi/third_party/typeshed/stdlib/2and3/quopri.pyi +jedi/third_party/typeshed/stdlib/2and3/readline.pyi +jedi/third_party/typeshed/stdlib/2and3/rlcompleter.pyi +jedi/third_party/typeshed/stdlib/2and3/sched.pyi +jedi/third_party/typeshed/stdlib/2and3/select.pyi +jedi/third_party/typeshed/stdlib/2and3/shutil.pyi +jedi/third_party/typeshed/stdlib/2and3/site.pyi +jedi/third_party/typeshed/stdlib/2and3/smtpd.pyi +jedi/third_party/typeshed/stdlib/2and3/sndhdr.pyi +jedi/third_party/typeshed/stdlib/2and3/socket.pyi +jedi/third_party/typeshed/stdlib/2and3/sre_compile.pyi +jedi/third_party/typeshed/stdlib/2and3/ssl.pyi +jedi/third_party/typeshed/stdlib/2and3/stringprep.pyi +jedi/third_party/typeshed/stdlib/2and3/struct.pyi +jedi/third_party/typeshed/stdlib/2and3/sunau.pyi +jedi/third_party/typeshed/stdlib/2and3/symtable.pyi +jedi/third_party/typeshed/stdlib/2and3/sysconfig.pyi +jedi/third_party/typeshed/stdlib/2and3/syslog.pyi +jedi/third_party/typeshed/stdlib/2and3/tabnanny.pyi +jedi/third_party/typeshed/stdlib/2and3/tarfile.pyi +jedi/third_party/typeshed/stdlib/2and3/telnetlib.pyi +jedi/third_party/typeshed/stdlib/2and3/termios.pyi +jedi/third_party/typeshed/stdlib/2and3/threading.pyi +jedi/third_party/typeshed/stdlib/2and3/time.pyi +jedi/third_party/typeshed/stdlib/2and3/timeit.pyi +jedi/third_party/typeshed/stdlib/2and3/token.pyi +jedi/third_party/typeshed/stdlib/2and3/trace.pyi +jedi/third_party/typeshed/stdlib/2and3/traceback.pyi +jedi/third_party/typeshed/stdlib/2and3/tty.pyi +jedi/third_party/typeshed/stdlib/2and3/turtle.pyi +jedi/third_party/typeshed/stdlib/2and3/unicodedata.pyi +jedi/third_party/typeshed/stdlib/2and3/uu.pyi +jedi/third_party/typeshed/stdlib/2and3/uuid.pyi +jedi/third_party/typeshed/stdlib/2and3/warnings.pyi +jedi/third_party/typeshed/stdlib/2and3/wave.pyi +jedi/third_party/typeshed/stdlib/2and3/weakref.pyi +jedi/third_party/typeshed/stdlib/2and3/webbrowser.pyi +jedi/third_party/typeshed/stdlib/2and3/xdrlib.pyi +jedi/third_party/typeshed/stdlib/2and3/zipfile.pyi +jedi/third_party/typeshed/stdlib/2and3/zipimport.pyi +jedi/third_party/typeshed/stdlib/2and3/zlib.pyi +jedi/third_party/typeshed/stdlib/2and3/ctypes/__init__.pyi +jedi/third_party/typeshed/stdlib/2and3/ctypes/util.pyi +jedi/third_party/typeshed/stdlib/2and3/ctypes/wintypes.pyi +jedi/third_party/typeshed/stdlib/2and3/distutils/__init__.pyi +jedi/third_party/typeshed/stdlib/2and3/distutils/archive_util.pyi +jedi/third_party/typeshed/stdlib/2and3/distutils/bcppcompiler.pyi +jedi/third_party/typeshed/stdlib/2and3/distutils/ccompiler.pyi +jedi/third_party/typeshed/stdlib/2and3/distutils/cmd.pyi +jedi/third_party/typeshed/stdlib/2and3/distutils/core.pyi +jedi/third_party/typeshed/stdlib/2and3/distutils/cygwinccompiler.pyi +jedi/third_party/typeshed/stdlib/2and3/distutils/debug.pyi +jedi/third_party/typeshed/stdlib/2and3/distutils/dep_util.pyi +jedi/third_party/typeshed/stdlib/2and3/distutils/dir_util.pyi +jedi/third_party/typeshed/stdlib/2and3/distutils/dist.pyi +jedi/third_party/typeshed/stdlib/2and3/distutils/errors.pyi +jedi/third_party/typeshed/stdlib/2and3/distutils/extension.pyi +jedi/third_party/typeshed/stdlib/2and3/distutils/fancy_getopt.pyi +jedi/third_party/typeshed/stdlib/2and3/distutils/file_util.pyi +jedi/third_party/typeshed/stdlib/2and3/distutils/filelist.pyi +jedi/third_party/typeshed/stdlib/2and3/distutils/log.pyi +jedi/third_party/typeshed/stdlib/2and3/distutils/msvccompiler.pyi +jedi/third_party/typeshed/stdlib/2and3/distutils/spawn.pyi +jedi/third_party/typeshed/stdlib/2and3/distutils/sysconfig.pyi +jedi/third_party/typeshed/stdlib/2and3/distutils/text_file.pyi +jedi/third_party/typeshed/stdlib/2and3/distutils/unixccompiler.pyi +jedi/third_party/typeshed/stdlib/2and3/distutils/util.pyi +jedi/third_party/typeshed/stdlib/2and3/distutils/version.pyi +jedi/third_party/typeshed/stdlib/2and3/distutils/command/__init__.pyi +jedi/third_party/typeshed/stdlib/2and3/distutils/command/bdist.pyi +jedi/third_party/typeshed/stdlib/2and3/distutils/command/bdist_dumb.pyi +jedi/third_party/typeshed/stdlib/2and3/distutils/command/bdist_msi.pyi +jedi/third_party/typeshed/stdlib/2and3/distutils/command/bdist_packager.pyi +jedi/third_party/typeshed/stdlib/2and3/distutils/command/bdist_rpm.pyi +jedi/third_party/typeshed/stdlib/2and3/distutils/command/bdist_wininst.pyi +jedi/third_party/typeshed/stdlib/2and3/distutils/command/build.pyi +jedi/third_party/typeshed/stdlib/2and3/distutils/command/build_clib.pyi +jedi/third_party/typeshed/stdlib/2and3/distutils/command/build_ext.pyi +jedi/third_party/typeshed/stdlib/2and3/distutils/command/build_py.pyi +jedi/third_party/typeshed/stdlib/2and3/distutils/command/build_scripts.pyi +jedi/third_party/typeshed/stdlib/2and3/distutils/command/check.pyi +jedi/third_party/typeshed/stdlib/2and3/distutils/command/clean.pyi +jedi/third_party/typeshed/stdlib/2and3/distutils/command/config.pyi +jedi/third_party/typeshed/stdlib/2and3/distutils/command/install.pyi +jedi/third_party/typeshed/stdlib/2and3/distutils/command/install_data.pyi +jedi/third_party/typeshed/stdlib/2and3/distutils/command/install_headers.pyi +jedi/third_party/typeshed/stdlib/2and3/distutils/command/install_lib.pyi +jedi/third_party/typeshed/stdlib/2and3/distutils/command/install_scripts.pyi +jedi/third_party/typeshed/stdlib/2and3/distutils/command/register.pyi +jedi/third_party/typeshed/stdlib/2and3/distutils/command/sdist.pyi +jedi/third_party/typeshed/stdlib/2and3/lib2to3/__init__.pyi +jedi/third_party/typeshed/stdlib/2and3/lib2to3/pygram.pyi +jedi/third_party/typeshed/stdlib/2and3/lib2to3/pytree.pyi +jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/__init__.pyi +jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/driver.pyi +jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/grammar.pyi +jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/literals.pyi +jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/parse.pyi +jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/pgen.pyi +jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/token.pyi +jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/tokenize.pyi +jedi/third_party/typeshed/stdlib/2and3/logging/__init__.pyi +jedi/third_party/typeshed/stdlib/2and3/logging/config.pyi +jedi/third_party/typeshed/stdlib/2and3/logging/handlers.pyi +jedi/third_party/typeshed/stdlib/2and3/pyexpat/__init__.pyi +jedi/third_party/typeshed/stdlib/2and3/pyexpat/errors.pyi +jedi/third_party/typeshed/stdlib/2and3/pyexpat/model.pyi +jedi/third_party/typeshed/stdlib/2and3/sqlite3/__init__.pyi +jedi/third_party/typeshed/stdlib/2and3/sqlite3/dbapi2.pyi +jedi/third_party/typeshed/stdlib/2and3/wsgiref/__init__.pyi +jedi/third_party/typeshed/stdlib/2and3/wsgiref/handlers.pyi +jedi/third_party/typeshed/stdlib/2and3/wsgiref/headers.pyi +jedi/third_party/typeshed/stdlib/2and3/wsgiref/simple_server.pyi +jedi/third_party/typeshed/stdlib/2and3/wsgiref/types.pyi +jedi/third_party/typeshed/stdlib/2and3/wsgiref/util.pyi +jedi/third_party/typeshed/stdlib/2and3/wsgiref/validate.pyi +jedi/third_party/typeshed/stdlib/2and3/xml/__init__.pyi +jedi/third_party/typeshed/stdlib/2and3/xml/etree/ElementInclude.pyi +jedi/third_party/typeshed/stdlib/2and3/xml/etree/ElementPath.pyi +jedi/third_party/typeshed/stdlib/2and3/xml/etree/ElementTree.pyi +jedi/third_party/typeshed/stdlib/2and3/xml/etree/__init__.pyi +jedi/third_party/typeshed/stdlib/2and3/xml/etree/cElementTree.pyi +jedi/third_party/typeshed/stdlib/2and3/xml/parsers/__init__.pyi +jedi/third_party/typeshed/stdlib/2and3/xml/parsers/expat/__init__.pyi +jedi/third_party/typeshed/stdlib/2and3/xml/parsers/expat/errors.pyi +jedi/third_party/typeshed/stdlib/2and3/xml/parsers/expat/model.pyi +jedi/third_party/typeshed/stdlib/2and3/xml/sax/__init__.pyi +jedi/third_party/typeshed/stdlib/2and3/xml/sax/handler.pyi +jedi/third_party/typeshed/stdlib/2and3/xml/sax/saxutils.pyi +jedi/third_party/typeshed/stdlib/2and3/xml/sax/xmlreader.pyi +jedi/third_party/typeshed/stdlib/3/_ast.pyi +jedi/third_party/typeshed/stdlib/3/_compression.pyi +jedi/third_party/typeshed/stdlib/3/_curses.pyi +jedi/third_party/typeshed/stdlib/3/_dummy_thread.pyi +jedi/third_party/typeshed/stdlib/3/_imp.pyi +jedi/third_party/typeshed/stdlib/3/_importlib_modulespec.pyi +jedi/third_party/typeshed/stdlib/3/_json.pyi +jedi/third_party/typeshed/stdlib/3/_markupbase.pyi +jedi/third_party/typeshed/stdlib/3/_operator.pyi +jedi/third_party/typeshed/stdlib/3/_posixsubprocess.pyi +jedi/third_party/typeshed/stdlib/3/_stat.pyi +jedi/third_party/typeshed/stdlib/3/_subprocess.pyi +jedi/third_party/typeshed/stdlib/3/_thread.pyi +jedi/third_party/typeshed/stdlib/3/_threading_local.pyi +jedi/third_party/typeshed/stdlib/3/_tracemalloc.pyi +jedi/third_party/typeshed/stdlib/3/_warnings.pyi +jedi/third_party/typeshed/stdlib/3/_winapi.pyi +jedi/third_party/typeshed/stdlib/3/abc.pyi +jedi/third_party/typeshed/stdlib/3/ast.pyi +jedi/third_party/typeshed/stdlib/3/atexit.pyi +jedi/third_party/typeshed/stdlib/3/compileall.pyi +jedi/third_party/typeshed/stdlib/3/configparser.pyi +jedi/third_party/typeshed/stdlib/3/enum.pyi +jedi/third_party/typeshed/stdlib/3/faulthandler.pyi +jedi/third_party/typeshed/stdlib/3/fcntl.pyi +jedi/third_party/typeshed/stdlib/3/fnmatch.pyi +jedi/third_party/typeshed/stdlib/3/functools.pyi +jedi/third_party/typeshed/stdlib/3/gc.pyi +jedi/third_party/typeshed/stdlib/3/getopt.pyi +jedi/third_party/typeshed/stdlib/3/getpass.pyi +jedi/third_party/typeshed/stdlib/3/gettext.pyi +jedi/third_party/typeshed/stdlib/3/glob.pyi +jedi/third_party/typeshed/stdlib/3/gzip.pyi +jedi/third_party/typeshed/stdlib/3/hashlib.pyi +jedi/third_party/typeshed/stdlib/3/heapq.pyi +jedi/third_party/typeshed/stdlib/3/imp.pyi +jedi/third_party/typeshed/stdlib/3/inspect.pyi +jedi/third_party/typeshed/stdlib/3/io.pyi +jedi/third_party/typeshed/stdlib/3/ipaddress.pyi +jedi/third_party/typeshed/stdlib/3/itertools.pyi +jedi/third_party/typeshed/stdlib/3/lzma.pyi +jedi/third_party/typeshed/stdlib/3/msvcrt.pyi +jedi/third_party/typeshed/stdlib/3/nntplib.pyi +jedi/third_party/typeshed/stdlib/3/nturl2path.pyi +jedi/third_party/typeshed/stdlib/3/pathlib.pyi +jedi/third_party/typeshed/stdlib/3/pipes.pyi +jedi/third_party/typeshed/stdlib/3/platform.pyi +jedi/third_party/typeshed/stdlib/3/posix.pyi +jedi/third_party/typeshed/stdlib/3/queue.pyi +jedi/third_party/typeshed/stdlib/3/random.pyi +jedi/third_party/typeshed/stdlib/3/re.pyi +jedi/third_party/typeshed/stdlib/3/reprlib.pyi +jedi/third_party/typeshed/stdlib/3/resource.pyi +jedi/third_party/typeshed/stdlib/3/runpy.pyi +jedi/third_party/typeshed/stdlib/3/selectors.pyi +jedi/third_party/typeshed/stdlib/3/shelve.pyi +jedi/third_party/typeshed/stdlib/3/shlex.pyi +jedi/third_party/typeshed/stdlib/3/signal.pyi +jedi/third_party/typeshed/stdlib/3/smtplib.pyi +jedi/third_party/typeshed/stdlib/3/socketserver.pyi +jedi/third_party/typeshed/stdlib/3/spwd.pyi +jedi/third_party/typeshed/stdlib/3/sre_constants.pyi +jedi/third_party/typeshed/stdlib/3/sre_parse.pyi +jedi/third_party/typeshed/stdlib/3/stat.pyi +jedi/third_party/typeshed/stdlib/3/statistics.pyi +jedi/third_party/typeshed/stdlib/3/string.pyi +jedi/third_party/typeshed/stdlib/3/subprocess.pyi +jedi/third_party/typeshed/stdlib/3/symbol.pyi +jedi/third_party/typeshed/stdlib/3/sys.pyi +jedi/third_party/typeshed/stdlib/3/tempfile.pyi +jedi/third_party/typeshed/stdlib/3/textwrap.pyi +jedi/third_party/typeshed/stdlib/3/tokenize.pyi +jedi/third_party/typeshed/stdlib/3/tracemalloc.pyi +jedi/third_party/typeshed/stdlib/3/types.pyi +jedi/third_party/typeshed/stdlib/3/typing.pyi +jedi/third_party/typeshed/stdlib/3.5/zipapp.pyi +jedi/third_party/typeshed/stdlib/3.6/secrets.pyi +jedi/third_party/typeshed/stdlib/3.7/contextvars.pyi +jedi/third_party/typeshed/stdlib/3.7/dataclasses.pyi +jedi/third_party/typeshed/stdlib/3/asyncio/__init__.pyi +jedi/third_party/typeshed/stdlib/3/asyncio/base_events.pyi +jedi/third_party/typeshed/stdlib/3/asyncio/coroutines.pyi +jedi/third_party/typeshed/stdlib/3/asyncio/events.pyi +jedi/third_party/typeshed/stdlib/3/asyncio/futures.pyi +jedi/third_party/typeshed/stdlib/3/asyncio/locks.pyi +jedi/third_party/typeshed/stdlib/3/asyncio/protocols.pyi +jedi/third_party/typeshed/stdlib/3/asyncio/queues.pyi +jedi/third_party/typeshed/stdlib/3/asyncio/runners.pyi +jedi/third_party/typeshed/stdlib/3/asyncio/streams.pyi +jedi/third_party/typeshed/stdlib/3/asyncio/subprocess.pyi +jedi/third_party/typeshed/stdlib/3/asyncio/tasks.pyi +jedi/third_party/typeshed/stdlib/3/asyncio/transports.pyi +jedi/third_party/typeshed/stdlib/3/collections/__init__.pyi +jedi/third_party/typeshed/stdlib/3/collections/abc.pyi +jedi/third_party/typeshed/stdlib/3/concurrent/__init__.pyi +jedi/third_party/typeshed/stdlib/3/concurrent/futures/__init__.pyi +jedi/third_party/typeshed/stdlib/3/concurrent/futures/_base.pyi +jedi/third_party/typeshed/stdlib/3/concurrent/futures/process.pyi +jedi/third_party/typeshed/stdlib/3/concurrent/futures/thread.pyi +jedi/third_party/typeshed/stdlib/3/curses/__init__.pyi +jedi/third_party/typeshed/stdlib/3/curses/ascii.pyi +jedi/third_party/typeshed/stdlib/3/curses/panel.pyi +jedi/third_party/typeshed/stdlib/3/curses/textpad.pyi +jedi/third_party/typeshed/stdlib/3/email/__init__.pyi +jedi/third_party/typeshed/stdlib/3/email/charset.pyi +jedi/third_party/typeshed/stdlib/3/email/contentmanager.pyi +jedi/third_party/typeshed/stdlib/3/email/encoders.pyi +jedi/third_party/typeshed/stdlib/3/email/errors.pyi +jedi/third_party/typeshed/stdlib/3/email/feedparser.pyi +jedi/third_party/typeshed/stdlib/3/email/generator.pyi +jedi/third_party/typeshed/stdlib/3/email/header.pyi +jedi/third_party/typeshed/stdlib/3/email/headerregistry.pyi +jedi/third_party/typeshed/stdlib/3/email/iterators.pyi +jedi/third_party/typeshed/stdlib/3/email/message.pyi +jedi/third_party/typeshed/stdlib/3/email/parser.pyi +jedi/third_party/typeshed/stdlib/3/email/policy.pyi +jedi/third_party/typeshed/stdlib/3/email/utils.pyi +jedi/third_party/typeshed/stdlib/3/email/mime/__init__.pyi +jedi/third_party/typeshed/stdlib/3/email/mime/application.pyi +jedi/third_party/typeshed/stdlib/3/email/mime/audio.pyi +jedi/third_party/typeshed/stdlib/3/email/mime/base.pyi +jedi/third_party/typeshed/stdlib/3/email/mime/image.pyi +jedi/third_party/typeshed/stdlib/3/email/mime/message.pyi +jedi/third_party/typeshed/stdlib/3/email/mime/multipart.pyi +jedi/third_party/typeshed/stdlib/3/email/mime/nonmultipart.pyi +jedi/third_party/typeshed/stdlib/3/email/mime/text.pyi +jedi/third_party/typeshed/stdlib/3/encodings/__init__.pyi +jedi/third_party/typeshed/stdlib/3/encodings/utf_8.pyi +jedi/third_party/typeshed/stdlib/3/html/__init__.pyi +jedi/third_party/typeshed/stdlib/3/html/entities.pyi +jedi/third_party/typeshed/stdlib/3/html/parser.pyi +jedi/third_party/typeshed/stdlib/3/http/__init__.pyi +jedi/third_party/typeshed/stdlib/3/http/client.pyi +jedi/third_party/typeshed/stdlib/3/http/cookiejar.pyi +jedi/third_party/typeshed/stdlib/3/http/cookies.pyi +jedi/third_party/typeshed/stdlib/3/http/server.pyi +jedi/third_party/typeshed/stdlib/3/importlib/__init__.pyi +jedi/third_party/typeshed/stdlib/3/importlib/abc.pyi +jedi/third_party/typeshed/stdlib/3/importlib/machinery.pyi +jedi/third_party/typeshed/stdlib/3/importlib/resources.pyi +jedi/third_party/typeshed/stdlib/3/importlib/util.pyi +jedi/third_party/typeshed/stdlib/3/json/__init__.pyi +jedi/third_party/typeshed/stdlib/3/json/decoder.pyi +jedi/third_party/typeshed/stdlib/3/json/encoder.pyi +jedi/third_party/typeshed/stdlib/3/multiprocessing/__init__.pyi +jedi/third_party/typeshed/stdlib/3/multiprocessing/connection.pyi +jedi/third_party/typeshed/stdlib/3/multiprocessing/context.pyi +jedi/third_party/typeshed/stdlib/3/multiprocessing/managers.pyi +jedi/third_party/typeshed/stdlib/3/multiprocessing/pool.pyi +jedi/third_party/typeshed/stdlib/3/multiprocessing/process.pyi +jedi/third_party/typeshed/stdlib/3/multiprocessing/queues.pyi +jedi/third_party/typeshed/stdlib/3/multiprocessing/spawn.pyi +jedi/third_party/typeshed/stdlib/3/multiprocessing/synchronize.pyi +jedi/third_party/typeshed/stdlib/3/multiprocessing/dummy/__init__.pyi +jedi/third_party/typeshed/stdlib/3/multiprocessing/dummy/connection.pyi +jedi/third_party/typeshed/stdlib/3/os/__init__.pyi +jedi/third_party/typeshed/stdlib/3/os/path.pyi +jedi/third_party/typeshed/stdlib/3/tkinter/__init__.pyi +jedi/third_party/typeshed/stdlib/3/tkinter/commondialog.pyi +jedi/third_party/typeshed/stdlib/3/tkinter/constants.pyi +jedi/third_party/typeshed/stdlib/3/tkinter/dialog.pyi +jedi/third_party/typeshed/stdlib/3/tkinter/filedialog.pyi +jedi/third_party/typeshed/stdlib/3/tkinter/messagebox.pyi +jedi/third_party/typeshed/stdlib/3/tkinter/ttk.pyi +jedi/third_party/typeshed/stdlib/3/unittest/__init__.pyi +jedi/third_party/typeshed/stdlib/3/unittest/case.pyi +jedi/third_party/typeshed/stdlib/3/unittest/loader.pyi +jedi/third_party/typeshed/stdlib/3/unittest/mock.pyi +jedi/third_party/typeshed/stdlib/3/unittest/result.pyi +jedi/third_party/typeshed/stdlib/3/unittest/runner.pyi +jedi/third_party/typeshed/stdlib/3/unittest/signals.pyi +jedi/third_party/typeshed/stdlib/3/unittest/suite.pyi +jedi/third_party/typeshed/stdlib/3/urllib/__init__.pyi +jedi/third_party/typeshed/stdlib/3/urllib/error.pyi +jedi/third_party/typeshed/stdlib/3/urllib/parse.pyi +jedi/third_party/typeshed/stdlib/3/urllib/request.pyi +jedi/third_party/typeshed/stdlib/3/urllib/response.pyi +jedi/third_party/typeshed/stdlib/3/urllib/robotparser.pyi +jedi/third_party/typeshed/third_party/2/enum.pyi +jedi/third_party/typeshed/third_party/2/gflags.pyi +jedi/third_party/typeshed/third_party/2/pathlib2.pyi +jedi/third_party/typeshed/third_party/2/pymssql.pyi +jedi/third_party/typeshed/third_party/2/OpenSSL/__init__.pyi +jedi/third_party/typeshed/third_party/2/OpenSSL/crypto.pyi +jedi/third_party/typeshed/third_party/2/concurrent/__init__.pyi +jedi/third_party/typeshed/third_party/2/concurrent/futures/__init__.pyi +jedi/third_party/typeshed/third_party/2/concurrent/futures/_base.pyi +jedi/third_party/typeshed/third_party/2/concurrent/futures/process.pyi +jedi/third_party/typeshed/third_party/2/concurrent/futures/thread.pyi +jedi/third_party/typeshed/third_party/2/cryptography/__init__.pyi +jedi/third_party/typeshed/third_party/2/cryptography/hazmat/__init__.pyi +jedi/third_party/typeshed/third_party/2/cryptography/hazmat/primitives/__init__.pyi +jedi/third_party/typeshed/third_party/2/cryptography/hazmat/primitives/serialization.pyi +jedi/third_party/typeshed/third_party/2/cryptography/hazmat/primitives/asymmetric/__init__.pyi +jedi/third_party/typeshed/third_party/2/cryptography/hazmat/primitives/asymmetric/dsa.pyi +jedi/third_party/typeshed/third_party/2/cryptography/hazmat/primitives/asymmetric/rsa.pyi +jedi/third_party/typeshed/third_party/2/fb303/FacebookService.pyi +jedi/third_party/typeshed/third_party/2/fb303/__init__.pyi +jedi/third_party/typeshed/third_party/2/kazoo/__init__.pyi +jedi/third_party/typeshed/third_party/2/kazoo/client.pyi +jedi/third_party/typeshed/third_party/2/kazoo/exceptions.pyi +jedi/third_party/typeshed/third_party/2/kazoo/recipe/__init__.pyi +jedi/third_party/typeshed/third_party/2/kazoo/recipe/watchers.pyi +jedi/third_party/typeshed/third_party/2/redis/__init__.pyi +jedi/third_party/typeshed/third_party/2/redis/client.pyi +jedi/third_party/typeshed/third_party/2/redis/connection.pyi +jedi/third_party/typeshed/third_party/2/redis/exceptions.pyi +jedi/third_party/typeshed/third_party/2/redis/utils.pyi +jedi/third_party/typeshed/third_party/2/routes/__init__.pyi +jedi/third_party/typeshed/third_party/2/routes/mapper.pyi +jedi/third_party/typeshed/third_party/2/routes/util.pyi +jedi/third_party/typeshed/third_party/2/scribe/__init__.pyi +jedi/third_party/typeshed/third_party/2/scribe/scribe.pyi +jedi/third_party/typeshed/third_party/2/scribe/ttypes.pyi +jedi/third_party/typeshed/third_party/2/six/__init__.pyi +jedi/third_party/typeshed/third_party/2/six/moves/BaseHTTPServer.pyi +jedi/third_party/typeshed/third_party/2/six/moves/SimpleHTTPServer.pyi +jedi/third_party/typeshed/third_party/2/six/moves/__init__.pyi +jedi/third_party/typeshed/third_party/2/six/moves/_dummy_thread.pyi +jedi/third_party/typeshed/third_party/2/six/moves/_thread.pyi +jedi/third_party/typeshed/third_party/2/six/moves/cPickle.pyi +jedi/third_party/typeshed/third_party/2/six/moves/configparser.pyi +jedi/third_party/typeshed/third_party/2/six/moves/email_mime_base.pyi +jedi/third_party/typeshed/third_party/2/six/moves/email_mime_multipart.pyi +jedi/third_party/typeshed/third_party/2/six/moves/email_mime_nonmultipart.pyi +jedi/third_party/typeshed/third_party/2/six/moves/email_mime_text.pyi +jedi/third_party/typeshed/third_party/2/six/moves/html_entities.pyi +jedi/third_party/typeshed/third_party/2/six/moves/html_parser.pyi +jedi/third_party/typeshed/third_party/2/six/moves/http_client.pyi +jedi/third_party/typeshed/third_party/2/six/moves/http_cookiejar.pyi +jedi/third_party/typeshed/third_party/2/six/moves/http_cookies.pyi +jedi/third_party/typeshed/third_party/2/six/moves/queue.pyi +jedi/third_party/typeshed/third_party/2/six/moves/reprlib.pyi +jedi/third_party/typeshed/third_party/2/six/moves/socketserver.pyi +jedi/third_party/typeshed/third_party/2/six/moves/urllib_error.pyi +jedi/third_party/typeshed/third_party/2/six/moves/urllib_parse.pyi +jedi/third_party/typeshed/third_party/2/six/moves/urllib_request.pyi +jedi/third_party/typeshed/third_party/2/six/moves/urllib_response.pyi +jedi/third_party/typeshed/third_party/2/six/moves/urllib_robotparser.pyi +jedi/third_party/typeshed/third_party/2/six/moves/xmlrpc_client.pyi +jedi/third_party/typeshed/third_party/2/six/moves/urllib/__init__.pyi +jedi/third_party/typeshed/third_party/2/six/moves/urllib/error.pyi +jedi/third_party/typeshed/third_party/2/six/moves/urllib/parse.pyi +jedi/third_party/typeshed/third_party/2/six/moves/urllib/request.pyi +jedi/third_party/typeshed/third_party/2/six/moves/urllib/response.pyi +jedi/third_party/typeshed/third_party/2/six/moves/urllib/robotparser.pyi +jedi/third_party/typeshed/third_party/2/tornado/__init__.pyi +jedi/third_party/typeshed/third_party/2/tornado/concurrent.pyi +jedi/third_party/typeshed/third_party/2/tornado/gen.pyi +jedi/third_party/typeshed/third_party/2/tornado/httpclient.pyi +jedi/third_party/typeshed/third_party/2/tornado/httpserver.pyi +jedi/third_party/typeshed/third_party/2/tornado/httputil.pyi +jedi/third_party/typeshed/third_party/2/tornado/ioloop.pyi +jedi/third_party/typeshed/third_party/2/tornado/locks.pyi +jedi/third_party/typeshed/third_party/2/tornado/netutil.pyi +jedi/third_party/typeshed/third_party/2/tornado/process.pyi +jedi/third_party/typeshed/third_party/2/tornado/tcpserver.pyi +jedi/third_party/typeshed/third_party/2/tornado/testing.pyi +jedi/third_party/typeshed/third_party/2/tornado/util.pyi +jedi/third_party/typeshed/third_party/2/tornado/web.pyi +jedi/third_party/typeshed/third_party/2and3/backports_abc.pyi +jedi/third_party/typeshed/third_party/2and3/certifi.pyi +jedi/third_party/typeshed/third_party/2and3/croniter.pyi +jedi/third_party/typeshed/third_party/2and3/emoji.pyi +jedi/third_party/typeshed/third_party/2and3/first.pyi +jedi/third_party/typeshed/third_party/2and3/itsdangerous.pyi +jedi/third_party/typeshed/third_party/2and3/mock.pyi +jedi/third_party/typeshed/third_party/2and3/mypy_extensions.pyi +jedi/third_party/typeshed/third_party/2and3/pycurl.pyi +jedi/third_party/typeshed/third_party/2and3/singledispatch.pyi +jedi/third_party/typeshed/third_party/2and3/tabulate.pyi +jedi/third_party/typeshed/third_party/2and3/termcolor.pyi +jedi/third_party/typeshed/third_party/2and3/toml.pyi +jedi/third_party/typeshed/third_party/2and3/typing_extensions.pyi +jedi/third_party/typeshed/third_party/2and3/ujson.pyi +jedi/third_party/typeshed/third_party/2and3/Crypto/__init__.pyi +jedi/third_party/typeshed/third_party/2and3/Crypto/pct_warnings.pyi +jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/AES.pyi +jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/ARC2.pyi +jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/ARC4.pyi +jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/Blowfish.pyi +jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/CAST.pyi +jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/DES.pyi +jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/DES3.pyi +jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/PKCS1_OAEP.pyi +jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/PKCS1_v1_5.pyi +jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/XOR.pyi +jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/__init__.pyi +jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/blockalgo.pyi +jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/HMAC.pyi +jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/MD2.pyi +jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/MD4.pyi +jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/MD5.pyi +jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/RIPEMD.pyi +jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA.pyi +jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA224.pyi +jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA256.pyi +jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA384.pyi +jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA512.pyi +jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/__init__.pyi +jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/hashalgo.pyi +jedi/third_party/typeshed/third_party/2and3/Crypto/Protocol/AllOrNothing.pyi +jedi/third_party/typeshed/third_party/2and3/Crypto/Protocol/Chaffing.pyi +jedi/third_party/typeshed/third_party/2and3/Crypto/Protocol/KDF.pyi +jedi/third_party/typeshed/third_party/2and3/Crypto/Protocol/__init__.pyi +jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/DSA.pyi +jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/ElGamal.pyi +jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/RSA.pyi +jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/__init__.pyi +jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/pubkey.pyi +jedi/third_party/typeshed/third_party/2and3/Crypto/Random/__init__.pyi +jedi/third_party/typeshed/third_party/2and3/Crypto/Random/random.pyi +jedi/third_party/typeshed/third_party/2and3/Crypto/Random/Fortuna/FortunaAccumulator.pyi +jedi/third_party/typeshed/third_party/2and3/Crypto/Random/Fortuna/FortunaGenerator.pyi +jedi/third_party/typeshed/third_party/2and3/Crypto/Random/Fortuna/SHAd256.pyi +jedi/third_party/typeshed/third_party/2and3/Crypto/Random/Fortuna/__init__.pyi +jedi/third_party/typeshed/third_party/2and3/Crypto/Random/OSRNG/__init__.pyi +jedi/third_party/typeshed/third_party/2and3/Crypto/Random/OSRNG/fallback.pyi +jedi/third_party/typeshed/third_party/2and3/Crypto/Random/OSRNG/posix.pyi +jedi/third_party/typeshed/third_party/2and3/Crypto/Random/OSRNG/rng_base.pyi +jedi/third_party/typeshed/third_party/2and3/Crypto/Signature/PKCS1_PSS.pyi +jedi/third_party/typeshed/third_party/2and3/Crypto/Signature/PKCS1_v1_5.pyi +jedi/third_party/typeshed/third_party/2and3/Crypto/Signature/__init__.pyi +jedi/third_party/typeshed/third_party/2and3/Crypto/Util/Counter.pyi +jedi/third_party/typeshed/third_party/2and3/Crypto/Util/RFC1751.pyi +jedi/third_party/typeshed/third_party/2and3/Crypto/Util/__init__.pyi +jedi/third_party/typeshed/third_party/2and3/Crypto/Util/asn1.pyi +jedi/third_party/typeshed/third_party/2and3/Crypto/Util/number.pyi +jedi/third_party/typeshed/third_party/2and3/Crypto/Util/randpool.pyi +jedi/third_party/typeshed/third_party/2and3/Crypto/Util/strxor.pyi +jedi/third_party/typeshed/third_party/2and3/atomicwrites/__init__.pyi +jedi/third_party/typeshed/third_party/2and3/attr/__init__.pyi +jedi/third_party/typeshed/third_party/2and3/attr/converters.pyi +jedi/third_party/typeshed/third_party/2and3/attr/exceptions.pyi +jedi/third_party/typeshed/third_party/2and3/attr/filters.pyi +jedi/third_party/typeshed/third_party/2and3/attr/validators.pyi +jedi/third_party/typeshed/third_party/2and3/backports/__init__.pyi +jedi/third_party/typeshed/third_party/2and3/backports/ssl_match_hostname.pyi +jedi/third_party/typeshed/third_party/2and3/bleach/__init__.pyi +jedi/third_party/typeshed/third_party/2and3/bleach/callbacks.pyi +jedi/third_party/typeshed/third_party/2and3/bleach/linkifier.pyi +jedi/third_party/typeshed/third_party/2and3/bleach/sanitizer.pyi +jedi/third_party/typeshed/third_party/2and3/bleach/utils.pyi +jedi/third_party/typeshed/third_party/2and3/boto/__init__.pyi +jedi/third_party/typeshed/third_party/2and3/boto/auth.pyi +jedi/third_party/typeshed/third_party/2and3/boto/auth_handler.pyi +jedi/third_party/typeshed/third_party/2and3/boto/compat.pyi +jedi/third_party/typeshed/third_party/2and3/boto/connection.pyi +jedi/third_party/typeshed/third_party/2and3/boto/exception.pyi +jedi/third_party/typeshed/third_party/2and3/boto/plugin.pyi +jedi/third_party/typeshed/third_party/2and3/boto/regioninfo.pyi +jedi/third_party/typeshed/third_party/2and3/boto/utils.pyi +jedi/third_party/typeshed/third_party/2and3/boto/ec2/__init__.pyi +jedi/third_party/typeshed/third_party/2and3/boto/elb/__init__.pyi +jedi/third_party/typeshed/third_party/2and3/boto/kms/__init__.pyi +jedi/third_party/typeshed/third_party/2and3/boto/kms/exceptions.pyi +jedi/third_party/typeshed/third_party/2and3/boto/kms/layer1.pyi +jedi/third_party/typeshed/third_party/2and3/boto/s3/__init__.pyi +jedi/third_party/typeshed/third_party/2and3/boto/s3/acl.pyi +jedi/third_party/typeshed/third_party/2and3/boto/s3/bucket.pyi +jedi/third_party/typeshed/third_party/2and3/boto/s3/bucketlistresultset.pyi +jedi/third_party/typeshed/third_party/2and3/boto/s3/bucketlogging.pyi +jedi/third_party/typeshed/third_party/2and3/boto/s3/connection.pyi +jedi/third_party/typeshed/third_party/2and3/boto/s3/cors.pyi +jedi/third_party/typeshed/third_party/2and3/boto/s3/deletemarker.pyi +jedi/third_party/typeshed/third_party/2and3/boto/s3/key.pyi +jedi/third_party/typeshed/third_party/2and3/boto/s3/keyfile.pyi +jedi/third_party/typeshed/third_party/2and3/boto/s3/lifecycle.pyi +jedi/third_party/typeshed/third_party/2and3/boto/s3/multidelete.pyi +jedi/third_party/typeshed/third_party/2and3/boto/s3/multipart.pyi +jedi/third_party/typeshed/third_party/2and3/boto/s3/prefix.pyi +jedi/third_party/typeshed/third_party/2and3/boto/s3/tagging.pyi +jedi/third_party/typeshed/third_party/2and3/boto/s3/user.pyi +jedi/third_party/typeshed/third_party/2and3/boto/s3/website.pyi +jedi/third_party/typeshed/third_party/2and3/characteristic/__init__.pyi +jedi/third_party/typeshed/third_party/2and3/click/__init__.pyi +jedi/third_party/typeshed/third_party/2and3/click/_termui_impl.pyi +jedi/third_party/typeshed/third_party/2and3/click/core.pyi +jedi/third_party/typeshed/third_party/2and3/click/decorators.pyi +jedi/third_party/typeshed/third_party/2and3/click/exceptions.pyi +jedi/third_party/typeshed/third_party/2and3/click/formatting.pyi +jedi/third_party/typeshed/third_party/2and3/click/globals.pyi +jedi/third_party/typeshed/third_party/2and3/click/parser.pyi +jedi/third_party/typeshed/third_party/2and3/click/termui.pyi +jedi/third_party/typeshed/third_party/2and3/click/testing.pyi +jedi/third_party/typeshed/third_party/2and3/click/types.pyi +jedi/third_party/typeshed/third_party/2and3/click/utils.pyi +jedi/third_party/typeshed/third_party/2and3/dateutil/__init__.pyi +jedi/third_party/typeshed/third_party/2and3/dateutil/_common.pyi +jedi/third_party/typeshed/third_party/2and3/dateutil/parser.pyi +jedi/third_party/typeshed/third_party/2and3/dateutil/relativedelta.pyi +jedi/third_party/typeshed/third_party/2and3/dateutil/rrule.pyi +jedi/third_party/typeshed/third_party/2and3/dateutil/utils.pyi +jedi/third_party/typeshed/third_party/2and3/dateutil/tz/__init__.pyi +jedi/third_party/typeshed/third_party/2and3/dateutil/tz/_common.pyi +jedi/third_party/typeshed/third_party/2and3/dateutil/tz/tz.pyi +jedi/third_party/typeshed/third_party/2and3/flask/__init__.pyi +jedi/third_party/typeshed/third_party/2and3/flask/app.pyi +jedi/third_party/typeshed/third_party/2and3/flask/blueprints.pyi +jedi/third_party/typeshed/third_party/2and3/flask/cli.pyi +jedi/third_party/typeshed/third_party/2and3/flask/config.pyi +jedi/third_party/typeshed/third_party/2and3/flask/ctx.pyi +jedi/third_party/typeshed/third_party/2and3/flask/debughelpers.pyi +jedi/third_party/typeshed/third_party/2and3/flask/globals.pyi +jedi/third_party/typeshed/third_party/2and3/flask/helpers.pyi +jedi/third_party/typeshed/third_party/2and3/flask/logging.pyi +jedi/third_party/typeshed/third_party/2and3/flask/sessions.pyi +jedi/third_party/typeshed/third_party/2and3/flask/signals.pyi +jedi/third_party/typeshed/third_party/2and3/flask/templating.pyi +jedi/third_party/typeshed/third_party/2and3/flask/testing.pyi +jedi/third_party/typeshed/third_party/2and3/flask/views.pyi +jedi/third_party/typeshed/third_party/2and3/flask/wrappers.pyi +jedi/third_party/typeshed/third_party/2and3/flask/json/__init__.pyi +jedi/third_party/typeshed/third_party/2and3/flask/json/tag.pyi +jedi/third_party/typeshed/third_party/2and3/google/__init__.pyi +jedi/third_party/typeshed/third_party/2and3/google/protobuf/__init__.pyi +jedi/third_party/typeshed/third_party/2and3/google/protobuf/any_pb2.pyi +jedi/third_party/typeshed/third_party/2and3/google/protobuf/any_test_pb2.pyi +jedi/third_party/typeshed/third_party/2and3/google/protobuf/api_pb2.pyi +jedi/third_party/typeshed/third_party/2and3/google/protobuf/descriptor.pyi +jedi/third_party/typeshed/third_party/2and3/google/protobuf/descriptor_pb2.pyi +jedi/third_party/typeshed/third_party/2and3/google/protobuf/descriptor_pool.pyi +jedi/third_party/typeshed/third_party/2and3/google/protobuf/duration_pb2.pyi +jedi/third_party/typeshed/third_party/2and3/google/protobuf/empty_pb2.pyi +jedi/third_party/typeshed/third_party/2and3/google/protobuf/field_mask_pb2.pyi +jedi/third_party/typeshed/third_party/2and3/google/protobuf/json_format.pyi +jedi/third_party/typeshed/third_party/2and3/google/protobuf/map_proto2_unittest_pb2.pyi +jedi/third_party/typeshed/third_party/2and3/google/protobuf/map_unittest_pb2.pyi +jedi/third_party/typeshed/third_party/2and3/google/protobuf/message.pyi +jedi/third_party/typeshed/third_party/2and3/google/protobuf/message_factory.pyi +jedi/third_party/typeshed/third_party/2and3/google/protobuf/reflection.pyi +jedi/third_party/typeshed/third_party/2and3/google/protobuf/service.pyi +jedi/third_party/typeshed/third_party/2and3/google/protobuf/source_context_pb2.pyi +jedi/third_party/typeshed/third_party/2and3/google/protobuf/struct_pb2.pyi +jedi/third_party/typeshed/third_party/2and3/google/protobuf/symbol_database.pyi +jedi/third_party/typeshed/third_party/2and3/google/protobuf/test_messages_proto2_pb2.pyi +jedi/third_party/typeshed/third_party/2and3/google/protobuf/test_messages_proto3_pb2.pyi +jedi/third_party/typeshed/third_party/2and3/google/protobuf/timestamp_pb2.pyi +jedi/third_party/typeshed/third_party/2and3/google/protobuf/type_pb2.pyi +jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_arena_pb2.pyi +jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_custom_options_pb2.pyi +jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_import_pb2.pyi +jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_import_public_pb2.pyi +jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_mset_pb2.pyi +jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_mset_wire_format_pb2.pyi +jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_no_arena_import_pb2.pyi +jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_no_arena_pb2.pyi +jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_no_generic_services_pb2.pyi +jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_pb2.pyi +jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_proto3_arena_pb2.pyi +jedi/third_party/typeshed/third_party/2and3/google/protobuf/wrappers_pb2.pyi +jedi/third_party/typeshed/third_party/2and3/google/protobuf/compiler/__init__.pyi +jedi/third_party/typeshed/third_party/2and3/google/protobuf/compiler/plugin_pb2.pyi +jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/__init__.pyi +jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/containers.pyi +jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/decoder.pyi +jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/encoder.pyi +jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/enum_type_wrapper.pyi +jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/message_listener.pyi +jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/well_known_types.pyi +jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/wire_format.pyi +jedi/third_party/typeshed/third_party/2and3/google/protobuf/util/__init__.pyi +jedi/third_party/typeshed/third_party/2and3/google/protobuf/util/json_format_proto3_pb2.pyi +jedi/third_party/typeshed/third_party/2and3/jinja2/__init__.pyi +jedi/third_party/typeshed/third_party/2and3/jinja2/_compat.pyi +jedi/third_party/typeshed/third_party/2and3/jinja2/_stringdefs.pyi +jedi/third_party/typeshed/third_party/2and3/jinja2/bccache.pyi +jedi/third_party/typeshed/third_party/2and3/jinja2/compiler.pyi +jedi/third_party/typeshed/third_party/2and3/jinja2/constants.pyi +jedi/third_party/typeshed/third_party/2and3/jinja2/debug.pyi +jedi/third_party/typeshed/third_party/2and3/jinja2/defaults.pyi +jedi/third_party/typeshed/third_party/2and3/jinja2/environment.pyi +jedi/third_party/typeshed/third_party/2and3/jinja2/exceptions.pyi +jedi/third_party/typeshed/third_party/2and3/jinja2/ext.pyi +jedi/third_party/typeshed/third_party/2and3/jinja2/filters.pyi +jedi/third_party/typeshed/third_party/2and3/jinja2/lexer.pyi +jedi/third_party/typeshed/third_party/2and3/jinja2/loaders.pyi +jedi/third_party/typeshed/third_party/2and3/jinja2/meta.pyi +jedi/third_party/typeshed/third_party/2and3/jinja2/nodes.pyi +jedi/third_party/typeshed/third_party/2and3/jinja2/optimizer.pyi +jedi/third_party/typeshed/third_party/2and3/jinja2/parser.pyi +jedi/third_party/typeshed/third_party/2and3/jinja2/runtime.pyi +jedi/third_party/typeshed/third_party/2and3/jinja2/sandbox.pyi +jedi/third_party/typeshed/third_party/2and3/jinja2/tests.pyi +jedi/third_party/typeshed/third_party/2and3/jinja2/utils.pyi +jedi/third_party/typeshed/third_party/2and3/jinja2/visitor.pyi +jedi/third_party/typeshed/third_party/2and3/markupsafe/__init__.pyi +jedi/third_party/typeshed/third_party/2and3/markupsafe/_compat.pyi +jedi/third_party/typeshed/third_party/2and3/markupsafe/_constants.pyi +jedi/third_party/typeshed/third_party/2and3/markupsafe/_native.pyi +jedi/third_party/typeshed/third_party/2and3/markupsafe/_speedups.pyi +jedi/third_party/typeshed/third_party/2and3/pymysql/__init__.pyi +jedi/third_party/typeshed/third_party/2and3/pymysql/charset.pyi +jedi/third_party/typeshed/third_party/2and3/pymysql/connections.pyi +jedi/third_party/typeshed/third_party/2and3/pymysql/converters.pyi +jedi/third_party/typeshed/third_party/2and3/pymysql/cursors.pyi +jedi/third_party/typeshed/third_party/2and3/pymysql/err.pyi +jedi/third_party/typeshed/third_party/2and3/pymysql/times.pyi +jedi/third_party/typeshed/third_party/2and3/pymysql/util.pyi +jedi/third_party/typeshed/third_party/2and3/pymysql/constants/CLIENT.pyi +jedi/third_party/typeshed/third_party/2and3/pymysql/constants/COMMAND.pyi +jedi/third_party/typeshed/third_party/2and3/pymysql/constants/ER.pyi +jedi/third_party/typeshed/third_party/2and3/pymysql/constants/FIELD_TYPE.pyi +jedi/third_party/typeshed/third_party/2and3/pymysql/constants/FLAG.pyi +jedi/third_party/typeshed/third_party/2and3/pymysql/constants/SERVER_STATUS.pyi +jedi/third_party/typeshed/third_party/2and3/pymysql/constants/__init__.pyi +jedi/third_party/typeshed/third_party/2and3/pynamodb/__init__.pyi +jedi/third_party/typeshed/third_party/2and3/pynamodb/attributes.pyi +jedi/third_party/typeshed/third_party/2and3/pynamodb/constants.pyi +jedi/third_party/typeshed/third_party/2and3/pynamodb/exceptions.pyi +jedi/third_party/typeshed/third_party/2and3/pynamodb/indexes.pyi +jedi/third_party/typeshed/third_party/2and3/pynamodb/models.pyi +jedi/third_party/typeshed/third_party/2and3/pynamodb/settings.pyi +jedi/third_party/typeshed/third_party/2and3/pynamodb/throttle.pyi +jedi/third_party/typeshed/third_party/2and3/pynamodb/types.pyi +jedi/third_party/typeshed/third_party/2and3/pynamodb/connection/__init__.pyi +jedi/third_party/typeshed/third_party/2and3/pynamodb/connection/base.pyi +jedi/third_party/typeshed/third_party/2and3/pynamodb/connection/table.pyi +jedi/third_party/typeshed/third_party/2and3/pynamodb/connection/util.pyi +jedi/third_party/typeshed/third_party/2and3/pytz/__init__.pyi +jedi/third_party/typeshed/third_party/2and3/requests/__init__.pyi +jedi/third_party/typeshed/third_party/2and3/requests/adapters.pyi +jedi/third_party/typeshed/third_party/2and3/requests/api.pyi +jedi/third_party/typeshed/third_party/2and3/requests/auth.pyi +jedi/third_party/typeshed/third_party/2and3/requests/compat.pyi +jedi/third_party/typeshed/third_party/2and3/requests/cookies.pyi +jedi/third_party/typeshed/third_party/2and3/requests/exceptions.pyi +jedi/third_party/typeshed/third_party/2and3/requests/hooks.pyi +jedi/third_party/typeshed/third_party/2and3/requests/models.pyi +jedi/third_party/typeshed/third_party/2and3/requests/sessions.pyi +jedi/third_party/typeshed/third_party/2and3/requests/status_codes.pyi +jedi/third_party/typeshed/third_party/2and3/requests/structures.pyi +jedi/third_party/typeshed/third_party/2and3/requests/utils.pyi +jedi/third_party/typeshed/third_party/2and3/requests/packages/__init__.pyi +jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/__init__.pyi +jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/_collections.pyi +jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/connection.pyi +jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/connectionpool.pyi +jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/exceptions.pyi +jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/fields.pyi +jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/filepost.pyi +jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/poolmanager.pyi +jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/request.pyi +jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/response.pyi +jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/contrib/__init__.pyi +jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/packages/__init__.pyi +jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/packages/ssl_match_hostname/__init__.pyi +jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.pyi +jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/__init__.pyi +jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/connection.pyi +jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/request.pyi +jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/response.pyi +jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/retry.pyi +jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/ssl_.pyi +jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/timeout.pyi +jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/url.pyi +jedi/third_party/typeshed/third_party/2and3/simplejson/__init__.pyi +jedi/third_party/typeshed/third_party/2and3/simplejson/decoder.pyi +jedi/third_party/typeshed/third_party/2and3/simplejson/encoder.pyi +jedi/third_party/typeshed/third_party/2and3/simplejson/scanner.pyi +jedi/third_party/typeshed/third_party/2and3/werkzeug/__init__.pyi +jedi/third_party/typeshed/third_party/2and3/werkzeug/_compat.pyi +jedi/third_party/typeshed/third_party/2and3/werkzeug/_internal.pyi +jedi/third_party/typeshed/third_party/2and3/werkzeug/_reloader.pyi +jedi/third_party/typeshed/third_party/2and3/werkzeug/datastructures.pyi +jedi/third_party/typeshed/third_party/2and3/werkzeug/exceptions.pyi +jedi/third_party/typeshed/third_party/2and3/werkzeug/filesystem.pyi +jedi/third_party/typeshed/third_party/2and3/werkzeug/formparser.pyi +jedi/third_party/typeshed/third_party/2and3/werkzeug/http.pyi +jedi/third_party/typeshed/third_party/2and3/werkzeug/local.pyi +jedi/third_party/typeshed/third_party/2and3/werkzeug/posixemulation.pyi +jedi/third_party/typeshed/third_party/2and3/werkzeug/routing.pyi +jedi/third_party/typeshed/third_party/2and3/werkzeug/script.pyi +jedi/third_party/typeshed/third_party/2and3/werkzeug/security.pyi +jedi/third_party/typeshed/third_party/2and3/werkzeug/serving.pyi +jedi/third_party/typeshed/third_party/2and3/werkzeug/test.pyi +jedi/third_party/typeshed/third_party/2and3/werkzeug/testapp.pyi +jedi/third_party/typeshed/third_party/2and3/werkzeug/urls.pyi +jedi/third_party/typeshed/third_party/2and3/werkzeug/useragents.pyi +jedi/third_party/typeshed/third_party/2and3/werkzeug/utils.pyi +jedi/third_party/typeshed/third_party/2and3/werkzeug/wrappers.pyi +jedi/third_party/typeshed/third_party/2and3/werkzeug/wsgi.pyi +jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/__init__.pyi +jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/atom.pyi +jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/cache.pyi +jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/fixers.pyi +jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/iterio.pyi +jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/jsrouting.pyi +jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/limiter.pyi +jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/lint.pyi +jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/profiler.pyi +jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/securecookie.pyi +jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/sessions.pyi +jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/testtools.pyi +jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/wrappers.pyi +jedi/third_party/typeshed/third_party/2and3/werkzeug/debug/__init__.pyi +jedi/third_party/typeshed/third_party/2and3/werkzeug/debug/console.pyi +jedi/third_party/typeshed/third_party/2and3/werkzeug/debug/repr.pyi +jedi/third_party/typeshed/third_party/2and3/werkzeug/debug/tbtools.pyi +jedi/third_party/typeshed/third_party/2and3/yaml/__init__.pyi +jedi/third_party/typeshed/third_party/2and3/yaml/composer.pyi +jedi/third_party/typeshed/third_party/2and3/yaml/constructor.pyi +jedi/third_party/typeshed/third_party/2and3/yaml/cyaml.pyi +jedi/third_party/typeshed/third_party/2and3/yaml/dumper.pyi +jedi/third_party/typeshed/third_party/2and3/yaml/emitter.pyi +jedi/third_party/typeshed/third_party/2and3/yaml/error.pyi +jedi/third_party/typeshed/third_party/2and3/yaml/events.pyi +jedi/third_party/typeshed/third_party/2and3/yaml/loader.pyi +jedi/third_party/typeshed/third_party/2and3/yaml/nodes.pyi +jedi/third_party/typeshed/third_party/2and3/yaml/parser.pyi +jedi/third_party/typeshed/third_party/2and3/yaml/reader.pyi +jedi/third_party/typeshed/third_party/2and3/yaml/representer.pyi +jedi/third_party/typeshed/third_party/2and3/yaml/resolver.pyi +jedi/third_party/typeshed/third_party/2and3/yaml/scanner.pyi +jedi/third_party/typeshed/third_party/2and3/yaml/serializer.pyi +jedi/third_party/typeshed/third_party/2and3/yaml/tokens.pyi +jedi/third_party/typeshed/third_party/3/dataclasses.pyi +jedi/third_party/typeshed/third_party/3/orjson.pyi +jedi/third_party/typeshed/third_party/3.5/contextvars.pyi +jedi/third_party/typeshed/third_party/3/docutils/__init__.pyi +jedi/third_party/typeshed/third_party/3/docutils/examples.pyi +jedi/third_party/typeshed/third_party/3/docutils/nodes.pyi +jedi/third_party/typeshed/third_party/3/docutils/parsers/__init__.pyi +jedi/third_party/typeshed/third_party/3/docutils/parsers/rst/__init__.pyi +jedi/third_party/typeshed/third_party/3/docutils/parsers/rst/nodes.pyi +jedi/third_party/typeshed/third_party/3/docutils/parsers/rst/roles.pyi +jedi/third_party/typeshed/third_party/3/docutils/parsers/rst/states.pyi +jedi/third_party/typeshed/third_party/3/jwt/__init__.pyi +jedi/third_party/typeshed/third_party/3/jwt/algorithms.pyi +jedi/third_party/typeshed/third_party/3/jwt/contrib/__init__.pyi +jedi/third_party/typeshed/third_party/3/jwt/contrib/algorithms/__init__.pyi +jedi/third_party/typeshed/third_party/3/jwt/contrib/algorithms/py_ecdsa.pyi +jedi/third_party/typeshed/third_party/3/jwt/contrib/algorithms/pycrypto.pyi +jedi/third_party/typeshed/third_party/3/pkg_resources/__init__.pyi +jedi/third_party/typeshed/third_party/3/pkg_resources/py31compat.pyi +jedi/third_party/typeshed/third_party/3/six/__init__.pyi +jedi/third_party/typeshed/third_party/3/six/moves/BaseHTTPServer.pyi +jedi/third_party/typeshed/third_party/3/six/moves/CGIHTTPServer.pyi +jedi/third_party/typeshed/third_party/3/six/moves/SimpleHTTPServer.pyi +jedi/third_party/typeshed/third_party/3/six/moves/__init__.pyi +jedi/third_party/typeshed/third_party/3/six/moves/_dummy_thread.pyi +jedi/third_party/typeshed/third_party/3/six/moves/_thread.pyi +jedi/third_party/typeshed/third_party/3/six/moves/builtins.pyi +jedi/third_party/typeshed/third_party/3/six/moves/cPickle.pyi +jedi/third_party/typeshed/third_party/3/six/moves/configparser.pyi +jedi/third_party/typeshed/third_party/3/six/moves/email_mime_base.pyi +jedi/third_party/typeshed/third_party/3/six/moves/email_mime_multipart.pyi +jedi/third_party/typeshed/third_party/3/six/moves/email_mime_nonmultipart.pyi +jedi/third_party/typeshed/third_party/3/six/moves/email_mime_text.pyi +jedi/third_party/typeshed/third_party/3/six/moves/html_entities.pyi +jedi/third_party/typeshed/third_party/3/six/moves/html_parser.pyi +jedi/third_party/typeshed/third_party/3/six/moves/http_client.pyi +jedi/third_party/typeshed/third_party/3/six/moves/http_cookiejar.pyi +jedi/third_party/typeshed/third_party/3/six/moves/http_cookies.pyi +jedi/third_party/typeshed/third_party/3/six/moves/queue.pyi +jedi/third_party/typeshed/third_party/3/six/moves/reprlib.pyi +jedi/third_party/typeshed/third_party/3/six/moves/socketserver.pyi +jedi/third_party/typeshed/third_party/3/six/moves/tkinter.pyi +jedi/third_party/typeshed/third_party/3/six/moves/tkinter_commondialog.pyi +jedi/third_party/typeshed/third_party/3/six/moves/tkinter_constants.pyi +jedi/third_party/typeshed/third_party/3/six/moves/tkinter_dialog.pyi +jedi/third_party/typeshed/third_party/3/six/moves/tkinter_filedialog.pyi +jedi/third_party/typeshed/third_party/3/six/moves/tkinter_tkfiledialog.pyi +jedi/third_party/typeshed/third_party/3/six/moves/tkinter_ttk.pyi +jedi/third_party/typeshed/third_party/3/six/moves/urllib_error.pyi +jedi/third_party/typeshed/third_party/3/six/moves/urllib_parse.pyi +jedi/third_party/typeshed/third_party/3/six/moves/urllib_request.pyi +jedi/third_party/typeshed/third_party/3/six/moves/urllib_response.pyi +jedi/third_party/typeshed/third_party/3/six/moves/urllib_robotparser.pyi +jedi/third_party/typeshed/third_party/3/six/moves/urllib/__init__.pyi +jedi/third_party/typeshed/third_party/3/six/moves/urllib/error.pyi +jedi/third_party/typeshed/third_party/3/six/moves/urllib/parse.pyi +jedi/third_party/typeshed/third_party/3/six/moves/urllib/request.pyi +jedi/third_party/typeshed/third_party/3/six/moves/urllib/response.pyi +jedi/third_party/typeshed/third_party/3/six/moves/urllib/robotparser.pyi +jedi/third_party/typeshed/third_party/3/typed_ast/__init__.pyi +jedi/third_party/typeshed/third_party/3/typed_ast/ast27.pyi +jedi/third_party/typeshed/third_party/3/typed_ast/ast3.pyi +jedi/third_party/typeshed/third_party/3/typed_ast/conversions.pyi +test/__init__.py +test/blabla_test_documentation.py +test/conftest.py +test/helpers.py +test/refactor.py +test/run.py +test/test_cache.py +test/test_compatibility.py +test/test_debug.py +test/test_integration.py +test/test_settings.py +test/test_speed.py +test/test_utils.py +test/completion/__init__.py +test/completion/arrays.py +test/completion/async_.py +test/completion/basic.py +test/completion/classes.py +test/completion/completion.py +test/completion/complex.py +test/completion/comprehensions.py +test/completion/context.py +test/completion/decorators.py +test/completion/definition.py +test/completion/descriptors.py +test/completion/docstring.py +test/completion/dynamic_arrays.py +test/completion/dynamic_params.py +test/completion/flow_analysis.py +test/completion/fstring.py +test/completion/functions.py +test/completion/generators.py +test/completion/goto.py +test/completion/imports.py +test/completion/invalid.py +test/completion/isinstance.py +test/completion/keywords.py +test/completion/lambdas.py +test/completion/named_expression.py +test/completion/named_param.py +test/completion/on_import.py +test/completion/ordering.py +test/completion/parser.py +test/completion/pep0484_basic.py +test/completion/pep0484_comments.py +test/completion/pep0484_typing.py +test/completion/pep0526_variables.py +test/completion/positional_only_params.py +test/completion/precedence.py +test/completion/recursion.py +test/completion/stdlib.py +test/completion/stubs.py +test/completion/sys_path.py +test/completion/types.py +test/completion/usages.py +test/completion/import_tree/__init__.py +test/completion/import_tree/classes.py +test/completion/import_tree/flow_import.py +test/completion/import_tree/invisible_pkg.py +test/completion/import_tree/mod1.py +test/completion/import_tree/mod2.py +test/completion/import_tree/random.py +test/completion/import_tree/recurse_class1.py +test/completion/import_tree/recurse_class2.py +test/completion/import_tree/rename1.py +test/completion/import_tree/rename2.py +test/completion/import_tree/pkg/__init__.py +test/completion/import_tree/pkg/mod1.py +test/completion/stub_folder/stub_only.pyi +test/completion/stub_folder/with_stub.py +test/completion/stub_folder/with_stub.pyi +test/completion/stub_folder/stub_only_folder/__init__.pyi +test/completion/stub_folder/stub_only_folder/nested_stub_only.pyi +test/completion/stub_folder/stub_only_folder/nested_with_stub.py +test/completion/stub_folder/stub_only_folder/nested_with_stub.pyi +test/completion/stub_folder/stub_only_folder/python_only.py +test/completion/stub_folder/with_stub_folder/__init__.py +test/completion/stub_folder/with_stub_folder/__init__.pyi +test/completion/stub_folder/with_stub_folder/nested_stub_only.pyi +test/completion/stub_folder/with_stub_folder/nested_with_stub.py +test/completion/stub_folder/with_stub_folder/nested_with_stub.pyi +test/completion/stub_folder/with_stub_folder/python_only.py +test/completion/thirdparty/PyQt4_.py +test/completion/thirdparty/django_.py +test/completion/thirdparty/jedi_.py +test/completion/thirdparty/psycopg2_.py +test/completion/thirdparty/pylab_.py +test/examples/README.rst +test/examples/buildout_project/buildout.cfg +test/examples/buildout_project/bin/app +test/examples/buildout_project/bin/binary_file +test/examples/buildout_project/bin/empty_file +test/examples/buildout_project/src/proj_name/module_name.py +test/examples/django/manage.py +test/examples/django/app/__init__.py +test/examples/django/app/models.py +test/examples/issue1209/__init__.py +test/examples/issue1209/api/__init__.py +test/examples/issue1209/api/whatever/__init__.py +test/examples/issue1209/api/whatever/api_test1.py +test/examples/issue1209/whatever/__init__.py +test/examples/issue1209/whatever/test.py +test/examples/namespace_package_relative_import/rel1.py +test/examples/namespace_package_relative_import/rel2.py +test/examples/stub_packages/no_python-stubs/__init__.pyi +test/examples/stub_packages/with_python/__init__.py +test/examples/stub_packages/with_python/module.py +test/examples/stub_packages/with_python-stubs/__init__.pyi +test/examples/stub_packages/with_python-stubs/module.pyi +test/refactor/extract.py +test/refactor/inline.py +test/refactor/rename.py +test/speed/precedence.py +test/static_analysis/attribute_error.py +test/static_analysis/attribute_warnings.py +test/static_analysis/branches.py +test/static_analysis/builtins.py +test/static_analysis/class_simple.py +test/static_analysis/comprehensions.py +test/static_analysis/descriptors.py +test/static_analysis/generators.py +test/static_analysis/imports.py +test/static_analysis/iterable.py +test/static_analysis/keywords.py +test/static_analysis/normal_arguments.py +test/static_analysis/operations.py +test/static_analysis/python2.py +test/static_analysis/star_arguments.py +test/static_analysis/try_except.py +test/static_analysis/import_tree/__init__.py +test/static_analysis/import_tree/a.py +test/static_analysis/import_tree/b.py +test/test_api/__init__.py +test/test_api/test_analysis.py +test/test_api/test_api.py +test/test_api/test_api_classes_follow_definition.py +test/test_api/test_call_signatures.py +test/test_api/test_classes.py +test/test_api/test_completion.py +test/test_api/test_defined_names.py +test/test_api/test_environment.py +test/test_api/test_full_name.py +test/test_api/test_interpreter.py +test/test_api/test_keyword.py +test/test_api/test_project.py +test/test_api/test_settings.py +test/test_api/test_signatures.py +test/test_api/test_unicode.py +test/test_api/test_usages.py +test/test_api/import_tree_for_usages/__init__.py +test/test_api/import_tree_for_usages/a.py +test/test_api/import_tree_for_usages/b.py +test/test_api/simple_import/__init__.py +test/test_api/simple_import/module.py +test/test_api/simple_import/module2.py +test/test_evaluate/__init__.py +test/test_evaluate/test_absolute_import.py +test/test_evaluate/test_annotations.py +test/test_evaluate/test_buildout_detection.py +test/test_evaluate/test_compiled.py +test/test_evaluate/test_context.py +test/test_evaluate/test_docstring.py +test/test_evaluate/test_extension.py +test/test_evaluate/test_fstring.py +test/test_evaluate/test_helpers.py +test/test_evaluate/test_implicit_namespace_package.py +test/test_evaluate/test_imports.py +test/test_evaluate/test_literals.py +test/test_evaluate/test_mixed.py +test/test_evaluate/test_namespace_package.py +test/test_evaluate/test_precedence.py +test/test_evaluate/test_pyc.py +test/test_evaluate/test_representation.py +test/test_evaluate/test_signature.py +test/test_evaluate/test_stdlib.py +test/test_evaluate/test_sys_path.py +test/test_evaluate/absolute_import/local_module.py +test/test_evaluate/absolute_import/unittest.py +test/test_evaluate/flask-site-packages/flask_foo.py +test/test_evaluate/flask-site-packages/flask/__init__.py +test/test_evaluate/flask-site-packages/flask/ext/__init__.py +test/test_evaluate/flask-site-packages/flask_baz/__init__.py +test/test_evaluate/flask-site-packages/flaskext/__init__.py +test/test_evaluate/flask-site-packages/flaskext/bar.py +test/test_evaluate/flask-site-packages/flaskext/moo/__init__.py +test/test_evaluate/implicit_namespace_package/ns1/pkg/ns1_file.py +test/test_evaluate/implicit_namespace_package/ns2/pkg/ns2_file.py +test/test_evaluate/implicit_nested_namespaces/namespace/pkg/module.py +test/test_evaluate/init_extension_module/__init__.cpython-34m.so +test/test_evaluate/init_extension_module/module.c +test/test_evaluate/init_extension_module/setup.py +test/test_evaluate/namespace_package/ns1/pkg/__init__.py +test/test_evaluate/namespace_package/ns1/pkg/ns1_file.py +test/test_evaluate/namespace_package/ns1/pkg/ns1_folder/__init__.py +test/test_evaluate/namespace_package/ns2/pkg/ns2_file.py +test/test_evaluate/namespace_package/ns2/pkg/ns2_folder/__init__.py +test/test_evaluate/namespace_package/ns2/pkg/ns2_folder/nested/__init__.py +test/test_evaluate/nested_namespaces/__init__.py +test/test_evaluate/nested_namespaces/namespace/__init__.py +test/test_evaluate/nested_namespaces/namespace/pkg/__init__.py +test/test_evaluate/not_in_sys_path/__init__.py +test/test_evaluate/not_in_sys_path/not_in_sys_path.py +test/test_evaluate/not_in_sys_path/not_in_sys_path_package/__init__.py +test/test_evaluate/not_in_sys_path/not_in_sys_path_package/module.py +test/test_evaluate/not_in_sys_path/pkg/__init__.py +test/test_evaluate/not_in_sys_path/pkg/module.py +test/test_evaluate/sample_venvs/pth_directory/egg_link.egg-link +test/test_evaluate/sample_venvs/pth_directory/foo.pth +test/test_evaluate/sample_venvs/pth_directory/import_smth.pth +test/test_evaluate/sample_venvs/pth_directory/relative.egg-link +test/test_evaluate/sample_venvs/pth_directory/smth.py +test/test_evaluate/sample_venvs/pth_directory/dir-from-foo-pth/__init__.py +test/test_evaluate/test_gradual/test_stub_loading.py +test/test_evaluate/test_gradual/test_stubs.py +test/test_evaluate/test_gradual/test_typeshed.py +test/test_evaluate/zipped_imports/not_pkg.zip +test/test_evaluate/zipped_imports/pkg.zip +test/test_parso_integration/test_basic.py +test/test_parso_integration/test_error_correction.py +test/test_parso_integration/test_parser_utils.py \ No newline at end of file diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi.egg-info/dependency_links.txt b/vim/bundle/jedi-vim/pythonx/jedi/jedi.egg-info/dependency_links.txt new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi.egg-info/dependency_links.txt @@ -0,0 +1 @@ + diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi.egg-info/requires.txt b/vim/bundle/jedi-vim/pythonx/jedi/jedi.egg-info/requires.txt new file mode 100644 index 0000000..ccf5255 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi.egg-info/requires.txt @@ -0,0 +1,6 @@ +parso>=0.5.0 + +[testing] +pytest<5.0.0,>=3.1.0 +docopt +colorama diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi.egg-info/top_level.txt b/vim/bundle/jedi-vim/pythonx/jedi/jedi.egg-info/top_level.txt new file mode 100644 index 0000000..86c1cb1 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi.egg-info/top_level.txt @@ -0,0 +1 @@ +jedi diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/__init__.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/__init__.py new file mode 100644 index 0000000..28cb035 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/__init__.py @@ -0,0 +1,47 @@ +""" +Jedi is a static analysis tool for Python that can be used in IDEs/editors. +Jedi has a focus on autocompletion and goto functionality. Jedi is fast and is +very well tested. It understands Python and stubs on a deep level. + +Jedi has support for different goto functions. It's possible to search for +usages and list names in a Python file to get information about them. + +Jedi uses a very simple API to connect with IDE's. There's a reference +implementation as a `VIM-Plugin `_, +which uses Jedi's autocompletion. We encourage you to use Jedi in your IDEs. +Autocompletion in your REPL is also possible, IPython uses it natively and for +the CPython REPL you have to install it. + +Here's a simple example of the autocompletion feature: + +>>> import jedi +>>> source = ''' +... import json +... json.lo''' +>>> script = jedi.Script(source, 3, len('json.lo'), 'example.py') +>>> script + +>>> completions = script.completions() +>>> completions +[, ] +>>> print(completions[0].complete) +ad +>>> print(completions[0].name) +load + +As you see Jedi is pretty simple and allows you to concentrate on writing a +good text editor, while still having very good IDE features for Python. +""" + +__version__ = '0.15.1' + +from jedi.api import Script, Interpreter, set_debug_function, \ + preload_module, names +from jedi import settings +from jedi.api.environment import find_virtualenvs, find_system_environments, \ + get_default_environment, InvalidPythonEnvironment, create_environment, \ + get_system_environment +from jedi.api.exceptions import InternalError +# Finally load the internal plugins. This is only internal. +from jedi.plugins import registry +del registry diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/__main__.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/__main__.py new file mode 100644 index 0000000..f2ee047 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/__main__.py @@ -0,0 +1,48 @@ +import sys +from os.path import join, dirname, abspath, isdir + + +def _start_linter(): + """ + This is a pre-alpha API. You're not supposed to use it at all, except for + testing. It will very likely change. + """ + import jedi + + if '--debug' in sys.argv: + jedi.set_debug_function() + + for path in sys.argv[2:]: + if path.startswith('--'): + continue + if isdir(path): + import fnmatch + import os + + paths = [] + for root, dirnames, filenames in os.walk(path): + for filename in fnmatch.filter(filenames, '*.py'): + paths.append(os.path.join(root, filename)) + else: + paths = [path] + + try: + for path in paths: + for error in jedi.Script(path=path)._analysis(): + print(error) + except Exception: + if '--pdb' in sys.argv: + import traceback + traceback.print_exc() + import pdb + pdb.post_mortem() + else: + raise + + +if len(sys.argv) == 2 and sys.argv[1] == 'repl': + # don't want to use __main__ only for repl yet, maybe we want to use it for + # something else. So just use the keyword ``repl`` for now. + print(join(dirname(abspath(__file__)), 'api', 'replstartup.py')) +elif len(sys.argv) > 1 and sys.argv[1] == 'linter': + _start_linter() diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/_compatibility.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/_compatibility.py new file mode 100644 index 0000000..28e23b0 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/_compatibility.py @@ -0,0 +1,665 @@ +""" +To ensure compatibility from Python ``2.7`` - ``3.x``, a module has been +created. Clearly there is huge need to use conforming syntax. +""" +from __future__ import print_function +import atexit +import errno +import functools +import sys +import os +import re +import pkgutil +import warnings +import inspect +import subprocess +import weakref +try: + import importlib +except ImportError: + pass +from zipimport import zipimporter + +from jedi.file_io import KnownContentFileIO, ZipFileIO + +is_py3 = sys.version_info[0] >= 3 +is_py35 = is_py3 and sys.version_info[1] >= 5 +py_version = int(str(sys.version_info[0]) + str(sys.version_info[1])) + + +class DummyFile(object): + def __init__(self, loader, string): + self.loader = loader + self.string = string + + def read(self): + return self.loader.get_source(self.string) + + def close(self): + del self.loader + + +def find_module_py34(string, path=None, full_name=None, is_global_search=True): + spec = None + loader = None + + for finder in sys.meta_path: + if is_global_search and finder != importlib.machinery.PathFinder: + p = None + else: + p = path + try: + find_spec = finder.find_spec + except AttributeError: + # These are old-school clases that still have a different API, just + # ignore those. + continue + + spec = find_spec(string, p) + if spec is not None: + loader = spec.loader + if loader is None and not spec.has_location: + # This is a namespace package. + full_name = string if not path else full_name + implicit_ns_info = ImplicitNSInfo(full_name, spec.submodule_search_locations._path) + return implicit_ns_info, True + break + + return find_module_py33(string, path, loader) + + +def find_module_py33(string, path=None, loader=None, full_name=None, is_global_search=True): + loader = loader or importlib.machinery.PathFinder.find_module(string, path) + + if loader is None and path is None: # Fallback to find builtins + try: + with warnings.catch_warnings(record=True): + # Mute "DeprecationWarning: Use importlib.util.find_spec() + # instead." While we should replace that in the future, it's + # probably good to wait until we deprecate Python 3.3, since + # it was added in Python 3.4 and find_loader hasn't been + # removed in 3.6. + loader = importlib.find_loader(string) + except ValueError as e: + # See #491. Importlib might raise a ValueError, to avoid this, we + # just raise an ImportError to fix the issue. + raise ImportError("Originally " + repr(e)) + + if loader is None: + raise ImportError("Couldn't find a loader for {}".format(string)) + + return _from_loader(loader, string) + + +def _from_loader(loader, string): + is_package = loader.is_package(string) + try: + get_filename = loader.get_filename + except AttributeError: + return None, is_package + else: + module_path = cast_path(get_filename(string)) + + # To avoid unicode and read bytes, "overwrite" loader.get_source if + # possible. + f = type(loader).get_source + if is_py3 and f is not importlib.machinery.SourceFileLoader.get_source: + # Unfortunately we are reading unicode here, not bytes. + # It seems hard to get bytes, because the zip importer + # logic just unpacks the zip file and returns a file descriptor + # that we cannot as easily access. Therefore we just read it as + # a string in the cases where get_source was overwritten. + code = loader.get_source(string) + else: + code = _get_source(loader, string) + + if code is None: + return None, is_package + if isinstance(loader, zipimporter): + return ZipFileIO(module_path, code, cast_path(loader.archive)), is_package + + return KnownContentFileIO(module_path, code), is_package + + +def _get_source(loader, fullname): + """ + This method is here as a replacement for SourceLoader.get_source. That + method returns unicode, but we prefer bytes. + """ + path = loader.get_filename(fullname) + try: + return loader.get_data(path) + except OSError: + raise ImportError('source not available through get_data()', + name=fullname) + + +def find_module_pre_py3(string, path=None, full_name=None, is_global_search=True): + # This import is here, because in other places it will raise a + # DeprecationWarning. + import imp + try: + module_file, module_path, description = imp.find_module(string, path) + module_type = description[2] + is_package = module_type is imp.PKG_DIRECTORY + if is_package: + # In Python 2 directory package imports are returned as folder + # paths, not __init__.py paths. + p = os.path.join(module_path, '__init__.py') + try: + module_file = open(p) + module_path = p + except FileNotFoundError: + pass + elif module_type != imp.PY_SOURCE: + if module_file is not None: + module_file.close() + module_file = None + + if module_file is None: + code = None + return None, is_package + + with module_file: + code = module_file.read() + return KnownContentFileIO(cast_path(module_path), code), is_package + except ImportError: + pass + + if path is None: + path = sys.path + for item in path: + loader = pkgutil.get_importer(item) + if loader: + loader = loader.find_module(string) + if loader is not None: + return _from_loader(loader, string) + raise ImportError("No module named {}".format(string)) + + +find_module = find_module_py34 if is_py3 else find_module_pre_py3 +find_module.__doc__ = """ +Provides information about a module. + +This function isolates the differences in importing libraries introduced with +python 3.3 on; it gets a module name and optionally a path. It will return a +tuple containin an open file for the module (if not builtin), the filename +or the name of the module if it is a builtin one and a boolean indicating +if the module is contained in a package. +""" + + +def _iter_modules(paths, prefix=''): + # Copy of pkgutil.iter_modules adapted to work with namespaces + + for path in paths: + importer = pkgutil.get_importer(path) + + if not isinstance(importer, importlib.machinery.FileFinder): + # We're only modifying the case for FileFinder. All the other cases + # still need to be checked (like zip-importing). Do this by just + # calling the pkgutil version. + for mod_info in pkgutil.iter_modules([path], prefix): + yield mod_info + continue + + # START COPY OF pkutils._iter_file_finder_modules. + if importer.path is None or not os.path.isdir(importer.path): + return + + yielded = {} + + try: + filenames = os.listdir(importer.path) + except OSError: + # ignore unreadable directories like import does + filenames = [] + filenames.sort() # handle packages before same-named modules + + for fn in filenames: + modname = inspect.getmodulename(fn) + if modname == '__init__' or modname in yielded: + continue + + # jedi addition: Avoid traversing special directories + if fn.startswith('.') or fn == '__pycache__': + continue + + path = os.path.join(importer.path, fn) + ispkg = False + + if not modname and os.path.isdir(path) and '.' not in fn: + modname = fn + # A few jedi modifications: Don't check if there's an + # __init__.py + try: + os.listdir(path) + except OSError: + # ignore unreadable directories like import does + continue + ispkg = True + + if modname and '.' not in modname: + yielded[modname] = 1 + yield importer, prefix + modname, ispkg + # END COPY + + +iter_modules = _iter_modules if py_version >= 34 else pkgutil.iter_modules + + +class ImplicitNSInfo(object): + """Stores information returned from an implicit namespace spec""" + def __init__(self, name, paths): + self.name = name + self.paths = paths + + +if is_py3: + all_suffixes = importlib.machinery.all_suffixes +else: + def all_suffixes(): + # Is deprecated and raises a warning in Python 3.6. + import imp + return [suffix for suffix, _, _ in imp.get_suffixes()] + + +# unicode function +try: + unicode = unicode +except NameError: + unicode = str + + +# re-raise function +if is_py3: + def reraise(exception, traceback): + raise exception.with_traceback(traceback) +else: + eval(compile(""" +def reraise(exception, traceback): + raise exception, None, traceback +""", 'blub', 'exec')) + +reraise.__doc__ = """ +Re-raise `exception` with a `traceback` object. + +Usage:: + + reraise(Exception, sys.exc_info()[2]) + +""" + + +def use_metaclass(meta, *bases): + """ Create a class with a metaclass. """ + if not bases: + bases = (object,) + return meta("Py2CompatibilityMetaClass", bases, {}) + + +try: + encoding = sys.stdout.encoding + if encoding is None: + encoding = 'utf-8' +except AttributeError: + encoding = 'ascii' + + +def u(string, errors='strict'): + """Cast to unicode DAMMIT! + Written because Python2 repr always implicitly casts to a string, so we + have to cast back to a unicode (and we now that we always deal with valid + unicode, because we check that in the beginning). + """ + if isinstance(string, bytes): + return unicode(string, encoding='UTF-8', errors=errors) + return string + + +def cast_path(obj): + """ + Take a bytes or str path and cast it to unicode. + + Apparently it is perfectly fine to pass both byte and unicode objects into + the sys.path. This probably means that byte paths are normal at other + places as well. + + Since this just really complicates everything and Python 2.7 will be EOL + soon anyway, just go with always strings. + """ + return u(obj, errors='replace') + + +def force_unicode(obj): + # Intentionally don't mix those two up, because those two code paths might + # be different in the future (maybe windows?). + return cast_path(obj) + + +try: + import builtins # module name in python 3 +except ImportError: + import __builtin__ as builtins # noqa: F401 + + +import ast # noqa: F401 + + +def literal_eval(string): + return ast.literal_eval(string) + + +try: + from itertools import zip_longest +except ImportError: + from itertools import izip_longest as zip_longest # Python 2 # noqa: F401 + +try: + FileNotFoundError = FileNotFoundError +except NameError: + FileNotFoundError = IOError + +try: + IsADirectoryError = IsADirectoryError +except NameError: + IsADirectoryError = IOError + +try: + PermissionError = PermissionError +except NameError: + PermissionError = IOError + + +def no_unicode_pprint(dct): + """ + Python 2/3 dict __repr__ may be different, because of unicode differens + (with or without a `u` prefix). Normally in doctests we could use `pprint` + to sort dicts and check for equality, but here we have to write a separate + function to do that. + """ + import pprint + s = pprint.pformat(dct) + print(re.sub("u'", "'", s)) + + +def utf8_repr(func): + """ + ``__repr__`` methods in Python 2 don't allow unicode objects to be + returned. Therefore cast them to utf-8 bytes in this decorator. + """ + def wrapper(self): + result = func(self) + if isinstance(result, unicode): + return result.encode('utf-8') + else: + return result + + if is_py3: + return func + else: + return wrapper + + +if is_py3: + import queue +else: + import Queue as queue # noqa: F401 + +try: + # Attempt to load the C implementation of pickle on Python 2 as it is way + # faster. + import cPickle as pickle +except ImportError: + import pickle +if sys.version_info[:2] == (3, 3): + """ + Monkeypatch the unpickler in Python 3.3. This is needed, because the + argument `encoding='bytes'` is not supported in 3.3, but badly needed to + communicate with Python 2. + """ + + class NewUnpickler(pickle._Unpickler): + dispatch = dict(pickle._Unpickler.dispatch) + + def _decode_string(self, value): + # Used to allow strings from Python 2 to be decoded either as + # bytes or Unicode strings. This should be used only with the + # STRING, BINSTRING and SHORT_BINSTRING opcodes. + if self.encoding == "bytes": + return value + else: + return value.decode(self.encoding, self.errors) + + def load_string(self): + data = self.readline()[:-1] + # Strip outermost quotes + if len(data) >= 2 and data[0] == data[-1] and data[0] in b'"\'': + data = data[1:-1] + else: + raise pickle.UnpicklingError("the STRING opcode argument must be quoted") + self.append(self._decode_string(pickle.codecs.escape_decode(data)[0])) + dispatch[pickle.STRING[0]] = load_string + + def load_binstring(self): + # Deprecated BINSTRING uses signed 32-bit length + len, = pickle.struct.unpack('' % ( + self.__class__.__name__, + repr(self._orig_path), + self._evaluator.environment, + ) + + def completions(self): + """ + Return :class:`classes.Completion` objects. Those objects contain + information about the completions, more than just names. + + :return: Completion objects, sorted by name and __ comes last. + :rtype: list of :class:`classes.Completion` + """ + with debug.increase_indent_cm('completions'): + completion = Completion( + self._evaluator, self._get_module(), self._code_lines, + self._pos, self.call_signatures + ) + return completion.completions() + + def goto_definitions(self, **kwargs): + """ + Return the definitions of a the path under the cursor. goto function! + This follows complicated paths and returns the end, not the first + definition. The big difference between :meth:`goto_assignments` and + :meth:`goto_definitions` is that :meth:`goto_assignments` doesn't + follow imports and statements. Multiple objects may be returned, + because Python itself is a dynamic language, which means depending on + an option you can have two different versions of a function. + + :param only_stubs: Only return stubs for this goto call. + :param prefer_stubs: Prefer stubs to Python objects for this type + inference call. + :rtype: list of :class:`classes.Definition` + """ + with debug.increase_indent_cm('goto_definitions'): + return self._goto_definitions(**kwargs) + + def _goto_definitions(self, only_stubs=False, prefer_stubs=False): + leaf = self._module_node.get_name_of_position(self._pos) + if leaf is None: + leaf = self._module_node.get_leaf_for_position(self._pos) + if leaf is None: + return [] + + context = self._evaluator.create_context(self._get_module(), leaf) + + contexts = helpers.evaluate_goto_definition(self._evaluator, context, leaf) + contexts = convert_contexts( + contexts, + only_stubs=only_stubs, + prefer_stubs=prefer_stubs, + ) + + defs = [classes.Definition(self._evaluator, c.name) for c in contexts] + # The additional set here allows the definitions to become unique in an + # API sense. In the internals we want to separate more things than in + # the API. + return helpers.sorted_definitions(set(defs)) + + def goto_assignments(self, follow_imports=False, follow_builtin_imports=False, **kwargs): + """ + Return the first definition found, while optionally following imports. + Multiple objects may be returned, because Python itself is a + dynamic language, which means depending on an option you can have two + different versions of a function. + + .. note:: It is deprecated to use follow_imports and follow_builtin_imports as + positional arguments. Will be a keyword argument in 0.16.0. + + :param follow_imports: The goto call will follow imports. + :param follow_builtin_imports: If follow_imports is True will decide if + it follow builtin imports. + :param only_stubs: Only return stubs for this goto call. + :param prefer_stubs: Prefer stubs to Python objects for this goto call. + :rtype: list of :class:`classes.Definition` + """ + with debug.increase_indent_cm('goto_assignments'): + return self._goto_assignments(follow_imports, follow_builtin_imports, **kwargs) + + def _goto_assignments(self, follow_imports, follow_builtin_imports, + only_stubs=False, prefer_stubs=False): + def filter_follow_imports(names, check): + for name in names: + if check(name): + new_names = list(filter_follow_imports(name.goto(), check)) + found_builtin = False + if follow_builtin_imports: + for new_name in new_names: + if new_name.start_pos is None: + found_builtin = True + + if found_builtin: + yield name + else: + for new_name in new_names: + yield new_name + else: + yield name + + tree_name = self._module_node.get_name_of_position(self._pos) + if tree_name is None: + # Without a name we really just want to jump to the result e.g. + # executed by `foo()`, if we the cursor is after `)`. + return self.goto_definitions(only_stubs=only_stubs, prefer_stubs=prefer_stubs) + context = self._evaluator.create_context(self._get_module(), tree_name) + names = list(self._evaluator.goto(context, tree_name)) + + if follow_imports: + names = filter_follow_imports(names, lambda name: name.is_import()) + names = convert_names( + names, + only_stubs=only_stubs, + prefer_stubs=prefer_stubs, + ) + + defs = [classes.Definition(self._evaluator, d) for d in set(names)] + return helpers.sorted_definitions(defs) + + def usages(self, additional_module_paths=(), **kwargs): + """ + Return :class:`classes.Definition` objects, which contain all + names that point to the definition of the name under the cursor. This + is very useful for refactoring (renaming), or to show all usages of a + variable. + + .. todo:: Implement additional_module_paths + + :param additional_module_paths: Deprecated, never ever worked. + :param include_builtins: Default True, checks if a usage is a builtin + (e.g. ``sys``) and in that case does not return it. + :rtype: list of :class:`classes.Definition` + """ + if additional_module_paths: + warnings.warn( + "Deprecated since version 0.12.0. This never even worked, just ignore it.", + DeprecationWarning, + stacklevel=2 + ) + + def _usages(include_builtins=True): + tree_name = self._module_node.get_name_of_position(self._pos) + if tree_name is None: + # Must be syntax + return [] + + names = usages.usages(self._get_module(), tree_name) + + definitions = [classes.Definition(self._evaluator, n) for n in names] + if not include_builtins: + definitions = [d for d in definitions if not d.in_builtin_module()] + return helpers.sorted_definitions(definitions) + return _usages(**kwargs) + + def call_signatures(self): + """ + Return the function object of the call you're currently in. + + E.g. if the cursor is here:: + + abs(# <-- cursor is here + + This would return the ``abs`` function. On the other hand:: + + abs()# <-- cursor is here + + This would return an empty list.. + + :rtype: list of :class:`classes.CallSignature` + """ + call_details = helpers.get_call_signature_details(self._module_node, self._pos) + if call_details is None: + return [] + + context = self._evaluator.create_context( + self._get_module(), + call_details.bracket_leaf + ) + definitions = helpers.cache_call_signatures( + self._evaluator, + context, + call_details.bracket_leaf, + self._code_lines, + self._pos + ) + debug.speed('func_call followed') + + # TODO here we use stubs instead of the actual contexts. We should use + # the signatures from stubs, but the actual contexts, probably?! + return [classes.CallSignature(self._evaluator, signature, call_details) + for signature in definitions.get_signatures()] + + def _analysis(self): + self._evaluator.is_analysis = True + self._evaluator.analysis_modules = [self._module_node] + module = self._get_module() + try: + for node in get_executable_nodes(self._module_node): + context = module.create_context(node) + if node.type in ('funcdef', 'classdef'): + # Resolve the decorators. + tree_name_to_contexts(self._evaluator, context, node.children[1]) + elif isinstance(node, tree.Import): + import_names = set(node.get_defined_names()) + if node.is_nested(): + import_names |= set(path[-1] for path in node.get_paths()) + for n in import_names: + imports.infer_import(context, n) + elif node.type == 'expr_stmt': + types = context.eval_node(node) + for testlist in node.children[:-1:2]: + # Iterate tuples. + unpack_tuple_to_dict(context, types, testlist) + else: + if node.type == 'name': + defs = self._evaluator.goto_definitions(context, node) + else: + defs = evaluate_call_of_leaf(context, node) + try_iter_content(defs) + self._evaluator.reset_recursion_limitations() + + ana = [a for a in self._evaluator.analysis if self.path == a.path] + return sorted(set(ana), key=lambda x: x.line) + finally: + self._evaluator.is_analysis = False + + +class Interpreter(Script): + """ + Jedi API for Python REPLs. + + In addition to completion of simple attribute access, Jedi + supports code completion based on static code analysis. + Jedi can complete attributes of object which is not initialized + yet. + + >>> from os.path import join + >>> namespace = locals() + >>> script = Interpreter('join("").up', [namespace]) + >>> print(script.completions()[0].name) + upper + """ + _allow_descriptor_getattr_default = True + + def __init__(self, source, namespaces, **kwds): + """ + Parse `source` and mixin interpreted Python objects from `namespaces`. + + :type source: str + :arg source: Code to parse. + :type namespaces: list of dict + :arg namespaces: a list of namespace dictionaries such as the one + returned by :func:`locals`. + + Other optional arguments are same as the ones for :class:`Script`. + If `line` and `column` are None, they are assumed be at the end of + `source`. + """ + try: + namespaces = [dict(n) for n in namespaces] + except Exception: + raise TypeError("namespaces must be a non-empty list of dicts.") + + environment = kwds.get('environment', None) + if environment is None: + environment = InterpreterEnvironment() + else: + if not isinstance(environment, InterpreterEnvironment): + raise TypeError("The environment needs to be an InterpreterEnvironment subclass.") + + super(Interpreter, self).__init__(source, environment=environment, + _project=Project(os.getcwd()), **kwds) + self.namespaces = namespaces + self._evaluator.allow_descriptor_getattr = self._allow_descriptor_getattr_default + + def _get_module(self): + return interpreter.MixedModuleContext( + self._evaluator, + self._module_node, + self.namespaces, + file_io=KnownContentFileIO(self.path, self._code), + code_lines=self._code_lines, + ) + + +def names(source=None, path=None, encoding='utf-8', all_scopes=False, + definitions=True, references=False, environment=None): + """ + Returns a list of `Definition` objects, containing name parts. + This means you can call ``Definition.goto_assignments()`` and get the + reference of a name. + The parameters are the same as in :py:class:`Script`, except or the + following ones: + + :param all_scopes: If True lists the names of all scopes instead of only + the module namespace. + :param definitions: If True lists the names that have been defined by a + class, function or a statement (``a = b`` returns ``a``). + :param references: If True lists all the names that are not listed by + ``definitions=True``. E.g. ``a = b`` returns ``b``. + """ + def def_ref_filter(_def): + is_def = _def._name.tree_name.is_definition() + return definitions and is_def or references and not is_def + + def create_name(name): + if name.parent.type == 'param': + cls = ParamName + else: + cls = TreeNameDefinition + return cls( + module_context.create_context(name), + name + ) + + # Set line/column to a random position, because they don't matter. + script = Script(source, line=1, column=0, path=path, encoding=encoding, environment=environment) + module_context = script._get_module() + defs = [ + classes.Definition( + script._evaluator, + create_name(name) + ) for name in get_module_names(script._module_node, all_scopes) + ] + return sorted(filter(def_ref_filter, defs), key=lambda x: (x.line, x.column)) + + +def preload_module(*modules): + """ + Preloading modules tells Jedi to load a module now, instead of lazy parsing + of modules. Usful for IDEs, to control which modules to load on startup. + + :param modules: different module names, list of string. + """ + for m in modules: + s = "import %s as x; x." % m + Script(s, 1, len(s), None).completions() + + +def set_debug_function(func_cb=debug.print_to_stdout, warnings=True, + notices=True, speed=True): + """ + Define a callback debug function to get all the debug messages. + + If you don't specify any arguments, debug messages will be printed to stdout. + + :param func_cb: The callback function for debug messages, with n params. + """ + debug.debug_function = func_cb + debug.enable_warning = warnings + debug.enable_notice = notices + debug.enable_speed = speed diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/api/classes.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/api/classes.py new file mode 100644 index 0000000..c393ca6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/api/classes.py @@ -0,0 +1,768 @@ +""" +The :mod:`jedi.api.classes` module contains the return classes of the API. +These classes are the much bigger part of the whole API, because they contain +the interesting information about completion and goto operations. +""" +import re +import sys +import warnings + +from jedi import settings +from jedi import debug +from jedi.evaluate.utils import unite +from jedi.cache import memoize_method +from jedi.evaluate import imports +from jedi.evaluate import compiled +from jedi.evaluate.imports import ImportName +from jedi.evaluate.context import FunctionExecutionContext +from jedi.evaluate.gradual.typeshed import StubModuleContext +from jedi.evaluate.gradual.conversion import convert_names, convert_contexts +from jedi.evaluate.base_context import ContextSet +from jedi.api.keywords import KeywordName + + +def _sort_names_by_start_pos(names): + return sorted(names, key=lambda s: s.start_pos or (0, 0)) + + +def defined_names(evaluator, context): + """ + List sub-definitions (e.g., methods in class). + + :type scope: Scope + :rtype: list of Definition + """ + filter = next(context.get_filters(search_global=True)) + names = [name for name in filter.values()] + return [Definition(evaluator, n) for n in _sort_names_by_start_pos(names)] + + +def _contexts_to_definitions(contexts): + return [Definition(c.evaluator, c.name) for c in contexts] + + +class BaseDefinition(object): + _mapping = { + 'posixpath': 'os.path', + 'riscospath': 'os.path', + 'ntpath': 'os.path', + 'os2emxpath': 'os.path', + 'macpath': 'os.path', + 'genericpath': 'os.path', + 'posix': 'os', + '_io': 'io', + '_functools': 'functools', + '_collections': 'collections', + '_socket': 'socket', + '_sqlite3': 'sqlite3', + '__builtin__': 'builtins', + } + + _tuple_mapping = dict((tuple(k.split('.')), v) for (k, v) in { + 'argparse._ActionsContainer': 'argparse.ArgumentParser', + }.items()) + + def __init__(self, evaluator, name): + self._evaluator = evaluator + self._name = name + """ + An instance of :class:`parso.python.tree.Name` subclass. + """ + self.is_keyword = isinstance(self._name, KeywordName) + + @memoize_method + def _get_module(self): + # This can take a while to complete, because in the worst case of + # imports (consider `import a` completions), we need to load all + # modules starting with a first. + return self._name.get_root_context() + + @property + def module_path(self): + """Shows the file path of a module. e.g. ``/usr/lib/python2.7/os.py``""" + module = self._get_module() + if module.is_stub() or not module.is_compiled(): + # Compiled modules should not return a module path even if they + # have one. + return self._get_module().py__file__() + + return None + + @property + def name(self): + """ + Name of variable/function/class/module. + + For example, for ``x = None`` it returns ``'x'``. + + :rtype: str or None + """ + return self._name.string_name + + @property + def type(self): + """ + The type of the definition. + + Here is an example of the value of this attribute. Let's consider + the following source. As what is in ``variable`` is unambiguous + to Jedi, :meth:`jedi.Script.goto_definitions` should return a list of + definition for ``sys``, ``f``, ``C`` and ``x``. + + >>> from jedi._compatibility import no_unicode_pprint + >>> from jedi import Script + >>> source = ''' + ... import keyword + ... + ... class C: + ... pass + ... + ... class D: + ... pass + ... + ... x = D() + ... + ... def f(): + ... pass + ... + ... for variable in [keyword, f, C, x]: + ... variable''' + + >>> script = Script(source) + >>> defs = script.goto_definitions() + + Before showing what is in ``defs``, let's sort it by :attr:`line` + so that it is easy to relate the result to the source code. + + >>> defs = sorted(defs, key=lambda d: d.line) + >>> no_unicode_pprint(defs) # doctest: +NORMALIZE_WHITESPACE + [, + , + , + ] + + Finally, here is what you can get from :attr:`type`: + + >>> defs = [str(d.type) for d in defs] # It's unicode and in Py2 has u before it. + >>> defs[0] + 'module' + >>> defs[1] + 'class' + >>> defs[2] + 'instance' + >>> defs[3] + 'function' + + Valid values for are ``module``, ``class``, ``instance``, ``function``, + ``param``, ``path`` and ``keyword``. + + """ + tree_name = self._name.tree_name + resolve = False + if tree_name is not None: + # TODO move this to their respective names. + definition = tree_name.get_definition() + if definition is not None and definition.type == 'import_from' and \ + tree_name.is_definition(): + resolve = True + + if isinstance(self._name, imports.SubModuleName) or resolve: + for context in self._name.infer(): + return context.api_type + return self._name.api_type + + @property + def module_name(self): + """ + The module name. + + >>> from jedi import Script + >>> source = 'import json' + >>> script = Script(source, path='example.py') + >>> d = script.goto_definitions()[0] + >>> print(d.module_name) # doctest: +ELLIPSIS + json + """ + return self._get_module().name.string_name + + def in_builtin_module(self): + """Whether this is a builtin module.""" + if isinstance(self._get_module(), StubModuleContext): + return any(isinstance(context, compiled.CompiledObject) + for context in self._get_module().non_stub_context_set) + return isinstance(self._get_module(), compiled.CompiledObject) + + @property + def line(self): + """The line where the definition occurs (starting with 1).""" + start_pos = self._name.start_pos + if start_pos is None: + return None + return start_pos[0] + + @property + def column(self): + """The column where the definition occurs (starting with 0).""" + start_pos = self._name.start_pos + if start_pos is None: + return None + return start_pos[1] + + def docstring(self, raw=False, fast=True): + r""" + Return a document string for this completion object. + + Example: + + >>> from jedi import Script + >>> source = '''\ + ... def f(a, b=1): + ... "Document for function f." + ... ''' + >>> script = Script(source, 1, len('def f'), 'example.py') + >>> doc = script.goto_definitions()[0].docstring() + >>> print(doc) + f(a, b=1) + + Document for function f. + + Notice that useful extra information is added to the actual + docstring. For function, it is call signature. If you need + actual docstring, use ``raw=True`` instead. + + >>> print(script.goto_definitions()[0].docstring(raw=True)) + Document for function f. + + :param fast: Don't follow imports that are only one level deep like + ``import foo``, but follow ``from foo import bar``. This makes + sense for speed reasons. Completing `import a` is slow if you use + the ``foo.docstring(fast=False)`` on every object, because it + parses all libraries starting with ``a``. + """ + return _Help(self._name).docstring(fast=fast, raw=raw) + + @property + def description(self): + """A textual description of the object.""" + return self._name.string_name + + @property + def full_name(self): + """ + Dot-separated path of this object. + + It is in the form of ``[.[...]][.]``. + It is useful when you want to look up Python manual of the + object at hand. + + Example: + + >>> from jedi import Script + >>> source = ''' + ... import os + ... os.path.join''' + >>> script = Script(source, 3, len('os.path.join'), 'example.py') + >>> print(script.goto_definitions()[0].full_name) + os.path.join + + Notice that it returns ``'os.path.join'`` instead of (for example) + ``'posixpath.join'``. This is not correct, since the modules name would + be `````. However most users find the latter + more practical. + """ + if not self._name.is_context_name: + return None + + names = self._name.get_qualified_names(include_module_names=True) + if names is None: + return names + + names = list(names) + try: + names[0] = self._mapping[names[0]] + except KeyError: + pass + + return '.'.join(names) + + def is_stub(self): + if not self._name.is_context_name: + return False + + return self._name.get_root_context().is_stub() + + def goto_assignments(self, **kwargs): # Python 2... + with debug.increase_indent_cm('goto for %s' % self._name): + return self._goto_assignments(**kwargs) + + def _goto_assignments(self, only_stubs=False, prefer_stubs=False): + assert not (only_stubs and prefer_stubs) + + if not self._name.is_context_name: + return [] + + names = convert_names( + self._name.goto(), + only_stubs=only_stubs, + prefer_stubs=prefer_stubs, + ) + return [self if n == self._name else Definition(self._evaluator, n) + for n in names] + + def infer(self, **kwargs): # Python 2... + with debug.increase_indent_cm('infer for %s' % self._name): + return self._infer(**kwargs) + + def _infer(self, only_stubs=False, prefer_stubs=False): + assert not (only_stubs and prefer_stubs) + + if not self._name.is_context_name: + return [] + + # First we need to make sure that we have stub names (if possible) that + # we can follow. If we don't do that, we can end up with the inferred + # results of Python objects instead of stubs. + names = convert_names([self._name], prefer_stubs=True) + contexts = convert_contexts( + ContextSet.from_sets(n.infer() for n in names), + only_stubs=only_stubs, + prefer_stubs=prefer_stubs, + ) + resulting_names = [c.name for c in contexts] + return [self if n == self._name else Definition(self._evaluator, n) + for n in resulting_names] + + @property + @memoize_method + def params(self): + """ + Deprecated! Will raise a warning soon. Use get_signatures()[...].params. + + Raises an ``AttributeError`` if the definition is not callable. + Otherwise returns a list of `Definition` that represents the params. + """ + # Only return the first one. There might be multiple one, especially + # with overloading. + for context in self._name.infer(): + for signature in context.get_signatures(): + return [ + Definition(self._evaluator, n) + for n in signature.get_param_names(resolve_stars=True) + ] + + if self.type == 'function' or self.type == 'class': + # Fallback, if no signatures were defined (which is probably by + # itself a bug). + return [] + raise AttributeError('There are no params defined on this.') + + def parent(self): + if not self._name.is_context_name: + return None + + context = self._name.parent_context + if context is None: + return None + + if isinstance(context, FunctionExecutionContext): + context = context.function_context + return Definition(self._evaluator, context.name) + + def __repr__(self): + return "<%s %sname=%r, description=%r>" % ( + self.__class__.__name__, + 'full_' if self.full_name else '', + self.full_name or self.name, + self.description, + ) + + def get_line_code(self, before=0, after=0): + """ + Returns the line of code where this object was defined. + + :param before: Add n lines before the current line to the output. + :param after: Add n lines after the current line to the output. + + :return str: Returns the line(s) of code or an empty string if it's a + builtin. + """ + if not self._name.is_context_name or self.in_builtin_module(): + return '' + + lines = self._name.get_root_context().code_lines + + index = self._name.start_pos[0] - 1 + start_index = max(index - before, 0) + return ''.join(lines[start_index:index + after + 1]) + + def get_signatures(self): + return [Signature(self._evaluator, s) for s in self._name.infer().get_signatures()] + + def execute(self): + return _contexts_to_definitions(self._name.infer().execute_evaluated()) + + +class Completion(BaseDefinition): + """ + `Completion` objects are returned from :meth:`api.Script.completions`. They + provide additional information about a completion. + """ + def __init__(self, evaluator, name, stack, like_name_length): + super(Completion, self).__init__(evaluator, name) + + self._like_name_length = like_name_length + self._stack = stack + + # Completion objects with the same Completion name (which means + # duplicate items in the completion) + self._same_name_completions = [] + + def _complete(self, like_name): + append = '' + if settings.add_bracket_after_function \ + and self.type == 'function': + append = '(' + + if self._name.api_type == 'param' and self._stack is not None: + nonterminals = [stack_node.nonterminal for stack_node in self._stack] + if 'trailer' in nonterminals and 'argument' not in nonterminals: + # TODO this doesn't work for nested calls. + append += '=' + + name = self._name.string_name + if like_name: + name = name[self._like_name_length:] + return name + append + + @property + def complete(self): + """ + Return the rest of the word, e.g. completing ``isinstance``:: + + isinstan# <-- Cursor is here + + would return the string 'ce'. It also adds additional stuff, depending + on your `settings.py`. + + Assuming the following function definition:: + + def foo(param=0): + pass + + completing ``foo(par`` would give a ``Completion`` which `complete` + would be `am=` + + + """ + return self._complete(True) + + @property + def name_with_symbols(self): + """ + Similar to :attr:`name`, but like :attr:`name` returns also the + symbols, for example assuming the following function definition:: + + def foo(param=0): + pass + + completing ``foo(`` would give a ``Completion`` which + ``name_with_symbols`` would be "param=". + + """ + return self._complete(False) + + def docstring(self, raw=False, fast=True): + if self._like_name_length >= 3: + # In this case we can just resolve the like name, because we + # wouldn't load like > 100 Python modules anymore. + fast = False + return super(Completion, self).docstring(raw=raw, fast=fast) + + @property + def description(self): + """Provide a description of the completion object.""" + # TODO improve the class structure. + return Definition.description.__get__(self) + + def __repr__(self): + return '<%s: %s>' % (type(self).__name__, self._name.string_name) + + @memoize_method + def follow_definition(self): + """ + Deprecated! + + Return the original definitions. I strongly recommend not using it for + your completions, because it might slow down |jedi|. If you want to + read only a few objects (<=20), it might be useful, especially to get + the original docstrings. The basic problem of this function is that it + follows all results. This means with 1000 completions (e.g. numpy), + it's just PITA-slow. + """ + warnings.warn( + "Deprecated since version 0.14.0. Use .infer.", + DeprecationWarning, + stacklevel=2 + ) + return self.infer() + + +class Definition(BaseDefinition): + """ + *Definition* objects are returned from :meth:`api.Script.goto_assignments` + or :meth:`api.Script.goto_definitions`. + """ + def __init__(self, evaluator, definition): + super(Definition, self).__init__(evaluator, definition) + + @property + def description(self): + """ + A description of the :class:`.Definition` object, which is heavily used + in testing. e.g. for ``isinstance`` it returns ``def isinstance``. + + Example: + + >>> from jedi._compatibility import no_unicode_pprint + >>> from jedi import Script + >>> source = ''' + ... def f(): + ... pass + ... + ... class C: + ... pass + ... + ... variable = f if random.choice([0,1]) else C''' + >>> script = Script(source, column=3) # line is maximum by default + >>> defs = script.goto_definitions() + >>> defs = sorted(defs, key=lambda d: d.line) + >>> no_unicode_pprint(defs) # doctest: +NORMALIZE_WHITESPACE + [, + ] + >>> str(defs[0].description) # strip literals in python2 + 'def f' + >>> str(defs[1].description) + 'class C' + + """ + typ = self.type + tree_name = self._name.tree_name + if typ == 'param': + return typ + ' ' + self._name.to_string() + if typ in ('function', 'class', 'module', 'instance') or tree_name is None: + if typ == 'function': + # For the description we want a short and a pythonic way. + typ = 'def' + return typ + ' ' + self._name.string_name + + definition = tree_name.get_definition() or tree_name + # Remove the prefix, because that's not what we want for get_code + # here. + txt = definition.get_code(include_prefix=False) + # Delete comments: + txt = re.sub(r'#[^\n]+\n', ' ', txt) + # Delete multi spaces/newlines + txt = re.sub(r'\s+', ' ', txt).strip() + return txt + + @property + def desc_with_module(self): + """ + In addition to the definition, also return the module. + + .. warning:: Don't use this function yet, its behaviour may change. If + you really need it, talk to me. + + .. todo:: Add full path. This function is should return a + `module.class.function` path. + """ + position = '' if self.in_builtin_module else '@%s' % self.line + return "%s:%s%s" % (self.module_name, self.description, position) + + @memoize_method + def defined_names(self): + """ + List sub-definitions (e.g., methods in class). + + :rtype: list of Definition + """ + defs = self._name.infer() + return sorted( + unite(defined_names(self._evaluator, d) for d in defs), + key=lambda s: s._name.start_pos or (0, 0) + ) + + def is_definition(self): + """ + Returns True, if defined as a name in a statement, function or class. + Returns False, if it's a reference to such a definition. + """ + if self._name.tree_name is None: + return True + else: + return self._name.tree_name.is_definition() + + def __eq__(self, other): + return self._name.start_pos == other._name.start_pos \ + and self.module_path == other.module_path \ + and self.name == other.name \ + and self._evaluator == other._evaluator + + def __ne__(self, other): + return not self.__eq__(other) + + def __hash__(self): + return hash((self._name.start_pos, self.module_path, self.name, self._evaluator)) + + +class Signature(Definition): + """ + `Signature` objects is the return value of `Script.function_definition`. + It knows what functions you are currently in. e.g. `isinstance(` would + return the `isinstance` function. without `(` it would return nothing. + """ + def __init__(self, evaluator, signature): + super(Signature, self).__init__(evaluator, signature.name) + self._signature = signature + + @property + def params(self): + """ + :return list of ParamDefinition: + """ + return [ParamDefinition(self._evaluator, n) + for n in self._signature.get_param_names(resolve_stars=True)] + + def to_string(self): + return self._signature.to_string() + + +class CallSignature(Signature): + """ + `CallSignature` objects is the return value of `Script.call_signatures`. + It knows what functions you are currently in. e.g. `isinstance(` would + return the `isinstance` function with its params. Without `(` it would + return nothing. + """ + def __init__(self, evaluator, signature, call_details): + super(CallSignature, self).__init__(evaluator, signature) + self._call_details = call_details + self._signature = signature + + @property + def index(self): + """ + The Param index of the current call. + Returns None if the index cannot be found in the curent call. + """ + return self._call_details.calculate_index( + self._signature.get_param_names(resolve_stars=True) + ) + + @property + def bracket_start(self): + """ + The line/column of the bracket that is responsible for the last + function call. + """ + return self._call_details.bracket_leaf.start_pos + + def __repr__(self): + return '<%s: index=%r %s>' % ( + type(self).__name__, + self.index, + self._signature.to_string(), + ) + + +class ParamDefinition(Definition): + def infer_default(self): + """ + :return list of Definition: + """ + return _contexts_to_definitions(self._name.infer_default()) + + def infer_annotation(self, **kwargs): + """ + :return list of Definition: + + :param execute_annotation: If False, the values are not executed and + you get classes instead of instances. + """ + return _contexts_to_definitions(self._name.infer_annotation(**kwargs)) + + def to_string(self): + return self._name.to_string() + + @property + def kind(self): + """ + Returns an enum instance. Returns the same values as the builtin + :py:attr:`inspect.Parameter.kind`. + + No support for Python < 3.4 anymore. + """ + if sys.version_info < (3, 5): + raise NotImplementedError( + 'Python 2 is end-of-life, the new feature is not available for it' + ) + return self._name.get_kind() + + +def _format_signatures(context): + return '\n'.join( + signature.to_string() + for signature in context.get_signatures() + ) + + +class _Help(object): + """ + Temporary implementation, will be used as `Script.help() or something in + the future. + """ + def __init__(self, definition): + self._name = definition + + @memoize_method + def _get_contexts(self, fast): + if isinstance(self._name, ImportName) and fast: + return {} + + if self._name.api_type == 'statement': + return {} + + return self._name.infer() + + def docstring(self, fast=True, raw=True): + """ + The docstring ``__doc__`` for any object. + + See :attr:`doc` for example. + """ + full_doc = '' + # Using the first docstring that we see. + for context in self._get_contexts(fast=fast): + if full_doc: + # In case we have multiple contexts, just return all of them + # separated by a few dashes. + full_doc += '\n' + '-' * 30 + '\n' + + doc = context.py__doc__() + + signature_text = '' + if self._name.is_context_name: + if not raw: + signature_text = _format_signatures(context) + if not doc and context.is_stub(): + for c in convert_contexts(ContextSet({context}), ignore_compiled=False): + doc = c.py__doc__() + if doc: + break + + if signature_text and doc: + full_doc += signature_text + '\n\n' + doc + else: + full_doc += signature_text + doc + + return full_doc diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/api/completion.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/api/completion.py new file mode 100644 index 0000000..aa5be0a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/api/completion.py @@ -0,0 +1,326 @@ +import re + +from parso.python.token import PythonTokenTypes +from parso.python import tree +from parso.tree import search_ancestor, Leaf + +from jedi._compatibility import Parameter +from jedi import debug +from jedi import settings +from jedi.api import classes +from jedi.api import helpers +from jedi.api import keywords +from jedi.api.file_name import file_name_completions +from jedi.evaluate import imports +from jedi.evaluate.helpers import evaluate_call_of_leaf, parse_dotted_names +from jedi.evaluate.filters import get_global_filters +from jedi.evaluate.gradual.conversion import convert_contexts +from jedi.parser_utils import get_statement_of_position, cut_value_at_position + + +def get_call_signature_param_names(call_signatures): + # add named params + for call_sig in call_signatures: + for p in call_sig.params: + # Allow protected access, because it's a public API. + if p._name.get_kind() in (Parameter.POSITIONAL_OR_KEYWORD, + Parameter.KEYWORD_ONLY): + yield p._name + + +def filter_names(evaluator, completion_names, stack, like_name): + comp_dct = {} + if settings.case_insensitive_completion: + like_name = like_name.lower() + for name in completion_names: + string = name.string_name + if settings.case_insensitive_completion: + string = string.lower() + + if string.startswith(like_name): + new = classes.Completion( + evaluator, + name, + stack, + len(like_name) + ) + k = (new.name, new.complete) # key + if k in comp_dct and settings.no_completion_duplicates: + comp_dct[k]._same_name_completions.append(new) + else: + comp_dct[k] = new + yield new + + +def get_user_scope(module_context, position): + """ + Returns the scope in which the user resides. This includes flows. + """ + user_stmt = get_statement_of_position(module_context.tree_node, position) + if user_stmt is None: + def scan(scope): + for s in scope.children: + if s.start_pos <= position <= s.end_pos: + if isinstance(s, (tree.Scope, tree.Flow)) \ + or s.type in ('async_stmt', 'async_funcdef'): + return scan(s) or s + elif s.type in ('suite', 'decorated'): + return scan(s) + return None + + scanned_node = scan(module_context.tree_node) + if scanned_node: + return module_context.create_context(scanned_node, node_is_context=True) + return module_context + else: + return module_context.create_context(user_stmt) + + +def get_flow_scope_node(module_node, position): + node = module_node.get_leaf_for_position(position, include_prefixes=True) + while not isinstance(node, (tree.Scope, tree.Flow)): + node = node.parent + + return node + + +class Completion: + def __init__(self, evaluator, module, code_lines, position, call_signatures_callback): + self._evaluator = evaluator + self._module_context = module + self._module_node = module.tree_node + self._code_lines = code_lines + + # The first step of completions is to get the name + self._like_name = helpers.get_on_completion_name(self._module_node, code_lines, position) + # The actual cursor position is not what we need to calculate + # everything. We want the start of the name we're on. + self._original_position = position + self._position = position[0], position[1] - len(self._like_name) + self._call_signatures_callback = call_signatures_callback + + def completions(self): + leaf = self._module_node.get_leaf_for_position(self._position, include_prefixes=True) + string, start_leaf = _extract_string_while_in_string(leaf, self._position) + if string is not None: + completions = list(file_name_completions( + self._evaluator, self._module_context, start_leaf, string, + self._like_name, self._call_signatures_callback, + self._code_lines, self._original_position + )) + if completions: + return completions + + completion_names = self._get_context_completions(leaf) + + completions = filter_names(self._evaluator, completion_names, + self.stack, self._like_name) + + return sorted(completions, key=lambda x: (x.name.startswith('__'), + x.name.startswith('_'), + x.name.lower())) + + def _get_context_completions(self, leaf): + """ + Analyzes the context that a completion is made in and decides what to + return. + + Technically this works by generating a parser stack and analysing the + current stack for possible grammar nodes. + + Possible enhancements: + - global/nonlocal search global + - yield from / raise from <- could be only exceptions/generators + - In args: */**: no completion + - In params (also lambda): no completion before = + """ + + grammar = self._evaluator.grammar + self.stack = stack = None + + try: + self.stack = stack = helpers.get_stack_at_position( + grammar, self._code_lines, leaf, self._position + ) + except helpers.OnErrorLeaf as e: + value = e.error_leaf.value + if value == '.': + # After ErrorLeaf's that are dots, we will not do any + # completions since this probably just confuses the user. + return [] + + # If we don't have a context, just use global completion. + return self._global_completions() + + allowed_transitions = \ + list(stack._allowed_transition_names_and_token_types()) + + if 'if' in allowed_transitions: + leaf = self._module_node.get_leaf_for_position(self._position, include_prefixes=True) + previous_leaf = leaf.get_previous_leaf() + + indent = self._position[1] + if not (leaf.start_pos <= self._position <= leaf.end_pos): + indent = leaf.start_pos[1] + + if previous_leaf is not None: + stmt = previous_leaf + while True: + stmt = search_ancestor( + stmt, 'if_stmt', 'for_stmt', 'while_stmt', 'try_stmt', + 'error_node', + ) + if stmt is None: + break + + type_ = stmt.type + if type_ == 'error_node': + first = stmt.children[0] + if isinstance(first, Leaf): + type_ = first.value + '_stmt' + # Compare indents + if stmt.start_pos[1] == indent: + if type_ == 'if_stmt': + allowed_transitions += ['elif', 'else'] + elif type_ == 'try_stmt': + allowed_transitions += ['except', 'finally', 'else'] + elif type_ == 'for_stmt': + allowed_transitions.append('else') + + completion_names = [] + current_line = self._code_lines[self._position[0] - 1][:self._position[1]] + if not current_line or current_line[-1] in ' \t.;': + completion_names += self._get_keyword_completion_names(allowed_transitions) + + if any(t in allowed_transitions for t in (PythonTokenTypes.NAME, + PythonTokenTypes.INDENT)): + # This means that we actually have to do type inference. + + nonterminals = [stack_node.nonterminal for stack_node in stack] + + nodes = [] + for stack_node in stack: + if stack_node.dfa.from_rule == 'small_stmt': + nodes = [] + else: + nodes += stack_node.nodes + + if nodes and nodes[-1] in ('as', 'def', 'class'): + # No completions for ``with x as foo`` and ``import x as foo``. + # Also true for defining names as a class or function. + return list(self._get_class_context_completions(is_function=True)) + elif "import_stmt" in nonterminals: + level, names = parse_dotted_names(nodes, "import_from" in nonterminals) + + only_modules = not ("import_from" in nonterminals and 'import' in nodes) + completion_names += self._get_importer_names( + names, + level, + only_modules=only_modules, + ) + elif nonterminals[-1] in ('trailer', 'dotted_name') and nodes[-1] == '.': + dot = self._module_node.get_leaf_for_position(self._position) + completion_names += self._trailer_completions(dot.get_previous_leaf()) + else: + completion_names += self._global_completions() + completion_names += self._get_class_context_completions(is_function=False) + + if 'trailer' in nonterminals: + call_signatures = self._call_signatures_callback() + completion_names += get_call_signature_param_names(call_signatures) + + return completion_names + + def _get_keyword_completion_names(self, allowed_transitions): + for k in allowed_transitions: + if isinstance(k, str) and k.isalpha(): + yield keywords.KeywordName(self._evaluator, k) + + def _global_completions(self): + context = get_user_scope(self._module_context, self._position) + debug.dbg('global completion scope: %s', context) + flow_scope_node = get_flow_scope_node(self._module_node, self._position) + filters = get_global_filters( + self._evaluator, + context, + self._position, + origin_scope=flow_scope_node + ) + completion_names = [] + for filter in filters: + completion_names += filter.values() + return completion_names + + def _trailer_completions(self, previous_leaf): + user_context = get_user_scope(self._module_context, self._position) + evaluation_context = self._evaluator.create_context( + self._module_context, previous_leaf + ) + contexts = evaluate_call_of_leaf(evaluation_context, previous_leaf) + completion_names = [] + debug.dbg('trailer completion contexts: %s', contexts, color='MAGENTA') + for context in contexts: + for filter in context.get_filters( + search_global=False, + origin_scope=user_context.tree_node): + completion_names += filter.values() + + python_contexts = convert_contexts(contexts) + for c in python_contexts: + if c not in contexts: + for filter in c.get_filters( + search_global=False, + origin_scope=user_context.tree_node): + completion_names += filter.values() + return completion_names + + def _get_importer_names(self, names, level=0, only_modules=True): + names = [n.value for n in names] + i = imports.Importer(self._evaluator, names, self._module_context, level) + return i.completion_names(self._evaluator, only_modules=only_modules) + + def _get_class_context_completions(self, is_function=True): + """ + Autocomplete inherited methods when overriding in child class. + """ + leaf = self._module_node.get_leaf_for_position(self._position, include_prefixes=True) + cls = tree.search_ancestor(leaf, 'classdef') + if isinstance(cls, (tree.Class, tree.Function)): + # Complete the methods that are defined in the super classes. + random_context = self._module_context.create_context( + cls, + node_is_context=True + ) + else: + return + + if cls.start_pos[1] >= leaf.start_pos[1]: + return + + filters = random_context.get_filters(search_global=False, is_instance=True) + # The first dict is the dictionary of class itself. + next(filters) + for filter in filters: + for name in filter.values(): + # TODO we should probably check here for properties + if (name.api_type == 'function') == is_function: + yield name + + +def _extract_string_while_in_string(leaf, position): + if leaf.type == 'string': + match = re.match(r'^\w*(\'{3}|"{3}|\'|")', leaf.value) + quote = match.group(1) + if leaf.line == position[0] and position[1] < leaf.column + match.end(): + return None, None + if leaf.end_pos[0] == position[0] and position[1] > leaf.end_pos[1] - len(quote): + return None, None + return cut_value_at_position(leaf, position)[match.end():], leaf + + leaves = [] + while leaf is not None and leaf.line == position[0]: + if leaf.type == 'error_leaf' and ('"' in leaf.value or "'" in leaf.value): + return ''.join(l.get_code() for l in leaves), leaf + leaves.insert(0, leaf) + leaf = leaf.get_previous_leaf() + return None, None diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/api/environment.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/api/environment.py new file mode 100644 index 0000000..e57f548 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/api/environment.py @@ -0,0 +1,458 @@ +""" +Environments are a way to activate different Python versions or Virtualenvs for +static analysis. The Python binary in that environment is going to be executed. +""" +import os +import sys +import hashlib +import filecmp +from collections import namedtuple + +from jedi._compatibility import highest_pickle_protocol, which +from jedi.cache import memoize_method, time_cache +from jedi.evaluate.compiled.subprocess import CompiledSubprocess, \ + EvaluatorSameProcess, EvaluatorSubprocess + +import parso + +_VersionInfo = namedtuple('VersionInfo', 'major minor micro') + +_SUPPORTED_PYTHONS = ['3.8', '3.7', '3.6', '3.5', '3.4', '2.7'] +_SAFE_PATHS = ['/usr/bin', '/usr/local/bin'] +_CURRENT_VERSION = '%s.%s' % (sys.version_info.major, sys.version_info.minor) + + +class InvalidPythonEnvironment(Exception): + """ + If you see this exception, the Python executable or Virtualenv you have + been trying to use is probably not a correct Python version. + """ + + +class _BaseEnvironment(object): + @memoize_method + def get_grammar(self): + version_string = '%s.%s' % (self.version_info.major, self.version_info.minor) + return parso.load_grammar(version=version_string) + + @property + def _sha256(self): + try: + return self._hash + except AttributeError: + self._hash = _calculate_sha256_for_file(self.executable) + return self._hash + + +def _get_info(): + return ( + sys.executable, + sys.prefix, + sys.version_info[:3], + ) + + +class Environment(_BaseEnvironment): + """ + This class is supposed to be created by internal Jedi architecture. You + should not create it directly. Please use create_environment or the other + functions instead. It is then returned by that function. + """ + _subprocess = None + + def __init__(self, executable): + self._start_executable = executable + # Initialize the environment + self._get_subprocess() + + def _get_subprocess(self): + if self._subprocess is not None and not self._subprocess.is_crashed: + return self._subprocess + + try: + self._subprocess = CompiledSubprocess(self._start_executable) + info = self._subprocess._send(None, _get_info) + except Exception as exc: + raise InvalidPythonEnvironment( + "Could not get version information for %r: %r" % ( + self._start_executable, + exc)) + + # Since it could change and might not be the same(?) as the one given, + # set it here. + self.executable = info[0] + """ + The Python executable, matches ``sys.executable``. + """ + self.path = info[1] + """ + The path to an environment, matches ``sys.prefix``. + """ + self.version_info = _VersionInfo(*info[2]) + """ + Like ``sys.version_info``. A tuple to show the current Environment's + Python version. + """ + + # py2 sends bytes via pickle apparently?! + if self.version_info.major == 2: + self.executable = self.executable.decode() + self.path = self.path.decode() + + # Adjust pickle protocol according to host and client version. + self._subprocess._pickle_protocol = highest_pickle_protocol([ + sys.version_info, self.version_info]) + + return self._subprocess + + def __repr__(self): + version = '.'.join(str(i) for i in self.version_info) + return '<%s: %s in %s>' % (self.__class__.__name__, version, self.path) + + def get_evaluator_subprocess(self, evaluator): + return EvaluatorSubprocess(evaluator, self._get_subprocess()) + + @memoize_method + def get_sys_path(self): + """ + The sys path for this environment. Does not include potential + modifications like ``sys.path.append``. + + :returns: list of str + """ + # It's pretty much impossible to generate the sys path without actually + # executing Python. The sys path (when starting with -S) itself depends + # on how the Python version was compiled (ENV variables). + # If you omit -S when starting Python (normal case), additionally + # site.py gets executed. + return self._get_subprocess().get_sys_path() + + +class _SameEnvironmentMixin(object): + def __init__(self): + self._start_executable = self.executable = sys.executable + self.path = sys.prefix + self.version_info = _VersionInfo(*sys.version_info[:3]) + + +class SameEnvironment(_SameEnvironmentMixin, Environment): + pass + + +class InterpreterEnvironment(_SameEnvironmentMixin, _BaseEnvironment): + def get_evaluator_subprocess(self, evaluator): + return EvaluatorSameProcess(evaluator) + + def get_sys_path(self): + return sys.path + + +def _get_virtual_env_from_var(): + """Get virtualenv environment from VIRTUAL_ENV environment variable. + + It uses `safe=False` with ``create_environment``, because the environment + variable is considered to be safe / controlled by the user solely. + """ + var = os.environ.get('VIRTUAL_ENV') + if var: + # Under macOS in some cases - notably when using Pipenv - the + # sys.prefix of the virtualenv is /path/to/env/bin/.. instead of + # /path/to/env so we need to fully resolve the paths in order to + # compare them. + if os.path.realpath(var) == os.path.realpath(sys.prefix): + return _try_get_same_env() + + try: + return create_environment(var, safe=False) + except InvalidPythonEnvironment: + pass + + +def _calculate_sha256_for_file(path): + sha256 = hashlib.sha256() + with open(path, 'rb') as f: + for block in iter(lambda: f.read(filecmp.BUFSIZE), b''): + sha256.update(block) + return sha256.hexdigest() + + +def get_default_environment(): + """ + Tries to return an active Virtualenv. If there is no VIRTUAL_ENV variable + set it will return the latest Python version installed on the system. This + makes it possible to use as many new Python features as possible when using + autocompletion and other functionality. + + :returns: :class:`Environment` + """ + virtual_env = _get_virtual_env_from_var() + if virtual_env is not None: + return virtual_env + + return _try_get_same_env() + + +def _try_get_same_env(): + env = SameEnvironment() + if not os.path.basename(env.executable).lower().startswith('python'): + # This tries to counter issues with embedding. In some cases (e.g. + # VIM's Python Mac/Windows, sys.executable is /foo/bar/vim. This + # happens, because for Mac a function called `_NSGetExecutablePath` is + # used and for Windows `GetModuleFileNameW`. These are both platform + # specific functions. For all other systems sys.executable should be + # alright. However here we try to generalize: + # + # 1. Check if the executable looks like python (heuristic) + # 2. In case it's not try to find the executable + # 3. In case we don't find it use an interpreter environment. + # + # The last option will always work, but leads to potential crashes of + # Jedi - which is ok, because it happens very rarely and even less, + # because the code below should work for most cases. + if os.name == 'nt': + # The first case would be a virtualenv and the second a normal + # Python installation. + checks = (r'Scripts\python.exe', 'python.exe') + else: + # For unix it looks like Python is always in a bin folder. + checks = ( + 'bin/python%s.%s' % (sys.version_info[0], sys.version[1]), + 'bin/python%s' % (sys.version_info[0]), + 'bin/python', + ) + for check in checks: + guess = os.path.join(sys.exec_prefix, check) + if os.path.isfile(guess): + # Bingo - We think we have our Python. + return Environment(guess) + # It looks like there is no reasonable Python to be found. + return InterpreterEnvironment() + # If no virtualenv is found, use the environment we're already + # using. + return env + + +def get_cached_default_environment(): + var = os.environ.get('VIRTUAL_ENV') + environment = _get_cached_default_environment() + + # Under macOS in some cases - notably when using Pipenv - the + # sys.prefix of the virtualenv is /path/to/env/bin/.. instead of + # /path/to/env so we need to fully resolve the paths in order to + # compare them. + if var and os.path.realpath(var) != os.path.realpath(environment.path): + _get_cached_default_environment.clear_cache() + return _get_cached_default_environment() + return environment + + +@time_cache(seconds=10 * 60) # 10 Minutes +def _get_cached_default_environment(): + return get_default_environment() + + +def find_virtualenvs(paths=None, **kwargs): + """ + :param paths: A list of paths in your file system to be scanned for + Virtualenvs. It will search in these paths and potentially execute the + Python binaries. Also the VIRTUAL_ENV variable will be checked if it + contains a valid Virtualenv. + :param safe: Default True. In case this is False, it will allow this + function to execute potential `python` environments. An attacker might + be able to drop an executable in a path this function is searching by + default. If the executable has not been installed by root, it will not + be executed. + + :yields: :class:`Environment` + """ + def py27_comp(paths=None, safe=True): + if paths is None: + paths = [] + + _used_paths = set() + + # Using this variable should be safe, because attackers might be able + # to drop files (via git) but not environment variables. + virtual_env = _get_virtual_env_from_var() + if virtual_env is not None: + yield virtual_env + _used_paths.add(virtual_env.path) + + for directory in paths: + if not os.path.isdir(directory): + continue + + directory = os.path.abspath(directory) + for path in os.listdir(directory): + path = os.path.join(directory, path) + if path in _used_paths: + # A path shouldn't be evaluated twice. + continue + _used_paths.add(path) + + try: + executable = _get_executable_path(path, safe=safe) + yield Environment(executable) + except InvalidPythonEnvironment: + pass + + return py27_comp(paths, **kwargs) + + +def find_system_environments(): + """ + Ignores virtualenvs and returns the Python versions that were installed on + your system. This might return nothing, if you're running Python e.g. from + a portable version. + + The environments are sorted from latest to oldest Python version. + + :yields: :class:`Environment` + """ + for version_string in _SUPPORTED_PYTHONS: + try: + yield get_system_environment(version_string) + except InvalidPythonEnvironment: + pass + + +# TODO: this function should probably return a list of environments since +# multiple Python installations can be found on a system for the same version. +def get_system_environment(version): + """ + Return the first Python environment found for a string of the form 'X.Y' + where X and Y are the major and minor versions of Python. + + :raises: :exc:`.InvalidPythonEnvironment` + :returns: :class:`Environment` + """ + exe = which('python' + version) + if exe: + if exe == sys.executable: + return SameEnvironment() + return Environment(exe) + + if os.name == 'nt': + for exe in _get_executables_from_windows_registry(version): + try: + return Environment(exe) + except InvalidPythonEnvironment: + pass + raise InvalidPythonEnvironment("Cannot find executable python%s." % version) + + +def create_environment(path, safe=True): + """ + Make it possible to manually create an Environment object by specifying a + Virtualenv path or an executable path. + + :raises: :exc:`.InvalidPythonEnvironment` + :returns: :class:`Environment` + """ + if os.path.isfile(path): + _assert_safe(path, safe) + return Environment(path) + return Environment(_get_executable_path(path, safe=safe)) + + +def _get_executable_path(path, safe=True): + """ + Returns None if it's not actually a virtual env. + """ + + if os.name == 'nt': + python = os.path.join(path, 'Scripts', 'python.exe') + else: + python = os.path.join(path, 'bin', 'python') + if not os.path.exists(python): + raise InvalidPythonEnvironment("%s seems to be missing." % python) + + _assert_safe(python, safe) + return python + + +def _get_executables_from_windows_registry(version): + # The winreg module is named _winreg on Python 2. + try: + import winreg + except ImportError: + import _winreg as winreg + + # TODO: support Python Anaconda. + sub_keys = [ + r'SOFTWARE\Python\PythonCore\{version}\InstallPath', + r'SOFTWARE\Wow6432Node\Python\PythonCore\{version}\InstallPath', + r'SOFTWARE\Python\PythonCore\{version}-32\InstallPath', + r'SOFTWARE\Wow6432Node\Python\PythonCore\{version}-32\InstallPath' + ] + for root_key in [winreg.HKEY_CURRENT_USER, winreg.HKEY_LOCAL_MACHINE]: + for sub_key in sub_keys: + sub_key = sub_key.format(version=version) + try: + with winreg.OpenKey(root_key, sub_key) as key: + prefix = winreg.QueryValueEx(key, '')[0] + exe = os.path.join(prefix, 'python.exe') + if os.path.isfile(exe): + yield exe + except WindowsError: + pass + + +def _assert_safe(executable_path, safe): + if safe and not _is_safe(executable_path): + raise InvalidPythonEnvironment( + "The python binary is potentially unsafe.") + + +def _is_safe(executable_path): + # Resolve sym links. A venv typically is a symlink to a known Python + # binary. Only virtualenvs copy symlinks around. + real_path = os.path.realpath(executable_path) + + if _is_unix_safe_simple(real_path): + return True + + # Just check the list of known Python versions. If it's not in there, + # it's likely an attacker or some Python that was not properly + # installed in the system. + for environment in find_system_environments(): + if environment.executable == real_path: + return True + + # If the versions don't match, just compare the binary files. If we + # don't do that, only venvs will be working and not virtualenvs. + # venvs are symlinks while virtualenvs are actual copies of the + # Python files. + # This still means that if the system Python is updated and the + # virtualenv's Python is not (which is probably never going to get + # upgraded), it will not work with Jedi. IMO that's fine, because + # people should just be using venv. ~ dave + if environment._sha256 == _calculate_sha256_for_file(real_path): + return True + return False + + +def _is_unix_safe_simple(real_path): + if _is_unix_admin(): + # In case we are root, just be conservative and + # only execute known paths. + return any(real_path.startswith(p) for p in _SAFE_PATHS) + + uid = os.stat(real_path).st_uid + # The interpreter needs to be owned by root. This means that it wasn't + # written by a user and therefore attacking Jedi is not as simple. + # The attack could look like the following: + # 1. A user clones a repository. + # 2. The repository has an innocent looking folder called foobar. jedi + # searches for the folder and executes foobar/bin/python --version if + # there's also a foobar/bin/activate. + # 3. The bin/python is obviously not a python script but a bash script or + # whatever the attacker wants. + return uid == 0 + + +def _is_unix_admin(): + try: + return os.getuid() == 0 + except AttributeError: + return False # Windows diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/api/exceptions.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/api/exceptions.py new file mode 100644 index 0000000..99cebdb --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/api/exceptions.py @@ -0,0 +1,10 @@ +class _JediError(Exception): + pass + + +class InternalError(_JediError): + pass + + +class WrongVersion(_JediError): + pass diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/api/file_name.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/api/file_name.py new file mode 100644 index 0000000..2a2c4e6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/api/file_name.py @@ -0,0 +1,161 @@ +import os + +from jedi._compatibility import FileNotFoundError, force_unicode +from jedi.evaluate.names import AbstractArbitraryName +from jedi.api import classes +from jedi.evaluate.helpers import get_str_or_none +from jedi.parser_utils import get_string_quote + + +def file_name_completions(evaluator, module_context, start_leaf, string, + like_name, call_signatures_callback, code_lines, position): + # First we want to find out what can actually be changed as a name. + like_name_length = len(os.path.basename(string) + like_name) + + addition = _get_string_additions(module_context, start_leaf) + if addition is None: + return + string = addition + string + + # Here we use basename again, because if strings are added like + # `'foo' + 'bar`, it should complete to `foobar/`. + must_start_with = os.path.basename(string) + like_name + string = os.path.dirname(string) + + sigs = call_signatures_callback() + is_in_os_path_join = sigs and all(s.full_name == 'os.path.join' for s in sigs) + if is_in_os_path_join: + to_be_added = _add_os_path_join(module_context, start_leaf, sigs[0].bracket_start) + if to_be_added is None: + is_in_os_path_join = False + else: + string = to_be_added + string + base_path = os.path.join(evaluator.project._path, string) + try: + listed = os.listdir(base_path) + except FileNotFoundError: + return + for name in listed: + if name.startswith(must_start_with): + path_for_name = os.path.join(base_path, name) + if is_in_os_path_join or not os.path.isdir(path_for_name): + if start_leaf.type == 'string': + quote = get_string_quote(start_leaf) + else: + assert start_leaf.type == 'error_leaf' + quote = start_leaf.value + potential_other_quote = \ + code_lines[position[0] - 1][position[1]:position[1] + len(quote)] + # Add a quote if it's not already there. + if quote != potential_other_quote: + name += quote + else: + name += os.path.sep + + yield classes.Completion( + evaluator, + FileName(evaluator, name[len(must_start_with) - like_name_length:]), + stack=None, + like_name_length=like_name_length + ) + + +def _get_string_additions(module_context, start_leaf): + def iterate_nodes(): + node = addition.parent + was_addition = True + for child_node in reversed(node.children[:node.children.index(addition)]): + if was_addition: + was_addition = False + yield child_node + continue + + if child_node != '+': + break + was_addition = True + + addition = start_leaf.get_previous_leaf() + if addition != '+': + return '' + context = module_context.create_context(start_leaf) + return _add_strings(context, reversed(list(iterate_nodes()))) + + +def _add_strings(context, nodes, add_slash=False): + string = '' + first = True + for child_node in nodes: + contexts = context.eval_node(child_node) + if len(contexts) != 1: + return None + c, = contexts + s = get_str_or_none(c) + if s is None: + return None + if not first and add_slash: + string += os.path.sep + string += force_unicode(s) + first = False + return string + + +class FileName(AbstractArbitraryName): + api_type = u'path' + is_context_name = False + + +def _add_os_path_join(module_context, start_leaf, bracket_start): + def check(maybe_bracket, nodes): + if maybe_bracket.start_pos != bracket_start: + return None + + if not nodes: + return '' + context = module_context.create_context(nodes[0]) + return _add_strings(context, nodes, add_slash=True) or '' + + if start_leaf.type == 'error_leaf': + # Unfinished string literal, like `join('` + context_node = start_leaf.parent + index = context_node.children.index(start_leaf) + if index > 0: + error_node = context_node.children[index - 1] + if error_node.type == 'error_node' and len(error_node.children) >= 2: + index = -2 + if error_node.children[-1].type == 'arglist': + arglist_nodes = error_node.children[-1].children + index -= 1 + else: + arglist_nodes = [] + + return check(error_node.children[index + 1], arglist_nodes[::2]) + return None + + # Maybe an arglist or some weird error case. Therefore checked below. + searched_node_child = start_leaf + while searched_node_child.parent is not None \ + and searched_node_child.parent.type not in ('arglist', 'trailer', 'error_node'): + searched_node_child = searched_node_child.parent + + if searched_node_child.get_first_leaf() is not start_leaf: + return None + searched_node = searched_node_child.parent + if searched_node is None: + return None + + index = searched_node.children.index(searched_node_child) + arglist_nodes = searched_node.children[:index] + if searched_node.type == 'arglist': + trailer = searched_node.parent + if trailer.type == 'error_node': + trailer_index = trailer.children.index(searched_node) + assert trailer_index >= 2 + assert trailer.children[trailer_index - 1] == '(' + return check(trailer.children[trailer_index - 1], arglist_nodes[::2]) + elif trailer.type == 'trailer': + return check(trailer.children[0], arglist_nodes[::2]) + elif searched_node.type == 'trailer': + return check(searched_node.children[0], []) + elif searched_node.type == 'error_node': + # Stuff like `join(""` + return check(arglist_nodes[-1], []) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/api/helpers.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/api/helpers.py new file mode 100644 index 0000000..6fafb11 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/api/helpers.py @@ -0,0 +1,397 @@ +""" +Helpers for the API +""" +import re +from collections import namedtuple +from textwrap import dedent + +from parso.python.parser import Parser +from parso.python import tree + +from jedi._compatibility import u, Parameter +from jedi.evaluate.base_context import NO_CONTEXTS +from jedi.evaluate.syntax_tree import eval_atom +from jedi.evaluate.helpers import evaluate_call_of_leaf +from jedi.evaluate.compiled import get_string_context_set +from jedi.cache import call_signature_time_cache + + +CompletionParts = namedtuple('CompletionParts', ['path', 'has_dot', 'name']) + + +def sorted_definitions(defs): + # Note: `or ''` below is required because `module_path` could be + return sorted(defs, key=lambda x: (x.module_path or '', x.line or 0, x.column or 0, x.name)) + + +def get_on_completion_name(module_node, lines, position): + leaf = module_node.get_leaf_for_position(position) + if leaf is None or leaf.type in ('string', 'error_leaf'): + # Completions inside strings are a bit special, we need to parse the + # string. The same is true for comments and error_leafs. + line = lines[position[0] - 1] + # The first step of completions is to get the name + return re.search(r'(?!\d)\w+$|$', line[:position[1]]).group(0) + elif leaf.type not in ('name', 'keyword'): + return '' + + return leaf.value[:position[1] - leaf.start_pos[1]] + + +def _get_code(code_lines, start_pos, end_pos): + # Get relevant lines. + lines = code_lines[start_pos[0] - 1:end_pos[0]] + # Remove the parts at the end of the line. + lines[-1] = lines[-1][:end_pos[1]] + # Remove first line indentation. + lines[0] = lines[0][start_pos[1]:] + return ''.join(lines) + + +class OnErrorLeaf(Exception): + @property + def error_leaf(self): + return self.args[0] + + +def _get_code_for_stack(code_lines, leaf, position): + # It might happen that we're on whitespace or on a comment. This means + # that we would not get the right leaf. + if leaf.start_pos >= position: + # If we're not on a comment simply get the previous leaf and proceed. + leaf = leaf.get_previous_leaf() + if leaf is None: + return u('') # At the beginning of the file. + + is_after_newline = leaf.type == 'newline' + while leaf.type == 'newline': + leaf = leaf.get_previous_leaf() + if leaf is None: + return u('') + + if leaf.type == 'error_leaf' or leaf.type == 'string': + if leaf.start_pos[0] < position[0]: + # On a different line, we just begin anew. + return u('') + + # Error leafs cannot be parsed, completion in strings is also + # impossible. + raise OnErrorLeaf(leaf) + else: + user_stmt = leaf + while True: + if user_stmt.parent.type in ('file_input', 'suite', 'simple_stmt'): + break + user_stmt = user_stmt.parent + + if is_after_newline: + if user_stmt.start_pos[1] > position[1]: + # This means that it's actually a dedent and that means that we + # start without context (part of a suite). + return u('') + + # This is basically getting the relevant lines. + return _get_code(code_lines, user_stmt.get_start_pos_of_prefix(), position) + + +def get_stack_at_position(grammar, code_lines, leaf, pos): + """ + Returns the possible node names (e.g. import_from, xor_test or yield_stmt). + """ + class EndMarkerReached(Exception): + pass + + def tokenize_without_endmarker(code): + # TODO This is for now not an official parso API that exists purely + # for Jedi. + tokens = grammar._tokenize(code) + for token in tokens: + if token.string == safeword: + raise EndMarkerReached() + elif token.prefix.endswith(safeword): + # This happens with comments. + raise EndMarkerReached() + elif token.string.endswith(safeword): + yield token # Probably an f-string literal that was not finished. + raise EndMarkerReached() + else: + yield token + + # The code might be indedented, just remove it. + code = dedent(_get_code_for_stack(code_lines, leaf, pos)) + # We use a word to tell Jedi when we have reached the start of the + # completion. + # Use Z as a prefix because it's not part of a number suffix. + safeword = 'ZZZ_USER_WANTS_TO_COMPLETE_HERE_WITH_JEDI' + code = code + ' ' + safeword + + p = Parser(grammar._pgen_grammar, error_recovery=True) + try: + p.parse(tokens=tokenize_without_endmarker(code)) + except EndMarkerReached: + return p.stack + raise SystemError( + "This really shouldn't happen. There's a bug in Jedi:\n%s" + % list(tokenize_without_endmarker(code)) + ) + + +def evaluate_goto_definition(evaluator, context, leaf): + if leaf.type == 'name': + # In case of a name we can just use goto_definition which does all the + # magic itself. + return evaluator.goto_definitions(context, leaf) + + parent = leaf.parent + definitions = NO_CONTEXTS + if parent.type == 'atom': + # e.g. `(a + b)` + definitions = context.eval_node(leaf.parent) + elif parent.type == 'trailer': + # e.g. `a()` + definitions = evaluate_call_of_leaf(context, leaf) + elif isinstance(leaf, tree.Literal): + # e.g. `"foo"` or `1.0` + return eval_atom(context, leaf) + elif leaf.type in ('fstring_string', 'fstring_start', 'fstring_end'): + return get_string_context_set(evaluator) + return definitions + + +class CallDetails(object): + def __init__(self, bracket_leaf, children, position): + ['bracket_leaf', 'call_index', 'keyword_name_str'] + self.bracket_leaf = bracket_leaf + self._children = children + self._position = position + + @property + def index(self): + return _get_index_and_key(self._children, self._position)[0] + + @property + def keyword_name_str(self): + return _get_index_and_key(self._children, self._position)[1] + + def calculate_index(self, param_names): + positional_count = 0 + used_names = set() + star_count = -1 + args = list(_iter_arguments(self._children, self._position)) + if not args: + if param_names: + return 0 + else: + return None + + is_kwarg = False + for i, (star_count, key_start, had_equal) in enumerate(args): + is_kwarg |= had_equal | (star_count == 2) + if star_count: + pass # For now do nothing, we don't know what's in there here. + else: + if i + 1 != len(args): # Not last + if had_equal: + used_names.add(key_start) + else: + positional_count += 1 + + for i, param_name in enumerate(param_names): + kind = param_name.get_kind() + + if not is_kwarg: + if kind == Parameter.VAR_POSITIONAL: + return i + if kind in (Parameter.POSITIONAL_OR_KEYWORD, Parameter.POSITIONAL_ONLY): + if i == positional_count: + return i + + if key_start is not None and not star_count == 1 or star_count == 2: + if param_name.string_name not in used_names \ + and (kind == Parameter.KEYWORD_ONLY + or kind == Parameter.POSITIONAL_OR_KEYWORD + and positional_count <= i): + if star_count: + return i + if had_equal: + if param_name.string_name == key_start: + return i + else: + if param_name.string_name.startswith(key_start): + return i + + if kind == Parameter.VAR_KEYWORD: + return i + return None + + +def _iter_arguments(nodes, position): + def remove_after_pos(name): + if name.type != 'name': + return None + return name.value[:position[1] - name.start_pos[1]] + + # Returns Generator[Tuple[star_count, Optional[key_start: str], had_equal]] + nodes_before = [c for c in nodes if c.start_pos < position] + if nodes_before[-1].type == 'arglist': + for x in _iter_arguments(nodes_before[-1].children, position): + yield x # Python 2 :( + return + + previous_node_yielded = False + stars_seen = 0 + for i, node in enumerate(nodes_before): + if node.type == 'argument': + previous_node_yielded = True + first = node.children[0] + second = node.children[1] + if second == '=': + if second.start_pos < position: + yield 0, first.value, True + else: + yield 0, remove_after_pos(first), False + elif first in ('*', '**'): + yield len(first.value), remove_after_pos(second), False + else: + # Must be a Comprehension + first_leaf = node.get_first_leaf() + if first_leaf.type == 'name' and first_leaf.start_pos >= position: + yield 0, remove_after_pos(first_leaf), False + else: + yield 0, None, False + stars_seen = 0 + elif node.type in ('testlist', 'testlist_star_expr'): # testlist is Python 2 + for n in node.children[::2]: + if n.type == 'star_expr': + stars_seen = 1 + n = n.children[1] + yield stars_seen, remove_after_pos(n), False + stars_seen = 0 + # The count of children is even if there's a comma at the end. + previous_node_yielded = bool(len(node.children) % 2) + elif isinstance(node, tree.PythonLeaf) and node.value == ',': + if not previous_node_yielded: + yield stars_seen, '', False + stars_seen = 0 + previous_node_yielded = False + elif isinstance(node, tree.PythonLeaf) and node.value in ('*', '**'): + stars_seen = len(node.value) + elif node == '=' and nodes_before[-1]: + previous_node_yielded = True + before = nodes_before[i - 1] + if before.type == 'name': + yield 0, before.value, True + else: + yield 0, None, False + # Just ignore the star that is probably a syntax error. + stars_seen = 0 + + if not previous_node_yielded: + if nodes_before[-1].type == 'name': + yield stars_seen, remove_after_pos(nodes_before[-1]), False + else: + yield stars_seen, '', False + + +def _get_index_and_key(nodes, position): + """ + Returns the amount of commas and the keyword argument string. + """ + nodes_before = [c for c in nodes if c.start_pos < position] + if nodes_before[-1].type == 'arglist': + return _get_index_and_key(nodes_before[-1].children, position) + + key_str = None + + last = nodes_before[-1] + if last.type == 'argument' and last.children[1] == '=' \ + and last.children[1].end_pos <= position: + # Checked if the argument + key_str = last.children[0].value + elif last == '=': + key_str = nodes_before[-2].value + + return nodes_before.count(','), key_str + + +def _get_call_signature_details_from_error_node(node, additional_children, position): + for index, element in reversed(list(enumerate(node.children))): + # `index > 0` means that it's a trailer and not an atom. + if element == '(' and element.end_pos <= position and index > 0: + # It's an error node, we don't want to match too much, just + # until the parentheses is enough. + children = node.children[index:] + name = element.get_previous_leaf() + if name is None: + continue + if name.type == 'name' or name.parent.type in ('trailer', 'atom'): + return CallDetails(element, children + additional_children, position) + + +def get_call_signature_details(module, position): + leaf = module.get_leaf_for_position(position, include_prefixes=True) + if leaf.start_pos >= position: + # Whitespace / comments after the leaf count towards the previous leaf. + leaf = leaf.get_previous_leaf() + if leaf is None: + return None + + if leaf == ')': + # TODO is this ok? + if leaf.end_pos == position: + leaf = leaf.get_next_leaf() + + # Now that we know where we are in the syntax tree, we start to look at + # parents for possible function definitions. + node = leaf.parent + while node is not None: + if node.type in ('funcdef', 'classdef'): + # Don't show call signatures if there's stuff before it that just + # makes it feel strange to have a call signature. + return None + + additional_children = [] + for n in reversed(node.children): + if n.start_pos < position: + if n.type == 'error_node': + result = _get_call_signature_details_from_error_node( + n, additional_children, position + ) + if result is not None: + return result + + additional_children[0:0] = n.children + continue + additional_children.insert(0, n) + + if node.type == 'trailer' and node.children[0] == '(': + leaf = node.get_previous_leaf() + if leaf is None: + return None + return CallDetails(node.children[0], node.children, position) + + node = node.parent + + return None + + +@call_signature_time_cache("call_signatures_validity") +def cache_call_signatures(evaluator, context, bracket_leaf, code_lines, user_pos): + """This function calculates the cache key.""" + line_index = user_pos[0] - 1 + + before_cursor = code_lines[line_index][:user_pos[1]] + other_lines = code_lines[bracket_leaf.start_pos[0]:line_index] + whole = ''.join(other_lines + [before_cursor]) + before_bracket = re.match(r'.*\(', whole, re.DOTALL) + + module_path = context.get_root_context().py__file__() + if module_path is None: + yield None # Don't cache! + else: + yield (module_path, before_bracket, bracket_leaf.start_pos) + yield evaluate_goto_definition( + evaluator, + context, + bracket_leaf.get_previous_leaf(), + ) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/api/interpreter.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/api/interpreter.py new file mode 100644 index 0000000..515e007 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/api/interpreter.py @@ -0,0 +1,47 @@ +""" +TODO Some parts of this module are still not well documented. +""" + +from jedi.evaluate.context import ModuleContext +from jedi.evaluate import compiled +from jedi.evaluate.compiled import mixed +from jedi.evaluate.compiled.access import create_access_path +from jedi.evaluate.base_context import ContextWrapper + + +def _create(evaluator, obj): + return compiled.create_from_access_path( + evaluator, create_access_path(evaluator, obj) + ) + + +class NamespaceObject(object): + def __init__(self, dct): + self.__dict__ = dct + + +class MixedModuleContext(ContextWrapper): + type = 'mixed_module' + + def __init__(self, evaluator, tree_module, namespaces, file_io, code_lines): + module_context = ModuleContext( + evaluator, tree_module, + file_io=file_io, + string_names=('__main__',), + code_lines=code_lines + ) + super(MixedModuleContext, self).__init__(module_context) + self._namespace_objects = [NamespaceObject(n) for n in namespaces] + + def get_filters(self, *args, **kwargs): + for filter in self._wrapped_context.get_filters(*args, **kwargs): + yield filter + + for namespace_obj in self._namespace_objects: + compiled_object = _create(self.evaluator, namespace_obj) + mixed_object = mixed.MixedObject( + compiled_object=compiled_object, + tree_context=self._wrapped_context + ) + for filter in mixed_object.get_filters(*args, **kwargs): + yield filter diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/api/keywords.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/api/keywords.py new file mode 100644 index 0000000..cc301b8 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/api/keywords.py @@ -0,0 +1,85 @@ +import pydoc + +from jedi.evaluate.utils import ignored +from jedi.evaluate.names import AbstractArbitraryName + +try: + from pydoc_data import topics as pydoc_topics +except ImportError: + # Python 2 + try: + import pydoc_topics + except ImportError: + # This is for Python 3 embeddable version, which dont have + # pydoc_data module in its file python3x.zip. + pydoc_topics = None + + +def get_operator(evaluator, string, pos): + return Keyword(evaluator, string, pos) + + +class KeywordName(AbstractArbitraryName): + api_type = u'keyword' + + def infer(self): + return [Keyword(self.evaluator, self.string_name, (0, 0))] + + +class Keyword(object): + api_type = u'keyword' + + def __init__(self, evaluator, name, pos): + self.name = KeywordName(evaluator, name) + self.start_pos = pos + self.parent = evaluator.builtins_module + + @property + def names(self): + """ For a `parsing.Name` like comparision """ + return [self.name] + + def py__doc__(self): + return imitate_pydoc(self.name.string_name) + + def get_signatures(self): + # TODO this makes no sense, I think Keyword should somehow merge with + # Context to make it easier for the api/classes.py to deal with all + # of it. + return [] + + def __repr__(self): + return '<%s: %s>' % (type(self).__name__, self.name) + + +def imitate_pydoc(string): + """ + It's not possible to get the pydoc's without starting the annoying pager + stuff. + """ + if pydoc_topics is None: + return '' + + # str needed because of possible unicode stuff in py2k (pydoc doesn't work + # with unicode strings) + string = str(string) + h = pydoc.help + with ignored(KeyError): + # try to access symbols + string = h.symbols[string] + string, _, related = string.partition(' ') + + get_target = lambda s: h.topics.get(s, h.keywords.get(s)) + while isinstance(string, str): + string = get_target(string) + + try: + # is a tuple now + label, related = string + except TypeError: + return '' + + try: + return pydoc_topics.topics[label].strip() if pydoc_topics else '' + except KeyError: + return '' diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/api/project.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/api/project.py new file mode 100644 index 0000000..63ee2b8 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/api/project.py @@ -0,0 +1,197 @@ +import os +import json + +from jedi._compatibility import FileNotFoundError, PermissionError, IsADirectoryError +from jedi.api.environment import SameEnvironment, \ + get_cached_default_environment +from jedi.api.exceptions import WrongVersion +from jedi._compatibility import force_unicode +from jedi.evaluate.sys_path import discover_buildout_paths +from jedi.evaluate.cache import evaluator_as_method_param_cache +from jedi.common.utils import traverse_parents + +_CONFIG_FOLDER = '.jedi' +_CONTAINS_POTENTIAL_PROJECT = 'setup.py', '.git', '.hg', 'requirements.txt', 'MANIFEST.in' + +_SERIALIZER_VERSION = 1 + + +def _remove_duplicates_from_path(path): + used = set() + for p in path: + if p in used: + continue + used.add(p) + yield p + + +def _force_unicode_list(lst): + return list(map(force_unicode, lst)) + + +class Project(object): + # TODO serialize environment + _serializer_ignore_attributes = ('_environment',) + _environment = None + + @staticmethod + def _get_json_path(base_path): + return os.path.join(base_path, _CONFIG_FOLDER, 'project.json') + + @classmethod + def load(cls, path): + """ + :param path: The path of the directory you want to use as a project. + """ + with open(cls._get_json_path(path)) as f: + version, data = json.load(f) + + if version == 1: + self = cls.__new__() + self.__dict__.update(data) + return self + else: + raise WrongVersion( + "The Jedi version of this project seems newer than what we can handle." + ) + + def __init__(self, path, **kwargs): + """ + :param path: The base path for this project. + :param sys_path: list of str. You can override the sys path if you + want. By default the ``sys.path.`` is generated from the + environment (virtualenvs, etc). + :param smart_sys_path: If this is enabled (default), adds paths from + local directories. Otherwise you will have to rely on your packages + being properly configured on the ``sys.path``. + """ + def py2_comp(path, environment=None, sys_path=None, + smart_sys_path=True, _django=False): + self._path = os.path.abspath(path) + if isinstance(environment, SameEnvironment): + self._environment = environment + + self._sys_path = sys_path + self._smart_sys_path = smart_sys_path + self._django = _django + + py2_comp(path, **kwargs) + + @evaluator_as_method_param_cache() + def _get_base_sys_path(self, evaluator, environment=None): + if self._sys_path is not None: + return self._sys_path + + # The sys path has not been set explicitly. + if environment is None: + environment = self.get_environment() + + sys_path = list(environment.get_sys_path()) + try: + sys_path.remove('') + except ValueError: + pass + return sys_path + + @evaluator_as_method_param_cache() + def _get_sys_path(self, evaluator, environment=None, add_parent_paths=True): + """ + Keep this method private for all users of jedi. However internally this + one is used like a public method. + """ + suffixed = [] + prefixed = [] + + sys_path = list(self._get_base_sys_path(evaluator, environment)) + if self._smart_sys_path: + prefixed.append(self._path) + + if evaluator.script_path is not None: + suffixed += discover_buildout_paths(evaluator, evaluator.script_path) + + if add_parent_paths: + traversed = list(traverse_parents(evaluator.script_path)) + + # AFAIK some libraries have imports like `foo.foo.bar`, which + # leads to the conclusion to by default prefer longer paths + # rather than shorter ones by default. + suffixed += reversed(traversed) + + if self._django: + prefixed.append(self._path) + + path = prefixed + sys_path + suffixed + return list(_force_unicode_list(_remove_duplicates_from_path(path))) + + def save(self): + data = dict(self.__dict__) + for attribute in self._serializer_ignore_attributes: + data.pop(attribute, None) + + with open(self._get_json_path(self._path), 'wb') as f: + return json.dump((_SERIALIZER_VERSION, data), f) + + def get_environment(self): + if self._environment is None: + return get_cached_default_environment() + + return self._environment + + def __repr__(self): + return '<%s: %s>' % (self.__class__.__name__, self._path) + + +def _is_potential_project(path): + for name in _CONTAINS_POTENTIAL_PROJECT: + if os.path.exists(os.path.join(path, name)): + return True + return False + + +def _is_django_path(directory): + """ Detects the path of the very well known Django library (if used) """ + try: + with open(os.path.join(directory, 'manage.py'), 'rb') as f: + return b"DJANGO_SETTINGS_MODULE" in f.read() + except (FileNotFoundError, IsADirectoryError, PermissionError): + return False + + return False + + +def get_default_project(path=None): + if path is None: + path = os.getcwd() + + check = os.path.realpath(path) + probable_path = None + first_no_init_file = None + for dir in traverse_parents(check, include_current=True): + try: + return Project.load(dir) + except (FileNotFoundError, IsADirectoryError, PermissionError): + pass + + if first_no_init_file is None: + if os.path.exists(os.path.join(dir, '__init__.py')): + # In the case that a __init__.py exists, it's in 99% just a + # Python package and the project sits at least one level above. + continue + else: + first_no_init_file = dir + + if _is_django_path(dir): + return Project(dir, _django=True) + + if probable_path is None and _is_potential_project(dir): + probable_path = dir + + if probable_path is not None: + # TODO search for setup.py etc + return Project(probable_path) + + if first_no_init_file is not None: + return Project(first_no_init_file) + + curdir = path if os.path.isdir(path) else os.path.dirname(path) + return Project(curdir) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/api/replstartup.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/api/replstartup.py new file mode 100644 index 0000000..3ac8470 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/api/replstartup.py @@ -0,0 +1,29 @@ +""" +To use Jedi completion in Python interpreter, add the following in your shell +setup (e.g., ``.bashrc``). This works only on Linux/Mac, because readline is +not available on Windows. If you still want Jedi autocompletion in your REPL, +just use IPython instead:: + + export PYTHONSTARTUP="$(python -m jedi repl)" + +Then you will be able to use Jedi completer in your Python interpreter:: + + $ python + Python 2.7.2+ (default, Jul 20 2012, 22:15:08) + [GCC 4.6.1] on linux2 + Type "help", "copyright", "credits" or "license" for more information. + >>> import os + >>> os.path.join('a', 'b').split().in # doctest: +SKIP + ..dex ..sert + +""" +import jedi.utils +from jedi import __version__ as __jedi_version__ + +print('REPL completion using Jedi %s' % __jedi_version__) +jedi.utils.setup_readline() + +del jedi + +# Note: try not to do many things here, as it will contaminate global +# namespace of the interpreter. diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/cache.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/cache.py new file mode 100644 index 0000000..93e2bd7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/cache.py @@ -0,0 +1,146 @@ +""" +This caching is very important for speed and memory optimizations. There's +nothing really spectacular, just some decorators. The following cache types are +available: + +- ``time_cache`` can be used to cache something for just a limited time span, + which can be useful if there's user interaction and the user cannot react + faster than a certain time. + +This module is one of the reasons why |jedi| is not thread-safe. As you can see +there are global variables, which are holding the cache information. Some of +these variables are being cleaned after every API usage. +""" +import time +from functools import wraps + +from jedi import settings +from parso.cache import parser_cache + +_time_caches = {} + + +def underscore_memoization(func): + """ + Decorator for methods:: + + class A(object): + def x(self): + if self._x: + self._x = 10 + return self._x + + Becomes:: + + class A(object): + @underscore_memoization + def x(self): + return 10 + + A now has an attribute ``_x`` written by this decorator. + """ + name = '_' + func.__name__ + + def wrapper(self): + try: + return getattr(self, name) + except AttributeError: + result = func(self) + setattr(self, name, result) + return result + + return wrapper + + +def clear_time_caches(delete_all=False): + """ Jedi caches many things, that should be completed after each completion + finishes. + + :param delete_all: Deletes also the cache that is normally not deleted, + like parser cache, which is important for faster parsing. + """ + global _time_caches + + if delete_all: + for cache in _time_caches.values(): + cache.clear() + parser_cache.clear() + else: + # normally just kill the expired entries, not all + for tc in _time_caches.values(): + # check time_cache for expired entries + for key, (t, value) in list(tc.items()): + if t < time.time(): + # delete expired entries + del tc[key] + + +def call_signature_time_cache(time_add_setting): + """ + This decorator works as follows: Call it with a setting and after that + use the function with a callable that returns the key. + But: This function is only called if the key is not available. After a + certain amount of time (`time_add_setting`) the cache is invalid. + + If the given key is None, the function will not be cached. + """ + def _temp(key_func): + dct = {} + _time_caches[time_add_setting] = dct + + def wrapper(*args, **kwargs): + generator = key_func(*args, **kwargs) + key = next(generator) + try: + expiry, value = dct[key] + if expiry > time.time(): + return value + except KeyError: + pass + + value = next(generator) + time_add = getattr(settings, time_add_setting) + if key is not None: + dct[key] = time.time() + time_add, value + return value + return wrapper + return _temp + + +def time_cache(seconds): + def decorator(func): + cache = {} + + @wraps(func) + def wrapper(*args, **kwargs): + key = (args, frozenset(kwargs.items())) + try: + created, result = cache[key] + if time.time() < created + seconds: + return result + except KeyError: + pass + result = func(*args, **kwargs) + cache[key] = time.time(), result + return result + + wrapper.clear_cache = lambda: cache.clear() + return wrapper + + return decorator + + +def memoize_method(method): + """A normal memoize function.""" + @wraps(method) + def wrapper(self, *args, **kwargs): + cache_dict = self.__dict__.setdefault('_memoize_method_dct', {}) + dct = cache_dict.setdefault(method, {}) + key = (args, frozenset(kwargs.items())) + try: + return dct[key] + except KeyError: + result = method(self, *args, **kwargs) + dct[key] = result + return result + return wrapper diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/common/__init__.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/common/__init__.py new file mode 100644 index 0000000..702a5e6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/common/__init__.py @@ -0,0 +1 @@ +from jedi.common.context import BaseContextSet, BaseContext diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/common/context.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/common/context.py new file mode 100644 index 0000000..92a5fe0 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/common/context.py @@ -0,0 +1,73 @@ +class BaseContext(object): + def __init__(self, evaluator, parent_context=None): + self.evaluator = evaluator + self.parent_context = parent_context + + def get_root_context(self): + context = self + while True: + if context.parent_context is None: + return context + context = context.parent_context + + +class BaseContextSet(object): + def __init__(self, iterable): + self._set = frozenset(iterable) + for context in iterable: + assert not isinstance(context, BaseContextSet) + + @classmethod + def _from_frozen_set(cls, frozenset_): + self = cls.__new__(cls) + self._set = frozenset_ + return self + + @classmethod + def from_sets(cls, sets): + """ + Used to work with an iterable of set. + """ + aggregated = set() + for set_ in sets: + if isinstance(set_, BaseContextSet): + aggregated |= set_._set + else: + aggregated |= frozenset(set_) + return cls._from_frozen_set(frozenset(aggregated)) + + def __or__(self, other): + return self._from_frozen_set(self._set | other._set) + + def __and__(self, other): + return self._from_frozen_set(self._set & other._set) + + def __iter__(self): + for element in self._set: + yield element + + def __bool__(self): + return bool(self._set) + + def __len__(self): + return len(self._set) + + def __repr__(self): + return 'S{%s}' % (', '.join(str(s) for s in self._set)) + + def filter(self, filter_func): + return self.__class__(filter(filter_func, self._set)) + + def __getattr__(self, name): + def mapper(*args, **kwargs): + return self.from_sets( + getattr(context, name)(*args, **kwargs) + for context in self._set + ) + return mapper + + def __eq__(self, other): + return self._set == other._set + + def __hash__(self): + return hash(self._set) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/common/utils.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/common/utils.py new file mode 100644 index 0000000..92ff52e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/common/utils.py @@ -0,0 +1,26 @@ +import os +from contextlib import contextmanager + + +def traverse_parents(path, include_current=False): + if not include_current: + path = os.path.dirname(path) + + previous = None + while previous != path: + yield path + previous = path + path = os.path.dirname(path) + + +@contextmanager +def monkeypatch(obj, attribute_name, new_value): + """ + Like pytest's monkeypatch, but as a context manager. + """ + old_value = getattr(obj, attribute_name) + try: + setattr(obj, attribute_name, new_value) + yield + finally: + setattr(obj, attribute_name, old_value) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/debug.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/debug.py new file mode 100644 index 0000000..4136acf --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/debug.py @@ -0,0 +1,143 @@ +import os +import time +from contextlib import contextmanager + +from jedi._compatibility import encoding, is_py3, u + +_inited = False + + +def _lazy_colorama_init(): + """ + Lazily init colorama if necessary, not to screw up stdout if debugging is + not enabled. + + This version of the function does nothing. + """ + + +try: + if os.name == 'nt': + # Does not work on Windows, as pyreadline and colorama interfere + raise ImportError + else: + # Use colorama for nicer console output. + from colorama import Fore, init + from colorama import initialise + + def _lazy_colorama_init(): # noqa: F811 + """ + Lazily init colorama if necessary, not to screw up stdout is + debug not enabled. + + This version of the function does init colorama. + """ + global _inited + if not _inited: + # pytest resets the stream at the end - causes troubles. Since + # after every output the stream is reset automatically we don't + # need this. + initialise.atexit_done = True + try: + init(strip=False) + except Exception: + # Colorama fails with initializing under vim and is buggy in + # version 0.3.6. + pass + _inited = True + +except ImportError: + class Fore(object): + RED = '' + GREEN = '' + YELLOW = '' + MAGENTA = '' + RESET = '' + BLUE = '' + +NOTICE = object() +WARNING = object() +SPEED = object() + +enable_speed = False +enable_warning = False +enable_notice = False + +# callback, interface: level, str +debug_function = None +_debug_indent = 0 +_start_time = time.time() + + +def reset_time(): + global _start_time, _debug_indent + _start_time = time.time() + _debug_indent = 0 + + +def increase_indent(func): + """Decorator for makin """ + def wrapper(*args, **kwargs): + with increase_indent_cm(): + return func(*args, **kwargs) + return wrapper + + +@contextmanager +def increase_indent_cm(title=None): + global _debug_indent + if title: + dbg('Start: ' + title, color='MAGENTA') + _debug_indent += 1 + try: + yield + finally: + _debug_indent -= 1 + if title: + dbg('End: ' + title, color='MAGENTA') + + +def dbg(message, *args, **kwargs): + """ Looks at the stack, to see if a debug message should be printed. """ + # Python 2 compatibility, because it doesn't understand default args + color = kwargs.pop('color', 'GREEN') + assert color + + if debug_function and enable_notice: + i = ' ' * _debug_indent + _lazy_colorama_init() + debug_function(color, i + 'dbg: ' + message % tuple(u(repr(a)) for a in args)) + + +def warning(message, *args, **kwargs): + format = kwargs.pop('format', True) + assert not kwargs + + if debug_function and enable_warning: + i = ' ' * _debug_indent + if format: + message = message % tuple(u(repr(a)) for a in args) + debug_function('RED', i + 'warning: ' + message) + + +def speed(name): + if debug_function and enable_speed: + now = time.time() + i = ' ' * _debug_indent + debug_function('YELLOW', i + 'speed: ' + '%s %s' % (name, now - _start_time)) + + +def print_to_stdout(color, str_out): + """ + The default debug function that prints to standard out. + + :param str color: A string that is an attribute of ``colorama.Fore``. + """ + col = getattr(Fore, color) + _lazy_colorama_init() + if not is_py3: + str_out = str_out.encode(encoding, 'replace') + print(col + str_out + Fore.RESET) + + +# debug_function = print_to_stdout diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/__init__.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/__init__.py new file mode 100644 index 0000000..a4f7e90 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/__init__.py @@ -0,0 +1,443 @@ +""" +Evaluation of Python code in |jedi| is based on three assumptions: + +* The code uses as least side effects as possible. Jedi understands certain + list/tuple/set modifications, but there's no guarantee that Jedi detects + everything (list.append in different modules for example). +* No magic is being used: + + - metaclasses + - ``setattr()`` / ``__import__()`` + - writing to ``globals()``, ``locals()``, ``object.__dict__`` +* The programmer is not a total dick, e.g. like `this + `_ :-) + +The actual algorithm is based on a principle called lazy evaluation. That +said, the typical entry point for static analysis is calling +``eval_expr_stmt``. There's separate logic for autocompletion in the API, the +evaluator is all about evaluating an expression. + +TODO this paragraph is not what jedi does anymore, it's similar, but not the +same. + +Now you need to understand what follows after ``eval_expr_stmt``. Let's +make an example:: + + import datetime + datetime.date.toda# <-- cursor here + +First of all, this module doesn't care about completion. It really just cares +about ``datetime.date``. At the end of the procedure ``eval_expr_stmt`` will +return the ``date`` class. + +To *visualize* this (simplified): + +- ``Evaluator.eval_expr_stmt`` doesn't do much, because there's no assignment. +- ``Context.eval_node`` cares for resolving the dotted path +- ``Evaluator.find_types`` searches for global definitions of datetime, which + it finds in the definition of an import, by scanning the syntax tree. +- Using the import logic, the datetime module is found. +- Now ``find_types`` is called again by ``eval_node`` to find ``date`` + inside the datetime module. + +Now what would happen if we wanted ``datetime.date.foo.bar``? Two more +calls to ``find_types``. However the second call would be ignored, because the +first one would return nothing (there's no foo attribute in ``date``). + +What if the import would contain another ``ExprStmt`` like this:: + + from foo import bar + Date = bar.baz + +Well... You get it. Just another ``eval_expr_stmt`` recursion. It's really +easy. Python can obviously get way more complicated then this. To understand +tuple assignments, list comprehensions and everything else, a lot more code had +to be written. + +Jedi has been tested very well, so you can just start modifying code. It's best +to write your own test first for your "new" feature. Don't be scared of +breaking stuff. As long as the tests pass, you're most likely to be fine. + +I need to mention now that lazy evaluation is really good because it +only *evaluates* what needs to be *evaluated*. All the statements and modules +that are not used are just being ignored. +""" +from parso.python import tree +import parso +from parso import python_bytes_to_unicode +from jedi.file_io import FileIO + +from jedi import debug +from jedi import parser_utils +from jedi.evaluate.utils import unite +from jedi.evaluate import imports +from jedi.evaluate import recursion +from jedi.evaluate.cache import evaluator_function_cache +from jedi.evaluate import helpers +from jedi.evaluate.names import TreeNameDefinition, ParamName +from jedi.evaluate.base_context import ContextualizedName, ContextualizedNode, \ + ContextSet, NO_CONTEXTS, iterate_contexts +from jedi.evaluate.context import ClassContext, FunctionContext, \ + AnonymousInstance, BoundMethod +from jedi.evaluate.context.iterable import CompForContext +from jedi.evaluate.syntax_tree import eval_trailer, eval_expr_stmt, \ + eval_node, check_tuple_assignments +from jedi.plugins import plugin_manager + + +class Evaluator(object): + def __init__(self, project, environment=None, script_path=None): + if environment is None: + environment = project.get_environment() + self.environment = environment + self.script_path = script_path + self.compiled_subprocess = environment.get_evaluator_subprocess(self) + self.grammar = environment.get_grammar() + + self.latest_grammar = parso.load_grammar(version='3.7') + self.memoize_cache = {} # for memoize decorators + self.module_cache = imports.ModuleCache() # does the job of `sys.modules`. + self.stub_module_cache = {} # Dict[Tuple[str, ...], Optional[ModuleContext]] + self.compiled_cache = {} # see `evaluate.compiled.create()` + self.inferred_element_counts = {} + self.mixed_cache = {} # see `evaluate.compiled.mixed._create()` + self.analysis = [] + self.dynamic_params_depth = 0 + self.is_analysis = False + self.project = project + self.access_cache = {} + self.allow_descriptor_getattr = False + + self.reset_recursion_limitations() + self.allow_different_encoding = True + + def import_module(self, import_names, parent_module_context=None, + sys_path=None, prefer_stubs=True): + if sys_path is None: + sys_path = self.get_sys_path() + return imports.import_module(self, import_names, parent_module_context, + sys_path, prefer_stubs=prefer_stubs) + + @staticmethod + @plugin_manager.decorate() + def execute(context, arguments): + debug.dbg('execute: %s %s', context, arguments) + with debug.increase_indent_cm(): + context_set = context.py__call__(arguments=arguments) + debug.dbg('execute result: %s in %s', context_set, context) + return context_set + + @property + @evaluator_function_cache() + def builtins_module(self): + module_name = u'builtins' + if self.environment.version_info.major == 2: + module_name = u'__builtin__' + builtins_module, = self.import_module((module_name,), sys_path=()) + return builtins_module + + @property + @evaluator_function_cache() + def typing_module(self): + typing_module, = self.import_module((u'typing',)) + return typing_module + + def reset_recursion_limitations(self): + self.recursion_detector = recursion.RecursionDetector() + self.execution_recursion_detector = recursion.ExecutionRecursionDetector(self) + + def get_sys_path(self, **kwargs): + """Convenience function""" + return self.project._get_sys_path(self, environment=self.environment, **kwargs) + + def eval_element(self, context, element): + if isinstance(context, CompForContext): + return eval_node(context, element) + + if_stmt = element + while if_stmt is not None: + if_stmt = if_stmt.parent + if if_stmt.type in ('if_stmt', 'for_stmt'): + break + if parser_utils.is_scope(if_stmt): + if_stmt = None + break + predefined_if_name_dict = context.predefined_names.get(if_stmt) + # TODO there's a lot of issues with this one. We actually should do + # this in a different way. Caching should only be active in certain + # cases and this all sucks. + if predefined_if_name_dict is None and if_stmt \ + and if_stmt.type == 'if_stmt' and self.is_analysis: + if_stmt_test = if_stmt.children[1] + name_dicts = [{}] + # If we already did a check, we don't want to do it again -> If + # context.predefined_names is filled, we stop. + # We don't want to check the if stmt itself, it's just about + # the content. + if element.start_pos > if_stmt_test.end_pos: + # Now we need to check if the names in the if_stmt match the + # names in the suite. + if_names = helpers.get_names_of_node(if_stmt_test) + element_names = helpers.get_names_of_node(element) + str_element_names = [e.value for e in element_names] + if any(i.value in str_element_names for i in if_names): + for if_name in if_names: + definitions = self.goto_definitions(context, if_name) + # Every name that has multiple different definitions + # causes the complexity to rise. The complexity should + # never fall below 1. + if len(definitions) > 1: + if len(name_dicts) * len(definitions) > 16: + debug.dbg('Too many options for if branch evaluation %s.', if_stmt) + # There's only a certain amount of branches + # Jedi can evaluate, otherwise it will take to + # long. + name_dicts = [{}] + break + + original_name_dicts = list(name_dicts) + name_dicts = [] + for definition in definitions: + new_name_dicts = list(original_name_dicts) + for i, name_dict in enumerate(new_name_dicts): + new_name_dicts[i] = name_dict.copy() + new_name_dicts[i][if_name.value] = ContextSet([definition]) + + name_dicts += new_name_dicts + else: + for name_dict in name_dicts: + name_dict[if_name.value] = definitions + if len(name_dicts) > 1: + result = NO_CONTEXTS + for name_dict in name_dicts: + with helpers.predefine_names(context, if_stmt, name_dict): + result |= eval_node(context, element) + return result + else: + return self._eval_element_if_evaluated(context, element) + else: + if predefined_if_name_dict: + return eval_node(context, element) + else: + return self._eval_element_if_evaluated(context, element) + + def _eval_element_if_evaluated(self, context, element): + """ + TODO This function is temporary: Merge with eval_element. + """ + parent = element + while parent is not None: + parent = parent.parent + predefined_if_name_dict = context.predefined_names.get(parent) + if predefined_if_name_dict is not None: + return eval_node(context, element) + return self._eval_element_cached(context, element) + + @evaluator_function_cache(default=NO_CONTEXTS) + def _eval_element_cached(self, context, element): + return eval_node(context, element) + + def goto_definitions(self, context, name): + def_ = name.get_definition(import_name_always=True) + if def_ is not None: + type_ = def_.type + is_classdef = type_ == 'classdef' + if is_classdef or type_ == 'funcdef': + if is_classdef: + c = ClassContext(self, context, name.parent) + else: + c = FunctionContext.from_context(context, name.parent) + return ContextSet([c]) + + if type_ == 'expr_stmt': + is_simple_name = name.parent.type not in ('power', 'trailer') + if is_simple_name: + return eval_expr_stmt(context, def_, name) + if type_ == 'for_stmt': + container_types = context.eval_node(def_.children[3]) + cn = ContextualizedNode(context, def_.children[3]) + for_types = iterate_contexts(container_types, cn) + c_node = ContextualizedName(context, name) + return check_tuple_assignments(self, c_node, for_types) + if type_ in ('import_from', 'import_name'): + return imports.infer_import(context, name) + else: + result = self._follow_error_node_imports_if_possible(context, name) + if result is not None: + return result + + return helpers.evaluate_call_of_leaf(context, name) + + def _follow_error_node_imports_if_possible(self, context, name): + error_node = tree.search_ancestor(name, 'error_node') + if error_node is not None: + # Get the first command start of a started simple_stmt. The error + # node is sometimes a small_stmt and sometimes a simple_stmt. Check + # for ; leaves that start a new statements. + start_index = 0 + for index, n in enumerate(error_node.children): + if n.start_pos > name.start_pos: + break + if n == ';': + start_index = index + 1 + nodes = error_node.children[start_index:] + first_name = nodes[0].get_first_leaf().value + + # Make it possible to infer stuff like `import foo.` or + # `from foo.bar`. + if first_name in ('from', 'import'): + is_import_from = first_name == 'from' + level, names = helpers.parse_dotted_names( + nodes, + is_import_from=is_import_from, + until_node=name, + ) + return imports.Importer(self, names, context.get_root_context(), level).follow() + return None + + def goto(self, context, name): + definition = name.get_definition(import_name_always=True) + if definition is not None: + type_ = definition.type + if type_ == 'expr_stmt': + # Only take the parent, because if it's more complicated than just + # a name it's something you can "goto" again. + is_simple_name = name.parent.type not in ('power', 'trailer') + if is_simple_name: + return [TreeNameDefinition(context, name)] + elif type_ == 'param': + return [ParamName(context, name)] + elif type_ in ('import_from', 'import_name'): + module_names = imports.infer_import(context, name, is_goto=True) + return module_names + else: + return [TreeNameDefinition(context, name)] + else: + contexts = self._follow_error_node_imports_if_possible(context, name) + if contexts is not None: + return [context.name for context in contexts] + + par = name.parent + node_type = par.type + if node_type == 'argument' and par.children[1] == '=' and par.children[0] == name: + # Named param goto. + trailer = par.parent + if trailer.type == 'arglist': + trailer = trailer.parent + if trailer.type != 'classdef': + if trailer.type == 'decorator': + context_set = context.eval_node(trailer.children[1]) + else: + i = trailer.parent.children.index(trailer) + to_evaluate = trailer.parent.children[:i] + if to_evaluate[0] == 'await': + to_evaluate.pop(0) + context_set = context.eval_node(to_evaluate[0]) + for trailer in to_evaluate[1:]: + context_set = eval_trailer(context, context_set, trailer) + param_names = [] + for context in context_set: + for signature in context.get_signatures(): + for param_name in signature.get_param_names(): + if param_name.string_name == name.value: + param_names.append(param_name) + return param_names + elif node_type == 'dotted_name': # Is a decorator. + index = par.children.index(name) + if index > 0: + new_dotted = helpers.deep_ast_copy(par) + new_dotted.children[index - 1:] = [] + values = context.eval_node(new_dotted) + return unite( + value.py__getattribute__(name, name_context=context, is_goto=True) + for value in values + ) + + if node_type == 'trailer' and par.children[0] == '.': + values = helpers.evaluate_call_of_leaf(context, name, cut_own_trailer=True) + return values.py__getattribute__(name, name_context=context, is_goto=True) + else: + stmt = tree.search_ancestor( + name, 'expr_stmt', 'lambdef' + ) or name + if stmt.type == 'lambdef': + stmt = name + return context.py__getattribute__( + name, + position=stmt.start_pos, + search_global=True, is_goto=True + ) + + def create_context(self, base_context, node, node_is_context=False, node_is_object=False): + def parent_scope(node): + while True: + node = node.parent + + if parser_utils.is_scope(node): + return node + elif node.type in ('argument', 'testlist_comp'): + if node.children[1].type in ('comp_for', 'sync_comp_for'): + return node.children[1] + elif node.type == 'dictorsetmaker': + for n in node.children[1:4]: + # In dictionaries it can be pretty much anything. + if n.type in ('comp_for', 'sync_comp_for'): + return n + + def from_scope_node(scope_node, is_nested=True, node_is_object=False): + if scope_node == base_node: + return base_context + + is_funcdef = scope_node.type in ('funcdef', 'lambdef') + parent_scope = parser_utils.get_parent_scope(scope_node) + parent_context = from_scope_node(parent_scope) + + if is_funcdef: + func = FunctionContext.from_context(parent_context, scope_node) + if parent_context.is_class(): + instance = AnonymousInstance( + self, parent_context.parent_context, parent_context) + func = BoundMethod( + instance=instance, + function=func + ) + + if is_nested and not node_is_object: + return func.get_function_execution() + return func + elif scope_node.type == 'classdef': + return ClassContext(self, parent_context, scope_node) + elif scope_node.type in ('comp_for', 'sync_comp_for'): + if node.start_pos >= scope_node.children[-1].start_pos: + return parent_context + return CompForContext.from_comp_for(parent_context, scope_node) + raise Exception("There's a scope that was not managed.") + + base_node = base_context.tree_node + + if node_is_context and parser_utils.is_scope(node): + scope_node = node + else: + scope_node = parent_scope(node) + if scope_node.type in ('funcdef', 'classdef'): + colon = scope_node.children[scope_node.children.index(':')] + if node.start_pos < colon.start_pos: + parent = node.parent + if not (parent.type == 'param' and parent.name == node): + scope_node = parent_scope(scope_node) + return from_scope_node(scope_node, is_nested=True, node_is_object=node_is_object) + + def parse_and_get_code(self, code=None, path=None, encoding='utf-8', + use_latest_grammar=False, file_io=None, **kwargs): + if self.allow_different_encoding: + if code is None: + if file_io is None: + file_io = FileIO(path) + code = file_io.read() + code = python_bytes_to_unicode(code, encoding=encoding, errors='replace') + + grammar = self.latest_grammar if use_latest_grammar else self.grammar + return grammar.parse(code=code, path=path, file_io=file_io, **kwargs), code + + def parse(self, *args, **kwargs): + return self.parse_and_get_code(*args, **kwargs)[0] diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/analysis.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/analysis.py new file mode 100644 index 0000000..47f1bbd --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/analysis.py @@ -0,0 +1,224 @@ +""" +Module for statical analysis. +""" +from parso.python import tree + +from jedi._compatibility import force_unicode +from jedi import debug +from jedi.evaluate.helpers import is_string + + +CODES = { + 'attribute-error': (1, AttributeError, 'Potential AttributeError.'), + 'name-error': (2, NameError, 'Potential NameError.'), + 'import-error': (3, ImportError, 'Potential ImportError.'), + 'type-error-too-many-arguments': (4, TypeError, None), + 'type-error-too-few-arguments': (5, TypeError, None), + 'type-error-keyword-argument': (6, TypeError, None), + 'type-error-multiple-values': (7, TypeError, None), + 'type-error-star-star': (8, TypeError, None), + 'type-error-star': (9, TypeError, None), + 'type-error-operation': (10, TypeError, None), + 'type-error-not-iterable': (11, TypeError, None), + 'type-error-isinstance': (12, TypeError, None), + 'type-error-not-subscriptable': (13, TypeError, None), + 'value-error-too-many-values': (14, ValueError, None), + 'value-error-too-few-values': (15, ValueError, None), +} + + +class Error(object): + def __init__(self, name, module_path, start_pos, message=None): + self.path = module_path + self._start_pos = start_pos + self.name = name + if message is None: + message = CODES[self.name][2] + self.message = message + + @property + def line(self): + return self._start_pos[0] + + @property + def column(self): + return self._start_pos[1] + + @property + def code(self): + # The class name start + first = self.__class__.__name__[0] + return first + str(CODES[self.name][0]) + + def __unicode__(self): + return '%s:%s:%s: %s %s' % (self.path, self.line, self.column, + self.code, self.message) + + def __str__(self): + return self.__unicode__() + + def __eq__(self, other): + return (self.path == other.path and self.name == other.name and + self._start_pos == other._start_pos) + + def __ne__(self, other): + return not self.__eq__(other) + + def __hash__(self): + return hash((self.path, self._start_pos, self.name)) + + def __repr__(self): + return '<%s %s: %s@%s,%s>' % (self.__class__.__name__, + self.name, self.path, + self._start_pos[0], self._start_pos[1]) + + +class Warning(Error): + pass + + +def add(node_context, error_name, node, message=None, typ=Error, payload=None): + exception = CODES[error_name][1] + if _check_for_exception_catch(node_context, node, exception, payload): + return + + # TODO this path is probably not right + module_context = node_context.get_root_context() + module_path = module_context.py__file__() + issue_instance = typ(error_name, module_path, node.start_pos, message) + debug.warning(str(issue_instance), format=False) + node_context.evaluator.analysis.append(issue_instance) + return issue_instance + + +def _check_for_setattr(instance): + """ + Check if there's any setattr method inside an instance. If so, return True. + """ + module = instance.get_root_context() + node = module.tree_node + if node is None: + # If it's a compiled module or doesn't have a tree_node + return False + + try: + stmt_names = node.get_used_names()['setattr'] + except KeyError: + return False + + return any(node.start_pos < n.start_pos < node.end_pos + # Check if it's a function called setattr. + and not (n.parent.type == 'funcdef' and n.parent.name == n) + for n in stmt_names) + + +def add_attribute_error(name_context, lookup_context, name): + message = ('AttributeError: %s has no attribute %s.' % (lookup_context, name)) + from jedi.evaluate.context.instance import CompiledInstanceName + # Check for __getattr__/__getattribute__ existance and issue a warning + # instead of an error, if that happens. + typ = Error + if lookup_context.is_instance() and not lookup_context.is_compiled(): + slot_names = lookup_context.get_function_slot_names(u'__getattr__') + \ + lookup_context.get_function_slot_names(u'__getattribute__') + for n in slot_names: + # TODO do we even get here? + if isinstance(name, CompiledInstanceName) and \ + n.parent_context.obj == object: + typ = Warning + break + + if _check_for_setattr(lookup_context): + typ = Warning + + payload = lookup_context, name + add(name_context, 'attribute-error', name, message, typ, payload) + + +def _check_for_exception_catch(node_context, jedi_name, exception, payload=None): + """ + Checks if a jedi object (e.g. `Statement`) sits inside a try/catch and + doesn't count as an error (if equal to `exception`). + Also checks `hasattr` for AttributeErrors and uses the `payload` to compare + it. + Returns True if the exception was catched. + """ + def check_match(cls, exception): + if not cls.is_class(): + return False + + for python_cls in exception.mro(): + if cls.py__name__() == python_cls.__name__ \ + and cls.parent_context == cls.evaluator.builtins_module: + return True + return False + + def check_try_for_except(obj, exception): + # Only nodes in try + iterator = iter(obj.children) + for branch_type in iterator: + colon = next(iterator) + suite = next(iterator) + if branch_type == 'try' \ + and not (branch_type.start_pos < jedi_name.start_pos <= suite.end_pos): + return False + + for node in obj.get_except_clause_tests(): + if node is None: + return True # An exception block that catches everything. + else: + except_classes = node_context.eval_node(node) + for cls in except_classes: + from jedi.evaluate.context import iterable + if isinstance(cls, iterable.Sequence) and \ + cls.array_type == 'tuple': + # multiple exceptions + for lazy_context in cls.py__iter__(): + for typ in lazy_context.infer(): + if check_match(typ, exception): + return True + else: + if check_match(cls, exception): + return True + + def check_hasattr(node, suite): + try: + assert suite.start_pos <= jedi_name.start_pos < suite.end_pos + assert node.type in ('power', 'atom_expr') + base = node.children[0] + assert base.type == 'name' and base.value == 'hasattr' + trailer = node.children[1] + assert trailer.type == 'trailer' + arglist = trailer.children[1] + assert arglist.type == 'arglist' + from jedi.evaluate.arguments import TreeArguments + args = list(TreeArguments(node_context.evaluator, node_context, arglist).unpack()) + # Arguments should be very simple + assert len(args) == 2 + + # Check name + key, lazy_context = args[1] + names = list(lazy_context.infer()) + assert len(names) == 1 and is_string(names[0]) + assert force_unicode(names[0].get_safe_value()) == payload[1].value + + # Check objects + key, lazy_context = args[0] + objects = lazy_context.infer() + return payload[0] in objects + except AssertionError: + return False + + obj = jedi_name + while obj is not None and not isinstance(obj, (tree.Function, tree.Class)): + if isinstance(obj, tree.Flow): + # try/except catch check + if obj.type == 'try_stmt' and check_try_for_except(obj, exception): + return True + # hasattr check + if exception == AttributeError and obj.type in ('if_stmt', 'while_stmt'): + if check_hasattr(obj.children[1], obj.children[3]): + return True + obj = obj.parent + + return False diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/arguments.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/arguments.py new file mode 100644 index 0000000..4e32653 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/arguments.py @@ -0,0 +1,382 @@ +import re + +from parso.python import tree + +from jedi._compatibility import zip_longest +from jedi import debug +from jedi.evaluate.utils import PushBackIterator +from jedi.evaluate import analysis +from jedi.evaluate.lazy_context import LazyKnownContext, LazyKnownContexts, \ + LazyTreeContext, get_merged_lazy_context +from jedi.evaluate.names import ParamName, TreeNameDefinition +from jedi.evaluate.base_context import NO_CONTEXTS, ContextSet, ContextualizedNode +from jedi.evaluate.context import iterable +from jedi.evaluate.cache import evaluator_as_method_param_cache +from jedi.evaluate.param import get_executed_params_and_issues, ExecutedParam + + +def try_iter_content(types, depth=0): + """Helper method for static analysis.""" + if depth > 10: + # It's possible that a loop has references on itself (especially with + # CompiledObject). Therefore don't loop infinitely. + return + + for typ in types: + try: + f = typ.py__iter__ + except AttributeError: + pass + else: + for lazy_context in f(): + try_iter_content(lazy_context.infer(), depth + 1) + + +class ParamIssue(Exception): + pass + + +def repack_with_argument_clinic(string, keep_arguments_param=False, keep_callback_param=False): + """ + Transforms a function or method with arguments to the signature that is + given as an argument clinic notation. + + Argument clinic is part of CPython and used for all the functions that are + implemented in C (Python 3.7): + + str.split.__text_signature__ + # Results in: '($self, /, sep=None, maxsplit=-1)' + """ + clinic_args = list(_parse_argument_clinic(string)) + + def decorator(func): + def wrapper(context, *args, **kwargs): + if keep_arguments_param: + arguments = kwargs['arguments'] + else: + arguments = kwargs.pop('arguments') + if not keep_arguments_param: + kwargs.pop('callback', None) + try: + args += tuple(_iterate_argument_clinic( + context.evaluator, + arguments, + clinic_args + )) + except ParamIssue: + return NO_CONTEXTS + else: + return func(context, *args, **kwargs) + + return wrapper + return decorator + + +def _iterate_argument_clinic(evaluator, arguments, parameters): + """Uses a list with argument clinic information (see PEP 436).""" + iterator = PushBackIterator(arguments.unpack()) + for i, (name, optional, allow_kwargs, stars) in enumerate(parameters): + if stars == 1: + lazy_contexts = [] + for key, argument in iterator: + if key is not None: + iterator.push_back((key, argument)) + break + + lazy_contexts.append(argument) + yield ContextSet([iterable.FakeSequence(evaluator, u'tuple', lazy_contexts)]) + lazy_contexts + continue + elif stars == 2: + raise NotImplementedError() + key, argument = next(iterator, (None, None)) + if key is not None: + debug.warning('Keyword arguments in argument clinic are currently not supported.') + raise ParamIssue + if argument is None and not optional: + debug.warning('TypeError: %s expected at least %s arguments, got %s', + name, len(parameters), i) + raise ParamIssue + + context_set = NO_CONTEXTS if argument is None else argument.infer() + + if not context_set and not optional: + # For the stdlib we always want values. If we don't get them, + # that's ok, maybe something is too hard to resolve, however, + # we will not proceed with the evaluation of that function. + debug.warning('argument_clinic "%s" not resolvable.', name) + raise ParamIssue + yield context_set + + +def _parse_argument_clinic(string): + allow_kwargs = False + optional = False + while string: + # Optional arguments have to begin with a bracket. And should always be + # at the end of the arguments. This is therefore not a proper argument + # clinic implementation. `range()` for exmple allows an optional start + # value at the beginning. + match = re.match(r'(?:(?:(\[),? ?|, ?|)(\**\w+)|, ?/)\]*', string) + string = string[len(match.group(0)):] + if not match.group(2): # A slash -> allow named arguments + allow_kwargs = True + continue + optional = optional or bool(match.group(1)) + word = match.group(2) + stars = word.count('*') + word = word[stars:] + yield (word, optional, allow_kwargs, stars) + if stars: + allow_kwargs = True + + +class _AbstractArgumentsMixin(object): + def eval_all(self, funcdef=None): + """ + Evaluates all arguments as a support for static analysis + (normally Jedi). + """ + for key, lazy_context in self.unpack(): + types = lazy_context.infer() + try_iter_content(types) + + def unpack(self, funcdef=None): + raise NotImplementedError + + def get_executed_params_and_issues(self, execution_context): + return get_executed_params_and_issues(execution_context, self) + + def get_calling_nodes(self): + return [] + + +class AbstractArguments(_AbstractArgumentsMixin): + context = None + argument_node = None + trailer = None + + +class AnonymousArguments(AbstractArguments): + def get_executed_params_and_issues(self, execution_context): + from jedi.evaluate.dynamic import search_params + return search_params( + execution_context.evaluator, + execution_context, + execution_context.tree_node + ), [] + + def __repr__(self): + return '%s()' % self.__class__.__name__ + + +def unpack_arglist(arglist): + if arglist is None: + return + + # Allow testlist here as well for Python2's class inheritance + # definitions. + if not (arglist.type in ('arglist', 'testlist') or ( + # in python 3.5 **arg is an argument, not arglist + (arglist.type == 'argument') and + arglist.children[0] in ('*', '**'))): + yield 0, arglist + return + + iterator = iter(arglist.children) + for child in iterator: + if child == ',': + continue + elif child in ('*', '**'): + yield len(child.value), next(iterator) + elif child.type == 'argument' and \ + child.children[0] in ('*', '**'): + assert len(child.children) == 2 + yield len(child.children[0].value), child.children[1] + else: + yield 0, child + + +class TreeArguments(AbstractArguments): + def __init__(self, evaluator, context, argument_node, trailer=None): + """ + The argument_node is either a parser node or a list of evaluated + objects. Those evaluated objects may be lists of evaluated objects + themselves (one list for the first argument, one for the second, etc). + + :param argument_node: May be an argument_node or a list of nodes. + """ + self.argument_node = argument_node + self.context = context + self._evaluator = evaluator + self.trailer = trailer # Can be None, e.g. in a class definition. + + @classmethod + @evaluator_as_method_param_cache() + def create_cached(cls, *args, **kwargs): + return cls(*args, **kwargs) + + def unpack(self, funcdef=None): + named_args = [] + for star_count, el in unpack_arglist(self.argument_node): + if star_count == 1: + arrays = self.context.eval_node(el) + iterators = [_iterate_star_args(self.context, a, el, funcdef) + for a in arrays] + for values in list(zip_longest(*iterators)): + # TODO zip_longest yields None, that means this would raise + # an exception? + yield None, get_merged_lazy_context( + [v for v in values if v is not None] + ) + elif star_count == 2: + arrays = self.context.eval_node(el) + for dct in arrays: + for key, values in _star_star_dict(self.context, dct, el, funcdef): + yield key, values + else: + if el.type == 'argument': + c = el.children + if len(c) == 3: # Keyword argument. + named_args.append((c[0].value, LazyTreeContext(self.context, c[2]),)) + else: # Generator comprehension. + # Include the brackets with the parent. + sync_comp_for = el.children[1] + if sync_comp_for.type == 'comp_for': + sync_comp_for = sync_comp_for.children[1] + comp = iterable.GeneratorComprehension( + self._evaluator, + defining_context=self.context, + sync_comp_for_node=sync_comp_for, + entry_node=el.children[0], + ) + yield None, LazyKnownContext(comp) + else: + yield None, LazyTreeContext(self.context, el) + + # Reordering arguments is necessary, because star args sometimes appear + # after named argument, but in the actual order it's prepended. + for named_arg in named_args: + yield named_arg + + def _as_tree_tuple_objects(self): + for star_count, argument in unpack_arglist(self.argument_node): + default = None + if argument.type == 'argument': + if len(argument.children) == 3: # Keyword argument. + argument, default = argument.children[::2] + yield argument, default, star_count + + def iter_calling_names_with_star(self): + for name, default, star_count in self._as_tree_tuple_objects(): + # TODO this function is a bit strange. probably refactor? + if not star_count or not isinstance(name, tree.Name): + continue + + yield TreeNameDefinition(self.context, name) + + def __repr__(self): + return '<%s: %s>' % (self.__class__.__name__, self.argument_node) + + def get_calling_nodes(self): + from jedi.evaluate.dynamic import DynamicExecutedParams + old_arguments_list = [] + arguments = self + + while arguments not in old_arguments_list: + if not isinstance(arguments, TreeArguments): + break + + old_arguments_list.append(arguments) + for calling_name in reversed(list(arguments.iter_calling_names_with_star())): + names = calling_name.goto() + if len(names) != 1: + break + if not isinstance(names[0], ParamName): + break + param = names[0].get_param() + if isinstance(param, DynamicExecutedParams): + # For dynamic searches we don't even want to see errors. + return [] + if not isinstance(param, ExecutedParam): + break + if param.var_args is None: + break + arguments = param.var_args + break + + if arguments.argument_node is not None: + return [ContextualizedNode(arguments.context, arguments.argument_node)] + if arguments.trailer is not None: + return [ContextualizedNode(arguments.context, arguments.trailer)] + return [] + + +class ValuesArguments(AbstractArguments): + def __init__(self, values_list): + self._values_list = values_list + + def unpack(self, funcdef=None): + for values in self._values_list: + yield None, LazyKnownContexts(values) + + def __repr__(self): + return '<%s: %s>' % (self.__class__.__name__, self._values_list) + + +class TreeArgumentsWrapper(_AbstractArgumentsMixin): + def __init__(self, arguments): + self._wrapped_arguments = arguments + + @property + def context(self): + return self._wrapped_arguments.context + + @property + def argument_node(self): + return self._wrapped_arguments.argument_node + + @property + def trailer(self): + return self._wrapped_arguments.trailer + + def unpack(self, func=None): + raise NotImplementedError + + def get_calling_nodes(self): + return self._wrapped_arguments.get_calling_nodes() + + def __repr__(self): + return '<%s: %s>' % (self.__class__.__name__, self._wrapped_arguments) + + +def _iterate_star_args(context, array, input_node, funcdef=None): + if not array.py__getattribute__('__iter__'): + if funcdef is not None: + # TODO this funcdef should not be needed. + m = "TypeError: %s() argument after * must be a sequence, not %s" \ + % (funcdef.name.value, array) + analysis.add(context, 'type-error-star', input_node, message=m) + try: + iter_ = array.py__iter__ + except AttributeError: + pass + else: + for lazy_context in iter_(): + yield lazy_context + + +def _star_star_dict(context, array, input_node, funcdef): + from jedi.evaluate.context.instance import CompiledInstance + if isinstance(array, CompiledInstance) and array.name.string_name == 'dict': + # For now ignore this case. In the future add proper iterators and just + # make one call without crazy isinstance checks. + return {} + elif isinstance(array, iterable.Sequence) and array.array_type == 'dict': + return array.exact_key_items() + else: + if funcdef is not None: + m = "TypeError: %s argument after ** must be a mapping, not %s" \ + % (funcdef.name.value, array) + analysis.add(context, 'type-error-star-star', input_node, message=m) + return {} diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/base_context.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/base_context.py new file mode 100644 index 0000000..8a03248 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/base_context.py @@ -0,0 +1,436 @@ +""" +Contexts are the "values" that Python would return. However Contexts are at the +same time also the "contexts" that a user is currently sitting in. + +A ContextSet is typically used to specify the return of a function or any other +static analysis operation. In jedi there are always multiple returns and not +just one. +""" +from functools import reduce +from operator import add +from parso.python.tree import ExprStmt, SyncCompFor + +from jedi import debug +from jedi._compatibility import zip_longest, unicode +from jedi.parser_utils import clean_scope_docstring +from jedi.common import BaseContextSet, BaseContext +from jedi.evaluate.helpers import SimpleGetItemNotFound +from jedi.evaluate.utils import safe_property +from jedi.evaluate.cache import evaluator_as_method_param_cache +from jedi.cache import memoize_method + +_sentinel = object() + + +class HelperContextMixin(object): + def get_root_context(self): + context = self + while True: + if context.parent_context is None: + return context + context = context.parent_context + + @classmethod + @evaluator_as_method_param_cache() + def create_cached(cls, *args, **kwargs): + return cls(*args, **kwargs) + + def execute(self, arguments): + return self.evaluator.execute(self, arguments=arguments) + + def execute_evaluated(self, *value_list): + from jedi.evaluate.arguments import ValuesArguments + arguments = ValuesArguments([ContextSet([value]) for value in value_list]) + return self.evaluator.execute(self, arguments) + + def execute_annotation(self): + return self.execute_evaluated() + + def gather_annotation_classes(self): + return ContextSet([self]) + + def merge_types_of_iterate(self, contextualized_node=None, is_async=False): + return ContextSet.from_sets( + lazy_context.infer() + for lazy_context in self.iterate(contextualized_node, is_async) + ) + + def py__getattribute__(self, name_or_str, name_context=None, position=None, + search_global=False, is_goto=False, + analysis_errors=True): + """ + :param position: Position of the last statement -> tuple of line, column + """ + if name_context is None: + name_context = self + from jedi.evaluate import finder + f = finder.NameFinder(self.evaluator, self, name_context, name_or_str, + position, analysis_errors=analysis_errors) + filters = f.get_filters(search_global) + if is_goto: + return f.filter_name(filters) + return f.find(filters, attribute_lookup=not search_global) + + def py__await__(self): + await_context_set = self.py__getattribute__(u"__await__") + if not await_context_set: + debug.warning('Tried to run __await__ on context %s', self) + return await_context_set.execute_evaluated() + + def eval_node(self, node): + return self.evaluator.eval_element(self, node) + + def create_context(self, node, node_is_context=False, node_is_object=False): + return self.evaluator.create_context(self, node, node_is_context, node_is_object) + + def iterate(self, contextualized_node=None, is_async=False): + debug.dbg('iterate %s', self) + if is_async: + from jedi.evaluate.lazy_context import LazyKnownContexts + # TODO if no __aiter__ contexts are there, error should be: + # TypeError: 'async for' requires an object with __aiter__ method, got int + return iter([ + LazyKnownContexts( + self.py__getattribute__('__aiter__').execute_evaluated() + .py__getattribute__('__anext__').execute_evaluated() + .py__getattribute__('__await__').execute_evaluated() + .py__stop_iteration_returns() + ) # noqa + ]) + return self.py__iter__(contextualized_node) + + def is_sub_class_of(self, class_context): + for cls in self.py__mro__(): + if cls.is_same_class(class_context): + return True + return False + + def is_same_class(self, class2): + # Class matching should prefer comparisons that are not this function. + if type(class2).is_same_class != HelperContextMixin.is_same_class: + return class2.is_same_class(self) + return self == class2 + + +class Context(HelperContextMixin, BaseContext): + """ + Should be defined, otherwise the API returns empty types. + """ + predefined_names = {} + """ + To be defined by subclasses. + """ + tree_node = None + + @property + def api_type(self): + # By default just lower name of the class. Can and should be + # overwritten. + return self.__class__.__name__.lower() + + def py__getitem__(self, index_context_set, contextualized_node): + from jedi.evaluate import analysis + # TODO this context is probably not right. + analysis.add( + contextualized_node.context, + 'type-error-not-subscriptable', + contextualized_node.node, + message="TypeError: '%s' object is not subscriptable" % self + ) + return NO_CONTEXTS + + def py__iter__(self, contextualized_node=None): + if contextualized_node is not None: + from jedi.evaluate import analysis + analysis.add( + contextualized_node.context, + 'type-error-not-iterable', + contextualized_node.node, + message="TypeError: '%s' object is not iterable" % self) + return iter([]) + + def get_signatures(self): + return [] + + def is_class(self): + return False + + def is_instance(self): + return False + + def is_function(self): + return False + + def is_module(self): + return False + + def is_namespace(self): + return False + + def is_compiled(self): + return False + + def is_bound_method(self): + return False + + def py__bool__(self): + """ + Since Wrapper is a super class for classes, functions and modules, + the return value will always be true. + """ + return True + + def py__doc__(self): + try: + self.tree_node.get_doc_node + except AttributeError: + return '' + else: + return clean_scope_docstring(self.tree_node) + return None + + def get_safe_value(self, default=_sentinel): + if default is _sentinel: + raise ValueError("There exists no safe value for context %s" % self) + return default + + def py__call__(self, arguments): + debug.warning("no execution possible %s", self) + return NO_CONTEXTS + + def py__stop_iteration_returns(self): + debug.warning("Not possible to return the stop iterations of %s", self) + return NO_CONTEXTS + + def get_qualified_names(self): + # Returns Optional[Tuple[str, ...]] + return None + + def is_stub(self): + # The root context knows if it's a stub or not. + return self.parent_context.is_stub() + + +def iterate_contexts(contexts, contextualized_node=None, is_async=False): + """ + Calls `iterate`, on all contexts but ignores the ordering and just returns + all contexts that the iterate functions yield. + """ + return ContextSet.from_sets( + lazy_context.infer() + for lazy_context in contexts.iterate(contextualized_node, is_async=is_async) + ) + + +class _ContextWrapperBase(HelperContextMixin): + predefined_names = {} + + @safe_property + def name(self): + from jedi.evaluate.names import ContextName + wrapped_name = self._wrapped_context.name + if wrapped_name.tree_name is not None: + return ContextName(self, wrapped_name.tree_name) + else: + from jedi.evaluate.compiled import CompiledContextName + return CompiledContextName(self, wrapped_name.string_name) + + @classmethod + @evaluator_as_method_param_cache() + def create_cached(cls, evaluator, *args, **kwargs): + return cls(*args, **kwargs) + + def __getattr__(self, name): + assert name != '_wrapped_context', 'Problem with _get_wrapped_context' + return getattr(self._wrapped_context, name) + + +class LazyContextWrapper(_ContextWrapperBase): + @safe_property + @memoize_method + def _wrapped_context(self): + with debug.increase_indent_cm('Resolve lazy context wrapper'): + return self._get_wrapped_context() + + def __repr__(self): + return '<%s>' % (self.__class__.__name__) + + def _get_wrapped_context(self): + raise NotImplementedError + + +class ContextWrapper(_ContextWrapperBase): + def __init__(self, wrapped_context): + self._wrapped_context = wrapped_context + + def __repr__(self): + return '%s(%s)' % (self.__class__.__name__, self._wrapped_context) + + +class TreeContext(Context): + def __init__(self, evaluator, parent_context, tree_node): + super(TreeContext, self).__init__(evaluator, parent_context) + self.predefined_names = {} + self.tree_node = tree_node + + def __repr__(self): + return '<%s: %s>' % (self.__class__.__name__, self.tree_node) + + +class ContextualizedNode(object): + def __init__(self, context, node): + self.context = context + self.node = node + + def get_root_context(self): + return self.context.get_root_context() + + def infer(self): + return self.context.eval_node(self.node) + + def __repr__(self): + return '<%s: %s in %s>' % (self.__class__.__name__, self.node, self.context) + + +class ContextualizedName(ContextualizedNode): + # TODO merge with TreeNameDefinition?! + @property + def name(self): + return self.node + + def assignment_indexes(self): + """ + Returns an array of tuple(int, node) of the indexes that are used in + tuple assignments. + + For example if the name is ``y`` in the following code:: + + x, (y, z) = 2, '' + + would result in ``[(1, xyz_node), (0, yz_node)]``. + + When searching for b in the case ``a, *b, c = [...]`` it will return:: + + [(slice(1, -1), abc_node)] + """ + indexes = [] + is_star_expr = False + node = self.node.parent + compare = self.node + while node is not None: + if node.type in ('testlist', 'testlist_comp', 'testlist_star_expr', 'exprlist'): + for i, child in enumerate(node.children): + if child == compare: + index = int(i / 2) + if is_star_expr: + from_end = int((len(node.children) - i) / 2) + index = slice(index, -from_end) + indexes.insert(0, (index, node)) + break + else: + raise LookupError("Couldn't find the assignment.") + is_star_expr = False + elif node.type == 'star_expr': + is_star_expr = True + elif isinstance(node, (ExprStmt, SyncCompFor)): + break + + compare = node + node = node.parent + return indexes + + +def _getitem(context, index_contexts, contextualized_node): + from jedi.evaluate.context.iterable import Slice + + # The actual getitem call. + simple_getitem = getattr(context, 'py__simple_getitem__', None) + + result = NO_CONTEXTS + unused_contexts = set() + for index_context in index_contexts: + if simple_getitem is not None: + index = index_context + if isinstance(index_context, Slice): + index = index.obj + + try: + method = index.get_safe_value + except AttributeError: + pass + else: + index = method(default=None) + + if type(index) in (float, int, str, unicode, slice, bytes): + try: + result |= simple_getitem(index) + continue + except SimpleGetItemNotFound: + pass + + unused_contexts.add(index_context) + + # The index was somehow not good enough or simply a wrong type. + # Therefore we now iterate through all the contexts and just take + # all results. + if unused_contexts or not index_contexts: + result |= context.py__getitem__( + ContextSet(unused_contexts), + contextualized_node + ) + debug.dbg('py__getitem__ result: %s', result) + return result + + +class ContextSet(BaseContextSet): + def py__class__(self): + return ContextSet(c.py__class__() for c in self._set) + + def iterate(self, contextualized_node=None, is_async=False): + from jedi.evaluate.lazy_context import get_merged_lazy_context + type_iters = [c.iterate(contextualized_node, is_async=is_async) for c in self._set] + for lazy_contexts in zip_longest(*type_iters): + yield get_merged_lazy_context( + [l for l in lazy_contexts if l is not None] + ) + + def execute(self, arguments): + return ContextSet.from_sets(c.evaluator.execute(c, arguments) for c in self._set) + + def execute_evaluated(self, *args, **kwargs): + return ContextSet.from_sets(c.execute_evaluated(*args, **kwargs) for c in self._set) + + def py__getattribute__(self, *args, **kwargs): + if kwargs.get('is_goto'): + return reduce(add, [c.py__getattribute__(*args, **kwargs) for c in self._set], []) + return ContextSet.from_sets(c.py__getattribute__(*args, **kwargs) for c in self._set) + + def get_item(self, *args, **kwargs): + return ContextSet.from_sets(_getitem(c, *args, **kwargs) for c in self._set) + + def try_merge(self, function_name): + context_set = self.__class__([]) + for c in self._set: + try: + method = getattr(c, function_name) + except AttributeError: + pass + else: + context_set |= method() + return context_set + + def gather_annotation_classes(self): + return ContextSet.from_sets([c.gather_annotation_classes() for c in self._set]) + + def get_signatures(self): + return [sig for c in self._set for sig in c.get_signatures()] + + +NO_CONTEXTS = ContextSet([]) + + +def iterator_to_context_set(func): + def wrapper(*args, **kwargs): + return ContextSet(func(*args, **kwargs)) + + return wrapper diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/cache.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/cache.py new file mode 100644 index 0000000..e865a0d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/cache.py @@ -0,0 +1,123 @@ +""" +- the popular ``_memoize_default`` works like a typical memoize and returns the + default otherwise. +- ``CachedMetaClass`` uses ``_memoize_default`` to do the same with classes. +""" + +from jedi import debug + +_NO_DEFAULT = object() +_RECURSION_SENTINEL = object() + + +def _memoize_default(default=_NO_DEFAULT, evaluator_is_first_arg=False, second_arg_is_evaluator=False): + """ This is a typical memoization decorator, BUT there is one difference: + To prevent recursion it sets defaults. + + Preventing recursion is in this case the much bigger use than speed. I + don't think, that there is a big speed difference, but there are many cases + where recursion could happen (think about a = b; b = a). + """ + def func(function): + def wrapper(obj, *args, **kwargs): + # TODO These checks are kind of ugly and slow. + if evaluator_is_first_arg: + cache = obj.memoize_cache + elif second_arg_is_evaluator: + cache = args[0].memoize_cache # needed for meta classes + else: + cache = obj.evaluator.memoize_cache + + try: + memo = cache[function] + except KeyError: + cache[function] = memo = {} + + key = (obj, args, frozenset(kwargs.items())) + if key in memo: + return memo[key] + else: + if default is not _NO_DEFAULT: + memo[key] = default + rv = function(obj, *args, **kwargs) + memo[key] = rv + return rv + return wrapper + + return func + + +def evaluator_function_cache(default=_NO_DEFAULT): + def decorator(func): + return _memoize_default(default=default, evaluator_is_first_arg=True)(func) + + return decorator + + +def evaluator_method_cache(default=_NO_DEFAULT): + def decorator(func): + return _memoize_default(default=default)(func) + + return decorator + + +def evaluator_as_method_param_cache(): + def decorator(call): + return _memoize_default(second_arg_is_evaluator=True)(call) + + return decorator + + +class CachedMetaClass(type): + """ + This is basically almost the same than the decorator above, it just caches + class initializations. Either you do it this way or with decorators, but + with decorators you lose class access (isinstance, etc). + """ + @evaluator_as_method_param_cache() + def __call__(self, *args, **kwargs): + return super(CachedMetaClass, self).__call__(*args, **kwargs) + + +def evaluator_method_generator_cache(): + """ + This is a special memoizer. It memoizes generators and also checks for + recursion errors and returns no further iterator elemends in that case. + """ + def func(function): + def wrapper(obj, *args, **kwargs): + cache = obj.evaluator.memoize_cache + try: + memo = cache[function] + except KeyError: + cache[function] = memo = {} + + key = (obj, args, frozenset(kwargs.items())) + + if key in memo: + actual_generator, cached_lst = memo[key] + else: + actual_generator = function(obj, *args, **kwargs) + cached_lst = [] + memo[key] = actual_generator, cached_lst + + i = 0 + while True: + try: + next_element = cached_lst[i] + if next_element is _RECURSION_SENTINEL: + debug.warning('Found a generator recursion for %s' % obj) + # This means we have hit a recursion. + return + except IndexError: + cached_lst.append(_RECURSION_SENTINEL) + next_element = next(actual_generator, None) + if next_element is None: + cached_lst.pop() + return + cached_lst[-1] = next_element + yield next_element + i += 1 + return wrapper + + return func diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/compiled/__init__.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/compiled/__init__.py new file mode 100644 index 0000000..cfda727 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/compiled/__init__.py @@ -0,0 +1,64 @@ +from jedi._compatibility import unicode +from jedi.evaluate.compiled.context import CompiledObject, CompiledName, \ + CompiledObjectFilter, CompiledContextName, create_from_access_path +from jedi.evaluate.base_context import ContextWrapper, LazyContextWrapper + + +def builtin_from_name(evaluator, string): + typing_builtins_module = evaluator.builtins_module + if string in ('None', 'True', 'False'): + builtins, = typing_builtins_module.non_stub_context_set + filter_ = next(builtins.get_filters()) + else: + filter_ = next(typing_builtins_module.get_filters()) + name, = filter_.get(string) + context, = name.infer() + return context + + +class CompiledValue(LazyContextWrapper): + def __init__(self, compiled_obj): + self.evaluator = compiled_obj.evaluator + self._compiled_obj = compiled_obj + + def __getattribute__(self, name): + if name in ('get_safe_value', 'execute_operation', 'access_handle', + 'negate', 'py__bool__', 'is_compiled'): + return getattr(self._compiled_obj, name) + return super(CompiledValue, self).__getattribute__(name) + + def _get_wrapped_context(self): + instance, = builtin_from_name( + self.evaluator, self._compiled_obj.name.string_name).execute_evaluated() + return instance + + def __repr__(self): + return '<%s: %s>' % (self.__class__.__name__, self._compiled_obj) + + +def create_simple_object(evaluator, obj): + """ + Only allows creations of objects that are easily picklable across Python + versions. + """ + assert type(obj) in (int, float, str, bytes, unicode, slice, complex, bool), obj + compiled_obj = create_from_access_path( + evaluator, + evaluator.compiled_subprocess.create_simple_object(obj) + ) + return CompiledValue(compiled_obj) + + +def get_string_context_set(evaluator): + return builtin_from_name(evaluator, u'str').execute_evaluated() + + +def load_module(evaluator, dotted_name, **kwargs): + # Temporary, some tensorflow builtins cannot be loaded, so it's tried again + # and again and it's really slow. + if dotted_name.startswith('tensorflow.'): + return None + access_path = evaluator.compiled_subprocess.load_module(dotted_name=dotted_name, **kwargs) + if access_path is None: + return None + return create_from_access_path(evaluator, access_path) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/compiled/access.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/compiled/access.py new file mode 100644 index 0000000..18aacf5 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/compiled/access.py @@ -0,0 +1,497 @@ +from __future__ import print_function +import inspect +import types +import sys +import operator as op +from collections import namedtuple + +from jedi._compatibility import unicode, is_py3, builtins, \ + py_version, force_unicode +from jedi.evaluate.compiled.getattr_static import getattr_static + +ALLOWED_GETITEM_TYPES = (str, list, tuple, unicode, bytes, bytearray, dict) + +MethodDescriptorType = type(str.replace) +# These are not considered classes and access is granted even though they have +# a __class__ attribute. +NOT_CLASS_TYPES = ( + types.BuiltinFunctionType, + types.CodeType, + types.FrameType, + types.FunctionType, + types.GeneratorType, + types.GetSetDescriptorType, + types.LambdaType, + types.MemberDescriptorType, + types.MethodType, + types.ModuleType, + types.TracebackType, + MethodDescriptorType +) + +if is_py3: + NOT_CLASS_TYPES += ( + types.MappingProxyType, + types.SimpleNamespace, + types.DynamicClassAttribute, + ) + + +# Those types don't exist in typing. +MethodDescriptorType = type(str.replace) +WrapperDescriptorType = type(set.__iter__) +# `object.__subclasshook__` is an already executed descriptor. +object_class_dict = type.__dict__["__dict__"].__get__(object) +ClassMethodDescriptorType = type(object_class_dict['__subclasshook__']) + +_sentinel = object() + +# Maps Python syntax to the operator module. +COMPARISON_OPERATORS = { + '==': op.eq, + '!=': op.ne, + 'is': op.is_, + 'is not': op.is_not, + '<': op.lt, + '<=': op.le, + '>': op.gt, + '>=': op.ge, +} + +_OPERATORS = { + '+': op.add, + '-': op.sub, +} +_OPERATORS.update(COMPARISON_OPERATORS) + +ALLOWED_DESCRIPTOR_ACCESS = ( + types.FunctionType, + types.GetSetDescriptorType, + types.MemberDescriptorType, + MethodDescriptorType, + WrapperDescriptorType, + ClassMethodDescriptorType, + staticmethod, + classmethod, +) + + +def safe_getattr(obj, name, default=_sentinel): + try: + attr, is_get_descriptor = getattr_static(obj, name) + except AttributeError: + if default is _sentinel: + raise + return default + else: + if isinstance(attr, ALLOWED_DESCRIPTOR_ACCESS): + # In case of descriptors that have get methods we cannot return + # it's value, because that would mean code execution. + # Since it's an isinstance call, code execution is still possible, + # but this is not really a security feature, but much more of a + # safety feature. Code execution is basically always possible when + # a module is imported. This is here so people don't shoot + # themselves in the foot. + return getattr(obj, name) + return attr + + +SignatureParam = namedtuple( + 'SignatureParam', + 'name has_default default default_string has_annotation annotation annotation_string kind_name' +) + + +def compiled_objects_cache(attribute_name): + def decorator(func): + """ + This decorator caches just the ids, oopposed to caching the object itself. + Caching the id has the advantage that an object doesn't need to be + hashable. + """ + def wrapper(evaluator, obj, parent_context=None): + cache = getattr(evaluator, attribute_name) + # Do a very cheap form of caching here. + key = id(obj) + try: + cache[key] + return cache[key][0] + except KeyError: + # TODO wuaaaarrghhhhhhhh + if attribute_name == 'mixed_cache': + result = func(evaluator, obj, parent_context) + else: + result = func(evaluator, obj) + # Need to cache all of them, otherwise the id could be overwritten. + cache[key] = result, obj, parent_context + return result + return wrapper + + return decorator + + +def create_access(evaluator, obj): + return evaluator.compiled_subprocess.get_or_create_access_handle(obj) + + +def load_module(evaluator, dotted_name, sys_path): + temp, sys.path = sys.path, sys_path + try: + __import__(dotted_name) + except ImportError: + # If a module is "corrupt" or not really a Python module or whatever. + print('Module %s not importable in path %s.' % (dotted_name, sys_path), file=sys.stderr) + return None + except Exception: + # Since __import__ pretty much makes code execution possible, just + # catch any error here and print it. + import traceback + print("Cannot import:\n%s" % traceback.format_exc(), file=sys.stderr) + return None + finally: + sys.path = temp + + # Just access the cache after import, because of #59 as well as the very + # complicated import structure of Python. + module = sys.modules[dotted_name] + return create_access_path(evaluator, module) + + +class AccessPath(object): + def __init__(self, accesses): + self.accesses = accesses + + # Writing both of these methods here looks a bit ridiculous. However with + # the differences of Python 2/3 it's actually necessary, because we will + # otherwise have a accesses attribute that is bytes instead of unicode. + def __getstate__(self): + return self.accesses + + def __setstate__(self, value): + self.accesses = value + + +def create_access_path(evaluator, obj): + access = create_access(evaluator, obj) + return AccessPath(access.get_access_path_tuples()) + + +def _force_unicode_decorator(func): + return lambda *args, **kwargs: force_unicode(func(*args, **kwargs)) + + +def get_api_type(obj): + if inspect.isclass(obj): + return u'class' + elif inspect.ismodule(obj): + return u'module' + elif inspect.isbuiltin(obj) or inspect.ismethod(obj) \ + or inspect.ismethoddescriptor(obj) or inspect.isfunction(obj): + return u'function' + # Everything else... + return u'instance' + + +class DirectObjectAccess(object): + def __init__(self, evaluator, obj): + self._evaluator = evaluator + self._obj = obj + + def __repr__(self): + return '%s(%s)' % (self.__class__.__name__, self.get_repr()) + + def _create_access(self, obj): + return create_access(self._evaluator, obj) + + def _create_access_path(self, obj): + return create_access_path(self._evaluator, obj) + + def py__bool__(self): + return bool(self._obj) + + def py__file__(self): + try: + return self._obj.__file__ + except AttributeError: + return None + + def py__doc__(self): + return force_unicode(inspect.getdoc(self._obj)) or u'' + + def py__name__(self): + if not _is_class_instance(self._obj) or \ + inspect.ismethoddescriptor(self._obj): # slots + cls = self._obj + else: + try: + cls = self._obj.__class__ + except AttributeError: + # happens with numpy.core.umath._UFUNC_API (you get it + # automatically by doing `import numpy`. + return None + + try: + return force_unicode(cls.__name__) + except AttributeError: + return None + + def py__mro__accesses(self): + return tuple(self._create_access_path(cls) for cls in self._obj.__mro__[1:]) + + def py__getitem__all_values(self): + if isinstance(self._obj, dict): + return [self._create_access_path(v) for v in self._obj.values()] + return self.py__iter__list() + + def py__simple_getitem__(self, index): + if type(self._obj) not in ALLOWED_GETITEM_TYPES: + # Get rid of side effects, we won't call custom `__getitem__`s. + return None + + return self._create_access_path(self._obj[index]) + + def py__iter__list(self): + if not hasattr(self._obj, '__getitem__'): + return None + + if type(self._obj) not in ALLOWED_GETITEM_TYPES: + # Get rid of side effects, we won't call custom `__getitem__`s. + return [] + + lst = [] + for i, part in enumerate(self._obj): + if i > 20: + # Should not go crazy with large iterators + break + lst.append(self._create_access_path(part)) + return lst + + def py__class__(self): + return self._create_access_path(self._obj.__class__) + + def py__bases__(self): + return [self._create_access_path(base) for base in self._obj.__bases__] + + def py__path__(self): + return self._obj.__path__ + + @_force_unicode_decorator + def get_repr(self): + builtins = 'builtins', '__builtin__' + + if inspect.ismodule(self._obj): + return repr(self._obj) + # Try to avoid execution of the property. + if safe_getattr(self._obj, '__module__', default='') in builtins: + return repr(self._obj) + + type_ = type(self._obj) + if type_ == type: + return type.__repr__(self._obj) + + if safe_getattr(type_, '__module__', default='') in builtins: + # Allow direct execution of repr for builtins. + return repr(self._obj) + return object.__repr__(self._obj) + + def is_class(self): + return inspect.isclass(self._obj) + + def is_module(self): + return inspect.ismodule(self._obj) + + def is_instance(self): + return _is_class_instance(self._obj) + + def ismethoddescriptor(self): + return inspect.ismethoddescriptor(self._obj) + + def get_qualified_names(self): + def try_to_get_name(obj): + return getattr(obj, '__qualname__', getattr(obj, '__name__', None)) + + if self.is_module(): + return () + name = try_to_get_name(self._obj) + if name is None: + name = try_to_get_name(type(self._obj)) + if name is None: + return () + return tuple(name.split('.')) + + def dir(self): + return list(map(force_unicode, dir(self._obj))) + + def has_iter(self): + try: + iter(self._obj) + return True + except TypeError: + return False + + def is_allowed_getattr(self, name): + # TODO this API is ugly. + try: + attr, is_get_descriptor = getattr_static(self._obj, name) + except AttributeError: + return False, False + else: + if is_get_descriptor and type(attr) not in ALLOWED_DESCRIPTOR_ACCESS: + # In case of descriptors that have get methods we cannot return + # it's value, because that would mean code execution. + return True, True + return True, False + + def getattr_paths(self, name, default=_sentinel): + try: + return_obj = getattr(self._obj, name) + except Exception as e: + if default is _sentinel: + if isinstance(e, AttributeError): + # Happens e.g. in properties of + # PyQt4.QtGui.QStyleOptionComboBox.currentText + # -> just set it to None + raise + # Just in case anything happens, return an AttributeError. It + # should not crash. + raise AttributeError + return_obj = default + access = self._create_access(return_obj) + if inspect.ismodule(return_obj): + return [access] + + module = inspect.getmodule(return_obj) + if module is None: + module = inspect.getmodule(type(return_obj)) + if module is None: + module = builtins + return [self._create_access(module), access] + + def get_safe_value(self): + if type(self._obj) in (bool, bytes, float, int, str, unicode, slice): + return self._obj + raise ValueError("Object is type %s and not simple" % type(self._obj)) + + def get_api_type(self): + return get_api_type(self._obj) + + def get_access_path_tuples(self): + accesses = [create_access(self._evaluator, o) for o in self._get_objects_path()] + return [(access.py__name__(), access) for access in accesses] + + def _get_objects_path(self): + def get(): + obj = self._obj + yield obj + try: + obj = obj.__objclass__ + except AttributeError: + pass + else: + yield obj + + try: + # Returns a dotted string path. + imp_plz = obj.__module__ + except AttributeError: + # Unfortunately in some cases like `int` there's no __module__ + if not inspect.ismodule(obj): + yield builtins + else: + if imp_plz is None: + # Happens for example in `(_ for _ in []).send.__module__`. + yield builtins + else: + try: + yield sys.modules[imp_plz] + except KeyError: + # __module__ can be something arbitrary that doesn't exist. + yield builtins + + return list(reversed(list(get()))) + + def execute_operation(self, other_access_handle, operator): + other_access = other_access_handle.access + op = _OPERATORS[operator] + return self._create_access_path(op(self._obj, other_access._obj)) + + def needs_type_completions(self): + return inspect.isclass(self._obj) and self._obj != type + + def get_signature_params(self): + return [ + SignatureParam( + name=p.name, + has_default=p.default is not p.empty, + default=self._create_access_path(p.default), + default_string=repr(p.default), + has_annotation=p.annotation is not p.empty, + annotation=self._create_access_path(p.annotation), + annotation_string=str(p.default), + kind_name=str(p.kind) + ) for p in self._get_signature().parameters.values() + ] + + def _get_signature(self): + obj = self._obj + if py_version < 33: + raise ValueError("inspect.signature was introduced in 3.3") + if py_version == 34: + # In 3.4 inspect.signature are wrong for str and int. This has + # been fixed in 3.5. The signature of object is returned, + # because no signature was found for str. Here we imitate 3.5 + # logic and just ignore the signature if the magic methods + # don't match object. + # 3.3 doesn't even have the logic and returns nothing for str + # and classes that inherit from object. + user_def = inspect._signature_get_user_defined_method + if (inspect.isclass(obj) + and not user_def(type(obj), '__init__') + and not user_def(type(obj), '__new__') + and (obj.__init__ != object.__init__ + or obj.__new__ != object.__new__)): + raise ValueError + + try: + return inspect.signature(obj) + except (RuntimeError, TypeError): + # Reading the code of the function in Python 3.6 implies there are + # at least these errors that might occur if something is wrong with + # the signature. In that case we just want a simple escape for now. + raise ValueError + + def get_return_annotation(self): + try: + o = self._obj.__annotations__.get('return') + except AttributeError: + return None + + if o is None: + return None + + return self._create_access_path(o) + + def negate(self): + return self._create_access_path(-self._obj) + + def get_dir_infos(self): + """ + Used to return a couple of infos that are needed when accessing the sub + objects of an objects + """ + # TODO is_allowed_getattr might raise an AttributeError + tuples = dict( + (force_unicode(name), self.is_allowed_getattr(name)) + for name in self.dir() + ) + return self.needs_type_completions(), tuples + + +def _is_class_instance(obj): + """Like inspect.* methods.""" + try: + cls = obj.__class__ + except AttributeError: + return False + else: + return cls != type and not issubclass(cls, NOT_CLASS_TYPES) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/compiled/context.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/compiled/context.py new file mode 100644 index 0000000..731fce0 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/compiled/context.py @@ -0,0 +1,541 @@ +""" +Imitate the parser representation. +""" +import re +from functools import partial + +from jedi import debug +from jedi.evaluate.utils import to_list +from jedi._compatibility import force_unicode, Parameter, cast_path +from jedi.cache import underscore_memoization, memoize_method +from jedi.evaluate.filters import AbstractFilter +from jedi.evaluate.names import AbstractNameDefinition, ContextNameMixin, \ + ParamNameInterface +from jedi.evaluate.base_context import Context, ContextSet, NO_CONTEXTS +from jedi.evaluate.lazy_context import LazyKnownContext +from jedi.evaluate.compiled.access import _sentinel +from jedi.evaluate.cache import evaluator_function_cache +from jedi.evaluate.helpers import reraise_getitem_errors +from jedi.evaluate.signature import BuiltinSignature + + +class CheckAttribute(object): + """Raises an AttributeError if the attribute X isn't available.""" + def __init__(self, check_name=None): + # Remove the py in front of e.g. py__call__. + self.check_name = check_name + + def __call__(self, func): + self.func = func + if self.check_name is None: + self.check_name = force_unicode(func.__name__[2:]) + return self + + def __get__(self, instance, owner): + if instance is None: + return self + + # This might raise an AttributeError. That's wanted. + instance.access_handle.getattr_paths(self.check_name) + return partial(self.func, instance) + + +class CompiledObject(Context): + def __init__(self, evaluator, access_handle, parent_context=None): + super(CompiledObject, self).__init__(evaluator, parent_context) + self.access_handle = access_handle + + def py__call__(self, arguments): + return_annotation = self.access_handle.get_return_annotation() + if return_annotation is not None: + # TODO the return annotation may also be a string. + return create_from_access_path(self.evaluator, return_annotation).execute_annotation() + + try: + self.access_handle.getattr_paths(u'__call__') + except AttributeError: + return super(CompiledObject, self).py__call__(arguments) + else: + if self.access_handle.is_class(): + from jedi.evaluate.context import CompiledInstance + return ContextSet([ + CompiledInstance(self.evaluator, self.parent_context, self, arguments) + ]) + else: + return ContextSet(self._execute_function(arguments)) + + @CheckAttribute() + def py__class__(self): + return create_from_access_path(self.evaluator, self.access_handle.py__class__()) + + @CheckAttribute() + def py__mro__(self): + return (self,) + tuple( + create_from_access_path(self.evaluator, access) + for access in self.access_handle.py__mro__accesses() + ) + + @CheckAttribute() + def py__bases__(self): + return tuple( + create_from_access_path(self.evaluator, access) + for access in self.access_handle.py__bases__() + ) + + @CheckAttribute() + def py__path__(self): + return map(cast_path, self.access_handle.py__path__()) + + @property + def string_names(self): + # For modules + name = self.py__name__() + if name is None: + return () + return tuple(name.split('.')) + + def get_qualified_names(self): + return self.access_handle.get_qualified_names() + + def py__bool__(self): + return self.access_handle.py__bool__() + + def py__file__(self): + return cast_path(self.access_handle.py__file__()) + + def is_class(self): + return self.access_handle.is_class() + + def is_module(self): + return self.access_handle.is_module() + + def is_compiled(self): + return True + + def is_stub(self): + return False + + def is_instance(self): + return self.access_handle.is_instance() + + def py__doc__(self): + return self.access_handle.py__doc__() + + @to_list + def get_param_names(self): + try: + signature_params = self.access_handle.get_signature_params() + except ValueError: # Has no signature + params_str, ret = self._parse_function_doc() + if not params_str: + tokens = [] + else: + tokens = params_str.split(',') + if self.access_handle.ismethoddescriptor(): + tokens.insert(0, 'self') + for p in tokens: + name, _, default = p.strip().partition('=') + yield UnresolvableParamName(self, name, default) + else: + for signature_param in signature_params: + yield SignatureParamName(self, signature_param) + + def get_signatures(self): + _, return_string = self._parse_function_doc() + return [BuiltinSignature(self, return_string)] + + def __repr__(self): + return '<%s: %s>' % (self.__class__.__name__, self.access_handle.get_repr()) + + @underscore_memoization + def _parse_function_doc(self): + doc = self.py__doc__() + if doc is None: + return '', '' + + return _parse_function_doc(doc) + + @property + def api_type(self): + return self.access_handle.get_api_type() + + @underscore_memoization + def _cls(self): + """ + We used to limit the lookups for instantiated objects like list(), but + this is not the case anymore. Python itself + """ + # Ensures that a CompiledObject is returned that is not an instance (like list) + return self + + def get_filters(self, search_global=False, is_instance=False, + until_position=None, origin_scope=None): + yield self._ensure_one_filter(is_instance) + + @memoize_method + def _ensure_one_filter(self, is_instance): + """ + search_global shouldn't change the fact that there's one dict, this way + there's only one `object`. + """ + return CompiledObjectFilter(self.evaluator, self, is_instance) + + @CheckAttribute(u'__getitem__') + def py__simple_getitem__(self, index): + with reraise_getitem_errors(IndexError, KeyError, TypeError): + access = self.access_handle.py__simple_getitem__(index) + if access is None: + return NO_CONTEXTS + + return ContextSet([create_from_access_path(self.evaluator, access)]) + + def py__getitem__(self, index_context_set, contextualized_node): + all_access_paths = self.access_handle.py__getitem__all_values() + if all_access_paths is None: + # This means basically that no __getitem__ has been defined on this + # object. + return super(CompiledObject, self).py__getitem__(index_context_set, contextualized_node) + return ContextSet( + create_from_access_path(self.evaluator, access) + for access in all_access_paths + ) + + def py__iter__(self, contextualized_node=None): + # Python iterators are a bit strange, because there's no need for + # the __iter__ function as long as __getitem__ is defined (it will + # just start with __getitem__(0). This is especially true for + # Python 2 strings, where `str.__iter__` is not even defined. + if not self.access_handle.has_iter(): + for x in super(CompiledObject, self).py__iter__(contextualized_node): + yield x + + access_path_list = self.access_handle.py__iter__list() + if access_path_list is None: + # There is no __iter__ method on this object. + return + + for access in access_path_list: + yield LazyKnownContext(create_from_access_path(self.evaluator, access)) + + def py__name__(self): + return self.access_handle.py__name__() + + @property + def name(self): + name = self.py__name__() + if name is None: + name = self.access_handle.get_repr() + return CompiledContextName(self, name) + + def _execute_function(self, params): + from jedi.evaluate import docstrings + from jedi.evaluate.compiled import builtin_from_name + if self.api_type != 'function': + return + + for name in self._parse_function_doc()[1].split(): + try: + # TODO wtf is this? this is exactly the same as the thing + # below. It uses getattr as well. + self.evaluator.builtins_module.access_handle.getattr_paths(name) + except AttributeError: + continue + else: + bltn_obj = builtin_from_name(self.evaluator, name) + for result in self.evaluator.execute(bltn_obj, params): + yield result + for type_ in docstrings.infer_return_types(self): + yield type_ + + def get_safe_value(self, default=_sentinel): + try: + return self.access_handle.get_safe_value() + except ValueError: + if default == _sentinel: + raise + return default + + def execute_operation(self, other, operator): + return create_from_access_path( + self.evaluator, + self.access_handle.execute_operation(other.access_handle, operator) + ) + + def negate(self): + return create_from_access_path(self.evaluator, self.access_handle.negate()) + + def get_metaclasses(self): + return NO_CONTEXTS + + +class CompiledName(AbstractNameDefinition): + def __init__(self, evaluator, parent_context, name): + self._evaluator = evaluator + self.parent_context = parent_context + self.string_name = name + + def _get_qualified_names(self): + parent_qualified_names = self.parent_context.get_qualified_names() + return parent_qualified_names + (self.string_name,) + + def __repr__(self): + try: + name = self.parent_context.name # __name__ is not defined all the time + except AttributeError: + name = None + return '<%s: (%s).%s>' % (self.__class__.__name__, name, self.string_name) + + @property + def api_type(self): + api = self.infer() + # If we can't find the type, assume it is an instance variable + if not api: + return "instance" + return next(iter(api)).api_type + + @underscore_memoization + def infer(self): + return ContextSet([_create_from_name( + self._evaluator, self.parent_context, self.string_name + )]) + + +class SignatureParamName(ParamNameInterface, AbstractNameDefinition): + def __init__(self, compiled_obj, signature_param): + self.parent_context = compiled_obj.parent_context + self._signature_param = signature_param + + @property + def string_name(self): + return self._signature_param.name + + def to_string(self): + s = self._kind_string() + self.string_name + if self._signature_param.has_annotation: + s += ': ' + self._signature_param.annotation_string + if self._signature_param.has_default: + s += '=' + self._signature_param.default_string + return s + + def get_kind(self): + return getattr(Parameter, self._signature_param.kind_name) + + def infer(self): + p = self._signature_param + evaluator = self.parent_context.evaluator + contexts = NO_CONTEXTS + if p.has_default: + contexts = ContextSet([create_from_access_path(evaluator, p.default)]) + if p.has_annotation: + annotation = create_from_access_path(evaluator, p.annotation) + contexts |= annotation.execute_evaluated() + return contexts + + +class UnresolvableParamName(ParamNameInterface, AbstractNameDefinition): + def __init__(self, compiled_obj, name, default): + self.parent_context = compiled_obj.parent_context + self.string_name = name + self._default = default + + def get_kind(self): + return Parameter.POSITIONAL_ONLY + + def to_string(self): + string = self.string_name + if self._default: + string += '=' + self._default + return string + + def infer(self): + return NO_CONTEXTS + + +class CompiledContextName(ContextNameMixin, AbstractNameDefinition): + def __init__(self, context, name): + self.string_name = name + self._context = context + self.parent_context = context.parent_context + + +class EmptyCompiledName(AbstractNameDefinition): + """ + Accessing some names will raise an exception. To avoid not having any + completions, just give Jedi the option to return this object. It infers to + nothing. + """ + def __init__(self, evaluator, name): + self.parent_context = evaluator.builtins_module + self.string_name = name + + def infer(self): + return NO_CONTEXTS + + +class CompiledObjectFilter(AbstractFilter): + name_class = CompiledName + + def __init__(self, evaluator, compiled_object, is_instance=False): + self._evaluator = evaluator + self.compiled_object = compiled_object + self.is_instance = is_instance + + def get(self, name): + return self._get( + name, + lambda: self.compiled_object.access_handle.is_allowed_getattr(name), + lambda: self.compiled_object.access_handle.dir(), + check_has_attribute=True + ) + + def _get(self, name, allowed_getattr_callback, dir_callback, check_has_attribute=False): + """ + To remove quite a few access calls we introduced the callback here. + """ + has_attribute, is_descriptor = allowed_getattr_callback() + if check_has_attribute and not has_attribute: + return [] + + # Always use unicode objects in Python 2 from here. + name = force_unicode(name) + + if (is_descriptor and not self._evaluator.allow_descriptor_getattr) or not has_attribute: + return [self._get_cached_name(name, is_empty=True)] + + if self.is_instance and name not in dir_callback(): + return [] + return [self._get_cached_name(name)] + + @memoize_method + def _get_cached_name(self, name, is_empty=False): + if is_empty: + return EmptyCompiledName(self._evaluator, name) + else: + return self._create_name(name) + + def values(self): + from jedi.evaluate.compiled import builtin_from_name + names = [] + needs_type_completions, dir_infos = self.compiled_object.access_handle.get_dir_infos() + for name in dir_infos: + names += self._get( + name, + lambda: dir_infos[name], + lambda: dir_infos.keys(), + ) + + # ``dir`` doesn't include the type names. + if not self.is_instance and needs_type_completions: + for filter in builtin_from_name(self._evaluator, u'type').get_filters(): + names += filter.values() + return names + + def _create_name(self, name): + return self.name_class(self._evaluator, self.compiled_object, name) + + def __repr__(self): + return "<%s: %s>" % (self.__class__.__name__, self.compiled_object) + + +docstr_defaults = { + 'floating point number': u'float', + 'character': u'str', + 'integer': u'int', + 'dictionary': u'dict', + 'string': u'str', +} + + +def _parse_function_doc(doc): + """ + Takes a function and returns the params and return value as a tuple. + This is nothing more than a docstring parser. + + TODO docstrings like utime(path, (atime, mtime)) and a(b [, b]) -> None + TODO docstrings like 'tuple of integers' + """ + doc = force_unicode(doc) + # parse round parentheses: def func(a, (b,c)) + try: + count = 0 + start = doc.index('(') + for i, s in enumerate(doc[start:]): + if s == '(': + count += 1 + elif s == ')': + count -= 1 + if count == 0: + end = start + i + break + param_str = doc[start + 1:end] + except (ValueError, UnboundLocalError): + # ValueError for doc.index + # UnboundLocalError for undefined end in last line + debug.dbg('no brackets found - no param') + end = 0 + param_str = u'' + else: + # remove square brackets, that show an optional param ( = None) + def change_options(m): + args = m.group(1).split(',') + for i, a in enumerate(args): + if a and '=' not in a: + args[i] += '=None' + return ','.join(args) + + while True: + param_str, changes = re.subn(r' ?\[([^\[\]]+)\]', + change_options, param_str) + if changes == 0: + break + param_str = param_str.replace('-', '_') # see: isinstance.__doc__ + + # parse return value + r = re.search(u'-[>-]* ', doc[end:end + 7]) + if r is None: + ret = u'' + else: + index = end + r.end() + # get result type, which can contain newlines + pattern = re.compile(r'(,\n|[^\n-])+') + ret_str = pattern.match(doc, index).group(0).strip() + # New object -> object() + ret_str = re.sub(r'[nN]ew (.*)', r'\1()', ret_str) + + ret = docstr_defaults.get(ret_str, ret_str) + + return param_str, ret + + +def _create_from_name(evaluator, compiled_object, name): + access_paths = compiled_object.access_handle.getattr_paths(name, default=None) + parent_context = compiled_object + if parent_context.is_class(): + parent_context = parent_context.parent_context + + context = None + for access_path in access_paths: + context = create_cached_compiled_object( + evaluator, access_path, parent_context=context + ) + return context + + +def _normalize_create_args(func): + """The cache doesn't care about keyword vs. normal args.""" + def wrapper(evaluator, obj, parent_context=None): + return func(evaluator, obj, parent_context) + return wrapper + + +def create_from_access_path(evaluator, access_path): + parent_context = None + for name, access in access_path.accesses: + parent_context = create_cached_compiled_object(evaluator, access, parent_context) + return parent_context + + +@_normalize_create_args +@evaluator_function_cache() +def create_cached_compiled_object(evaluator, access_handle, parent_context): + return CompiledObject(evaluator, access_handle, parent_context) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/compiled/getattr_static.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/compiled/getattr_static.py new file mode 100644 index 0000000..946ac09 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/compiled/getattr_static.py @@ -0,0 +1,176 @@ +""" +A static version of getattr. +This is a backport of the Python 3 code with a little bit of additional +information returned to enable Jedi to make decisions. +""" + +import types + +from jedi._compatibility import py_version + +_sentinel = object() + + +def _check_instance(obj, attr): + instance_dict = {} + try: + instance_dict = object.__getattribute__(obj, "__dict__") + except AttributeError: + pass + return dict.get(instance_dict, attr, _sentinel) + + +def _check_class(klass, attr): + for entry in _static_getmro(klass): + if _shadowed_dict(type(entry)) is _sentinel: + try: + return entry.__dict__[attr] + except KeyError: + pass + return _sentinel + + +def _is_type(obj): + try: + _static_getmro(obj) + except TypeError: + return False + return True + + +def _shadowed_dict_newstyle(klass): + dict_attr = type.__dict__["__dict__"] + for entry in _static_getmro(klass): + try: + class_dict = dict_attr.__get__(entry)["__dict__"] + except KeyError: + pass + else: + if not (type(class_dict) is types.GetSetDescriptorType and + class_dict.__name__ == "__dict__" and + class_dict.__objclass__ is entry): + return class_dict + return _sentinel + + +def _static_getmro_newstyle(klass): + return type.__dict__['__mro__'].__get__(klass) + + +if py_version >= 30: + _shadowed_dict = _shadowed_dict_newstyle + _get_type = type + _static_getmro = _static_getmro_newstyle +else: + def _shadowed_dict(klass): + """ + In Python 2 __dict__ is not overwritable: + + class Foo(object): pass + setattr(Foo, '__dict__', 4) + + Traceback (most recent call last): + File "", line 1, in + TypeError: __dict__ must be a dictionary object + + It applies to both newstyle and oldstyle classes: + + class Foo(object): pass + setattr(Foo, '__dict__', 4) + Traceback (most recent call last): + File "", line 1, in + AttributeError: attribute '__dict__' of 'type' objects is not writable + + It also applies to instances of those objects. However to keep things + straight forward, newstyle classes always use the complicated way of + accessing it while oldstyle classes just use getattr. + """ + if type(klass) is _oldstyle_class_type: + return getattr(klass, '__dict__', _sentinel) + return _shadowed_dict_newstyle(klass) + + class _OldStyleClass: + pass + + _oldstyle_instance_type = type(_OldStyleClass()) + _oldstyle_class_type = type(_OldStyleClass) + + def _get_type(obj): + type_ = object.__getattribute__(obj, '__class__') + if type_ is _oldstyle_instance_type: + # Somehow for old style classes we need to access it directly. + return obj.__class__ + return type_ + + def _static_getmro(klass): + if type(klass) is _oldstyle_class_type: + def oldstyle_mro(klass): + """ + Oldstyle mro is a really simplistic way of look up mro: + https://stackoverflow.com/questions/54867/what-is-the-difference-between-old-style-and-new-style-classes-in-python + """ + yield klass + for base in klass.__bases__: + for yield_from in oldstyle_mro(base): + yield yield_from + + return oldstyle_mro(klass) + + return _static_getmro_newstyle(klass) + + +def _safe_hasattr(obj, name): + return _check_class(_get_type(obj), name) is not _sentinel + + +def _safe_is_data_descriptor(obj): + return _safe_hasattr(obj, '__set__') or _safe_hasattr(obj, '__delete__') + + +def getattr_static(obj, attr, default=_sentinel): + """Retrieve attributes without triggering dynamic lookup via the + descriptor protocol, __getattr__ or __getattribute__. + + Note: this function may not be able to retrieve all attributes + that getattr can fetch (like dynamically created attributes) + and may find attributes that getattr can't (like descriptors + that raise AttributeError). It can also return descriptor objects + instead of instance members in some cases. See the + documentation for details. + + Returns a tuple `(attr, is_get_descriptor)`. is_get_descripter means that + the attribute is a descriptor that has a `__get__` attribute. + """ + instance_result = _sentinel + if not _is_type(obj): + klass = _get_type(obj) + dict_attr = _shadowed_dict(klass) + if (dict_attr is _sentinel or type(dict_attr) is types.MemberDescriptorType): + instance_result = _check_instance(obj, attr) + else: + klass = obj + + klass_result = _check_class(klass, attr) + + if instance_result is not _sentinel and klass_result is not _sentinel: + if _safe_hasattr(klass_result, '__get__') \ + and _safe_is_data_descriptor(klass_result): + # A get/set descriptor has priority over everything. + return klass_result, True + + if instance_result is not _sentinel: + return instance_result, False + if klass_result is not _sentinel: + return klass_result, _safe_hasattr(klass_result, '__get__') + + if obj is klass: + # for types we check the metaclass too + for entry in _static_getmro(type(klass)): + if _shadowed_dict(type(entry)) is _sentinel: + try: + return entry.__dict__[attr], False + except KeyError: + pass + if default is not _sentinel: + return default, False + raise AttributeError(attr) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/compiled/mixed.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/compiled/mixed.py new file mode 100644 index 0000000..37d9fbe --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/compiled/mixed.py @@ -0,0 +1,291 @@ +""" +Used only for REPL Completion. +""" + +import inspect +import os +import sys + +from jedi.parser_utils import get_cached_code_lines + +from jedi import settings +from jedi.evaluate import compiled +from jedi.cache import underscore_memoization +from jedi.file_io import FileIO +from jedi.evaluate.base_context import ContextSet, ContextWrapper +from jedi.evaluate.helpers import SimpleGetItemNotFound +from jedi.evaluate.context import ModuleContext +from jedi.evaluate.cache import evaluator_function_cache +from jedi.evaluate.compiled.getattr_static import getattr_static +from jedi.evaluate.compiled.access import compiled_objects_cache, \ + ALLOWED_GETITEM_TYPES, get_api_type +from jedi.evaluate.compiled.context import create_cached_compiled_object +from jedi.evaluate.gradual.conversion import to_stub + +_sentinel = object() + + +class MixedObject(ContextWrapper): + """ + A ``MixedObject`` is used in two ways: + + 1. It uses the default logic of ``parser.python.tree`` objects, + 2. except for getattr calls. The names dicts are generated in a fashion + like ``CompiledObject``. + + This combined logic makes it possible to provide more powerful REPL + completion. It allows side effects that are not noticable with the default + parser structure to still be completeable. + + The biggest difference from CompiledObject to MixedObject is that we are + generally dealing with Python code and not with C code. This will generate + fewer special cases, because we in Python you don't have the same freedoms + to modify the runtime. + """ + def __init__(self, compiled_object, tree_context): + super(MixedObject, self).__init__(tree_context) + self.compiled_object = compiled_object + self.access_handle = compiled_object.access_handle + + def get_filters(self, *args, **kwargs): + yield MixedObjectFilter(self.evaluator, self) + + def get_signatures(self): + # Prefer `inspect.signature` over somehow analyzing Python code. It + # should be very precise, especially for stuff like `partial`. + return self.compiled_object.get_signatures() + + def py__call__(self, arguments): + return (to_stub(self._wrapped_context) or self._wrapped_context).py__call__(arguments) + + def get_safe_value(self, default=_sentinel): + if default is _sentinel: + return self.compiled_object.get_safe_value() + else: + return self.compiled_object.get_safe_value(default) + + def py__simple_getitem__(self, index): + python_object = self.compiled_object.access_handle.access._obj + if type(python_object) in ALLOWED_GETITEM_TYPES: + return self.compiled_object.py__simple_getitem__(index) + raise SimpleGetItemNotFound + + def __repr__(self): + return '<%s: %s>' % ( + type(self).__name__, + self.access_handle.get_repr() + ) + + +class MixedName(compiled.CompiledName): + """ + The ``CompiledName._compiled_object`` is our MixedObject. + """ + @property + def start_pos(self): + contexts = list(self.infer()) + if not contexts: + # This means a start_pos that doesn't exist (compiled objects). + return 0, 0 + return contexts[0].name.start_pos + + @start_pos.setter + def start_pos(self, value): + # Ignore the __init__'s start_pos setter call. + pass + + @underscore_memoization + def infer(self): + # TODO use logic from compiled.CompiledObjectFilter + access_paths = self.parent_context.access_handle.getattr_paths( + self.string_name, + default=None + ) + assert len(access_paths) + contexts = [None] + for access in access_paths: + contexts = ContextSet.from_sets( + _create(self._evaluator, access, parent_context=c) + if c is None or isinstance(c, MixedObject) + else ContextSet({create_cached_compiled_object(c.evaluator, access, c)}) + for c in contexts + ) + return contexts + + @property + def api_type(self): + return next(iter(self.infer())).api_type + + +class MixedObjectFilter(compiled.CompiledObjectFilter): + name_class = MixedName + + +@evaluator_function_cache() +def _load_module(evaluator, path): + module_node = evaluator.parse( + path=path, + cache=True, + diff_cache=settings.fast_parser, + cache_path=settings.cache_directory + ).get_root_node() + # python_module = inspect.getmodule(python_object) + # TODO we should actually make something like this possible. + #evaluator.modules[python_module.__name__] = module_node + return module_node + + +def _get_object_to_check(python_object): + """Check if inspect.getfile has a chance to find the source.""" + if sys.version_info[0] > 2: + python_object = inspect.unwrap(python_object) + + if (inspect.ismodule(python_object) or + inspect.isclass(python_object) or + inspect.ismethod(python_object) or + inspect.isfunction(python_object) or + inspect.istraceback(python_object) or + inspect.isframe(python_object) or + inspect.iscode(python_object)): + return python_object + + try: + return python_object.__class__ + except AttributeError: + raise TypeError # Prevents computation of `repr` within inspect. + + +def _find_syntax_node_name(evaluator, python_object): + original_object = python_object + try: + python_object = _get_object_to_check(python_object) + path = inspect.getsourcefile(python_object) + except TypeError: + # The type might not be known (e.g. class_with_dict.__weakref__) + return None + if path is None or not os.path.exists(path): + # The path might not exist or be e.g. . + return None + + file_io = FileIO(path) + module_node = _load_module(evaluator, path) + + if inspect.ismodule(python_object): + # We don't need to check names for modules, because there's not really + # a way to write a module in a module in Python (and also __name__ can + # be something like ``email.utils``). + code_lines = get_cached_code_lines(evaluator.grammar, path) + return module_node, module_node, file_io, code_lines + + try: + name_str = python_object.__name__ + except AttributeError: + # Stuff like python_function.__code__. + return None + + if name_str == '': + return None # It's too hard to find lambdas. + + # Doesn't always work (e.g. os.stat_result) + names = module_node.get_used_names().get(name_str, []) + # Only functions and classes are relevant. If a name e.g. points to an + # import, it's probably a builtin (like collections.deque) and needs to be + # ignored. + names = [ + n for n in names + if n.parent.type in ('funcdef', 'classdef') and n.parent.name == n + ] + if not names: + return None + + try: + code = python_object.__code__ + # By using the line number of a code object we make the lookup in a + # file pretty easy. There's still a possibility of people defining + # stuff like ``a = 3; foo(a); a = 4`` on the same line, but if people + # do so we just don't care. + line_nr = code.co_firstlineno + except AttributeError: + pass + else: + line_names = [name for name in names if name.start_pos[0] == line_nr] + # There's a chance that the object is not available anymore, because + # the code has changed in the background. + if line_names: + names = line_names + + code_lines = get_cached_code_lines(evaluator.grammar, path) + # It's really hard to actually get the right definition, here as a last + # resort we just return the last one. This chance might lead to odd + # completions at some points but will lead to mostly correct type + # inference, because people tend to define a public name in a module only + # once. + tree_node = names[-1].parent + if tree_node.type == 'funcdef' and get_api_type(original_object) == 'instance': + # If an instance is given and we're landing on a function (e.g. + # partial in 3.5), something is completely wrong and we should not + # return that. + return None + return module_node, tree_node, file_io, code_lines + + +@compiled_objects_cache('mixed_cache') +def _create(evaluator, access_handle, parent_context, *args): + compiled_object = create_cached_compiled_object( + evaluator, + access_handle, + parent_context=parent_context and parent_context.compiled_object + ) + + # TODO accessing this is bad, but it probably doesn't matter that much, + # because we're working with interpreteters only here. + python_object = access_handle.access._obj + result = _find_syntax_node_name(evaluator, python_object) + if result is None: + # TODO Care about generics from stuff like `[1]` and don't return like this. + if type(python_object) in (dict, list, tuple): + return ContextSet({compiled_object}) + + tree_contexts = to_stub(compiled_object) + if not tree_contexts: + return ContextSet({compiled_object}) + else: + module_node, tree_node, file_io, code_lines = result + + if parent_context is None: + # TODO this __name__ is probably wrong. + name = compiled_object.get_root_context().py__name__() + string_names = tuple(name.split('.')) + module_context = ModuleContext( + evaluator, module_node, + file_io=file_io, + string_names=string_names, + code_lines=code_lines, + is_package=hasattr(compiled_object, 'py__path__'), + ) + if name is not None: + evaluator.module_cache.add(string_names, ContextSet([module_context])) + else: + if parent_context.tree_node.get_root_node() != module_node: + # This happens e.g. when __module__ is wrong, or when using + # TypeVar('foo'), where Jedi uses 'foo' as the name and + # Python's TypeVar('foo').__module__ will be typing. + return ContextSet({compiled_object}) + module_context = parent_context.get_root_context() + + tree_contexts = ContextSet({ + module_context.create_context( + tree_node, + node_is_context=True, + node_is_object=True + ) + }) + if tree_node.type == 'classdef': + if not access_handle.is_class(): + # Is an instance, not a class. + tree_contexts = tree_contexts.execute_evaluated() + + return ContextSet( + MixedObject(compiled_object, tree_context=tree_context) + for tree_context in tree_contexts + ) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/compiled/subprocess/__init__.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/compiled/subprocess/__init__.py new file mode 100644 index 0000000..dea2f66 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/compiled/subprocess/__init__.py @@ -0,0 +1,406 @@ +""" +Makes it possible to do the compiled analysis in a subprocess. This has two +goals: + +1. Making it safer - Segfaults and RuntimeErrors as well as stdout/stderr can + be ignored and dealt with. +2. Make it possible to handle different Python versions as well as virtualenvs. +""" + +import os +import sys +import subprocess +import socket +import errno +import traceback +from functools import partial +from threading import Thread +try: + from queue import Queue, Empty +except ImportError: + from Queue import Queue, Empty # python 2.7 + +from jedi._compatibility import queue, is_py3, force_unicode, \ + pickle_dump, pickle_load, GeneralizedPopen, weakref +from jedi import debug +from jedi.cache import memoize_method +from jedi.evaluate.compiled.subprocess import functions +from jedi.evaluate.compiled.access import DirectObjectAccess, AccessPath, \ + SignatureParam +from jedi.api.exceptions import InternalError + + +_MAIN_PATH = os.path.join(os.path.dirname(__file__), '__main__.py') + + +def _enqueue_output(out, queue): + for line in iter(out.readline, b''): + queue.put(line) + + +def _add_stderr_to_debug(stderr_queue): + while True: + # Try to do some error reporting from the subprocess and print its + # stderr contents. + try: + line = stderr_queue.get_nowait() + line = line.decode('utf-8', 'replace') + debug.warning('stderr output: %s' % line.rstrip('\n')) + except Empty: + break + + +def _get_function(name): + return getattr(functions, name) + + +def _cleanup_process(process, thread): + try: + process.kill() + process.wait() + except OSError: + # Raised if the process is already killed. + pass + thread.join() + for stream in [process.stdin, process.stdout, process.stderr]: + try: + stream.close() + except OSError: + # Raised if the stream is broken. + pass + + +class _EvaluatorProcess(object): + def __init__(self, evaluator): + self._evaluator_weakref = weakref.ref(evaluator) + self._evaluator_id = id(evaluator) + self._handles = {} + + def get_or_create_access_handle(self, obj): + id_ = id(obj) + try: + return self.get_access_handle(id_) + except KeyError: + access = DirectObjectAccess(self._evaluator_weakref(), obj) + handle = AccessHandle(self, access, id_) + self.set_access_handle(handle) + return handle + + def get_access_handle(self, id_): + return self._handles[id_] + + def set_access_handle(self, handle): + self._handles[handle.id] = handle + + +class EvaluatorSameProcess(_EvaluatorProcess): + """ + Basically just an easy access to functions.py. It has the same API + as EvaluatorSubprocess and does the same thing without using a subprocess. + This is necessary for the Interpreter process. + """ + def __getattr__(self, name): + return partial(_get_function(name), self._evaluator_weakref()) + + +class EvaluatorSubprocess(_EvaluatorProcess): + def __init__(self, evaluator, compiled_subprocess): + super(EvaluatorSubprocess, self).__init__(evaluator) + self._used = False + self._compiled_subprocess = compiled_subprocess + + def __getattr__(self, name): + func = _get_function(name) + + def wrapper(*args, **kwargs): + self._used = True + + result = self._compiled_subprocess.run( + self._evaluator_weakref(), + func, + args=args, + kwargs=kwargs, + ) + # IMO it should be possible to create a hook in pickle.load to + # mess with the loaded objects. However it's extremely complicated + # to work around this so just do it with this call. ~ dave + return self._convert_access_handles(result) + + return wrapper + + def _convert_access_handles(self, obj): + if isinstance(obj, SignatureParam): + return SignatureParam(*self._convert_access_handles(tuple(obj))) + elif isinstance(obj, tuple): + return tuple(self._convert_access_handles(o) for o in obj) + elif isinstance(obj, list): + return [self._convert_access_handles(o) for o in obj] + elif isinstance(obj, AccessHandle): + try: + # Rewrite the access handle to one we're already having. + obj = self.get_access_handle(obj.id) + except KeyError: + obj.add_subprocess(self) + self.set_access_handle(obj) + elif isinstance(obj, AccessPath): + return AccessPath(self._convert_access_handles(obj.accesses)) + return obj + + def __del__(self): + if self._used and not self._compiled_subprocess.is_crashed: + self._compiled_subprocess.delete_evaluator(self._evaluator_id) + + +class CompiledSubprocess(object): + is_crashed = False + # Start with 2, gets set after _get_info. + _pickle_protocol = 2 + + def __init__(self, executable): + self._executable = executable + self._evaluator_deletion_queue = queue.deque() + self._cleanup_callable = lambda: None + + def __repr__(self): + pid = os.getpid() + return '<%s _executable=%r, _pickle_protocol=%r, is_crashed=%r, pid=%r>' % ( + self.__class__.__name__, + self._executable, + self._pickle_protocol, + self.is_crashed, + pid, + ) + + @memoize_method + def _get_process(self): + debug.dbg('Start environment subprocess %s', self._executable) + parso_path = sys.modules['parso'].__file__ + args = ( + self._executable, + _MAIN_PATH, + os.path.dirname(os.path.dirname(parso_path)), + '.'.join(str(x) for x in sys.version_info[:3]), + ) + process = GeneralizedPopen( + args, + stdin=subprocess.PIPE, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + # Use system default buffering on Python 2 to improve performance + # (this is already the case on Python 3). + bufsize=-1 + ) + self._stderr_queue = Queue() + self._stderr_thread = t = Thread( + target=_enqueue_output, + args=(process.stderr, self._stderr_queue) + ) + t.daemon = True + t.start() + # Ensure the subprocess is properly cleaned up when the object + # is garbage collected. + self._cleanup_callable = weakref.finalize(self, + _cleanup_process, + process, + t) + return process + + def run(self, evaluator, function, args=(), kwargs={}): + # Delete old evaluators. + while True: + try: + evaluator_id = self._evaluator_deletion_queue.pop() + except IndexError: + break + else: + self._send(evaluator_id, None) + + assert callable(function) + return self._send(id(evaluator), function, args, kwargs) + + def get_sys_path(self): + return self._send(None, functions.get_sys_path, (), {}) + + def _kill(self): + self.is_crashed = True + self._cleanup_callable() + + def _send(self, evaluator_id, function, args=(), kwargs={}): + if self.is_crashed: + raise InternalError("The subprocess %s has crashed." % self._executable) + + if not is_py3: + # Python 2 compatibility + kwargs = {force_unicode(key): value for key, value in kwargs.items()} + + data = evaluator_id, function, args, kwargs + try: + pickle_dump(data, self._get_process().stdin, self._pickle_protocol) + except (socket.error, IOError) as e: + # Once Python2 will be removed we can just use `BrokenPipeError`. + # Also, somehow in windows it returns EINVAL instead of EPIPE if + # the subprocess dies. + if e.errno not in (errno.EPIPE, errno.EINVAL): + # Not a broken pipe + raise + self._kill() + raise InternalError("The subprocess %s was killed. Maybe out of memory?" + % self._executable) + + try: + is_exception, traceback, result = pickle_load(self._get_process().stdout) + except EOFError as eof_error: + try: + stderr = self._get_process().stderr.read().decode('utf-8', 'replace') + except Exception as exc: + stderr = '' % exc + self._kill() + _add_stderr_to_debug(self._stderr_queue) + raise InternalError( + "The subprocess %s has crashed (%r, stderr=%s)." % ( + self._executable, + eof_error, + stderr, + )) + + _add_stderr_to_debug(self._stderr_queue) + + if is_exception: + # Replace the attribute error message with a the traceback. It's + # way more informative. + result.args = (traceback,) + raise result + return result + + def delete_evaluator(self, evaluator_id): + """ + Currently we are not deleting evalutors instantly. They only get + deleted once the subprocess is used again. It would probably a better + solution to move all of this into a thread. However, the memory usage + of a single evaluator shouldn't be that high. + """ + # With an argument - the evaluator gets deleted. + self._evaluator_deletion_queue.append(evaluator_id) + + +class Listener(object): + def __init__(self, pickle_protocol): + self._evaluators = {} + # TODO refactor so we don't need to process anymore just handle + # controlling. + self._process = _EvaluatorProcess(Listener) + self._pickle_protocol = pickle_protocol + + def _get_evaluator(self, function, evaluator_id): + from jedi.evaluate import Evaluator + + try: + evaluator = self._evaluators[evaluator_id] + except KeyError: + from jedi.api.environment import InterpreterEnvironment + evaluator = Evaluator( + # The project is not actually needed. Nothing should need to + # access it. + project=None, + environment=InterpreterEnvironment() + ) + self._evaluators[evaluator_id] = evaluator + return evaluator + + def _run(self, evaluator_id, function, args, kwargs): + if evaluator_id is None: + return function(*args, **kwargs) + elif function is None: + del self._evaluators[evaluator_id] + else: + evaluator = self._get_evaluator(function, evaluator_id) + + # Exchange all handles + args = list(args) + for i, arg in enumerate(args): + if isinstance(arg, AccessHandle): + args[i] = evaluator.compiled_subprocess.get_access_handle(arg.id) + for key, value in kwargs.items(): + if isinstance(value, AccessHandle): + kwargs[key] = evaluator.compiled_subprocess.get_access_handle(value.id) + + return function(evaluator, *args, **kwargs) + + def listen(self): + stdout = sys.stdout + # Mute stdout. Nobody should actually be able to write to it, + # because stdout is used for IPC. + sys.stdout = open(os.devnull, 'w') + stdin = sys.stdin + if sys.version_info[0] > 2: + stdout = stdout.buffer + stdin = stdin.buffer + # Python 2 opens streams in text mode on Windows. Set stdout and stdin + # to binary mode. + elif sys.platform == 'win32': + import msvcrt + msvcrt.setmode(stdout.fileno(), os.O_BINARY) + msvcrt.setmode(stdin.fileno(), os.O_BINARY) + + while True: + try: + payload = pickle_load(stdin) + except EOFError: + # It looks like the parent process closed. + # Don't make a big fuss here and just exit. + exit(0) + try: + result = False, None, self._run(*payload) + except Exception as e: + result = True, traceback.format_exc(), e + + pickle_dump(result, stdout, self._pickle_protocol) + + +class AccessHandle(object): + def __init__(self, subprocess, access, id_): + self.access = access + self._subprocess = subprocess + self.id = id_ + + def add_subprocess(self, subprocess): + self._subprocess = subprocess + + def __repr__(self): + try: + detail = self.access + except AttributeError: + detail = '#' + str(self.id) + return '<%s of %s>' % (self.__class__.__name__, detail) + + def __getstate__(self): + return self.id + + def __setstate__(self, state): + self.id = state + + def __getattr__(self, name): + if name in ('id', 'access') or name.startswith('_'): + raise AttributeError("Something went wrong with unpickling") + + #if not is_py3: print >> sys.stderr, name + #print('getattr', name, file=sys.stderr) + return partial(self._workaround, force_unicode(name)) + + def _workaround(self, name, *args, **kwargs): + """ + TODO Currently we're passing slice objects around. This should not + happen. They are also the only unhashable objects that we're passing + around. + """ + if args and isinstance(args[0], slice): + return self._subprocess.get_compiled_method_return(self.id, name, *args, **kwargs) + return self._cached_results(name, *args, **kwargs) + + @memoize_method + def _cached_results(self, name, *args, **kwargs): + #if type(self._subprocess) == EvaluatorSubprocess: + #print(name, args, kwargs, + #self._subprocess.get_compiled_method_return(self.id, name, *args, **kwargs) + #) + return self._subprocess.get_compiled_method_return(self.id, name, *args, **kwargs) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/compiled/subprocess/__main__.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/compiled/subprocess/__main__.py new file mode 100644 index 0000000..4be2820 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/compiled/subprocess/__main__.py @@ -0,0 +1,55 @@ +import os +import sys + + +def _get_paths(): + # Get the path to jedi. + _d = os.path.dirname + _jedi_path = _d(_d(_d(_d(_d(__file__))))) + _parso_path = sys.argv[1] + # The paths are the directory that jedi and parso lie in. + return {'jedi': _jedi_path, 'parso': _parso_path} + + +# Remove the first entry, because it's simply a directory entry that equals +# this directory. +del sys.path[0] + +if sys.version_info > (3, 4): + from importlib.machinery import PathFinder + + class _ExactImporter(object): + def __init__(self, path_dct): + self._path_dct = path_dct + + def find_module(self, fullname, path=None): + if path is None and fullname in self._path_dct: + p = self._path_dct[fullname] + loader = PathFinder.find_module(fullname, path=[p]) + return loader + return None + + # Try to import jedi/parso. + sys.meta_path.insert(0, _ExactImporter(_get_paths())) + from jedi.evaluate.compiled import subprocess # NOQA + sys.meta_path.pop(0) +else: + import imp + + def load(name): + paths = list(_get_paths().values()) + fp, pathname, description = imp.find_module(name, paths) + return imp.load_module(name, fp, pathname, description) + + load('parso') + load('jedi') + from jedi.evaluate.compiled import subprocess # NOQA + +from jedi._compatibility import highest_pickle_protocol # noqa: E402 + + +# Retrieve the pickle protocol. +host_sys_version = [int(x) for x in sys.argv[2].split('.')] +pickle_protocol = highest_pickle_protocol([sys.version_info, host_sys_version]) +# And finally start the client. +subprocess.Listener(pickle_protocol=pickle_protocol).listen() diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/compiled/subprocess/functions.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/compiled/subprocess/functions.py new file mode 100644 index 0000000..b3fdac0 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/compiled/subprocess/functions.py @@ -0,0 +1,86 @@ +from __future__ import print_function +import sys +import os + +from jedi._compatibility import find_module, cast_path, force_unicode, \ + iter_modules, all_suffixes +from jedi.evaluate.compiled import access +from jedi import parser_utils + + +def get_sys_path(): + return list(map(cast_path, sys.path)) + + +def load_module(evaluator, **kwargs): + return access.load_module(evaluator, **kwargs) + + +def get_compiled_method_return(evaluator, id, attribute, *args, **kwargs): + handle = evaluator.compiled_subprocess.get_access_handle(id) + return getattr(handle.access, attribute)(*args, **kwargs) + + +def create_simple_object(evaluator, obj): + return access.create_access_path(evaluator, obj) + + +def get_module_info(evaluator, sys_path=None, full_name=None, **kwargs): + """ + Returns Tuple[Union[NamespaceInfo, FileIO, None], Optional[bool]] + """ + if sys_path is not None: + sys.path, temp = sys_path, sys.path + try: + return find_module(full_name=full_name, **kwargs) + except ImportError: + return None, None + finally: + if sys_path is not None: + sys.path = temp + + +def list_module_names(evaluator, search_path): + return [ + force_unicode(name) + for module_loader, name, is_pkg in iter_modules(search_path) + ] + + +def get_builtin_module_names(evaluator): + return list(map(force_unicode, sys.builtin_module_names)) + + +def _test_raise_error(evaluator, exception_type): + """ + Raise an error to simulate certain problems for unit tests. + """ + raise exception_type + + +def _test_print(evaluator, stderr=None, stdout=None): + """ + Force some prints in the subprocesses. This exists for unit tests. + """ + if stderr is not None: + print(stderr, file=sys.stderr) + sys.stderr.flush() + if stdout is not None: + print(stdout) + sys.stdout.flush() + + +def _get_init_path(directory_path): + """ + The __init__ file can be searched in a directory. If found return it, else + None. + """ + for suffix in all_suffixes(): + path = os.path.join(directory_path, '__init__' + suffix) + if os.path.exists(path): + return path + return None + + +def safe_literal_eval(evaluator, value): + return parser_utils.safe_literal_eval(value) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/context/__init__.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/context/__init__.py new file mode 100644 index 0000000..56f6495 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/context/__init__.py @@ -0,0 +1,6 @@ +from jedi.evaluate.context.module import ModuleContext +from jedi.evaluate.context.klass import ClassContext +from jedi.evaluate.context.function import FunctionContext, \ + MethodContext, FunctionExecutionContext +from jedi.evaluate.context.instance import AnonymousInstance, BoundMethod, \ + CompiledInstance, AbstractInstanceContext, TreeInstance diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/context/decorator.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/context/decorator.py new file mode 100644 index 0000000..317c5f4 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/context/decorator.py @@ -0,0 +1,15 @@ +''' +Decorators are not really contexts, however we need some wrappers to improve +docstrings and other things around decorators. +''' + +from jedi.evaluate.base_context import ContextWrapper + + +class Decoratee(ContextWrapper): + def __init__(self, wrapped_context, original_context): + self._wrapped_context = wrapped_context + self._original_context = original_context + + def py__doc__(self): + return self._original_context.py__doc__() diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/context/function.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/context/function.py new file mode 100644 index 0000000..203dcf0 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/context/function.py @@ -0,0 +1,444 @@ +from parso.python import tree + +from jedi._compatibility import use_metaclass +from jedi import debug +from jedi.evaluate.cache import evaluator_method_cache, CachedMetaClass +from jedi.evaluate import compiled +from jedi.evaluate import recursion +from jedi.evaluate import docstrings +from jedi.evaluate import flow_analysis +from jedi.evaluate import helpers +from jedi.evaluate.signature import TreeSignature +from jedi.evaluate.arguments import AnonymousArguments +from jedi.evaluate.filters import ParserTreeFilter, FunctionExecutionFilter +from jedi.evaluate.names import ContextName, AbstractNameDefinition, ParamName +from jedi.evaluate.base_context import ContextualizedNode, NO_CONTEXTS, \ + ContextSet, TreeContext, ContextWrapper +from jedi.evaluate.lazy_context import LazyKnownContexts, LazyKnownContext, \ + LazyTreeContext +from jedi.evaluate.context import iterable +from jedi import parser_utils +from jedi.evaluate.parser_cache import get_yield_exprs +from jedi.evaluate.helpers import contexts_from_qualified_names + + +class LambdaName(AbstractNameDefinition): + string_name = '' + api_type = u'function' + + def __init__(self, lambda_context): + self._lambda_context = lambda_context + self.parent_context = lambda_context.parent_context + + @property + def start_pos(self): + return self._lambda_context.tree_node.start_pos + + def infer(self): + return ContextSet([self._lambda_context]) + + +class FunctionAndClassBase(TreeContext): + def get_qualified_names(self): + if self.parent_context.is_class(): + n = self.parent_context.get_qualified_names() + if n is None: + # This means that the parent class lives within a function. + return None + return n + (self.py__name__(),) + elif self.parent_context.is_module(): + return (self.py__name__(),) + else: + return None + + +class FunctionMixin(object): + api_type = u'function' + + def get_filters(self, search_global=False, until_position=None, origin_scope=None): + if search_global: + yield ParserTreeFilter( + self.evaluator, + context=self, + until_position=until_position, + origin_scope=origin_scope + ) + else: + cls = self.py__class__() + for instance in cls.execute_evaluated(): + for filter in instance.get_filters(search_global=False, origin_scope=origin_scope): + yield filter + + def py__get__(self, instance, class_context): + from jedi.evaluate.context.instance import BoundMethod + if instance is None: + # Calling the Foo.bar results in the original bar function. + return ContextSet([self]) + return ContextSet([BoundMethod(instance, self)]) + + def get_param_names(self): + function_execution = self.get_function_execution() + return [ParamName(function_execution, param.name) + for param in self.tree_node.get_params()] + + @property + def name(self): + if self.tree_node.type == 'lambdef': + return LambdaName(self) + return ContextName(self, self.tree_node.name) + + def py__name__(self): + return self.name.string_name + + def py__call__(self, arguments): + function_execution = self.get_function_execution(arguments) + return function_execution.infer() + + def get_function_execution(self, arguments=None): + if arguments is None: + arguments = AnonymousArguments() + + return FunctionExecutionContext(self.evaluator, self.parent_context, self, arguments) + + def get_signatures(self): + return [TreeSignature(f) for f in self.get_signature_functions()] + + +class FunctionContext(use_metaclass(CachedMetaClass, FunctionMixin, FunctionAndClassBase)): + """ + Needed because of decorators. Decorators are evaluated here. + """ + def is_function(self): + return True + + @classmethod + def from_context(cls, context, tree_node): + def create(tree_node): + if context.is_class(): + return MethodContext( + context.evaluator, + context, + parent_context=parent_context, + tree_node=tree_node + ) + else: + return cls( + context.evaluator, + parent_context=parent_context, + tree_node=tree_node + ) + + overloaded_funcs = list(_find_overload_functions(context, tree_node)) + + parent_context = context + while parent_context.is_class() or parent_context.is_instance(): + parent_context = parent_context.parent_context + + function = create(tree_node) + + if overloaded_funcs: + return OverloadedFunctionContext( + function, + [create(f) for f in overloaded_funcs] + ) + return function + + def py__class__(self): + c, = contexts_from_qualified_names(self.evaluator, u'types', u'FunctionType') + return c + + def get_default_param_context(self): + return self.parent_context + + def get_signature_functions(self): + return [self] + + +class MethodContext(FunctionContext): + def __init__(self, evaluator, class_context, *args, **kwargs): + super(MethodContext, self).__init__(evaluator, *args, **kwargs) + self.class_context = class_context + + def get_default_param_context(self): + return self.class_context + + def get_qualified_names(self): + # Need to implement this, because the parent context of a method + # context is not the class context but the module. + names = self.class_context.get_qualified_names() + if names is None: + return None + return names + (self.py__name__(),) + + +class FunctionExecutionContext(TreeContext): + """ + This class is used to evaluate functions and their returns. + + This is the most complicated class, because it contains the logic to + transfer parameters. It is even more complicated, because there may be + multiple calls to functions and recursion has to be avoided. But this is + responsibility of the decorators. + """ + function_execution_filter = FunctionExecutionFilter + + def __init__(self, evaluator, parent_context, function_context, var_args): + super(FunctionExecutionContext, self).__init__( + evaluator, + parent_context, + function_context.tree_node, + ) + self.function_context = function_context + self.var_args = var_args + + @evaluator_method_cache(default=NO_CONTEXTS) + @recursion.execution_recursion_decorator() + def get_return_values(self, check_yields=False): + funcdef = self.tree_node + if funcdef.type == 'lambdef': + return self.eval_node(funcdef.children[-1]) + + if check_yields: + context_set = NO_CONTEXTS + returns = get_yield_exprs(self.evaluator, funcdef) + else: + returns = funcdef.iter_return_stmts() + from jedi.evaluate.gradual.annotation import infer_return_types + context_set = infer_return_types(self) + if context_set: + # If there are annotations, prefer them over anything else. + # This will make it faster. + return context_set + context_set |= docstrings.infer_return_types(self.function_context) + + for r in returns: + check = flow_analysis.reachability_check(self, funcdef, r) + if check is flow_analysis.UNREACHABLE: + debug.dbg('Return unreachable: %s', r) + else: + if check_yields: + context_set |= ContextSet.from_sets( + lazy_context.infer() + for lazy_context in self._get_yield_lazy_context(r) + ) + else: + try: + children = r.children + except AttributeError: + ctx = compiled.builtin_from_name(self.evaluator, u'None') + context_set |= ContextSet([ctx]) + else: + context_set |= self.eval_node(children[1]) + if check is flow_analysis.REACHABLE: + debug.dbg('Return reachable: %s', r) + break + return context_set + + def _get_yield_lazy_context(self, yield_expr): + if yield_expr.type == 'keyword': + # `yield` just yields None. + ctx = compiled.builtin_from_name(self.evaluator, u'None') + yield LazyKnownContext(ctx) + return + + node = yield_expr.children[1] + if node.type == 'yield_arg': # It must be a yield from. + cn = ContextualizedNode(self, node.children[1]) + for lazy_context in cn.infer().iterate(cn): + yield lazy_context + else: + yield LazyTreeContext(self, node) + + @recursion.execution_recursion_decorator(default=iter([])) + def get_yield_lazy_contexts(self, is_async=False): + # TODO: if is_async, wrap yield statements in Awaitable/async_generator_asend + for_parents = [(y, tree.search_ancestor(y, 'for_stmt', 'funcdef', + 'while_stmt', 'if_stmt')) + for y in get_yield_exprs(self.evaluator, self.tree_node)] + + # Calculate if the yields are placed within the same for loop. + yields_order = [] + last_for_stmt = None + for yield_, for_stmt in for_parents: + # For really simple for loops we can predict the order. Otherwise + # we just ignore it. + parent = for_stmt.parent + if parent.type == 'suite': + parent = parent.parent + if for_stmt.type == 'for_stmt' and parent == self.tree_node \ + and parser_utils.for_stmt_defines_one_name(for_stmt): # Simplicity for now. + if for_stmt == last_for_stmt: + yields_order[-1][1].append(yield_) + else: + yields_order.append((for_stmt, [yield_])) + elif for_stmt == self.tree_node: + yields_order.append((None, [yield_])) + else: + types = self.get_return_values(check_yields=True) + if types: + yield LazyKnownContexts(types) + return + last_for_stmt = for_stmt + + for for_stmt, yields in yields_order: + if for_stmt is None: + # No for_stmt, just normal yields. + for yield_ in yields: + for result in self._get_yield_lazy_context(yield_): + yield result + else: + input_node = for_stmt.get_testlist() + cn = ContextualizedNode(self, input_node) + ordered = cn.infer().iterate(cn) + ordered = list(ordered) + for lazy_context in ordered: + dct = {str(for_stmt.children[1].value): lazy_context.infer()} + with helpers.predefine_names(self, for_stmt, dct): + for yield_in_same_for_stmt in yields: + for result in self._get_yield_lazy_context(yield_in_same_for_stmt): + yield result + + def merge_yield_contexts(self, is_async=False): + return ContextSet.from_sets( + lazy_context.infer() + for lazy_context in self.get_yield_lazy_contexts() + ) + + def get_filters(self, search_global=False, until_position=None, origin_scope=None): + yield self.function_execution_filter(self.evaluator, self, + until_position=until_position, + origin_scope=origin_scope) + + @evaluator_method_cache() + def get_executed_params_and_issues(self): + return self.var_args.get_executed_params_and_issues(self) + + def matches_signature(self): + executed_params, issues = self.get_executed_params_and_issues() + if issues: + return False + + matches = all(executed_param.matches_signature() + for executed_param in executed_params) + if debug.enable_notice: + signature = parser_utils.get_call_signature(self.tree_node) + if matches: + debug.dbg("Overloading match: %s@%s (%s)", + signature, self.tree_node.start_pos[0], self.var_args, color='BLUE') + else: + debug.dbg("Overloading no match: %s@%s (%s)", + signature, self.tree_node.start_pos[0], self.var_args, color='BLUE') + return matches + + def infer(self): + """ + Created to be used by inheritance. + """ + evaluator = self.evaluator + is_coroutine = self.tree_node.parent.type in ('async_stmt', 'async_funcdef') + is_generator = bool(get_yield_exprs(evaluator, self.tree_node)) + from jedi.evaluate.gradual.typing import GenericClass + + if is_coroutine: + if is_generator: + if evaluator.environment.version_info < (3, 6): + return NO_CONTEXTS + async_generator_classes = evaluator.typing_module \ + .py__getattribute__('AsyncGenerator') + + yield_contexts = self.merge_yield_contexts(is_async=True) + # The contravariant doesn't seem to be defined. + generics = (yield_contexts.py__class__(), NO_CONTEXTS) + return ContextSet( + # In Python 3.6 AsyncGenerator is still a class. + GenericClass(c, generics) + for c in async_generator_classes + ).execute_annotation() + else: + if evaluator.environment.version_info < (3, 5): + return NO_CONTEXTS + async_classes = evaluator.typing_module.py__getattribute__('Coroutine') + return_contexts = self.get_return_values() + # Only the first generic is relevant. + generics = (return_contexts.py__class__(), NO_CONTEXTS, NO_CONTEXTS) + return ContextSet( + GenericClass(c, generics) for c in async_classes + ).execute_annotation() + else: + if is_generator: + return ContextSet([iterable.Generator(evaluator, self)]) + else: + return self.get_return_values() + + +class OverloadedFunctionContext(FunctionMixin, ContextWrapper): + def __init__(self, function, overloaded_functions): + super(OverloadedFunctionContext, self).__init__(function) + self._overloaded_functions = overloaded_functions + + def py__call__(self, arguments): + debug.dbg("Execute overloaded function %s", self._wrapped_context, color='BLUE') + function_executions = [] + context_set = NO_CONTEXTS + matched = False + for f in self._overloaded_functions: + function_execution = f.get_function_execution(arguments) + function_executions.append(function_execution) + if function_execution.matches_signature(): + matched = True + return function_execution.infer() + + if matched: + return context_set + + if self.evaluator.is_analysis: + # In this case we want precision. + return NO_CONTEXTS + return ContextSet.from_sets(fe.infer() for fe in function_executions) + + def get_signature_functions(self): + return self._overloaded_functions + + +def _find_overload_functions(context, tree_node): + def _is_overload_decorated(funcdef): + if funcdef.parent.type == 'decorated': + decorators = funcdef.parent.children[0] + if decorators.type == 'decorator': + decorators = [decorators] + else: + decorators = decorators.children + for decorator in decorators: + dotted_name = decorator.children[1] + if dotted_name.type == 'name' and dotted_name.value == 'overload': + # TODO check with contexts if it's the right overload + return True + return False + + if tree_node.type == 'lambdef': + return + + if _is_overload_decorated(tree_node): + yield tree_node + + while True: + filter = ParserTreeFilter( + context.evaluator, + context, + until_position=tree_node.start_pos + ) + names = filter.get(tree_node.name.value) + assert isinstance(names, list) + if not names: + break + + found = False + for name in names: + funcdef = name.tree_name.parent + if funcdef.type == 'funcdef' and _is_overload_decorated(funcdef): + tree_node = funcdef + found = True + yield funcdef + + if not found: + break diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/context/instance.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/context/instance.py new file mode 100644 index 0000000..e00ff03 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/context/instance.py @@ -0,0 +1,531 @@ +from abc import abstractproperty + +from jedi import debug +from jedi import settings +from jedi.evaluate import compiled +from jedi.evaluate.compiled.context import CompiledObjectFilter +from jedi.evaluate.helpers import contexts_from_qualified_names +from jedi.evaluate.filters import AbstractFilter +from jedi.evaluate.names import ContextName, TreeNameDefinition +from jedi.evaluate.base_context import Context, NO_CONTEXTS, ContextSet, \ + iterator_to_context_set, ContextWrapper +from jedi.evaluate.lazy_context import LazyKnownContext, LazyKnownContexts +from jedi.evaluate.cache import evaluator_method_cache +from jedi.evaluate.arguments import AnonymousArguments, \ + ValuesArguments, TreeArgumentsWrapper +from jedi.evaluate.context.function import \ + FunctionContext, FunctionMixin, OverloadedFunctionContext +from jedi.evaluate.context.klass import ClassContext, apply_py__get__, \ + ClassFilter +from jedi.evaluate.context import iterable +from jedi.parser_utils import get_parent_scope + + +class InstanceExecutedParam(object): + def __init__(self, instance, tree_param): + self._instance = instance + self._tree_param = tree_param + self.string_name = self._tree_param.name.value + + def infer(self): + return ContextSet([self._instance]) + + def matches_signature(self): + return True + + +class AnonymousInstanceArguments(AnonymousArguments): + def __init__(self, instance): + self._instance = instance + + def get_executed_params_and_issues(self, execution_context): + from jedi.evaluate.dynamic import search_params + tree_params = execution_context.tree_node.get_params() + if not tree_params: + return [], [] + + self_param = InstanceExecutedParam(self._instance, tree_params[0]) + if len(tree_params) == 1: + # If the only param is self, we don't need to try to find + # executions of this function, we have all the params already. + return [self_param], [] + executed_params = list(search_params( + execution_context.evaluator, + execution_context, + execution_context.tree_node + )) + executed_params[0] = self_param + return executed_params, [] + + +class AbstractInstanceContext(Context): + """ + This class is used to evaluate instances. + """ + api_type = u'instance' + + def __init__(self, evaluator, parent_context, class_context, var_args): + super(AbstractInstanceContext, self).__init__(evaluator, parent_context) + # Generated instances are classes that are just generated by self + # (No var_args) used. + self.class_context = class_context + self.var_args = var_args + + def is_instance(self): + return True + + def get_qualified_names(self): + return self.class_context.get_qualified_names() + + def get_annotated_class_object(self): + return self.class_context # This is the default. + + def py__call__(self, arguments): + names = self.get_function_slot_names(u'__call__') + if not names: + # Means the Instance is not callable. + return super(AbstractInstanceContext, self).py__call__(arguments) + + return ContextSet.from_sets(name.infer().execute(arguments) for name in names) + + def py__class__(self): + return self.class_context + + def py__bool__(self): + # Signalize that we don't know about the bool type. + return None + + def get_function_slot_names(self, name): + # Python classes don't look at the dictionary of the instance when + # looking up `__call__`. This is something that has to do with Python's + # internal slot system (note: not __slots__, but C slots). + for filter in self.get_filters(include_self_names=False): + names = filter.get(name) + if names: + return names + return [] + + def execute_function_slots(self, names, *evaluated_args): + return ContextSet.from_sets( + name.infer().execute_evaluated(*evaluated_args) + for name in names + ) + + def py__get__(self, obj, class_context): + """ + obj may be None. + """ + # Arguments in __get__ descriptors are obj, class. + # `method` is the new parent of the array, don't know if that's good. + names = self.get_function_slot_names(u'__get__') + if names: + if obj is None: + obj = compiled.builtin_from_name(self.evaluator, u'None') + return self.execute_function_slots(names, obj, class_context) + else: + return ContextSet([self]) + + def get_filters(self, search_global=None, until_position=None, + origin_scope=None, include_self_names=True): + class_context = self.get_annotated_class_object() + if include_self_names: + for cls in class_context.py__mro__(): + if not isinstance(cls, compiled.CompiledObject) \ + or cls.tree_node is not None: + # In this case we're excluding compiled objects that are + # not fake objects. It doesn't make sense for normal + # compiled objects to search for self variables. + yield SelfAttributeFilter(self.evaluator, self, cls, origin_scope) + + class_filters = class_context.get_filters( + search_global=False, + origin_scope=origin_scope, + is_instance=True, + ) + for f in class_filters: + if isinstance(f, ClassFilter): + yield InstanceClassFilter(self.evaluator, self, f) + elif isinstance(f, CompiledObjectFilter): + yield CompiledInstanceClassFilter(self.evaluator, self, f) + else: + # Propably from the metaclass. + yield f + + def py__getitem__(self, index_context_set, contextualized_node): + names = self.get_function_slot_names(u'__getitem__') + if not names: + return super(AbstractInstanceContext, self).py__getitem__( + index_context_set, + contextualized_node, + ) + + args = ValuesArguments([index_context_set]) + return ContextSet.from_sets(name.infer().execute(args) for name in names) + + def py__iter__(self, contextualized_node=None): + iter_slot_names = self.get_function_slot_names(u'__iter__') + if not iter_slot_names: + return super(AbstractInstanceContext, self).py__iter__(contextualized_node) + + def iterate(): + for generator in self.execute_function_slots(iter_slot_names): + if generator.is_instance() and not generator.is_compiled(): + # `__next__` logic. + if self.evaluator.environment.version_info.major == 2: + name = u'next' + else: + name = u'__next__' + next_slot_names = generator.get_function_slot_names(name) + if next_slot_names: + yield LazyKnownContexts( + generator.execute_function_slots(next_slot_names) + ) + else: + debug.warning('Instance has no __next__ function in %s.', generator) + else: + for lazy_context in generator.py__iter__(): + yield lazy_context + return iterate() + + @abstractproperty + def name(self): + pass + + def create_init_executions(self): + for name in self.get_function_slot_names(u'__init__'): + # TODO is this correct? I think we need to check for functions. + if isinstance(name, LazyInstanceClassName): + function = FunctionContext.from_context( + self.parent_context, + name.tree_name.parent + ) + bound_method = BoundMethod(self, function) + yield bound_method.get_function_execution(self.var_args) + + @evaluator_method_cache() + def create_instance_context(self, class_context, node): + if node.parent.type in ('funcdef', 'classdef'): + node = node.parent + scope = get_parent_scope(node) + if scope == class_context.tree_node: + return class_context + else: + parent_context = self.create_instance_context(class_context, scope) + if scope.type == 'funcdef': + func = FunctionContext.from_context( + parent_context, + scope, + ) + bound_method = BoundMethod(self, func) + if scope.name.value == '__init__' and parent_context == class_context: + return bound_method.get_function_execution(self.var_args) + else: + return bound_method.get_function_execution() + elif scope.type == 'classdef': + class_context = ClassContext(self.evaluator, parent_context, scope) + return class_context + elif scope.type in ('comp_for', 'sync_comp_for'): + # Comprehensions currently don't have a special scope in Jedi. + return self.create_instance_context(class_context, scope) + else: + raise NotImplementedError + return class_context + + def get_signatures(self): + call_funcs = self.py__getattribute__('__call__').py__get__(self, self.class_context) + return [s.bind(self) for s in call_funcs.get_signatures()] + + def __repr__(self): + return "<%s of %s(%s)>" % (self.__class__.__name__, self.class_context, + self.var_args) + + +class CompiledInstance(AbstractInstanceContext): + def __init__(self, evaluator, parent_context, class_context, var_args): + self._original_var_args = var_args + super(CompiledInstance, self).__init__(evaluator, parent_context, class_context, var_args) + + @property + def name(self): + return compiled.CompiledContextName(self, self.class_context.name.string_name) + + def get_first_non_keyword_argument_contexts(self): + key, lazy_context = next(self._original_var_args.unpack(), ('', None)) + if key is not None: + return NO_CONTEXTS + + return lazy_context.infer() + + def is_stub(self): + return False + + +class TreeInstance(AbstractInstanceContext): + def __init__(self, evaluator, parent_context, class_context, var_args): + # I don't think that dynamic append lookups should happen here. That + # sounds more like something that should go to py__iter__. + if class_context.py__name__() in ['list', 'set'] \ + and parent_context.get_root_context() == evaluator.builtins_module: + # compare the module path with the builtin name. + if settings.dynamic_array_additions: + var_args = iterable.get_dynamic_array_instance(self, var_args) + + super(TreeInstance, self).__init__(evaluator, parent_context, + class_context, var_args) + self.tree_node = class_context.tree_node + + @property + def name(self): + return ContextName(self, self.class_context.name.tree_name) + + # This can recurse, if the initialization of the class includes a reference + # to itself. + @evaluator_method_cache(default=None) + def _get_annotated_class_object(self): + from jedi.evaluate.gradual.annotation import py__annotations__, \ + infer_type_vars_for_execution + + for func in self._get_annotation_init_functions(): + # Just take the first result, it should always be one, because we + # control the typeshed code. + bound = BoundMethod(self, func) + execution = bound.get_function_execution(self.var_args) + if not execution.matches_signature(): + # First check if the signature even matches, if not we don't + # need to infer anything. + continue + + all_annotations = py__annotations__(execution.tree_node) + defined, = self.class_context.define_generics( + infer_type_vars_for_execution(execution, all_annotations), + ) + debug.dbg('Inferred instance context as %s', defined, color='BLUE') + return defined + return None + + def get_annotated_class_object(self): + return self._get_annotated_class_object() or self.class_context + + def _get_annotation_init_functions(self): + filter = next(self.class_context.get_filters()) + for init_name in filter.get('__init__'): + for init in init_name.infer(): + if init.is_function(): + for signature in init.get_signatures(): + yield signature.context + + +class AnonymousInstance(TreeInstance): + def __init__(self, evaluator, parent_context, class_context): + super(AnonymousInstance, self).__init__( + evaluator, + parent_context, + class_context, + var_args=AnonymousInstanceArguments(self), + ) + + def get_annotated_class_object(self): + return self.class_context # This is the default. + + +class CompiledInstanceName(compiled.CompiledName): + + def __init__(self, evaluator, instance, klass, name): + super(CompiledInstanceName, self).__init__( + evaluator, + klass.parent_context, + name.string_name + ) + self._instance = instance + self._class_member_name = name + + @iterator_to_context_set + def infer(self): + for result_context in self._class_member_name.infer(): + if result_context.api_type == 'function': + yield CompiledBoundMethod(result_context) + else: + yield result_context + + +class CompiledInstanceClassFilter(AbstractFilter): + name_class = CompiledInstanceName + + def __init__(self, evaluator, instance, f): + self._evaluator = evaluator + self._instance = instance + self._class_filter = f + + def get(self, name): + return self._convert(self._class_filter.get(name)) + + def values(self): + return self._convert(self._class_filter.values()) + + def _convert(self, names): + klass = self._class_filter.compiled_object + return [ + CompiledInstanceName(self._evaluator, self._instance, klass, n) + for n in names + ] + + +class BoundMethod(FunctionMixin, ContextWrapper): + def __init__(self, instance, function): + super(BoundMethod, self).__init__(function) + self.instance = instance + + def is_bound_method(self): + return True + + def py__class__(self): + c, = contexts_from_qualified_names(self.evaluator, u'types', u'MethodType') + return c + + def _get_arguments(self, arguments): + if arguments is None: + arguments = AnonymousInstanceArguments(self.instance) + + return InstanceArguments(self.instance, arguments) + + def get_function_execution(self, arguments=None): + arguments = self._get_arguments(arguments) + return super(BoundMethod, self).get_function_execution(arguments) + + def py__call__(self, arguments): + if isinstance(self._wrapped_context, OverloadedFunctionContext): + return self._wrapped_context.py__call__(self._get_arguments(arguments)) + + function_execution = self.get_function_execution(arguments) + return function_execution.infer() + + def get_signature_functions(self): + return [ + BoundMethod(self.instance, f) + for f in self._wrapped_context.get_signature_functions() + ] + + def get_signatures(self): + return [sig.bind(self) for sig in super(BoundMethod, self).get_signatures()] + + def __repr__(self): + return '<%s: %s>' % (self.__class__.__name__, self._wrapped_context) + + +class CompiledBoundMethod(ContextWrapper): + def is_bound_method(self): + return True + + def get_signatures(self): + return [sig.bind(self) for sig in self._wrapped_context.get_signatures()] + + +class SelfName(TreeNameDefinition): + """ + This name calculates the parent_context lazily. + """ + def __init__(self, instance, class_context, tree_name): + self._instance = instance + self.class_context = class_context + self.tree_name = tree_name + + @property + def parent_context(self): + return self._instance.create_instance_context(self.class_context, self.tree_name) + + +class LazyInstanceClassName(object): + def __init__(self, instance, class_context, class_member_name): + self._instance = instance + self.class_context = class_context + self._class_member_name = class_member_name + + @iterator_to_context_set + def infer(self): + for result_context in self._class_member_name.infer(): + for c in apply_py__get__(result_context, self._instance, self.class_context): + yield c + + def __getattr__(self, name): + return getattr(self._class_member_name, name) + + def __repr__(self): + return '<%s: %s>' % (self.__class__.__name__, self._class_member_name) + + +class InstanceClassFilter(AbstractFilter): + """ + This filter is special in that it uses the class filter and wraps the + resulting names in LazyINstanceClassName. The idea is that the class name + filtering can be very flexible and always be reflected in instances. + """ + def __init__(self, evaluator, instance, class_filter): + self._instance = instance + self._class_filter = class_filter + + def get(self, name): + return self._convert(self._class_filter.get(name, from_instance=True)) + + def values(self): + return self._convert(self._class_filter.values(from_instance=True)) + + def _convert(self, names): + return [LazyInstanceClassName(self._instance, self._class_filter.context, n) for n in names] + + def __repr__(self): + return '<%s for %s>' % (self.__class__.__name__, self._class_filter.context) + + +class SelfAttributeFilter(ClassFilter): + """ + This class basically filters all the use cases where `self.*` was assigned. + """ + name_class = SelfName + + def __init__(self, evaluator, context, class_context, origin_scope): + super(SelfAttributeFilter, self).__init__( + evaluator=evaluator, + context=context, + node_context=class_context, + origin_scope=origin_scope, + is_instance=True, + ) + self._class_context = class_context + + def _filter(self, names): + names = self._filter_self_names(names) + start, end = self._parser_scope.start_pos, self._parser_scope.end_pos + return [n for n in names if start < n.start_pos < end] + + def _filter_self_names(self, names): + for name in names: + trailer = name.parent + if trailer.type == 'trailer' \ + and len(trailer.parent.children) == 2 \ + and trailer.children[0] == '.': + if name.is_definition() and self._access_possible(name, from_instance=True): + # TODO filter non-self assignments. + yield name + + def _convert_names(self, names): + return [self.name_class(self.context, self._class_context, name) for name in names] + + def _check_flows(self, names): + return names + + +class InstanceArguments(TreeArgumentsWrapper): + def __init__(self, instance, arguments): + super(InstanceArguments, self).__init__(arguments) + self.instance = instance + + def unpack(self, func=None): + yield None, LazyKnownContext(self.instance) + for values in self._wrapped_arguments.unpack(func): + yield values + + def get_executed_params_and_issues(self, execution_context): + if isinstance(self._wrapped_arguments, AnonymousInstanceArguments): + return self._wrapped_arguments.get_executed_params_and_issues(execution_context) + + return super(InstanceArguments, self).get_executed_params_and_issues(execution_context) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/context/iterable.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/context/iterable.py new file mode 100644 index 0000000..bf69bde --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/context/iterable.py @@ -0,0 +1,821 @@ +""" +Contains all classes and functions to deal with lists, dicts, generators and +iterators in general. + +Array modifications +******************* + +If the content of an array (``set``/``list``) is requested somewhere, the +current module will be checked for appearances of ``arr.append``, +``arr.insert``, etc. If the ``arr`` name points to an actual array, the +content will be added + +This can be really cpu intensive, as you can imagine. Because |jedi| has to +follow **every** ``append`` and check wheter it's the right array. However this +works pretty good, because in *slow* cases, the recursion detector and other +settings will stop this process. + +It is important to note that: + +1. Array modfications work only in the current module. +2. Jedi only checks Array additions; ``list.pop``, etc are ignored. +""" +import sys + +from jedi import debug +from jedi import settings +from jedi._compatibility import force_unicode, is_py3 +from jedi.evaluate import compiled +from jedi.evaluate import analysis +from jedi.evaluate import recursion +from jedi.evaluate.lazy_context import LazyKnownContext, LazyKnownContexts, \ + LazyTreeContext +from jedi.evaluate.helpers import get_int_or_none, is_string, \ + predefine_names, evaluate_call_of_leaf, reraise_getitem_errors, \ + SimpleGetItemNotFound +from jedi.evaluate.utils import safe_property, to_list +from jedi.evaluate.cache import evaluator_method_cache +from jedi.evaluate.filters import ParserTreeFilter, LazyAttributeOverwrite, \ + publish_method +from jedi.evaluate.base_context import ContextSet, Context, NO_CONTEXTS, \ + TreeContext, ContextualizedNode, iterate_contexts, HelperContextMixin, _sentinel +from jedi.parser_utils import get_sync_comp_fors + + +class IterableMixin(object): + def py__stop_iteration_returns(self): + return ContextSet([compiled.builtin_from_name(self.evaluator, u'None')]) + + # At the moment, safe values are simple values like "foo", 1 and not + # lists/dicts. Therefore as a small speed optimization we can just do the + # default instead of resolving the lazy wrapped contexts, that are just + # doing this in the end as well. + # This mostly speeds up patterns like `sys.version_info >= (3, 0)` in + # typeshed. + if sys.version_info[0] == 2: + # Python 2........... + def get_safe_value(self, default=_sentinel): + if default is _sentinel: + raise ValueError("There exists no safe value for context %s" % self) + return default + else: + get_safe_value = Context.get_safe_value + + +class GeneratorBase(LazyAttributeOverwrite, IterableMixin): + array_type = None + + def _get_wrapped_context(self): + generator, = self.evaluator.typing_module \ + .py__getattribute__('Generator') \ + .execute_annotation() + return generator + + def is_instance(self): + return False + + def py__bool__(self): + return True + + @publish_method('__iter__') + def py__iter__(self, contextualized_node=None): + return ContextSet([self]) + + @publish_method('send') + @publish_method('next', python_version_match=2) + @publish_method('__next__', python_version_match=3) + def py__next__(self): + return ContextSet.from_sets(lazy_context.infer() for lazy_context in self.py__iter__()) + + def py__stop_iteration_returns(self): + return ContextSet([compiled.builtin_from_name(self.evaluator, u'None')]) + + @property + def name(self): + return compiled.CompiledContextName(self, 'Generator') + + +class Generator(GeneratorBase): + """Handling of `yield` functions.""" + def __init__(self, evaluator, func_execution_context): + super(Generator, self).__init__(evaluator) + self._func_execution_context = func_execution_context + + def py__iter__(self, contextualized_node=None): + return self._func_execution_context.get_yield_lazy_contexts() + + def py__stop_iteration_returns(self): + return self._func_execution_context.get_return_values() + + def __repr__(self): + return "<%s of %s>" % (type(self).__name__, self._func_execution_context) + + +class CompForContext(TreeContext): + @classmethod + def from_comp_for(cls, parent_context, comp_for): + return cls(parent_context.evaluator, parent_context, comp_for) + + def get_filters(self, search_global=False, until_position=None, origin_scope=None): + yield ParserTreeFilter(self.evaluator, self) + + +def comprehension_from_atom(evaluator, context, atom): + bracket = atom.children[0] + test_list_comp = atom.children[1] + + if bracket == '{': + if atom.children[1].children[1] == ':': + sync_comp_for = test_list_comp.children[3] + if sync_comp_for.type == 'comp_for': + sync_comp_for = sync_comp_for.children[1] + + return DictComprehension( + evaluator, + context, + sync_comp_for_node=sync_comp_for, + key_node=test_list_comp.children[0], + value_node=test_list_comp.children[2], + ) + else: + cls = SetComprehension + elif bracket == '(': + cls = GeneratorComprehension + elif bracket == '[': + cls = ListComprehension + + sync_comp_for = test_list_comp.children[1] + if sync_comp_for.type == 'comp_for': + sync_comp_for = sync_comp_for.children[1] + + return cls( + evaluator, + defining_context=context, + sync_comp_for_node=sync_comp_for, + entry_node=test_list_comp.children[0], + ) + + +class ComprehensionMixin(object): + @evaluator_method_cache() + def _get_comp_for_context(self, parent_context, comp_for): + return CompForContext.from_comp_for(parent_context, comp_for) + + def _nested(self, comp_fors, parent_context=None): + comp_for = comp_fors[0] + + is_async = comp_for.parent.type == 'comp_for' + + input_node = comp_for.children[3] + parent_context = parent_context or self._defining_context + input_types = parent_context.eval_node(input_node) + # TODO: simulate await if self.is_async + + cn = ContextualizedNode(parent_context, input_node) + iterated = input_types.iterate(cn, is_async=is_async) + exprlist = comp_for.children[1] + for i, lazy_context in enumerate(iterated): + types = lazy_context.infer() + dct = unpack_tuple_to_dict(parent_context, types, exprlist) + context_ = self._get_comp_for_context( + parent_context, + comp_for, + ) + with predefine_names(context_, comp_for, dct): + try: + for result in self._nested(comp_fors[1:], context_): + yield result + except IndexError: + iterated = context_.eval_node(self._entry_node) + if self.array_type == 'dict': + yield iterated, context_.eval_node(self._value_node) + else: + yield iterated + + @evaluator_method_cache(default=[]) + @to_list + def _iterate(self): + comp_fors = tuple(get_sync_comp_fors(self._sync_comp_for_node)) + for result in self._nested(comp_fors): + yield result + + def py__iter__(self, contextualized_node=None): + for set_ in self._iterate(): + yield LazyKnownContexts(set_) + + def __repr__(self): + return "<%s of %s>" % (type(self).__name__, self._sync_comp_for_node) + + +class _DictMixin(object): + def _get_generics(self): + return tuple(c_set.py__class__() for c_set in self.get_mapping_item_contexts()) + + +class Sequence(LazyAttributeOverwrite, IterableMixin): + api_type = u'instance' + + @property + def name(self): + return compiled.CompiledContextName(self, self.array_type) + + def _get_generics(self): + return (self.merge_types_of_iterate().py__class__(),) + + def _get_wrapped_context(self): + from jedi.evaluate.gradual.typing import GenericClass + klass = compiled.builtin_from_name(self.evaluator, self.array_type) + c, = GenericClass(klass, self._get_generics()).execute_annotation() + return c + + def py__bool__(self): + return None # We don't know the length, because of appends. + + def py__class__(self): + return compiled.builtin_from_name(self.evaluator, self.array_type) + + @safe_property + def parent(self): + return self.evaluator.builtins_module + + def py__getitem__(self, index_context_set, contextualized_node): + if self.array_type == 'dict': + return self._dict_values() + return iterate_contexts(ContextSet([self])) + + +class _BaseComprehension(ComprehensionMixin): + def __init__(self, evaluator, defining_context, sync_comp_for_node, entry_node): + assert sync_comp_for_node.type == 'sync_comp_for' + super(_BaseComprehension, self).__init__(evaluator) + self._defining_context = defining_context + self._sync_comp_for_node = sync_comp_for_node + self._entry_node = entry_node + + +class ListComprehension(_BaseComprehension, Sequence): + array_type = u'list' + + def py__simple_getitem__(self, index): + if isinstance(index, slice): + return ContextSet([self]) + + all_types = list(self.py__iter__()) + with reraise_getitem_errors(IndexError, TypeError): + lazy_context = all_types[index] + return lazy_context.infer() + + +class SetComprehension(_BaseComprehension, Sequence): + array_type = u'set' + + +class GeneratorComprehension(_BaseComprehension, GeneratorBase): + pass + + +class DictComprehension(ComprehensionMixin, Sequence): + array_type = u'dict' + + def __init__(self, evaluator, defining_context, sync_comp_for_node, key_node, value_node): + assert sync_comp_for_node.type == 'sync_comp_for' + super(DictComprehension, self).__init__(evaluator) + self._defining_context = defining_context + self._sync_comp_for_node = sync_comp_for_node + self._entry_node = key_node + self._value_node = value_node + + def py__iter__(self, contextualized_node=None): + for keys, values in self._iterate(): + yield LazyKnownContexts(keys) + + def py__simple_getitem__(self, index): + for keys, values in self._iterate(): + for k in keys: + if isinstance(k, compiled.CompiledObject): + # Be careful in the future if refactoring, index could be a + # slice. + if k.get_safe_value(default=object()) == index: + return values + raise SimpleGetItemNotFound() + + def _dict_keys(self): + return ContextSet.from_sets(keys for keys, values in self._iterate()) + + def _dict_values(self): + return ContextSet.from_sets(values for keys, values in self._iterate()) + + @publish_method('values') + def _imitate_values(self): + lazy_context = LazyKnownContexts(self._dict_values()) + return ContextSet([FakeSequence(self.evaluator, u'list', [lazy_context])]) + + @publish_method('items') + def _imitate_items(self): + lazy_contexts = [ + LazyKnownContext( + FakeSequence( + self.evaluator, + u'tuple', + [LazyKnownContexts(key), + LazyKnownContexts(value)] + ) + ) + for key, value in self._iterate() + ] + + return ContextSet([FakeSequence(self.evaluator, u'list', lazy_contexts)]) + + def get_mapping_item_contexts(self): + return self._dict_keys(), self._dict_values() + + def exact_key_items(self): + # NOTE: A smarter thing can probably done here to achieve better + # completions, but at least like this jedi doesn't crash + return [] + + +class SequenceLiteralContext(Sequence): + _TUPLE_LIKE = 'testlist_star_expr', 'testlist', 'subscriptlist' + mapping = {'(': u'tuple', + '[': u'list', + '{': u'set'} + + def __init__(self, evaluator, defining_context, atom): + super(SequenceLiteralContext, self).__init__(evaluator) + self.atom = atom + self._defining_context = defining_context + + if self.atom.type in self._TUPLE_LIKE: + self.array_type = u'tuple' + else: + self.array_type = SequenceLiteralContext.mapping[atom.children[0]] + """The builtin name of the array (list, set, tuple or dict).""" + + def py__simple_getitem__(self, index): + """Here the index is an int/str. Raises IndexError/KeyError.""" + if self.array_type == u'dict': + compiled_obj_index = compiled.create_simple_object(self.evaluator, index) + for key, value in self.get_tree_entries(): + for k in self._defining_context.eval_node(key): + try: + method = k.execute_operation + except AttributeError: + pass + else: + if method(compiled_obj_index, u'==').get_safe_value(): + return self._defining_context.eval_node(value) + raise SimpleGetItemNotFound('No key found in dictionary %s.' % self) + + if isinstance(index, slice): + return ContextSet([self]) + else: + with reraise_getitem_errors(TypeError, KeyError, IndexError): + node = self.get_tree_entries()[index] + return self._defining_context.eval_node(node) + + def py__iter__(self, contextualized_node=None): + """ + While values returns the possible values for any array field, this + function returns the value for a certain index. + """ + if self.array_type == u'dict': + # Get keys. + types = NO_CONTEXTS + for k, _ in self.get_tree_entries(): + types |= self._defining_context.eval_node(k) + # We don't know which dict index comes first, therefore always + # yield all the types. + for _ in types: + yield LazyKnownContexts(types) + else: + for node in self.get_tree_entries(): + if node == ':' or node.type == 'subscript': + # TODO this should probably use at least part of the code + # of eval_subscript_list. + yield LazyKnownContext(Slice(self._defining_context, None, None, None)) + else: + yield LazyTreeContext(self._defining_context, node) + for addition in check_array_additions(self._defining_context, self): + yield addition + + def py__len__(self): + # This function is not really used often. It's more of a try. + return len(self.get_tree_entries()) + + def _dict_values(self): + return ContextSet.from_sets( + self._defining_context.eval_node(v) + for k, v in self.get_tree_entries() + ) + + def get_tree_entries(self): + c = self.atom.children + + if self.atom.type in self._TUPLE_LIKE: + return c[::2] + + array_node = c[1] + if array_node in (']', '}', ')'): + return [] # Direct closing bracket, doesn't contain items. + + if array_node.type == 'testlist_comp': + # filter out (for now) pep 448 single-star unpacking + return [value for value in array_node.children[::2] + if value.type != "star_expr"] + elif array_node.type == 'dictorsetmaker': + kv = [] + iterator = iter(array_node.children) + for key in iterator: + if key == "**": + # dict with pep 448 double-star unpacking + # for now ignoring the values imported by ** + next(iterator) + next(iterator, None) # Possible comma. + else: + op = next(iterator, None) + if op is None or op == ',': + if key.type == "star_expr": + # pep 448 single-star unpacking + # for now ignoring values imported by * + pass + else: + kv.append(key) # A set. + else: + assert op == ':' # A dict. + kv.append((key, next(iterator))) + next(iterator, None) # Possible comma. + return kv + else: + if array_node.type == "star_expr": + # pep 448 single-star unpacking + # for now ignoring values imported by * + return [] + else: + return [array_node] + + def exact_key_items(self): + """ + Returns a generator of tuples like dict.items(), where the key is + resolved (as a string) and the values are still lazy contexts. + """ + for key_node, value in self.get_tree_entries(): + for key in self._defining_context.eval_node(key_node): + if is_string(key): + yield key.get_safe_value(), LazyTreeContext(self._defining_context, value) + + def __repr__(self): + return "<%s of %s>" % (self.__class__.__name__, self.atom) + + +class DictLiteralContext(_DictMixin, SequenceLiteralContext): + array_type = u'dict' + + def __init__(self, evaluator, defining_context, atom): + super(SequenceLiteralContext, self).__init__(evaluator) + self._defining_context = defining_context + self.atom = atom + + @publish_method('values') + def _imitate_values(self): + lazy_context = LazyKnownContexts(self._dict_values()) + return ContextSet([FakeSequence(self.evaluator, u'list', [lazy_context])]) + + @publish_method('items') + def _imitate_items(self): + lazy_contexts = [ + LazyKnownContext(FakeSequence( + self.evaluator, u'tuple', + (LazyTreeContext(self._defining_context, key_node), + LazyTreeContext(self._defining_context, value_node)) + )) for key_node, value_node in self.get_tree_entries() + ] + + return ContextSet([FakeSequence(self.evaluator, u'list', lazy_contexts)]) + + def _dict_keys(self): + return ContextSet.from_sets( + self._defining_context.eval_node(k) + for k, v in self.get_tree_entries() + ) + + def get_mapping_item_contexts(self): + return self._dict_keys(), self._dict_values() + + +class _FakeArray(SequenceLiteralContext): + def __init__(self, evaluator, container, type): + super(SequenceLiteralContext, self).__init__(evaluator) + self.array_type = type + self.atom = container + # TODO is this class really needed? + + +class FakeSequence(_FakeArray): + def __init__(self, evaluator, array_type, lazy_context_list): + """ + type should be one of "tuple", "list" + """ + super(FakeSequence, self).__init__(evaluator, None, array_type) + self._lazy_context_list = lazy_context_list + + def py__simple_getitem__(self, index): + if isinstance(index, slice): + return ContextSet([self]) + + with reraise_getitem_errors(IndexError, TypeError): + lazy_context = self._lazy_context_list[index] + return lazy_context.infer() + + def py__iter__(self, contextualized_node=None): + return self._lazy_context_list + + def py__bool__(self): + return bool(len(self._lazy_context_list)) + + def __repr__(self): + return "<%s of %s>" % (type(self).__name__, self._lazy_context_list) + + +class FakeDict(_DictMixin, _FakeArray): + def __init__(self, evaluator, dct): + super(FakeDict, self).__init__(evaluator, dct, u'dict') + self._dct = dct + + def py__iter__(self, contextualized_node=None): + for key in self._dct: + yield LazyKnownContext(compiled.create_simple_object(self.evaluator, key)) + + def py__simple_getitem__(self, index): + if is_py3 and self.evaluator.environment.version_info.major == 2: + # In Python 2 bytes and unicode compare. + if isinstance(index, bytes): + index_unicode = force_unicode(index) + try: + return self._dct[index_unicode].infer() + except KeyError: + pass + elif isinstance(index, str): + index_bytes = index.encode('utf-8') + try: + return self._dct[index_bytes].infer() + except KeyError: + pass + + with reraise_getitem_errors(KeyError, TypeError): + lazy_context = self._dct[index] + return lazy_context.infer() + + @publish_method('values') + def _values(self): + return ContextSet([FakeSequence( + self.evaluator, u'tuple', + [LazyKnownContexts(self._dict_values())] + )]) + + def _dict_values(self): + return ContextSet.from_sets(lazy_context.infer() for lazy_context in self._dct.values()) + + def _dict_keys(self): + return ContextSet.from_sets(lazy_context.infer() for lazy_context in self.py__iter__()) + + def get_mapping_item_contexts(self): + return self._dict_keys(), self._dict_values() + + def exact_key_items(self): + return self._dct.items() + + +class MergedArray(_FakeArray): + def __init__(self, evaluator, arrays): + super(MergedArray, self).__init__(evaluator, arrays, arrays[-1].array_type) + self._arrays = arrays + + def py__iter__(self, contextualized_node=None): + for array in self._arrays: + for lazy_context in array.py__iter__(): + yield lazy_context + + def py__simple_getitem__(self, index): + return ContextSet.from_sets(lazy_context.infer() for lazy_context in self.py__iter__()) + + def get_tree_entries(self): + for array in self._arrays: + for a in array.get_tree_entries(): + yield a + + def __len__(self): + return sum(len(a) for a in self._arrays) + + +def unpack_tuple_to_dict(context, types, exprlist): + """ + Unpacking tuple assignments in for statements and expr_stmts. + """ + if exprlist.type == 'name': + return {exprlist.value: types} + elif exprlist.type == 'atom' and exprlist.children[0] in ('(', '['): + return unpack_tuple_to_dict(context, types, exprlist.children[1]) + elif exprlist.type in ('testlist', 'testlist_comp', 'exprlist', + 'testlist_star_expr'): + dct = {} + parts = iter(exprlist.children[::2]) + n = 0 + for lazy_context in types.iterate(exprlist): + n += 1 + try: + part = next(parts) + except StopIteration: + # TODO this context is probably not right. + analysis.add(context, 'value-error-too-many-values', part, + message="ValueError: too many values to unpack (expected %s)" % n) + else: + dct.update(unpack_tuple_to_dict(context, lazy_context.infer(), part)) + has_parts = next(parts, None) + if types and has_parts is not None: + # TODO this context is probably not right. + analysis.add(context, 'value-error-too-few-values', has_parts, + message="ValueError: need more than %s values to unpack" % n) + return dct + elif exprlist.type == 'power' or exprlist.type == 'atom_expr': + # Something like ``arr[x], var = ...``. + # This is something that is not yet supported, would also be difficult + # to write into a dict. + return {} + elif exprlist.type == 'star_expr': # `a, *b, c = x` type unpackings + # Currently we're not supporting them. + return {} + raise NotImplementedError + + +def check_array_additions(context, sequence): + """ Just a mapper function for the internal _check_array_additions """ + if sequence.array_type not in ('list', 'set'): + # TODO also check for dict updates + return NO_CONTEXTS + + return _check_array_additions(context, sequence) + + +@evaluator_method_cache(default=NO_CONTEXTS) +@debug.increase_indent +def _check_array_additions(context, sequence): + """ + Checks if a `Array` has "add" (append, insert, extend) statements: + + >>> a = [""] + >>> a.append(1) + """ + from jedi.evaluate import arguments + + debug.dbg('Dynamic array search for %s' % sequence, color='MAGENTA') + module_context = context.get_root_context() + if not settings.dynamic_array_additions or isinstance(module_context, compiled.CompiledObject): + debug.dbg('Dynamic array search aborted.', color='MAGENTA') + return NO_CONTEXTS + + def find_additions(context, arglist, add_name): + params = list(arguments.TreeArguments(context.evaluator, context, arglist).unpack()) + result = set() + if add_name in ['insert']: + params = params[1:] + if add_name in ['append', 'add', 'insert']: + for key, lazy_context in params: + result.add(lazy_context) + elif add_name in ['extend', 'update']: + for key, lazy_context in params: + result |= set(lazy_context.infer().iterate()) + return result + + temp_param_add, settings.dynamic_params_for_other_modules = \ + settings.dynamic_params_for_other_modules, False + + is_list = sequence.name.string_name == 'list' + search_names = (['append', 'extend', 'insert'] if is_list else ['add', 'update']) + + added_types = set() + for add_name in search_names: + try: + possible_names = module_context.tree_node.get_used_names()[add_name] + except KeyError: + continue + else: + for name in possible_names: + context_node = context.tree_node + if not (context_node.start_pos < name.start_pos < context_node.end_pos): + continue + trailer = name.parent + power = trailer.parent + trailer_pos = power.children.index(trailer) + try: + execution_trailer = power.children[trailer_pos + 1] + except IndexError: + continue + else: + if execution_trailer.type != 'trailer' \ + or execution_trailer.children[0] != '(' \ + or execution_trailer.children[1] == ')': + continue + + random_context = context.create_context(name) + + with recursion.execution_allowed(context.evaluator, power) as allowed: + if allowed: + found = evaluate_call_of_leaf( + random_context, + name, + cut_own_trailer=True + ) + if sequence in found: + # The arrays match. Now add the results + added_types |= find_additions( + random_context, + execution_trailer.children[1], + add_name + ) + + # reset settings + settings.dynamic_params_for_other_modules = temp_param_add + debug.dbg('Dynamic array result %s' % added_types, color='MAGENTA') + return added_types + + +def get_dynamic_array_instance(instance, arguments): + """Used for set() and list() instances.""" + ai = _ArrayInstance(instance, arguments) + from jedi.evaluate import arguments + return arguments.ValuesArguments([ContextSet([ai])]) + + +class _ArrayInstance(HelperContextMixin): + """ + Used for the usage of set() and list(). + This is definitely a hack, but a good one :-) + It makes it possible to use set/list conversions. + """ + def __init__(self, instance, var_args): + self.instance = instance + self.var_args = var_args + + def py__class__(self): + tuple_, = self.instance.evaluator.builtins_module.py__getattribute__('tuple') + return tuple_ + + def py__iter__(self, contextualized_node=None): + var_args = self.var_args + try: + _, lazy_context = next(var_args.unpack()) + except StopIteration: + pass + else: + for lazy in lazy_context.infer().iterate(): + yield lazy + + from jedi.evaluate import arguments + if isinstance(var_args, arguments.TreeArguments): + additions = _check_array_additions(var_args.context, self.instance) + for addition in additions: + yield addition + + def iterate(self, contextualized_node=None, is_async=False): + return self.py__iter__(contextualized_node) + + +class Slice(object): + def __init__(self, context, start, stop, step): + self._context = context + self._slice_object = None + # All of them are either a Precedence or None. + self._start = start + self._stop = stop + self._step = step + + def __getattr__(self, name): + if self._slice_object is None: + context = compiled.builtin_from_name(self._context.evaluator, 'slice') + self._slice_object, = context.execute_evaluated() + return getattr(self._slice_object, name) + + @property + def obj(self): + """ + Imitate CompiledObject.obj behavior and return a ``builtin.slice()`` + object. + """ + def get(element): + if element is None: + return None + + result = self._context.eval_node(element) + if len(result) != 1: + # For simplicity, we want slices to be clear defined with just + # one type. Otherwise we will return an empty slice object. + raise IndexError + + context, = result + return get_int_or_none(context) + + try: + return slice(get(self._start), get(self._stop), get(self._step)) + except IndexError: + return slice(None, None, None) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/context/klass.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/context/klass.py new file mode 100644 index 0000000..b587c6e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/context/klass.py @@ -0,0 +1,344 @@ +""" +Like described in the :mod:`parso.python.tree` module, +there's a need for an ast like module to represent the states of parsed +modules. + +But now there are also structures in Python that need a little bit more than +that. An ``Instance`` for example is only a ``Class`` before it is +instantiated. This class represents these cases. + +So, why is there also a ``Class`` class here? Well, there are decorators and +they change classes in Python 3. + +Representation modules also define "magic methods". Those methods look like +``py__foo__`` and are typically mappable to the Python equivalents ``__call__`` +and others. Here's a list: + +====================================== ======================================== +**Method** **Description** +-------------------------------------- ---------------------------------------- +py__call__(arguments: Array) On callable objects, returns types. +py__bool__() Returns True/False/None; None means that + there's no certainty. +py__bases__() Returns a list of base classes. +py__iter__() Returns a generator of a set of types. +py__class__() Returns the class of an instance. +py__simple_getitem__(index: int/str) Returns a a set of types of the index. + Can raise an IndexError/KeyError. +py__getitem__(indexes: ContextSet) Returns a a set of types of the index. +py__file__() Only on modules. Returns None if does + not exist. +py__package__() -> List[str] Only on modules. For the import system. +py__path__() Only on modules. For the import system. +py__get__(call_object) Only on instances. Simulates + descriptors. +py__doc__() Returns the docstring for a context. +====================================== ======================================== + +""" +from jedi import debug +from jedi._compatibility import use_metaclass +from jedi.parser_utils import get_cached_parent_scope +from jedi.evaluate.cache import evaluator_method_cache, CachedMetaClass, \ + evaluator_method_generator_cache +from jedi.evaluate import compiled +from jedi.evaluate.lazy_context import LazyKnownContexts +from jedi.evaluate.filters import ParserTreeFilter +from jedi.evaluate.names import TreeNameDefinition, ContextName +from jedi.evaluate.arguments import unpack_arglist, ValuesArguments +from jedi.evaluate.base_context import ContextSet, iterator_to_context_set, \ + NO_CONTEXTS +from jedi.evaluate.context.function import FunctionAndClassBase +from jedi.plugins import plugin_manager + + +def apply_py__get__(context, instance, class_context): + try: + method = context.py__get__ + except AttributeError: + yield context + else: + for descriptor_context in method(instance, class_context): + yield descriptor_context + + +class ClassName(TreeNameDefinition): + def __init__(self, parent_context, tree_name, name_context, apply_decorators): + super(ClassName, self).__init__(parent_context, tree_name) + self._name_context = name_context + self._apply_decorators = apply_decorators + + @iterator_to_context_set + def infer(self): + # We're using a different context to infer, so we cannot call super(). + from jedi.evaluate.syntax_tree import tree_name_to_contexts + inferred = tree_name_to_contexts( + self.parent_context.evaluator, self._name_context, self.tree_name) + + for result_context in inferred: + if self._apply_decorators: + for c in apply_py__get__(result_context, + instance=None, + class_context=self.parent_context): + yield c + else: + yield result_context + + +class ClassFilter(ParserTreeFilter): + name_class = ClassName + + def __init__(self, *args, **kwargs): + self._is_instance = kwargs.pop('is_instance') # Python 2 :/ + super(ClassFilter, self).__init__(*args, **kwargs) + + def _convert_names(self, names): + return [ + self.name_class( + parent_context=self.context, + tree_name=name, + name_context=self._node_context, + apply_decorators=not self._is_instance, + ) for name in names + ] + + def _equals_origin_scope(self): + node = self._origin_scope + while node is not None: + if node == self._parser_scope or node == self.context: + return True + node = get_cached_parent_scope(self._used_names, node) + return False + + def _access_possible(self, name, from_instance=False): + # Filter for ClassVar variables + # TODO this is not properly done, yet. It just checks for the string + # ClassVar in the annotation, which can be quite imprecise. If we + # wanted to do this correct, we would have to resolve the ClassVar. + if not from_instance: + expr_stmt = name.get_definition() + if expr_stmt is not None and expr_stmt.type == 'expr_stmt': + annassign = expr_stmt.children[1] + if annassign.type == 'annassign': + # TODO this is not proper matching + if 'ClassVar' not in annassign.children[1].get_code(): + return False + + # Filter for name mangling of private variables like __foo + return not name.value.startswith('__') or name.value.endswith('__') \ + or self._equals_origin_scope() + + def _filter(self, names, from_instance=False): + names = super(ClassFilter, self)._filter(names) + return [name for name in names if self._access_possible(name, from_instance)] + + +class ClassMixin(object): + def is_class(self): + return True + + def py__call__(self, arguments=None): + from jedi.evaluate.context import TreeInstance + if arguments is None: + arguments = ValuesArguments([]) + return ContextSet([TreeInstance(self.evaluator, self.parent_context, self, arguments)]) + + def py__class__(self): + return compiled.builtin_from_name(self.evaluator, u'type') + + @property + def name(self): + return ContextName(self, self.tree_node.name) + + def py__name__(self): + return self.name.string_name + + def get_param_names(self): + for context_ in self.py__getattribute__(u'__init__'): + if context_.is_function(): + return list(context_.get_param_names())[1:] + return [] + + @evaluator_method_generator_cache() + def py__mro__(self): + mro = [self] + yield self + # TODO Do a proper mro resolution. Currently we are just listing + # classes. However, it's a complicated algorithm. + for lazy_cls in self.py__bases__(): + # TODO there's multiple different mro paths possible if this yields + # multiple possibilities. Could be changed to be more correct. + for cls in lazy_cls.infer(): + # TODO detect for TypeError: duplicate base class str, + # e.g. `class X(str, str): pass` + try: + mro_method = cls.py__mro__ + except AttributeError: + # TODO add a TypeError like: + """ + >>> class Y(lambda: test): pass + Traceback (most recent call last): + File "", line 1, in + TypeError: function() argument 1 must be code, not str + >>> class Y(1): pass + Traceback (most recent call last): + File "", line 1, in + TypeError: int() takes at most 2 arguments (3 given) + """ + debug.warning('Super class of %s is not a class: %s', self, cls) + else: + for cls_new in mro_method(): + if cls_new not in mro: + mro.append(cls_new) + yield cls_new + + def get_filters(self, search_global=False, until_position=None, + origin_scope=None, is_instance=False): + metaclasses = self.get_metaclasses() + if metaclasses: + for f in self.get_metaclass_filters(metaclasses): + yield f + + if search_global: + yield self.get_global_filter(until_position, origin_scope) + else: + for cls in self.py__mro__(): + if isinstance(cls, compiled.CompiledObject): + for filter in cls.get_filters(is_instance=is_instance): + yield filter + else: + yield ClassFilter( + self.evaluator, self, node_context=cls, + origin_scope=origin_scope, + is_instance=is_instance + ) + if not is_instance: + from jedi.evaluate.compiled import builtin_from_name + type_ = builtin_from_name(self.evaluator, u'type') + assert isinstance(type_, ClassContext) + if type_ != self: + for instance in type_.py__call__(): + instance_filters = instance.get_filters() + # Filter out self filters + next(instance_filters) + next(instance_filters) + yield next(instance_filters) + + def get_signatures(self): + init_funcs = self.py__call__().py__getattribute__('__init__') + return [sig.bind(self) for sig in init_funcs.get_signatures()] + + def get_global_filter(self, until_position=None, origin_scope=None): + return ParserTreeFilter( + self.evaluator, + context=self, + until_position=until_position, + origin_scope=origin_scope + ) + + +class ClassContext(use_metaclass(CachedMetaClass, ClassMixin, FunctionAndClassBase)): + """ + This class is not only important to extend `tree.Class`, it is also a + important for descriptors (if the descriptor methods are evaluated or not). + """ + api_type = u'class' + + @evaluator_method_cache() + def list_type_vars(self): + found = [] + arglist = self.tree_node.get_super_arglist() + if arglist is None: + return [] + + for stars, node in unpack_arglist(arglist): + if stars: + continue # These are not relevant for this search. + + from jedi.evaluate.gradual.annotation import find_unknown_type_vars + for type_var in find_unknown_type_vars(self.parent_context, node): + if type_var not in found: + # The order matters and it's therefore a list. + found.append(type_var) + return found + + def _get_bases_arguments(self): + arglist = self.tree_node.get_super_arglist() + if arglist: + from jedi.evaluate import arguments + return arguments.TreeArguments(self.evaluator, self.parent_context, arglist) + return None + + @evaluator_method_cache(default=()) + def py__bases__(self): + args = self._get_bases_arguments() + if args is not None: + lst = [value for key, value in args.unpack() if key is None] + if lst: + return lst + + if self.py__name__() == 'object' \ + and self.parent_context == self.evaluator.builtins_module: + return [] + return [LazyKnownContexts( + self.evaluator.builtins_module.py__getattribute__('object') + )] + + def py__getitem__(self, index_context_set, contextualized_node): + from jedi.evaluate.gradual.typing import LazyGenericClass + if not index_context_set: + return ContextSet([self]) + return ContextSet( + LazyGenericClass( + self, + index_context, + context_of_index=contextualized_node.context, + ) + for index_context in index_context_set + ) + + def define_generics(self, type_var_dict): + from jedi.evaluate.gradual.typing import GenericClass + + def remap_type_vars(): + """ + The TypeVars in the resulting classes have sometimes different names + and we need to check for that, e.g. a signature can be: + + def iter(iterable: Iterable[_T]) -> Iterator[_T]: ... + + However, the iterator is defined as Iterator[_T_co], which means it has + a different type var name. + """ + for type_var in self.list_type_vars(): + yield type_var_dict.get(type_var.py__name__(), NO_CONTEXTS) + + if type_var_dict: + return ContextSet([GenericClass( + self, + generics=tuple(remap_type_vars()) + )]) + return ContextSet({self}) + + @plugin_manager.decorate() + def get_metaclass_filters(self, metaclass): + debug.dbg('Unprocessed metaclass %s', metaclass) + return [] + + @evaluator_method_cache(default=NO_CONTEXTS) + def get_metaclasses(self): + args = self._get_bases_arguments() + if args is not None: + m = [value for key, value in args.unpack() if key == 'metaclass'] + metaclasses = ContextSet.from_sets(lazy_context.infer() for lazy_context in m) + metaclasses = ContextSet(m for m in metaclasses if m.is_class()) + if metaclasses: + return metaclasses + + for lazy_base in self.py__bases__(): + for context in lazy_base.infer(): + if context.is_class(): + contexts = context.get_metaclasses() + if contexts: + return contexts + return NO_CONTEXTS diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/context/module.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/context/module.py new file mode 100644 index 0000000..28f92f3 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/context/module.py @@ -0,0 +1,283 @@ +import re +import os + +from jedi import debug +from jedi.evaluate.cache import evaluator_method_cache +from jedi.evaluate.names import ContextNameMixin, AbstractNameDefinition +from jedi.evaluate.filters import GlobalNameFilter, ParserTreeFilter, DictFilter, MergedFilter +from jedi.evaluate import compiled +from jedi.evaluate.base_context import TreeContext +from jedi.evaluate.names import SubModuleName +from jedi.evaluate.helpers import contexts_from_qualified_names +from jedi.evaluate.compiled import create_simple_object +from jedi.evaluate.base_context import ContextSet + + +class _ModuleAttributeName(AbstractNameDefinition): + """ + For module attributes like __file__, __str__ and so on. + """ + api_type = u'instance' + + def __init__(self, parent_module, string_name, string_value=None): + self.parent_context = parent_module + self.string_name = string_name + self._string_value = string_value + + def infer(self): + if self._string_value is not None: + s = self._string_value + if self.parent_context.evaluator.environment.version_info.major == 2 \ + and not isinstance(s, bytes): + s = s.encode('utf-8') + return ContextSet([ + create_simple_object(self.parent_context.evaluator, s) + ]) + return compiled.get_string_context_set(self.parent_context.evaluator) + + +class ModuleName(ContextNameMixin, AbstractNameDefinition): + start_pos = 1, 0 + + def __init__(self, context, name): + self._context = context + self._name = name + + @property + def string_name(self): + return self._name + + +def iter_module_names(evaluator, paths): + # Python modules/packages + for n in evaluator.compiled_subprocess.list_module_names(paths): + yield n + + for path in paths: + try: + dirs = os.listdir(path) + except OSError: + # The file might not exist or reading it might lead to an error. + debug.warning("Not possible to list directory: %s", path) + continue + for name in dirs: + # Namespaces + if os.path.isdir(os.path.join(path, name)): + # pycache is obviously not an interestin namespace. Also the + # name must be a valid identifier. + # TODO use str.isidentifier, once Python 2 is removed + if name != '__pycache__' and not re.search(r'\W|^\d', name): + yield name + # Stub files + if name.endswith('.pyi'): + if name != '__init__.pyi': + yield name[:-4] + + +class SubModuleDictMixin(object): + @evaluator_method_cache() + def sub_modules_dict(self): + """ + Lists modules in the directory of this module (if this module is a + package). + """ + names = {} + try: + method = self.py__path__ + except AttributeError: + pass + else: + mods = iter_module_names(self.evaluator, method()) + for name in mods: + # It's obviously a relative import to the current module. + names[name] = SubModuleName(self, name) + + # In the case of an import like `from x.` we don't need to + # add all the variables, this is only about submodules. + return names + + +class ModuleMixin(SubModuleDictMixin): + def get_filters(self, search_global=False, until_position=None, origin_scope=None): + yield MergedFilter( + ParserTreeFilter( + self.evaluator, + context=self, + until_position=until_position, + origin_scope=origin_scope + ), + GlobalNameFilter(self, self.tree_node), + ) + yield DictFilter(self.sub_modules_dict()) + yield DictFilter(self._module_attributes_dict()) + for star_filter in self.iter_star_filters(): + yield star_filter + + def py__class__(self): + c, = contexts_from_qualified_names(self.evaluator, u'types', u'ModuleType') + return c + + def is_module(self): + return True + + def is_stub(self): + return False + + @property + @evaluator_method_cache() + def name(self): + return ModuleName(self, self._string_name) + + @property + def _string_name(self): + """ This is used for the goto functions. """ + # TODO It's ugly that we even use this, the name is usually well known + # ahead so just pass it when create a ModuleContext. + if self._path is None: + return '' # no path -> empty name + else: + sep = (re.escape(os.path.sep),) * 2 + r = re.search(r'([^%s]*?)(%s__init__)?(\.pyi?|\.so)?$' % sep, self._path) + # Remove PEP 3149 names + return re.sub(r'\.[a-z]+-\d{2}[mud]{0,3}$', '', r.group(1)) + + @evaluator_method_cache() + def _module_attributes_dict(self): + names = ['__package__', '__doc__', '__name__'] + # All the additional module attributes are strings. + dct = dict((n, _ModuleAttributeName(self, n)) for n in names) + file = self.py__file__() + if file is not None: + dct['__file__'] = _ModuleAttributeName(self, '__file__', file) + return dct + + def iter_star_filters(self, search_global=False): + for star_module in self.star_imports(): + yield next(star_module.get_filters(search_global)) + + # I'm not sure if the star import cache is really that effective anymore + # with all the other really fast import caches. Recheck. Also we would need + # to push the star imports into Evaluator.module_cache, if we reenable this. + @evaluator_method_cache([]) + def star_imports(self): + from jedi.evaluate.imports import Importer + + modules = [] + for i in self.tree_node.iter_imports(): + if i.is_star_import(): + new = Importer( + self.evaluator, + import_path=i.get_paths()[-1], + module_context=self, + level=i.level + ).follow() + + for module in new: + if isinstance(module, ModuleContext): + modules += module.star_imports() + modules += new + return modules + + def get_qualified_names(self): + """ + A module doesn't have a qualified name, but it's important to note that + it's reachable and not `None`. With this information we can add + qualified names on top for all context children. + """ + return () + + +class ModuleContext(ModuleMixin, TreeContext): + api_type = u'module' + parent_context = None + + def __init__(self, evaluator, module_node, file_io, string_names, code_lines, is_package=False): + super(ModuleContext, self).__init__( + evaluator, + parent_context=None, + tree_node=module_node + ) + self.file_io = file_io + if file_io is None: + self._path = None + else: + self._path = file_io.path + self.string_names = string_names # Optional[Tuple[str, ...]] + self.code_lines = code_lines + self.is_package = is_package + + def is_stub(self): + if self._path is not None and self._path.endswith('.pyi'): + # Currently this is the way how we identify stubs when e.g. goto is + # used in them. This could be changed if stubs would be identified + # sooner and used as StubModuleContext. + return True + return super(ModuleContext, self).is_stub() + + def py__name__(self): + if self.string_names is None: + return None + return '.'.join(self.string_names) + + def py__file__(self): + """ + In contrast to Python's __file__ can be None. + """ + if self._path is None: + return None + + return os.path.abspath(self._path) + + def py__package__(self): + if self.is_package: + return self.string_names + return self.string_names[:-1] + + def _py__path__(self): + # A namespace package is typically auto generated and ~10 lines long. + first_few_lines = ''.join(self.code_lines[:50]) + # these are strings that need to be used for namespace packages, + # the first one is ``pkgutil``, the second ``pkg_resources``. + options = ('declare_namespace(__name__)', 'extend_path(__path__') + if options[0] in first_few_lines or options[1] in first_few_lines: + # It is a namespace, now try to find the rest of the + # modules on sys_path or whatever the search_path is. + paths = set() + for s in self.evaluator.get_sys_path(): + other = os.path.join(s, self.name.string_name) + if os.path.isdir(other): + paths.add(other) + if paths: + return list(paths) + # Nested namespace packages will not be supported. Nobody ever + # asked for it and in Python 3 they are there without using all the + # crap above. + + # Default to the of this file. + file = self.py__file__() + assert file is not None # Shouldn't be a package in the first place. + return [os.path.dirname(file)] + + @property + def py__path__(self): + """ + Not seen here, since it's a property. The callback actually uses a + variable, so use it like:: + + foo.py__path__(sys_path) + + In case of a package, this returns Python's __path__ attribute, which + is a list of paths (strings). + Raises an AttributeError if the module is not a package. + """ + if self.is_package: + return self._py__path__ + else: + raise AttributeError('Only packages have __path__ attributes.') + + def __repr__(self): + return "<%s: %s@%s-%s is_stub=%s>" % ( + self.__class__.__name__, self._string_name, + self.tree_node.start_pos[0], self.tree_node.end_pos[0], + self.is_stub() + ) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/context/namespace.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/context/namespace.py new file mode 100644 index 0000000..12c8b3a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/context/namespace.py @@ -0,0 +1,64 @@ +from jedi.evaluate.cache import evaluator_method_cache +from jedi.evaluate.filters import DictFilter +from jedi.evaluate.names import ContextNameMixin, AbstractNameDefinition +from jedi.evaluate.base_context import Context +from jedi.evaluate.context.module import SubModuleDictMixin + + +class ImplicitNSName(ContextNameMixin, AbstractNameDefinition): + """ + Accessing names for implicit namespace packages should infer to nothing. + This object will prevent Jedi from raising exceptions + """ + def __init__(self, implicit_ns_context, string_name): + self._context = implicit_ns_context + self.string_name = string_name + + +class ImplicitNamespaceContext(Context, SubModuleDictMixin): + """ + Provides support for implicit namespace packages + """ + # Is a module like every other module, because if you import an empty + # folder foobar it will be available as an object: + # . + api_type = u'module' + parent_context = None + + def __init__(self, evaluator, fullname, paths): + super(ImplicitNamespaceContext, self).__init__(evaluator, parent_context=None) + self.evaluator = evaluator + self._fullname = fullname + self._paths = paths + + def get_filters(self, search_global=False, until_position=None, origin_scope=None): + yield DictFilter(self.sub_modules_dict()) + + @property + @evaluator_method_cache() + def name(self): + string_name = self.py__package__()[-1] + return ImplicitNSName(self, string_name) + + def py__file__(self): + return None + + def py__package__(self): + """Return the fullname + """ + return self._fullname.split('.') + + def py__path__(self): + return self._paths + + def py__name__(self): + return self._fullname + + def is_namespace(self): + return True + + def is_stub(self): + return False + + def __repr__(self): + return '<%s: %s>' % (self.__class__.__name__, self._fullname) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/docstrings.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/docstrings.py new file mode 100644 index 0000000..d38dbf1 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/docstrings.py @@ -0,0 +1,311 @@ +""" +Docstrings are another source of information for functions and classes. +:mod:`jedi.evaluate.dynamic` tries to find all executions of functions, while +the docstring parsing is much easier. There are three different types of +docstrings that |jedi| understands: + +- `Sphinx `_ +- `Epydoc `_ +- `Numpydoc `_ + +For example, the sphinx annotation ``:type foo: str`` clearly states that the +type of ``foo`` is ``str``. + +As an addition to parameter searching, this module also provides return +annotations. +""" + +import re +import warnings +from textwrap import dedent + +from parso import parse, ParserSyntaxError + +from jedi._compatibility import u +from jedi import debug +from jedi.evaluate.utils import indent_block +from jedi.evaluate.cache import evaluator_method_cache +from jedi.evaluate.base_context import iterator_to_context_set, ContextSet, \ + NO_CONTEXTS +from jedi.evaluate.lazy_context import LazyKnownContexts + + +DOCSTRING_PARAM_PATTERNS = [ + r'\s*:type\s+%s:\s*([^\n]+)', # Sphinx + r'\s*:param\s+(\w+)\s+%s:[^\n]*', # Sphinx param with type + r'\s*@type\s+%s:\s*([^\n]+)', # Epydoc +] + +DOCSTRING_RETURN_PATTERNS = [ + re.compile(r'\s*:rtype:\s*([^\n]+)', re.M), # Sphinx + re.compile(r'\s*@rtype:\s*([^\n]+)', re.M), # Epydoc +] + +REST_ROLE_PATTERN = re.compile(r':[^`]+:`([^`]+)`') + + +_numpy_doc_string_cache = None + + +def _get_numpy_doc_string_cls(): + global _numpy_doc_string_cache + if isinstance(_numpy_doc_string_cache, (ImportError, SyntaxError)): + raise _numpy_doc_string_cache + from numpydoc.docscrape import NumpyDocString + _numpy_doc_string_cache = NumpyDocString + return _numpy_doc_string_cache + + +def _search_param_in_numpydocstr(docstr, param_str): + """Search `docstr` (in numpydoc format) for type(-s) of `param_str`.""" + with warnings.catch_warnings(): + warnings.simplefilter("ignore") + try: + # This is a non-public API. If it ever changes we should be + # prepared and return gracefully. + params = _get_numpy_doc_string_cls()(docstr)._parsed_data['Parameters'] + except Exception: + return [] + for p_name, p_type, p_descr in params: + if p_name == param_str: + m = re.match(r'([^,]+(,[^,]+)*?)(,[ ]*optional)?$', p_type) + if m: + p_type = m.group(1) + return list(_expand_typestr(p_type)) + return [] + + +def _search_return_in_numpydocstr(docstr): + """ + Search `docstr` (in numpydoc format) for type(-s) of function returns. + """ + with warnings.catch_warnings(): + warnings.simplefilter("ignore") + try: + doc = _get_numpy_doc_string_cls()(docstr) + except Exception: + return + try: + # This is a non-public API. If it ever changes we should be + # prepared and return gracefully. + returns = doc._parsed_data['Returns'] + returns += doc._parsed_data['Yields'] + except Exception: + return + for r_name, r_type, r_descr in returns: + # Return names are optional and if so the type is in the name + if not r_type: + r_type = r_name + for type_ in _expand_typestr(r_type): + yield type_ + + +def _expand_typestr(type_str): + """ + Attempts to interpret the possible types in `type_str` + """ + # Check if alternative types are specified with 'or' + if re.search(r'\bor\b', type_str): + for t in type_str.split('or'): + yield t.split('of')[0].strip() + # Check if like "list of `type`" and set type to list + elif re.search(r'\bof\b', type_str): + yield type_str.split('of')[0] + # Check if type has is a set of valid literal values eg: {'C', 'F', 'A'} + elif type_str.startswith('{'): + node = parse(type_str, version='3.7').children[0] + if node.type == 'atom': + for leaf in node.children[1].children: + if leaf.type == 'number': + if '.' in leaf.value: + yield 'float' + else: + yield 'int' + elif leaf.type == 'string': + if 'b' in leaf.string_prefix.lower(): + yield 'bytes' + else: + yield 'str' + # Ignore everything else. + + # Otherwise just work with what we have. + else: + yield type_str + + +def _search_param_in_docstr(docstr, param_str): + """ + Search `docstr` for type(-s) of `param_str`. + + >>> _search_param_in_docstr(':type param: int', 'param') + ['int'] + >>> _search_param_in_docstr('@type param: int', 'param') + ['int'] + >>> _search_param_in_docstr( + ... ':type param: :class:`threading.Thread`', 'param') + ['threading.Thread'] + >>> bool(_search_param_in_docstr('no document', 'param')) + False + >>> _search_param_in_docstr(':param int param: some description', 'param') + ['int'] + + """ + # look at #40 to see definitions of those params + patterns = [re.compile(p % re.escape(param_str)) + for p in DOCSTRING_PARAM_PATTERNS] + for pattern in patterns: + match = pattern.search(docstr) + if match: + return [_strip_rst_role(match.group(1))] + + return _search_param_in_numpydocstr(docstr, param_str) + + +def _strip_rst_role(type_str): + """ + Strip off the part looks like a ReST role in `type_str`. + + >>> _strip_rst_role(':class:`ClassName`') # strip off :class: + 'ClassName' + >>> _strip_rst_role(':py:obj:`module.Object`') # works with domain + 'module.Object' + >>> _strip_rst_role('ClassName') # do nothing when not ReST role + 'ClassName' + + See also: + http://sphinx-doc.org/domains.html#cross-referencing-python-objects + + """ + match = REST_ROLE_PATTERN.match(type_str) + if match: + return match.group(1) + else: + return type_str + + +def _evaluate_for_statement_string(module_context, string): + code = dedent(u(""" + def pseudo_docstring_stuff(): + ''' + Create a pseudo function for docstring statements. + Need this docstring so that if the below part is not valid Python this + is still a function. + ''' + {} + """)) + if string is None: + return [] + + for element in re.findall(r'((?:\w+\.)*\w+)\.', string): + # Try to import module part in dotted name. + # (e.g., 'threading' in 'threading.Thread'). + string = 'import %s\n' % element + string + + # Take the default grammar here, if we load the Python 2.7 grammar here, it + # will be impossible to use `...` (Ellipsis) as a token. Docstring types + # don't need to conform with the current grammar. + debug.dbg('Parse docstring code %s', string, color='BLUE') + grammar = module_context.evaluator.latest_grammar + try: + module = grammar.parse(code.format(indent_block(string)), error_recovery=False) + except ParserSyntaxError: + return [] + try: + funcdef = next(module.iter_funcdefs()) + # First pick suite, then simple_stmt and then the node, + # which is also not the last item, because there's a newline. + stmt = funcdef.children[-1].children[-1].children[-2] + except (AttributeError, IndexError): + return [] + + if stmt.type not in ('name', 'atom', 'atom_expr'): + return [] + + from jedi.evaluate.context import FunctionContext + function_context = FunctionContext( + module_context.evaluator, + module_context, + funcdef + ) + func_execution_context = function_context.get_function_execution() + # Use the module of the param. + # TODO this module is not the module of the param in case of a function + # call. In that case it's the module of the function call. + # stuffed with content from a function call. + return list(_execute_types_in_stmt(func_execution_context, stmt)) + + +def _execute_types_in_stmt(module_context, stmt): + """ + Executing all types or general elements that we find in a statement. This + doesn't include tuple, list and dict literals, because the stuff they + contain is executed. (Used as type information). + """ + definitions = module_context.eval_node(stmt) + return ContextSet.from_sets( + _execute_array_values(module_context.evaluator, d) + for d in definitions + ) + + +def _execute_array_values(evaluator, array): + """ + Tuples indicate that there's not just one return value, but the listed + ones. `(str, int)` means that it returns a tuple with both types. + """ + from jedi.evaluate.context.iterable import SequenceLiteralContext, FakeSequence + if isinstance(array, SequenceLiteralContext): + values = [] + for lazy_context in array.py__iter__(): + objects = ContextSet.from_sets( + _execute_array_values(evaluator, typ) + for typ in lazy_context.infer() + ) + values.append(LazyKnownContexts(objects)) + return {FakeSequence(evaluator, array.array_type, values)} + else: + return array.execute_annotation() + + +@evaluator_method_cache() +def infer_param(execution_context, param): + from jedi.evaluate.context.instance import InstanceArguments + from jedi.evaluate.context import FunctionExecutionContext + + def eval_docstring(docstring): + return ContextSet( + p + for param_str in _search_param_in_docstr(docstring, param.name.value) + for p in _evaluate_for_statement_string(module_context, param_str) + ) + module_context = execution_context.get_root_context() + func = param.get_parent_function() + if func.type == 'lambdef': + return NO_CONTEXTS + + types = eval_docstring(execution_context.py__doc__()) + if isinstance(execution_context, FunctionExecutionContext) \ + and isinstance(execution_context.var_args, InstanceArguments) \ + and execution_context.function_context.py__name__() == '__init__': + class_context = execution_context.var_args.instance.class_context + types |= eval_docstring(class_context.py__doc__()) + + debug.dbg('Found param types for docstring: %s', types, color='BLUE') + return types + + +@evaluator_method_cache() +@iterator_to_context_set +def infer_return_types(function_context): + def search_return_in_docstr(code): + for p in DOCSTRING_RETURN_PATTERNS: + match = p.search(code) + if match: + yield _strip_rst_role(match.group(1)) + # Check for numpy style return hint + for type_ in _search_return_in_numpydocstr(code): + yield type_ + + for type_str in search_return_in_docstr(function_context.py__doc__()): + for type_eval in _evaluate_for_statement_string(function_context.get_root_context(), type_str): + yield type_eval diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/dynamic.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/dynamic.py new file mode 100644 index 0000000..fc3b19f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/dynamic.py @@ -0,0 +1,231 @@ +""" +One of the really important features of |jedi| is to have an option to +understand code like this:: + + def foo(bar): + bar. # completion here + foo(1) + +There's no doubt wheter bar is an ``int`` or not, but if there's also a call +like ``foo('str')``, what would happen? Well, we'll just show both. Because +that's what a human would expect. + +It works as follows: + +- |Jedi| sees a param +- search for function calls named ``foo`` +- execute these calls and check the input. +""" + +from jedi import settings +from jedi import debug +from jedi.evaluate.cache import evaluator_function_cache +from jedi.evaluate import imports +from jedi.evaluate.arguments import TreeArguments +from jedi.evaluate.param import create_default_params +from jedi.evaluate.helpers import is_stdlib_path +from jedi.evaluate.utils import to_list +from jedi.parser_utils import get_parent_scope +from jedi.evaluate.context import ModuleContext, instance +from jedi.evaluate.base_context import ContextSet, NO_CONTEXTS +from jedi.evaluate import recursion + + +MAX_PARAM_SEARCHES = 20 + + +class DynamicExecutedParams(object): + """ + Simulates being a parameter while actually just being multiple params. + """ + + def __init__(self, evaluator, executed_params): + self.evaluator = evaluator + self._executed_params = executed_params + + def infer(self): + with recursion.execution_allowed(self.evaluator, self) as allowed: + # We need to catch recursions that may occur, because an + # anonymous functions can create an anonymous parameter that is + # more or less self referencing. + if allowed: + return ContextSet.from_sets(p.infer() for p in self._executed_params) + return NO_CONTEXTS + + +@debug.increase_indent +def search_params(evaluator, execution_context, funcdef): + """ + A dynamic search for param values. If you try to complete a type: + + >>> def func(foo): + ... foo + >>> func(1) + >>> func("") + + It is not known what the type ``foo`` without analysing the whole code. You + have to look for all calls to ``func`` to find out what ``foo`` possibly + is. + """ + if not settings.dynamic_params: + return create_default_params(execution_context, funcdef) + + evaluator.dynamic_params_depth += 1 + try: + path = execution_context.get_root_context().py__file__() + if path is not None and is_stdlib_path(path): + # We don't want to search for usages in the stdlib. Usually people + # don't work with it (except if you are a core maintainer, sorry). + # This makes everything slower. Just disable it and run the tests, + # you will see the slowdown, especially in 3.6. + return create_default_params(execution_context, funcdef) + + if funcdef.type == 'lambdef': + string_name = _get_lambda_name(funcdef) + if string_name is None: + return create_default_params(execution_context, funcdef) + else: + string_name = funcdef.name.value + debug.dbg('Dynamic param search in %s.', string_name, color='MAGENTA') + + try: + module_context = execution_context.get_root_context() + function_executions = _search_function_executions( + evaluator, + module_context, + funcdef, + string_name=string_name, + ) + if function_executions: + zipped_params = zip(*list( + function_execution.get_executed_params_and_issues()[0] + for function_execution in function_executions + )) + params = [DynamicExecutedParams(evaluator, executed_params) + for executed_params in zipped_params] + # Evaluate the ExecutedParams to types. + else: + return create_default_params(execution_context, funcdef) + finally: + debug.dbg('Dynamic param result finished', color='MAGENTA') + return params + finally: + evaluator.dynamic_params_depth -= 1 + + +@evaluator_function_cache(default=None) +@to_list +def _search_function_executions(evaluator, module_context, funcdef, string_name): + """ + Returns a list of param names. + """ + compare_node = funcdef + if string_name == '__init__': + cls = get_parent_scope(funcdef) + if cls.type == 'classdef': + string_name = cls.name.value + compare_node = cls + + found_executions = False + i = 0 + for for_mod_context in imports.get_modules_containing_name( + evaluator, [module_context], string_name): + if not isinstance(module_context, ModuleContext): + return + for name, trailer in _get_possible_nodes(for_mod_context, string_name): + i += 1 + + # This is a simple way to stop Jedi's dynamic param recursion + # from going wild: The deeper Jedi's in the recursion, the less + # code should be evaluated. + if i * evaluator.dynamic_params_depth > MAX_PARAM_SEARCHES: + return + + random_context = evaluator.create_context(for_mod_context, name) + for function_execution in _check_name_for_execution( + evaluator, random_context, compare_node, name, trailer): + found_executions = True + yield function_execution + + # If there are results after processing a module, we're probably + # good to process. This is a speed optimization. + if found_executions: + return + + +def _get_lambda_name(node): + stmt = node.parent + if stmt.type == 'expr_stmt': + first_operator = next(stmt.yield_operators(), None) + if first_operator == '=': + first = stmt.children[0] + if first.type == 'name': + return first.value + + return None + + +def _get_possible_nodes(module_context, func_string_name): + try: + names = module_context.tree_node.get_used_names()[func_string_name] + except KeyError: + return + + for name in names: + bracket = name.get_next_leaf() + trailer = bracket.parent + if trailer.type == 'trailer' and bracket == '(': + yield name, trailer + + +def _check_name_for_execution(evaluator, context, compare_node, name, trailer): + from jedi.evaluate.context.function import FunctionExecutionContext + + def create_func_excs(): + arglist = trailer.children[1] + if arglist == ')': + arglist = None + args = TreeArguments(evaluator, context, arglist, trailer) + if value_node.type == 'classdef': + created_instance = instance.TreeInstance( + evaluator, + value.parent_context, + value, + args + ) + for execution in created_instance.create_init_executions(): + yield execution + else: + yield value.get_function_execution(args) + + for value in evaluator.goto_definitions(context, name): + value_node = value.tree_node + if compare_node == value_node: + for func_execution in create_func_excs(): + yield func_execution + elif isinstance(value.parent_context, FunctionExecutionContext) and \ + compare_node.type == 'funcdef': + # Here we're trying to find decorators by checking the first + # parameter. It's not very generic though. Should find a better + # solution that also applies to nested decorators. + params, _ = value.parent_context.get_executed_params_and_issues() + if len(params) != 1: + continue + values = params[0].infer() + nodes = [v.tree_node for v in values] + if nodes == [compare_node]: + # Found a decorator. + module_context = context.get_root_context() + execution_context = next(create_func_excs()) + for name, trailer in _get_possible_nodes(module_context, params[0].string_name): + if value_node.start_pos < name.start_pos < value_node.end_pos: + random_context = evaluator.create_context(execution_context, name) + iterator = _check_name_for_execution( + evaluator, + random_context, + compare_node, + name, + trailer + ) + for function_execution in iterator: + yield function_execution diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/filters.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/filters.py new file mode 100644 index 0000000..0b758ea --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/filters.py @@ -0,0 +1,412 @@ +""" +Filters are objects that you can use to filter names in different scopes. They +are needed for name resolution. +""" +from abc import abstractmethod +import weakref + +from parso.tree import search_ancestor + +from jedi._compatibility import use_metaclass +from jedi.evaluate import flow_analysis +from jedi.evaluate.base_context import ContextSet, Context, ContextWrapper, \ + LazyContextWrapper +from jedi.parser_utils import get_cached_parent_scope +from jedi.evaluate.utils import to_list +from jedi.evaluate.names import TreeNameDefinition, ParamName, AbstractNameDefinition + +_definition_name_cache = weakref.WeakKeyDictionary() + + +class AbstractFilter(object): + _until_position = None + + def _filter(self, names): + if self._until_position is not None: + return [n for n in names if n.start_pos < self._until_position] + return names + + @abstractmethod + def get(self, name): + raise NotImplementedError + + @abstractmethod + def values(self): + raise NotImplementedError + + +class FilterWrapper(object): + name_wrapper_class = None + + def __init__(self, wrapped_filter): + self._wrapped_filter = wrapped_filter + + def wrap_names(self, names): + return [self.name_wrapper_class(name) for name in names] + + def get(self, name): + return self.wrap_names(self._wrapped_filter.get(name)) + + def values(self): + return self.wrap_names(self._wrapped_filter.values()) + + +def _get_definition_names(used_names, name_key): + try: + for_module = _definition_name_cache[used_names] + except KeyError: + for_module = _definition_name_cache[used_names] = {} + + try: + return for_module[name_key] + except KeyError: + names = used_names.get(name_key, ()) + result = for_module[name_key] = tuple(name for name in names if name.is_definition()) + return result + + +class AbstractUsedNamesFilter(AbstractFilter): + name_class = TreeNameDefinition + + def __init__(self, context, parser_scope): + self._parser_scope = parser_scope + self._module_node = self._parser_scope.get_root_node() + self._used_names = self._module_node.get_used_names() + self.context = context + + def get(self, name, **filter_kwargs): + return self._convert_names(self._filter( + _get_definition_names(self._used_names, name), + **filter_kwargs + )) + + def _convert_names(self, names): + return [self.name_class(self.context, name) for name in names] + + def values(self, **filter_kwargs): + return self._convert_names( + name + for name_key in self._used_names + for name in self._filter( + _get_definition_names(self._used_names, name_key), + **filter_kwargs + ) + ) + + def __repr__(self): + return '<%s: %s>' % (self.__class__.__name__, self.context) + + +class ParserTreeFilter(AbstractUsedNamesFilter): + # TODO remove evaluator as an argument, it's not used. + def __init__(self, evaluator, context, node_context=None, until_position=None, + origin_scope=None): + """ + node_context is an option to specify a second context for use cases + like the class mro where the parent class of a new name would be the + context, but for some type inference it's important to have a local + context of the other classes. + """ + if node_context is None: + node_context = context + super(ParserTreeFilter, self).__init__(context, node_context.tree_node) + self._node_context = node_context + self._origin_scope = origin_scope + self._until_position = until_position + + def _filter(self, names): + names = super(ParserTreeFilter, self)._filter(names) + names = [n for n in names if self._is_name_reachable(n)] + return list(self._check_flows(names)) + + def _is_name_reachable(self, name): + parent = name.parent + if parent.type == 'trailer': + return False + base_node = parent if parent.type in ('classdef', 'funcdef') else name + return get_cached_parent_scope(self._used_names, base_node) == self._parser_scope + + def _check_flows(self, names): + for name in sorted(names, key=lambda name: name.start_pos, reverse=True): + check = flow_analysis.reachability_check( + context=self._node_context, + context_scope=self._parser_scope, + node=name, + origin_scope=self._origin_scope + ) + if check is not flow_analysis.UNREACHABLE: + yield name + + if check is flow_analysis.REACHABLE: + break + + +class FunctionExecutionFilter(ParserTreeFilter): + param_name = ParamName + + def __init__(self, evaluator, context, node_context=None, + until_position=None, origin_scope=None): + super(FunctionExecutionFilter, self).__init__( + evaluator, + context, + node_context, + until_position, + origin_scope + ) + + @to_list + def _convert_names(self, names): + for name in names: + param = search_ancestor(name, 'param') + if param: + yield self.param_name(self.context, name) + else: + yield TreeNameDefinition(self.context, name) + + +class GlobalNameFilter(AbstractUsedNamesFilter): + def __init__(self, context, parser_scope): + super(GlobalNameFilter, self).__init__(context, parser_scope) + + def get(self, name): + try: + names = self._used_names[name] + except KeyError: + return [] + return self._convert_names(self._filter(names)) + + @to_list + def _filter(self, names): + for name in names: + if name.parent.type == 'global_stmt': + yield name + + def values(self): + return self._convert_names( + name for name_list in self._used_names.values() + for name in self._filter(name_list) + ) + + +class DictFilter(AbstractFilter): + def __init__(self, dct): + self._dct = dct + + def get(self, name): + try: + value = self._convert(name, self._dct[name]) + except KeyError: + return [] + else: + return list(self._filter([value])) + + def values(self): + def yielder(): + for item in self._dct.items(): + try: + yield self._convert(*item) + except KeyError: + pass + return self._filter(yielder()) + + def _convert(self, name, value): + return value + + def __repr__(self): + keys = ', '.join(self._dct.keys()) + return '<%s: for {%s}>' % (self.__class__.__name__, keys) + + +class MergedFilter(object): + def __init__(self, *filters): + self._filters = filters + + def get(self, name): + return [n for filter in self._filters for n in filter.get(name)] + + def values(self): + return [n for filter in self._filters for n in filter.values()] + + def __repr__(self): + return '%s(%s)' % (self.__class__.__name__, ', '.join(str(f) for f in self._filters)) + + +class _BuiltinMappedMethod(Context): + """``Generator.__next__`` ``dict.values`` methods and so on.""" + api_type = u'function' + + def __init__(self, builtin_context, method, builtin_func): + super(_BuiltinMappedMethod, self).__init__( + builtin_context.evaluator, + parent_context=builtin_context + ) + self._method = method + self._builtin_func = builtin_func + + def py__call__(self, arguments): + # TODO add TypeError if params are given/or not correct. + return self._method(self.parent_context) + + def __getattr__(self, name): + return getattr(self._builtin_func, name) + + +class SpecialMethodFilter(DictFilter): + """ + A filter for methods that are defined in this module on the corresponding + classes like Generator (for __next__, etc). + """ + class SpecialMethodName(AbstractNameDefinition): + api_type = u'function' + + def __init__(self, parent_context, string_name, value, builtin_context): + callable_, python_version = value + if python_version is not None and \ + python_version != parent_context.evaluator.environment.version_info.major: + raise KeyError + + self.parent_context = parent_context + self.string_name = string_name + self._callable = callable_ + self._builtin_context = builtin_context + + def infer(self): + for filter in self._builtin_context.get_filters(): + # We can take the first index, because on builtin methods there's + # always only going to be one name. The same is true for the + # inferred values. + for name in filter.get(self.string_name): + builtin_func = next(iter(name.infer())) + break + else: + continue + break + return ContextSet([ + _BuiltinMappedMethod(self.parent_context, self._callable, builtin_func) + ]) + + def __init__(self, context, dct, builtin_context): + super(SpecialMethodFilter, self).__init__(dct) + self.context = context + self._builtin_context = builtin_context + """ + This context is what will be used to introspect the name, where as the + other context will be used to execute the function. + + We distinguish, because we have to. + """ + + def _convert(self, name, value): + return self.SpecialMethodName(self.context, name, value, self._builtin_context) + + +class _OverwriteMeta(type): + def __init__(cls, name, bases, dct): + super(_OverwriteMeta, cls).__init__(name, bases, dct) + + base_dct = {} + for base_cls in reversed(cls.__bases__): + try: + base_dct.update(base_cls.overwritten_methods) + except AttributeError: + pass + + for func in cls.__dict__.values(): + try: + base_dct.update(func.registered_overwritten_methods) + except AttributeError: + pass + cls.overwritten_methods = base_dct + + +class _AttributeOverwriteMixin(object): + def get_filters(self, search_global=False, *args, **kwargs): + yield SpecialMethodFilter(self, self.overwritten_methods, self._wrapped_context) + + for filter in self._wrapped_context.get_filters(search_global): + yield filter + + +class LazyAttributeOverwrite(use_metaclass(_OverwriteMeta, _AttributeOverwriteMixin, + LazyContextWrapper)): + def __init__(self, evaluator): + self.evaluator = evaluator + + +class AttributeOverwrite(use_metaclass(_OverwriteMeta, _AttributeOverwriteMixin, + ContextWrapper)): + pass + + +def publish_method(method_name, python_version_match=None): + def decorator(func): + dct = func.__dict__.setdefault('registered_overwritten_methods', {}) + dct[method_name] = func, python_version_match + return func + return decorator + + +def get_global_filters(evaluator, context, until_position, origin_scope): + """ + Returns all filters in order of priority for name resolution. + + For global name lookups. The filters will handle name resolution + themselves, but here we gather possible filters downwards. + + >>> from jedi._compatibility import u, no_unicode_pprint + >>> from jedi import Script + >>> script = Script(u(''' + ... x = ['a', 'b', 'c'] + ... def func(): + ... y = None + ... ''')) + >>> module_node = script._module_node + >>> scope = next(module_node.iter_funcdefs()) + >>> scope + + >>> context = script._get_module().create_context(scope) + >>> filters = list(get_global_filters(context.evaluator, context, (4, 0), None)) + + First we get the names from the function scope. + + >>> no_unicode_pprint(filters[0]) # doctest: +ELLIPSIS + MergedFilter(, ) + >>> sorted(str(n) for n in filters[0].values()) # doctest: +NORMALIZE_WHITESPACE + ['', + ''] + >>> filters[0]._filters[0]._until_position + (4, 0) + >>> filters[0]._filters[1]._until_position + + Then it yields the names from one level "lower". In this example, this is + the module scope (including globals). + As a side note, you can see, that the position in the filter is None on the + globals filter, because there the whole module is searched. + + >>> list(filters[1].values()) # package modules -> Also empty. + [] + >>> sorted(name.string_name for name in filters[2].values()) # Module attributes + ['__doc__', '__name__', '__package__'] + + Finally, it yields the builtin filter, if `include_builtin` is + true (default). + + >>> list(filters[3].values()) # doctest: +ELLIPSIS + [...] + """ + from jedi.evaluate.context.function import FunctionExecutionContext + while context is not None: + # Names in methods cannot be resolved within the class. + for filter in context.get_filters( + search_global=True, + until_position=until_position, + origin_scope=origin_scope): + yield filter + if isinstance(context, FunctionExecutionContext): + # The position should be reset if the current scope is a function. + until_position = None + + context = context.parent_context + + # Add builtins to the global scope. + yield next(evaluator.builtins_module.get_filters()) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/finder.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/finder.py new file mode 100644 index 0000000..7b8b001 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/finder.py @@ -0,0 +1,290 @@ +""" +Searching for names with given scope and name. This is very central in Jedi and +Python. The name resolution is quite complicated with descripter, +``__getattribute__``, ``__getattr__``, ``global``, etc. + +If you want to understand name resolution, please read the first few chapters +in http://blog.ionelmc.ro/2015/02/09/understanding-python-metaclasses/. + +Flow checks ++++++++++++ + +Flow checks are not really mature. There's only a check for ``isinstance``. It +would check whether a flow has the form of ``if isinstance(a, type_or_tuple)``. +Unfortunately every other thing is being ignored (e.g. a == '' would be easy to +check for -> a is a string). There's big potential in these checks. +""" + +from parso.python import tree +from parso.tree import search_ancestor +from jedi import debug +from jedi import settings +from jedi.evaluate import compiled +from jedi.evaluate import analysis +from jedi.evaluate import flow_analysis +from jedi.evaluate.arguments import TreeArguments +from jedi.evaluate import helpers +from jedi.evaluate.context import iterable +from jedi.evaluate.filters import get_global_filters +from jedi.evaluate.names import TreeNameDefinition +from jedi.evaluate.base_context import ContextSet, NO_CONTEXTS +from jedi.parser_utils import is_scope, get_parent_scope +from jedi.evaluate.gradual.conversion import convert_contexts + + +class NameFinder(object): + def __init__(self, evaluator, context, name_context, name_or_str, + position=None, analysis_errors=True): + self._evaluator = evaluator + # Make sure that it's not just a syntax tree node. + self._context = context + self._name_context = name_context + self._name = name_or_str + if isinstance(name_or_str, tree.Name): + self._string_name = name_or_str.value + else: + self._string_name = name_or_str + self._position = position + self._found_predefined_types = None + self._analysis_errors = analysis_errors + + def find(self, filters, attribute_lookup): + """ + :params bool attribute_lookup: Tell to logic if we're accessing the + attribute or the contents of e.g. a function. + """ + names = self.filter_name(filters) + if self._found_predefined_types is not None and names: + check = flow_analysis.reachability_check( + context=self._context, + context_scope=self._context.tree_node, + node=self._name, + ) + if check is flow_analysis.UNREACHABLE: + return NO_CONTEXTS + return self._found_predefined_types + + types = self._names_to_types(names, attribute_lookup) + + if not names and self._analysis_errors and not types \ + and not (isinstance(self._name, tree.Name) and + isinstance(self._name.parent.parent, tree.Param)): + if isinstance(self._name, tree.Name): + if attribute_lookup: + analysis.add_attribute_error( + self._name_context, self._context, self._name) + else: + message = ("NameError: name '%s' is not defined." + % self._string_name) + analysis.add(self._name_context, 'name-error', self._name, message) + + return types + + def _get_origin_scope(self): + if isinstance(self._name, tree.Name): + scope = self._name + while scope.parent is not None: + # TODO why if classes? + if not isinstance(scope, tree.Scope): + break + scope = scope.parent + return scope + else: + return None + + def get_filters(self, search_global=False): + origin_scope = self._get_origin_scope() + if search_global: + position = self._position + + # For functions and classes the defaults don't belong to the + # function and get evaluated in the context before the function. So + # make sure to exclude the function/class name. + if origin_scope is not None: + ancestor = search_ancestor(origin_scope, 'funcdef', 'classdef', 'lambdef') + lambdef = None + if ancestor == 'lambdef': + # For lambdas it's even more complicated since parts will + # be evaluated later. + lambdef = ancestor + ancestor = search_ancestor(origin_scope, 'funcdef', 'classdef') + if ancestor is not None: + colon = ancestor.children[-2] + if position is not None and position < colon.start_pos: + if lambdef is None or position < lambdef.children[-2].start_pos: + position = ancestor.start_pos + + return get_global_filters(self._evaluator, self._context, position, origin_scope) + else: + return self._get_context_filters(origin_scope) + + def _get_context_filters(self, origin_scope): + for f in self._context.get_filters(False, self._position, origin_scope=origin_scope): + yield f + # This covers the case where a stub files are incomplete. + if self._context.is_stub(): + for c in convert_contexts(ContextSet({self._context})): + for f in c.get_filters(): + yield f + + def filter_name(self, filters): + """ + Searches names that are defined in a scope (the different + ``filters``), until a name fits. + """ + names = [] + # This paragraph is currently needed for proper branch evaluation + # (static analysis). + if self._context.predefined_names and isinstance(self._name, tree.Name): + node = self._name + while node is not None and not is_scope(node): + node = node.parent + if node.type in ("if_stmt", "for_stmt", "comp_for", 'sync_comp_for'): + try: + name_dict = self._context.predefined_names[node] + types = name_dict[self._string_name] + except KeyError: + continue + else: + self._found_predefined_types = types + break + + for filter in filters: + names = filter.get(self._string_name) + if names: + if len(names) == 1: + n, = names + if isinstance(n, TreeNameDefinition): + # Something somewhere went terribly wrong. This + # typically happens when using goto on an import in an + # __init__ file. I think we need a better solution, but + # it's kind of hard, because for Jedi it's not clear + # that that name has not been defined, yet. + if n.tree_name == self._name: + def_ = self._name.get_definition() + if def_ is not None and def_.type == 'import_from': + continue + break + + debug.dbg('finder.filter_name %s in (%s): %s@%s', + self._string_name, self._context, names, self._position) + return list(names) + + def _check_getattr(self, inst): + """Checks for both __getattr__ and __getattribute__ methods""" + # str is important, because it shouldn't be `Name`! + name = compiled.create_simple_object(self._evaluator, self._string_name) + + # This is a little bit special. `__getattribute__` is in Python + # executed before `__getattr__`. But: I know no use case, where + # this could be practical and where Jedi would return wrong types. + # If you ever find something, let me know! + # We are inversing this, because a hand-crafted `__getattribute__` + # could still call another hand-crafted `__getattr__`, but not the + # other way around. + names = (inst.get_function_slot_names(u'__getattr__') or + inst.get_function_slot_names(u'__getattribute__')) + return inst.execute_function_slots(names, name) + + def _names_to_types(self, names, attribute_lookup): + contexts = ContextSet.from_sets(name.infer() for name in names) + + debug.dbg('finder._names_to_types: %s -> %s', names, contexts) + if not names and self._context.is_instance() and not self._context.is_compiled(): + # handling __getattr__ / __getattribute__ + return self._check_getattr(self._context) + + # Add isinstance and other if/assert knowledge. + if not contexts and isinstance(self._name, tree.Name) and \ + not self._name_context.is_instance() and not self._context.is_compiled(): + flow_scope = self._name + base_nodes = [self._name_context.tree_node] + + if any(b.type in ('comp_for', 'sync_comp_for') for b in base_nodes): + return contexts + while True: + flow_scope = get_parent_scope(flow_scope, include_flows=True) + n = _check_flow_information(self._name_context, flow_scope, + self._name, self._position) + if n is not None: + return n + if flow_scope in base_nodes: + break + return contexts + + +def _check_flow_information(context, flow, search_name, pos): + """ Try to find out the type of a variable just with the information that + is given by the flows: e.g. It is also responsible for assert checks.:: + + if isinstance(k, str): + k. # <- completion here + + ensures that `k` is a string. + """ + if not settings.dynamic_flow_information: + return None + + result = None + if is_scope(flow): + # Check for asserts. + module_node = flow.get_root_node() + try: + names = module_node.get_used_names()[search_name.value] + except KeyError: + return None + names = reversed([ + n for n in names + if flow.start_pos <= n.start_pos < (pos or flow.end_pos) + ]) + + for name in names: + ass = search_ancestor(name, 'assert_stmt') + if ass is not None: + result = _check_isinstance_type(context, ass.assertion, search_name) + if result is not None: + return result + + if flow.type in ('if_stmt', 'while_stmt'): + potential_ifs = [c for c in flow.children[1::4] if c != ':'] + for if_test in reversed(potential_ifs): + if search_name.start_pos > if_test.end_pos: + return _check_isinstance_type(context, if_test, search_name) + return result + + +def _check_isinstance_type(context, element, search_name): + try: + assert element.type in ('power', 'atom_expr') + # this might be removed if we analyze and, etc + assert len(element.children) == 2 + first, trailer = element.children + assert first.type == 'name' and first.value == 'isinstance' + assert trailer.type == 'trailer' and trailer.children[0] == '(' + assert len(trailer.children) == 3 + + # arglist stuff + arglist = trailer.children[1] + args = TreeArguments(context.evaluator, context, arglist, trailer) + param_list = list(args.unpack()) + # Disallow keyword arguments + assert len(param_list) == 2 + (key1, lazy_context_object), (key2, lazy_context_cls) = param_list + assert key1 is None and key2 is None + call = helpers.call_of_leaf(search_name) + is_instance_call = helpers.call_of_leaf(lazy_context_object.data) + # Do a simple get_code comparison. They should just have the same code, + # and everything will be all right. + normalize = context.evaluator.grammar._normalize + assert normalize(is_instance_call) == normalize(call) + except AssertionError: + return None + + context_set = NO_CONTEXTS + for cls_or_tup in lazy_context_cls.infer(): + if isinstance(cls_or_tup, iterable.Sequence) and cls_or_tup.array_type == 'tuple': + for lazy_context in cls_or_tup.py__iter__(): + context_set |= lazy_context.infer().execute_evaluated() + else: + context_set |= cls_or_tup.execute_evaluated() + return context_set diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/flow_analysis.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/flow_analysis.py new file mode 100644 index 0000000..474071f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/flow_analysis.py @@ -0,0 +1,118 @@ +from jedi.parser_utils import get_flow_branch_keyword, is_scope, get_parent_scope +from jedi.evaluate.recursion import execution_allowed + + +class Status(object): + lookup_table = {} + + def __init__(self, value, name): + self._value = value + self._name = name + Status.lookup_table[value] = self + + def invert(self): + if self is REACHABLE: + return UNREACHABLE + elif self is UNREACHABLE: + return REACHABLE + else: + return UNSURE + + def __and__(self, other): + if UNSURE in (self, other): + return UNSURE + else: + return REACHABLE if self._value and other._value else UNREACHABLE + + def __repr__(self): + return '<%s: %s>' % (type(self).__name__, self._name) + + +REACHABLE = Status(True, 'reachable') +UNREACHABLE = Status(False, 'unreachable') +UNSURE = Status(None, 'unsure') + + +def _get_flow_scopes(node): + while True: + node = get_parent_scope(node, include_flows=True) + if node is None or is_scope(node): + return + yield node + + +def reachability_check(context, context_scope, node, origin_scope=None): + first_flow_scope = get_parent_scope(node, include_flows=True) + if origin_scope is not None: + origin_flow_scopes = list(_get_flow_scopes(origin_scope)) + node_flow_scopes = list(_get_flow_scopes(node)) + + branch_matches = True + for flow_scope in origin_flow_scopes: + if flow_scope in node_flow_scopes: + node_keyword = get_flow_branch_keyword(flow_scope, node) + origin_keyword = get_flow_branch_keyword(flow_scope, origin_scope) + branch_matches = node_keyword == origin_keyword + if flow_scope.type == 'if_stmt': + if not branch_matches: + return UNREACHABLE + elif flow_scope.type == 'try_stmt': + if not branch_matches and origin_keyword == 'else' \ + and node_keyword == 'except': + return UNREACHABLE + if branch_matches: + break + + # Direct parents get resolved, we filter scopes that are separate + # branches. This makes sense for autocompletion and static analysis. + # For actual Python it doesn't matter, because we're talking about + # potentially unreachable code. + # e.g. `if 0:` would cause all name lookup within the flow make + # unaccessible. This is not a "problem" in Python, because the code is + # never called. In Jedi though, we still want to infer types. + while origin_scope is not None: + if first_flow_scope == origin_scope and branch_matches: + return REACHABLE + origin_scope = origin_scope.parent + + return _break_check(context, context_scope, first_flow_scope, node) + + +def _break_check(context, context_scope, flow_scope, node): + reachable = REACHABLE + if flow_scope.type == 'if_stmt': + if flow_scope.is_node_after_else(node): + for check_node in flow_scope.get_test_nodes(): + reachable = _check_if(context, check_node) + if reachable in (REACHABLE, UNSURE): + break + reachable = reachable.invert() + else: + flow_node = flow_scope.get_corresponding_test_node(node) + if flow_node is not None: + reachable = _check_if(context, flow_node) + elif flow_scope.type in ('try_stmt', 'while_stmt'): + return UNSURE + + # Only reachable branches need to be examined further. + if reachable in (UNREACHABLE, UNSURE): + return reachable + + if context_scope != flow_scope and context_scope != flow_scope.parent: + flow_scope = get_parent_scope(flow_scope, include_flows=True) + return reachable & _break_check(context, context_scope, flow_scope, node) + else: + return reachable + + +def _check_if(context, node): + with execution_allowed(context.evaluator, node) as allowed: + if not allowed: + return UNSURE + + types = context.eval_node(node) + values = set(x.py__bool__() for x in types) + if len(values) == 1: + return Status.lookup_table[values.pop()] + else: + return UNSURE diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/gradual/__init__.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/gradual/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/gradual/annotation.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/gradual/annotation.py new file mode 100644 index 0000000..c014512 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/gradual/annotation.py @@ -0,0 +1,405 @@ +""" +PEP 0484 ( https://www.python.org/dev/peps/pep-0484/ ) describes type hints +through function annotations. There is a strong suggestion in this document +that only the type of type hinting defined in PEP0484 should be allowed +as annotations in future python versions. +""" + +import re + +from parso import ParserSyntaxError, parse + +from jedi._compatibility import force_unicode +from jedi.evaluate.cache import evaluator_method_cache +from jedi.evaluate.base_context import ContextSet, NO_CONTEXTS +from jedi.evaluate.gradual.typing import TypeVar, LazyGenericClass, \ + AbstractAnnotatedClass +from jedi.evaluate.gradual.typing import GenericClass +from jedi.evaluate.helpers import is_string +from jedi.evaluate.compiled import builtin_from_name +from jedi import debug +from jedi import parser_utils + + +def eval_annotation(context, annotation): + """ + Evaluates an annotation node. This means that it evaluates the part of + `int` here: + + foo: int = 3 + + Also checks for forward references (strings) + """ + context_set = context.eval_node(annotation) + if len(context_set) != 1: + debug.warning("Eval'ed typing index %s should lead to 1 object, " + " not %s" % (annotation, context_set)) + return context_set + + evaled_context = list(context_set)[0] + if is_string(evaled_context): + result = _get_forward_reference_node(context, evaled_context.get_safe_value()) + if result is not None: + return context.eval_node(result) + return context_set + + +def _evaluate_annotation_string(context, string, index=None): + node = _get_forward_reference_node(context, string) + if node is None: + return NO_CONTEXTS + + context_set = context.eval_node(node) + if index is not None: + context_set = context_set.filter( + lambda context: context.array_type == u'tuple' # noqa + and len(list(context.py__iter__())) >= index + ).py__simple_getitem__(index) + return context_set + + +def _get_forward_reference_node(context, string): + try: + new_node = context.evaluator.grammar.parse( + force_unicode(string), + start_symbol='eval_input', + error_recovery=False + ) + except ParserSyntaxError: + debug.warning('Annotation not parsed: %s' % string) + return None + else: + module = context.tree_node.get_root_node() + parser_utils.move(new_node, module.end_pos[0]) + new_node.parent = context.tree_node + return new_node + + +def _split_comment_param_declaration(decl_text): + """ + Split decl_text on commas, but group generic expressions + together. + + For example, given "foo, Bar[baz, biz]" we return + ['foo', 'Bar[baz, biz]']. + + """ + try: + node = parse(decl_text, error_recovery=False).children[0] + except ParserSyntaxError: + debug.warning('Comment annotation is not valid Python: %s' % decl_text) + return [] + + if node.type == 'name': + return [node.get_code().strip()] + + params = [] + try: + children = node.children + except AttributeError: + return [] + else: + for child in children: + if child.type in ['name', 'atom_expr', 'power']: + params.append(child.get_code().strip()) + + return params + + +@evaluator_method_cache() +def infer_param(execution_context, param): + contexts = _infer_param(execution_context, param) + evaluator = execution_context.evaluator + if param.star_count == 1: + tuple_ = builtin_from_name(evaluator, 'tuple') + return ContextSet([GenericClass( + tuple_, + generics=(contexts,), + ) for c in contexts]) + elif param.star_count == 2: + dct = builtin_from_name(evaluator, 'dict') + return ContextSet([GenericClass( + dct, + generics=(ContextSet([builtin_from_name(evaluator, 'str')]), contexts), + ) for c in contexts]) + pass + return contexts + + +def _infer_param(execution_context, param): + """ + Infers the type of a function parameter, using type annotations. + """ + annotation = param.annotation + if annotation is None: + # If no Python 3-style annotation, look for a Python 2-style comment + # annotation. + # Identify parameters to function in the same sequence as they would + # appear in a type comment. + all_params = [child for child in param.parent.children + if child.type == 'param'] + + node = param.parent.parent + comment = parser_utils.get_following_comment_same_line(node) + if comment is None: + return NO_CONTEXTS + + match = re.match(r"^#\s*type:\s*\(([^#]*)\)\s*->", comment) + if not match: + return NO_CONTEXTS + params_comments = _split_comment_param_declaration(match.group(1)) + + # Find the specific param being investigated + index = all_params.index(param) + # If the number of parameters doesn't match length of type comment, + # ignore first parameter (assume it's self). + if len(params_comments) != len(all_params): + debug.warning( + "Comments length != Params length %s %s", + params_comments, all_params + ) + from jedi.evaluate.context.instance import InstanceArguments + if isinstance(execution_context.var_args, InstanceArguments): + if index == 0: + # Assume it's self, which is already handled + return NO_CONTEXTS + index -= 1 + if index >= len(params_comments): + return NO_CONTEXTS + + param_comment = params_comments[index] + return _evaluate_annotation_string( + execution_context.function_context.get_default_param_context(), + param_comment + ) + # Annotations are like default params and resolve in the same way. + context = execution_context.function_context.get_default_param_context() + return eval_annotation(context, annotation) + + +def py__annotations__(funcdef): + dct = {} + for function_param in funcdef.get_params(): + param_annotation = function_param.annotation + if param_annotation is not None: + dct[function_param.name.value] = param_annotation + + return_annotation = funcdef.annotation + if return_annotation: + dct['return'] = return_annotation + return dct + + +@evaluator_method_cache() +def infer_return_types(function_execution_context): + """ + Infers the type of a function's return value, + according to type annotations. + """ + all_annotations = py__annotations__(function_execution_context.tree_node) + annotation = all_annotations.get("return", None) + if annotation is None: + # If there is no Python 3-type annotation, look for a Python 2-type annotation + node = function_execution_context.tree_node + comment = parser_utils.get_following_comment_same_line(node) + if comment is None: + return NO_CONTEXTS + + match = re.match(r"^#\s*type:\s*\([^#]*\)\s*->\s*([^#]*)", comment) + if not match: + return NO_CONTEXTS + + return _evaluate_annotation_string( + function_execution_context.function_context.get_default_param_context(), + match.group(1).strip() + ).execute_annotation() + if annotation is None: + return NO_CONTEXTS + + context = function_execution_context.function_context.get_default_param_context() + unknown_type_vars = list(find_unknown_type_vars(context, annotation)) + annotation_contexts = eval_annotation(context, annotation) + if not unknown_type_vars: + return annotation_contexts.execute_annotation() + + type_var_dict = infer_type_vars_for_execution(function_execution_context, all_annotations) + + return ContextSet.from_sets( + ann.define_generics(type_var_dict) + if isinstance(ann, (AbstractAnnotatedClass, TypeVar)) else ContextSet({ann}) + for ann in annotation_contexts + ).execute_annotation() + + +def infer_type_vars_for_execution(execution_context, annotation_dict): + """ + Some functions use type vars that are not defined by the class, but rather + only defined in the function. See for example `iter`. In those cases we + want to: + + 1. Search for undefined type vars. + 2. Infer type vars with the execution state we have. + 3. Return the union of all type vars that have been found. + """ + context = execution_context.function_context.get_default_param_context() + + annotation_variable_results = {} + executed_params, _ = execution_context.get_executed_params_and_issues() + for executed_param in executed_params: + try: + annotation_node = annotation_dict[executed_param.string_name] + except KeyError: + continue + + annotation_variables = find_unknown_type_vars(context, annotation_node) + if annotation_variables: + # Infer unknown type var + annotation_context_set = context.eval_node(annotation_node) + star_count = executed_param._param_node.star_count + actual_context_set = executed_param.infer(use_hints=False) + if star_count == 1: + actual_context_set = actual_context_set.merge_types_of_iterate() + elif star_count == 2: + # TODO _dict_values is not public. + actual_context_set = actual_context_set.try_merge('_dict_values') + for ann in annotation_context_set: + _merge_type_var_dicts( + annotation_variable_results, + _infer_type_vars(ann, actual_context_set), + ) + + return annotation_variable_results + + +def _merge_type_var_dicts(base_dict, new_dict): + for type_var_name, contexts in new_dict.items(): + try: + base_dict[type_var_name] |= contexts + except KeyError: + base_dict[type_var_name] = contexts + + +def _infer_type_vars(annotation_context, context_set): + """ + This function tries to find information about undefined type vars and + returns a dict from type var name to context set. + + This is for example important to understand what `iter([1])` returns. + According to typeshed, `iter` returns an `Iterator[_T]`: + + def iter(iterable: Iterable[_T]) -> Iterator[_T]: ... + + This functions would generate `int` for `_T` in this case, because it + unpacks the `Iterable`. + """ + type_var_dict = {} + if isinstance(annotation_context, TypeVar): + return {annotation_context.py__name__(): context_set.py__class__()} + elif isinstance(annotation_context, LazyGenericClass): + name = annotation_context.py__name__() + if name == 'Iterable': + given = annotation_context.get_generics() + if given: + for nested_annotation_context in given[0]: + _merge_type_var_dicts( + type_var_dict, + _infer_type_vars( + nested_annotation_context, + context_set.merge_types_of_iterate() + ) + ) + elif name == 'Mapping': + given = annotation_context.get_generics() + if len(given) == 2: + for context in context_set: + try: + method = context.get_mapping_item_contexts + except AttributeError: + continue + key_contexts, value_contexts = method() + + for nested_annotation_context in given[0]: + _merge_type_var_dicts( + type_var_dict, + _infer_type_vars( + nested_annotation_context, + key_contexts, + ) + ) + for nested_annotation_context in given[1]: + _merge_type_var_dicts( + type_var_dict, + _infer_type_vars( + nested_annotation_context, + value_contexts, + ) + ) + return type_var_dict + + +def find_type_from_comment_hint_for(context, node, name): + return _find_type_from_comment_hint(context, node, node.children[1], name) + + +def find_type_from_comment_hint_with(context, node, name): + assert len(node.children[1].children) == 3, \ + "Can only be here when children[1] is 'foo() as f'" + varlist = node.children[1].children[2] + return _find_type_from_comment_hint(context, node, varlist, name) + + +def find_type_from_comment_hint_assign(context, node, name): + return _find_type_from_comment_hint(context, node, node.children[0], name) + + +def _find_type_from_comment_hint(context, node, varlist, name): + index = None + if varlist.type in ("testlist_star_expr", "exprlist", "testlist"): + # something like "a, b = 1, 2" + index = 0 + for child in varlist.children: + if child == name: + break + if child.type == "operator": + continue + index += 1 + else: + return [] + + comment = parser_utils.get_following_comment_same_line(node) + if comment is None: + return [] + match = re.match(r"^#\s*type:\s*([^#]*)", comment) + if match is None: + return [] + return _evaluate_annotation_string( + context, match.group(1).strip(), index + ).execute_annotation() + + +def find_unknown_type_vars(context, node): + def check_node(node): + if node.type in ('atom_expr', 'power'): + trailer = node.children[-1] + if trailer.type == 'trailer' and trailer.children[0] == '[': + for subscript_node in _unpack_subscriptlist(trailer.children[1]): + check_node(subscript_node) + else: + type_var_set = context.eval_node(node) + for type_var in type_var_set: + if isinstance(type_var, TypeVar) and type_var not in found: + found.append(type_var) + + found = [] # We're not using a set, because the order matters. + check_node(node) + return found + + +def _unpack_subscriptlist(subscriptlist): + if subscriptlist.type == 'subscriptlist': + for subscript in subscriptlist.children[::2]: + if subscript.type != 'subscript': + yield subscript + else: + if subscriptlist.type != 'subscript': + yield subscriptlist diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/gradual/conversion.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/gradual/conversion.py new file mode 100644 index 0000000..88f4942 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/gradual/conversion.py @@ -0,0 +1,199 @@ +from jedi import debug +from jedi.evaluate.base_context import ContextSet, \ + NO_CONTEXTS +from jedi.evaluate.utils import to_list +from jedi.evaluate.gradual.stub_context import StubModuleContext + + +def _stub_to_python_context_set(stub_context, ignore_compiled=False): + stub_module = stub_context.get_root_context() + if not stub_module.is_stub(): + return ContextSet([stub_context]) + + was_instance = stub_context.is_instance() + if was_instance: + stub_context = stub_context.py__class__() + + qualified_names = stub_context.get_qualified_names() + if qualified_names is None: + return NO_CONTEXTS + + was_bound_method = stub_context.is_bound_method() + if was_bound_method: + # Infer the object first. We can infer the method later. + method_name = qualified_names[-1] + qualified_names = qualified_names[:-1] + was_instance = True + + contexts = _infer_from_stub(stub_module, qualified_names, ignore_compiled) + if was_instance: + contexts = ContextSet.from_sets( + c.execute_evaluated() + for c in contexts + if c.is_class() + ) + if was_bound_method: + # Now that the instance has been properly created, we can simply get + # the method. + contexts = contexts.py__getattribute__(method_name) + return contexts + + +def _infer_from_stub(stub_module, qualified_names, ignore_compiled): + from jedi.evaluate.compiled.mixed import MixedObject + assert isinstance(stub_module, (StubModuleContext, MixedObject)), stub_module + non_stubs = stub_module.non_stub_context_set + if ignore_compiled: + non_stubs = non_stubs.filter(lambda c: not c.is_compiled()) + for name in qualified_names: + non_stubs = non_stubs.py__getattribute__(name) + return non_stubs + + +@to_list +def _try_stub_to_python_names(names, prefer_stub_to_compiled=False): + for name in names: + module = name.get_root_context() + if not module.is_stub(): + yield name + continue + + name_list = name.get_qualified_names() + if name_list is None: + contexts = NO_CONTEXTS + else: + contexts = _infer_from_stub( + module, + name_list[:-1], + ignore_compiled=prefer_stub_to_compiled, + ) + if contexts and name_list: + new_names = contexts.py__getattribute__(name_list[-1], is_goto=True) + for new_name in new_names: + yield new_name + if new_names: + continue + elif contexts: + for c in contexts: + yield c.name + continue + # This is the part where if we haven't found anything, just return the + # stub name. + yield name + + +def _load_stub_module(module): + if module.is_stub(): + return module + from jedi.evaluate.gradual.typeshed import _try_to_load_stub_cached + return _try_to_load_stub_cached( + module.evaluator, + import_names=module.string_names, + python_context_set=ContextSet([module]), + parent_module_context=None, + sys_path=module.evaluator.get_sys_path(), + ) + + +@to_list +def _python_to_stub_names(names, fallback_to_python=False): + for name in names: + module = name.get_root_context() + if module.is_stub(): + yield name + continue + + if name.is_import(): + for new_name in name.goto(): + # Imports don't need to be converted, because they are already + # stubs if possible. + if fallback_to_python or new_name.is_stub(): + yield new_name + continue + + name_list = name.get_qualified_names() + stubs = NO_CONTEXTS + if name_list is not None: + stub_module = _load_stub_module(module) + if stub_module is not None: + stubs = ContextSet({stub_module}) + for name in name_list[:-1]: + stubs = stubs.py__getattribute__(name) + if stubs and name_list: + new_names = stubs.py__getattribute__(name_list[-1], is_goto=True) + for new_name in new_names: + yield new_name + if new_names: + continue + elif stubs: + for c in stubs: + yield c.name + continue + if fallback_to_python: + # This is the part where if we haven't found anything, just return + # the stub name. + yield name + + +def convert_names(names, only_stubs=False, prefer_stubs=False): + assert not (only_stubs and prefer_stubs) + with debug.increase_indent_cm('convert names'): + if only_stubs or prefer_stubs: + return _python_to_stub_names(names, fallback_to_python=prefer_stubs) + else: + return _try_stub_to_python_names(names, prefer_stub_to_compiled=True) + + +def convert_contexts(contexts, only_stubs=False, prefer_stubs=False, ignore_compiled=True): + assert not (only_stubs and prefer_stubs) + with debug.increase_indent_cm('convert contexts'): + if only_stubs or prefer_stubs: + return ContextSet.from_sets( + to_stub(context) + or (ContextSet({context}) if prefer_stubs else NO_CONTEXTS) + for context in contexts + ) + else: + return ContextSet.from_sets( + _stub_to_python_context_set(stub_context, ignore_compiled=ignore_compiled) + or ContextSet({stub_context}) + for stub_context in contexts + ) + + +# TODO merge with _python_to_stub_names? +def to_stub(context): + if context.is_stub(): + return ContextSet([context]) + + was_instance = context.is_instance() + if was_instance: + context = context.py__class__() + + qualified_names = context.get_qualified_names() + stub_module = _load_stub_module(context.get_root_context()) + if stub_module is None or qualified_names is None: + return NO_CONTEXTS + + was_bound_method = context.is_bound_method() + if was_bound_method: + # Infer the object first. We can infer the method later. + method_name = qualified_names[-1] + qualified_names = qualified_names[:-1] + was_instance = True + + stub_contexts = ContextSet([stub_module]) + for name in qualified_names: + stub_contexts = stub_contexts.py__getattribute__(name) + + if was_instance: + stub_contexts = ContextSet.from_sets( + c.execute_evaluated() + for c in stub_contexts + if c.is_class() + ) + if was_bound_method: + # Now that the instance has been properly created, we can simply get + # the method. + stub_contexts = stub_contexts.py__getattribute__(method_name) + return stub_contexts diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/gradual/stub_context.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/gradual/stub_context.py new file mode 100644 index 0000000..94090c1 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/gradual/stub_context.py @@ -0,0 +1,105 @@ +from jedi.evaluate.base_context import ContextWrapper +from jedi.evaluate.context.module import ModuleContext +from jedi.evaluate.filters import ParserTreeFilter, \ + TreeNameDefinition +from jedi.evaluate.gradual.typing import TypingModuleFilterWrapper + + +class StubModuleContext(ModuleContext): + def __init__(self, non_stub_context_set, *args, **kwargs): + super(StubModuleContext, self).__init__(*args, **kwargs) + self.non_stub_context_set = non_stub_context_set + + def is_stub(self): + return True + + def sub_modules_dict(self): + """ + We have to overwrite this, because it's possible to have stubs that + don't have code for all the child modules. At the time of writing this + there are for example no stubs for `json.tool`. + """ + names = {} + for context in self.non_stub_context_set: + try: + method = context.sub_modules_dict + except AttributeError: + pass + else: + names.update(method()) + names.update(super(StubModuleContext, self).sub_modules_dict()) + return names + + def _get_first_non_stub_filters(self): + for context in self.non_stub_context_set: + yield next(context.get_filters(search_global=False)) + + def _get_stub_filters(self, search_global, **filter_kwargs): + return [StubFilter( + self.evaluator, + context=self, + search_global=search_global, + **filter_kwargs + )] + list(self.iter_star_filters(search_global=search_global)) + + def get_filters(self, search_global=False, until_position=None, + origin_scope=None, **kwargs): + filters = super(StubModuleContext, self).get_filters( + search_global, until_position, origin_scope, **kwargs + ) + next(filters) # Ignore the first filter and replace it with our own + stub_filters = self._get_stub_filters( + search_global=search_global, + until_position=until_position, + origin_scope=origin_scope, + ) + for f in stub_filters: + yield f + + for f in filters: + yield f + + +class TypingModuleWrapper(StubModuleContext): + def get_filters(self, *args, **kwargs): + filters = super(TypingModuleWrapper, self).get_filters(*args, **kwargs) + yield TypingModuleFilterWrapper(next(filters)) + for f in filters: + yield f + + +# From here on down we make looking up the sys.version_info fast. +class _StubName(TreeNameDefinition): + def infer(self): + inferred = super(_StubName, self).infer() + if self.string_name == 'version_info' and self.get_root_context().py__name__() == 'sys': + return [VersionInfo(c) for c in inferred] + return inferred + + +class StubFilter(ParserTreeFilter): + name_class = _StubName + + def __init__(self, *args, **kwargs): + self._search_global = kwargs.pop('search_global') # Python 2 :/ + super(StubFilter, self).__init__(*args, **kwargs) + + def _is_name_reachable(self, name): + if not super(StubFilter, self)._is_name_reachable(name): + return False + + if not self._search_global: + # Imports in stub files are only public if they have an "as" + # export. + definition = name.get_definition() + if definition.type in ('import_from', 'import_name'): + if name.parent.type not in ('import_as_name', 'dotted_as_name'): + return False + n = name.value + if n.startswith('_') and not (n.startswith('__') and n.endswith('__')): + return False + return True + + +class VersionInfo(ContextWrapper): + pass diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/gradual/typeshed.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/gradual/typeshed.py new file mode 100644 index 0000000..5a386c0 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/gradual/typeshed.py @@ -0,0 +1,289 @@ +import os +import re +from functools import wraps + +from jedi.file_io import FileIO +from jedi._compatibility import FileNotFoundError, cast_path +from jedi.parser_utils import get_cached_code_lines +from jedi.evaluate.base_context import ContextSet, NO_CONTEXTS +from jedi.evaluate.gradual.stub_context import TypingModuleWrapper, StubModuleContext + +_jedi_path = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) +TYPESHED_PATH = os.path.join(_jedi_path, 'third_party', 'typeshed') + +_IMPORT_MAP = dict( + _collections='collections', + _socket='socket', +) + + +def _merge_create_stub_map(directories): + map_ = {} + for directory in directories: + map_.update(_create_stub_map(directory)) + return map_ + + +def _create_stub_map(directory): + """ + Create a mapping of an importable name in Python to a stub file. + """ + def generate(): + try: + listed = os.listdir(directory) + except (FileNotFoundError, OSError): + # OSError is Python 2 + return + + for entry in listed: + entry = cast_path(entry) + path = os.path.join(directory, entry) + if os.path.isdir(path): + init = os.path.join(path, '__init__.pyi') + if os.path.isfile(init): + yield entry, init + elif entry.endswith('.pyi') and os.path.isfile(path): + name = entry.rstrip('.pyi') + if name != '__init__': + yield name, path + + # Create a dictionary from the tuple generator. + return dict(generate()) + + +def _get_typeshed_directories(version_info): + check_version_list = ['2and3', str(version_info.major)] + for base in ['stdlib', 'third_party']: + base = os.path.join(TYPESHED_PATH, base) + base_list = os.listdir(base) + for base_list_entry in base_list: + match = re.match(r'(\d+)\.(\d+)$', base_list_entry) + if match is not None: + if int(match.group(1)) == version_info.major \ + and int(match.group(2)) <= version_info.minor: + check_version_list.append(base_list_entry) + + for check_version in check_version_list: + yield os.path.join(base, check_version) + + +_version_cache = {} + + +def _cache_stub_file_map(version_info): + """ + Returns a map of an importable name in Python to a stub file. + """ + # TODO this caches the stub files indefinitely, maybe use a time cache + # for that? + version = version_info[:2] + try: + return _version_cache[version] + except KeyError: + pass + + _version_cache[version] = file_set = \ + _merge_create_stub_map(_get_typeshed_directories(version_info)) + return file_set + + +def import_module_decorator(func): + @wraps(func) + def wrapper(evaluator, import_names, parent_module_context, sys_path, prefer_stubs): + try: + python_context_set = evaluator.module_cache.get(import_names) + except KeyError: + if parent_module_context is not None and parent_module_context.is_stub(): + parent_module_contexts = parent_module_context.non_stub_context_set + else: + parent_module_contexts = [parent_module_context] + if import_names == ('os', 'path'): + # This is a huge exception, we follow a nested import + # ``os.path``, because it's a very important one in Python + # that is being achieved by messing with ``sys.modules`` in + # ``os``. + python_parent = next(iter(parent_module_contexts)) + if python_parent is None: + python_parent, = evaluator.import_module(('os',), prefer_stubs=False) + python_context_set = python_parent.py__getattribute__('path') + else: + python_context_set = ContextSet.from_sets( + func(evaluator, import_names, p, sys_path,) + for p in parent_module_contexts + ) + evaluator.module_cache.add(import_names, python_context_set) + + if not prefer_stubs: + return python_context_set + + stub = _try_to_load_stub_cached(evaluator, import_names, python_context_set, + parent_module_context, sys_path) + if stub is not None: + return ContextSet([stub]) + return python_context_set + + return wrapper + + +def _try_to_load_stub_cached(evaluator, import_names, *args, **kwargs): + try: + return evaluator.stub_module_cache[import_names] + except KeyError: + pass + + # TODO is this needed? where are the exceptions coming from that make this + # necessary? Just remove this line. + evaluator.stub_module_cache[import_names] = None + evaluator.stub_module_cache[import_names] = result = \ + _try_to_load_stub(evaluator, import_names, *args, **kwargs) + return result + + +def _try_to_load_stub(evaluator, import_names, python_context_set, + parent_module_context, sys_path): + """ + Trying to load a stub for a set of import_names. + + This is modelled to work like "PEP 561 -- Distributing and Packaging Type + Information", see https://www.python.org/dev/peps/pep-0561. + """ + if parent_module_context is None and len(import_names) > 1: + try: + parent_module_context = _try_to_load_stub_cached( + evaluator, import_names[:-1], NO_CONTEXTS, + parent_module_context=None, sys_path=sys_path) + except KeyError: + pass + + # 1. Try to load foo-stubs folders on path for import name foo. + if len(import_names) == 1: + # foo-stubs + for p in sys_path: + init = os.path.join(p, *import_names) + '-stubs' + os.path.sep + '__init__.pyi' + m = _try_to_load_stub_from_file( + evaluator, + python_context_set, + file_io=FileIO(init), + import_names=import_names, + ) + if m is not None: + return m + + # 2. Try to load pyi files next to py files. + for c in python_context_set: + try: + method = c.py__file__ + except AttributeError: + pass + else: + file_path = method() + file_paths = [] + if c.is_namespace(): + file_paths = [os.path.join(p, '__init__.pyi') for p in c.py__path__()] + elif file_path is not None and file_path.endswith('.py'): + file_paths = [file_path + 'i'] + + for file_path in file_paths: + m = _try_to_load_stub_from_file( + evaluator, + python_context_set, + # The file path should end with .pyi + file_io=FileIO(file_path), + import_names=import_names, + ) + if m is not None: + return m + + # 3. Try to load typeshed + m = _load_from_typeshed(evaluator, python_context_set, parent_module_context, import_names) + if m is not None: + return m + + # 4. Try to load pyi file somewhere if python_context_set was not defined. + if not python_context_set: + if parent_module_context is not None: + try: + method = parent_module_context.py__path__ + except AttributeError: + check_path = [] + else: + check_path = method() + # In case import_names + names_for_path = (import_names[-1],) + else: + check_path = sys_path + names_for_path = import_names + + for p in check_path: + m = _try_to_load_stub_from_file( + evaluator, + python_context_set, + file_io=FileIO(os.path.join(p, *names_for_path) + '.pyi'), + import_names=import_names, + ) + if m is not None: + return m + + # If no stub is found, that's fine, the calling function has to deal with + # it. + return None + + +def _load_from_typeshed(evaluator, python_context_set, parent_module_context, import_names): + import_name = import_names[-1] + map_ = None + if len(import_names) == 1: + map_ = _cache_stub_file_map(evaluator.grammar.version_info) + import_name = _IMPORT_MAP.get(import_name, import_name) + elif isinstance(parent_module_context, StubModuleContext): + if not parent_module_context.is_package: + # Only if it's a package (= a folder) something can be + # imported. + return None + path = parent_module_context.py__path__() + map_ = _merge_create_stub_map(path) + + if map_ is not None: + path = map_.get(import_name) + if path is not None: + return _try_to_load_stub_from_file( + evaluator, + python_context_set, + file_io=FileIO(path), + import_names=import_names, + ) + + +def _try_to_load_stub_from_file(evaluator, python_context_set, file_io, import_names): + try: + stub_module_node = evaluator.parse( + file_io=file_io, + cache=True, + use_latest_grammar=True + ) + except (OSError, IOError): # IOError is Python 2 only + # The file that you're looking for doesn't exist (anymore). + return None + else: + return create_stub_module( + evaluator, python_context_set, stub_module_node, file_io, + import_names + ) + + +def create_stub_module(evaluator, python_context_set, stub_module_node, file_io, import_names): + if import_names == ('typing',): + module_cls = TypingModuleWrapper + else: + module_cls = StubModuleContext + file_name = os.path.basename(file_io.path) + stub_module_context = module_cls( + python_context_set, evaluator, stub_module_node, + file_io=file_io, + string_names=import_names, + # The code was loaded with latest_grammar, so use + # that. + code_lines=get_cached_code_lines(evaluator.latest_grammar, file_io.path), + is_package=file_name == '__init__.pyi', + ) + return stub_module_context diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/gradual/typing.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/gradual/typing.py new file mode 100644 index 0000000..20f2321 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/gradual/typing.py @@ -0,0 +1,707 @@ +""" +We need to somehow work with the typing objects. Since the typing objects are +pretty bare we need to add all the Jedi customizations to make them work as +contexts. + +This file deals with all the typing.py cases. +""" +from jedi._compatibility import unicode, force_unicode +from jedi import debug +from jedi.evaluate.cache import evaluator_method_cache +from jedi.evaluate.compiled import builtin_from_name +from jedi.evaluate.base_context import ContextSet, NO_CONTEXTS, Context, \ + iterator_to_context_set, ContextWrapper, LazyContextWrapper +from jedi.evaluate.lazy_context import LazyKnownContexts +from jedi.evaluate.context.iterable import SequenceLiteralContext +from jedi.evaluate.arguments import repack_with_argument_clinic +from jedi.evaluate.utils import to_list +from jedi.evaluate.filters import FilterWrapper +from jedi.evaluate.names import NameWrapper, AbstractTreeName, \ + AbstractNameDefinition, ContextName +from jedi.evaluate.helpers import is_string +from jedi.evaluate.context.klass import ClassMixin, ClassFilter + +_PROXY_CLASS_TYPES = 'Tuple Generic Protocol Callable Type'.split() +_TYPE_ALIAS_TYPES = { + 'List': 'builtins.list', + 'Dict': 'builtins.dict', + 'Set': 'builtins.set', + 'FrozenSet': 'builtins.frozenset', + 'ChainMap': 'collections.ChainMap', + 'Counter': 'collections.Counter', + 'DefaultDict': 'collections.defaultdict', + 'Deque': 'collections.deque', +} +_PROXY_TYPES = 'Optional Union ClassVar'.split() + + +class TypingName(AbstractTreeName): + def __init__(self, context, other_name): + super(TypingName, self).__init__(context.parent_context, other_name.tree_name) + self._context = context + + def infer(self): + return ContextSet([self._context]) + + +class _BaseTypingContext(Context): + def __init__(self, evaluator, parent_context, tree_name): + super(_BaseTypingContext, self).__init__(evaluator, parent_context) + self._tree_name = tree_name + + @property + def tree_node(self): + return self._tree_name + + def get_filters(self, *args, **kwargs): + # TODO this is obviously wrong. Is it though? + class EmptyFilter(ClassFilter): + def __init__(self): + pass + + def get(self, name, **kwargs): + return [] + + def values(self, **kwargs): + return [] + + yield EmptyFilter() + + def py__class__(self): + # TODO this is obviously not correct, but at least gives us a class if + # we have none. Some of these objects don't really have a base class in + # typeshed. + return builtin_from_name(self.evaluator, u'object') + + @property + def name(self): + return ContextName(self, self._tree_name) + + def __repr__(self): + return '%s(%s)' % (self.__class__.__name__, self._tree_name.value) + + +class TypingModuleName(NameWrapper): + def infer(self): + return ContextSet(self._remap()) + + def _remap(self): + name = self.string_name + evaluator = self.parent_context.evaluator + try: + actual = _TYPE_ALIAS_TYPES[name] + except KeyError: + pass + else: + yield TypeAlias.create_cached(evaluator, self.parent_context, self.tree_name, actual) + return + + if name in _PROXY_CLASS_TYPES: + yield TypingClassContext.create_cached(evaluator, self.parent_context, self.tree_name) + elif name in _PROXY_TYPES: + yield TypingContext.create_cached(evaluator, self.parent_context, self.tree_name) + elif name == 'runtime': + # We don't want anything here, not sure what this function is + # supposed to do, since it just appears in the stubs and shouldn't + # have any effects there (because it's never executed). + return + elif name == 'TypeVar': + yield TypeVarClass.create_cached(evaluator, self.parent_context, self.tree_name) + elif name == 'Any': + yield Any.create_cached(evaluator, self.parent_context, self.tree_name) + elif name == 'TYPE_CHECKING': + # This is needed for e.g. imports that are only available for type + # checking or are in cycles. The user can then check this variable. + yield builtin_from_name(evaluator, u'True') + elif name == 'overload': + yield OverloadFunction.create_cached(evaluator, self.parent_context, self.tree_name) + elif name == 'NewType': + yield NewTypeFunction.create_cached(evaluator, self.parent_context, self.tree_name) + elif name == 'cast': + # TODO implement cast + yield CastFunction.create_cached(evaluator, self.parent_context, self.tree_name) + elif name == 'TypedDict': + # TODO doesn't even exist in typeshed/typing.py, yet. But will be + # added soon. + pass + elif name in ('no_type_check', 'no_type_check_decorator'): + # This is not necessary, as long as we are not doing type checking. + for c in self._wrapped_name.infer(): # Fuck my life Python 2 + yield c + else: + # Everything else shouldn't be relevant for type checking. + for c in self._wrapped_name.infer(): # Fuck my life Python 2 + yield c + + +class TypingModuleFilterWrapper(FilterWrapper): + name_wrapper_class = TypingModuleName + + +class _WithIndexBase(_BaseTypingContext): + def __init__(self, evaluator, parent_context, name, index_context, context_of_index): + super(_WithIndexBase, self).__init__(evaluator, parent_context, name) + self._index_context = index_context + self._context_of_index = context_of_index + + def __repr__(self): + return '<%s: %s[%s]>' % ( + self.__class__.__name__, + self._tree_name.value, + self._index_context, + ) + + +class TypingContextWithIndex(_WithIndexBase): + def execute_annotation(self): + string_name = self._tree_name.value + + if string_name == 'Union': + # This is kind of a special case, because we have Unions (in Jedi + # ContextSets). + return self.gather_annotation_classes().execute_annotation() + elif string_name == 'Optional': + # Optional is basically just saying it's either None or the actual + # type. + return self.gather_annotation_classes().execute_annotation() \ + | ContextSet([builtin_from_name(self.evaluator, u'None')]) + elif string_name == 'Type': + # The type is actually already given in the index_context + return ContextSet([self._index_context]) + elif string_name == 'ClassVar': + # For now don't do anything here, ClassVars are always used. + return self._index_context.execute_annotation() + + cls = globals()[string_name] + return ContextSet([cls( + self.evaluator, + self.parent_context, + self._tree_name, + self._index_context, + self._context_of_index + )]) + + def gather_annotation_classes(self): + return ContextSet.from_sets( + _iter_over_arguments(self._index_context, self._context_of_index) + ) + + +class TypingContext(_BaseTypingContext): + index_class = TypingContextWithIndex + py__simple_getitem__ = None + + def py__getitem__(self, index_context_set, contextualized_node): + return ContextSet( + self.index_class.create_cached( + self.evaluator, + self.parent_context, + self._tree_name, + index_context, + context_of_index=contextualized_node.context) + for index_context in index_context_set + ) + + +class _TypingClassMixin(object): + def py__bases__(self): + return [LazyKnownContexts( + self.evaluator.builtins_module.py__getattribute__('object') + )] + + def get_metaclasses(self): + return [] + + +class TypingClassContextWithIndex(_TypingClassMixin, TypingContextWithIndex, ClassMixin): + pass + + +class TypingClassContext(_TypingClassMixin, TypingContext, ClassMixin): + index_class = TypingClassContextWithIndex + + +def _iter_over_arguments(maybe_tuple_context, defining_context): + def iterate(): + if isinstance(maybe_tuple_context, SequenceLiteralContext): + for lazy_context in maybe_tuple_context.py__iter__(contextualized_node=None): + yield lazy_context.infer() + else: + yield ContextSet([maybe_tuple_context]) + + def resolve_forward_references(context_set): + for context in context_set: + if is_string(context): + from jedi.evaluate.gradual.annotation import _get_forward_reference_node + node = _get_forward_reference_node(defining_context, context.get_safe_value()) + if node is not None: + for c in defining_context.eval_node(node): + yield c + else: + yield context + + for context_set in iterate(): + yield ContextSet(resolve_forward_references(context_set)) + + +class TypeAlias(LazyContextWrapper): + def __init__(self, parent_context, origin_tree_name, actual): + self.evaluator = parent_context.evaluator + self.parent_context = parent_context + self._origin_tree_name = origin_tree_name + self._actual = actual # e.g. builtins.list + + @property + def name(self): + return ContextName(self, self._origin_tree_name) + + def py__name__(self): + return self.name.string_name + + def __repr__(self): + return '<%s: %s>' % (self.__class__.__name__, self._actual) + + def _get_wrapped_context(self): + module_name, class_name = self._actual.split('.') + if self.evaluator.environment.version_info.major == 2 and module_name == 'builtins': + module_name = '__builtin__' + + # TODO use evaluator.import_module? + from jedi.evaluate.imports import Importer + module, = Importer( + self.evaluator, [module_name], self.evaluator.builtins_module + ).follow() + classes = module.py__getattribute__(class_name) + # There should only be one, because it's code that we control. + assert len(classes) == 1, classes + cls = next(iter(classes)) + return cls + + +class _ContainerBase(_WithIndexBase): + def _get_getitem_contexts(self, index): + args = _iter_over_arguments(self._index_context, self._context_of_index) + for i, contexts in enumerate(args): + if i == index: + return contexts + + debug.warning('No param #%s found for annotation %s', index, self._index_context) + return NO_CONTEXTS + + +class Callable(_ContainerBase): + def py__call__(self, arguments): + # The 0th index are the arguments. + return self._get_getitem_contexts(1).execute_annotation() + + +class Tuple(_ContainerBase): + def _is_homogenous(self): + # To specify a variable-length tuple of homogeneous type, Tuple[T, ...] + # is used. + if isinstance(self._index_context, SequenceLiteralContext): + entries = self._index_context.get_tree_entries() + if len(entries) == 2 and entries[1] == '...': + return True + return False + + def py__simple_getitem__(self, index): + if self._is_homogenous(): + return self._get_getitem_contexts(0).execute_annotation() + else: + if isinstance(index, int): + return self._get_getitem_contexts(index).execute_annotation() + + debug.dbg('The getitem type on Tuple was %s' % index) + return NO_CONTEXTS + + def py__iter__(self, contextualized_node=None): + if self._is_homogenous(): + yield LazyKnownContexts(self._get_getitem_contexts(0).execute_annotation()) + else: + if isinstance(self._index_context, SequenceLiteralContext): + for i in range(self._index_context.py__len__()): + yield LazyKnownContexts(self._get_getitem_contexts(i).execute_annotation()) + + def py__getitem__(self, index_context_set, contextualized_node): + if self._is_homogenous(): + return self._get_getitem_contexts(0).execute_annotation() + + return ContextSet.from_sets( + _iter_over_arguments(self._index_context, self._context_of_index) + ).execute_annotation() + + +class Generic(_ContainerBase): + pass + + +class Protocol(_ContainerBase): + pass + + +class Any(_BaseTypingContext): + def execute_annotation(self): + debug.warning('Used Any - returned no results') + return NO_CONTEXTS + + +class TypeVarClass(_BaseTypingContext): + def py__call__(self, arguments): + unpacked = arguments.unpack() + + key, lazy_context = next(unpacked, (None, None)) + var_name = self._find_string_name(lazy_context) + # The name must be given, otherwise it's useless. + if var_name is None or key is not None: + debug.warning('Found a variable without a name %s', arguments) + return NO_CONTEXTS + + return ContextSet([TypeVar.create_cached( + self.evaluator, + self.parent_context, + self._tree_name, + var_name, + unpacked + )]) + + def _find_string_name(self, lazy_context): + if lazy_context is None: + return None + + context_set = lazy_context.infer() + if not context_set: + return None + if len(context_set) > 1: + debug.warning('Found multiple contexts for a type variable: %s', context_set) + + name_context = next(iter(context_set)) + try: + method = name_context.get_safe_value + except AttributeError: + return None + else: + safe_value = method(default=None) + if self.evaluator.environment.version_info.major == 2: + if isinstance(safe_value, bytes): + return force_unicode(safe_value) + if isinstance(safe_value, (str, unicode)): + return safe_value + return None + + +class TypeVar(_BaseTypingContext): + def __init__(self, evaluator, parent_context, tree_name, var_name, unpacked_args): + super(TypeVar, self).__init__(evaluator, parent_context, tree_name) + self._var_name = var_name + + self._constraints_lazy_contexts = [] + self._bound_lazy_context = None + self._covariant_lazy_context = None + self._contravariant_lazy_context = None + for key, lazy_context in unpacked_args: + if key is None: + self._constraints_lazy_contexts.append(lazy_context) + else: + if key == 'bound': + self._bound_lazy_context = lazy_context + elif key == 'covariant': + self._covariant_lazy_context = lazy_context + elif key == 'contravariant': + self._contra_variant_lazy_context = lazy_context + else: + debug.warning('Invalid TypeVar param name %s', key) + + def py__name__(self): + return self._var_name + + def get_filters(self, *args, **kwargs): + return iter([]) + + def _get_classes(self): + if self._bound_lazy_context is not None: + return self._bound_lazy_context.infer() + if self._constraints_lazy_contexts: + return self.constraints + debug.warning('Tried to infer the TypeVar %s without a given type', self._var_name) + return NO_CONTEXTS + + def is_same_class(self, other): + # Everything can match an undefined type var. + return True + + @property + def constraints(self): + return ContextSet.from_sets( + lazy.infer() for lazy in self._constraints_lazy_contexts + ) + + def define_generics(self, type_var_dict): + try: + found = type_var_dict[self.py__name__()] + except KeyError: + pass + else: + if found: + return found + return self._get_classes() or ContextSet({self}) + + def execute_annotation(self): + return self._get_classes().execute_annotation() + + def __repr__(self): + return '<%s: %s>' % (self.__class__.__name__, self.py__name__()) + + +class OverloadFunction(_BaseTypingContext): + @repack_with_argument_clinic('func, /') + def py__call__(self, func_context_set): + # Just pass arguments through. + return func_context_set + + +class NewTypeFunction(_BaseTypingContext): + def py__call__(self, arguments): + ordered_args = arguments.unpack() + next(ordered_args, (None, None)) + _, second_arg = next(ordered_args, (None, None)) + if second_arg is None: + return NO_CONTEXTS + return ContextSet( + NewType( + self.evaluator, + contextualized_node.context, + contextualized_node.node, + second_arg.infer(), + ) for contextualized_node in arguments.get_calling_nodes()) + + +class NewType(Context): + def __init__(self, evaluator, parent_context, tree_node, type_context_set): + super(NewType, self).__init__(evaluator, parent_context) + self._type_context_set = type_context_set + self.tree_node = tree_node + + def py__call__(self, arguments): + return self._type_context_set.execute_annotation() + + +class CastFunction(_BaseTypingContext): + @repack_with_argument_clinic('type, object, /') + def py__call__(self, type_context_set, object_context_set): + return type_context_set.execute_annotation() + + +class BoundTypeVarName(AbstractNameDefinition): + """ + This type var was bound to a certain type, e.g. int. + """ + def __init__(self, type_var, context_set): + self._type_var = type_var + self.parent_context = type_var.parent_context + self._context_set = context_set + + def infer(self): + def iter_(): + for context in self._context_set: + # Replace any with the constraints if they are there. + if isinstance(context, Any): + for constraint in self._type_var.constraints: + yield constraint + else: + yield context + return ContextSet(iter_()) + + def py__name__(self): + return self._type_var.py__name__() + + def __repr__(self): + return '<%s %s -> %s>' % (self.__class__.__name__, self.py__name__(), self._context_set) + + +class TypeVarFilter(object): + """ + A filter for all given variables in a class. + + A = TypeVar('A') + B = TypeVar('B') + class Foo(Mapping[A, B]): + ... + + In this example we would have two type vars given: A and B + """ + def __init__(self, generics, type_vars): + self._generics = generics + self._type_vars = type_vars + + def get(self, name): + for i, type_var in enumerate(self._type_vars): + if type_var.py__name__() == name: + try: + return [BoundTypeVarName(type_var, self._generics[i])] + except IndexError: + return [type_var.name] + return [] + + def values(self): + # The values are not relevant. If it's not searched exactly, the type + # vars are just global and should be looked up as that. + return [] + + +class AbstractAnnotatedClass(ClassMixin, ContextWrapper): + def get_type_var_filter(self): + return TypeVarFilter(self.get_generics(), self.list_type_vars()) + + def get_filters(self, search_global=False, *args, **kwargs): + filters = super(AbstractAnnotatedClass, self).get_filters( + search_global, + *args, **kwargs + ) + for f in filters: + yield f + + if search_global: + # The type vars can only be looked up if it's a global search and + # not a direct lookup on the class. + yield self.get_type_var_filter() + + def is_same_class(self, other): + if not isinstance(other, AbstractAnnotatedClass): + return False + + if self.tree_node != other.tree_node: + # TODO not sure if this is nice. + return False + given_params1 = self.get_generics() + given_params2 = other.get_generics() + + if len(given_params1) != len(given_params2): + # If the amount of type vars doesn't match, the class doesn't + # match. + return False + + # Now compare generics + return all( + any( + # TODO why is this ordering the correct one? + cls2.is_same_class(cls1) + for cls1 in class_set1 + for cls2 in class_set2 + ) for class_set1, class_set2 in zip(given_params1, given_params2) + ) + + def py__call__(self, arguments): + instance, = super(AbstractAnnotatedClass, self).py__call__(arguments) + return ContextSet([InstanceWrapper(instance)]) + + def get_generics(self): + raise NotImplementedError + + def define_generics(self, type_var_dict): + changed = False + new_generics = [] + for generic_set in self.get_generics(): + contexts = NO_CONTEXTS + for generic in generic_set: + if isinstance(generic, (AbstractAnnotatedClass, TypeVar)): + result = generic.define_generics(type_var_dict) + contexts |= result + if result != ContextSet({generic}): + changed = True + else: + contexts |= ContextSet([generic]) + new_generics.append(contexts) + + if not changed: + # There might not be any type vars that change. In that case just + # return itself, because it does not make sense to potentially lose + # cached results. + return ContextSet([self]) + + return ContextSet([GenericClass( + self._wrapped_context, + generics=tuple(new_generics) + )]) + + def __repr__(self): + return '<%s: %s%s>' % ( + self.__class__.__name__, + self._wrapped_context, + list(self.get_generics()), + ) + + @to_list + def py__bases__(self): + for base in self._wrapped_context.py__bases__(): + yield LazyAnnotatedBaseClass(self, base) + + +class LazyGenericClass(AbstractAnnotatedClass): + def __init__(self, class_context, index_context, context_of_index): + super(LazyGenericClass, self).__init__(class_context) + self._index_context = index_context + self._context_of_index = context_of_index + + @evaluator_method_cache() + def get_generics(self): + return list(_iter_over_arguments(self._index_context, self._context_of_index)) + + +class GenericClass(AbstractAnnotatedClass): + def __init__(self, class_context, generics): + super(GenericClass, self).__init__(class_context) + self._generics = generics + + def get_generics(self): + return self._generics + + +class LazyAnnotatedBaseClass(object): + def __init__(self, class_context, lazy_base_class): + self._class_context = class_context + self._lazy_base_class = lazy_base_class + + @iterator_to_context_set + def infer(self): + for base in self._lazy_base_class.infer(): + if isinstance(base, AbstractAnnotatedClass): + # Here we have to recalculate the given types. + yield GenericClass.create_cached( + base.evaluator, + base._wrapped_context, + tuple(self._remap_type_vars(base)), + ) + else: + yield base + + def _remap_type_vars(self, base): + filter = self._class_context.get_type_var_filter() + for type_var_set in base.get_generics(): + new = NO_CONTEXTS + for type_var in type_var_set: + if isinstance(type_var, TypeVar): + names = filter.get(type_var.py__name__()) + new |= ContextSet.from_sets( + name.infer() for name in names + ) + else: + # Mostly will be type vars, except if in some cases + # a concrete type will already be there. In that + # case just add it to the context set. + new |= ContextSet([type_var]) + yield new + + +class InstanceWrapper(ContextWrapper): + def py__stop_iteration_returns(self): + for cls in self._wrapped_context.class_context.py__mro__(): + if cls.py__name__() == 'Generator': + generics = cls.get_generics() + try: + return generics[2].execute_annotation() + except IndexError: + pass + elif cls.py__name__() == 'Iterator': + return ContextSet([builtin_from_name(self.evaluator, u'None')]) + return self._wrapped_context.py__stop_iteration_returns() diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/gradual/utils.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/gradual/utils.py new file mode 100644 index 0000000..6bc60e6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/gradual/utils.py @@ -0,0 +1,32 @@ +import os + +from jedi.evaluate.gradual.typeshed import TYPESHED_PATH, create_stub_module + + +def load_proper_stub_module(evaluator, file_io, import_names, module_node): + """ + This function is given a random .pyi file and should return the proper + module. + """ + path = file_io.path + assert path.endswith('.pyi') + if path.startswith(TYPESHED_PATH): + # /foo/stdlib/3/os/__init__.pyi -> stdlib/3/os/__init__ + rest = path[len(TYPESHED_PATH) + 1: -4] + split_paths = tuple(rest.split(os.path.sep)) + # Remove the stdlib/3 or third_party/3.5 part + import_names = split_paths[2:] + if import_names[-1] == '__init__': + import_names = import_names[:-1] + + if import_names is not None: + actual_context_set = evaluator.import_module(import_names, prefer_stubs=False) + if not actual_context_set: + return None + + stub = create_stub_module( + evaluator, actual_context_set, module_node, file_io, import_names + ) + evaluator.stub_module_cache[import_names] = stub + return stub + return None diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/helpers.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/helpers.py new file mode 100644 index 0000000..78d2a7f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/helpers.py @@ -0,0 +1,269 @@ +import copy +import sys +import re +import os +from itertools import chain +from contextlib import contextmanager + +from parso.python import tree + +from jedi._compatibility import unicode +from jedi.parser_utils import get_parent_scope + + +def is_stdlib_path(path): + # Python standard library paths look like this: + # /usr/lib/python3.5/... + # TODO The implementation below is probably incorrect and not complete. + if 'dist-packages' in path or 'site-packages' in path: + return False + + base_path = os.path.join(sys.prefix, 'lib', 'python') + return bool(re.match(re.escape(base_path) + r'\d.\d', path)) + + +def deep_ast_copy(obj): + """ + Much, much faster than copy.deepcopy, but just for parser tree nodes. + """ + # If it's already in the cache, just return it. + new_obj = copy.copy(obj) + + # Copy children + new_children = [] + for child in obj.children: + if isinstance(child, tree.Leaf): + new_child = copy.copy(child) + new_child.parent = new_obj + else: + new_child = deep_ast_copy(child) + new_child.parent = new_obj + new_children.append(new_child) + new_obj.children = new_children + + return new_obj + + +def evaluate_call_of_leaf(context, leaf, cut_own_trailer=False): + """ + Creates a "call" node that consist of all ``trailer`` and ``power`` + objects. E.g. if you call it with ``append``:: + + list([]).append(3) or None + + You would get a node with the content ``list([]).append`` back. + + This generates a copy of the original ast node. + + If you're using the leaf, e.g. the bracket `)` it will return ``list([])``. + + We use this function for two purposes. Given an expression ``bar.foo``, + we may want to + - infer the type of ``foo`` to offer completions after foo + - infer the type of ``bar`` to be able to jump to the definition of foo + The option ``cut_own_trailer`` must be set to true for the second purpose. + """ + trailer = leaf.parent + if trailer.type == 'fstring': + from jedi.evaluate import compiled + return compiled.get_string_context_set(context.evaluator) + + # The leaf may not be the last or first child, because there exist three + # different trailers: `( x )`, `[ x ]` and `.x`. In the first two examples + # we should not match anything more than x. + if trailer.type != 'trailer' or leaf not in (trailer.children[0], trailer.children[-1]): + if trailer.type == 'atom': + return context.eval_node(trailer) + return context.eval_node(leaf) + + power = trailer.parent + index = power.children.index(trailer) + if cut_own_trailer: + cut = index + else: + cut = index + 1 + + if power.type == 'error_node': + start = index + while True: + start -= 1 + base = power.children[start] + if base.type != 'trailer': + break + trailers = power.children[start + 1: index + 1] + else: + base = power.children[0] + trailers = power.children[1:cut] + + if base == 'await': + base = trailers[0] + trailers = trailers[1:] + + values = context.eval_node(base) + from jedi.evaluate.syntax_tree import eval_trailer + for trailer in trailers: + values = eval_trailer(context, values, trailer) + return values + + +def call_of_leaf(leaf): + """ + Creates a "call" node that consist of all ``trailer`` and ``power`` + objects. E.g. if you call it with ``append``:: + + list([]).append(3) or None + + You would get a node with the content ``list([]).append`` back. + + This generates a copy of the original ast node. + + If you're using the leaf, e.g. the bracket `)` it will return ``list([])``. + """ + # TODO this is the old version of this call. Try to remove it. + trailer = leaf.parent + # The leaf may not be the last or first child, because there exist three + # different trailers: `( x )`, `[ x ]` and `.x`. In the first two examples + # we should not match anything more than x. + if trailer.type != 'trailer' or leaf not in (trailer.children[0], trailer.children[-1]): + if trailer.type == 'atom': + return trailer + return leaf + + power = trailer.parent + index = power.children.index(trailer) + + new_power = copy.copy(power) + new_power.children = list(new_power.children) + new_power.children[index + 1:] = [] + + if power.type == 'error_node': + start = index + while True: + start -= 1 + if power.children[start].type != 'trailer': + break + transformed = tree.Node('power', power.children[start:]) + transformed.parent = power.parent + return transformed + + return power + + +def get_names_of_node(node): + try: + children = node.children + except AttributeError: + if node.type == 'name': + return [node] + else: + return [] + else: + return list(chain.from_iterable(get_names_of_node(c) for c in children)) + + +def get_module_names(module, all_scopes): + """ + Returns a dictionary with name parts as keys and their call paths as + values. + """ + names = list(chain.from_iterable(module.get_used_names().values())) + if not all_scopes: + # We have to filter all the names that don't have the module as a + # parent_scope. There's None as a parent, because nodes in the module + # node have the parent module and not suite as all the others. + # Therefore it's important to catch that case. + + def is_module_scope_name(name): + parent_scope = get_parent_scope(name) + # async functions have an extra wrapper. Strip it. + if parent_scope and parent_scope.type == 'async_stmt': + parent_scope = parent_scope.parent + return parent_scope in (module, None) + + names = [n for n in names if is_module_scope_name(n)] + return names + + +@contextmanager +def predefine_names(context, flow_scope, dct): + predefined = context.predefined_names + predefined[flow_scope] = dct + try: + yield + finally: + del predefined[flow_scope] + + +def is_string(context): + if context.evaluator.environment.version_info.major == 2: + str_classes = (unicode, bytes) + else: + str_classes = (unicode,) + return context.is_compiled() and isinstance(context.get_safe_value(default=None), str_classes) + + +def is_literal(context): + return is_number(context) or is_string(context) + + +def _get_safe_value_or_none(context, accept): + value = context.get_safe_value(default=None) + if isinstance(value, accept): + return value + + +def get_int_or_none(context): + return _get_safe_value_or_none(context, int) + + +def get_str_or_none(context): + return _get_safe_value_or_none(context, (bytes, unicode)) + + +def is_number(context): + return _get_safe_value_or_none(context, (int, float)) is not None + + +class SimpleGetItemNotFound(Exception): + pass + + +@contextmanager +def reraise_getitem_errors(*exception_classes): + try: + yield + except exception_classes as e: + raise SimpleGetItemNotFound(e) + + +def parse_dotted_names(nodes, is_import_from, until_node=None): + level = 0 + names = [] + for node in nodes[1:]: + if node in ('.', '...'): + if not names: + level += len(node.value) + elif node.type == 'dotted_name': + for n in node.children[::2]: + names.append(n) + if n is until_node: + break + else: + continue + break + elif node.type == 'name': + names.append(node) + if node is until_node: + break + elif node == ',': + if not is_import_from: + names = [] + else: + # Here if the keyword `import` comes along it stops checking + # for names. + break + return level, names + + +def contexts_from_qualified_names(evaluator, *names): + return evaluator.import_module(names[:-1]).py__getattribute__(names[-1]) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/imports.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/imports.py new file mode 100644 index 0000000..f7ec8c3 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/imports.py @@ -0,0 +1,568 @@ +""" +:mod:`jedi.evaluate.imports` is here to resolve import statements and return +the modules/classes/functions/whatever, which they stand for. However there's +not any actual importing done. This module is about finding modules in the +filesystem. This can be quite tricky sometimes, because Python imports are not +always that simple. + +This module uses imp for python up to 3.2 and importlib for python 3.3 on; the +correct implementation is delegated to _compatibility. + +This module also supports import autocompletion, which means to complete +statements like ``from datetim`` (cursor at the end would return ``datetime``). +""" +import os + +from parso.python import tree +from parso.tree import search_ancestor +from parso import python_bytes_to_unicode + +from jedi._compatibility import (FileNotFoundError, ImplicitNSInfo, + force_unicode, unicode) +from jedi import debug +from jedi import settings +from jedi.file_io import KnownContentFileIO, FileIO +from jedi.parser_utils import get_cached_code_lines +from jedi.evaluate import sys_path +from jedi.evaluate import helpers +from jedi.evaluate import compiled +from jedi.evaluate import analysis +from jedi.evaluate.utils import unite +from jedi.evaluate.cache import evaluator_method_cache +from jedi.evaluate.names import ImportName, SubModuleName +from jedi.evaluate.base_context import ContextSet, NO_CONTEXTS +from jedi.evaluate.gradual.typeshed import import_module_decorator +from jedi.evaluate.context.module import iter_module_names +from jedi.plugins import plugin_manager + + +class ModuleCache(object): + def __init__(self): + self._path_cache = {} + self._name_cache = {} + + def add(self, string_names, context_set): + #path = module.py__file__() + #self._path_cache[path] = context_set + if string_names is not None: + self._name_cache[string_names] = context_set + + def get(self, string_names): + return self._name_cache[string_names] + + def get_from_path(self, path): + return self._path_cache[path] + + +# This memoization is needed, because otherwise we will infinitely loop on +# certain imports. +@evaluator_method_cache(default=NO_CONTEXTS) +def infer_import(context, tree_name, is_goto=False): + module_context = context.get_root_context() + import_node = search_ancestor(tree_name, 'import_name', 'import_from') + import_path = import_node.get_path_for_name(tree_name) + from_import_name = None + evaluator = context.evaluator + try: + from_names = import_node.get_from_names() + except AttributeError: + # Is an import_name + pass + else: + if len(from_names) + 1 == len(import_path): + # We have to fetch the from_names part first and then check + # if from_names exists in the modules. + from_import_name = import_path[-1] + import_path = from_names + + importer = Importer(evaluator, tuple(import_path), + module_context, import_node.level) + + types = importer.follow() + + #if import_node.is_nested() and not self.nested_resolve: + # scopes = [NestedImportModule(module, import_node)] + + if not types: + return NO_CONTEXTS + + if from_import_name is not None: + types = unite( + t.py__getattribute__( + from_import_name, + name_context=context, + is_goto=is_goto, + analysis_errors=False + ) + for t in types + ) + if not is_goto: + types = ContextSet(types) + + if not types: + path = import_path + [from_import_name] + importer = Importer(evaluator, tuple(path), + module_context, import_node.level) + types = importer.follow() + # goto only accepts `Name` + if is_goto: + types = set(s.name for s in types) + else: + # goto only accepts `Name` + if is_goto: + types = set(s.name for s in types) + + debug.dbg('after import: %s', types) + return types + + +class NestedImportModule(tree.Module): + """ + TODO while there's no use case for nested import module right now, we might + be able to use them for static analysis checks later on. + """ + def __init__(self, module, nested_import): + self._module = module + self._nested_import = nested_import + + def _get_nested_import_name(self): + """ + Generates an Import statement, that can be used to fake nested imports. + """ + i = self._nested_import + # This is not an existing Import statement. Therefore, set position to + # 0 (0 is not a valid line number). + zero = (0, 0) + names = [unicode(name) for name in i.namespace_names[1:]] + name = helpers.FakeName(names, self._nested_import) + new = tree.Import(i._sub_module, zero, zero, name) + new.parent = self._module + debug.dbg('Generated a nested import: %s', new) + return helpers.FakeName(str(i.namespace_names[1]), new) + + def __getattr__(self, name): + return getattr(self._module, name) + + def __repr__(self): + return "<%s: %s of %s>" % (self.__class__.__name__, self._module, + self._nested_import) + + +def _add_error(context, name, message): + if hasattr(name, 'parent') and context is not None: + analysis.add(context, 'import-error', name, message) + else: + debug.warning('ImportError without origin: ' + message) + + +def _level_to_base_import_path(project_path, directory, level): + """ + In case the level is outside of the currently known package (something like + import .....foo), we can still try our best to help the user for + completions. + """ + for i in range(level - 1): + old = directory + directory = os.path.dirname(directory) + if old == directory: + return None, None + + d = directory + level_import_paths = [] + # Now that we are on the level that the user wants to be, calculate the + # import path for it. + while True: + if d == project_path: + return level_import_paths, d + dir_name = os.path.basename(d) + if dir_name: + level_import_paths.insert(0, dir_name) + d = os.path.dirname(d) + else: + return None, directory + + +class Importer(object): + def __init__(self, evaluator, import_path, module_context, level=0): + """ + An implementation similar to ``__import__``. Use `follow` + to actually follow the imports. + + *level* specifies whether to use absolute or relative imports. 0 (the + default) means only perform absolute imports. Positive values for level + indicate the number of parent directories to search relative to the + directory of the module calling ``__import__()`` (see PEP 328 for the + details). + + :param import_path: List of namespaces (strings or Names). + """ + debug.speed('import %s %s' % (import_path, module_context)) + self._evaluator = evaluator + self.level = level + self.module_context = module_context + + self._fixed_sys_path = None + self._inference_possible = True + if level: + base = module_context.py__package__() + # We need to care for two cases, the first one is if it's a valid + # Python import. This import has a properly defined module name + # chain like `foo.bar.baz` and an import in baz is made for + # `..lala.` It can then resolve to `foo.bar.lala`. + # The else here is a heuristic for all other cases, if for example + # in `foo` you search for `...bar`, it's obviously out of scope. + # However since Jedi tries to just do it's best, we help the user + # here, because he might have specified something wrong in his + # project. + if level <= len(base): + # Here we basically rewrite the level to 0. + base = tuple(base) + if level > 1: + base = base[:-level + 1] + import_path = base + tuple(import_path) + else: + path = module_context.py__file__() + import_path = list(import_path) + if path is None: + # If no path is defined, our best guess is that the current + # file is edited by a user on the current working + # directory. We need to add an initial path, because it + # will get removed as the name of the current file. + directory = os.getcwd() + else: + directory = os.path.dirname(path) + + base_import_path, base_directory = _level_to_base_import_path( + self._evaluator.project._path, directory, level, + ) + if base_directory is None: + # Everything is lost, the relative import does point + # somewhere out of the filesystem. + self._inference_possible = False + else: + self._fixed_sys_path = [force_unicode(base_directory)] + + if base_import_path is None: + if import_path: + _add_error( + module_context, import_path[0], + message='Attempted relative import beyond top-level package.' + ) + else: + import_path = base_import_path + import_path + self.import_path = import_path + + @property + def _str_import_path(self): + """Returns the import path as pure strings instead of `Name`.""" + return tuple( + name.value if isinstance(name, tree.Name) else name + for name in self.import_path + ) + + def _sys_path_with_modifications(self): + if self._fixed_sys_path is not None: + return self._fixed_sys_path + + sys_path_mod = ( + self._evaluator.get_sys_path() + + sys_path.check_sys_path_modifications(self.module_context) + ) + + if self._evaluator.environment.version_info.major == 2: + file_path = self.module_context.py__file__() + if file_path is not None: + # Python2 uses an old strange way of importing relative imports. + sys_path_mod.append(force_unicode(os.path.dirname(file_path))) + + return sys_path_mod + + def follow(self): + if not self.import_path or not self._inference_possible: + return NO_CONTEXTS + + import_names = tuple( + force_unicode(i.value if isinstance(i, tree.Name) else i) + for i in self.import_path + ) + sys_path = self._sys_path_with_modifications() + + context_set = [None] + for i, name in enumerate(self.import_path): + context_set = ContextSet.from_sets([ + self._evaluator.import_module( + import_names[:i+1], + parent_module_context, + sys_path + ) for parent_module_context in context_set + ]) + if not context_set: + message = 'No module named ' + '.'.join(import_names) + _add_error(self.module_context, name, message) + return NO_CONTEXTS + return context_set + + def _get_module_names(self, search_path=None, in_module=None): + """ + Get the names of all modules in the search_path. This means file names + and not names defined in the files. + """ + names = [] + # add builtin module names + if search_path is None and in_module is None: + names += [ImportName(self.module_context, name) + for name in self._evaluator.compiled_subprocess.get_builtin_module_names()] + + if search_path is None: + search_path = self._sys_path_with_modifications() + + for name in iter_module_names(self._evaluator, search_path): + if in_module is None: + n = ImportName(self.module_context, name) + else: + n = SubModuleName(in_module, name) + names.append(n) + return names + + def completion_names(self, evaluator, only_modules=False): + """ + :param only_modules: Indicates wheter it's possible to import a + definition that is not defined in a module. + """ + if not self._inference_possible: + return [] + + names = [] + if self.import_path: + # flask + if self._str_import_path == ('flask', 'ext'): + # List Flask extensions like ``flask_foo`` + for mod in self._get_module_names(): + modname = mod.string_name + if modname.startswith('flask_'): + extname = modname[len('flask_'):] + names.append(ImportName(self.module_context, extname)) + # Now the old style: ``flaskext.foo`` + for dir in self._sys_path_with_modifications(): + flaskext = os.path.join(dir, 'flaskext') + if os.path.isdir(flaskext): + names += self._get_module_names([flaskext]) + + contexts = self.follow() + for context in contexts: + # Non-modules are not completable. + if context.api_type != 'module': # not a module + continue + names += context.sub_modules_dict().values() + + if not only_modules: + from jedi.evaluate.gradual.conversion import convert_contexts + + both_contexts = contexts | convert_contexts(contexts) + for c in both_contexts: + for filter in c.get_filters(search_global=False): + names += filter.values() + else: + if self.level: + # We only get here if the level cannot be properly calculated. + names += self._get_module_names(self._fixed_sys_path) + else: + # This is just the list of global imports. + names += self._get_module_names() + return names + + +@plugin_manager.decorate() +@import_module_decorator +def import_module(evaluator, import_names, parent_module_context, sys_path): + """ + This method is very similar to importlib's `_gcd_import`. + """ + if import_names[0] in settings.auto_import_modules: + module = _load_builtin_module(evaluator, import_names, sys_path) + if module is None: + return NO_CONTEXTS + return ContextSet([module]) + + module_name = '.'.join(import_names) + if parent_module_context is None: + # Override the sys.path. It works only good that way. + # Injecting the path directly into `find_module` did not work. + file_io_or_ns, is_pkg = evaluator.compiled_subprocess.get_module_info( + string=import_names[-1], + full_name=module_name, + sys_path=sys_path, + is_global_search=True, + ) + if is_pkg is None: + return NO_CONTEXTS + else: + try: + method = parent_module_context.py__path__ + except AttributeError: + # The module is not a package. + return NO_CONTEXTS + else: + paths = method() + for path in paths: + # At the moment we are only using one path. So this is + # not important to be correct. + if not isinstance(path, list): + path = [path] + file_io_or_ns, is_pkg = evaluator.compiled_subprocess.get_module_info( + string=import_names[-1], + path=path, + full_name=module_name, + is_global_search=False, + ) + if is_pkg is not None: + break + else: + return NO_CONTEXTS + + if isinstance(file_io_or_ns, ImplicitNSInfo): + from jedi.evaluate.context.namespace import ImplicitNamespaceContext + module = ImplicitNamespaceContext( + evaluator, + fullname=file_io_or_ns.name, + paths=file_io_or_ns.paths, + ) + elif file_io_or_ns is None: + module = _load_builtin_module(evaluator, import_names, sys_path) + if module is None: + return NO_CONTEXTS + else: + module = _load_python_module( + evaluator, file_io_or_ns, sys_path, + import_names=import_names, + is_package=is_pkg, + ) + + if parent_module_context is None: + debug.dbg('global search_module %s: %s', import_names[-1], module) + else: + debug.dbg('search_module %s in paths %s: %s', module_name, paths, module) + return ContextSet([module]) + + +def _load_python_module(evaluator, file_io, sys_path=None, + import_names=None, is_package=False): + try: + return evaluator.module_cache.get_from_path(file_io.path) + except KeyError: + pass + + module_node = evaluator.parse( + file_io=file_io, + cache=True, + diff_cache=settings.fast_parser, + cache_path=settings.cache_directory + ) + + from jedi.evaluate.context import ModuleContext + return ModuleContext( + evaluator, module_node, + file_io=file_io, + string_names=import_names, + code_lines=get_cached_code_lines(evaluator.grammar, file_io.path), + is_package=is_package, + ) + + +def _load_builtin_module(evaluator, import_names=None, sys_path=None): + if sys_path is None: + sys_path = evaluator.get_sys_path() + + dotted_name = '.'.join(import_names) + assert dotted_name is not None + module = compiled.load_module(evaluator, dotted_name=dotted_name, sys_path=sys_path) + if module is None: + # The file might raise an ImportError e.g. and therefore not be + # importable. + return None + return module + + +def _load_module_from_path(evaluator, file_io, base_names): + """ + This should pretty much only be used for get_modules_containing_name. It's + here to ensure that a random path is still properly loaded into the Jedi + module structure. + """ + e_sys_path = evaluator.get_sys_path() + path = file_io.path + if base_names: + module_name = os.path.basename(path) + module_name = sys_path.remove_python_path_suffix(module_name) + is_package = module_name == '__init__' + if is_package: + import_names = base_names + else: + import_names = base_names + (module_name,) + else: + import_names, is_package = sys_path.transform_path_to_dotted(e_sys_path, path) + + module = _load_python_module( + evaluator, file_io, + sys_path=e_sys_path, + import_names=import_names, + is_package=is_package, + ) + evaluator.module_cache.add(import_names, ContextSet([module])) + return module + + +def get_modules_containing_name(evaluator, modules, name): + """ + Search a name in the directories of modules. + """ + def check_directory(folder_io): + for file_name in folder_io.list(): + if file_name.endswith('.py'): + yield folder_io.get_file_io(file_name) + + def check_fs(file_io, base_names): + try: + code = file_io.read() + except FileNotFoundError: + return None + code = python_bytes_to_unicode(code, errors='replace') + if name not in code: + return None + new_file_io = KnownContentFileIO(file_io.path, code) + m = _load_module_from_path(evaluator, new_file_io, base_names) + if isinstance(m, compiled.CompiledObject): + return None + return m + + # skip non python modules + used_mod_paths = set() + folders_with_names_to_be_checked = [] + for m in modules: + if m.file_io is not None: + path = m.file_io.path + if path not in used_mod_paths: + used_mod_paths.add(path) + folders_with_names_to_be_checked.append(( + m.file_io.get_parent_folder(), + m.py__package__() + )) + yield m + + if not settings.dynamic_params_for_other_modules: + return + + def get_file_ios_to_check(): + for folder_io, base_names in folders_with_names_to_be_checked: + for file_io in check_directory(folder_io): + yield file_io, base_names + + for p in settings.additional_dynamic_modules: + p = os.path.abspath(p) + if p not in used_mod_paths: + yield FileIO(p), None + + for file_io, base_names in get_file_ios_to_check(): + m = check_fs(file_io, base_names) + if m is not None: + yield m diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/lazy_context.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/lazy_context.py new file mode 100644 index 0000000..0501d3b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/lazy_context.py @@ -0,0 +1,59 @@ +from jedi.evaluate.base_context import ContextSet, NO_CONTEXTS +from jedi.common.utils import monkeypatch + + +class AbstractLazyContext(object): + def __init__(self, data): + self.data = data + + def __repr__(self): + return '<%s: %s>' % (self.__class__.__name__, self.data) + + def infer(self): + raise NotImplementedError + + +class LazyKnownContext(AbstractLazyContext): + """data is a context.""" + def infer(self): + return ContextSet([self.data]) + + +class LazyKnownContexts(AbstractLazyContext): + """data is a ContextSet.""" + def infer(self): + return self.data + + +class LazyUnknownContext(AbstractLazyContext): + def __init__(self): + super(LazyUnknownContext, self).__init__(None) + + def infer(self): + return NO_CONTEXTS + + +class LazyTreeContext(AbstractLazyContext): + def __init__(self, context, node): + super(LazyTreeContext, self).__init__(node) + self.context = context + # We need to save the predefined names. It's an unfortunate side effect + # that needs to be tracked otherwise results will be wrong. + self._predefined_names = dict(context.predefined_names) + + def infer(self): + with monkeypatch(self.context, 'predefined_names', self._predefined_names): + return self.context.eval_node(self.data) + + +def get_merged_lazy_context(lazy_contexts): + if len(lazy_contexts) > 1: + return MergedLazyContexts(lazy_contexts) + else: + return lazy_contexts[0] + + +class MergedLazyContexts(AbstractLazyContext): + """data is a list of lazy contexts.""" + def infer(self): + return ContextSet.from_sets(l.infer() for l in self.data) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/names.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/names.py new file mode 100644 index 0000000..b1c2d40 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/names.py @@ -0,0 +1,375 @@ +from abc import abstractmethod + +from parso.tree import search_ancestor + +from jedi._compatibility import Parameter +from jedi.evaluate.base_context import ContextSet, NO_CONTEXTS +from jedi.cache import memoize_method + + +class AbstractNameDefinition(object): + start_pos = None + string_name = None + parent_context = None + tree_name = None + is_context_name = True + """ + Used for the Jedi API to know if it's a keyword or an actual name. + """ + + @abstractmethod + def infer(self): + raise NotImplementedError + + @abstractmethod + def goto(self): + # Typically names are already definitions and therefore a goto on that + # name will always result on itself. + return {self} + + def get_qualified_names(self, include_module_names=False): + qualified_names = self._get_qualified_names() + if qualified_names is None or not include_module_names: + return qualified_names + + module_names = self.get_root_context().string_names + if module_names is None: + return None + return module_names + qualified_names + + def _get_qualified_names(self): + # By default, a name has no qualified names. + return None + + def get_root_context(self): + return self.parent_context.get_root_context() + + def __repr__(self): + if self.start_pos is None: + return '<%s: string_name=%s>' % (self.__class__.__name__, self.string_name) + return '<%s: string_name=%s start_pos=%s>' % (self.__class__.__name__, + self.string_name, self.start_pos) + + def is_import(self): + return False + + @property + def api_type(self): + return self.parent_context.api_type + + +class AbstractArbitraryName(AbstractNameDefinition): + """ + When you e.g. want to complete dicts keys, you probably want to complete + string literals, which is not really a name, but for Jedi we use this + concept of Name for completions as well. + """ + is_context_name = False + + def __init__(self, evaluator, string): + self.evaluator = evaluator + self.string_name = string + self.parent_context = evaluator.builtins_module + + def infer(self): + return NO_CONTEXTS + + +class AbstractTreeName(AbstractNameDefinition): + def __init__(self, parent_context, tree_name): + self.parent_context = parent_context + self.tree_name = tree_name + + def get_qualified_names(self, include_module_names=False): + import_node = search_ancestor(self.tree_name, 'import_name', 'import_from') + # For import nodes we cannot just have names, because it's very unclear + # how they would look like. For now we just ignore them in most cases. + # In case of level == 1, it works always, because it's like a submodule + # lookup. + if import_node is not None and not (import_node.level == 1 + and self.get_root_context().is_package): + # TODO improve the situation for when level is present. + if include_module_names and not import_node.level: + return tuple(n.value for n in import_node.get_path_for_name(self.tree_name)) + else: + return None + + return super(AbstractTreeName, self).get_qualified_names(include_module_names) + + def _get_qualified_names(self): + parent_names = self.parent_context.get_qualified_names() + if parent_names is None: + return None + return parent_names + (self.tree_name.value,) + + def goto(self, **kwargs): + return self.parent_context.evaluator.goto(self.parent_context, self.tree_name, **kwargs) + + def is_import(self): + imp = search_ancestor(self.tree_name, 'import_from', 'import_name') + return imp is not None + + @property + def string_name(self): + return self.tree_name.value + + @property + def start_pos(self): + return self.tree_name.start_pos + + +class ContextNameMixin(object): + def infer(self): + return ContextSet([self._context]) + + def _get_qualified_names(self): + return self._context.get_qualified_names() + + def get_root_context(self): + if self.parent_context is None: # A module + return self._context + return super(ContextNameMixin, self).get_root_context() + + @property + def api_type(self): + return self._context.api_type + + +class ContextName(ContextNameMixin, AbstractTreeName): + def __init__(self, context, tree_name): + super(ContextName, self).__init__(context.parent_context, tree_name) + self._context = context + + def goto(self): + return ContextSet([self._context.name]) + + +class TreeNameDefinition(AbstractTreeName): + _API_TYPES = dict( + import_name='module', + import_from='module', + funcdef='function', + param='param', + classdef='class', + ) + + def infer(self): + # Refactor this, should probably be here. + from jedi.evaluate.syntax_tree import tree_name_to_contexts + parent = self.parent_context + return tree_name_to_contexts(parent.evaluator, parent, self.tree_name) + + @property + def api_type(self): + definition = self.tree_name.get_definition(import_name_always=True) + if definition is None: + return 'statement' + return self._API_TYPES.get(definition.type, 'statement') + + +class _ParamMixin(object): + def maybe_positional_argument(self, include_star=True): + options = [Parameter.POSITIONAL_ONLY, Parameter.POSITIONAL_OR_KEYWORD] + if include_star: + options.append(Parameter.VAR_POSITIONAL) + return self.get_kind() in options + + def maybe_keyword_argument(self, include_stars=True): + options = [Parameter.KEYWORD_ONLY, Parameter.POSITIONAL_OR_KEYWORD] + if include_stars: + options.append(Parameter.VAR_KEYWORD) + return self.get_kind() in options + + def _kind_string(self): + kind = self.get_kind() + if kind == Parameter.VAR_POSITIONAL: # *args + return '*' + if kind == Parameter.VAR_KEYWORD: # **kwargs + return '**' + return '' + + +class ParamNameInterface(_ParamMixin): + api_type = u'param' + + def get_kind(self): + raise NotImplementedError + + def to_string(self): + raise NotImplementedError + + def get_param(self): + # TODO document better where this is used and when. Currently it has + # very limited use, but is still in use. It's currently not even + # clear what values would be allowed. + return None + + @property + def star_count(self): + kind = self.get_kind() + if kind == Parameter.VAR_POSITIONAL: + return 1 + if kind == Parameter.VAR_KEYWORD: + return 2 + return 0 + + +class BaseTreeParamName(ParamNameInterface, AbstractTreeName): + annotation_node = None + default_node = None + + def to_string(self): + output = self._kind_string() + self.string_name + annotation = self.annotation_node + default = self.default_node + if annotation is not None: + output += ': ' + annotation.get_code(include_prefix=False) + if default is not None: + output += '=' + default.get_code(include_prefix=False) + return output + + +class ParamName(BaseTreeParamName): + def _get_param_node(self): + return search_ancestor(self.tree_name, 'param') + + @property + def annotation_node(self): + return self._get_param_node().annotation + + def infer_annotation(self, execute_annotation=True): + node = self.annotation_node + if node is None: + return NO_CONTEXTS + contexts = self.parent_context.parent_context.eval_node(node) + if execute_annotation: + contexts = contexts.execute_annotation() + return contexts + + def infer_default(self): + node = self.default_node + if node is None: + return NO_CONTEXTS + return self.parent_context.parent_context.eval_node(node) + + @property + def default_node(self): + return self._get_param_node().default + + @property + def string_name(self): + name = self.tree_name.value + if name.startswith('__'): + # Params starting with __ are an equivalent to positional only + # variables in typeshed. + name = name[2:] + return name + + def get_kind(self): + tree_param = self._get_param_node() + if tree_param.star_count == 1: # *args + return Parameter.VAR_POSITIONAL + if tree_param.star_count == 2: # **kwargs + return Parameter.VAR_KEYWORD + + # Params starting with __ are an equivalent to positional only + # variables in typeshed. + if tree_param.name.value.startswith('__'): + return Parameter.POSITIONAL_ONLY + + parent = tree_param.parent + param_appeared = False + for p in parent.children: + if param_appeared: + if p == '/': + return Parameter.POSITIONAL_ONLY + else: + if p == '*': + return Parameter.KEYWORD_ONLY + if p.type == 'param': + if p.star_count: + return Parameter.KEYWORD_ONLY + if p == tree_param: + param_appeared = True + return Parameter.POSITIONAL_OR_KEYWORD + + def infer(self): + return self.get_param().infer() + + def get_param(self): + params, _ = self.parent_context.get_executed_params_and_issues() + param_node = search_ancestor(self.tree_name, 'param') + return params[param_node.position_index] + + +class ParamNameWrapper(_ParamMixin): + def __init__(self, param_name): + self._wrapped_param_name = param_name + + def __getattr__(self, name): + return getattr(self._wrapped_param_name, name) + + def __repr__(self): + return '<%s: %s>' % (self.__class__.__name__, self._wrapped_param_name) + + +class ImportName(AbstractNameDefinition): + start_pos = (1, 0) + _level = 0 + + def __init__(self, parent_context, string_name): + self._from_module_context = parent_context + self.string_name = string_name + + def get_qualified_names(self, include_module_names=False): + if include_module_names: + if self._level: + assert self._level == 1, "Everything else is not supported for now" + module_names = self._from_module_context.string_names + if module_names is None: + return module_names + return module_names + (self.string_name,) + return (self.string_name,) + return () + + @property + def parent_context(self): + m = self._from_module_context + import_contexts = self.infer() + if not import_contexts: + return m + # It's almost always possible to find the import or to not find it. The + # importing returns only one context, pretty much always. + return next(iter(import_contexts)) + + @memoize_method + def infer(self): + from jedi.evaluate.imports import Importer + m = self._from_module_context + return Importer(m.evaluator, [self.string_name], m, level=self._level).follow() + + def goto(self): + return [m.name for m in self.infer()] + + @property + def api_type(self): + return 'module' + + +class SubModuleName(ImportName): + _level = 1 + + +class NameWrapper(object): + def __init__(self, wrapped_name): + self._wrapped_name = wrapped_name + + @abstractmethod + def infer(self): + raise NotImplementedError + + def __getattr__(self, name): + return getattr(self._wrapped_name, name) + + def __repr__(self): + return '%s(%s)' % (self.__class__.__name__, self._wrapped_name) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/param.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/param.py new file mode 100644 index 0000000..ffec77e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/param.py @@ -0,0 +1,253 @@ +from collections import defaultdict + +from jedi import debug +from jedi.evaluate.utils import PushBackIterator +from jedi.evaluate import analysis +from jedi.evaluate.lazy_context import LazyKnownContext, \ + LazyTreeContext, LazyUnknownContext +from jedi.evaluate import docstrings +from jedi.evaluate.context import iterable + + +def _add_argument_issue(error_name, lazy_context, message): + if isinstance(lazy_context, LazyTreeContext): + node = lazy_context.data + if node.parent.type == 'argument': + node = node.parent + return analysis.add(lazy_context.context, error_name, node, message) + + +class ExecutedParam(object): + """Fake a param and give it values.""" + def __init__(self, execution_context, param_node, lazy_context, is_default=False): + self._execution_context = execution_context + self._param_node = param_node + self._lazy_context = lazy_context + self.string_name = param_node.name.value + self._is_default = is_default + + def infer_annotations(self): + from jedi.evaluate.gradual.annotation import infer_param + return infer_param(self._execution_context, self._param_node) + + def infer(self, use_hints=True): + if use_hints: + doc_params = docstrings.infer_param(self._execution_context, self._param_node) + ann = self.infer_annotations().execute_annotation() + if ann or doc_params: + return ann | doc_params + + return self._lazy_context.infer() + + def matches_signature(self): + if self._is_default: + return True + argument_contexts = self.infer(use_hints=False).py__class__() + if self._param_node.star_count: + return True + annotations = self.infer_annotations() + if not annotations: + # If we cannot infer annotations - or there aren't any - pretend + # that the signature matches. + return True + matches = any(c1.is_sub_class_of(c2) + for c1 in argument_contexts + for c2 in annotations.gather_annotation_classes()) + debug.dbg("signature compare %s: %s <=> %s", + matches, argument_contexts, annotations, color='BLUE') + return matches + + @property + def var_args(self): + return self._execution_context.var_args + + def __repr__(self): + return '<%s: %s>' % (self.__class__.__name__, self.string_name) + + +def get_executed_params_and_issues(execution_context, arguments): + def too_many_args(argument): + m = _error_argument_count(funcdef, len(unpacked_va)) + # Just report an error for the first param that is not needed (like + # cPython). + if arguments.get_calling_nodes(): + # There might not be a valid calling node so check for that first. + issues.append( + _add_argument_issue( + 'type-error-too-many-arguments', + argument, + message=m + ) + ) + else: + issues.append(None) + + issues = [] # List[Optional[analysis issue]] + result_params = [] + param_dict = {} + funcdef = execution_context.tree_node + # Default params are part of the context where the function was defined. + # This means that they might have access on class variables that the + # function itself doesn't have. + default_param_context = execution_context.function_context.get_default_param_context() + + for param in funcdef.get_params(): + param_dict[param.name.value] = param + unpacked_va = list(arguments.unpack(funcdef)) + var_arg_iterator = PushBackIterator(iter(unpacked_va)) + + non_matching_keys = defaultdict(lambda: []) + keys_used = {} + keys_only = False + had_multiple_value_error = False + for param in funcdef.get_params(): + # The value and key can both be null. There, the defaults apply. + # args / kwargs will just be empty arrays / dicts, respectively. + # Wrong value count is just ignored. If you try to test cases that are + # not allowed in Python, Jedi will maybe not show any completions. + is_default = False + key, argument = next(var_arg_iterator, (None, None)) + while key is not None: + keys_only = True + try: + key_param = param_dict[key] + except KeyError: + non_matching_keys[key] = argument + else: + if key in keys_used: + had_multiple_value_error = True + m = ("TypeError: %s() got multiple values for keyword argument '%s'." + % (funcdef.name, key)) + for contextualized_node in arguments.get_calling_nodes(): + issues.append( + analysis.add(contextualized_node.context, + 'type-error-multiple-values', + contextualized_node.node, message=m) + ) + else: + keys_used[key] = ExecutedParam(execution_context, key_param, argument) + key, argument = next(var_arg_iterator, (None, None)) + + try: + result_params.append(keys_used[param.name.value]) + continue + except KeyError: + pass + + if param.star_count == 1: + # *args param + lazy_context_list = [] + if argument is not None: + lazy_context_list.append(argument) + for key, argument in var_arg_iterator: + # Iterate until a key argument is found. + if key: + var_arg_iterator.push_back((key, argument)) + break + lazy_context_list.append(argument) + seq = iterable.FakeSequence(execution_context.evaluator, u'tuple', lazy_context_list) + result_arg = LazyKnownContext(seq) + elif param.star_count == 2: + if argument is not None: + too_many_args(argument) + # **kwargs param + dct = iterable.FakeDict(execution_context.evaluator, dict(non_matching_keys)) + result_arg = LazyKnownContext(dct) + non_matching_keys = {} + else: + # normal param + if argument is None: + # No value: Return an empty container + if param.default is None: + result_arg = LazyUnknownContext() + if not keys_only: + for contextualized_node in arguments.get_calling_nodes(): + m = _error_argument_count(funcdef, len(unpacked_va)) + issues.append( + analysis.add( + contextualized_node.context, + 'type-error-too-few-arguments', + contextualized_node.node, + message=m, + ) + ) + else: + result_arg = LazyTreeContext(default_param_context, param.default) + is_default = True + else: + result_arg = argument + + result_params.append(ExecutedParam( + execution_context, param, result_arg, + is_default=is_default + )) + if not isinstance(result_arg, LazyUnknownContext): + keys_used[param.name.value] = result_params[-1] + + if keys_only: + # All arguments should be handed over to the next function. It's not + # about the values inside, it's about the names. Jedi needs to now that + # there's nothing to find for certain names. + for k in set(param_dict) - set(keys_used): + param = param_dict[k] + + if not (non_matching_keys or had_multiple_value_error or + param.star_count or param.default): + # add a warning only if there's not another one. + for contextualized_node in arguments.get_calling_nodes(): + m = _error_argument_count(funcdef, len(unpacked_va)) + issues.append( + analysis.add(contextualized_node.context, + 'type-error-too-few-arguments', + contextualized_node.node, message=m) + ) + + for key, lazy_context in non_matching_keys.items(): + m = "TypeError: %s() got an unexpected keyword argument '%s'." \ + % (funcdef.name, key) + issues.append( + _add_argument_issue( + 'type-error-keyword-argument', + lazy_context, + message=m + ) + ) + + remaining_arguments = list(var_arg_iterator) + if remaining_arguments: + first_key, lazy_context = remaining_arguments[0] + too_many_args(lazy_context) + return result_params, issues + + +def _error_argument_count(funcdef, actual_count): + params = funcdef.get_params() + default_arguments = sum(1 for p in params if p.default or p.star_count) + + if default_arguments == 0: + before = 'exactly ' + else: + before = 'from %s to ' % (len(params) - default_arguments) + return ('TypeError: %s() takes %s%s arguments (%s given).' + % (funcdef.name, before, len(params), actual_count)) + + +def _create_default_param(execution_context, param): + if param.star_count == 1: + result_arg = LazyKnownContext( + iterable.FakeSequence(execution_context.evaluator, u'tuple', []) + ) + elif param.star_count == 2: + result_arg = LazyKnownContext( + iterable.FakeDict(execution_context.evaluator, {}) + ) + elif param.default is None: + result_arg = LazyUnknownContext() + else: + result_arg = LazyTreeContext(execution_context.parent_context, param.default) + return ExecutedParam(execution_context, param, result_arg) + + +def create_default_params(execution_context, funcdef): + return [_create_default_param(execution_context, p) + for p in funcdef.get_params()] diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/parser_cache.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/parser_cache.py new file mode 100644 index 0000000..84fe52d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/parser_cache.py @@ -0,0 +1,6 @@ +from jedi.evaluate.cache import evaluator_function_cache + + +@evaluator_function_cache() +def get_yield_exprs(evaluator, funcdef): + return list(funcdef.iter_yield_exprs()) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/recursion.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/recursion.py new file mode 100644 index 0000000..f86deda --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/recursion.py @@ -0,0 +1,153 @@ +""" +Recursions are the recipe of |jedi| to conquer Python code. However, someone +must stop recursions going mad. Some settings are here to make |jedi| stop at +the right time. You can read more about them :ref:`here `. + +Next to :mod:`jedi.evaluate.cache` this module also makes |jedi| not +thread-safe. Why? ``execution_recursion_decorator`` uses class variables to +count the function calls. + +.. _settings-recursion: + +Settings +~~~~~~~~~~ + +Recursion settings are important if you don't want extremly +recursive python code to go absolutely crazy. + +The default values are based on experiments while completing the |jedi| library +itself (inception!). But I don't think there's any other Python library that +uses recursion in a similarly extreme way. Completion should also be fast and +therefore the quality might not always be maximal. + +.. autodata:: recursion_limit +.. autodata:: total_function_execution_limit +.. autodata:: per_function_execution_limit +.. autodata:: per_function_recursion_limit +""" + +from contextlib import contextmanager + +from jedi import debug +from jedi.evaluate.base_context import NO_CONTEXTS + + +recursion_limit = 15 +""" +Like ``sys.getrecursionlimit()``, just for |jedi|. +""" +total_function_execution_limit = 200 +""" +This is a hard limit of how many non-builtin functions can be executed. +""" +per_function_execution_limit = 6 +""" +The maximal amount of times a specific function may be executed. +""" +per_function_recursion_limit = 2 +""" +A function may not be executed more than this number of times recursively. +""" + + +class RecursionDetector(object): + def __init__(self): + self.pushed_nodes = [] + + +@contextmanager +def execution_allowed(evaluator, node): + """ + A decorator to detect recursions in statements. In a recursion a statement + at the same place, in the same module may not be executed two times. + """ + pushed_nodes = evaluator.recursion_detector.pushed_nodes + + if node in pushed_nodes: + debug.warning('catched stmt recursion: %s @%s', node, + getattr(node, 'start_pos', None)) + yield False + else: + try: + pushed_nodes.append(node) + yield True + finally: + pushed_nodes.pop() + + +def execution_recursion_decorator(default=NO_CONTEXTS): + def decorator(func): + def wrapper(self, **kwargs): + detector = self.evaluator.execution_recursion_detector + limit_reached = detector.push_execution(self) + try: + if limit_reached: + result = default + else: + result = func(self, **kwargs) + finally: + detector.pop_execution() + return result + return wrapper + return decorator + + +class ExecutionRecursionDetector(object): + """ + Catches recursions of executions. + """ + def __init__(self, evaluator): + self._evaluator = evaluator + + self._recursion_level = 0 + self._parent_execution_funcs = [] + self._funcdef_execution_counts = {} + self._execution_count = 0 + + def pop_execution(self): + self._parent_execution_funcs.pop() + self._recursion_level -= 1 + + def push_execution(self, execution): + funcdef = execution.tree_node + + # These two will be undone in pop_execution. + self._recursion_level += 1 + self._parent_execution_funcs.append(funcdef) + + module = execution.get_root_context() + + if module == self._evaluator.builtins_module: + # We have control over builtins so we know they are not recursing + # like crazy. Therefore we just let them execute always, because + # they usually just help a lot with getting good results. + return False + + if self._recursion_level > recursion_limit: + debug.warning('Recursion limit (%s) reached', recursion_limit) + return True + + if self._execution_count >= total_function_execution_limit: + debug.warning('Function execution limit (%s) reached', total_function_execution_limit) + return True + self._execution_count += 1 + + if self._funcdef_execution_counts.setdefault(funcdef, 0) >= per_function_execution_limit: + if module.py__name__() in ('builtins', 'typing'): + return False + debug.warning( + 'Per function execution limit (%s) reached: %s', + per_function_execution_limit, + funcdef + ) + return True + self._funcdef_execution_counts[funcdef] += 1 + + if self._parent_execution_funcs.count(funcdef) > per_function_recursion_limit: + debug.warning( + 'Per function recursion limit (%s) reached: %s', + per_function_recursion_limit, + funcdef + ) + return True + return False diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/signature.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/signature.py new file mode 100644 index 0000000..43d3d5d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/signature.py @@ -0,0 +1,116 @@ +from jedi._compatibility import Parameter +from jedi.cache import memoize_method + + +class _SignatureMixin(object): + def to_string(self): + def param_strings(): + is_positional = False + is_kw_only = False + for n in self.get_param_names(resolve_stars=True): + kind = n.get_kind() + is_positional |= kind == Parameter.POSITIONAL_ONLY + if is_positional and kind != Parameter.POSITIONAL_ONLY: + yield '/' + is_positional = False + + if kind == Parameter.VAR_POSITIONAL: + is_kw_only = True + elif kind == Parameter.KEYWORD_ONLY and not is_kw_only: + yield '*' + is_kw_only = True + + yield n.to_string() + + if is_positional: + yield '/' + + s = self.name.string_name + '(' + ', '.join(param_strings()) + ')' + annotation = self.annotation_string + if annotation: + s += ' -> ' + annotation + return s + + +class AbstractSignature(_SignatureMixin): + def __init__(self, context, is_bound=False): + self.context = context + self.is_bound = is_bound + + @property + def name(self): + return self.context.name + + @property + def annotation_string(self): + return '' + + def get_param_names(self, resolve_stars=False): + param_names = self._function_context.get_param_names() + if self.is_bound: + return param_names[1:] + return param_names + + def bind(self, context): + raise NotImplementedError + + def __repr__(self): + return '<%s: %s, %s>' % (self.__class__.__name__, self.context, self._function_context) + + +class TreeSignature(AbstractSignature): + def __init__(self, context, function_context=None, is_bound=False): + super(TreeSignature, self).__init__(context, is_bound) + self._function_context = function_context or context + + def bind(self, context): + return TreeSignature(context, self._function_context, is_bound=True) + + @property + def _annotation(self): + # Classes don't need annotations, even if __init__ has one. They always + # return themselves. + if self.context.is_class(): + return None + return self._function_context.tree_node.annotation + + @property + def annotation_string(self): + a = self._annotation + if a is None: + return '' + return a.get_code(include_prefix=False) + + @memoize_method + def get_param_names(self, resolve_stars=False): + params = super(TreeSignature, self).get_param_names(resolve_stars=False) + if resolve_stars: + from jedi.evaluate.star_args import process_params + params = process_params(params) + return params + + +class BuiltinSignature(AbstractSignature): + def __init__(self, context, return_string, is_bound=False): + super(BuiltinSignature, self).__init__(context, is_bound) + self._return_string = return_string + + @property + def annotation_string(self): + return self._return_string + + @property + def _function_context(self): + return self.context + + def bind(self, context): + assert not self.is_bound + return BuiltinSignature(context, self._return_string, is_bound=True) + + +class SignatureWrapper(_SignatureMixin): + def __init__(self, wrapped_signature): + self._wrapped_signature = wrapped_signature + + def __getattr__(self, name): + return getattr(self._wrapped_signature, name) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/star_args.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/star_args.py new file mode 100644 index 0000000..2008a85 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/star_args.py @@ -0,0 +1,206 @@ +""" +This module is responsible for evaluating *args and **kwargs for signatures. + +This means for example in this case:: + + def foo(a, b, c): ... + + def bar(*args): + return foo(1, *args) + +The signature here for bar should be `bar(b, c)` instead of bar(*args). +""" + +from jedi._compatibility import Parameter +from jedi.evaluate.utils import to_list +from jedi.evaluate.names import ParamNameWrapper + + +def _iter_nodes_for_param(param_name): + from parso.python.tree import search_ancestor + from jedi.evaluate.arguments import TreeArguments + + execution_context = param_name.parent_context + function_node = execution_context.tree_node + module_node = function_node.get_root_node() + start = function_node.children[-1].start_pos + end = function_node.children[-1].end_pos + for name in module_node.get_used_names().get(param_name.string_name): + if start <= name.start_pos < end: + # Is used in the function + argument = name.parent + if argument.type == 'argument' \ + and argument.children[0] == '*' * param_name.star_count: + # No support for Python <= 3.4 here, but they are end-of-life + # anyway + trailer = search_ancestor(argument, 'trailer') + if trailer is not None: # Make sure we're in a function + context = execution_context.create_context(trailer) + if _goes_to_param_name(param_name, context, name): + contexts = _to_callables(context, trailer) + + args = TreeArguments.create_cached( + execution_context.evaluator, + context=context, + argument_node=trailer.children[1], + trailer=trailer, + ) + for c in contexts: + yield c, args + else: + assert False + + +def _goes_to_param_name(param_name, context, potential_name): + if potential_name.type != 'name': + return False + from jedi.evaluate.names import TreeNameDefinition + found = TreeNameDefinition(context, potential_name).goto() + return any(param_name.parent_context == p.parent_context + and param_name.start_pos == p.start_pos + for p in found) + + +def _to_callables(context, trailer): + from jedi.evaluate.syntax_tree import eval_trailer + + atom_expr = trailer.parent + index = atom_expr.children[0] == 'await' + # Eval atom first + contexts = context.eval_node(atom_expr.children[index]) + for trailer2 in atom_expr.children[index + 1:]: + if trailer == trailer2: + break + contexts = eval_trailer(context, contexts, trailer2) + return contexts + + +def _remove_given_params(arguments, param_names): + count = 0 + used_keys = set() + for key, _ in arguments.unpack(): + if key is None: + count += 1 + else: + used_keys.add(key) + + for p in param_names: + if count and p.maybe_positional_argument(): + count -= 1 + continue + if p.string_name in used_keys and p.maybe_keyword_argument(): + continue + yield p + + +@to_list +def process_params(param_names, star_count=3): # default means both * and ** + used_names = set() + arg_callables = [] + kwarg_callables = [] + + kw_only_names = [] + kwarg_names = [] + arg_names = [] + original_arg_name = None + original_kwarg_name = None + for p in param_names: + kind = p.get_kind() + if kind == Parameter.VAR_POSITIONAL: + if star_count & 1: + arg_callables = _iter_nodes_for_param(p) + original_arg_name = p + elif p.get_kind() == Parameter.VAR_KEYWORD: + if star_count & 2: + kwarg_callables = list(_iter_nodes_for_param(p)) + original_kwarg_name = p + elif kind == Parameter.KEYWORD_ONLY: + if star_count & 2: + kw_only_names.append(p) + elif kind == Parameter.POSITIONAL_ONLY: + if star_count & 1: + yield p + else: + if star_count == 1: + yield ParamNameFixedKind(p, Parameter.POSITIONAL_ONLY) + elif star_count == 2: + kw_only_names.append(ParamNameFixedKind(p, Parameter.KEYWORD_ONLY)) + else: + used_names.add(p.string_name) + yield p + + longest_param_names = () + found_arg_signature = False + found_kwarg_signature = False + for func_and_argument in arg_callables: + func, arguments = func_and_argument + new_star_count = star_count + if func_and_argument in kwarg_callables: + kwarg_callables.remove(func_and_argument) + else: + new_star_count = 1 + + for signature in func.get_signatures(): + found_arg_signature = True + if new_star_count == 3: + found_kwarg_signature = True + args_for_this_func = [] + for p in process_params( + list(_remove_given_params( + arguments, + signature.get_param_names(resolve_stars=False) + )), new_star_count): + if p.get_kind() == Parameter.VAR_KEYWORD: + kwarg_names.append(p) + elif p.get_kind() == Parameter.VAR_POSITIONAL: + arg_names.append(p) + elif p.get_kind() == Parameter.KEYWORD_ONLY: + kw_only_names.append(p) + else: + args_for_this_func.append(p) + if len(args_for_this_func) > len(longest_param_names): + longest_param_names = args_for_this_func + + for p in longest_param_names: + if star_count == 1 and p.get_kind() != Parameter.VAR_POSITIONAL: + yield ParamNameFixedKind(p, Parameter.POSITIONAL_ONLY) + else: + if p.get_kind() == Parameter.POSITIONAL_OR_KEYWORD: + used_names.add(p.string_name) + yield p + + if not found_arg_signature and original_arg_name is not None: + yield original_arg_name + elif arg_names: + yield arg_names[0] + + for p in kw_only_names: + if p.string_name in used_names: + continue + yield p + used_names.add(p.string_name) + + for func, arguments in kwarg_callables: + for signature in func.get_signatures(): + found_kwarg_signature = True + for p in process_params( + list(_remove_given_params( + arguments, + signature.get_param_names(resolve_stars=False) + )), star_count=2): + if p.get_kind() != Parameter.KEYWORD_ONLY or not kwarg_names: + yield p + + if not found_kwarg_signature and original_kwarg_name is not None: + yield original_kwarg_name + elif kwarg_names: + yield kwarg_names[0] + + +class ParamNameFixedKind(ParamNameWrapper): + def __init__(self, param_name, new_kind): + super(ParamNameFixedKind, self).__init__(param_name) + self._new_kind = new_kind + + def get_kind(self): + return self._new_kind diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/syntax_tree.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/syntax_tree.py new file mode 100644 index 0000000..89c51d3 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/syntax_tree.py @@ -0,0 +1,730 @@ +""" +Functions evaluating the syntax tree. +""" +import copy + +from parso.python import tree + +from jedi._compatibility import force_unicode, unicode +from jedi import debug +from jedi import parser_utils +from jedi.evaluate.base_context import ContextSet, NO_CONTEXTS, ContextualizedNode, \ + ContextualizedName, iterator_to_context_set, iterate_contexts +from jedi.evaluate.lazy_context import LazyTreeContext +from jedi.evaluate import compiled +from jedi.evaluate import recursion +from jedi.evaluate import helpers +from jedi.evaluate import analysis +from jedi.evaluate import imports +from jedi.evaluate import arguments +from jedi.evaluate.context import ClassContext, FunctionContext +from jedi.evaluate.context import iterable +from jedi.evaluate.context import TreeInstance +from jedi.evaluate.finder import NameFinder +from jedi.evaluate.helpers import is_string, is_literal, is_number +from jedi.evaluate.compiled.access import COMPARISON_OPERATORS +from jedi.evaluate.cache import evaluator_method_cache +from jedi.evaluate.gradual.stub_context import VersionInfo +from jedi.evaluate.gradual import annotation +from jedi.evaluate.context.decorator import Decoratee +from jedi.plugins import plugin_manager + + +def _limit_context_infers(func): + """ + This is for now the way how we limit type inference going wild. There are + other ways to ensure recursion limits as well. This is mostly necessary + because of instance (self) access that can be quite tricky to limit. + + I'm still not sure this is the way to go, but it looks okay for now and we + can still go anther way in the future. Tests are there. ~ dave + """ + def wrapper(context, *args, **kwargs): + n = context.tree_node + evaluator = context.evaluator + try: + evaluator.inferred_element_counts[n] += 1 + if evaluator.inferred_element_counts[n] > 300: + debug.warning('In context %s there were too many inferences.', n) + return NO_CONTEXTS + except KeyError: + evaluator.inferred_element_counts[n] = 1 + return func(context, *args, **kwargs) + + return wrapper + + +def _py__stop_iteration_returns(generators): + results = NO_CONTEXTS + for generator in generators: + try: + method = generator.py__stop_iteration_returns + except AttributeError: + debug.warning('%s is not actually a generator', generator) + else: + results |= method() + return results + + +@debug.increase_indent +@_limit_context_infers +def eval_node(context, element): + debug.dbg('eval_node %s@%s in %s', element, element.start_pos, context) + evaluator = context.evaluator + typ = element.type + if typ in ('name', 'number', 'string', 'atom', 'strings', 'keyword', 'fstring'): + return eval_atom(context, element) + elif typ == 'lambdef': + return ContextSet([FunctionContext.from_context(context, element)]) + elif typ == 'expr_stmt': + return eval_expr_stmt(context, element) + elif typ in ('power', 'atom_expr'): + first_child = element.children[0] + children = element.children[1:] + had_await = False + if first_child.type == 'keyword' and first_child.value == 'await': + had_await = True + first_child = children.pop(0) + + context_set = context.eval_node(first_child) + for (i, trailer) in enumerate(children): + if trailer == '**': # has a power operation. + right = context.eval_node(children[i + 1]) + context_set = _eval_comparison( + evaluator, + context, + context_set, + trailer, + right + ) + break + context_set = eval_trailer(context, context_set, trailer) + + if had_await: + return context_set.py__await__().py__stop_iteration_returns() + return context_set + elif typ in ('testlist_star_expr', 'testlist',): + # The implicit tuple in statements. + return ContextSet([iterable.SequenceLiteralContext(evaluator, context, element)]) + elif typ in ('not_test', 'factor'): + context_set = context.eval_node(element.children[-1]) + for operator in element.children[:-1]: + context_set = eval_factor(context_set, operator) + return context_set + elif typ == 'test': + # `x if foo else y` case. + return (context.eval_node(element.children[0]) | + context.eval_node(element.children[-1])) + elif typ == 'operator': + # Must be an ellipsis, other operators are not evaluated. + # In Python 2 ellipsis is coded as three single dot tokens, not + # as one token 3 dot token. + if element.value not in ('.', '...'): + origin = element.parent + raise AssertionError("unhandled operator %s in %s " % (repr(element.value), origin)) + return ContextSet([compiled.builtin_from_name(evaluator, u'Ellipsis')]) + elif typ == 'dotted_name': + context_set = eval_atom(context, element.children[0]) + for next_name in element.children[2::2]: + # TODO add search_global=True? + context_set = context_set.py__getattribute__(next_name, name_context=context) + return context_set + elif typ == 'eval_input': + return eval_node(context, element.children[0]) + elif typ == 'annassign': + return annotation.eval_annotation(context, element.children[1]) \ + .execute_annotation() + elif typ == 'yield_expr': + if len(element.children) and element.children[1].type == 'yield_arg': + # Implies that it's a yield from. + element = element.children[1].children[1] + generators = context.eval_node(element) \ + .py__getattribute__('__iter__').execute_evaluated() + return generators.py__stop_iteration_returns() + + # Generator.send() is not implemented. + return NO_CONTEXTS + elif typ == 'namedexpr_test': + return eval_node(context, element.children[2]) + else: + return eval_or_test(context, element) + + +def eval_trailer(context, atom_contexts, trailer): + trailer_op, node = trailer.children[:2] + if node == ')': # `arglist` is optional. + node = None + + if trailer_op == '[': + trailer_op, node, _ = trailer.children + return atom_contexts.get_item( + eval_subscript_list(context.evaluator, context, node), + ContextualizedNode(context, trailer) + ) + else: + debug.dbg('eval_trailer: %s in %s', trailer, atom_contexts) + if trailer_op == '.': + return atom_contexts.py__getattribute__( + name_context=context, + name_or_str=node + ) + else: + assert trailer_op == '(', 'trailer_op is actually %s' % trailer_op + args = arguments.TreeArguments(context.evaluator, context, node, trailer) + return atom_contexts.execute(args) + + +def eval_atom(context, atom): + """ + Basically to process ``atom`` nodes. The parser sometimes doesn't + generate the node (because it has just one child). In that case an atom + might be a name or a literal as well. + """ + if atom.type == 'name': + if atom.value in ('True', 'False', 'None'): + # Python 2... + return ContextSet([compiled.builtin_from_name(context.evaluator, atom.value)]) + + # This is the first global lookup. + stmt = tree.search_ancestor( + atom, 'expr_stmt', 'lambdef' + ) or atom + if stmt.type == 'lambdef': + stmt = atom + position = stmt.start_pos + if _is_annotation_name(atom): + # Since Python 3.7 (with from __future__ import annotations), + # annotations are essentially strings and can reference objects + # that are defined further down in code. Therefore just set the + # position to None, so the finder will not try to stop at a certain + # position in the module. + position = None + return context.py__getattribute__( + name_or_str=atom, + position=position, + search_global=True + ) + elif atom.type == 'keyword': + # For False/True/None + if atom.value in ('False', 'True', 'None'): + return ContextSet([compiled.builtin_from_name(context.evaluator, atom.value)]) + elif atom.value == 'print': + # print e.g. could be evaluated like this in Python 2.7 + return NO_CONTEXTS + elif atom.value == 'yield': + # Contrary to yield from, yield can just appear alone to return a + # value when used with `.send()`. + return NO_CONTEXTS + assert False, 'Cannot evaluate the keyword %s' % atom + + elif isinstance(atom, tree.Literal): + string = context.evaluator.compiled_subprocess.safe_literal_eval(atom.value) + return ContextSet([compiled.create_simple_object(context.evaluator, string)]) + elif atom.type == 'strings': + # Will be multiple string. + context_set = eval_atom(context, atom.children[0]) + for string in atom.children[1:]: + right = eval_atom(context, string) + context_set = _eval_comparison(context.evaluator, context, context_set, u'+', right) + return context_set + elif atom.type == 'fstring': + return compiled.get_string_context_set(context.evaluator) + else: + c = atom.children + # Parentheses without commas are not tuples. + if c[0] == '(' and not len(c) == 2 \ + and not(c[1].type == 'testlist_comp' and + len(c[1].children) > 1): + return context.eval_node(c[1]) + + try: + comp_for = c[1].children[1] + except (IndexError, AttributeError): + pass + else: + if comp_for == ':': + # Dict comprehensions have a colon at the 3rd index. + try: + comp_for = c[1].children[3] + except IndexError: + pass + + if comp_for.type in ('comp_for', 'sync_comp_for'): + return ContextSet([iterable.comprehension_from_atom( + context.evaluator, context, atom + )]) + + # It's a dict/list/tuple literal. + array_node = c[1] + try: + array_node_c = array_node.children + except AttributeError: + array_node_c = [] + if c[0] == '{' and (array_node == '}' or ':' in array_node_c or + '**' in array_node_c): + context = iterable.DictLiteralContext(context.evaluator, context, atom) + else: + context = iterable.SequenceLiteralContext(context.evaluator, context, atom) + return ContextSet([context]) + + +@_limit_context_infers +def eval_expr_stmt(context, stmt, seek_name=None): + with recursion.execution_allowed(context.evaluator, stmt) as allowed: + # Here we allow list/set to recurse under certain conditions. To make + # it possible to resolve stuff like list(set(list(x))), this is + # necessary. + if not allowed and context.get_root_context() == context.evaluator.builtins_module: + try: + instance = context.var_args.instance + except AttributeError: + pass + else: + if instance.name.string_name in ('list', 'set'): + c = instance.get_first_non_keyword_argument_contexts() + if instance not in c: + allowed = True + + if allowed: + return _eval_expr_stmt(context, stmt, seek_name) + return NO_CONTEXTS + + +@debug.increase_indent +def _eval_expr_stmt(context, stmt, seek_name=None): + """ + The starting point of the completion. A statement always owns a call + list, which are the calls, that a statement does. In case multiple + names are defined in the statement, `seek_name` returns the result for + this name. + + :param stmt: A `tree.ExprStmt`. + """ + debug.dbg('eval_expr_stmt %s (%s)', stmt, seek_name) + rhs = stmt.get_rhs() + context_set = context.eval_node(rhs) + + if seek_name: + c_node = ContextualizedName(context, seek_name) + context_set = check_tuple_assignments(context.evaluator, c_node, context_set) + + first_operator = next(stmt.yield_operators(), None) + if first_operator not in ('=', None) and first_operator.type == 'operator': + # `=` is always the last character in aug assignments -> -1 + operator = copy.copy(first_operator) + operator.value = operator.value[:-1] + name = stmt.get_defined_names()[0].value + left = context.py__getattribute__( + name, position=stmt.start_pos, search_global=True) + + for_stmt = tree.search_ancestor(stmt, 'for_stmt') + if for_stmt is not None and for_stmt.type == 'for_stmt' and context_set \ + and parser_utils.for_stmt_defines_one_name(for_stmt): + # Iterate through result and add the values, that's possible + # only in for loops without clutter, because they are + # predictable. Also only do it, if the variable is not a tuple. + node = for_stmt.get_testlist() + cn = ContextualizedNode(context, node) + ordered = list(cn.infer().iterate(cn)) + + for lazy_context in ordered: + dct = {for_stmt.children[1].value: lazy_context.infer()} + with helpers.predefine_names(context, for_stmt, dct): + t = context.eval_node(rhs) + left = _eval_comparison(context.evaluator, context, left, operator, t) + context_set = left + else: + context_set = _eval_comparison(context.evaluator, context, left, operator, context_set) + debug.dbg('eval_expr_stmt result %s', context_set) + return context_set + + +def eval_or_test(context, or_test): + iterator = iter(or_test.children) + types = context.eval_node(next(iterator)) + for operator in iterator: + right = next(iterator) + if operator.type == 'comp_op': # not in / is not + operator = ' '.join(c.value for c in operator.children) + + # handle lazy evaluation of and/or here. + if operator in ('and', 'or'): + left_bools = set(left.py__bool__() for left in types) + if left_bools == {True}: + if operator == 'and': + types = context.eval_node(right) + elif left_bools == {False}: + if operator != 'and': + types = context.eval_node(right) + # Otherwise continue, because of uncertainty. + else: + types = _eval_comparison(context.evaluator, context, types, operator, + context.eval_node(right)) + debug.dbg('eval_or_test types %s', types) + return types + + +@iterator_to_context_set +def eval_factor(context_set, operator): + """ + Calculates `+`, `-`, `~` and `not` prefixes. + """ + for context in context_set: + if operator == '-': + if is_number(context): + yield context.negate() + elif operator == 'not': + value = context.py__bool__() + if value is None: # Uncertainty. + return + yield compiled.create_simple_object(context.evaluator, not value) + else: + yield context + + +def _literals_to_types(evaluator, result): + # Changes literals ('a', 1, 1.0, etc) to its type instances (str(), + # int(), float(), etc). + new_result = NO_CONTEXTS + for typ in result: + if is_literal(typ): + # Literals are only valid as long as the operations are + # correct. Otherwise add a value-free instance. + cls = compiled.builtin_from_name(evaluator, typ.name.string_name) + new_result |= cls.execute_evaluated() + else: + new_result |= ContextSet([typ]) + return new_result + + +def _eval_comparison(evaluator, context, left_contexts, operator, right_contexts): + if not left_contexts or not right_contexts: + # illegal slices e.g. cause left/right_result to be None + result = (left_contexts or NO_CONTEXTS) | (right_contexts or NO_CONTEXTS) + return _literals_to_types(evaluator, result) + else: + # I don't think there's a reasonable chance that a string + # operation is still correct, once we pass something like six + # objects. + if len(left_contexts) * len(right_contexts) > 6: + return _literals_to_types(evaluator, left_contexts | right_contexts) + else: + return ContextSet.from_sets( + _eval_comparison_part(evaluator, context, left, operator, right) + for left in left_contexts + for right in right_contexts + ) + + +def _is_annotation_name(name): + ancestor = tree.search_ancestor(name, 'param', 'funcdef', 'expr_stmt') + if ancestor is None: + return False + + if ancestor.type in ('param', 'funcdef'): + ann = ancestor.annotation + if ann is not None: + return ann.start_pos <= name.start_pos < ann.end_pos + elif ancestor.type == 'expr_stmt': + c = ancestor.children + if len(c) > 1 and c[1].type == 'annassign': + return c[1].start_pos <= name.start_pos < c[1].end_pos + return False + + +def _is_tuple(context): + return isinstance(context, iterable.Sequence) and context.array_type == 'tuple' + + +def _is_list(context): + return isinstance(context, iterable.Sequence) and context.array_type == 'list' + + +def _bool_to_context(evaluator, bool_): + return compiled.builtin_from_name(evaluator, force_unicode(str(bool_))) + + +def _get_tuple_ints(context): + if not isinstance(context, iterable.SequenceLiteralContext): + return None + numbers = [] + for lazy_context in context.py__iter__(): + if not isinstance(lazy_context, LazyTreeContext): + return None + node = lazy_context.data + if node.type != 'number': + return None + try: + numbers.append(int(node.value)) + except ValueError: + return None + return numbers + + +def _eval_comparison_part(evaluator, context, left, operator, right): + l_is_num = is_number(left) + r_is_num = is_number(right) + if isinstance(operator, unicode): + str_operator = operator + else: + str_operator = force_unicode(str(operator.value)) + + if str_operator == '*': + # for iterables, ignore * operations + if isinstance(left, iterable.Sequence) or is_string(left): + return ContextSet([left]) + elif isinstance(right, iterable.Sequence) or is_string(right): + return ContextSet([right]) + elif str_operator == '+': + if l_is_num and r_is_num or is_string(left) and is_string(right): + return ContextSet([left.execute_operation(right, str_operator)]) + elif _is_tuple(left) and _is_tuple(right) or _is_list(left) and _is_list(right): + return ContextSet([iterable.MergedArray(evaluator, (left, right))]) + elif str_operator == '-': + if l_is_num and r_is_num: + return ContextSet([left.execute_operation(right, str_operator)]) + elif str_operator == '%': + # With strings and numbers the left type typically remains. Except for + # `int() % float()`. + return ContextSet([left]) + elif str_operator in COMPARISON_OPERATORS: + if left.is_compiled() and right.is_compiled(): + # Possible, because the return is not an option. Just compare. + try: + return ContextSet([left.execute_operation(right, str_operator)]) + except TypeError: + # Could be True or False. + pass + else: + if str_operator in ('is', '!=', '==', 'is not'): + operation = COMPARISON_OPERATORS[str_operator] + bool_ = operation(left, right) + return ContextSet([_bool_to_context(evaluator, bool_)]) + + if isinstance(left, VersionInfo): + version_info = _get_tuple_ints(right) + if version_info is not None: + bool_result = compiled.access.COMPARISON_OPERATORS[operator]( + evaluator.environment.version_info, + tuple(version_info) + ) + return ContextSet([_bool_to_context(evaluator, bool_result)]) + + return ContextSet([_bool_to_context(evaluator, True), _bool_to_context(evaluator, False)]) + elif str_operator == 'in': + return NO_CONTEXTS + + def check(obj): + """Checks if a Jedi object is either a float or an int.""" + return isinstance(obj, TreeInstance) and \ + obj.name.string_name in ('int', 'float') + + # Static analysis, one is a number, the other one is not. + if str_operator in ('+', '-') and l_is_num != r_is_num \ + and not (check(left) or check(right)): + message = "TypeError: unsupported operand type(s) for +: %s and %s" + analysis.add(context, 'type-error-operation', operator, + message % (left, right)) + + result = ContextSet([left, right]) + debug.dbg('Used operator %s resulting in %s', operator, result) + return result + + +def _remove_statements(evaluator, context, stmt, name): + """ + This is the part where statements are being stripped. + + Due to lazy evaluation, statements like a = func; b = a; b() have to be + evaluated. + """ + pep0484_contexts = \ + annotation.find_type_from_comment_hint_assign(context, stmt, name) + if pep0484_contexts: + return pep0484_contexts + + return eval_expr_stmt(context, stmt, seek_name=name) + + +@plugin_manager.decorate() +def tree_name_to_contexts(evaluator, context, tree_name): + context_set = NO_CONTEXTS + module_node = context.get_root_context().tree_node + # First check for annotations, like: `foo: int = 3` + if module_node is not None: + names = module_node.get_used_names().get(tree_name.value, []) + for name in names: + expr_stmt = name.parent + + if expr_stmt.type == "expr_stmt" and expr_stmt.children[1].type == "annassign": + correct_scope = parser_utils.get_parent_scope(name) == context.tree_node + if correct_scope: + context_set |= annotation.eval_annotation( + context, expr_stmt.children[1].children[1] + ).execute_annotation() + if context_set: + return context_set + + types = [] + node = tree_name.get_definition(import_name_always=True) + if node is None: + node = tree_name.parent + if node.type == 'global_stmt': + context = evaluator.create_context(context, tree_name) + finder = NameFinder(evaluator, context, context, tree_name.value) + filters = finder.get_filters(search_global=True) + # For global_stmt lookups, we only need the first possible scope, + # which means the function itself. + filters = [next(filters)] + return finder.find(filters, attribute_lookup=False) + elif node.type not in ('import_from', 'import_name'): + context = evaluator.create_context(context, tree_name) + return eval_atom(context, tree_name) + + typ = node.type + if typ == 'for_stmt': + types = annotation.find_type_from_comment_hint_for(context, node, tree_name) + if types: + return types + if typ == 'with_stmt': + types = annotation.find_type_from_comment_hint_with(context, node, tree_name) + if types: + return types + + if typ in ('for_stmt', 'comp_for', 'sync_comp_for'): + try: + types = context.predefined_names[node][tree_name.value] + except KeyError: + cn = ContextualizedNode(context, node.children[3]) + for_types = iterate_contexts( + cn.infer(), + contextualized_node=cn, + is_async=node.parent.type == 'async_stmt', + ) + c_node = ContextualizedName(context, tree_name) + types = check_tuple_assignments(evaluator, c_node, for_types) + elif typ == 'expr_stmt': + types = _remove_statements(evaluator, context, node, tree_name) + elif typ == 'with_stmt': + context_managers = context.eval_node(node.get_test_node_from_name(tree_name)) + enter_methods = context_managers.py__getattribute__(u'__enter__') + return enter_methods.execute_evaluated() + elif typ in ('import_from', 'import_name'): + types = imports.infer_import(context, tree_name) + elif typ in ('funcdef', 'classdef'): + types = _apply_decorators(context, node) + elif typ == 'try_stmt': + # TODO an exception can also be a tuple. Check for those. + # TODO check for types that are not classes and add it to + # the static analysis report. + exceptions = context.eval_node(tree_name.get_previous_sibling().get_previous_sibling()) + types = exceptions.execute_evaluated() + elif node.type == 'param': + types = NO_CONTEXTS + else: + raise ValueError("Should not happen. type: %s" % typ) + return types + + +# We don't want to have functions/classes that are created by the same +# tree_node. +@evaluator_method_cache() +def _apply_decorators(context, node): + """ + Returns the function, that should to be executed in the end. + This is also the places where the decorators are processed. + """ + if node.type == 'classdef': + decoratee_context = ClassContext( + context.evaluator, + parent_context=context, + tree_node=node + ) + else: + decoratee_context = FunctionContext.from_context(context, node) + initial = values = ContextSet([decoratee_context]) + for dec in reversed(node.get_decorators()): + debug.dbg('decorator: %s %s', dec, values, color="MAGENTA") + with debug.increase_indent_cm(): + dec_values = context.eval_node(dec.children[1]) + trailer_nodes = dec.children[2:-1] + if trailer_nodes: + # Create a trailer and evaluate it. + trailer = tree.PythonNode('trailer', trailer_nodes) + trailer.parent = dec + dec_values = eval_trailer(context, dec_values, trailer) + + if not len(dec_values): + code = dec.get_code(include_prefix=False) + # For the short future, we don't want to hear about the runtime + # decorator in typing that was intentionally omitted. This is not + # "correct", but helps with debugging. + if code != '@runtime\n': + debug.warning('decorator not found: %s on %s', dec, node) + return initial + + values = dec_values.execute(arguments.ValuesArguments([values])) + if not len(values): + debug.warning('not possible to resolve wrappers found %s', node) + return initial + + debug.dbg('decorator end %s', values, color="MAGENTA") + if values != initial: + return ContextSet([Decoratee(c, decoratee_context) for c in values]) + return values + + +def check_tuple_assignments(evaluator, contextualized_name, context_set): + """ + Checks if tuples are assigned. + """ + lazy_context = None + for index, node in contextualized_name.assignment_indexes(): + cn = ContextualizedNode(contextualized_name.context, node) + iterated = context_set.iterate(cn) + if isinstance(index, slice): + # For no star unpacking is not possible. + return NO_CONTEXTS + for _ in range(index + 1): + try: + lazy_context = next(iterated) + except StopIteration: + # We could do this with the default param in next. But this + # would allow this loop to run for a very long time if the + # index number is high. Therefore break if the loop is + # finished. + return NO_CONTEXTS + context_set = lazy_context.infer() + return context_set + + +def eval_subscript_list(evaluator, context, index): + """ + Handles slices in subscript nodes. + """ + if index == ':': + # Like array[:] + return ContextSet([iterable.Slice(context, None, None, None)]) + + elif index.type == 'subscript' and not index.children[0] == '.': + # subscript basically implies a slice operation, except for Python 2's + # Ellipsis. + # e.g. array[:3] + result = [] + for el in index.children: + if el == ':': + if not result: + result.append(None) + elif el.type == 'sliceop': + if len(el.children) == 2: + result.append(el.children[1]) + else: + result.append(el) + result += [None] * (3 - len(result)) + + return ContextSet([iterable.Slice(context, *result)]) + elif index.type == 'subscriptlist': + return ContextSet([iterable.SequenceLiteralContext(evaluator, context, index)]) + + # No slices + return context.eval_node(index) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/sys_path.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/sys_path.py new file mode 100644 index 0000000..8dea434 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/sys_path.py @@ -0,0 +1,261 @@ +import os + +from jedi._compatibility import unicode, force_unicode, all_suffixes +from jedi.evaluate.cache import evaluator_method_cache +from jedi.evaluate.base_context import ContextualizedNode +from jedi.evaluate.helpers import is_string +from jedi.common.utils import traverse_parents +from jedi.parser_utils import get_cached_code_lines +from jedi.file_io import FileIO +from jedi import settings +from jedi import debug + + +def _abs_path(module_context, path): + if os.path.isabs(path): + return path + + module_path = module_context.py__file__() + if module_path is None: + # In this case we have no idea where we actually are in the file + # system. + return None + + base_dir = os.path.dirname(module_path) + path = force_unicode(path) + return os.path.abspath(os.path.join(base_dir, path)) + + +def _paths_from_assignment(module_context, expr_stmt): + """ + Extracts the assigned strings from an assignment that looks as follows:: + + sys.path[0:0] = ['module/path', 'another/module/path'] + + This function is in general pretty tolerant (and therefore 'buggy'). + However, it's not a big issue usually to add more paths to Jedi's sys_path, + because it will only affect Jedi in very random situations and by adding + more paths than necessary, it usually benefits the general user. + """ + for assignee, operator in zip(expr_stmt.children[::2], expr_stmt.children[1::2]): + try: + assert operator in ['=', '+='] + assert assignee.type in ('power', 'atom_expr') and \ + len(assignee.children) > 1 + c = assignee.children + assert c[0].type == 'name' and c[0].value == 'sys' + trailer = c[1] + assert trailer.children[0] == '.' and trailer.children[1].value == 'path' + # TODO Essentially we're not checking details on sys.path + # manipulation. Both assigment of the sys.path and changing/adding + # parts of the sys.path are the same: They get added to the end of + # the current sys.path. + """ + execution = c[2] + assert execution.children[0] == '[' + subscript = execution.children[1] + assert subscript.type == 'subscript' + assert ':' in subscript.children + """ + except AssertionError: + continue + + cn = ContextualizedNode(module_context.create_context(expr_stmt), expr_stmt) + for lazy_context in cn.infer().iterate(cn): + for context in lazy_context.infer(): + if is_string(context): + abs_path = _abs_path(module_context, context.get_safe_value()) + if abs_path is not None: + yield abs_path + + +def _paths_from_list_modifications(module_context, trailer1, trailer2): + """ extract the path from either "sys.path.append" or "sys.path.insert" """ + # Guarantee that both are trailers, the first one a name and the second one + # a function execution with at least one param. + if not (trailer1.type == 'trailer' and trailer1.children[0] == '.' + and trailer2.type == 'trailer' and trailer2.children[0] == '(' + and len(trailer2.children) == 3): + return + + name = trailer1.children[1].value + if name not in ['insert', 'append']: + return + arg = trailer2.children[1] + if name == 'insert' and len(arg.children) in (3, 4): # Possible trailing comma. + arg = arg.children[2] + + for context in module_context.create_context(arg).eval_node(arg): + if is_string(context): + abs_path = _abs_path(module_context, context.get_safe_value()) + if abs_path is not None: + yield abs_path + + +@evaluator_method_cache(default=[]) +def check_sys_path_modifications(module_context): + """ + Detect sys.path modifications within module. + """ + def get_sys_path_powers(names): + for name in names: + power = name.parent.parent + if power is not None and power.type in ('power', 'atom_expr'): + c = power.children + if c[0].type == 'name' and c[0].value == 'sys' \ + and c[1].type == 'trailer': + n = c[1].children[1] + if n.type == 'name' and n.value == 'path': + yield name, power + + if module_context.tree_node is None: + return [] + + added = [] + try: + possible_names = module_context.tree_node.get_used_names()['path'] + except KeyError: + pass + else: + for name, power in get_sys_path_powers(possible_names): + expr_stmt = power.parent + if len(power.children) >= 4: + added.extend( + _paths_from_list_modifications( + module_context, *power.children[2:4] + ) + ) + elif expr_stmt is not None and expr_stmt.type == 'expr_stmt': + added.extend(_paths_from_assignment(module_context, expr_stmt)) + return added + + +def discover_buildout_paths(evaluator, script_path): + buildout_script_paths = set() + + for buildout_script_path in _get_buildout_script_paths(script_path): + for path in _get_paths_from_buildout_script(evaluator, buildout_script_path): + buildout_script_paths.add(path) + + return buildout_script_paths + + +def _get_paths_from_buildout_script(evaluator, buildout_script_path): + file_io = FileIO(buildout_script_path) + try: + module_node = evaluator.parse( + file_io=file_io, + cache=True, + cache_path=settings.cache_directory + ) + except IOError: + debug.warning('Error trying to read buildout_script: %s', buildout_script_path) + return + + from jedi.evaluate.context import ModuleContext + module = ModuleContext( + evaluator, module_node, file_io, + string_names=None, + code_lines=get_cached_code_lines(evaluator.grammar, buildout_script_path), + ) + for path in check_sys_path_modifications(module): + yield path + + +def _get_parent_dir_with_file(path, filename): + for parent in traverse_parents(path): + if os.path.isfile(os.path.join(parent, filename)): + return parent + return None + + +def _get_buildout_script_paths(search_path): + """ + if there is a 'buildout.cfg' file in one of the parent directories of the + given module it will return a list of all files in the buildout bin + directory that look like python files. + + :param search_path: absolute path to the module. + :type search_path: str + """ + project_root = _get_parent_dir_with_file(search_path, 'buildout.cfg') + if not project_root: + return + bin_path = os.path.join(project_root, 'bin') + if not os.path.exists(bin_path): + return + + for filename in os.listdir(bin_path): + try: + filepath = os.path.join(bin_path, filename) + with open(filepath, 'r') as f: + firstline = f.readline() + if firstline.startswith('#!') and 'python' in firstline: + yield filepath + except (UnicodeDecodeError, IOError) as e: + # Probably a binary file; permission error or race cond. because + # file got deleted. Ignore it. + debug.warning(unicode(e)) + continue + + +def remove_python_path_suffix(path): + for suffix in all_suffixes(): + if path.endswith(suffix): + path = path[:-len(suffix)] + break + return path + + +def transform_path_to_dotted(sys_path, module_path): + """ + Returns the dotted path inside a sys.path as a list of names. e.g. + + >>> from os.path import abspath + >>> transform_path_to_dotted([abspath("/foo")], abspath('/foo/bar/baz.py')) + (('bar', 'baz'), False) + + Returns (None, False) if the path doesn't really resolve to anything. + The second return part is if it is a package. + """ + # First remove the suffix. + module_path = remove_python_path_suffix(module_path) + + # Once the suffix was removed we are using the files as we know them. This + # means that if someone uses an ending like .vim for a Python file, .vim + # will be part of the returned dotted part. + + is_package = module_path.endswith(os.path.sep + '__init__') + if is_package: + # -1 to remove the separator + module_path = module_path[:-len('__init__') - 1] + + def iter_potential_solutions(): + for p in sys_path: + if module_path.startswith(p): + # Strip the trailing slash/backslash + rest = module_path[len(p):] + # On Windows a path can also use a slash. + if rest.startswith(os.path.sep) or rest.startswith('/'): + # Remove a slash in cases it's still there. + rest = rest[1:] + + if rest: + split = rest.split(os.path.sep) + if not all(split): + # This means that part of the file path was empty, this + # is very strange and is probably a file that is called + # `.py`. + return + yield tuple(split) + + potential_solutions = tuple(iter_potential_solutions()) + if not potential_solutions: + return None, False + # Try to find the shortest path, this makes more sense usually, because the + # user usually has venvs somewhere. This means that a path like + # .tox/py37/lib/python3.7/os.py can be normal for a file. However in that + # case we definitely want to return ['os'] as a path and not a crazy + # ['.tox', 'py37', 'lib', 'python3.7', 'os']. Keep in mind that this is a + # heuristic and there's now ay to "always" do it right. + return sorted(potential_solutions, key=lambda p: len(p))[0], is_package diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/usages.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/usages.py new file mode 100644 index 0000000..9c8d265 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/usages.py @@ -0,0 +1,61 @@ +from jedi.evaluate import imports +from jedi.evaluate.names import TreeNameDefinition + + +def _resolve_names(definition_names, avoid_names=()): + for name in definition_names: + if name in avoid_names: + # Avoiding recursions here, because goto on a module name lands + # on the same module. + continue + + if not isinstance(name, imports.SubModuleName): + # SubModuleNames are not actually existing names but created + # names when importing something like `import foo.bar.baz`. + yield name + + if name.api_type == 'module': + for name in _resolve_names(name.goto(), definition_names): + yield name + + +def _dictionarize(names): + return dict( + (n if n.tree_name is None else n.tree_name, n) + for n in names + ) + + +def _find_names(module_context, tree_name): + context = module_context.create_context(tree_name) + name = TreeNameDefinition(context, tree_name) + found_names = set(name.goto()) + found_names.add(name) + return _dictionarize(_resolve_names(found_names)) + + +def usages(module_context, tree_name): + search_name = tree_name.value + found_names = _find_names(module_context, tree_name) + modules = set(d.get_root_context() for d in found_names.values()) + modules = set(m for m in modules if m.is_module() and not m.is_compiled()) + + non_matching_usage_maps = {} + for m in imports.get_modules_containing_name(module_context.evaluator, modules, search_name): + for name_leaf in m.tree_node.get_used_names().get(search_name, []): + new = _find_names(m, name_leaf) + if any(tree_name in found_names for tree_name in new): + found_names.update(new) + for tree_name in new: + for dct in non_matching_usage_maps.get(tree_name, []): + # A usage that was previously searched for matches with + # a now found name. Merge. + found_names.update(dct) + try: + del non_matching_usage_maps[tree_name] + except KeyError: + pass + else: + for name in new: + non_matching_usage_maps.setdefault(name, []).append(new) + return found_names.values() diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/utils.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/utils.py new file mode 100644 index 0000000..990a995 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/evaluate/utils.py @@ -0,0 +1,119 @@ +""" A universal module with functions / classes without dependencies. """ +import sys +import contextlib +import functools +import re +import os + +from jedi._compatibility import reraise + + +_sep = os.path.sep +if os.path.altsep is not None: + _sep += os.path.altsep +_path_re = re.compile(r'(?:\.[^{0}]+|[{0}]__init__\.py)$'.format(re.escape(_sep))) +del _sep + + +def to_list(func): + def wrapper(*args, **kwargs): + return list(func(*args, **kwargs)) + return wrapper + + +def unite(iterable): + """Turns a two dimensional array into a one dimensional.""" + return set(typ for types in iterable for typ in types) + + +class UncaughtAttributeError(Exception): + """ + Important, because `__getattr__` and `hasattr` catch AttributeErrors + implicitly. This is really evil (mainly because of `__getattr__`). + `hasattr` in Python 2 is even more evil, because it catches ALL exceptions. + Therefore this class originally had to be derived from `BaseException` + instead of `Exception`. But because I removed relevant `hasattr` from + the code base, we can now switch back to `Exception`. + + :param base: return values of sys.exc_info(). + """ + + +def safe_property(func): + return property(reraise_uncaught(func)) + + +def reraise_uncaught(func): + """ + Re-throw uncaught `AttributeError`. + + Usage: Put ``@rethrow_uncaught`` in front of the function + which does **not** suppose to raise `AttributeError`. + + AttributeError is easily get caught by `hasattr` and another + ``except AttributeError`` clause. This becomes problem when you use + a lot of "dynamic" attributes (e.g., using ``@property``) because you + can't distinguish if the property does not exist for real or some code + inside of the "dynamic" attribute through that error. In a well + written code, such error should not exist but getting there is very + difficult. This decorator is to help us getting there by changing + `AttributeError` to `UncaughtAttributeError` to avoid unexpected catch. + This helps us noticing bugs earlier and facilitates debugging. + + .. note:: Treating StopIteration here is easy. + Add that feature when needed. + """ + @functools.wraps(func) + def wrapper(*args, **kwds): + try: + return func(*args, **kwds) + except AttributeError: + exc_info = sys.exc_info() + reraise(UncaughtAttributeError(exc_info[1]), exc_info[2]) + return wrapper + + +class PushBackIterator(object): + def __init__(self, iterator): + self.pushes = [] + self.iterator = iterator + self.current = None + + def push_back(self, value): + self.pushes.append(value) + + def __iter__(self): + return self + + def next(self): + """ Python 2 Compatibility """ + return self.__next__() + + def __next__(self): + if self.pushes: + self.current = self.pushes.pop() + else: + self.current = next(self.iterator) + return self.current + + +@contextlib.contextmanager +def ignored(*exceptions): + """ + Context manager that ignores all of the specified exceptions. This will + be in the standard library starting with Python 3.4. + """ + try: + yield + except exceptions: + pass + + +def indent_block(text, indention=' '): + """This function indents a text block with a default of four spaces.""" + temp = '' + while text and text[-1] == '\n': + temp += text[-1] + text = text[:-1] + lines = text.split('\n') + return '\n'.join(map(lambda s: indention + s, lines)) + temp diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/file_io.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/file_io.py new file mode 100644 index 0000000..37d958e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/file_io.py @@ -0,0 +1,48 @@ +import os + +from parso import file_io + + +class AbstractFolderIO(object): + def __init__(self, path): + self.path = path + + def list(self): + raise NotImplementedError + + def get_file_io(self, name): + raise NotImplementedError + + +class FolderIO(AbstractFolderIO): + def list(self): + return os.listdir(self.path) + + def get_file_io(self, name): + return FileIO(os.path.join(self.path, name)) + + +class FileIOFolderMixin(object): + def get_parent_folder(self): + return FolderIO(os.path.dirname(self.path)) + + +class ZipFileIO(file_io.KnownContentFileIO, FileIOFolderMixin): + """For .zip and .egg archives""" + def __init__(self, path, code, zip_path): + super(ZipFileIO, self).__init__(path, code) + self._zip_path = zip_path + + def get_last_modified(self): + try: + return os.path.getmtime(self._zip_path) + except OSError: # Python 3 would probably only need FileNotFoundError + return None + + +class FileIO(file_io.FileIO, FileIOFolderMixin): + pass + + +class KnownContentFileIO(file_io.KnownContentFileIO, FileIOFolderMixin): + pass diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/parser_utils.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/parser_utils.py new file mode 100644 index 0000000..99d7a96 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/parser_utils.py @@ -0,0 +1,297 @@ +import re +import textwrap +from inspect import cleandoc +from weakref import WeakKeyDictionary + +from parso.python import tree +from parso.cache import parser_cache +from parso import split_lines + +from jedi._compatibility import literal_eval, force_unicode + +_EXECUTE_NODES = {'funcdef', 'classdef', 'import_from', 'import_name', 'test', + 'or_test', 'and_test', 'not_test', 'comparison', 'expr', + 'xor_expr', 'and_expr', 'shift_expr', 'arith_expr', + 'atom_expr', 'term', 'factor', 'power', 'atom'} + +_FLOW_KEYWORDS = ( + 'try', 'except', 'finally', 'else', 'if', 'elif', 'with', 'for', 'while' +) + + +def get_executable_nodes(node, last_added=False): + """ + For static analysis. + """ + result = [] + typ = node.type + if typ == 'name': + next_leaf = node.get_next_leaf() + if last_added is False and node.parent.type != 'param' and next_leaf != '=': + result.append(node) + elif typ == 'expr_stmt': + # I think evaluating the statement (and possibly returned arrays), + # should be enough for static analysis. + result.append(node) + for child in node.children: + result += get_executable_nodes(child, last_added=True) + elif typ == 'decorator': + # decorator + if node.children[-2] == ')': + node = node.children[-3] + if node != '(': + result += get_executable_nodes(node) + else: + try: + children = node.children + except AttributeError: + pass + else: + if node.type in _EXECUTE_NODES and not last_added: + result.append(node) + + for child in children: + result += get_executable_nodes(child, last_added) + + return result + + +def get_sync_comp_fors(comp_for): + yield comp_for + last = comp_for.children[-1] + while True: + if last.type == 'comp_for': + yield last.children[1] # Ignore the async. + elif last.type == 'sync_comp_for': + yield last + elif not last.type == 'comp_if': + break + last = last.children[-1] + + +def for_stmt_defines_one_name(for_stmt): + """ + Returns True if only one name is returned: ``for x in y``. + Returns False if the for loop is more complicated: ``for x, z in y``. + + :returns: bool + """ + return for_stmt.children[1].type == 'name' + + +def get_flow_branch_keyword(flow_node, node): + start_pos = node.start_pos + if not (flow_node.start_pos < start_pos <= flow_node.end_pos): + raise ValueError('The node is not part of the flow.') + + keyword = None + for i, child in enumerate(flow_node.children): + if start_pos < child.start_pos: + return keyword + first_leaf = child.get_first_leaf() + if first_leaf in _FLOW_KEYWORDS: + keyword = first_leaf + return 0 + + +def get_statement_of_position(node, pos): + for c in node.children: + if c.start_pos <= pos <= c.end_pos: + if c.type not in ('decorated', 'simple_stmt', 'suite', + 'async_stmt', 'async_funcdef') \ + and not isinstance(c, (tree.Flow, tree.ClassOrFunc)): + return c + else: + try: + return get_statement_of_position(c, pos) + except AttributeError: + pass # Must be a non-scope + return None + + +def clean_scope_docstring(scope_node): + """ Returns a cleaned version of the docstring token. """ + node = scope_node.get_doc_node() + if node is not None: + # TODO We have to check next leaves until there are no new + # leaves anymore that might be part of the docstring. A + # docstring can also look like this: ``'foo' 'bar' + # Returns a literal cleaned version of the ``Token``. + cleaned = cleandoc(safe_literal_eval(node.value)) + # Since we want the docstr output to be always unicode, just + # force it. + return force_unicode(cleaned) + return '' + + +def safe_literal_eval(value): + first_two = value[:2].lower() + if first_two[0] == 'f' or first_two in ('fr', 'rf'): + # literal_eval is not able to resovle f literals. We have to do that + # manually, but that's right now not implemented. + return '' + + try: + return literal_eval(value) + except SyntaxError: + # It's possible to create syntax errors with literals like rb'' in + # Python 2. This should not be possible and in that case just return an + # empty string. + # Before Python 3.3 there was a more strict definition in which order + # you could define literals. + return '' + + +def get_call_signature(funcdef, width=72, call_string=None, + omit_first_param=False, omit_return_annotation=False): + """ + Generate call signature of this function. + + :param width: Fold lines if a line is longer than this value. + :type width: int + :arg func_name: Override function name when given. + :type func_name: str + + :rtype: str + """ + # Lambdas have no name. + if call_string is None: + if funcdef.type == 'lambdef': + call_string = '' + else: + call_string = funcdef.name.value + params = funcdef.get_params() + if omit_first_param: + params = params[1:] + p = '(' + ''.join(param.get_code() for param in params).strip() + ')' + # TODO this is pretty bad, we should probably just normalize. + p = re.sub(r'\s+', ' ', p) + if funcdef.annotation and not omit_return_annotation: + rtype = " ->" + funcdef.annotation.get_code() + else: + rtype = "" + code = call_string + p + rtype + + return '\n'.join(textwrap.wrap(code, width)) + + +def move(node, line_offset): + """ + Move the `Node` start_pos. + """ + try: + children = node.children + except AttributeError: + node.line += line_offset + else: + for c in children: + move(c, line_offset) + + +def get_following_comment_same_line(node): + """ + returns (as string) any comment that appears on the same line, + after the node, including the # + """ + try: + if node.type == 'for_stmt': + whitespace = node.children[5].get_first_leaf().prefix + elif node.type == 'with_stmt': + whitespace = node.children[3].get_first_leaf().prefix + elif node.type == 'funcdef': + # actually on the next line + whitespace = node.children[4].get_first_leaf().get_next_leaf().prefix + else: + whitespace = node.get_last_leaf().get_next_leaf().prefix + except AttributeError: + return None + except ValueError: + # TODO in some particular cases, the tree doesn't seem to be linked + # correctly + return None + if "#" not in whitespace: + return None + comment = whitespace[whitespace.index("#"):] + if "\r" in comment: + comment = comment[:comment.index("\r")] + if "\n" in comment: + comment = comment[:comment.index("\n")] + return comment + + +def is_scope(node): + t = node.type + if t == 'comp_for': + # Starting with Python 3.8, async is outside of the statement. + return node.children[1].type != 'sync_comp_for' + + return t in ('file_input', 'classdef', 'funcdef', 'lambdef', 'sync_comp_for') + + +def _get_parent_scope_cache(func): + cache = WeakKeyDictionary() + + def wrapper(used_names, node, include_flows=False): + try: + for_module = cache[used_names] + except KeyError: + for_module = cache[used_names] = {} + + try: + return for_module[node] + except KeyError: + result = for_module[node] = func(node, include_flows) + return result + return wrapper + + +def get_parent_scope(node, include_flows=False): + """ + Returns the underlying scope. + """ + scope = node.parent + if scope is None: + return None # It's a module already. + + while True: + if is_scope(scope) or include_flows and isinstance(scope, tree.Flow): + if scope.type in ('classdef', 'funcdef', 'lambdef'): + index = scope.children.index(':') + if scope.children[index].start_pos >= node.start_pos: + if node.parent.type == 'param' and node.parent.name == node: + pass + elif node.parent.type == 'tfpdef' and node.parent.children[0] == node: + pass + else: + scope = scope.parent + continue + return scope + scope = scope.parent + return scope + + +get_cached_parent_scope = _get_parent_scope_cache(get_parent_scope) + + +def get_cached_code_lines(grammar, path): + """ + Basically access the cached code lines in parso. This is not the nicest way + to do this, but we avoid splitting all the lines again. + """ + return parser_cache[grammar._hashed][path].lines + + +def cut_value_at_position(leaf, position): + """ + Cuts of the value of the leaf at position + """ + lines = split_lines(leaf.value, keepends=True)[:position[0] - leaf.line + 1] + column = position[1] + if leaf.line == position[0]: + column -= leaf.column + lines[-1] = lines[-1][:column] + return ''.join(lines) + + +def get_string_quote(leaf): + return re.match('\w*("""|\'{3}|"|\')', leaf.value).group(1) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/plugins/__init__.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/plugins/__init__.py new file mode 100644 index 0000000..df106cf --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/plugins/__init__.py @@ -0,0 +1,47 @@ +from functools import wraps + + +class _PluginManager(object): + def __init__(self): + self._registered_plugins = [] + self._cached_base_callbacks = {} + self._built_functions = {} + + def register(self, *plugins): + """ + Makes it possible to register your plugin. + """ + self._registered_plugins.extend(plugins) + self._build_functions() + + def decorate(self): + def decorator(callback): + @wraps(callback) + def wrapper(*args, **kwargs): + return built_functions[name](*args, **kwargs) + + name = callback.__name__ + + assert name not in self._built_functions + built_functions = self._built_functions + built_functions[name] = callback + self._cached_base_callbacks[name] = callback + + return wrapper + + return decorator + + def _build_functions(self): + for name, callback in self._cached_base_callbacks.items(): + for plugin in reversed(self._registered_plugins): + # Need to reverse so the first plugin is run first. + try: + func = getattr(plugin, name) + except AttributeError: + pass + else: + callback = func(callback) + self._built_functions[name] = callback + + +plugin_manager = _PluginManager() diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/plugins/flask.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/plugins/flask.py new file mode 100644 index 0000000..7cbb106 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/plugins/flask.py @@ -0,0 +1,21 @@ +def import_module(callback): + """ + Handle "magic" Flask extension imports: + ``flask.ext.foo`` is really ``flask_foo`` or ``flaskext.foo``. + """ + def wrapper(evaluator, import_names, module_context, *args, **kwargs): + if len(import_names) == 3 and import_names[:2] == ('flask', 'ext'): + # New style. + ipath = (u'flask_' + import_names[2]), + context_set = callback(evaluator, ipath, None, *args, **kwargs) + if context_set: + return context_set + context_set = callback(evaluator, (u'flaskext',), None, *args, **kwargs) + return callback( + evaluator, + (u'flaskext', import_names[2]), + next(iter(context_set)), + *args, **kwargs + ) + return callback(evaluator, import_names, module_context, *args, **kwargs) + return wrapper diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/plugins/registry.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/plugins/registry.py new file mode 100644 index 0000000..2391324 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/plugins/registry.py @@ -0,0 +1,10 @@ +""" +This is not a plugin, this is just the place were plugins are registered. +""" + +from jedi.plugins import stdlib +from jedi.plugins import flask +from jedi.plugins import plugin_manager + + +plugin_manager.register(stdlib, flask) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/plugins/stdlib.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/plugins/stdlib.py new file mode 100644 index 0000000..2f2608f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/plugins/stdlib.py @@ -0,0 +1,835 @@ +""" +Implementations of standard library functions, because it's not possible to +understand them with Jedi. + +To add a new implementation, create a function and add it to the +``_implemented`` dict at the bottom of this module. + +Note that this module exists only to implement very specific functionality in +the standard library. The usual way to understand the standard library is the +compiled module that returns the types for C-builtins. +""" +import parso +import os + +from jedi._compatibility import force_unicode, Parameter +from jedi import debug +from jedi.evaluate.utils import safe_property +from jedi.evaluate.helpers import get_str_or_none +from jedi.evaluate.arguments import ValuesArguments, \ + repack_with_argument_clinic, AbstractArguments, TreeArgumentsWrapper +from jedi.evaluate import analysis +from jedi.evaluate import compiled +from jedi.evaluate.context.instance import BoundMethod, InstanceArguments +from jedi.evaluate.base_context import ContextualizedNode, \ + NO_CONTEXTS, ContextSet, ContextWrapper, LazyContextWrapper +from jedi.evaluate.context import ClassContext, ModuleContext, \ + FunctionExecutionContext +from jedi.evaluate.context.klass import ClassMixin +from jedi.evaluate.context.function import FunctionMixin +from jedi.evaluate.context import iterable +from jedi.evaluate.lazy_context import LazyTreeContext, LazyKnownContext, \ + LazyKnownContexts +from jedi.evaluate.names import ContextName, BaseTreeParamName +from jedi.evaluate.syntax_tree import is_string +from jedi.evaluate.filters import AttributeOverwrite, publish_method, \ + ParserTreeFilter, DictFilter +from jedi.evaluate.signature import AbstractSignature, SignatureWrapper + + +# Copied from Python 3.6's stdlib. +_NAMEDTUPLE_CLASS_TEMPLATE = """\ +_property = property +_tuple = tuple +from operator import itemgetter as _itemgetter +from collections import OrderedDict + +class {typename}(tuple): + '{typename}({arg_list})' + + __slots__ = () + + _fields = {field_names!r} + + def __new__(_cls, {arg_list}): + 'Create new instance of {typename}({arg_list})' + return _tuple.__new__(_cls, ({arg_list})) + + @classmethod + def _make(cls, iterable, new=tuple.__new__, len=len): + 'Make a new {typename} object from a sequence or iterable' + result = new(cls, iterable) + if len(result) != {num_fields:d}: + raise TypeError('Expected {num_fields:d} arguments, got %d' % len(result)) + return result + + def _replace(_self, **kwds): + 'Return a new {typename} object replacing specified fields with new values' + result = _self._make(map(kwds.pop, {field_names!r}, _self)) + if kwds: + raise ValueError('Got unexpected field names: %r' % list(kwds)) + return result + + def __repr__(self): + 'Return a nicely formatted representation string' + return self.__class__.__name__ + '({repr_fmt})' % self + + def _asdict(self): + 'Return a new OrderedDict which maps field names to their values.' + return OrderedDict(zip(self._fields, self)) + + def __getnewargs__(self): + 'Return self as a plain tuple. Used by copy and pickle.' + return tuple(self) + + # These methods were added by Jedi. + # __new__ doesn't really work with Jedi. So adding this to nametuples seems + # like the easiest way. + def __init__(_cls, {arg_list}): + 'A helper function for namedtuple.' + self.__iterable = ({arg_list}) + + def __iter__(self): + for i in self.__iterable: + yield i + + def __getitem__(self, y): + return self.__iterable[y] + +{field_defs} +""" + +_NAMEDTUPLE_FIELD_TEMPLATE = '''\ + {name} = _property(_itemgetter({index:d}), doc='Alias for field number {index:d}') +''' + + +def execute(callback): + def wrapper(context, arguments): + def call(): + return callback(context, arguments=arguments) + + try: + obj_name = context.name.string_name + except AttributeError: + pass + else: + if context.parent_context == context.evaluator.builtins_module: + module_name = 'builtins' + elif context.parent_context is not None and context.parent_context.is_module(): + module_name = context.parent_context.py__name__() + else: + return call() + + if isinstance(context, BoundMethod): + if module_name == 'builtins': + if context.py__name__() == '__get__': + if context.class_context.py__name__() == 'property': + return builtins_property( + context, + arguments=arguments, + callback=call, + ) + elif context.py__name__() in ('deleter', 'getter', 'setter'): + if context.class_context.py__name__() == 'property': + return ContextSet([context.instance]) + + return call() + + # for now we just support builtin functions. + try: + func = _implemented[module_name][obj_name] + except KeyError: + pass + else: + return func(context, arguments=arguments, callback=call) + return call() + + return wrapper + + +def _follow_param(evaluator, arguments, index): + try: + key, lazy_context = list(arguments.unpack())[index] + except IndexError: + return NO_CONTEXTS + else: + return lazy_context.infer() + + +def argument_clinic(string, want_obj=False, want_context=False, + want_arguments=False, want_evaluator=False, + want_callback=False): + """ + Works like Argument Clinic (PEP 436), to validate function params. + """ + + def f(func): + @repack_with_argument_clinic(string, keep_arguments_param=True, + keep_callback_param=True) + def wrapper(obj, *args, **kwargs): + arguments = kwargs.pop('arguments') + callback = kwargs.pop('callback') + assert not kwargs # Python 2... + debug.dbg('builtin start %s' % obj, color='MAGENTA') + result = NO_CONTEXTS + if want_context: + kwargs['context'] = arguments.context + if want_obj: + kwargs['obj'] = obj + if want_evaluator: + kwargs['evaluator'] = obj.evaluator + if want_arguments: + kwargs['arguments'] = arguments + if want_callback: + kwargs['callback'] = callback + result = func(*args, **kwargs) + debug.dbg('builtin end: %s', result, color='MAGENTA') + return result + + return wrapper + return f + + +@argument_clinic('obj, type, /', want_obj=True, want_arguments=True) +def builtins_property(objects, types, obj, arguments): + property_args = obj.instance.var_args.unpack() + key, lazy_context = next(property_args, (None, None)) + if key is not None or lazy_context is None: + debug.warning('property expected a first param, not %s', arguments) + return NO_CONTEXTS + + return lazy_context.infer().py__call__(arguments=ValuesArguments([objects])) + + +@argument_clinic('iterator[, default], /', want_evaluator=True) +def builtins_next(iterators, defaults, evaluator): + if evaluator.environment.version_info.major == 2: + name = 'next' + else: + name = '__next__' + + # TODO theoretically we have to check here if something is an iterator. + # That is probably done by checking if it's not a class. + return defaults | iterators.py__getattribute__(name).execute_evaluated() + + +@argument_clinic('iterator[, default], /') +def builtins_iter(iterators_or_callables, defaults): + # TODO implement this if it's a callable. + return iterators_or_callables.py__getattribute__('__iter__').execute_evaluated() + + +@argument_clinic('object, name[, default], /') +def builtins_getattr(objects, names, defaults=None): + # follow the first param + for obj in objects: + for name in names: + string = get_str_or_none(name) + if string is None: + debug.warning('getattr called without str') + continue + else: + return obj.py__getattribute__(force_unicode(string)) + return NO_CONTEXTS + + +@argument_clinic('object[, bases, dict], /') +def builtins_type(objects, bases, dicts): + if bases or dicts: + # It's a type creation... maybe someday... + return NO_CONTEXTS + else: + return objects.py__class__() + + +class SuperInstance(LazyContextWrapper): + """To be used like the object ``super`` returns.""" + def __init__(self, evaluator, instance): + self.evaluator = evaluator + self._instance = instance # Corresponds to super().__self__ + + def _get_bases(self): + return self._instance.py__class__().py__bases__() + + def _get_wrapped_context(self): + objs = self._get_bases()[0].infer().execute_evaluated() + if not objs: + # This is just a fallback and will only be used, if it's not + # possible to find a class + return self._instance + return next(iter(objs)) + + def get_filters(self, search_global=False, until_position=None, origin_scope=None): + for b in self._get_bases(): + for obj in b.infer().execute_evaluated(): + for f in obj.get_filters(): + yield f + + +@argument_clinic('[type[, obj]], /', want_context=True) +def builtins_super(types, objects, context): + if isinstance(context, FunctionExecutionContext): + if isinstance(context.var_args, InstanceArguments): + instance = context.var_args.instance + # TODO if a class is given it doesn't have to be the direct super + # class, it can be an anecestor from long ago. + return ContextSet({SuperInstance(instance.evaluator, instance)}) + + return NO_CONTEXTS + + +class ReversedObject(AttributeOverwrite): + def __init__(self, reversed_obj, iter_list): + super(ReversedObject, self).__init__(reversed_obj) + self._iter_list = iter_list + + @publish_method('__iter__') + def py__iter__(self, contextualized_node=None): + return self._iter_list + + @publish_method('next', python_version_match=2) + @publish_method('__next__', python_version_match=3) + def py__next__(self): + return ContextSet.from_sets( + lazy_context.infer() for lazy_context in self._iter_list + ) + + +@argument_clinic('sequence, /', want_obj=True, want_arguments=True) +def builtins_reversed(sequences, obj, arguments): + # While we could do without this variable (just by using sequences), we + # want static analysis to work well. Therefore we need to generated the + # values again. + key, lazy_context = next(arguments.unpack()) + cn = None + if isinstance(lazy_context, LazyTreeContext): + # TODO access private + cn = ContextualizedNode(lazy_context.context, lazy_context.data) + ordered = list(sequences.iterate(cn)) + + # Repack iterator values and then run it the normal way. This is + # necessary, because `reversed` is a function and autocompletion + # would fail in certain cases like `reversed(x).__iter__` if we + # just returned the result directly. + seq, = obj.evaluator.typing_module.py__getattribute__('Iterator').execute_evaluated() + return ContextSet([ReversedObject(seq, list(reversed(ordered)))]) + + +@argument_clinic('obj, type, /', want_arguments=True, want_evaluator=True) +def builtins_isinstance(objects, types, arguments, evaluator): + bool_results = set() + for o in objects: + cls = o.py__class__() + try: + cls.py__bases__ + except AttributeError: + # This is temporary. Everything should have a class attribute in + # Python?! Maybe we'll leave it here, because some numpy objects or + # whatever might not. + bool_results = set([True, False]) + break + + mro = list(cls.py__mro__()) + + for cls_or_tup in types: + if cls_or_tup.is_class(): + bool_results.add(cls_or_tup in mro) + elif cls_or_tup.name.string_name == 'tuple' \ + and cls_or_tup.get_root_context() == evaluator.builtins_module: + # Check for tuples. + classes = ContextSet.from_sets( + lazy_context.infer() + for lazy_context in cls_or_tup.iterate() + ) + bool_results.add(any(cls in mro for cls in classes)) + else: + _, lazy_context = list(arguments.unpack())[1] + if isinstance(lazy_context, LazyTreeContext): + node = lazy_context.data + message = 'TypeError: isinstance() arg 2 must be a ' \ + 'class, type, or tuple of classes and types, ' \ + 'not %s.' % cls_or_tup + analysis.add(lazy_context.context, 'type-error-isinstance', node, message) + + return ContextSet( + compiled.builtin_from_name(evaluator, force_unicode(str(b))) + for b in bool_results + ) + + +class StaticMethodObject(AttributeOverwrite, ContextWrapper): + def get_object(self): + return self._wrapped_context + + def py__get__(self, instance, klass): + return ContextSet([self._wrapped_context]) + + +@argument_clinic('sequence, /') +def builtins_staticmethod(functions): + return ContextSet(StaticMethodObject(f) for f in functions) + + +class ClassMethodObject(AttributeOverwrite, ContextWrapper): + def __init__(self, class_method_obj, function): + super(ClassMethodObject, self).__init__(class_method_obj) + self._function = function + + def get_object(self): + return self._wrapped_context + + def py__get__(self, obj, class_context): + return ContextSet([ + ClassMethodGet(__get__, class_context, self._function) + for __get__ in self._wrapped_context.py__getattribute__('__get__') + ]) + + +class ClassMethodGet(AttributeOverwrite, ContextWrapper): + def __init__(self, get_method, klass, function): + super(ClassMethodGet, self).__init__(get_method) + self._class = klass + self._function = function + + def get_signatures(self): + return self._function.get_signatures() + + def get_object(self): + return self._wrapped_context + + def py__call__(self, arguments): + return self._function.execute(ClassMethodArguments(self._class, arguments)) + + +class ClassMethodArguments(TreeArgumentsWrapper): + def __init__(self, klass, arguments): + super(ClassMethodArguments, self).__init__(arguments) + self._class = klass + + def unpack(self, func=None): + yield None, LazyKnownContext(self._class) + for values in self._wrapped_arguments.unpack(func): + yield values + + +@argument_clinic('sequence, /', want_obj=True, want_arguments=True) +def builtins_classmethod(functions, obj, arguments): + return ContextSet( + ClassMethodObject(class_method_object, function) + for class_method_object in obj.py__call__(arguments=arguments) + for function in functions + ) + + +def collections_namedtuple(obj, arguments, callback): + """ + Implementation of the namedtuple function. + + This has to be done by processing the namedtuple class template and + evaluating the result. + + """ + evaluator = obj.evaluator + + # Process arguments + name = u'jedi_unknown_namedtuple' + for c in _follow_param(evaluator, arguments, 0): + x = get_str_or_none(c) + if x is not None: + name = force_unicode(x) + break + + # TODO here we only use one of the types, we should use all. + param_contexts = _follow_param(evaluator, arguments, 1) + if not param_contexts: + return NO_CONTEXTS + _fields = list(param_contexts)[0] + string = get_str_or_none(_fields) + if string is not None: + fields = force_unicode(string).replace(',', ' ').split() + elif isinstance(_fields, iterable.Sequence): + fields = [ + force_unicode(get_str_or_none(v)) + for lazy_context in _fields.py__iter__() + for v in lazy_context.infer() + ] + fields = [f for f in fields if f is not None] + else: + return NO_CONTEXTS + + # Build source code + code = _NAMEDTUPLE_CLASS_TEMPLATE.format( + typename=name, + field_names=tuple(fields), + num_fields=len(fields), + arg_list=repr(tuple(fields)).replace("u'", "").replace("'", "")[1:-1], + repr_fmt='', + field_defs='\n'.join(_NAMEDTUPLE_FIELD_TEMPLATE.format(index=index, name=name) + for index, name in enumerate(fields)) + ) + + # Parse source code + module = evaluator.grammar.parse(code) + generated_class = next(module.iter_classdefs()) + parent_context = ModuleContext( + evaluator, module, + file_io=None, + string_names=None, + code_lines=parso.split_lines(code, keepends=True), + ) + + return ContextSet([ClassContext(evaluator, parent_context, generated_class)]) + + +class PartialObject(object): + def __init__(self, actual_context, arguments): + self._actual_context = actual_context + self._arguments = arguments + + def __getattr__(self, name): + return getattr(self._actual_context, name) + + def _get_function(self, unpacked_arguments): + key, lazy_context = next(unpacked_arguments, (None, None)) + if key is not None or lazy_context is None: + debug.warning("Partial should have a proper function %s", self._arguments) + return None + return lazy_context.infer() + + def get_signatures(self): + unpacked_arguments = self._arguments.unpack() + func = self._get_function(unpacked_arguments) + if func is None: + return [] + + arg_count = 0 + keys = set() + for key, _ in unpacked_arguments: + if key is None: + arg_count += 1 + else: + keys.add(key) + return [PartialSignature(s, arg_count, keys) for s in func.get_signatures()] + + def py__call__(self, arguments): + func = self._get_function(self._arguments.unpack()) + if func is None: + return NO_CONTEXTS + + return func.execute( + MergedPartialArguments(self._arguments, arguments) + ) + + +class PartialSignature(SignatureWrapper): + def __init__(self, wrapped_signature, skipped_arg_count, skipped_arg_set): + super(PartialSignature, self).__init__(wrapped_signature) + self._skipped_arg_count = skipped_arg_count + self._skipped_arg_set = skipped_arg_set + + def get_param_names(self, resolve_stars=False): + names = self._wrapped_signature.get_param_names()[self._skipped_arg_count:] + return [n for n in names if n.string_name not in self._skipped_arg_set] + + +class MergedPartialArguments(AbstractArguments): + def __init__(self, partial_arguments, call_arguments): + self._partial_arguments = partial_arguments + self._call_arguments = call_arguments + + def unpack(self, funcdef=None): + unpacked = self._partial_arguments.unpack(funcdef) + # Ignore this one, it's the function. It was checked before that it's + # there. + next(unpacked) + for key_lazy_context in unpacked: + yield key_lazy_context + for key_lazy_context in self._call_arguments.unpack(funcdef): + yield key_lazy_context + + +def functools_partial(obj, arguments, callback): + return ContextSet( + PartialObject(instance, arguments) + for instance in obj.py__call__(arguments) + ) + + +@argument_clinic('first, /') +def _return_first_param(firsts): + return firsts + + +@argument_clinic('seq') +def _random_choice(sequences): + return ContextSet.from_sets( + lazy_context.infer() + for sequence in sequences + for lazy_context in sequence.py__iter__() + ) + + +def _dataclass(obj, arguments, callback): + for c in _follow_param(obj.evaluator, arguments, 0): + if c.is_class(): + return ContextSet([DataclassWrapper(c)]) + else: + return ContextSet([obj]) + return NO_CONTEXTS + + +class DataclassWrapper(ContextWrapper, ClassMixin): + def get_signatures(self): + param_names = [] + for cls in reversed(list(self.py__mro__())): + if isinstance(cls, DataclassWrapper): + filter_ = cls.get_global_filter() + # .values ordering is not guaranteed, at least not in + # Python < 3.6, when dicts where not ordered, which is an + # implementation detail anyway. + for name in sorted(filter_.values(), key=lambda name: name.start_pos): + d = name.tree_name.get_definition() + annassign = d.children[1] + if d.type == 'expr_stmt' and annassign.type == 'annassign': + if len(annassign.children) < 4: + default = None + else: + default = annassign.children[3] + param_names.append(DataclassParamName( + parent_context=cls.parent_context, + tree_name=name.tree_name, + annotation_node=annassign.children[1], + default_node=default, + )) + return [DataclassSignature(cls, param_names)] + + +class DataclassSignature(AbstractSignature): + def __init__(self, context, param_names): + super(DataclassSignature, self).__init__(context) + self._param_names = param_names + + def get_param_names(self, resolve_stars=False): + return self._param_names + + +class DataclassParamName(BaseTreeParamName): + def __init__(self, parent_context, tree_name, annotation_node, default_node): + super(DataclassParamName, self).__init__(parent_context, tree_name) + self.annotation_node = annotation_node + self.default_node = default_node + + def get_kind(self): + return Parameter.POSITIONAL_OR_KEYWORD + + def infer(self): + if self.annotation_node is None: + return NO_CONTEXTS + else: + return self.parent_context.eval_node(self.annotation_node) + + +class ItemGetterCallable(ContextWrapper): + def __init__(self, instance, args_context_set): + super(ItemGetterCallable, self).__init__(instance) + self._args_context_set = args_context_set + + @repack_with_argument_clinic('item, /') + def py__call__(self, item_context_set): + context_set = NO_CONTEXTS + for args_context in self._args_context_set: + lazy_contexts = list(args_context.py__iter__()) + if len(lazy_contexts) == 1: + # TODO we need to add the contextualized context. + context_set |= item_context_set.get_item(lazy_contexts[0].infer(), None) + else: + context_set |= ContextSet([iterable.FakeSequence( + self._wrapped_context.evaluator, + 'list', + [ + LazyKnownContexts(item_context_set.get_item(lazy_context.infer(), None)) + for lazy_context in lazy_contexts + ], + )]) + return context_set + + +@argument_clinic('func, /') +def _functools_wraps(funcs): + return ContextSet(WrapsCallable(func) for func in funcs) + + +class WrapsCallable(ContextWrapper): + # XXX this is not the correct wrapped context, it should be a weird + # partials object, but it doesn't matter, because it's always used as a + # decorator anyway. + @repack_with_argument_clinic('func, /') + def py__call__(self, funcs): + return ContextSet({Wrapped(func, self._wrapped_context) for func in funcs}) + + +class Wrapped(ContextWrapper, FunctionMixin): + def __init__(self, func, original_function): + super(Wrapped, self).__init__(func) + self._original_function = original_function + + @property + def name(self): + return self._original_function.name + + def get_signature_functions(self): + return [self] + + +@argument_clinic('*args, /', want_obj=True, want_arguments=True) +def _operator_itemgetter(args_context_set, obj, arguments): + return ContextSet([ + ItemGetterCallable(instance, args_context_set) + for instance in obj.py__call__(arguments) + ]) + + +def _create_string_input_function(func): + @argument_clinic('string, /', want_obj=True, want_arguments=True) + def wrapper(strings, obj, arguments): + def iterate(): + for context in strings: + s = get_str_or_none(context) + if s is not None: + s = func(s) + yield compiled.create_simple_object(context.evaluator, s) + contexts = ContextSet(iterate()) + if contexts: + return contexts + return obj.py__call__(arguments) + return wrapper + + +@argument_clinic('*args, /', want_callback=True) +def _os_path_join(args_set, callback): + if len(args_set) == 1: + string = u'' + sequence, = args_set + is_first = True + for lazy_context in sequence.py__iter__(): + string_contexts = lazy_context.infer() + if len(string_contexts) != 1: + break + s = get_str_or_none(next(iter(string_contexts))) + if s is None: + break + if not is_first: + string += os.path.sep + string += force_unicode(s) + is_first = False + else: + return ContextSet([compiled.create_simple_object(sequence.evaluator, string)]) + return callback() + + +_implemented = { + 'builtins': { + 'getattr': builtins_getattr, + 'type': builtins_type, + 'super': builtins_super, + 'reversed': builtins_reversed, + 'isinstance': builtins_isinstance, + 'next': builtins_next, + 'iter': builtins_iter, + 'staticmethod': builtins_staticmethod, + 'classmethod': builtins_classmethod, + }, + 'copy': { + 'copy': _return_first_param, + 'deepcopy': _return_first_param, + }, + 'json': { + 'load': lambda obj, arguments, callback: NO_CONTEXTS, + 'loads': lambda obj, arguments, callback: NO_CONTEXTS, + }, + 'collections': { + 'namedtuple': collections_namedtuple, + }, + 'functools': { + 'partial': functools_partial, + 'wraps': _functools_wraps, + }, + '_weakref': { + 'proxy': _return_first_param, + }, + 'random': { + 'choice': _random_choice, + }, + 'operator': { + 'itemgetter': _operator_itemgetter, + }, + 'abc': { + # Not sure if this is necessary, but it's used a lot in typeshed and + # it's for now easier to just pass the function. + 'abstractmethod': _return_first_param, + }, + 'typing': { + # The _alias function just leads to some annoying type inference. + # Therefore, just make it return nothing, which leads to the stubs + # being used instead. This only matters for 3.7+. + '_alias': lambda obj, arguments, callback: NO_CONTEXTS, + }, + 'dataclasses': { + # For now this works at least better than Jedi trying to understand it. + 'dataclass': _dataclass + }, + 'os.path': { + 'dirname': _create_string_input_function(os.path.dirname), + 'abspath': _create_string_input_function(os.path.abspath), + 'relpath': _create_string_input_function(os.path.relpath), + 'join': _os_path_join, + } +} + + +def get_metaclass_filters(func): + def wrapper(cls, metaclasses): + for metaclass in metaclasses: + if metaclass.py__name__() == 'EnumMeta' \ + and metaclass.get_root_context().py__name__() == 'enum': + filter_ = ParserTreeFilter(cls.evaluator, context=cls) + return [DictFilter({ + name.string_name: EnumInstance(cls, name).name for name in filter_.values() + })] + return func(cls, metaclasses) + return wrapper + + +class EnumInstance(LazyContextWrapper): + def __init__(self, cls, name): + self.evaluator = cls.evaluator + self._cls = cls # Corresponds to super().__self__ + self._name = name + self.tree_node = self._name.tree_name + + @safe_property + def name(self): + return ContextName(self, self._name.tree_name) + + def _get_wrapped_context(self): + obj, = self._cls.execute_evaluated() + return obj + + def get_filters(self, search_global=False, position=None, origin_scope=None): + yield DictFilter(dict( + name=compiled.create_simple_object(self.evaluator, self._name.string_name).name, + value=self._name, + )) + for f in self._get_wrapped_context().get_filters(): + yield f + + +def tree_name_to_contexts(func): + def wrapper(evaluator, context, tree_name): + if tree_name.value == 'sep' and context.is_module() and context.py__name__() == 'os.path': + return ContextSet({ + compiled.create_simple_object(evaluator, os.path.sep), + }) + return func(evaluator, context, tree_name) + return wrapper diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/refactoring.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/refactoring.py new file mode 100644 index 0000000..6c1d74d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/refactoring.py @@ -0,0 +1,203 @@ +""" +THIS is not in active development, please check +https://github.com/davidhalter/jedi/issues/667 first before editing. + +Introduce some basic refactoring functions to |jedi|. This module is still in a +very early development stage and needs much testing and improvement. + +.. warning:: I won't do too much here, but if anyone wants to step in, please + do. Refactoring is none of my priorities + +It uses the |jedi| `API `_ and supports currently the +following functions (sometimes bug-prone): + +- rename +- extract variable +- inline variable +""" +import difflib + +from parso import python_bytes_to_unicode, split_lines +from jedi.evaluate import helpers + + +class Refactoring(object): + def __init__(self, change_dct): + """ + :param change_dct: dict(old_path=(new_path, old_lines, new_lines)) + """ + self.change_dct = change_dct + + def old_files(self): + dct = {} + for old_path, (new_path, old_l, new_l) in self.change_dct.items(): + dct[old_path] = '\n'.join(old_l) + return dct + + def new_files(self): + dct = {} + for old_path, (new_path, old_l, new_l) in self.change_dct.items(): + dct[new_path] = '\n'.join(new_l) + return dct + + def diff(self): + texts = [] + for old_path, (new_path, old_l, new_l) in self.change_dct.items(): + if old_path: + udiff = difflib.unified_diff(old_l, new_l) + else: + udiff = difflib.unified_diff(old_l, new_l, old_path, new_path) + texts.append('\n'.join(udiff)) + return '\n'.join(texts) + + +def rename(script, new_name): + """ The `args` / `kwargs` params are the same as in `api.Script`. + :param new_name: The new name of the script. + :param script: The source Script object. + :return: list of changed lines/changed files + """ + return Refactoring(_rename(script.usages(), new_name)) + + +def _rename(names, replace_str): + """ For both rename and inline. """ + order = sorted(names, key=lambda x: (x.module_path, x.line, x.column), + reverse=True) + + def process(path, old_lines, new_lines): + if new_lines is not None: # goto next file, save last + dct[path] = path, old_lines, new_lines + + dct = {} + current_path = object() + new_lines = old_lines = None + for name in order: + if name.in_builtin_module(): + continue + if current_path != name.module_path: + current_path = name.module_path + + process(current_path, old_lines, new_lines) + if current_path is not None: + # None means take the source that is a normal param. + with open(current_path) as f: + source = f.read() + + new_lines = split_lines(python_bytes_to_unicode(source)) + old_lines = new_lines[:] + + nr, indent = name.line, name.column + line = new_lines[nr - 1] + new_lines[nr - 1] = line[:indent] + replace_str + \ + line[indent + len(name.name):] + process(current_path, old_lines, new_lines) + return dct + + +def extract(script, new_name): + """ The `args` / `kwargs` params are the same as in `api.Script`. + :param operation: The refactoring operation to execute. + :type operation: str + :type source: str + :return: list of changed lines/changed files + """ + new_lines = split_lines(python_bytes_to_unicode(script.source)) + old_lines = new_lines[:] + + user_stmt = script._parser.user_stmt() + + # TODO care for multi-line extracts + dct = {} + if user_stmt: + pos = script._pos + line_index = pos[0] - 1 + # Be careful here. 'array_for_pos' does not exist in 'helpers'. + arr, index = helpers.array_for_pos(user_stmt, pos) + if arr is not None: + start_pos = arr[index].start_pos + end_pos = arr[index].end_pos + + # take full line if the start line is different from end line + e = end_pos[1] if end_pos[0] == start_pos[0] else None + start_line = new_lines[start_pos[0] - 1] + text = start_line[start_pos[1]:e] + for l in range(start_pos[0], end_pos[0] - 1): + text += '\n' + str(l) + if e is None: + end_line = new_lines[end_pos[0] - 1] + text += '\n' + end_line[:end_pos[1]] + + # remove code from new lines + t = text.lstrip() + del_start = start_pos[1] + len(text) - len(t) + + text = t.rstrip() + del_end = len(t) - len(text) + if e is None: + new_lines[end_pos[0] - 1] = end_line[end_pos[1] - del_end:] + e = len(start_line) + else: + e = e - del_end + start_line = start_line[:del_start] + new_name + start_line[e:] + new_lines[start_pos[0] - 1] = start_line + new_lines[start_pos[0]:end_pos[0] - 1] = [] + + # add parentheses in multi-line case + open_brackets = ['(', '[', '{'] + close_brackets = [')', ']', '}'] + if '\n' in text and not (text[0] in open_brackets and text[-1] == + close_brackets[open_brackets.index(text[0])]): + text = '(%s)' % text + + # add new line before statement + indent = user_stmt.start_pos[1] + new = "%s%s = %s" % (' ' * indent, new_name, text) + new_lines.insert(line_index, new) + dct[script.path] = script.path, old_lines, new_lines + return Refactoring(dct) + + +def inline(script): + """ + :type script: api.Script + """ + new_lines = split_lines(python_bytes_to_unicode(script.source)) + + dct = {} + + definitions = script.goto_assignments() + assert len(definitions) == 1 + stmt = definitions[0]._definition + usages = script.usages() + inlines = [r for r in usages + if not stmt.start_pos <= (r.line, r.column) <= stmt.end_pos] + inlines = sorted(inlines, key=lambda x: (x.module_path, x.line, x.column), + reverse=True) + expression_list = stmt.expression_list() + # don't allow multi-line refactorings for now. + assert stmt.start_pos[0] == stmt.end_pos[0] + index = stmt.start_pos[0] - 1 + + line = new_lines[index] + replace_str = line[expression_list[0].start_pos[1]:stmt.end_pos[1] + 1] + replace_str = replace_str.strip() + # tuples need parentheses + if expression_list and isinstance(expression_list[0], pr.Array): + arr = expression_list[0] + if replace_str[0] not in ['(', '[', '{'] and len(arr) > 1: + replace_str = '(%s)' % replace_str + + # if it's the only assignment, remove the statement + if len(stmt.get_defined_names()) == 1: + line = line[:stmt.start_pos[1]] + line[stmt.end_pos[1]:] + + dct = _rename(inlines, replace_str) + # remove the empty line + new_lines = dct[script.path][2] + if line.strip(): + new_lines[index] = line + else: + new_lines.pop(index) + + return Refactoring(dct) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/settings.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/settings.py new file mode 100644 index 0000000..7b7de1b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/settings.py @@ -0,0 +1,163 @@ +""" +This module contains variables with global |jedi| settings. To change the +behavior of |jedi|, change the variables defined in :mod:`jedi.settings`. + +Plugins should expose an interface so that the user can adjust the +configuration. + + +Example usage:: + + from jedi import settings + settings.case_insensitive_completion = True + + +Completion output +~~~~~~~~~~~~~~~~~ + +.. autodata:: case_insensitive_completion +.. autodata:: add_bracket_after_function +.. autodata:: no_completion_duplicates + + +Filesystem cache +~~~~~~~~~~~~~~~~ + +.. autodata:: cache_directory +.. autodata:: use_filesystem_cache + + +Parser +~~~~~~ + +.. autodata:: fast_parser + + +Dynamic stuff +~~~~~~~~~~~~~ + +.. autodata:: dynamic_array_additions +.. autodata:: dynamic_params +.. autodata:: dynamic_params_for_other_modules +.. autodata:: additional_dynamic_modules +.. autodata:: auto_import_modules + + +Caching +~~~~~~~ + +.. autodata:: call_signatures_validity + + +""" +import os +import platform + +# ---------------- +# completion output settings +# ---------------- + +case_insensitive_completion = True +""" +The completion is by default case insensitive. +""" + +add_bracket_after_function = False +""" +Adds an opening bracket after a function, because that's normal behaviour. +Removed it again, because in VIM that is not very practical. +""" + +no_completion_duplicates = True +""" +If set, completions with the same name don't appear in the output anymore, +but are in the `same_name_completions` attribute. +""" + +# ---------------- +# Filesystem cache +# ---------------- + +use_filesystem_cache = True +""" +Use filesystem cache to save once parsed files with pickle. +""" + +if platform.system().lower() == 'windows': + _cache_directory = os.path.join(os.getenv('APPDATA') or '~', 'Jedi', + 'Jedi') +elif platform.system().lower() == 'darwin': + _cache_directory = os.path.join('~', 'Library', 'Caches', 'Jedi') +else: + _cache_directory = os.path.join(os.getenv('XDG_CACHE_HOME') or '~/.cache', + 'jedi') +cache_directory = os.path.expanduser(_cache_directory) +""" +The path where the cache is stored. + +On Linux, this defaults to ``~/.cache/jedi/``, on OS X to +``~/Library/Caches/Jedi/`` and on Windows to ``%APPDATA%\\Jedi\\Jedi\\``. +On Linux, if environment variable ``$XDG_CACHE_HOME`` is set, +``$XDG_CACHE_HOME/jedi`` is used instead of the default one. +""" + +# ---------------- +# parser +# ---------------- + +fast_parser = True +""" +Use the fast parser. This means that reparsing is only being done if +something has been changed e.g. to a function. If this happens, only the +function is being reparsed. +""" + +# ---------------- +# dynamic stuff +# ---------------- + +dynamic_array_additions = True +""" +check for `append`, etc. on arrays: [], {}, () as well as list/set calls. +""" + +dynamic_params = True +""" +A dynamic param completion, finds the callees of the function, which define +the params of a function. +""" + +dynamic_params_for_other_modules = True +""" +Do the same for other modules. +""" + +additional_dynamic_modules = [] +""" +Additional modules in which |jedi| checks if statements are to be found. This +is practical for IDEs, that want to administrate their modules themselves. +""" + +dynamic_flow_information = True +""" +Check for `isinstance` and other information to infer a type. +""" + +auto_import_modules = [ + 'gi', # This third-party repository (GTK stuff) doesn't really work with jedi +] +""" +Modules that are not analyzed but imported, although they contain Python code. +This improves autocompletion for libraries that use ``setattr`` or +``globals()`` modifications a lot. +""" + +# ---------------- +# caching validity (time) +# ---------------- + +call_signatures_validity = 3.0 +""" +Finding function calls might be slow (0.1-0.5s). This is not acceptible for +normal writing. Therefore cache it for a short time. +""" diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/.flake8 b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/.flake8 new file mode 100644 index 0000000..1d582c4 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/.flake8 @@ -0,0 +1,25 @@ +# Some PEP8 deviations are considered irrelevant to stub files: +# (error counts as of 2017-05-22) +# 17952 E704 multiple statements on one line (def) +# 12197 E301 expected 1 blank line +# 7155 E302 expected 2 blank lines +# 1463 F401 imported but unused +# 967 E701 multiple statements on one line (colon) +# 457 F811 redefinition +# 390 E305 expected 2 blank lines +# 4 E741 ambiguous variable name + +# Nice-to-haves ignored for now +# 2307 E501 line too long + +# Other ignored warnings +# W504 line break after binary operator + +[flake8] +ignore = F401, F403, F405, F811, E301, E302, E305, E501, E701, E704, E741, B303, W504 +# We are checking with Python 3 but many of the stubs are Python 2 stubs. +# A nice future improvement would be to provide separate .flake8 +# configurations for Python 2 and Python 3 files. +builtins = StandardError,apply,basestring,buffer,cmp,coerce,execfile,file,intern,long,raw_input,reduce,reload,unichr,unicode,xrange +exclude = .venv*,@*,.git +max-line-length = 130 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/.travis.yml b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/.travis.yml new file mode 100644 index 0000000..99a3c65 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/.travis.yml @@ -0,0 +1,30 @@ +dist: xenial +language: python +python: 3.7 + +matrix: + include: + - name: "pytype" + python: 3.6 + env: + - TEST_CMD="./tests/pytype_test.py" + - INSTALL="test" + - name: "mypy" + env: + - TEST_CMD="./tests/mypy_test.py" + - INSTALL="mypy" + - name: "mypy self test" + env: TEST_CMD="./tests/mypy_selftest.py" + - name: "check file consistency" + env: TEST_CMD="./tests/check_consistent.py" + - name: "flake8" + env: + - TEST_CMD="flake8" + - INSTALL="test" + +install: + - if [[ $INSTALL == 'test' ]]; then pip install -r requirements-tests-py3.txt; fi + - if [[ $INSTALL == 'mypy' ]]; then pip install -U git+git://github.com/python/mypy git+git://github.com/python/typed_ast; fi + +script: + - $TEST_CMD diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/CONTRIBUTING.md b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/CONTRIBUTING.md new file mode 100644 index 0000000..cb2452c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/CONTRIBUTING.md @@ -0,0 +1,382 @@ +# Contributing to typeshed + +Welcome! typeshed is a community project that aims to work for a wide +range of Python users and Python codebases. If you're trying a type +checker on your Python code, your experience and what you can contribute +are important to the project's success. + + +## The contribution process at a glance + +1. Read the [README.md file](README.md). +2. Set up your environment to be able to [run all tests](README.md#running-the-tests). They should pass. +3. [Prepare your changes](#preparing-changes): + * [Contact us](#discussion) before starting significant work. + * IMPORTANT: For new libraries, [get permission from the library owner first](#adding-a-new-library). + * Create your stubs [conforming to the coding style](#stub-file-coding-style). + * Make sure your tests pass cleanly on `mypy`, `pytype`, and `flake8`. +4. [Submit your changes](#submitting-changes): + * Open a pull request + * For new libraries, [include a reference to where you got permission](#adding-a-new-library) +5. You can expect a reply within a few days: + * Diffs are merged when considered ready by the core team. + * Feel free to ping the core team if your pull request goes without + a reply for more than a few days. + +For more details, read below. + + +## Discussion + +If you've run into behavior in the type checker that suggests the type +stubs for a given library are incorrect or incomplete, +we want to hear from you! + +Our main forum for discussion is the project's [GitHub issue +tracker](https://github.com/python/typeshed/issues). This is the right +place to start a discussion of any of the above or most any other +topic concerning the project. + +For less formal discussion, try the typing chat room on +[gitter.im](https://gitter.im/python/typing). Some Mypy core developers +are almost always present; feel free to find us there and we're happy +to chat. Substantive technical discussion will be directed to the +issue tracker. + +### Code of Conduct + +Everyone participating in the typeshed community, and in particular in +our issue tracker, pull requests, and IRC channel, is expected to treat +other people with respect and more generally to follow the guidelines +articulated in the [Python Community Code of +Conduct](https://www.python.org/psf/codeofconduct/). + + +## Submitting Changes + +Even more excellent than a good bug report is a fix for a bug, or the +implementation of a much-needed stub. We'd love to have +your contributions. + +We use the usual GitHub pull-request flow, which may be familiar to +you if you've contributed to other projects on GitHub. For the +mechanics, see [Mypy's git and GitHub workflow help page](https://github.com/python/mypy/wiki/Using-Git-And-GitHub), +or [GitHub's own documentation](https://help.github.com/articles/using-pull-requests/). + +Anyone interested in type stubs may review your code. One of the core +developers will merge your pull request when they think it's ready. +For every pull request, we aim to promptly either merge it or say why +it's not yet ready; if you go a few days without a reply, please feel +free to ping the thread by adding a new comment. + +To get your pull request merged sooner, you should explain why you are +making the change. For example, you can point to a code sample that is +processed incorrectly by a type checker. It is also helpful to add +links to online documentation or to the implementation of the code +you are changing. + +Also, do not squash your commits after you have submitted a pull request, as this +erases context during review. We will squash commits when the pull request is merged. + +At present the core developers are (alphabetically): +* David Fisher (@ddfisher) +* Łukasz Langa (@ambv) +* Jukka Lehtosalo (@JukkaL) +* Ivan Levkivskyi (@ilevkivskyi) +* Matthias Kramm (@matthiaskramm) +* Greg Price (@gnprice) +* Sebastian Rittau (@srittau) +* Guido van Rossum (@gvanrossum) +* Jelle Zijlstra (@JelleZijlstra) + +NOTE: the process for preparing and submitting changes also applies to +core developers. This ensures high quality contributions and keeps +everybody on the same page. Avoid direct pushes to the repository. + + +## Preparing Changes + +### Before you begin + +If your change will be a significant amount of work to write, we highly +recommend starting by opening an issue laying out what you want to do. +That lets a conversation happen early in case other contributors disagree +with what you'd like to do or have ideas that will help you do it. + +### Adding a new library + +If you want to submit type stubs for a new library, you need to +**contact the maintainers of the original library** first to let them +know and **get their permission**. Do it by opening an issue on their +project's bug tracker. This gives them the opportunity to +consider adopting type hints directly in their codebase (which you +should prefer to external type stubs). When the project owners agree +for you to submit stubs here or you do not receive a reply within +one month, open a pull request **referencing the +issue where you asked for permission**. + +Make sure your changes pass the tests (the [README](README.md#running-the-tests) +has more information). + +### What to include + +Stubs should include the complete interface (classes, functions, +constants, etc.) of the module they cover, but it is not always +clear exactly what is part of the interface. + +The following should always be included: +- All objects listed in the module's documentation. +- All objects included in ``__all__`` (if present). + +Other objects may be included if they are being used in practice +or if they are not prefixed with an underscore. This means +that typeshed will generally accept contributions that add missing +objects, even if they are undocumented. Undocumented objects should +be marked with a comment of the form ``# undocumented``. +Example: + +```python +def list2cmdline(seq: Sequence[str]) -> str: ... # undocumented +``` + +We accept such undocumented objects because omitting objects can confuse +users. Users who see an error like "module X has no attribute Y" will +not know whether the error appeared because their code had a bug or +because the stub is wrong. Although it may also be helpful for a type +checker to point out usage of private objects, we usually prefer false +negatives (no errors for wrong code) over false positives (type errors +for correct code). In addition, even for private objects a type checker +can be helpful in pointing out that an incorrect type was used. + +### Incomplete stubs + +We accept partial stubs, especially for larger packages. These need to +follow the following guidelines: + +* Included functions and methods must list all arguments, but the arguments + can be left unannotated. Do not use `Any` to mark unannotated arguments + or return values. +* Partial classes must include a `__getattr__()` method marked with an + `# incomplete` comment (see example below). +* Partial modules (i.e. modules that are missing some or all classes, + functions, or attributes) must include a top-level `__getattr__()` + function marked with an `# incomplete` comment (see example below). +* Partial packages (i.e. packages that are missing one or more sub-modules) + must have a `__init__.pyi` stub that is marked as incomplete (see above). + A better alternative is to create empty stubs for all sub-modules and + mark them as incomplete individually. + +Example of a partial module with a partial class `Foo` and a partially +annotated function `bar()`: + +```python +def __getattr__(name: str) -> Any: ... # incomplete + +class Foo: + def __getattr__(self, name: str) -> Any: # incomplete + x: int + y: str + +def bar(x: str, y, *, z=...): ... +``` + +### Using stubgen + +Mypy includes a tool called [stubgen](https://mypy.readthedocs.io/en/latest/stubgen.html) +that auto-generates stubs for Python and C modules using static analysis, +Sphinx docs, and runtime introspection. It can be used to get a starting +point for your stubs. Note that this generator is currently unable to +determine most argument and return types and omits them or uses ``Any`` in +their place. Fill out manually the types that you know. + +### Stub file coding style + +#### Syntax example + +The below is an excerpt from the types for the `datetime` module. + +```python +MAXYEAR: int +MINYEAR: int + +class date: + def __init__(self, year: int, month: int, day: int) -> None: ... + @classmethod + def fromtimestamp(cls, timestamp: float) -> date: ... + @classmethod + def today(cls) -> date: ... + @classmethod + def fromordinal(cls, ordinal: int) -> date: ... + @property + def year(self) -> int: ... + def replace(self, year: int = ..., month: int = ..., day: int = ...) -> date: ... + def ctime(self) -> str: ... + def weekday(self) -> int: ... +``` + +#### Conventions + +Stub files are *like* Python files and you should generally expect them +to look the same. Your tools should be able to successfully treat them +as regular Python files. However, there are a few important differences +you should know about. + +Style conventions for stub files are different from PEP 8. The general +rule is that they should be as concise as possible. Specifically: +* lines can be up to 130 characters long; +* functions and methods that don't fit in one line should be split up + with one argument per line; +* all function bodies should be empty; +* prefer ``...`` over ``pass``; +* prefer ``...`` on the same line as the class/function signature; +* avoid vertical whitespace between consecutive module-level functions, + names, or methods and fields within a single class; +* use a single blank line between top-level class definitions, or none + if the classes are very small; +* do not use docstrings; +* use variable annotations instead of type comments, even for stubs + that target older versions of Python; +* for arguments with a type and a default, use spaces around the `=`. +The code formatter [black](https://github.com/python/black) will format +stubs according to this standard. + +Stub files should only contain information necessary for the type +checker, and leave out unnecessary detail: +* for arguments with a default, use `...` instead of the actual + default; +* for arguments that default to `None`, use `Optional[]` explicitly + (see below for details); +* use `float` instead of `Union[int, float]`. + +Some further tips for good type hints: +* avoid invariant collection types (`List`, `Dict`) in argument + positions, in favor of covariant types like `Mapping` or `Sequence`; +* avoid Union return types: https://github.com/python/mypy/issues/1693; +* in Python 2, whenever possible, use `unicode` if that's the only + possible type, and `Text` if it can be either `unicode` or `bytes`; +* use platform checks like `if sys.platform == 'win32'` to denote + platform-dependent APIs. + +Imports in stubs are considered private (not part of the exported API) +unless: +* they use the form ``from library import name as name`` (sic, using + explicit ``as`` even if the name stays the same); or +* they use the form ``from library import *`` which means all names + from that library are exported. + +When adding type hints, avoid using the `Any` type when possible. Reserve +the use of `Any` for when: +* the correct type cannot be expressed in the current type system; and +* to avoid Union returns (see above). + +Note that `Any` is not the correct type to use if you want to indicate +that some function can accept literally anything: in those cases use +`object` instead. + +For arguments with type and a default value of `None`, PEP 484 +prescribes that the type automatically becomes `Optional`. However we +prefer explicit over implicit in this case, and require the explicit +`Optional[]` around the type. The mypy tests enforce this (through +the use of --no-implicit-optional) and the error looks like +`Incompatible types in assignment (expression has type None, variable +has type "Blah") `. + +Stub files support forward references natively. In other words, the +order of class declarations and type aliases does not matter in +a stub file. You can also use the name of the class within its own +body. Focus on making your stubs clear to the reader. Avoid using +string literals in type annotations. + +Type variables and aliases you introduce purely for legibility reasons +should be prefixed with an underscore to make it obvious to the reader +they are not part of the stubbed API. + +NOTE: there are stubs in this repository that don't conform to the +style described above. Fixing them is a great starting point for new +contributors. + +### Stub versioning + +There are separate directories for `stdlib` and `third_party` stubs. +Within those, there are separate directories for different versions of +Python the stubs target. + +The directory name indicates the major version of Python that a stub targets +and optionally the lowest minor version, with the exception of the `2and3` +directory which applies to both Python 2 and 3. + +For example, stubs in the `3` directory will be applied to all versions of +Python 3, though stubs in the `3.6` directory will only be applied to versions +3.6 and above. However, stubs in the `2` directory will not be applied to +Python 3. + +It is preferred to use a single stub in the more generic directory that +conditionally targets specific versions when needed, as opposed +to maintaining multiple stub files within more specific directories. Similarly, +if the given library works on both Python 2 and Python 3, prefer to put your +stubs in the `2and3` directory, unless the types are so different that the stubs +become unreadable that way. + +You can use checks like `if sys.version_info >= (3, 4):` to denote new +functionality introduced in a given Python version or solve type +differences. When doing so, only use one-tuples or two-tuples. This is +because: + +* mypy doesn't support more fine-grained version checks; and more + importantly + +* the micro versions of a Python release will change over time in your + checking environment and the checker should return consistent results + regardless of the micro version used. + +Because of this, if a given functionality was introduced in, say, Python +3.4.4, your check: + +* should be expressed as `if sys.version_info >= (3, 4):` +* should NOT be expressed as `if sys.version_info >= (3, 4, 4):` +* should NOT be expressed as `if sys.version_info >= (3, 5):` + +This makes the type checker assume the functionality was also available +in 3.4.0 - 3.4.3, which while *technically* incorrect is relatively +harmless. This is a strictly better compromise than using the latter +two forms, which would generate false positive errors for correct use +under Python 3.4.4. + +Note: in its current implementation, typeshed cannot contain stubs for +multiple versions of the same third-party library. Prefer to generate +stubs for the latest version released on PyPI at the time of your +stubbing. + +### What to do when a project's documentation and implementation disagree + +Type stubs are meant to be external type annotations for a given +library. While they are useful documentation in its own merit, they +augment the project's concrete implementation, not the project's +documentation. Whenever you find them disagreeing, model the type +information after the actual implementation and file an issue on the +project's tracker to fix their documentation. + +## Issue-tracker conventions + +We aim to reply to all new issues promptly. We'll assign one or more +labels to indicate we've triaged an issue, but most typeshed issues +are relatively simple (stubs for a given module or package are +missing, incomplete or incorrect) and we won't add noise to the +tracker by labeling all of them. Please see the +[list of all labels](https://github.com/python/typeshed/issues/labels) +for a detailed description of the labels we use. + +Sometimes a PR can't make progress until some external issue is +addressed. We indicate this by editing the subject to add a ``[WIP]`` +prefix. (This should be removed before committing the issue once +unblocked!) + +### Core developer guidelines + +Core developers should follow these rules when processing pull requests: + +* Always wait for tests to pass before merging PRs. +* Use "[Squash and merge](https://github.com/blog/2141-squash-your-commits)" to merge PRs. +* Delete branches for merged PRs (by core devs pushing to the main repo). +* Make sure commit messages to master are meaningful. For example, remove irrelevant + intermediate commit messages. diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/LICENSE b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/LICENSE new file mode 100644 index 0000000..e5833ae --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/LICENSE @@ -0,0 +1,238 @@ +The "typeshed" project is licensed under the terms of the Apache license, as +reproduced below. + += = = = = + +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + 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. + += = = = = + +Parts of typeshed are licensed under different licenses (like the MIT +license), reproduced below. + += = = = = + +The MIT License + +Copyright (c) 2015 Jukka Lehtosalo and contributors + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + += = = = = + diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/README.md b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/README.md new file mode 100644 index 0000000..9423259 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/README.md @@ -0,0 +1,144 @@ +# typeshed + +[![Build Status](https://travis-ci.org/python/typeshed.svg?branch=master)](https://travis-ci.org/python/typeshed) +[![Chat at https://gitter.im/python/typing](https://badges.gitter.im/python/typing.svg)](https://gitter.im/python/typing?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) + +## About + +Typeshed contains external type annotations for the Python standard library +and Python builtins, as well as third party packages. + +This data can e.g. be used for static analysis, type checking or type inference. + +For information on how to use `typeshed`, read below. Information for +contributors can be found in [CONTRIBUTING.md](CONTRIBUTING.md). **Please read +it before submitting pull requests.** + +Typeshed supports Python versions 2.7 and 3.4 and up. + +## Using + +If you're just using mypy (or pytype or PyCharm), as opposed to +developing it, you don't need to interact with the typeshed repo at +all: a copy of typeshed is bundled with mypy. + +When you use a checked-out clone of the mypy repo, a copy of typeshed +should be included as a submodule, using + + $ git clone --recurse-submodules https://github.com/python/mypy.git + +or + + $ git clone https://github.com/python/mypy.git + $ cd mypy + $ git submodule init + $ git submodule update + +and occasionally you will have to repeat the final command (`git +submodule update`) to pull in changes made in the upstream typeshed +repo. + +PyCharm and pytype similarly include a copy of typeshed. The one in +pytype can be updated in the same way if you are working with the +pytype repo. + +## Format + +Each Python module is represented by a `.pyi` "stub". This is a normal Python +file (i.e., it can be interpreted by Python 3), except all the methods are empty. +Python function annotations ([PEP 3107](https://www.python.org/dev/peps/pep-3107/)) +are used to describe the types the function has. + +See [PEP 484](http://www.python.org/dev/peps/pep-0484/) for the exact +syntax of the stub files and [CONTRIBUTING.md](CONTRIBUTING.md) for the +coding style used in typeshed. + +## Directory structure + +### stdlib + +This contains stubs for modules the Python standard library -- which +includes pure Python modules, dynamically loaded extension modules, +hard-linked extension modules, and the builtins. + +### third_party + +Modules that are not shipped with Python but have a type description in Python +go into `third_party`. Since these modules can behave differently for different +versions of Python, `third_party` has version subdirectories, just like +`stdlib`. + +NOTE: When you're contributing a new stub for a package that you did +not develop, please obtain consent of the package owner (this is +specified in [PEP +484](https://www.python.org/dev/peps/pep-0484/#the-typeshed-repo)). +The best way to obtain consent is to file an issue in the third-party +package's tracker and include the link to a positive response in your PR +for typeshed. + +For more information on directory structure and stub versioning, see +[the relevant section of CONTRIBUTING.md]( +https://github.com/python/typeshed/blob/master/CONTRIBUTING.md#stub-versioning). + +## Contributing + +Please read [CONTRIBUTING.md](CONTRIBUTING.md) before submitting pull +requests. If you have questions related to contributing, drop by the [typing Gitter](https://gitter.im/python/typing). + +## Running the tests + +The tests are automatically run by Travis CI on every PR and push to +the repo. There are several sets of tests: `tests/mypy_test.py` +runs tests against [mypy](https://github.com/python/mypy/), while +`tests/pytype_test.py` runs tests against +[pytype](https://github.com/google/pytype/). + +Both sets of tests are shallow -- they verify that all stubs can be +imported but they don't check whether stubs match their implementation +(in the Python standard library or a third-party package). Also note +that each set of tests has a blacklist of modules that are not tested +at all. The blacklists also live in the tests directory. + +In addition, you can run `tests/mypy_selftest.py` to run mypy's own +test suite using the typeshed code in your repo. This will sometimes +catch issues with incorrectly typed stubs, but is much slower than the +other tests. + +To manually run the mypy tests, you need to have Python 3.5 or higher; +Python 3.6.1 or higher is recommended. + +Run: +``` +$ python3.6 -m venv .venv3 +$ source .venv3/bin/activate +(.venv3)$ pip3 install -r requirements-tests-py3.txt +``` +This will install mypy (you need the latest master branch from GitHub), +typed-ast, flake8, and pytype. You can then run mypy, flake8, and pytype tests +by invoking: +``` +(.venv3)$ python3 tests/mypy_test.py +... +(.venv3)$ python3 tests/mypy_selftest.py +... +(.venv3)$ flake8 +... +(.venv3)$ python3 tests/pytype_test.py +... +``` +Note that flake8 only works with Python 3.6 or higher, and that to run the +pytype tests, you will need Python 2.7 and Python 3.6 interpreters. Pytype will +find these automatically if they're in `PATH`, but otherwise you must point to +them with the `--python27-exe` and `--python36-exe` arguments, respectively. + +For mypy, if you are in the typeshed repo that is submodule of the +mypy repo (so `..` refers to the mypy repo), there's a shortcut to run +the mypy tests that avoids installing mypy: +```bash +$ PYTHONPATH=../.. python3 tests/mypy_test.py +``` +You can mypy tests to a single version by passing `-p2` or `-p3.5` e.g. +```bash +$ PYTHONPATH=../.. python3 tests/mypy_test.py -p3.5 +running mypy --python-version 3.5 --strict-optional # with 342 files +``` diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/requirements-tests-py3.txt b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/requirements-tests-py3.txt new file mode 100644 index 0000000..5c23efe --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/requirements-tests-py3.txt @@ -0,0 +1,6 @@ +git+https://github.com/python/mypy.git@master +typed-ast>=1.0.4 +flake8==3.6.0 +flake8-bugbear==18.8.0 +flake8-pyi==18.3.1 +pytype>=2019.5.15 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/BaseHTTPServer.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/BaseHTTPServer.pyi new file mode 100644 index 0000000..1f9d2ce --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/BaseHTTPServer.pyi @@ -0,0 +1,47 @@ +# Stubs for BaseHTTPServer (Python 2.7) + +from typing import Any, BinaryIO, Mapping, Optional, Tuple, Union +import SocketServer +import mimetools + +class HTTPServer(SocketServer.TCPServer): + server_name: str + server_port: int + def __init__(self, server_address: Tuple[str, int], + RequestHandlerClass: type) -> None: ... + +class BaseHTTPRequestHandler: + client_address: Tuple[str, int] + server: SocketServer.BaseServer + close_connection: bool + command: str + path: str + request_version: str + headers: mimetools.Message + rfile: BinaryIO + wfile: BinaryIO + server_version: str + sys_version: str + error_message_format: str + error_content_type: str + protocol_version: str + MessageClass: type + responses: Mapping[int, Tuple[str, str]] + def __init__(self, request: bytes, client_address: Tuple[str, int], + server: SocketServer.BaseServer) -> None: ... + def handle(self) -> None: ... + def handle_one_request(self) -> None: ... + def send_error(self, code: int, message: Optional[str] = ...) -> None: ... + def send_response(self, code: int, + message: Optional[str] = ...) -> None: ... + def send_header(self, keyword: str, value: str) -> None: ... + def end_headers(self) -> None: ... + def flush_headers(self) -> None: ... + def log_request(self, code: Union[int, str] = ..., + size: Union[int, str] = ...) -> None: ... + def log_error(self, format: str, *args: Any) -> None: ... + def log_message(self, format: str, *args: Any) -> None: ... + def version_string(self) -> str: ... + def date_time_string(self, timestamp: Optional[int] = ...) -> str: ... + def log_date_time_string(self) -> str: ... + def address_string(self) -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/ConfigParser.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/ConfigParser.pyi new file mode 100644 index 0000000..5d86811 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/ConfigParser.pyi @@ -0,0 +1,97 @@ +from typing import Any, IO, Sequence, Tuple, Union, List, Dict, Protocol, Optional + +DEFAULTSECT: str +MAX_INTERPOLATION_DEPTH: int + +class Error(Exception): + message: Any + def __init__(self, msg: str = ...) -> None: ... + def _get_message(self) -> None: ... + def _set_message(self, value: str) -> None: ... + def __repr__(self) -> str: ... + def __str__(self) -> str: ... + +class NoSectionError(Error): + section: str + def __init__(self, section: str) -> None: ... + +class DuplicateSectionError(Error): + section: str + def __init__(self, section: str) -> None: ... + +class NoOptionError(Error): + section: str + option: str + def __init__(self, option: str, section: str) -> None: ... + +class InterpolationError(Error): + section: str + option: str + msg: str + def __init__(self, option: str, section: str, msg: str) -> None: ... + +class InterpolationMissingOptionError(InterpolationError): + reference: str + def __init__(self, option: str, section: str, rawval: str, reference: str) -> None: ... + +class InterpolationSyntaxError(InterpolationError): ... + +class InterpolationDepthError(InterpolationError): + def __init__(self, option: str, section: str, rawval: str) -> None: ... + +class ParsingError(Error): + filename: str + errors: List[Tuple[Any, Any]] + def __init__(self, filename: str) -> None: ... + def append(self, lineno: Any, line: Any) -> None: ... + +class MissingSectionHeaderError(ParsingError): + lineno: Any + line: Any + def __init__(self, filename: str, lineno: Any, line: Any) -> None: ... + +class _Readable(Protocol): + def readline(self) -> str: ... + +class RawConfigParser: + _dict: Any + _sections: dict + _defaults: dict + _optcre: Any + SECTCRE: Any + OPTCRE: Any + OPTCRE_NV: Any + def __init__(self, defaults: Dict[Any, Any] = ..., dict_type: Any = ..., allow_no_value: bool = ...) -> None: ... + def defaults(self) -> Dict[Any, Any]: ... + def sections(self) -> List[str]: ... + def add_section(self, section: str) -> None: ... + def has_section(self, section: str) -> bool: ... + def options(self, section: str) -> List[str]: ... + def read(self, filenames: Union[str, Sequence[str]]) -> List[str]: ... + def readfp(self, fp: _Readable, filename: str = ...) -> None: ... + def get(self, section: str, option: str) -> str: ... + def items(self, section: str) -> List[Tuple[Any, Any]]: ... + def _get(self, section: str, conv: type, option: str) -> Any: ... + def getint(self, section: str, option: str) -> int: ... + def getfloat(self, section: str, option: str) -> float: ... + _boolean_states: Dict[str, bool] + def getboolean(self, section: str, option: str) -> bool: ... + def optionxform(self, optionstr: str) -> str: ... + def has_option(self, section: str, option: str) -> bool: ... + def set(self, section: str, option: str, value: Any = ...) -> None: ... + def write(self, fp: IO[str]) -> None: ... + def remove_option(self, section: str, option: Any) -> bool: ... + def remove_section(self, section: str) -> bool: ... + def _read(self, fp: IO[str], fpname: str) -> None: ... + +class ConfigParser(RawConfigParser): + _KEYCRE: Any + def get(self, section: str, option: str, raw: bool = ..., vars: Optional[dict] = ...) -> Any: ... + def items(self, section: str, raw: bool = ..., vars: Optional[dict] = ...) -> List[Tuple[str, Any]]: ... + def _interpolate(self, section: str, option: str, rawval: Any, vars: Any) -> str: ... + def _interpolation_replace(self, match: Any) -> str: ... + +class SafeConfigParser(ConfigParser): + _interpvar_re: Any + def _interpolate(self, section: str, option: str, rawval: Any, vars: Any) -> str: ... + def _interpolate_some(self, option: str, accum: list, rest: str, section: str, map: dict, depth: int) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/Cookie.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/Cookie.pyi new file mode 100644 index 0000000..79a7a81 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/Cookie.pyi @@ -0,0 +1,40 @@ +from typing import Any, Optional + +class CookieError(Exception): ... + +class Morsel(dict): + key: Any + def __init__(self): ... + def __setitem__(self, K, V): ... + def isReservedKey(self, K): ... + value: Any + coded_value: Any + def set(self, key, val, coded_val, LegalChars=..., idmap=..., translate=...): ... + def output(self, attrs: Optional[Any] = ..., header=...): ... + def js_output(self, attrs: Optional[Any] = ...): ... + def OutputString(self, attrs: Optional[Any] = ...): ... + +class BaseCookie(dict): + def value_decode(self, val): ... + def value_encode(self, val): ... + def __init__(self, input: Optional[Any] = ...): ... + def __setitem__(self, key, value): ... + def output(self, attrs: Optional[Any] = ..., header=..., sep=...): ... + def js_output(self, attrs: Optional[Any] = ...): ... + def load(self, rawdata): ... + +class SimpleCookie(BaseCookie): + def value_decode(self, val): ... + def value_encode(self, val): ... + +class SerialCookie(BaseCookie): + def __init__(self, input: Optional[Any] = ...): ... + def value_decode(self, val): ... + def value_encode(self, val): ... + +class SmartCookie(BaseCookie): + def __init__(self, input: Optional[Any] = ...): ... + def value_decode(self, val): ... + def value_encode(self, val): ... + +Cookie: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/HTMLParser.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/HTMLParser.pyi new file mode 100644 index 0000000..0f6c7e3 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/HTMLParser.pyi @@ -0,0 +1,31 @@ +from typing import List, Tuple, AnyStr +from markupbase import ParserBase + +class HTMLParser(ParserBase): + def __init__(self) -> None: ... + def feed(self, feed: AnyStr) -> None: ... + def close(self) -> None: ... + def reset(self) -> None: ... + + def get_starttag_text(self) -> AnyStr: ... + def set_cdata_mode(self, AnyStr) -> None: ... + def clear_cdata_mode(self) -> None: ... + + def handle_startendtag(self, tag: AnyStr, attrs: List[Tuple[AnyStr, AnyStr]]): ... + def handle_starttag(self, tag: AnyStr, attrs: List[Tuple[AnyStr, AnyStr]]): ... + def handle_endtag(self, tag: AnyStr): ... + def handle_charref(self, name: AnyStr): ... + def handle_entityref(self, name: AnyStr): ... + def handle_data(self, data: AnyStr): ... + def handle_comment(self, data: AnyStr): ... + def handle_decl(self, decl: AnyStr): ... + def handle_pi(self, data: AnyStr): ... + + def unknown_decl(self, data: AnyStr): ... + + def unescape(self, s: AnyStr) -> AnyStr: ... + +class HTMLParseError(Exception): + msg: str + lineno: int + offset: int diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/Queue.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/Queue.pyi new file mode 100644 index 0000000..11b01ed --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/Queue.pyi @@ -0,0 +1,31 @@ +# Stubs for Queue (Python 2) + +from collections import deque +from typing import Any, TypeVar, Generic, Optional + +_T = TypeVar('_T') + +class Empty(Exception): ... +class Full(Exception): ... + +class Queue(Generic[_T]): + maxsize: Any + mutex: Any + not_empty: Any + not_full: Any + all_tasks_done: Any + unfinished_tasks: Any + queue: deque # undocumented + def __init__(self, maxsize: int = ...) -> None: ... + def task_done(self) -> None: ... + def join(self) -> None: ... + def qsize(self) -> int: ... + def empty(self) -> bool: ... + def full(self) -> bool: ... + def put(self, item: _T, block: bool = ..., timeout: Optional[float] = ...) -> None: ... + def put_nowait(self, item: _T) -> None: ... + def get(self, block: bool = ..., timeout: Optional[float] = ...) -> _T: ... + def get_nowait(self) -> _T: ... + +class PriorityQueue(Queue): ... +class LifoQueue(Queue): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/SimpleHTTPServer.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/SimpleHTTPServer.pyi new file mode 100644 index 0000000..be22b88 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/SimpleHTTPServer.pyi @@ -0,0 +1,16 @@ +# Stubs for SimpleHTTPServer (Python 2) + +from typing import Any, AnyStr, IO, Mapping, Optional, Union +import BaseHTTPServer +from StringIO import StringIO + +class SimpleHTTPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler): + server_version: str + def do_GET(self) -> None: ... + def do_HEAD(self) -> None: ... + def send_head(self) -> Optional[IO[str]]: ... + def list_directory(self, path: Union[str, unicode]) -> Optional[StringIO]: ... + def translate_path(self, path: AnyStr) -> AnyStr: ... + def copyfile(self, source: IO[AnyStr], outputfile: IO[AnyStr]): ... + def guess_type(self, path: Union[str, unicode]) -> str: ... + extensions_map: Mapping[str, str] diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/SocketServer.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/SocketServer.pyi new file mode 100644 index 0000000..d485b8b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/SocketServer.pyi @@ -0,0 +1,99 @@ +# NB: SocketServer.pyi and socketserver.pyi must remain consistent! +# Stubs for socketserver + +from typing import Any, BinaryIO, Optional, Tuple, Type +from socket import SocketType +import sys +import types + +class BaseServer: + address_family: int + RequestHandlerClass: type + server_address: Tuple[str, int] + socket: SocketType + allow_reuse_address: bool + request_queue_size: int + socket_type: int + timeout: Optional[float] + def __init__(self, server_address: Tuple[str, int], + RequestHandlerClass: type) -> None: ... + def fileno(self) -> int: ... + def handle_request(self) -> None: ... + def serve_forever(self, poll_interval: float = ...) -> None: ... + def shutdown(self) -> None: ... + def server_close(self) -> None: ... + def finish_request(self, request: bytes, + client_address: Tuple[str, int]) -> None: ... + def get_request(self) -> None: ... + def handle_error(self, request: bytes, + client_address: Tuple[str, int]) -> None: ... + def handle_timeout(self) -> None: ... + def process_request(self, request: bytes, + client_address: Tuple[str, int]) -> None: ... + def server_activate(self) -> None: ... + def server_bind(self) -> None: ... + def verify_request(self, request: bytes, + client_address: Tuple[str, int]) -> bool: ... + if sys.version_info >= (3, 6): + def __enter__(self) -> BaseServer: ... + def __exit__(self, exc_type: Optional[Type[BaseException]], + exc_val: Optional[BaseException], + exc_tb: Optional[types.TracebackType]) -> bool: ... + if sys.version_info >= (3, 3): + def service_actions(self) -> None: ... + +class TCPServer(BaseServer): + def __init__(self, server_address: Tuple[str, int], + RequestHandlerClass: type, + bind_and_activate: bool = ...) -> None: ... + +class UDPServer(BaseServer): + def __init__(self, server_address: Tuple[str, int], + RequestHandlerClass: type, + bind_and_activate: bool = ...) -> None: ... + +if sys.platform != 'win32': + class UnixStreamServer(BaseServer): + def __init__(self, server_address: Tuple[str, int], + RequestHandlerClass: type, + bind_and_activate: bool = ...) -> None: ... + + class UnixDatagramServer(BaseServer): + def __init__(self, server_address: Tuple[str, int], + RequestHandlerClass: type, + bind_and_activate: bool = ...) -> None: ... + +class ForkingMixIn: ... +class ThreadingMixIn: ... + +class ForkingTCPServer(ForkingMixIn, TCPServer): ... +class ForkingUDPServer(ForkingMixIn, UDPServer): ... +class ThreadingTCPServer(ThreadingMixIn, TCPServer): ... +class ThreadingUDPServer(ThreadingMixIn, UDPServer): ... +if sys.platform != 'win32': + class ThreadingUnixStreamServer(ThreadingMixIn, UnixStreamServer): ... + class ThreadingUnixDatagramServer(ThreadingMixIn, UnixDatagramServer): ... + + +class BaseRequestHandler: + # Those are technically of types, respectively: + # * Union[SocketType, Tuple[bytes, SocketType]] + # * Union[Tuple[str, int], str] + # But there are some concerns that having unions here would cause + # too much inconvenience to people using it (see + # https://github.com/python/typeshed/pull/384#issuecomment-234649696) + request: Any + client_address: Any + + server: BaseServer + def setup(self) -> None: ... + def handle(self) -> None: ... + def finish(self) -> None: ... + +class StreamRequestHandler(BaseRequestHandler): + rfile: BinaryIO + wfile: BinaryIO + +class DatagramRequestHandler(BaseRequestHandler): + rfile: BinaryIO + wfile: BinaryIO diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/StringIO.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/StringIO.pyi new file mode 100644 index 0000000..de17f6a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/StringIO.pyi @@ -0,0 +1,30 @@ +# Stubs for StringIO (Python 2) + +from typing import Any, IO, AnyStr, Iterator, Iterable, Generic, List, Optional + +class StringIO(IO[AnyStr], Generic[AnyStr]): + closed: bool + softspace: int + len: int + name: str + def __init__(self, buf: AnyStr = ...) -> None: ... + def __iter__(self) -> Iterator[AnyStr]: ... + def next(self) -> AnyStr: ... + def close(self) -> None: ... + def isatty(self) -> bool: ... + def seek(self, pos: int, mode: int = ...) -> int: ... + def tell(self) -> int: ... + def read(self, n: int = ...) -> AnyStr: ... + def readline(self, length: int = ...) -> AnyStr: ... + def readlines(self, sizehint: int = ...) -> List[AnyStr]: ... + def truncate(self, size: Optional[int] = ...) -> int: ... + def write(self, s: AnyStr) -> int: ... + def writelines(self, iterable: Iterable[AnyStr]) -> None: ... + def flush(self) -> None: ... + def getvalue(self) -> AnyStr: ... + def __enter__(self) -> Any: ... + def __exit__(self, type: Any, value: Any, traceback: Any) -> Any: ... + def fileno(self) -> int: ... + def readable(self) -> bool: ... + def seekable(self) -> bool: ... + def writable(self) -> bool: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/UserDict.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/UserDict.pyi new file mode 100644 index 0000000..965e88e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/UserDict.pyi @@ -0,0 +1,44 @@ +from typing import (Any, Container, Dict, Generic, Iterable, Iterator, List, + Mapping, Optional, Sized, Tuple, TypeVar, Union, overload) + +_KT = TypeVar('_KT') +_VT = TypeVar('_VT') +_T = TypeVar('_T') + +class UserDict(Dict[_KT, _VT], Generic[_KT, _VT]): + data: Mapping[_KT, _VT] + + def __init__(self, initialdata: Mapping[_KT, _VT] = ...) -> None: ... + + # TODO: __iter__ is not available for UserDict + +class IterableUserDict(UserDict[_KT, _VT], Generic[_KT, _VT]): + ... + +class DictMixin(Iterable[_KT], Container[_KT], Sized, Generic[_KT, _VT]): + def has_key(self, key: _KT) -> bool: ... + def __len__(self) -> int: ... + def __iter__(self) -> Iterator[_KT]: ... + + # From typing.Mapping[_KT, _VT] + # (can't inherit because of keys()) + @overload + def get(self, k: _KT) -> Optional[_VT]: ... + @overload + def get(self, k: _KT, default: Union[_VT, _T]) -> Union[_VT, _T]: ... + def values(self) -> List[_VT]: ... + def items(self) -> List[Tuple[_KT, _VT]]: ... + def iterkeys(self) -> Iterator[_KT]: ... + def itervalues(self) -> Iterator[_VT]: ... + def iteritems(self) -> Iterator[Tuple[_KT, _VT]]: ... + def __contains__(self, o: Any) -> bool: ... + + # From typing.MutableMapping[_KT, _VT] + def clear(self) -> None: ... + def pop(self, k: _KT, default: _VT = ...) -> _VT: ... + def popitem(self) -> Tuple[_KT, _VT]: ... + def setdefault(self, k: _KT, default: _VT = ...) -> _VT: ... + @overload + def update(self, m: Mapping[_KT, _VT], **kwargs: _VT) -> None: ... + @overload + def update(self, m: Iterable[Tuple[_KT, _VT]], **kwargs: _VT) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/UserList.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/UserList.pyi new file mode 100644 index 0000000..b8466ee --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/UserList.pyi @@ -0,0 +1,18 @@ +from typing import Iterable, MutableSequence, TypeVar, Union, overload + +_T = TypeVar("_T") +_ULT = TypeVar("_ULT", bound=UserList) + +class UserList(MutableSequence[_T]): + def insert(self, index: int, object: _T) -> None: ... + @overload + def __setitem__(self, i: int, o: _T) -> None: ... + @overload + def __setitem__(self, s: slice, o: Iterable[_T]) -> None: ... + def __delitem__(self, i: Union[int, slice]) -> None: ... + def __len__(self) -> int: ... + @overload + def __getitem__(self, i: int) -> _T: ... + @overload + def __getitem__(self: _ULT, s: slice) -> _ULT: ... + def sort(self) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/UserString.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/UserString.pyi new file mode 100644 index 0000000..8cbbfc1 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/UserString.pyi @@ -0,0 +1,75 @@ +import collections +from typing import Any, Iterable, List, MutableSequence, Sequence, Optional, overload, Text, TypeVar, Tuple, Union + +_UST = TypeVar("_UST", bound=UserString) +_MST = TypeVar("_MST", bound=MutableString) + +class UserString(Sequence[UserString]): + data: unicode + def __init__(self, seq: object) -> None: ... + def __int__(self) -> int: ... + def __long__(self) -> long: ... + def __float__(self) -> float: ... + def __complex__(self) -> complex: ... + def __hash__(self) -> int: ... + def __len__(self) -> int: ... + @overload + def __getitem__(self: _UST, i: int) -> _UST: ... + @overload + def __getitem__(self: _UST, s: slice) -> _UST: ... + def __add__(self: _UST, other: Any) -> _UST: ... + def __radd__(self: _UST, other: Any) -> _UST: ... + def __mul__(self: _UST, other: int) -> _UST: ... + def __rmul__(self: _UST, other: int) -> _UST: ... + def __mod__(self: _UST, args: Any) -> _UST: ... + def capitalize(self: _UST) -> _UST: ... + def center(self: _UST, width: int, *args: Any) -> _UST: ... + def count(self, sub: int, start: int = ..., end: int = ...) -> int: ... + def decode(self: _UST, encoding: Optional[str] = ..., errors: Optional[str] = ...) -> _UST: ... + def encode(self: _UST, encoding: Optional[str] = ..., errors: Optional[str] = ...) -> _UST: ... + def endswith(self, suffix: Text, start: int = ..., end: int = ...) -> bool: ... + def expandtabs(self: _UST, tabsize: int = ...) -> _UST: ... + def find(self, sub: Text, start: int = ..., end: int = ...) -> int: ... + def index(self, sub: Text, start: int = ..., end: int = ...) -> int: ... + def isalpha(self) -> bool: ... + def isalnum(self) -> bool: ... + def isdecimal(self) -> bool: ... + def isdigit(self) -> bool: ... + def islower(self) -> bool: ... + def isnumeric(self) -> bool: ... + def isspace(self) -> bool: ... + def istitle(self) -> bool: ... + def isupper(self) -> bool: ... + def join(self, seq: Iterable[Text]) -> Text: ... + def ljust(self: _UST, width: int, *args: Any) -> _UST: ... + def lower(self: _UST) -> _UST: ... + def lstrip(self: _UST, chars: Optional[Text] = ...) -> _UST: ... + def partition(self, sep: Text) -> Tuple[Text, Text, Text]: ... + def replace(self: _UST, old: Text, new: Text, maxsplit: int = ...) -> _UST: ... + def rfind(self, sub: Text, start: int = ..., end: int = ...) -> int: ... + def rindex(self, sub: Text, start: int = ..., end: int = ...) -> int: ... + def rjust(self: _UST, width: int, *args: Any) -> _UST: ... + def rpartition(self, sep: Text) -> Tuple[Text, Text, Text]: ... + def rstrip(self: _UST, chars: Optional[Text] = ...) -> _UST: ... + def split(self, sep: Optional[Text] = ..., maxsplit: int = ...) -> List[Text]: ... + def rsplit(self, sep: Optional[Text] = ..., maxsplit: int = ...) -> List[Text]: ... + def splitlines(self, keepends: int = ...) -> List[Text]: ... + def startswith(self, suffix: Text, start: int = ..., end: int = ...) -> bool: ... + def strip(self: _UST, chars: Optional[Text] = ...) -> _UST: ... + def swapcase(self: _UST) -> _UST: ... + def title(self: _UST) -> _UST: ... + def translate(self: _UST, *args: Any) -> _UST: ... + def upper(self: _UST) -> _UST: ... + def zfill(self: _UST, width: int) -> _UST: ... + +class MutableString(UserString, MutableSequence[MutableString]): # type: ignore + @overload + def __getitem__(self: _MST, i: int) -> _MST: ... + @overload + def __getitem__(self: _MST, s: slice) -> _MST: ... + def __setitem__(self, index: Union[int, slice], sub: Any) -> None: ... + def __delitem__(self, index: Union[int, slice]) -> None: ... + def immutable(self) -> UserString: ... + def __iadd__(self: _MST, other: Any) -> _MST: ... + def __imul__(self, n: int) -> _MST: ... + def insert(self, index: int, value: Any) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/__builtin__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/__builtin__.pyi new file mode 100644 index 0000000..cca0e4f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/__builtin__.pyi @@ -0,0 +1,1622 @@ +# True and False are deliberately omitted because they are keywords in +# Python 3, and stub files conform to Python 3 syntax. + +from typing import ( + TypeVar, Iterator, Iterable, NoReturn, overload, Container, + Sequence, MutableSequence, Mapping, MutableMapping, Tuple, List, Any, Dict, Callable, Generic, + Set, AbstractSet, FrozenSet, MutableSet, Sized, Reversible, SupportsInt, SupportsFloat, SupportsAbs, + SupportsComplex, IO, BinaryIO, Union, + ItemsView, KeysView, ValuesView, ByteString, Optional, AnyStr, Type, Text, + Protocol, +) +from abc import abstractmethod, ABCMeta +from ast import mod, AST +from types import TracebackType, CodeType +import sys + +if sys.version_info >= (3,): + from typing import SupportsBytes, SupportsRound + +_T = TypeVar('_T') +_T_co = TypeVar('_T_co', covariant=True) +_KT = TypeVar('_KT') +_VT = TypeVar('_VT') +_S = TypeVar('_S') +_T1 = TypeVar('_T1') +_T2 = TypeVar('_T2') +_T3 = TypeVar('_T3') +_T4 = TypeVar('_T4') +_T5 = TypeVar('_T5') +_TT = TypeVar('_TT', bound='type') + +class object: + __doc__: Optional[str] + __dict__: Dict[str, Any] + __slots__: Union[Text, Iterable[Text]] + __module__: str + if sys.version_info >= (3, 6): + __annotations__: Dict[str, Any] + + @property + def __class__(self: _T) -> Type[_T]: ... + @__class__.setter + def __class__(self, __type: Type[object]) -> None: ... + def __init__(self) -> None: ... + def __new__(cls) -> Any: ... + def __setattr__(self, name: str, value: Any) -> None: ... + def __eq__(self, o: object) -> bool: ... + def __ne__(self, o: object) -> bool: ... + def __str__(self) -> str: ... + def __repr__(self) -> str: ... + def __hash__(self) -> int: ... + def __format__(self, format_spec: str) -> str: ... + def __getattribute__(self, name: str) -> Any: ... + def __delattr__(self, name: str) -> None: ... + def __sizeof__(self) -> int: ... + def __reduce__(self) -> tuple: ... + def __reduce_ex__(self, protocol: int) -> tuple: ... + if sys.version_info >= (3,): + def __dir__(self) -> Iterable[str]: ... + if sys.version_info >= (3, 6): + def __init_subclass__(cls) -> None: ... + +class staticmethod(object): # Special, only valid as a decorator. + __func__: Callable + if sys.version_info >= (3,): + __isabstractmethod__: bool + + def __init__(self, f: Callable) -> None: ... + def __new__(cls: Type[_T], *args: Any, **kwargs: Any) -> _T: ... + def __get__(self, obj: _T, type: Optional[Type[_T]] = ...) -> Callable: ... + +class classmethod(object): # Special, only valid as a decorator. + __func__: Callable + if sys.version_info >= (3,): + __isabstractmethod__: bool + + def __init__(self, f: Callable) -> None: ... + def __new__(cls: Type[_T], *args: Any, **kwargs: Any) -> _T: ... + def __get__(self, obj: _T, type: Optional[Type[_T]] = ...) -> Callable: ... + +class type(object): + __base__: type + __bases__: Tuple[type, ...] + __basicsize__: int + __dict__: Dict[str, Any] + __dictoffset__: int + __flags__: int + __itemsize__: int + __module__: str + __mro__: Tuple[type, ...] + __name__: str + if sys.version_info >= (3,): + __qualname__: str + __text_signature__: Optional[str] + __weakrefoffset__: int + + @overload + def __init__(self, o: object) -> None: ... + @overload + def __init__(self, name: str, bases: Tuple[type, ...], dict: Dict[str, Any]) -> None: ... + @overload + def __new__(cls, o: object) -> type: ... + @overload + def __new__(cls, name: str, bases: Tuple[type, ...], namespace: Dict[str, Any]) -> type: ... + def __call__(self, *args: Any, **kwds: Any) -> Any: ... + def __subclasses__(self: _TT) -> List[_TT]: ... + # Note: the documentation doesnt specify what the return type is, the standard + # implementation seems to be returning a list. + def mro(self) -> List[type]: ... + def __instancecheck__(self, instance: Any) -> bool: ... + def __subclasscheck__(self, subclass: type) -> bool: ... + if sys.version_info >= (3,): + @classmethod + def __prepare__(metacls, __name: str, __bases: Tuple[type, ...], **kwds: Any) -> Mapping[str, Any]: ... + +class super(object): + if sys.version_info >= (3,): + @overload + def __init__(self, t: Any, obj: Any) -> None: ... + @overload + def __init__(self, t: Any) -> None: ... + @overload + def __init__(self) -> None: ... + else: + @overload + def __init__(self, t: Any, obj: Any) -> None: ... + @overload + def __init__(self, t: Any) -> None: ... + +class int: + @overload + def __init__(self, x: Union[Text, bytes, SupportsInt] = ...) -> None: ... + @overload + def __init__(self, x: Union[Text, bytes, bytearray], base: int) -> None: ... + + @property + def real(self) -> int: ... + @property + def imag(self) -> int: ... + @property + def numerator(self) -> int: ... + @property + def denominator(self) -> int: ... + def conjugate(self) -> int: ... + + def bit_length(self) -> int: ... + if sys.version_info >= (3,): + def to_bytes(self, length: int, byteorder: str, *, signed: bool = ...) -> bytes: ... + @classmethod + def from_bytes(cls, bytes: Sequence[int], byteorder: str, *, + signed: bool = ...) -> int: ... # TODO buffer object argument + + def __add__(self, x: int) -> int: ... + def __sub__(self, x: int) -> int: ... + def __mul__(self, x: int) -> int: ... + def __floordiv__(self, x: int) -> int: ... + if sys.version_info < (3,): + def __div__(self, x: int) -> int: ... + def __truediv__(self, x: int) -> float: ... + def __mod__(self, x: int) -> int: ... + def __divmod__(self, x: int) -> Tuple[int, int]: ... + def __radd__(self, x: int) -> int: ... + def __rsub__(self, x: int) -> int: ... + def __rmul__(self, x: int) -> int: ... + def __rfloordiv__(self, x: int) -> int: ... + if sys.version_info < (3,): + def __rdiv__(self, x: int) -> int: ... + def __rtruediv__(self, x: int) -> float: ... + def __rmod__(self, x: int) -> int: ... + def __rdivmod__(self, x: int) -> Tuple[int, int]: ... + def __pow__(self, x: int) -> Any: ... # Return type can be int or float, depending on x. + def __rpow__(self, x: int) -> Any: ... + def __and__(self, n: int) -> int: ... + def __or__(self, n: int) -> int: ... + def __xor__(self, n: int) -> int: ... + def __lshift__(self, n: int) -> int: ... + def __rshift__(self, n: int) -> int: ... + def __rand__(self, n: int) -> int: ... + def __ror__(self, n: int) -> int: ... + def __rxor__(self, n: int) -> int: ... + def __rlshift__(self, n: int) -> int: ... + def __rrshift__(self, n: int) -> int: ... + def __neg__(self) -> int: ... + def __pos__(self) -> int: ... + def __invert__(self) -> int: ... + if sys.version_info >= (3,): + def __round__(self, ndigits: Optional[int] = ...) -> int: ... + def __getnewargs__(self) -> Tuple[int]: ... + + def __eq__(self, x: object) -> bool: ... + def __ne__(self, x: object) -> bool: ... + def __lt__(self, x: int) -> bool: ... + def __le__(self, x: int) -> bool: ... + def __gt__(self, x: int) -> bool: ... + def __ge__(self, x: int) -> bool: ... + + def __str__(self) -> str: ... + def __float__(self) -> float: ... + def __int__(self) -> int: ... + def __abs__(self) -> int: ... + def __hash__(self) -> int: ... + if sys.version_info >= (3,): + def __bool__(self) -> bool: ... + else: + def __nonzero__(self) -> bool: ... + def __index__(self) -> int: ... + +class float: + def __init__(self, x: Union[SupportsFloat, Text, bytes, bytearray] = ...) -> None: ... + def as_integer_ratio(self) -> Tuple[int, int]: ... + def hex(self) -> str: ... + def is_integer(self) -> bool: ... + @classmethod + def fromhex(cls, s: str) -> float: ... + + @property + def real(self) -> float: ... + @property + def imag(self) -> float: ... + def conjugate(self) -> float: ... + + def __add__(self, x: float) -> float: ... + def __sub__(self, x: float) -> float: ... + def __mul__(self, x: float) -> float: ... + def __floordiv__(self, x: float) -> float: ... + if sys.version_info < (3,): + def __div__(self, x: float) -> float: ... + def __truediv__(self, x: float) -> float: ... + def __mod__(self, x: float) -> float: ... + def __divmod__(self, x: float) -> Tuple[float, float]: ... + def __pow__(self, x: float) -> float: ... # In Python 3, returns complex if self is negative and x is not whole + def __radd__(self, x: float) -> float: ... + def __rsub__(self, x: float) -> float: ... + def __rmul__(self, x: float) -> float: ... + def __rfloordiv__(self, x: float) -> float: ... + if sys.version_info < (3,): + def __rdiv__(self, x: float) -> float: ... + def __rtruediv__(self, x: float) -> float: ... + def __rmod__(self, x: float) -> float: ... + def __rdivmod__(self, x: float) -> Tuple[float, float]: ... + def __rpow__(self, x: float) -> float: ... + def __getnewargs__(self) -> Tuple[float]: ... + if sys.version_info >= (3,): + @overload + def __round__(self) -> int: ... + @overload + def __round__(self, ndigits: None) -> int: ... + @overload + def __round__(self, ndigits: int) -> float: ... + + def __eq__(self, x: object) -> bool: ... + def __ne__(self, x: object) -> bool: ... + def __lt__(self, x: float) -> bool: ... + def __le__(self, x: float) -> bool: ... + def __gt__(self, x: float) -> bool: ... + def __ge__(self, x: float) -> bool: ... + def __neg__(self) -> float: ... + def __pos__(self) -> float: ... + + def __str__(self) -> str: ... + def __int__(self) -> int: ... + def __float__(self) -> float: ... + def __abs__(self) -> float: ... + def __hash__(self) -> int: ... + if sys.version_info >= (3,): + def __bool__(self) -> bool: ... + else: + def __nonzero__(self) -> bool: ... + +class complex: + @overload + def __init__(self, re: float = ..., im: float = ...) -> None: ... + @overload + def __init__(self, s: str) -> None: ... + @overload + def __init__(self, s: SupportsComplex) -> None: ... + + @property + def real(self) -> float: ... + @property + def imag(self) -> float: ... + + def conjugate(self) -> complex: ... + + def __add__(self, x: complex) -> complex: ... + def __sub__(self, x: complex) -> complex: ... + def __mul__(self, x: complex) -> complex: ... + def __pow__(self, x: complex) -> complex: ... + if sys.version_info < (3,): + def __div__(self, x: complex) -> complex: ... + def __truediv__(self, x: complex) -> complex: ... + def __radd__(self, x: complex) -> complex: ... + def __rsub__(self, x: complex) -> complex: ... + def __rmul__(self, x: complex) -> complex: ... + def __rpow__(self, x: complex) -> complex: ... + if sys.version_info < (3,): + def __rdiv__(self, x: complex) -> complex: ... + def __rtruediv__(self, x: complex) -> complex: ... + + def __eq__(self, x: object) -> bool: ... + def __ne__(self, x: object) -> bool: ... + def __neg__(self) -> complex: ... + def __pos__(self) -> complex: ... + + def __str__(self) -> str: ... + def __complex__(self) -> complex: ... + def __abs__(self) -> float: ... + def __hash__(self) -> int: ... + if sys.version_info >= (3,): + def __bool__(self) -> bool: ... + else: + def __nonzero__(self) -> bool: ... + +if sys.version_info >= (3,): + _str_base = object +else: + class basestring(metaclass=ABCMeta): ... + + class unicode(basestring, Sequence[unicode]): + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, o: object) -> None: ... + @overload + def __init__(self, o: str, encoding: unicode = ..., errors: unicode = ...) -> None: ... + def capitalize(self) -> unicode: ... + def center(self, width: int, fillchar: unicode = ...) -> unicode: ... + def count(self, x: unicode) -> int: ... + def decode(self, encoding: unicode = ..., errors: unicode = ...) -> unicode: ... + def encode(self, encoding: unicode = ..., errors: unicode = ...) -> str: ... + def endswith(self, suffix: Union[unicode, Tuple[unicode, ...]], start: int = ..., + end: int = ...) -> bool: ... + def expandtabs(self, tabsize: int = ...) -> unicode: ... + def find(self, sub: unicode, start: int = ..., end: int = ...) -> int: ... + def format(self, *args: Any, **kwargs: Any) -> unicode: ... + def index(self, sub: unicode, start: int = ..., end: int = ...) -> int: ... + def isalnum(self) -> bool: ... + def isalpha(self) -> bool: ... + def isdecimal(self) -> bool: ... + def isdigit(self) -> bool: ... + def isidentifier(self) -> bool: ... + def islower(self) -> bool: ... + def isnumeric(self) -> bool: ... + def isprintable(self) -> bool: ... + def isspace(self) -> bool: ... + def istitle(self) -> bool: ... + def isupper(self) -> bool: ... + def join(self, iterable: Iterable[unicode]) -> unicode: ... + def ljust(self, width: int, fillchar: unicode = ...) -> unicode: ... + def lower(self) -> unicode: ... + def lstrip(self, chars: unicode = ...) -> unicode: ... + def partition(self, sep: unicode) -> Tuple[unicode, unicode, unicode]: ... + def replace(self, old: unicode, new: unicode, count: int = ...) -> unicode: ... + def rfind(self, sub: unicode, start: int = ..., end: int = ...) -> int: ... + def rindex(self, sub: unicode, start: int = ..., end: int = ...) -> int: ... + def rjust(self, width: int, fillchar: unicode = ...) -> unicode: ... + def rpartition(self, sep: unicode) -> Tuple[unicode, unicode, unicode]: ... + def rsplit(self, sep: Optional[unicode] = ..., maxsplit: int = ...) -> List[unicode]: ... + def rstrip(self, chars: unicode = ...) -> unicode: ... + def split(self, sep: Optional[unicode] = ..., maxsplit: int = ...) -> List[unicode]: ... + def splitlines(self, keepends: bool = ...) -> List[unicode]: ... + def startswith(self, prefix: Union[unicode, Tuple[unicode, ...]], start: int = ..., + end: int = ...) -> bool: ... + def strip(self, chars: unicode = ...) -> unicode: ... + def swapcase(self) -> unicode: ... + def title(self) -> unicode: ... + def translate(self, table: Union[Dict[int, Any], unicode]) -> unicode: ... + def upper(self) -> unicode: ... + def zfill(self, width: int) -> unicode: ... + + @overload + def __getitem__(self, i: int) -> unicode: ... + @overload + def __getitem__(self, s: slice) -> unicode: ... + def __getslice__(self, start: int, stop: int) -> unicode: ... + def __add__(self, s: unicode) -> unicode: ... + def __mul__(self, n: int) -> unicode: ... + def __rmul__(self, n: int) -> unicode: ... + def __mod__(self, x: Any) -> unicode: ... + def __eq__(self, x: object) -> bool: ... + def __ne__(self, x: object) -> bool: ... + def __lt__(self, x: unicode) -> bool: ... + def __le__(self, x: unicode) -> bool: ... + def __gt__(self, x: unicode) -> bool: ... + def __ge__(self, x: unicode) -> bool: ... + + def __len__(self) -> int: ... + # The argument type is incompatible with Sequence + def __contains__(self, s: Union[unicode, bytes]) -> bool: ... # type: ignore + def __iter__(self) -> Iterator[unicode]: ... + def __str__(self) -> str: ... + def __repr__(self) -> str: ... + def __int__(self) -> int: ... + def __float__(self) -> float: ... + def __hash__(self) -> int: ... + def __getnewargs__(self) -> Tuple[unicode]: ... + + _str_base = basestring + +class str(Sequence[str], _str_base): + if sys.version_info >= (3,): + @overload + def __init__(self, o: object = ...) -> None: ... + @overload + def __init__(self, o: bytes, encoding: str = ..., errors: str = ...) -> None: ... + else: + def __init__(self, o: object = ...) -> None: ... + + def capitalize(self) -> str: ... + if sys.version_info >= (3, 3): + def casefold(self) -> str: ... + def center(self, width: int, fillchar: str = ...) -> str: ... + def count(self, x: Text, __start: Optional[int] = ..., __end: Optional[int] = ...) -> int: ... + if sys.version_info < (3,): + def decode(self, encoding: Text = ..., errors: Text = ...) -> unicode: ... + def encode(self, encoding: Text = ..., errors: Text = ...) -> bytes: ... + if sys.version_info >= (3,): + def endswith(self, suffix: Union[Text, Tuple[Text, ...]], start: Optional[int] = ..., + end: Optional[int] = ...) -> bool: ... + else: + def endswith(self, suffix: Union[Text, Tuple[Text, ...]]) -> bool: ... + def expandtabs(self, tabsize: int = ...) -> str: ... + def find(self, sub: Text, __start: Optional[int] = ..., __end: Optional[int] = ...) -> int: ... + def format(self, *args: Any, **kwargs: Any) -> str: ... + if sys.version_info >= (3,): + def format_map(self, map: Mapping[str, Any]) -> str: ... + def index(self, sub: Text, __start: Optional[int] = ..., __end: Optional[int] = ...) -> int: ... + def isalnum(self) -> bool: ... + def isalpha(self) -> bool: ... + if sys.version_info >= (3, 7): + def isascii(self) -> bool: ... + if sys.version_info >= (3,): + def isdecimal(self) -> bool: ... + def isdigit(self) -> bool: ... + if sys.version_info >= (3,): + def isidentifier(self) -> bool: ... + def islower(self) -> bool: ... + if sys.version_info >= (3,): + def isnumeric(self) -> bool: ... + def isprintable(self) -> bool: ... + def isspace(self) -> bool: ... + def istitle(self) -> bool: ... + def isupper(self) -> bool: ... + if sys.version_info >= (3,): + def join(self, iterable: Iterable[str]) -> str: ... + else: + def join(self, iterable: Iterable[AnyStr]) -> AnyStr: ... + def ljust(self, width: int, fillchar: str = ...) -> str: ... + def lower(self) -> str: ... + if sys.version_info >= (3,): + def lstrip(self, chars: Optional[str] = ...) -> str: ... + def partition(self, sep: str) -> Tuple[str, str, str]: ... + def replace(self, old: str, new: str, count: int = ...) -> str: ... + else: + @overload + def lstrip(self, chars: str = ...) -> str: ... + @overload + def lstrip(self, chars: unicode) -> unicode: ... + @overload + def partition(self, sep: bytearray) -> Tuple[str, bytearray, str]: ... + @overload + def partition(self, sep: str) -> Tuple[str, str, str]: ... + @overload + def partition(self, sep: unicode) -> Tuple[unicode, unicode, unicode]: ... + def replace(self, old: AnyStr, new: AnyStr, count: int = ...) -> AnyStr: ... + def rfind(self, sub: Text, __start: Optional[int] = ..., __end: Optional[int] = ...) -> int: ... + def rindex(self, sub: Text, __start: Optional[int] = ..., __end: Optional[int] = ...) -> int: ... + def rjust(self, width: int, fillchar: str = ...) -> str: ... + if sys.version_info >= (3,): + def rpartition(self, sep: str) -> Tuple[str, str, str]: ... + def rsplit(self, sep: Optional[str] = ..., maxsplit: int = ...) -> List[str]: ... + def rstrip(self, chars: Optional[str] = ...) -> str: ... + def split(self, sep: Optional[str] = ..., maxsplit: int = ...) -> List[str]: ... + else: + @overload + def rpartition(self, sep: bytearray) -> Tuple[str, bytearray, str]: ... + @overload + def rpartition(self, sep: str) -> Tuple[str, str, str]: ... + @overload + def rpartition(self, sep: unicode) -> Tuple[unicode, unicode, unicode]: ... + @overload + def rsplit(self, sep: Optional[str] = ..., maxsplit: int = ...) -> List[str]: ... + @overload + def rsplit(self, sep: unicode, maxsplit: int = ...) -> List[unicode]: ... + @overload + def rstrip(self, chars: str = ...) -> str: ... + @overload + def rstrip(self, chars: unicode) -> unicode: ... + @overload + def split(self, sep: Optional[str] = ..., maxsplit: int = ...) -> List[str]: ... + @overload + def split(self, sep: unicode, maxsplit: int = ...) -> List[unicode]: ... + def splitlines(self, keepends: bool = ...) -> List[str]: ... + if sys.version_info >= (3,): + def startswith(self, prefix: Union[Text, Tuple[Text, ...]], start: Optional[int] = ..., + end: Optional[int] = ...) -> bool: ... + def strip(self, chars: Optional[str] = ...) -> str: ... + else: + def startswith(self, prefix: Union[Text, Tuple[Text, ...]]) -> bool: ... + @overload + def strip(self, chars: str = ...) -> str: ... + @overload + def strip(self, chars: unicode) -> unicode: ... + def swapcase(self) -> str: ... + def title(self) -> str: ... + if sys.version_info >= (3,): + def translate(self, table: Union[Mapping[int, Union[int, str, None]], Sequence[Union[int, str, None]]]) -> str: ... + else: + def translate(self, table: Optional[AnyStr], deletechars: AnyStr = ...) -> AnyStr: ... + def upper(self) -> str: ... + def zfill(self, width: int) -> str: ... + if sys.version_info >= (3,): + @staticmethod + @overload + def maketrans(x: Union[Dict[int, _T], Dict[str, _T], Dict[Union[str, int], _T]]) -> Dict[int, _T]: ... + @staticmethod + @overload + def maketrans(x: str, y: str, z: str = ...) -> Dict[int, Union[int, None]]: ... + + if sys.version_info >= (3,): + def __add__(self, s: str) -> str: ... + else: + def __add__(self, s: AnyStr) -> AnyStr: ... + # Incompatible with Sequence.__contains__ + def __contains__(self, o: Union[str, Text]) -> bool: ... # type: ignore + def __eq__(self, x: object) -> bool: ... + def __ge__(self, x: Text) -> bool: ... + def __getitem__(self, i: Union[int, slice]) -> str: ... + def __gt__(self, x: Text) -> bool: ... + def __hash__(self) -> int: ... + def __iter__(self) -> Iterator[str]: ... + def __le__(self, x: Text) -> bool: ... + def __len__(self) -> int: ... + def __lt__(self, x: Text) -> bool: ... + def __mod__(self, x: Any) -> str: ... + def __mul__(self, n: int) -> str: ... + def __ne__(self, x: object) -> bool: ... + def __repr__(self) -> str: ... + def __rmul__(self, n: int) -> str: ... + def __str__(self) -> str: ... + def __getnewargs__(self) -> Tuple[str]: ... + + if sys.version_info < (3,): + def __getslice__(self, start: int, stop: int) -> str: ... + def __float__(self) -> float: ... + def __int__(self) -> int: ... + +if sys.version_info >= (3,): + class bytes(ByteString): + @overload + def __init__(self, ints: Iterable[int]) -> None: ... + @overload + def __init__(self, string: str, encoding: str, + errors: str = ...) -> None: ... + @overload + def __init__(self, length: int) -> None: ... + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, o: SupportsBytes) -> None: ... + def capitalize(self) -> bytes: ... + def center(self, width: int, fillchar: bytes = ...) -> bytes: ... + def count(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... + def decode(self, encoding: str = ..., errors: str = ...) -> str: ... + def endswith(self, suffix: Union[bytes, Tuple[bytes, ...]]) -> bool: ... + def expandtabs(self, tabsize: int = ...) -> bytes: ... + def find(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... + if sys.version_info >= (3, 5): + def hex(self) -> str: ... + def index(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... + def isalnum(self) -> bool: ... + def isalpha(self) -> bool: ... + if sys.version_info >= (3, 7): + def isascii(self) -> bool: ... + def isdigit(self) -> bool: ... + def islower(self) -> bool: ... + def isspace(self) -> bool: ... + def istitle(self) -> bool: ... + def isupper(self) -> bool: ... + def join(self, iterable: Iterable[Union[ByteString, memoryview]]) -> bytes: ... + def ljust(self, width: int, fillchar: bytes = ...) -> bytes: ... + def lower(self) -> bytes: ... + def lstrip(self, chars: Optional[bytes] = ...) -> bytes: ... + def partition(self, sep: bytes) -> Tuple[bytes, bytes, bytes]: ... + def replace(self, old: bytes, new: bytes, count: int = ...) -> bytes: ... + def rfind(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... + def rindex(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... + def rjust(self, width: int, fillchar: bytes = ...) -> bytes: ... + def rpartition(self, sep: bytes) -> Tuple[bytes, bytes, bytes]: ... + def rsplit(self, sep: Optional[bytes] = ..., maxsplit: int = ...) -> List[bytes]: ... + def rstrip(self, chars: Optional[bytes] = ...) -> bytes: ... + def split(self, sep: Optional[bytes] = ..., maxsplit: int = ...) -> List[bytes]: ... + def splitlines(self, keepends: bool = ...) -> List[bytes]: ... + def startswith( + self, + prefix: Union[bytes, Tuple[bytes, ...]], + start: Optional[int] = ..., + end: Optional[int] = ..., + ) -> bool: ... + def strip(self, chars: Optional[bytes] = ...) -> bytes: ... + def swapcase(self) -> bytes: ... + def title(self) -> bytes: ... + def translate(self, table: Optional[bytes], delete: bytes = ...) -> bytes: ... + def upper(self) -> bytes: ... + def zfill(self, width: int) -> bytes: ... + @classmethod + def fromhex(cls, s: str) -> bytes: ... + @classmethod + def maketrans(cls, frm: bytes, to: bytes) -> bytes: ... + + def __len__(self) -> int: ... + def __iter__(self) -> Iterator[int]: ... + def __str__(self) -> str: ... + def __repr__(self) -> str: ... + def __int__(self) -> int: ... + def __float__(self) -> float: ... + def __hash__(self) -> int: ... + @overload + def __getitem__(self, i: int) -> int: ... + @overload + def __getitem__(self, s: slice) -> bytes: ... + def __add__(self, s: bytes) -> bytes: ... + def __mul__(self, n: int) -> bytes: ... + def __rmul__(self, n: int) -> bytes: ... + if sys.version_info >= (3, 5): + def __mod__(self, value: Any) -> bytes: ... + # Incompatible with Sequence.__contains__ + def __contains__(self, o: Union[int, bytes]) -> bool: ... # type: ignore + def __eq__(self, x: object) -> bool: ... + def __ne__(self, x: object) -> bool: ... + def __lt__(self, x: bytes) -> bool: ... + def __le__(self, x: bytes) -> bool: ... + def __gt__(self, x: bytes) -> bool: ... + def __ge__(self, x: bytes) -> bool: ... + def __getnewargs__(self) -> Tuple[bytes]: ... +else: + bytes = str + +class bytearray(MutableSequence[int], ByteString): + if sys.version_info >= (3,): + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, ints: Iterable[int]) -> None: ... + @overload + def __init__(self, string: Text, encoding: Text, errors: Text = ...) -> None: ... + @overload + def __init__(self, length: int) -> None: ... + else: + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, ints: Iterable[int]) -> None: ... + @overload + def __init__(self, string: str) -> None: ... + @overload + def __init__(self, string: Text, encoding: Text, errors: Text = ...) -> None: ... + @overload + def __init__(self, length: int) -> None: ... + def capitalize(self) -> bytearray: ... + def center(self, width: int, fillchar: bytes = ...) -> bytearray: ... + if sys.version_info >= (3,): + def count(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... + def copy(self) -> bytearray: ... + else: + def count(self, x: str) -> int: ... + def decode(self, encoding: Text = ..., errors: Text = ...) -> str: ... + def endswith(self, suffix: Union[bytes, Tuple[bytes, ...]]) -> bool: ... + def expandtabs(self, tabsize: int = ...) -> bytearray: ... + if sys.version_info >= (3,): + def find(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... + if sys.version_info >= (3, 5): + def hex(self) -> str: ... + def index(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... + else: + def find(self, sub: str, start: int = ..., end: int = ...) -> int: ... + def index(self, sub: str, start: int = ..., end: int = ...) -> int: ... + def insert(self, index: int, object: int) -> None: ... + def isalnum(self) -> bool: ... + def isalpha(self) -> bool: ... + if sys.version_info >= (3, 7): + def isascii(self) -> bool: ... + def isdigit(self) -> bool: ... + def islower(self) -> bool: ... + def isspace(self) -> bool: ... + def istitle(self) -> bool: ... + def isupper(self) -> bool: ... + if sys.version_info >= (3,): + def join(self, iterable: Iterable[Union[ByteString, memoryview]]) -> bytearray: ... + def ljust(self, width: int, fillchar: bytes = ...) -> bytearray: ... + else: + def join(self, iterable: Iterable[str]) -> bytearray: ... + def ljust(self, width: int, fillchar: str = ...) -> bytearray: ... + def lower(self) -> bytearray: ... + def lstrip(self, chars: Optional[bytes] = ...) -> bytearray: ... + def partition(self, sep: bytes) -> Tuple[bytearray, bytearray, bytearray]: ... + def replace(self, old: bytes, new: bytes, count: int = ...) -> bytearray: ... + if sys.version_info >= (3,): + def rfind(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... + def rindex(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... + else: + def rfind(self, sub: bytes, start: int = ..., end: int = ...) -> int: ... + def rindex(self, sub: bytes, start: int = ..., end: int = ...) -> int: ... + def rjust(self, width: int, fillchar: bytes = ...) -> bytearray: ... + def rpartition(self, sep: bytes) -> Tuple[bytearray, bytearray, bytearray]: ... + def rsplit(self, sep: Optional[bytes] = ..., maxsplit: int = ...) -> List[bytearray]: ... + def rstrip(self, chars: Optional[bytes] = ...) -> bytearray: ... + def split(self, sep: Optional[bytes] = ..., maxsplit: int = ...) -> List[bytearray]: ... + def splitlines(self, keepends: bool = ...) -> List[bytearray]: ... + def startswith( + self, + prefix: Union[bytes, Tuple[bytes, ...]], + start: Optional[int] = ..., + end: Optional[int] = ..., + ) -> bool: ... + def strip(self, chars: Optional[bytes] = ...) -> bytearray: ... + def swapcase(self) -> bytearray: ... + def title(self) -> bytearray: ... + if sys.version_info >= (3,): + def translate(self, table: Optional[bytes], delete: bytes = ...) -> bytearray: ... + else: + def translate(self, table: str) -> bytearray: ... + def upper(self) -> bytearray: ... + def zfill(self, width: int) -> bytearray: ... + @staticmethod + def fromhex(s: str) -> bytearray: ... + if sys.version_info >= (3,): + @classmethod + def maketrans(cls, frm: bytes, to: bytes) -> bytes: ... + + def __len__(self) -> int: ... + def __iter__(self) -> Iterator[int]: ... + def __str__(self) -> str: ... + def __repr__(self) -> str: ... + def __int__(self) -> int: ... + def __float__(self) -> float: ... + def __hash__(self) -> int: ... + @overload + def __getitem__(self, i: int) -> int: ... + @overload + def __getitem__(self, s: slice) -> bytearray: ... + @overload + def __setitem__(self, i: int, x: int) -> None: ... + @overload + def __setitem__(self, s: slice, x: Union[Iterable[int], bytes]) -> None: ... + def __delitem__(self, i: Union[int, slice]) -> None: ... + if sys.version_info < (3,): + def __getslice__(self, start: int, stop: int) -> bytearray: ... + def __setslice__(self, start: int, stop: int, x: Union[Sequence[int], str]) -> None: ... + def __delslice__(self, start: int, stop: int) -> None: ... + def __add__(self, s: bytes) -> bytearray: ... + if sys.version_info >= (3,): + def __iadd__(self, s: Iterable[int]) -> bytearray: ... + def __mul__(self, n: int) -> bytearray: ... + if sys.version_info >= (3,): + def __rmul__(self, n: int) -> bytearray: ... + def __imul__(self, n: int) -> bytearray: ... + if sys.version_info >= (3, 5): + def __mod__(self, value: Any) -> bytes: ... + # Incompatible with Sequence.__contains__ + def __contains__(self, o: Union[int, bytes]) -> bool: ... # type: ignore + def __eq__(self, x: object) -> bool: ... + def __ne__(self, x: object) -> bool: ... + def __lt__(self, x: bytes) -> bool: ... + def __le__(self, x: bytes) -> bool: ... + def __gt__(self, x: bytes) -> bool: ... + def __ge__(self, x: bytes) -> bool: ... + +if sys.version_info >= (3,): + _mv_container_type = int +else: + _mv_container_type = str + +class memoryview(Sized, Container[_mv_container_type]): + format: str + itemsize: int + shape: Optional[Tuple[int, ...]] + strides: Optional[Tuple[int, ...]] + suboffsets: Optional[Tuple[int, ...]] + readonly: bool + ndim: int + + if sys.version_info >= (3,): + c_contiguous: bool + f_contiguous: bool + contiguous: bool + def __init__(self, obj: Union[bytes, bytearray, memoryview]) -> None: ... + def __enter__(self) -> memoryview: ... + def __exit__(self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType]) -> bool: ... + else: + def __init__(self, obj: Union[bytes, bytearray, buffer, memoryview]) -> None: ... + + @overload + def __getitem__(self, i: int) -> _mv_container_type: ... + @overload + def __getitem__(self, s: slice) -> memoryview: ... + + def __contains__(self, x: object) -> bool: ... + def __iter__(self) -> Iterator[_mv_container_type]: ... + def __len__(self) -> int: ... + + @overload + def __setitem__(self, i: int, o: bytes) -> None: ... + @overload + def __setitem__(self, s: slice, o: Sequence[bytes]) -> None: ... + @overload + def __setitem__(self, s: slice, o: memoryview) -> None: ... + + def tobytes(self) -> bytes: ... + def tolist(self) -> List[int]: ... + + if sys.version_info >= (3, 5): + def hex(self) -> str: ... + +class bool(int): + def __init__(self, o: object = ...) -> None: ... + @overload + def __and__(self, x: bool) -> bool: ... + @overload + def __and__(self, x: int) -> int: ... + @overload + def __or__(self, x: bool) -> bool: ... + @overload + def __or__(self, x: int) -> int: ... + @overload + def __xor__(self, x: bool) -> bool: ... + @overload + def __xor__(self, x: int) -> int: ... + @overload + def __rand__(self, x: bool) -> bool: ... + @overload + def __rand__(self, x: int) -> int: ... + @overload + def __ror__(self, x: bool) -> bool: ... + @overload + def __ror__(self, x: int) -> int: ... + @overload + def __rxor__(self, x: bool) -> bool: ... + @overload + def __rxor__(self, x: int) -> int: ... + def __getnewargs__(self) -> Tuple[int]: ... + +class slice(object): + start: Optional[int] + step: Optional[int] + stop: Optional[int] + @overload + def __init__(self, stop: Optional[int]) -> None: ... + @overload + def __init__(self, start: Optional[int], stop: Optional[int], step: Optional[int] = ...) -> None: ... + def indices(self, len: int) -> Tuple[int, int, int]: ... + +class tuple(Sequence[_T_co], Generic[_T_co]): + def __new__(cls: Type[_T], iterable: Iterable[_T_co] = ...) -> _T: ... + def __init__(self, iterable: Iterable[_T_co] = ...): ... + def __len__(self) -> int: ... + def __contains__(self, x: object) -> bool: ... + @overload + def __getitem__(self, x: int) -> _T_co: ... + @overload + def __getitem__(self, x: slice) -> Tuple[_T_co, ...]: ... + def __iter__(self) -> Iterator[_T_co]: ... + def __lt__(self, x: Tuple[_T_co, ...]) -> bool: ... + def __le__(self, x: Tuple[_T_co, ...]) -> bool: ... + def __gt__(self, x: Tuple[_T_co, ...]) -> bool: ... + def __ge__(self, x: Tuple[_T_co, ...]) -> bool: ... + def __add__(self, x: Tuple[_T_co, ...]) -> Tuple[_T_co, ...]: ... + def __mul__(self, n: int) -> Tuple[_T_co, ...]: ... + def __rmul__(self, n: int) -> Tuple[_T_co, ...]: ... + def count(self, x: Any) -> int: ... + if sys.version_info >= (3, 5): + def index(self, x: Any, start: int = ..., end: int = ...) -> int: ... + else: + def index(self, x: Any) -> int: ... + +class list(MutableSequence[_T], Generic[_T]): + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, iterable: Iterable[_T]) -> None: ... + if sys.version_info >= (3,): + def clear(self) -> None: ... + def copy(self) -> List[_T]: ... + def append(self, object: _T) -> None: ... + def extend(self, iterable: Iterable[_T]) -> None: ... + def pop(self, index: int = ...) -> _T: ... + def index(self, object: _T, start: int = ..., stop: int = ...) -> int: ... + def count(self, object: _T) -> int: ... + def insert(self, index: int, object: _T) -> None: ... + def remove(self, object: _T) -> None: ... + def reverse(self) -> None: ... + if sys.version_info >= (3,): + def sort(self, *, key: Optional[Callable[[_T], Any]] = ..., reverse: bool = ...) -> None: ... + else: + def sort(self, cmp: Callable[[_T, _T], Any] = ..., key: Callable[[_T], Any] = ..., reverse: bool = ...) -> None: ... + + def __len__(self) -> int: ... + def __iter__(self) -> Iterator[_T]: ... + def __str__(self) -> str: ... + def __hash__(self) -> int: ... + @overload + def __getitem__(self, i: int) -> _T: ... + @overload + def __getitem__(self, s: slice) -> List[_T]: ... + @overload + def __setitem__(self, i: int, o: _T) -> None: ... + @overload + def __setitem__(self, s: slice, o: Iterable[_T]) -> None: ... + def __delitem__(self, i: Union[int, slice]) -> None: ... + if sys.version_info < (3,): + def __getslice__(self, start: int, stop: int) -> List[_T]: ... + def __setslice__(self, start: int, stop: int, o: Sequence[_T]) -> None: ... + def __delslice__(self, start: int, stop: int) -> None: ... + def __add__(self, x: List[_T]) -> List[_T]: ... + def __iadd__(self: _S, x: Iterable[_T]) -> _S: ... + def __mul__(self, n: int) -> List[_T]: ... + def __rmul__(self, n: int) -> List[_T]: ... + if sys.version_info >= (3,): + def __imul__(self: _S, n: int) -> _S: ... + def __contains__(self, o: object) -> bool: ... + def __reversed__(self) -> Iterator[_T]: ... + def __gt__(self, x: List[_T]) -> bool: ... + def __ge__(self, x: List[_T]) -> bool: ... + def __lt__(self, x: List[_T]) -> bool: ... + def __le__(self, x: List[_T]) -> bool: ... + +class dict(MutableMapping[_KT, _VT], Generic[_KT, _VT]): + # NOTE: Keyword arguments are special. If they are used, _KT must include + # str, but we have no way of enforcing it here. + @overload + def __init__(self, **kwargs: _VT) -> None: ... + @overload + def __init__(self, map: Mapping[_KT, _VT], **kwargs: _VT) -> None: ... + @overload + def __init__(self, iterable: Iterable[Tuple[_KT, _VT]], **kwargs: _VT) -> None: ... + + def __new__(cls: Type[_T1], *args: Any, **kwargs: Any) -> _T1: ... + + if sys.version_info < (3,): + def has_key(self, k: _KT) -> bool: ... + def clear(self) -> None: ... + def copy(self) -> Dict[_KT, _VT]: ... + def popitem(self) -> Tuple[_KT, _VT]: ... + def setdefault(self, k: _KT, default: _VT = ...) -> _VT: ... + @overload + def update(self, __m: Mapping[_KT, _VT], **kwargs: _VT) -> None: ... + @overload + def update(self, __m: Iterable[Tuple[_KT, _VT]], **kwargs: _VT) -> None: ... + @overload + def update(self, **kwargs: _VT) -> None: ... + if sys.version_info >= (3,): + def keys(self) -> KeysView[_KT]: ... + def values(self) -> ValuesView[_VT]: ... + def items(self) -> ItemsView[_KT, _VT]: ... + else: + def iterkeys(self) -> Iterator[_KT]: ... + def itervalues(self) -> Iterator[_VT]: ... + def iteritems(self) -> Iterator[Tuple[_KT, _VT]]: ... + def viewkeys(self) -> KeysView[_KT]: ... + def viewvalues(self) -> ValuesView[_VT]: ... + def viewitems(self) -> ItemsView[_KT, _VT]: ... + @staticmethod + @overload + def fromkeys(seq: Iterable[_T]) -> Dict[_T, Any]: ... # TODO: Actually a class method (mypy/issues#328) + @staticmethod + @overload + def fromkeys(seq: Iterable[_T], value: _S) -> Dict[_T, _S]: ... + def __len__(self) -> int: ... + def __getitem__(self, k: _KT) -> _VT: ... + def __setitem__(self, k: _KT, v: _VT) -> None: ... + def __delitem__(self, v: _KT) -> None: ... + def __iter__(self) -> Iterator[_KT]: ... + def __str__(self) -> str: ... + +class set(MutableSet[_T], Generic[_T]): + def __init__(self, iterable: Iterable[_T] = ...) -> None: ... + def add(self, element: _T) -> None: ... + def clear(self) -> None: ... + def copy(self) -> Set[_T]: ... + def difference(self, *s: Iterable[Any]) -> Set[_T]: ... + def difference_update(self, *s: Iterable[Any]) -> None: ... + def discard(self, element: _T) -> None: ... + def intersection(self, *s: Iterable[Any]) -> Set[_T]: ... + def intersection_update(self, *s: Iterable[Any]) -> None: ... + def isdisjoint(self, s: Iterable[Any]) -> bool: ... + def issubset(self, s: Iterable[Any]) -> bool: ... + def issuperset(self, s: Iterable[Any]) -> bool: ... + def pop(self) -> _T: ... + def remove(self, element: _T) -> None: ... + def symmetric_difference(self, s: Iterable[_T]) -> Set[_T]: ... + def symmetric_difference_update(self, s: Iterable[_T]) -> None: ... + def union(self, *s: Iterable[_T]) -> Set[_T]: ... + def update(self, *s: Iterable[_T]) -> None: ... + def __len__(self) -> int: ... + def __contains__(self, o: object) -> bool: ... + def __iter__(self) -> Iterator[_T]: ... + def __str__(self) -> str: ... + def __and__(self, s: AbstractSet[object]) -> Set[_T]: ... + def __iand__(self, s: AbstractSet[object]) -> Set[_T]: ... + def __or__(self, s: AbstractSet[_S]) -> Set[Union[_T, _S]]: ... + def __ior__(self, s: AbstractSet[_S]) -> Set[Union[_T, _S]]: ... + def __sub__(self, s: AbstractSet[object]) -> Set[_T]: ... + def __isub__(self, s: AbstractSet[object]) -> Set[_T]: ... + def __xor__(self, s: AbstractSet[_S]) -> Set[Union[_T, _S]]: ... + def __ixor__(self, s: AbstractSet[_S]) -> Set[Union[_T, _S]]: ... + def __le__(self, s: AbstractSet[object]) -> bool: ... + def __lt__(self, s: AbstractSet[object]) -> bool: ... + def __ge__(self, s: AbstractSet[object]) -> bool: ... + def __gt__(self, s: AbstractSet[object]) -> bool: ... + +class frozenset(AbstractSet[_T], Generic[_T]): + def __init__(self, iterable: Iterable[_T] = ...) -> None: ... + def copy(self) -> FrozenSet[_T]: ... + def difference(self, *s: Iterable[object]) -> FrozenSet[_T]: ... + def intersection(self, *s: Iterable[object]) -> FrozenSet[_T]: ... + def isdisjoint(self, s: Iterable[_T]) -> bool: ... + def issubset(self, s: Iterable[object]) -> bool: ... + def issuperset(self, s: Iterable[object]) -> bool: ... + def symmetric_difference(self, s: Iterable[_T]) -> FrozenSet[_T]: ... + def union(self, *s: Iterable[_T]) -> FrozenSet[_T]: ... + def __len__(self) -> int: ... + def __contains__(self, o: object) -> bool: ... + def __iter__(self) -> Iterator[_T]: ... + def __str__(self) -> str: ... + def __and__(self, s: AbstractSet[_T]) -> FrozenSet[_T]: ... + def __or__(self, s: AbstractSet[_S]) -> FrozenSet[Union[_T, _S]]: ... + def __sub__(self, s: AbstractSet[_T]) -> FrozenSet[_T]: ... + def __xor__(self, s: AbstractSet[_S]) -> FrozenSet[Union[_T, _S]]: ... + def __le__(self, s: AbstractSet[object]) -> bool: ... + def __lt__(self, s: AbstractSet[object]) -> bool: ... + def __ge__(self, s: AbstractSet[object]) -> bool: ... + def __gt__(self, s: AbstractSet[object]) -> bool: ... + +class enumerate(Iterator[Tuple[int, _T]], Generic[_T]): + def __init__(self, iterable: Iterable[_T], start: int = ...) -> None: ... + def __iter__(self) -> Iterator[Tuple[int, _T]]: ... + if sys.version_info >= (3,): + def __next__(self) -> Tuple[int, _T]: ... + else: + def next(self) -> Tuple[int, _T]: ... + +if sys.version_info >= (3,): + class range(Sequence[int]): + start: int + stop: int + step: int + @overload + def __init__(self, stop: int) -> None: ... + @overload + def __init__(self, start: int, stop: int, step: int = ...) -> None: ... + def count(self, value: int) -> int: ... + def index(self, value: int, start: int = ..., stop: Optional[int] = ...) -> int: ... + def __len__(self) -> int: ... + def __contains__(self, o: object) -> bool: ... + def __iter__(self) -> Iterator[int]: ... + @overload + def __getitem__(self, i: int) -> int: ... + @overload + def __getitem__(self, s: slice) -> range: ... + def __repr__(self) -> str: ... + def __reversed__(self) -> Iterator[int]: ... +else: + class xrange(Sized, Iterable[int], Reversible[int]): + @overload + def __init__(self, stop: int) -> None: ... + @overload + def __init__(self, start: int, stop: int, step: int = ...) -> None: ... + def __len__(self) -> int: ... + def __iter__(self) -> Iterator[int]: ... + def __getitem__(self, i: int) -> int: ... + def __reversed__(self) -> Iterator[int]: ... + +class property(object): + def __init__(self, fget: Optional[Callable[[Any], Any]] = ..., + fset: Optional[Callable[[Any, Any], None]] = ..., + fdel: Optional[Callable[[Any], None]] = ..., + doc: Optional[str] = ...) -> None: ... + def getter(self, fget: Callable[[Any], Any]) -> property: ... + def setter(self, fset: Callable[[Any, Any], None]) -> property: ... + def deleter(self, fdel: Callable[[Any], None]) -> property: ... + def __get__(self, obj: Any, type: Optional[type] = ...) -> Any: ... + def __set__(self, obj: Any, value: Any) -> None: ... + def __delete__(self, obj: Any) -> None: ... + def fget(self) -> Any: ... + def fset(self, value: Any) -> None: ... + def fdel(self) -> None: ... + +if sys.version_info < (3,): + long = int + +NotImplemented: Any + +def abs(__n: SupportsAbs[_T]) -> _T: ... +def all(__i: Iterable[object]) -> bool: ... +def any(__i: Iterable[object]) -> bool: ... +if sys.version_info < (3,): + def apply(__func: Callable[..., _T], __args: Optional[Sequence[Any]] = ..., __kwds: Optional[Mapping[str, Any]] = ...) -> _T: ... +if sys.version_info >= (3,): + def ascii(__o: object) -> str: ... + +class _SupportsIndex(Protocol): + def __index__(self) -> int: ... +def bin(__number: Union[int, _SupportsIndex]) -> str: ... + +if sys.version_info >= (3, 7): + def breakpoint(*args: Any, **kws: Any) -> None: ... +def callable(__o: object) -> bool: ... +def chr(__code: int) -> str: ... +if sys.version_info < (3,): + def cmp(__x: Any, __y: Any) -> int: ... + _N1 = TypeVar('_N1', bool, int, float, complex) + def coerce(__x: _N1, __y: _N1) -> Tuple[_N1, _N1]: ... +if sys.version_info >= (3, 6): + # This class is to be exported as PathLike from os, + # but we define it here as _PathLike to avoid import cycle issues. + # See https://github.com/python/typeshed/pull/991#issuecomment-288160993 + class _PathLike(Generic[AnyStr]): + def __fspath__(self) -> AnyStr: ... + def compile(source: Union[str, bytes, mod, AST], filename: Union[str, bytes, _PathLike], mode: str, flags: int = ..., dont_inherit: int = ..., optimize: int = ...) -> Any: ... +elif sys.version_info >= (3,): + def compile(source: Union[str, bytes, mod, AST], filename: Union[str, bytes], mode: str, flags: int = ..., dont_inherit: int = ..., optimize: int = ...) -> Any: ... +else: + def compile(source: Union[Text, mod], filename: Text, mode: Text, flags: int = ..., dont_inherit: int = ...) -> Any: ... +if sys.version_info >= (3,): + def copyright() -> None: ... + def credits() -> None: ... +def delattr(__o: Any, __name: Text) -> None: ... +def dir(__o: object = ...) -> List[str]: ... +_N2 = TypeVar('_N2', int, float) +def divmod(__a: _N2, __b: _N2) -> Tuple[_N2, _N2]: ... +def eval(__source: Union[Text, bytes, CodeType], __globals: Optional[Dict[str, Any]] = ..., __locals: Optional[Mapping[str, Any]] = ...) -> Any: ... +if sys.version_info >= (3,): + def exec(__object: Union[str, bytes, CodeType], __globals: Optional[Dict[str, Any]] = ..., __locals: Optional[Mapping[str, Any]] = ...) -> Any: ... +else: + def execfile(__filename: str, __globals: Optional[Dict[str, Any]] = ..., __locals: Optional[Dict[str, Any]] = ...) -> None: ... +def exit(code: object = ...) -> NoReturn: ... +if sys.version_info >= (3,): + @overload + def filter(__function: None, __iterable: Iterable[Optional[_T]]) -> Iterator[_T]: ... + @overload + def filter(__function: Callable[[_T], Any], __iterable: Iterable[_T]) -> Iterator[_T]: ... +else: + @overload + def filter(__function: Callable[[AnyStr], Any], # type: ignore + __iterable: AnyStr) -> AnyStr: ... + @overload + def filter(__function: None, # type: ignore + __iterable: Tuple[Optional[_T], ...]) -> Tuple[_T, ...]: ... + @overload + def filter(__function: Callable[[_T], Any], # type: ignore + __iterable: Tuple[_T, ...]) -> Tuple[_T, ...]: ... + @overload + def filter(__function: None, + __iterable: Iterable[Optional[_T]]) -> List[_T]: ... + @overload + def filter(__function: Callable[[_T], Any], + __iterable: Iterable[_T]) -> List[_T]: ... +def format(__o: object, __format_spec: str = ...) -> str: ... # TODO unicode +def getattr(__o: Any, name: Text, __default: Any = ...) -> Any: ... +def globals() -> Dict[str, Any]: ... +def hasattr(__o: Any, __name: Text) -> bool: ... +def hash(__o: object) -> int: ... +if sys.version_info >= (3,): + def help(*args: Any, **kwds: Any) -> None: ... +def hex(__i: Union[int, _SupportsIndex]) -> str: ... +def id(__o: object) -> int: ... +if sys.version_info >= (3,): + def input(__prompt: Any = ...) -> str: ... +else: + def input(__prompt: Any = ...) -> Any: ... + def intern(__string: str) -> str: ... +@overload +def iter(__iterable: Iterable[_T]) -> Iterator[_T]: ... +@overload +def iter(__function: Callable[[], _T], __sentinel: _T) -> Iterator[_T]: ... +def isinstance(__o: object, __t: Union[type, Tuple[Union[type, Tuple], ...]]) -> bool: ... +def issubclass(__cls: type, __classinfo: Union[type, Tuple[Union[type, Tuple], ...]]) -> bool: ... +def len(__o: Sized) -> int: ... +if sys.version_info >= (3,): + def license() -> None: ... +def locals() -> Dict[str, Any]: ... +if sys.version_info >= (3,): + @overload + def map(__func: Callable[[_T1], _S], __iter1: Iterable[_T1]) -> Iterator[_S]: ... + @overload + def map(__func: Callable[[_T1, _T2], _S], __iter1: Iterable[_T1], + __iter2: Iterable[_T2]) -> Iterator[_S]: ... + @overload + def map(__func: Callable[[_T1, _T2, _T3], _S], + __iter1: Iterable[_T1], + __iter2: Iterable[_T2], + __iter3: Iterable[_T3]) -> Iterator[_S]: ... + @overload + def map(__func: Callable[[_T1, _T2, _T3, _T4], _S], + __iter1: Iterable[_T1], + __iter2: Iterable[_T2], + __iter3: Iterable[_T3], + __iter4: Iterable[_T4]) -> Iterator[_S]: ... + @overload + def map(__func: Callable[[_T1, _T2, _T3, _T4, _T5], _S], + __iter1: Iterable[_T1], + __iter2: Iterable[_T2], + __iter3: Iterable[_T3], + __iter4: Iterable[_T4], + __iter5: Iterable[_T5]) -> Iterator[_S]: ... + @overload + def map(__func: Callable[..., _S], + __iter1: Iterable[Any], + __iter2: Iterable[Any], + __iter3: Iterable[Any], + __iter4: Iterable[Any], + __iter5: Iterable[Any], + __iter6: Iterable[Any], + *iterables: Iterable[Any]) -> Iterator[_S]: ... +else: + @overload + def map(__func: None, __iter1: Iterable[_T1]) -> List[_T1]: ... + @overload + def map(__func: None, + __iter1: Iterable[_T1], + __iter2: Iterable[_T2]) -> List[Tuple[_T1, _T2]]: ... + @overload + def map(__func: None, + __iter1: Iterable[_T1], + __iter2: Iterable[_T2], + __iter3: Iterable[_T3]) -> List[Tuple[_T1, _T2, _T3]]: ... + @overload + def map(__func: None, + __iter1: Iterable[_T1], + __iter2: Iterable[_T2], + __iter3: Iterable[_T3], + __iter4: Iterable[_T4]) -> List[Tuple[_T1, _T2, _T3, _T4]]: ... + @overload + def map(__func: None, + __iter1: Iterable[_T1], + __iter2: Iterable[_T2], + __iter3: Iterable[_T3], + __iter4: Iterable[_T4], + __iter5: Iterable[_T5]) -> List[Tuple[_T1, _T2, _T3, _T4, _T5]]: ... + @overload + def map(__func: None, + __iter1: Iterable[Any], + __iter2: Iterable[Any], + __iter3: Iterable[Any], + __iter4: Iterable[Any], + __iter5: Iterable[Any], + __iter6: Iterable[Any], + *iterables: Iterable[Any]) -> List[Tuple[Any, ...]]: ... + @overload + def map(__func: Callable[[_T1], _S], __iter1: Iterable[_T1]) -> List[_S]: ... + @overload + def map(__func: Callable[[_T1, _T2], _S], + __iter1: Iterable[_T1], + __iter2: Iterable[_T2]) -> List[_S]: ... + @overload + def map(__func: Callable[[_T1, _T2, _T3], _S], + __iter1: Iterable[_T1], + __iter2: Iterable[_T2], + __iter3: Iterable[_T3]) -> List[_S]: ... + @overload + def map(__func: Callable[[_T1, _T2, _T3, _T4], _S], + __iter1: Iterable[_T1], + __iter2: Iterable[_T2], + __iter3: Iterable[_T3], + __iter4: Iterable[_T4]) -> List[_S]: ... + @overload + def map(__func: Callable[[_T1, _T2, _T3, _T4, _T5], _S], + __iter1: Iterable[_T1], + __iter2: Iterable[_T2], + __iter3: Iterable[_T3], + __iter4: Iterable[_T4], + __iter5: Iterable[_T5]) -> List[_S]: ... + @overload + def map(__func: Callable[..., _S], + __iter1: Iterable[Any], + __iter2: Iterable[Any], + __iter3: Iterable[Any], + __iter4: Iterable[Any], + __iter5: Iterable[Any], + __iter6: Iterable[Any], + *iterables: Iterable[Any]) -> List[_S]: ... +if sys.version_info >= (3,): + @overload + def max(__arg1: _T, __arg2: _T, *_args: _T, key: Callable[[_T], Any] = ...) -> _T: ... + @overload + def max(__iterable: Iterable[_T], *, key: Callable[[_T], Any] = ...) -> _T: ... + @overload + def max(__iterable: Iterable[_T], *, key: Callable[[_T], Any] = ..., default: _VT) -> Union[_T, _VT]: ... +else: + @overload + def max(__arg1: _T, __arg2: _T, *_args: _T, key: Callable[[_T], Any] = ...) -> _T: ... + @overload + def max(__iterable: Iterable[_T], *, key: Callable[[_T], Any] = ...) -> _T: ... +if sys.version_info >= (3,): + @overload + def min(__arg1: _T, __arg2: _T, *_args: _T, key: Callable[[_T], Any] = ...) -> _T: ... + @overload + def min(__iterable: Iterable[_T], *, key: Callable[[_T], Any] = ...) -> _T: ... + @overload + def min(__iterable: Iterable[_T], *, key: Callable[[_T], Any] = ..., default: _VT) -> Union[_T, _VT]: ... +else: + @overload + def min(__arg1: _T, __arg2: _T, *_args: _T, key: Callable[[_T], Any] = ...) -> _T: ... + @overload + def min(__iterable: Iterable[_T], *, key: Callable[[_T], Any] = ...) -> _T: ... +@overload +def next(__i: Iterator[_T]) -> _T: ... +@overload +def next(__i: Iterator[_T], default: _VT) -> Union[_T, _VT]: ... +def oct(__i: Union[int, _SupportsIndex]) -> str: ... + +if sys.version_info >= (3, 6): + def open(file: Union[str, bytes, int, _PathLike], mode: str = ..., buffering: int = ..., encoding: Optional[str] = ..., + errors: Optional[str] = ..., newline: Optional[str] = ..., closefd: bool = ..., + opener: Optional[Callable[[str, int], int]] = ...) -> IO[Any]: ... +elif sys.version_info >= (3,): + def open(file: Union[str, bytes, int], mode: str = ..., buffering: int = ..., encoding: Optional[str] = ..., + errors: Optional[str] = ..., newline: Optional[str] = ..., closefd: bool = ..., + opener: Optional[Callable[[str, int], int]] = ...) -> IO[Any]: ... +else: + def open(name: Union[unicode, int], mode: unicode = ..., buffering: int = ...) -> BinaryIO: ... + +def ord(__c: Union[Text, bytes]) -> int: ... +if sys.version_info >= (3,): + class _Writer(Protocol): + def write(self, __s: str) -> Any: ... + def print(*values: object, sep: Text = ..., end: Text = ..., file: Optional[_Writer] = ..., flush: bool = ...) -> None: ... +else: + class _Writer(Protocol): + def write(self, __s: Any) -> Any: ... + # This is only available after from __future__ import print_function. + def print(*values: object, sep: Text = ..., end: Text = ..., file: Optional[_Writer] = ...) -> None: ... +@overload +def pow(__x: int, __y: int) -> Any: ... # The return type can be int or float, depending on y +@overload +def pow(__x: int, __y: int, __z: int) -> Any: ... +@overload +def pow(__x: float, __y: float) -> float: ... +@overload +def pow(__x: float, __y: float, __z: float) -> float: ... +def quit(code: object = ...) -> NoReturn: ... +if sys.version_info < (3,): + def range(__x: int, __y: int = ..., __step: int = ...) -> List[int]: ... + def raw_input(__prompt: Any = ...) -> str: ... + @overload + def reduce(__function: Callable[[_T, _S], _T], __iterable: Iterable[_S], __initializer: _T) -> _T: ... + @overload + def reduce(__function: Callable[[_T, _T], _T], __iterable: Iterable[_T]) -> _T: ... + def reload(__module: Any) -> Any: ... +@overload +def reversed(__object: Sequence[_T]) -> Iterator[_T]: ... +@overload +def reversed(__object: Reversible[_T]) -> Iterator[_T]: ... +def repr(__o: object) -> str: ... +if sys.version_info >= (3,): + @overload + def round(number: float) -> int: ... + @overload + def round(number: float, ndigits: None) -> int: ... + @overload + def round(number: float, ndigits: int) -> float: ... + @overload + def round(number: SupportsRound[_T]) -> int: ... + @overload + def round(number: SupportsRound[_T], ndigits: None) -> int: ... # type: ignore + @overload + def round(number: SupportsRound[_T], ndigits: int) -> _T: ... +else: + @overload + def round(number: float) -> float: ... + @overload + def round(number: float, ndigits: int) -> float: ... + @overload + def round(number: SupportsFloat) -> float: ... + @overload + def round(number: SupportsFloat, ndigits: int) -> float: ... +def setattr(__object: Any, __name: Text, __value: Any) -> None: ... +if sys.version_info >= (3,): + def sorted(__iterable: Iterable[_T], *, + key: Optional[Callable[[_T], Any]] = ..., + reverse: bool = ...) -> List[_T]: ... +else: + def sorted(__iterable: Iterable[_T], *, + cmp: Callable[[_T, _T], int] = ..., + key: Callable[[_T], Any] = ..., + reverse: bool = ...) -> List[_T]: ... +@overload +def sum(__iterable: Iterable[_T]) -> Union[_T, int]: ... +@overload +def sum(__iterable: Iterable[_T], __start: _S) -> Union[_T, _S]: ... +if sys.version_info < (3,): + def unichr(__i: int) -> unicode: ... +def vars(__object: Any = ...) -> Dict[str, Any]: ... +if sys.version_info >= (3,): + @overload + def zip(__iter1: Iterable[_T1]) -> Iterator[Tuple[_T1]]: ... + @overload + def zip(__iter1: Iterable[_T1], __iter2: Iterable[_T2]) -> Iterator[Tuple[_T1, _T2]]: ... + @overload + def zip(__iter1: Iterable[_T1], __iter2: Iterable[_T2], + __iter3: Iterable[_T3]) -> Iterator[Tuple[_T1, _T2, _T3]]: ... + @overload + def zip(__iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3], + __iter4: Iterable[_T4]) -> Iterator[Tuple[_T1, _T2, _T3, _T4]]: ... + @overload + def zip(__iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3], + __iter4: Iterable[_T4], __iter5: Iterable[_T5]) -> Iterator[Tuple[_T1, _T2, _T3, _T4, _T5]]: ... + @overload + def zip(__iter1: Iterable[Any], __iter2: Iterable[Any], __iter3: Iterable[Any], + __iter4: Iterable[Any], __iter5: Iterable[Any], __iter6: Iterable[Any], + *iterables: Iterable[Any]) -> Iterator[Tuple[Any, ...]]: ... +else: + @overload + def zip(__iter1: Iterable[_T1]) -> List[Tuple[_T1]]: ... + @overload + def zip(__iter1: Iterable[_T1], + __iter2: Iterable[_T2]) -> List[Tuple[_T1, _T2]]: ... + @overload + def zip(__iter1: Iterable[_T1], __iter2: Iterable[_T2], + __iter3: Iterable[_T3]) -> List[Tuple[_T1, _T2, _T3]]: ... + @overload + def zip(__iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3], + __iter4: Iterable[_T4]) -> List[Tuple[_T1, _T2, _T3, _T4]]: ... + @overload + def zip(__iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3], + __iter4: Iterable[_T4], __iter5: Iterable[_T5]) -> List[Tuple[_T1, _T2, _T3, _T4, _T5]]: ... + @overload + def zip(__iter1: Iterable[Any], __iter2: Iterable[Any], __iter3: Iterable[Any], + __iter4: Iterable[Any], __iter5: Iterable[Any], __iter6: Iterable[Any], + *iterables: Iterable[Any]) -> List[Tuple[Any, ...]]: ... +def __import__(name: Text, globals: Dict[str, Any] = ..., locals: Dict[str, Any] = ..., + fromlist: List[str] = ..., level: int = ...) -> Any: ... + +# Actually the type of Ellipsis is , but since it's +# not exposed anywhere under that name, we make it private here. +class ellipsis: ... +Ellipsis: ellipsis + +if sys.version_info < (3,): + # TODO: buffer support is incomplete; e.g. some_string.startswith(some_buffer) doesn't type check. + _AnyBuffer = TypeVar('_AnyBuffer', str, unicode, bytearray, buffer) + + class buffer(Sized): + def __init__(self, object: _AnyBuffer, offset: int = ..., size: int = ...) -> None: ... + def __add__(self, other: _AnyBuffer) -> str: ... + def __cmp__(self, other: _AnyBuffer) -> bool: ... + def __getitem__(self, key: Union[int, slice]) -> str: ... + def __getslice__(self, i: int, j: int) -> str: ... + def __len__(self) -> int: ... + def __mul__(self, x: int) -> str: ... + +class BaseException(object): + args: Tuple[Any, ...] + if sys.version_info < (3,): + message: Any + if sys.version_info >= (3,): + __cause__: Optional[BaseException] + __context__: Optional[BaseException] + __suppress_context__: bool + __traceback__: Optional[TracebackType] + def __init__(self, *args: object) -> None: ... + if sys.version_info < (3,): + def __getitem__(self, i: int) -> Any: ... + def __getslice__(self, start: int, stop: int) -> Tuple[Any, ...]: ... + if sys.version_info >= (3,): + def with_traceback(self, tb: Optional[TracebackType]) -> BaseException: ... + +class GeneratorExit(BaseException): ... +class KeyboardInterrupt(BaseException): ... +class SystemExit(BaseException): + code: int +class Exception(BaseException): ... +class StopIteration(Exception): + if sys.version_info >= (3,): + value: Any +if sys.version_info >= (3,): + _StandardError = Exception + class OSError(Exception): + errno: int + strerror: str + # filename, filename2 are actually Union[str, bytes, None] + filename: Any + filename2: Any + EnvironmentError = OSError + IOError = OSError +else: + class StandardError(Exception): ... + _StandardError = StandardError + class EnvironmentError(StandardError): + errno: int + strerror: str + # TODO can this be unicode? + filename: str + class OSError(EnvironmentError): ... + class IOError(EnvironmentError): ... + +class ArithmeticError(_StandardError): ... +class AssertionError(_StandardError): ... +class AttributeError(_StandardError): ... +class BufferError(_StandardError): ... +class EOFError(_StandardError): ... +class ImportError(_StandardError): + if sys.version_info >= (3,): + name: str + path: str +class LookupError(_StandardError): ... +class MemoryError(_StandardError): ... +class NameError(_StandardError): ... +class ReferenceError(_StandardError): ... +class RuntimeError(_StandardError): ... +if sys.version_info >= (3, 5): + class StopAsyncIteration(Exception): + value: Any +class SyntaxError(_StandardError): + msg: str + lineno: int + offset: Optional[int] + text: str + filename: str +class SystemError(_StandardError): ... +class TypeError(_StandardError): ... +class ValueError(_StandardError): ... + +class FloatingPointError(ArithmeticError): ... +class OverflowError(ArithmeticError): ... +class ZeroDivisionError(ArithmeticError): ... + +if sys.version_info >= (3, 6): + class ModuleNotFoundError(ImportError): ... + +class IndexError(LookupError): ... +class KeyError(LookupError): ... + +class UnboundLocalError(NameError): ... + +class WindowsError(OSError): + winerror: int +if sys.version_info >= (3,): + class BlockingIOError(OSError): + characters_written: int + class ChildProcessError(OSError): ... + class ConnectionError(OSError): ... + class BrokenPipeError(ConnectionError): ... + class ConnectionAbortedError(ConnectionError): ... + class ConnectionRefusedError(ConnectionError): ... + class ConnectionResetError(ConnectionError): ... + class FileExistsError(OSError): ... + class FileNotFoundError(OSError): ... + class InterruptedError(OSError): ... + class IsADirectoryError(OSError): ... + class NotADirectoryError(OSError): ... + class PermissionError(OSError): ... + class ProcessLookupError(OSError): ... + class TimeoutError(OSError): ... + +class NotImplementedError(RuntimeError): ... +if sys.version_info >= (3, 5): + class RecursionError(RuntimeError): ... + +class IndentationError(SyntaxError): ... +class TabError(IndentationError): ... + +class UnicodeError(ValueError): ... +class UnicodeDecodeError(UnicodeError): + encoding: str + object: bytes + start: int + end: int + reason: str + def __init__(self, __encoding: str, __object: bytes, __start: int, __end: int, + __reason: str) -> None: ... +class UnicodeEncodeError(UnicodeError): + encoding: str + object: Text + start: int + end: int + reason: str + def __init__(self, __encoding: str, __object: Text, __start: int, __end: int, + __reason: str) -> None: ... +class UnicodeTranslateError(UnicodeError): ... + +class Warning(Exception): ... +class UserWarning(Warning): ... +class DeprecationWarning(Warning): ... +class SyntaxWarning(Warning): ... +class RuntimeWarning(Warning): ... +class FutureWarning(Warning): ... +class PendingDeprecationWarning(Warning): ... +class ImportWarning(Warning): ... +class UnicodeWarning(Warning): ... +class BytesWarning(Warning): ... +if sys.version_info >= (3, 2): + class ResourceWarning(Warning): ... + +if sys.version_info < (3,): + class file(BinaryIO): + @overload + def __init__(self, file: str, mode: str = ..., buffering: int = ...) -> None: ... + @overload + def __init__(self, file: unicode, mode: str = ..., buffering: int = ...) -> None: ... + @overload + def __init__(self, file: int, mode: str = ..., buffering: int = ...) -> None: ... + def __iter__(self) -> Iterator[str]: ... + def next(self) -> str: ... + def read(self, n: int = ...) -> str: ... + def __enter__(self) -> BinaryIO: ... + def __exit__(self, t: Optional[type] = ..., exc: Optional[BaseException] = ..., tb: Optional[Any] = ...) -> bool: ... + def flush(self) -> None: ... + def fileno(self) -> int: ... + def isatty(self) -> bool: ... + def close(self) -> None: ... + + def readable(self) -> bool: ... + def writable(self) -> bool: ... + def seekable(self) -> bool: ... + def seek(self, offset: int, whence: int = ...) -> int: ... + def tell(self) -> int: ... + def readline(self, limit: int = ...) -> str: ... + def readlines(self, hint: int = ...) -> List[str]: ... + def write(self, data: str) -> int: ... + def writelines(self, data: Iterable[str]) -> None: ... + def truncate(self, pos: Optional[int] = ...) -> int: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/_ast.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/_ast.pyi new file mode 100644 index 0000000..c461bb4 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/_ast.pyi @@ -0,0 +1,330 @@ +import typing +from typing import Optional + +__version__: str +PyCF_ONLY_AST: int +_identifier = str + +class AST: + _attributes: typing.Tuple[str, ...] + _fields: typing.Tuple[str, ...] + def __init__(self, *args, **kwargs) -> None: ... + +class mod(AST): + ... + +class Module(mod): + body: typing.List[stmt] + +class Interactive(mod): + body: typing.List[stmt] + +class Expression(mod): + body: expr + +class Suite(mod): + body: typing.List[stmt] + + +class stmt(AST): + lineno: int + col_offset: int + +class FunctionDef(stmt): + name: _identifier + args: arguments + body: typing.List[stmt] + decorator_list: typing.List[expr] + +class ClassDef(stmt): + name: _identifier + bases: typing.List[expr] + body: typing.List[stmt] + decorator_list: typing.List[expr] + +class Return(stmt): + value: Optional[expr] + +class Delete(stmt): + targets: typing.List[expr] + +class Assign(stmt): + targets: typing.List[expr] + value: expr + +class AugAssign(stmt): + target: expr + op: operator + value: expr + +class Print(stmt): + dest: Optional[expr] + values: typing.List[expr] + nl: bool + +class For(stmt): + target: expr + iter: expr + body: typing.List[stmt] + orelse: typing.List[stmt] + +class While(stmt): + test: expr + body: typing.List[stmt] + orelse: typing.List[stmt] + +class If(stmt): + test: expr + body: typing.List[stmt] + orelse: typing.List[stmt] + +class With(stmt): + context_expr: expr + optional_vars: Optional[expr] + body: typing.List[stmt] + +class Raise(stmt): + type: Optional[expr] + inst: Optional[expr] + tback: Optional[expr] + +class TryExcept(stmt): + body: typing.List[stmt] + handlers: typing.List[ExceptHandler] + orelse: typing.List[stmt] + +class TryFinally(stmt): + body: typing.List[stmt] + finalbody: typing.List[stmt] + +class Assert(stmt): + test: expr + msg: Optional[expr] + +class Import(stmt): + names: typing.List[alias] + +class ImportFrom(stmt): + module: Optional[_identifier] + names: typing.List[alias] + level: Optional[int] + +class Exec(stmt): + body: expr + globals: Optional[expr] + locals: Optional[expr] + +class Global(stmt): + names: typing.List[_identifier] + +class Expr(stmt): + value: expr + +class Pass(stmt): ... +class Break(stmt): ... +class Continue(stmt): ... + + +class slice(AST): + ... + +_slice = slice # this lets us type the variable named 'slice' below + +class Slice(slice): + lower: Optional[expr] + upper: Optional[expr] + step: Optional[expr] + +class ExtSlice(slice): + dims: typing.List[slice] + +class Index(slice): + value: expr + +class Ellipsis(slice): ... + + +class expr(AST): + lineno: int + col_offset: int + +class BoolOp(expr): + op: boolop + values: typing.List[expr] + +class BinOp(expr): + left: expr + op: operator + right: expr + +class UnaryOp(expr): + op: unaryop + operand: expr + +class Lambda(expr): + args: arguments + body: expr + +class IfExp(expr): + test: expr + body: expr + orelse: expr + +class Dict(expr): + keys: typing.List[expr] + values: typing.List[expr] + +class Set(expr): + elts: typing.List[expr] + +class ListComp(expr): + elt: expr + generators: typing.List[comprehension] + +class SetComp(expr): + elt: expr + generators: typing.List[comprehension] + +class DictComp(expr): + key: expr + value: expr + generators: typing.List[comprehension] + +class GeneratorExp(expr): + elt: expr + generators: typing.List[comprehension] + +class Yield(expr): + value: Optional[expr] + +class Compare(expr): + left: expr + ops: typing.List[cmpop] + comparators: typing.List[expr] + +class Call(expr): + func: expr + args: typing.List[expr] + keywords: typing.List[keyword] + starargs: Optional[expr] + kwargs: Optional[expr] + +class Repr(expr): + value: expr + +class Num(expr): + n: float + +class Str(expr): + s: str + +class Attribute(expr): + value: expr + attr: _identifier + ctx: expr_context + +class Subscript(expr): + value: expr + slice: _slice + ctx: expr_context + +class Name(expr): + id: _identifier + ctx: expr_context + +class List(expr): + elts: typing.List[expr] + ctx: expr_context + +class Tuple(expr): + elts: typing.List[expr] + ctx: expr_context + + +class expr_context(AST): + ... + +class AugLoad(expr_context): ... +class AugStore(expr_context): ... +class Del(expr_context): ... +class Load(expr_context): ... +class Param(expr_context): ... +class Store(expr_context): ... + + +class boolop(AST): + ... + +class And(boolop): ... +class Or(boolop): ... + +class operator(AST): + ... + +class Add(operator): ... +class BitAnd(operator): ... +class BitOr(operator): ... +class BitXor(operator): ... +class Div(operator): ... +class FloorDiv(operator): ... +class LShift(operator): ... +class Mod(operator): ... +class Mult(operator): ... +class Pow(operator): ... +class RShift(operator): ... +class Sub(operator): ... + +class unaryop(AST): + ... + +class Invert(unaryop): ... +class Not(unaryop): ... +class UAdd(unaryop): ... +class USub(unaryop): ... + +class cmpop(AST): + ... + +class Eq(cmpop): ... +class Gt(cmpop): ... +class GtE(cmpop): ... +class In(cmpop): ... +class Is(cmpop): ... +class IsNot(cmpop): ... +class Lt(cmpop): ... +class LtE(cmpop): ... +class NotEq(cmpop): ... +class NotIn(cmpop): ... + + +class comprehension(AST): + target: expr + iter: expr + ifs: typing.List[expr] + + +class excepthandler(AST): + ... + + +class ExceptHandler(excepthandler): + type: Optional[expr] + name: Optional[expr] + body: typing.List[stmt] + lineno: int + col_offset: int + + +class arguments(AST): + args: typing.List[expr] + vararg: Optional[_identifier] + kwarg: Optional[_identifier] + defaults: typing.List[expr] + +class keyword(AST): + arg: _identifier + value: expr + +class alias(AST): + name: _identifier + asname: Optional[_identifier] diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/_collections.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/_collections.pyi new file mode 100644 index 0000000..e24d405 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/_collections.pyi @@ -0,0 +1,41 @@ +"""Stub file for the '_collections' module.""" + +from typing import Any, Generic, Iterator, TypeVar, Optional, Union + +class defaultdict(dict): + default_factory: None + def __init__(self, default: Any = ..., init: Any = ...) -> None: ... + def __missing__(self, key) -> Any: + raise KeyError() + def __copy__(self) -> defaultdict: ... + def copy(self) -> defaultdict: ... + +_T = TypeVar('_T') +_T2 = TypeVar('_T2') + +class deque(Generic[_T]): + maxlen: Optional[int] + def __init__(self, iterable: Iterator[_T] = ..., maxlen: int = ...) -> None: ... + def append(self, x: _T) -> None: ... + def appendleft(self, x: _T) -> None: ... + def clear(self) -> None: ... + def count(self, x: Any) -> int: ... + def extend(self, iterable: Iterator[_T]) -> None: ... + def extendleft(self, iterable: Iterator[_T]) -> None: ... + def pop(self) -> _T: + raise IndexError() + def popleft(self) -> _T: + raise IndexError() + def remove(self, value: _T) -> None: + raise IndexError() + def reverse(self) -> None: ... + def rotate(self, n: int = ...) -> None: ... + def __contains__(self, o: Any) -> bool: ... + def __copy__(self) -> deque[_T]: ... + def __getitem__(self, i: int) -> _T: + raise IndexError() + def __iadd__(self, other: deque[_T2]) -> deque[Union[_T, _T2]]: ... + def __iter__(self) -> Iterator[_T]: ... + def __len__(self) -> int: ... + def __reversed__(self) -> Iterator[_T]: ... + def __setitem__(self, i: int, x: _T) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/_functools.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/_functools.pyi new file mode 100644 index 0000000..0641885 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/_functools.pyi @@ -0,0 +1,87 @@ +"""Stub file for the '_functools' module.""" + +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Tuple, overload + +_T = TypeVar("_T") +_T2 = TypeVar("_T2") +_T3 = TypeVar("_T3") +_T4 = TypeVar("_T4") +_T5 = TypeVar("_T5") +_S = TypeVar("_S") + +@overload +def reduce(function: Callable[[_T, _T], _T], + sequence: Iterable[_T]) -> _T: ... +@overload +def reduce(function: Callable[[_T, _S], _T], + sequence: Iterable[_S], initial: _T) -> _T: ... + +@overload +def partial(__func: Callable[[_T], _S], __arg: _T) -> Callable[[], _S]: ... +@overload +def partial(__func: Callable[[_T, _T2], _S], __arg: _T) -> Callable[[_T2], _S]: ... +@overload +def partial(__func: Callable[[_T, _T2, _T3], _S], __arg: _T) -> Callable[[_T2, _T3], _S]: ... +@overload +def partial(__func: Callable[[_T, _T2, _T3, _T4], _S], __arg: _T) -> Callable[[_T2, _T3, _T4], _S]: ... +@overload +def partial(__func: Callable[[_T, _T2, _T3, _T4, _T5], _S], __arg: _T) -> Callable[[_T2, _T3, _T4, _T5], _S]: ... + +@overload +def partial(__func: Callable[[_T, _T2], _S], + __arg1: _T, + __arg2: _T2) -> Callable[[], _S]: ... +@overload +def partial(__func: Callable[[_T, _T2, _T3], _S], + __arg1: _T, + __arg2: _T2) -> Callable[[_T3], _S]: ... +@overload +def partial(__func: Callable[[_T, _T2, _T3, _T4], _S], + __arg1: _T, + __arg2: _T2) -> Callable[[_T3, _T4], _S]: ... +@overload +def partial(__func: Callable[[_T, _T2, _T3, _T4, _T5], _S], + __arg1: _T, + __arg2: _T2) -> Callable[[_T3, _T4, _T5], _S]: ... + +@overload +def partial(__func: Callable[[_T, _T2, _T3], _S], + __arg1: _T, + __arg2: _T2, + __arg3: _T3) -> Callable[[], _S]: ... +@overload +def partial(__func: Callable[[_T, _T2, _T3, _T4], _S], + __arg1: _T, + __arg2: _T2, + __arg3: _T3) -> Callable[[_T4], _S]: ... +@overload +def partial(__func: Callable[[_T, _T2, _T3, _T4, _T5], _S], + __arg1: _T, + __arg2: _T2, + __arg3: _T3) -> Callable[[_T4, _T5], _S]: ... + +@overload +def partial(__func: Callable[[_T, _T2, _T3, _T4], _S], + __arg1: _T, + __arg2: _T2, + __arg3: _T3, + __arg4: _T4) -> Callable[[], _S]: ... +@overload +def partial(__func: Callable[[_T, _T2, _T3, _T4, _T5], _S], + __arg1: _T, + __arg2: _T2, + __arg3: _T3, + __arg4: _T4) -> Callable[[_T5], _S]: ... + +@overload +def partial(__func: Callable[[_T, _T2, _T3, _T4, _T5], _S], + __arg1: _T, + __arg2: _T2, + __arg3: _T3, + __arg4: _T4, + __arg5: _T5) -> Callable[[], _S]: ... + +@overload +def partial(__func: Callable[..., _S], + *args: Any, + **kwargs: Any) -> Callable[..., _S]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/_hotshot.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/_hotshot.pyi new file mode 100644 index 0000000..8a9c8d7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/_hotshot.pyi @@ -0,0 +1,34 @@ +"""Stub file for the '_hotshot' module.""" +# This is an autogenerated file. It serves as a starting point +# for a more precise manual annotation of this module. +# Feel free to edit the source below, but remove this header when you do. + +from typing import Any, List, Tuple, Dict, Generic + +def coverage(a: str) -> Any: ... + +def logreader(a: str) -> LogReaderType: + raise IOError() + raise RuntimeError() + +def profiler(a: str, *args, **kwargs) -> Any: + raise IOError() + +def resolution() -> tuple: ... + + +class LogReaderType(object): + def close(self) -> None: ... + def fileno(self) -> int: + raise ValueError() + +class ProfilerType(object): + def addinfo(self, a: str, b: str) -> None: ... + def close(self) -> None: ... + def fileno(self) -> int: + raise ValueError() + def runcall(self, *args, **kwargs) -> Any: ... + def runcode(self, a, b, *args, **kwargs) -> Any: + raise TypeError() + def start(self) -> None: ... + def stop(self) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/_io.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/_io.pyi new file mode 100644 index 0000000..e4e15cb --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/_io.pyi @@ -0,0 +1,183 @@ +from typing import Any, AnyStr, BinaryIO, IO, Text, TextIO, Iterable, Iterator, List, Optional, Type, Tuple, TypeVar, Union +from mmap import mmap +from types import TracebackType + +_bytearray_like = Union[bytearray, mmap] + +DEFAULT_BUFFER_SIZE: int + +class BlockingIOError(IOError): + characters_written: int + +class UnsupportedOperation(ValueError, IOError): ... + +_T = TypeVar("_T") + +class _IOBase(BinaryIO): + @property + def closed(self) -> bool: ... + def _checkClosed(self) -> None: ... + def _checkReadable(self) -> None: ... + def _checkSeekable(self) -> None: ... + def _checkWritable(self) -> None: ... + # All these methods are concrete here (you can instantiate this) + def close(self) -> None: ... + def fileno(self) -> int: ... + def flush(self) -> None: ... + def isatty(self) -> bool: ... + def readable(self) -> bool: ... + def seek(self, offset: int, whence: int = ...) -> int: ... + def seekable(self) -> bool: ... + def tell(self) -> int: ... + def truncate(self, size: Optional[int] = ...) -> int: ... + def writable(self) -> bool: ... + def __enter__(self: _T) -> _T: ... + def __exit__(self, t: Optional[Type[BaseException]], value: Optional[BaseException], traceback: Optional[Any]) -> bool: ... + def __iter__(self: _T) -> _T: ... + # The parameter type of writelines[s]() is determined by that of write(): + def writelines(self, lines: Iterable[bytes]) -> None: ... + # The return type of readline[s]() and next() is determined by that of read(): + def readline(self, limit: int = ...) -> bytes: ... + def readlines(self, hint: int = ...) -> List[bytes]: ... + def next(self) -> bytes: ... + # These don't actually exist but we need to pretend that it does + # so that this class is concrete. + def write(self, s: bytes) -> int: ... + def read(self, n: int = ...) -> bytes: ... + +class _BufferedIOBase(_IOBase): + def read1(self, n: int) -> bytes: ... + def read(self, size: int = ...) -> bytes: ... + def readinto(self, buffer: _bytearray_like) -> int: ... + def write(self, s: bytes) -> int: ... + def detach(self) -> _IOBase: ... + +class BufferedRWPair(_BufferedIOBase): + def __init__(self, reader: _RawIOBase, writer: _RawIOBase, + buffer_size: int = ..., max_buffer_size: int = ...) -> None: ... + def peek(self, n: int = ...) -> bytes: ... + def __enter__(self) -> BufferedRWPair: ... + +class BufferedRandom(_BufferedIOBase): + mode: str + name: str + raw: _IOBase + def __init__(self, raw: _IOBase, + buffer_size: int = ..., + max_buffer_size: int = ...) -> None: ... + def peek(self, n: int = ...) -> bytes: ... + +class BufferedReader(_BufferedIOBase): + mode: str + name: str + raw: _IOBase + def __init__(self, raw: _IOBase, buffer_size: int = ...) -> None: ... + def peek(self, n: int = ...) -> bytes: ... + +class BufferedWriter(_BufferedIOBase): + name: str + raw: _IOBase + mode: str + def __init__(self, raw: _IOBase, + buffer_size: int = ..., + max_buffer_size: int = ...) -> None: ... + +class BytesIO(_BufferedIOBase): + def __init__(self, initial_bytes: bytes = ...) -> None: ... + def __setstate__(self, tuple) -> None: ... + def __getstate__(self) -> tuple: ... + # BytesIO does not contain a "name" field. This workaround is necessary + # to allow BytesIO sub-classes to add this field, as it is defined + # as a read-only property on IO[]. + name: Any + def getvalue(self) -> bytes: ... + def write(self, s: bytes) -> int: ... + def writelines(self, lines: Iterable[bytes]) -> None: ... + def read1(self, size: int) -> bytes: ... + def next(self) -> bytes: ... + +class _RawIOBase(_IOBase): + def readall(self) -> str: ... + def read(self, n: int = ...) -> str: ... + +class FileIO(_RawIOBase, BytesIO): + mode: str + closefd: bool + def __init__(self, file: Union[str, int], mode: str = ..., closefd: bool = ...) -> None: ... + def readinto(self, buffer: _bytearray_like) -> int: ... + def write(self, pbuf: str) -> int: ... + +class IncrementalNewlineDecoder(object): + newlines: Union[str, unicode] + def __init__(self, decoder, translate, z=...) -> None: ... + def decode(self, input, final) -> Any: ... + def getstate(self) -> Tuple[Any, int]: ... + def setstate(self, state: Tuple[Any, int]) -> None: ... + def reset(self) -> None: ... + + +# Note: In the actual _io.py, _TextIOBase inherits from _IOBase. +class _TextIOBase(TextIO): + errors: Optional[str] + # TODO: On _TextIOBase, this is always None. But it's unicode/bytes in subclasses. + newlines: Union[None, unicode, bytes] + encoding: str + @property + def closed(self) -> bool: ... + def _checkClosed(self) -> None: ... + def _checkReadable(self) -> None: ... + def _checkSeekable(self) -> None: ... + def _checkWritable(self) -> None: ... + def close(self) -> None: ... + def detach(self) -> IO: ... + def fileno(self) -> int: ... + def flush(self) -> None: ... + def isatty(self) -> bool: ... + def next(self) -> unicode: ... + def read(self, size: int = ...) -> unicode: ... + def readable(self) -> bool: ... + def readline(self, limit: int = ...) -> unicode: ... + def readlines(self, hint: int = ...) -> list[unicode]: ... + def seek(self, offset: int, whence: int = ...) -> int: ... + def seekable(self) -> bool: ... + def tell(self) -> int: ... + def truncate(self, size: Optional[int] = ...) -> int: ... + def writable(self) -> bool: ... + def write(self, pbuf: unicode) -> int: ... + def writelines(self, lines: Iterable[unicode]) -> None: ... + def __enter__(self: _T) -> _T: ... + def __exit__(self, t: Optional[Type[BaseException]], value: Optional[BaseException], traceback: Optional[Any]) -> bool: ... + def __iter__(self: _T) -> _T: ... + +class StringIO(_TextIOBase): + line_buffering: bool + def __init__(self, + initial_value: Optional[unicode] = ..., + newline: Optional[unicode] = ...) -> None: ... + def __setstate__(self, state: tuple) -> None: ... + def __getstate__(self) -> tuple: ... + # StringIO does not contain a "name" field. This workaround is necessary + # to allow StringIO sub-classes to add this field, as it is defined + # as a read-only property on IO[]. + name: Any + def getvalue(self) -> unicode: ... + +class TextIOWrapper(_TextIOBase): + name: str + line_buffering: bool + buffer: BinaryIO + _CHUNK_SIZE: int + def __init__(self, buffer: IO, + encoding: Optional[Text] = ..., + errors: Optional[Text] = ..., + newline: Optional[Text] = ..., + line_buffering: bool = ..., + write_through: bool = ...) -> None: ... + +def open(file: Union[str, unicode, int], + mode: Text = ..., + buffering: int = ..., + encoding: Optional[Text] = ..., + errors: Optional[Text] = ..., + newline: Optional[Text] = ..., + closefd: bool = ...) -> IO[Any]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/_json.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/_json.pyi new file mode 100644 index 0000000..028b7b2 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/_json.pyi @@ -0,0 +1,17 @@ +"""Stub file for the '_json' module.""" +# This is an autogenerated file. It serves as a starting point +# for a more precise manual annotation of this module. +# Feel free to edit the source below, but remove this header when you do. + +from typing import Any, List, Tuple, Dict, Generic + +def encode_basestring_ascii(*args, **kwargs) -> str: + raise TypeError() + +def scanstring(a, b, *args, **kwargs) -> tuple: + raise TypeError() + + +class Encoder(object): ... + +class Scanner(object): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/_md5.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/_md5.pyi new file mode 100644 index 0000000..96111b7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/_md5.pyi @@ -0,0 +1,13 @@ +blocksize: int +digest_size: int + +class MD5Type(object): + name: str + block_size: int + digest_size: int + def copy(self) -> MD5Type: ... + def digest(self) -> str: ... + def hexdigest(self) -> str: ... + def update(self, arg: str) -> None: ... + +def new(arg: str = ...) -> MD5Type: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/_sha.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/_sha.pyi new file mode 100644 index 0000000..7c47256 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/_sha.pyi @@ -0,0 +1,15 @@ +blocksize: int +block_size: int +digest_size: int + +class sha(object): # not actually exposed + name: str + block_size: int + digest_size: int + digestsize: int + def copy(self) -> sha: ... + def digest(self) -> str: ... + def hexdigest(self) -> str: ... + def update(self, arg: str) -> None: ... + +def new(arg: str = ...) -> sha: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/_sha256.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/_sha256.pyi new file mode 100644 index 0000000..b6eb47d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/_sha256.pyi @@ -0,0 +1,23 @@ +from typing import Optional + +class sha224(object): + name: str + block_size: int + digest_size: int + digestsize: int + def __init__(self, init: Optional[str]) -> None: ... + def copy(self) -> sha224: ... + def digest(self) -> str: ... + def hexdigest(self) -> str: ... + def update(self, arg: str) -> None: ... + +class sha256(object): + name: str + block_size: int + digest_size: int + digestsize: int + def __init__(self, init: Optional[str]) -> None: ... + def copy(self) -> sha256: ... + def digest(self) -> str: ... + def hexdigest(self) -> str: ... + def update(self, arg: str) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/_sha512.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/_sha512.pyi new file mode 100644 index 0000000..b1ca9ae --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/_sha512.pyi @@ -0,0 +1,23 @@ +from typing import Optional + +class sha384(object): + name: str + block_size: int + digest_size: int + digestsize: int + def __init__(self, init: Optional[str]) -> None: ... + def copy(self) -> sha384: ... + def digest(self) -> str: ... + def hexdigest(self) -> str: ... + def update(self, arg: str) -> None: ... + +class sha512(object): + name: str + block_size: int + digest_size: int + digestsize: int + def __init__(self, init: Optional[str]) -> None: ... + def copy(self) -> sha512: ... + def digest(self) -> str: ... + def hexdigest(self) -> str: ... + def update(self, arg: str) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/_socket.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/_socket.pyi new file mode 100644 index 0000000..8d02bde --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/_socket.pyi @@ -0,0 +1,287 @@ +from typing import Tuple, Union, IO, Any, Optional, overload + +AF_APPLETALK: int +AF_ASH: int +AF_ATMPVC: int +AF_ATMSVC: int +AF_AX25: int +AF_BLUETOOTH: int +AF_BRIDGE: int +AF_DECnet: int +AF_ECONET: int +AF_INET: int +AF_INET6: int +AF_IPX: int +AF_IRDA: int +AF_KEY: int +AF_LLC: int +AF_NETBEUI: int +AF_NETLINK: int +AF_NETROM: int +AF_PACKET: int +AF_PPPOX: int +AF_ROSE: int +AF_ROUTE: int +AF_SECURITY: int +AF_SNA: int +AF_TIPC: int +AF_UNIX: int +AF_UNSPEC: int +AF_WANPIPE: int +AF_X25: int +AI_ADDRCONFIG: int +AI_ALL: int +AI_CANONNAME: int +AI_NUMERICHOST: int +AI_NUMERICSERV: int +AI_PASSIVE: int +AI_V4MAPPED: int +BDADDR_ANY: str +BDADDR_LOCAL: str +BTPROTO_HCI: int +BTPROTO_L2CAP: int +BTPROTO_RFCOMM: int +BTPROTO_SCO: int +EAI_ADDRFAMILY: int +EAI_AGAIN: int +EAI_BADFLAGS: int +EAI_FAIL: int +EAI_FAMILY: int +EAI_MEMORY: int +EAI_NODATA: int +EAI_NONAME: int +EAI_OVERFLOW: int +EAI_SERVICE: int +EAI_SOCKTYPE: int +EAI_SYSTEM: int +EBADF: int +EINTR: int +HCI_DATA_DIR: int +HCI_FILTER: int +HCI_TIME_STAMP: int +INADDR_ALLHOSTS_GROUP: int +INADDR_ANY: int +INADDR_BROADCAST: int +INADDR_LOOPBACK: int +INADDR_MAX_LOCAL_GROUP: int +INADDR_NONE: int +INADDR_UNSPEC_GROUP: int +IPPORT_RESERVED: int +IPPORT_USERRESERVED: int +IPPROTO_AH: int +IPPROTO_DSTOPTS: int +IPPROTO_EGP: int +IPPROTO_ESP: int +IPPROTO_FRAGMENT: int +IPPROTO_GRE: int +IPPROTO_HOPOPTS: int +IPPROTO_ICMP: int +IPPROTO_ICMPV6: int +IPPROTO_IDP: int +IPPROTO_IGMP: int +IPPROTO_IP: int +IPPROTO_IPIP: int +IPPROTO_IPV6: int +IPPROTO_NONE: int +IPPROTO_PIM: int +IPPROTO_PUP: int +IPPROTO_RAW: int +IPPROTO_ROUTING: int +IPPROTO_RSVP: int +IPPROTO_TCP: int +IPPROTO_TP: int +IPPROTO_UDP: int +IPV6_CHECKSUM: int +IPV6_DSTOPTS: int +IPV6_HOPLIMIT: int +IPV6_HOPOPTS: int +IPV6_JOIN_GROUP: int +IPV6_LEAVE_GROUP: int +IPV6_MULTICAST_HOPS: int +IPV6_MULTICAST_IF: int +IPV6_MULTICAST_LOOP: int +IPV6_NEXTHOP: int +IPV6_PKTINFO: int +IPV6_RECVDSTOPTS: int +IPV6_RECVHOPLIMIT: int +IPV6_RECVHOPOPTS: int +IPV6_RECVPKTINFO: int +IPV6_RECVRTHDR: int +IPV6_RECVTCLASS: int +IPV6_RTHDR: int +IPV6_RTHDRDSTOPTS: int +IPV6_RTHDR_TYPE_0: int +IPV6_TCLASS: int +IPV6_UNICAST_HOPS: int +IPV6_V6ONLY: int +IP_ADD_MEMBERSHIP: int +IP_DEFAULT_MULTICAST_LOOP: int +IP_DEFAULT_MULTICAST_TTL: int +IP_DROP_MEMBERSHIP: int +IP_HDRINCL: int +IP_MAX_MEMBERSHIPS: int +IP_MULTICAST_IF: int +IP_MULTICAST_LOOP: int +IP_MULTICAST_TTL: int +IP_OPTIONS: int +IP_RECVOPTS: int +IP_RECVRETOPTS: int +IP_RETOPTS: int +IP_TOS: int +IP_TTL: int +MSG_CTRUNC: int +MSG_DONTROUTE: int +MSG_DONTWAIT: int +MSG_EOR: int +MSG_OOB: int +MSG_PEEK: int +MSG_TRUNC: int +MSG_WAITALL: int +MethodType: type +NETLINK_DNRTMSG: int +NETLINK_FIREWALL: int +NETLINK_IP6_FW: int +NETLINK_NFLOG: int +NETLINK_ROUTE: int +NETLINK_USERSOCK: int +NETLINK_XFRM: int +NI_DGRAM: int +NI_MAXHOST: int +NI_MAXSERV: int +NI_NAMEREQD: int +NI_NOFQDN: int +NI_NUMERICHOST: int +NI_NUMERICSERV: int +PACKET_BROADCAST: int +PACKET_FASTROUTE: int +PACKET_HOST: int +PACKET_LOOPBACK: int +PACKET_MULTICAST: int +PACKET_OTHERHOST: int +PACKET_OUTGOING: int +PF_PACKET: int +SHUT_RD: int +SHUT_RDWR: int +SHUT_WR: int +SOCK_DGRAM: int +SOCK_RAW: int +SOCK_RDM: int +SOCK_SEQPACKET: int +SOCK_STREAM: int +SOL_HCI: int +SOL_IP: int +SOL_SOCKET: int +SOL_TCP: int +SOL_TIPC: int +SOL_UDP: int +SOMAXCONN: int +SO_ACCEPTCONN: int +SO_BROADCAST: int +SO_DEBUG: int +SO_DONTROUTE: int +SO_ERROR: int +SO_KEEPALIVE: int +SO_LINGER: int +SO_OOBINLINE: int +SO_RCVBUF: int +SO_RCVLOWAT: int +SO_RCVTIMEO: int +SO_REUSEADDR: int +SO_REUSEPORT: int +SO_SNDBUF: int +SO_SNDLOWAT: int +SO_SNDTIMEO: int +SO_TYPE: int +SSL_ERROR_EOF: int +SSL_ERROR_INVALID_ERROR_CODE: int +SSL_ERROR_SSL: int +SSL_ERROR_SYSCALL: int +SSL_ERROR_WANT_CONNECT: int +SSL_ERROR_WANT_READ: int +SSL_ERROR_WANT_WRITE: int +SSL_ERROR_WANT_X509_LOOKUP: int +SSL_ERROR_ZERO_RETURN: int +TCP_CORK: int +TCP_DEFER_ACCEPT: int +TCP_INFO: int +TCP_KEEPCNT: int +TCP_KEEPIDLE: int +TCP_KEEPINTVL: int +TCP_LINGER2: int +TCP_MAXSEG: int +TCP_NODELAY: int +TCP_QUICKACK: int +TCP_SYNCNT: int +TCP_WINDOW_CLAMP: int +TIPC_ADDR_ID: int +TIPC_ADDR_NAME: int +TIPC_ADDR_NAMESEQ: int +TIPC_CFG_SRV: int +TIPC_CLUSTER_SCOPE: int +TIPC_CONN_TIMEOUT: int +TIPC_CRITICAL_IMPORTANCE: int +TIPC_DEST_DROPPABLE: int +TIPC_HIGH_IMPORTANCE: int +TIPC_IMPORTANCE: int +TIPC_LOW_IMPORTANCE: int +TIPC_MEDIUM_IMPORTANCE: int +TIPC_NODE_SCOPE: int +TIPC_PUBLISHED: int +TIPC_SRC_DROPPABLE: int +TIPC_SUBSCR_TIMEOUT: int +TIPC_SUB_CANCEL: int +TIPC_SUB_PORTS: int +TIPC_SUB_SERVICE: int +TIPC_TOP_SRV: int +TIPC_WAIT_FOREVER: int +TIPC_WITHDRAWN: int +TIPC_ZONE_SCOPE: int + +# PyCapsule +CAPI: Any + +has_ipv6: bool + +class error(IOError): ... +class gaierror(error): ... +class timeout(error): ... + +class SocketType(object): + family: int + type: int + proto: int + timeout: float + + def __init__(self, family: int = ..., type: int = ..., proto: int = ...) -> None: ... + def accept(self) -> Tuple[SocketType, tuple]: ... + def bind(self, address: tuple) -> None: ... + def close(self) -> None: ... + def connect(self, address: tuple) -> None: + raise gaierror + raise timeout + def connect_ex(self, address: tuple) -> int: ... + def dup(self) -> SocketType: ... + def fileno(self) -> int: ... + def getpeername(self) -> tuple: ... + def getsockname(self) -> tuple: ... + def getsockopt(self, level: int, option: int, buffersize: int = ...) -> str: ... + def gettimeout(self) -> float: ... + def listen(self, backlog: int) -> None: + raise error + def makefile(self, mode: str = ..., buffersize: int = ...) -> IO[Any]: ... + def recv(self, buffersize: int, flags: int = ...) -> str: ... + def recv_into(self, buffer: bytearray, nbytes: int = ..., flags: int = ...) -> int: ... + def recvfrom(self, buffersize: int, flags: int = ...) -> tuple: + raise error + def recvfrom_into(self, buffer: bytearray, nbytes: int = ..., + flags: int = ...) -> int: ... + def send(self, data: str, flags: int = ...) -> int: ... + def sendall(self, data: str, flags: int = ...) -> None: ... + @overload + def sendto(self, data: str, address: tuple) -> int: ... + @overload + def sendto(self, data: str, flags: int, address: tuple) -> int: ... + def setblocking(self, flag: bool) -> None: ... + def setsockopt(self, level: int, option: int, value: Union[int, str]) -> None: ... + def settimeout(self, value: Optional[float]) -> None: ... + def shutdown(self, flag: int) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/_sre.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/_sre.pyi new file mode 100644 index 0000000..0692b4c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/_sre.pyi @@ -0,0 +1,53 @@ +"""Stub file for the '_sre' module.""" + +from typing import Any, Union, Iterable, Optional, Mapping, Sequence, Dict, List, Tuple, overload + +CODESIZE: int +MAGIC: int +MAXREPEAT: long +copyright: str + +class SRE_Match(object): + def start(self, group: int = ...) -> int: + raise IndexError() + def end(self, group: int = ...) -> int: + raise IndexError() + def expand(self, s: str) -> Any: ... + @overload + def group(self) -> str: ... + @overload + def group(self, group: int = ...) -> Optional[str]: ... + def groupdict(self) -> Dict[int, Optional[str]]: ... + def groups(self) -> Tuple[Optional[str], ...]: ... + def span(self) -> Tuple[int, int]: + raise IndexError() + +class SRE_Scanner(object): + pattern: str + def match(self) -> SRE_Match: ... + def search(self) -> SRE_Match: ... + +class SRE_Pattern(object): + pattern: str + flags: int + groups: int + groupindex: Mapping[str, int] + indexgroup: Sequence[int] + def findall(self, source: str, pos: int = ..., endpos: int = ...) -> List[Union[tuple, str]]: ... + def finditer(self, source: str, pos: int = ..., endpos: int = ...) -> Iterable[Union[tuple, str]]: ... + def match(self, pattern, pos: int = ..., endpos: int = ...) -> SRE_Match: ... + def scanner(self, s: str, start: int = ..., end: int = ...) -> SRE_Scanner: ... + def search(self, pattern, pos: int = ..., endpos: int = ...) -> SRE_Match: ... + def split(self, source: str, maxsplit: int = ...) -> List[Optional[str]]: ... + def sub(self, repl: str, string: str, count: int = ...) -> tuple: ... + def subn(self, repl: str, string: str, count: int = ...) -> tuple: ... + +def compile(pattern: str, flags: int, code: List[int], + groups: int = ..., + groupindex: Mapping[str, int] = ..., + indexgroup: Sequence[int] = ...) -> SRE_Pattern: + raise OverflowError() + +def getcodesize() -> int: ... + +def getlower(a: int, b: int) -> int: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/_struct.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/_struct.pyi new file mode 100644 index 0000000..49f44f2 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/_struct.pyi @@ -0,0 +1,22 @@ +"""Stub file for the '_struct' module.""" + +from typing import Any, AnyStr, Tuple + +class error(Exception): ... + +class Struct(object): + size: int + format: str + + def __init__(self, fmt: str) -> None: ... + def pack_into(self, buffer: bytearray, offset: int, obj: Any) -> None: ... + def pack(self, *args) -> str: ... + def unpack(self, s: str) -> Tuple[Any, ...]: ... + def unpack_from(self, buffer: bytearray, offset: int = ...) -> Tuple[Any, ...]: ... + +def _clearcache() -> None: ... +def calcsize(fmt: str) -> int: ... +def pack(fmt: AnyStr, obj: Any) -> str: ... +def pack_into(fmt: AnyStr, buffer: bytearray, offset: int, obj: Any) -> None: ... +def unpack(fmt: AnyStr, data: str) -> Tuple[Any, ...]: ... +def unpack_from(fmt: AnyStr, buffer: bytearray, offset: int = ...) -> Tuple[Any, ...]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/_symtable.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/_symtable.pyi new file mode 100644 index 0000000..fbf5424 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/_symtable.pyi @@ -0,0 +1,39 @@ +from typing import List, Dict + +CELL: int +DEF_BOUND: int +DEF_FREE: int +DEF_FREE_CLASS: int +DEF_GLOBAL: int +DEF_IMPORT: int +DEF_LOCAL: int +DEF_PARAM: int +FREE: int +GLOBAL_EXPLICIT: int +GLOBAL_IMPLICIT: int +LOCAL: int +OPT_BARE_EXEC: int +OPT_EXEC: int +OPT_IMPORT_STAR: int +SCOPE_MASK: int +SCOPE_OFF: int +TYPE_CLASS: int +TYPE_FUNCTION: int +TYPE_MODULE: int +USE: int + +class _symtable_entry(object): + ... + +class symtable(object): + children: List[_symtable_entry] + id: int + lineno: int + name: str + nested: int + optimized: int + symbols: Dict[str, int] + type: int + varnames: List[str] + + def __init__(self, src: str, filename: str, startstr: str) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/_threading_local.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/_threading_local.pyi new file mode 100644 index 0000000..512bf58 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/_threading_local.pyi @@ -0,0 +1,14 @@ +# Source: https://hg.python.org/cpython/file/2.7/Lib/_threading_local.py +from typing import Any, List + +__all__: List[str] + +class _localbase(object): ... + +class local(_localbase): + def __getattribute__(self, name: str) -> Any: ... + def __setattr__(self, name: str, value: Any) -> None: ... + def __delattr__(self, name: str) -> None: ... + def __del__(self) -> None: ... + +def _patch(self: local) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/_warnings.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/_warnings.pyi new file mode 100644 index 0000000..9609faa --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/_warnings.pyi @@ -0,0 +1,11 @@ +from typing import Any, List, Optional, Type + +default_action: str +filters: List[tuple] +once_registry: dict + +def warn(message: Warning, category: Optional[Type[Warning]] = ..., stacklevel: int = ...) -> None: ... +def warn_explicit(message: Warning, category: Optional[Type[Warning]], + filename: str, lineno: int, + module: Any = ..., registry: dict = ..., + module_globals: dict = ...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/abc.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/abc.pyi new file mode 100644 index 0000000..746f530 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/abc.pyi @@ -0,0 +1,29 @@ +from typing import Any, Dict, Set, Tuple, Type +import _weakrefset + +# NOTE: mypy has special processing for ABCMeta and abstractmethod. + +def abstractmethod(funcobj: Any) -> Any: ... + +class ABCMeta(type): + # TODO: FrozenSet + __abstractmethods__: Set[Any] + _abc_cache: _weakrefset.WeakSet + _abc_invalidation_counter: int + _abc_negative_cache: _weakrefset.WeakSet + _abc_negative_cache_version: int + _abc_registry: _weakrefset.WeakSet + def __init__(self, name: str, bases: Tuple[type, ...], namespace: Dict[Any, Any]) -> None: ... + def __instancecheck__(cls: ABCMeta, instance: Any) -> Any: ... + def __subclasscheck__(cls: ABCMeta, subclass: Any) -> Any: ... + def _dump_registry(cls: ABCMeta, *args: Any, **kwargs: Any) -> None: ... + def register(cls: ABCMeta, subclass: Type[Any]) -> None: ... + +# TODO: The real abc.abstractproperty inherits from "property". +class abstractproperty(object): + def __new__(cls, func: Any) -> Any: ... + __isabstractmethod__: bool + doc: Any + fdel: Any + fget: Any + fset: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/ast.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/ast.pyi new file mode 100644 index 0000000..c5ffd65 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/ast.pyi @@ -0,0 +1,28 @@ +# Python 2.7 ast + +# Rename typing to _typing, as not to conflict with typing imported +# from _ast below when loaded in an unorthodox way by the Dropbox +# internal Bazel integration. +import typing as _typing +from typing import Any, Iterator, Optional, Union + +from _ast import * +from _ast import AST, Module + +def parse(source: Union[str, unicode], filename: Union[str, unicode] = ..., mode: Union[str, unicode] = ...) -> Module: ... +def copy_location(new_node: AST, old_node: AST) -> AST: ... +def dump(node: AST, annotate_fields: bool = ..., include_attributes: bool = ...) -> str: ... +def fix_missing_locations(node: AST) -> AST: ... +def get_docstring(node: AST, clean: bool = ...) -> str: ... +def increment_lineno(node: AST, n: int = ...) -> AST: ... +def iter_child_nodes(node: AST) -> Iterator[AST]: ... +def iter_fields(node: AST) -> Iterator[_typing.Tuple[str, Any]]: ... +def literal_eval(node_or_string: Union[str, unicode, AST]) -> Any: ... +def walk(node: AST) -> Iterator[AST]: ... + +class NodeVisitor(): + def visit(self, node: AST) -> Any: ... + def generic_visit(self, node: AST) -> Any: ... + +class NodeTransformer(NodeVisitor): + def generic_visit(self, node: AST) -> Optional[AST]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/atexit.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/atexit.pyi new file mode 100644 index 0000000..13d2602 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/atexit.pyi @@ -0,0 +1,5 @@ +from typing import TypeVar, Any + +_FT = TypeVar('_FT') + +def register(func: _FT, *args: Any, **kargs: Any) -> _FT: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/cPickle.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/cPickle.pyi new file mode 100644 index 0000000..0421c50 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/cPickle.pyi @@ -0,0 +1,32 @@ +from typing import Any, IO, List + +HIGHEST_PROTOCOL: int +compatible_formats: List[str] +format_version: str + +class Pickler: + def __init__(self, file: IO[str], protocol: int = ...) -> None: ... + + def dump(self, obj: Any) -> None: ... + + def clear_memo(self) -> None: ... + + +class Unpickler: + def __init__(self, file: IO[str]) -> None: ... + + def load(self) -> Any: ... + + def noload(self) -> Any: ... + + +def dump(obj: Any, file: IO[str], protocol: int = ...) -> None: ... +def dumps(obj: Any, protocol: int = ...) -> str: ... +def load(file: IO[str]) -> Any: ... +def loads(str: str) -> Any: ... + +class PickleError(Exception): ... +class UnpicklingError(PickleError): ... +class BadPickleGet(UnpicklingError): ... +class PicklingError(PickleError): ... +class UnpickleableError(PicklingError): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/cStringIO.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/cStringIO.pyi new file mode 100644 index 0000000..380e3a4 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/cStringIO.pyi @@ -0,0 +1,54 @@ +# Stubs for cStringIO (Python 2.7) +# See https://docs.python.org/2/library/stringio.html + +from abc import ABCMeta +from typing import overload, IO, List, Iterable, Iterator, Optional, Union +from types import TracebackType + +# TODO the typing.IO[] generics should be split into input and output. + +# This class isn't actually abstract, but you can't instantiate it +# directly, so we might as well treat it as abstract in the stub. +class InputType(IO[str], Iterator[str], metaclass=ABCMeta): + def getvalue(self) -> str: ... + def close(self) -> None: ... + @property + def closed(self) -> bool: ... + def flush(self) -> None: ... + def isatty(self) -> bool: ... + def read(self, size: int = ...) -> str: ... + def readline(self, size: int = ...) -> str: ... + def readlines(self, hint: int = ...) -> List[str]: ... + def seek(self, offset: int, whence: int = ...) -> int: ... + def tell(self) -> int: ... + def truncate(self, size: Optional[int] = ...) -> int: ... + def __iter__(self) -> InputType: ... + def next(self) -> str: ... + def reset(self) -> None: ... + + +class OutputType(IO[str], Iterator[str], metaclass=ABCMeta): + @property + def softspace(self) -> int: ... + def getvalue(self) -> str: ... + def close(self) -> None: ... + @property + def closed(self) -> bool: ... + def flush(self) -> None: ... + def isatty(self) -> bool: ... + def read(self, size: int = ...) -> str: ... + def readline(self, size: int = ...) -> str: ... + def readlines(self, hint: int = ...) -> List[str]: ... + def seek(self, offset: int, whence: int = ...) -> int: ... + def tell(self) -> int: ... + def truncate(self, size: Optional[int] = ...) -> int: ... + def __iter__(self) -> OutputType: ... + def next(self) -> str: ... + def reset(self) -> None: ... + def write(self, b: Union[str, unicode]) -> int: ... + def writelines(self, lines: Iterable[Union[str, unicode]]) -> None: ... + +@overload +def StringIO() -> OutputType: ... +@overload +def StringIO(s: str) -> InputType: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/collections.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/collections.pyi new file mode 100644 index 0000000..0daa118 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/collections.pyi @@ -0,0 +1,126 @@ +# These are not exported. +from typing import Dict, Generic, TypeVar, Tuple, overload, Type, Optional, List, Union, Reversible + +# These are exported. +from typing import ( + Callable as Callable, + Container as Container, + Hashable as Hashable, + ItemsView as ItemsView, + Iterable as Iterable, + Iterator as Iterator, + KeysView as KeysView, + Mapping as Mapping, + MappingView as MappingView, + MutableMapping as MutableMapping, + MutableSequence as MutableSequence, + MutableSet as MutableSet, + Sequence as Sequence, + AbstractSet as Set, + Sized as Sized, + ValuesView as ValuesView, +) + +_S = TypeVar('_S') +_T = TypeVar('_T') +_KT = TypeVar('_KT') +_VT = TypeVar('_VT') + +# namedtuple is special-cased in the type checker; the initializer is ignored. +def namedtuple(typename: Union[str, unicode], field_names: Union[str, unicode, Iterable[Union[str, unicode]]], + verbose: bool = ..., rename: bool = ...) -> Type[tuple]: ... + +class deque(Sized, Iterable[_T], Reversible[_T], Generic[_T]): + def __init__(self, iterable: Iterable[_T] = ..., + maxlen: int = ...) -> None: ... + @property + def maxlen(self) -> Optional[int]: ... + def append(self, x: _T) -> None: ... + def appendleft(self, x: _T) -> None: ... + def clear(self) -> None: ... + def count(self, x: _T) -> int: ... + def extend(self, iterable: Iterable[_T]) -> None: ... + def extendleft(self, iterable: Iterable[_T]) -> None: ... + def pop(self) -> _T: ... + def popleft(self) -> _T: ... + def remove(self, value: _T) -> None: ... + def reverse(self) -> None: ... + def rotate(self, n: int) -> None: ... + def __len__(self) -> int: ... + def __iter__(self) -> Iterator[_T]: ... + def __str__(self) -> str: ... + def __hash__(self) -> int: ... + def __getitem__(self, i: int) -> _T: ... + def __setitem__(self, i: int, x: _T) -> None: ... + def __contains__(self, o: _T) -> bool: ... + def __reversed__(self) -> Iterator[_T]: ... + def __iadd__(self: _S, iterable: Iterable[_T]) -> _S: ... + +_CounterT = TypeVar('_CounterT', bound=Counter) + +class Counter(Dict[_T, int], Generic[_T]): + @overload + def __init__(self, **kwargs: int) -> None: ... + @overload + def __init__(self, mapping: Mapping[_T, int]) -> None: ... + @overload + def __init__(self, iterable: Iterable[_T]) -> None: ... + def copy(self: _CounterT) -> _CounterT: ... + def elements(self) -> Iterator[_T]: ... + def most_common(self, n: Optional[int] = ...) -> List[Tuple[_T, int]]: ... + @overload + def subtract(self, __mapping: Mapping[_T, int]) -> None: ... + @overload + def subtract(self, iterable: Iterable[_T]) -> None: ... + # The Iterable[Tuple[...]] argument type is not actually desirable + # (the tuples will be added as keys, breaking type safety) but + # it's included so that the signature is compatible with + # Dict.update. Not sure if we should use '# type: ignore' instead + # and omit the type from the union. + @overload + def update(self, __m: Mapping[_T, int], **kwargs: int) -> None: ... + @overload + def update(self, __m: Union[Iterable[_T], Iterable[Tuple[_T, int]]], **kwargs: int) -> None: ... + @overload + def update(self, **kwargs: int) -> None: ... + + def __add__(self, other: Counter[_T]) -> Counter[_T]: ... + def __sub__(self, other: Counter[_T]) -> Counter[_T]: ... + def __and__(self, other: Counter[_T]) -> Counter[_T]: ... + def __or__(self, other: Counter[_T]) -> Counter[_T]: ... + def __iadd__(self, other: Counter[_T]) -> Counter[_T]: ... + def __isub__(self, other: Counter[_T]) -> Counter[_T]: ... + def __iand__(self, other: Counter[_T]) -> Counter[_T]: ... + def __ior__(self, other: Counter[_T]) -> Counter[_T]: ... + +_OrderedDictT = TypeVar('_OrderedDictT', bound=OrderedDict) + +class OrderedDict(Dict[_KT, _VT], Reversible[_KT], Generic[_KT, _VT]): + def popitem(self, last: bool = ...) -> Tuple[_KT, _VT]: ... + def copy(self: _OrderedDictT) -> _OrderedDictT: ... + def __reversed__(self) -> Iterator[_KT]: ... + +_DefaultDictT = TypeVar('_DefaultDictT', bound=defaultdict) + +class defaultdict(Dict[_KT, _VT], Generic[_KT, _VT]): + default_factory: Callable[[], _VT] + @overload + def __init__(self, **kwargs: _VT) -> None: ... + @overload + def __init__(self, default_factory: Optional[Callable[[], _VT]]) -> None: ... + @overload + def __init__(self, default_factory: Optional[Callable[[], _VT]], **kwargs: _VT) -> None: ... + @overload + def __init__(self, default_factory: Optional[Callable[[], _VT]], + map: Mapping[_KT, _VT]) -> None: ... + @overload + def __init__(self, default_factory: Optional[Callable[[], _VT]], + map: Mapping[_KT, _VT], **kwargs: _VT) -> None: ... + @overload + def __init__(self, default_factory: Optional[Callable[[], _VT]], + iterable: Iterable[Tuple[_KT, _VT]]) -> None: ... + @overload + def __init__(self, default_factory: Optional[Callable[[], _VT]], + iterable: Iterable[Tuple[_KT, _VT]], **kwargs: _VT) -> None: ... + def __missing__(self, key: _KT) -> _VT: ... + def copy(self: _DefaultDictT) -> _DefaultDictT: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/commands.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/commands.pyi new file mode 100644 index 0000000..e321f08 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/commands.pyi @@ -0,0 +1,12 @@ +from typing import overload, AnyStr, Text, Tuple + +def getstatus(file: Text) -> str: ... +def getoutput(cmd: Text) -> str: ... +def getstatusoutput(cmd: Text) -> Tuple[int, str]: ... + +@overload +def mk2arg(head: bytes, x: bytes) -> bytes: ... +@overload +def mk2arg(head: Text, x: Text) -> Text: ... + +def mkarg(x: AnyStr) -> AnyStr: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/compileall.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/compileall.pyi new file mode 100644 index 0000000..c3e861e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/compileall.pyi @@ -0,0 +1,10 @@ +# Stubs for compileall (Python 2) + +from typing import Optional, Pattern, Union + +_Path = Union[str, bytes] + +# rx can be any object with a 'search' method; once we have Protocols we can change the type +def compile_dir(dir: _Path, maxlevels: int = ..., ddir: Optional[_Path] = ..., force: bool = ..., rx: Optional[Pattern] = ..., quiet: int = ...) -> int: ... +def compile_file(fullname: _Path, ddir: Optional[_Path] = ..., force: bool = ..., rx: Optional[Pattern] = ..., quiet: int = ...) -> int: ... +def compile_path(skip_curdir: bool = ..., maxlevels: int = ..., force: bool = ..., quiet: int = ...) -> int: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/cookielib.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/cookielib.pyi new file mode 100644 index 0000000..5bc4781 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/cookielib.pyi @@ -0,0 +1,110 @@ +from typing import Any, Optional + +class Cookie: + version: Any + name: Any + value: Any + port: Any + port_specified: Any + domain: Any + domain_specified: Any + domain_initial_dot: Any + path: Any + path_specified: Any + secure: Any + expires: Any + discard: Any + comment: Any + comment_url: Any + rfc2109: Any + def __init__(self, version, name, value, port, port_specified, domain, domain_specified, domain_initial_dot, path, + path_specified, secure, expires, discard, comment, comment_url, rest, rfc2109: bool = ...): ... + def has_nonstandard_attr(self, name): ... + def get_nonstandard_attr(self, name, default: Optional[Any] = ...): ... + def set_nonstandard_attr(self, name, value): ... + def is_expired(self, now: Optional[Any] = ...): ... + +class CookiePolicy: + def set_ok(self, cookie, request): ... + def return_ok(self, cookie, request): ... + def domain_return_ok(self, domain, request): ... + def path_return_ok(self, path, request): ... + +class DefaultCookiePolicy(CookiePolicy): + DomainStrictNoDots: Any + DomainStrictNonDomain: Any + DomainRFC2965Match: Any + DomainLiberal: Any + DomainStrict: Any + netscape: Any + rfc2965: Any + rfc2109_as_netscape: Any + hide_cookie2: Any + strict_domain: Any + strict_rfc2965_unverifiable: Any + strict_ns_unverifiable: Any + strict_ns_domain: Any + strict_ns_set_initial_dollar: Any + strict_ns_set_path: Any + def __init__(self, blocked_domains: Optional[Any] = ..., allowed_domains: Optional[Any] = ..., netscape: bool = ..., + rfc2965: bool = ..., rfc2109_as_netscape: Optional[Any] = ..., hide_cookie2: bool = ..., + strict_domain: bool = ..., strict_rfc2965_unverifiable: bool = ..., strict_ns_unverifiable: bool = ..., + strict_ns_domain=..., strict_ns_set_initial_dollar: bool = ..., strict_ns_set_path: bool = ...): ... + def blocked_domains(self): ... + def set_blocked_domains(self, blocked_domains): ... + def is_blocked(self, domain): ... + def allowed_domains(self): ... + def set_allowed_domains(self, allowed_domains): ... + def is_not_allowed(self, domain): ... + def set_ok(self, cookie, request): ... + def set_ok_version(self, cookie, request): ... + def set_ok_verifiability(self, cookie, request): ... + def set_ok_name(self, cookie, request): ... + def set_ok_path(self, cookie, request): ... + def set_ok_domain(self, cookie, request): ... + def set_ok_port(self, cookie, request): ... + def return_ok(self, cookie, request): ... + def return_ok_version(self, cookie, request): ... + def return_ok_verifiability(self, cookie, request): ... + def return_ok_secure(self, cookie, request): ... + def return_ok_expires(self, cookie, request): ... + def return_ok_port(self, cookie, request): ... + def return_ok_domain(self, cookie, request): ... + def domain_return_ok(self, domain, request): ... + def path_return_ok(self, path, request): ... + +class Absent: ... + +class CookieJar: + non_word_re: Any + quote_re: Any + strict_domain_re: Any + domain_re: Any + dots_re: Any + magic_re: Any + def __init__(self, policy: Optional[Any] = ...): ... + def set_policy(self, policy): ... + def add_cookie_header(self, request): ... + def make_cookies(self, response, request): ... + def set_cookie_if_ok(self, cookie, request): ... + def set_cookie(self, cookie): ... + def extract_cookies(self, response, request): ... + def clear(self, domain: Optional[Any] = ..., path: Optional[Any] = ..., name: Optional[Any] = ...): ... + def clear_session_cookies(self): ... + def clear_expired_cookies(self): ... + def __iter__(self): ... + def __len__(self): ... + +class LoadError(IOError): ... + +class FileCookieJar(CookieJar): + filename: Any + delayload: Any + def __init__(self, filename: Optional[Any] = ..., delayload: bool = ..., policy: Optional[Any] = ...): ... + def save(self, filename: Optional[Any] = ..., ignore_discard: bool = ..., ignore_expires: bool = ...): ... + def load(self, filename: Optional[Any] = ..., ignore_discard: bool = ..., ignore_expires: bool = ...): ... + def revert(self, filename: Optional[Any] = ..., ignore_discard: bool = ..., ignore_expires: bool = ...): ... + +MozillaCookieJar = FileCookieJar +LWPCookieJar = FileCookieJar +def lwp_cookie_str(cookie: Cookie) -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/dircache.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/dircache.pyi new file mode 100644 index 0000000..ac6732b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/dircache.pyi @@ -0,0 +1,10 @@ +# Source: https://hg.python.org/cpython/file/2.7/Lib/dircache.py + +from typing import List, MutableSequence, Text, Union + +def reset() -> None: ... +def listdir(path: Text) -> List[str]: ... + +opendir = listdir + +def annotate(head: Text, list: Union[MutableSequence[str], MutableSequence[Text], MutableSequence[Union[str, Text]]]) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/distutils/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/distutils/__init__.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/distutils/emxccompiler.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/distutils/emxccompiler.pyi new file mode 100644 index 0000000..97e4a29 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/distutils/emxccompiler.pyi @@ -0,0 +1,5 @@ +# Stubs for emxccompiler + +from distutils.unixccompiler import UnixCCompiler + +class EMXCCompiler(UnixCCompiler): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/dummy_thread.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/dummy_thread.pyi new file mode 100644 index 0000000..2804100 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/dummy_thread.pyi @@ -0,0 +1,21 @@ +from typing import Any, Callable, Dict, NoReturn, Optional, Tuple + +class error(Exception): + def __init__(self, *args: Any) -> None: ... + +def start_new_thread(function: Callable[..., Any], args: Tuple[Any, ...], kwargs: Dict[str, Any] = ...) -> None: ... +def exit() -> NoReturn: ... +def get_ident() -> int: ... +def allocate_lock() -> LockType: ... +def stack_size(size: Optional[int] = ...) -> int: ... + +class LockType(object): + locked_status: bool + def __init__(self) -> None: ... + def acquire(self, waitflag: Optional[bool] = ...) -> bool: ... + def __enter__(self, waitflag: Optional[bool] = ...) -> bool: ... + def __exit__(self, typ: Any, val: Any, tb: Any) -> None: ... + def release(self) -> bool: ... + def locked(self) -> bool: ... + +def interrupt_main() -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/email/MIMEText.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/email/MIMEText.pyi new file mode 100644 index 0000000..3b05977 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/email/MIMEText.pyi @@ -0,0 +1,4 @@ +from email.mime.nonmultipart import MIMENonMultipart + +class MIMEText(MIMENonMultipart): + def __init__(self, _text, _subtype=..., _charset=...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/email/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/email/__init__.pyi new file mode 100644 index 0000000..384d956 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/email/__init__.pyi @@ -0,0 +1,6 @@ +from typing import IO, Any, AnyStr + +def message_from_string(s: AnyStr, *args, **kwargs): ... +def message_from_bytes(s: str, *args, **kwargs): ... +def message_from_file(fp: IO[AnyStr], *args, **kwargs): ... +def message_from_binary_file(fp: IO[str], *args, **kwargs): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/email/_parseaddr.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/email/_parseaddr.pyi new file mode 100644 index 0000000..424ade7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/email/_parseaddr.pyi @@ -0,0 +1,40 @@ +from typing import Any, Optional + +def parsedate_tz(data): ... +def parsedate(data): ... +def mktime_tz(data): ... +def quote(str): ... + +class AddrlistClass: + specials: Any + pos: Any + LWS: Any + CR: Any + FWS: Any + atomends: Any + phraseends: Any + field: Any + commentlist: Any + def __init__(self, field): ... + def gotonext(self): ... + def getaddrlist(self): ... + def getaddress(self): ... + def getrouteaddr(self): ... + def getaddrspec(self): ... + def getdomain(self): ... + def getdelimited(self, beginchar, endchars, allowcomments: bool = ...): ... + def getquote(self): ... + def getcomment(self): ... + def getdomainliteral(self): ... + def getatom(self, atomends: Optional[Any] = ...): ... + def getphraselist(self): ... + +class AddressList(AddrlistClass): + addresslist: Any + def __init__(self, field): ... + def __len__(self): ... + def __add__(self, other): ... + def __iadd__(self, other): ... + def __sub__(self, other): ... + def __isub__(self, other): ... + def __getitem__(self, index): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/email/base64mime.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/email/base64mime.pyi new file mode 100644 index 0000000..f05003b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/email/base64mime.pyi @@ -0,0 +1,8 @@ +def base64_len(s: bytes) -> int: ... +def header_encode(header, charset=..., keep_eols=..., maxlinelen=..., eol=...): ... +def encode(s, binary=..., maxlinelen=..., eol=...): ... +body_encode = encode +encodestring = encode +def decode(s, convert_eols=...): ... +body_decode = decode +decodestring = decode diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/email/charset.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/email/charset.pyi new file mode 100644 index 0000000..88b5f88 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/email/charset.pyi @@ -0,0 +1,26 @@ +def add_charset(charset, header_enc=..., body_enc=..., output_charset=...) -> None: ... +def add_alias(alias, canonical) -> None: ... +def add_codec(charset, codecname) -> None: ... + +QP: int # undocumented +BASE64: int # undocumented +SHORTEST: int # undocumented + +class Charset: + input_charset = ... + header_encoding = ... + body_encoding = ... + output_charset = ... + input_codec = ... + output_codec = ... + def __init__(self, input_charset=...) -> None: ... + def __eq__(self, other): ... + def __ne__(self, other): ... + def get_body_encoding(self): ... + def convert(self, s): ... + def to_splittable(self, s): ... + def from_splittable(self, ustr, to_output: bool = ...): ... + def get_output_charset(self): ... + def encoded_header_len(self, s): ... + def header_encode(self, s, convert: bool = ...): ... + def body_encode(self, s, convert: bool = ...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/email/encoders.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/email/encoders.pyi new file mode 100644 index 0000000..5670cba --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/email/encoders.pyi @@ -0,0 +1,4 @@ +def encode_base64(msg) -> None: ... +def encode_quopri(msg) -> None: ... +def encode_7or8bit(msg) -> None: ... +def encode_noop(msg) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/email/feedparser.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/email/feedparser.pyi new file mode 100644 index 0000000..51f8259 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/email/feedparser.pyi @@ -0,0 +1,18 @@ +class BufferedSubFile: + def __init__(self) -> None: ... + def push_eof_matcher(self, pred) -> None: ... + def pop_eof_matcher(self): ... + def close(self) -> None: ... + def readline(self): ... + def unreadline(self, line) -> None: ... + def push(self, data): ... + def pushlines(self, lines) -> None: ... + def is_closed(self): ... + def __iter__(self): ... + def next(self): ... + + +class FeedParser: + def __init__(self, _factory=...) -> None: ... + def feed(self, data) -> None: ... + def close(self): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/email/generator.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/email/generator.pyi new file mode 100644 index 0000000..96cfe2d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/email/generator.pyi @@ -0,0 +1,9 @@ +class Generator: + def __init__(self, outfp, mangle_from_: bool = ..., maxheaderlen: int = ...) -> None: ... + def write(self, s) -> None: ... + def flatten(self, msg, unixfrom: bool = ...) -> None: ... + def clone(self, fp): ... + + +class DecodedGenerator(Generator): + def __init__(self, outfp, mangle_from_: bool = ..., maxheaderlen: int = ..., fmt=...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/email/header.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/email/header.pyi new file mode 100644 index 0000000..69c9363 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/email/header.pyi @@ -0,0 +1,11 @@ +def decode_header(header): ... +def make_header(decoded_seq, maxlinelen=..., header_name=..., continuation_ws=...): ... + +class Header: + def __init__(self, s=..., charset=..., maxlinelen=..., header_name=..., continuation_ws=..., + errors=...) -> None: ... + def __unicode__(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + def append(self, s, charset=..., errors=...) -> None: ... + def encode(self, splitchars=...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/email/iterators.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/email/iterators.pyi new file mode 100644 index 0000000..48aaf06 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/email/iterators.pyi @@ -0,0 +1,5 @@ +from typing import Generator + +def walk(self) -> Generator: ... +def body_line_iterator(msg, decode: bool = ...) -> Generator: ... +def typed_subpart_iterator(msg, maintype=..., subtype=...) -> Generator: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/email/message.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/email/message.pyi new file mode 100644 index 0000000..bd3c622 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/email/message.pyi @@ -0,0 +1,45 @@ +from typing import Generator + +class Message: + preamble = ... + epilogue = ... + defects = ... + def __init__(self): ... + def as_string(self, unixfrom=...): ... + def is_multipart(self) -> bool: ... + def set_unixfrom(self, unixfrom) -> None: ... + def get_unixfrom(self): ... + def attach(self, payload) -> None: ... + def get_payload(self, i=..., decode: bool = ...): ... + def set_payload(self, payload, charset=...) -> None: ... + def set_charset(self, charset): ... + def get_charset(self): ... + def __len__(self): ... + def __getitem__(self, name): ... + def __setitem__(self, name, val) -> None: ... + def __delitem__(self, name) -> None: ... + def __contains__(self, name): ... + def has_key(self, name) -> bool: ... + def keys(self): ... + def values(self): ... + def items(self): ... + def get(self, name, failobj=...): ... + def get_all(self, name, failobj=...): ... + def add_header(self, _name, _value, **_params) -> None: ... + def replace_header(self, _name, _value) -> None: ... + def get_content_type(self): ... + def get_content_maintype(self): ... + def get_content_subtype(self): ... + def get_default_type(self): ... + def set_default_type(self, ctype) -> None: ... + def get_params(self, failobj=..., header=..., unquote: bool = ...): ... + def get_param(self, param, failobj=..., header=..., unquote: bool = ...): ... + def set_param(self, param, value, header=..., requote: bool = ..., charset=..., language=...) -> None: ... + def del_param(self, param, header=..., requote: bool = ...): ... + def set_type(self, type, header=..., requote: bool = ...): ... + def get_filename(self, failobj=...): ... + def get_boundary(self, failobj=...): ... + def set_boundary(self, boundary) -> None: ... + def get_content_charset(self, failobj=...): ... + def get_charsets(self, failobj=...): ... + def walk(self) -> Generator: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/email/mime/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/email/mime/__init__.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/email/mime/application.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/email/mime/application.pyi new file mode 100644 index 0000000..99da672 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/email/mime/application.pyi @@ -0,0 +1,11 @@ +# Stubs for email.mime.application + +from typing import Callable, Optional, Tuple, Union +from email.mime.nonmultipart import MIMENonMultipart + +_ParamsType = Union[str, None, Tuple[str, Optional[str], str]] + +class MIMEApplication(MIMENonMultipart): + def __init__(self, _data: bytes, _subtype: str = ..., + _encoder: Callable[[MIMEApplication], None] = ..., + **_params: _ParamsType) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/email/mime/audio.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/email/mime/audio.pyi new file mode 100644 index 0000000..406ade1 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/email/mime/audio.pyi @@ -0,0 +1,5 @@ +from email.mime.nonmultipart import MIMENonMultipart + + +class MIMEAudio(MIMENonMultipart): + def __init__(self, _audiodata, _subtype=..., _encoder=..., **_params) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/email/mime/base.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/email/mime/base.pyi new file mode 100644 index 0000000..4bde4f0 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/email/mime/base.pyi @@ -0,0 +1,4 @@ +from email import message + +class MIMEBase(message.Message): + def __init__(self, _maintype, _subtype, **_params) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/email/mime/image.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/email/mime/image.pyi new file mode 100644 index 0000000..2dfb098 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/email/mime/image.pyi @@ -0,0 +1,5 @@ +from email.mime.nonmultipart import MIMENonMultipart + + +class MIMEImage(MIMENonMultipart): + def __init__(self, _imagedata, _subtype=..., _encoder=..., **_params) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/email/mime/message.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/email/mime/message.pyi new file mode 100644 index 0000000..33552fa --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/email/mime/message.pyi @@ -0,0 +1,5 @@ +from email.mime.nonmultipart import MIMENonMultipart + + +class MIMEMessage(MIMENonMultipart): + def __init__(self, _msg, _subtype=...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/email/mime/multipart.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/email/mime/multipart.pyi new file mode 100644 index 0000000..0a7d3fa --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/email/mime/multipart.pyi @@ -0,0 +1,4 @@ +from email.mime.base import MIMEBase + +class MIMEMultipart(MIMEBase): + def __init__(self, _subtype=..., boundary=..., _subparts=..., **_params) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/email/mime/nonmultipart.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/email/mime/nonmultipart.pyi new file mode 100644 index 0000000..04d130e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/email/mime/nonmultipart.pyi @@ -0,0 +1,4 @@ +from email.mime.base import MIMEBase + +class MIMENonMultipart(MIMEBase): + def attach(self, payload): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/email/mime/text.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/email/mime/text.pyi new file mode 100644 index 0000000..3b05977 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/email/mime/text.pyi @@ -0,0 +1,4 @@ +from email.mime.nonmultipart import MIMENonMultipart + +class MIMEText(MIMENonMultipart): + def __init__(self, _text, _subtype=..., _charset=...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/email/parser.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/email/parser.pyi new file mode 100644 index 0000000..4f22828 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/email/parser.pyi @@ -0,0 +1,10 @@ +from .feedparser import FeedParser as FeedParser # not in __all__ but listed in documentation + +class Parser: + def __init__(self, *args, **kws) -> None: ... + def parse(self, fp, headersonly: bool = ...): ... + def parsestr(self, text, headersonly: bool = ...): ... + +class HeaderParser(Parser): + def parse(self, fp, headersonly: bool = ...): ... + def parsestr(self, text, headersonly: bool = ...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/email/quoprimime.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/email/quoprimime.pyi new file mode 100644 index 0000000..3f2963c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/email/quoprimime.pyi @@ -0,0 +1,18 @@ +def header_quopri_check(c): ... +def body_quopri_check(c): ... +def header_quopri_len(s): ... +def body_quopri_len(str): ... +def unquote(s): ... +def quote(c): ... +def header_encode(header, charset: str = ..., keep_eols: bool = ..., maxlinelen: int = ..., eol=...): ... +def encode(body, binary: bool = ..., maxlinelen: int = ..., eol=...): ... + +body_encode = encode +encodestring = encode + +def decode(encoded, eol=...): ... + +body_decode = decode +decodestring = decode + +def header_decode(s): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/email/utils.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/email/utils.pyi new file mode 100644 index 0000000..7b868ef --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/email/utils.pyi @@ -0,0 +1,19 @@ +from email._parseaddr import AddressList as _AddressList +from email._parseaddr import mktime_tz as mktime_tz +from email._parseaddr import parsedate as _parsedate +from email._parseaddr import parsedate_tz as _parsedate_tz +from quopri import decodestring as _qdecode +from typing import Optional, Any + +def formataddr(pair): ... +def getaddresses(fieldvalues): ... +def formatdate(timeval: Optional[Any] = ..., localtime: bool = ..., usegmt: bool = ...): ... +def make_msgid(idstring: Optional[Any] = ...): ... +def parsedate(data): ... +def parsedate_tz(data): ... +def parseaddr(addr): ... +def unquote(str): ... +def decode_rfc2231(s): ... +def encode_rfc2231(s, charset: Optional[Any] = ..., language: Optional[Any] = ...): ... +def decode_params(params): ... +def collapse_rfc2231_value(value, errors=..., fallback_charset=...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/encodings/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/encodings/__init__.pyi new file mode 100644 index 0000000..2ae6c0a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/encodings/__init__.pyi @@ -0,0 +1,6 @@ +import codecs + +import typing + +def search_function(encoding: str) -> codecs.CodecInfo: + ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/encodings/utf_8.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/encodings/utf_8.pyi new file mode 100644 index 0000000..d38bd58 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/encodings/utf_8.pyi @@ -0,0 +1,15 @@ +import codecs +from typing import Text, Tuple + +class IncrementalEncoder(codecs.IncrementalEncoder): + def encode(self, input: Text, final: bool = ...) -> bytes: ... + +class IncrementalDecoder(codecs.BufferedIncrementalDecoder): + def _buffer_decode(self, input: bytes, errors: str, final: bool) -> Tuple[Text, int]: ... + +class StreamWriter(codecs.StreamWriter): ... +class StreamReader(codecs.StreamReader): ... + +def getregentry() -> codecs.CodecInfo: ... +def encode(input: Text, errors: Text = ...) -> bytes: ... +def decode(input: bytes, errors: Text = ...) -> Text: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/exceptions.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/exceptions.pyi new file mode 100644 index 0000000..6e4bafc --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/exceptions.pyi @@ -0,0 +1,48 @@ +from __builtin__ import ArithmeticError as ArithmeticError +from __builtin__ import AssertionError as AssertionError +from __builtin__ import AttributeError as AttributeError +from __builtin__ import BaseException as BaseException +from __builtin__ import BufferError as BufferError +from __builtin__ import BytesWarning as BytesWarning +from __builtin__ import DeprecationWarning as DeprecationWarning +from __builtin__ import EOFError as EOFError +from __builtin__ import EnvironmentError as EnvironmentError +from __builtin__ import Exception as Exception +from __builtin__ import FloatingPointError as FloatingPointError +from __builtin__ import FutureWarning as FutureWarning +from __builtin__ import GeneratorExit as GeneratorExit +from __builtin__ import IOError as IOError +from __builtin__ import ImportError as ImportError +from __builtin__ import ImportWarning as ImportWarning +from __builtin__ import IndentationError as IndentationError +from __builtin__ import IndexError as IndexError +from __builtin__ import KeyError as KeyError +from __builtin__ import KeyboardInterrupt as KeyboardInterrupt +from __builtin__ import LookupError as LookupError +from __builtin__ import MemoryError as MemoryError +from __builtin__ import NameError as NameError +from __builtin__ import NotImplementedError as NotImplementedError +from __builtin__ import OSError as OSError +from __builtin__ import OverflowError as OverflowError +from __builtin__ import PendingDeprecationWarning as PendingDeprecationWarning +from __builtin__ import ReferenceError as ReferenceError +from __builtin__ import RuntimeError as RuntimeError +from __builtin__ import RuntimeWarning as RuntimeWarning +from __builtin__ import StandardError as StandardError +from __builtin__ import StopIteration as StopIteration +from __builtin__ import SyntaxError as SyntaxError +from __builtin__ import SyntaxWarning as SyntaxWarning +from __builtin__ import SystemError as SystemError +from __builtin__ import SystemExit as SystemExit +from __builtin__ import TabError as TabError +from __builtin__ import TypeError as TypeError +from __builtin__ import UnboundLocalError as UnboundLocalError +from __builtin__ import UnicodeError as UnicodeError +from __builtin__ import UnicodeDecodeError as UnicodeDecodeError +from __builtin__ import UnicodeEncodeError as UnicodeEncodeError +from __builtin__ import UnicodeTranslateError as UnicodeTranslateError +from __builtin__ import UnicodeWarning as UnicodeWarning +from __builtin__ import UserWarning as UserWarning +from __builtin__ import ValueError as ValueError +from __builtin__ import Warning as Warning +from __builtin__ import ZeroDivisionError as ZeroDivisionError diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/fcntl.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/fcntl.pyi new file mode 100644 index 0000000..5ba64ae --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/fcntl.pyi @@ -0,0 +1,87 @@ +from typing import Any, Union, IO +import io + +FASYNC: int +FD_CLOEXEC: int + +DN_ACCESS: int +DN_ATTRIB: int +DN_CREATE: int +DN_DELETE: int +DN_MODIFY: int +DN_MULTISHOT: int +DN_RENAME: int +F_DUPFD: int +F_EXLCK: int +F_GETFD: int +F_GETFL: int +F_GETLEASE: int +F_GETLK: int +F_GETLK64: int +F_GETOWN: int +F_GETSIG: int +F_NOTIFY: int +F_RDLCK: int +F_SETFD: int +F_SETFL: int +F_SETLEASE: int +F_SETLK: int +F_SETLK64: int +F_SETLKW: int +F_SETLKW64: int +F_SETOWN: int +F_SETSIG: int +F_SHLCK: int +F_UNLCK: int +F_WRLCK: int +I_ATMARK: int +I_CANPUT: int +I_CKBAND: int +I_FDINSERT: int +I_FIND: int +I_FLUSH: int +I_FLUSHBAND: int +I_GETBAND: int +I_GETCLTIME: int +I_GETSIG: int +I_GRDOPT: int +I_GWROPT: int +I_LINK: int +I_LIST: int +I_LOOK: int +I_NREAD: int +I_PEEK: int +I_PLINK: int +I_POP: int +I_PUNLINK: int +I_PUSH: int +I_RECVFD: int +I_SENDFD: int +I_SETCLTIME: int +I_SETSIG: int +I_SRDOPT: int +I_STR: int +I_SWROPT: int +I_UNLINK: int +LOCK_EX: int +LOCK_MAND: int +LOCK_NB: int +LOCK_READ: int +LOCK_RW: int +LOCK_SH: int +LOCK_UN: int +LOCK_WRITE: int + +_ANYFILE = Union[int, IO] + +# TODO All these return either int or bytes depending on the value of +# cmd (not on the type of arg). +def fcntl(fd: _ANYFILE, op: int, arg: Union[int, bytes] = ...) -> Any: ... + +# TODO: arg: int or read-only buffer interface or read-write buffer interface +def ioctl(fd: _ANYFILE, op: int, arg: Union[int, bytes] = ..., + mutate_flag: bool = ...) -> Any: ... + +def flock(fd: _ANYFILE, op: int) -> None: ... +def lockf(fd: _ANYFILE, op: int, length: int = ..., start: int = ..., + whence: int = ...) -> Any: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/fnmatch.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/fnmatch.pyi new file mode 100644 index 0000000..e933b7b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/fnmatch.pyi @@ -0,0 +1,8 @@ +from typing import AnyStr, Iterable, List, Union + +_EitherStr = Union[str, unicode] + +def fnmatch(filename: _EitherStr, pattern: _EitherStr) -> bool: ... +def fnmatchcase(filename: _EitherStr, pattern: _EitherStr) -> bool: ... +def filter(names: Iterable[AnyStr], pattern: _EitherStr) -> List[AnyStr]: ... +def translate(pattern: AnyStr) -> AnyStr: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/functools.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/functools.pyi new file mode 100644 index 0000000..c12af8f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/functools.pyi @@ -0,0 +1,101 @@ +# Stubs for functools (Python 2.7) + +# NOTE: These are incomplete! + +from abc import ABCMeta, abstractmethod +from typing import Any, Callable, Generic, Dict, Iterable, Optional, Sequence, Tuple, TypeVar, overload +from collections import namedtuple + +_AnyCallable = Callable[..., Any] + +_T = TypeVar("_T") +_T2 = TypeVar("_T2") +_T3 = TypeVar("_T3") +_T4 = TypeVar("_T4") +_T5 = TypeVar("_T5") +_S = TypeVar("_S") +@overload +def reduce(function: Callable[[_T, _T], _T], + sequence: Iterable[_T]) -> _T: ... +@overload +def reduce(function: Callable[[_T, _S], _T], + sequence: Iterable[_S], initial: _T) -> _T: ... + +WRAPPER_ASSIGNMENTS: Sequence[str] +WRAPPER_UPDATES: Sequence[str] + +def update_wrapper(wrapper: _AnyCallable, wrapped: _AnyCallable, assigned: Sequence[str] = ..., + updated: Sequence[str] = ...) -> _AnyCallable: ... +def wraps(wrapped: _AnyCallable, assigned: Sequence[str] = ..., updated: Sequence[str] = ...) -> Callable[[_AnyCallable], _AnyCallable]: ... +def total_ordering(cls: type) -> type: ... +def cmp_to_key(mycmp: Callable[[_T, _T], int]) -> Callable[[_T], Any]: ... + +@overload +def partial(__func: Callable[[_T], _S], __arg: _T) -> Callable[[], _S]: ... +@overload +def partial(__func: Callable[[_T, _T2], _S], __arg: _T) -> Callable[[_T2], _S]: ... +@overload +def partial(__func: Callable[[_T, _T2, _T3], _S], __arg: _T) -> Callable[[_T2, _T3], _S]: ... +@overload +def partial(__func: Callable[[_T, _T2, _T3, _T4], _S], __arg: _T) -> Callable[[_T2, _T3, _T4], _S]: ... +@overload +def partial(__func: Callable[[_T, _T2, _T3, _T4, _T5], _S], __arg: _T) -> Callable[[_T2, _T3, _T4, _T5], _S]: ... + +@overload +def partial(__func: Callable[[_T, _T2], _S], + __arg1: _T, + __arg2: _T2) -> Callable[[], _S]: ... +@overload +def partial(__func: Callable[[_T, _T2, _T3], _S], + __arg1: _T, + __arg2: _T2) -> Callable[[_T3], _S]: ... +@overload +def partial(__func: Callable[[_T, _T2, _T3, _T4], _S], + __arg1: _T, + __arg2: _T2) -> Callable[[_T3, _T4], _S]: ... +@overload +def partial(__func: Callable[[_T, _T2, _T3, _T4, _T5], _S], + __arg1: _T, + __arg2: _T2) -> Callable[[_T3, _T4, _T5], _S]: ... + +@overload +def partial(__func: Callable[[_T, _T2, _T3], _S], + __arg1: _T, + __arg2: _T2, + __arg3: _T3) -> Callable[[], _S]: ... +@overload +def partial(__func: Callable[[_T, _T2, _T3, _T4], _S], + __arg1: _T, + __arg2: _T2, + __arg3: _T3) -> Callable[[_T4], _S]: ... +@overload +def partial(__func: Callable[[_T, _T2, _T3, _T4, _T5], _S], + __arg1: _T, + __arg2: _T2, + __arg3: _T3) -> Callable[[_T4, _T5], _S]: ... + +@overload +def partial(__func: Callable[[_T, _T2, _T3, _T4], _S], + __arg1: _T, + __arg2: _T2, + __arg3: _T3, + __arg4: _T4) -> Callable[[], _S]: ... +@overload +def partial(__func: Callable[[_T, _T2, _T3, _T4, _T5], _S], + __arg1: _T, + __arg2: _T2, + __arg3: _T3, + __arg4: _T4) -> Callable[[_T5], _S]: ... + +@overload +def partial(__func: Callable[[_T, _T2, _T3, _T4, _T5], _S], + __arg1: _T, + __arg2: _T2, + __arg3: _T3, + __arg4: _T4, + __arg5: _T5) -> Callable[[], _S]: ... + +@overload +def partial(__func: Callable[..., _S], + *args: Any, + **kwargs: Any) -> Callable[..., _S]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/future_builtins.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/future_builtins.pyi new file mode 100644 index 0000000..a9b25b2 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/future_builtins.pyi @@ -0,0 +1,14 @@ +from typing import Any + +from itertools import ifilter as filter +from itertools import imap as map +from itertools import izip as zip + + +def ascii(obj: Any) -> str: ... + + +def hex(x: int) -> str: ... + + +def oct(x: int) -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/gc.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/gc.pyi new file mode 100644 index 0000000..cdfae74 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/gc.pyi @@ -0,0 +1,29 @@ +# Stubs for gc + +from typing import Any, List, Tuple + + +def enable() -> None: ... +def disable() -> None: ... +def isenabled() -> bool: ... +def collect(generation: int = ...) -> int: ... +def set_debug(flags: int) -> None: ... +def get_debug() -> int: ... +def get_objects() -> List[Any]: ... +def set_threshold(threshold0: int, threshold1: int = ..., + threshold2: int = ...) -> None: ... +def get_count() -> Tuple[int, int, int]: ... +def get_threshold() -> Tuple[int, int, int]: ... +def get_referrers(*objs: Any) -> List[Any]: ... +def get_referents(*objs: Any) -> List[Any]: ... +def is_tracked(obj: Any) -> bool: ... + +garbage: List[Any] + +DEBUG_STATS: int +DEBUG_COLLECTABLE: int +DEBUG_UNCOLLECTABLE: int +DEBUG_INSTANCES: int +DEBUG_OBJECTS: int +DEBUG_SAVEALL: int +DEBUG_LEAK: int diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/getopt.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/getopt.pyi new file mode 100644 index 0000000..370d4d5 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/getopt.pyi @@ -0,0 +1,12 @@ +from typing import List, Tuple + +class GetoptError(Exception): + opt: str + msg: str + def __init__(self, msg: str, opt: str = ...) -> None: ... + def __str__(self) -> str: ... + +error = GetoptError + +def getopt(args: List[str], shortopts: str, longopts: List[str] = ...) -> Tuple[List[Tuple[str, str]], List[str]]: ... +def gnu_getopt(args: List[str], shortopts: str, longopts: List[str] = ...) -> Tuple[List[Tuple[str, str]], List[str]]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/getpass.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/getpass.pyi new file mode 100644 index 0000000..011fc8e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/getpass.pyi @@ -0,0 +1,8 @@ +# Stubs for getpass (Python 2) + +from typing import Any, IO + +class GetPassWarning(UserWarning): ... + +def getpass(prompt: str = ..., stream: IO[Any] = ...) -> str: ... +def getuser() -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/gettext.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/gettext.pyi new file mode 100644 index 0000000..c7bfceb --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/gettext.pyi @@ -0,0 +1,41 @@ +from typing import Any, Container, Dict, IO, List, Optional, Sequence, Type, Union + +def bindtextdomain(domain: str, localedir: str = ...) -> str: ... +def bind_textdomain_codeset(domain: str, codeset: str = ...) -> str: ... +def textdomain(domain: str = ...) -> str: ... +def gettext(message: str) -> str: ... +def lgettext(message: str) -> str: ... +def dgettext(domain: str, message: str) -> str: ... +def ldgettext(domain: str, message: str) -> str: ... +def ngettext(singular: str, plural: str, n: int) -> str: ... +def lngettext(singular: str, plural: str, n: int) -> str: ... +def dngettext(domain: str, singular: str, plural: str, n: int) -> str: ... +def ldngettext(domain: str, singular: str, plural: str, n: int) -> str: ... + +class NullTranslations(object): + def __init__(self, fp: IO[str] = ...) -> None: ... + def _parse(self, fp: IO[str]) -> None: ... + def add_fallback(self, fallback: NullTranslations) -> None: ... + def gettext(self, message: str) -> str: ... + def lgettext(self, message: str) -> str: ... + def ugettext(self, message: Union[str, unicode]) -> unicode: ... + def ngettext(self, singular: str, plural: str, n: int) -> str: ... + def lngettext(self, singular: str, plural: str, n: int) -> str: ... + def ungettext(self, singular: Union[str, unicode], plural: Union[str, unicode], n: int) -> unicode: ... + def info(self) -> Dict[str, str]: ... + def charset(self) -> Optional[str]: ... + def output_charset(self) -> Optional[str]: ... + def set_output_charset(self, charset: Optional[str]) -> None: ... + def install(self, unicode: bool = ..., names: Container[str] = ...) -> None: ... + +class GNUTranslations(NullTranslations): + LE_MAGIC: int + BE_MAGIC: int + +def find(domain: str, localedir: Optional[str] = ..., languages: Optional[Sequence[str]] = ..., + all: Any = ...) -> Optional[Union[str, List[str]]]: ... + +def translation(domain: str, localedir: Optional[str] = ..., languages: Optional[Sequence[str]] = ..., + class_: Optional[Type[NullTranslations]] = ..., fallback: bool = ..., codeset: Optional[str] = ...) -> NullTranslations: ... +def install(domain: str, localedir: Optional[str] = ..., unicode: bool = ..., codeset: Optional[str] = ..., + names: Container[str] = ...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/glob.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/glob.pyi new file mode 100644 index 0000000..5caa166 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/glob.pyi @@ -0,0 +1,7 @@ +from typing import List, Iterator, Union, AnyStr + +def glob(pathname: AnyStr) -> List[AnyStr]: ... +def iglob(pathname: AnyStr) -> Iterator[AnyStr]: ... +def glob1(dirname: Union[str, unicode], pattern: AnyStr) -> List[AnyStr]: ... +def glob0(dirname: Union[str, unicode], basename: AnyStr) -> List[AnyStr]: ... +def has_magic(s: Union[str, unicode]) -> bool: ... # undocumented diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/gzip.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/gzip.pyi new file mode 100644 index 0000000..50c38e4 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/gzip.pyi @@ -0,0 +1,37 @@ +from typing import Any, IO, Text +import io + +class GzipFile(io.BufferedIOBase): + myfileobj: Any + max_read_chunk: Any + mode: Any + extrabuf: Any + extrasize: Any + extrastart: Any + name: Any + min_readsize: Any + compress: Any + fileobj: Any + offset: Any + mtime: Any + def __init__(self, filename: str = ..., mode: Text = ..., compresslevel: int = ..., + fileobj: IO[str] = ..., mtime: float = ...) -> None: ... + @property + def filename(self): ... + size: Any + crc: Any + def write(self, data): ... + def read(self, size=...): ... + @property + def closed(self): ... + def close(self): ... + def flush(self, zlib_mode=...): ... + def fileno(self): ... + def rewind(self): ... + def readable(self): ... + def writable(self): ... + def seekable(self): ... + def seek(self, offset, whence=...): ... + def readline(self, size=...): ... + +def open(filename: str, mode: Text = ..., compresslevel: int = ...) -> GzipFile: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/hashlib.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/hashlib.pyi new file mode 100644 index 0000000..2228820 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/hashlib.pyi @@ -0,0 +1,31 @@ +# Stubs for hashlib (Python 2) + +from typing import Tuple, Union + +_DataType = Union[str, unicode, bytearray, buffer, memoryview] + +class _hash(object): # This is not actually in the module namespace. + name: str + block_size = 0 + digest_size = 0 + digestsize = 0 + def __init__(self, arg: _DataType = ...) -> None: ... + def update(self, arg: _DataType) -> None: ... + def digest(self) -> str: ... + def hexdigest(self) -> str: ... + def copy(self) -> _hash: ... + +def new(name: str, data: str = ...) -> _hash: ... + +def md5(s: _DataType = ...) -> _hash: ... +def sha1(s: _DataType = ...) -> _hash: ... +def sha224(s: _DataType = ...) -> _hash: ... +def sha256(s: _DataType = ...) -> _hash: ... +def sha384(s: _DataType = ...) -> _hash: ... +def sha512(s: _DataType = ...) -> _hash: ... + +algorithms: Tuple[str, ...] +algorithms_guaranteed: Tuple[str, ...] +algorithms_available: Tuple[str, ...] + +def pbkdf2_hmac(name: str, password: str, salt: str, rounds: int, dklen: int = ...) -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/heapq.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/heapq.pyi new file mode 100644 index 0000000..00abb31 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/heapq.pyi @@ -0,0 +1,16 @@ +from typing import TypeVar, List, Iterable, Any, Callable, Optional + +_T = TypeVar('_T') + +def cmp_lt(x, y) -> bool: ... +def heappush(heap: List[_T], item: _T) -> None: ... +def heappop(heap: List[_T]) -> _T: + raise IndexError() # if heap is empty +def heappushpop(heap: List[_T], item: _T) -> _T: ... +def heapify(x: List[_T]) -> None: ... +def heapreplace(heap: List[_T], item: _T) -> _T: + raise IndexError() # if heap is empty +def merge(*iterables: Iterable[_T]) -> Iterable[_T]: ... +def nlargest(n: int, iterable: Iterable[_T], + key: Optional[Callable[[_T], Any]] = ...) -> List[_T]: ... +def nsmallest(n: int, iterable: Iterable[_T]) -> List[_T]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/htmlentitydefs.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/htmlentitydefs.pyi new file mode 100644 index 0000000..6ae88e7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/htmlentitydefs.pyi @@ -0,0 +1,5 @@ +from typing import Any, Mapping + +name2codepoint: Mapping[str, int] +codepoint2name: Mapping[int, str] +entitydefs: Mapping[str, str] diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/httplib.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/httplib.pyi new file mode 100644 index 0000000..4e3843c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/httplib.pyi @@ -0,0 +1,205 @@ +# Stubs for httplib (Python 2) +# +# Generated by stubgen and manually massaged a bit. +# Needs lots more work! + +from typing import Any, Dict, Optional, Protocol +import mimetools +import ssl + +class HTTPMessage(mimetools.Message): + def addcontinue(self, key: str, more: str) -> None: ... + dict: Dict[str, str] + def addheader(self, key: str, value: str) -> None: ... + unixfrom: str + headers: Any + status: str + seekable: bool + def readheaders(self) -> None: ... + +class HTTPResponse: + fp: Any + debuglevel: Any + strict: Any + msg: Any + version: Any + status: Any + reason: Any + chunked: Any + chunk_left: Any + length: Any + will_close: Any + def __init__(self, sock, debuglevel: int = ..., strict: int = ..., method: Optional[Any] = ..., + buffering: bool = ...) -> None: ... + def begin(self): ... + def close(self): ... + def isclosed(self): ... + def read(self, amt: Optional[Any] = ...): ... + def fileno(self): ... + def getheader(self, name, default: Optional[Any] = ...): ... + def getheaders(self): ... + +# This is an API stub only for HTTPConnection and HTTPSConnection, as used in +# urllib2.AbstractHTTPHandler.do_open, which takes either the class +# HTTPConnection or the class HTTPSConnection, *not* an instance of either +# class. do_open does not use all of the parameters of HTTPConnection.__init__ +# or HTTPSConnection.__init__, so HTTPConnectionProtocol only implements the +# parameters that do_open does use. +class HTTPConnectionProtocol(Protocol): + def __call__(self, host: str, timeout: int = ..., **http_con_args: Any) -> HTTPConnection: ... + +class HTTPConnection: + response_class: Any + default_port: Any + auto_open: Any + debuglevel: Any + strict: Any + timeout: Any + source_address: Any + sock: Any + host: str = ... + port: int = ... + def __init__(self, host, port: Optional[Any] = ..., strict: Optional[Any] = ..., timeout=..., + source_address: Optional[Any] = ...) -> None: ... + def set_tunnel(self, host, port: Optional[Any] = ..., headers: Optional[Any] = ...): ... + def set_debuglevel(self, level): ... + def connect(self): ... + def close(self): ... + def send(self, data): ... + def putrequest(self, method, url, skip_host: int = ..., skip_accept_encoding: int = ...): ... + def putheader(self, header, *values): ... + def endheaders(self, message_body: Optional[Any] = ...): ... + def request(self, method, url, body: Optional[Any] = ..., headers=...): ... + def getresponse(self, buffering: bool = ...): ... + +class HTTP: + debuglevel: Any + def __init__(self, host: str = ..., port: Optional[Any] = ..., strict: Optional[Any] = ...) -> None: ... + def connect(self, host: Optional[Any] = ..., port: Optional[Any] = ...): ... + def getfile(self): ... + file: Any + headers: Any + def getreply(self, buffering: bool = ...): ... + def close(self): ... + +class HTTPSConnection(HTTPConnection): + default_port: Any + key_file: Any + cert_file: Any + def __init__(self, host, port: Optional[Any] = ..., key_file: Optional[Any] = ..., cert_file: Optional[Any] = ..., + strict: Optional[Any] = ..., timeout=..., source_address: Optional[Any] = ..., + context: Optional[Any] = ...) -> None: ... + sock: Any + def connect(self): ... + +class HTTPS(HTTP): + key_file: Any + cert_file: Any + def __init__(self, host: str = ..., port: Optional[Any] = ..., key_file: Optional[Any] = ..., cert_file: Optional[Any] = ..., strict: Optional[Any] = ..., context: Optional[Any] = ...) -> None: ... + +class HTTPException(Exception): ... +class NotConnected(HTTPException): ... +class InvalidURL(HTTPException): ... + +class UnknownProtocol(HTTPException): + args: Any + version: Any + def __init__(self, version) -> None: ... + +class UnknownTransferEncoding(HTTPException): ... +class UnimplementedFileMode(HTTPException): ... + +class IncompleteRead(HTTPException): + args: Any + partial: Any + expected: Any + def __init__(self, partial, expected: Optional[Any] = ...) -> None: ... + +class ImproperConnectionState(HTTPException): ... +class CannotSendRequest(ImproperConnectionState): ... +class CannotSendHeader(ImproperConnectionState): ... +class ResponseNotReady(ImproperConnectionState): ... + +class BadStatusLine(HTTPException): + args: Any + line: Any + def __init__(self, line) -> None: ... + +class LineTooLong(HTTPException): + def __init__(self, line_type) -> None: ... + +error: Any + +class LineAndFileWrapper: + def __init__(self, line, file) -> None: ... + def __getattr__(self, attr): ... + def read(self, amt: Optional[Any] = ...): ... + def readline(self): ... + def readlines(self, size: Optional[Any] = ...): ... + +# Constants + +responses: Dict[int, str] + +HTTP_PORT: int +HTTPS_PORT: int + +# status codes +# informational +CONTINUE: int +SWITCHING_PROTOCOLS: int +PROCESSING: int + +# successful +OK: int +CREATED: int +ACCEPTED: int +NON_AUTHORITATIVE_INFORMATION: int +NO_CONTENT: int +RESET_CONTENT: int +PARTIAL_CONTENT: int +MULTI_STATUS: int +IM_USED: int + +# redirection +MULTIPLE_CHOICES: int +MOVED_PERMANENTLY: int +FOUND: int +SEE_OTHER: int +NOT_MODIFIED: int +USE_PROXY: int +TEMPORARY_REDIRECT: int + +# client error +BAD_REQUEST: int +UNAUTHORIZED: int +PAYMENT_REQUIRED: int +FORBIDDEN: int +NOT_FOUND: int +METHOD_NOT_ALLOWED: int +NOT_ACCEPTABLE: int +PROXY_AUTHENTICATION_REQUIRED: int +REQUEST_TIMEOUT: int +CONFLICT: int +GONE: int +LENGTH_REQUIRED: int +PRECONDITION_FAILED: int +REQUEST_ENTITY_TOO_LARGE: int +REQUEST_URI_TOO_LONG: int +UNSUPPORTED_MEDIA_TYPE: int +REQUESTED_RANGE_NOT_SATISFIABLE: int +EXPECTATION_FAILED: int +UNPROCESSABLE_ENTITY: int +LOCKED: int +FAILED_DEPENDENCY: int +UPGRADE_REQUIRED: int + +# server error +INTERNAL_SERVER_ERROR: int +NOT_IMPLEMENTED: int +BAD_GATEWAY: int +SERVICE_UNAVAILABLE: int +GATEWAY_TIMEOUT: int +HTTP_VERSION_NOT_SUPPORTED: int +INSUFFICIENT_STORAGE: int +NOT_EXTENDED: int diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/imp.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/imp.pyi new file mode 100644 index 0000000..409fecb --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/imp.pyi @@ -0,0 +1,35 @@ +"""Stubs for the 'imp' module.""" + +from typing import List, Optional, Tuple, Iterable, IO, Any +import types + +C_BUILTIN: int +C_EXTENSION: int +IMP_HOOK: int +PKG_DIRECTORY: int +PY_CODERESOURCE: int +PY_COMPILED: int +PY_FROZEN: int +PY_RESOURCE: int +PY_SOURCE: int +SEARCH_ERROR: int + +def acquire_lock() -> None: ... +def find_module(name: str, path: Iterable[str] = ...) -> Optional[Tuple[str, str, Tuple[str, str, int]]]: ... +def get_magic() -> str: ... +def get_suffixes() -> List[Tuple[str, str, int]]: ... +def init_builtin(name: str) -> types.ModuleType: ... +def init_frozen(name: str) -> types.ModuleType: ... +def is_builtin(name: str) -> int: ... +def is_frozen(name: str) -> bool: ... +def load_compiled(name: str, pathname: str, file: IO[Any] = ...) -> types.ModuleType: ... +def load_dynamic(name: str, pathname: str, file: IO[Any] = ...) -> types.ModuleType: ... +def load_module(name: str, file: str, pathname: str, description: Tuple[str, str, int]) -> types.ModuleType: ... +def load_source(name: str, pathname: str, file: IO[Any] = ...) -> types.ModuleType: ... +def lock_held() -> bool: ... +def new_module(name: str) -> types.ModuleType: ... +def release_lock() -> None: ... + +class NullImporter: + def __init__(self, path_string: str) -> None: ... + def find_module(self, fullname: str, path: str = ...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/importlib.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/importlib.pyi new file mode 100644 index 0000000..8bb179a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/importlib.pyi @@ -0,0 +1,4 @@ +import types +from typing import Optional, Text + +def import_module(name: Text, package: Optional[Text] = ...) -> types.ModuleType: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/inspect.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/inspect.pyi new file mode 100644 index 0000000..8bc2eac --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/inspect.pyi @@ -0,0 +1,135 @@ +from types import CodeType, TracebackType, FrameType, ModuleType +from typing import Any, Dict, Callable, List, NamedTuple, Optional, Sequence, Tuple, Type, Union + +# Types and members +class EndOfBlock(Exception): ... + +class BlockFinder: + indent: int + islambda: bool + started: bool + passline: bool + last: int + def tokeneater(self, type: int, token: str, srow_scol: Tuple[int, int], + erow_ecol: Tuple[int, int], line: str) -> None: ... + +CO_GENERATOR: int +CO_NESTED: int +CO_NEWLOCALS: int +CO_NOFREE: int +CO_OPTIMIZED: int +CO_VARARGS: int +CO_VARKEYWORDS: int +TPFLAGS_IS_ABSTRACT: int + +ModuleInfo = NamedTuple('ModuleInfo', [('name', str), + ('suffix', str), + ('mode', str), + ('module_type', int), + ]) +def getmembers( + object: object, + predicate: Optional[Callable[[Any], bool]] = ... +) -> List[Tuple[str, Any]]: ... +def getmoduleinfo(path: str) -> Optional[ModuleInfo]: ... +def getmodulename(path: str) -> Optional[str]: ... + +def ismodule(object: object) -> bool: ... +def isclass(object: object) -> bool: ... +def ismethod(object: object) -> bool: ... +def isfunction(object: object) -> bool: ... +def isgeneratorfunction(object: object) -> bool: ... +def isgenerator(object: object) -> bool: ... +def istraceback(object: object) -> bool: ... +def isframe(object: object) -> bool: ... +def iscode(object: object) -> bool: ... +def isbuiltin(object: object) -> bool: ... +def isroutine(object: object) -> bool: ... +def isabstract(object: object) -> bool: ... +def ismethoddescriptor(object: object) -> bool: ... +def isdatadescriptor(object: object) -> bool: ... +def isgetsetdescriptor(object: object) -> bool: ... +def ismemberdescriptor(object: object) -> bool: ... + +# Retrieving source code +def findsource(object: object) -> Tuple[List[str], int]: ... +def getabsfile(object: object) -> str: ... +def getblock(lines: Sequence[str]) -> Sequence[str]: ... +def getdoc(object: object) -> str: ... +def getcomments(object: object) -> str: ... +def getfile(object: object) -> str: ... +def getmodule(object: object) -> ModuleType: ... +def getsourcefile(object: object) -> str: ... +# TODO restrict to "module, class, method, function, traceback, frame, +# or code object" +def getsourcelines(object: object) -> Tuple[List[str], int]: ... +# TODO restrict to "a module, class, method, function, traceback, frame, +# or code object" +def getsource(object: object) -> str: ... +def cleandoc(doc: str) -> str: ... +def indentsize(line: str) -> int: ... + +# Classes and functions +def getclasstree(classes: List[type], unique: bool = ...) -> List[ + Union[Tuple[type, Tuple[type, ...]], list]]: ... + +ArgSpec = NamedTuple('ArgSpec', [('args', List[str]), + ('varargs', Optional[str]), + ('keywords', Optional[str]), + ('defaults', tuple), + ]) + +ArgInfo = NamedTuple('ArgInfo', [('args', List[str]), + ('varargs', Optional[str]), + ('keywords', Optional[str]), + ('locals', Dict[str, Any]), + ]) + +Arguments = NamedTuple('Arguments', [('args', List[Union[str, List[Any]]]), + ('varargs', Optional[str]), + ('keywords', Optional[str]), + ]) + +def getargs(co: CodeType) -> Arguments: ... +def getargspec(func: object) -> ArgSpec: ... +def getargvalues(frame: FrameType) -> ArgInfo: ... +def formatargspec(args, varargs=..., varkw=..., defaults=..., + formatarg=..., formatvarargs=..., formatvarkw=..., formatvalue=..., + join=...) -> str: ... +def formatargvalues(args, varargs=..., varkw=..., defaults=..., + formatarg=..., formatvarargs=..., formatvarkw=..., formatvalue=..., + join=...) -> str: ... +def getmro(cls: type) -> Tuple[type, ...]: ... +def getcallargs(func, *args, **kwds) -> Dict[str, Any]: ... + +# The interpreter stack + +Traceback = NamedTuple( + 'Traceback', + [ + ('filename', str), + ('lineno', int), + ('function', str), + ('code_context', List[str]), + ('index', int), + ] +) + +_FrameInfo = Tuple[FrameType, str, int, str, List[str], int] + +def getouterframes(frame: FrameType, context: int = ...) -> List[_FrameInfo]: ... +def getframeinfo(frame: Union[FrameType, TracebackType], context: int = ...) -> Traceback: ... +def getinnerframes(traceback: TracebackType, context: int = ...) -> List[_FrameInfo]: ... +def getlineno(frame: FrameType) -> int: ... + +def currentframe(depth: int = ...) -> FrameType: ... +def stack(context: int = ...) -> List[_FrameInfo]: ... +def trace(context: int = ...) -> List[_FrameInfo]: ... + +Attribute = NamedTuple('Attribute', [('name', str), + ('kind', str), + ('defining_class', type), + ('object', object), + ]) + +def classify_class_attrs(cls: type) -> List[Attribute]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/io.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/io.pyi new file mode 100644 index 0000000..1ab6b90 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/io.pyi @@ -0,0 +1,42 @@ +# Stubs for io + +# Based on https://docs.python.org/2/library/io.html + +# Only a subset of functionality is included. + +from typing import List, BinaryIO, TextIO, IO, overload, Iterator, Iterable, Any, Union, Optional +import _io + +from _io import BlockingIOError as BlockingIOError +from _io import BufferedRWPair as BufferedRWPair +from _io import BufferedRandom as BufferedRandom +from _io import BufferedReader as BufferedReader +from _io import BufferedWriter as BufferedWriter +from _io import BytesIO as BytesIO +from _io import DEFAULT_BUFFER_SIZE as DEFAULT_BUFFER_SIZE +from _io import FileIO as FileIO +from _io import IncrementalNewlineDecoder as IncrementalNewlineDecoder +from _io import StringIO as StringIO +from _io import TextIOWrapper as TextIOWrapper +from _io import UnsupportedOperation as UnsupportedOperation +from _io import open as open + +def _OpenWrapper(file: Union[str, unicode, int], + mode: unicode = ..., buffering: int = ..., encoding: unicode = ..., + errors: unicode = ..., newline: unicode = ..., + closefd: bool = ...) -> IO[Any]: ... + +SEEK_SET: int +SEEK_CUR: int +SEEK_END: int + + +class IOBase(_io._IOBase): ... + +class RawIOBase(_io._RawIOBase, IOBase): ... + +class BufferedIOBase(_io._BufferedIOBase, IOBase): ... + +# Note: In the actual io.py, TextIOBase subclasses IOBase. +# (Which we don't do here because we don't want to subclass both TextIO and BinaryIO.) +class TextIOBase(_io._TextIOBase): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/itertools.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/itertools.pyi new file mode 100644 index 0000000..1c8522c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/itertools.pyi @@ -0,0 +1,165 @@ +# Stubs for itertools + +# Based on https://docs.python.org/2/library/itertools.html + +from typing import (Iterator, TypeVar, Iterable, overload, Any, Callable, Tuple, + Union, Sequence, Generic, Optional) + +_T = TypeVar('_T') +_S = TypeVar('_S') + +def count(start: int = ..., + step: int = ...) -> Iterator[int]: ... # more general types? +def cycle(iterable: Iterable[_T]) -> Iterator[_T]: ... + +def repeat(object: _T, times: int = ...) -> Iterator[_T]: ... + +def accumulate(iterable: Iterable[_T]) -> Iterator[_T]: ... + +class chain(Iterator[_T], Generic[_T]): + def __init__(self, *iterables: Iterable[_T]) -> None: ... + def next(self) -> _T: ... + def __iter__(self) -> Iterator[_T]: ... + @staticmethod + def from_iterable(iterable: Iterable[Iterable[_S]]) -> Iterator[_S]: ... + +def compress(data: Iterable[_T], selectors: Iterable[Any]) -> Iterator[_T]: ... +def dropwhile(predicate: Callable[[_T], Any], + iterable: Iterable[_T]) -> Iterator[_T]: ... +def ifilter(predicate: Optional[Callable[[_T], Any]], + iterable: Iterable[_T]) -> Iterator[_T]: ... +def ifilterfalse(predicate: Optional[Callable[[_T], Any]], + iterable: Iterable[_T]) -> Iterator[_T]: ... + +@overload +def groupby(iterable: Iterable[_T], key: None = ...) -> Iterator[Tuple[_T, Iterator[_T]]]: ... +@overload +def groupby(iterable: Iterable[_T], key: Callable[[_T], _S]) -> Iterator[Tuple[_S, Iterator[_T]]]: ... + +@overload +def islice(iterable: Iterable[_T], stop: Optional[int]) -> Iterator[_T]: ... +@overload +def islice(iterable: Iterable[_T], start: Optional[int], stop: Optional[int], + step: Optional[int] = ...) -> Iterator[_T]: ... + +_T1 = TypeVar('_T1') +_T2 = TypeVar('_T2') +_T3 = TypeVar('_T3') +_T4 = TypeVar('_T4') +_T5 = TypeVar('_T5') +_T6 = TypeVar('_T6') + +@overload +def imap(func: Callable[[_T1], _S], iter1: Iterable[_T1]) -> Iterator[_S]: ... +@overload +def imap(func: Callable[[_T1, _T2], _S], + iter1: Iterable[_T1], + iter2: Iterable[_T2]) -> Iterator[_S]: ... +@overload +def imap(func: Callable[[_T1, _T2, _T3], _S], + iter1: Iterable[_T1], iter2: Iterable[_T2], + iter3: Iterable[_T3]) -> Iterator[_S]: ... + +@overload +def imap(func: Callable[[_T1, _T2, _T3, _T4], _S], + iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], + iter4: Iterable[_T4]) -> Iterator[_S]: ... + +@overload +def imap(func: Callable[[_T1, _T2, _T3, _T4, _T5], _S], + iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], + iter4: Iterable[_T4], iter5: Iterable[_T5]) -> Iterator[_S]: ... + +@overload +def imap(func: Callable[[_T1, _T2, _T3, _T4, _T5, _T6], _S], + iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], + iter4: Iterable[_T4], iter5: Iterable[_T5], + iter6: Iterable[_T6]) -> Iterator[_S]: ... + +@overload +def imap(func: Callable[..., _S], + iter1: Iterable[Any], iter2: Iterable[Any], iter3: Iterable[Any], + iter4: Iterable[Any], iter5: Iterable[Any], iter6: Iterable[Any], + iter7: Iterable[Any], *iterables: Iterable[Any]) -> Iterator[_S]: ... + +def starmap(func: Any, iterable: Iterable[Any]) -> Iterator[Any]: ... +def takewhile(predicate: Callable[[_T], Any], + iterable: Iterable[_T]) -> Iterator[_T]: ... +def tee(iterable: Iterable[_T], n: int = ...) -> Tuple[Iterator[_T], ...]: ... + +@overload +def izip(iter1: Iterable[_T1]) -> Iterator[Tuple[_T1]]: ... +@overload +def izip(iter1: Iterable[_T1], + iter2: Iterable[_T2]) -> Iterator[Tuple[_T1, _T2]]: ... +@overload +def izip(iter1: Iterable[_T1], iter2: Iterable[_T2], + iter3: Iterable[_T3]) -> Iterator[Tuple[_T1, _T2, _T3]]: ... +@overload +def izip(iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], + iter4: Iterable[_T4]) -> Iterator[Tuple[_T1, _T2, + _T3, _T4]]: ... +@overload +def izip(iter1: Iterable[_T1], iter2: Iterable[_T2], + iter3: Iterable[_T3], iter4: Iterable[_T4], + iter5: Iterable[_T5]) -> Iterator[Tuple[_T1, _T2, + _T3, _T4, _T5]]: ... +@overload +def izip(iter1: Iterable[_T1], iter2: Iterable[_T2], + iter3: Iterable[_T3], iter4: Iterable[_T4], + iter5: Iterable[_T5], iter6: Iterable[_T6]) -> Iterator[Tuple[_T1, _T2, _T3, + _T4, _T5, _T6]]: ... +@overload +def izip(iter1: Iterable[Any], iter2: Iterable[Any], + iter3: Iterable[Any], iter4: Iterable[Any], + iter5: Iterable[Any], iter6: Iterable[Any], + iter7: Iterable[Any], *iterables: Iterable[Any]) -> Iterator[Tuple[Any, ...]]: ... + +def izip_longest(*p: Iterable[Any], + fillvalue: Any = ...) -> Iterator[Any]: ... + +@overload +def product(iter1: Iterable[_T1]) -> Iterator[Tuple[_T1]]: ... +@overload +def product(iter1: Iterable[_T1], + iter2: Iterable[_T2]) -> Iterator[Tuple[_T1, _T2]]: ... +@overload +def product(iter1: Iterable[_T1], + iter2: Iterable[_T2], + iter3: Iterable[_T3]) -> Iterator[Tuple[_T1, _T2, _T3]]: ... +@overload +def product(iter1: Iterable[_T1], + iter2: Iterable[_T2], + iter3: Iterable[_T3], + iter4: Iterable[_T4]) -> Iterator[Tuple[_T1, _T2, _T3, _T4]]: ... +@overload +def product(iter1: Iterable[_T1], + iter2: Iterable[_T2], + iter3: Iterable[_T3], + iter4: Iterable[_T4], + iter5: Iterable[_T5]) -> Iterator[Tuple[_T1, _T2, _T3, _T4, _T5]]: ... +@overload +def product(iter1: Iterable[_T1], + iter2: Iterable[_T2], + iter3: Iterable[_T3], + iter4: Iterable[_T4], + iter5: Iterable[_T5], + iter6: Iterable[_T6]) -> Iterator[Tuple[_T1, _T2, _T3, _T4, _T5, _T6]]: ... +@overload +def product(iter1: Iterable[Any], + iter2: Iterable[Any], + iter3: Iterable[Any], + iter4: Iterable[Any], + iter5: Iterable[Any], + iter6: Iterable[Any], + iter7: Iterable[Any], + *iterables: Iterable[Any]) -> Iterator[Tuple[Any, ...]]: ... +@overload +def product(*iterables: Iterable[Any], repeat: int) -> Iterator[Tuple[Any, ...]]: ... + +def permutations(iterable: Iterable[_T], + r: int = ...) -> Iterator[Sequence[_T]]: ... +def combinations(iterable: Iterable[_T], + r: int) -> Iterator[Sequence[_T]]: ... +def combinations_with_replacement(iterable: Iterable[_T], + r: int) -> Iterator[Sequence[_T]]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/json.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/json.pyi new file mode 100644 index 0000000..9cc151b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/json.pyi @@ -0,0 +1,96 @@ +from typing import Any, IO, Optional, Tuple, Callable, Dict, List, Union, Text, Protocol + +class JSONDecodeError(ValueError): + def dumps(self, obj: Any) -> str: ... + def dump(self, obj: Any, fp: IO[str], *args: Any, **kwds: Any) -> None: ... + def loads(self, s: str) -> Any: ... + def load(self, fp: IO[str]) -> Any: ... + +def dumps(obj: Any, + skipkeys: bool = ..., + ensure_ascii: bool = ..., + check_circular: bool = ..., + allow_nan: bool = ..., + cls: Any = ..., + indent: Optional[int] = ..., + separators: Optional[Tuple[str, str]] = ..., + encoding: str = ..., + default: Optional[Callable[[Any], Any]] = ..., + sort_keys: bool = ..., + **kwds: Any) -> str: ... + +def dump(obj: Any, + fp: Union[IO[str], IO[Text]], + skipkeys: bool = ..., + ensure_ascii: bool = ..., + check_circular: bool = ..., + allow_nan: bool = ..., + cls: Any = ..., + indent: Optional[int] = ..., + separators: Optional[Tuple[str, str]] = ..., + encoding: str = ..., + default: Optional[Callable[[Any], Any]] = ..., + sort_keys: bool = ..., + **kwds: Any) -> None: ... + +def loads(s: Union[Text, bytes], + encoding: Any = ..., + cls: Any = ..., + object_hook: Optional[Callable[[Dict], Any]] = ..., + parse_float: Optional[Callable[[str], Any]] = ..., + parse_int: Optional[Callable[[str], Any]] = ..., + parse_constant: Optional[Callable[[str], Any]] = ..., + object_pairs_hook: Optional[Callable[[List[Tuple[Any, Any]]], Any]] = ..., + **kwds: Any) -> Any: ... + +class _Reader(Protocol): + def read(self) -> Union[Text, bytes]: ... + +def load(fp: _Reader, + encoding: Optional[str] = ..., + cls: Any = ..., + object_hook: Optional[Callable[[Dict], Any]] = ..., + parse_float: Optional[Callable[[str], Any]] = ..., + parse_int: Optional[Callable[[str], Any]] = ..., + parse_constant: Optional[Callable[[str], Any]] = ..., + object_pairs_hook: Optional[Callable[[List[Tuple[Any, Any]]], Any]] = ..., + **kwds: Any) -> Any: ... + +class JSONDecoder(object): + def __init__(self, + encoding: Union[Text, bytes] = ..., + object_hook: Callable[..., Any] = ..., + parse_float: Callable[[str], float] = ..., + parse_int: Callable[[str], int] = ..., + parse_constant: Callable[[str], Any] = ..., + strict: bool = ..., + object_pairs_hook: Callable[..., Any] = ...) -> None: ... + def decode(self, s: Union[Text, bytes], _w: Any = ...) -> Any: ... + def raw_decode(self, s: Union[Text, bytes], idx: int = ...) -> Tuple[Any, Any]: ... + +class JSONEncoder(object): + item_separator: str + key_separator: str + skipkeys: bool + ensure_ascii: bool + check_circular: bool + allow_nan: bool + sort_keys: bool + indent: Optional[int] + + def __init__(self, + skipkeys: bool = ..., + ensure_ascii: bool = ..., + check_circular: bool = ..., + allow_nan: bool = ..., + sort_keys: bool = ..., + indent: Optional[int] = ..., + separators: Tuple[Union[Text, bytes], Union[Text, bytes]] = ..., + encoding: Union[Text, bytes] = ..., + default: Callable[..., Any] = ...) -> None: ... + + def default(self, o: Any) -> Any: ... + + def encode(self, o: Any) -> str: ... + + def iterencode(self, o: Any, _one_shot: bool = ...) -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/markupbase.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/markupbase.pyi new file mode 100644 index 0000000..358ba16 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/markupbase.pyi @@ -0,0 +1,9 @@ +from typing import Tuple + +class ParserBase(object): + def __init__(self) -> None: ... + def error(self, message: str) -> None: ... + def reset(self) -> None: ... + def getpos(self) -> Tuple[int, int]: ... + + def unknown_decl(self, data: str) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/md5.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/md5.pyi new file mode 100644 index 0000000..fe6ad71 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/md5.pyi @@ -0,0 +1,6 @@ +# Stubs for Python 2.7 md5 stdlib module + +from hashlib import md5 as md5, md5 as new + +blocksize = 0 +digest_size = 0 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/mimetools.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/mimetools.pyi new file mode 100644 index 0000000..f565202 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/mimetools.pyi @@ -0,0 +1,27 @@ +from typing import Any +import rfc822 + +class Message(rfc822.Message): + encodingheader: Any + typeheader: Any + def __init__(self, fp, seekable: int = ...): ... + plisttext: Any + type: Any + maintype: Any + subtype: Any + def parsetype(self): ... + plist: Any + def parseplist(self): ... + def getplist(self): ... + def getparam(self, name): ... + def getparamnames(self): ... + def getencoding(self): ... + def gettype(self): ... + def getmaintype(self): ... + def getsubtype(self): ... + +def choose_boundary(): ... +def decode(input, output, encoding): ... +def encode(input, output, encoding): ... +def copyliteral(input, output): ... +def copybinary(input, output): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/multiprocessing/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/multiprocessing/__init__.pyi new file mode 100644 index 0000000..fb00b24 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/multiprocessing/__init__.pyi @@ -0,0 +1,50 @@ +from typing import Any, Callable, Optional, TypeVar, Iterable + +from multiprocessing import pool +from multiprocessing.process import Process as Process, current_process as current_process, active_children as active_children +from multiprocessing.util import SUBDEBUG as SUBDEBUG, SUBWARNING as SUBWARNING +from Queue import Queue as _BaseQueue + +class ProcessError(Exception): ... +class BufferTooShort(ProcessError): ... +class TimeoutError(ProcessError): ... +class AuthenticationError(ProcessError): ... + +_T = TypeVar('_T') + +class Queue(_BaseQueue[_T]): + def __init__(self, maxsize: int = ...) -> None: ... + def get(self, block: bool = ..., timeout: Optional[float] = ...) -> _T: ... + def put(self, item: _T, block: bool = ..., timeout: Optional[float] = ...) -> None: ... + def qsize(self) -> int: ... + def empty(self) -> bool: ... + def full(self) -> bool: ... + def put_nowait(self, item: _T) -> None: ... + def get_nowait(self) -> _T: ... + def close(self) -> None: ... + def join_thread(self) -> None: ... + def cancel_join_thread(self) -> None: ... + +def Manager(): ... +def Pipe(duplex: bool = ...): ... +def cpu_count() -> int: ... +def freeze_support(): ... +def get_logger(): ... +def log_to_stderr(level: Optional[Any] = ...): ... +def allow_connection_pickling(): ... +def Lock(): ... +def RLock(): ... +def Condition(lock: Optional[Any] = ...): ... +def Semaphore(value: int = ...): ... +def BoundedSemaphore(value: int = ...): ... +def Event(): ... +def JoinableQueue(maxsize: int = ...): ... +def RawValue(typecode_or_type, *args): ... +def RawArray(typecode_or_type, size_or_initializer): ... +def Value(typecode_or_type, *args, **kwds): ... +def Array(typecode_or_type, size_or_initializer, **kwds): ... + +def Pool(processes: Optional[int] = ..., + initializer: Optional[Callable[..., Any]] = ..., + initargs: Iterable[Any] = ..., + maxtasksperchild: Optional[int] = ...) -> pool.Pool: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/multiprocessing/dummy/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/multiprocessing/dummy/__init__.pyi new file mode 100644 index 0000000..e8e02eb --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/multiprocessing/dummy/__init__.pyi @@ -0,0 +1,51 @@ +from typing import Any, Optional, List, Type + +import threading +import sys +import weakref +import array +import itertools + +from multiprocessing import TimeoutError, cpu_count +from multiprocessing.dummy.connection import Pipe +from threading import Lock, RLock, Semaphore, BoundedSemaphore +from threading import Event +from Queue import Queue + + +class DummyProcess(threading.Thread): + _children: weakref.WeakKeyDictionary + _parent: threading.Thread + _pid: None + _start_called: bool + def __init__(self, group=..., target=..., name=..., args=..., kwargs=...) -> None: ... + @property + def exitcode(self) -> Optional[int]: ... + + +Process = DummyProcess + +# This should be threading._Condition but threading.pyi exports it as Condition +class Condition(threading.Condition): + notify_all: Any + +class Namespace(object): + def __init__(self, **kwds) -> None: ... + +class Value(object): + _typecode: Any + _value: Any + value: Any + def __init__(self, typecode, value, lock=...) -> None: ... + def _get(self) -> Any: ... + def _set(self, value) -> None: ... + +JoinableQueue = Queue + +def Array(typecode, sequence, lock=...) -> array.array: ... +def Manager() -> Any: ... +def Pool(processes=..., initializer=..., initargs=...) -> Any: ... +def active_children() -> List: ... +def current_process() -> threading.Thread: ... +def freeze_support() -> None: ... +def shutdown() -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/multiprocessing/dummy/connection.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/multiprocessing/dummy/connection.pyi new file mode 100644 index 0000000..a7a4f99 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/multiprocessing/dummy/connection.pyi @@ -0,0 +1,26 @@ +from Queue import Queue +from typing import Any, List, Optional, Tuple, Type + +families: List[None] + +class Connection(object): + _in: Any + _out: Any + recv: Any + recv_bytes: Any + send: Any + send_bytes: Any + def __init__(self, _in, _out) -> None: ... + def close(self) -> None: ... + def poll(self, timeout=...) -> Any: ... + +class Listener(object): + _backlog_queue: Optional[Queue] + address: Any + def __init__(self, address=..., family=..., backlog=...) -> None: ... + def accept(self) -> Connection: ... + def close(self) -> None: ... + + +def Client(address) -> Connection: ... +def Pipe(duplex=...) -> Tuple[Connection, Connection]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/multiprocessing/pool.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/multiprocessing/pool.pyi new file mode 100644 index 0000000..4001a5a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/multiprocessing/pool.pyi @@ -0,0 +1,59 @@ +from typing import ( + Any, Callable, ContextManager, Iterable, Optional, Dict, List, + TypeVar, Iterator, +) + +_T = TypeVar('_T', bound=Pool) + +class AsyncResult(): + def get(self, timeout: Optional[float] = ...) -> Any: ... + def wait(self, timeout: Optional[float] = ...) -> None: ... + def ready(self) -> bool: ... + def successful(self) -> bool: ... + +class IMapIterator(Iterator[Any]): + def __iter__(self) -> Iterator[Any]: ... + def next(self, timeout: Optional[float] = ...) -> Any: ... + +class IMapUnorderedIterator(IMapIterator): ... + +class Pool(ContextManager[Pool]): + def __init__(self, processes: Optional[int] = ..., + initializer: Optional[Callable[..., None]] = ..., + initargs: Iterable[Any] = ..., + maxtasksperchild: Optional[int] = ...) -> None: ... + def apply(self, + func: Callable[..., Any], + args: Iterable[Any] = ..., + kwds: Dict[str, Any] = ...) -> Any: ... + def apply_async(self, + func: Callable[..., Any], + args: Iterable[Any] = ..., + kwds: Dict[str, Any] = ..., + callback: Optional[Callable[..., None]] = ...) -> AsyncResult: ... + def map(self, + func: Callable[..., Any], + iterable: Iterable[Any] = ..., + chunksize: Optional[int] = ...) -> List[Any]: ... + def map_async(self, func: Callable[..., Any], + iterable: Iterable[Any] = ..., + chunksize: Optional[int] = ..., + callback: Optional[Callable[..., None]] = ...) -> AsyncResult: ... + def imap(self, + func: Callable[..., Any], + iterable: Iterable[Any] = ..., + chunksize: Optional[int] = ...) -> IMapIterator: ... + def imap_unordered(self, + func: Callable[..., Any], + iterable: Iterable[Any] = ..., + chunksize: Optional[int] = ...) -> IMapIterator: ... + def close(self) -> None: ... + def terminate(self) -> None: ... + def join(self) -> None: ... + def __enter__(self: _T) -> _T: ... + +class ThreadPool(Pool, ContextManager[ThreadPool]): + + def __init__(self, processes: Optional[int] = ..., + initializer: Optional[Callable[..., Any]] = ..., + initargs: Iterable[Any] = ...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/multiprocessing/process.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/multiprocessing/process.pyi new file mode 100644 index 0000000..476b403 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/multiprocessing/process.pyi @@ -0,0 +1,36 @@ +from typing import Any, Optional + +def current_process(): ... +def active_children(): ... + +class Process: + def __init__(self, group: Optional[Any] = ..., target: Optional[Any] = ..., name: Optional[Any] = ..., args=..., + kwargs=...): ... + def run(self): ... + def start(self): ... + def terminate(self): ... + def join(self, timeout: Optional[Any] = ...): ... + def is_alive(self): ... + @property + def name(self): ... + @name.setter + def name(self, name): ... + @property + def daemon(self): ... + @daemon.setter + def daemon(self, daemonic): ... + @property + def authkey(self): ... + @authkey.setter + def authkey(self, authkey): ... + @property + def exitcode(self): ... + @property + def ident(self): ... + pid: Any + +class AuthenticationString(bytes): + def __reduce__(self): ... + +class _MainProcess(Process): + def __init__(self): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/multiprocessing/util.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/multiprocessing/util.pyi new file mode 100644 index 0000000..14d44f6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/multiprocessing/util.pyi @@ -0,0 +1,29 @@ +from typing import Any, Optional +import threading + +SUBDEBUG: Any +SUBWARNING: Any + +def sub_debug(msg, *args): ... +def debug(msg, *args): ... +def info(msg, *args): ... +def sub_warning(msg, *args): ... +def get_logger(): ... +def log_to_stderr(level: Optional[Any] = ...): ... +def get_temp_dir(): ... +def register_after_fork(obj, func): ... + +class Finalize: + def __init__(self, obj, callback, args=..., kwargs: Optional[Any] = ..., exitpriority: Optional[Any] = ...): ... + def __call__(self, wr: Optional[Any] = ...): ... + def cancel(self): ... + def still_active(self): ... + +def is_exiting(): ... + +class ForkAwareThreadLock: + def __init__(self): ... + +class ForkAwareLocal(threading.local): + def __init__(self): ... + def __reduce__(self): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/mutex.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/mutex.pyi new file mode 100644 index 0000000..8da8bfb --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/mutex.pyi @@ -0,0 +1,15 @@ +# Source: https://hg.python.org/cpython/file/2.7/Lib/mutex.py + +from collections import deque +from typing import Any, Callable, TypeVar + +_ArgType = TypeVar('_ArgType') + +class mutex: + locked: bool + queue: deque + def __init__(self) -> None: ... + def test(self) -> bool: ... + def testandset(self) -> bool: ... + def lock(self, function: Callable[[_ArgType], Any], argument: _ArgType) -> None: ... + def unlock(self) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/nturl2path.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/nturl2path.pyi new file mode 100644 index 0000000..b87b008 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/nturl2path.pyi @@ -0,0 +1,4 @@ +from typing import AnyStr + +def url2pathname(url: AnyStr) -> AnyStr: ... +def pathname2url(p: AnyStr) -> AnyStr: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/os/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/os/__init__.pyi new file mode 100644 index 0000000..2c66dc7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/os/__init__.pyi @@ -0,0 +1,369 @@ +# Stubs for os +# Ron Murawski + +from builtins import OSError as error +from io import TextIOWrapper as _TextIOWrapper +from posix import stat_result as stat_result # TODO: use this, see https://github.com/python/mypy/issues/3078 +import sys +from typing import ( + Mapping, MutableMapping, Dict, List, Any, Tuple, Iterator, overload, Union, AnyStr, + Optional, Generic, Set, Callable, Text, Sequence, IO, NamedTuple, NoReturn, TypeVar +) +from . import path as path + +_T = TypeVar('_T') + +# ----- os variables ----- + +if sys.version_info >= (3, 2): + supports_bytes_environ: bool + +if sys.version_info >= (3, 3): + supports_dir_fd: Set[Callable[..., Any]] + supports_fd: Set[Callable[..., Any]] + supports_effective_ids: Set[Callable[..., Any]] + supports_follow_symlinks: Set[Callable[..., Any]] + +SEEK_SET: int +SEEK_CUR: int +SEEK_END: int + +O_RDONLY: int +O_WRONLY: int +O_RDWR: int +O_APPEND: int +O_CREAT: int +O_EXCL: int +O_TRUNC: int +# We don't use sys.platform for O_* flags to denote platform-dependent APIs because some codes, +# including tests for mypy, use a more finer way than sys.platform before using these APIs +# See https://github.com/python/typeshed/pull/2286 for discussions +O_DSYNC: int # Unix only +O_RSYNC: int # Unix only +O_SYNC: int # Unix only +O_NDELAY: int # Unix only +O_NONBLOCK: int # Unix only +O_NOCTTY: int # Unix only +O_SHLOCK: int # Unix only +O_EXLOCK: int # Unix only +O_BINARY: int # Windows only +O_NOINHERIT: int # Windows only +O_SHORT_LIVED: int # Windows only +O_TEMPORARY: int # Windows only +O_RANDOM: int # Windows only +O_SEQUENTIAL: int # Windows only +O_TEXT: int # Windows only +O_ASYNC: int # Gnu extension if in C library +O_DIRECT: int # Gnu extension if in C library +O_DIRECTORY: int # Gnu extension if in C library +O_NOFOLLOW: int # Gnu extension if in C library +O_NOATIME: int # Gnu extension if in C library +O_LARGEFILE: int # Gnu extension if in C library + +curdir: str +pardir: str +sep: str +if sys.platform == 'win32': + altsep: str +else: + altsep: Optional[str] +extsep: str +pathsep: str +defpath: str +linesep: str +devnull: str +name: str + +F_OK: int +R_OK: int +W_OK: int +X_OK: int + +class _Environ(MutableMapping[AnyStr, AnyStr], Generic[AnyStr]): + def copy(self) -> Dict[AnyStr, AnyStr]: ... + def __delitem__(self, key: AnyStr) -> None: ... + def __getitem__(self, key: AnyStr) -> AnyStr: ... + def __setitem__(self, key: AnyStr, value: AnyStr) -> None: ... + def __iter__(self) -> Iterator[AnyStr]: ... + def __len__(self) -> int: ... + +environ: _Environ[str] +if sys.version_info >= (3, 2): + environb: _Environ[bytes] + +if sys.platform != 'win32': + # Unix only + confstr_names: Dict[str, int] + pathconf_names: Dict[str, int] + sysconf_names: Dict[str, int] + + EX_OK: int + EX_USAGE: int + EX_DATAERR: int + EX_NOINPUT: int + EX_NOUSER: int + EX_NOHOST: int + EX_UNAVAILABLE: int + EX_SOFTWARE: int + EX_OSERR: int + EX_OSFILE: int + EX_CANTCREAT: int + EX_IOERR: int + EX_TEMPFAIL: int + EX_PROTOCOL: int + EX_NOPERM: int + EX_CONFIG: int + EX_NOTFOUND: int + +P_NOWAIT: int +P_NOWAITO: int +P_WAIT: int +if sys.platform == 'win32': + P_DETACH: int + P_OVERLAY: int + +# wait()/waitpid() options +if sys.platform != 'win32': + WNOHANG: int # Unix only + WCONTINUED: int # some Unix systems + WUNTRACED: int # Unix only + +TMP_MAX: int # Undocumented, but used by tempfile + +# ----- os classes (structures) ----- +if sys.version_info >= (3, 6): + from builtins import _PathLike as PathLike # See comment in builtins + +_PathType = path._PathType + +_StatVFS = NamedTuple('_StatVFS', [('f_bsize', int), ('f_frsize', int), ('f_blocks', int), + ('f_bfree', int), ('f_bavail', int), ('f_files', int), + ('f_ffree', int), ('f_favail', int), ('f_flag', int), + ('f_namemax', int)]) + +def getlogin() -> str: ... +def getpid() -> int: ... +def getppid() -> int: ... +def strerror(code: int) -> str: ... +def umask(mask: int) -> int: ... + +if sys.platform != 'win32': + def ctermid() -> str: ... + def getegid() -> int: ... + def geteuid() -> int: ... + def getgid() -> int: ... + def getgroups() -> List[int]: ... # Unix only, behaves differently on Mac + def initgroups(username: str, gid: int) -> None: ... + def getpgid(pid: int) -> int: ... + def getpgrp() -> int: ... + def getresuid() -> Tuple[int, int, int]: ... + def getresgid() -> Tuple[int, int, int]: ... + def getuid() -> int: ... + def setegid(egid: int) -> None: ... + def seteuid(euid: int) -> None: ... + def setgid(gid: int) -> None: ... + def setgroups(groups: Sequence[int]) -> None: ... + def setpgrp() -> None: ... + def setpgid(pid: int, pgrp: int) -> None: ... + def setregid(rgid: int, egid: int) -> None: ... + def setresgid(rgid: int, egid: int, sgid: int) -> None: ... + def setresuid(ruid: int, euid: int, suid: int) -> None: ... + def setreuid(ruid: int, euid: int) -> None: ... + def getsid(pid: int) -> int: ... + def setsid() -> None: ... + def setuid(uid: int) -> None: ... + def uname() -> Tuple[str, str, str, str, str]: ... + +@overload +def getenv(key: Text) -> Optional[str]: ... +@overload +def getenv(key: Text, default: _T) -> Union[str, _T]: ... +def putenv(key: Union[bytes, Text], value: Union[bytes, Text]) -> None: ... +def unsetenv(key: Union[bytes, Text]) -> None: ... + +def fdopen(fd: int, *args, **kwargs) -> IO[Any]: ... +def close(fd: int) -> None: ... +def closerange(fd_low: int, fd_high: int) -> None: ... +def dup(fd: int) -> int: ... +def dup2(fd: int, fd2: int) -> None: ... +def fstat(fd: int) -> Any: ... +def fsync(fd: int) -> None: ... +def lseek(fd: int, pos: int, how: int) -> int: ... +def open(file: _PathType, flags: int, mode: int = ...) -> int: ... +def pipe() -> Tuple[int, int]: ... +def read(fd: int, n: int) -> bytes: ... +def write(fd: int, string: bytes) -> int: ... +def access(path: _PathType, mode: int) -> bool: ... +def chdir(path: _PathType) -> None: ... +def fchdir(fd: int) -> None: ... +def getcwd() -> str: ... +def getcwdu() -> unicode: ... +def chmod(path: _PathType, mode: int) -> None: ... +def link(src: _PathType, link_name: _PathType) -> None: ... +def listdir(path: AnyStr) -> List[AnyStr]: ... +def lstat(path: _PathType) -> Any: ... +def mknod(filename: _PathType, mode: int = ..., device: int = ...) -> None: ... +def major(device: int) -> int: ... +def minor(device: int) -> int: ... +def makedev(major: int, minor: int) -> int: ... +def mkdir(path: _PathType, mode: int = ...) -> None: ... +def makedirs(path: _PathType, mode: int = ...) -> None: ... +def readlink(path: AnyStr) -> AnyStr: ... +def remove(path: _PathType) -> None: ... +def removedirs(path: _PathType) -> None: ... +def rename(src: _PathType, dst: _PathType) -> None: ... +def renames(old: _PathType, new: _PathType) -> None: ... +def rmdir(path: _PathType) -> None: ... +def stat(path: _PathType) -> Any: ... +@overload +def stat_float_times() -> bool: ... +@overload +def stat_float_times(newvalue: bool) -> None: ... +def symlink(source: _PathType, link_name: _PathType) -> None: ... +def unlink(path: _PathType) -> None: ... +# TODO: add ns, dir_fd, follow_symlinks argument +if sys.version_info >= (3, 0): + def utime(path: _PathType, times: Optional[Tuple[float, float]] = ...) -> None: ... +else: + def utime(path: _PathType, times: Optional[Tuple[float, float]]) -> None: ... + +if sys.platform != 'win32': + # Unix only + def fchmod(fd: int, mode: int) -> None: ... + def fchown(fd: int, uid: int, gid: int) -> None: ... + if sys.platform != 'darwin': + def fdatasync(fd: int) -> None: ... # Unix only, not Mac + def fpathconf(fd: int, name: Union[str, int]) -> int: ... + def fstatvfs(fd: int) -> _StatVFS: ... + def ftruncate(fd: int, length: int) -> None: ... + def isatty(fd: int) -> bool: ... + def openpty() -> Tuple[int, int]: ... # some flavors of Unix + def tcgetpgrp(fd: int) -> int: ... + def tcsetpgrp(fd: int, pg: int) -> None: ... + def ttyname(fd: int) -> str: ... + def chflags(path: _PathType, flags: int) -> None: ... + def chroot(path: _PathType) -> None: ... + def chown(path: _PathType, uid: int, gid: int) -> None: ... + def lchflags(path: _PathType, flags: int) -> None: ... + def lchmod(path: _PathType, mode: int) -> None: ... + def lchown(path: _PathType, uid: int, gid: int) -> None: ... + def mkfifo(path: _PathType, mode: int = ...) -> None: ... + def pathconf(path: _PathType, name: Union[str, int]) -> int: ... + def statvfs(path: _PathType) -> _StatVFS: ... + +if sys.version_info >= (3, 6): + def walk(top: Union[AnyStr, PathLike[AnyStr]], topdown: bool = ..., + onerror: Optional[Callable[[OSError], Any]] = ..., + followlinks: bool = ...) -> Iterator[Tuple[AnyStr, List[AnyStr], + List[AnyStr]]]: ... +else: + def walk(top: AnyStr, topdown: bool = ..., onerror: Optional[Callable[[OSError], Any]] = ..., + followlinks: bool = ...) -> Iterator[Tuple[AnyStr, List[AnyStr], + List[AnyStr]]]: ... + +def abort() -> NoReturn: ... +# These are defined as execl(file, *args) but the first *arg is mandatory. +def execl(file: _PathType, __arg0: Union[bytes, Text], *args: Union[bytes, Text]) -> NoReturn: ... +def execlp(file: _PathType, __arg0: Union[bytes, Text], *args: Union[bytes, Text]) -> NoReturn: ... + +# These are: execle(file, *args, env) but env is pulled from the last element of the args. +def execle(file: _PathType, __arg0: Union[bytes, Text], *args: Any) -> NoReturn: ... +def execlpe(file: _PathType, __arg0: Union[bytes, Text], *args: Any) -> NoReturn: ... + +# The docs say `args: tuple or list of strings` +# The implementation enforces tuple or list so we can't use Sequence. +_ExecVArgs = Union[Tuple[Union[bytes, Text], ...], List[bytes], List[Text], List[Union[bytes, Text]]] +def execv(path: _PathType, args: _ExecVArgs) -> NoReturn: ... +def execve(path: _PathType, args: _ExecVArgs, env: Mapping[str, str]) -> NoReturn: ... +def execvp(file: _PathType, args: _ExecVArgs) -> NoReturn: ... +def execvpe(file: _PathType, args: _ExecVArgs, env: Mapping[str, str]) -> NoReturn: ... + +def _exit(n: int) -> NoReturn: ... +def kill(pid: int, sig: int) -> None: ... + +if sys.platform != 'win32': + # Unix only + def fork() -> int: ... + def forkpty() -> Tuple[int, int]: ... # some flavors of Unix + def killpg(pgid: int, sig: int) -> None: ... + def nice(increment: int) -> int: ... + def plock(op: int) -> None: ... # ???op is int? + +if sys.version_info >= (3, 0): + class popen(_TextIOWrapper): + # TODO 'b' modes or bytes command not accepted? + def __init__(self, command: str, mode: str = ..., + bufsize: int = ...) -> None: ... + def close(self) -> Any: ... # may return int +else: + def popen(command: str, *args, **kwargs) -> IO[Any]: ... + def popen2(cmd: str, *args, **kwargs) -> Tuple[IO[Any], IO[Any]]: ... + def popen3(cmd: str, *args, **kwargs) -> Tuple[IO[Any], IO[Any], IO[Any]]: ... + def popen4(cmd: str, *args, **kwargs) -> Tuple[IO[Any], IO[Any]]: ... + +def spawnl(mode: int, path: _PathType, arg0: Union[bytes, Text], *args: Union[bytes, Text]) -> int: ... +def spawnle(mode: int, path: _PathType, arg0: Union[bytes, Text], + *args: Any) -> int: ... # Imprecise sig +def spawnv(mode: int, path: _PathType, args: List[Union[bytes, Text]]) -> int: ... +def spawnve(mode: int, path: _PathType, args: List[Union[bytes, Text]], + env: Mapping[str, str]) -> int: ... +def system(command: _PathType) -> int: ... +def times() -> Tuple[float, float, float, float, float]: ... +def waitpid(pid: int, options: int) -> Tuple[int, int]: ... +def urandom(n: int) -> bytes: ... + +if sys.platform == 'win32': + def startfile(path: _PathType, operation: Optional[str] = ...) -> None: ... +else: + # Unix only + def spawnlp(mode: int, file: _PathType, arg0: Union[bytes, Text], *args: Union[bytes, Text]) -> int: ... + def spawnlpe(mode: int, file: _PathType, arg0: Union[bytes, Text], *args: Any) -> int: ... # Imprecise signature + def spawnvp(mode: int, file: _PathType, args: List[Union[bytes, Text]]) -> int: ... + def spawnvpe(mode: int, file: _PathType, args: List[Union[bytes, Text]], env: Mapping[str, str]) -> int: ... + def wait() -> Tuple[int, int]: ... + def wait3(options: int) -> Tuple[int, int, Any]: ... + def wait4(pid: int, options: int) -> Tuple[int, int, Any]: ... + def WCOREDUMP(status: int) -> bool: ... + def WIFCONTINUED(status: int) -> bool: ... + def WIFSTOPPED(status: int) -> bool: ... + def WIFSIGNALED(status: int) -> bool: ... + def WIFEXITED(status: int) -> bool: ... + def WEXITSTATUS(status: int) -> int: ... + def WSTOPSIG(status: int) -> int: ... + def WTERMSIG(status: int) -> int: ... + def confstr(name: Union[str, int]) -> Optional[str]: ... + def getloadavg() -> Tuple[float, float, float]: ... + def sysconf(name: Union[str, int]) -> int: ... + +if sys.version_info >= (3, 0): + def sched_getaffinity(id: int) -> Set[int]: ... +if sys.version_info >= (3, 3): + class waitresult: + si_pid: int + def waitid(idtype: int, id: int, options: int) -> waitresult: ... + +if sys.version_info < (3, 0): + def tmpfile() -> IO[Any]: ... + def tmpnam() -> str: ... + def tempnam(dir: str = ..., prefix: str = ...) -> str: ... + +P_ALL: int +WEXITED: int +WNOWAIT: int + +if sys.version_info >= (3, 3): + if sys.platform != 'win32': + # Unix only + def sync() -> None: ... + + def truncate(path: Union[_PathType, int], length: int) -> None: ... # Unix only up to version 3.4 + + def fwalk(top: AnyStr = ..., topdown: bool = ..., + onerror: Callable = ..., *, follow_symlinks: bool = ..., + dir_fd: int = ...) -> Iterator[Tuple[AnyStr, List[AnyStr], List[AnyStr], int]]: ... + + terminal_size = NamedTuple('terminal_size', [('columns', int), ('lines', int)]) + def get_terminal_size(fd: int = ...) -> terminal_size: ... + +if sys.version_info >= (3, 4): + def cpu_count() -> Optional[int]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/os/path.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/os/path.pyi new file mode 100644 index 0000000..c0bf576 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/os/path.pyi @@ -0,0 +1,180 @@ +# NB: path.pyi and stdlib/2 and stdlib/3 must remain consistent! +# Stubs for os.path +# Ron Murawski + +import os +import sys +from typing import ( + overload, List, Any, AnyStr, Sequence, Tuple, BinaryIO, TextIO, + TypeVar, Union, Text, Callable, Optional +) + +_T = TypeVar('_T') + +if sys.version_info >= (3, 6): + from builtins import _PathLike + _PathType = Union[bytes, Text, _PathLike] + _StrPath = Union[Text, _PathLike[Text]] + _BytesPath = Union[bytes, _PathLike[bytes]] +else: + _PathType = Union[bytes, Text] + _StrPath = Text + _BytesPath = bytes + +# ----- os.path variables ----- +supports_unicode_filenames: bool +# aliases (also in os) +curdir: str +pardir: str +sep: str +if sys.platform == 'win32': + altsep: str +else: + altsep: Optional[str] +extsep: str +pathsep: str +defpath: str +devnull: str + +# ----- os.path function stubs ----- +if sys.version_info >= (3, 6): + # Overloads are necessary to work around python/mypy#3644. + @overload + def abspath(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def abspath(path: AnyStr) -> AnyStr: ... + @overload + def basename(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def basename(path: AnyStr) -> AnyStr: ... + @overload + def dirname(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def dirname(path: AnyStr) -> AnyStr: ... + @overload + def expanduser(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def expanduser(path: AnyStr) -> AnyStr: ... + @overload + def expandvars(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def expandvars(path: AnyStr) -> AnyStr: ... + @overload + def normcase(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def normcase(path: AnyStr) -> AnyStr: ... + @overload + def normpath(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def normpath(path: AnyStr) -> AnyStr: ... + if sys.platform == 'win32': + @overload + def realpath(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def realpath(path: AnyStr) -> AnyStr: ... + else: + @overload + def realpath(filename: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def realpath(filename: AnyStr) -> AnyStr: ... + +else: + def abspath(path: AnyStr) -> AnyStr: ... + def basename(path: AnyStr) -> AnyStr: ... + def dirname(path: AnyStr) -> AnyStr: ... + def expanduser(path: AnyStr) -> AnyStr: ... + def expandvars(path: AnyStr) -> AnyStr: ... + def normcase(path: AnyStr) -> AnyStr: ... + def normpath(path: AnyStr) -> AnyStr: ... + if sys.platform == 'win32': + def realpath(path: AnyStr) -> AnyStr: ... + else: + def realpath(filename: AnyStr) -> AnyStr: ... + +if sys.version_info >= (3, 6): + # In reality it returns str for sequences of _StrPath and bytes for sequences + # of _BytesPath, but mypy does not accept such a signature. + def commonpath(paths: Sequence[_PathType]) -> Any: ... +elif sys.version_info >= (3, 5): + def commonpath(paths: Sequence[AnyStr]) -> AnyStr: ... + +# NOTE: Empty lists results in '' (str) regardless of contained type. +# Also, in Python 2 mixed sequences of Text and bytes results in either Text or bytes +# So, fall back to Any +def commonprefix(list: Sequence[_PathType]) -> Any: ... + +if sys.version_info >= (3, 3): + def exists(path: Union[_PathType, int]) -> bool: ... +else: + def exists(path: _PathType) -> bool: ... +def lexists(path: _PathType) -> bool: ... + +# These return float if os.stat_float_times() == True, +# but int is a subclass of float. +def getatime(path: _PathType) -> float: ... +def getmtime(path: _PathType) -> float: ... +def getctime(path: _PathType) -> float: ... + +def getsize(path: _PathType) -> int: ... +def isabs(path: _PathType) -> bool: ... +def isfile(path: _PathType) -> bool: ... +def isdir(path: _PathType) -> bool: ... +def islink(path: _PathType) -> bool: ... +def ismount(path: _PathType) -> bool: ... + +if sys.version_info < (3, 0): + # Make sure signatures are disjunct, and allow combinations of bytes and unicode. + # (Since Python 2 allows that, too) + # Note that e.g. os.path.join("a", "b", "c", "d", u"e") will still result in + # a type error. + @overload + def join(__p1: bytes, *p: bytes) -> bytes: ... + @overload + def join(__p1: bytes, __p2: bytes, __p3: bytes, __p4: Text, *p: _PathType) -> Text: ... + @overload + def join(__p1: bytes, __p2: bytes, __p3: Text, *p: _PathType) -> Text: ... + @overload + def join(__p1: bytes, __p2: Text, *p: _PathType) -> Text: ... + @overload + def join(__p1: Text, *p: _PathType) -> Text: ... +elif sys.version_info >= (3, 6): + # Mypy complains that the signatures overlap (same for relpath below), but things seem to behave correctly anyway. + @overload + def join(path: _StrPath, *paths: _StrPath) -> Text: ... + @overload + def join(path: _BytesPath, *paths: _BytesPath) -> bytes: ... +else: + def join(path: AnyStr, *paths: AnyStr) -> AnyStr: ... + +@overload +def relpath(path: _BytesPath, start: Optional[_BytesPath] = ...) -> bytes: ... +@overload +def relpath(path: _StrPath, start: Optional[_StrPath] = ...) -> Text: ... + +def samefile(path1: _PathType, path2: _PathType) -> bool: ... +def sameopenfile(fp1: int, fp2: int) -> bool: ... +def samestat(stat1: os.stat_result, stat2: os.stat_result) -> bool: ... + +if sys.version_info >= (3, 6): + @overload + def split(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... + @overload + def split(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitdrive(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitdrive(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitext(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitext(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... +else: + def split(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + def splitdrive(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + def splitext(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + +if sys.platform == 'win32': + def splitunc(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... # deprecated + +if sys.version_info < (3,): + def walk(path: AnyStr, visit: Callable[[_T, AnyStr, List[AnyStr]], Any], arg: _T) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/os2emxpath.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/os2emxpath.pyi new file mode 100644 index 0000000..c0bf576 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/os2emxpath.pyi @@ -0,0 +1,180 @@ +# NB: path.pyi and stdlib/2 and stdlib/3 must remain consistent! +# Stubs for os.path +# Ron Murawski + +import os +import sys +from typing import ( + overload, List, Any, AnyStr, Sequence, Tuple, BinaryIO, TextIO, + TypeVar, Union, Text, Callable, Optional +) + +_T = TypeVar('_T') + +if sys.version_info >= (3, 6): + from builtins import _PathLike + _PathType = Union[bytes, Text, _PathLike] + _StrPath = Union[Text, _PathLike[Text]] + _BytesPath = Union[bytes, _PathLike[bytes]] +else: + _PathType = Union[bytes, Text] + _StrPath = Text + _BytesPath = bytes + +# ----- os.path variables ----- +supports_unicode_filenames: bool +# aliases (also in os) +curdir: str +pardir: str +sep: str +if sys.platform == 'win32': + altsep: str +else: + altsep: Optional[str] +extsep: str +pathsep: str +defpath: str +devnull: str + +# ----- os.path function stubs ----- +if sys.version_info >= (3, 6): + # Overloads are necessary to work around python/mypy#3644. + @overload + def abspath(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def abspath(path: AnyStr) -> AnyStr: ... + @overload + def basename(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def basename(path: AnyStr) -> AnyStr: ... + @overload + def dirname(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def dirname(path: AnyStr) -> AnyStr: ... + @overload + def expanduser(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def expanduser(path: AnyStr) -> AnyStr: ... + @overload + def expandvars(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def expandvars(path: AnyStr) -> AnyStr: ... + @overload + def normcase(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def normcase(path: AnyStr) -> AnyStr: ... + @overload + def normpath(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def normpath(path: AnyStr) -> AnyStr: ... + if sys.platform == 'win32': + @overload + def realpath(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def realpath(path: AnyStr) -> AnyStr: ... + else: + @overload + def realpath(filename: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def realpath(filename: AnyStr) -> AnyStr: ... + +else: + def abspath(path: AnyStr) -> AnyStr: ... + def basename(path: AnyStr) -> AnyStr: ... + def dirname(path: AnyStr) -> AnyStr: ... + def expanduser(path: AnyStr) -> AnyStr: ... + def expandvars(path: AnyStr) -> AnyStr: ... + def normcase(path: AnyStr) -> AnyStr: ... + def normpath(path: AnyStr) -> AnyStr: ... + if sys.platform == 'win32': + def realpath(path: AnyStr) -> AnyStr: ... + else: + def realpath(filename: AnyStr) -> AnyStr: ... + +if sys.version_info >= (3, 6): + # In reality it returns str for sequences of _StrPath and bytes for sequences + # of _BytesPath, but mypy does not accept such a signature. + def commonpath(paths: Sequence[_PathType]) -> Any: ... +elif sys.version_info >= (3, 5): + def commonpath(paths: Sequence[AnyStr]) -> AnyStr: ... + +# NOTE: Empty lists results in '' (str) regardless of contained type. +# Also, in Python 2 mixed sequences of Text and bytes results in either Text or bytes +# So, fall back to Any +def commonprefix(list: Sequence[_PathType]) -> Any: ... + +if sys.version_info >= (3, 3): + def exists(path: Union[_PathType, int]) -> bool: ... +else: + def exists(path: _PathType) -> bool: ... +def lexists(path: _PathType) -> bool: ... + +# These return float if os.stat_float_times() == True, +# but int is a subclass of float. +def getatime(path: _PathType) -> float: ... +def getmtime(path: _PathType) -> float: ... +def getctime(path: _PathType) -> float: ... + +def getsize(path: _PathType) -> int: ... +def isabs(path: _PathType) -> bool: ... +def isfile(path: _PathType) -> bool: ... +def isdir(path: _PathType) -> bool: ... +def islink(path: _PathType) -> bool: ... +def ismount(path: _PathType) -> bool: ... + +if sys.version_info < (3, 0): + # Make sure signatures are disjunct, and allow combinations of bytes and unicode. + # (Since Python 2 allows that, too) + # Note that e.g. os.path.join("a", "b", "c", "d", u"e") will still result in + # a type error. + @overload + def join(__p1: bytes, *p: bytes) -> bytes: ... + @overload + def join(__p1: bytes, __p2: bytes, __p3: bytes, __p4: Text, *p: _PathType) -> Text: ... + @overload + def join(__p1: bytes, __p2: bytes, __p3: Text, *p: _PathType) -> Text: ... + @overload + def join(__p1: bytes, __p2: Text, *p: _PathType) -> Text: ... + @overload + def join(__p1: Text, *p: _PathType) -> Text: ... +elif sys.version_info >= (3, 6): + # Mypy complains that the signatures overlap (same for relpath below), but things seem to behave correctly anyway. + @overload + def join(path: _StrPath, *paths: _StrPath) -> Text: ... + @overload + def join(path: _BytesPath, *paths: _BytesPath) -> bytes: ... +else: + def join(path: AnyStr, *paths: AnyStr) -> AnyStr: ... + +@overload +def relpath(path: _BytesPath, start: Optional[_BytesPath] = ...) -> bytes: ... +@overload +def relpath(path: _StrPath, start: Optional[_StrPath] = ...) -> Text: ... + +def samefile(path1: _PathType, path2: _PathType) -> bool: ... +def sameopenfile(fp1: int, fp2: int) -> bool: ... +def samestat(stat1: os.stat_result, stat2: os.stat_result) -> bool: ... + +if sys.version_info >= (3, 6): + @overload + def split(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... + @overload + def split(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitdrive(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitdrive(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitext(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitext(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... +else: + def split(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + def splitdrive(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + def splitext(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + +if sys.platform == 'win32': + def splitunc(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... # deprecated + +if sys.version_info < (3,): + def walk(path: AnyStr, visit: Callable[[_T, AnyStr, List[AnyStr]], Any], arg: _T) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/pipes.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/pipes.pyi new file mode 100644 index 0000000..d5f5291 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/pipes.pyi @@ -0,0 +1,13 @@ +from typing import Any, IO + +class Template: + def __init__(self) -> None: ... + def reset(self) -> None: ... + def clone(self) -> Template: ... + def debug(self, flag: bool) -> None: ... + def append(self, cmd: str, kind: str) -> None: ... + def prepend(self, cmd: str, kind: str) -> None: ... + def open(self, file: str, mode: str) -> IO[Any]: ... + def copy(self, infile: str, outfile: str) -> None: ... + +def quote(s: str) -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/platform.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/platform.pyi new file mode 100644 index 0000000..e6e0378 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/platform.pyi @@ -0,0 +1,45 @@ +# Stubs for platform (Python 2) +# +# Based on stub generated by stubgen. + +from typing import Any, Optional, Tuple + +__copyright__: Any +DEV_NULL: Any + +def libc_ver(executable=..., lib=..., version=..., chunksize: int = ...): ... +def linux_distribution(distname=..., version=..., id=..., supported_dists=..., full_distribution_name: int = ...): ... +def dist(distname=..., version=..., id=..., supported_dists=...): ... + +class _popen: + tmpfile: Any + pipe: Any + bufsize: Any + mode: Any + def __init__(self, cmd, mode=..., bufsize: Optional[Any] = ...): ... + def read(self): ... + def readlines(self): ... + def close(self, remove=..., error=...): ... + __del__: Any + +def popen(cmd, mode=..., bufsize: Optional[Any] = ...): ... +def win32_ver(release=..., version=..., csd=..., ptype=...): ... +def mac_ver(release=..., versioninfo=..., machine=...): ... +def java_ver(release=..., vendor=..., vminfo=..., osinfo=...): ... +def system_alias(system, release, version): ... +def architecture(executable=..., bits=..., linkage=...) -> Tuple[str, str]: ... +def uname() -> Tuple[str, str, str, str, str, str]: ... +def system() -> str: ... +def node() -> str: ... +def release() -> str: ... +def version() -> str: ... +def machine() -> str: ... +def processor() -> str: ... +def python_implementation() -> str: ... +def python_version() -> str: ... +def python_version_tuple() -> Tuple[str, str, str]: ... +def python_branch() -> str: ... +def python_revision() -> str: ... +def python_build() -> Tuple[str, str]: ... +def python_compiler() -> str: ... +def platform(aliased: int = ..., terse: int = ...) -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/popen2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/popen2.pyi new file mode 100644 index 0000000..23435b3 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/popen2.pyi @@ -0,0 +1,28 @@ +from typing import Any, Iterable, List, Optional, Union, TextIO, Tuple, TypeVar + +_T = TypeVar('_T') + + +class Popen3: + sts: int + cmd: Iterable + pid: int + tochild: TextIO + fromchild: TextIO + childerr: Optional[TextIO] + def __init__(self, cmd: Iterable = ..., capturestderr: bool = ..., bufsize: int = ...) -> None: ... + def __del__(self) -> None: ... + def poll(self, _deadstate: _T = ...) -> Union[int, _T]: ... + def wait(self) -> int: ... + +class Popen4(Popen3): + childerr: None + cmd: Iterable + pid: int + tochild: TextIO + fromchild: TextIO + def __init__(self, cmd: Iterable = ..., bufsize: int = ...) -> None: ... + +def popen2(cmd: Iterable = ..., bufsize: int = ..., mode: str = ...) -> Tuple[TextIO, TextIO]: ... +def popen3(cmd: Iterable = ..., bufsize: int = ..., mode: str = ...) -> Tuple[TextIO, TextIO, TextIO]: ... +def popen4(cmd: Iterable = ..., bufsize: int = ..., mode: str = ...) -> Tuple[TextIO, TextIO]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/posix.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/posix.pyi new file mode 100644 index 0000000..fcd4a66 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/posix.pyi @@ -0,0 +1,205 @@ +from typing import Dict, List, Mapping, Tuple, Union, Sequence, IO, Optional, TypeVar + +error = OSError + +confstr_names: Dict[str, int] +environ: Dict[str, str] +pathconf_names: Dict[str, int] +sysconf_names: Dict[str, int] + +EX_CANTCREAT: int +EX_CONFIG: int +EX_DATAERR: int +EX_IOERR: int +EX_NOHOST: int +EX_NOINPUT: int +EX_NOPERM: int +EX_NOUSER: int +EX_OK: int +EX_OSERR: int +EX_OSFILE: int +EX_PROTOCOL: int +EX_SOFTWARE: int +EX_TEMPFAIL: int +EX_UNAVAILABLE: int +EX_USAGE: int +F_OK: int +NGROUPS_MAX: int +O_APPEND: int +O_ASYNC: int +O_CREAT: int +O_DIRECT: int +O_DIRECTORY: int +O_DSYNC: int +O_EXCL: int +O_LARGEFILE: int +O_NDELAY: int +O_NOATIME: int +O_NOCTTY: int +O_NOFOLLOW: int +O_NONBLOCK: int +O_RDONLY: int +O_RDWR: int +O_RSYNC: int +O_SYNC: int +O_TRUNC: int +O_WRONLY: int +R_OK: int +TMP_MAX: int +WCONTINUED: int +WNOHANG: int +WUNTRACED: int +W_OK: int +X_OK: int + +def WCOREDUMP(status: int) -> bool: ... +def WEXITSTATUS(status: int) -> bool: ... +def WIFCONTINUED(status: int) -> bool: ... +def WIFEXITED(status: int) -> bool: ... +def WIFSIGNALED(status: int) -> bool: ... +def WIFSTOPPED(status: int) -> bool: ... +def WSTOPSIG(status: int) -> bool: ... +def WTERMSIG(status: int) -> bool: ... + +class stat_result(object): + n_fields: int + n_sequence_fields: int + n_unnamed_fields: int + st_mode: int + st_ino: int + st_dev: int + st_nlink: int + st_uid: int + st_gid: int + st_size: int + st_atime: int + st_mtime: int + st_ctime: int + +class statvfs_result(object): + n_fields: int + n_sequence_fields: int + n_unnamed_fields: int + f_bsize: int + f_frsize: int + f_blocks: int + f_bfree: int + f_bavail: int + f_files: int + f_ffree: int + f_favail: int + f_flag: int + f_namemax: int + +def _exit(status: int) -> None: ... +def abort() -> None: ... +def access(path: unicode, mode: int) -> bool: ... +def chdir(path: unicode) -> None: ... +def chmod(path: unicode, mode: int) -> None: ... +def chown(path: unicode, uid: int, gid: int) -> None: ... +def chroot(path: unicode) -> None: ... +def close(fd: int) -> None: ... +def closerange(fd_low: int, fd_high: int) -> None: ... +def confstr(name: Union[str, int]) -> str: ... +def ctermid() -> str: ... +def dup(fd: int) -> int: ... +def dup2(fd: int, fd2: int) -> None: ... +def execv(path: str, args: Sequence[str], env: Mapping[str, str]) -> None: ... +def execve(path: str, args: Sequence[str], env: Mapping[str, str]) -> None: ... +def fchdir(fd: int) -> None: ... +def fchmod(fd: int, mode: int) -> None: ... +def fchown(fd: int, uid: int, gid: int) -> None: ... +def fdatasync(fd: int) -> None: ... +def fdopen(fd: int, mode: str = ..., bufsize: int = ...) -> IO[str]: ... +def fork() -> int: + raise OSError() +def forkpty() -> Tuple[int, int]: + raise OSError() +def fpathconf(fd: int, name: str) -> None: ... +def fstat(fd: int) -> stat_result: ... +def fstatvfs(fd: int) -> statvfs_result: ... +def fsync(fd: int) -> None: ... +def ftruncate(fd: int, length: int) -> None: ... +def getcwd() -> str: ... +def getcwdu() -> unicode: ... +def getegid() -> int: ... +def geteuid() -> int: ... +def getgid() -> int: ... +def getgroups() -> List[int]: ... +def getloadavg() -> Tuple[float, float, float]: + raise OSError() +def getlogin() -> str: ... +def getpgid(pid: int) -> int: ... +def getpgrp() -> int: ... +def getpid() -> int: ... +def getppid() -> int: ... +def getresgid() -> Tuple[int, int, int]: ... +def getresuid() -> Tuple[int, int, int]: ... +def getsid(pid: int) -> int: ... +def getuid() -> int: ... +def initgroups(username: str, gid: int) -> None: ... +def isatty(fd: int) -> bool: ... +def kill(pid: int, sig: int) -> None: ... +def killpg(pgid: int, sig: int) -> None: ... +def lchown(path: unicode, uid: int, gid: int) -> None: ... +def link(source: unicode, link_name: str) -> None: ... +_T = TypeVar("_T") +def listdir(path: _T) -> List[_T]: ... +def lseek(fd: int, pos: int, how: int) -> None: ... +def lstat(path: unicode) -> stat_result: ... +def major(device: int) -> int: ... +def makedev(major: int, minor: int) -> int: ... +def minor(device: int) -> int: ... +def mkdir(path: unicode, mode: int = ...) -> None: ... +def mkfifo(path: unicode, mode: int = ...) -> None: ... +def mknod(filename: unicode, mode: int = ..., device: int = ...) -> None: ... +def nice(increment: int) -> int: ... +def open(file: unicode, flags: int, mode: int = ...) -> int: ... +def openpty() -> Tuple[int, int]: ... +def pathconf(path: unicode, name: str) -> str: ... +def pipe() -> Tuple[int, int]: ... +def popen(command: str, mode: str = ..., bufsize: int = ...) -> IO[str]: ... +def putenv(varname: str, value: str) -> None: ... +def read(fd: int, n: int) -> str: ... +def readlink(path: _T) -> _T: ... +def remove(path: unicode) -> None: ... +def rename(src: unicode, dst: unicode) -> None: ... +def rmdir(path: unicode) -> None: ... +def setegid(egid: int) -> None: ... +def seteuid(euid: int) -> None: ... +def setgid(gid: int) -> None: ... +def setgroups(groups: Sequence[int]) -> None: ... +def setpgid(pid: int, pgrp: int) -> None: ... +def setpgrp() -> None: ... +def setregid(rgid: int, egid: int) -> None: ... +def setresgid(rgid: int, egid: int, sgid: int) -> None: ... +def setresuid(ruid: int, euid: int, suid: int) -> None: ... +def setreuid(ruid: int, euid: int) -> None: ... +def setsid() -> None: ... +def setuid(pid: int) -> None: ... +def stat(path: unicode) -> stat_result: ... +def statvfs(path: unicode) -> statvfs_result: ... +def stat_float_times(fd: int) -> None: ... +def strerror(code: int) -> str: ... +def symlink(source: unicode, link_name: unicode) -> None: ... +def sysconf(name: Union[str, int]) -> int: ... +def system(command: unicode) -> int: ... +def tcgetpgrp(fd: int) -> int: ... +def tcsetpgrp(fd: int, pg: int) -> None: ... +def times() -> Tuple[float, float, float, float, float]: ... +def tmpfile() -> IO[str]: ... +def ttyname(fd: int) -> str: ... +def umask(mask: int) -> int: ... +def uname() -> Tuple[str, str, str, str, str]: ... +def unlink(path: unicode) -> None: ... +def unsetenv(varname: str) -> None: ... +def urandom(n: int) -> str: ... +def utime(path: unicode, times: Optional[Tuple[int, int]]) -> None: + raise OSError +def wait() -> int: ... +_r = Tuple[float, float, int, int, int, int, int, int, int, int, int, int, int, int, int, int] +def wait3(options: int) -> Tuple[int, int, _r]: ... +def wait4(pid: int, options: int) -> Tuple[int, int, _r]: ... +def waitpid(pid: int, options: int) -> int: + raise OSError() +def write(fd: int, str: str) -> int: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/random.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/random.pyi new file mode 100644 index 0000000..3292db8 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/random.pyi @@ -0,0 +1,75 @@ +# Stubs for random +# Ron Murawski +# Updated by Jukka Lehtosalo + +# based on https://docs.python.org/2/library/random.html + +# ----- random classes ----- + +import _random +from typing import ( + Any, TypeVar, Sequence, List, Callable, AbstractSet, Union, + overload +) + +_T = TypeVar('_T') + +class Random(_random.Random): + def __init__(self, x: object = ...) -> None: ... + def seed(self, x: object = ...) -> None: ... + def getstate(self) -> _random._State: ... + def setstate(self, state: _random._State) -> None: ... + def jumpahead(self, n: int) -> None: ... + def getrandbits(self, k: int) -> int: ... + @overload + def randrange(self, stop: int) -> int: ... + @overload + def randrange(self, start: int, stop: int, step: int = ...) -> int: ... + def randint(self, a: int, b: int) -> int: ... + def choice(self, seq: Sequence[_T]) -> _T: ... + def shuffle(self, x: List[Any], random: Callable[[], None] = ...) -> None: ... + def sample(self, population: Union[Sequence[_T], AbstractSet[_T]], k: int) -> List[_T]: ... + def random(self) -> float: ... + def uniform(self, a: float, b: float) -> float: ... + def triangular(self, low: float = ..., high: float = ..., mode: float = ...) -> float: ... + def betavariate(self, alpha: float, beta: float) -> float: ... + def expovariate(self, lambd: float) -> float: ... + def gammavariate(self, alpha: float, beta: float) -> float: ... + def gauss(self, mu: float, sigma: float) -> float: ... + def lognormvariate(self, mu: float, sigma: float) -> float: ... + def normalvariate(self, mu: float, sigma: float) -> float: ... + def vonmisesvariate(self, mu: float, kappa: float) -> float: ... + def paretovariate(self, alpha: float) -> float: ... + def weibullvariate(self, alpha: float, beta: float) -> float: ... + +# SystemRandom is not implemented for all OS's; good on Windows & Linux +class SystemRandom(Random): + ... + +# ----- random function stubs ----- +def seed(x: object = ...) -> None: ... +def getstate() -> object: ... +def setstate(state: object) -> None: ... +def jumpahead(n: int) -> None: ... +def getrandbits(k: int) -> int: ... +@overload +def randrange(stop: int) -> int: ... +@overload +def randrange(start: int, stop: int, step: int = ...) -> int: ... +def randint(a: int, b: int) -> int: ... +def choice(seq: Sequence[_T]) -> _T: ... +def shuffle(x: List[Any], random: Callable[[], float] = ...) -> None: ... +def sample(population: Union[Sequence[_T], AbstractSet[_T]], k: int) -> List[_T]: ... +def random() -> float: ... +def uniform(a: float, b: float) -> float: ... +def triangular(low: float = ..., high: float = ..., + mode: float = ...) -> float: ... +def betavariate(alpha: float, beta: float) -> float: ... +def expovariate(lambd: float) -> float: ... +def gammavariate(alpha: float, beta: float) -> float: ... +def gauss(mu: float, sigma: float) -> float: ... +def lognormvariate(mu: float, sigma: float) -> float: ... +def normalvariate(mu: float, sigma: float) -> float: ... +def vonmisesvariate(mu: float, kappa: float) -> float: ... +def paretovariate(alpha: float) -> float: ... +def weibullvariate(alpha: float, beta: float) -> float: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/re.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/re.pyi new file mode 100644 index 0000000..2a2c2cb --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/re.pyi @@ -0,0 +1,100 @@ +# Stubs for re +# Ron Murawski +# 'bytes' support added by Jukka Lehtosalo + +# based on: http: //docs.python.org/2.7/library/re.html + +from typing import ( + List, Iterator, overload, Callable, Tuple, Sequence, Dict, + Generic, AnyStr, Match, Pattern, Any, Optional, Union +) + +# ----- re variables and constants ----- +DEBUG = 0 +I = 0 +IGNORECASE = 0 +L = 0 +LOCALE = 0 +M = 0 +MULTILINE = 0 +S = 0 +DOTALL = 0 +X = 0 +VERBOSE = 0 +U = 0 +UNICODE = 0 +T = 0 +TEMPLATE = 0 + +class error(Exception): ... + +@overload +def compile(pattern: AnyStr, flags: int = ...) -> Pattern[AnyStr]: ... +@overload +def compile(pattern: Pattern[AnyStr], flags: int = ...) -> Pattern[AnyStr]: ... + +@overload +def search(pattern: Union[str, unicode], string: AnyStr, flags: int = ...) -> Optional[Match[AnyStr]]: ... +@overload +def search(pattern: Union[Pattern[str], Pattern[unicode]], string: AnyStr, flags: int = ...) -> Optional[Match[AnyStr]]: ... + +@overload +def match(pattern: Union[str, unicode], string: AnyStr, flags: int = ...) -> Optional[Match[AnyStr]]: ... +@overload +def match(pattern: Union[Pattern[str], Pattern[unicode]], string: AnyStr, flags: int = ...) -> Optional[Match[AnyStr]]: ... + +@overload +def split(pattern: Union[str, unicode], string: AnyStr, + maxsplit: int = ..., flags: int = ...) -> List[AnyStr]: ... +@overload +def split(pattern: Union[Pattern[str], Pattern[unicode]], string: AnyStr, + maxsplit: int = ..., flags: int = ...) -> List[AnyStr]: ... + +@overload +def findall(pattern: Union[str, unicode], string: AnyStr, flags: int = ...) -> List[Any]: ... +@overload +def findall(pattern: Union[Pattern[str], Pattern[unicode]], string: AnyStr, flags: int = ...) -> List[Any]: ... + +# Return an iterator yielding match objects over all non-overlapping matches +# for the RE pattern in string. The string is scanned left-to-right, and +# matches are returned in the order found. Empty matches are included in the +# result unless they touch the beginning of another match. +@overload +def finditer(pattern: Union[str, unicode], string: AnyStr, + flags: int = ...) -> Iterator[Match[AnyStr]]: ... +@overload +def finditer(pattern: Union[Pattern[str], Pattern[unicode]], string: AnyStr, + flags: int = ...) -> Iterator[Match[AnyStr]]: ... + +@overload +def sub(pattern: Union[str, unicode], repl: AnyStr, string: AnyStr, count: int = ..., + flags: int = ...) -> AnyStr: ... +@overload +def sub(pattern: Union[str, unicode], repl: Callable[[Match[AnyStr]], AnyStr], + string: AnyStr, count: int = ..., flags: int = ...) -> AnyStr: ... +@overload +def sub(pattern: Union[Pattern[str], Pattern[unicode]], repl: AnyStr, string: AnyStr, count: int = ..., + flags: int = ...) -> AnyStr: ... +@overload +def sub(pattern: Union[Pattern[str], Pattern[unicode]], repl: Callable[[Match[AnyStr]], AnyStr], + string: AnyStr, count: int = ..., flags: int = ...) -> AnyStr: ... + +@overload +def subn(pattern: Union[str, unicode], repl: AnyStr, string: AnyStr, count: int = ..., + flags: int = ...) -> Tuple[AnyStr, int]: ... +@overload +def subn(pattern: Union[str, unicode], repl: Callable[[Match[AnyStr]], AnyStr], + string: AnyStr, count: int = ..., + flags: int = ...) -> Tuple[AnyStr, int]: ... +@overload +def subn(pattern: Union[Pattern[str], Pattern[unicode]], repl: AnyStr, string: AnyStr, count: int = ..., + flags: int = ...) -> Tuple[AnyStr, int]: ... +@overload +def subn(pattern: Union[Pattern[str], Pattern[unicode]], repl: Callable[[Match[AnyStr]], AnyStr], + string: AnyStr, count: int = ..., + flags: int = ...) -> Tuple[AnyStr, int]: ... + +def escape(string: AnyStr) -> AnyStr: ... + +def purge() -> None: ... +def template(pattern: Union[AnyStr, Pattern[AnyStr]], flags: int = ...) -> Pattern[AnyStr]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/repr.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/repr.pyi new file mode 100644 index 0000000..ad89789 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/repr.pyi @@ -0,0 +1,31 @@ +class Repr: + maxarray: int + maxdeque: int + maxdict: int + maxfrozenset: int + maxlevel: int + maxlist: int + maxlong: int + maxother: int + maxset: int + maxstring: int + maxtuple: int + def __init__(self) -> None: ... + def _repr_iterable(self, x, level: complex, left, right, maxiter, trail=...) -> str: ... + def repr(self, x) -> str: ... + def repr1(self, x, level: complex) -> str: ... + def repr_array(self, x, level: complex) -> str: ... + def repr_deque(self, x, level: complex) -> str: ... + def repr_dict(self, x, level: complex) -> str: ... + def repr_frozenset(self, x, level: complex) -> str: ... + def repr_instance(self, x, level: complex) -> str: ... + def repr_list(self, x, level: complex) -> str: ... + def repr_long(self, x, level: complex) -> str: ... + def repr_set(self, x, level: complex) -> str: ... + def repr_str(self, x, level: complex) -> str: ... + def repr_tuple(self, x, level: complex) -> str: ... + +def _possibly_sorted(x) -> list: ... + +aRepr: Repr +def repr(x) -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/resource.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/resource.pyi new file mode 100644 index 0000000..2a6c694 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/resource.pyi @@ -0,0 +1,33 @@ +from typing import Tuple, NamedTuple + +class error(Exception): ... + +RLIM_INFINITY: int +def getrlimit(resource: int) -> Tuple[int, int]: ... +def setrlimit(resource: int, limits: Tuple[int, int]) -> None: ... + +RLIMIT_CORE: int +RLIMIT_CPU: int +RLIMIT_FSIZE: int +RLIMIT_DATA: int +RLIMIT_STACK: int +RLIMIT_RSS: int +RLIMIT_NPROC: int +RLIMIT_NOFILE: int +RLIMIT_OFILE: int +RLIMIT_MEMLOCK: int +RLIMIT_VMEM: int +RLIMIT_AS: int + +_RUsage = NamedTuple('_RUsage', [('ru_utime', float), ('ru_stime', float), ('ru_maxrss', int), + ('ru_ixrss', int), ('ru_idrss', int), ('ru_isrss', int), + ('ru_minflt', int), ('ru_majflt', int), ('ru_nswap', int), + ('ru_inblock', int), ('ru_oublock', int), ('ru_msgsnd', int), + ('ru_msgrcv', int), ('ru_nsignals', int), ('ru_nvcsw', int), + ('ru_nivcsw', int)]) +def getrusage(who: int) -> _RUsage: ... +def getpagesize() -> int: ... + +RUSAGE_SELF: int +RUSAGE_CHILDREN: int +RUSAGE_BOTH: int diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/rfc822.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/rfc822.pyi new file mode 100644 index 0000000..20cd1d6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/rfc822.pyi @@ -0,0 +1,79 @@ +# Stubs for rfc822 (Python 2) +# +# Based on stub generated by stubgen. + +from typing import Any, Optional + +class Message: + fp: Any + seekable: Any + startofheaders: Any + startofbody: Any + def __init__(self, fp, seekable: int = ...): ... + def rewindbody(self): ... + dict: Any + unixfrom: Any + headers: Any + status: Any + def readheaders(self): ... + def isheader(self, line): ... + def islast(self, line): ... + def iscomment(self, line): ... + def getallmatchingheaders(self, name): ... + def getfirstmatchingheader(self, name): ... + def getrawheader(self, name): ... + def getheader(self, name, default: Optional[Any] = ...): ... + get: Any + def getheaders(self, name): ... + def getaddr(self, name): ... + def getaddrlist(self, name): ... + def getdate(self, name): ... + def getdate_tz(self, name): ... + def __len__(self): ... + def __getitem__(self, name): ... + def __setitem__(self, name, value): ... + def __delitem__(self, name): ... + def setdefault(self, name, default=...): ... + def has_key(self, name): ... + def __contains__(self, name): ... + def __iter__(self): ... + def keys(self): ... + def values(self): ... + def items(self): ... + +class AddrlistClass: + specials: Any + pos: Any + LWS: Any + CR: Any + atomends: Any + phraseends: Any + field: Any + commentlist: Any + def __init__(self, field): ... + def gotonext(self): ... + def getaddrlist(self): ... + def getaddress(self): ... + def getrouteaddr(self): ... + def getaddrspec(self): ... + def getdomain(self): ... + def getdelimited(self, beginchar, endchars, allowcomments: int = ...): ... + def getquote(self): ... + def getcomment(self): ... + def getdomainliteral(self): ... + def getatom(self, atomends: Optional[Any] = ...): ... + def getphraselist(self): ... + +class AddressList(AddrlistClass): + addresslist: Any + def __init__(self, field): ... + def __len__(self): ... + def __add__(self, other): ... + def __iadd__(self, other): ... + def __sub__(self, other): ... + def __isub__(self, other): ... + def __getitem__(self, index): ... + +def parsedate_tz(data): ... +def parsedate(data): ... +def mktime_tz(data): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/robotparser.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/robotparser.pyi new file mode 100644 index 0000000..403039a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/robotparser.pyi @@ -0,0 +1,7 @@ +class RobotFileParser: + def set_url(self, url: str): ... + def read(self): ... + def parse(self, lines: str): ... + def can_fetch(self, user_agent: str, url: str): ... + def mtime(self): ... + def modified(self): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/runpy.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/runpy.pyi new file mode 100644 index 0000000..6674af0 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/runpy.pyi @@ -0,0 +1,17 @@ +from typing import Any, Optional + +class _TempModule: + mod_name: Any + module: Any + def __init__(self, mod_name): ... + def __enter__(self): ... + def __exit__(self, *args): ... + +class _ModifiedArgv0: + value: Any + def __init__(self, value): ... + def __enter__(self): ... + def __exit__(self, *args): ... + +def run_module(mod_name, init_globals: Optional[Any] = ..., run_name: Optional[Any] = ..., alter_sys: bool = ...): ... +def run_path(path_name, init_globals: Optional[Any] = ..., run_name: Optional[Any] = ...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/sets.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/sets.pyi new file mode 100644 index 0000000..a68994f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/sets.pyi @@ -0,0 +1,61 @@ +# Stubs for sets (Python 2) +from typing import Any, Callable, Hashable, Iterable, Iterator, MutableMapping, Optional, TypeVar, Union + +_T = TypeVar('_T') +_Setlike = Union[BaseSet[_T], Iterable[_T]] +_SelfT = TypeVar('_SelfT', bound=BaseSet) + +class BaseSet(Iterable[_T]): + def __init__(self) -> None: ... + def __len__(self) -> int: ... + def __repr__(self) -> str: ... + def __str__(self) -> str: ... + def __iter__(self) -> Iterator[_T]: ... + def __cmp__(self, other: Any) -> int: ... + def __eq__(self, other: Any) -> bool: ... + def __ne__(self, other: Any) -> bool: ... + def copy(self: _SelfT) -> _SelfT: ... + def __copy__(self: _SelfT) -> _SelfT: ... + def __deepcopy__(self: _SelfT, memo: MutableMapping[int, BaseSet[_T]]) -> _SelfT: ... + def __or__(self: _SelfT, other: BaseSet[_T]) -> _SelfT: ... + def union(self: _SelfT, other: _Setlike) -> _SelfT: ... + def __and__(self: _SelfT, other: BaseSet[_T]) -> _SelfT: ... + def intersection(self: _SelfT, other: _Setlike) -> _SelfT: ... + def __xor__(self: _SelfT, other: BaseSet[_T]) -> _SelfT: ... + def symmetric_difference(self: _SelfT, other: _Setlike) -> _SelfT: ... + def __sub__(self: _SelfT, other: BaseSet[_T]) -> _SelfT: ... + def difference(self: _SelfT, other: _Setlike) -> _SelfT: ... + def __contains__(self, element: Any) -> bool: ... + def issubset(self, other: BaseSet[_T]) -> bool: ... + def issuperset(self, other: BaseSet[_T]) -> bool: ... + def __le__(self, other: BaseSet[_T]) -> bool: ... + def __ge__(self, other: BaseSet[_T]) -> bool: ... + def __lt__(self, other: BaseSet[_T]) -> bool: ... + def __gt__(self, other: BaseSet[_T]) -> bool: ... + +class ImmutableSet(BaseSet[_T], Hashable): + def __init__(self, iterable: Optional[_Setlike] = ...) -> None: ... + def __hash__(self) -> int: ... + +class Set(BaseSet[_T]): + def __init__(self, iterable: Optional[_Setlike] = ...) -> None: ... + def __ior__(self, other: BaseSet[_T]) -> Set: ... + def union_update(self, other: _Setlike) -> None: ... + def __iand__(self, other: BaseSet[_T]) -> Set: ... + def intersection_update(self, other: _Setlike) -> None: ... + def __ixor__(self, other: BaseSet[_T]) -> Set: ... + def symmetric_difference_update(self, other: _Setlike) -> None: ... + def __isub__(self, other: BaseSet[_T]) -> Set: ... + def difference_update(self, other: _Setlike) -> None: ... + def update(self, iterable: _Setlike) -> None: ... + def clear(self) -> None: ... + def add(self, element: _T) -> None: ... + def remove(self, element: _T) -> None: ... + def discard(self, element: _T) -> None: ... + def pop(self) -> _T: ... + def __as_immutable__(self) -> ImmutableSet[_T]: ... + def __as_temporarily_immutable__(self) -> _TemporarilyImmutableSet[_T]: ... + +class _TemporarilyImmutableSet(BaseSet[_T]): + def __init__(self, set: BaseSet[_T]) -> None: ... + def __hash__(self) -> int: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/sha.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/sha.pyi new file mode 100644 index 0000000..f1606fa --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/sha.pyi @@ -0,0 +1,11 @@ +# Stubs for Python 2.7 sha stdlib module + +class sha(object): + def update(self, arg: str) -> None: ... + def digest(self) -> str: ... + def hexdigest(self) -> str: ... + def copy(self) -> sha: ... + +def new(string: str = ...) -> sha: ... +blocksize = 0 +digest_size = 0 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/shelve.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/shelve.pyi new file mode 100644 index 0000000..d7d9b8c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/shelve.pyi @@ -0,0 +1,33 @@ +from typing import Any, Dict, Iterator, List, Optional, Tuple +import collections + + +class Shelf(collections.MutableMapping): + def __init__(self, dict: Dict[Any, Any], protocol: Optional[int] = ..., writeback: bool = ..., keyencoding: str = ...) -> None: ... + def __iter__(self) -> Iterator[str]: ... + def keys(self) -> List[Any]: ... + def __len__(self) -> int: ... + def has_key(self, key: Any) -> bool: ... + def __contains__(self, key: Any) -> bool: ... + def get(self, key: Any, default: Any = ...) -> Any: ... + def __getitem__(self, key: Any) -> Any: ... + def __setitem__(self, key: Any, value: Any) -> None: ... + def __delitem__(self, key: Any) -> None: ... + def __enter__(self) -> Shelf: ... + def __exit__(self, type: Any, value: Any, traceback: Any) -> None: ... + def close(self) -> None: ... + def __del__(self) -> None: ... + def sync(self) -> None: ... + +class BsdDbShelf(Shelf): + def __init__(self, dict: Dict[Any, Any], protocol: Optional[int] = ..., writeback: bool = ..., keyencoding: str = ...) -> None: ... + def set_location(self, key: Any) -> Tuple[str, Any]: ... + def next(self) -> Tuple[str, Any]: ... + def previous(self) -> Tuple[str, Any]: ... + def first(self) -> Tuple[str, Any]: ... + def last(self) -> Tuple[str, Any]: ... + +class DbfilenameShelf(Shelf): + def __init__(self, filename: str, flag: str = ..., protocol: Optional[int] = ..., writeback: bool = ...) -> None: ... + +def open(filename: str, flag: str = ..., protocol: Optional[int] = ..., writeback: bool = ...) -> DbfilenameShelf: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/shlex.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/shlex.pyi new file mode 100644 index 0000000..5bf6fcc --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/shlex.pyi @@ -0,0 +1,30 @@ +from typing import Any, IO, List, Optional, TypeVar + +def split(s: Optional[str], comments: bool = ..., posix: bool = ...) -> List[str]: ... + +_SLT = TypeVar('_SLT', bound=shlex) + +class shlex: + def __init__(self, instream: IO[Any] = ..., infile: IO[Any] = ..., posix: bool = ...) -> None: ... + def __iter__(self: _SLT) -> _SLT: ... + def get_token(self) -> Optional[str]: ... + def push_token(self, _str: str) -> None: ... + def read_token(self) -> str: ... + def sourcehook(self, filename: str) -> None: ... + def push_source(self, stream: IO[Any], filename: str = ...) -> None: ... + def pop_source(self) -> IO[Any]: ... + def error_leader(self, file: str = ..., line: int = ...) -> str: ... + + commenters: str + wordchars: str + whitespace: str + escape: str + quotes: str + escapedquotes: str + whitespace_split: bool + infile: IO[Any] + source: Optional[str] + debug: int + lineno: int + token: Any + eof: Optional[str] diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/signal.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/signal.pyi new file mode 100644 index 0000000..cda4c65 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/signal.pyi @@ -0,0 +1,71 @@ +from typing import Callable, Any, Tuple, Union +from types import FrameType + +SIG_DFL: int = ... +SIG_IGN: int = ... + +ITIMER_REAL: int = ... +ITIMER_VIRTUAL: int = ... +ITIMER_PROF: int = ... + +NSIG: int = ... + +SIGABRT: int = ... +SIGALRM: int = ... +SIGBREAK: int = ... # Windows +SIGBUS: int = ... +SIGCHLD: int = ... +SIGCLD: int = ... +SIGCONT: int = ... +SIGEMT: int = ... +SIGFPE: int = ... +SIGHUP: int = ... +SIGILL: int = ... +SIGINFO: int = ... +SIGINT: int = ... +SIGIO: int = ... +SIGIOT: int = ... +SIGKILL: int = ... +SIGPIPE: int = ... +SIGPOLL: int = ... +SIGPROF: int = ... +SIGPWR: int = ... +SIGQUIT: int = ... +SIGRTMAX: int = ... +SIGRTMIN: int = ... +SIGSEGV: int = ... +SIGSTOP: int = ... +SIGSYS: int = ... +SIGTERM: int = ... +SIGTRAP: int = ... +SIGTSTP: int = ... +SIGTTIN: int = ... +SIGTTOU: int = ... +SIGURG: int = ... +SIGUSR1: int = ... +SIGUSR2: int = ... +SIGVTALRM: int = ... +SIGWINCH: int = ... +SIGXCPU: int = ... +SIGXFSZ: int = ... + +# Windows +CTRL_C_EVENT: int = ... +CTRL_BREAK_EVENT: int = ... + +class ItimerError(IOError): ... + +_HANDLER = Union[Callable[[int, FrameType], None], int, None] + +def alarm(time: int) -> int: ... +def getsignal(signalnum: int) -> _HANDLER: ... +def pause() -> None: ... +def setitimer(which: int, seconds: float, interval: float = ...) -> Tuple[float, float]: ... +def getitimer(which: int) -> Tuple[float, float]: ... +def set_wakeup_fd(fd: int) -> int: ... +def siginterrupt(signalnum: int, flag: bool) -> None: + raise RuntimeError() +def signal(signalnum: int, handler: _HANDLER) -> _HANDLER: + raise RuntimeError() +def default_int_handler(signum: int, frame: FrameType) -> None: + raise KeyboardInterrupt() diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/smtplib.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/smtplib.pyi new file mode 100644 index 0000000..438221a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/smtplib.pyi @@ -0,0 +1,86 @@ +from typing import Any + +class SMTPException(Exception): ... +class SMTPServerDisconnected(SMTPException): ... + +class SMTPResponseException(SMTPException): + smtp_code: Any + smtp_error: Any + args: Any + def __init__(self, code, msg) -> None: ... + +class SMTPSenderRefused(SMTPResponseException): + smtp_code: Any + smtp_error: Any + sender: Any + args: Any + def __init__(self, code, msg, sender) -> None: ... + +class SMTPRecipientsRefused(SMTPException): + recipients: Any + args: Any + def __init__(self, recipients) -> None: ... + +class SMTPDataError(SMTPResponseException): ... +class SMTPConnectError(SMTPResponseException): ... +class SMTPHeloError(SMTPResponseException): ... +class SMTPAuthenticationError(SMTPResponseException): ... + +def quoteaddr(addr): ... +def quotedata(data): ... + +class SSLFakeFile: + sslobj: Any + def __init__(self, sslobj) -> None: ... + def readline(self, size=...): ... + def close(self): ... + +class SMTP: + debuglevel: Any + file: Any + helo_resp: Any + ehlo_msg: Any + ehlo_resp: Any + does_esmtp: Any + default_port: Any + timeout: Any + esmtp_features: Any + local_hostname: Any + def __init__(self, host: str = ..., port: int = ..., local_hostname=..., timeout=...) -> None: ... + def set_debuglevel(self, debuglevel): ... + sock: Any + def connect(self, host=..., port=...): ... + def send(self, str): ... + def putcmd(self, cmd, args=...): ... + def getreply(self): ... + def docmd(self, cmd, args=...): ... + def helo(self, name=...): ... + def ehlo(self, name=...): ... + def has_extn(self, opt): ... + def help(self, args=...): ... + def rset(self): ... + def noop(self): ... + def mail(self, sender, options=...): ... + def rcpt(self, recip, options=...): ... + def data(self, msg): ... + def verify(self, address): ... + vrfy: Any + def expn(self, address): ... + def ehlo_or_helo_if_needed(self): ... + def login(self, user, password): ... + def starttls(self, keyfile=..., certfile=...): ... + def sendmail(self, from_addr, to_addrs, msg, mail_options=..., rcpt_options=...): ... + def close(self): ... + def quit(self): ... + +class SMTP_SSL(SMTP): + default_port: Any + keyfile: Any + certfile: Any + def __init__(self, host=..., port=..., local_hostname=..., keyfile=..., certfile=..., timeout=...) -> None: ... + +class LMTP(SMTP): + ehlo_msg: Any + def __init__(self, host=..., port=..., local_hostname=...) -> None: ... + sock: Any + def connect(self, host=..., port=...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/spwd.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/spwd.pyi new file mode 100644 index 0000000..1d58990 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/spwd.pyi @@ -0,0 +1,14 @@ +from typing import List, NamedTuple + +struct_spwd = NamedTuple("struct_spwd", [("sp_nam", str), + ("sp_pwd", str), + ("sp_lstchg", int), + ("sp_min", int), + ("sp_max", int), + ("sp_warn", int), + ("sp_inact", int), + ("sp_expire", int), + ("sp_flag", int)]) + +def getspall() -> List[struct_spwd]: ... +def getspnam(name: str) -> struct_spwd: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/sre_constants.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/sre_constants.pyi new file mode 100644 index 0000000..89d453e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/sre_constants.pyi @@ -0,0 +1,94 @@ +# Source: https://hg.python.org/cpython/file/2.7/Lib/sre_constants.py + +from typing import Dict, List, TypeVar + +MAGIC: int +MAXREPEAT: int + +class error(Exception): ... + +FAILURE: str +SUCCESS: str +ANY: str +ANY_ALL: str +ASSERT: str +ASSERT_NOT: str +AT: str +BIGCHARSET: str +BRANCH: str +CALL: str +CATEGORY: str +CHARSET: str +GROUPREF: str +GROUPREF_IGNORE: str +GROUPREF_EXISTS: str +IN: str +IN_IGNORE: str +INFO: str +JUMP: str +LITERAL: str +LITERAL_IGNORE: str +MARK: str +MAX_REPEAT: str +MAX_UNTIL: str +MIN_REPEAT: str +MIN_UNTIL: str +NEGATE: str +NOT_LITERAL: str +NOT_LITERAL_IGNORE: str +RANGE: str +REPEAT: str +REPEAT_ONE: str +SUBPATTERN: str +MIN_REPEAT_ONE: str +AT_BEGINNING: str +AT_BEGINNING_LINE: str +AT_BEGINNING_STRING: str +AT_BOUNDARY: str +AT_NON_BOUNDARY: str +AT_END: str +AT_END_LINE: str +AT_END_STRING: str +AT_LOC_BOUNDARY: str +AT_LOC_NON_BOUNDARY: str +AT_UNI_BOUNDARY: str +AT_UNI_NON_BOUNDARY: str +CATEGORY_DIGIT: str +CATEGORY_NOT_DIGIT: str +CATEGORY_SPACE: str +CATEGORY_NOT_SPACE: str +CATEGORY_WORD: str +CATEGORY_NOT_WORD: str +CATEGORY_LINEBREAK: str +CATEGORY_NOT_LINEBREAK: str +CATEGORY_LOC_WORD: str +CATEGORY_LOC_NOT_WORD: str +CATEGORY_UNI_DIGIT: str +CATEGORY_UNI_NOT_DIGIT: str +CATEGORY_UNI_SPACE: str +CATEGORY_UNI_NOT_SPACE: str +CATEGORY_UNI_WORD: str +CATEGORY_UNI_NOT_WORD: str +CATEGORY_UNI_LINEBREAK: str +CATEGORY_UNI_NOT_LINEBREAK: str + +_T = TypeVar('_T') +def makedict(list: List[_T]) -> Dict[_T, int]: ... + +OP_IGNORE: Dict[str, str] +AT_MULTILINE: Dict[str, str] +AT_LOCALE: Dict[str, str] +AT_UNICODE: Dict[str, str] +CH_LOCALE: Dict[str, str] +CH_UNICODE: Dict[str, str] +SRE_FLAG_TEMPLATE: int +SRE_FLAG_IGNORECASE: int +SRE_FLAG_LOCALE: int +SRE_FLAG_MULTILINE: int +SRE_FLAG_DOTALL: int +SRE_FLAG_UNICODE: int +SRE_FLAG_VERBOSE: int +SRE_FLAG_DEBUG: int +SRE_INFO_PREFIX: int +SRE_INFO_LITERAL: int +SRE_INFO_CHARSET: int diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/sre_parse.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/sre_parse.pyi new file mode 100644 index 0000000..beabb40 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/sre_parse.pyi @@ -0,0 +1,63 @@ +# Source: https://hg.python.org/cpython/file/2.7/Lib/sre_parse.py + +from typing import Any, Dict, Iterable, List, Match, Optional, Pattern as _Pattern, Set, Tuple, Union + +SPECIAL_CHARS: str +REPEAT_CHARS: str +DIGITS: Set +OCTDIGITS: Set +HEXDIGITS: Set +WHITESPACE: Set +ESCAPES: Dict[str, Tuple[str, int]] +CATEGORIES: Dict[str, Union[Tuple[str, str], Tuple[str, List[Tuple[str, str]]]]] +FLAGS: Dict[str, int] + +class Pattern: + flags: int + open: List[int] + groups: int + groupdict: Dict[str, int] + lookbehind: int + def __init__(self) -> None: ... + def opengroup(self, name: str = ...) -> int: ... + def closegroup(self, gid: int) -> None: ... + def checkgroup(self, gid: int) -> bool: ... + + +_OpSubpatternType = Tuple[Optional[int], int, int, SubPattern] +_OpGroupRefExistsType = Tuple[int, SubPattern, SubPattern] +_OpInType = List[Tuple[str, int]] +_OpBranchType = Tuple[None, List[SubPattern]] +_AvType = Union[_OpInType, _OpBranchType, Iterable[SubPattern], _OpGroupRefExistsType, _OpSubpatternType] +_CodeType = Union[str, _AvType] + +class SubPattern: + pattern: str + data: List[_CodeType] + width: Optional[int] + def __init__(self, pattern, data: List[_CodeType] = ...) -> None: ... + def dump(self, level: int = ...) -> None: ... + def __len__(self) -> int: ... + def __delitem__(self, index: Union[int, slice]) -> None: ... + def __getitem__(self, index: Union[int, slice]) -> Union[SubPattern, _CodeType]: ... + def __setitem__(self, index: Union[int, slice], code: _CodeType): ... + def insert(self, index, code: _CodeType) -> None: ... + def append(self, code: _CodeType) -> None: ... + def getwidth(self) -> int: ... + +class Tokenizer: + string: str + index: int + def __init__(self, string: str) -> None: ... + def match(self, char: str, skip: int = ...) -> int: ... + def get(self) -> Optional[str]: ... + def tell(self) -> Tuple[int, Optional[str]]: ... + def seek(self, index: int) -> None: ... + +def isident(char: str) -> bool: ... +def isdigit(char: str) -> bool: ... +def isname(name: str) -> bool: ... +def parse(str: str, flags: int = ..., pattern: Pattern = ...) -> SubPattern: ... +_Template = Tuple[List[Tuple[int, int]], List[Optional[int]]] +def parse_template(source: str, pattern: _Pattern) -> _Template: ... +def expand_template(template: _Template, match: Match) -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/stat.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/stat.pyi new file mode 100644 index 0000000..dd3418d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/stat.pyi @@ -0,0 +1,59 @@ +def S_ISDIR(mode: int) -> bool: ... +def S_ISCHR(mode: int) -> bool: ... +def S_ISBLK(mode: int) -> bool: ... +def S_ISREG(mode: int) -> bool: ... +def S_ISFIFO(mode: int) -> bool: ... +def S_ISLNK(mode: int) -> bool: ... +def S_ISSOCK(mode: int) -> bool: ... + +def S_IMODE(mode: int) -> int: ... +def S_IFMT(mode: int) -> int: ... + +ST_MODE = 0 +ST_INO = 0 +ST_DEV = 0 +ST_NLINK = 0 +ST_UID = 0 +ST_GID = 0 +ST_SIZE = 0 +ST_ATIME = 0 +ST_MTIME = 0 +ST_CTIME = 0 +S_IFSOCK = 0 +S_IFLNK = 0 +S_IFREG = 0 +S_IFBLK = 0 +S_IFDIR = 0 +S_IFCHR = 0 +S_IFIFO = 0 +S_ISUID = 0 +S_ISGID = 0 +S_ISVTX = 0 +S_IRWXU = 0 +S_IRUSR = 0 +S_IWUSR = 0 +S_IXUSR = 0 +S_IRWXG = 0 +S_IRGRP = 0 +S_IWGRP = 0 +S_IXGRP = 0 +S_IRWXO = 0 +S_IROTH = 0 +S_IWOTH = 0 +S_IXOTH = 0 +S_ENFMT = 0 +S_IREAD = 0 +S_IWRITE = 0 +S_IEXEC = 0 +UF_NODUMP = 0 +UF_IMMUTABLE = 0 +UF_APPEND = 0 +UF_OPAQUE = 0 +UF_NOUNLINK = 0 +UF_COMPRESSED = 0 +UF_HIDDEN = 0 +SF_ARCHIVED = 0 +SF_IMMUTABLE = 0 +SF_APPEND = 0 +SF_NOUNLINK = 0 +SF_SNAPSHOT = 0 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/string.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/string.pyi new file mode 100644 index 0000000..624f092 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/string.pyi @@ -0,0 +1,78 @@ +# Stubs for string + +# Based on http://docs.python.org/3.2/library/string.html + +from typing import Any, AnyStr, Iterable, List, Mapping, Optional, overload, Sequence, Text, Tuple, Union + +ascii_letters: str +ascii_lowercase: str +ascii_uppercase: str +digits: str +hexdigits: str +letters: str +lowercase: str +octdigits: str +punctuation: str +printable: str +uppercase: str +whitespace: str + +def capwords(s: AnyStr, sep: AnyStr = ...) -> AnyStr: ... +# TODO: originally named 'from' +def maketrans(_from: str, to: str) -> str: ... +def atof(s: unicode) -> float: ... +def atoi(s: unicode, base: int = ...) -> int: ... +def atol(s: unicode, base: int = ...) -> int: ... +def capitalize(word: AnyStr) -> AnyStr: ... +def find(s: unicode, sub: unicode, start: int = ..., end: int = ...) -> int: ... +def rfind(s: unicode, sub: unicode, start: int = ..., end: int = ...) -> int: ... +def index(s: unicode, sub: unicode, start: int = ..., end: int = ...) -> int: ... +def rindex(s: unicode, sub: unicode, start: int = ..., end: int = ...) -> int: ... +def count(s: unicode, sub: unicode, start: int = ..., end: int = ...) -> int: ... +def lower(s: AnyStr) -> AnyStr: ... +def split(s: AnyStr, sep: AnyStr = ..., maxsplit: int = ...) -> List[AnyStr]: ... +def rsplit(s: AnyStr, sep: AnyStr = ..., maxsplit: int = ...) -> List[AnyStr]: ... +def splitfields(s: AnyStr, sep: AnyStr = ..., maxsplit: int = ...) -> List[AnyStr]: ... +def join(words: Iterable[AnyStr], sep: AnyStr = ...) -> AnyStr: ... +def joinfields(word: Iterable[AnyStr], sep: AnyStr = ...) -> AnyStr: ... +def lstrip(s: AnyStr, chars: AnyStr = ...) -> AnyStr: ... +def rstrip(s: AnyStr, chars: AnyStr = ...) -> AnyStr: ... +def strip(s: AnyStr, chars: AnyStr = ...) -> AnyStr: ... +def swapcase(s: AnyStr) -> AnyStr: ... +def translate(s: str, table: str, deletechars: str = ...) -> str: ... +def upper(s: AnyStr) -> AnyStr: ... +def ljust(s: AnyStr, width: int, fillchar: AnyStr = ...) -> AnyStr: ... +def rjust(s: AnyStr, width: int, fillchar: AnyStr = ...) -> AnyStr: ... +def center(s: AnyStr, width: int, fillchar: AnyStr = ...) -> AnyStr: ... +def zfill(s: AnyStr, width: int) -> AnyStr: ... +def replace(s: AnyStr, old: AnyStr, new: AnyStr, maxreplace: int = ...) -> AnyStr: ... + +class Template: + template: Text + + def __init__(self, template: Text) -> None: ... + @overload + def substitute(self, mapping: Union[Mapping[str, str], Mapping[unicode, str]] = ..., **kwds: str) -> str: ... + @overload + def substitute(self, mapping: Union[Mapping[str, Text], Mapping[unicode, Text]] = ..., **kwds: Text) -> Text: ... + @overload + def safe_substitute(self, mapping: Union[Mapping[str, str], Mapping[unicode, str]] = ..., **kwds: str) -> str: ... + @overload + def safe_substitute(self, mapping: Union[Mapping[str, Text], Mapping[unicode, Text]], **kwds: Text) -> Text: ... + +# TODO(MichalPokorny): This is probably badly and/or loosely typed. +class Formatter(object): + def format(self, format_string: str, *args, **kwargs) -> str: ... + def vformat(self, format_string: str, args: Sequence[Any], + kwargs: Mapping[str, Any]) -> str: ... + def parse(self, format_string: str) -> Iterable[Tuple[str, str, str, str]]: ... + def get_field(self, field_name: str, args: Sequence[Any], + kwargs: Mapping[str, Any]) -> Any: ... + def get_value(self, key: Union[int, str], args: Sequence[Any], + kwargs: Mapping[str, Any]) -> Any: + raise IndexError() + raise KeyError() + def check_unused_args(self, used_args: Sequence[Union[int, str]], args: Sequence[Any], + kwargs: Mapping[str, Any]) -> None: ... + def format_field(self, value: Any, format_spec: str) -> Any: ... + def convert_field(self, value: Any, conversion: str) -> Any: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/stringold.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/stringold.pyi new file mode 100644 index 0000000..ab3e764 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/stringold.pyi @@ -0,0 +1,46 @@ +# Source: https://hg.python.org/cpython/file/2.7/Lib/stringold.py +from typing import AnyStr, Iterable, List, Optional, Type + +whitespace: str +lowercase: str +uppercase: str +letters: str +digits: str +hexdigits: str +octdigits: str +_idmap: str +_idmapL: Optional[List[str]] +index_error = ValueError +atoi_error = ValueError +atof_error = ValueError +atol_error = ValueError + + +def lower(s: AnyStr) -> AnyStr: ... +def upper(s: AnyStr) -> AnyStr: ... +def swapcase(s: AnyStr) -> AnyStr: ... +def strip(s: AnyStr) -> AnyStr: ... +def lstrip(s: AnyStr) -> AnyStr: ... +def rstrip(s: AnyStr) -> AnyStr: ... +def split(s: AnyStr, sep: AnyStr = ..., maxsplit: int = ...) -> List[AnyStr]: ... +def splitfields(s: AnyStr, sep: AnyStr = ..., maxsplit: int = ...) -> List[AnyStr]: ... +def join(words: Iterable[AnyStr], sep: AnyStr = ...) -> AnyStr: ... +def joinfields(words: Iterable[AnyStr], sep: AnyStr = ...) -> AnyStr: ... +def index(s: unicode, sub: unicode, start: int = ..., end: int = ...) -> int: ... +def rindex(s: unicode, sub: unicode, start: int = ..., end: int = ...) -> int: ... +def count(s: unicode, sub: unicode, start: int = ..., end: int = ...) -> int: ... +def find(s: unicode, sub: unicode, start: int = ..., end: int = ...) -> int: ... +def rfind(s: unicode, sub: unicode, start: int = ..., end: int = ...) -> int: ... +def atof(s: unicode) -> float: ... +def atoi(s: unicode, base: int = ...) -> int: ... +def atol(s: unicode, base: int = ...) -> long: ... +def ljust(s: AnyStr, width: int, fillchar: AnyStr = ...) -> AnyStr: ... +def rjust(s: AnyStr, width: int, fillchar: AnyStr = ...) -> AnyStr: ... +def center(s: AnyStr, width: int, fillchar: AnyStr = ...) -> AnyStr: ... +def zfill(s: AnyStr, width: int) -> AnyStr: ... +def expandtabs(s: AnyStr, tabsize: int = ...) -> AnyStr: ... +def translate(s: str, table: str, deletions: str = ...) -> str: ... +def capitalize(s: AnyStr) -> AnyStr: ... +def capwords(s: AnyStr, sep: AnyStr = ...) -> AnyStr: ... +def maketrans(fromstr: str, tostr: str) -> str: ... +def replace(s: AnyStr, old: AnyStr, new: AnyStr, maxreplace: int = ...) -> AnyStr: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/strop.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/strop.pyi new file mode 100644 index 0000000..e1a098f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/strop.pyi @@ -0,0 +1,72 @@ +"""Stub file for the 'strop' module.""" + +from typing import List, Sequence + +lowercase: str +uppercase: str +whitespace: str + +def atof(a: str) -> float: + raise DeprecationWarning() + +def atoi(a: str, base: int = ...) -> int: + raise DeprecationWarning() + +def atol(a: str, base: int = ...) -> long: + raise DeprecationWarning() + +def capitalize(s: str) -> str: + raise DeprecationWarning() + +def count(s: str, sub: str, start: int = ..., end: int = ...) -> int: + raise DeprecationWarning() + +def expandtabs(string: str, tabsize: int = ...) -> str: + raise DeprecationWarning() + raise OverflowError() + +def find(s: str, sub: str, start: int = ..., end: int = ...) -> int: + raise DeprecationWarning() + +def join(list: Sequence[str], sep: str = ...) -> str: + raise DeprecationWarning() + raise OverflowError() + +def joinfields(list: Sequence[str], sep: str = ...) -> str: + raise DeprecationWarning() + raise OverflowError() + +def lower(s: str) -> str: + raise DeprecationWarning() + +def lstrip(s: str) -> str: + raise DeprecationWarning() + +def maketrans(frm: str, to: str) -> str: ... + +def replace(s: str, old: str, new: str, maxsplit: int = ...) -> str: + raise DeprecationWarning() + +def rfind(s: str, sub: str, start: int = ..., end: int = ...) -> int: + raise DeprecationWarning() + +def rstrip(s: str) -> str: + raise DeprecationWarning() + +def split(s: str, sep: str, maxsplit: int = ...) -> List[str]: + raise DeprecationWarning() + +def splitfields(s: str, sep: str, maxsplit: int = ...) -> List[str]: + raise DeprecationWarning() + +def strip(s: str) -> str: + raise DeprecationWarning() + +def swapcase(s: str) -> str: + raise DeprecationWarning() + +def translate(s: str, table: str, deletechars: str = ...) -> str: + raise DeprecationWarning() + +def upper(s: str) -> str: + raise DeprecationWarning() diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/subprocess.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/subprocess.pyi new file mode 100644 index 0000000..b60e89e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/subprocess.pyi @@ -0,0 +1,117 @@ +# Stubs for subprocess + +# Based on http://docs.python.org/2/library/subprocess.html and Python 3 stub + +from typing import Sequence, Any, Mapping, Callable, Tuple, IO, Union, Optional, List, Text + +_FILE = Union[None, int, IO[Any]] +_TXT = Union[bytes, Text] +_CMD = Union[_TXT, Sequence[_TXT]] +_ENV = Union[Mapping[bytes, _TXT], Mapping[Text, _TXT]] + +# Same args as Popen.__init__ +def call(args: _CMD, + bufsize: int = ..., + executable: _TXT = ..., + stdin: _FILE = ..., + stdout: _FILE = ..., + stderr: _FILE = ..., + preexec_fn: Callable[[], Any] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: _TXT = ..., + env: _ENV = ..., + universal_newlines: bool = ..., + startupinfo: Any = ..., + creationflags: int = ...) -> int: ... + +def check_call(args: _CMD, + bufsize: int = ..., + executable: _TXT = ..., + stdin: _FILE = ..., + stdout: _FILE = ..., + stderr: _FILE = ..., + preexec_fn: Callable[[], Any] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: _TXT = ..., + env: _ENV = ..., + universal_newlines: bool = ..., + startupinfo: Any = ..., + creationflags: int = ...) -> int: ... + +# Same args as Popen.__init__ except for stdout +def check_output(args: _CMD, + bufsize: int = ..., + executable: _TXT = ..., + stdin: _FILE = ..., + stderr: _FILE = ..., + preexec_fn: Callable[[], Any] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: _TXT = ..., + env: _ENV = ..., + universal_newlines: bool = ..., + startupinfo: Any = ..., + creationflags: int = ...) -> bytes: ... + +PIPE: int +STDOUT: int + +class CalledProcessError(Exception): + returncode = 0 + # morally: _CMD + cmd: Any + # morally: Optional[bytes] + output: Any + + def __init__(self, + returncode: int, + cmd: _CMD, + output: Optional[bytes] = ...) -> None: ... + +class Popen: + stdin: Optional[IO[Any]] + stdout: Optional[IO[Any]] + stderr: Optional[IO[Any]] + pid = 0 + returncode = 0 + + def __init__(self, + args: _CMD, + bufsize: int = ..., + executable: Optional[_TXT] = ..., + stdin: Optional[_FILE] = ..., + stdout: Optional[_FILE] = ..., + stderr: Optional[_FILE] = ..., + preexec_fn: Optional[Callable[[], Any]] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[_TXT] = ..., + env: Optional[_ENV] = ..., + universal_newlines: bool = ..., + startupinfo: Optional[Any] = ..., + creationflags: int = ...) -> None: ... + + def poll(self) -> int: ... + def wait(self) -> int: ... + # morally: -> Tuple[Optional[bytes], Optional[bytes]] + def communicate(self, input: Optional[_TXT] = ...) -> Tuple[Any, Any]: ... + def send_signal(self, signal: int) -> None: ... + def terminate(self) -> None: ... + def kill(self) -> None: ... + def __enter__(self) -> Popen: ... + def __exit__(self, type, value, traceback) -> bool: ... + +def list2cmdline(seq: Sequence[str]) -> str: ... # undocumented + +# Windows-only: STARTUPINFO etc. + +STD_INPUT_HANDLE: Any +STD_OUTPUT_HANDLE: Any +STD_ERROR_HANDLE: Any +SW_HIDE: Any +STARTF_USESTDHANDLES: Any +STARTF_USESHOWWINDOW: Any +CREATE_NEW_CONSOLE: Any +CREATE_NEW_PROCESS_GROUP: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/symbol.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/symbol.pyi new file mode 100644 index 0000000..55d25a6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/symbol.pyi @@ -0,0 +1,91 @@ +# Stubs for symbol (Python 2) + +from typing import Dict + +single_input: int +file_input: int +eval_input: int +decorator: int +decorators: int +decorated: int +funcdef: int +parameters: int +varargslist: int +fpdef: int +fplist: int +stmt: int +simple_stmt: int +small_stmt: int +expr_stmt: int +augassign: int +print_stmt: int +del_stmt: int +pass_stmt: int +flow_stmt: int +break_stmt: int +continue_stmt: int +return_stmt: int +yield_stmt: int +raise_stmt: int +import_stmt: int +import_name: int +import_from: int +import_as_name: int +dotted_as_name: int +import_as_names: int +dotted_as_names: int +dotted_name: int +global_stmt: int +exec_stmt: int +assert_stmt: int +compound_stmt: int +if_stmt: int +while_stmt: int +for_stmt: int +try_stmt: int +with_stmt: int +with_item: int +except_clause: int +suite: int +testlist_safe: int +old_test: int +old_lambdef: int +test: int +or_test: int +and_test: int +not_test: int +comparison: int +comp_op: int +expr: int +xor_expr: int +and_expr: int +shift_expr: int +arith_expr: int +term: int +factor: int +power: int +atom: int +listmaker: int +testlist_comp: int +lambdef: int +trailer: int +subscriptlist: int +subscript: int +sliceop: int +exprlist: int +testlist: int +dictorsetmaker: int +classdef: int +arglist: int +argument: int +list_iter: int +list_for: int +list_if: int +comp_iter: int +comp_for: int +comp_if: int +testlist1: int +encoding_decl: int +yield_expr: int + +sym_name: Dict[int, str] diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/sys.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/sys.pyi new file mode 100644 index 0000000..e67b263 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/sys.pyi @@ -0,0 +1,138 @@ +"""Stubs for the 'sys' module.""" + +from typing import ( + IO, NoReturn, Union, List, Sequence, Any, Dict, Tuple, BinaryIO, Optional, + Callable, overload, Text, Type, +) +from types import FrameType, ModuleType, TracebackType, ClassType + +# The following type alias are stub-only and do not exist during runtime +_ExcInfo = Tuple[Type[BaseException], BaseException, TracebackType] +_OptExcInfo = Tuple[Optional[Type[BaseException]], Optional[BaseException], Optional[TracebackType]] + +class _flags: + bytes_warning: int + debug: int + division_new: int + division_warning: int + dont_write_bytecode: int + hash_randomization: int + ignore_environment: int + inspect: int + interactive: int + no_site: int + no_user_site: int + optimize: int + py3k_warning: int + tabcheck: int + unicode: int + verbose: int + +class _float_info: + max: float + max_exp: int + max_10_exp: int + min: float + min_exp: int + min_10_exp: int + dig: int + mant_dig: int + epsilon: float + radix: int + rounds: int + +class _version_info(Tuple[int, int, int, str, int]): + major = 0 + minor = 0 + micro = 0 + releaselevel: str + serial = 0 + +_mercurial: Tuple[str, str, str] +api_version: int +argv: List[str] +builtin_module_names: Tuple[str, ...] +byteorder: str +copyright: str +dont_write_bytecode: bool +exec_prefix: str +executable: str +flags: _flags +float_repr_style: str +hexversion: int +long_info: object +maxint: int +maxsize: int +maxunicode: int +modules: Dict[str, Any] +path: List[str] +platform: str +prefix: str +py3kwarning: bool +__stderr__: IO[str] +__stdin__: IO[str] +__stdout__: IO[str] +stderr: IO[str] +stdin: IO[str] +stdout: IO[str] +subversion: Tuple[str, str, str] +version: str +warnoptions: object +float_info: _float_info +version_info: _version_info +ps1: str +ps2: str +last_type: type +last_value: BaseException +last_traceback: TracebackType +# TODO precise types +meta_path: List[Any] +path_hooks: List[Any] +path_importer_cache: Dict[str, Any] +displayhook: Optional[Callable[[int], None]] +excepthook: Optional[Callable[[type, BaseException, TracebackType], None]] +exc_type: Optional[type] +exc_value: Union[BaseException, ClassType] +exc_traceback: TracebackType + +class _WindowsVersionType: + major: Any + minor: Any + build: Any + platform: Any + service_pack: Any + service_pack_major: Any + service_pack_minor: Any + suite_mask: Any + product_type: Any + +def getwindowsversion() -> _WindowsVersionType: ... + +def _clear_type_cache() -> None: ... +def _current_frames() -> Dict[int, FrameType]: ... +def _getframe(depth: int = ...) -> FrameType: ... +def call_tracing(fn: Any, args: Any) -> Any: ... +def __displayhook__(value: int) -> None: ... +def __excepthook__(type_: type, value: BaseException, traceback: TracebackType) -> None: ... +def exc_clear() -> None: + raise DeprecationWarning() +def exc_info() -> _OptExcInfo: ... + +# sys.exit() accepts an optional argument of anything printable +def exit(arg: Any = ...) -> NoReturn: + raise SystemExit() +def getcheckinterval() -> int: ... # deprecated +def getdefaultencoding() -> str: ... +def getdlopenflags() -> int: ... +def getfilesystemencoding() -> str: ... # In practice, never returns None +def getrefcount(arg: Any) -> int: ... +def getrecursionlimit() -> int: ... +def getsizeof(obj: object, default: int = ...) -> int: ... +def getprofile() -> Optional[Any]: ... +def gettrace() -> Optional[Any]: ... +def setcheckinterval(interval: int) -> None: ... # deprecated +def setdlopenflags(n: int) -> None: ... +def setdefaultencoding(encoding: Text) -> None: ... # only exists after reload(sys) +def setprofile(profilefunc: Any) -> None: ... # TODO type +def setrecursionlimit(limit: int) -> None: ... +def settrace(tracefunc: Any) -> None: ... # TODO type diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/tempfile.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/tempfile.pyi new file mode 100644 index 0000000..2dcc1a9 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/tempfile.pyi @@ -0,0 +1,111 @@ +from typing import Any, AnyStr, IO, Iterable, Iterator, List, Optional, overload, Text, Tuple, Union +from thread import LockType +from random import Random + +TMP_MAX: int +tempdir: str +template: str +_name_sequence: Optional[_RandomNameSequence] + +class _RandomNameSequence: + characters: str = ... + mutex: LockType + @property + def rng(self) -> Random: ... + def __iter__(self) -> _RandomNameSequence: ... + def next(self) -> str: ... + # from os.path: + def normcase(self, path: AnyStr) -> AnyStr: ... + +class _TemporaryFileWrapper(IO[str]): + delete: bool + file: IO + name: Any + def __init__(self, file: IO, name: Any, delete: bool = ...) -> None: ... + def __del__(self) -> None: ... + def __enter__(self) -> _TemporaryFileWrapper: ... + def __exit__(self, exc, value, tb) -> bool: ... + def __getattr__(self, name: unicode) -> Any: ... + def close(self) -> None: ... + def unlink(self, path: unicode) -> None: ... + # These methods don't exist directly on this object, but + # are delegated to the underlying IO object through __getattr__. + # We need to add them here so that this class is concrete. + def __iter__(self) -> Iterator[str]: ... + def fileno(self) -> int: ... + def flush(self) -> None: ... + def isatty(self) -> bool: ... + def next(self) -> str: ... + def read(self, n: int = ...) -> str: ... + def readable(self) -> bool: ... + def readline(self, limit: int = ...) -> str: ... + def readlines(self, hint: int = ...) -> List[str]: ... + def seek(self, offset: int, whence: int = ...) -> int: ... + def seekable(self) -> bool: ... + def tell(self) -> int: ... + def truncate(self, size: Optional[int] = ...) -> int: ... + def writable(self) -> bool: ... + def write(self, s: Text) -> int: ... + def writelines(self, lines: Iterable[str]) -> None: ... + + +# TODO text files + +def TemporaryFile( + mode: Union[bytes, unicode] = ..., + bufsize: int = ..., + suffix: Union[bytes, unicode] = ..., + prefix: Union[bytes, unicode] = ..., + dir: Union[bytes, unicode] = ... +) -> _TemporaryFileWrapper: + ... + +def NamedTemporaryFile( + mode: Union[bytes, unicode] = ..., + bufsize: int = ..., + suffix: Union[bytes, unicode] = ..., + prefix: Union[bytes, unicode] = ..., + dir: Union[bytes, unicode] = ..., + delete: bool = ... +) -> _TemporaryFileWrapper: + ... + +def SpooledTemporaryFile( + max_size: int = ..., + mode: Union[bytes, unicode] = ..., + buffering: int = ..., + suffix: Union[bytes, unicode] = ..., + prefix: Union[bytes, unicode] = ..., + dir: Union[bytes, unicode] = ... +) -> _TemporaryFileWrapper: + ... + +class TemporaryDirectory: + name: Any + def __init__(self, + suffix: Union[bytes, unicode] = ..., + prefix: Union[bytes, unicode] = ..., + dir: Union[bytes, unicode] = ...) -> None: ... + def cleanup(self) -> None: ... + def __enter__(self) -> Any: ... # Can be str or unicode + def __exit__(self, type, value, traceback) -> bool: ... + +@overload +def mkstemp() -> Tuple[int, str]: ... +@overload +def mkstemp(suffix: AnyStr = ..., prefix: AnyStr = ..., dir: Optional[AnyStr] = ..., + text: bool = ...) -> Tuple[int, AnyStr]: ... +@overload +def mkdtemp() -> str: ... +@overload +def mkdtemp(suffix: AnyStr = ..., prefix: AnyStr = ..., dir: Optional[AnyStr] = ...) -> AnyStr: ... +@overload +def mktemp() -> str: ... +@overload +def mktemp(suffix: AnyStr = ..., prefix: AnyStr = ..., dir: Optional[AnyStr] = ...) -> AnyStr: ... +def gettempdir() -> str: ... +def gettempprefix() -> str: ... + +def _candidate_tempdir_list() -> List[str]: ... +def _get_candidate_names() -> Optional[_RandomNameSequence]: ... +def _get_default_tempdir() -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/textwrap.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/textwrap.pyi new file mode 100644 index 0000000..60498a6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/textwrap.pyi @@ -0,0 +1,61 @@ +from typing import AnyStr, List, Dict, Pattern + +class TextWrapper(object): + width: int = ... + initial_indent: str = ... + subsequent_indent: str = ... + expand_tabs: bool = ... + replace_whitespace: bool = ... + fix_sentence_endings: bool = ... + drop_whitespace: bool = ... + break_long_words: bool = ... + break_on_hyphens: bool = ... + + # Attributes not present in documentation + sentence_end_re: Pattern[str] = ... + wordsep_re: Pattern[str] = ... + wordsep_simple_re: Pattern[str] = ... + whitespace_trans: str = ... + unicode_whitespace_trans: Dict[int, int] = ... + uspace: int = ... + x: int = ... + + def __init__( + self, + width: int = ..., + initial_indent: str = ..., + subsequent_indent: str = ..., + expand_tabs: bool = ..., + replace_whitespace: bool = ..., + fix_sentence_endings: bool = ..., + break_long_words: bool = ..., + drop_whitespace: bool = ..., + break_on_hyphens: bool = ...) -> None: + ... + + def wrap(self, text: AnyStr) -> List[AnyStr]: ... + def fill(self, text: AnyStr) -> AnyStr: ... + +def wrap(text: AnyStr, + width: int = ..., + initial_indent: AnyStr = ..., + subsequent_indent: AnyStr = ..., + expand_tabs: bool = ..., + replace_whitespace: bool = ..., + fix_sentence_endings: bool = ..., + break_long_words: bool = ..., + drop_whitespace: bool = ..., + break_on_hyphens: bool = ...) -> List[AnyStr]: ... + +def fill(text: AnyStr, + width: int = ..., + initial_indent: AnyStr = ..., + subsequent_indent: AnyStr = ..., + expand_tabs: bool = ..., + replace_whitespace: bool = ..., + fix_sentence_endings: bool = ..., + break_long_words: bool = ..., + drop_whitespace: bool = ..., + break_on_hyphens: bool = ...) -> AnyStr: ... + +def dedent(text: AnyStr) -> AnyStr: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/thread.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/thread.pyi new file mode 100644 index 0000000..eb4e6d6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/thread.pyi @@ -0,0 +1,30 @@ +"""Stubs for the "thread" module.""" +from typing import Callable, Any + +def _count() -> int: ... + +class error(Exception): ... + +class LockType: + def acquire(self, waitflag: int = ...) -> bool: ... + def acquire_lock(self, waitflag: int = ...) -> bool: ... + def release(self) -> None: ... + def release_lock(self) -> None: ... + def locked(self) -> bool: ... + def locked_lock(self) -> bool: ... + def __enter__(self) -> LockType: ... + def __exit__(self, typ: Any, value: Any, traceback: Any) -> None: ... + +class _local(object): ... +class _localdummy(object): ... + +def start_new(function: Callable[..., Any], args: Any, kwargs: Any = ...) -> int: ... +def start_new_thread(function: Callable[..., Any], args: Any, kwargs: Any = ...) -> int: ... +def interrupt_main() -> None: ... +def exit() -> None: + raise SystemExit() +def exit_thread() -> Any: + raise SystemExit() +def allocate_lock() -> LockType: ... +def get_ident() -> int: ... +def stack_size(size: int = ...) -> int: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/toaiff.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/toaiff.pyi new file mode 100644 index 0000000..77334c7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/toaiff.pyi @@ -0,0 +1,16 @@ +# Stubs for toaiff (Python 2) + +# Source: https://hg.python.org/cpython/file/2.7/Lib/toaiff.py +from pipes import Template +from typing import Dict, List + + +__all__: List[str] +table: Dict[str, Template] +t: Template +uncompress: Template + +class error(Exception): ... + +def toaiff(filename: str) -> str: ... +def _toaiff(filename: str, temps: List[str]) -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/tokenize.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/tokenize.pyi new file mode 100644 index 0000000..43457b6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/tokenize.pyi @@ -0,0 +1,136 @@ +# Automatically generated by pytype, manually fixed up. May still contain errors. + +from typing import Any, Callable, Dict, Generator, Iterator, List, Tuple, Union, Iterable + +__author__: str +__credits__: str + +AMPER: int +AMPEREQUAL: int +AT: int +BACKQUOTE: int +Binnumber: str +Bracket: str +CIRCUMFLEX: int +CIRCUMFLEXEQUAL: int +COLON: int +COMMA: int +COMMENT: int +Comment: str +ContStr: str +DEDENT: int +DOT: int +DOUBLESLASH: int +DOUBLESLASHEQUAL: int +DOUBLESTAR: int +DOUBLESTAREQUAL: int +Decnumber: str +Double: str +Double3: str +ENDMARKER: int +EQEQUAL: int +EQUAL: int +ERRORTOKEN: int +Expfloat: str +Exponent: str +Floatnumber: str +Funny: str +GREATER: int +GREATEREQUAL: int +Hexnumber: str +INDENT: int + +def ISEOF(x: int) -> bool: ... +def ISNONTERMINAL(x: int) -> bool: ... +def ISTERMINAL(x: int) -> bool: ... + +Ignore: str +Imagnumber: str +Intnumber: str +LBRACE: int +LEFTSHIFT: int +LEFTSHIFTEQUAL: int +LESS: int +LESSEQUAL: int +LPAR: int +LSQB: int +MINEQUAL: int +MINUS: int +NAME: int +NEWLINE: int +NL: int +NOTEQUAL: int +NT_OFFSET: int +NUMBER: int +N_TOKENS: int +Name: str +Number: str +OP: int +Octnumber: str +Operator: str +PERCENT: int +PERCENTEQUAL: int +PLUS: int +PLUSEQUAL: int +PlainToken: str +Pointfloat: str +PseudoExtras: str +PseudoToken: str +RBRACE: int +RIGHTSHIFT: int +RIGHTSHIFTEQUAL: int +RPAR: int +RSQB: int +SEMI: int +SLASH: int +SLASHEQUAL: int +STAR: int +STAREQUAL: int +STRING: int +Single: str +Single3: str +Special: str +String: str +TILDE: int +Token: str +Triple: str +VBAR: int +VBAREQUAL: int +Whitespace: str +chain: type +double3prog: type +endprogs: Dict[str, Any] +pseudoprog: type +single3prog: type +single_quoted: Dict[str, str] +t: str +tabsize: int +tok_name: Dict[int, str] +tokenprog: type +triple_quoted: Dict[str, str] +x: str + +_Pos = Tuple[int, int] +_TokenType = Tuple[int, str, _Pos, _Pos, str] + +def any(*args, **kwargs) -> str: ... +def generate_tokens(readline: Callable[[], str]) -> Generator[_TokenType, None, None]: ... +def group(*args: str) -> str: ... +def maybe(*args: str) -> str: ... +def printtoken(type: int, token: str, srow_scol: _Pos, erow_ecol: _Pos, line: str) -> None: ... +def tokenize(readline: Callable[[], str], tokeneater: Callable[[Tuple[int, str, _Pos, _Pos, str]], None]) -> None: ... +def tokenize_loop(readline: Callable[[], str], tokeneater: Callable[[Tuple[int, str, _Pos, _Pos, str]], None]) -> None: ... +def untokenize(iterable: Iterable[_TokenType]) -> str: ... + +class StopTokenizing(Exception): ... + +class TokenError(Exception): ... + +class Untokenizer: + prev_col: int + prev_row: int + tokens: List[str] + def __init__(self) -> None: ... + def add_whitespace(self, _Pos) -> None: ... + def compat(self, token: Tuple[int, Any], iterable: Iterator[_TokenType]) -> None: ... + def untokenize(self, iterable: Iterable[_TokenType]) -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/types.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/types.pyi new file mode 100644 index 0000000..5984706 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/types.pyi @@ -0,0 +1,168 @@ +# Stubs for types +# Note, all classes "defined" here require special handling. + +from typing import ( + Any, Callable, Dict, Iterable, Iterator, List, Optional, + Tuple, Type, TypeVar, Union, overload, +) + +_T = TypeVar('_T') + +class NoneType: ... +TypeType = type +ObjectType = object + +IntType = int +LongType = int # Really long, but can't reference that due to a mypy import cycle +FloatType = float +BooleanType = bool +ComplexType = complex +StringType = str +UnicodeType = unicode +StringTypes: Tuple[Type[StringType], Type[UnicodeType]] +BufferType = buffer +TupleType = tuple +ListType = list +DictType = dict +DictionaryType = dict + +class _Cell: + cell_contents: Any + +class FunctionType: + func_closure: Optional[Tuple[_Cell, ...]] = ... + func_code: CodeType = ... + func_defaults: Optional[Tuple[Any, ...]] = ... + func_dict: Dict[str, Any] = ... + func_doc: Optional[str] = ... + func_globals: Dict[str, Any] = ... + func_name: str = ... + __closure__ = func_closure + __code__ = func_code + __defaults__ = func_defaults + __dict__ = func_dict + __globals__ = func_globals + __name__ = func_name + def __init__(self, code: CodeType, globals: Dict[str, Any], name: Optional[str] = ..., argdefs: Optional[Tuple[object, ...]] = ..., closure: Optional[Tuple[_Cell, ...]] = ...) -> None: ... + def __call__(self, *args: Any, **kwargs: Any) -> Any: ... + def __get__(self, obj: Optional[object], type: Optional[type]) -> UnboundMethodType: ... + +LambdaType = FunctionType + +class CodeType: + co_argcount: int + co_cellvars: Tuple[str, ...] + co_code: str + co_consts: Tuple[Any, ...] + co_filename: str + co_firstlineno: int + co_flags: int + co_freevars: Tuple[str, ...] + co_lnotab: str + co_name: str + co_names: Tuple[str, ...] + co_nlocals: int + co_stacksize: int + co_varnames: Tuple[str, ...] + +class GeneratorType: + gi_code: CodeType + gi_frame: FrameType + gi_running: int + def __iter__(self) -> GeneratorType: ... + def close(self) -> None: ... + def next(self) -> Any: ... + def send(self, arg: Any) -> Any: ... + @overload + def throw(self, val: BaseException) -> Any: ... + @overload + def throw(self, typ: type, val: BaseException = ..., tb: TracebackType = ...) -> Any: ... + +class ClassType: ... +class UnboundMethodType: + im_class: type = ... + im_func: FunctionType = ... + im_self: object = ... + __name__: str + __func__ = im_func + __self__ = im_self + def __init__(self, func: Callable, obj: object) -> None: ... + def __call__(self, *args: Any, **kwargs: Any) -> Any: ... + +class InstanceType(object): ... + +MethodType = UnboundMethodType + +class BuiltinFunctionType: + __self__: Optional[object] + def __call__(self, *args: Any, **kwargs: Any) -> Any: ... +BuiltinMethodType = BuiltinFunctionType + +class ModuleType: + __doc__: Optional[str] + __file__: Optional[str] + __name__: str + __package__: Optional[str] + __path__: Optional[Iterable[str]] + __dict__: Dict[str, Any] + def __init__(self, name: str, doc: Optional[str] = ...) -> None: ... +FileType = file +XRangeType = xrange + +class TracebackType: + tb_frame: FrameType + tb_lasti: int + tb_lineno: int + tb_next: TracebackType + +class FrameType: + f_back: FrameType + f_builtins: Dict[str, Any] + f_code: CodeType + f_exc_type: None + f_exc_value: None + f_exc_traceback: None + f_globals: Dict[str, Any] + f_lasti: int + f_lineno: int + f_locals: Dict[str, Any] + f_restricted: bool + f_trace: Callable[[], None] + + def clear(self) -> None: ... + +SliceType = slice +class EllipsisType: ... + +class DictProxyType: + # TODO is it possible to have non-string keys? + # no __init__ + def copy(self) -> dict: ... + def get(self, key: str, default: _T = ...) -> Union[Any, _T]: ... + def has_key(self, key: str) -> bool: ... + def items(self) -> List[Tuple[str, Any]]: ... + def iteritems(self) -> Iterator[Tuple[str, Any]]: ... + def iterkeys(self) -> Iterator[str]: ... + def itervalues(self) -> Iterator[Any]: ... + def keys(self) -> List[str]: ... + def values(self) -> List[Any]: ... + def __contains__(self, key: str) -> bool: ... + def __getitem__(self, key: str) -> Any: ... + def __iter__(self) -> Iterator[str]: ... + def __len__(self) -> int: ... + +class NotImplementedType: ... + +class GetSetDescriptorType: + __name__: str + __objclass__: type + def __get__(self, obj: Any, type: type = ...) -> Any: ... + def __set__(self, obj: Any) -> None: ... + def __delete__(self, obj: Any) -> None: ... +# Same type on Jython, different on CPython and PyPy, unknown on IronPython. +class MemberDescriptorType: + __name__: str + __objclass__: type + def __get__(self, obj: Any, type: type = ...) -> Any: ... + def __set__(self, obj: Any) -> None: ... + def __delete__(self, obj: Any) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/typing.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/typing.pyi new file mode 100644 index 0000000..6c159b9 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/typing.pyi @@ -0,0 +1,468 @@ +# Stubs for typing (Python 2.7) + +from abc import abstractmethod, ABCMeta +from types import CodeType, FrameType, TracebackType +import collections # Needed by aliases like DefaultDict, see mypy issue 2986 + +# Definitions of special type checking related constructs. Their definitions +# are not used, so their value does not matter. + +overload = object() +Any = object() +TypeVar = object() +_promote = object() +no_type_check = object() + +class _SpecialForm(object): + def __getitem__(self, typeargs: Any) -> object: ... + +Tuple: _SpecialForm = ... +Generic: _SpecialForm = ... +Protocol: _SpecialForm = ... +Callable: _SpecialForm = ... +Type: _SpecialForm = ... +ClassVar: _SpecialForm = ... + +class GenericMeta(type): ... + +# Return type that indicates a function does not return. +# This type is equivalent to the None type, but the no-op Union is necessary to +# distinguish the None type from the None value. +NoReturn = Union[None] + +# Type aliases and type constructors + +class TypeAlias: + # Class for defining generic aliases for library types. + def __init__(self, target_type: type) -> None: ... + def __getitem__(self, typeargs: Any) -> Any: ... + +Union = TypeAlias(object) +Optional = TypeAlias(object) +List = TypeAlias(object) +Dict = TypeAlias(object) +DefaultDict = TypeAlias(object) +Set = TypeAlias(object) +FrozenSet = TypeAlias(object) +Counter = TypeAlias(object) +Deque = TypeAlias(object) + +# Predefined type variables. +AnyStr = TypeVar('AnyStr', str, unicode) + +# Abstract base classes. + +# These type variables are used by the container types. +_T = TypeVar('_T') +_S = TypeVar('_S') +_KT = TypeVar('_KT') # Key type. +_VT = TypeVar('_VT') # Value type. +_T_co = TypeVar('_T_co', covariant=True) # Any type covariant containers. +_V_co = TypeVar('_V_co', covariant=True) # Any type covariant containers. +_KT_co = TypeVar('_KT_co', covariant=True) # Key type covariant containers. +_VT_co = TypeVar('_VT_co', covariant=True) # Value type covariant containers. +_T_contra = TypeVar('_T_contra', contravariant=True) # Ditto contravariant. +_TC = TypeVar('_TC', bound=Type[object]) +_C = TypeVar("_C", bound=Callable) + +def runtime(cls: _TC) -> _TC: ... + +@runtime +class SupportsInt(Protocol, metaclass=ABCMeta): + @abstractmethod + def __int__(self) -> int: ... + +@runtime +class SupportsFloat(Protocol, metaclass=ABCMeta): + @abstractmethod + def __float__(self) -> float: ... + +@runtime +class SupportsComplex(Protocol, metaclass=ABCMeta): + @abstractmethod + def __complex__(self) -> complex: ... + +@runtime +class SupportsAbs(Protocol[_T_co]): + @abstractmethod + def __abs__(self) -> _T_co: ... + +@runtime +class Reversible(Protocol[_T_co]): + @abstractmethod + def __reversed__(self) -> Iterator[_T_co]: ... + +@runtime +class Sized(Protocol, metaclass=ABCMeta): + @abstractmethod + def __len__(self) -> int: ... + +@runtime +class Hashable(Protocol, metaclass=ABCMeta): + # TODO: This is special, in that a subclass of a hashable class may not be hashable + # (for example, list vs. object). It's not obvious how to represent this. This class + # is currently mostly useless for static checking. + @abstractmethod + def __hash__(self) -> int: ... + +@runtime +class Iterable(Protocol[_T_co]): + @abstractmethod + def __iter__(self) -> Iterator[_T_co]: ... + +@runtime +class Iterator(Iterable[_T_co], Protocol[_T_co]): + @abstractmethod + def next(self) -> _T_co: ... + def __iter__(self) -> Iterator[_T_co]: ... + +class Generator(Iterator[_T_co], Generic[_T_co, _T_contra, _V_co]): + @abstractmethod + def next(self) -> _T_co: ... + + @abstractmethod + def send(self, value: _T_contra) -> _T_co: ... + + @abstractmethod + def throw(self, typ: Type[BaseException], val: Optional[BaseException] = ..., + tb: TracebackType = ...) -> _T_co: ... + @abstractmethod + def close(self) -> None: ... + @property + def gi_code(self) -> CodeType: ... + @property + def gi_frame(self) -> FrameType: ... + @property + def gi_running(self) -> bool: ... + +@runtime +class Container(Protocol[_T_co]): + @abstractmethod + def __contains__(self, x: object) -> bool: ... + +class Sequence(Iterable[_T_co], Container[_T_co], Reversible[_T_co], Generic[_T_co]): + @overload + @abstractmethod + def __getitem__(self, i: int) -> _T_co: ... + @overload + @abstractmethod + def __getitem__(self, s: slice) -> Sequence[_T_co]: ... + # Mixin methods + def index(self, x: Any) -> int: ... + def count(self, x: Any) -> int: ... + def __contains__(self, x: object) -> bool: ... + def __iter__(self) -> Iterator[_T_co]: ... + def __reversed__(self) -> Iterator[_T_co]: ... + # Implement Sized (but don't have it as a base class). + @abstractmethod + def __len__(self) -> int: ... + +class MutableSequence(Sequence[_T], Generic[_T]): + @abstractmethod + def insert(self, index: int, object: _T) -> None: ... + @overload + @abstractmethod + def __getitem__(self, i: int) -> _T: ... + @overload + @abstractmethod + def __getitem__(self, s: slice) -> MutableSequence[_T]: ... + @overload + @abstractmethod + def __setitem__(self, i: int, o: _T) -> None: ... + @overload + @abstractmethod + def __setitem__(self, s: slice, o: Iterable[_T]) -> None: ... + @overload + @abstractmethod + def __delitem__(self, i: int) -> None: ... + @overload + @abstractmethod + def __delitem__(self, i: slice) -> None: ... + # Mixin methods + def append(self, object: _T) -> None: ... + def extend(self, iterable: Iterable[_T]) -> None: ... + def reverse(self) -> None: ... + def pop(self, index: int = ...) -> _T: ... + def remove(self, object: _T) -> None: ... + def __iadd__(self, x: Iterable[_T]) -> MutableSequence[_T]: ... + +class AbstractSet(Iterable[_T_co], Container[_T_co], Generic[_T_co]): + @abstractmethod + def __contains__(self, x: object) -> bool: ... + # Mixin methods + def __le__(self, s: AbstractSet[Any]) -> bool: ... + def __lt__(self, s: AbstractSet[Any]) -> bool: ... + def __gt__(self, s: AbstractSet[Any]) -> bool: ... + def __ge__(self, s: AbstractSet[Any]) -> bool: ... + def __and__(self, s: AbstractSet[Any]) -> AbstractSet[_T_co]: ... + def __or__(self, s: AbstractSet[_T]) -> AbstractSet[Union[_T_co, _T]]: ... + def __sub__(self, s: AbstractSet[Any]) -> AbstractSet[_T_co]: ... + def __xor__(self, s: AbstractSet[_T]) -> AbstractSet[Union[_T_co, _T]]: ... + # TODO: argument can be any container? + def isdisjoint(self, s: AbstractSet[Any]) -> bool: ... + # Implement Sized (but don't have it as a base class). + @abstractmethod + def __len__(self) -> int: ... + + +class MutableSet(AbstractSet[_T], Generic[_T]): + @abstractmethod + def add(self, x: _T) -> None: ... + @abstractmethod + def discard(self, x: _T) -> None: ... + # Mixin methods + def clear(self) -> None: ... + def pop(self) -> _T: ... + def remove(self, element: _T) -> None: ... + def __ior__(self, s: AbstractSet[_S]) -> MutableSet[Union[_T, _S]]: ... + def __iand__(self, s: AbstractSet[Any]) -> MutableSet[_T]: ... + def __ixor__(self, s: AbstractSet[_S]) -> MutableSet[Union[_T, _S]]: ... + def __isub__(self, s: AbstractSet[Any]) -> MutableSet[_T]: ... + +class MappingView(object): + def __len__(self) -> int: ... + +class ItemsView(MappingView, AbstractSet[Tuple[_KT_co, _VT_co]], Generic[_KT_co, _VT_co]): + def __contains__(self, o: object) -> bool: ... + def __iter__(self) -> Iterator[Tuple[_KT_co, _VT_co]]: ... + +class KeysView(MappingView, AbstractSet[_KT_co], Generic[_KT_co]): + def __contains__(self, o: object) -> bool: ... + def __iter__(self) -> Iterator[_KT_co]: ... + +class ValuesView(MappingView, Iterable[_VT_co], Generic[_VT_co]): + def __contains__(self, o: object) -> bool: ... + def __iter__(self) -> Iterator[_VT_co]: ... + +@runtime +class ContextManager(Protocol[_T_co]): + def __enter__(self) -> _T_co: ... + def __exit__(self, __exc_type: Optional[Type[BaseException]], + __exc_value: Optional[BaseException], + __traceback: Optional[TracebackType]) -> Optional[bool]: ... + +class Mapping(Iterable[_KT], Container[_KT], Generic[_KT, _VT_co]): + # TODO: We wish the key type could also be covariant, but that doesn't work, + # see discussion in https: //github.com/python/typing/pull/273. + @abstractmethod + def __getitem__(self, k: _KT) -> _VT_co: + ... + # Mixin methods + @overload + def get(self, k: _KT) -> Optional[_VT_co]: ... + @overload + def get(self, k: _KT, default: Union[_VT_co, _T]) -> Union[_VT_co, _T]: ... + def keys(self) -> list[_KT]: ... + def values(self) -> list[_VT_co]: ... + def items(self) -> list[Tuple[_KT, _VT_co]]: ... + def iterkeys(self) -> Iterator[_KT]: ... + def itervalues(self) -> Iterator[_VT_co]: ... + def iteritems(self) -> Iterator[Tuple[_KT, _VT_co]]: ... + def __contains__(self, o: object) -> bool: ... + # Implement Sized (but don't have it as a base class). + @abstractmethod + def __len__(self) -> int: ... + +class MutableMapping(Mapping[_KT, _VT], Generic[_KT, _VT]): + @abstractmethod + def __setitem__(self, k: _KT, v: _VT) -> None: ... + @abstractmethod + def __delitem__(self, v: _KT) -> None: ... + + def clear(self) -> None: ... + @overload + def pop(self, k: _KT) -> _VT: ... + @overload + def pop(self, k: _KT, default: Union[_VT, _T] = ...) -> Union[_VT, _T]: ... + def popitem(self) -> Tuple[_KT, _VT]: ... + def setdefault(self, k: _KT, default: _VT = ...) -> _VT: ... + @overload + def update(self, __m: Mapping[_KT, _VT], **kwargs: _VT) -> None: ... + @overload + def update(self, __m: Iterable[Tuple[_KT, _VT]], **kwargs: _VT) -> None: ... + @overload + def update(self, **kwargs: _VT) -> None: ... + +Text = unicode + +TYPE_CHECKING = True + +class IO(Iterator[AnyStr], Generic[AnyStr]): + # TODO detach + # TODO use abstract properties + @property + def mode(self) -> str: ... + @property + def name(self) -> str: ... + @abstractmethod + def close(self) -> None: ... + @property + def closed(self) -> bool: ... + @abstractmethod + def fileno(self) -> int: ... + @abstractmethod + def flush(self) -> None: ... + @abstractmethod + def isatty(self) -> bool: ... + # TODO what if n is None? + @abstractmethod + def read(self, n: int = ...) -> AnyStr: ... + @abstractmethod + def readable(self) -> bool: ... + @abstractmethod + def readline(self, limit: int = ...) -> AnyStr: ... + @abstractmethod + def readlines(self, hint: int = ...) -> list[AnyStr]: ... + @abstractmethod + def seek(self, offset: int, whence: int = ...) -> int: ... + @abstractmethod + def seekable(self) -> bool: ... + @abstractmethod + def tell(self) -> int: ... + @abstractmethod + def truncate(self, size: Optional[int] = ...) -> int: ... + @abstractmethod + def writable(self) -> bool: ... + # TODO buffer objects + @abstractmethod + def write(self, s: AnyStr) -> int: ... + @abstractmethod + def writelines(self, lines: Iterable[AnyStr]) -> None: ... + + @abstractmethod + def next(self) -> AnyStr: ... + @abstractmethod + def __iter__(self) -> Iterator[AnyStr]: ... + @abstractmethod + def __enter__(self) -> IO[AnyStr]: ... + @abstractmethod + def __exit__(self, t: Optional[Type[BaseException]], value: Optional[BaseException], + traceback: Optional[TracebackType]) -> bool: ... + +class BinaryIO(IO[str]): + # TODO readinto + # TODO read1? + # TODO peek? + @abstractmethod + def __enter__(self) -> BinaryIO: ... + +class TextIO(IO[unicode]): + # TODO use abstractproperty + @property + def buffer(self) -> BinaryIO: ... + @property + def encoding(self) -> str: ... + @property + def errors(self) -> Optional[str]: ... + @property + def line_buffering(self) -> bool: ... + @property + def newlines(self) -> Any: ... # None, str or tuple + @abstractmethod + def __enter__(self) -> TextIO: ... + +class ByteString(Sequence[int], metaclass=ABCMeta): ... + +class Match(Generic[AnyStr]): + pos: int + endpos: int + lastindex: Optional[int] + string: AnyStr + + # The regular expression object whose match() or search() method produced + # this match instance. This should not be Pattern[AnyStr] because the type + # of the pattern is independent of the type of the matched string in + # Python 2. Strictly speaking Match should be generic over AnyStr twice: + # once for the type of the pattern and once for the type of the matched + # string. + re: Pattern[Any] + # Can be None if there are no groups or if the last group was unnamed; + # otherwise matches the type of the pattern. + lastgroup: Optional[Any] + + def expand(self, template: Union[str, Text]) -> Any: ... + + @overload + def group(self, group1: int = ...) -> AnyStr: ... + @overload + def group(self, group1: str) -> AnyStr: ... + @overload + def group(self, group1: int, group2: int, + *groups: int) -> Tuple[AnyStr, ...]: ... + @overload + def group(self, group1: str, group2: str, + *groups: str) -> Tuple[AnyStr, ...]: ... + + def groups(self, default: AnyStr = ...) -> Tuple[AnyStr, ...]: ... + def groupdict(self, default: AnyStr = ...) -> Dict[str, AnyStr]: ... + def start(self, group: Union[int, str] = ...) -> int: ... + def end(self, group: Union[int, str] = ...) -> int: ... + def span(self, group: Union[int, str] = ...) -> Tuple[int, int]: ... + +# We need a second TypeVar with the same definition as AnyStr, because +# Pattern is generic over AnyStr (determining the type of its .pattern +# attribute), but at the same time its methods take either bytes or +# Text and return the same type, regardless of the type of the pattern. +_AnyStr2 = TypeVar('_AnyStr2', bytes, Text) + +class Pattern(Generic[AnyStr]): + flags: int + groupindex: Dict[AnyStr, int] + groups: int + pattern: AnyStr + + def search(self, string: _AnyStr2, pos: int = ..., + endpos: int = ...) -> Optional[Match[_AnyStr2]]: ... + def match(self, string: _AnyStr2, pos: int = ..., + endpos: int = ...) -> Optional[Match[_AnyStr2]]: ... + def split(self, string: _AnyStr2, maxsplit: int = ...) -> List[_AnyStr2]: ... + # Returns either a list of _AnyStr2 or a list of tuples, depending on + # whether there are groups in the pattern. + def findall(self, string: Union[bytes, Text], pos: int = ..., + endpos: int = ...) -> List[Any]: ... + def finditer(self, string: _AnyStr2, pos: int = ..., + endpos: int = ...) -> Iterator[Match[_AnyStr2]]: ... + + @overload + def sub(self, repl: _AnyStr2, string: _AnyStr2, + count: int = ...) -> _AnyStr2: ... + @overload + def sub(self, repl: Callable[[Match[_AnyStr2]], _AnyStr2], string: _AnyStr2, + count: int = ...) -> _AnyStr2: ... + + @overload + def subn(self, repl: _AnyStr2, string: _AnyStr2, + count: int = ...) -> Tuple[_AnyStr2, int]: ... + @overload + def subn(self, repl: Callable[[Match[_AnyStr2]], _AnyStr2], string: _AnyStr2, + count: int = ...) -> Tuple[_AnyStr2, int]: ... + +# Functions + +def get_type_hints(obj: Callable, globalns: Optional[dict[Text, Any]] = ..., + localns: Optional[dict[Text, Any]] = ...) -> None: ... + +@overload +def cast(tp: Type[_T], obj: Any) -> _T: ... +@overload +def cast(tp: str, obj: Any) -> Any: ... + +# Type constructors + +# NamedTuple is special-cased in the type checker +class NamedTuple(tuple): + _fields: Tuple[str, ...] + + def __init__(self, typename: Text, fields: Iterable[Tuple[Text, Any]] = ..., *, + verbose: bool = ..., rename: bool = ..., **kwargs: Any) -> None: ... + + @classmethod + def _make(cls: Type[_T], iterable: Iterable[Any]) -> _T: ... + + def _asdict(self) -> dict: ... + def _replace(self: _T, **kwargs: Any) -> _T: ... + +def NewType(name: str, tp: Type[_T]) -> Type[_T]: ... + +# This itself is only available during type checking +def type_check_only(func_or_cls: _C) -> _C: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/unittest.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/unittest.pyi new file mode 100644 index 0000000..d8d499a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/unittest.pyi @@ -0,0 +1,262 @@ +# Stubs for unittest + +# Based on http://docs.python.org/2.7/library/unittest.html + +from typing import (Any, Callable, Dict, FrozenSet, Iterable, Iterator, + List, NoReturn, Optional, overload, Pattern, Sequence, Set, + Text, TextIO, Tuple, Type, TypeVar, Union) +from abc import abstractmethod, ABCMeta +import types + +_T = TypeVar('_T') +_FT = TypeVar('_FT') + +_ExceptionType = Union[Type[BaseException], Tuple[Type[BaseException], ...]] +_Regexp = Union[Text, Pattern[Text]] + +class Testable(metaclass=ABCMeta): + @abstractmethod + def run(self, result: TestResult) -> None: ... + @abstractmethod + def debug(self) -> None: ... + @abstractmethod + def countTestCases(self) -> int: ... + +# TODO ABC for test runners? + +class TestResult: + errors: List[Tuple[Testable, str]] + failures: List[Tuple[Testable, str]] + skipped: List[Tuple[Testable, str]] + expectedFailures: List[Tuple[Testable, str]] + unexpectedSuccesses: List[Testable] + shouldStop: bool + testsRun: int + buffer: bool + failfast: bool + + def wasSuccessful(self) -> bool: ... + def stop(self) -> None: ... + def startTest(self, test: Testable) -> None: ... + def stopTest(self, test: Testable) -> None: ... + def startTestRun(self) -> None: ... + def stopTestRun(self) -> None: ... + def addError(self, test: Testable, err: Tuple[type, Any, Any]) -> None: ... # TODO + def addFailure(self, test: Testable, err: Tuple[type, Any, Any]) -> None: ... # TODO + def addSuccess(self, test: Testable) -> None: ... + def addSkip(self, test: Testable, reason: str) -> None: ... + def addExpectedFailure(self, test: Testable, err: str) -> None: ... + def addUnexpectedSuccess(self, test: Testable) -> None: ... + +class _AssertRaisesBaseContext: + expected: Any + failureException: Type[BaseException] + obj_name: str + expected_regex: Pattern[str] + +class _AssertRaisesContext(_AssertRaisesBaseContext): + exception: Any + def __enter__(self) -> _AssertRaisesContext: ... + def __exit__(self, exc_type, exc_value, tb) -> bool: ... + +class TestCase(Testable): + failureException: Type[BaseException] + longMessage: bool + maxDiff: Optional[int] + # undocumented + _testMethodName: str + def __init__(self, methodName: str = ...) -> None: ... + def setUp(self) -> None: ... + def tearDown(self) -> None: ... + @classmethod + def setUpClass(cls) -> None: ... + @classmethod + def tearDownClass(cls) -> None: ... + def run(self, result: TestResult = ...) -> None: ... + def debug(self) -> None: ... + def assert_(self, expr: Any, msg: object = ...) -> None: ... + def failUnless(self, expr: Any, msg: object = ...) -> None: ... + def assertTrue(self, expr: Any, msg: object = ...) -> None: ... + def assertEqual(self, first: Any, second: Any, + msg: object = ...) -> None: ... + def assertEquals(self, first: Any, second: Any, + msg: object = ...) -> None: ... + def failUnlessEqual(self, first: Any, second: Any, + msg: object = ...) -> None: ... + def assertNotEqual(self, first: Any, second: Any, + msg: object = ...) -> None: ... + def assertNotEquals(self, first: Any, second: Any, + msg: object = ...) -> None: ... + def failIfEqual(self, first: Any, second: Any, + msg: object = ...) -> None: ... + @overload + def assertAlmostEqual(self, first: float, second: float, + places: int = ..., msg: Any = ...) -> None: ... + @overload + def assertAlmostEqual(self, first: float, second: float, *, + msg: Any = ..., delta: float = ...) -> None: ... + @overload + def assertAlmostEquals(self, first: float, second: float, + places: int = ..., msg: Any = ...) -> None: ... + @overload + def assertAlmostEquals(self, first: float, second: float, *, + msg: Any = ..., delta: float = ...) -> None: ... + def failUnlessAlmostEqual(self, first: float, second: float, places: int = ..., + msg: object = ...) -> None: ... + @overload + def assertNotAlmostEqual(self, first: float, second: float, + places: int = ..., msg: Any = ...) -> None: ... + @overload + def assertNotAlmostEqual(self, first: float, second: float, *, + msg: Any = ..., delta: float = ...) -> None: ... + @overload + def assertNotAlmostEquals(self, first: float, second: float, + places: int = ..., msg: Any = ...) -> None: ... + @overload + def assertNotAlmostEquals(self, first: float, second: float, *, + msg: Any = ..., delta: float = ...) -> None: ... + def failIfAlmostEqual(self, first: float, second: float, places: int = ..., + msg: object = ..., + delta: float = ...) -> None: ... + def assertGreater(self, first: Any, second: Any, + msg: object = ...) -> None: ... + def assertGreaterEqual(self, first: Any, second: Any, + msg: object = ...) -> None: ... + def assertMultiLineEqual(self, first: str, second: str, + msg: object = ...) -> None: ... + def assertSequenceEqual(self, first: Sequence[Any], second: Sequence[Any], + msg: object = ..., seq_type: type = ...) -> None: ... + def assertListEqual(self, first: List[Any], second: List[Any], + msg: object = ...) -> None: ... + def assertTupleEqual(self, first: Tuple[Any, ...], second: Tuple[Any, ...], + msg: object = ...) -> None: ... + def assertSetEqual(self, first: Union[Set[Any], FrozenSet[Any]], + second: Union[Set[Any], FrozenSet[Any]], msg: object = ...) -> None: ... + def assertDictEqual(self, first: Dict[Any, Any], second: Dict[Any, Any], + msg: object = ...) -> None: ... + def assertLess(self, first: Any, second: Any, + msg: object = ...) -> None: ... + def assertLessEqual(self, first: Any, second: Any, + msg: object = ...) -> None: ... + @overload + def assertRaises(self, exception: _ExceptionType, callable: Callable[..., Any], *args: Any, **kwargs: Any) -> None: ... + @overload + def assertRaises(self, exception: _ExceptionType) -> _AssertRaisesContext: ... + @overload + def assertRaisesRegexp(self, exception: _ExceptionType, regexp: _Regexp, callable: Callable[..., Any], *args: Any, **kwargs: Any) -> None: ... + @overload + def assertRaisesRegexp(self, exception: _ExceptionType, regexp: _Regexp) -> _AssertRaisesContext: ... + def assertRegexpMatches(self, text: Text, regexp: _Regexp, msg: object = ...) -> None: ... + def assertNotRegexpMatches(self, text: Text, regexp: _Regexp, msg: object = ...) -> None: ... + def assertItemsEqual(self, first: Iterable[Any], second: Iterable[Any], msg: object = ...) -> None: ... + def assertDictContainsSubset(self, expected: Dict[Any, Any], actual: Dict[Any, Any], msg: object = ...) -> None: ... + def addTypeEqualityFunc(self, typeobj: type, function: Callable[..., None]) -> None: ... + @overload + def failUnlessRaises(self, exception: _ExceptionType, callable: Callable[..., Any], *args: Any, **kwargs: Any) -> None: ... + @overload + def failUnlessRaises(self, exception: _ExceptionType) -> _AssertRaisesContext: ... + def failIf(self, expr: Any, msg: object = ...) -> None: ... + def assertFalse(self, expr: Any, msg: object = ...) -> None: ... + def assertIs(self, first: object, second: object, + msg: object = ...) -> None: ... + def assertIsNot(self, first: object, second: object, + msg: object = ...) -> None: ... + def assertIsNone(self, expr: Any, msg: object = ...) -> None: ... + def assertIsNotNone(self, expr: Any, msg: object = ...) -> None: ... + def assertIn(self, first: _T, second: Iterable[_T], + msg: object = ...) -> None: ... + def assertNotIn(self, first: _T, second: Iterable[_T], + msg: object = ...) -> None: ... + def assertIsInstance(self, obj: Any, cls: Union[type, Tuple[type, ...]], + msg: object = ...) -> None: ... + def assertNotIsInstance(self, obj: Any, cls: Union[type, Tuple[type, ...]], + msg: object = ...) -> None: ... + def fail(self, msg: object = ...) -> NoReturn: ... + def countTestCases(self) -> int: ... + def defaultTestResult(self) -> TestResult: ... + def id(self) -> str: ... + def shortDescription(self) -> str: ... # May return None + def addCleanup(self, function: Any, *args: Any, **kwargs: Any) -> None: ... + def doCleanups(self) -> bool: ... + def skipTest(self, reason: Any) -> None: ... + def _formatMessage(self, msg: Optional[Text], standardMsg: Text) -> str: ... # undocumented + def _getAssertEqualityFunc(self, first: Any, second: Any) -> Callable[..., None]: ... # undocumented + +class FunctionTestCase(Testable): + def __init__(self, testFunc: Callable[[], None], + setUp: Optional[Callable[[], None]] = ..., + tearDown: Optional[Callable[[], None]] = ..., + description: Optional[str] = ...) -> None: ... + def run(self, result: TestResult) -> None: ... + def debug(self) -> None: ... + def countTestCases(self) -> int: ... + +class TestSuite(Testable): + def __init__(self, tests: Iterable[Testable] = ...) -> None: ... + def addTest(self, test: Testable) -> None: ... + def addTests(self, tests: Iterable[Testable]) -> None: ... + def run(self, result: TestResult) -> None: ... + def debug(self) -> None: ... + def countTestCases(self) -> int: ... + def __iter__(self) -> Iterator[Testable]: ... + +class TestLoader: + testMethodPrefix: str + sortTestMethodsUsing: Optional[Callable[[str, str], int]] + suiteClass: Callable[[List[TestCase]], TestSuite] + def loadTestsFromTestCase(self, + testCaseClass: Type[TestCase]) -> TestSuite: ... + def loadTestsFromModule(self, module: types.ModuleType = ..., + use_load_tests: bool = ...) -> TestSuite: ... + def loadTestsFromName(self, name: str = ..., + module: Optional[types.ModuleType] = ...) -> TestSuite: ... + def loadTestsFromNames(self, names: List[str] = ..., + module: Optional[types.ModuleType] = ...) -> TestSuite: ... + def discover(self, start_dir: str, pattern: str = ..., + top_level_dir: Optional[str] = ...) -> TestSuite: ... + def getTestCaseNames(self, testCaseClass: Type[TestCase] = ...) -> List[str]: ... + +defaultTestLoader: TestLoader + +class TextTestResult(TestResult): + def __init__(self, stream: TextIO, descriptions: bool, verbosity: int) -> None: ... + +class TextTestRunner: + def __init__(self, stream: Optional[TextIO] = ..., descriptions: bool = ..., + verbosity: int = ..., failfast: bool = ..., buffer: bool = ..., + resultclass: Optional[Type[TestResult]] = ...) -> None: ... + def _makeResult(self) -> TestResult: ... + +class SkipTest(Exception): + ... + +# TODO precise types +def skipUnless(condition: Any, reason: Union[str, unicode]) -> Any: ... +def skipIf(condition: Any, reason: Union[str, unicode]) -> Any: ... +def expectedFailure(func: _FT) -> _FT: ... +def skip(reason: Union[str, unicode]) -> Any: ... + +# not really documented +class TestProgram: + result: TestResult + def runTests(self) -> None: ... # undocumented + +def main(module: Union[None, Text, types.ModuleType] = ..., defaultTest: Optional[str] = ..., + argv: Optional[Sequence[str]] = ..., + testRunner: Union[Type[TextTestRunner], TextTestRunner, None] = ..., + testLoader: TestLoader = ..., exit: bool = ..., verbosity: int = ..., + failfast: Optional[bool] = ..., catchbreak: Optional[bool] = ..., + buffer: Optional[bool] = ...) -> TestProgram: ... + +def load_tests(loader: TestLoader, tests: TestSuite, pattern: Optional[Text]) -> TestSuite: ... + +def installHandler() -> None: ... +def registerResult(result: TestResult) -> None: ... +def removeResult(result: TestResult) -> bool: ... +@overload +def removeHandler() -> None: ... +@overload +def removeHandler(function: Callable[..., Any]) -> Callable[..., Any]: ... + +# private but occasionally used +util: types.ModuleType diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/urllib.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/urllib.pyi new file mode 100644 index 0000000..8b44a06 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/urllib.pyi @@ -0,0 +1,134 @@ +from typing import Any, AnyStr, IO, List, Mapping, Sequence, Text, Tuple, TypeVar, Union + +def url2pathname(pathname: AnyStr) -> AnyStr: ... +def pathname2url(pathname: AnyStr) -> AnyStr: ... +def urlopen(url: str, data=..., proxies: Mapping[str, str] = ..., context=...) -> IO[Any]: ... +def urlretrieve(url, filename=..., reporthook=..., data=..., context=...): ... +def urlcleanup() -> None: ... + +class ContentTooShortError(IOError): + content: Any + def __init__(self, message, content) -> None: ... + +class URLopener: + version: Any + proxies: Any + key_file: Any + cert_file: Any + context: Any + addheaders: Any + tempcache: Any + ftpcache: Any + def __init__(self, proxies: Mapping[str, str] = ..., context=..., **x509) -> None: ... + def __del__(self): ... + def close(self): ... + def cleanup(self): ... + def addheader(self, *args): ... + type: Any + def open(self, fullurl: str, data=...): ... + def open_unknown(self, fullurl, data=...): ... + def open_unknown_proxy(self, proxy, fullurl, data=...): ... + def retrieve(self, url, filename=..., reporthook=..., data=...): ... + def open_http(self, url, data=...): ... + def http_error(self, url, fp, errcode, errmsg, headers, data=...): ... + def http_error_default(self, url, fp, errcode, errmsg, headers): ... + def open_https(self, url, data=...): ... + def open_file(self, url): ... + def open_local_file(self, url): ... + def open_ftp(self, url): ... + def open_data(self, url, data=...): ... + +class FancyURLopener(URLopener): + auth_cache: Any + tries: Any + maxtries: Any + def __init__(self, *args, **kwargs) -> None: ... + def http_error_default(self, url, fp, errcode, errmsg, headers): ... + def http_error_302(self, url, fp, errcode, errmsg, headers, data=...): ... + def redirect_internal(self, url, fp, errcode, errmsg, headers, data): ... + def http_error_301(self, url, fp, errcode, errmsg, headers, data=...): ... + def http_error_303(self, url, fp, errcode, errmsg, headers, data=...): ... + def http_error_307(self, url, fp, errcode, errmsg, headers, data=...): ... + def http_error_401(self, url, fp, errcode, errmsg, headers, data=...): ... + def http_error_407(self, url, fp, errcode, errmsg, headers, data=...): ... + def retry_proxy_http_basic_auth(self, url, realm, data=...): ... + def retry_proxy_https_basic_auth(self, url, realm, data=...): ... + def retry_http_basic_auth(self, url, realm, data=...): ... + def retry_https_basic_auth(self, url, realm, data=...): ... + def get_user_passwd(self, host, realm, clear_cache=...): ... + def prompt_user_passwd(self, host, realm): ... + +class ftpwrapper: + user: Any + passwd: Any + host: Any + port: Any + dirs: Any + timeout: Any + refcount: Any + keepalive: Any + def __init__(self, user, passwd, host, port, dirs, timeout=..., persistent=...) -> None: ... + busy: Any + ftp: Any + def init(self): ... + def retrfile(self, file, type): ... + def endtransfer(self): ... + def close(self): ... + def file_close(self): ... + def real_close(self): ... + +_AIUT = TypeVar("_AIUT", bound=addbase) + +class addbase: + fp: Any + def read(self, n: int = ...) -> bytes: ... + def readline(self, limit: int = ...) -> bytes: ... + def readlines(self, hint: int = ...) -> List[bytes]: ... + def fileno(self) -> int: ... # Optional[int], but that is rare + def __iter__(self: _AIUT) -> _AIUT: ... + def next(self) -> bytes: ... + def __init__(self, fp) -> None: ... + def close(self) -> None: ... + +class addclosehook(addbase): + closehook: Any + hookargs: Any + def __init__(self, fp, closehook, *hookargs) -> None: ... + def close(self): ... + +class addinfo(addbase): + headers: Any + def __init__(self, fp, headers) -> None: ... + def info(self): ... + +class addinfourl(addbase): + headers: Any + url: Any + code: Any + def __init__(self, fp, headers, url, code=...) -> None: ... + def info(self): ... + def getcode(self): ... + def geturl(self): ... + +def unwrap(url): ... +def splittype(url): ... +def splithost(url): ... +def splituser(host): ... +def splitpasswd(user): ... +def splitport(host): ... +def splitnport(host, defport=...): ... +def splitquery(url): ... +def splittag(url): ... +def splitattr(url): ... +def splitvalue(attr): ... +def unquote(s: AnyStr) -> AnyStr: ... +def unquote_plus(s: AnyStr) -> AnyStr: ... +def quote(s: AnyStr, safe: Text = ...) -> AnyStr: ... +def quote_plus(s: AnyStr, safe: Text = ...) -> AnyStr: ... +def urlencode(query: Union[Sequence[Tuple[Any, Any]], Mapping[Any, Any]], doseq=...) -> str: ... + +def getproxies() -> Mapping[str, str]: ... +def proxy_bypass(host): ... + +# Names in __all__ with no definition: +# basejoin diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/urllib2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/urllib2.pyi new file mode 100644 index 0000000..6611ad2 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/urllib2.pyi @@ -0,0 +1,182 @@ + +import ssl +from typing import Any, AnyStr, Dict, List, Union, Optional, Mapping, Callable, Sequence, Text, Tuple, Type +from urllib import addinfourl +from httplib import HTTPConnectionProtocol, HTTPResponse + +_string = Union[str, unicode] + +class URLError(IOError): + reason: Union[str, BaseException] + +class HTTPError(URLError, addinfourl): + code: int + headers: Mapping[str, str] + def __init__(self, url, code: int, msg: str, hdrs: Mapping[str, str], fp: addinfourl) -> None: ... + +class Request(object): + host: str + port: str + data: str + headers: Dict[str, str] + unverifiable: bool + type: Optional[str] + origin_req_host = ... + unredirected_hdrs: Dict[str, str] + + def __init__(self, url: str, data: Optional[str] = ..., headers: Dict[str, str] = ..., + origin_req_host: Optional[str] = ..., unverifiable: bool = ...) -> None: ... + def __getattr__(self, attr): ... + def get_method(self) -> str: ... + def add_data(self, data) -> None: ... + def has_data(self) -> bool: ... + def get_data(self) -> str: ... + def get_full_url(self) -> str: ... + def get_type(self): ... + def get_host(self) -> str: ... + def get_selector(self): ... + def set_proxy(self, host, type) -> None: ... + def has_proxy(self) -> bool: ... + def get_origin_req_host(self) -> str: ... + def is_unverifiable(self) -> bool: ... + def add_header(self, key: str, val: str) -> None: ... + def add_unredirected_header(self, key: str, val: str) -> None: ... + def has_header(self, header_name: str) -> bool: ... + def get_header(self, header_name: str, default: Optional[str] = ...) -> str: ... + def header_items(self): ... + +class OpenerDirector(object): + addheaders: List[Tuple[str, str]] + + def add_handler(self, handler: BaseHandler) -> None: ... + def open(self, fullurl: Union[Request, _string], data: Optional[_string] = ..., timeout: Optional[float] = ...) -> Optional[addinfourl]: ... + def error(self, proto: _string, *args: Any): ... + +# Note that this type is somewhat a lie. The return *can* be None if +# a custom opener has been installed that fails to handle the request. +def urlopen(url: Union[Request, _string], data: Optional[_string] = ..., timeout: Optional[float] = ..., + cafile: Optional[_string] = ..., capath: Optional[_string] = ..., cadefault: bool = ..., + context: Optional[ssl.SSLContext] = ...) -> addinfourl: ... +def install_opener(opener: OpenerDirector) -> None: ... +def build_opener(*handlers: Union[BaseHandler, Type[BaseHandler]]) -> OpenerDirector: ... + +class BaseHandler: + handler_order: int + parent: OpenerDirector + + def add_parent(self, parent: OpenerDirector) -> None: ... + def close(self) -> None: ... + def __lt__(self, other: Any) -> bool: ... + +class HTTPErrorProcessor(BaseHandler): + def http_response(self, request, response): ... + +class HTTPDefaultErrorHandler(BaseHandler): + def http_error_default(self, req: Request, fp: addinfourl, code: int, msg: str, hdrs: Mapping[str, str]): ... + +class HTTPRedirectHandler(BaseHandler): + max_repeats: int + max_redirections: int + def redirect_request(self, req: Request, fp: addinfourl, code: int, msg: str, headers: Mapping[str, str], newurl): ... + def http_error_301(self, req: Request, fp: addinfourl, code: int, msg: str, headers: Mapping[str, str]): ... + def http_error_302(self, req: Request, fp: addinfourl, code: int, msg: str, headers: Mapping[str, str]): ... + def http_error_303(self, req: Request, fp: addinfourl, code: int, msg: str, headers: Mapping[str, str]): ... + def http_error_307(self, req: Request, fp: addinfourl, code: int, msg: str, headers: Mapping[str, str]): ... + inf_msg: str + + +class ProxyHandler(BaseHandler): + proxies: Mapping[str, str] + + def __init__(self, proxies: Optional[Mapping[str, str]] = ...): ... + def proxy_open(self, req: Request, proxy, type): ... + +class HTTPPasswordMgr: + def __init__(self) -> None: ... + def add_password(self, realm: Optional[Text], uri: Union[Text, Sequence[Text]], user: Text, passwd: Text) -> None: ... + def find_user_password(self, realm: Optional[Text], authuri: Text) -> Tuple[Any, Any]: ... + def reduce_uri(self, uri: _string, default_port: bool = ...) -> Tuple[Any, Any]: ... + def is_suburi(self, base: _string, test: _string) -> bool: ... + +class HTTPPasswordMgrWithDefaultRealm(HTTPPasswordMgr): ... + +class AbstractBasicAuthHandler: + def __init__(self, password_mgr: Optional[HTTPPasswordMgr] = ...) -> None: ... + def add_password(self, realm: Optional[Text], uri: Union[Text, Sequence[Text]], user: Text, passwd: Text) -> None: ... + def http_error_auth_reqed(self, authreq, host, req: Request, headers: Mapping[str, str]): ... + def retry_http_basic_auth(self, host, req: Request, realm): ... + +class HTTPBasicAuthHandler(AbstractBasicAuthHandler, BaseHandler): + auth_header: str + def http_error_401(self, req: Request, fp: addinfourl, code: int, msg: str, headers: Mapping[str, str]): ... + +class ProxyBasicAuthHandler(AbstractBasicAuthHandler, BaseHandler): + auth_header: str + def http_error_407(self, req: Request, fp: addinfourl, code: int, msg: str, headers: Mapping[str, str]): ... + +class AbstractDigestAuthHandler: + def __init__(self, passwd: Optional[HTTPPasswordMgr] = ...) -> None: ... + def add_password(self, realm: Optional[Text], uri: Union[Text, Sequence[Text]], user: Text, passwd: Text) -> None: ... + def reset_retry_count(self) -> None: ... + def http_error_auth_reqed(self, auth_header: str, host: str, req: Request, + headers: Mapping[str, str]) -> None: ... + def retry_http_digest_auth(self, req: Request, auth: str) -> Optional[HTTPResponse]: ... + def get_cnonce(self, nonce: str) -> str: ... + def get_authorization(self, req: Request, chal: Mapping[str, str]) -> str: ... + def get_algorithm_impls(self, algorithm: str) -> Tuple[Callable[[str], str], Callable[[str, str], str]]: ... + def get_entity_digest(self, data: Optional[bytes], chal: Mapping[str, str]) -> Optional[str]: ... + +class HTTPDigestAuthHandler(BaseHandler, AbstractDigestAuthHandler): + auth_header: str + handler_order: int + def http_error_401(self, req: Request, fp: addinfourl, code: int, msg: str, headers: Mapping[str, str]): ... + +class ProxyDigestAuthHandler(BaseHandler, AbstractDigestAuthHandler): + auth_header: str + handler_order: int + def http_error_407(self, req: Request, fp: addinfourl, code: int, msg: str, headers: Mapping[str, str]): ... + +class AbstractHTTPHandler(BaseHandler): # undocumented + def __init__(self, debuglevel: int = ...) -> None: ... + def set_http_debuglevel(self, level: int) -> None: ... + def do_request_(self, request: Request) -> Request: ... + def do_open(self, + http_class: HTTPConnectionProtocol, + req: Request, + **http_conn_args: Optional[Any]) -> addinfourl: ... + +class HTTPHandler(AbstractHTTPHandler): + def http_open(self, req: Request) -> addinfourl: ... + def http_request(self, request: Request) -> Request: ... # undocumented + +class HTTPSHandler(AbstractHTTPHandler): + def __init__(self, debuglevel: int = ..., context: Optional[ssl.SSLContext] = ...) -> None: ... + def https_open(self, req: Request) -> addinfourl: ... + def https_request(self, request: Request) -> Request: ... # undocumented + +class HTTPCookieProcessor(BaseHandler): + def __init__(self, cookiejar: Optional[Any] = ...): ... + def http_request(self, request: Request): ... + def http_response(self, request: Request, response): ... + +class UnknownHandler(BaseHandler): + def unknown_open(self, req: Request): ... + +class FileHandler(BaseHandler): + def file_open(self, req: Request): ... + def get_names(self): ... + def open_local_file(self, req: Request): ... + +class FTPHandler(BaseHandler): + def ftp_open(self, req: Request): ... + def connect_ftp(self, user, passwd, host, port, dirs, timeout): ... + +class CacheFTPHandler(FTPHandler): + def __init__(self) -> None: ... + def setTimeout(self, t: Optional[float]): ... + def setMaxConns(self, m: int): ... + def check_cache(self): ... + def clear_cache(self): ... + +def parse_http_list(s: AnyStr) -> List[AnyStr]: ... +def parse_keqv_list(l: List[AnyStr]) -> Dict[AnyStr, AnyStr]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/urlparse.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/urlparse.pyi new file mode 100644 index 0000000..fb59095 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/urlparse.pyi @@ -0,0 +1,70 @@ +# Stubs for urlparse (Python 2) + +from typing import AnyStr, Dict, List, NamedTuple, Tuple, Sequence, Union, overload + +_String = Union[str, unicode] + +uses_relative: List[str] +uses_netloc: List[str] +uses_params: List[str] +non_hierarchical: List[str] +uses_query: List[str] +uses_fragment: List[str] +scheme_chars: str +MAX_CACHE_SIZE = 0 + +def clear_cache() -> None: ... + +class ResultMixin(object): + @property + def username(self) -> str: ... + @property + def password(self) -> str: ... + @property + def hostname(self) -> str: ... + @property + def port(self) -> int: ... + +class SplitResult( + NamedTuple( + 'SplitResult', + [ + ('scheme', str), ('netloc', str), ('path', str), ('query', str), ('fragment', str) + ] + ), + ResultMixin +): + def geturl(self) -> str: ... + +class ParseResult( + NamedTuple( + 'ParseResult', + [ + ('scheme', str), ('netloc', str), ('path', str), ('params', str), ('query', str), + ('fragment', str) + ] + ), + ResultMixin +): + def geturl(self) -> str: ... + +def urlparse(url: _String, scheme: _String = ..., + allow_fragments: bool = ...) -> ParseResult: ... +def urlsplit(url: _String, scheme: _String = ..., + allow_fragments: bool = ...) -> SplitResult: ... +@overload +def urlunparse(data: Tuple[_String, _String, _String, _String, _String, _String]) -> str: ... +@overload +def urlunparse(data: Sequence[_String]) -> str: ... +@overload +def urlunsplit(data: Tuple[_String, _String, _String, _String, _String]) -> str: ... +@overload +def urlunsplit(data: Sequence[_String]) -> str: ... +def urljoin(base: _String, url: _String, + allow_fragments: bool = ...) -> str: ... +def urldefrag(url: AnyStr) -> Tuple[AnyStr, str]: ... +def unquote(s: AnyStr) -> AnyStr: ... +def parse_qs(qs: AnyStr, keep_blank_values: bool = ..., + strict_parsing: bool = ...) -> Dict[AnyStr, List[AnyStr]]: ... +def parse_qsl(qs: AnyStr, keep_blank_values: int = ..., + strict_parsing: bool = ...) -> List[Tuple[AnyStr, AnyStr]]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/user.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/user.pyi new file mode 100644 index 0000000..e857a3a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/user.pyi @@ -0,0 +1,9 @@ +# Stubs for user (Python 2) + +# Docs: https://docs.python.org/2/library/user.html +# Source: https://hg.python.org/cpython/file/2.7/Lib/user.py +from typing import Any + +def __getattr__(name) -> Any: ... +home: str +pythonrc: str diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/whichdb.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/whichdb.pyi new file mode 100644 index 0000000..b1a69f4 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/whichdb.pyi @@ -0,0 +1,5 @@ +# Source: https://hg.python.org/cpython/file/2.7/Lib/whichdb.py + +from typing import Optional, Text + +def whichdb(filename: Text) -> Optional[str]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/xmlrpclib.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/xmlrpclib.pyi new file mode 100644 index 0000000..abf4098 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2/xmlrpclib.pyi @@ -0,0 +1,199 @@ +# Stubs for xmlrpclib (Python 2) + +from typing import Any, AnyStr, Callable, IO, Iterable, List, Mapping, MutableMapping, Optional, Tuple, Type, TypeVar, Union +from types import InstanceType +from datetime import datetime +from time import struct_time +from httplib import HTTPConnection, HTTPResponse, HTTPSConnection +from ssl import SSLContext +from StringIO import StringIO +from gzip import GzipFile + +_Unmarshaller = Any +_timeTuple = Tuple[int, int, int, int, int, int, int, int, int] +# Represents types that can be compared against a DateTime object +_dateTimeComp = Union[AnyStr, DateTime, datetime, _timeTuple] +# A "host description" used by Transport factories +_hostDesc = Union[str, Tuple[str, Mapping[Any, Any]]] + +def escape(s: AnyStr, replace: Callable[[AnyStr, AnyStr, AnyStr], AnyStr] = ...) -> AnyStr: ... + +MAXINT: int +MININT: int +PARSE_ERROR: int +SERVER_ERROR: int +APPLICATION_ERROR: int +SYSTEM_ERROR: int +TRANSPORT_ERROR: int +NOT_WELLFORMED_ERROR: int +UNSUPPORTED_ENCODING: int +INVALID_ENCODING_CHAR: int +INVALID_XMLRPC: int +METHOD_NOT_FOUND: int +INVALID_METHOD_PARAMS: int +INTERNAL_ERROR: int + +class Error(Exception): ... + +class ProtocolError(Error): + url: str + errcode: int + errmsg: str + headers: Any + def __init__(self, url: str, errcode: int, errmsg: str, headers: Any) -> None: ... + +class ResponseError(Error): ... + +class Fault(Error): + faultCode: Any + faultString: str + def __init__(self, faultCode: Any, faultString: str, **extra: Any) -> None: ... + +boolean: Type[bool] +Boolean: Type[bool] + +class DateTime: + value: str + def __init__(self, value: Union[str, unicode, datetime, float, int, _timeTuple, struct_time] = ...) -> None: ... + def make_comparable(self, other: _dateTimeComp) -> Tuple[_dateTimeComp, _dateTimeComp]: ... + def __lt__(self, other: _dateTimeComp) -> bool: ... + def __le__(self, other: _dateTimeComp) -> bool: ... + def __gt__(self, other: _dateTimeComp) -> bool: ... + def __ge__(self, other: _dateTimeComp) -> bool: ... + def __eq__(self, other: _dateTimeComp) -> bool: ... + def __ne__(self, other: _dateTimeComp) -> bool: ... + def timetuple(self) -> struct_time: ... + def __cmp__(self, other: _dateTimeComp) -> int: ... + def decode(self, data: Any) -> None: ... + def encode(self, out: IO) -> None: ... + +class Binary: + data: str + def __init__(self, data: Optional[str] = ...) -> None: ... + def __cmp__(self, other: Any) -> int: ... + def decode(self, data: str) -> None: ... + def encode(self, out: IO) -> None: ... + +WRAPPERS: tuple + +# Still part of the public API, but see http://bugs.python.org/issue1773632 +FastParser: None +FastUnmarshaller: None +FastMarshaller: None + +# xmlrpclib.py will leave ExpatParser undefined if it can't import expat from +# xml.parsers. Because this is Python 2.7, the import will succeed. +class ExpatParser: + def __init__(self, target: _Unmarshaller) -> None: ... + def feed(self, data: str): ... + def close(self): ... + +# TODO: Add xmllib.XMLParser as base class +class SlowParser: + handle_xml: Callable[[str, bool], None] + unknown_starttag: Callable[[str, Any], None] + handle_data: Callable[[str], None] + handle_cdata: Callable[[str], None] + unknown_endtag: Callable[[str, Callable[[Iterable[str], str], str]], None] + def __init__(self, target: _Unmarshaller) -> None: ... + +class Marshaller: + memo: MutableMapping[int, Any] + data: Optional[str] + encoding: Optional[str] + allow_none: bool + def __init__(self, encoding: Optional[str] = ..., allow_none: bool = ...) -> None: ... + dispatch: Mapping[type, Callable[[Marshaller, str, Callable[[str], None]], None]] + def dumps(self, values: Union[Iterable[Union[None, int, bool, long, float, str, unicode, List, Tuple, Mapping, datetime, InstanceType]], Fault]) -> str: ... + def dump_nil(self, value: None, write: Callable[[str], None]) -> None: ... + def dump_int(self, value: int, write: Callable[[str], None]) -> None: ... + def dump_bool(self, value: bool, write: Callable[[str], None]) -> None: ... + def dump_long(self, value: long, write: Callable[[str], None]) -> None: ... + def dump_double(self, value: float, write: Callable[[str], None]) -> None: ... + def dump_string(self, value: str, write: Callable[[str], None], escape: Callable[[AnyStr, Callable[[AnyStr, AnyStr, AnyStr], AnyStr]], AnyStr] = ...) -> None: ... + def dump_unicode(self, value: unicode, write: Callable[[str], None], escape: Callable[[AnyStr, Callable[[AnyStr, AnyStr, AnyStr], AnyStr]], AnyStr] = ...) -> None: ... + def dump_array(self, value: Union[List, Tuple], write: Callable[[str], None]) -> None: ... + def dump_struct(self, value: Mapping, write: Callable[[str], None], escape: Callable[[AnyStr, Callable[[AnyStr, AnyStr, AnyStr], AnyStr]], AnyStr] = ...) -> None: ... + def dump_datetime(self, value: datetime, write: Callable[[str], None]) -> None: ... + def dump_instance(self, value: InstanceType, write: Callable[[str], None]) -> None: ... + +class Unmarshaller: + def append(self, object: Any) -> None: ... + def __init__(self, use_datetime: bool = ...) -> None: ... + def close(self) -> tuple: ... + def getmethodname(self) -> Optional[str]: ... + def xml(self, encoding: str, standalone: bool) -> None: ... + def start(self, tag: str, attrs: Any) -> None: ... + def data(self, text: str) -> None: ... + def end(self, tag: str, join: Callable[[Iterable[str], str], str] = ...) -> None: ... + def end_dispatch(self, tag: str, data: str) -> None: ... + dispatch: Mapping[str, Callable[[Unmarshaller, str], None]] + def end_nil(self, data: str): ... + def end_boolean(self, data: str) -> None: ... + def end_int(self, data: str) -> None: ... + def end_double(self, data: str) -> None: ... + def end_string(self, data: str) -> None: ... + def end_array(self, data: str) -> None: ... + def end_struct(self, data: str) -> None: ... + def end_base64(self, data: str) -> None: ... + def end_dateTime(self, data: str) -> None: ... + def end_value(self, data: str) -> None: ... + def end_params(self, data: str) -> None: ... + def end_fault(self, data: str) -> None: ... + def end_methodName(self, data: str) -> None: ... + +class _MultiCallMethod: + def __init__(self, call_list: List[Tuple[str, tuple]], name: str) -> None: ... +class MultiCallIterator: + def __init__(self, results: List) -> None: ... + +class MultiCall: + def __init__(self, server: ServerProxy) -> None: ... + def __getattr__(self, name: str) -> _MultiCallMethod: ... + def __call__(self) -> MultiCallIterator: ... + +def getparser(use_datetime: bool = ...) -> Tuple[Union[ExpatParser, SlowParser], Unmarshaller]: ... +def dumps(params: Union[tuple, Fault], methodname: Optional[str] = ..., methodresponse: Optional[bool] = ..., encoding: Optional[str] = ..., allow_none: bool = ...) -> str: ... +def loads(data: str, use_datetime: bool = ...) -> Tuple[tuple, Optional[str]]: ... + +def gzip_encode(data: str) -> str: ... +def gzip_decode(data: str, max_decode: int = ...) -> str: ... + +class GzipDecodedResponse(GzipFile): + stringio: StringIO + def __init__(self, response: HTTPResponse) -> None: ... + def close(self): ... + +class _Method: + def __init__(self, send: Callable[[str, tuple], Any], name: str) -> None: ... + def __getattr__(self, name: str) -> _Method: ... + def __call__(self, *args: Any) -> Any: ... + +class Transport: + user_agent: str + accept_gzip_encoding: bool + encode_threshold: Optional[int] + def __init__(self, use_datetime: bool = ...) -> None: ... + def request(self, host: _hostDesc, handler: str, request_body: str, verbose: bool = ...) -> tuple: ... + verbose: bool + def single_request(self, host: _hostDesc, handler: str, request_body: str, verbose: bool = ...) -> tuple: ... + def getparser(self) -> Tuple[Union[ExpatParser, SlowParser], Unmarshaller]: ... + def get_host_info(self, host: _hostDesc) -> Tuple[str, Optional[List[Tuple[str, str]]], Optional[Mapping[Any, Any]]]: ... + def make_connection(self, host: _hostDesc) -> HTTPConnection: ... + def close(self) -> None: ... + def send_request(self, connection: HTTPConnection, handler: str, request_body: str) -> None: ... + def send_host(self, connection: HTTPConnection, host: str) -> None: ... + def send_user_agent(self, connection: HTTPConnection) -> None: ... + def send_content(self, connection: HTTPConnection, request_body: str) -> None: ... + def parse_response(self, response: HTTPResponse) -> tuple: ... + +class SafeTransport(Transport): + def __init__(self, use_datetime: bool = ..., context: Optional[SSLContext] = ...) -> None: ... + def make_connection(self, host: _hostDesc) -> HTTPSConnection: ... + +class ServerProxy: + def __init__(self, uri: str, transport: Optional[Transport] = ..., encoding: Optional[str] = ..., verbose: bool = ..., allow_none: bool = ..., use_datetime: bool = ..., context: Optional[SSLContext] = ...) -> None: ... + def __getattr__(self, name: str) -> _Method: ... + def __call__(self, attr: str) -> Optional[Transport]: ... + +Server = ServerProxy diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/__future__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/__future__.pyi new file mode 100644 index 0000000..13db2dc --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/__future__.pyi @@ -0,0 +1,24 @@ +import sys +from typing import List + +class _Feature: + def getOptionalRelease(self) -> sys._version_info: ... + def getMandatoryRelease(self) -> sys._version_info: ... + +absolute_import: _Feature +division: _Feature +generators: _Feature +nested_scopes: _Feature +print_function: _Feature +unicode_literals: _Feature +with_statement: _Feature +if sys.version_info >= (3, 0): + barry_as_FLUFL: _Feature + +if sys.version_info >= (3, 5): + generator_stop: _Feature + +if sys.version_info >= (3, 7): + annotations: _Feature + +all_feature_names: List[str] diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/_bisect.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/_bisect.pyi new file mode 100644 index 0000000..6233547 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/_bisect.pyi @@ -0,0 +1,11 @@ +"""Stub file for the '_bisect' module.""" + +from typing import Sequence, TypeVar + +_T = TypeVar('_T') +def bisect(a: Sequence[_T], x: _T, lo: int = ..., hi: int = ...) -> int: ... +def bisect_left(a: Sequence[_T], x: _T, lo: int = ..., hi: int = ...) -> int: ... +def bisect_right(a: Sequence[_T], x: _T, lo: int = ..., hi: int = ...) -> int: ... +def insort(a: Sequence[_T], x: _T, lo: int = ..., hi: int = ...) -> None: ... +def insort_left(a: Sequence[_T], x: _T, lo: int = ..., hi: int = ...) -> None: ... +def insort_right(a: Sequence[_T], x: _T, lo: int = ..., hi: int = ...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/_codecs.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/_codecs.pyi new file mode 100644 index 0000000..32163eb --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/_codecs.pyi @@ -0,0 +1,74 @@ +"""Stub file for the '_codecs' module.""" + +import sys +from typing import Any, Callable, Tuple, Optional, Dict, Text, Union + +import codecs + +# For convenience: +_Handler = Callable[[Exception], Tuple[Text, int]] +_String = Union[bytes, str] +_Errors = Union[str, Text, None] +if sys.version_info < (3, 0): + _Decodable = Union[bytes, Text] + _Encodable = Union[bytes, Text] +else: + _Decodable = bytes + _Encodable = str + +# This type is not exposed; it is defined in unicodeobject.c +class _EncodingMap(object): + def size(self) -> int: ... +_MapT = Union[Dict[int, int], _EncodingMap] + +def register(search_function: Callable[[str], Any]) -> None: ... +def register_error(errors: Union[str, Text], handler: _Handler) -> None: ... +def lookup(encoding: Union[str, Text]) -> codecs.CodecInfo: ... +def lookup_error(name: Union[str, Text]) -> _Handler: ... +def decode(obj: Any, encoding: Union[str, Text] = ..., errors: _Errors = ...) -> Any: ... +def encode(obj: Any, encoding: Union[str, Text] = ..., errors: _Errors = ...) -> Any: ... +def charmap_build(map: Text) -> _MapT: ... + +def ascii_decode(data: _Decodable, errors: _Errors = ...) -> Tuple[Text, int]: ... +def ascii_encode(data: _Encodable, errors: _Errors = ...) -> Tuple[bytes, int]: ... +def charbuffer_encode(data: _Encodable, errors: _Errors = ...) -> Tuple[bytes, int]: ... +def charmap_decode(data: _Decodable, errors: _Errors = ..., mapping: Optional[_MapT] = ...) -> Tuple[Text, int]: ... +def charmap_encode(data: _Encodable, errors: _Errors, mapping: Optional[_MapT] = ...) -> Tuple[bytes, int]: ... +def escape_decode(data: _String, errors: _Errors = ...) -> Tuple[str, int]: ... +def escape_encode(data: bytes, errors: _Errors = ...) -> Tuple[bytes, int]: ... +def latin_1_decode(data: _Decodable, errors: _Errors = ...) -> Tuple[Text, int]: ... +def latin_1_encode(data: _Encodable, errors: _Errors = ...) -> Tuple[bytes, int]: ... +def raw_unicode_escape_decode(data: _String, errors: _Errors = ...) -> Tuple[Text, int]: ... +def raw_unicode_escape_encode(data: _Encodable, errors: _Errors = ...) -> Tuple[bytes, int]: ... +def readbuffer_encode(data: _String, errors: _Errors = ...) -> Tuple[bytes, int]: ... +def unicode_escape_decode(data: _String, errors: _Errors = ...) -> Tuple[Text, int]: ... +def unicode_escape_encode(data: _Encodable, errors: _Errors = ...) -> Tuple[bytes, int]: ... +def unicode_internal_decode(data: _String, errors: _Errors = ...) -> Tuple[Text, int]: ... +def unicode_internal_encode(data: _String, errors: _Errors = ...) -> Tuple[bytes, int]: ... +def utf_16_be_decode(data: _Decodable, errors: _Errors = ..., final: int = ...) -> Tuple[Text, int]: ... +def utf_16_be_encode(data: _Encodable, errors: _Errors = ...) -> Tuple[bytes, int]: ... +def utf_16_decode(data: _Decodable, errors: _Errors = ..., final: int = ...) -> Tuple[Text, int]: ... +def utf_16_encode(data: _Encodable, errors: _Errors = ..., byteorder: int = ...) -> Tuple[bytes, int]: ... +def utf_16_ex_decode(data: _Decodable, errors: _Errors = ..., final: int = ...) -> Tuple[Text, int, int]: ... +def utf_16_le_decode(data: _Decodable, errors: _Errors = ..., final: int = ...) -> Tuple[Text, int]: ... +def utf_16_le_encode(data: _Encodable, errors: _Errors = ...) -> Tuple[bytes, int]: ... +def utf_32_be_decode(data: _Decodable, errors: _Errors = ..., final: int = ...) -> Tuple[Text, int]: ... +def utf_32_be_encode(data: _Encodable, errors: _Errors = ...) -> Tuple[bytes, int]: ... +def utf_32_decode(data: _Decodable, errors: _Errors = ..., final: int = ...) -> Tuple[Text, int]: ... +def utf_32_encode(data: _Encodable, errors: _Errors = ..., byteorder: int = ...) -> Tuple[bytes, int]: ... +def utf_32_ex_decode(data: _Decodable, errors: _Errors = ..., final: int = ...) -> Tuple[Text, int, int]: ... +def utf_32_le_decode(data: _Decodable, errors: _Errors = ..., final: int = ...) -> Tuple[Text, int]: ... +def utf_32_le_encode(data: _Encodable, errors: _Errors = ...) -> Tuple[bytes, int]: ... +def utf_7_decode(data: _Decodable, errors: _Errors = ..., final: int = ...) -> Tuple[Text, int]: ... +def utf_7_encode(data: _Encodable, errors: _Errors = ...) -> Tuple[bytes, int]: ... +def utf_8_decode(data: _Decodable, errors: _Errors = ..., final: int = ...) -> Tuple[Text, int]: ... +def utf_8_encode(data: _Encodable, errors: _Errors = ...) -> Tuple[bytes, int]: ... + +if sys.platform == 'win32': + def mbcs_decode(data: _Decodable, errors: _Errors = ..., final: int = ...) -> Tuple[Text, int]: ... + def mbcs_encode(str: _Encodable, errors: _Errors = ...) -> Tuple[bytes, int]: ... + if sys.version_info >= (3, 0): + def oem_decode(data: bytes, errors: _Errors = ..., final: int = ...) -> Tuple[Text, int]: ... + def code_page_decode(codepage: int, data: bytes, errors: _Errors = ..., final: int = ...) -> Tuple[Text, int]: ... + def oem_encode(str: Text, errors: _Errors = ...) -> Tuple[bytes, int]: ... + def code_page_encode(code_page: int, str: Text, errors: _Errors = ...) -> Tuple[bytes, int]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/_csv.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/_csv.pyi new file mode 100644 index 0000000..1c4c26e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/_csv.pyi @@ -0,0 +1,49 @@ +import sys + +from typing import Any, Iterable, Iterator, List, Optional, Sequence, Text + +QUOTE_ALL: int +QUOTE_MINIMAL: int +QUOTE_NONE: int +QUOTE_NONNUMERIC: int + +class Error(Exception): ... + +class Dialect: + delimiter: str + quotechar: Optional[str] + escapechar: Optional[str] + doublequote: bool + skipinitialspace: bool + lineterminator: str + quoting: int + strict: int + def __init__(self) -> None: ... + +class _reader(Iterator[List[str]]): + dialect: Dialect + line_num: int + if sys.version_info >= (3, 0): + def __next__(self) -> List[str]: ... + else: + def next(self) -> List[str]: ... + +class _writer: + dialect: Dialect + + if sys.version_info >= (3, 5): + def writerow(self, row: Iterable[Any]) -> None: ... + def writerows(self, rows: Iterable[Iterable[Any]]) -> None: ... + else: + def writerow(self, row: Sequence[Any]) -> None: ... + def writerows(self, rows: Iterable[Sequence[Any]]) -> None: ... + + +# TODO: precise type +def writer(csvfile: Any, dialect: Any = ..., **fmtparams: Any) -> _writer: ... +def reader(csvfile: Iterable[Text], dialect: Any = ..., **fmtparams: Any) -> _reader: ... +def register_dialect(name: str, dialect: Any = ..., **fmtparams: Any) -> None: ... +def unregister_dialect(name: str) -> None: ... +def get_dialect(name: str) -> Dialect: ... +def list_dialects() -> List[str]: ... +def field_size_limit(new_limit: int = ...) -> int: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/_heapq.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/_heapq.pyi new file mode 100644 index 0000000..8b7f6ea --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/_heapq.pyi @@ -0,0 +1,15 @@ +"""Stub file for the '_heapq' module.""" + +from typing import TypeVar, List + +_T = TypeVar("_T") + +def heapify(heap: List[_T]) -> None: ... +def heappop(heap: List[_T]) -> _T: + raise IndexError() # if list is empty +def heappush(heap: List[_T], item: _T) -> None: ... +def heappushpop(heap: List[_T], item: _T) -> _T: ... +def heapreplace(heap: List[_T], item: _T) -> _T: + raise IndexError() # if list is empty +def nlargest(a: int, b: List[_T]) -> List[_T]: ... +def nsmallest(a: int, b: List[_T]) -> List[_T]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/_random.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/_random.pyi new file mode 100644 index 0000000..a37149d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/_random.pyi @@ -0,0 +1,17 @@ +# Stubs for _random + +import sys +from typing import Tuple + +# Actually Tuple[(int,) * 625] +_State = Tuple[int, ...] + +class Random(object): + def __init__(self, seed: object = ...) -> None: ... + def seed(self, x: object = ...) -> None: ... + def getstate(self) -> _State: ... + def setstate(self, state: _State) -> None: ... + def random(self) -> float: ... + def getrandbits(self, k: int) -> int: ... + if sys.version_info < (3,): + def jumpahead(self, i: int) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/_weakref.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/_weakref.pyi new file mode 100644 index 0000000..6a527c1 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/_weakref.pyi @@ -0,0 +1,28 @@ +import sys +from typing import Any, Callable, Generic, Optional, TypeVar, overload + +_C = TypeVar('_C', bound=Callable[..., Any]) +_T = TypeVar('_T') + +class CallableProxyType(object): # "weakcallableproxy" + def __getattr__(self, attr: str) -> Any: ... + +class ProxyType(object): # "weakproxy" + def __getattr__(self, attr: str) -> Any: ... + +class ReferenceType(Generic[_T]): + if sys.version_info >= (3, 4): + __callback__: Callable[[ReferenceType[_T]], Any] + def __init__(self, o: _T, callback: Optional[Callable[[ReferenceType[_T]], Any]] = ...) -> None: ... + def __call__(self) -> Optional[_T]: ... + def __hash__(self) -> int: ... + +ref = ReferenceType + +def getweakrefcount(object: Any) -> int: ... +def getweakrefs(object: Any) -> int: ... +@overload +def proxy(object: _C, callback: Optional[Callable[[_C], Any]] = ...) -> CallableProxyType: ... +# Return CallableProxyType if object is callable, ProxyType otherwise +@overload +def proxy(object: _T, callback: Optional[Callable[[_T], Any]] = ...) -> Any: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/_weakrefset.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/_weakrefset.pyi new file mode 100644 index 0000000..950d3fe --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/_weakrefset.pyi @@ -0,0 +1,43 @@ +from typing import Iterator, Any, Iterable, MutableSet, Optional, TypeVar, Generic, Union + +_S = TypeVar('_S') +_T = TypeVar('_T') +_SelfT = TypeVar('_SelfT', bound=WeakSet) + +class WeakSet(MutableSet[_T], Generic[_T]): + def __init__(self, data: Optional[Iterable[_T]] = ...) -> None: ... + + def add(self, item: _T) -> None: ... + def clear(self) -> None: ... + def discard(self, item: _T) -> None: ... + def copy(self: _SelfT) -> _SelfT: ... + def pop(self) -> _T: ... + def remove(self, item: _T) -> None: ... + def update(self, other: Iterable[_T]) -> None: ... + def __contains__(self, item: object) -> bool: ... + def __len__(self) -> int: ... + def __iter__(self) -> Iterator[_T]: ... + + def __ior__(self, other: Iterable[_S]) -> WeakSet[Union[_S, _T]]: ... + def difference(self: _SelfT, other: Iterable[_T]) -> _SelfT: ... + def __sub__(self: _SelfT, other: Iterable[_T]) -> _SelfT: ... + def difference_update(self: _SelfT, other: Iterable[_T]) -> None: ... + def __isub__(self: _SelfT, other: Iterable[_T]) -> _SelfT: ... + def intersection(self: _SelfT, other: Iterable[_T]) -> _SelfT: ... + def __and__(self: _SelfT, other: Iterable[_T]) -> _SelfT: ... + def intersection_update(self, other: Iterable[_T]) -> None: ... + def __iand__(self: _SelfT, other: Iterable[_T]) -> _SelfT: ... + def issubset(self, other: Iterable[_T]) -> bool: ... + def __le__(self, other: Iterable[_T]) -> bool: ... + def __lt__(self, other: Iterable[_T]) -> bool: ... + def issuperset(self, other: Iterable[_T]) -> bool: ... + def __ge__(self, other: Iterable[_T]) -> bool: ... + def __gt__(self, other: Iterable[_T]) -> bool: ... + def __eq__(self, other: object) -> bool: ... + def symmetric_difference(self, other: Iterable[_S]) -> WeakSet[Union[_S, _T]]: ... + def __xor__(self, other: Iterable[_S]) -> WeakSet[Union[_S, _T]]: ... + def symmetric_difference_update(self, other: Iterable[_S]) -> None: ... + def __ixor__(self, other: Iterable[_S]) -> WeakSet[Union[_S, _T]]: ... + def union(self, other: Iterable[_S]) -> WeakSet[Union[_S, _T]]: ... + def __or__(self, other: Iterable[_S]) -> WeakSet[Union[_S, _T]]: ... + def isdisjoint(self, other: Iterable[_T]) -> bool: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/argparse.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/argparse.pyi new file mode 100644 index 0000000..d4dd5b5 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/argparse.pyi @@ -0,0 +1,408 @@ +# Stubs for argparse (Python 2.7 and 3.4) + +from typing import ( + Any, Callable, Dict, Generator, Iterable, List, IO, NoReturn, Optional, + Pattern, Sequence, Tuple, Type, Union, TypeVar, overload +) +import sys + +_T = TypeVar('_T') +_ActionT = TypeVar('_ActionT', bound='Action') +_N = TypeVar('_N') + +if sys.version_info >= (3,): + _Text = str +else: + _Text = Union[str, unicode] + +ONE_OR_MORE: str +OPTIONAL: str +PARSER: str +REMAINDER: str +SUPPRESS: str +ZERO_OR_MORE: str +_UNRECOGNIZED_ARGS_ATTR: str # undocumented + +class ArgumentError(Exception): ... + +# undocumented +class _AttributeHolder: + def _get_kwargs(self) -> List[Tuple[str, Any]]: ... + def _get_args(self) -> List[Any]: ... + +# undocumented +class _ActionsContainer: + description: Optional[_Text] + prefix_chars: _Text + argument_default: Optional[_Text] + conflict_handler: _Text + + _registries: Dict[_Text, Dict[Any, Any]] + _actions: List[Action] + _option_string_actions: Dict[_Text, Action] + _action_groups: List[_ArgumentGroup] + _mutually_exclusive_groups: List[_MutuallyExclusiveGroup] + _defaults: Dict[str, Any] + _negative_number_matcher: Pattern[str] + _has_negative_number_optionals: List[bool] + + def __init__(self, description: Optional[_Text], prefix_chars: _Text, + argument_default: Optional[_Text], conflict_handler: _Text) -> None: ... + def register(self, registry_name: _Text, value: Any, object: Any) -> None: ... + def _registry_get(self, registry_name: _Text, value: Any, default: Any = ...) -> Any: ... + def set_defaults(self, **kwargs: Any) -> None: ... + def get_default(self, dest: _Text) -> Any: ... + def add_argument(self, + *name_or_flags: _Text, + action: Union[_Text, Type[Action]] = ..., + nargs: Union[int, _Text] = ..., + const: Any = ..., + default: Any = ..., + type: Union[Callable[[str], _T], FileType] = ..., + choices: Iterable[_T] = ..., + required: bool = ..., + help: Optional[_Text] = ..., + metavar: Optional[Union[_Text, Tuple[_Text, ...]]] = ..., + dest: Optional[_Text] = ..., + version: _Text = ..., + **kwargs: Any) -> Action: ... + def add_argument_group(self, *args: Any, **kwargs: Any) -> _ArgumentGroup: ... + def add_mutually_exclusive_group(self, **kwargs: Any) -> _MutuallyExclusiveGroup: ... + def _add_action(self, action: _ActionT) -> _ActionT: ... + def _remove_action(self, action: Action) -> None: ... + def _add_container_actions(self, container: _ActionsContainer) -> None: ... + def _get_positional_kwargs(self, dest: _Text, **kwargs: Any) -> Dict[str, Any]: ... + def _get_optional_kwargs(self, *args: Any, **kwargs: Any) -> Dict[str, Any]: ... + def _pop_action_class(self, kwargs: Any, default: Optional[Type[Action]] = ...) -> Type[Action]: ... + def _get_handler(self) -> Callable[[Action, Iterable[Tuple[_Text, Action]]], Any]: ... + def _check_conflict(self, action: Action) -> None: ... + def _handle_conflict_error(self, action: Action, conflicting_actions: Iterable[Tuple[_Text, Action]]) -> NoReturn: ... + def _handle_conflict_resolve(self, action: Action, conflicting_actions: Iterable[Tuple[_Text, Action]]) -> None: ... + +class ArgumentParser(_AttributeHolder, _ActionsContainer): + prog: _Text + usage: Optional[_Text] + epilog: Optional[_Text] + formatter_class: Type[HelpFormatter] + fromfile_prefix_chars: Optional[_Text] + add_help: bool + + if sys.version_info >= (3, 5): + allow_abbrev: bool + + # undocumented + _positionals: _ArgumentGroup + _optionals: _ArgumentGroup + _subparsers: Optional[_ArgumentGroup] + + if sys.version_info >= (3, 5): + def __init__(self, + prog: Optional[str] = ..., + usage: Optional[str] = ..., + description: Optional[str] = ..., + epilog: Optional[str] = ..., + parents: Sequence[ArgumentParser] = ..., + formatter_class: Type[HelpFormatter] = ..., + prefix_chars: _Text = ..., + fromfile_prefix_chars: Optional[str] = ..., + argument_default: Optional[str] = ..., + conflict_handler: _Text = ..., + add_help: bool = ..., + allow_abbrev: bool = ...) -> None: ... + else: + def __init__(self, + prog: Optional[_Text] = ..., + usage: Optional[_Text] = ..., + description: Optional[_Text] = ..., + epilog: Optional[_Text] = ..., + parents: Sequence[ArgumentParser] = ..., + formatter_class: Type[HelpFormatter] = ..., + prefix_chars: _Text = ..., + fromfile_prefix_chars: Optional[_Text] = ..., + argument_default: Optional[_Text] = ..., + conflict_handler: _Text = ..., + add_help: bool = ...) -> None: ... + + # The type-ignores in these overloads should be temporary. See: + # https://github.com/python/typeshed/pull/2643#issuecomment-442280277 + @overload + def parse_args(self, args: Optional[Sequence[_Text]] = ...) -> Namespace: ... + @overload + def parse_args(self, args: Optional[Sequence[_Text]], namespace: None) -> Namespace: ... # type: ignore + @overload + def parse_args(self, args: Optional[Sequence[_Text]], namespace: _N) -> _N: ... + @overload + def parse_args(self, *, namespace: None) -> Namespace: ... # type: ignore + @overload + def parse_args(self, *, namespace: _N) -> _N: ... + + if sys.version_info >= (3, 7): + def add_subparsers(self, title: _Text = ..., + description: Optional[_Text] = ..., + prog: _Text = ..., + parser_class: Type[ArgumentParser] = ..., + action: Type[Action] = ..., + option_string: _Text = ..., + dest: Optional[_Text] = ..., + required: bool = ..., + help: Optional[_Text] = ..., + metavar: Optional[_Text] = ...) -> _SubParsersAction: ... + else: + def add_subparsers(self, title: _Text = ..., + description: Optional[_Text] = ..., + prog: _Text = ..., + parser_class: Type[ArgumentParser] = ..., + action: Type[Action] = ..., + option_string: _Text = ..., + dest: Optional[_Text] = ..., + help: Optional[_Text] = ..., + metavar: Optional[_Text] = ...) -> _SubParsersAction: ... + + def print_usage(self, file: Optional[IO[str]] = ...) -> None: ... + def print_help(self, file: Optional[IO[str]] = ...) -> None: ... + def format_usage(self) -> str: ... + def format_help(self) -> str: ... + def parse_known_args(self, args: Optional[Sequence[_Text]] = ..., + namespace: Optional[Namespace] = ...) -> Tuple[Namespace, List[str]]: ... + def convert_arg_line_to_args(self, arg_line: _Text) -> List[str]: ... + def exit(self, status: int = ..., message: Optional[_Text] = ...) -> NoReturn: ... + def error(self, message: _Text) -> NoReturn: ... + if sys.version_info >= (3, 7): + def parse_intermixed_args(self, args: Optional[Sequence[_Text]] = ..., + namespace: Optional[Namespace] = ...) -> Namespace: ... + def parse_known_intermixed_args(self, + args: Optional[Sequence[_Text]] = ..., + namespace: Optional[Namespace] = ...) -> Tuple[Namespace, List[str]]: ... + # undocumented + def _get_optional_actions(self) -> List[Action]: ... + def _get_positional_actions(self) -> List[Action]: ... + def _parse_known_args(self, arg_strings: List[_Text], namespace: Namespace) -> Tuple[Namespace, List[str]]: ... + def _read_args_from_files(self, arg_strings: List[_Text]) -> List[_Text]: ... + def _match_argument(self, action: Action, arg_strings_pattern: _Text) -> int: ... + def _match_arguments_partial(self, actions: Sequence[Action], arg_strings_pattern: _Text) -> List[int]: ... + def _parse_optional(self, arg_string: _Text) -> Optional[Tuple[Optional[Action], _Text, Optional[_Text]]]: ... + def _get_option_tuples(self, option_string: _Text) -> List[Tuple[Action, _Text, Optional[_Text]]]: ... + def _get_nargs_pattern(self, action: Action) -> _Text: ... + def _get_values(self, action: Action, arg_strings: List[_Text]) -> Any: ... + def _get_value(self, action: Action, arg_string: _Text) -> Any: ... + def _check_value(self, action: Action, value: Any) -> None: ... + def _get_formatter(self) -> HelpFormatter: ... + def _print_message(self, message: str, file: Optional[IO[str]] = ...) -> None: ... + +class HelpFormatter: + # undocumented + _prog: _Text + _indent_increment: int + _max_help_position: int + _width: int + _current_indent: int + _level: int + _action_max_length: int + _root_section: Any + _current_section: Any + _whitespace_matcher: Pattern[str] + _long_break_matcher: Pattern[str] + _Section: Type[Any] # Nested class + def __init__(self, prog: _Text, indent_increment: int = ..., + max_help_position: int = ..., + width: Optional[int] = ...) -> None: ... + def _indent(self) -> None: ... + def _dedent(self) -> None: ... + def _add_item(self, func: Callable[..., _Text], args: Iterable[Any]) -> None: ... + def start_section(self, heading: Optional[_Text]) -> None: ... + def end_section(self) -> None: ... + def add_text(self, text: Optional[_Text]) -> None: ... + def add_usage(self, usage: _Text, actions: Iterable[Action], groups: Iterable[_ArgumentGroup], prefix: Optional[_Text] = ...) -> None: ... + def add_argument(self, action: Action) -> None: ... + def add_arguments(self, actions: Iterable[Action]) -> None: ... + def format_help(self) -> _Text: ... + def _join_parts(self, part_strings: Iterable[_Text]) -> _Text: ... + def _format_usage(self, usage: _Text, actions: Iterable[Action], groups: Iterable[_ArgumentGroup], prefix: Optional[_Text]) -> _Text: ... + def _format_actions_usage(self, actions: Iterable[Action], groups: Iterable[_ArgumentGroup]) -> _Text: ... + def _format_text(self, text: _Text) -> _Text: ... + def _format_action(self, action: Action) -> _Text: ... + def _format_action_invocation(self, action: Action) -> _Text: ... + def _metavar_formatter(self, action: Action, default_metavar: _Text) -> Callable[[int], Tuple[_Text, ...]]: ... + def _format_args(self, action: Action, default_metavar: _Text) -> _Text: ... + def _expand_help(self, action: Action) -> _Text: ... + def _iter_indented_subactions(self, action: Action) -> Generator[Action, None, None]: ... + def _split_lines(self, text: _Text, width: int) -> List[_Text]: ... + def _fill_text(self, text: _Text, width: int, indent: int) -> _Text: ... + def _get_help_string(self, action: Action) -> Optional[_Text]: ... + def _get_default_metavar_for_optional(self, action: Action) -> _Text: ... + def _get_default_metavar_for_positional(self, action: Action) -> _Text: ... + +class RawDescriptionHelpFormatter(HelpFormatter): ... +class RawTextHelpFormatter(HelpFormatter): ... +class ArgumentDefaultsHelpFormatter(HelpFormatter): ... +if sys.version_info >= (3,): + class MetavarTypeHelpFormatter(HelpFormatter): ... + +class Action(_AttributeHolder): + option_strings: Sequence[_Text] + dest: _Text + nargs: Optional[Union[int, _Text]] + const: Any + default: Any + type: Union[Callable[[str], Any], FileType, None] + choices: Optional[Iterable[Any]] + required: bool + help: Optional[_Text] + metavar: Optional[Union[_Text, Tuple[_Text, ...]]] + + def __init__(self, + option_strings: Sequence[_Text], + dest: _Text, + nargs: Optional[Union[int, _Text]] = ..., + const: Any = ..., + default: Any = ..., + type: Optional[Union[Callable[[str], _T], FileType]] = ..., + choices: Optional[Iterable[_T]] = ..., + required: bool = ..., + help: Optional[_Text] = ..., + metavar: Optional[Union[_Text, Tuple[_Text, ...]]] = ...) -> None: ... + def __call__(self, parser: ArgumentParser, namespace: Namespace, + values: Union[_Text, Sequence[Any], None], + option_string: Optional[_Text] = ...) -> None: ... + +class Namespace(_AttributeHolder): + def __init__(self, **kwargs: Any) -> None: ... + def __getattr__(self, name: _Text) -> Any: ... + def __setattr__(self, name: _Text, value: Any) -> None: ... + def __contains__(self, key: str) -> bool: ... + +class FileType: + # undocumented + _mode: _Text + _bufsize: int + if sys.version_info >= (3, 4): + _encoding: Optional[_Text] + _errors: Optional[_Text] + if sys.version_info >= (3, 4): + def __init__(self, mode: _Text = ..., bufsize: int = ..., + encoding: Optional[_Text] = ..., + errors: Optional[_Text] = ...) -> None: ... + elif sys.version_info >= (3,): + def __init__(self, + mode: _Text = ..., bufsize: int = ...) -> None: ... + else: + def __init__(self, + mode: _Text = ..., bufsize: Optional[int] = ...) -> None: ... + def __call__(self, string: _Text) -> IO[Any]: ... + +# undocumented +class _ArgumentGroup(_ActionsContainer): + title: Optional[_Text] + _group_actions: List[Action] + def __init__(self, container: _ActionsContainer, + title: Optional[_Text] = ..., + description: Optional[_Text] = ..., **kwargs: Any) -> None: ... + +# undocumented +class _MutuallyExclusiveGroup(_ArgumentGroup): + required: bool + _container: _ActionsContainer + def __init__(self, container: _ActionsContainer, required: bool = ...) -> None: ... + +# undocumented +class _StoreAction(Action): ... + +# undocumented +class _StoreConstAction(Action): + def __init__(self, + option_strings: Sequence[_Text], + dest: _Text, + const: Any, + default: Any = ..., + required: bool = ..., + help: Optional[_Text] = ..., + metavar: Optional[Union[_Text, Tuple[_Text, ...]]] = ...) -> None: ... + +# undocumented +class _StoreTrueAction(_StoreConstAction): + def __init__(self, + option_strings: Sequence[_Text], + dest: _Text, + default: bool = ..., + required: bool = ..., + help: Optional[_Text] = ...) -> None: ... + +# undocumented +class _StoreFalseAction(_StoreConstAction): + def __init__(self, + option_strings: Sequence[_Text], + dest: _Text, + default: bool = ..., + required: bool = ..., + help: Optional[_Text] = ...) -> None: ... + +# undocumented +class _AppendAction(Action): ... + +# undocumented +class _AppendConstAction(Action): + def __init__(self, + option_strings: Sequence[_Text], + dest: _Text, + const: Any, + default: Any = ..., + required: bool = ..., + help: Optional[_Text] = ..., + metavar: Optional[Union[_Text, Tuple[_Text, ...]]] = ...) -> None: ... + +# undocumented +class _CountAction(Action): + def __init__(self, + option_strings: Sequence[_Text], + dest: _Text, + default: Any = ..., + required: bool = ..., + help: Optional[_Text] = ...) -> None: ... + +# undocumented +class _HelpAction(Action): + def __init__(self, + option_strings: Sequence[_Text], + dest: _Text = ..., + default: _Text = ..., + help: Optional[_Text] = ...) -> None: ... + +# undocumented +class _VersionAction(Action): + version: Optional[_Text] + def __init__(self, + option_strings: Sequence[_Text], + version: Optional[_Text] = ..., + dest: _Text = ..., + default: _Text = ..., + help: _Text = ...) -> None: ... + +# undocumented +class _SubParsersAction(Action): + _ChoicesPseudoAction: Type[Any] # nested class + _prog_prefix: _Text + _parser_class: Type[ArgumentParser] + _name_parser_map: Dict[_Text, ArgumentParser] + choices: Dict[_Text, ArgumentParser] + _choices_actions: List[Action] + def __init__(self, + option_strings: Sequence[_Text], + prog: _Text, + parser_class: Type[ArgumentParser], + dest: _Text = ..., + required: bool = ..., + help: Optional[_Text] = ..., + metavar: Optional[Union[_Text, Tuple[_Text, ...]]] = ...) -> None: ... + # TODO: Type keyword args properly. + def add_parser(self, name: _Text, **kwargs: Any) -> ArgumentParser: ... + def _get_subactions(self) -> List[Action]: ... + +# undocumented +class ArgumentTypeError(Exception): ... + +if sys.version_info < (3, 7): + # undocumented + def _ensure_value(namespace: Namespace, name: _Text, value: Any) -> Any: ... + +# undocumented +def _get_action_name(argument: Optional[Action]) -> Optional[str]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/array.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/array.pyi new file mode 100644 index 0000000..01c6f99 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/array.pyi @@ -0,0 +1,73 @@ +# Stubs for array + +# Based on http://docs.python.org/3.6/library/array.html + +import sys +from typing import (Any, BinaryIO, Generic, Iterable, Iterator, List, MutableSequence, + overload, Text, Tuple, TypeVar, Union) + +_T = TypeVar('_T', int, float, Text) + +if sys.version_info >= (3,): + typecodes: str + +class array(MutableSequence[_T], Generic[_T]): + typecode: str + itemsize: int + def __init__(self, typecode: str, + __initializer: Union[bytes, Iterable[_T]] = ...) -> None: ... + def append(self, x: _T) -> None: ... + def buffer_info(self) -> Tuple[int, int]: ... + def byteswap(self) -> None: ... + def count(self, x: Any) -> int: ... + def extend(self, iterable: Iterable[_T]) -> None: ... + if sys.version_info >= (3, 2): + def frombytes(self, s: bytes) -> None: ... + def fromfile(self, f: BinaryIO, n: int) -> None: ... + def fromlist(self, list: List[_T]) -> None: ... + def fromstring(self, s: bytes) -> None: ... + def fromunicode(self, s: str) -> None: ... + def index(self, x: _T) -> int: ... # type: ignore # Overrides Sequence + def insert(self, i: int, x: _T) -> None: ... + def pop(self, i: int = ...) -> _T: ... + if sys.version_info < (3,): + def read(self, f: BinaryIO, n: int) -> None: ... + def remove(self, x: Any) -> None: ... + def reverse(self) -> None: ... + if sys.version_info >= (3, 2): + def tobytes(self) -> bytes: ... + def tofile(self, f: BinaryIO) -> None: ... + def tolist(self) -> List[_T]: ... + def tostring(self) -> bytes: ... + def tounicode(self) -> str: ... + if sys.version_info < (3,): + def write(self, f: BinaryIO) -> None: ... + + def __len__(self) -> int: ... + + @overload + def __getitem__(self, i: int) -> _T: ... + @overload + def __getitem__(self, s: slice) -> array[_T]: ... + + @overload # type: ignore # Overrides MutableSequence + def __setitem__(self, i: int, o: _T) -> None: ... + @overload + def __setitem__(self, s: slice, o: array[_T]) -> None: ... + + def __delitem__(self, i: Union[int, slice]) -> None: ... + def __add__(self, x: array[_T]) -> array[_T]: ... + def __ge__(self, other: array[_T]) -> bool: ... + def __gt__(self, other: array[_T]) -> bool: ... + def __iadd__(self, x: array[_T]) -> array[_T]: ... # type: ignore # Overrides MutableSequence + def __imul__(self, n: int) -> array[_T]: ... + def __le__(self, other: array[_T]) -> bool: ... + def __lt__(self, other: array[_T]) -> bool: ... + def __mul__(self, n: int) -> array[_T]: ... + def __rmul__(self, n: int) -> array[_T]: ... + if sys.version_info < (3,): + def __delslice__(self, i: int, j: int) -> None: ... + def __getslice__(self, i: int, j: int) -> array[_T]: ... + def __setslice__(self, i: int, j: int, y: array[_T]) -> None: ... + +ArrayType = array diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/asynchat.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/asynchat.pyi new file mode 100644 index 0000000..a359ae7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/asynchat.pyi @@ -0,0 +1,41 @@ +from abc import abstractmethod +import asyncore +import socket +import sys +from typing import Optional, Sequence, Tuple, Union + + +class simple_producer: + def __init__(self, data: bytes, buffer_size: int = ...) -> None: ... + def more(self) -> bytes: ... + +class async_chat(asyncore.dispatcher): + ac_in_buffer_size: int + ac_out_buffer_size: int + def __init__(self, sock: Optional[socket.socket] = ..., map: Optional[asyncore._maptype] = ...) -> None: ... + + @abstractmethod + def collect_incoming_data(self, data: bytes) -> None: ... + @abstractmethod + def found_terminator(self) -> None: ... + def set_terminator(self, term: Union[bytes, int, None]) -> None: ... + def get_terminator(self) -> Union[bytes, int, None]: ... + def handle_read(self) -> None: ... + def handle_write(self) -> None: ... + def handle_close(self) -> None: ... + def push(self, data: bytes) -> None: ... + def push_with_producer(self, producer: simple_producer) -> None: ... + def readable(self) -> bool: ... + def writable(self) -> bool: ... + def close_when_done(self) -> None: ... + def initiate_send(self) -> None: ... + def discard_buffers(self) -> None: ... + +if sys.version_info < (3, 0): + class fifo: + def __init__(self, list: Sequence[Union[bytes, simple_producer]] = ...) -> None: ... + def __len__(self) -> int: ... + def is_empty(self) -> bool: ... + def first(self) -> bytes: ... + def push(self, data: Union[bytes, simple_producer]) -> None: ... + def pop(self) -> Tuple[int, bytes]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/asyncore.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/asyncore.pyi new file mode 100644 index 0000000..8dc8f47 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/asyncore.pyi @@ -0,0 +1,144 @@ +from typing import Tuple, Union, Optional, Any, Dict, overload + +import os +import select +import sys +import time +import warnings +from socket import SocketType +from typing import Optional + +from errno import (EALREADY, EINPROGRESS, EWOULDBLOCK, ECONNRESET, EINVAL, + ENOTCONN, ESHUTDOWN, EINTR, EISCONN, EBADF, ECONNABORTED, + EPIPE, EAGAIN, errorcode) + +# cyclic dependence with asynchat +_maptype = Dict[str, Any] + + +class ExitNow(Exception): ... + +def read(obj: Any) -> None: ... +def write(obj: Any) -> None: ... +def readwrite(obj: Any, flags: int) -> None: ... +def poll(timeout: float = ..., map: _maptype = ...) -> None: ... +def poll2(timeout: float = ..., map: _maptype = ...) -> None: ... + +poll3 = poll2 + +def loop(timeout: float = ..., use_poll: bool = ..., map: _maptype = ..., count: Optional[int] = ...) -> None: ... + + +# Not really subclass of socket.socket; it's only delegation. +# It is not covariant to it. +class dispatcher: + + debug: bool + connected: bool + accepting: bool + connecting: bool + closing: bool + ignore_log_types: frozenset[str] + socket: Optional[SocketType] + + def __init__(self, sock: Optional[SocketType] = ..., map: _maptype = ...) -> None: ... + def add_channel(self, map: _maptype = ...) -> None: ... + def del_channel(self, map: _maptype = ...) -> None: ... + def create_socket(self, family: int, type: int) -> None: ... + def set_socket(self, sock: SocketType, map: _maptype = ...) -> None: ... + def set_reuse_addr(self) -> None: ... + def readable(self) -> bool: ... + def writable(self) -> bool: ... + def listen(self, backlog: int) -> None: ... + def bind(self, address: Union[tuple, str]) -> None: ... + def connect(self, address: Union[tuple, str]) -> None: ... + def accept(self) -> Optional[Tuple[SocketType, Any]]: ... + def send(self, data: bytes) -> int: ... + def recv(self, buffer_size: int) -> bytes: ... + def close(self) -> None: ... + + def log(self, message: Any) -> None: ... + def log_info(self, message: Any, type: str = ...) -> None: ... + def handle_read_event(self) -> None: ... + def handle_connect_event(self) -> None: ... + def handle_write_event(self) -> None: ... + def handle_expt_event(self) -> None: ... + def handle_error(self) -> None: ... + def handle_expt(self) -> None: ... + def handle_read(self) -> None: ... + def handle_write(self) -> None: ... + def handle_connect(self) -> None: ... + def handle_accept(self) -> None: ... + def handle_close(self) -> None: ... + + if sys.version_info < (3, 5): + # Historically, some methods were "imported" from `self.socket` by + # means of `__getattr__`. This was long deprecated, and as of Python + # 3.5 has been removed; simply call the relevant methods directly on + # self.socket if necessary. + + def detach(self) -> int: ... + def fileno(self) -> int: ... + + # return value is an address + def getpeername(self) -> Any: ... + def getsockname(self) -> Any: ... + + @overload + def getsockopt(self, level: int, optname: int) -> int: ... + @overload + def getsockopt(self, level: int, optname: int, buflen: int) -> bytes: ... + + def gettimeout(self) -> float: ... + def ioctl(self, control: object, + option: Tuple[int, int, int]) -> None: ... + # TODO the return value may be BinaryIO or TextIO, depending on mode + def makefile(self, mode: str = ..., buffering: int = ..., + encoding: str = ..., errors: str = ..., + newline: str = ...) -> Any: + ... + + # return type is an address + def recvfrom(self, bufsize: int, flags: int = ...) -> Any: ... + def recvfrom_into(self, buffer: bytes, nbytes: int, flags: int = ...) -> Any: ... + def recv_into(self, buffer: bytes, nbytes: int, flags: int = ...) -> Any: ... + def sendall(self, data: bytes, flags: int = ...) -> None: ... + def sendto(self, data: bytes, address: Union[tuple, str], flags: int = ...) -> int: ... + def setblocking(self, flag: bool) -> None: ... + def settimeout(self, value: Union[float, None]) -> None: ... + def setsockopt(self, level: int, optname: int, value: Union[int, bytes]) -> None: ... + def shutdown(self, how: int) -> None: ... + +class dispatcher_with_send(dispatcher): + def __init__(self, sock: SocketType = ..., map: _maptype = ...) -> None: ... + def initiate_send(self) -> None: ... + def handle_write(self) -> None: ... + # incompatible signature: + # def send(self, data: bytes) -> Optional[int]: ... + +def compact_traceback() -> Tuple[Tuple[str, str, str], type, type, str]: ... +def close_all(map: _maptype = ..., ignore_all: bool = ...) -> None: ... + +# if os.name == 'posix': +# import fcntl +class file_wrapper: + fd: int + + def __init__(self, fd: int) -> None: ... + def recv(self, bufsize: int, flags: int = ...) -> bytes: ... + def send(self, data: bytes, flags: int = ...) -> int: ... + + @overload + def getsockopt(self, level: int, optname: int) -> int: ... + @overload + def getsockopt(self, level: int, optname: int, buflen: int) -> bytes: ... + + def read(self, bufsize: int, flags: int = ...) -> bytes: ... + def write(self, data: bytes, flags: int = ...) -> int: ... + + def close(self) -> None: ... + def fileno(self) -> int: ... + +class file_dispatcher(dispatcher): + def __init__(self, fd: int, map: _maptype = ...) -> None: ... + def set_file(self, fd: int) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/base64.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/base64.pyi new file mode 100644 index 0000000..7c648c8 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/base64.pyi @@ -0,0 +1,38 @@ +# Stubs for base64 + +from typing import IO, Union, Text +import sys + +if sys.version_info < (3,): + _encodable = Union[bytes, unicode] + _decodable = Union[bytes, unicode] +else: + _encodable = bytes + _decodable = Union[bytes, str] + +def b64encode(s: _encodable, altchars: bytes = ...) -> bytes: ... +def b64decode(s: _decodable, altchars: bytes = ..., + validate: bool = ...) -> bytes: ... +def standard_b64encode(s: _encodable) -> bytes: ... +def standard_b64decode(s: _decodable) -> bytes: ... +def urlsafe_b64encode(s: _encodable) -> bytes: ... +def urlsafe_b64decode(s: _decodable) -> bytes: ... +def b32encode(s: _encodable) -> bytes: ... +def b32decode(s: _decodable, casefold: bool = ..., + map01: bytes = ...) -> bytes: ... +def b16encode(s: _encodable) -> bytes: ... +def b16decode(s: _decodable, casefold: bool = ...) -> bytes: ... +if sys.version_info >= (3, 4): + def a85encode(b: _encodable, *, foldspaces: bool = ..., wrapcol: int = ..., + pad: bool = ..., adobe: bool = ...) -> bytes: ... + def a85decode(b: _decodable, *, foldspaces: bool = ..., + adobe: bool = ..., ignorechars: Union[str, bytes] = ...) -> bytes: ... + def b85encode(b: _encodable, pad: bool = ...) -> bytes: ... + def b85decode(b: _decodable) -> bytes: ... + +def decode(input: IO[bytes], output: IO[bytes]) -> None: ... +def decodebytes(s: bytes) -> bytes: ... +def decodestring(s: bytes) -> bytes: ... +def encode(input: IO[bytes], output: IO[bytes]) -> None: ... +def encodebytes(s: bytes) -> bytes: ... +def encodestring(s: bytes) -> bytes: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/binascii.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/binascii.pyi new file mode 100644 index 0000000..9689b71 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/binascii.pyi @@ -0,0 +1,47 @@ +# Stubs for binascii + +# Based on http://docs.python.org/3.2/library/binascii.html + +import sys +from typing import Union, Text + + +if sys.version_info < (3,): + # Python 2 accepts unicode ascii pretty much everywhere. + _Bytes = Union[bytes, Text] + _Ascii = Union[bytes, Text] +elif sys.version_info < (3, 3): + # Python 3.2 and below only accepts bytes. + _Bytes = bytes + _Ascii = bytes +else: + # But since Python 3.3 ASCII-only unicode strings are accepted by the + # a2b_* functions. + _Bytes = bytes + _Ascii = Union[bytes, Text] + +def a2b_uu(string: _Ascii) -> bytes: ... +if sys.version_info >= (3, 7): + def b2a_uu(data: _Bytes, *, backtick: bool = ...) -> bytes: ... +else: + def b2a_uu(data: _Bytes) -> bytes: ... +def a2b_base64(string: _Ascii) -> bytes: ... +if sys.version_info >= (3, 6): + def b2a_base64(data: _Bytes, *, newline: bool = ...) -> bytes: ... +else: + def b2a_base64(data: _Bytes) -> bytes: ... +def a2b_qp(string: _Ascii, header: bool = ...) -> bytes: ... +def b2a_qp(data: _Bytes, quotetabs: bool = ..., istext: bool = ..., header: bool = ...) -> bytes: ... +def a2b_hqx(string: _Ascii) -> bytes: ... +def rledecode_hqx(data: _Bytes) -> bytes: ... +def rlecode_hqx(data: _Bytes) -> bytes: ... +def b2a_hqx(data: _Bytes) -> bytes: ... +def crc_hqx(data: _Bytes, crc: int) -> int: ... +def crc32(data: _Bytes, crc: int = ...) -> int: ... +def b2a_hex(data: _Bytes) -> bytes: ... +def hexlify(data: _Bytes) -> bytes: ... +def a2b_hex(hexstr: _Ascii) -> bytes: ... +def unhexlify(hexlify: _Ascii) -> bytes: ... + +class Error(Exception): ... +class Incomplete(Exception): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/binhex.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/binhex.pyi new file mode 100644 index 0000000..c759ba0 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/binhex.pyi @@ -0,0 +1,48 @@ +from typing import ( + Any, + IO, + Tuple, + Union, +) + + +class Error(Exception): ... + +REASONABLY_LARGE: int +LINELEN: int +RUNCHAR: bytes + +class FInfo: + def __init__(self) -> None: ... + Type: str + Creator: str + Flags: int + +_FileInfoTuple = Tuple[str, FInfo, int, int] +_FileHandleUnion = Union[str, IO[bytes]] + +def getfileinfo(name: str) -> _FileInfoTuple: ... + +class openrsrc: + def __init__(self, *args: Any) -> None: ... + def read(self, *args: Any) -> bytes: ... + def write(self, *args: Any) -> None: ... + def close(self) -> None: ... + +class BinHex: + def __init__(self, name_finfo_dlen_rlen: _FileInfoTuple, ofp: _FileHandleUnion) -> None: ... + def write(self, data: bytes) -> None: ... + def close_data(self) -> None: ... + def write_rsrc(self, data: bytes) -> None: ... + def close(self) -> None: ... + +def binhex(inp: str, out: str) -> None: ... + +class HexBin: + def __init__(self, ifp: _FileHandleUnion) -> None: ... + def read(self, *n: int) -> bytes: ... + def close_data(self) -> None: ... + def read_rsrc(self, *n: int) -> bytes: ... + def close(self) -> None: ... + +def hexbin(inp: str, out: str) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/bisect.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/bisect.pyi new file mode 100644 index 0000000..5c54112 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/bisect.pyi @@ -0,0 +1,22 @@ +# Stubs for bisect + +from typing import Any, Sequence, TypeVar + +_T = TypeVar('_T') + +# TODO uncomment when mypy# 2035 is fixed +# def bisect_left(a: Sequence[_T], x: _T, lo: int = ..., hi: int = ...) -> int: ... +# def bisect_right(a: Sequence[_T], x: _T, lo: int = ..., hi: int = ...) -> int: ... +# def bisect(a: Sequence[_T], x: _T, lo: int = ..., hi: int = ...) -> int: ... +# +# def insort_left(a: Sequence[_T], x: _T, lo: int = ..., hi: int = ...) -> int: ... +# def insort_right(a: Sequence[_T], x: _T, lo: int = ..., hi: int = ...) -> int: ... +# def insort(a: Sequence[_T], x: _T, lo: int = ..., hi: int = ...) -> int: ... + +def bisect_left(a: Sequence, x: Any, lo: int = ..., hi: int = ...) -> int: ... +def bisect_right(a: Sequence, x: Any, lo: int = ..., hi: int = ...) -> int: ... +def bisect(a: Sequence, x: Any, lo: int = ..., hi: int = ...) -> int: ... + +def insort_left(a: Sequence, x: Any, lo: int = ..., hi: int = ...) -> int: ... +def insort_right(a: Sequence, x: Any, lo: int = ..., hi: int = ...) -> int: ... +def insort(a: Sequence, x: Any, lo: int = ..., hi: int = ...) -> int: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/builtins.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/builtins.pyi new file mode 100644 index 0000000..cca0e4f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/builtins.pyi @@ -0,0 +1,1622 @@ +# True and False are deliberately omitted because they are keywords in +# Python 3, and stub files conform to Python 3 syntax. + +from typing import ( + TypeVar, Iterator, Iterable, NoReturn, overload, Container, + Sequence, MutableSequence, Mapping, MutableMapping, Tuple, List, Any, Dict, Callable, Generic, + Set, AbstractSet, FrozenSet, MutableSet, Sized, Reversible, SupportsInt, SupportsFloat, SupportsAbs, + SupportsComplex, IO, BinaryIO, Union, + ItemsView, KeysView, ValuesView, ByteString, Optional, AnyStr, Type, Text, + Protocol, +) +from abc import abstractmethod, ABCMeta +from ast import mod, AST +from types import TracebackType, CodeType +import sys + +if sys.version_info >= (3,): + from typing import SupportsBytes, SupportsRound + +_T = TypeVar('_T') +_T_co = TypeVar('_T_co', covariant=True) +_KT = TypeVar('_KT') +_VT = TypeVar('_VT') +_S = TypeVar('_S') +_T1 = TypeVar('_T1') +_T2 = TypeVar('_T2') +_T3 = TypeVar('_T3') +_T4 = TypeVar('_T4') +_T5 = TypeVar('_T5') +_TT = TypeVar('_TT', bound='type') + +class object: + __doc__: Optional[str] + __dict__: Dict[str, Any] + __slots__: Union[Text, Iterable[Text]] + __module__: str + if sys.version_info >= (3, 6): + __annotations__: Dict[str, Any] + + @property + def __class__(self: _T) -> Type[_T]: ... + @__class__.setter + def __class__(self, __type: Type[object]) -> None: ... + def __init__(self) -> None: ... + def __new__(cls) -> Any: ... + def __setattr__(self, name: str, value: Any) -> None: ... + def __eq__(self, o: object) -> bool: ... + def __ne__(self, o: object) -> bool: ... + def __str__(self) -> str: ... + def __repr__(self) -> str: ... + def __hash__(self) -> int: ... + def __format__(self, format_spec: str) -> str: ... + def __getattribute__(self, name: str) -> Any: ... + def __delattr__(self, name: str) -> None: ... + def __sizeof__(self) -> int: ... + def __reduce__(self) -> tuple: ... + def __reduce_ex__(self, protocol: int) -> tuple: ... + if sys.version_info >= (3,): + def __dir__(self) -> Iterable[str]: ... + if sys.version_info >= (3, 6): + def __init_subclass__(cls) -> None: ... + +class staticmethod(object): # Special, only valid as a decorator. + __func__: Callable + if sys.version_info >= (3,): + __isabstractmethod__: bool + + def __init__(self, f: Callable) -> None: ... + def __new__(cls: Type[_T], *args: Any, **kwargs: Any) -> _T: ... + def __get__(self, obj: _T, type: Optional[Type[_T]] = ...) -> Callable: ... + +class classmethod(object): # Special, only valid as a decorator. + __func__: Callable + if sys.version_info >= (3,): + __isabstractmethod__: bool + + def __init__(self, f: Callable) -> None: ... + def __new__(cls: Type[_T], *args: Any, **kwargs: Any) -> _T: ... + def __get__(self, obj: _T, type: Optional[Type[_T]] = ...) -> Callable: ... + +class type(object): + __base__: type + __bases__: Tuple[type, ...] + __basicsize__: int + __dict__: Dict[str, Any] + __dictoffset__: int + __flags__: int + __itemsize__: int + __module__: str + __mro__: Tuple[type, ...] + __name__: str + if sys.version_info >= (3,): + __qualname__: str + __text_signature__: Optional[str] + __weakrefoffset__: int + + @overload + def __init__(self, o: object) -> None: ... + @overload + def __init__(self, name: str, bases: Tuple[type, ...], dict: Dict[str, Any]) -> None: ... + @overload + def __new__(cls, o: object) -> type: ... + @overload + def __new__(cls, name: str, bases: Tuple[type, ...], namespace: Dict[str, Any]) -> type: ... + def __call__(self, *args: Any, **kwds: Any) -> Any: ... + def __subclasses__(self: _TT) -> List[_TT]: ... + # Note: the documentation doesnt specify what the return type is, the standard + # implementation seems to be returning a list. + def mro(self) -> List[type]: ... + def __instancecheck__(self, instance: Any) -> bool: ... + def __subclasscheck__(self, subclass: type) -> bool: ... + if sys.version_info >= (3,): + @classmethod + def __prepare__(metacls, __name: str, __bases: Tuple[type, ...], **kwds: Any) -> Mapping[str, Any]: ... + +class super(object): + if sys.version_info >= (3,): + @overload + def __init__(self, t: Any, obj: Any) -> None: ... + @overload + def __init__(self, t: Any) -> None: ... + @overload + def __init__(self) -> None: ... + else: + @overload + def __init__(self, t: Any, obj: Any) -> None: ... + @overload + def __init__(self, t: Any) -> None: ... + +class int: + @overload + def __init__(self, x: Union[Text, bytes, SupportsInt] = ...) -> None: ... + @overload + def __init__(self, x: Union[Text, bytes, bytearray], base: int) -> None: ... + + @property + def real(self) -> int: ... + @property + def imag(self) -> int: ... + @property + def numerator(self) -> int: ... + @property + def denominator(self) -> int: ... + def conjugate(self) -> int: ... + + def bit_length(self) -> int: ... + if sys.version_info >= (3,): + def to_bytes(self, length: int, byteorder: str, *, signed: bool = ...) -> bytes: ... + @classmethod + def from_bytes(cls, bytes: Sequence[int], byteorder: str, *, + signed: bool = ...) -> int: ... # TODO buffer object argument + + def __add__(self, x: int) -> int: ... + def __sub__(self, x: int) -> int: ... + def __mul__(self, x: int) -> int: ... + def __floordiv__(self, x: int) -> int: ... + if sys.version_info < (3,): + def __div__(self, x: int) -> int: ... + def __truediv__(self, x: int) -> float: ... + def __mod__(self, x: int) -> int: ... + def __divmod__(self, x: int) -> Tuple[int, int]: ... + def __radd__(self, x: int) -> int: ... + def __rsub__(self, x: int) -> int: ... + def __rmul__(self, x: int) -> int: ... + def __rfloordiv__(self, x: int) -> int: ... + if sys.version_info < (3,): + def __rdiv__(self, x: int) -> int: ... + def __rtruediv__(self, x: int) -> float: ... + def __rmod__(self, x: int) -> int: ... + def __rdivmod__(self, x: int) -> Tuple[int, int]: ... + def __pow__(self, x: int) -> Any: ... # Return type can be int or float, depending on x. + def __rpow__(self, x: int) -> Any: ... + def __and__(self, n: int) -> int: ... + def __or__(self, n: int) -> int: ... + def __xor__(self, n: int) -> int: ... + def __lshift__(self, n: int) -> int: ... + def __rshift__(self, n: int) -> int: ... + def __rand__(self, n: int) -> int: ... + def __ror__(self, n: int) -> int: ... + def __rxor__(self, n: int) -> int: ... + def __rlshift__(self, n: int) -> int: ... + def __rrshift__(self, n: int) -> int: ... + def __neg__(self) -> int: ... + def __pos__(self) -> int: ... + def __invert__(self) -> int: ... + if sys.version_info >= (3,): + def __round__(self, ndigits: Optional[int] = ...) -> int: ... + def __getnewargs__(self) -> Tuple[int]: ... + + def __eq__(self, x: object) -> bool: ... + def __ne__(self, x: object) -> bool: ... + def __lt__(self, x: int) -> bool: ... + def __le__(self, x: int) -> bool: ... + def __gt__(self, x: int) -> bool: ... + def __ge__(self, x: int) -> bool: ... + + def __str__(self) -> str: ... + def __float__(self) -> float: ... + def __int__(self) -> int: ... + def __abs__(self) -> int: ... + def __hash__(self) -> int: ... + if sys.version_info >= (3,): + def __bool__(self) -> bool: ... + else: + def __nonzero__(self) -> bool: ... + def __index__(self) -> int: ... + +class float: + def __init__(self, x: Union[SupportsFloat, Text, bytes, bytearray] = ...) -> None: ... + def as_integer_ratio(self) -> Tuple[int, int]: ... + def hex(self) -> str: ... + def is_integer(self) -> bool: ... + @classmethod + def fromhex(cls, s: str) -> float: ... + + @property + def real(self) -> float: ... + @property + def imag(self) -> float: ... + def conjugate(self) -> float: ... + + def __add__(self, x: float) -> float: ... + def __sub__(self, x: float) -> float: ... + def __mul__(self, x: float) -> float: ... + def __floordiv__(self, x: float) -> float: ... + if sys.version_info < (3,): + def __div__(self, x: float) -> float: ... + def __truediv__(self, x: float) -> float: ... + def __mod__(self, x: float) -> float: ... + def __divmod__(self, x: float) -> Tuple[float, float]: ... + def __pow__(self, x: float) -> float: ... # In Python 3, returns complex if self is negative and x is not whole + def __radd__(self, x: float) -> float: ... + def __rsub__(self, x: float) -> float: ... + def __rmul__(self, x: float) -> float: ... + def __rfloordiv__(self, x: float) -> float: ... + if sys.version_info < (3,): + def __rdiv__(self, x: float) -> float: ... + def __rtruediv__(self, x: float) -> float: ... + def __rmod__(self, x: float) -> float: ... + def __rdivmod__(self, x: float) -> Tuple[float, float]: ... + def __rpow__(self, x: float) -> float: ... + def __getnewargs__(self) -> Tuple[float]: ... + if sys.version_info >= (3,): + @overload + def __round__(self) -> int: ... + @overload + def __round__(self, ndigits: None) -> int: ... + @overload + def __round__(self, ndigits: int) -> float: ... + + def __eq__(self, x: object) -> bool: ... + def __ne__(self, x: object) -> bool: ... + def __lt__(self, x: float) -> bool: ... + def __le__(self, x: float) -> bool: ... + def __gt__(self, x: float) -> bool: ... + def __ge__(self, x: float) -> bool: ... + def __neg__(self) -> float: ... + def __pos__(self) -> float: ... + + def __str__(self) -> str: ... + def __int__(self) -> int: ... + def __float__(self) -> float: ... + def __abs__(self) -> float: ... + def __hash__(self) -> int: ... + if sys.version_info >= (3,): + def __bool__(self) -> bool: ... + else: + def __nonzero__(self) -> bool: ... + +class complex: + @overload + def __init__(self, re: float = ..., im: float = ...) -> None: ... + @overload + def __init__(self, s: str) -> None: ... + @overload + def __init__(self, s: SupportsComplex) -> None: ... + + @property + def real(self) -> float: ... + @property + def imag(self) -> float: ... + + def conjugate(self) -> complex: ... + + def __add__(self, x: complex) -> complex: ... + def __sub__(self, x: complex) -> complex: ... + def __mul__(self, x: complex) -> complex: ... + def __pow__(self, x: complex) -> complex: ... + if sys.version_info < (3,): + def __div__(self, x: complex) -> complex: ... + def __truediv__(self, x: complex) -> complex: ... + def __radd__(self, x: complex) -> complex: ... + def __rsub__(self, x: complex) -> complex: ... + def __rmul__(self, x: complex) -> complex: ... + def __rpow__(self, x: complex) -> complex: ... + if sys.version_info < (3,): + def __rdiv__(self, x: complex) -> complex: ... + def __rtruediv__(self, x: complex) -> complex: ... + + def __eq__(self, x: object) -> bool: ... + def __ne__(self, x: object) -> bool: ... + def __neg__(self) -> complex: ... + def __pos__(self) -> complex: ... + + def __str__(self) -> str: ... + def __complex__(self) -> complex: ... + def __abs__(self) -> float: ... + def __hash__(self) -> int: ... + if sys.version_info >= (3,): + def __bool__(self) -> bool: ... + else: + def __nonzero__(self) -> bool: ... + +if sys.version_info >= (3,): + _str_base = object +else: + class basestring(metaclass=ABCMeta): ... + + class unicode(basestring, Sequence[unicode]): + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, o: object) -> None: ... + @overload + def __init__(self, o: str, encoding: unicode = ..., errors: unicode = ...) -> None: ... + def capitalize(self) -> unicode: ... + def center(self, width: int, fillchar: unicode = ...) -> unicode: ... + def count(self, x: unicode) -> int: ... + def decode(self, encoding: unicode = ..., errors: unicode = ...) -> unicode: ... + def encode(self, encoding: unicode = ..., errors: unicode = ...) -> str: ... + def endswith(self, suffix: Union[unicode, Tuple[unicode, ...]], start: int = ..., + end: int = ...) -> bool: ... + def expandtabs(self, tabsize: int = ...) -> unicode: ... + def find(self, sub: unicode, start: int = ..., end: int = ...) -> int: ... + def format(self, *args: Any, **kwargs: Any) -> unicode: ... + def index(self, sub: unicode, start: int = ..., end: int = ...) -> int: ... + def isalnum(self) -> bool: ... + def isalpha(self) -> bool: ... + def isdecimal(self) -> bool: ... + def isdigit(self) -> bool: ... + def isidentifier(self) -> bool: ... + def islower(self) -> bool: ... + def isnumeric(self) -> bool: ... + def isprintable(self) -> bool: ... + def isspace(self) -> bool: ... + def istitle(self) -> bool: ... + def isupper(self) -> bool: ... + def join(self, iterable: Iterable[unicode]) -> unicode: ... + def ljust(self, width: int, fillchar: unicode = ...) -> unicode: ... + def lower(self) -> unicode: ... + def lstrip(self, chars: unicode = ...) -> unicode: ... + def partition(self, sep: unicode) -> Tuple[unicode, unicode, unicode]: ... + def replace(self, old: unicode, new: unicode, count: int = ...) -> unicode: ... + def rfind(self, sub: unicode, start: int = ..., end: int = ...) -> int: ... + def rindex(self, sub: unicode, start: int = ..., end: int = ...) -> int: ... + def rjust(self, width: int, fillchar: unicode = ...) -> unicode: ... + def rpartition(self, sep: unicode) -> Tuple[unicode, unicode, unicode]: ... + def rsplit(self, sep: Optional[unicode] = ..., maxsplit: int = ...) -> List[unicode]: ... + def rstrip(self, chars: unicode = ...) -> unicode: ... + def split(self, sep: Optional[unicode] = ..., maxsplit: int = ...) -> List[unicode]: ... + def splitlines(self, keepends: bool = ...) -> List[unicode]: ... + def startswith(self, prefix: Union[unicode, Tuple[unicode, ...]], start: int = ..., + end: int = ...) -> bool: ... + def strip(self, chars: unicode = ...) -> unicode: ... + def swapcase(self) -> unicode: ... + def title(self) -> unicode: ... + def translate(self, table: Union[Dict[int, Any], unicode]) -> unicode: ... + def upper(self) -> unicode: ... + def zfill(self, width: int) -> unicode: ... + + @overload + def __getitem__(self, i: int) -> unicode: ... + @overload + def __getitem__(self, s: slice) -> unicode: ... + def __getslice__(self, start: int, stop: int) -> unicode: ... + def __add__(self, s: unicode) -> unicode: ... + def __mul__(self, n: int) -> unicode: ... + def __rmul__(self, n: int) -> unicode: ... + def __mod__(self, x: Any) -> unicode: ... + def __eq__(self, x: object) -> bool: ... + def __ne__(self, x: object) -> bool: ... + def __lt__(self, x: unicode) -> bool: ... + def __le__(self, x: unicode) -> bool: ... + def __gt__(self, x: unicode) -> bool: ... + def __ge__(self, x: unicode) -> bool: ... + + def __len__(self) -> int: ... + # The argument type is incompatible with Sequence + def __contains__(self, s: Union[unicode, bytes]) -> bool: ... # type: ignore + def __iter__(self) -> Iterator[unicode]: ... + def __str__(self) -> str: ... + def __repr__(self) -> str: ... + def __int__(self) -> int: ... + def __float__(self) -> float: ... + def __hash__(self) -> int: ... + def __getnewargs__(self) -> Tuple[unicode]: ... + + _str_base = basestring + +class str(Sequence[str], _str_base): + if sys.version_info >= (3,): + @overload + def __init__(self, o: object = ...) -> None: ... + @overload + def __init__(self, o: bytes, encoding: str = ..., errors: str = ...) -> None: ... + else: + def __init__(self, o: object = ...) -> None: ... + + def capitalize(self) -> str: ... + if sys.version_info >= (3, 3): + def casefold(self) -> str: ... + def center(self, width: int, fillchar: str = ...) -> str: ... + def count(self, x: Text, __start: Optional[int] = ..., __end: Optional[int] = ...) -> int: ... + if sys.version_info < (3,): + def decode(self, encoding: Text = ..., errors: Text = ...) -> unicode: ... + def encode(self, encoding: Text = ..., errors: Text = ...) -> bytes: ... + if sys.version_info >= (3,): + def endswith(self, suffix: Union[Text, Tuple[Text, ...]], start: Optional[int] = ..., + end: Optional[int] = ...) -> bool: ... + else: + def endswith(self, suffix: Union[Text, Tuple[Text, ...]]) -> bool: ... + def expandtabs(self, tabsize: int = ...) -> str: ... + def find(self, sub: Text, __start: Optional[int] = ..., __end: Optional[int] = ...) -> int: ... + def format(self, *args: Any, **kwargs: Any) -> str: ... + if sys.version_info >= (3,): + def format_map(self, map: Mapping[str, Any]) -> str: ... + def index(self, sub: Text, __start: Optional[int] = ..., __end: Optional[int] = ...) -> int: ... + def isalnum(self) -> bool: ... + def isalpha(self) -> bool: ... + if sys.version_info >= (3, 7): + def isascii(self) -> bool: ... + if sys.version_info >= (3,): + def isdecimal(self) -> bool: ... + def isdigit(self) -> bool: ... + if sys.version_info >= (3,): + def isidentifier(self) -> bool: ... + def islower(self) -> bool: ... + if sys.version_info >= (3,): + def isnumeric(self) -> bool: ... + def isprintable(self) -> bool: ... + def isspace(self) -> bool: ... + def istitle(self) -> bool: ... + def isupper(self) -> bool: ... + if sys.version_info >= (3,): + def join(self, iterable: Iterable[str]) -> str: ... + else: + def join(self, iterable: Iterable[AnyStr]) -> AnyStr: ... + def ljust(self, width: int, fillchar: str = ...) -> str: ... + def lower(self) -> str: ... + if sys.version_info >= (3,): + def lstrip(self, chars: Optional[str] = ...) -> str: ... + def partition(self, sep: str) -> Tuple[str, str, str]: ... + def replace(self, old: str, new: str, count: int = ...) -> str: ... + else: + @overload + def lstrip(self, chars: str = ...) -> str: ... + @overload + def lstrip(self, chars: unicode) -> unicode: ... + @overload + def partition(self, sep: bytearray) -> Tuple[str, bytearray, str]: ... + @overload + def partition(self, sep: str) -> Tuple[str, str, str]: ... + @overload + def partition(self, sep: unicode) -> Tuple[unicode, unicode, unicode]: ... + def replace(self, old: AnyStr, new: AnyStr, count: int = ...) -> AnyStr: ... + def rfind(self, sub: Text, __start: Optional[int] = ..., __end: Optional[int] = ...) -> int: ... + def rindex(self, sub: Text, __start: Optional[int] = ..., __end: Optional[int] = ...) -> int: ... + def rjust(self, width: int, fillchar: str = ...) -> str: ... + if sys.version_info >= (3,): + def rpartition(self, sep: str) -> Tuple[str, str, str]: ... + def rsplit(self, sep: Optional[str] = ..., maxsplit: int = ...) -> List[str]: ... + def rstrip(self, chars: Optional[str] = ...) -> str: ... + def split(self, sep: Optional[str] = ..., maxsplit: int = ...) -> List[str]: ... + else: + @overload + def rpartition(self, sep: bytearray) -> Tuple[str, bytearray, str]: ... + @overload + def rpartition(self, sep: str) -> Tuple[str, str, str]: ... + @overload + def rpartition(self, sep: unicode) -> Tuple[unicode, unicode, unicode]: ... + @overload + def rsplit(self, sep: Optional[str] = ..., maxsplit: int = ...) -> List[str]: ... + @overload + def rsplit(self, sep: unicode, maxsplit: int = ...) -> List[unicode]: ... + @overload + def rstrip(self, chars: str = ...) -> str: ... + @overload + def rstrip(self, chars: unicode) -> unicode: ... + @overload + def split(self, sep: Optional[str] = ..., maxsplit: int = ...) -> List[str]: ... + @overload + def split(self, sep: unicode, maxsplit: int = ...) -> List[unicode]: ... + def splitlines(self, keepends: bool = ...) -> List[str]: ... + if sys.version_info >= (3,): + def startswith(self, prefix: Union[Text, Tuple[Text, ...]], start: Optional[int] = ..., + end: Optional[int] = ...) -> bool: ... + def strip(self, chars: Optional[str] = ...) -> str: ... + else: + def startswith(self, prefix: Union[Text, Tuple[Text, ...]]) -> bool: ... + @overload + def strip(self, chars: str = ...) -> str: ... + @overload + def strip(self, chars: unicode) -> unicode: ... + def swapcase(self) -> str: ... + def title(self) -> str: ... + if sys.version_info >= (3,): + def translate(self, table: Union[Mapping[int, Union[int, str, None]], Sequence[Union[int, str, None]]]) -> str: ... + else: + def translate(self, table: Optional[AnyStr], deletechars: AnyStr = ...) -> AnyStr: ... + def upper(self) -> str: ... + def zfill(self, width: int) -> str: ... + if sys.version_info >= (3,): + @staticmethod + @overload + def maketrans(x: Union[Dict[int, _T], Dict[str, _T], Dict[Union[str, int], _T]]) -> Dict[int, _T]: ... + @staticmethod + @overload + def maketrans(x: str, y: str, z: str = ...) -> Dict[int, Union[int, None]]: ... + + if sys.version_info >= (3,): + def __add__(self, s: str) -> str: ... + else: + def __add__(self, s: AnyStr) -> AnyStr: ... + # Incompatible with Sequence.__contains__ + def __contains__(self, o: Union[str, Text]) -> bool: ... # type: ignore + def __eq__(self, x: object) -> bool: ... + def __ge__(self, x: Text) -> bool: ... + def __getitem__(self, i: Union[int, slice]) -> str: ... + def __gt__(self, x: Text) -> bool: ... + def __hash__(self) -> int: ... + def __iter__(self) -> Iterator[str]: ... + def __le__(self, x: Text) -> bool: ... + def __len__(self) -> int: ... + def __lt__(self, x: Text) -> bool: ... + def __mod__(self, x: Any) -> str: ... + def __mul__(self, n: int) -> str: ... + def __ne__(self, x: object) -> bool: ... + def __repr__(self) -> str: ... + def __rmul__(self, n: int) -> str: ... + def __str__(self) -> str: ... + def __getnewargs__(self) -> Tuple[str]: ... + + if sys.version_info < (3,): + def __getslice__(self, start: int, stop: int) -> str: ... + def __float__(self) -> float: ... + def __int__(self) -> int: ... + +if sys.version_info >= (3,): + class bytes(ByteString): + @overload + def __init__(self, ints: Iterable[int]) -> None: ... + @overload + def __init__(self, string: str, encoding: str, + errors: str = ...) -> None: ... + @overload + def __init__(self, length: int) -> None: ... + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, o: SupportsBytes) -> None: ... + def capitalize(self) -> bytes: ... + def center(self, width: int, fillchar: bytes = ...) -> bytes: ... + def count(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... + def decode(self, encoding: str = ..., errors: str = ...) -> str: ... + def endswith(self, suffix: Union[bytes, Tuple[bytes, ...]]) -> bool: ... + def expandtabs(self, tabsize: int = ...) -> bytes: ... + def find(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... + if sys.version_info >= (3, 5): + def hex(self) -> str: ... + def index(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... + def isalnum(self) -> bool: ... + def isalpha(self) -> bool: ... + if sys.version_info >= (3, 7): + def isascii(self) -> bool: ... + def isdigit(self) -> bool: ... + def islower(self) -> bool: ... + def isspace(self) -> bool: ... + def istitle(self) -> bool: ... + def isupper(self) -> bool: ... + def join(self, iterable: Iterable[Union[ByteString, memoryview]]) -> bytes: ... + def ljust(self, width: int, fillchar: bytes = ...) -> bytes: ... + def lower(self) -> bytes: ... + def lstrip(self, chars: Optional[bytes] = ...) -> bytes: ... + def partition(self, sep: bytes) -> Tuple[bytes, bytes, bytes]: ... + def replace(self, old: bytes, new: bytes, count: int = ...) -> bytes: ... + def rfind(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... + def rindex(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... + def rjust(self, width: int, fillchar: bytes = ...) -> bytes: ... + def rpartition(self, sep: bytes) -> Tuple[bytes, bytes, bytes]: ... + def rsplit(self, sep: Optional[bytes] = ..., maxsplit: int = ...) -> List[bytes]: ... + def rstrip(self, chars: Optional[bytes] = ...) -> bytes: ... + def split(self, sep: Optional[bytes] = ..., maxsplit: int = ...) -> List[bytes]: ... + def splitlines(self, keepends: bool = ...) -> List[bytes]: ... + def startswith( + self, + prefix: Union[bytes, Tuple[bytes, ...]], + start: Optional[int] = ..., + end: Optional[int] = ..., + ) -> bool: ... + def strip(self, chars: Optional[bytes] = ...) -> bytes: ... + def swapcase(self) -> bytes: ... + def title(self) -> bytes: ... + def translate(self, table: Optional[bytes], delete: bytes = ...) -> bytes: ... + def upper(self) -> bytes: ... + def zfill(self, width: int) -> bytes: ... + @classmethod + def fromhex(cls, s: str) -> bytes: ... + @classmethod + def maketrans(cls, frm: bytes, to: bytes) -> bytes: ... + + def __len__(self) -> int: ... + def __iter__(self) -> Iterator[int]: ... + def __str__(self) -> str: ... + def __repr__(self) -> str: ... + def __int__(self) -> int: ... + def __float__(self) -> float: ... + def __hash__(self) -> int: ... + @overload + def __getitem__(self, i: int) -> int: ... + @overload + def __getitem__(self, s: slice) -> bytes: ... + def __add__(self, s: bytes) -> bytes: ... + def __mul__(self, n: int) -> bytes: ... + def __rmul__(self, n: int) -> bytes: ... + if sys.version_info >= (3, 5): + def __mod__(self, value: Any) -> bytes: ... + # Incompatible with Sequence.__contains__ + def __contains__(self, o: Union[int, bytes]) -> bool: ... # type: ignore + def __eq__(self, x: object) -> bool: ... + def __ne__(self, x: object) -> bool: ... + def __lt__(self, x: bytes) -> bool: ... + def __le__(self, x: bytes) -> bool: ... + def __gt__(self, x: bytes) -> bool: ... + def __ge__(self, x: bytes) -> bool: ... + def __getnewargs__(self) -> Tuple[bytes]: ... +else: + bytes = str + +class bytearray(MutableSequence[int], ByteString): + if sys.version_info >= (3,): + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, ints: Iterable[int]) -> None: ... + @overload + def __init__(self, string: Text, encoding: Text, errors: Text = ...) -> None: ... + @overload + def __init__(self, length: int) -> None: ... + else: + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, ints: Iterable[int]) -> None: ... + @overload + def __init__(self, string: str) -> None: ... + @overload + def __init__(self, string: Text, encoding: Text, errors: Text = ...) -> None: ... + @overload + def __init__(self, length: int) -> None: ... + def capitalize(self) -> bytearray: ... + def center(self, width: int, fillchar: bytes = ...) -> bytearray: ... + if sys.version_info >= (3,): + def count(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... + def copy(self) -> bytearray: ... + else: + def count(self, x: str) -> int: ... + def decode(self, encoding: Text = ..., errors: Text = ...) -> str: ... + def endswith(self, suffix: Union[bytes, Tuple[bytes, ...]]) -> bool: ... + def expandtabs(self, tabsize: int = ...) -> bytearray: ... + if sys.version_info >= (3,): + def find(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... + if sys.version_info >= (3, 5): + def hex(self) -> str: ... + def index(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... + else: + def find(self, sub: str, start: int = ..., end: int = ...) -> int: ... + def index(self, sub: str, start: int = ..., end: int = ...) -> int: ... + def insert(self, index: int, object: int) -> None: ... + def isalnum(self) -> bool: ... + def isalpha(self) -> bool: ... + if sys.version_info >= (3, 7): + def isascii(self) -> bool: ... + def isdigit(self) -> bool: ... + def islower(self) -> bool: ... + def isspace(self) -> bool: ... + def istitle(self) -> bool: ... + def isupper(self) -> bool: ... + if sys.version_info >= (3,): + def join(self, iterable: Iterable[Union[ByteString, memoryview]]) -> bytearray: ... + def ljust(self, width: int, fillchar: bytes = ...) -> bytearray: ... + else: + def join(self, iterable: Iterable[str]) -> bytearray: ... + def ljust(self, width: int, fillchar: str = ...) -> bytearray: ... + def lower(self) -> bytearray: ... + def lstrip(self, chars: Optional[bytes] = ...) -> bytearray: ... + def partition(self, sep: bytes) -> Tuple[bytearray, bytearray, bytearray]: ... + def replace(self, old: bytes, new: bytes, count: int = ...) -> bytearray: ... + if sys.version_info >= (3,): + def rfind(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... + def rindex(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... + else: + def rfind(self, sub: bytes, start: int = ..., end: int = ...) -> int: ... + def rindex(self, sub: bytes, start: int = ..., end: int = ...) -> int: ... + def rjust(self, width: int, fillchar: bytes = ...) -> bytearray: ... + def rpartition(self, sep: bytes) -> Tuple[bytearray, bytearray, bytearray]: ... + def rsplit(self, sep: Optional[bytes] = ..., maxsplit: int = ...) -> List[bytearray]: ... + def rstrip(self, chars: Optional[bytes] = ...) -> bytearray: ... + def split(self, sep: Optional[bytes] = ..., maxsplit: int = ...) -> List[bytearray]: ... + def splitlines(self, keepends: bool = ...) -> List[bytearray]: ... + def startswith( + self, + prefix: Union[bytes, Tuple[bytes, ...]], + start: Optional[int] = ..., + end: Optional[int] = ..., + ) -> bool: ... + def strip(self, chars: Optional[bytes] = ...) -> bytearray: ... + def swapcase(self) -> bytearray: ... + def title(self) -> bytearray: ... + if sys.version_info >= (3,): + def translate(self, table: Optional[bytes], delete: bytes = ...) -> bytearray: ... + else: + def translate(self, table: str) -> bytearray: ... + def upper(self) -> bytearray: ... + def zfill(self, width: int) -> bytearray: ... + @staticmethod + def fromhex(s: str) -> bytearray: ... + if sys.version_info >= (3,): + @classmethod + def maketrans(cls, frm: bytes, to: bytes) -> bytes: ... + + def __len__(self) -> int: ... + def __iter__(self) -> Iterator[int]: ... + def __str__(self) -> str: ... + def __repr__(self) -> str: ... + def __int__(self) -> int: ... + def __float__(self) -> float: ... + def __hash__(self) -> int: ... + @overload + def __getitem__(self, i: int) -> int: ... + @overload + def __getitem__(self, s: slice) -> bytearray: ... + @overload + def __setitem__(self, i: int, x: int) -> None: ... + @overload + def __setitem__(self, s: slice, x: Union[Iterable[int], bytes]) -> None: ... + def __delitem__(self, i: Union[int, slice]) -> None: ... + if sys.version_info < (3,): + def __getslice__(self, start: int, stop: int) -> bytearray: ... + def __setslice__(self, start: int, stop: int, x: Union[Sequence[int], str]) -> None: ... + def __delslice__(self, start: int, stop: int) -> None: ... + def __add__(self, s: bytes) -> bytearray: ... + if sys.version_info >= (3,): + def __iadd__(self, s: Iterable[int]) -> bytearray: ... + def __mul__(self, n: int) -> bytearray: ... + if sys.version_info >= (3,): + def __rmul__(self, n: int) -> bytearray: ... + def __imul__(self, n: int) -> bytearray: ... + if sys.version_info >= (3, 5): + def __mod__(self, value: Any) -> bytes: ... + # Incompatible with Sequence.__contains__ + def __contains__(self, o: Union[int, bytes]) -> bool: ... # type: ignore + def __eq__(self, x: object) -> bool: ... + def __ne__(self, x: object) -> bool: ... + def __lt__(self, x: bytes) -> bool: ... + def __le__(self, x: bytes) -> bool: ... + def __gt__(self, x: bytes) -> bool: ... + def __ge__(self, x: bytes) -> bool: ... + +if sys.version_info >= (3,): + _mv_container_type = int +else: + _mv_container_type = str + +class memoryview(Sized, Container[_mv_container_type]): + format: str + itemsize: int + shape: Optional[Tuple[int, ...]] + strides: Optional[Tuple[int, ...]] + suboffsets: Optional[Tuple[int, ...]] + readonly: bool + ndim: int + + if sys.version_info >= (3,): + c_contiguous: bool + f_contiguous: bool + contiguous: bool + def __init__(self, obj: Union[bytes, bytearray, memoryview]) -> None: ... + def __enter__(self) -> memoryview: ... + def __exit__(self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType]) -> bool: ... + else: + def __init__(self, obj: Union[bytes, bytearray, buffer, memoryview]) -> None: ... + + @overload + def __getitem__(self, i: int) -> _mv_container_type: ... + @overload + def __getitem__(self, s: slice) -> memoryview: ... + + def __contains__(self, x: object) -> bool: ... + def __iter__(self) -> Iterator[_mv_container_type]: ... + def __len__(self) -> int: ... + + @overload + def __setitem__(self, i: int, o: bytes) -> None: ... + @overload + def __setitem__(self, s: slice, o: Sequence[bytes]) -> None: ... + @overload + def __setitem__(self, s: slice, o: memoryview) -> None: ... + + def tobytes(self) -> bytes: ... + def tolist(self) -> List[int]: ... + + if sys.version_info >= (3, 5): + def hex(self) -> str: ... + +class bool(int): + def __init__(self, o: object = ...) -> None: ... + @overload + def __and__(self, x: bool) -> bool: ... + @overload + def __and__(self, x: int) -> int: ... + @overload + def __or__(self, x: bool) -> bool: ... + @overload + def __or__(self, x: int) -> int: ... + @overload + def __xor__(self, x: bool) -> bool: ... + @overload + def __xor__(self, x: int) -> int: ... + @overload + def __rand__(self, x: bool) -> bool: ... + @overload + def __rand__(self, x: int) -> int: ... + @overload + def __ror__(self, x: bool) -> bool: ... + @overload + def __ror__(self, x: int) -> int: ... + @overload + def __rxor__(self, x: bool) -> bool: ... + @overload + def __rxor__(self, x: int) -> int: ... + def __getnewargs__(self) -> Tuple[int]: ... + +class slice(object): + start: Optional[int] + step: Optional[int] + stop: Optional[int] + @overload + def __init__(self, stop: Optional[int]) -> None: ... + @overload + def __init__(self, start: Optional[int], stop: Optional[int], step: Optional[int] = ...) -> None: ... + def indices(self, len: int) -> Tuple[int, int, int]: ... + +class tuple(Sequence[_T_co], Generic[_T_co]): + def __new__(cls: Type[_T], iterable: Iterable[_T_co] = ...) -> _T: ... + def __init__(self, iterable: Iterable[_T_co] = ...): ... + def __len__(self) -> int: ... + def __contains__(self, x: object) -> bool: ... + @overload + def __getitem__(self, x: int) -> _T_co: ... + @overload + def __getitem__(self, x: slice) -> Tuple[_T_co, ...]: ... + def __iter__(self) -> Iterator[_T_co]: ... + def __lt__(self, x: Tuple[_T_co, ...]) -> bool: ... + def __le__(self, x: Tuple[_T_co, ...]) -> bool: ... + def __gt__(self, x: Tuple[_T_co, ...]) -> bool: ... + def __ge__(self, x: Tuple[_T_co, ...]) -> bool: ... + def __add__(self, x: Tuple[_T_co, ...]) -> Tuple[_T_co, ...]: ... + def __mul__(self, n: int) -> Tuple[_T_co, ...]: ... + def __rmul__(self, n: int) -> Tuple[_T_co, ...]: ... + def count(self, x: Any) -> int: ... + if sys.version_info >= (3, 5): + def index(self, x: Any, start: int = ..., end: int = ...) -> int: ... + else: + def index(self, x: Any) -> int: ... + +class list(MutableSequence[_T], Generic[_T]): + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, iterable: Iterable[_T]) -> None: ... + if sys.version_info >= (3,): + def clear(self) -> None: ... + def copy(self) -> List[_T]: ... + def append(self, object: _T) -> None: ... + def extend(self, iterable: Iterable[_T]) -> None: ... + def pop(self, index: int = ...) -> _T: ... + def index(self, object: _T, start: int = ..., stop: int = ...) -> int: ... + def count(self, object: _T) -> int: ... + def insert(self, index: int, object: _T) -> None: ... + def remove(self, object: _T) -> None: ... + def reverse(self) -> None: ... + if sys.version_info >= (3,): + def sort(self, *, key: Optional[Callable[[_T], Any]] = ..., reverse: bool = ...) -> None: ... + else: + def sort(self, cmp: Callable[[_T, _T], Any] = ..., key: Callable[[_T], Any] = ..., reverse: bool = ...) -> None: ... + + def __len__(self) -> int: ... + def __iter__(self) -> Iterator[_T]: ... + def __str__(self) -> str: ... + def __hash__(self) -> int: ... + @overload + def __getitem__(self, i: int) -> _T: ... + @overload + def __getitem__(self, s: slice) -> List[_T]: ... + @overload + def __setitem__(self, i: int, o: _T) -> None: ... + @overload + def __setitem__(self, s: slice, o: Iterable[_T]) -> None: ... + def __delitem__(self, i: Union[int, slice]) -> None: ... + if sys.version_info < (3,): + def __getslice__(self, start: int, stop: int) -> List[_T]: ... + def __setslice__(self, start: int, stop: int, o: Sequence[_T]) -> None: ... + def __delslice__(self, start: int, stop: int) -> None: ... + def __add__(self, x: List[_T]) -> List[_T]: ... + def __iadd__(self: _S, x: Iterable[_T]) -> _S: ... + def __mul__(self, n: int) -> List[_T]: ... + def __rmul__(self, n: int) -> List[_T]: ... + if sys.version_info >= (3,): + def __imul__(self: _S, n: int) -> _S: ... + def __contains__(self, o: object) -> bool: ... + def __reversed__(self) -> Iterator[_T]: ... + def __gt__(self, x: List[_T]) -> bool: ... + def __ge__(self, x: List[_T]) -> bool: ... + def __lt__(self, x: List[_T]) -> bool: ... + def __le__(self, x: List[_T]) -> bool: ... + +class dict(MutableMapping[_KT, _VT], Generic[_KT, _VT]): + # NOTE: Keyword arguments are special. If they are used, _KT must include + # str, but we have no way of enforcing it here. + @overload + def __init__(self, **kwargs: _VT) -> None: ... + @overload + def __init__(self, map: Mapping[_KT, _VT], **kwargs: _VT) -> None: ... + @overload + def __init__(self, iterable: Iterable[Tuple[_KT, _VT]], **kwargs: _VT) -> None: ... + + def __new__(cls: Type[_T1], *args: Any, **kwargs: Any) -> _T1: ... + + if sys.version_info < (3,): + def has_key(self, k: _KT) -> bool: ... + def clear(self) -> None: ... + def copy(self) -> Dict[_KT, _VT]: ... + def popitem(self) -> Tuple[_KT, _VT]: ... + def setdefault(self, k: _KT, default: _VT = ...) -> _VT: ... + @overload + def update(self, __m: Mapping[_KT, _VT], **kwargs: _VT) -> None: ... + @overload + def update(self, __m: Iterable[Tuple[_KT, _VT]], **kwargs: _VT) -> None: ... + @overload + def update(self, **kwargs: _VT) -> None: ... + if sys.version_info >= (3,): + def keys(self) -> KeysView[_KT]: ... + def values(self) -> ValuesView[_VT]: ... + def items(self) -> ItemsView[_KT, _VT]: ... + else: + def iterkeys(self) -> Iterator[_KT]: ... + def itervalues(self) -> Iterator[_VT]: ... + def iteritems(self) -> Iterator[Tuple[_KT, _VT]]: ... + def viewkeys(self) -> KeysView[_KT]: ... + def viewvalues(self) -> ValuesView[_VT]: ... + def viewitems(self) -> ItemsView[_KT, _VT]: ... + @staticmethod + @overload + def fromkeys(seq: Iterable[_T]) -> Dict[_T, Any]: ... # TODO: Actually a class method (mypy/issues#328) + @staticmethod + @overload + def fromkeys(seq: Iterable[_T], value: _S) -> Dict[_T, _S]: ... + def __len__(self) -> int: ... + def __getitem__(self, k: _KT) -> _VT: ... + def __setitem__(self, k: _KT, v: _VT) -> None: ... + def __delitem__(self, v: _KT) -> None: ... + def __iter__(self) -> Iterator[_KT]: ... + def __str__(self) -> str: ... + +class set(MutableSet[_T], Generic[_T]): + def __init__(self, iterable: Iterable[_T] = ...) -> None: ... + def add(self, element: _T) -> None: ... + def clear(self) -> None: ... + def copy(self) -> Set[_T]: ... + def difference(self, *s: Iterable[Any]) -> Set[_T]: ... + def difference_update(self, *s: Iterable[Any]) -> None: ... + def discard(self, element: _T) -> None: ... + def intersection(self, *s: Iterable[Any]) -> Set[_T]: ... + def intersection_update(self, *s: Iterable[Any]) -> None: ... + def isdisjoint(self, s: Iterable[Any]) -> bool: ... + def issubset(self, s: Iterable[Any]) -> bool: ... + def issuperset(self, s: Iterable[Any]) -> bool: ... + def pop(self) -> _T: ... + def remove(self, element: _T) -> None: ... + def symmetric_difference(self, s: Iterable[_T]) -> Set[_T]: ... + def symmetric_difference_update(self, s: Iterable[_T]) -> None: ... + def union(self, *s: Iterable[_T]) -> Set[_T]: ... + def update(self, *s: Iterable[_T]) -> None: ... + def __len__(self) -> int: ... + def __contains__(self, o: object) -> bool: ... + def __iter__(self) -> Iterator[_T]: ... + def __str__(self) -> str: ... + def __and__(self, s: AbstractSet[object]) -> Set[_T]: ... + def __iand__(self, s: AbstractSet[object]) -> Set[_T]: ... + def __or__(self, s: AbstractSet[_S]) -> Set[Union[_T, _S]]: ... + def __ior__(self, s: AbstractSet[_S]) -> Set[Union[_T, _S]]: ... + def __sub__(self, s: AbstractSet[object]) -> Set[_T]: ... + def __isub__(self, s: AbstractSet[object]) -> Set[_T]: ... + def __xor__(self, s: AbstractSet[_S]) -> Set[Union[_T, _S]]: ... + def __ixor__(self, s: AbstractSet[_S]) -> Set[Union[_T, _S]]: ... + def __le__(self, s: AbstractSet[object]) -> bool: ... + def __lt__(self, s: AbstractSet[object]) -> bool: ... + def __ge__(self, s: AbstractSet[object]) -> bool: ... + def __gt__(self, s: AbstractSet[object]) -> bool: ... + +class frozenset(AbstractSet[_T], Generic[_T]): + def __init__(self, iterable: Iterable[_T] = ...) -> None: ... + def copy(self) -> FrozenSet[_T]: ... + def difference(self, *s: Iterable[object]) -> FrozenSet[_T]: ... + def intersection(self, *s: Iterable[object]) -> FrozenSet[_T]: ... + def isdisjoint(self, s: Iterable[_T]) -> bool: ... + def issubset(self, s: Iterable[object]) -> bool: ... + def issuperset(self, s: Iterable[object]) -> bool: ... + def symmetric_difference(self, s: Iterable[_T]) -> FrozenSet[_T]: ... + def union(self, *s: Iterable[_T]) -> FrozenSet[_T]: ... + def __len__(self) -> int: ... + def __contains__(self, o: object) -> bool: ... + def __iter__(self) -> Iterator[_T]: ... + def __str__(self) -> str: ... + def __and__(self, s: AbstractSet[_T]) -> FrozenSet[_T]: ... + def __or__(self, s: AbstractSet[_S]) -> FrozenSet[Union[_T, _S]]: ... + def __sub__(self, s: AbstractSet[_T]) -> FrozenSet[_T]: ... + def __xor__(self, s: AbstractSet[_S]) -> FrozenSet[Union[_T, _S]]: ... + def __le__(self, s: AbstractSet[object]) -> bool: ... + def __lt__(self, s: AbstractSet[object]) -> bool: ... + def __ge__(self, s: AbstractSet[object]) -> bool: ... + def __gt__(self, s: AbstractSet[object]) -> bool: ... + +class enumerate(Iterator[Tuple[int, _T]], Generic[_T]): + def __init__(self, iterable: Iterable[_T], start: int = ...) -> None: ... + def __iter__(self) -> Iterator[Tuple[int, _T]]: ... + if sys.version_info >= (3,): + def __next__(self) -> Tuple[int, _T]: ... + else: + def next(self) -> Tuple[int, _T]: ... + +if sys.version_info >= (3,): + class range(Sequence[int]): + start: int + stop: int + step: int + @overload + def __init__(self, stop: int) -> None: ... + @overload + def __init__(self, start: int, stop: int, step: int = ...) -> None: ... + def count(self, value: int) -> int: ... + def index(self, value: int, start: int = ..., stop: Optional[int] = ...) -> int: ... + def __len__(self) -> int: ... + def __contains__(self, o: object) -> bool: ... + def __iter__(self) -> Iterator[int]: ... + @overload + def __getitem__(self, i: int) -> int: ... + @overload + def __getitem__(self, s: slice) -> range: ... + def __repr__(self) -> str: ... + def __reversed__(self) -> Iterator[int]: ... +else: + class xrange(Sized, Iterable[int], Reversible[int]): + @overload + def __init__(self, stop: int) -> None: ... + @overload + def __init__(self, start: int, stop: int, step: int = ...) -> None: ... + def __len__(self) -> int: ... + def __iter__(self) -> Iterator[int]: ... + def __getitem__(self, i: int) -> int: ... + def __reversed__(self) -> Iterator[int]: ... + +class property(object): + def __init__(self, fget: Optional[Callable[[Any], Any]] = ..., + fset: Optional[Callable[[Any, Any], None]] = ..., + fdel: Optional[Callable[[Any], None]] = ..., + doc: Optional[str] = ...) -> None: ... + def getter(self, fget: Callable[[Any], Any]) -> property: ... + def setter(self, fset: Callable[[Any, Any], None]) -> property: ... + def deleter(self, fdel: Callable[[Any], None]) -> property: ... + def __get__(self, obj: Any, type: Optional[type] = ...) -> Any: ... + def __set__(self, obj: Any, value: Any) -> None: ... + def __delete__(self, obj: Any) -> None: ... + def fget(self) -> Any: ... + def fset(self, value: Any) -> None: ... + def fdel(self) -> None: ... + +if sys.version_info < (3,): + long = int + +NotImplemented: Any + +def abs(__n: SupportsAbs[_T]) -> _T: ... +def all(__i: Iterable[object]) -> bool: ... +def any(__i: Iterable[object]) -> bool: ... +if sys.version_info < (3,): + def apply(__func: Callable[..., _T], __args: Optional[Sequence[Any]] = ..., __kwds: Optional[Mapping[str, Any]] = ...) -> _T: ... +if sys.version_info >= (3,): + def ascii(__o: object) -> str: ... + +class _SupportsIndex(Protocol): + def __index__(self) -> int: ... +def bin(__number: Union[int, _SupportsIndex]) -> str: ... + +if sys.version_info >= (3, 7): + def breakpoint(*args: Any, **kws: Any) -> None: ... +def callable(__o: object) -> bool: ... +def chr(__code: int) -> str: ... +if sys.version_info < (3,): + def cmp(__x: Any, __y: Any) -> int: ... + _N1 = TypeVar('_N1', bool, int, float, complex) + def coerce(__x: _N1, __y: _N1) -> Tuple[_N1, _N1]: ... +if sys.version_info >= (3, 6): + # This class is to be exported as PathLike from os, + # but we define it here as _PathLike to avoid import cycle issues. + # See https://github.com/python/typeshed/pull/991#issuecomment-288160993 + class _PathLike(Generic[AnyStr]): + def __fspath__(self) -> AnyStr: ... + def compile(source: Union[str, bytes, mod, AST], filename: Union[str, bytes, _PathLike], mode: str, flags: int = ..., dont_inherit: int = ..., optimize: int = ...) -> Any: ... +elif sys.version_info >= (3,): + def compile(source: Union[str, bytes, mod, AST], filename: Union[str, bytes], mode: str, flags: int = ..., dont_inherit: int = ..., optimize: int = ...) -> Any: ... +else: + def compile(source: Union[Text, mod], filename: Text, mode: Text, flags: int = ..., dont_inherit: int = ...) -> Any: ... +if sys.version_info >= (3,): + def copyright() -> None: ... + def credits() -> None: ... +def delattr(__o: Any, __name: Text) -> None: ... +def dir(__o: object = ...) -> List[str]: ... +_N2 = TypeVar('_N2', int, float) +def divmod(__a: _N2, __b: _N2) -> Tuple[_N2, _N2]: ... +def eval(__source: Union[Text, bytes, CodeType], __globals: Optional[Dict[str, Any]] = ..., __locals: Optional[Mapping[str, Any]] = ...) -> Any: ... +if sys.version_info >= (3,): + def exec(__object: Union[str, bytes, CodeType], __globals: Optional[Dict[str, Any]] = ..., __locals: Optional[Mapping[str, Any]] = ...) -> Any: ... +else: + def execfile(__filename: str, __globals: Optional[Dict[str, Any]] = ..., __locals: Optional[Dict[str, Any]] = ...) -> None: ... +def exit(code: object = ...) -> NoReturn: ... +if sys.version_info >= (3,): + @overload + def filter(__function: None, __iterable: Iterable[Optional[_T]]) -> Iterator[_T]: ... + @overload + def filter(__function: Callable[[_T], Any], __iterable: Iterable[_T]) -> Iterator[_T]: ... +else: + @overload + def filter(__function: Callable[[AnyStr], Any], # type: ignore + __iterable: AnyStr) -> AnyStr: ... + @overload + def filter(__function: None, # type: ignore + __iterable: Tuple[Optional[_T], ...]) -> Tuple[_T, ...]: ... + @overload + def filter(__function: Callable[[_T], Any], # type: ignore + __iterable: Tuple[_T, ...]) -> Tuple[_T, ...]: ... + @overload + def filter(__function: None, + __iterable: Iterable[Optional[_T]]) -> List[_T]: ... + @overload + def filter(__function: Callable[[_T], Any], + __iterable: Iterable[_T]) -> List[_T]: ... +def format(__o: object, __format_spec: str = ...) -> str: ... # TODO unicode +def getattr(__o: Any, name: Text, __default: Any = ...) -> Any: ... +def globals() -> Dict[str, Any]: ... +def hasattr(__o: Any, __name: Text) -> bool: ... +def hash(__o: object) -> int: ... +if sys.version_info >= (3,): + def help(*args: Any, **kwds: Any) -> None: ... +def hex(__i: Union[int, _SupportsIndex]) -> str: ... +def id(__o: object) -> int: ... +if sys.version_info >= (3,): + def input(__prompt: Any = ...) -> str: ... +else: + def input(__prompt: Any = ...) -> Any: ... + def intern(__string: str) -> str: ... +@overload +def iter(__iterable: Iterable[_T]) -> Iterator[_T]: ... +@overload +def iter(__function: Callable[[], _T], __sentinel: _T) -> Iterator[_T]: ... +def isinstance(__o: object, __t: Union[type, Tuple[Union[type, Tuple], ...]]) -> bool: ... +def issubclass(__cls: type, __classinfo: Union[type, Tuple[Union[type, Tuple], ...]]) -> bool: ... +def len(__o: Sized) -> int: ... +if sys.version_info >= (3,): + def license() -> None: ... +def locals() -> Dict[str, Any]: ... +if sys.version_info >= (3,): + @overload + def map(__func: Callable[[_T1], _S], __iter1: Iterable[_T1]) -> Iterator[_S]: ... + @overload + def map(__func: Callable[[_T1, _T2], _S], __iter1: Iterable[_T1], + __iter2: Iterable[_T2]) -> Iterator[_S]: ... + @overload + def map(__func: Callable[[_T1, _T2, _T3], _S], + __iter1: Iterable[_T1], + __iter2: Iterable[_T2], + __iter3: Iterable[_T3]) -> Iterator[_S]: ... + @overload + def map(__func: Callable[[_T1, _T2, _T3, _T4], _S], + __iter1: Iterable[_T1], + __iter2: Iterable[_T2], + __iter3: Iterable[_T3], + __iter4: Iterable[_T4]) -> Iterator[_S]: ... + @overload + def map(__func: Callable[[_T1, _T2, _T3, _T4, _T5], _S], + __iter1: Iterable[_T1], + __iter2: Iterable[_T2], + __iter3: Iterable[_T3], + __iter4: Iterable[_T4], + __iter5: Iterable[_T5]) -> Iterator[_S]: ... + @overload + def map(__func: Callable[..., _S], + __iter1: Iterable[Any], + __iter2: Iterable[Any], + __iter3: Iterable[Any], + __iter4: Iterable[Any], + __iter5: Iterable[Any], + __iter6: Iterable[Any], + *iterables: Iterable[Any]) -> Iterator[_S]: ... +else: + @overload + def map(__func: None, __iter1: Iterable[_T1]) -> List[_T1]: ... + @overload + def map(__func: None, + __iter1: Iterable[_T1], + __iter2: Iterable[_T2]) -> List[Tuple[_T1, _T2]]: ... + @overload + def map(__func: None, + __iter1: Iterable[_T1], + __iter2: Iterable[_T2], + __iter3: Iterable[_T3]) -> List[Tuple[_T1, _T2, _T3]]: ... + @overload + def map(__func: None, + __iter1: Iterable[_T1], + __iter2: Iterable[_T2], + __iter3: Iterable[_T3], + __iter4: Iterable[_T4]) -> List[Tuple[_T1, _T2, _T3, _T4]]: ... + @overload + def map(__func: None, + __iter1: Iterable[_T1], + __iter2: Iterable[_T2], + __iter3: Iterable[_T3], + __iter4: Iterable[_T4], + __iter5: Iterable[_T5]) -> List[Tuple[_T1, _T2, _T3, _T4, _T5]]: ... + @overload + def map(__func: None, + __iter1: Iterable[Any], + __iter2: Iterable[Any], + __iter3: Iterable[Any], + __iter4: Iterable[Any], + __iter5: Iterable[Any], + __iter6: Iterable[Any], + *iterables: Iterable[Any]) -> List[Tuple[Any, ...]]: ... + @overload + def map(__func: Callable[[_T1], _S], __iter1: Iterable[_T1]) -> List[_S]: ... + @overload + def map(__func: Callable[[_T1, _T2], _S], + __iter1: Iterable[_T1], + __iter2: Iterable[_T2]) -> List[_S]: ... + @overload + def map(__func: Callable[[_T1, _T2, _T3], _S], + __iter1: Iterable[_T1], + __iter2: Iterable[_T2], + __iter3: Iterable[_T3]) -> List[_S]: ... + @overload + def map(__func: Callable[[_T1, _T2, _T3, _T4], _S], + __iter1: Iterable[_T1], + __iter2: Iterable[_T2], + __iter3: Iterable[_T3], + __iter4: Iterable[_T4]) -> List[_S]: ... + @overload + def map(__func: Callable[[_T1, _T2, _T3, _T4, _T5], _S], + __iter1: Iterable[_T1], + __iter2: Iterable[_T2], + __iter3: Iterable[_T3], + __iter4: Iterable[_T4], + __iter5: Iterable[_T5]) -> List[_S]: ... + @overload + def map(__func: Callable[..., _S], + __iter1: Iterable[Any], + __iter2: Iterable[Any], + __iter3: Iterable[Any], + __iter4: Iterable[Any], + __iter5: Iterable[Any], + __iter6: Iterable[Any], + *iterables: Iterable[Any]) -> List[_S]: ... +if sys.version_info >= (3,): + @overload + def max(__arg1: _T, __arg2: _T, *_args: _T, key: Callable[[_T], Any] = ...) -> _T: ... + @overload + def max(__iterable: Iterable[_T], *, key: Callable[[_T], Any] = ...) -> _T: ... + @overload + def max(__iterable: Iterable[_T], *, key: Callable[[_T], Any] = ..., default: _VT) -> Union[_T, _VT]: ... +else: + @overload + def max(__arg1: _T, __arg2: _T, *_args: _T, key: Callable[[_T], Any] = ...) -> _T: ... + @overload + def max(__iterable: Iterable[_T], *, key: Callable[[_T], Any] = ...) -> _T: ... +if sys.version_info >= (3,): + @overload + def min(__arg1: _T, __arg2: _T, *_args: _T, key: Callable[[_T], Any] = ...) -> _T: ... + @overload + def min(__iterable: Iterable[_T], *, key: Callable[[_T], Any] = ...) -> _T: ... + @overload + def min(__iterable: Iterable[_T], *, key: Callable[[_T], Any] = ..., default: _VT) -> Union[_T, _VT]: ... +else: + @overload + def min(__arg1: _T, __arg2: _T, *_args: _T, key: Callable[[_T], Any] = ...) -> _T: ... + @overload + def min(__iterable: Iterable[_T], *, key: Callable[[_T], Any] = ...) -> _T: ... +@overload +def next(__i: Iterator[_T]) -> _T: ... +@overload +def next(__i: Iterator[_T], default: _VT) -> Union[_T, _VT]: ... +def oct(__i: Union[int, _SupportsIndex]) -> str: ... + +if sys.version_info >= (3, 6): + def open(file: Union[str, bytes, int, _PathLike], mode: str = ..., buffering: int = ..., encoding: Optional[str] = ..., + errors: Optional[str] = ..., newline: Optional[str] = ..., closefd: bool = ..., + opener: Optional[Callable[[str, int], int]] = ...) -> IO[Any]: ... +elif sys.version_info >= (3,): + def open(file: Union[str, bytes, int], mode: str = ..., buffering: int = ..., encoding: Optional[str] = ..., + errors: Optional[str] = ..., newline: Optional[str] = ..., closefd: bool = ..., + opener: Optional[Callable[[str, int], int]] = ...) -> IO[Any]: ... +else: + def open(name: Union[unicode, int], mode: unicode = ..., buffering: int = ...) -> BinaryIO: ... + +def ord(__c: Union[Text, bytes]) -> int: ... +if sys.version_info >= (3,): + class _Writer(Protocol): + def write(self, __s: str) -> Any: ... + def print(*values: object, sep: Text = ..., end: Text = ..., file: Optional[_Writer] = ..., flush: bool = ...) -> None: ... +else: + class _Writer(Protocol): + def write(self, __s: Any) -> Any: ... + # This is only available after from __future__ import print_function. + def print(*values: object, sep: Text = ..., end: Text = ..., file: Optional[_Writer] = ...) -> None: ... +@overload +def pow(__x: int, __y: int) -> Any: ... # The return type can be int or float, depending on y +@overload +def pow(__x: int, __y: int, __z: int) -> Any: ... +@overload +def pow(__x: float, __y: float) -> float: ... +@overload +def pow(__x: float, __y: float, __z: float) -> float: ... +def quit(code: object = ...) -> NoReturn: ... +if sys.version_info < (3,): + def range(__x: int, __y: int = ..., __step: int = ...) -> List[int]: ... + def raw_input(__prompt: Any = ...) -> str: ... + @overload + def reduce(__function: Callable[[_T, _S], _T], __iterable: Iterable[_S], __initializer: _T) -> _T: ... + @overload + def reduce(__function: Callable[[_T, _T], _T], __iterable: Iterable[_T]) -> _T: ... + def reload(__module: Any) -> Any: ... +@overload +def reversed(__object: Sequence[_T]) -> Iterator[_T]: ... +@overload +def reversed(__object: Reversible[_T]) -> Iterator[_T]: ... +def repr(__o: object) -> str: ... +if sys.version_info >= (3,): + @overload + def round(number: float) -> int: ... + @overload + def round(number: float, ndigits: None) -> int: ... + @overload + def round(number: float, ndigits: int) -> float: ... + @overload + def round(number: SupportsRound[_T]) -> int: ... + @overload + def round(number: SupportsRound[_T], ndigits: None) -> int: ... # type: ignore + @overload + def round(number: SupportsRound[_T], ndigits: int) -> _T: ... +else: + @overload + def round(number: float) -> float: ... + @overload + def round(number: float, ndigits: int) -> float: ... + @overload + def round(number: SupportsFloat) -> float: ... + @overload + def round(number: SupportsFloat, ndigits: int) -> float: ... +def setattr(__object: Any, __name: Text, __value: Any) -> None: ... +if sys.version_info >= (3,): + def sorted(__iterable: Iterable[_T], *, + key: Optional[Callable[[_T], Any]] = ..., + reverse: bool = ...) -> List[_T]: ... +else: + def sorted(__iterable: Iterable[_T], *, + cmp: Callable[[_T, _T], int] = ..., + key: Callable[[_T], Any] = ..., + reverse: bool = ...) -> List[_T]: ... +@overload +def sum(__iterable: Iterable[_T]) -> Union[_T, int]: ... +@overload +def sum(__iterable: Iterable[_T], __start: _S) -> Union[_T, _S]: ... +if sys.version_info < (3,): + def unichr(__i: int) -> unicode: ... +def vars(__object: Any = ...) -> Dict[str, Any]: ... +if sys.version_info >= (3,): + @overload + def zip(__iter1: Iterable[_T1]) -> Iterator[Tuple[_T1]]: ... + @overload + def zip(__iter1: Iterable[_T1], __iter2: Iterable[_T2]) -> Iterator[Tuple[_T1, _T2]]: ... + @overload + def zip(__iter1: Iterable[_T1], __iter2: Iterable[_T2], + __iter3: Iterable[_T3]) -> Iterator[Tuple[_T1, _T2, _T3]]: ... + @overload + def zip(__iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3], + __iter4: Iterable[_T4]) -> Iterator[Tuple[_T1, _T2, _T3, _T4]]: ... + @overload + def zip(__iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3], + __iter4: Iterable[_T4], __iter5: Iterable[_T5]) -> Iterator[Tuple[_T1, _T2, _T3, _T4, _T5]]: ... + @overload + def zip(__iter1: Iterable[Any], __iter2: Iterable[Any], __iter3: Iterable[Any], + __iter4: Iterable[Any], __iter5: Iterable[Any], __iter6: Iterable[Any], + *iterables: Iterable[Any]) -> Iterator[Tuple[Any, ...]]: ... +else: + @overload + def zip(__iter1: Iterable[_T1]) -> List[Tuple[_T1]]: ... + @overload + def zip(__iter1: Iterable[_T1], + __iter2: Iterable[_T2]) -> List[Tuple[_T1, _T2]]: ... + @overload + def zip(__iter1: Iterable[_T1], __iter2: Iterable[_T2], + __iter3: Iterable[_T3]) -> List[Tuple[_T1, _T2, _T3]]: ... + @overload + def zip(__iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3], + __iter4: Iterable[_T4]) -> List[Tuple[_T1, _T2, _T3, _T4]]: ... + @overload + def zip(__iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3], + __iter4: Iterable[_T4], __iter5: Iterable[_T5]) -> List[Tuple[_T1, _T2, _T3, _T4, _T5]]: ... + @overload + def zip(__iter1: Iterable[Any], __iter2: Iterable[Any], __iter3: Iterable[Any], + __iter4: Iterable[Any], __iter5: Iterable[Any], __iter6: Iterable[Any], + *iterables: Iterable[Any]) -> List[Tuple[Any, ...]]: ... +def __import__(name: Text, globals: Dict[str, Any] = ..., locals: Dict[str, Any] = ..., + fromlist: List[str] = ..., level: int = ...) -> Any: ... + +# Actually the type of Ellipsis is , but since it's +# not exposed anywhere under that name, we make it private here. +class ellipsis: ... +Ellipsis: ellipsis + +if sys.version_info < (3,): + # TODO: buffer support is incomplete; e.g. some_string.startswith(some_buffer) doesn't type check. + _AnyBuffer = TypeVar('_AnyBuffer', str, unicode, bytearray, buffer) + + class buffer(Sized): + def __init__(self, object: _AnyBuffer, offset: int = ..., size: int = ...) -> None: ... + def __add__(self, other: _AnyBuffer) -> str: ... + def __cmp__(self, other: _AnyBuffer) -> bool: ... + def __getitem__(self, key: Union[int, slice]) -> str: ... + def __getslice__(self, i: int, j: int) -> str: ... + def __len__(self) -> int: ... + def __mul__(self, x: int) -> str: ... + +class BaseException(object): + args: Tuple[Any, ...] + if sys.version_info < (3,): + message: Any + if sys.version_info >= (3,): + __cause__: Optional[BaseException] + __context__: Optional[BaseException] + __suppress_context__: bool + __traceback__: Optional[TracebackType] + def __init__(self, *args: object) -> None: ... + if sys.version_info < (3,): + def __getitem__(self, i: int) -> Any: ... + def __getslice__(self, start: int, stop: int) -> Tuple[Any, ...]: ... + if sys.version_info >= (3,): + def with_traceback(self, tb: Optional[TracebackType]) -> BaseException: ... + +class GeneratorExit(BaseException): ... +class KeyboardInterrupt(BaseException): ... +class SystemExit(BaseException): + code: int +class Exception(BaseException): ... +class StopIteration(Exception): + if sys.version_info >= (3,): + value: Any +if sys.version_info >= (3,): + _StandardError = Exception + class OSError(Exception): + errno: int + strerror: str + # filename, filename2 are actually Union[str, bytes, None] + filename: Any + filename2: Any + EnvironmentError = OSError + IOError = OSError +else: + class StandardError(Exception): ... + _StandardError = StandardError + class EnvironmentError(StandardError): + errno: int + strerror: str + # TODO can this be unicode? + filename: str + class OSError(EnvironmentError): ... + class IOError(EnvironmentError): ... + +class ArithmeticError(_StandardError): ... +class AssertionError(_StandardError): ... +class AttributeError(_StandardError): ... +class BufferError(_StandardError): ... +class EOFError(_StandardError): ... +class ImportError(_StandardError): + if sys.version_info >= (3,): + name: str + path: str +class LookupError(_StandardError): ... +class MemoryError(_StandardError): ... +class NameError(_StandardError): ... +class ReferenceError(_StandardError): ... +class RuntimeError(_StandardError): ... +if sys.version_info >= (3, 5): + class StopAsyncIteration(Exception): + value: Any +class SyntaxError(_StandardError): + msg: str + lineno: int + offset: Optional[int] + text: str + filename: str +class SystemError(_StandardError): ... +class TypeError(_StandardError): ... +class ValueError(_StandardError): ... + +class FloatingPointError(ArithmeticError): ... +class OverflowError(ArithmeticError): ... +class ZeroDivisionError(ArithmeticError): ... + +if sys.version_info >= (3, 6): + class ModuleNotFoundError(ImportError): ... + +class IndexError(LookupError): ... +class KeyError(LookupError): ... + +class UnboundLocalError(NameError): ... + +class WindowsError(OSError): + winerror: int +if sys.version_info >= (3,): + class BlockingIOError(OSError): + characters_written: int + class ChildProcessError(OSError): ... + class ConnectionError(OSError): ... + class BrokenPipeError(ConnectionError): ... + class ConnectionAbortedError(ConnectionError): ... + class ConnectionRefusedError(ConnectionError): ... + class ConnectionResetError(ConnectionError): ... + class FileExistsError(OSError): ... + class FileNotFoundError(OSError): ... + class InterruptedError(OSError): ... + class IsADirectoryError(OSError): ... + class NotADirectoryError(OSError): ... + class PermissionError(OSError): ... + class ProcessLookupError(OSError): ... + class TimeoutError(OSError): ... + +class NotImplementedError(RuntimeError): ... +if sys.version_info >= (3, 5): + class RecursionError(RuntimeError): ... + +class IndentationError(SyntaxError): ... +class TabError(IndentationError): ... + +class UnicodeError(ValueError): ... +class UnicodeDecodeError(UnicodeError): + encoding: str + object: bytes + start: int + end: int + reason: str + def __init__(self, __encoding: str, __object: bytes, __start: int, __end: int, + __reason: str) -> None: ... +class UnicodeEncodeError(UnicodeError): + encoding: str + object: Text + start: int + end: int + reason: str + def __init__(self, __encoding: str, __object: Text, __start: int, __end: int, + __reason: str) -> None: ... +class UnicodeTranslateError(UnicodeError): ... + +class Warning(Exception): ... +class UserWarning(Warning): ... +class DeprecationWarning(Warning): ... +class SyntaxWarning(Warning): ... +class RuntimeWarning(Warning): ... +class FutureWarning(Warning): ... +class PendingDeprecationWarning(Warning): ... +class ImportWarning(Warning): ... +class UnicodeWarning(Warning): ... +class BytesWarning(Warning): ... +if sys.version_info >= (3, 2): + class ResourceWarning(Warning): ... + +if sys.version_info < (3,): + class file(BinaryIO): + @overload + def __init__(self, file: str, mode: str = ..., buffering: int = ...) -> None: ... + @overload + def __init__(self, file: unicode, mode: str = ..., buffering: int = ...) -> None: ... + @overload + def __init__(self, file: int, mode: str = ..., buffering: int = ...) -> None: ... + def __iter__(self) -> Iterator[str]: ... + def next(self) -> str: ... + def read(self, n: int = ...) -> str: ... + def __enter__(self) -> BinaryIO: ... + def __exit__(self, t: Optional[type] = ..., exc: Optional[BaseException] = ..., tb: Optional[Any] = ...) -> bool: ... + def flush(self) -> None: ... + def fileno(self) -> int: ... + def isatty(self) -> bool: ... + def close(self) -> None: ... + + def readable(self) -> bool: ... + def writable(self) -> bool: ... + def seekable(self) -> bool: ... + def seek(self, offset: int, whence: int = ...) -> int: ... + def tell(self) -> int: ... + def readline(self, limit: int = ...) -> str: ... + def readlines(self, hint: int = ...) -> List[str]: ... + def write(self, data: str) -> int: ... + def writelines(self, data: Iterable[str]) -> None: ... + def truncate(self, pos: Optional[int] = ...) -> int: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/bz2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/bz2.pyi new file mode 100644 index 0000000..2cb329c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/bz2.pyi @@ -0,0 +1,48 @@ +import io +import sys +from typing import Any, IO, Optional, Union + +if sys.version_info >= (3, 6): + from os import PathLike + _PathOrFile = Union[str, bytes, IO[Any], PathLike[Any]] +elif sys.version_info >= (3, 3): + _PathOrFile = Union[str, bytes, IO[Any]] +else: + _PathOrFile = str + +def compress(data: bytes, compresslevel: int = ...) -> bytes: ... +def decompress(data: bytes) -> bytes: ... + +if sys.version_info >= (3, 3): + def open(filename: _PathOrFile, + mode: str = ..., + compresslevel: int = ..., + encoding: Optional[str] = ..., + errors: Optional[str] = ..., + newline: Optional[str] = ...) -> IO[Any]: ... + +class BZ2File(io.BufferedIOBase, IO[bytes]): # type: ignore # python/mypy#5027 + def __init__(self, + filename: _PathOrFile, + mode: str = ..., + buffering: Optional[Any] = ..., + compresslevel: int = ...) -> None: ... + +class BZ2Compressor(object): + def __init__(self, compresslevel: int = ...) -> None: ... + def compress(self, data: bytes) -> bytes: ... + def flush(self) -> bytes: ... + +class BZ2Decompressor(object): + if sys.version_info >= (3, 5): + def decompress(self, data: bytes, max_length: int = ...) -> bytes: ... + else: + def decompress(self, data: bytes) -> bytes: ... + if sys.version_info >= (3, 3): + @property + def eof(self) -> bool: ... + if sys.version_info >= (3, 5): + @property + def needs_input(self) -> bool: ... + @property + def unused_data(self) -> bytes: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/cProfile.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/cProfile.pyi new file mode 100644 index 0000000..71e25ed --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/cProfile.pyi @@ -0,0 +1,24 @@ +import os +import sys +from typing import Any, Callable, Dict, Optional, Text, TypeVar, Union + +def run(statement: str, filename: Optional[str] = ..., sort: Union[str, int] = ...) -> None: ... +def runctx(statement: str, globals: Dict[str, Any], locals: Dict[str, Any], filename: Optional[str] = ..., sort: Union[str, int] = ...) -> None: ... + +_SelfT = TypeVar('_SelfT', bound='Profile') +_T = TypeVar('_T') +if sys.version_info >= (3, 6): + _Path = Union[bytes, Text, os.PathLike[Any]] +else: + _Path = Union[bytes, Text] + +class Profile: + def __init__(self, custom_timer: Callable[[], float] = ..., time_unit: float = ..., subcalls: bool = ..., builtins: bool = ...) -> None: ... + def enable(self) -> None: ... + def disable(self) -> None: ... + def print_stats(self, sort: Union[str, int] = ...) -> None: ... + def dump_stats(self, file: _Path) -> None: ... + def create_stats(self) -> None: ... + def run(self: _SelfT, cmd: str) -> _SelfT: ... + def runctx(self: _SelfT, cmd: str, globals: Dict[str, Any], locals: Dict[str, Any]) -> _SelfT: ... + def runcall(self, func: Callable[..., _T], *args: Any, **kw: Any) -> _T: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/calendar.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/calendar.pyi new file mode 100644 index 0000000..4b452cc --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/calendar.pyi @@ -0,0 +1,122 @@ +import datetime +import sys +from time import struct_time +from typing import Any, Iterable, List, Optional, Sequence, Tuple, Union + + +_LocaleType = Tuple[Optional[str], Optional[str]] + +class IllegalMonthError(ValueError): + def __init__(self, month: int) -> None: ... + def __str__(self) -> str: ... + +class IllegalWeekdayError(ValueError): + def __init__(self, weekday: int) -> None: ... + def __str__(self) -> str: ... + +def isleap(year: int) -> bool: ... +def leapdays(y1: int, y2: int) -> int: ... +def weekday(year: int, month: int, day: int) -> int: ... +def monthrange(year: int, month: int) -> Tuple[int, int]: ... + +class Calendar: + def __init__(self, firstweekday: int = ...) -> None: ... + def getfirstweekday(self) -> int: ... + def setfirstweekday(self, firstweekday: int) -> None: ... + def iterweekdays(self) -> Iterable[int]: ... + def itermonthdates(self, year: int, month: int) -> Iterable[datetime.date]: ... + def itermonthdays2(self, year: int, month: int) -> Iterable[Tuple[int, int]]: ... + def itermonthdays(self, year: int, month: int) -> Iterable[int]: ... + def monthdatescalendar(self, year: int, month: int) -> List[List[datetime.date]]: ... + def monthdays2calendar(self, year: int, month: int) -> List[List[Tuple[int, int]]]: ... + def monthdayscalendar(self, year: int, month: int) -> List[List[int]]: ... + def yeardatescalendar(self, year: int, width: int = ...) -> List[List[int]]: ... + def yeardays2calendar(self, year: int, width: int = ...) -> List[List[Tuple[int, int]]]: ... + def yeardayscalendar(self, year: int, width: int = ...) -> List[List[int]]: ... + if sys.version_info >= (3, 7): + def itermonthdays3(self, year: int, month: int) -> Iterable[Tuple[int, int, int]]: ... + def itermonthdays4(self, year: int, month: int) -> Iterable[Tuple[int, int, int, int]]: ... + +class TextCalendar(Calendar): + def prweek(self, theweek: int, width: int) -> None: ... + def formatday(self, day: int, weekday: int, width: int) -> str: ... + def formatweek(self, theweek: int, width: int) -> str: ... + def formatweekday(self, day: int, width: int) -> str: ... + def formatweekheader(self, width: int) -> str: ... + def formatmonthname(self, theyear: int, themonth: int, width: int, withyear: bool = ...) -> str: ... + def prmonth(self, theyear: int, themonth: int, w: int = ..., l: int = ...) -> None: ... + def formatmonth(self, theyear: int, themonth: int, w: int = ..., l: int = ...) -> str: ... + def formatyear(self, theyear: int, w: int = ..., l: int = ..., c: int = ..., m: int = ...) -> str: ... + def pryear(self, theyear: int, w: int = ..., l: int = ..., c: int = ..., m: int = ...) -> None: ... + +def firstweekday() -> int: ... +def monthcalendar(year: int, month: int) -> List[List[int]]: ... +def prweek(theweek: int, width: int) -> None: ... +def week(theweek: int, width: int) -> str: ... +def weekheader(width: int) -> str: ... +def prmonth(theyear: int, themonth: int, w: int = ..., l: int = ...) -> None: ... +def month(theyear: int, themonth: int, w: int = ..., l: int = ...) -> str: ... +def calendar(theyear: int, w: int = ..., l: int = ..., c: int = ..., m: int = ...) -> str: ... +def prcal(theyear: int, w: int = ..., l: int = ..., c: int = ..., m: int = ...) -> None: ... + +class HTMLCalendar(Calendar): + def formatday(self, day: int, weekday: int) -> str: ... + def formatweek(self, theweek: int) -> str: ... + def formatweekday(self, day: int) -> str: ... + def formatweekheader(self) -> str: ... + def formatmonthname(self, theyear: int, themonth: int, withyear: bool = ...) -> str: ... + def formatmonth(self, theyear: int, themonth: int, withyear: bool = ...) -> str: ... + def formatyear(self, theyear: int, width: int = ...) -> str: ... + def formatyearpage(self, theyear: int, width: int = ..., css: Optional[str] = ..., encoding: Optional[str] = ...) -> str: ... + if sys.version_info >= (3, 7): + cssclasses: List[str] + cssclass_noday: str + cssclasses_weekday_head: List[str] + cssclass_month_head: str + cssclass_month: str + cssclass_year: str + cssclass_year_head: str + +if sys.version_info < (3, 0): + class TimeEncoding: + def __init__(self, locale: _LocaleType) -> None: ... + def __enter__(self) -> _LocaleType: ... + def __exit__(self, *args: Any) -> None: ... +else: + class different_locale: + def __init__(self, locale: _LocaleType) -> None: ... + def __enter__(self) -> _LocaleType: ... + def __exit__(self, *args: Any) -> None: ... + +class LocaleTextCalendar(TextCalendar): + def __init__(self, firstweekday: int = ..., locale: Optional[_LocaleType] = ...) -> None: ... + def formatweekday(self, day: int, width: int) -> str: ... + def formatmonthname(self, theyear: int, themonth: int, width: int, withyear: bool = ...) -> str: ... + +class LocaleHTMLCalendar(HTMLCalendar): + def __init__(self, firstweekday: int = ..., locale: Optional[_LocaleType] = ...) -> None: ... + def formatweekday(self, day: int) -> str: ... + def formatmonthname(self, theyear: int, themonth: int, withyear: bool = ...) -> str: ... + +c: TextCalendar +def setfirstweekday(firstweekday: int) -> None: ... +def format(cols: int, colwidth: int = ..., spacing: int = ...) -> str: ... +def formatstring(cols: int, colwidth: int = ..., spacing: int = ...) -> str: ... +def timegm(tuple: Union[Tuple[int, ...], struct_time]) -> int: ... + +# Data attributes +day_name: Sequence[str] +day_abbr: Sequence[str] +month_name: Sequence[str] +month_abbr: Sequence[str] + +# Below constants are not in docs or __all__, but enough people have used them +# they are now effectively public. + +MONDAY: int +TUESDAY: int +WEDNESDAY: int +THURSDAY: int +FRIDAY: int +SATURDAY: int +SUNDAY: int diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/cgi.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/cgi.pyi new file mode 100644 index 0000000..02979c0 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/cgi.pyi @@ -0,0 +1,122 @@ +import sys +from typing import Any, AnyStr, Dict, IO, Iterable, List, Mapping, Optional, Tuple, TypeVar, Union + +_T = TypeVar('_T', bound=FieldStorage) + +def parse(fp: IO[Any] = ..., environ: Mapping[str, str] = ..., + keep_blank_values: bool = ..., strict_parsing: bool = ...) -> Dict[str, List[str]]: ... +def parse_qs(qs: str, keep_blank_values: bool = ..., strict_parsing: bool = ...) -> Dict[str, List[str]]: ... +def parse_qsl(qs: str, keep_blank_values: bool = ..., strict_parsing: bool = ...) -> Dict[str, List[str]]: ... +if sys.version_info >= (3, 7): + def parse_multipart(fp: IO[Any], pdict: Mapping[str, bytes], encoding: str = ..., errors: str = ...) -> Dict[str, List[Any]]: ... +else: + def parse_multipart(fp: IO[Any], pdict: Mapping[str, bytes]) -> Dict[str, List[bytes]]: ... +def parse_header(s: str) -> Tuple[str, Dict[str, str]]: ... +def test(environ: Mapping[str, str] = ...) -> None: ... +def print_environ(environ: Mapping[str, str] = ...) -> None: ... +def print_form(form: Dict[str, Any]) -> None: ... +def print_directory() -> None: ... +def print_environ_usage() -> None: ... +if sys.version_info >= (3, 0): + def escape(s: str, quote: bool = ...) -> str: ... +else: + def escape(s: AnyStr, quote: bool = ...) -> AnyStr: ... + + +class MiniFieldStorage: + # The first five "Any" attributes here are always None, but mypy doesn't support that + filename: Any + list: Any + type: Any + file: Optional[IO[bytes]] + type_options: Dict[Any, Any] + disposition: Any + disposition_options: Dict[Any, Any] + headers: Dict[Any, Any] + name: Any + value: Any + + def __init__(self, name: Any, value: Any) -> None: ... + def __repr__(self) -> str: ... + + +class FieldStorage(object): + FieldStorageClass: Optional[type] + keep_blank_values: int + strict_parsing: int + qs_on_post: Optional[str] + headers: Mapping[str, str] + fp: IO[bytes] + encoding: str + errors: str + outerboundary: bytes + bytes_read: int + limit: Optional[int] + disposition: str + disposition_options: Dict[str, str] + filename: Optional[str] + file: Optional[IO[bytes]] + type: str + type_options: Dict[str, str] + innerboundary: bytes + length: int + done: int + list: Optional[List[Any]] + value: Union[None, bytes, List[Any]] + + if sys.version_info >= (3, 0): + def __init__(self, fp: IO[Any] = ..., headers: Mapping[str, str] = ..., outerboundary: bytes = ..., + environ: Mapping[str, str] = ..., keep_blank_values: int = ..., strict_parsing: int = ..., + limit: int = ..., encoding: str = ..., errors: str = ...) -> None: ... + else: + def __init__(self, fp: IO[Any] = ..., headers: Mapping[str, str] = ..., outerboundary: bytes = ..., + environ: Mapping[str, str] = ..., keep_blank_values: int = ..., strict_parsing: int = ...) -> None: ... + + if sys.version_info >= (3, 0): + def __enter__(self: _T) -> _T: ... + def __exit__(self, *args: Any) -> None: ... + def __repr__(self) -> str: ... + def __iter__(self) -> Iterable[str]: ... + def __getitem__(self, key: str) -> Any: ... + def getvalue(self, key: str, default: Any = ...) -> Any: ... + def getfirst(self, key: str, default: Any = ...) -> Any: ... + def getlist(self, key: str) -> List[Any]: ... + def keys(self) -> List[str]: ... + if sys.version_info < (3, 0): + def has_key(self, key: str) -> bool: ... + def __contains__(self, key: str) -> bool: ... + def __len__(self) -> int: ... + if sys.version_info >= (3, 0): + def __bool__(self) -> bool: ... + else: + def __nonzero__(self) -> bool: ... + if sys.version_info >= (3, 0): + # In Python 3 it returns bytes or str IO depending on an internal flag + def make_file(self) -> IO[Any]: ... + else: + # In Python 2 it always returns bytes and ignores the "binary" flag + def make_file(self, binary: Any = ...) -> IO[bytes]: ... + + +if sys.version_info < (3, 0): + from UserDict import UserDict + + class FormContentDict(UserDict): + query_string: str + def __init__(self, environ: Mapping[str, str] = ..., keep_blank_values: int = ..., strict_parsing: int = ...) -> None: ... + + class SvFormContentDict(FormContentDict): + def getlist(self, key: Any) -> Any: ... + + class InterpFormContentDict(SvFormContentDict): ... + + class FormContent(FormContentDict): + # TODO this should have + # def values(self, key: Any) -> Any: ... + # but this is incompatible with the supertype, and adding '# type: ignore' triggers + # a parse error in pytype (https://github.com/google/pytype/issues/53) + def indexed_value(self, key: Any, location: int) -> Any: ... + def value(self, key: Any) -> Any: ... + def length(self, key: Any) -> int: ... + def stripped(self, key: Any) -> Any: ... + def pars(self) -> Dict[Any, Any]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/chunk.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/chunk.pyi new file mode 100644 index 0000000..2337f00 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/chunk.pyi @@ -0,0 +1,23 @@ +# Source(py2): https://hg.python.org/cpython/file/2.7/Lib/chunk.py +# Source(py3): https://github.com/python/cpython/blob/master/Lib/chunk.py + +from typing import IO + +class Chunk: + closed: bool + align: bool + file: IO[bytes] + chunkname: bytes + chunksize: int + size_read: int + offset: int + seekable: bool + def __init__(self, file: IO[bytes], align: bool = ..., bigendian: bool = ..., inclheader: bool = ...) -> None: ... + def getname(self) -> bytes: ... + def getsize(self) -> int: ... + def close(self) -> None: ... + def isatty(self) -> bool: ... + def seek(self, pos: int, whence: int = ...) -> None: ... + def tell(self) -> int: ... + def read(self, size: int = ...) -> bytes: ... + def skip(self) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/cmath.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/cmath.pyi new file mode 100644 index 0000000..4b15f0b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/cmath.pyi @@ -0,0 +1,42 @@ +"""Stub file for the 'cmath' module.""" + +import sys +from typing import SupportsComplex, SupportsFloat, Tuple, Union + +e: float +pi: float +if sys.version_info >= (3, 6): + inf: float + infj: complex + nan: float + nanj: complex + tau: float + +_C = Union[SupportsFloat, SupportsComplex] + +def acos(x: _C) -> complex: ... +def acosh(x: _C) -> complex: ... +def asin(x: _C) -> complex: ... +def asinh(x: _C) -> complex: ... +def atan(x: _C) -> complex: ... +def atanh(x: _C) -> complex: ... +def cos(x: _C) -> complex: ... +def cosh(x: _C) -> complex: ... +def exp(x: _C) -> complex: ... +if sys.version_info >= (3, 5): + def isclose(a: _C, b: _C, *, rel_tol: SupportsFloat = ..., abs_tol: SupportsFloat = ...) -> bool: ... +def isinf(z: _C) -> bool: ... +def isnan(z: _C) -> bool: ... +def log(x: _C, base: _C = ...) -> complex: ... +def log10(x: _C) -> complex: ... +def phase(z: _C) -> float: ... +def polar(z: _C) -> Tuple[float, float]: ... +def rect(r: float, phi: float) -> complex: ... +def sin(x: _C) -> complex: ... +def sinh(x: _C) -> complex: ... +def sqrt(x: _C) -> complex: ... +def tan(x: _C) -> complex: ... +def tanh(x: _C) -> complex: ... + +if sys.version_info >= (3,): + def isfinite(z: _C) -> bool: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/cmd.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/cmd.pyi new file mode 100644 index 0000000..c2aeb75 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/cmd.pyi @@ -0,0 +1,41 @@ +# Stubs for cmd (Python 2/3) + +from typing import Any, Optional, Text, IO, List, Callable, Tuple + +class Cmd: + prompt: str + identchars: str + ruler: str + lastcmd: str + intro: Optional[Any] + doc_leader: str + doc_header: str + misc_header: str + undoc_header: str + nohelp: str + use_rawinput: bool + stdin: IO[str] + stdout: IO[str] + cmdqueue: List[str] + completekey: str + def __init__(self, completekey: str = ..., stdin: Optional[IO[str]] = ..., stdout: Optional[IO[str]] = ...) -> None: ... + old_completer: Optional[Callable[[str, int], Optional[str]]] + def cmdloop(self, intro: Optional[Any] = ...) -> None: ... + def precmd(self, line: str) -> str: ... + def postcmd(self, stop: bool, line: str) -> bool: ... + def preloop(self) -> None: ... + def postloop(self) -> None: ... + def parseline(self, line: str) -> Tuple[Optional[str], Optional[str], str]: ... + def onecmd(self, line: str) -> bool: ... + def emptyline(self) -> bool: ... + def default(self, line: str) -> bool: ... + def completedefault(self, *ignored: Any) -> List[str]: ... + def completenames(self, text: str, *ignored: Any) -> List[str]: ... + completion_matches: Optional[List[str]] + def complete(self, text: str, state: int) -> Optional[List[str]]: ... + def get_names(self) -> List[str]: ... + # Only the first element of args matters. + def complete_help(self, *args: Any) -> List[str]: ... + def do_help(self, arg: Optional[str]) -> None: ... + def print_topics(self, header: str, cmds: Optional[List[str]], cmdlen: Any, maxcol: int) -> None: ... + def columnize(self, list: Optional[List[str]], displaywidth: int = ...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/code.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/code.pyi new file mode 100644 index 0000000..293ab9b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/code.pyi @@ -0,0 +1,38 @@ +# Stubs for code + +import sys +from typing import Any, Callable, Mapping, Optional +from types import CodeType + +class InteractiveInterpreter: + def __init__(self, locals: Optional[Mapping[str, Any]] = ...) -> None: ... + def runsource(self, source: str, filename: str = ..., + symbol: str = ...) -> bool: ... + def runcode(self, code: CodeType) -> None: ... + def showsyntaxerror(self, filename: Optional[str] = ...) -> None: ... + def showtraceback(self) -> None: ... + def write(self, data: str) -> None: ... + +class InteractiveConsole(InteractiveInterpreter): + def __init__(self, locals: Optional[Mapping[str, Any]] = ..., + filename: str = ...) -> None: ... + if sys.version_info >= (3, 6): + def interact(self, banner: Optional[str] = ..., + exitmsg: Optional[str] = ...) -> None: ... + else: + def interact(self, banner: Optional[str] = ...) -> None: ... + def push(self, line: str) -> bool: ... + def resetbuffer(self) -> None: ... + def raw_input(self, prompt: str = ...) -> str: ... + +if sys.version_info >= (3, 6): + def interact(banner: Optional[str] = ..., + readfunc: Optional[Callable[[str], str]] = ..., + local: Optional[Mapping[str, Any]] = ..., + exitmsg: Optional[str] = ...) -> None: ... +else: + def interact(banner: Optional[str] = ..., + readfunc: Optional[Callable[[str], str]] = ..., + local: Optional[Mapping[str, Any]] = ...) -> None: ... +def compile_command(source: str, filename: str = ..., + symbol: str = ...) -> Optional[CodeType]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/codecs.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/codecs.pyi new file mode 100644 index 0000000..b99ce91 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/codecs.pyi @@ -0,0 +1,242 @@ +import sys +from typing import Any, BinaryIO, Callable, Generator, IO, Iterable, Iterator, List, Optional, Protocol, Text, TextIO, Tuple, Type, TypeVar, Union + +from abc import abstractmethod +import types + +# TODO: this only satisfies the most common interface, where +# bytes (py2 str) is the raw form and str (py2 unicode) is the cooked form. +# In the long run, both should become template parameters maybe? +# There *are* bytes->bytes and str->str encodings in the standard library. +# They are much more common in Python 2 than in Python 3. + +_Decoded = Text +_Encoded = bytes + +class _Encoder(Protocol): + def __call__(self, input: _Decoded, errors: str = ...) -> Tuple[_Encoded, int]: ... # signature of Codec().encode +class _Decoder(Protocol): + def __call__(self, input: _Encoded, errors: str = ...) -> Tuple[_Decoded, int]: ... # signature of Codec().decode + +class _StreamReader(Protocol): + def __call__(self, stream: IO[_Encoded], errors: str = ...) -> StreamReader: ... +class _StreamWriter(Protocol): + def __call__(self, stream: IO[_Encoded], errors: str = ...) -> StreamWriter: ... + +class _IncrementalEncoder(Protocol): + def __call__(self, errors: str = ...) -> IncrementalEncoder: ... +class _IncrementalDecoder(Protocol): + def __call__(self, errors: str = ...) -> IncrementalDecoder: ... + +def encode(obj: _Decoded, encoding: str = ..., errors: str = ...) -> _Encoded: ... +def decode(obj: _Encoded, encoding: str = ..., errors: str = ...) -> _Decoded: ... +def lookup(encoding: str) -> CodecInfo: ... + +class CodecInfo(Tuple[_Encoder, _Decoder, _StreamReader, _StreamWriter]): + @property + def encode(self) -> _Encoder: ... + @property + def decode(self) -> _Decoder: ... + @property + def streamreader(self) -> _StreamReader: ... + @property + def streamwriter(self) -> _StreamWriter: ... + @property + def incrementalencoder(self) -> _IncrementalEncoder: ... + @property + def incrementaldecoder(self) -> _IncrementalDecoder: ... + name: str + def __init__( + self, + encode: _Encoder, + decode: _Decoder, + streamreader: _StreamReader = ..., + streamwriter: _StreamWriter = ..., + incrementalencoder: _IncrementalEncoder = ..., + incrementaldecoder: _IncrementalDecoder = ..., + name: str = ..., + ) -> None: ... + +def getencoder(encoding: str) -> _Encoder: ... +def getdecoder(encoding: str) -> _Decoder: ... +def getincrementalencoder(encoding: str) -> _IncrementalEncoder: ... +def getincrementaldecoder(encoding: str) -> _IncrementalDecoder: ... +def getreader(encoding: str) -> _StreamReader: ... +def getwriter(encoding: str) -> _StreamWriter: ... +def register(search_function: Callable[[str], CodecInfo]) -> None: ... +def open(filename: str, mode: str = ..., encoding: str = ..., errors: str = ..., buffering: int = ...) -> StreamReaderWriter: ... +def EncodedFile(file: IO[_Encoded], data_encoding: str, file_encoding: str = ..., errors: str = ...) -> StreamRecoder: ... +def iterencode(iterator: Iterable[_Decoded], encoding: str, errors: str = ...) -> Generator[_Encoded, None, None]: ... +def iterdecode(iterator: Iterable[_Encoded], encoding: str, errors: str = ...) -> Generator[_Decoded, None, None]: ... + +BOM: bytes +BOM_BE: bytes +BOM_LE: bytes +BOM_UTF8: bytes +BOM_UTF16: bytes +BOM_UTF16_BE: bytes +BOM_UTF16_LE: bytes +BOM_UTF32: bytes +BOM_UTF32_BE: bytes +BOM_UTF32_LE: bytes + +# It is expected that different actions be taken depending on which of the +# three subclasses of `UnicodeError` is actually ...ed. However, the Union +# is still needed for at least one of the cases. +def register_error(name: str, error_handler: Callable[[UnicodeError], Tuple[Union[str, bytes], int]]) -> None: ... +def lookup_error(name: str) -> Callable[[UnicodeError], Tuple[Union[str, bytes], int]]: ... +def strict_errors(exception: UnicodeError) -> Tuple[Union[str, bytes], int]: ... +def replace_errors(exception: UnicodeError) -> Tuple[Union[str, bytes], int]: ... +def ignore_errors(exception: UnicodeError) -> Tuple[Union[str, bytes], int]: ... +def xmlcharrefreplace_errors(exception: UnicodeError) -> Tuple[Union[str, bytes], int]: ... +def backslashreplace_errors(exception: UnicodeError) -> Tuple[Union[str, bytes], int]: ... + +class Codec: + # These are sort of @abstractmethod but sort of not. + # The StreamReader and StreamWriter subclasses only implement one. + def encode(self, input: _Decoded, errors: str = ...) -> Tuple[_Encoded, int]: ... + def decode(self, input: _Encoded, errors: str = ...) -> Tuple[_Decoded, int]: ... + +class IncrementalEncoder: + errors: str + def __init__(self, errors: str = ...) -> None: ... + @abstractmethod + def encode(self, object: _Decoded, final: bool = ...) -> _Encoded: ... + def reset(self) -> None: ... + # documentation says int but str is needed for the subclass. + def getstate(self) -> Union[int, _Decoded]: ... + def setstate(self, state: Union[int, _Decoded]) -> None: ... + +class IncrementalDecoder: + errors: str + def __init__(self, errors: str = ...) -> None: ... + @abstractmethod + def decode(self, object: _Encoded, final: bool = ...) -> _Decoded: ... + def reset(self) -> None: ... + def getstate(self) -> Tuple[_Encoded, int]: ... + def setstate(self, state: Tuple[_Encoded, int]) -> None: ... + +# These are not documented but used in encodings/*.py implementations. +class BufferedIncrementalEncoder(IncrementalEncoder): + buffer: str + def __init__(self, errors: str = ...) -> None: ... + @abstractmethod + def _buffer_encode(self, input: _Decoded, errors: str, final: bool) -> _Encoded: ... + def encode(self, input: _Decoded, final: bool = ...) -> _Encoded: ... + +class BufferedIncrementalDecoder(IncrementalDecoder): + buffer: bytes + def __init__(self, errors: str = ...) -> None: ... + @abstractmethod + def _buffer_decode(self, input: _Encoded, errors: str, final: bool) -> Tuple[_Decoded, int]: ... + def decode(self, object: _Encoded, final: bool = ...) -> _Decoded: ... + +_SW = TypeVar("_SW", bound=StreamWriter) + +# TODO: it is not possible to specify the requirement that all other +# attributes and methods are passed-through from the stream. +class StreamWriter(Codec): + errors: str + def __init__(self, stream: IO[_Encoded], errors: str = ...) -> None: ... + def write(self, obj: _Decoded) -> None: ... + def writelines(self, list: Iterable[_Decoded]) -> None: ... + def reset(self) -> None: ... + def __enter__(self: _SW) -> _SW: ... + def __exit__( + self, typ: Optional[Type[BaseException]], exc: Optional[BaseException], tb: Optional[types.TracebackType] + ) -> None: ... + def __getattr__(self, name: str) -> Any: ... + +_SR = TypeVar("_SR", bound=StreamReader) + +class StreamReader(Codec): + errors: str + def __init__(self, stream: IO[_Encoded], errors: str = ...) -> None: ... + def read(self, size: int = ..., chars: int = ..., firstline: bool = ...) -> _Decoded: ... + def readline(self, size: int = ..., keepends: bool = ...) -> _Decoded: ... + def readlines(self, sizehint: int = ..., keepends: bool = ...) -> List[_Decoded]: ... + def reset(self) -> None: ... + def __enter__(self: _SR) -> _SR: ... + def __exit__( + self, typ: Optional[Type[BaseException]], exc: Optional[BaseException], tb: Optional[types.TracebackType] + ) -> None: ... + def __iter__(self) -> Iterator[_Decoded]: ... + def __getattr__(self, name: str) -> Any: ... + +_T = TypeVar("_T", bound=StreamReaderWriter) + +# Doesn't actually inherit from TextIO, but wraps a BinaryIO to provide text reading and writing +# and delegates attributes to the underlying binary stream with __getattr__. +class StreamReaderWriter(TextIO): + def __init__(self, stream: IO[_Encoded], Reader: _StreamReader, Writer: _StreamWriter, errors: str = ...) -> None: ... + def read(self, size: int = ...) -> _Decoded: ... + def readline(self, size: Optional[int] = ...) -> _Decoded: ... + def readlines(self, sizehint: Optional[int] = ...) -> List[_Decoded]: ... + if sys.version_info >= (3,): + def __next__(self) -> Text: ... + else: + def next(self) -> Text: ... + def __iter__(self: _T) -> _T: ... + # This actually returns None, but that's incompatible with the supertype + def write(self, data: _Decoded) -> int: ... + def writelines(self, list: Iterable[_Decoded]) -> None: ... + def reset(self) -> None: ... + # Same as write() + def seek(self, offset: int, whence: int = ...) -> int: ... + def __enter__(self: _T) -> _T: ... + def __exit__( + self, typ: Optional[Type[BaseException]], exc: Optional[BaseException], tb: Optional[types.TracebackType] + ) -> bool: ... + def __getattr__(self, name: str) -> Any: ... + # These methods don't actually exist directly, but they are needed to satisfy the TextIO + # interface. At runtime, they are delegated through __getattr__. + def close(self) -> None: ... + def fileno(self) -> int: ... + def flush(self) -> None: ... + def isatty(self) -> bool: ... + def readable(self) -> bool: ... + def truncate(self, size: Optional[int] = ...) -> int: ... + def seekable(self) -> bool: ... + def tell(self) -> int: ... + def writable(self) -> bool: ... + +_SRT = TypeVar("_SRT", bound=StreamRecoder) + +class StreamRecoder(BinaryIO): + def __init__( + self, + stream: IO[_Encoded], + encode: _Encoder, + decode: _Decoder, + Reader: _StreamReader, + Writer: _StreamWriter, + errors: str = ..., + ) -> None: ... + def read(self, size: int = ...) -> bytes: ... + def readline(self, size: Optional[int] = ...) -> bytes: ... + def readlines(self, sizehint: Optional[int] = ...) -> List[bytes]: ... + if sys.version_info >= (3,): + def __next__(self) -> bytes: ... + else: + def next(self) -> bytes: ... + def __iter__(self: _SRT) -> _SRT: ... + def write(self, data: bytes) -> int: ... + def writelines(self, list: Iterable[bytes]) -> int: ... # type: ignore # it's supposed to return None + def reset(self) -> None: ... + def __getattr__(self, name: str) -> Any: ... + def __enter__(self: _SRT) -> _SRT: ... + def __exit__( + self, type: Optional[Type[BaseException]], value: Optional[BaseException], tb: Optional[types.TracebackType] + ) -> bool: ... + # These methods don't actually exist directly, but they are needed to satisfy the BinaryIO + # interface. At runtime, they are delegated through __getattr__. + def seek(self, offset: int, whence: int = ...) -> int: ... + def close(self) -> None: ... + def fileno(self) -> int: ... + def flush(self) -> None: ... + def isatty(self) -> bool: ... + def readable(self) -> bool: ... + def truncate(self, size: Optional[int] = ...) -> int: ... + def seekable(self) -> bool: ... + def tell(self) -> int: ... + def writable(self) -> bool: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/codeop.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/codeop.pyi new file mode 100644 index 0000000..0e1129e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/codeop.pyi @@ -0,0 +1,17 @@ +# Source(py2): https://hg.python.org/cpython/file/2.7/Lib/codeop.py +# Source(py3): https://github.com/python/cpython/blob/master/Lib/codeop.py + +from types import CodeType +from typing import Optional + +def compile_command(source: str, filename: str = ..., symbol: str = ...) -> Optional[CodeType]: ... + +class Compile: + flags: int + def __init__(self) -> None: ... + def __call__(self, source: str, filename: str, symbol: str) -> CodeType: ... + +class CommandCompiler: + compiler: Compile + def __init__(self) -> None: ... + def __call__(self, source: str, filename: str = ..., symbol: str = ...) -> Optional[CodeType]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/colorsys.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/colorsys.pyi new file mode 100644 index 0000000..c8b5591 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/colorsys.pyi @@ -0,0 +1,15 @@ +# Stubs for colorsys + +from typing import Tuple + +def rgb_to_yiq(r: float, g: float, b: float) -> Tuple[float, float, float]: ... +def yiq_to_rgb(y: float, i: float, q: float) -> Tuple[float, float, float]: ... +def rgb_to_hls(r: float, g: float, b: float) -> Tuple[float, float, float]: ... +def hls_to_rgb(h: float, l: float, s: float) -> Tuple[float, float, float]: ... +def rgb_to_hsv(r: float, g: float, b: float) -> Tuple[float, float, float]: ... +def hsv_to_rgb(h: float, s: float, v: float) -> Tuple[float, float, float]: ... + +# TODO undocumented +ONE_SIXTH: float +ONE_THIRD: float +TWO_THIRD: float diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/contextlib.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/contextlib.pyi new file mode 100644 index 0000000..dec1b41 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/contextlib.pyi @@ -0,0 +1,99 @@ +# Stubs for contextlib + +from typing import ( + Any, Callable, Generator, IO, Iterable, Iterator, Optional, Type, + Generic, TypeVar, overload +) +from types import TracebackType +import sys +# Aliased here for backwards compatibility; TODO eventually remove this +from typing import ContextManager as ContextManager + +if sys.version_info >= (3, 5): + from typing import AsyncContextManager, AsyncIterator + +if sys.version_info >= (3, 6): + from typing import ContextManager as AbstractContextManager +if sys.version_info >= (3, 7): + from typing import AsyncContextManager as AbstractAsyncContextManager + +_T = TypeVar('_T') + +_ExitFunc = Callable[[Optional[Type[BaseException]], + Optional[BaseException], + Optional[TracebackType]], bool] +_CM_EF = TypeVar('_CM_EF', ContextManager, _ExitFunc) + +if sys.version_info >= (3, 2): + class GeneratorContextManager(ContextManager[_T], Generic[_T]): + def __call__(self, func: Callable[..., _T]) -> Callable[..., _T]: ... + def contextmanager(func: Callable[..., Iterator[_T]]) -> Callable[..., GeneratorContextManager[_T]]: ... +else: + def contextmanager(func: Callable[..., Iterator[_T]]) -> Callable[..., ContextManager[_T]]: ... + +if sys.version_info >= (3, 7): + def asynccontextmanager(func: Callable[..., AsyncIterator[_T]]) -> Callable[..., AsyncContextManager[_T]]: ... + +if sys.version_info < (3,): + def nested(*mgr: ContextManager[Any]) -> ContextManager[Iterable[Any]]: ... + +class closing(ContextManager[_T], Generic[_T]): + def __init__(self, thing: _T) -> None: ... + +if sys.version_info >= (3, 4): + class suppress(ContextManager[None]): + def __init__(self, *exceptions: Type[BaseException]) -> None: ... + + class redirect_stdout(ContextManager[None]): + def __init__(self, new_target: IO[str]) -> None: ... + +if sys.version_info >= (3, 5): + class redirect_stderr(ContextManager[None]): + def __init__(self, new_target: IO[str]) -> None: ... + +if sys.version_info >= (3,): + class ContextDecorator: + def __call__(self, func: Callable[..., None]) -> Callable[..., ContextManager[None]]: ... + + _U = TypeVar('_U', bound='ExitStack') + + class ExitStack(ContextManager[ExitStack]): + def __init__(self) -> None: ... + def enter_context(self, cm: ContextManager[_T]) -> _T: ... + def push(self, exit: _CM_EF) -> _CM_EF: ... + def callback(self, callback: Callable[..., Any], + *args: Any, **kwds: Any) -> Callable[..., Any]: ... + def pop_all(self: _U) -> _U: ... + def close(self) -> None: ... + def __enter__(self: _U) -> _U: ... + +if sys.version_info >= (3, 7): + from typing import Awaitable + + _S = TypeVar('_S', bound='AsyncExitStack') + + _ExitCoroFunc = Callable[[Optional[Type[BaseException]], + Optional[BaseException], + Optional[TracebackType]], Awaitable[bool]] + _CallbackCoroFunc = Callable[..., Awaitable[Any]] + _ACM_EF = TypeVar('_ACM_EF', AsyncContextManager, _ExitCoroFunc) + + class AsyncExitStack(AsyncContextManager[AsyncExitStack]): + def __init__(self) -> None: ... + def enter_context(self, cm: ContextManager[_T]) -> _T: ... + def enter_async_context(self, cm: AsyncContextManager[_T]) -> Awaitable[_T]: ... + def push(self, exit: _CM_EF) -> _CM_EF: ... + def push_async_exit(self, exit: _ACM_EF) -> _ACM_EF: ... + def callback(self, callback: Callable[..., Any], + *args: Any, **kwds: Any) -> Callable[..., Any]: ... + def push_async_callback(self, callback: _CallbackCoroFunc, + *args: Any, **kwds: Any) -> _CallbackCoroFunc: ... + def pop_all(self: _S) -> _S: ... + def aclose(self) -> Awaitable[None]: ... + def __aenter__(self: _S) -> Awaitable[_S]: ... + +if sys.version_info >= (3, 7): + @overload + def nullcontext(enter_result: _T) -> ContextManager[_T]: ... + @overload + def nullcontext() -> ContextManager[None]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/copy.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/copy.pyi new file mode 100644 index 0000000..523802a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/copy.pyi @@ -0,0 +1,14 @@ +# Stubs for copy + +from typing import TypeVar, Optional, Dict, Any + +_T = TypeVar('_T') + +# None in CPython but non-None in Jython +PyStringMap: Any + +# Note: memo and _nil are internal kwargs. +def deepcopy(x: _T, memo: Optional[Dict[int, _T]] = ..., _nil: Any = ...) -> _T: ... +def copy(x: _T) -> _T: ... +class Error(Exception): ... +error = Error diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/crypt.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/crypt.pyi new file mode 100644 index 0000000..d55fc26 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/crypt.pyi @@ -0,0 +1,23 @@ +import sys +from typing import List, NamedTuple, Optional, Union + + +if sys.version_info >= (3, 3): + class _Method: ... + + METHOD_CRYPT: _Method + METHOD_MD5: _Method + METHOD_SHA256: _Method + METHOD_SHA512: _Method + if sys.version_info >= (3, 7): + METHOD_BLOWFISH: _Method + + methods: List[_Method] + + if sys.version_info >= (3, 7): + def mksalt(method: Optional[_Method] = ..., *, rounds: Optional[int] = ...) -> str: ... + else: + def mksalt(method: Optional[_Method] = ...) -> str: ... + def crypt(word: str, salt: Optional[Union[str, _Method]] = ...) -> str: ... +else: + def crypt(word: str, salt: str) -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/csv.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/csv.pyi new file mode 100644 index 0000000..0a04951 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/csv.pyi @@ -0,0 +1,93 @@ +from collections import OrderedDict +import sys +from typing import Any, Dict, Iterable, Iterator, List, Mapping, Optional, Sequence, Union + +from _csv import (_reader, + _writer, + reader as reader, + writer as writer, + register_dialect as register_dialect, + unregister_dialect as unregister_dialect, + get_dialect as get_dialect, + list_dialects as list_dialects, + field_size_limit as field_size_limit, + QUOTE_ALL as QUOTE_ALL, + QUOTE_MINIMAL as QUOTE_MINIMAL, + QUOTE_NONE as QUOTE_NONE, + QUOTE_NONNUMERIC as QUOTE_NONNUMERIC, + Error as Error, + ) + +_Dialect = Union[str, Dialect] +_DictRow = Mapping[str, Any] + +class Dialect(object): + delimiter: str + quotechar: Optional[str] + escapechar: Optional[str] + doublequote: bool + skipinitialspace: bool + lineterminator: str + quoting: int + def __init__(self) -> None: ... + +class excel(Dialect): + delimiter: str + quotechar: str + doublequote: bool + skipinitialspace: bool + lineterminator: str + quoting: int + +class excel_tab(excel): + delimiter: str + +if sys.version_info >= (3,): + class unix_dialect(Dialect): + delimiter: str + quotechar: str + doublequote: bool + skipinitialspace: bool + lineterminator: str + quoting: int + +if sys.version_info >= (3, 6): + _DRMapping = OrderedDict[str, str] +else: + _DRMapping = Dict[str, str] + + +class DictReader(Iterator[_DRMapping]): + restkey: Optional[str] + restval: Optional[str] + reader: _reader + dialect: _Dialect + line_num: int + fieldnames: Sequence[str] + def __init__(self, f: Iterable[str], fieldnames: Sequence[str] = ..., + restkey: Optional[str] = ..., restval: Optional[str] = ..., dialect: _Dialect = ..., + *args: Any, **kwds: Any) -> None: ... + def __iter__(self) -> DictReader: ... + if sys.version_info >= (3,): + def __next__(self) -> _DRMapping: ... + else: + def next(self) -> _DRMapping: ... + + +class DictWriter(object): + fieldnames: Sequence[str] + restval: Optional[Any] + extrasaction: str + writer: _writer + def __init__(self, f: Any, fieldnames: Sequence[str], + restval: Optional[Any] = ..., extrasaction: str = ..., dialect: _Dialect = ..., + *args: Any, **kwds: Any) -> None: ... + def writeheader(self) -> None: ... + def writerow(self, rowdict: _DictRow) -> None: ... + def writerows(self, rowdicts: Iterable[_DictRow]) -> None: ... + +class Sniffer(object): + preferred: List[str] + def __init__(self) -> None: ... + def sniff(self, sample: str, delimiters: Optional[str] = ...) -> Dialect: ... + def has_header(self, sample: str) -> bool: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/ctypes/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/ctypes/__init__.pyi new file mode 100644 index 0000000..e4cd6b4 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/ctypes/__init__.pyi @@ -0,0 +1,285 @@ +# Stubs for ctypes + +from array import array +from typing import ( + Any, Callable, ClassVar, Iterator, Iterable, List, Mapping, Optional, Sequence, Sized, Text, + Tuple, Type, Generic, TypeVar, overload, +) +from typing import Union as _UnionT +import sys + +_T = TypeVar('_T') +_DLLT = TypeVar('_DLLT', bound=CDLL) +_CT = TypeVar('_CT', bound=_CData) + + +RTLD_GLOBAL: int = ... +RTLD_LOCAL: int = ... +DEFAULT_MODE: int = ... + + +class CDLL(object): + _func_flags_: ClassVar[int] = ... + _func_restype_: ClassVar[_CData] = ... + _name: str = ... + _handle: int = ... + _FuncPtr: Type[_FuncPointer] = ... + def __init__(self, name: str, mode: int = ..., handle: Optional[int] = ..., + use_errno: bool = ..., use_last_error: bool = ...) -> None: ... + def __getattr__(self, name: str) -> _FuncPointer: ... + def __getitem__(self, name: str) -> _FuncPointer: ... +if sys.platform == 'win32': + class OleDLL(CDLL): ... + class WinDLL(CDLL): ... +class PyDLL(CDLL): ... + +class LibraryLoader(Generic[_DLLT]): + def __init__(self, dlltype: Type[_DLLT]) -> None: ... + def __getattr__(self, name: str) -> _DLLT: ... + def __getitem__(self, name: str) -> _DLLT: ... + def LoadLibrary(self, name: str) -> _DLLT: ... + +cdll: LibraryLoader[CDLL] = ... +if sys.platform == 'win32': + windll: LibraryLoader[WinDLL] = ... + oledll: LibraryLoader[OleDLL] = ... +pydll: LibraryLoader[PyDLL] = ... +pythonapi: PyDLL = ... + +# Anything that implements the read-write buffer interface. +# The buffer interface is defined purely on the C level, so we cannot define a normal Protocol +# for it. Instead we have to list the most common stdlib buffer classes in a Union. +_WritableBuffer = _UnionT[bytearray, memoryview, array, _CData] +# Same as _WritableBuffer, but also includes read-only buffer types (like bytes). +_ReadOnlyBuffer = _UnionT[_WritableBuffer, bytes] + +class _CDataMeta(type): + # By default mypy complains about the following two methods, because strictly speaking cls + # might not be a Type[_CT]. However this can never actually happen, because the only class that + # uses _CDataMeta as its metaclass is _CData. So it's safe to ignore the errors here. + def __mul__(cls: Type[_CT], other: int) -> Type[Array[_CT]]: ... # type: ignore + def __rmul__(cls: Type[_CT], other: int) -> Type[Array[_CT]]: ... # type: ignore +class _CData(metaclass=_CDataMeta): + _b_base: int = ... + _b_needsfree_: bool = ... + _objects: Optional[Mapping[Any, int]] = ... + @classmethod + def from_buffer(cls: Type[_CT], source: _WritableBuffer, offset: int = ...) -> _CT: ... + @classmethod + def from_buffer_copy(cls: Type[_CT], source: _ReadOnlyBuffer, offset: int = ...) -> _CT: ... + @classmethod + def from_address(cls: Type[_CT], address: int) -> _CT: ... + @classmethod + def from_param(cls: Type[_CT], obj: Any) -> _UnionT[_CT, _CArgObject]: ... + @classmethod + def in_dll(cls: Type[_CT], library: CDLL, name: str) -> _CT: ... + +class _PointerLike(_CData): ... + +_ECT = Callable[[Optional[Type[_CData]], + _FuncPointer, + Tuple[_CData, ...]], + _CData] +_PF = _UnionT[ + Tuple[int], + Tuple[int, str], + Tuple[int, str, Any] +] +class _FuncPointer(_PointerLike, _CData): + restype: _UnionT[Type[_CData], Callable[[int], None], None] = ... + argtypes: Sequence[Type[_CData]] = ... + errcheck: _ECT = ... + @overload + def __init__(self, address: int) -> None: ... + @overload + def __init__(self, callable: Callable[..., Any]) -> None: ... + @overload + def __init__(self, func_spec: Tuple[_UnionT[str, int], CDLL], + paramflags: Tuple[_PF, ...] = ...) -> None: ... + @overload + def __init__(self, vtlb_index: int, name: str, + paramflags: Tuple[_PF, ...] = ..., + iid: pointer[c_int] = ...) -> None: ... + def __call__(self, *args: Any, **kwargs: Any) -> Any: ... + +class ArgumentError(Exception): ... + + +def CFUNCTYPE(restype: Optional[Type[_CData]], + *argtypes: Type[_CData], + use_errno: bool = ..., + use_last_error: bool = ...) -> Type[_FuncPointer]: ... +if sys.platform == 'win32': + def WINFUNCTYPE(restype: Optional[Type[_CData]], + *argtypes: Type[_CData], + use_errno: bool = ..., + use_last_error: bool = ...) -> Type[_FuncPointer]: ... +def PYFUNCTYPE(restype: Optional[Type[_CData]], + *argtypes: Type[_CData]) -> Type[_FuncPointer]: ... + +class _CArgObject: ... + +# Any type that can be implicitly converted to c_void_p when passed as a C function argument. +# (bytes is not included here, see below.) +_CVoidPLike = _UnionT[_PointerLike, Array[Any], _CArgObject, int] +# Same as above, but including types known to be read-only (i. e. bytes). +# This distinction is not strictly necessary (ctypes doesn't differentiate between const +# and non-const pointers), but it catches errors like memmove(b'foo', buf, 4) +# when memmove(buf, b'foo', 4) was intended. +_CVoidConstPLike = _UnionT[_CVoidPLike, bytes] + +def addressof(obj: _CData) -> int: ... +def alignment(obj_or_type: _UnionT[_CData, Type[_CData]]) -> int: ... +def byref(obj: _CData, offset: int = ...) -> _CArgObject: ... +_PT = TypeVar('_PT', bound=_PointerLike) +def cast(obj: _UnionT[_CData, _CArgObject], type: Type[_PT]) -> _PT: ... +def create_string_buffer(init_or_size: _UnionT[int, bytes], + size: Optional[int] = ...) -> Array[c_char]: ... +c_buffer = create_string_buffer +def create_unicode_buffer(init_or_size: _UnionT[int, Text], + size: Optional[int] = ...) -> Array[c_wchar]: ... +if sys.platform == 'win32': + def DllCanUnloadNow() -> int: ... + def DllGetClassObject(rclsid: Any, riid: Any, ppv: Any) -> int: ... # TODO not documented + def FormatError(code: int) -> str: ... + def GetLastError() -> int: ... +def get_errno() -> int: ... +if sys.platform == 'win32': + def get_last_error() -> int: ... +def memmove(dst: _CVoidPLike, src: _CVoidConstPLike, count: int) -> None: ... +def memset(dst: _CVoidPLike, c: int, count: int) -> None: ... +def POINTER(type: Type[_CT]) -> Type[pointer[_CT]]: ... + +# The real ctypes.pointer is a function, not a class. The stub version of pointer behaves like +# ctypes._Pointer in that it is the base class for all pointer types. Unlike the real _Pointer, +# it can be instantiated directly (to mimic the behavior of the real pointer function). +class pointer(Generic[_CT], _PointerLike, _CData): + _type_: ClassVar[Type[_CT]] = ... + contents: _CT = ... + def __init__(self, arg: _CT = ...) -> None: ... + @overload + def __getitem__(self, i: int) -> _CT: ... + @overload + def __getitem__(self, s: slice) -> List[_CT]: ... + @overload + def __setitem__(self, i: int, o: _CT) -> None: ... + @overload + def __setitem__(self, s: slice, o: Iterable[_CT]) -> None: ... + +def resize(obj: _CData, size: int) -> None: ... +if sys.version_info < (3,): + def set_conversion_mode(encoding: str, errors: str) -> Tuple[str, str]: ... +def set_errno(value: int) -> int: ... +if sys.platform == 'win32': + def set_last_error(value: int) -> int: ... +def sizeof(obj_or_type: _UnionT[_CData, Type[_CData]]) -> int: ... +def string_at(address: _CVoidConstPLike, size: int = ...) -> bytes: ... +if sys.platform == 'win32': + def WinError(code: Optional[int] = ..., + desc: Optional[str] = ...) -> WindowsError: ... +def wstring_at(address: _CVoidConstPLike, size: int = ...) -> str: ... + +class _SimpleCData(Generic[_T], _CData): + value: _T = ... + def __init__(self, value: _T = ...) -> None: ... + +class c_byte(_SimpleCData[int]): ... + +class c_char(_SimpleCData[bytes]): + def __init__(self, value: _UnionT[int, bytes] = ...) -> None: ... +class c_char_p(_PointerLike, _SimpleCData[Optional[bytes]]): + def __init__(self, value: Optional[_UnionT[int, bytes]] = ...) -> None: ... + +class c_double(_SimpleCData[float]): ... +class c_longdouble(_SimpleCData[float]): ... +class c_float(_SimpleCData[float]): ... + +class c_int(_SimpleCData[int]): ... +class c_int8(_SimpleCData[int]): ... +class c_int16(_SimpleCData[int]): ... +class c_int32(_SimpleCData[int]): ... +class c_int64(_SimpleCData[int]): ... + +class c_long(_SimpleCData[int]): ... +class c_longlong(_SimpleCData[int]): ... + +class c_short(_SimpleCData[int]): ... + +class c_size_t(_SimpleCData[int]): ... +class c_ssize_t(_SimpleCData[int]): ... + +class c_ubyte(_SimpleCData[int]): ... + +class c_uint(_SimpleCData[int]): ... +class c_uint8(_SimpleCData[int]): ... +class c_uint16(_SimpleCData[int]): ... +class c_uint32(_SimpleCData[int]): ... +class c_uint64(_SimpleCData[int]): ... + +class c_ulong(_SimpleCData[int]): ... +class c_ulonglong(_SimpleCData[int]): ... + +class c_ushort(_SimpleCData[int]): ... + +class c_void_p(_PointerLike, _SimpleCData[Optional[int]]): ... + +class c_wchar(_SimpleCData[Text]): ... +class c_wchar_p(_PointerLike, _SimpleCData[Optional[Text]]): + def __init__(self, value: Optional[_UnionT[int, Text]] = ...) -> None: ... + +class c_bool(_SimpleCData[bool]): + def __init__(self, value: bool) -> None: ... + +if sys.platform == 'win32': + class HRESULT(_SimpleCData[int]): ... # TODO undocumented + +class py_object(_SimpleCData[_T]): ... + +class _CField: + offset: int = ... + size: int = ... +class _StructUnionMeta(_CDataMeta): + _fields_: Sequence[_UnionT[Tuple[str, Type[_CData]], Tuple[str, Type[_CData], int]]] = ... + _pack_: int = ... + _anonymous_: Sequence[str] = ... + def __getattr__(self, name: str) -> _CField: ... +class _StructUnionBase(_CData, metaclass=_StructUnionMeta): + def __init__(self, *args: Any, **kw: Any) -> None: ... + def __getattr__(self, name: str) -> Any: ... + def __setattr__(self, name: str, value: Any) -> None: ... + +class Union(_StructUnionBase): ... +class Structure(_StructUnionBase): ... +class BigEndianStructure(Structure): ... +class LittleEndianStructure(Structure): ... + +class Array(Generic[_CT], _CData): + _length_: ClassVar[int] = ... + _type_: ClassVar[Type[_CT]] = ... + raw: bytes = ... # Note: only available if _CT == c_char + value: Any = ... # Note: bytes if _CT == c_char, Text if _CT == c_wchar, unavailable otherwise + # TODO These methods cannot be annotated correctly at the moment. + # All of these "Any"s stand for the array's element type, but it's not possible to use _CT + # here, because of a special feature of ctypes. + # By default, when accessing an element of an Array[_CT], the returned object has type _CT. + # However, when _CT is a "simple type" like c_int, ctypes automatically "unboxes" the object + # and converts it to the corresponding Python primitive. For example, when accessing an element + # of an Array[c_int], a Python int object is returned, not a c_int. + # This behavior does *not* apply to subclasses of "simple types". + # If MyInt is a subclass of c_int, then accessing an element of an Array[MyInt] returns + # a MyInt, not an int. + # This special behavior is not easy to model in a stub, so for now all places where + # the array element type would belong are annotated with Any instead. + def __init__(self, *args: Any) -> None: ... + @overload + def __getitem__(self, i: int) -> Any: ... + @overload + def __getitem__(self, s: slice) -> List[Any]: ... + @overload + def __setitem__(self, i: int, o: Any) -> None: ... + @overload + def __setitem__(self, s: slice, o: Iterable[Any]) -> None: ... + def __iter__(self) -> Iterator[Any]: ... + # Can't inherit from Sized because the metaclass conflict between + # Sized and _CData prevents using _CDataMeta. + def __len__(self) -> int: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/ctypes/util.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/ctypes/util.pyi new file mode 100644 index 0000000..7077d9d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/ctypes/util.pyi @@ -0,0 +1,8 @@ +# Stubs for ctypes.util + +from typing import Optional +import sys + +def find_library(name: str) -> Optional[str]: ... +if sys.platform == 'win32': + def find_msvcrt() -> Optional[str]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/ctypes/wintypes.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/ctypes/wintypes.pyi new file mode 100644 index 0000000..c5a6226 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/ctypes/wintypes.pyi @@ -0,0 +1,209 @@ +from ctypes import ( + _SimpleCData, Array, Structure, c_byte, c_char, c_char_p, c_double, c_float, c_int, c_long, + c_longlong, c_short, c_uint, c_ulong, c_ulonglong, c_ushort, c_void_p, c_wchar, c_wchar_p, + pointer, +) + +BYTE = c_byte +WORD = c_ushort +DWORD = c_ulong +CHAR = c_char +WCHAR = c_wchar +UINT = c_uint +INT = c_int +DOUBLE = c_double +FLOAT = c_float +BOOLEAN = BYTE +BOOL = c_long +class VARIANT_BOOL(_SimpleCData[bool]): ... +ULONG = c_ulong +LONG = c_long +USHORT = c_ushort +SHORT = c_short +LARGE_INTEGER = c_longlong +_LARGE_INTEGER = c_longlong +ULARGE_INTEGER = c_ulonglong +_ULARGE_INTEGER = c_ulonglong + +OLESTR = c_wchar_p +LPOLESTR = c_wchar_p +LPCOLESTR = c_wchar_p +LPWSTR = c_wchar_p +LPCWSTR = c_wchar_p +LPSTR = c_char_p +LPCSTR = c_char_p +LPVOID = c_void_p +LPCVOID = c_void_p + +# These two types are pointer-sized unsigned and signed ints, respectively. +# At runtime, they are either c_[u]long or c_[u]longlong, depending on the host's pointer size +# (they are not really separate classes). +class WPARAM(_SimpleCData[int]): ... +class LPARAM(_SimpleCData[int]): ... + +ATOM = WORD +LANGID = WORD +COLORREF = DWORD +LGRPID = DWORD +LCTYPE = DWORD +LCID = DWORD + +HANDLE = c_void_p +HACCEL = HANDLE +HBITMAP = HANDLE +HBRUSH = HANDLE +HCOLORSPACE = HANDLE +HDC = HANDLE +HDESK = HANDLE +HDWP = HANDLE +HENHMETAFILE = HANDLE +HFONT = HANDLE +HGDIOBJ = HANDLE +HGLOBAL = HANDLE +HHOOK = HANDLE +HICON = HANDLE +HINSTANCE = HANDLE +HKEY = HANDLE +HKL = HANDLE +HLOCAL = HANDLE +HMENU = HANDLE +HMETAFILE = HANDLE +HMODULE = HANDLE +HMONITOR = HANDLE +HPALETTE = HANDLE +HPEN = HANDLE +HRGN = HANDLE +HRSRC = HANDLE +HSTR = HANDLE +HTASK = HANDLE +HWINSTA = HANDLE +HWND = HANDLE +SC_HANDLE = HANDLE +SERVICE_STATUS_HANDLE = HANDLE + +class RECT(Structure): + left: LONG + top: LONG + right: LONG + bottom: LONG +RECTL = RECT +_RECTL = RECT +tagRECT = RECT + +class _SMALL_RECT(Structure): + Left: SHORT + Top: SHORT + Right: SHORT + Bottom: SHORT +SMALL_RECT = _SMALL_RECT + +class _COORD(Structure): + X: SHORT + Y: SHORT + +class POINT(Structure): + x: LONG + y: LONG +POINTL = POINT +_POINTL = POINT +tagPOINT = POINT + +class SIZE(Structure): + cx: LONG + cy: LONG +SIZEL = SIZE +tagSIZE = SIZE + +def RGB(red: int, green: int, blue: int) -> int: ... + +class FILETIME(Structure): + dwLowDateTime: DWORD + dwHighDateTime: DWORD +_FILETIME = FILETIME + +class MSG(Structure): + hWnd: HWND + message: UINT + wParam: WPARAM + lParam: LPARAM + time: DWORD + pt: POINT +tagMSG = MSG +MAX_PATH: int + +class WIN32_FIND_DATAA(Structure): + dwFileAttributes: DWORD + ftCreationTime: FILETIME + ftLastAccessTime: FILETIME + ftLastWriteTime: FILETIME + nFileSizeHigh: DWORD + nFileSizeLow: DWORD + dwReserved0: DWORD + dwReserved1: DWORD + cFileName: Array[CHAR] + cAlternateFileName: Array[CHAR] + +class WIN32_FIND_DATAW(Structure): + dwFileAttributes: DWORD + ftCreationTime: FILETIME + ftLastAccessTime: FILETIME + ftLastWriteTime: FILETIME + nFileSizeHigh: DWORD + nFileSizeLow: DWORD + dwReserved0: DWORD + dwReserved1: DWORD + cFileName: Array[WCHAR] + cAlternateFileName: Array[WCHAR] + +# These pointer type definitions use pointer[...] instead of POINTER(...), to allow them +# to be used in type annotations. +PBOOL = pointer[BOOL] +LPBOOL = pointer[BOOL] +PBOOLEAN = pointer[BOOLEAN] +PBYTE = pointer[BYTE] +LPBYTE = pointer[BYTE] +PCHAR = pointer[CHAR] +LPCOLORREF = pointer[COLORREF] +PDWORD = pointer[DWORD] +LPDWORD = pointer[DWORD] +PFILETIME = pointer[FILETIME] +LPFILETIME = pointer[FILETIME] +PFLOAT = pointer[FLOAT] +PHANDLE = pointer[HANDLE] +LPHANDLE = pointer[HANDLE] +PHKEY = pointer[HKEY] +LPHKL = pointer[HKL] +PINT = pointer[INT] +LPINT = pointer[INT] +PLARGE_INTEGER = pointer[LARGE_INTEGER] +PLCID = pointer[LCID] +PLONG = pointer[LONG] +LPLONG = pointer[LONG] +PMSG = pointer[MSG] +LPMSG = pointer[MSG] +PPOINT = pointer[POINT] +LPPOINT = pointer[POINT] +PPOINTL = pointer[POINTL] +PRECT = pointer[RECT] +LPRECT = pointer[RECT] +PRECTL = pointer[RECTL] +LPRECTL = pointer[RECTL] +LPSC_HANDLE = pointer[SC_HANDLE] +PSHORT = pointer[SHORT] +PSIZE = pointer[SIZE] +LPSIZE = pointer[SIZE] +PSIZEL = pointer[SIZEL] +LPSIZEL = pointer[SIZEL] +PSMALL_RECT = pointer[SMALL_RECT] +PUINT = pointer[UINT] +LPUINT = pointer[UINT] +PULARGE_INTEGER = pointer[ULARGE_INTEGER] +PULONG = pointer[ULONG] +PUSHORT = pointer[USHORT] +PWCHAR = pointer[WCHAR] +PWIN32_FIND_DATAA = pointer[WIN32_FIND_DATAA] +LPWIN32_FIND_DATAA = pointer[WIN32_FIND_DATAA] +PWIN32_FIND_DATAW = pointer[WIN32_FIND_DATAW] +LPWIN32_FIND_DATAW = pointer[WIN32_FIND_DATAW] +PWORD = pointer[WORD] +LPWORD = pointer[WORD] diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/datetime.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/datetime.pyi new file mode 100644 index 0000000..ccc92ba --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/datetime.pyi @@ -0,0 +1,290 @@ +import sys +from time import struct_time +from typing import ( + AnyStr, Optional, SupportsAbs, Tuple, Union, overload, + ClassVar, +) + +if sys.version_info >= (3,): + _Text = str +else: + _Text = Union[str, unicode] + +MINYEAR: int +MAXYEAR: int + +class tzinfo: + def tzname(self, dt: Optional[datetime]) -> Optional[str]: ... + def utcoffset(self, dt: Optional[datetime]) -> Optional[timedelta]: ... + def dst(self, dt: Optional[datetime]) -> Optional[timedelta]: ... + def fromutc(self, dt: datetime) -> datetime: ... + +if sys.version_info >= (3, 2): + class timezone(tzinfo): + utc: ClassVar[timezone] + min: ClassVar[timezone] + max: ClassVar[timezone] + + def __init__(self, offset: timedelta, name: str = ...) -> None: ... + def __hash__(self) -> int: ... + +_tzinfo = tzinfo + +class date: + min: ClassVar[date] + max: ClassVar[date] + resolution: ClassVar[timedelta] + + def __init__(self, year: int, month: int, day: int) -> None: ... + + @classmethod + def fromtimestamp(cls, t: float) -> date: ... + @classmethod + def today(cls) -> date: ... + @classmethod + def fromordinal(cls, n: int) -> date: ... + if sys.version_info >= (3, 7): + @classmethod + def fromisoformat(cls, date_string: str) -> date: ... + + @property + def year(self) -> int: ... + @property + def month(self) -> int: ... + @property + def day(self) -> int: ... + + def ctime(self) -> str: ... + def strftime(self, fmt: _Text) -> str: ... + if sys.version_info >= (3,): + def __format__(self, fmt: str) -> str: ... + else: + def __format__(self, fmt: AnyStr) -> AnyStr: ... + def isoformat(self) -> str: ... + def timetuple(self) -> struct_time: ... + def toordinal(self) -> int: ... + def replace(self, year: int = ..., month: int = ..., day: int = ...) -> date: ... + def __le__(self, other: date) -> bool: ... + def __lt__(self, other: date) -> bool: ... + def __ge__(self, other: date) -> bool: ... + def __gt__(self, other: date) -> bool: ... + def __add__(self, other: timedelta) -> date: ... + @overload + def __sub__(self, other: timedelta) -> date: ... + @overload + def __sub__(self, other: date) -> timedelta: ... + def __hash__(self) -> int: ... + def weekday(self) -> int: ... + def isoweekday(self) -> int: ... + def isocalendar(self) -> Tuple[int, int, int]: ... + +class time: + min: ClassVar[time] + max: ClassVar[time] + resolution: ClassVar[timedelta] + + if sys.version_info >= (3, 6): + def __init__(self, hour: int = ..., minute: int = ..., second: int = ..., microsecond: int = ..., + tzinfo: Optional[_tzinfo] = ..., *, fold: int = ...) -> None: ... + else: + def __init__(self, hour: int = ..., minute: int = ..., second: int = ..., microsecond: int = ..., + tzinfo: Optional[_tzinfo] = ...) -> None: ... + + @property + def hour(self) -> int: ... + @property + def minute(self) -> int: ... + @property + def second(self) -> int: ... + @property + def microsecond(self) -> int: ... + @property + def tzinfo(self) -> Optional[_tzinfo]: ... + if sys.version_info >= (3, 6): + @property + def fold(self) -> int: ... + + def __le__(self, other: time) -> bool: ... + def __lt__(self, other: time) -> bool: ... + def __ge__(self, other: time) -> bool: ... + def __gt__(self, other: time) -> bool: ... + def __hash__(self) -> int: ... + def isoformat(self) -> str: ... + if sys.version_info >= (3, 7): + @classmethod + def fromisoformat(cls, time_string: str) -> time: ... + def strftime(self, fmt: _Text) -> str: ... + if sys.version_info >= (3,): + def __format__(self, fmt: str) -> str: ... + else: + def __format__(self, fmt: AnyStr) -> AnyStr: ... + def utcoffset(self) -> Optional[timedelta]: ... + def tzname(self) -> Optional[str]: ... + def dst(self) -> Optional[int]: ... + if sys.version_info >= (3, 6): + def replace(self, hour: int = ..., minute: int = ..., second: int = ..., + microsecond: int = ..., tzinfo: Optional[_tzinfo] = ..., + *, fold: int = ...) -> time: ... + else: + def replace(self, hour: int = ..., minute: int = ..., second: int = ..., + microsecond: int = ..., tzinfo: Optional[_tzinfo] = ...) -> time: ... + +_date = date +_time = time + +class timedelta(SupportsAbs[timedelta]): + min: ClassVar[timedelta] + max: ClassVar[timedelta] + resolution: ClassVar[timedelta] + + if sys.version_info >= (3, 6): + def __init__(self, days: float = ..., seconds: float = ..., microseconds: float = ..., + milliseconds: float = ..., minutes: float = ..., hours: float = ..., + weeks: float = ..., *, fold: int = ...) -> None: ... + else: + def __init__(self, days: float = ..., seconds: float = ..., microseconds: float = ..., + milliseconds: float = ..., minutes: float = ..., hours: float = ..., + weeks: float = ...) -> None: ... + + @property + def days(self) -> int: ... + @property + def seconds(self) -> int: ... + @property + def microseconds(self) -> int: ... + + def total_seconds(self) -> float: ... + def __add__(self, other: timedelta) -> timedelta: ... + def __radd__(self, other: timedelta) -> timedelta: ... + def __sub__(self, other: timedelta) -> timedelta: ... + def __rsub__(self, other: timedelta) -> timedelta: ... + def __neg__(self) -> timedelta: ... + def __pos__(self) -> timedelta: ... + def __abs__(self) -> timedelta: ... + def __mul__(self, other: float) -> timedelta: ... + def __rmul__(self, other: float) -> timedelta: ... + @overload + def __floordiv__(self, other: timedelta) -> int: ... + @overload + def __floordiv__(self, other: int) -> timedelta: ... + if sys.version_info >= (3,): + @overload + def __truediv__(self, other: timedelta) -> float: ... + @overload + def __truediv__(self, other: float) -> timedelta: ... + def __mod__(self, other: timedelta) -> timedelta: ... + def __divmod__(self, other: timedelta) -> Tuple[int, timedelta]: ... + else: + @overload + def __div__(self, other: timedelta) -> float: ... + @overload + def __div__(self, other: float) -> timedelta: ... + def __le__(self, other: timedelta) -> bool: ... + def __lt__(self, other: timedelta) -> bool: ... + def __ge__(self, other: timedelta) -> bool: ... + def __gt__(self, other: timedelta) -> bool: ... + def __hash__(self) -> int: ... + +class datetime(date): + min: ClassVar[datetime] + max: ClassVar[datetime] + resolution: ClassVar[timedelta] + + if sys.version_info >= (3, 6): + def __init__(self, year: int, month: int, day: int, hour: int = ..., + minute: int = ..., second: int = ..., microsecond: int = ..., + tzinfo: Optional[_tzinfo] = ..., *, fold: int = ...) -> None: ... + else: + def __init__(self, year: int, month: int, day: int, hour: int = ..., + minute: int = ..., second: int = ..., microsecond: int = ..., + tzinfo: Optional[_tzinfo] = ...) -> None: ... + + @property + def year(self) -> int: ... + @property + def month(self) -> int: ... + @property + def day(self) -> int: ... + @property + def hour(self) -> int: ... + @property + def minute(self) -> int: ... + @property + def second(self) -> int: ... + @property + def microsecond(self) -> int: ... + @property + def tzinfo(self) -> Optional[_tzinfo]: ... + if sys.version_info >= (3, 6): + @property + def fold(self) -> int: ... + + @classmethod + def fromtimestamp(cls, t: float, tz: Optional[_tzinfo] = ...) -> datetime: ... + @classmethod + def utcfromtimestamp(cls, t: float) -> datetime: ... + @classmethod + def today(cls) -> datetime: ... + @classmethod + def fromordinal(cls, n: int) -> datetime: ... + @classmethod + def now(cls, tz: Optional[_tzinfo] = ...) -> datetime: ... + @classmethod + def utcnow(cls) -> datetime: ... + if sys.version_info >= (3, 6): + @classmethod + def combine(cls, date: date, time: time, tzinfo: Optional[_tzinfo] = ...) -> datetime: ... + else: + @classmethod + def combine(cls, date: date, time: time) -> datetime: ... + if sys.version_info >= (3, 7): + @classmethod + def fromisoformat(cls, date_string: str) -> datetime: ... + def strftime(self, fmt: _Text) -> str: ... + if sys.version_info >= (3,): + def __format__(self, fmt: str) -> str: ... + else: + def __format__(self, fmt: AnyStr) -> AnyStr: ... + def toordinal(self) -> int: ... + def timetuple(self) -> struct_time: ... + if sys.version_info >= (3, 3): + def timestamp(self) -> float: ... + def utctimetuple(self) -> struct_time: ... + def date(self) -> _date: ... + def time(self) -> _time: ... + def timetz(self) -> _time: ... + if sys.version_info >= (3, 6): + def replace(self, year: int = ..., month: int = ..., day: int = ..., hour: int = ..., + minute: int = ..., second: int = ..., microsecond: int = ..., tzinfo: + Optional[_tzinfo] = ..., *, fold: int = ...) -> datetime: ... + else: + def replace(self, year: int = ..., month: int = ..., day: int = ..., hour: int = ..., + minute: int = ..., second: int = ..., microsecond: int = ..., tzinfo: + Optional[_tzinfo] = ...) -> datetime: ... + if sys.version_info >= (3, 3): + def astimezone(self, tz: Optional[_tzinfo] = ...) -> datetime: ... + else: + def astimezone(self, tz: _tzinfo) -> datetime: ... + def ctime(self) -> str: ... + if sys.version_info >= (3, 6): + def isoformat(self, sep: str = ..., timespec: str = ...) -> str: ... + else: + def isoformat(self, sep: str = ...) -> str: ... + @classmethod + def strptime(cls, date_string: _Text, format: _Text) -> datetime: ... + def utcoffset(self) -> Optional[timedelta]: ... + def tzname(self) -> Optional[str]: ... + def dst(self) -> Optional[timedelta]: ... + def __le__(self, other: datetime) -> bool: ... # type: ignore + def __lt__(self, other: datetime) -> bool: ... # type: ignore + def __ge__(self, other: datetime) -> bool: ... # type: ignore + def __gt__(self, other: datetime) -> bool: ... # type: ignore + def __add__(self, other: timedelta) -> datetime: ... + @overload # type: ignore + def __sub__(self, other: datetime) -> timedelta: ... + @overload + def __sub__(self, other: timedelta) -> datetime: ... + def __hash__(self) -> int: ... + def weekday(self) -> int: ... + def isoweekday(self) -> int: ... + def isocalendar(self) -> Tuple[int, int, int]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/decimal.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/decimal.pyi new file mode 100644 index 0000000..2018ed8 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/decimal.pyi @@ -0,0 +1,315 @@ +import numbers +import sys +from types import TracebackType +from typing import ( + Any, Container, Dict, List, NamedTuple, Optional, overload, Sequence, Text, Tuple, Type, TypeVar, Union, +) + +_Decimal = Union[Decimal, int] +_DecimalNew = Union[Decimal, float, Text, Tuple[int, Sequence[int], int]] +if sys.version_info >= (3,): + _ComparableNum = Union[Decimal, float, numbers.Rational] +else: + _ComparableNum = Union[Decimal, float] +_DecimalT = TypeVar('_DecimalT', bound=Decimal) + +DecimalTuple = NamedTuple('DecimalTuple', + [('sign', int), + ('digits', Tuple[int, ...]), + ('exponent', int)]) + +ROUND_DOWN: str +ROUND_HALF_UP: str +ROUND_HALF_EVEN: str +ROUND_CEILING: str +ROUND_FLOOR: str +ROUND_UP: str +ROUND_HALF_DOWN: str +ROUND_05UP: str + +if sys.version_info >= (3,): + HAVE_THREADS: bool + MAX_EMAX: int + MAX_PREC: int + MIN_EMIN: int + MIN_ETINY: int + +class DecimalException(ArithmeticError): + def handle(self, context: Context, *args: Any) -> Optional[Decimal]: ... + +class Clamped(DecimalException): ... + +class InvalidOperation(DecimalException): ... + +class ConversionSyntax(InvalidOperation): ... + +class DivisionByZero(DecimalException, ZeroDivisionError): ... + +class DivisionImpossible(InvalidOperation): ... + +class DivisionUndefined(InvalidOperation, ZeroDivisionError): ... + +class Inexact(DecimalException): ... + +class InvalidContext(InvalidOperation): ... + +class Rounded(DecimalException): ... + +class Subnormal(DecimalException): ... + +class Overflow(Inexact, Rounded): ... + +class Underflow(Inexact, Rounded, Subnormal): ... + +if sys.version_info >= (3,): + class FloatOperation(DecimalException, TypeError): ... + +def setcontext(context: Context) -> None: ... +def getcontext() -> Context: ... +def localcontext(ctx: Optional[Context] = ...) -> _ContextManager: ... + +class Decimal(object): + def __new__(cls: Type[_DecimalT], value: _DecimalNew = ..., context: Optional[Context] = ...) -> _DecimalT: ... + @classmethod + def from_float(cls, f: float) -> Decimal: ... + if sys.version_info >= (3,): + def __bool__(self) -> bool: ... + else: + def __nonzero__(self) -> bool: ... + def __eq__(self, other: object, context: Optional[Context] = ...) -> bool: ... + if sys.version_info < (3,): + def __ne__(self, other: object, context: Optional[Context] = ...) -> bool: ... + def __lt__(self, other: _ComparableNum, context: Optional[Context] = ...) -> bool: ... + def __le__(self, other: _ComparableNum, context: Optional[Context] = ...) -> bool: ... + def __gt__(self, other: _ComparableNum, context: Optional[Context] = ...) -> bool: ... + def __ge__(self, other: _ComparableNum, context: Optional[Context] = ...) -> bool: ... + def compare(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __hash__(self) -> int: ... + def as_tuple(self) -> DecimalTuple: ... + if sys.version_info >= (3,): + def as_integer_ratio(self) -> Tuple[int, int]: ... + def __str__(self, eng: bool = ..., context: Optional[Context] = ...) -> str: ... + def to_eng_string(self, context: Optional[Context] = ...) -> str: ... + def __neg__(self, context: Optional[Context] = ...) -> Decimal: ... + def __pos__(self, context: Optional[Context] = ...) -> Decimal: ... + def __abs__(self, round: bool = ..., context: Optional[Context] = ...) -> Decimal: ... + def __add__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __radd__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __sub__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __rsub__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __mul__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __rmul__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __truediv__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __rtruediv__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + if sys.version_info < (3,): + def __div__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __rdiv__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __divmod__(self, other: _Decimal, context: Optional[Context] = ...) -> Tuple[Decimal, Decimal]: ... + def __rdivmod__(self, other: _Decimal, context: Optional[Context] = ...) -> Tuple[Decimal, Decimal]: ... + def __mod__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __rmod__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def remainder_near(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __floordiv__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __rfloordiv__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __float__(self) -> float: ... + def __int__(self) -> int: ... + def __trunc__(self) -> int: ... + @property + def real(self) -> Decimal: ... + @property + def imag(self) -> Decimal: ... + def conjugate(self) -> Decimal: ... + def __complex__(self) -> complex: ... + if sys.version_info >= (3,): + @overload + def __round__(self) -> int: ... + @overload + def __round__(self, ndigits: int) -> Decimal: ... + def __floor__(self) -> int: ... + def __ceil__(self) -> int: ... + else: + def __long__(self) -> long: ... + def fma(self, other: _Decimal, third: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __pow__(self, other: _Decimal, modulo: Optional[_Decimal] = ..., context: Optional[Context] = ...) -> Decimal: ... + def __rpow__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def normalize(self, context: Optional[Context] = ...) -> Decimal: ... + if sys.version_info >= (3,): + def quantize(self, exp: _Decimal, rounding: Optional[str] = ..., + context: Optional[Context] = ...) -> Decimal: ... + def same_quantum(self, other: _Decimal, context: Optional[Context] = ...) -> bool: ... + else: + def quantize(self, exp: _Decimal, rounding: Optional[str] = ..., + context: Optional[Context] = ..., watchexp: bool = ...) -> Decimal: ... + def same_quantum(self, other: _Decimal) -> bool: ... + def to_integral_exact(self, rounding: Optional[str] = ..., context: Optional[Context] = ...) -> Decimal: ... + def to_integral_value(self, rounding: Optional[str] = ..., context: Optional[Context] = ...) -> Decimal: ... + def to_integral(self, rounding: Optional[str] = ..., context: Optional[Context] = ...) -> Decimal: ... + def sqrt(self, context: Optional[Context] = ...) -> Decimal: ... + def max(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def min(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def adjusted(self) -> int: ... + if sys.version_info >= (3,): + def canonical(self) -> Decimal: ... + else: + def canonical(self, context: Optional[Context] = ...) -> Decimal: ... + def compare_signal(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + if sys.version_info >= (3,): + def compare_total(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def compare_total_mag(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + else: + def compare_total(self, other: _Decimal) -> Decimal: ... + def compare_total_mag(self, other: _Decimal) -> Decimal: ... + def copy_abs(self) -> Decimal: ... + def copy_negate(self) -> Decimal: ... + if sys.version_info >= (3,): + def copy_sign(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + else: + def copy_sign(self, other: _Decimal) -> Decimal: ... + def exp(self, context: Optional[Context] = ...) -> Decimal: ... + def is_canonical(self) -> bool: ... + def is_finite(self) -> bool: ... + def is_infinite(self) -> bool: ... + def is_nan(self) -> bool: ... + def is_normal(self, context: Optional[Context] = ...) -> bool: ... + def is_qnan(self) -> bool: ... + def is_signed(self) -> bool: ... + def is_snan(self) -> bool: ... + def is_subnormal(self, context: Optional[Context] = ...) -> bool: ... + def is_zero(self) -> bool: ... + def ln(self, context: Optional[Context] = ...) -> Decimal: ... + def log10(self, context: Optional[Context] = ...) -> Decimal: ... + def logb(self, context: Optional[Context] = ...) -> Decimal: ... + def logical_and(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def logical_invert(self, context: Optional[Context] = ...) -> Decimal: ... + def logical_or(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def logical_xor(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def max_mag(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def min_mag(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def next_minus(self, context: Optional[Context] = ...) -> Decimal: ... + def next_plus(self, context: Optional[Context] = ...) -> Decimal: ... + def next_toward(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def number_class(self, context: Optional[Context] = ...) -> str: ... + def radix(self) -> Decimal: ... + def rotate(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def scaleb(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def shift(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __reduce__(self) -> Tuple[Type[Decimal], Tuple[str]]: ... + def __copy__(self) -> Decimal: ... + def __deepcopy__(self, memo: Any) -> Decimal: ... + def __format__(self, specifier: str, context: Optional[Context] = ...) -> str: ... + +class _ContextManager(object): + new_context: Context + saved_context: Context + def __init__(self, new_context: Context) -> None: ... + def __enter__(self) -> Context: ... + def __exit__(self, t: Optional[Type[BaseException]], v: Optional[BaseException], tb: Optional[TracebackType]) -> None: ... + +_TrapType = Type[DecimalException] + +class Context(object): + prec: int + rounding: str + Emin: int + Emax: int + capitals: int + if sys.version_info >= (3,): + clamp: int + else: + _clamp: int + traps: Dict[_TrapType, bool] + flags: Dict[_TrapType, bool] + if sys.version_info >= (3,): + def __init__(self, prec: Optional[int] = ..., rounding: Optional[str] = ..., + Emin: Optional[int] = ..., Emax: Optional[int] = ..., + capitals: Optional[int] = ..., clamp: Optional[int] = ..., + flags: Union[None, Dict[_TrapType, bool], Container[_TrapType]] = ..., + traps: Union[None, Dict[_TrapType, bool], Container[_TrapType]] = ..., + _ignored_flags: Optional[List[_TrapType]] = ...) -> None: ... + else: + def __init__(self, prec: Optional[int] = ..., rounding: Optional[str] = ..., + traps: Union[None, Dict[_TrapType, bool], Container[_TrapType]] = ..., + flags: Union[None, Dict[_TrapType, bool], Container[_TrapType]] = ..., + Emin: Optional[int] = ..., Emax: Optional[int] = ..., + capitals: Optional[int] = ..., _clamp: Optional[int] = ..., + _ignored_flags: Optional[List[_TrapType]] = ...) -> None: ... + if sys.version_info >= (3,): + # __setattr__() only allows to set a specific set of attributes, + # already defined above. + def __delattr__(self, name: str) -> None: ... + def __reduce__(self) -> Tuple[Type[Context], Tuple[Any, ...]]: ... + def clear_flags(self) -> None: ... + if sys.version_info >= (3,): + def clear_traps(self) -> None: ... + def copy(self) -> Context: ... + def __copy__(self) -> Context: ... + __hash__: Any = ... + def Etiny(self) -> int: ... + def Etop(self) -> int: ... + def create_decimal(self, num: _DecimalNew = ...) -> Decimal: ... + def create_decimal_from_float(self, f: float) -> Decimal: ... + def abs(self, a: _Decimal) -> Decimal: ... + def add(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def canonical(self, a: Decimal) -> Decimal: ... + def compare(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def compare_signal(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def compare_total(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def compare_total_mag(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def copy_abs(self, a: _Decimal) -> Decimal: ... + def copy_decimal(self, a: _Decimal) -> Decimal: ... + def copy_negate(self, a: _Decimal) -> Decimal: ... + def copy_sign(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def divide(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def divide_int(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def divmod(self, a: _Decimal, b: _Decimal) -> Tuple[Decimal, Decimal]: ... + def exp(self, a: _Decimal) -> Decimal: ... + def fma(self, a: _Decimal, b: _Decimal, c: _Decimal) -> Decimal: ... + def is_canonical(self, a: _Decimal) -> bool: ... + def is_finite(self, a: _Decimal) -> bool: ... + def is_infinite(self, a: _Decimal) -> bool: ... + def is_nan(self, a: _Decimal) -> bool: ... + def is_normal(self, a: _Decimal) -> bool: ... + def is_qnan(self, a: _Decimal) -> bool: ... + def is_signed(self, a: _Decimal) -> bool: ... + def is_snan(self, a: _Decimal) -> bool: ... + def is_subnormal(self, a: _Decimal) -> bool: ... + def is_zero(self, a: _Decimal) -> bool: ... + def ln(self, a: _Decimal) -> Decimal: ... + def log10(self, a: _Decimal) -> Decimal: ... + def logb(self, a: _Decimal) -> Decimal: ... + def logical_and(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def logical_invert(self, a: _Decimal) -> Decimal: ... + def logical_or(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def logical_xor(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def max(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def max_mag(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def min(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def min_mag(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def minus(self, a: _Decimal) -> Decimal: ... + def multiply(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def next_minus(self, a: _Decimal) -> Decimal: ... + def next_plus(self, a: _Decimal) -> Decimal: ... + def next_toward(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def normalize(self, a: _Decimal) -> Decimal: ... + def number_class(self, a: _Decimal) -> str: ... + def plus(self, a: _Decimal) -> Decimal: ... + def power(self, a: _Decimal, b: _Decimal, modulo: Optional[_Decimal] = ...) -> Decimal: ... + def quantize(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def radix(self) -> Decimal: ... + def remainder(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def remainder_near(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def rotate(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def same_quantum(self, a: _Decimal, b: _Decimal) -> bool: ... + def scaleb(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def shift(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def sqrt(self, a: _Decimal) -> Decimal: ... + def subtract(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def to_eng_string(self, a: _Decimal) -> str: ... + def to_sci_string(self, a: _Decimal) -> str: ... + def to_integral_exact(self, a: _Decimal) -> Decimal: ... + def to_integral_value(self, a: _Decimal) -> Decimal: ... + def to_integral(self, a: _Decimal) -> Decimal: ... + +DefaultContext: Context +BasicContext: Context +ExtendedContext: Context diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/difflib.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/difflib.pyi new file mode 100644 index 0000000..ddcec11 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/difflib.pyi @@ -0,0 +1,87 @@ +# Based on https://docs.python.org/2.7/library/difflib.html and https://docs.python.org/3.2/library/difflib.html + +import sys +from typing import ( + TypeVar, Callable, Iterable, Iterator, List, NamedTuple, Sequence, Tuple, + Generic, Optional, Text, Union, AnyStr +) + +_T = TypeVar('_T') + +if sys.version_info >= (3,): + _StrType = Text +else: + # Aliases can't point to type vars, so we need to redeclare AnyStr + _StrType = TypeVar('_StrType', Text, bytes) + +_JunkCallback = Union[Callable[[Text], bool], Callable[[str], bool]] + +Match = NamedTuple('Match', [ + ('a', int), + ('b', int), + ('size', int), +]) + +class SequenceMatcher(Generic[_T]): + def __init__(self, isjunk: Optional[Callable[[_T], bool]] = ..., + a: Sequence[_T] = ..., b: Sequence[_T] = ..., + autojunk: bool = ...) -> None: ... + def set_seqs(self, a: Sequence[_T], b: Sequence[_T]) -> None: ... + def set_seq1(self, a: Sequence[_T]) -> None: ... + def set_seq2(self, b: Sequence[_T]) -> None: ... + def find_longest_match(self, alo: int, ahi: int, blo: int, + bhi: int) -> Match: ... + def get_matching_blocks(self) -> List[Match]: ... + def get_opcodes(self) -> List[Tuple[str, int, int, int, int]]: ... + def get_grouped_opcodes(self, n: int = ... + ) -> Iterable[List[Tuple[str, int, int, int, int]]]: ... + def ratio(self) -> float: ... + def quick_ratio(self) -> float: ... + def real_quick_ratio(self) -> float: ... + +def get_close_matches(word: Sequence[_T], possibilities: Iterable[Sequence[_T]], + n: int = ..., cutoff: float = ...) -> List[Sequence[_T]]: ... + +class Differ: + def __init__(self, linejunk: _JunkCallback = ..., charjunk: _JunkCallback = ...) -> None: ... + def compare(self, a: Sequence[_StrType], b: Sequence[_StrType]) -> Iterator[_StrType]: ... + +def IS_LINE_JUNK(line: _StrType) -> bool: ... +def IS_CHARACTER_JUNK(line: _StrType) -> bool: ... +def unified_diff(a: Sequence[_StrType], b: Sequence[_StrType], fromfile: _StrType = ..., + tofile: _StrType = ..., fromfiledate: _StrType = ..., tofiledate: _StrType = ..., + n: int = ..., lineterm: _StrType = ...) -> Iterator[_StrType]: ... +def context_diff(a: Sequence[_StrType], b: Sequence[_StrType], fromfile: _StrType = ..., + tofile: _StrType = ..., fromfiledate: _StrType = ..., tofiledate: _StrType = ..., + n: int = ..., lineterm: _StrType = ...) -> Iterator[_StrType]: ... +def ndiff(a: Sequence[_StrType], b: Sequence[_StrType], + linejunk: _JunkCallback = ..., + charjunk: _JunkCallback = ... + ) -> Iterator[_StrType]: ... + +class HtmlDiff(object): + def __init__(self, tabsize: int = ..., wrapcolumn: int = ..., + linejunk: _JunkCallback = ..., + charjunk: _JunkCallback = ... + ) -> None: ... + def make_file(self, fromlines: Sequence[_StrType], tolines: Sequence[_StrType], + fromdesc: _StrType = ..., todesc: _StrType = ..., context: bool = ..., + numlines: int = ...) -> _StrType: ... + def make_table(self, fromlines: Sequence[_StrType], tolines: Sequence[_StrType], + fromdesc: _StrType = ..., todesc: _StrType = ..., context: bool = ..., + numlines: int = ...) -> _StrType: ... + +def restore(delta: Iterable[_StrType], which: int) -> Iterator[_StrType]: ... + +if sys.version_info >= (3, 5): + def diff_bytes( + dfunc: Callable[[Sequence[str], Sequence[str], str, str, str, str, int, str], Iterator[str]], + a: Sequence[bytes], + b: Sequence[bytes], + fromfile: bytes = ..., + tofile: bytes = ..., + fromfiledate: bytes = ..., + tofiledate: bytes = ..., + n: int = ..., + lineterm: bytes = ... + ) -> Iterator[bytes]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/dis.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/dis.pyi new file mode 100644 index 0000000..0ef27f4 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/dis.pyi @@ -0,0 +1,77 @@ +from typing import Callable, List, Union, Iterator, Tuple, Optional, Any, IO, NamedTuple, Dict + +import sys +import types + +from opcode import (hasconst as hasconst, hasname as hasname, hasjrel as hasjrel, + hasjabs as hasjabs, haslocal as haslocal, hascompare as hascompare, + hasfree as hasfree, cmp_op as cmp_op, opname as opname, opmap as opmap, + HAVE_ARGUMENT as HAVE_ARGUMENT, EXTENDED_ARG as EXTENDED_ARG) + +if sys.version_info >= (3, 4): + from opcode import stack_effect as stack_effect + +if sys.version_info >= (3, 6): + from opcode import hasnargs as hasnargs + +# Strictly this should not have to include Callable, but mypy doesn't use FunctionType +# for functions (python/mypy#3171) +_have_code = Union[types.MethodType, types.FunctionType, types.CodeType, type, Callable[..., Any]] +_have_code_or_string = Union[_have_code, str, bytes] + + +if sys.version_info >= (3, 4): + Instruction = NamedTuple( + "Instruction", + [ + ('opname', str), + ('opcode', int), + ('arg', Optional[int]), + ('argval', Any), + ('argrepr', str), + ('offset', int), + ('starts_line', Optional[int]), + ('is_jump_target', bool) + ] + ) + + class Bytecode: + codeobj: types.CodeType + first_line: int + def __init__(self, x: _have_code_or_string, *, first_line: Optional[int] = ..., + current_offset: Optional[int] = ...) -> None: ... + def __iter__(self) -> Iterator[Instruction]: ... + def __repr__(self) -> str: ... + def info(self) -> str: ... + def dis(self) -> str: ... + + @classmethod + def from_traceback(cls, tb: types.TracebackType) -> Bytecode: ... + + +COMPILER_FLAG_NAMES: Dict[int, str] + + +def findlabels(code: _have_code) -> List[int]: ... +def findlinestarts(code: _have_code) -> Iterator[Tuple[int, int]]: ... + +if sys.version_info >= (3, 0): + def pretty_flags(flags: int) -> str: ... + def code_info(x: _have_code_or_string) -> str: ... + +if sys.version_info >= (3, 4): + def dis(x: _have_code_or_string = ..., *, file: Optional[IO[str]] = ...) -> None: ... + def distb(tb: Optional[types.TracebackType] = ..., *, file: Optional[IO[str]] = ...) -> None: ... + def disassemble(co: _have_code, lasti: int = ..., *, file: Optional[IO[str]] = ...) -> None: ... + def disco(co: _have_code, lasti: int = ..., *, file: Optional[IO[str]] = ...) -> None: ... + def show_code(co: _have_code, *, file: Optional[IO[str]] = ...) -> None: ... + + def get_instructions(x: _have_code, *, first_line: Optional[int] = ...) -> Iterator[Instruction]: ... +else: + def dis(x: _have_code_or_string = ...) -> None: ... + def distb(tb: types.TracebackType = ...) -> None: ... + def disassemble(co: _have_code, lasti: int = ...) -> None: ... + def disco(co: _have_code, lasti: int = ...) -> None: ... + + if sys.version_info >= (3, 0): + def show_code(co: _have_code) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/__init__.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/archive_util.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/archive_util.pyi new file mode 100644 index 0000000..12172f3 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/archive_util.pyi @@ -0,0 +1,12 @@ +# Stubs for distutils.archive_util + +from typing import Optional + + +def make_archive(base_name: str, format: str, root_dir: Optional[str] = ..., + base_dir: Optional[str] = ..., verbose: int = ..., + dry_run: int = ...) -> str: ... +def make_tarball(base_name: str, base_dir: str, compress: Optional[str] = ..., + verbose: int = ..., dry_run: int = ...) -> str: ... +def make_zipfile(base_name: str, base_dir: str, verbose: int = ..., + dry_run: int = ...) -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/bcppcompiler.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/bcppcompiler.pyi new file mode 100644 index 0000000..9f27a0a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/bcppcompiler.pyi @@ -0,0 +1,6 @@ +# Stubs for distutils.bcppcompiler + +from distutils.ccompiler import CCompiler + + +class BCPPCompiler(CCompiler): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/ccompiler.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/ccompiler.pyi new file mode 100644 index 0000000..94fad8b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/ccompiler.pyi @@ -0,0 +1,119 @@ +# Stubs for distutils.ccompiler + +from typing import Any, Callable, List, Optional, Tuple, Union + + +_Macro = Union[Tuple[str], Tuple[str, str]] + + +def gen_lib_options(compiler: CCompiler, library_dirs: List[str], + runtime_library_dirs: List[str], + libraries: List[str]) -> List[str]: ... +def gen_preprocess_options(macros: List[_Macro], + include_dirs: List[str]) -> List[str]: ... +def get_default_compiler(osname: Optional[str] = ..., + platform: Optional[str] = ...) -> str: ... +def new_compiler(plat: Optional[str] = ..., compiler: Optional[str] = ..., + verbose: int = ..., dry_run: int = ..., + force: int = ...) -> CCompiler: ... +def show_compilers() -> None: ... + +class CCompiler: + def __init__(self, verbose: int = ..., dry_run: int = ..., + force: int = ...) -> None: ... + def add_include_dir(self, dir: str) -> None: ... + def set_include_dirs(self, dirs: List[str]) -> None: ... + def add_library(self, libname: str) -> None: ... + def set_libraries(self, libnames: List[str]) -> None: ... + def add_library_dir(self, dir: str) -> None: ... + def set_library_dirs(self, dirs: List[str]) -> None: ... + def add_runtime_library_dir(self, dir: str) -> None: ... + def set_runtime_library_dirs(self, dirs: List[str]) -> None: ... + def define_macro(self, name: str, value: Optional[str] = ...) -> None: ... + def undefine_macro(self, name: str) -> None: ... + def add_link_object(self, object: str) -> None: ... + def set_link_objects(self, objects: List[str]) -> None: ... + def detect_language(self, sources: Union[str, List[str]]) -> Optional[str]: ... + def find_library_file(self, dirs: List[str], lib: str, + debug: bool = ...) -> Optional[str]: ... + def has_function(self, funcname: str, includes: Optional[List[str]] = ..., + include_dirs: Optional[List[str]] = ..., + libraries: Optional[List[str]] = ..., + library_dirs: Optional[List[str]] = ...) -> bool: ... + def library_dir_option(self, dir: str) -> str: ... + def library_option(self, lib: str) -> str: ... + def runtime_library_dir_option(self, dir: str) -> str: ... + def set_executables(self, **args: str) -> None: ... + def compile(self, sources: List[str], output_dir: Optional[str] = ..., + macros: Optional[_Macro] = ..., + include_dirs: Optional[List[str]] = ..., debug: bool = ..., + extra_preargs: Optional[List[str]] = ..., + extra_postargs: Optional[List[str]] = ..., + depends: Optional[List[str]] = ...) -> List[str]: ... + def create_static_lib(self, objects: List[str], output_libname: str, + output_dir: Optional[str] = ..., debug: bool = ..., + target_lang: Optional[str] = ...) -> None: ... + def link(self, target_desc: str, objects: List[str], output_filename: str, + output_dir: Optional[str] = ..., + libraries: Optional[List[str]] = ..., + library_dirs: Optional[List[str]] = ..., + runtime_library_dirs: Optional[List[str]] = ..., + export_symbols: Optional[List[str]] = ..., debug: bool = ..., + extra_preargs: Optional[List[str]] = ..., + extra_postargs: Optional[List[str]] = ..., + build_temp: Optional[str] = ..., + target_lang: Optional[str] = ...) -> None: ... + def link_executable(self, objects: List[str], output_progname: str, + output_dir: Optional[str] = ..., + libraries: Optional[List[str]] = ..., + library_dirs: Optional[List[str]] = ..., + runtime_library_dirs: Optional[List[str]] = ..., + debug: bool = ..., + extra_preargs: Optional[List[str]] = ..., + extra_postargs: Optional[List[str]] = ..., + target_lang: Optional[str] = ...) -> None: ... + def link_shared_lib(self, objects: List[str], output_libname: str, + output_dir: Optional[str] = ..., + libraries: Optional[List[str]] = ..., + library_dirs: Optional[List[str]] = ..., + runtime_library_dirs: Optional[List[str]] = ..., + export_symbols: Optional[List[str]] = ..., + debug: bool = ..., + extra_preargs: Optional[List[str]] = ..., + extra_postargs: Optional[List[str]] = ..., + build_temp: Optional[str] = ..., + target_lang: Optional[str] = ...) -> None: ... + def link_shared_object(self, objects: List[str], output_filename: str, + output_dir: Optional[str] = ..., + libraries: Optional[List[str]] = ..., + library_dirs: Optional[List[str]] = ..., + runtime_library_dirs: Optional[List[str]] = ..., + export_symbols: Optional[List[str]] = ..., + debug: bool = ..., + extra_preargs: Optional[List[str]] = ..., + extra_postargs: Optional[List[str]] = ..., + build_temp: Optional[str] = ..., + target_lang: Optional[str] = ...) -> None: ... + def preprocess(self, source: str, output_file: Optional[str] = ..., + macros: Optional[List[_Macro]] = ..., + include_dirs: Optional[List[str]] = ..., + extra_preargs: Optional[List[str]] = ..., + extra_postargs: Optional[List[str]] = ...) -> None: ... + def executable_filename(self, basename: str, strip_dir: int = ..., + output_dir: str = ...) -> str: ... + def library_filename(self, libname: str, lib_type: str = ..., + strip_dir: int = ..., + output_dir: str = ...) -> str: ... + def object_filenames(self, source_filenames: List[str], + strip_dir: int = ..., + output_dir: str = ...) -> List[str]: ... + def shared_object_filename(self, basename: str, strip_dir: int = ..., + output_dir: str = ...) -> str: ... + def execute(self, func: Callable[..., None], args: Tuple[Any, ...], + msg: Optional[str] = ..., level: int = ...) -> None: ... + def spawn(self, cmd: List[str]) -> None: ... + def mkpath(self, name: str, mode: int = ...) -> None: ... + def move_file(self, src: str, dst: str) -> str: ... + def announce(self, msg: str, level: int = ...) -> None: ... + def warn(self, msg: str) -> None: ... + def debug_print(self, msg: str) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/cmd.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/cmd.pyi new file mode 100644 index 0000000..2ec5a50 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/cmd.pyi @@ -0,0 +1,40 @@ +# Stubs for distutils.cmd + +from typing import Callable, List, Tuple, Union, Optional, Iterable, Any, Text +from abc import abstractmethod +from distutils.dist import Distribution + +class Command: + sub_commands: List[Tuple[str, Union[Callable[[], bool], str, None]]] + def __init__(self, dist: Distribution) -> None: ... + @abstractmethod + def initialize_options(self) -> None: ... + @abstractmethod + def finalize_options(self) -> None: ... + @abstractmethod + def run(self) -> None: ... + + def announce(self, msg: Text, level: int = ...) -> None: ... + def debug_print(self, msg: Text) -> None: ... + + def ensure_string(self, option: str, default: Optional[str] = ...) -> None: ... + def ensure_string_list(self, option: Union[str, List[str]]) -> None: ... + def ensure_filename(self, option: str) -> None: ... + def ensure_dirname(self, option: str) -> None: ... + + def get_command_name(self) -> str: ... + def set_undefined_options(self, src_cmd: Text, *option_pairs: Tuple[str, str]) -> None: ... + def get_finalized_command(self, command: Text, create: int = ...) -> Command: ... + def reinitialize_command(self, command: Union[Command, Text], reinit_subcommands: int = ...) -> Command: ... + def run_command(self, command: Text) -> None: ... + def get_sub_commands(self) -> List[str]: ... + + def warn(self, msg: Text) -> None: ... + def execute(self, func: Callable[..., Any], args: Iterable[Any], msg: Optional[Text] = ..., level: int = ...) -> None: ... + def mkpath(self, name: str, mode: int = ...) -> None: ... + def copy_file(self, infile: str, outfile: str, preserve_mode: int = ..., preserve_times: int = ..., link: Optional[str] = ..., level: Any = ...) -> Tuple[str, bool]: ... # level is not used + def copy_tree(self, infile: str, outfile: str, preserve_mode: int = ..., preserve_times: int = ..., preserve_symlinks: int = ..., level: Any = ...) -> List[str]: ... # level is not used + def move_file(self, src: str, dest: str, level: Any = ...) -> str: ... # level is not used + def spawn(self, cmd: Iterable[str], search_path: int = ..., level: Any = ...) -> None: ... # level is not used + def make_archive(self, base_name: str, format: str, root_dir: Optional[str] = ..., base_dir: Optional[str] = ..., owner: Optional[str] = ..., group: Optional[str] = ...) -> str: ... + def make_file(self, infiles: Union[str, List[str], Tuple[str]], outfile: str, func: Callable[..., Any], args: List[Any], exec_msg: Optional[str] = ..., skip_msg: Optional[str] = ..., level: Any = ...) -> None: ... # level is not used diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/command/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/command/__init__.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/command/bdist.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/command/bdist.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/command/bdist_dumb.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/command/bdist_dumb.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/command/bdist_msi.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/command/bdist_msi.pyi new file mode 100644 index 0000000..a761792 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/command/bdist_msi.pyi @@ -0,0 +1,6 @@ +from distutils.cmd import Command + +class bdist_msi(Command): + def initialize_options(self) -> None: ... + def finalize_options(self) -> None: ... + def run(self) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/command/bdist_packager.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/command/bdist_packager.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/command/bdist_rpm.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/command/bdist_rpm.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/command/bdist_wininst.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/command/bdist_wininst.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/command/build.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/command/build.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/command/build_clib.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/command/build_clib.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/command/build_ext.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/command/build_ext.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/command/build_py.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/command/build_py.pyi new file mode 100644 index 0000000..34753e4 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/command/build_py.pyi @@ -0,0 +1,10 @@ +from distutils.cmd import Command +import sys + +if sys.version_info >= (3,): + class build_py(Command): + def initialize_options(self) -> None: ... + def finalize_options(self) -> None: ... + def run(self) -> None: ... + + class build_py_2to3(build_py): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/command/build_scripts.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/command/build_scripts.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/command/check.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/command/check.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/command/clean.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/command/clean.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/command/config.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/command/config.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/command/install.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/command/install.pyi new file mode 100644 index 0000000..94a9008 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/command/install.pyi @@ -0,0 +1,14 @@ +from distutils.cmd import Command +from typing import Optional, Text + + +class install(Command): + user: bool + prefix: Optional[Text] + home: Optional[Text] + root: Optional[Text] + install_lib: Optional[Text] + + def initialize_options(self) -> None: ... + def finalize_options(self) -> None: ... + def run(self) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/command/install_data.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/command/install_data.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/command/install_headers.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/command/install_headers.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/command/install_lib.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/command/install_lib.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/command/install_scripts.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/command/install_scripts.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/command/register.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/command/register.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/command/sdist.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/command/sdist.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/core.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/core.pyi new file mode 100644 index 0000000..125b799 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/core.pyi @@ -0,0 +1,50 @@ +# Stubs for distutils.core + +from typing import Any, List, Mapping, Optional, Tuple, Type, Union +from distutils.cmd import Command as Command +from distutils.dist import Distribution as Distribution +from distutils.extension import Extension as Extension + +def setup(name: str = ..., + version: str = ..., + description: str = ..., + long_description: str = ..., + author: str = ..., + author_email: str = ..., + maintainer: str = ..., + maintainer_email: str = ..., + url: str = ..., + download_url: str = ..., + packages: List[str] = ..., + py_modules: List[str] = ..., + scripts: List[str] = ..., + ext_modules: List[Extension] = ..., + classifiers: List[str] = ..., + distclass: Type[Distribution] = ..., + script_name: str = ..., + script_args: List[str] = ..., + options: Mapping[str, Any] = ..., + license: str = ..., + keywords: Union[List[str], str] = ..., + platforms: Union[List[str], str] = ..., + cmdclass: Mapping[str, Type[Command]] = ..., + data_files: List[Tuple[str, List[str]]] = ..., + package_dir: Mapping[str, str] = ..., + obsoletes: List[str] = ..., + provides: List[str] = ..., + requires: List[str] = ..., + command_packages: List[str] = ..., + command_options: Mapping[str, Mapping[str, Tuple[Any, Any]]] = ..., + package_data: Mapping[str, List[str]] = ..., + include_package_data: bool = ..., + libraries: List[str] = ..., + headers: List[str] = ..., + ext_package: str = ..., + include_dirs: List[str] = ..., + password: str = ..., + fullname: str = ..., + **attrs: Any) -> None: ... + +def run_setup(script_name: str, + script_args: Optional[List[str]] = ..., + stop_after: str = ...) -> Distribution: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/cygwinccompiler.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/cygwinccompiler.pyi new file mode 100644 index 0000000..1bfab90 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/cygwinccompiler.pyi @@ -0,0 +1,7 @@ +# Stubs for distutils.cygwinccompiler + +from distutils.unixccompiler import UnixCCompiler + + +class CygwinCCompiler(UnixCCompiler): ... +class Mingw32CCompiler(CygwinCCompiler): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/debug.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/debug.pyi new file mode 100644 index 0000000..76de447 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/debug.pyi @@ -0,0 +1,3 @@ +# Stubs for distutils.debug + +DEBUG: bool diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/dep_util.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/dep_util.pyi new file mode 100644 index 0000000..7df5847 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/dep_util.pyi @@ -0,0 +1,8 @@ +# Stubs for distutils.dep_util + +from typing import List, Tuple + +def newer(source: str, target: str) -> bool: ... +def newer_pairwise(sources: List[str], + targets: List[str]) -> List[Tuple[str, str]]: ... +def newer_group(sources: List[str], target: str, missing: str = ...) -> bool: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/dir_util.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/dir_util.pyi new file mode 100644 index 0000000..667ac2f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/dir_util.pyi @@ -0,0 +1,15 @@ +# Stubs for distutils.dir_util + +from typing import List + + +def mkpath(name: str, mode: int = ..., verbose: int = ..., + dry_run: int = ...) -> List[str]: ... +def create_tree(base_dir: str, files: List[str], mode: int = ..., + verbose: int = ..., dry_run: int = ...) -> None: ... +def copy_tree(src: str, dst: str, preserve_mode: int = ..., + preserve_times: int = ..., preserve_symlinks: int = ..., + update: int = ..., verbose: int = ..., + dry_run: int = ...) -> List[str]: ... +def remove_tree(directory: str, verbose: int = ..., + dry_run: int = ...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/dist.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/dist.pyi new file mode 100644 index 0000000..65e766d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/dist.pyi @@ -0,0 +1,11 @@ +# Stubs for distutils.dist +from distutils.cmd import Command + +from typing import Any, Mapping, Optional, Dict, Tuple, Iterable, Text + + +class Distribution: + def __init__(self, attrs: Optional[Mapping[str, Any]] = ...) -> None: ... + def get_option_dict(self, command: str) -> Dict[str, Tuple[str, Text]]: ... + def parse_config_files(self, filenames: Optional[Iterable[Text]] = ...) -> None: ... + def get_command_obj(self, command: str, create: bool = ...) -> Optional[Command]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/errors.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/errors.pyi new file mode 100644 index 0000000..e483362 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/errors.pyi @@ -0,0 +1,19 @@ +class DistutilsError(Exception): ... +class DistutilsModuleError(DistutilsError): ... +class DistutilsClassError(DistutilsError): ... +class DistutilsGetoptError(DistutilsError): ... +class DistutilsArgError(DistutilsError): ... +class DistutilsFileError(DistutilsError): ... +class DistutilsOptionError(DistutilsError): ... +class DistutilsSetupError(DistutilsError): ... +class DistutilsPlatformError(DistutilsError): ... +class DistutilsExecError(DistutilsError): ... +class DistutilsInternalError(DistutilsError): ... +class DistutilsTemplateError(DistutilsError): ... +class DistutilsByteCompileError(DistutilsError): ... +class CCompilerError(Exception): ... +class PreprocessError(CCompilerError): ... +class CompileError(CCompilerError): ... +class LibError(CCompilerError): ... +class LinkError(CCompilerError): ... +class UnknownFileError(CCompilerError): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/extension.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/extension.pyi new file mode 100644 index 0000000..5aa070e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/extension.pyi @@ -0,0 +1,39 @@ +# Stubs for distutils.extension + +from typing import List, Optional, Tuple +import sys + +class Extension: + if sys.version_info >= (3,): + def __init__(self, + name: str, + sources: List[str], + include_dirs: List[str] = ..., + define_macros: List[Tuple[str, Optional[str]]] = ..., + undef_macros: List[str] = ..., + library_dirs: List[str] = ..., + libraries: List[str] = ..., + runtime_library_dirs: List[str] = ..., + extra_objects: List[str] = ..., + extra_compile_args: List[str] = ..., + extra_link_args: List[str] = ..., + export_symbols: List[str] = ..., + depends: List[str] = ..., + language: str = ..., + optional: bool = ...) -> None: ... + else: + def __init__(self, + name: str, + sources: List[str], + include_dirs: List[str] = ..., + define_macros: List[Tuple[str, Optional[str]]] = ..., + undef_macros: List[str] = ..., + library_dirs: List[str] = ..., + libraries: List[str] = ..., + runtime_library_dirs: List[str] = ..., + extra_objects: List[str] = ..., + extra_compile_args: List[str] = ..., + extra_link_args: List[str] = ..., + export_symbols: List[str] = ..., + depends: List[str] = ..., + language: str = ...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/fancy_getopt.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/fancy_getopt.pyi new file mode 100644 index 0000000..aa7e964 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/fancy_getopt.pyi @@ -0,0 +1,27 @@ +# Stubs for distutils.fancy_getopt + +from typing import ( + Any, List, Mapping, Optional, Tuple, Union, + TypeVar, overload, +) + +_Option = Tuple[str, str, str] +_GR = Tuple[List[str], OptionDummy] + +def fancy_getopt(options: List[_Option], + negative_opt: Mapping[_Option, _Option], + object: Any, + args: Optional[List[str]]) -> Union[List[str], _GR]: ... +def wrap_text(text: str, width: int) -> List[str]: ... + +class FancyGetopt: + def __init__(self, option_table: Optional[List[_Option]] = ...) -> None: ... + # TODO kinda wrong, `getopt(object=object())` is invalid + @overload + def getopt(self, args: Optional[List[str]] = ...) -> _GR: ... + @overload + def getopt(self, args: Optional[List[str]], object: Any) -> List[str]: ... + def get_option_order(self) -> List[Tuple[str, str]]: ... + def generate_help(self, header: Optional[str] = ...) -> List[str]: ... + +class OptionDummy: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/file_util.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/file_util.pyi new file mode 100644 index 0000000..6324d63 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/file_util.pyi @@ -0,0 +1,12 @@ +# Stubs for distutils.file_util + +from typing import Optional, Sequence, Tuple + + +def copy_file(src: str, dst: str, preserve_mode: bool = ..., + preserve_times: bool = ..., update: bool = ..., + link: Optional[str] = ..., verbose: bool = ..., + dry_run: bool = ...) -> Tuple[str, str]: ... +def move_file(src: str, dst: str, verbose: bool = ..., + dry_run: bool = ...) -> str: ... +def write_file(filename: str, contents: Sequence[str]) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/filelist.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/filelist.pyi new file mode 100644 index 0000000..4ecaeba --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/filelist.pyi @@ -0,0 +1,3 @@ +# Stubs for distutils.filelist + +class FileList: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/log.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/log.pyi new file mode 100644 index 0000000..6c37cc5 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/log.pyi @@ -0,0 +1,28 @@ +from typing import Any, Callable, Iterable, Text + +DEBUG: int +INFO: int +WARN: int +ERROR: int +FATAL: int + +class Log: + def __init__(self, threshold: int = ...) -> None: ... + def log(self, level: int, msg: Text, *args: Any) -> None: ... + def debug(self, msg: Text, *args: Any) -> None: ... + def info(self, msg: Text, *args: Any) -> None: ... + def warn(self, msg: Text, *args: Any) -> None: ... + def error(self, msg: Text, *args: Any) -> None: ... + def fatal(self, msg: Text, *args: Any) -> None: ... + +_LogFunc = Callable[[Text, Iterable[Any]], None] + +log: Callable[[int, Text, Iterable[Any]], None] +debug: _LogFunc +info: _LogFunc +warn: _LogFunc +error: _LogFunc +fatal: _LogFunc + +def set_threshold(level: int) -> int: ... +def set_verbosity(v: int) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/msvccompiler.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/msvccompiler.pyi new file mode 100644 index 0000000..ffc9e44 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/msvccompiler.pyi @@ -0,0 +1,6 @@ +# Stubs for distutils.msvccompiler + +from distutils.ccompiler import CCompiler + + +class MSVCCompiler(CCompiler): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/spawn.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/spawn.pyi new file mode 100644 index 0000000..8df9eba --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/spawn.pyi @@ -0,0 +1,8 @@ +# Stubs for distutils.spawn + +from typing import List, Optional + +def spawn(cmd: List[str], search_path: bool = ..., + verbose: bool = ..., dry_run: bool = ...) -> None: ... +def find_executable(executable: str, + path: Optional[str] = ...) -> Optional[str]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/sysconfig.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/sysconfig.pyi new file mode 100644 index 0000000..62fa9af --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/sysconfig.pyi @@ -0,0 +1,19 @@ +# Stubs for distutils.sysconfig + +from typing import Mapping, Optional, Union +from distutils.ccompiler import CCompiler + +PREFIX: str +EXEC_PREFIX: str + +def get_config_var(name: str) -> Union[int, str, None]: ... +def get_config_vars(*args: str) -> Mapping[str, Union[int, str]]: ... +def get_config_h_filename() -> str: ... +def get_makefile_filename() -> str: ... +def get_python_inc(plat_specific: bool = ..., + prefix: Optional[str] = ...) -> str: ... +def get_python_lib(plat_specific: bool = ..., standard_lib: bool = ..., + prefix: Optional[str] = ...) -> str: ... + +def customize_compiler(compiler: CCompiler) -> None: ... +def set_python_build() -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/text_file.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/text_file.pyi new file mode 100644 index 0000000..8f90d41 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/text_file.pyi @@ -0,0 +1,18 @@ +# Stubs for distutils.text_file + +from typing import IO, List, Optional, Tuple, Union + +class TextFile: + def __init__(self, filename: Optional[str] = ..., + file: Optional[IO[str]] = ..., + *, strip_comments: bool = ..., + lstrip_ws: bool = ..., rstrip_ws: bool = ..., + skip_blanks: bool = ..., join_lines: bool = ..., + collapse_join: bool = ...) -> None: ... + def open(self, filename: str) -> None: ... + def close(self) -> None: ... + def warn(self, msg: str, + line: Union[List[int], Tuple[int, int], int] = ...) -> None: ... + def readline(self) -> Optional[str]: ... + def readlines(self) -> List[str]: ... + def unreadline(self, line: str) -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/unixccompiler.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/unixccompiler.pyi new file mode 100644 index 0000000..7ab7298 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/unixccompiler.pyi @@ -0,0 +1,6 @@ +# Stubs for distutils.unixccompiler + +from distutils.ccompiler import CCompiler + + +class UnixCCompiler(CCompiler): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/util.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/util.pyi new file mode 100644 index 0000000..942886d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/util.pyi @@ -0,0 +1,20 @@ +# Stubs for distutils.util + +from typing import Any, Callable, List, Mapping, Optional, Tuple + + +def get_platform() -> str: ... +def convert_path(pathname: str) -> str: ... +def change_root(new_root: str, pathname: str) -> str: ... +def check_environ() -> None: ... +def subst_vars(s: str, local_vars: Mapping[str, str]) -> None: ... +def split_quoted(s: str) -> List[str]: ... +def execute(func: Callable[..., None], args: Tuple[Any, ...], + msg: Optional[str] = ..., verbose: bool = ..., + dry_run: bool = ...) -> None: ... +def strtobool(val: str) -> bool: ... +def byte_compile(py_files: List[str], optimize: int = ..., force: bool = ..., + prefix: Optional[str] = ..., base_dir: Optional[str] = ..., + verbose: bool = ..., dry_run: bool = ..., + direct: Optional[bool] = ...) -> None: ... +def rfc822_escape(header: str) -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/version.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/version.pyi new file mode 100644 index 0000000..cb636b4 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/distutils/version.pyi @@ -0,0 +1,54 @@ +import sys +from abc import abstractmethod +from typing import Any, Optional, TypeVar, Union, Pattern, Text, Tuple + +_T = TypeVar('_T', bound='Version') + +class Version: + def __repr__(self) -> str: ... + + if sys.version_info >= (3,): + def __eq__(self, other: object) -> bool: ... + def __lt__(self: _T, other: Union[_T, str]) -> bool: ... + def __le__(self: _T, other: Union[_T, str]) -> bool: ... + def __gt__(self: _T, other: Union[_T, str]) -> bool: ... + def __ge__(self: _T, other: Union[_T, str]) -> bool: ... + + @abstractmethod + def __init__(self, vstring: Optional[Text] = ...) -> None: ... + @abstractmethod + def parse(self: _T, vstring: Text) -> _T: ... + @abstractmethod + def __str__(self) -> str: ... + if sys.version_info >= (3,): + @abstractmethod + def _cmp(self: _T, other: Union[_T, str]) -> bool: ... + else: + @abstractmethod + def __cmp__(self: _T, other: Union[_T, str]) -> bool: ... + +class StrictVersion(Version): + version_re: Pattern[str] + version: Tuple[int, int, int] + prerelease: Optional[Tuple[Text, int]] + + def __init__(self, vstring: Optional[Text] = ...) -> None: ... + def parse(self: _T, vstring: Text) -> _T: ... + def __str__(self) -> str: ... + if sys.version_info >= (3,): + def _cmp(self: _T, other: Union[_T, str]) -> bool: ... + else: + def __cmp__(self: _T, other: Union[_T, str]) -> bool: ... + +class LooseVersion(Version): + component_re: Pattern[str] + vstring: Text + version: Tuple[Union[Text, int], ...] + + def __init__(self, vstring: Optional[Text] = ...) -> None: ... + def parse(self: _T, vstring: Text) -> _T: ... + def __str__(self) -> str: ... + if sys.version_info >= (3,): + def _cmp(self: _T, other: Union[_T, str]) -> bool: ... + else: + def __cmp__(self: _T, other: Union[_T, str]) -> bool: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/doctest.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/doctest.pyi new file mode 100644 index 0000000..8151fb5 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/doctest.pyi @@ -0,0 +1,161 @@ +from typing import Any, Callable, Dict, List, NamedTuple, Optional, Tuple, Type, Union + +import sys +import types +import unittest + +TestResults = NamedTuple('TestResults', [ + ('failed', int), + ('attempted', int), +]) + +OPTIONFLAGS_BY_NAME: Dict[str, int] +def register_optionflag(name: str) -> int: ... +DONT_ACCEPT_TRUE_FOR_1: int +DONT_ACCEPT_BLANKLINE: int +NORMALIZE_WHITESPACE: int +ELLIPSIS: int +SKIP: int +IGNORE_EXCEPTION_DETAIL: int + +COMPARISON_FLAGS: int + +REPORT_UDIFF: int +REPORT_CDIFF: int +REPORT_NDIFF: int +REPORT_ONLY_FIRST_FAILURE: int +if sys.version_info >= (3, 4): + FAIL_FAST: int + +REPORTING_FLAGS: int + +BLANKLINE_MARKER: str +ELLIPSIS_MARKER: str + +class Example: + source: str + want: str + exc_msg: Optional[str] + lineno: int + indent: int + options: Dict[int, bool] + def __init__(self, source: str, want: str, exc_msg: Optional[str] = ..., lineno: int = ..., indent: int = ..., + options: Optional[Dict[int, bool]] = ...) -> None: ... + def __hash__(self) -> int: ... + +class DocTest: + examples: List[Example] + globs: Dict[str, Any] + name: str + filename: Optional[str] + lineno: Optional[int] + docstring: Optional[str] + def __init__(self, examples: List[Example], globs: Dict[str, Any], name: str, filename: Optional[str], lineno: Optional[int], docstring: Optional[str]) -> None: ... + def __hash__(self) -> int: ... + def __lt__(self, other: DocTest) -> bool: ... + +class DocTestParser: + def parse(self, string: str, name: str = ...) -> List[Union[str, Example]]: ... + def get_doctest(self, string: str, globs: Dict[str, Any], name: str, filename: Optional[str], lineno: Optional[str]) -> DocTest: ... + def get_examples(self, strin: str, name: str = ...) -> List[Example]: ... + +class DocTestFinder: + def __init__(self, verbose: bool = ..., parser: DocTestParser = ..., + recurse: bool = ..., exclude_empty: bool = ...) -> None: ... + def find(self, obj: object, name: Optional[str] = ..., module: Union[None, bool, types.ModuleType] = ..., + globs: Optional[Dict[str, Any]] = ..., extraglobs: Optional[Dict[str, Any]] = ...) -> List[DocTest]: ... + +_Out = Callable[[str], Any] +_ExcInfo = Tuple[Type[BaseException], BaseException, types.TracebackType] + +class DocTestRunner: + DIVIDER: str + optionflags: int + original_optionflags: int + tries: int + failures: int + test: DocTest + + def __init__(self, checker: Optional[OutputChecker] = ..., verbose: Optional[bool] = ..., optionflags: int = ...) -> None: ... + def report_start(self, out: _Out, test: DocTest, example: Example) -> None: ... + def report_success(self, out: _Out, test: DocTest, example: Example, got: str) -> None: ... + def report_failure(self, out: _Out, test: DocTest, example: Example, got: str) -> None: ... + def report_unexpected_exception(self, out: _Out, test: DocTest, example: Example, exc_info: _ExcInfo) -> None: ... + def run(self, test: DocTest, compileflags: Optional[int] = ..., out: Optional[_Out] = ..., clear_globs: bool = ...) -> TestResults: ... + def summarize(self, verbose: Optional[bool] = ...) -> TestResults: ... + def merge(self, other: DocTestRunner) -> None: ... + +class OutputChecker: + def check_output(self, want: str, got: str, optionflags: int) -> bool: ... + def output_difference(self, example: Example, got: str, optionflags: int) -> str: ... + +class DocTestFailure(Exception): + test: DocTest + example: Example + got: str + + def __init__(self, test: DocTest, example: Example, got: str) -> None: ... + +class UnexpectedException(Exception): + test: DocTest + example: Example + exc_info: _ExcInfo + + def __init__(self, test: DocTest, example: Example, exc_info: _ExcInfo) -> None: ... + +class DebugRunner(DocTestRunner): ... + +master: Optional[DocTestRunner] + +def testmod(m: Optional[types.ModuleType] = ..., name: Optional[str] = ..., globs: Dict[str, Any] = ..., verbose: Optional[bool] = ..., + report: bool = ..., optionflags: int = ..., extraglobs: Dict[str, Any] = ..., + raise_on_error: bool = ..., exclude_empty: bool = ...) -> TestResults: ... +def testfile(filename: str, module_relative: bool = ..., name: Optional[str] = ..., package: Union[None, str, types.ModuleType] = ..., + globs: Optional[Dict[str, Any]] = ..., verbose: Optional[bool] = ..., report: bool = ..., optionflags: int = ..., + extraglobs: Optional[Dict[str, Any]] = ..., raise_on_error: bool = ..., parser: DocTestParser = ..., + encoding: Optional[str] = ...) -> TestResults: ... +def run_docstring_examples(f: object, globs: Dict[str, Any], verbose: bool = ..., name: str = ..., + compileflags: Optional[int] = ..., optionflags: int = ...) -> None: ... +def set_unittest_reportflags(flags: int) -> int: ... + +class DocTestCase(unittest.TestCase): + def __init__(self, test: DocTest, optionflags: int = ..., setUp: Optional[Callable[[DocTest], Any]] = ..., + tearDown: Optional[Callable[[DocTest], Any]] = ..., + checker: Optional[OutputChecker] = ...) -> None: ... + def setUp(self) -> None: ... + def tearDown(self) -> None: ... + def runTest(self) -> None: ... + def format_failure(self, err: str) -> str: ... + def debug(self) -> None: ... + def id(self) -> str: ... + def __hash__(self) -> int: ... + def shortDescription(self) -> str: ... + +class SkipDocTestCase(DocTestCase): + def __init__(self, module: types.ModuleType) -> None: ... + def setUp(self) -> None: ... + def test_skip(self) -> None: ... + def shortDescription(self) -> str: ... + +if sys.version_info >= (3, 4): + class _DocTestSuite(unittest.TestSuite): ... +else: + _DocTestSuite = unittest.TestSuite + +def DocTestSuite(module: Union[None, str, types.ModuleType] = ..., globs: Optional[Dict[str, Any]] = ..., + extraglobs: Optional[Dict[str, Any]] = ..., test_finder: Optional[DocTestFinder] = ..., + **options: Any) -> _DocTestSuite: ... + +class DocFileCase(DocTestCase): + def id(self) -> str: ... + def format_failure(self, err: str) -> str: ... + +def DocFileTest(path: str, module_relative: bool = ..., package: Union[None, str, types.ModuleType] = ..., + globs: Optional[Dict[str, Any]] = ..., parser: DocTestParser = ..., + encoding: Optional[str] = ..., **options: Any) -> DocFileCase: ... +def DocFileSuite(*paths: str, **kw: Any) -> _DocTestSuite: ... +def script_from_examples(s: str) -> str: ... +def testsource(module: Union[None, str, types.ModuleType], name: str) -> str: ... +def debug_src(src: str, pm: bool = ..., globs: Optional[Dict[str, Any]] = ...) -> None: ... +def debug_script(src: str, pm: bool = ..., globs: Optional[Dict[str, Any]] = ...) -> None: ... +def debug(module: Union[None, str, types.ModuleType], name: str, pm: bool = ...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/errno.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/errno.pyi new file mode 100644 index 0000000..14987bb --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/errno.pyi @@ -0,0 +1,130 @@ +# Stubs for errno + +from typing import Mapping +import sys + +errorcode: Mapping[int, str] + +EPERM: int +ENOENT: int +ESRCH: int +EINTR: int +EIO: int +ENXIO: int +E2BIG: int +ENOEXEC: int +EBADF: int +ECHILD: int +EAGAIN: int +ENOMEM: int +EACCES: int +EFAULT: int +ENOTBLK: int +EBUSY: int +EEXIST: int +EXDEV: int +ENODEV: int +ENOTDIR: int +EISDIR: int +EINVAL: int +ENFILE: int +EMFILE: int +ENOTTY: int +ETXTBSY: int +EFBIG: int +ENOSPC: int +ESPIPE: int +EROFS: int +EMLINK: int +EPIPE: int +EDOM: int +ERANGE: int +EDEADLCK: int +ENAMETOOLONG: int +ENOLCK: int +ENOSYS: int +ENOTEMPTY: int +ELOOP: int +EWOULDBLOCK: int +ENOMSG: int +EIDRM: int +ECHRNG: int +EL2NSYNC: int +EL3HLT: int +EL3RST: int +ELNRNG: int +EUNATCH: int +ENOCSI: int +EL2HLT: int +EBADE: int +EBADR: int +EXFULL: int +ENOANO: int +EBADRQC: int +EBADSLT: int +EDEADLOCK: int +EBFONT: int +ENOSTR: int +ENODATA: int +ETIME: int +ENOSR: int +ENONET: int +ENOPKG: int +EREMOTE: int +ENOLINK: int +EADV: int +ESRMNT: int +ECOMM: int +EPROTO: int +EMULTIHOP: int +EDOTDOT: int +EBADMSG: int +EOVERFLOW: int +ENOTUNIQ: int +EBADFD: int +EREMCHG: int +ELIBACC: int +ELIBBAD: int +ELIBSCN: int +ELIBMAX: int +ELIBEXEC: int +EILSEQ: int +ERESTART: int +ESTRPIPE: int +EUSERS: int +ENOTSOCK: int +EDESTADDRREQ: int +EMSGSIZE: int +EPROTOTYPE: int +ENOPROTOOPT: int +EPROTONOSUPPORT: int +ESOCKTNOSUPPORT: int +ENOTSUP: int +EOPNOTSUPP: int +EPFNOSUPPORT: int +EAFNOSUPPORT: int +EADDRINUSE: int +EADDRNOTAVAIL: int +ENETDOWN: int +ENETUNREACH: int +ENETRESET: int +ECONNABORTED: int +ECONNRESET: int +ENOBUFS: int +EISCONN: int +ENOTCONN: int +ESHUTDOWN: int +ETOOMANYREFS: int +ETIMEDOUT: int +ECONNREFUSED: int +EHOSTDOWN: int +EHOSTUNREACH: int +EALREADY: int +EINPROGRESS: int +ESTALE: int +EUCLEAN: int +ENOTNAM: int +ENAVAIL: int +EISNAM: int +EREMOTEIO: int +EDQUOT: int diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/filecmp.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/filecmp.pyi new file mode 100644 index 0000000..57a8846 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/filecmp.pyi @@ -0,0 +1,48 @@ +# Stubs for filecmp (Python 2/3) +import sys +from typing import AnyStr, Callable, Dict, Generic, Iterable, List, Optional, Sequence, Tuple, Union, Text + +DEFAULT_IGNORES: List[str] + +def cmp(f1: Union[bytes, Text], f2: Union[bytes, Text], shallow: Union[int, bool] = ...) -> bool: ... +def cmpfiles(a: AnyStr, b: AnyStr, common: Iterable[AnyStr], + shallow: Union[int, bool] = ...) -> Tuple[List[AnyStr], List[AnyStr], List[AnyStr]]: ... + +class dircmp(Generic[AnyStr]): + def __init__(self, a: AnyStr, b: AnyStr, + ignore: Optional[Sequence[AnyStr]] = ..., + hide: Optional[Sequence[AnyStr]] = ...) -> None: ... + + left: AnyStr + right: AnyStr + hide: Sequence[AnyStr] + ignore: Sequence[AnyStr] + + # These properties are created at runtime by __getattr__ + subdirs: Dict[AnyStr, dircmp[AnyStr]] + same_files: List[AnyStr] + diff_files: List[AnyStr] + funny_files: List[AnyStr] + common_dirs: List[AnyStr] + common_files: List[AnyStr] + common_funny: List[AnyStr] + common: List[AnyStr] + left_only: List[AnyStr] + right_only: List[AnyStr] + left_list: List[AnyStr] + right_list: List[AnyStr] + + def report(self) -> None: ... + def report_partial_closure(self) -> None: ... + def report_full_closure(self) -> None: ... + + methodmap: Dict[str, Callable[[], None]] + def phase0(self) -> None: ... + def phase1(self) -> None: ... + def phase2(self) -> None: ... + def phase3(self) -> None: ... + def phase4(self) -> None: ... + def phase4_closure(self) -> None: ... + +if sys.version_info >= (3,): + def clear_cache() -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/fileinput.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/fileinput.pyi new file mode 100644 index 0000000..0eb8ca9 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/fileinput.pyi @@ -0,0 +1,62 @@ +from typing import Iterable, Callable, IO, AnyStr, Generic, Any, Text, Union, Iterator, Optional + +import os +import sys + +if sys.version_info >= (3, 6): + _Path = Union[Text, bytes, os.PathLike[Any]] +else: + _Path = Union[Text, bytes] + + +def input( + files: Union[_Path, Iterable[_Path], None] = ..., + inplace: bool = ..., + backup: str = ..., + bufsize: int = ..., + mode: str = ..., + openhook: Callable[[_Path, str], IO[AnyStr]] = ...) -> FileInput[AnyStr]: ... + + +def close() -> None: ... +def nextfile() -> None: ... +def filename() -> str: ... +def lineno() -> int: ... +def filelineno() -> int: ... +def fileno() -> int: ... +def isfirstline() -> bool: ... +def isstdin() -> bool: ... + +class FileInput(Iterable[AnyStr], Generic[AnyStr]): + def __init__( + self, + files: Union[None, _Path, Iterable[_Path]] = ..., + inplace: bool = ..., + backup: str = ..., + bufsize: int = ..., + mode: str = ..., + openhook: Callable[[_Path, str], IO[AnyStr]] = ... + ) -> None: ... + + def __del__(self) -> None: ... + def close(self) -> None: ... + if sys.version_info >= (3, 2): + def __enter__(self) -> FileInput[AnyStr]: ... + def __exit__(self, type: Any, value: Any, traceback: Any) -> None: ... + def __iter__(self) -> Iterator[AnyStr]: ... + def __next__(self) -> AnyStr: ... + def __getitem__(self, i: int) -> AnyStr: ... + def nextfile(self) -> None: ... + def readline(self) -> AnyStr: ... + def filename(self) -> str: ... + def lineno(self) -> int: ... + def filelineno(self) -> int: ... + def fileno(self) -> int: ... + def isfirstline(self) -> bool: ... + def isstdin(self) -> bool: ... + +def hook_compressed(filename: _Path, mode: str) -> IO[Any]: ... +if sys.version_info >= (3, 6): + def hook_encoded(encoding: str, errors: Optional[str] = ...) -> Callable[[_Path, str], IO[Any]]: ... +else: + def hook_encoded(encoding: str) -> Callable[[_Path, str], IO[Any]]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/formatter.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/formatter.pyi new file mode 100644 index 0000000..77a4956 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/formatter.pyi @@ -0,0 +1,105 @@ +# Source: https://hg.python.org/cpython/file/2.7/Lib/formatter.py +# and https://github.com/python/cpython/blob/master/Lib/formatter.py +from typing import Any, IO, List, Optional, Tuple + +AS_IS = None +_FontType = Tuple[str, bool, bool, bool] +_StylesType = Tuple[Any, ...] + +class NullFormatter: + writer: Optional[NullWriter] + def __init__(self, writer: Optional[NullWriter] = ...) -> None: ... + def end_paragraph(self, blankline: int) -> None: ... + def add_line_break(self) -> None: ... + def add_hor_rule(self, *args, **kw) -> None: ... + def add_label_data(self, format, counter: int, blankline: Optional[int] = ...) -> None: ... + def add_flowing_data(self, data: str) -> None: ... + def add_literal_data(self, data: str) -> None: ... + def flush_softspace(self) -> None: ... + def push_alignment(self, align: Optional[str]) -> None: ... + def pop_alignment(self) -> None: ... + def push_font(self, x: _FontType) -> None: ... + def pop_font(self) -> None: ... + def push_margin(self, margin: int) -> None: ... + def pop_margin(self) -> None: ... + def set_spacing(self, spacing: Optional[str]) -> None: ... + def push_style(self, *styles: _StylesType) -> None: ... + def pop_style(self, n: int = ...) -> None: ... + def assert_line_data(self, flag: int = ...) -> None: ... + +class AbstractFormatter: + writer: NullWriter + align: Optional[str] + align_stack: List[Optional[str]] + font_stack: List[_FontType] + margin_stack: List[int] + spacing: Optional[str] + style_stack: Any + nospace: int + softspace: int + para_end: int + parskip: int + hard_break: int + have_label: int + def __init__(self, writer: NullWriter) -> None: ... + def end_paragraph(self, blankline: int) -> None: ... + def add_line_break(self) -> None: ... + def add_hor_rule(self, *args, **kw) -> None: ... + def add_label_data(self, format, counter: int, blankline: Optional[int] = ...) -> None: ... + def format_counter(self, format, counter: int) -> str: ... + def format_letter(self, case: str, counter: int) -> str: ... + def format_roman(self, case: str, counter: int) -> str: ... + def add_flowing_data(self, data: str) -> None: ... + def add_literal_data(self, data: str) -> None: ... + def flush_softspace(self) -> None: ... + def push_alignment(self, align: Optional[str]) -> None: ... + def pop_alignment(self) -> None: ... + def push_font(self, font: _FontType) -> None: ... + def pop_font(self) -> None: ... + def push_margin(self, margin: int) -> None: ... + def pop_margin(self) -> None: ... + def set_spacing(self, spacing: Optional[str]) -> None: ... + def push_style(self, *styles: _StylesType) -> None: ... + def pop_style(self, n: int = ...) -> None: ... + def assert_line_data(self, flag: int = ...) -> None: ... + +class NullWriter: + def __init__(self) -> None: ... + def flush(self) -> None: ... + def new_alignment(self, align: Optional[str]) -> None: ... + def new_font(self, font: _FontType) -> None: ... + def new_margin(self, margin: int, level: int) -> None: ... + def new_spacing(self, spacing: Optional[str]) -> None: ... + def new_styles(self, styles) -> None: ... + def send_paragraph(self, blankline: int) -> None: ... + def send_line_break(self) -> None: ... + def send_hor_rule(self, *args, **kw) -> None: ... + def send_label_data(self, data: str) -> None: ... + def send_flowing_data(self, data: str) -> None: ... + def send_literal_data(self, data: str) -> None: ... + +class AbstractWriter(NullWriter): + def new_alignment(self, align: Optional[str]) -> None: ... + def new_font(self, font: _FontType) -> None: ... + def new_margin(self, margin: int, level: int) -> None: ... + def new_spacing(self, spacing: Optional[str]) -> None: ... + def new_styles(self, styles) -> None: ... + def send_paragraph(self, blankline: int) -> None: ... + def send_line_break(self) -> None: ... + def send_hor_rule(self, *args, **kw) -> None: ... + def send_label_data(self, data: str) -> None: ... + def send_flowing_data(self, data: str) -> None: ... + def send_literal_data(self, data: str) -> None: ... + +class DumbWriter(NullWriter): + file: IO + maxcol: int + def __init__(self, file: Optional[IO] = ..., maxcol: int = ...) -> None: ... + def reset(self) -> None: ... + def send_paragraph(self, blankline: int) -> None: ... + def send_line_break(self) -> None: ... + def send_hor_rule(self, *args, **kw) -> None: ... + def send_literal_data(self, data: str) -> None: ... + def send_flowing_data(self, data: str) -> None: ... + +def test(file: Optional[str] = ...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/fractions.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/fractions.pyi new file mode 100644 index 0000000..8bebe5f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/fractions.pyi @@ -0,0 +1,96 @@ +# Stubs for fractions +# See https://docs.python.org/3/library/fractions.html +# +# Note: these stubs are incomplete. The more complex type +# signatures are currently omitted. Also see numbers.pyi. + +from typing import Optional, TypeVar, Union, overload, Any +from numbers import Real, Integral, Rational +from decimal import Decimal +import sys + +_ComparableNum = Union[int, float, Decimal, Real] + + +@overload +def gcd(a: int, b: int) -> int: ... +@overload +def gcd(a: Integral, b: int) -> Integral: ... +@overload +def gcd(a: int, b: Integral) -> Integral: ... +@overload +def gcd(a: Integral, b: Integral) -> Integral: ... + + +class Fraction(Rational): + @overload + def __init__(self, + numerator: Union[int, Rational] = ..., + denominator: Optional[Union[int, Rational]] = ..., + *, + _normalize: bool = ...) -> None: ... + @overload + def __init__(self, value: float, *, _normalize: bool = ...) -> None: ... + @overload + def __init__(self, value: Decimal, *, _normalize: bool = ...) -> None: ... + @overload + def __init__(self, value: str, *, _normalize: bool = ...) -> None: ... + + @classmethod + def from_float(cls, f: float) -> Fraction: ... + @classmethod + def from_decimal(cls, dec: Decimal) -> Fraction: ... + def limit_denominator(self, max_denominator: int = ...) -> Fraction: ... + + @property + def numerator(self) -> int: ... + @property + def denominator(self) -> int: ... + + def __add__(self, other): ... + def __radd__(self, other): ... + def __sub__(self, other): ... + def __rsub__(self, other): ... + def __mul__(self, other): ... + def __rmul__(self, other): ... + def __truediv__(self, other): ... + def __rtruediv__(self, other): ... + if sys.version_info < (3, 0): + def __div__(self, other): ... + def __rdiv__(self, other): ... + def __floordiv__(self, other) -> int: ... + def __rfloordiv__(self, other) -> int: ... + def __mod__(self, other): ... + def __rmod__(self, other): ... + def __divmod__(self, other): ... + def __rdivmod__(self, other): ... + def __pow__(self, other): ... + def __rpow__(self, other): ... + + def __pos__(self) -> Fraction: ... + def __neg__(self) -> Fraction: ... + def __abs__(self) -> Fraction: ... + def __trunc__(self) -> int: ... + if sys.version_info >= (3, 0): + def __floor__(self) -> int: ... + def __ceil__(self) -> int: ... + def __round__(self, ndigits: Optional[Any] = ...): ... + + def __hash__(self) -> int: ... + def __eq__(self, other: object) -> bool: ... + def __lt__(self, other: _ComparableNum) -> bool: ... + def __gt__(self, other: _ComparableNum) -> bool: ... + def __le__(self, other: _ComparableNum) -> bool: ... + def __ge__(self, other: _ComparableNum) -> bool: ... + if sys.version_info >= (3, 0): + def __bool__(self) -> bool: ... + else: + def __nonzero__(self) -> bool: ... + + # Not actually defined within fractions.py, but provides more useful + # overrides + @property + def real(self) -> Fraction: ... + @property + def imag(self) -> Fraction: ... + def conjugate(self) -> Fraction: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/ftplib.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/ftplib.pyi new file mode 100644 index 0000000..dff8c47 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/ftplib.pyi @@ -0,0 +1,134 @@ +# Stubs for ftplib (Python 2.7/3) +import sys +from typing import Optional, BinaryIO, Tuple, TextIO, Iterable, Callable, List, Union, Iterator, Dict, Text, Type, TypeVar, Generic, Any +from types import TracebackType +from socket import socket +from ssl import SSLContext + +_T = TypeVar('_T') +_IntOrStr = Union[int, Text] + +MSG_OOB: int +FTP_PORT: int +MAXLINE: int +CRLF: str +if sys.version_info >= (3,): + B_CRLF: bytes + +class Error(Exception): ... +class error_reply(Error): ... +class error_temp(Error): ... +class error_perm(Error): ... +class error_proto(Error): ... + +all_errors = Tuple[Exception, ...] + +class FTP: + debugging: int + + # Note: This is technically the type that's passed in as the host argument. But to make it easier in Python 2 we + # accept Text but return str. + host: str + + port: int + maxline: int + sock: Optional[socket] + welcome: Optional[str] + passiveserver: int + timeout: int + af: int + lastresp: str + + if sys.version_info >= (3,): + file: Optional[TextIO] + encoding: str + def __enter__(self: _T) -> _T: ... + def __exit__(self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], + exc_tb: Optional[TracebackType]) -> bool: ... + else: + file: Optional[BinaryIO] + + if sys.version_info >= (3, 3): + source_address: Optional[Tuple[str, int]] + def __init__(self, host: Text = ..., user: Text = ..., passwd: Text = ..., acct: Text = ..., + timeout: float = ..., source_address: Optional[Tuple[str, int]] = ...) -> None: ... + def connect(self, host: Text = ..., port: int = ..., timeout: float = ..., + source_address: Optional[Tuple[str, int]] = ...) -> str: ... + else: + def __init__(self, host: Text = ..., user: Text = ..., passwd: Text = ..., acct: Text = ..., + timeout: float = ...) -> None: ... + def connect(self, host: Text = ..., port: int = ..., timeout: float = ...) -> str: ... + + def getwelcome(self) -> str: ... + def set_debuglevel(self, level: int) -> None: ... + def debug(self, level: int) -> None: ... + def set_pasv(self, val: Union[bool, int]) -> None: ... + def sanitize(self, s: Text) -> str: ... + def putline(self, line: Text) -> None: ... + def putcmd(self, line: Text) -> None: ... + def getline(self) -> str: ... + def getmultiline(self) -> str: ... + def getresp(self) -> str: ... + def voidresp(self) -> str: ... + def abort(self) -> str: ... + def sendcmd(self, cmd: Text) -> str: ... + def voidcmd(self, cmd: Text) -> str: ... + def sendport(self, host: Text, port: int) -> str: ... + def sendeprt(self, host: Text, port: int) -> str: ... + def makeport(self) -> socket: ... + def makepasv(self) -> Tuple[str, int]: ... + def login(self, user: Text = ..., passwd: Text = ..., acct: Text = ...) -> str: ... + + # In practice, `rest` rest can actually be anything whose str() is an integer sequence, so to make it simple we allow integers. + def ntransfercmd(self, cmd: Text, rest: Optional[_IntOrStr] = ...) -> Tuple[socket, int]: ... + def transfercmd(self, cmd: Text, rest: Optional[_IntOrStr] = ...) -> socket: ... + def retrbinary(self, cmd: Text, callback: Callable[[bytes], Any], blocksize: int = ..., rest: Optional[_IntOrStr] = ...) -> str: ... + def storbinary(self, cmd: Text, fp: BinaryIO, blocksize: int = ..., callback: Optional[Callable[[bytes], Any]] = ..., rest: Optional[_IntOrStr] = ...) -> str: ... + + def retrlines(self, cmd: Text, callback: Optional[Callable[[str], Any]] = ...) -> str: ... + def storlines(self, cmd: Text, fp: BinaryIO, callback: Optional[Callable[[bytes], Any]] = ...) -> str: ... + + def acct(self, password: Text) -> str: ... + def nlst(self, *args: Text) -> List[str]: ... + + # Technically only the last arg can be a Callable but ... + def dir(self, *args: Union[str, Callable[[str], None]]) -> None: ... + + if sys.version_info >= (3, 3): + def mlsd(self, path: Text = ..., facts: Iterable[str] = ...) -> Iterator[Tuple[str, Dict[str, str]]]: ... + def rename(self, fromname: Text, toname: Text) -> str: ... + def delete(self, filename: Text) -> str: ... + def cwd(self, dirname: Text) -> str: ... + def size(self, filename: Text) -> str: ... + def mkd(self, dirname: Text) -> str: ... + def rmd(self, dirname: Text) -> str: ... + def pwd(self) -> str: ... + def quit(self) -> str: ... + def close(self) -> None: ... + +class FTP_TLS(FTP): + def __init__(self, host: Text = ..., user: Text = ..., passwd: Text = ..., acct: Text = ..., + keyfile: Optional[str] = ..., certfile: Optional[str] = ..., + context: Optional[SSLContext] = ..., timeout: float = ..., + source_address: Optional[Tuple[str, int]] = ...) -> None: ... + + ssl_version: int + keyfile: Optional[str] + certfile: Optional[str] + context: SSLContext + + def login(self, user: Text = ..., passwd: Text = ..., acct: Text = ..., secure: bool = ...) -> str: ... + def auth(self) -> str: ... + def prot_p(self) -> str: ... + def prot_c(self) -> str: ... + + if sys.version_info >= (3, 3): + def ccc(self) -> str: ... + +if sys.version_info < (3,): + class Netrc: + def __init__(self, filename: Optional[Text] = ...) -> None: ... + def get_hosts(self) -> List[str]: ... + def get_account(self, host: Text) -> Tuple[Optional[str], Optional[str], Optional[str]]: ... + def get_macros(self) -> List[str]: ... + def get_macro(self, macro: Text) -> Tuple[str, ...]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/genericpath.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/genericpath.pyi new file mode 100644 index 0000000..e0b1c6d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/genericpath.pyi @@ -0,0 +1,21 @@ +from typing import Sequence, AnyStr, Text +import sys + +if sys.version_info >= (3, 0): + def commonprefix(m: Sequence[str]) -> str: ... +else: + def commonprefix(m: Sequence[AnyStr]) -> AnyStr: ... + +def exists(path: Text) -> bool: ... +def isfile(path: Text) -> bool: ... +def isdir(s: Text) -> bool: ... +def getsize(filename: Text) -> int: ... +def getmtime(filename: Text) -> float: ... +def getatime(filename: Text) -> float: ... +def getctime(filename: Text) -> float: ... + + +if sys.version_info >= (3, 4): + def samestat(s1: str, s2: str) -> int: ... + def samefile(f1: str, f2: str) -> int: ... + def sameopenfile(fp1: str, fp2: str) -> int: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/grp.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/grp.pyi new file mode 100644 index 0000000..6054727 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/grp.pyi @@ -0,0 +1,10 @@ +from typing import List, NamedTuple, Optional + +struct_group = NamedTuple("struct_group", [("gr_name", str), + ("gr_passwd", Optional[str]), + ("gr_gid", int), + ("gr_mem", List[str])]) + +def getgrall() -> List[struct_group]: ... +def getgrgid(gid: int) -> struct_group: ... +def getgrnam(name: str) -> struct_group: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/hmac.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/hmac.pyi new file mode 100644 index 0000000..47bbc7e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/hmac.pyi @@ -0,0 +1,38 @@ +# Stubs for hmac + +from typing import Any, Callable, Optional, Union, overload, AnyStr +from types import ModuleType +import sys + +_B = Union[bytes, bytearray] + +# TODO more precise type for object of hashlib +_Hash = Any + +digest_size: None + +if sys.version_info >= (3, 4): + def new(key: _B, msg: Optional[_B] = ..., + digestmod: Optional[Union[str, Callable[[], _Hash], ModuleType]] = ...) -> HMAC: ... +else: + def new(key: _B, msg: Optional[_B] = ..., + digestmod: Optional[Union[Callable[[], _Hash], ModuleType]] = ...) -> HMAC: ... + +class HMAC: + if sys.version_info >= (3,): + digest_size: int + if sys.version_info >= (3, 4): + block_size: int + name: str + def update(self, msg: _B) -> None: ... + def digest(self) -> bytes: ... + def hexdigest(self) -> str: ... + def copy(self) -> HMAC: ... + +@overload +def compare_digest(a: bytearray, b: bytearray) -> bool: ... +@overload +def compare_digest(a: AnyStr, b: AnyStr) -> bool: ... + +if sys.version_info >= (3, 7): + def digest(key: _B, msg: _B, digest: str) -> bytes: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/imaplib.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/imaplib.pyi new file mode 100644 index 0000000..ab32e7b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/imaplib.pyi @@ -0,0 +1,133 @@ +# Stubs for imaplib (Python 2) + +import imaplib +import subprocess +import sys +import time +from socket import socket as _socket +from ssl import SSLSocket +from typing import Any, Callable, Dict, IO, List, Optional, Pattern, Text, Tuple, Type, Union + +CommandResults = Tuple[str, List[Any]] + + +class IMAP4: + error: Type[Exception] = ... + abort: Type[Exception] = ... + readonly: Type[Exception] = ... + mustquote: Pattern[Text] = ... + debug: int = ... + state: str = ... + literal: Optional[Text] = ... + tagged_commands: Dict[str, str] = ... + untagged_responses: Dict[str, str] = ... + continuation_response: str = ... + is_readonly: bool = ... + tagnum: int = ... + tagpre: str = ... + tagre: Pattern[Text] = ... + welcome: bytes = ... + capabilities: Tuple[str] = ... + PROTOCOL_VERSION: str = ... + def __init__(self, host: str, port: int) -> None: ... + def __getattr__(self, attr: str) -> Any: ... + host: str = ... + port: int = ... + sock: _socket = ... + file: Union[IO[Text], IO[bytes]] = ... + def open(self, host: str = ..., port: int = ...) -> None: ... + def read(self, size: int) -> bytes: ... + def readline(self) -> bytes: ... + def send(self, data: bytes) -> None: ... + def shutdown(self) -> None: ... + def socket(self) -> _socket: ... + def recent(self) -> CommandResults: ... + def response(self, code: str) -> CommandResults: ... + def append(self, mailbox: str, flags: str, date_time: str, message: str) -> str: ... + def authenticate(self, mechanism: str, authobject: Callable) -> Tuple[str, str]: ... + def capability(self) -> CommandResults: ... + def check(self) -> CommandResults: ... + def close(self) -> CommandResults: ... + def copy(self, message_set: str, new_mailbox: str) -> CommandResults: ... + def create(self, mailbox: str) -> CommandResults: ... + def delete(self, mailbox: str) -> CommandResults: ... + def deleteacl(self, mailbox: str, who: str) -> CommandResults: ... + def expunge(self) -> CommandResults: ... + def fetch(self, message_set: str, message_parts: str) -> CommandResults: ... + def getacl(self, mailbox: str) -> CommandResults: ... + def getannotation(self, mailbox: str, entry: str, attribute: str) -> CommandResults: ... + def getquota(self, root: str) -> CommandResults: ... + def getquotaroot(self, mailbox: str) -> CommandResults: ... + def list(self, directory: str = ..., pattern: str = ...) -> CommandResults: ... + def login(self, user: str, password: str) -> CommandResults: ... + def login_cram_md5(self, user: str, password: str) -> CommandResults: ... + def logout(self) -> CommandResults: ... + def lsub(self, directory: str = ..., pattern: str = ...) -> CommandResults: ... + def myrights(self, mailbox: str) -> CommandResults: ... + def namespace(self) -> CommandResults: ... + def noop(self) -> CommandResults: ... + def partial(self, message_num: str, message_part: str, start: str, length: str) -> CommandResults: ... + def proxyauth(self, user: str) -> CommandResults: ... + def rename(self, oldmailbox: str, newmailbox: str) -> CommandResults: ... + def search(self, charset: Optional[str], *criteria: str) -> CommandResults: ... + def select(self, mailbox: str = ..., readonly: bool = ...) -> CommandResults: ... + def setacl(self, mailbox: str, who: str, what: str) -> CommandResults: ... + def setannotation(self, *args: List[str]) -> CommandResults: ... + def setquota(self, root: str, limits: str) -> CommandResults: ... + def sort(self, sort_criteria: str, charset: str, *search_criteria: List[str]) -> CommandResults: ... + if sys.version_info >= (3,): + def starttls(self, ssl_context: Optional[Any] = ...) -> CommandResults: ... + def status(self, mailbox: str, names: str) -> CommandResults: ... + def store(self, message_set: str, command: str, flags: str) -> CommandResults: ... + def subscribe(self, mailbox: str) -> CommandResults: ... + def thread(self, threading_algorithm: str, charset: str, *search_criteria: List[str]) -> CommandResults: ... + def uid(self, command: str, *args: List[str]) -> CommandResults: ... + def unsubscribe(self, mailbox: str) -> CommandResults: ... + def xatom(self, name: str, *args: List[str]) -> CommandResults: ... + def print_log(self) -> None: ... + +class IMAP4_SSL(IMAP4): + keyfile: str = ... + certfile: str = ... + def __init__(self, host: str = ..., port: int = ..., keyfile: Optional[str] = ..., certfile: Optional[str] = ...) -> None: ... + host: str = ... + port: int = ... + sock: _socket = ... + sslobj: SSLSocket = ... + file: IO[Any] = ... + def open(self, host: str = ..., port: Optional[int] = ...) -> None: ... + def read(self, size: int) -> bytes: ... + def readline(self) -> bytes: ... + def send(self, data: bytes) -> None: ... + def shutdown(self) -> None: ... + def socket(self) -> _socket: ... + def ssl(self) -> SSLSocket: ... + + +class IMAP4_stream(IMAP4): + command: str = ... + def __init__(self, command: str) -> None: ... + host: str = ... + port: int = ... + sock: _socket = ... + file: IO[Any] = ... + process: subprocess.Popen = ... + writefile: IO[Any] = ... + readfile: IO[Any] = ... + def open(self, host: str = ..., port: Optional[int] = ...) -> None: ... + def read(self, size: int) -> bytes: ... + def readline(self) -> bytes: ... + def send(self, data: bytes) -> None: ... + def shutdown(self) -> None: ... + +class _Authenticator: + mech: Callable = ... + def __init__(self, mechinst: Callable) -> None: ... + def process(self, data: str) -> str: ... + def encode(self, inp: bytes) -> str: ... + def decode(self, inp: str) -> bytes: ... + +def Internaldate2tuple(resp: str) -> time.struct_time: ... +def Int2AP(num: int) -> str: ... +def ParseFlags(resp: str) -> Tuple[str]: ... +def Time2Internaldate(date_time: Union[float, time.struct_time, str]) -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/imghdr.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/imghdr.pyi new file mode 100644 index 0000000..b9d8d17 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/imghdr.pyi @@ -0,0 +1,16 @@ +from typing import overload, Union, Text, BinaryIO, Optional, Any, List, Callable +import sys +import os + + +if sys.version_info >= (3, 6): + _File = Union[Text, os.PathLike[Text], BinaryIO] +else: + _File = Union[Text, BinaryIO] + + +@overload +def what(file: _File) -> Optional[str]: ... +@overload +def what(file: Any, h: bytes) -> Optional[str]: ... +tests: List[Callable[[bytes, BinaryIO], Optional[str]]] diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/keyword.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/keyword.pyi new file mode 100644 index 0000000..f9e3376 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/keyword.pyi @@ -0,0 +1,6 @@ +# Stubs for keyword + +from typing import Sequence, Text, Union + +def iskeyword(s: Union[Text, bytes]) -> bool: ... +kwlist: Sequence[str] diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/lib2to3/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/lib2to3/__init__.pyi new file mode 100644 index 0000000..145e31b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/lib2to3/__init__.pyi @@ -0,0 +1 @@ +# Stubs for lib2to3 (Python 3.6) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/__init__.pyi new file mode 100644 index 0000000..1adc82a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/__init__.pyi @@ -0,0 +1,10 @@ +# Stubs for lib2to3.pgen2 (Python 3.6) + +import os +import sys +from typing import Text, Union + +if sys.version_info >= (3, 6): + _Path = Union[Text, os.PathLike] +else: + _Path = Text diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/driver.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/driver.pyi new file mode 100644 index 0000000..56785f0 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/driver.pyi @@ -0,0 +1,24 @@ +# Stubs for lib2to3.pgen2.driver (Python 3.6) + +import os +import sys +from typing import Any, Callable, IO, Iterable, List, Optional, Text, Tuple, Union + +from logging import Logger +from lib2to3.pytree import _Convert, _NL +from lib2to3.pgen2 import _Path +from lib2to3.pgen2.grammar import Grammar + + +class Driver: + grammar: Grammar + logger: Logger + convert: _Convert + def __init__(self, grammar: Grammar, convert: Optional[_Convert] = ..., logger: Optional[Logger] = ...) -> None: ... + def parse_tokens(self, tokens: Iterable[Any], debug: bool = ...) -> _NL: ... + def parse_stream_raw(self, stream: IO[Text], debug: bool = ...) -> _NL: ... + def parse_stream(self, stream: IO[Text], debug: bool = ...) -> _NL: ... + def parse_file(self, filename: _Path, encoding: Optional[Text] = ..., debug: bool = ...) -> _NL: ... + def parse_string(self, text: Text, debug: bool = ...) -> _NL: ... + +def load_grammar(gt: Text = ..., gp: Optional[Text] = ..., save: bool = ..., force: bool = ..., logger: Optional[Logger] = ...) -> Grammar: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/grammar.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/grammar.pyi new file mode 100644 index 0000000..122d771 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/grammar.pyi @@ -0,0 +1,29 @@ +# Stubs for lib2to3.pgen2.grammar (Python 3.6) + +from lib2to3.pgen2 import _Path + +from typing import Any, Dict, List, Optional, Text, Tuple, TypeVar + +_P = TypeVar('_P') +_Label = Tuple[int, Optional[Text]] +_DFA = List[List[Tuple[int, int]]] +_DFAS = Tuple[_DFA, Dict[int, int]] + +class Grammar: + symbol2number: Dict[Text, int] + number2symbol: Dict[int, Text] + states: List[_DFA] + dfas: Dict[int, _DFAS] + labels: List[_Label] + keywords: Dict[Text, int] + tokens: Dict[int, int] + symbol2label: Dict[Text, int] + start: int + def __init__(self) -> None: ... + def dump(self, filename: _Path) -> None: ... + def load(self, filename: _Path) -> None: ... + def copy(self: _P) -> _P: ... + def report(self) -> None: ... + +opmap_raw: Text +opmap: Dict[Text, Text] diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/literals.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/literals.pyi new file mode 100644 index 0000000..8719500 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/literals.pyi @@ -0,0 +1,9 @@ +# Stubs for lib2to3.pgen2.literals (Python 3.6) + +from typing import Dict, Match, Text + +simple_escapes: Dict[Text, Text] + +def escape(m: Match) -> Text: ... +def evalString(s: Text) -> Text: ... +def test() -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/parse.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/parse.pyi new file mode 100644 index 0000000..101d476 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/parse.pyi @@ -0,0 +1,29 @@ +# Stubs for lib2to3.pgen2.parse (Python 3.6) + +from typing import Any, Dict, List, Optional, Sequence, Set, Text, Tuple + +from lib2to3.pgen2.grammar import Grammar, _DFAS +from lib2to3.pytree import _NL, _Convert, _RawNode + +_Context = Sequence[Any] + +class ParseError(Exception): + msg: Text + type: int + value: Optional[Text] + context: _Context + def __init__(self, msg: Text, type: int, value: Optional[Text], context: _Context) -> None: ... + +class Parser: + grammar: Grammar + convert: _Convert + stack: List[Tuple[_DFAS, int, _RawNode]] + rootnode: Optional[_NL] + used_names: Set[Text] + def __init__(self, grammar: Grammar, convert: Optional[_Convert] = ...) -> None: ... + def setup(self, start: Optional[int] = ...) -> None: ... + def addtoken(self, type: int, value: Optional[Text], context: _Context) -> bool: ... + def classify(self, type: int, value: Optional[Text], context: _Context) -> int: ... + def shift(self, type: int, value: Optional[Text], newstate: int, context: _Context) -> None: ... + def push(self, type: int, newdfa: _DFAS, newstate: int, context: _Context) -> None: ... + def pop(self) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/pgen.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/pgen.pyi new file mode 100644 index 0000000..42d503b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/pgen.pyi @@ -0,0 +1,50 @@ +# Stubs for lib2to3.pgen2.pgen (Python 3.6) + +from typing import ( + Any, Dict, IO, Iterable, Iterator, List, NoReturn, Optional, Text, Tuple +) + +from lib2to3.pgen2 import _Path, grammar +from lib2to3.pgen2.tokenize import _TokenInfo + +class PgenGrammar(grammar.Grammar): ... + +class ParserGenerator: + filename: _Path + stream: IO[Text] + generator: Iterator[_TokenInfo] + first: Dict[Text, Dict[Text, int]] + def __init__(self, filename: _Path, stream: Optional[IO[Text]] = ...) -> None: ... + def make_grammar(self) -> PgenGrammar: ... + def make_first(self, c: PgenGrammar, name: Text) -> Dict[int, int]: ... + def make_label(self, c: PgenGrammar, label: Text) -> int: ... + def addfirstsets(self) -> None: ... + def calcfirst(self, name: Text) -> None: ... + def parse(self) -> Tuple[Dict[Text, List[DFAState]], Text]: ... + def make_dfa(self, start: NFAState, finish: NFAState) -> List[DFAState]: ... + def dump_nfa(self, name: Text, start: NFAState, finish: NFAState) -> List[DFAState]: ... + def dump_dfa(self, name: Text, dfa: Iterable[DFAState]) -> None: ... + def simplify_dfa(self, dfa: List[DFAState]) -> None: ... + def parse_rhs(self) -> Tuple[NFAState, NFAState]: ... + def parse_alt(self) -> Tuple[NFAState, NFAState]: ... + def parse_item(self) -> Tuple[NFAState, NFAState]: ... + def parse_atom(self) -> Tuple[NFAState, NFAState]: ... + def expect(self, type: int, value: Optional[Any] = ...) -> Text: ... + def gettoken(self) -> None: ... + def raise_error(self, msg: str, *args: Any) -> NoReturn: ... + +class NFAState: + arcs: List[Tuple[Optional[Text], NFAState]] + def __init__(self) -> None: ... + def addarc(self, next: NFAState, label: Optional[Text] = ...) -> None: ... + +class DFAState: + nfaset: Dict[NFAState, Any] + isfinal: bool + arcs: Dict[Text, DFAState] + def __init__(self, nfaset: Dict[NFAState, Any], final: NFAState) -> None: ... + def addarc(self, next: DFAState, label: Text) -> None: ... + def unifystate(self, old: DFAState, new: DFAState) -> None: ... + def __eq__(self, other: Any) -> bool: ... + +def generate_grammar(filename: _Path = ...) -> PgenGrammar: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/token.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/token.pyi new file mode 100644 index 0000000..c256af8 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/token.pyi @@ -0,0 +1,73 @@ +# Stubs for lib2to3.pgen2.token (Python 3.6) + +import sys +from typing import Dict, Text + +ENDMARKER: int +NAME: int +NUMBER: int +STRING: int +NEWLINE: int +INDENT: int +DEDENT: int +LPAR: int +RPAR: int +LSQB: int +RSQB: int +COLON: int +COMMA: int +SEMI: int +PLUS: int +MINUS: int +STAR: int +SLASH: int +VBAR: int +AMPER: int +LESS: int +GREATER: int +EQUAL: int +DOT: int +PERCENT: int +BACKQUOTE: int +LBRACE: int +RBRACE: int +EQEQUAL: int +NOTEQUAL: int +LESSEQUAL: int +GREATEREQUAL: int +TILDE: int +CIRCUMFLEX: int +LEFTSHIFT: int +RIGHTSHIFT: int +DOUBLESTAR: int +PLUSEQUAL: int +MINEQUAL: int +STAREQUAL: int +SLASHEQUAL: int +PERCENTEQUAL: int +AMPEREQUAL: int +VBAREQUAL: int +CIRCUMFLEXEQUAL: int +LEFTSHIFTEQUAL: int +RIGHTSHIFTEQUAL: int +DOUBLESTAREQUAL: int +DOUBLESLASH: int +DOUBLESLASHEQUAL: int +OP: int +COMMENT: int +NL: int +if sys.version_info >= (3,): + RARROW: int +if sys.version_info >= (3, 5): + AT: int + ATEQUAL: int + AWAIT: int + ASYNC: int +ERRORTOKEN: int +N_TOKENS: int +NT_OFFSET: int +tok_name: Dict[int, Text] + +def ISTERMINAL(x: int) -> bool: ... +def ISNONTERMINAL(x: int) -> bool: ... +def ISEOF(x: int) -> bool: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/tokenize.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/tokenize.pyi new file mode 100644 index 0000000..c10305f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/tokenize.pyi @@ -0,0 +1,30 @@ +# Stubs for lib2to3.pgen2.tokenize (Python 3.6) +# NOTE: Only elements from __all__ are present. + +from typing import Callable, Iterable, Iterator, List, Text, Tuple +from lib2to3.pgen2.token import * # noqa + + +_Coord = Tuple[int, int] +_TokenEater = Callable[[int, Text, _Coord, _Coord, Text], None] +_TokenInfo = Tuple[int, Text, _Coord, _Coord, Text] + + +class TokenError(Exception): ... +class StopTokenizing(Exception): ... + +def tokenize(readline: Callable[[], Text], tokeneater: _TokenEater = ...) -> None: ... + +class Untokenizer: + tokens: List[Text] + prev_row: int + prev_col: int + def __init__(self) -> None: ... + def add_whitespace(self, start: _Coord) -> None: ... + def untokenize(self, iterable: Iterable[_TokenInfo]) -> Text: ... + def compat(self, token: Tuple[int, Text], iterable: Iterable[_TokenInfo]) -> None: ... + +def untokenize(iterable: Iterable[_TokenInfo]) -> Text: ... +def generate_tokens( + readline: Callable[[], Text] +) -> Iterator[_TokenInfo]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pygram.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pygram.pyi new file mode 100644 index 0000000..aeb7b93 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pygram.pyi @@ -0,0 +1,116 @@ +# Stubs for lib2to3.pygram (Python 3.6) + +from typing import Any +from lib2to3.pgen2.grammar import Grammar + +class Symbols: + def __init__(self, grammar: Grammar) -> None: ... + +class python_symbols(Symbols): + and_expr: int + and_test: int + annassign: int + arglist: int + argument: int + arith_expr: int + assert_stmt: int + async_funcdef: int + async_stmt: int + atom: int + augassign: int + break_stmt: int + classdef: int + comp_for: int + comp_if: int + comp_iter: int + comp_op: int + comparison: int + compound_stmt: int + continue_stmt: int + decorated: int + decorator: int + decorators: int + del_stmt: int + dictsetmaker: int + dotted_as_name: int + dotted_as_names: int + dotted_name: int + encoding_decl: int + eval_input: int + except_clause: int + exec_stmt: int + expr: int + expr_stmt: int + exprlist: int + factor: int + file_input: int + flow_stmt: int + for_stmt: int + funcdef: int + global_stmt: int + if_stmt: int + import_as_name: int + import_as_names: int + import_from: int + import_name: int + import_stmt: int + lambdef: int + listmaker: int + not_test: int + old_lambdef: int + old_test: int + or_test: int + parameters: int + pass_stmt: int + power: int + print_stmt: int + raise_stmt: int + return_stmt: int + shift_expr: int + simple_stmt: int + single_input: int + sliceop: int + small_stmt: int + star_expr: int + stmt: int + subscript: int + subscriptlist: int + suite: int + term: int + test: int + testlist: int + testlist1: int + testlist_gexp: int + testlist_safe: int + testlist_star_expr: int + tfpdef: int + tfplist: int + tname: int + trailer: int + try_stmt: int + typedargslist: int + varargslist: int + vfpdef: int + vfplist: int + vname: int + while_stmt: int + with_item: int + with_stmt: int + with_var: int + xor_expr: int + yield_arg: int + yield_expr: int + yield_stmt: int + +class pattern_symbols(Symbols): + Alternative: int + Alternatives: int + Details: int + Matcher: int + NegatedUnit: int + Repeater: int + Unit: int + +python_grammar: Grammar +python_grammar_no_print_statement: Grammar +pattern_grammar: Grammar diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pytree.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pytree.pyi new file mode 100644 index 0000000..06a7c12 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pytree.pyi @@ -0,0 +1,86 @@ +# Stubs for lib2to3.pytree (Python 3.6) + +import sys +from typing import Any, Callable, Dict, Iterator, List, Optional, Text, Tuple, TypeVar, Union + +from lib2to3.pgen2.grammar import Grammar + +_P = TypeVar('_P') +_NL = Union[Node, Leaf] +_Context = Tuple[Text, int, int] +_Results = Dict[Text, _NL] +_RawNode = Tuple[int, Text, _Context, Optional[List[_NL]]] +_Convert = Callable[[Grammar, _RawNode], Any] + +HUGE: int + +def type_repr(type_num: int) -> Text: ... + +class Base: + type: int + parent: Optional[Node] + prefix: Text + children: List[_NL] + was_changed: bool + was_checked: bool + def __eq__(self, other: Any) -> bool: ... + def _eq(self: _P, other: _P) -> bool: ... + def clone(self: _P) -> _P: ... + def post_order(self) -> Iterator[_NL]: ... + def pre_order(self) -> Iterator[_NL]: ... + def replace(self, new: Union[_NL, List[_NL]]) -> None: ... + def get_lineno(self) -> int: ... + def changed(self) -> None: ... + def remove(self) -> Optional[int]: ... + @property + def next_sibling(self) -> Optional[_NL]: ... + @property + def prev_sibling(self) -> Optional[_NL]: ... + def leaves(self) -> Iterator[Leaf]: ... + def depth(self) -> int: ... + def get_suffix(self) -> Text: ... + if sys.version_info < (3,): + def get_prefix(self) -> Text: ... + def set_prefix(self, prefix: Text) -> None: ... + +class Node(Base): + fixers_applied: List[Any] + def __init__(self, type: int, children: List[_NL], context: Optional[Any] = ..., prefix: Optional[Text] = ..., fixers_applied: Optional[List[Any]] = ...) -> None: ... + def set_child(self, i: int, child: _NL) -> None: ... + def insert_child(self, i: int, child: _NL) -> None: ... + def append_child(self, child: _NL) -> None: ... + +class Leaf(Base): + lineno: int + column: int + value: Text + fixers_applied: List[Any] + def __init__(self, type: int, value: Text, context: Optional[_Context] = ..., prefix: Optional[Text] = ..., fixers_applied: List[Any] = ...) -> None: ... + +def convert(gr: Grammar, raw_node: _RawNode) -> _NL: ... + +class BasePattern: + type: int + content: Optional[Text] + name: Optional[Text] + def optimize(self) -> BasePattern: ... # sic, subclasses are free to optimize themselves into different patterns + def match(self, node: _NL, results: Optional[_Results] = ...) -> bool: ... + def match_seq(self, nodes: List[_NL], results: Optional[_Results] = ...) -> bool: ... + def generate_matches(self, nodes: List[_NL]) -> Iterator[Tuple[int, _Results]]: ... + +class LeafPattern(BasePattern): + def __init__(self, type: Optional[int] = ..., content: Optional[Text] = ..., name: Optional[Text] = ...) -> None: ... + +class NodePattern(BasePattern): + wildcards: bool + def __init__(self, type: Optional[int] = ..., content: Optional[Text] = ..., name: Optional[Text] = ...) -> None: ... + +class WildcardPattern(BasePattern): + min: int + max: int + def __init__(self, content: Optional[Text] = ..., min: int = ..., max: int = ..., name: Optional[Text] = ...) -> None: ... + +class NegatedPattern(BasePattern): + def __init__(self, content: Optional[Text] = ...) -> None: ... + +def generate_matches(patterns: List[BasePattern], nodes: List[_NL]) -> Iterator[Tuple[int, _Results]]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/linecache.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/linecache.pyi new file mode 100644 index 0000000..3f35f46 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/linecache.pyi @@ -0,0 +1,12 @@ +import sys +from typing import Any, Dict, List, Optional, Text + +_ModuleGlobals = Dict[str, Any] + +def getline(filename: Text, lineno: int, module_globals: Optional[_ModuleGlobals] = ...) -> str: ... +def clearcache() -> None: ... +def getlines(filename: Text, module_globals: Optional[_ModuleGlobals] = ...) -> List[str]: ... +def checkcache(filename: Optional[Text] = ...) -> None: ... +def updatecache(filename: Text, module_globals: Optional[_ModuleGlobals] = ...) -> List[str]: ... +if sys.version_info >= (3, 5): + def lazycache(filename: Text, module_globals: _ModuleGlobals) -> bool: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/locale.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/locale.pyi new file mode 100644 index 0000000..a0d7383 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/locale.pyi @@ -0,0 +1,113 @@ +# Stubs for locale + +from decimal import Decimal +from typing import Any, Dict, Iterable, List, Mapping, Optional, Sequence, Tuple, Union +import sys + +# workaround for mypy#2010 +if sys.version_info < (3,): + from __builtin__ import str as _str +else: + from builtins import str as _str + +CODESET: int +D_T_FMT: int +D_FMT: int +T_FMT: int +T_FMT_AMPM: int + +DAY_1: int +DAY_2: int +DAY_3: int +DAY_4: int +DAY_5: int +DAY_6: int +DAY_7: int +ABDAY_1: int +ABDAY_2: int +ABDAY_3: int +ABDAY_4: int +ABDAY_5: int +ABDAY_6: int +ABDAY_7: int + +MON_1: int +MON_2: int +MON_3: int +MON_4: int +MON_5: int +MON_6: int +MON_7: int +MON_8: int +MON_9: int +MON_10: int +MON_11: int +MON_12: int +ABMON_1: int +ABMON_2: int +ABMON_3: int +ABMON_4: int +ABMON_5: int +ABMON_6: int +ABMON_7: int +ABMON_8: int +ABMON_9: int +ABMON_10: int +ABMON_11: int +ABMON_12: int + +RADIXCHAR: int +THOUSEP: int +YESEXPR: int +NOEXPR: int +CRNCYSTR: int + +ERA: int +ERA_D_T_FMT: int +ERA_D_FMT: int +ERA_T_FMT: int + +ALT_DIGITS: int + +LC_CTYPE: int +LC_COLLATE: int +LC_TIME: int +LC_MONETARY: int +LC_MESSAGES: int +LC_NUMERIC: int +LC_ALL: int + +CHAR_MAX: int + +class Error(Exception): ... + +def setlocale(category: int, + locale: Union[_str, Iterable[_str], None] = ...) -> _str: ... +def localeconv() -> Mapping[_str, Union[int, _str, List[int]]]: ... +def nl_langinfo(option: int) -> _str: ... +def getdefaultlocale(envvars: Tuple[_str, ...] = ...) -> Tuple[Optional[_str], Optional[_str]]: ... +def getlocale(category: int = ...) -> Sequence[_str]: ... +def getpreferredencoding(do_setlocale: bool = ...) -> _str: ... +def normalize(localename: _str) -> _str: ... +def resetlocale(category: int = ...) -> None: ... +def strcoll(string1: _str, string2: _str) -> int: ... +def strxfrm(string: _str) -> _str: ... +def format(format: _str, val: Union[float, Decimal], grouping: bool = ..., + monetary: bool = ...) -> _str: ... +if sys.version_info >= (3, 7): + def format_string(format: _str, val: Any, + grouping: bool = ..., monetary: bool = ...) -> _str: ... +else: + def format_string(format: _str, val: Any, + grouping: bool = ...) -> _str: ... +def currency(val: Union[int, float, Decimal], symbol: bool = ..., grouping: bool = ..., + international: bool = ...) -> _str: ... +if sys.version_info >= (3, 5): + def delocalize(string: _str) -> None: ... +def atof(string: _str) -> float: ... +def atoi(string: _str) -> int: ... +def str(float: float) -> _str: ... + +locale_alias: Dict[_str, _str] # undocumented +locale_encoding_alias: Dict[_str, _str] # undocumented +windows_locale: Dict[int, _str] # undocumented diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/logging/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/logging/__init__.pyi new file mode 100644 index 0000000..d736b08 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/logging/__init__.pyi @@ -0,0 +1,433 @@ +# Stubs for logging (Python 3.4) + +from typing import ( + Any, Callable, Dict, Iterable, List, Mapping, MutableMapping, Optional, IO, + Tuple, Text, Union, overload, +) +from string import Template +from time import struct_time +from types import TracebackType, FrameType +import sys +import threading + +_SysExcInfoType = Union[Tuple[type, BaseException, Optional[TracebackType]], + Tuple[None, None, None]] +if sys.version_info >= (3, 5): + _ExcInfoType = Union[None, bool, _SysExcInfoType, BaseException] +else: + _ExcInfoType = Union[None, bool, _SysExcInfoType] +_ArgsType = Union[Tuple[Any, ...], Mapping[str, Any]] +_FilterType = Union[Filter, Callable[[LogRecord], int]] +_Level = Union[int, Text] +if sys.version_info >= (3, 6): + from os import PathLike + _Path = Union[str, PathLike[str]] +else: + _Path = str + +raiseExceptions: bool + +def currentframe() -> FrameType: ... + +if sys.version_info >= (3,): + _levelToName: Dict[int, str] + _nameToLevel: Dict[str, int] +else: + _levelNames: dict + +class Filterer(object): + filters: List[Filter] + def __init__(self) -> None: ... + def addFilter(self, filter: Filter) -> None: ... + def removeFilter(self, filter: Filter) -> None: ... + def filter(self, record: LogRecord) -> bool: ... + +class Logger(Filterer): + name: str + level: int + parent: Union[Logger, PlaceHolder] + propagate: bool + handlers: List[Handler] + disabled: int + def __init__(self, name: str, level: _Level = ...) -> None: ... + def setLevel(self, level: Union[int, str]) -> None: ... + def isEnabledFor(self, lvl: int) -> bool: ... + def getEffectiveLevel(self) -> int: ... + def getChild(self, suffix: str) -> Logger: ... + if sys.version_info >= (3,): + def debug(self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... + def info(self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... + def warning(self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... + def warn(self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... + def error(self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... + def critical(self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... + fatal = critical + def log(self, level: int, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... + def exception(self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... + else: + def debug(self, + msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... + def info(self, + msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... + def warning(self, + msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... + warn = warning + def error(self, + msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... + def critical(self, + msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... + fatal = critical + def log(self, + level: int, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... + def exception(self, + msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... + def addFilter(self, filt: _FilterType) -> None: ... + def removeFilter(self, filt: _FilterType) -> None: ... + def filter(self, record: LogRecord) -> bool: ... + def addHandler(self, hdlr: Handler) -> None: ... + def removeHandler(self, hdlr: Handler) -> None: ... + if sys.version_info >= (3,): + def findCaller(self, stack_info: bool = ...) -> Tuple[str, int, str, Optional[str]]: ... + else: + def findCaller(self) -> Tuple[str, int, str]: ... + def handle(self, record: LogRecord) -> None: ... + if sys.version_info >= (3,): + def makeRecord(self, name: str, lvl: int, fn: str, lno: int, msg: Any, + args: _ArgsType, + exc_info: Optional[_SysExcInfoType], + func: Optional[str] = ..., + extra: Optional[Mapping[str, Any]] = ..., + sinfo: Optional[str] = ...) -> LogRecord: ... + else: + def makeRecord(self, + name: str, lvl: int, fn: str, lno: int, msg: Any, + args: _ArgsType, + exc_info: Optional[_SysExcInfoType], + func: Optional[str] = ..., + extra: Optional[Mapping[str, Any]] = ...) -> LogRecord: ... + if sys.version_info >= (3,): + def hasHandlers(self) -> bool: ... + + +CRITICAL: int +FATAL: int +ERROR: int +WARNING: int +WARN: int +INFO: int +DEBUG: int +NOTSET: int + + +class Handler(Filterer): + level: int # undocumented + formatter: Optional[Formatter] # undocumented + lock: Optional[threading.Lock] # undocumented + name: Optional[str] # undocumented + def __init__(self, level: _Level = ...) -> None: ... + def createLock(self) -> None: ... + def acquire(self) -> None: ... + def release(self) -> None: ... + def setLevel(self, lvl: Union[int, str]) -> None: ... + def setFormatter(self, form: Formatter) -> None: ... + def addFilter(self, filt: _FilterType) -> None: ... + def removeFilter(self, filt: _FilterType) -> None: ... + def filter(self, record: LogRecord) -> bool: ... + def flush(self) -> None: ... + def close(self) -> None: ... + def handle(self, record: LogRecord) -> None: ... + def handleError(self, record: LogRecord) -> None: ... + def format(self, record: LogRecord) -> str: ... + def emit(self, record: LogRecord) -> None: ... + + +class Formatter: + converter: Callable[[Optional[float]], struct_time] + _fmt: Optional[str] + datefmt: Optional[str] + if sys.version_info >= (3,): + _style: PercentStyle + default_time_format: str + default_msec_format: str + + if sys.version_info >= (3,): + def __init__(self, fmt: Optional[str] = ..., + datefmt: Optional[str] = ..., + style: str = ...) -> None: ... + else: + def __init__(self, + fmt: Optional[str] = ..., + datefmt: Optional[str] = ...) -> None: ... + + def format(self, record: LogRecord) -> str: ... + def formatTime(self, record: LogRecord, datefmt: str = ...) -> str: ... + def formatException(self, exc_info: _SysExcInfoType) -> str: ... + if sys.version_info >= (3,): + def formatMessage(self, record: LogRecord) -> str: ... # undocumented + def formatStack(self, stack_info: str) -> str: ... + + +class Filter: + def __init__(self, name: str = ...) -> None: ... + def filter(self, record: LogRecord) -> int: ... + + +class LogRecord: + args: _ArgsType + asctime: str + created: int + exc_info: Optional[_SysExcInfoType] + exc_text: Optional[str] + filename: str + funcName: str + levelname: str + levelno: int + lineno: int + module: str + msecs: int + message: str + msg: str + name: str + pathname: str + process: int + processName: str + relativeCreated: int + if sys.version_info >= (3,): + stack_info: Optional[str] + thread: int + threadName: str + if sys.version_info >= (3,): + def __init__(self, name: str, level: int, pathname: str, lineno: int, + msg: Any, args: _ArgsType, + exc_info: Optional[_SysExcInfoType], + func: Optional[str] = ..., + sinfo: Optional[str] = ...) -> None: ... + else: + def __init__(self, + name: str, level: int, pathname: str, lineno: int, + msg: Any, args: _ArgsType, + exc_info: Optional[_SysExcInfoType], + func: Optional[str] = ...) -> None: ... + def getMessage(self) -> str: ... + + +class LoggerAdapter: + logger: Logger + extra: Mapping[str, Any] + def __init__(self, logger: Logger, extra: Mapping[str, Any]) -> None: ... + def process(self, msg: Any, kwargs: MutableMapping[str, Any]) -> Tuple[Any, MutableMapping[str, Any]]: ... + if sys.version_info >= (3,): + def debug(self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... + def info(self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... + def warning(self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... + def warn(self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... + def error(self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... + def exception(self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... + def critical(self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... + def log(self, level: int, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... + else: + def debug(self, + msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... + def info(self, + msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... + def warning(self, + msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... + def error(self, + msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... + def exception(self, + msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... + def critical(self, + msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... + def log(self, + level: int, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... + def isEnabledFor(self, lvl: int) -> bool: ... + if sys.version_info >= (3,): + def getEffectiveLevel(self) -> int: ... + def setLevel(self, lvl: Union[int, str]) -> None: ... + def hasHandlers(self) -> bool: ... + + +if sys.version_info >= (3,): + def getLogger(name: Optional[str] = ...) -> Logger: ... +else: + @overload + def getLogger() -> Logger: ... + @overload + def getLogger(name: Union[Text, str]) -> Logger: ... +def getLoggerClass() -> type: ... +if sys.version_info >= (3,): + def getLogRecordFactory() -> Callable[..., LogRecord]: ... + +if sys.version_info >= (3,): + def debug(msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... + def info(msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... + def warning(msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... + def warn(msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... + def error(msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... + def critical(msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... + def exception(msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... + def log(level: int, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... +else: + def debug(msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... + def info(msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... + def warning(msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... + warn = warning + def error(msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... + def critical(msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... + def exception(msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... + def log(level: int, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... +fatal = critical + +def disable(lvl: int) -> None: ... +def addLevelName(lvl: int, levelName: str) -> None: ... +def getLevelName(lvl: Union[int, str]) -> Any: ... + +def makeLogRecord(attrdict: Mapping[str, Any]) -> LogRecord: ... + +if sys.version_info >= (3,): + def basicConfig(*, filename: _Path = ..., filemode: str = ..., + format: str = ..., datefmt: str = ..., style: str = ..., + level: _Level = ..., stream: IO[str] = ..., + handlers: Iterable[Handler] = ...) -> None: ... +else: + @overload + def basicConfig() -> None: ... + @overload + def basicConfig(*, filename: str = ..., filemode: str = ..., + format: str = ..., datefmt: str = ..., + level: _Level = ..., stream: IO[str] = ...) -> None: ... +def shutdown() -> None: ... + +def setLoggerClass(klass: type) -> None: ... + +def captureWarnings(capture: bool) -> None: ... + +if sys.version_info >= (3,): + def setLogRecordFactory(factory: Callable[..., LogRecord]) -> None: ... + + +if sys.version_info >= (3,): + lastResort: Optional[StreamHandler] + + +class StreamHandler(Handler): + stream: IO[str] + if sys.version_info >= (3,): + terminator: str + def __init__(self, stream: Optional[IO[str]] = ...) -> None: ... + + +class FileHandler(Handler): + baseFilename: str + mode: str + encoding: Optional[str] + delay: bool + def __init__(self, filename: _Path, mode: str = ..., + encoding: Optional[str] = ..., delay: bool = ...) -> None: ... + + +class NullHandler(Handler): ... + + +class PlaceHolder: + def __init__(self, alogger: Logger) -> None: ... + def append(self, alogger: Logger) -> None: ... + + +# Below aren't in module docs but still visible + +class RootLogger(Logger): ... + +root: RootLogger + + +if sys.version_info >= (3,): + class PercentStyle(object): + default_format: str + asctime_format: str + asctime_search: str + _fmt: str + + def __init__(self, fmt: str) -> None: ... + def usesTime(self) -> bool: ... + def format(self, record: Any) -> str: ... + + class StrFormatStyle(PercentStyle): + ... + + class StringTemplateStyle(PercentStyle): + _tpl: Template + + _STYLES: Dict[str, Tuple[PercentStyle, str]] + + +BASIC_FORMAT: str diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/logging/config.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/logging/config.pyi new file mode 100644 index 0000000..c8dbfdf --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/logging/config.pyi @@ -0,0 +1,33 @@ +# Stubs for logging.config (Python 3.4) + +from typing import Any, Callable, Dict, Optional, IO, Union +from threading import Thread +import sys +if sys.version_info >= (3,): + from configparser import RawConfigParser +else: + from ConfigParser import RawConfigParser +if sys.version_info >= (3, 6): + from os import PathLike + +if sys.version_info >= (3, 7): + _Path = Union[str, bytes, PathLike[str]] +elif sys.version_info >= (3, 6): + _Path = Union[str, PathLike[str]] +else: + _Path = str + + +def dictConfig(config: Dict[str, Any]) -> None: ... +if sys.version_info >= (3, 4): + def fileConfig(fname: Union[_Path, IO[str], RawConfigParser], + defaults: Optional[Dict[str, str]] = ..., + disable_existing_loggers: bool = ...) -> None: ... + def listen(port: int = ..., + verify: Optional[Callable[[bytes], Optional[bytes]]] = ...) -> Thread: ... +else: + def fileConfig(fname: Union[str, IO[str]], + defaults: Optional[Dict[str, str]] = ..., + disable_existing_loggers: bool = ...) -> None: ... + def listen(port: int = ...) -> Thread: ... +def stopListening() -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/logging/handlers.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/logging/handlers.pyi new file mode 100644 index 0000000..c18ddcc --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/logging/handlers.pyi @@ -0,0 +1,213 @@ +# Stubs for logging.handlers (Python 2.4) + +import datetime +from logging import Handler, FileHandler, LogRecord +from socket import SocketType +import ssl +import sys +from typing import Any, Callable, Dict, List, Optional, Tuple, Union, overload +if sys.version_info >= (3,): + from queue import Queue +else: + from Queue import Queue + +# TODO update socket stubs to add SocketKind +_SocketKind = int +if sys.version_info >= (3, 6): + from os import PathLike + _Path = Union[str, PathLike[str]] +else: + _Path = str + +DEFAULT_TCP_LOGGING_PORT: int +DEFAULT_UDP_LOGGING_PORT: int +DEFAULT_HTTP_LOGGING_PORT: int +DEFAULT_SOAP_LOGGING_PORT: int +SYSLOG_UDP_PORT: int +SYSLOG_TCP_PORT: int + +class WatchedFileHandler(FileHandler): + @overload + def __init__(self, filename: _Path) -> None: ... + @overload + def __init__(self, filename: _Path, mode: str) -> None: ... + @overload + def __init__(self, filename: _Path, mode: str, + encoding: Optional[str]) -> None: ... + @overload + def __init__(self, filename: _Path, mode: str, encoding: Optional[str], + delay: bool) -> None: ... + + +if sys.version_info >= (3,): + class BaseRotatingHandler(FileHandler): + terminator: str + namer: Optional[Callable[[str], str]] + rotator: Optional[Callable[[str, str], None]] + def __init__(self, filename: _Path, mode: str, + encoding: Optional[str] = ..., + delay: bool = ...) -> None: ... + def rotation_filename(self, default_name: str) -> None: ... + def rotate(self, source: str, dest: str) -> None: ... + + +if sys.version_info >= (3,): + class RotatingFileHandler(BaseRotatingHandler): + def __init__(self, filename: _Path, mode: str = ..., maxBytes: int = ..., + backupCount: int = ..., encoding: Optional[str] = ..., + delay: bool = ...) -> None: ... + def doRollover(self) -> None: ... +else: + class RotatingFileHandler(Handler): + def __init__(self, filename: str, mode: str = ..., maxBytes: int = ..., + backupCount: int = ..., encoding: Optional[str] = ..., + delay: bool = ...) -> None: ... + def doRollover(self) -> None: ... + + +if sys.version_info >= (3,): + class TimedRotatingFileHandler(BaseRotatingHandler): + if sys.version_info >= (3, 4): + def __init__(self, filename: _Path, when: str = ..., + interval: int = ..., + backupCount: int = ..., encoding: Optional[str] = ..., + delay: bool = ..., utc: bool = ..., + atTime: Optional[datetime.datetime] = ...) -> None: ... + else: + def __init__(self, + filename: str, when: str = ..., interval: int = ..., + backupCount: int = ..., encoding: Optional[str] = ..., + delay: bool = ..., utc: bool = ...) -> None: ... + def doRollover(self) -> None: ... +else: + class TimedRotatingFileHandler(Handler): + def __init__(self, + filename: str, when: str = ..., interval: int = ..., + backupCount: int = ..., encoding: Optional[str] = ..., + delay: bool = ..., utc: bool = ...) -> None: ... + def doRollover(self) -> None: ... + + +class SocketHandler(Handler): + retryStart: float + retryFactor: float + retryMax: float + if sys.version_info >= (3, 4): + def __init__(self, host: str, port: Optional[int]) -> None: ... + else: + def __init__(self, host: str, port: int) -> None: ... + def makeSocket(self) -> SocketType: ... + def makePickle(self, record: LogRecord) -> bytes: ... + def send(self, packet: bytes) -> None: ... + def createSocket(self) -> None: ... + + +class DatagramHandler(SocketHandler): ... + + +class SysLogHandler(Handler): + LOG_ALERT: int + LOG_CRIT: int + LOG_DEBUG: int + LOG_EMERG: int + LOG_ERR: int + LOG_INFO: int + LOG_NOTICE: int + LOG_WARNING: int + LOG_AUTH: int + LOG_AUTHPRIV: int + LOG_CRON: int + LOG_DAEMON: int + LOG_FTP: int + LOG_KERN: int + LOG_LPR: int + LOG_MAIL: int + LOG_NEWS: int + LOG_SYSLOG: int + LOG_USER: int + LOG_UUCP: int + LOG_LOCAL0: int + LOG_LOCAL1: int + LOG_LOCAL2: int + LOG_LOCAL3: int + LOG_LOCAL4: int + LOG_LOCAL5: int + LOG_LOCAL6: int + LOG_LOCAL7: int + def __init__(self, address: Union[Tuple[str, int], str] = ..., + facility: int = ..., socktype: _SocketKind = ...) -> None: ... + def encodePriority(self, facility: Union[int, str], + priority: Union[int, str]) -> int: ... + def mapPriority(self, levelName: str) -> str: ... + + +class NTEventLogHandler(Handler): + def __init__(self, appname: str, dllname: str = ..., + logtype: str = ...) -> None: ... + def getEventCategory(self, record: LogRecord) -> int: ... + # TODO correct return value? + def getEventType(self, record: LogRecord) -> int: ... + def getMessageID(self, record: LogRecord) -> int: ... + + +class SMTPHandler(Handler): + # TODO `secure` can also be an empty tuple + if sys.version_info >= (3,): + def __init__(self, mailhost: Union[str, Tuple[str, int]], fromaddr: str, + toaddrs: List[str], subject: str, + credentials: Optional[Tuple[str, str]] = ..., + secure: Union[Tuple[str], Tuple[str, str], None] = ..., + timeout: float = ...) -> None: ... + else: + def __init__(self, + mailhost: Union[str, Tuple[str, int]], fromaddr: str, + toaddrs: List[str], subject: str, + credentials: Optional[Tuple[str, str]] = ..., + secure: Union[Tuple[str], Tuple[str, str], None] = ...) -> None: ... + def getSubject(self, record: LogRecord) -> str: ... + + +class BufferingHandler(Handler): + def __init__(self, capacity: int) -> None: ... + def shouldFlush(self, record: LogRecord) -> bool: ... + +class MemoryHandler(BufferingHandler): + def __init__(self, capacity: int, flushLevel: int = ..., + target: Optional[Handler] = ...) -> None: ... + def setTarget(self, target: Handler) -> None: ... + + +class HTTPHandler(Handler): + if sys.version_info >= (3, 5): + def __init__(self, host: str, url: str, method: str = ..., + secure: bool = ..., + credentials: Optional[Tuple[str, str]] = ..., + context: Optional[ssl.SSLContext] = ...) -> None: ... + elif sys.version_info >= (3,): + def __init__(self, + host: str, url: str, method: str = ..., secure: bool = ..., + credentials: Optional[Tuple[str, str]] = ...) -> None: ... + else: + def __init__(self, + host: str, url: str, method: str = ...) -> None: ... + def mapLogRecord(self, record: LogRecord) -> Dict[str, Any]: ... + + +if sys.version_info >= (3,): + class QueueHandler(Handler): + def __init__(self, queue: Queue) -> None: ... + def prepare(self, record: LogRecord) -> Any: ... + def enqueue(self, record: LogRecord) -> None: ... + + class QueueListener: + if sys.version_info >= (3, 5): + def __init__(self, queue: Queue, *handlers: Handler, + respect_handler_level: bool = ...) -> None: ... + else: + def __init__(self, + queue: Queue, *handlers: Handler) -> None: ... + def dequeue(self, block: bool) -> LogRecord: ... + def prepare(self, record: LogRecord) -> Any: ... + def start(self) -> None: ... + def stop(self) -> None: ... + def enqueue_sentinel(self) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/macpath.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/macpath.pyi new file mode 100644 index 0000000..c0bf576 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/macpath.pyi @@ -0,0 +1,180 @@ +# NB: path.pyi and stdlib/2 and stdlib/3 must remain consistent! +# Stubs for os.path +# Ron Murawski + +import os +import sys +from typing import ( + overload, List, Any, AnyStr, Sequence, Tuple, BinaryIO, TextIO, + TypeVar, Union, Text, Callable, Optional +) + +_T = TypeVar('_T') + +if sys.version_info >= (3, 6): + from builtins import _PathLike + _PathType = Union[bytes, Text, _PathLike] + _StrPath = Union[Text, _PathLike[Text]] + _BytesPath = Union[bytes, _PathLike[bytes]] +else: + _PathType = Union[bytes, Text] + _StrPath = Text + _BytesPath = bytes + +# ----- os.path variables ----- +supports_unicode_filenames: bool +# aliases (also in os) +curdir: str +pardir: str +sep: str +if sys.platform == 'win32': + altsep: str +else: + altsep: Optional[str] +extsep: str +pathsep: str +defpath: str +devnull: str + +# ----- os.path function stubs ----- +if sys.version_info >= (3, 6): + # Overloads are necessary to work around python/mypy#3644. + @overload + def abspath(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def abspath(path: AnyStr) -> AnyStr: ... + @overload + def basename(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def basename(path: AnyStr) -> AnyStr: ... + @overload + def dirname(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def dirname(path: AnyStr) -> AnyStr: ... + @overload + def expanduser(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def expanduser(path: AnyStr) -> AnyStr: ... + @overload + def expandvars(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def expandvars(path: AnyStr) -> AnyStr: ... + @overload + def normcase(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def normcase(path: AnyStr) -> AnyStr: ... + @overload + def normpath(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def normpath(path: AnyStr) -> AnyStr: ... + if sys.platform == 'win32': + @overload + def realpath(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def realpath(path: AnyStr) -> AnyStr: ... + else: + @overload + def realpath(filename: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def realpath(filename: AnyStr) -> AnyStr: ... + +else: + def abspath(path: AnyStr) -> AnyStr: ... + def basename(path: AnyStr) -> AnyStr: ... + def dirname(path: AnyStr) -> AnyStr: ... + def expanduser(path: AnyStr) -> AnyStr: ... + def expandvars(path: AnyStr) -> AnyStr: ... + def normcase(path: AnyStr) -> AnyStr: ... + def normpath(path: AnyStr) -> AnyStr: ... + if sys.platform == 'win32': + def realpath(path: AnyStr) -> AnyStr: ... + else: + def realpath(filename: AnyStr) -> AnyStr: ... + +if sys.version_info >= (3, 6): + # In reality it returns str for sequences of _StrPath and bytes for sequences + # of _BytesPath, but mypy does not accept such a signature. + def commonpath(paths: Sequence[_PathType]) -> Any: ... +elif sys.version_info >= (3, 5): + def commonpath(paths: Sequence[AnyStr]) -> AnyStr: ... + +# NOTE: Empty lists results in '' (str) regardless of contained type. +# Also, in Python 2 mixed sequences of Text and bytes results in either Text or bytes +# So, fall back to Any +def commonprefix(list: Sequence[_PathType]) -> Any: ... + +if sys.version_info >= (3, 3): + def exists(path: Union[_PathType, int]) -> bool: ... +else: + def exists(path: _PathType) -> bool: ... +def lexists(path: _PathType) -> bool: ... + +# These return float if os.stat_float_times() == True, +# but int is a subclass of float. +def getatime(path: _PathType) -> float: ... +def getmtime(path: _PathType) -> float: ... +def getctime(path: _PathType) -> float: ... + +def getsize(path: _PathType) -> int: ... +def isabs(path: _PathType) -> bool: ... +def isfile(path: _PathType) -> bool: ... +def isdir(path: _PathType) -> bool: ... +def islink(path: _PathType) -> bool: ... +def ismount(path: _PathType) -> bool: ... + +if sys.version_info < (3, 0): + # Make sure signatures are disjunct, and allow combinations of bytes and unicode. + # (Since Python 2 allows that, too) + # Note that e.g. os.path.join("a", "b", "c", "d", u"e") will still result in + # a type error. + @overload + def join(__p1: bytes, *p: bytes) -> bytes: ... + @overload + def join(__p1: bytes, __p2: bytes, __p3: bytes, __p4: Text, *p: _PathType) -> Text: ... + @overload + def join(__p1: bytes, __p2: bytes, __p3: Text, *p: _PathType) -> Text: ... + @overload + def join(__p1: bytes, __p2: Text, *p: _PathType) -> Text: ... + @overload + def join(__p1: Text, *p: _PathType) -> Text: ... +elif sys.version_info >= (3, 6): + # Mypy complains that the signatures overlap (same for relpath below), but things seem to behave correctly anyway. + @overload + def join(path: _StrPath, *paths: _StrPath) -> Text: ... + @overload + def join(path: _BytesPath, *paths: _BytesPath) -> bytes: ... +else: + def join(path: AnyStr, *paths: AnyStr) -> AnyStr: ... + +@overload +def relpath(path: _BytesPath, start: Optional[_BytesPath] = ...) -> bytes: ... +@overload +def relpath(path: _StrPath, start: Optional[_StrPath] = ...) -> Text: ... + +def samefile(path1: _PathType, path2: _PathType) -> bool: ... +def sameopenfile(fp1: int, fp2: int) -> bool: ... +def samestat(stat1: os.stat_result, stat2: os.stat_result) -> bool: ... + +if sys.version_info >= (3, 6): + @overload + def split(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... + @overload + def split(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitdrive(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitdrive(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitext(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitext(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... +else: + def split(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + def splitdrive(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + def splitext(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + +if sys.platform == 'win32': + def splitunc(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... # deprecated + +if sys.version_info < (3,): + def walk(path: AnyStr, visit: Callable[[_T, AnyStr, List[AnyStr]], Any], arg: _T) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/marshal.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/marshal.pyi new file mode 100644 index 0000000..6eb3f17 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/marshal.pyi @@ -0,0 +1,8 @@ +from typing import Any, IO + +version: int + +def dump(value: Any, file: IO[Any], version: int = ...) -> None: ... +def load(file: IO[Any]) -> Any: ... +def dumps(value: Any, version: int = ...) -> str: ... +def loads(string: str) -> Any: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/math.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/math.pyi new file mode 100644 index 0000000..25eb1c4 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/math.pyi @@ -0,0 +1,71 @@ +# Stubs for math +# See: http://docs.python.org/2/library/math.html + +from typing import Tuple, Iterable, SupportsFloat, SupportsInt + +import sys + +e: float +pi: float +if sys.version_info >= (3, 5): + inf: float + nan: float +if sys.version_info >= (3, 6): + tau: float + +def acos(x: SupportsFloat) -> float: ... +def acosh(x: SupportsFloat) -> float: ... +def asin(x: SupportsFloat) -> float: ... +def asinh(x: SupportsFloat) -> float: ... +def atan(x: SupportsFloat) -> float: ... +def atan2(y: SupportsFloat, x: SupportsFloat) -> float: ... +def atanh(x: SupportsFloat) -> float: ... +if sys.version_info >= (3,): + def ceil(x: SupportsFloat) -> int: ... +else: + def ceil(x: SupportsFloat) -> float: ... +def copysign(x: SupportsFloat, y: SupportsFloat) -> float: ... +def cos(x: SupportsFloat) -> float: ... +def cosh(x: SupportsFloat) -> float: ... +def degrees(x: SupportsFloat) -> float: ... +def erf(x: SupportsFloat) -> float: ... +def erfc(x: SupportsFloat) -> float: ... +def exp(x: SupportsFloat) -> float: ... +def expm1(x: SupportsFloat) -> float: ... +def fabs(x: SupportsFloat) -> float: ... +def factorial(x: SupportsInt) -> int: ... +if sys.version_info >= (3,): + def floor(x: SupportsFloat) -> int: ... +else: + def floor(x: SupportsFloat) -> float: ... +def fmod(x: SupportsFloat, y: SupportsFloat) -> float: ... +def frexp(x: SupportsFloat) -> Tuple[float, int]: ... +def fsum(iterable: Iterable) -> float: ... +def gamma(x: SupportsFloat) -> float: ... +if sys.version_info >= (3, 5): + def gcd(a: int, b: int) -> int: ... +def hypot(x: SupportsFloat, y: SupportsFloat) -> float: ... +if sys.version_info >= (3, 5): + def isclose(a: SupportsFloat, b: SupportsFloat, rel_tol: SupportsFloat = ..., abs_tol: SupportsFloat = ...) -> bool: ... +def isinf(x: SupportsFloat) -> bool: ... +if sys.version_info >= (3,): + def isfinite(x: SupportsFloat) -> bool: ... +def isnan(x: SupportsFloat) -> bool: ... +def ldexp(x: SupportsFloat, i: int) -> float: ... +def lgamma(x: SupportsFloat) -> float: ... +def log(x: SupportsFloat, base: SupportsFloat = ...) -> float: ... +def log10(x: SupportsFloat) -> float: ... +def log1p(x: SupportsFloat) -> float: ... +if sys.version_info >= (3, 3): + def log2(x: SupportsFloat) -> float: ... +def modf(x: SupportsFloat) -> Tuple[float, float]: ... +def pow(x: SupportsFloat, y: SupportsFloat) -> float: ... +def radians(x: SupportsFloat) -> float: ... +if sys.version_info >= (3, 7): + def remainder(x: SupportsFloat, y: SupportsFloat) -> float: ... +def sin(x: SupportsFloat) -> float: ... +def sinh(x: SupportsFloat) -> float: ... +def sqrt(x: SupportsFloat) -> float: ... +def tan(x: SupportsFloat) -> float: ... +def tanh(x: SupportsFloat) -> float: ... +def trunc(x: SupportsFloat) -> int: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/mimetypes.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/mimetypes.pyi new file mode 100644 index 0000000..eb83027 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/mimetypes.pyi @@ -0,0 +1,38 @@ +# Stubs for mimetypes + +from typing import Dict, IO, List, Optional, Sequence, Text, Tuple +import sys + +def guess_type(url: Text, + strict: bool = ...) -> Tuple[Optional[str], Optional[str]]: ... +def guess_all_extensions(type: str, strict: bool = ...) -> List[str]: ... +def guess_extension(type: str, strict: bool = ...) -> Optional[str]: ... + +def init(files: Optional[Sequence[str]] = ...) -> None: ... +def read_mime_types(filename: str) -> Optional[Dict[str, str]]: ... +def add_type(type: str, ext: str, strict: bool = ...) -> None: ... + +inited: bool +knownfiles: List[str] +suffix_map: Dict[str, str] +encodings_map: Dict[str, str] +types_map: Dict[str, str] +common_types: Dict[str, str] + +class MimeTypes: + suffix_map: Dict[str, str] + encodings_map: Dict[str, str] + types_map: Tuple[Dict[str, str], Dict[str, str]] + types_map_inv: Tuple[Dict[str, str], Dict[str, str]] + def __init__(self, filenames: Tuple[str, ...] = ..., + strict: bool = ...) -> None: ... + def guess_extension(self, type: str, + strict: bool = ...) -> Optional[str]: ... + def guess_type(self, url: str, + strict: bool = ...) -> Tuple[Optional[str], Optional[str]]: ... + def guess_all_extensions(self, type: str, + strict: bool = ...) -> List[str]: ... + def read(self, filename: str, strict: bool = ...) -> None: ... + def readfp(self, fp: IO[str], strict: bool = ...) -> None: ... + if sys.platform == 'win32': + def read_windows_registry(self, strict: bool = ...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/mmap.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/mmap.pyi new file mode 100644 index 0000000..709d5d9 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/mmap.pyi @@ -0,0 +1,73 @@ +import sys +from typing import (Optional, Sequence, Union, Generic, overload, + Iterable, Iterator, Sized, ContextManager, AnyStr) + +ACCESS_DEFAULT: int +ACCESS_READ: int +ACCESS_WRITE: int +ACCESS_COPY: int + +ALLOCATIONGRANULARITY: int + +if sys.platform != 'win32': + MAP_ANON: int + MAP_ANONYMOUS: int + MAP_DENYWRITE: int + MAP_EXECUTABLE: int + MAP_PRIVATE: int + MAP_SHARED: int + PROT_EXEC: int + PROT_READ: int + PROT_WRITE: int + + PAGESIZE: int + +class _mmap(Generic[AnyStr]): + if sys.platform == 'win32': + def __init__(self, fileno: int, length: int, + tagname: Optional[str] = ..., access: int = ..., + offset: int = ...) -> None: ... + else: + def __init__(self, + fileno: int, length: int, flags: int = ..., + prot: int = ..., access: int = ..., + offset: int = ...) -> None: ... + def close(self) -> None: ... + def find(self, sub: AnyStr, + start: int = ..., end: int = ...) -> int: ... + def flush(self, offset: int = ..., size: int = ...) -> int: ... + def move(self, dest: int, src: int, count: int) -> None: ... + def read(self, n: int = ...) -> AnyStr: ... + def read_byte(self) -> AnyStr: ... + def readline(self) -> AnyStr: ... + def resize(self, newsize: int) -> None: ... + def seek(self, pos: int, whence: int = ...) -> None: ... + def size(self) -> int: ... + def tell(self) -> int: ... + def write(self, bytes: AnyStr) -> None: ... + def write_byte(self, byte: AnyStr) -> None: ... + def __len__(self) -> int: ... + +if sys.version_info >= (3,): + class mmap(_mmap, ContextManager[mmap], Iterable[bytes], Sized): + closed: bool + def rfind(self, sub: bytes, start: int = ..., stop: int = ...) -> int: ... + @overload + def __getitem__(self, index: int) -> int: ... + @overload + def __getitem__(self, index: slice) -> bytes: ... + def __delitem__(self, index: Union[int, slice]) -> None: ... + @overload + def __setitem__(self, index: int, object: int) -> None: ... + @overload + def __setitem__(self, index: slice, object: bytes) -> None: ... + # Doesn't actually exist, but the object is actually iterable because it has __getitem__ and + # __len__, so we claim that there is also an __iter__ to help type checkers. + def __iter__(self) -> Iterator[bytes]: ... +else: + class mmap(_mmap, Sequence[bytes]): + def rfind(self, string: bytes, start: int = ..., stop: int = ...) -> int: ... + def __getitem__(self, index: Union[int, slice]) -> bytes: ... + def __getslice__(self, i: Optional[int], j: Optional[int]) -> bytes: ... + def __delitem__(self, index: Union[int, slice]) -> None: ... + def __setitem__(self, index: Union[int, slice], object: bytes) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/netrc.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/netrc.pyi new file mode 100644 index 0000000..3ceae88 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/netrc.pyi @@ -0,0 +1,19 @@ +from typing import AnyStr, Dict, List, Optional, Tuple, overload + + +class NetrcParseError(Exception): + filename: Optional[str] + lineno: Optional[int] + msg: str + + +# (login, account, password) tuple +_NetrcTuple = Tuple[str, Optional[str], Optional[str]] + + +class netrc: + hosts: Dict[str, _NetrcTuple] + macros: Dict[str, List[str]] + + def __init__(self, file: str = ...) -> None: ... + def authenticators(self, host: str) -> Optional[_NetrcTuple]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/nis.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/nis.pyi new file mode 100644 index 0000000..87223ca --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/nis.pyi @@ -0,0 +1,10 @@ +import sys +from typing import Dict, List + +if sys.platform != 'win32': + def cat(map: str, domain: str = ...) -> Dict[str, str]: ... + def get_default_domain() -> str: ... + def maps(domain: str = ...) -> List[str]: ... + def match(key: str, map: str, domain: str = ...) -> str: ... + + class error(Exception): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/ntpath.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/ntpath.pyi new file mode 100644 index 0000000..c0bf576 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/ntpath.pyi @@ -0,0 +1,180 @@ +# NB: path.pyi and stdlib/2 and stdlib/3 must remain consistent! +# Stubs for os.path +# Ron Murawski + +import os +import sys +from typing import ( + overload, List, Any, AnyStr, Sequence, Tuple, BinaryIO, TextIO, + TypeVar, Union, Text, Callable, Optional +) + +_T = TypeVar('_T') + +if sys.version_info >= (3, 6): + from builtins import _PathLike + _PathType = Union[bytes, Text, _PathLike] + _StrPath = Union[Text, _PathLike[Text]] + _BytesPath = Union[bytes, _PathLike[bytes]] +else: + _PathType = Union[bytes, Text] + _StrPath = Text + _BytesPath = bytes + +# ----- os.path variables ----- +supports_unicode_filenames: bool +# aliases (also in os) +curdir: str +pardir: str +sep: str +if sys.platform == 'win32': + altsep: str +else: + altsep: Optional[str] +extsep: str +pathsep: str +defpath: str +devnull: str + +# ----- os.path function stubs ----- +if sys.version_info >= (3, 6): + # Overloads are necessary to work around python/mypy#3644. + @overload + def abspath(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def abspath(path: AnyStr) -> AnyStr: ... + @overload + def basename(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def basename(path: AnyStr) -> AnyStr: ... + @overload + def dirname(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def dirname(path: AnyStr) -> AnyStr: ... + @overload + def expanduser(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def expanduser(path: AnyStr) -> AnyStr: ... + @overload + def expandvars(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def expandvars(path: AnyStr) -> AnyStr: ... + @overload + def normcase(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def normcase(path: AnyStr) -> AnyStr: ... + @overload + def normpath(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def normpath(path: AnyStr) -> AnyStr: ... + if sys.platform == 'win32': + @overload + def realpath(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def realpath(path: AnyStr) -> AnyStr: ... + else: + @overload + def realpath(filename: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def realpath(filename: AnyStr) -> AnyStr: ... + +else: + def abspath(path: AnyStr) -> AnyStr: ... + def basename(path: AnyStr) -> AnyStr: ... + def dirname(path: AnyStr) -> AnyStr: ... + def expanduser(path: AnyStr) -> AnyStr: ... + def expandvars(path: AnyStr) -> AnyStr: ... + def normcase(path: AnyStr) -> AnyStr: ... + def normpath(path: AnyStr) -> AnyStr: ... + if sys.platform == 'win32': + def realpath(path: AnyStr) -> AnyStr: ... + else: + def realpath(filename: AnyStr) -> AnyStr: ... + +if sys.version_info >= (3, 6): + # In reality it returns str for sequences of _StrPath and bytes for sequences + # of _BytesPath, but mypy does not accept such a signature. + def commonpath(paths: Sequence[_PathType]) -> Any: ... +elif sys.version_info >= (3, 5): + def commonpath(paths: Sequence[AnyStr]) -> AnyStr: ... + +# NOTE: Empty lists results in '' (str) regardless of contained type. +# Also, in Python 2 mixed sequences of Text and bytes results in either Text or bytes +# So, fall back to Any +def commonprefix(list: Sequence[_PathType]) -> Any: ... + +if sys.version_info >= (3, 3): + def exists(path: Union[_PathType, int]) -> bool: ... +else: + def exists(path: _PathType) -> bool: ... +def lexists(path: _PathType) -> bool: ... + +# These return float if os.stat_float_times() == True, +# but int is a subclass of float. +def getatime(path: _PathType) -> float: ... +def getmtime(path: _PathType) -> float: ... +def getctime(path: _PathType) -> float: ... + +def getsize(path: _PathType) -> int: ... +def isabs(path: _PathType) -> bool: ... +def isfile(path: _PathType) -> bool: ... +def isdir(path: _PathType) -> bool: ... +def islink(path: _PathType) -> bool: ... +def ismount(path: _PathType) -> bool: ... + +if sys.version_info < (3, 0): + # Make sure signatures are disjunct, and allow combinations of bytes and unicode. + # (Since Python 2 allows that, too) + # Note that e.g. os.path.join("a", "b", "c", "d", u"e") will still result in + # a type error. + @overload + def join(__p1: bytes, *p: bytes) -> bytes: ... + @overload + def join(__p1: bytes, __p2: bytes, __p3: bytes, __p4: Text, *p: _PathType) -> Text: ... + @overload + def join(__p1: bytes, __p2: bytes, __p3: Text, *p: _PathType) -> Text: ... + @overload + def join(__p1: bytes, __p2: Text, *p: _PathType) -> Text: ... + @overload + def join(__p1: Text, *p: _PathType) -> Text: ... +elif sys.version_info >= (3, 6): + # Mypy complains that the signatures overlap (same for relpath below), but things seem to behave correctly anyway. + @overload + def join(path: _StrPath, *paths: _StrPath) -> Text: ... + @overload + def join(path: _BytesPath, *paths: _BytesPath) -> bytes: ... +else: + def join(path: AnyStr, *paths: AnyStr) -> AnyStr: ... + +@overload +def relpath(path: _BytesPath, start: Optional[_BytesPath] = ...) -> bytes: ... +@overload +def relpath(path: _StrPath, start: Optional[_StrPath] = ...) -> Text: ... + +def samefile(path1: _PathType, path2: _PathType) -> bool: ... +def sameopenfile(fp1: int, fp2: int) -> bool: ... +def samestat(stat1: os.stat_result, stat2: os.stat_result) -> bool: ... + +if sys.version_info >= (3, 6): + @overload + def split(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... + @overload + def split(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitdrive(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitdrive(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitext(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitext(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... +else: + def split(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + def splitdrive(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + def splitext(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + +if sys.platform == 'win32': + def splitunc(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... # deprecated + +if sys.version_info < (3,): + def walk(path: AnyStr, visit: Callable[[_T, AnyStr, List[AnyStr]], Any], arg: _T) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/numbers.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/numbers.pyi new file mode 100644 index 0000000..50b561c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/numbers.pyi @@ -0,0 +1,140 @@ +# Stubs for numbers (Python 3.5) +# See https://docs.python.org/2.7/library/numbers.html +# and https://docs.python.org/3/library/numbers.html +# +# Note: these stubs are incomplete. The more complex type +# signatures are currently omitted. + +from typing import Any, Optional, SupportsFloat +from abc import ABCMeta, abstractmethod +import sys + +class Number(metaclass=ABCMeta): + @abstractmethod + def __hash__(self) -> int: ... + +class Complex(Number): + @abstractmethod + def __complex__(self) -> complex: ... + if sys.version_info >= (3, 0): + def __bool__(self) -> bool: ... + else: + def __nonzero__(self) -> bool: ... + @property + @abstractmethod + def real(self): ... + @property + @abstractmethod + def imag(self): ... + @abstractmethod + def __add__(self, other): ... + @abstractmethod + def __radd__(self, other): ... + @abstractmethod + def __neg__(self): ... + @abstractmethod + def __pos__(self): ... + def __sub__(self, other): ... + def __rsub__(self, other): ... + @abstractmethod + def __mul__(self, other): ... + @abstractmethod + def __rmul__(self, other): ... + if sys.version_info < (3, 0): + @abstractmethod + def __div__(self, other): ... + @abstractmethod + def __rdiv__(self, other): ... + @abstractmethod + def __truediv__(self, other): ... + @abstractmethod + def __rtruediv__(self, other): ... + @abstractmethod + def __pow__(self, exponent): ... + @abstractmethod + def __rpow__(self, base): ... + def __abs__(self): ... + def conjugate(self): ... + def __eq__(self, other: object) -> bool: ... + if sys.version_info < (3, 0): + def __ne__(self, other: object) -> bool: ... + +class Real(Complex, SupportsFloat): + @abstractmethod + def __float__(self) -> float: ... + @abstractmethod + def __trunc__(self) -> int: ... + if sys.version_info >= (3, 0): + @abstractmethod + def __floor__(self) -> int: ... + @abstractmethod + def __ceil__(self) -> int: ... + @abstractmethod + def __round__(self, ndigits: Optional[int] = ...): ... + def __divmod__(self, other): ... + def __rdivmod__(self, other): ... + @abstractmethod + def __floordiv__(self, other): ... + @abstractmethod + def __rfloordiv__(self, other): ... + @abstractmethod + def __mod__(self, other): ... + @abstractmethod + def __rmod__(self, other): ... + @abstractmethod + def __lt__(self, other) -> bool: ... + @abstractmethod + def __le__(self, other) -> bool: ... + def __complex__(self) -> complex: ... + @property + def real(self): ... + @property + def imag(self): ... + def conjugate(self): ... + +class Rational(Real): + @property + @abstractmethod + def numerator(self) -> int: ... + @property + @abstractmethod + def denominator(self) -> int: ... + def __float__(self) -> float: ... + +class Integral(Rational): + if sys.version_info >= (3, 0): + @abstractmethod + def __int__(self) -> int: ... + else: + @abstractmethod + def __long__(self) -> long: ... + def __index__(self) -> int: ... + @abstractmethod + def __pow__(self, exponent, modulus: Optional[Any] = ...): ... + @abstractmethod + def __lshift__(self, other): ... + @abstractmethod + def __rlshift__(self, other): ... + @abstractmethod + def __rshift__(self, other): ... + @abstractmethod + def __rrshift__(self, other): ... + @abstractmethod + def __and__(self, other): ... + @abstractmethod + def __rand__(self, other): ... + @abstractmethod + def __xor__(self, other): ... + @abstractmethod + def __rxor__(self, other): ... + @abstractmethod + def __or__(self, other): ... + @abstractmethod + def __ror__(self, other): ... + @abstractmethod + def __invert__(self): ... + def __float__(self) -> float: ... + @property + def numerator(self) -> int: ... + @property + def denominator(self) -> int: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/opcode.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/opcode.pyi new file mode 100644 index 0000000..34350e7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/opcode.pyi @@ -0,0 +1,23 @@ +from typing import List, Dict, Optional, Sequence + +import sys + +cmp_op: Sequence[str] +hasconst: List[int] +hasname: List[int] +hasjrel: List[int] +hasjabs: List[int] +haslocal: List[int] +hascompare: List[int] +hasfree: List[int] +opname: List[str] + +opmap: Dict[str, int] +HAVE_ARGUMENT: int +EXTENDED_ARG: int + +if sys.version_info >= (3, 4): + def stack_effect(opcode: int, oparg: Optional[int] = ...) -> int: ... + +if sys.version_info >= (3, 6): + hasnargs: List[int] diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/operator.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/operator.pyi new file mode 100644 index 0000000..eafc37c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/operator.pyi @@ -0,0 +1,227 @@ +# Stubs for operator + +from typing import ( + Any, Callable, Container, Mapping, MutableMapping, MutableSequence, Sequence, SupportsAbs, Tuple, + TypeVar, overload, +) +import sys + + +_T = TypeVar('_T') +_K = TypeVar('_K') +_V = TypeVar('_V') + + +def lt(a: Any, b: Any) -> Any: ... +def le(a: Any, b: Any) -> Any: ... +def eq(a: Any, b: Any) -> Any: ... +def ne(a: Any, b: Any) -> Any: ... +def ge(a: Any, b: Any) -> Any: ... +def gt(a: Any, b: Any) -> Any: ... +def __lt__(a: Any, b: Any) -> Any: ... +def __le__(a: Any, b: Any) -> Any: ... +def __eq__(a: Any, b: Any) -> Any: ... +def __ne__(a: Any, b: Any) -> Any: ... +def __ge__(a: Any, b: Any) -> Any: ... +def __gt__(a: Any, b: Any) -> Any: ... + +def not_(obj: Any) -> bool: ... +def __not__(obj: Any) -> bool: ... + +def truth(x: Any) -> bool: ... + +def is_(a: Any, b: Any) -> bool: ... + +def is_not(a: Any, b: Any) -> bool: ... + +def abs(x: SupportsAbs) -> Any: ... +def __abs__(a: SupportsAbs) -> Any: ... + +def add(a: Any, b: Any) -> Any: ... +def __add__(a: Any, b: Any) -> Any: ... + +def and_(a: Any, b: Any) -> Any: ... +def __and__(a: Any, b: Any) -> Any: ... + +if sys.version_info < (3, ): + def div(a: Any, b: Any) -> Any: ... + def __div__(a: Any, b: Any) -> Any: ... + +def floordiv(a: Any, b: Any) -> Any: ... +def __floordiv__(a: Any, b: Any) -> Any: ... + +def index(a: Any) -> int: ... +def __index__(a: Any) -> int: ... + +def inv(obj: Any) -> Any: ... +def invert(obj: Any) -> Any: ... +def __inv__(obj: Any) -> Any: ... +def __invert__(obj: Any) -> Any: ... + +def lshift(a: Any, b: Any) -> Any: ... +def __lshift__(a: Any, b: Any) -> Any: ... + +def mod(a: Any, b: Any) -> Any: ... +def __mod__(a: Any, b: Any) -> Any: ... + +def mul(a: Any, b: Any) -> Any: ... +def __mul__(a: Any, b: Any) -> Any: ... + +if sys.version_info >= (3, 5): + def matmul(a: Any, b: Any) -> Any: ... + def __matmul__(a: Any, b: Any) -> Any: ... + +def neg(obj: Any) -> Any: ... +def __neg__(obj: Any) -> Any: ... + +def or_(a: Any, b: Any) -> Any: ... +def __or__(a: Any, b: Any) -> Any: ... + +def pos(obj: Any) -> Any: ... +def __pos__(obj: Any) -> Any: ... + +def pow(a: Any, b: Any) -> Any: ... +def __pow__(a: Any, b: Any) -> Any: ... + +def rshift(a: Any, b: Any) -> Any: ... +def __rshift__(a: Any, b: Any) -> Any: ... + +def sub(a: Any, b: Any) -> Any: ... +def __sub__(a: Any, b: Any) -> Any: ... + +def truediv(a: Any, b: Any) -> Any: ... +def __truediv__(a: Any, b: Any) -> Any: ... + +def xor(a: Any, b: Any) -> Any: ... +def __xor__(a: Any, b: Any) -> Any: ... + +def concat(a: Sequence[_T], b: Sequence[_T]) -> Sequence[_T]: ... +def __concat__(a: Sequence[_T], b: Sequence[_T]) -> Sequence[_T]: ... + +def contains(a: Container[Any], b: Any) -> bool: ... +def __contains__(a: Container[Any], b: Any) -> bool: ... + +def countOf(a: Container[Any], b: Any) -> int: ... + +@overload +def delitem(a: MutableSequence[_T], b: int) -> None: ... +@overload +def delitem(a: MutableMapping[_K, _V], b: _K) -> None: ... +@overload +def __delitem__(a: MutableSequence[_T], b: int) -> None: ... +@overload +def __delitem__(a: MutableMapping[_K, _V], b: _K) -> None: ... + +if sys.version_info < (3, ): + def delslice(a: MutableSequence[Any], b: int, c: int) -> None: ... + def __delslice__(a: MutableSequence[Any], b: int, c: int) -> None: ... + +@overload +def getitem(a: Sequence[_T], b: int) -> _T: ... +@overload +def getitem(a: Mapping[_K, _V], b: _K) -> _V: ... +@overload +def __getitem__(a: Sequence[_T], b: int) -> _T: ... +@overload +def __getitem__(a: Mapping[_K, _V], b: _K) -> _V: ... + +if sys.version_info < (3, ): + def getslice(a: Sequence[_T], b: int, c: int) -> Sequence[_T]: ... + def __getslice__(a: Sequence[_T], b: int, c: int) -> Sequence[_T]: ... + +def indexOf(a: Sequence[_T], b: _T) -> int: ... + +if sys.version_info < (3, ): + def repeat(a: Any, b: int) -> Any: ... + def __repeat__(a: Any, b: int) -> Any: ... + +if sys.version_info < (3, ): + def sequenceIncludes(a: Container[Any], b: Any) -> bool: ... + +@overload +def setitem(a: MutableSequence[_T], b: int, c: _T) -> None: ... +@overload +def setitem(a: MutableMapping[_K, _V], b: _K, c: _V) -> None: ... +@overload +def __setitem__(a: MutableSequence[_T], b: int, c: _T) -> None: ... +@overload +def __setitem__(a: MutableMapping[_K, _V], b: _K, c: _V) -> None: ... + +if sys.version_info < (3, ): + def setslice(a: MutableSequence[_T], b: int, c: int, v: Sequence[_T]) -> None: ... + def __setslice__(a: MutableSequence[_T], b: int, c: int, v: Sequence[_T]) -> None: ... + + +if sys.version_info >= (3, 4): + def length_hint(obj: Any, default: int = ...) -> int: ... + +@overload +def attrgetter(attr: str) -> Callable[[Any], Any]: ... +@overload +def attrgetter(*attrs: str) -> Callable[[Any], Tuple[Any, ...]]: ... + +@overload +def itemgetter(item: Any) -> Callable[[Any], Any]: ... +@overload +def itemgetter(*items: Any) -> Callable[[Any], Tuple[Any, ...]]: ... + +def methodcaller(name: str, *args: Any, **kwargs: Any) -> Callable[..., Any]: ... + + +def iadd(a: Any, b: Any) -> Any: ... +def __iadd__(a: Any, b: Any) -> Any: ... + +def iand(a: Any, b: Any) -> Any: ... +def __iand__(a: Any, b: Any) -> Any: ... + +def iconcat(a: Any, b: Any) -> Any: ... +def __iconcat__(a: Any, b: Any) -> Any: ... + +if sys.version_info < (3, ): + def idiv(a: Any, b: Any) -> Any: ... + def __idiv__(a: Any, b: Any) -> Any: ... + +def ifloordiv(a: Any, b: Any) -> Any: ... +def __ifloordiv__(a: Any, b: Any) -> Any: ... + +def ilshift(a: Any, b: Any) -> Any: ... +def __ilshift__(a: Any, b: Any) -> Any: ... + +def imod(a: Any, b: Any) -> Any: ... +def __imod__(a: Any, b: Any) -> Any: ... + +def imul(a: Any, b: Any) -> Any: ... +def __imul__(a: Any, b: Any) -> Any: ... + +if sys.version_info >= (3, 5): + def imatmul(a: Any, b: Any) -> Any: ... + def __imatmul__(a: Any, b: Any) -> Any: ... + +def ior(a: Any, b: Any) -> Any: ... +def __ior__(a: Any, b: Any) -> Any: ... + +def ipow(a: Any, b: Any) -> Any: ... +def __ipow__(a: Any, b: Any) -> Any: ... + +if sys.version_info < (3, ): + def irepeat(a: Any, b: int) -> Any: ... + def __irepeat__(a: Any, b: int) -> Any: ... + +def irshift(a: Any, b: Any) -> Any: ... +def __irshift__(a: Any, b: Any) -> Any: ... + +def isub(a: Any, b: Any) -> Any: ... +def __isub__(a: Any, b: Any) -> Any: ... + +def itruediv(a: Any, b: Any) -> Any: ... +def __itruediv__(a: Any, b: Any) -> Any: ... + +def ixor(a: Any, b: Any) -> Any: ... +def __ixor__(a: Any, b: Any) -> Any: ... + + +if sys.version_info < (3, ): + def isCallable(x: Any) -> bool: ... + def isMappingType(x: Any) -> bool: ... + def isNumberType(x: Any) -> bool: ... + def isSequenceType(x: Any) -> bool: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/optparse.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/optparse.pyi new file mode 100644 index 0000000..9b8b8ea --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/optparse.pyi @@ -0,0 +1,228 @@ +# Generated by pytype, with only minor tweaks. Might be incomplete. +import sys +from typing import Any, AnyStr, Callable, Dict, IO, Iterable, List, Mapping, Optional, Sequence, Tuple, Union + +# See https://groups.google.com/forum/#!topic/python-ideas/gA1gdj3RZ5g +if sys.version_info >= (3,): + _Text = str +else: + _Text = Union[str, unicode] + +NO_DEFAULT: Tuple[_Text, ...] +SUPPRESS_HELP: _Text +SUPPRESS_USAGE: _Text + +def check_builtin(option: Option, opt: Any, value: _Text) -> Any: ... +def check_choice(option: Option, opt: Any, value: _Text) -> Any: ... +if sys.version_info < (3,): + def isbasestring(x: Any) -> bool: ... + +class OptParseError(Exception): + msg: _Text + def __init__(self, msg: _Text) -> None: ... + +class BadOptionError(OptParseError): + opt_str: _Text + def __init__(self, opt_str: _Text) -> None: ... + +class AmbiguousOptionError(BadOptionError): + possibilities: Iterable[_Text] + def __init__(self, opt_str: _Text, possibilities: Sequence[_Text]) -> None: ... + +class OptionError(OptParseError): + msg: _Text + option_id: _Text + def __init__(self, msg: _Text, option: Option) -> None: ... + +class OptionConflictError(OptionError): ... + +class OptionValueError(OptParseError): ... + + +class HelpFormatter: + NO_DEFAULT_VALUE: _Text + _long_opt_fmt: _Text + _short_opt_fmt: _Text + current_indent: int + default_tag: _Text + help_position: Any + help_width: Any + indent_increment: int + level: int + max_help_position: int + option_strings: Dict[Option, _Text] + parser: OptionParser + short_first: Any + width: int + def __init__(self, indent_increment: int, max_help_position: int, width: Optional[int], short_first: int) -> None: ... + def _format__Text(self, _Text: _Text) -> _Text: ... + def dedent(self) -> None: ... + def expand_default(self, option: Option) -> _Text: ... + def format_description(self, description: _Text) -> _Text: ... + def format_epilog(self, epilog) -> _Text: ... + def format_heading(self, heading: Any) -> _Text: ... + def format_option(self, option: OptionParser) -> _Text: ... + def format_option_strings(self, option: OptionParser) -> Any: ... + def format_usage(self, usage: Any) -> _Text: ... + def indent(self) -> None: ... + def set_long_opt_delimiter(self, delim: _Text) -> None: ... + def set_parser(self, parser: OptionParser) -> None: ... + def set_short_opt_delimiter(self, delim: _Text) -> None: ... + def store_option_strings(self, parser: OptionParser) -> None: ... + +class IndentedHelpFormatter(HelpFormatter): + def __init__(self, + indent_increment: int = ..., + max_help_position: int = ..., + width: Optional[int] = ..., + short_first: int = ...) -> None: ... + def format_heading(self, heading: _Text) -> _Text: ... + def format_usage(self, usage: _Text) -> _Text: ... + +class TitledHelpFormatter(HelpFormatter): + def __init__(self, + indent_increment: int = ..., + max_help_position: int = ..., + width: Optional[int] = ..., + short_first: int = ...) -> None: ... + def format_heading(self, heading: _Text) -> _Text: ... + def format_usage(self, usage: _Text) -> _Text: ... + +class Option: + ACTIONS: Tuple[_Text, ...] + ALWAYS_TYPED_ACTIONS: Tuple[_Text, ...] + ATTRS: List[_Text] + CHECK_METHODS: Optional[List[Callable]] + CONST_ACTIONS: Tuple[_Text, ...] + STORE_ACTIONS: Tuple[_Text, ...] + TYPED_ACTIONS: Tuple[_Text, ...] + TYPES: Tuple[_Text, ...] + TYPE_CHECKER: Dict[_Text, Callable] + _long_opts: List[_Text] + _short_opts: List[_Text] + action: _Text + dest: Optional[_Text] + nargs: int + type: Any + def __init__(self, *opts, **attrs) -> None: ... + def _check_action(self) -> None: ... + def _check_callback(self) -> None: ... + def _check_choice(self) -> None: ... + def _check_const(self) -> None: ... + def _check_dest(self) -> None: ... + def _check_nargs(self) -> None: ... + def _check_opt_strings(self, opts: Optional[_Text]) -> Any: ... + def _check_type(self) -> None: ... + def _set_attrs(self, attrs: Dict[_Text, Any]) -> None: ... + def _set_opt_strings(self, opts: _Text) -> None: ... + def check_value(self, opt: Any, value: Any) -> Any: ... + def convert_value(self, opt: Any, value: Any) -> Any: ... + def get_opt_string(self) -> _Text: ... + def process(self, opt: Any, value: Any, values: Any, parser: OptionParser) -> int: ... + def take_action(self, action: _Text, dest: _Text, opt: Any, value: Any, values: Any, parser: OptionParser) -> int: ... + def takes_value(self) -> bool: ... + +make_option = Option + +class OptionContainer: + _long_opt: Dict[_Text, Option] + _short_opt: Dict[_Text, Option] + conflict_handler: _Text + defaults: Dict[_Text, Any] + description: Any + option_class: Any + def __init__(self, option_class: Option, conflict_handler: Any, description: Any) -> None: ... + def _check_conflict(self, option: Any) -> None: ... + def _create_option_mappings(self) -> None: ... + def _share_option_mappings(self, parser: OptionParser) -> None: ... + def add_option(self, *args, **kwargs) -> Any: ... + def add_options(self, option_list: Iterable[Option]) -> None: ... + def destroy(self) -> None: ... + def format_description(self, formatter: Optional[HelpFormatter]) -> Any: ... + def format_help(self, formatter: Optional[HelpFormatter]) -> _Text: ... + def format_option_help(self, formatter: Optional[HelpFormatter]) -> _Text: ... + def get_description(self) -> Any: ... + def get_option(self, opt_str: _Text) -> Optional[Option]: ... + def has_option(self, opt_str: _Text) -> bool: ... + def remove_option(self, opt_str: _Text) -> None: ... + def set_conflict_handler(self, handler: Any) -> None: ... + def set_description(self, description: Any) -> None: ... + +class OptionGroup(OptionContainer): + option_list: List[Option] + parser: OptionParser + title: _Text + def __init__(self, parser: OptionParser, title: _Text, description: Optional[_Text] = ...) -> None: ... + def _create_option_list(self) -> None: ... + def set_title(self, title: _Text) -> None: ... + +class Values: + def __init__(self, defaults: Optional[Mapping[str, Any]] = ...) -> None: ... + def _update(self, dict: Mapping[_Text, Any], mode: Any) -> None: ... + def _update_careful(self, dict: Mapping[_Text, Any]) -> None: ... + def _update_loose(self, dict: Mapping[_Text, Any]) -> None: ... + def ensure_value(self, attr: _Text, value: Any) -> Any: ... + def read_file(self, filename: _Text, mode: _Text) -> None: ... + def read_module(self, modname: _Text, mode: _Text) -> None: ... + def __getattr__(self, name: str) -> Any: ... + def __setattr__(self, name: str, value: Any) -> None: ... + +class OptionParser(OptionContainer): + allow_interspersed_args: bool + epilog: Optional[_Text] + formatter: HelpFormatter + largs: Optional[List[_Text]] + option_groups: List[OptionParser] + option_list: List[Option] + process_default_values: Any + prog: Optional[_Text] + rargs: Optional[List[Any]] + standard_option_list: List[Option] + usage: Optional[_Text] + values: Optional[Values] + version: _Text + def __init__(self, + usage: Optional[_Text] = ..., + option_list: Iterable[Option] = ..., + option_class: Option = ..., + version: Optional[_Text] = ..., + conflict_handler: _Text = ..., + description: Optional[_Text] = ..., + formatter: Optional[HelpFormatter] = ..., + add_help_option: bool = ..., + prog: Optional[_Text] = ..., + epilog: Optional[_Text] = ...) -> None: ... + def _add_help_option(self) -> None: ... + def _add_version_option(self) -> None: ... + def _create_option_list(self) -> None: ... + def _get_all_options(self) -> List[Option]: ... + def _get_args(self, args: Iterable) -> List[Any]: ... + def _init_parsing_state(self) -> None: ... + def _match_long_opt(self, opt: _Text) -> _Text: ... + def _populate_option_list(self, option_list: Iterable[Option], add_help: bool = ...) -> None: ... + def _process_args(self, largs: List, rargs: List, values: Values) -> None: ... + def _process_long_opt(self, rargs: List, values: Any) -> None: ... + def _process_short_opts(self, rargs: List, values: Any) -> None: ... + def add_option_group(self, *args, **kwargs) -> OptionParser: ... + def check_values(self, values: Values, args: List[_Text]) -> Tuple[Values, List[_Text]]: ... + def disable_interspersed_args(self) -> None: ... + def enable_interspersed_args(self) -> None: ... + def error(self, msg: _Text) -> None: ... + def exit(self, status: int = ..., msg: Optional[str] = ...) -> None: ... + def expand_prog_name(self, s: Optional[_Text]) -> Any: ... + def format_epilog(self, formatter: HelpFormatter) -> Any: ... + def format_help(self, formatter: Optional[HelpFormatter] = ...) -> _Text: ... + def format_option_help(self, formatter: Optional[HelpFormatter] = ...) -> _Text: ... + def get_default_values(self) -> Values: ... + def get_option_group(self, opt_str: _Text) -> Any: ... + def get_prog_name(self) -> _Text: ... + def get_usage(self) -> _Text: ... + def get_version(self) -> _Text: ... + def parse_args(self, args: Optional[Sequence[AnyStr]] = ..., values: Optional[Values] = ...) -> Tuple[Values, List[AnyStr]]: ... + def print_usage(self, file: Optional[IO[str]] = ...) -> None: ... + def print_help(self, file: Optional[IO[str]] = ...) -> None: ... + def print_version(self, file: Optional[IO[str]] = ...) -> None: ... + def set_default(self, dest: Any, value: Any) -> None: ... + def set_defaults(self, **kwargs) -> None: ... + def set_process_default_values(self, process: Any) -> None: ... + def set_usage(self, usage: _Text) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/pdb.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/pdb.pyi new file mode 100644 index 0000000..e403c36 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/pdb.pyi @@ -0,0 +1,62 @@ +# NOTE: This stub is incomplete - only contains some global functions + +from cmd import Cmd +import sys +from types import FrameType +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar + +_T = TypeVar('_T') + +class Restart(Exception): ... + +def run(statement: str, globals: Optional[Dict[str, Any]] = ..., + locals: Optional[Dict[str, Any]] = ...) -> None: ... +def runeval(expression: str, globals: Optional[Dict[str, Any]] = ..., + locals: Optional[Dict[str, Any]] = ...) -> Any: ... +def runctx(statement: str, globals: Dict[str, Any], locals: Dict[str, Any]) -> None: ... +def runcall(*args: Any, **kwds: Any) -> Any: ... + +if sys.version_info >= (3, 7): + def set_trace(*, header: Optional[str] = ...) -> None: ... +else: + def set_trace() -> None: ... + +def post_mortem(t: Optional[Any] = ...) -> None: ... +def pm() -> None: ... + +class Pdb(Cmd): + if sys.version_info >= (3, 6): + def __init__( + self, + completekey: str = ..., + stdin: Optional[IO[str]] = ..., + stdout: Optional[IO[str]] = ..., + skip: Optional[Iterable[str]] = ..., + nosigint: bool = ..., + readrc: bool = ..., + ) -> None: ... + elif sys.version_info >= (3, 2): + def __init__( + self, + completekey: str = ..., + stdin: Optional[IO[str]] = ..., + stdout: Optional[IO[str]] = ..., + skip: Optional[Iterable[str]] = ..., + nosigint: bool = ..., + ) -> None: ... + else: + def __init__( + self, + completekey: str = ..., + stdin: Optional[IO[str]] = ..., + stdout: Optional[IO[str]] = ..., + skip: Optional[Iterable[str]] = ..., + ) -> None: ... + # TODO: The run* and set_trace() methods are actually defined on bdb.Bdb, from which Pdb inherits. + # Move these methods there once we have a bdb stub. + def run(self, statement: str, globals: Optional[Dict[str, Any]] = ..., + locals: Optional[Dict[str, Any]] = ...) -> None: ... + def runeval(self, expression: str, globals: Optional[Dict[str, Any]] = ..., + locals: Optional[Dict[str, Any]] = ...) -> Any: ... + def runcall(self, func: Callable[..., _T], *args: Any, **kwds: Any) -> Optional[_T]: ... + def set_trace(self, frame: Optional[FrameType] = ...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/pickle.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/pickle.pyi new file mode 100644 index 0000000..7bfad8f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/pickle.pyi @@ -0,0 +1,140 @@ +import sys +from typing import Any, IO, Mapping, Union, Tuple, Callable, Optional, Iterator + +HIGHEST_PROTOCOL: int +if sys.version_info >= (3, 0): + DEFAULT_PROTOCOL: int + + +if sys.version_info >= (3, 0): + def dump(obj: Any, file: IO[bytes], protocol: Optional[int] = ..., *, + fix_imports: bool = ...) -> None: ... + def dumps(obj: Any, protocol: Optional[int] = ..., *, + fix_imports: bool = ...) -> bytes: ... + def loads(bytes_object: bytes, *, fix_imports: bool = ..., + encoding: str = ..., errors: str = ...) -> Any: ... + def load(file: IO[bytes], *, fix_imports: bool = ..., encoding: str = ..., + errors: str = ...) -> Any: ... +else: + def dump(obj: Any, file: IO[bytes], protocol: Optional[int] = ...) -> None: ... + def dumps(obj: Any, protocol: Optional[int] = ...) -> bytes: ... + def load(file: IO[bytes]) -> Any: ... + def loads(string: bytes) -> Any: ... + +class PickleError(Exception): ... +class PicklingError(PickleError): ... +class UnpicklingError(PickleError): ... + +_reducedtype = Union[str, + Tuple[Callable[..., Any], Tuple], + Tuple[Callable[..., Any], Tuple, Any], + Tuple[Callable[..., Any], Tuple, Any, + Optional[Iterator]], + Tuple[Callable[..., Any], Tuple, Any, + Optional[Iterator], Optional[Iterator]]] + + +class Pickler: + fast: bool + if sys.version_info >= (3, 3): + dispatch_table: Mapping[type, Callable[[Any], _reducedtype]] + + if sys.version_info >= (3, 0): + def __init__(self, file: IO[bytes], protocol: Optional[int] = ..., *, + fix_imports: bool = ...) -> None: ... + else: + def __init__(self, file: IO[bytes], protocol: Optional[int] = ...) -> None: ... + + def dump(self, obj: Any) -> None: ... + def clear_memo(self) -> None: ... + def persistent_id(self, obj: Any) -> Any: ... + + +class Unpickler: + if sys.version_info >= (3, 0): + def __init__(self, file: IO[bytes], *, fix_imports: bool = ..., + encoding: str = ..., errors: str = ...) -> None: ... + else: + def __init__(self, file: IO[bytes]) -> None: ... + + def load(self) -> Any: ... + def find_class(self, module: str, name: str) -> Any: ... + if sys.version_info >= (3, 0): + def persistent_load(self, pid: Any) -> Any: ... + +MARK: bytes +STOP: bytes +POP: bytes +POP_MARK: bytes +DUP: bytes +FLOAT: bytes +INT: bytes +BININT: bytes +BININT1: bytes +LONG: bytes +BININT2: bytes +NONE: bytes +PERSID: bytes +BINPERSID: bytes +REDUCE: bytes +STRING: bytes +BINSTRING: bytes +SHORT_BINSTRING: bytes +UNICODE: bytes +BINUNICODE: bytes +APPEND: bytes +BUILD: bytes +GLOBAL: bytes +DICT: bytes +EMPTY_DICT: bytes +APPENDS: bytes +GET: bytes +BINGET: bytes +INST: bytes +LONG_BINGET: bytes +LIST: bytes +EMPTY_LIST: bytes +OBJ: bytes +PUT: bytes +BINPUT: bytes +LONG_BINPUT: bytes +SETITEM: bytes +TUPLE: bytes +EMPTY_TUPLE: bytes +SETITEMS: bytes +BINFLOAT: bytes + +TRUE: bytes +FALSE: bytes + +# protocol 2 +PROTO: bytes +NEWOBJ: bytes +EXT1: bytes +EXT2: bytes +EXT4: bytes +TUPLE1: bytes +TUPLE2: bytes +TUPLE3: bytes +NEWTRUE: bytes +NEWFALSE: bytes +LONG1: bytes +LONG4: bytes + +if sys.version_info >= (3, 0): + # protocol 3 + BINBYTES: bytes + SHORT_BINBYTES: bytes + +if sys.version_info >= (3, 4): + # protocol 4 + SHORT_BINUNICODE: bytes + BINUNICODE8: bytes + BINBYTES8: bytes + EMPTY_SET: bytes + ADDITEMS: bytes + FROZENSET: bytes + NEWOBJ_EX: bytes + STACK_GLOBAL: bytes + MEMOIZE: bytes + FRAME: bytes diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/pickletools.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/pickletools.pyi new file mode 100644 index 0000000..c036646 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/pickletools.pyi @@ -0,0 +1,145 @@ +# Stubs for pickletools (Python 2 and 3) +import sys +from typing import Any, Callable, IO, Iterator, List, MutableMapping, Optional, Text, Tuple, Type, Union + +_Reader = Callable[[IO[bytes]], Any] + +if sys.version_info >= (3, 0): + bytes_types: Tuple[Type[Any], ...] + +UP_TO_NEWLINE: int +TAKEN_FROM_ARGUMENT1: int +TAKEN_FROM_ARGUMENT4: int +if sys.version_info >= (3, 3): + TAKEN_FROM_ARGUMENT4U: int +if sys.version_info >= (3, 4): + TAKEN_FROM_ARGUMENT8U: int + +class ArgumentDescriptor(object): + name: str + n: int + reader: _Reader + doc: str + def __init__(self, name: str, n: int, reader: _Reader, doc: str) -> None: ... + +def read_uint1(f: IO[bytes]) -> int: ... +uint1: ArgumentDescriptor + +def read_uint2(f: IO[bytes]) -> int: ... +uint2: ArgumentDescriptor + +def read_int4(f: IO[bytes]) -> int: ... +int4: ArgumentDescriptor + +if sys.version_info >= (3, 3): + def read_uint4(f: IO[bytes]) -> int: ... + uint4: ArgumentDescriptor + +if sys.version_info >= (3, 5): + def read_uint8(f: IO[bytes]) -> int: ... + uint8: ArgumentDescriptor + +def read_stringnl(f: IO[bytes], decode: bool = ..., stripquotes: bool = ...) -> Union[bytes, Text]: ... +stringnl: ArgumentDescriptor + +def read_stringnl_noescape(f: IO[bytes]) -> str: ... +stringnl_noescape: ArgumentDescriptor + +def read_stringnl_noescape_pair(f: IO[bytes]) -> Text: ... +stringnl_noescape_pair: ArgumentDescriptor + +def read_string1(f: IO[bytes]) -> str: ... +string1: ArgumentDescriptor + +def read_string4(f: IO[bytes]) -> str: ... +string4: ArgumentDescriptor + +if sys.version_info >= (3, 3): + def read_bytes1(f: IO[bytes]) -> bytes: ... + bytes1: ArgumentDescriptor + + def read_bytes4(f: IO[bytes]) -> bytes: ... + bytes4: ArgumentDescriptor + +if sys.version_info >= (3, 4): + def read_bytes8(f: IO[bytes]) -> bytes: ... + bytes8: ArgumentDescriptor + +def read_unicodestringnl(f: IO[bytes]) -> Text: ... +unicodestringnl: ArgumentDescriptor + +if sys.version_info >= (3, 4): + def read_unicodestring1(f: IO[bytes]) -> Text: ... + unicodestring1: ArgumentDescriptor + +def read_unicodestring4(f: IO[bytes]) -> Text: ... +unicodestring4: ArgumentDescriptor + +if sys.version_info >= (3, 4): + def read_unicodestring8(f: IO[bytes]) -> Text: ... + unicodestring8: ArgumentDescriptor + +def read_decimalnl_short(f: IO[bytes]) -> int: ... +def read_decimalnl_long(f: IO[bytes]) -> int: ... +decimalnl_short: ArgumentDescriptor +decimalnl_long: ArgumentDescriptor + +def read_floatnl(f: IO[bytes]) -> float: ... +floatnl: ArgumentDescriptor + +def read_float8(f: IO[bytes]) -> float: ... +float8: ArgumentDescriptor + +def read_long1(f: IO[bytes]) -> int: ... +long1: ArgumentDescriptor + +def read_long4(f: IO[bytes]) -> int: ... +long4: ArgumentDescriptor + +class StackObject(object): + name: str + obtype: Union[Type[Any], Tuple[Type[Any], ...]] + doc: str + def __init__(self, name: str, obtype: Union[Type[Any], Tuple[Type[Any], ...]], doc: str) -> None: ... + +pyint: StackObject +pylong: StackObject +pyinteger_or_bool: StackObject +pybool: StackObject +pyfloat: StackObject +if sys.version_info >= (3, 4): + pybytes_or_str: StackObject +pystring: StackObject +if sys.version_info >= (3, 0): + pybytes: StackObject +pyunicode: StackObject +pynone: StackObject +pytuple: StackObject +pylist: StackObject +pydict: StackObject +if sys.version_info >= (3, 4): + pyset: StackObject + pyfrozenset: StackObject +anyobject: StackObject +markobject: StackObject +stackslice: StackObject + +class OpcodeInfo(object): + name: str + code: str + arg: Optional[ArgumentDescriptor] + stack_before: List[StackObject] + stack_after: List[StackObject] + proto: int + doc: str + def __init__(self, name: str, code: str, arg: Optional[ArgumentDescriptor], + stack_before: List[StackObject], stack_after: List[StackObject], proto: int, doc: str) -> None: ... + +opcodes: List[OpcodeInfo] + +def genops(pickle: Union[bytes, IO[bytes]]) -> Iterator[Tuple[OpcodeInfo, Optional[Any], Optional[int]]]: ... +def optimize(p: Union[bytes, IO[bytes]]) -> bytes: ... +if sys.version_info >= (3, 2): + def dis(pickle: Union[bytes, IO[bytes]], out: Optional[IO[str]] = ..., memo: Optional[MutableMapping[int, Any]] = ..., indentlevel: int = ..., annotate: int = ...) -> None: ... +else: + def dis(pickle: Union[bytes, IO[bytes]], out: Optional[IO[str]] = ..., memo: Optional[MutableMapping[int, Any]] = ..., indentlevel: int = ...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/pkgutil.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/pkgutil.pyi new file mode 100644 index 0000000..c7bad42 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/pkgutil.pyi @@ -0,0 +1,35 @@ +# Stubs for pkgutil + +from typing import Any, Callable, Generator, IO, Iterable, Optional, Tuple, NamedTuple +import sys + +if sys.version_info >= (3,): + from importlib.abc import Loader +else: + Loader = Any + +if sys.version_info >= (3, 6): + ModuleInfo = NamedTuple('ModuleInfo', [('module_finder', Any), ('name', str), ('ispkg', bool)]) + _YMFNI = Generator[ModuleInfo, None, None] +else: + _YMFNI = Generator[Tuple[Any, str, bool], None, None] + + +def extend_path(path: Iterable[str], name: str) -> Iterable[str]: ... + +class ImpImporter: + def __init__(self, dirname: Optional[str] = ...) -> None: ... + +class ImpLoader: + def __init__(self, fullname: str, file: IO[str], filename: str, + etc: Tuple[str, str, int]) -> None: ... + +def find_loader(fullname: str) -> Loader: ... +def get_importer(path_item: str) -> Any: ... # TODO precise type +def get_loader(module_or_name: str) -> Loader: ... +def iter_importers(fullname: str = ...) -> Generator[Any, None, None]: ... # TODO precise type +def iter_modules(path: Optional[Iterable[str]] = ..., + prefix: str = ...) -> _YMFNI: ... # TODO precise type +def walk_packages(path: Optional[Iterable[str]] = ..., prefix: str = ..., + onerror: Optional[Callable[[str], None]] = ...) -> _YMFNI: ... +def get_data(package: str, resource: str) -> Optional[bytes]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/plistlib.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/plistlib.pyi new file mode 100644 index 0000000..64201dd --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/plistlib.pyi @@ -0,0 +1,57 @@ +# Stubs for plistlib + +from typing import ( + Any, IO, Mapping, MutableMapping, Optional, Union, + Type, TypeVar, +) +from typing import Dict as DictT +import sys +if sys.version_info >= (3,): + from enum import Enum + + class PlistFormat(Enum): + FMT_XML = ... + FMT_BINARY = ... + FMT_XML = PlistFormat.FMT_XML + FMT_BINARY = PlistFormat.FMT_BINARY + +mm = MutableMapping[str, Any] +_D = TypeVar('_D', bound=mm) +if sys.version_info >= (3,): + _Path = str +else: + _Path = Union[str, unicode] + +if sys.version_info >= (3, 4): + def load(fp: IO[bytes], *, fmt: Optional[PlistFormat] = ..., + use_builtin_types: bool = ..., dict_type: Type[_D] = ...) -> _D: ... + def loads(data: bytes, *, fmt: Optional[PlistFormat] = ..., + use_builtin_types: bool = ..., dict_type: Type[_D] = ...) -> _D: ... + def dump(value: Mapping[str, Any], fp: IO[bytes], *, + fmt: PlistFormat = ..., sort_keys: bool = ..., + skipkeys: bool = ...) -> None: ... + def dumps(value: Mapping[str, Any], *, fmt: PlistFormat = ..., + skipkeys: bool = ..., sort_keys: bool = ...) -> bytes: ... + +def readPlist(pathOrFile: Union[_Path, IO[bytes]]) -> DictT[str, Any]: ... +def writePlist(value: Mapping[str, Any], pathOrFile: Union[_Path, IO[bytes]]) -> None: ... +def readPlistFromBytes(data: bytes) -> DictT[str, Any]: ... +def writePlistToBytes(value: Mapping[str, Any]) -> bytes: ... +if sys.version_info < (3,): + def readPlistFromResource(path: _Path, restype: str = ..., + resid: int = ...) -> DictT[str, Any]: ... + def writePlistToResource(rootObject: Mapping[str, Any], path: _Path, + restype: str = ..., + resid: int = ...) -> None: ... + def readPlistFromString(data: str) -> DictT[str, Any]: ... + def writePlistToString(rootObject: Mapping[str, Any]) -> str: ... + +if sys.version_info < (3, 7): + class Dict(dict): + def __getattr__(self, attr: str) -> Any: ... + def __setattr__(self, attr: str, value: Any) -> None: ... + def __delattr__(self, attr: str) -> None: ... + +class Data: + data: bytes + def __init__(self, data: bytes) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/poplib.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/poplib.pyi new file mode 100644 index 0000000..d2b7dab --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/poplib.pyi @@ -0,0 +1,77 @@ +# Stubs for poplib (Python 2 and 3) + +import socket +import ssl +import sys +from typing import ( + Any, BinaryIO, Dict, List, NoReturn, Optional, overload, Pattern, Text, + Tuple, +) + +_LongResp = Tuple[bytes, List[bytes], int] + +class error_proto(Exception): ... + +POP3_PORT: int +POP3_SSL_PORT: int +CR: bytes +LF: bytes +CRLF: bytes + + +class POP3: + if sys.version_info >= (3, 0): + encoding: Text + + host: Text + port: int + sock: socket.socket + file: BinaryIO + welcome: bytes + + def __init__(self, host: Text, port: int = ..., timeout: float = ...) -> None: ... + def getwelcome(self) -> bytes: ... + def set_debuglevel(self, level: int) -> None: ... + def user(self, user: Text) -> bytes: ... + def pass_(self, pswd: Text) -> bytes: ... + def stat(self) -> Tuple[int, int]: ... + def list(self, which: Optional[Any] = ...) -> _LongResp: ... + def retr(self, which: Any) -> _LongResp: ... + def dele(self, which: Any) -> bytes: ... + def noop(self) -> bytes: ... + def rset(self) -> bytes: ... + def quit(self) -> bytes: ... + def close(self) -> None: ... + def rpop(self, user: Text) -> bytes: ... + + timestamp: Pattern[Text] + + if sys.version_info < (3, 0): + def apop(self, user: Text, secret: Text) -> bytes: ... + else: + def apop(self, user: Text, password: Text) -> bytes: ... + def top(self, which: Any, howmuch: int) -> _LongResp: ... + + @overload + def uidl(self) -> _LongResp: ... + @overload + def uidl(self, which: Any) -> bytes: ... + + if sys.version_info >= (3, 5): + def utf8(self) -> bytes: ... + if sys.version_info >= (3, 4): + def capa(self) -> Dict[Text, List[Text]]: ... + def stls(self, context: Optional[ssl.SSLContext] = ...) -> bytes: ... + + +class POP3_SSL(POP3): + if sys.version_info >= (3, 0): + def __init__(self, host: Text, port: int = ..., keyfile: Optional[Text] = ..., certfile: Optional[Text] = ..., + timeout: float = ..., context: Optional[ssl.SSLContext] = ...) -> None: ... + else: + def __init__(self, host: Text, port: int = ..., keyfile: Optional[Text] = ..., certfile: Optional[Text] = ..., + timeout: float = ...) -> None: ... + + if sys.version_info >= (3, 4): + # "context" is actually the last argument, but that breaks LSP and it doesn't really matter because all the arguments are ignored + def stls(self, context: Any = ..., keyfile: Any = ..., certfile: Any = ...) -> bytes: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/posixpath.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/posixpath.pyi new file mode 100644 index 0000000..c0bf576 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/posixpath.pyi @@ -0,0 +1,180 @@ +# NB: path.pyi and stdlib/2 and stdlib/3 must remain consistent! +# Stubs for os.path +# Ron Murawski + +import os +import sys +from typing import ( + overload, List, Any, AnyStr, Sequence, Tuple, BinaryIO, TextIO, + TypeVar, Union, Text, Callable, Optional +) + +_T = TypeVar('_T') + +if sys.version_info >= (3, 6): + from builtins import _PathLike + _PathType = Union[bytes, Text, _PathLike] + _StrPath = Union[Text, _PathLike[Text]] + _BytesPath = Union[bytes, _PathLike[bytes]] +else: + _PathType = Union[bytes, Text] + _StrPath = Text + _BytesPath = bytes + +# ----- os.path variables ----- +supports_unicode_filenames: bool +# aliases (also in os) +curdir: str +pardir: str +sep: str +if sys.platform == 'win32': + altsep: str +else: + altsep: Optional[str] +extsep: str +pathsep: str +defpath: str +devnull: str + +# ----- os.path function stubs ----- +if sys.version_info >= (3, 6): + # Overloads are necessary to work around python/mypy#3644. + @overload + def abspath(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def abspath(path: AnyStr) -> AnyStr: ... + @overload + def basename(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def basename(path: AnyStr) -> AnyStr: ... + @overload + def dirname(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def dirname(path: AnyStr) -> AnyStr: ... + @overload + def expanduser(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def expanduser(path: AnyStr) -> AnyStr: ... + @overload + def expandvars(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def expandvars(path: AnyStr) -> AnyStr: ... + @overload + def normcase(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def normcase(path: AnyStr) -> AnyStr: ... + @overload + def normpath(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def normpath(path: AnyStr) -> AnyStr: ... + if sys.platform == 'win32': + @overload + def realpath(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def realpath(path: AnyStr) -> AnyStr: ... + else: + @overload + def realpath(filename: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def realpath(filename: AnyStr) -> AnyStr: ... + +else: + def abspath(path: AnyStr) -> AnyStr: ... + def basename(path: AnyStr) -> AnyStr: ... + def dirname(path: AnyStr) -> AnyStr: ... + def expanduser(path: AnyStr) -> AnyStr: ... + def expandvars(path: AnyStr) -> AnyStr: ... + def normcase(path: AnyStr) -> AnyStr: ... + def normpath(path: AnyStr) -> AnyStr: ... + if sys.platform == 'win32': + def realpath(path: AnyStr) -> AnyStr: ... + else: + def realpath(filename: AnyStr) -> AnyStr: ... + +if sys.version_info >= (3, 6): + # In reality it returns str for sequences of _StrPath and bytes for sequences + # of _BytesPath, but mypy does not accept such a signature. + def commonpath(paths: Sequence[_PathType]) -> Any: ... +elif sys.version_info >= (3, 5): + def commonpath(paths: Sequence[AnyStr]) -> AnyStr: ... + +# NOTE: Empty lists results in '' (str) regardless of contained type. +# Also, in Python 2 mixed sequences of Text and bytes results in either Text or bytes +# So, fall back to Any +def commonprefix(list: Sequence[_PathType]) -> Any: ... + +if sys.version_info >= (3, 3): + def exists(path: Union[_PathType, int]) -> bool: ... +else: + def exists(path: _PathType) -> bool: ... +def lexists(path: _PathType) -> bool: ... + +# These return float if os.stat_float_times() == True, +# but int is a subclass of float. +def getatime(path: _PathType) -> float: ... +def getmtime(path: _PathType) -> float: ... +def getctime(path: _PathType) -> float: ... + +def getsize(path: _PathType) -> int: ... +def isabs(path: _PathType) -> bool: ... +def isfile(path: _PathType) -> bool: ... +def isdir(path: _PathType) -> bool: ... +def islink(path: _PathType) -> bool: ... +def ismount(path: _PathType) -> bool: ... + +if sys.version_info < (3, 0): + # Make sure signatures are disjunct, and allow combinations of bytes and unicode. + # (Since Python 2 allows that, too) + # Note that e.g. os.path.join("a", "b", "c", "d", u"e") will still result in + # a type error. + @overload + def join(__p1: bytes, *p: bytes) -> bytes: ... + @overload + def join(__p1: bytes, __p2: bytes, __p3: bytes, __p4: Text, *p: _PathType) -> Text: ... + @overload + def join(__p1: bytes, __p2: bytes, __p3: Text, *p: _PathType) -> Text: ... + @overload + def join(__p1: bytes, __p2: Text, *p: _PathType) -> Text: ... + @overload + def join(__p1: Text, *p: _PathType) -> Text: ... +elif sys.version_info >= (3, 6): + # Mypy complains that the signatures overlap (same for relpath below), but things seem to behave correctly anyway. + @overload + def join(path: _StrPath, *paths: _StrPath) -> Text: ... + @overload + def join(path: _BytesPath, *paths: _BytesPath) -> bytes: ... +else: + def join(path: AnyStr, *paths: AnyStr) -> AnyStr: ... + +@overload +def relpath(path: _BytesPath, start: Optional[_BytesPath] = ...) -> bytes: ... +@overload +def relpath(path: _StrPath, start: Optional[_StrPath] = ...) -> Text: ... + +def samefile(path1: _PathType, path2: _PathType) -> bool: ... +def sameopenfile(fp1: int, fp2: int) -> bool: ... +def samestat(stat1: os.stat_result, stat2: os.stat_result) -> bool: ... + +if sys.version_info >= (3, 6): + @overload + def split(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... + @overload + def split(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitdrive(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitdrive(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitext(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitext(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... +else: + def split(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + def splitdrive(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + def splitext(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + +if sys.platform == 'win32': + def splitunc(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... # deprecated + +if sys.version_info < (3,): + def walk(path: AnyStr, visit: Callable[[_T, AnyStr, List[AnyStr]], Any], arg: _T) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/pprint.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/pprint.pyi new file mode 100644 index 0000000..90a87ab --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/pprint.pyi @@ -0,0 +1,40 @@ +# Stubs for pprint + +# Based on http://docs.python.org/2/library/pprint.html +# Based on http://docs.python.org/3/library/pprint.html + +import sys +from typing import Any, Dict, Tuple, IO + +if sys.version_info >= (3, 4): + def pformat(o: object, indent: int = ..., width: int = ..., + depth: int = ..., compact: bool = ...) -> str: ... +else: + def pformat(o: object, indent: int = ..., width: int = ..., + depth: int = ...) -> str: ... + +if sys.version_info >= (3, 4): + def pprint(o: object, stream: IO[str] = ..., indent: int = ..., width: int = ..., + depth: int = ..., compact: bool = ...) -> None: ... +else: + def pprint(o: object, stream: IO[str] = ..., indent: int = ..., width: int = ..., + depth: int = ...) -> None: ... + +def isreadable(o: object) -> bool: ... +def isrecursive(o: object) -> bool: ... +def saferepr(o: object) -> str: ... + +class PrettyPrinter: + if sys.version_info >= (3, 4): + def __init__(self, indent: int = ..., width: int = ..., depth: int = ..., + stream: IO[str] = ..., compact: bool = ...) -> None: ... + else: + def __init__(self, indent: int = ..., width: int = ..., depth: int = ..., + stream: IO[str] = ...) -> None: ... + + def pformat(self, o: object) -> str: ... + def pprint(self, o: object) -> None: ... + def isreadable(self, o: object) -> bool: ... + def isrecursive(self, o: object) -> bool: ... + def format(self, o: object, context: Dict[int, Any], maxlevels: int, + level: int) -> Tuple[str, bool, bool]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/profile.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/profile.pyi new file mode 100644 index 0000000..31236bb --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/profile.pyi @@ -0,0 +1,27 @@ +import os +import sys +from typing import Any, Callable, Dict, Optional, Text, TypeVar, Union + +def run(statement: str, filename: Optional[str] = ..., sort: Union[str, int] = ...) -> None: ... +def runctx(statement: str, globals: Dict[str, Any], locals: Dict[str, Any], filename: Optional[str] = ..., sort: Union[str, int] = ...) -> None: ... + +_SelfT = TypeVar('_SelfT', bound='Profile') +_T = TypeVar('_T') +if sys.version_info >= (3, 6): + _Path = Union[bytes, Text, os.PathLike[Any]] +else: + _Path = Union[bytes, Text] + +class Profile: + def __init__(self, timer: Optional[Callable[[], float]] = ..., bias: Optional[int] = ...) -> None: ... + def set_cmd(self, cmd: str) -> None: ... + def simulate_call(self, name: str) -> None: ... + def simulate_cmd_complete(self) -> None: ... + def print_stats(self, sort: Union[str, int] = ...) -> None: ... + def dump_stats(self, file: _Path) -> None: ... + def create_stats(self) -> None: ... + def snapshot_stats(self) -> None: ... + def run(self: _SelfT, cmd: str) -> _SelfT: ... + def runctx(self: _SelfT, cmd: str, globals: Dict[str, Any], locals: Dict[str, Any]) -> _SelfT: ... + def runcall(self, func: Callable[..., _T], *args: Any, **kw: Any) -> _T: ... + def calibrate(self, m: int, verbose: int = ...) -> float: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/pstats.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/pstats.pyi new file mode 100644 index 0000000..8bf1b0d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/pstats.pyi @@ -0,0 +1,39 @@ +from profile import Profile +from cProfile import Profile as _cProfile +import os +import sys +from typing import Any, Dict, IO, Iterable, List, Text, Tuple, TypeVar, Union, overload + +_Selector = Union[str, float, int] +_T = TypeVar('_T', bound='Stats') +if sys.version_info >= (3, 6): + _Path = Union[bytes, Text, os.PathLike[Any]] +else: + _Path = Union[bytes, Text] + +class Stats: + def __init__(self: _T, __arg: Union[None, str, Text, Profile, _cProfile] = ..., + *args: Union[None, str, Text, Profile, _cProfile, _T], + stream: IO[Any] = ...) -> None: ... + def init(self, arg: Union[None, str, Text, Profile, _cProfile]) -> None: ... + def load_stats(self, arg: Union[None, str, Text, Profile, _cProfile]) -> None: ... + def get_top_level_stats(self) -> None: ... + def add(self: _T, *arg_list: Union[None, str, Text, Profile, _cProfile, _T]) -> _T: ... + def dump_stats(self, filename: _Path) -> None: ... + def get_sort_arg_defs(self) -> Dict[str, Tuple[Tuple[Tuple[int, int], ...], str]]: ... + @overload + def sort_stats(self: _T, field: int) -> _T: ... + @overload + def sort_stats(self: _T, *field: str) -> _T: ... + def reverse_order(self: _T) -> _T: ... + def strip_dirs(self: _T) -> _T: ... + def calc_callees(self) -> None: ... + def eval_print_amount(self, sel: _Selector, list: List[str], msg: str) -> Tuple[List[str], str]: ... + def get_print_list(self, sel_list: Iterable[_Selector]) -> Tuple[int, List[str]]: ... + def print_stats(self: _T, *amount: _Selector) -> _T: ... + def print_callees(self: _T, *amount: _Selector) -> _T: ... + def print_callers(self: _T, *amount: _Selector) -> _T: ... + def print_call_heading(self, name_size: int, column_title: str) -> None: ... + def print_call_line(self, name_size: int, source: str, call_dict: Dict[str, Any], arrow: str = ...) -> None: ... + def print_title(self) -> None: ... + def print_line(self, func: str) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/pty.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/pty.pyi new file mode 100644 index 0000000..3931bb0 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/pty.pyi @@ -0,0 +1,20 @@ +# Stubs for pty (Python 2 and 3) +import sys +from typing import Callable, Iterable, Tuple, Union + +_Reader = Callable[[int], bytes] + +STDIN_FILENO: int +STDOUT_FILENO: int +STDERR_FILENO: int + +CHILD: int + +def openpty() -> Tuple[int, int]: ... +def master_open() -> Tuple[int, str]: ... +def slave_open(tty_name: str) -> int: ... +def fork() -> Tuple[int, int]: ... +if sys.version_info >= (3, 4): + def spawn(argv: Union[str, Iterable[str]], master_read: _Reader = ..., stdin_read: _Reader = ...) -> int: ... +else: + def spawn(argv: Union[str, Iterable[str]], master_read: _Reader = ..., stdin_read: _Reader = ...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/pwd.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/pwd.pyi new file mode 100644 index 0000000..5bd0bbb --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/pwd.pyi @@ -0,0 +1,13 @@ +from typing import List, NamedTuple + +struct_passwd = NamedTuple("struct_passwd", [("pw_name", str), + ("pw_passwd", str), + ("pw_uid", int), + ("pw_gid", int), + ("pw_gecos", str), + ("pw_dir", str), + ("pw_shell", str)]) + +def getpwall() -> List[struct_passwd]: ... +def getpwuid(uid: int) -> struct_passwd: ... +def getpwnam(name: str) -> struct_passwd: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/py_compile.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/py_compile.pyi new file mode 100644 index 0000000..a8be113 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/py_compile.pyi @@ -0,0 +1,20 @@ +# Stubs for py_compile (Python 2 and 3) +import sys + +from typing import Optional, List, Text, AnyStr, Union + +_EitherStr = Union[bytes, Text] + +class PyCompileError(Exception): + exc_type_name: str + exc_value: BaseException + file: str + msg: str + def __init__(self, exc_type: str, exc_value: BaseException, file: str, msg: str = ...) -> None: ... + +if sys.version_info >= (3, 2): + def compile(file: AnyStr, cfile: Optional[AnyStr] = ..., dfile: Optional[AnyStr] = ..., doraise: bool = ..., optimize: int = ...) -> Optional[AnyStr]: ... +else: + def compile(file: _EitherStr, cfile: Optional[_EitherStr] = ..., dfile: Optional[_EitherStr] = ..., doraise: bool = ...) -> None: ... + +def main(args: Optional[List[Text]] = ...) -> int: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/pyclbr.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/pyclbr.pyi new file mode 100644 index 0000000..efecf32 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/pyclbr.pyi @@ -0,0 +1,40 @@ +from typing import List, Union, Sequence, Optional, Dict + + +class Class: + module: str + name: str + super: Optional[List[Union[Class, str]]] + methods: Dict[str, int] + file: int + lineno: int + + def __init__(self, + module: str, + name: str, + super: Optional[List[Union[Class, str]]], + file: str, + lineno: int) -> None: ... + + +class Function: + module: str + name: str + file: int + lineno: int + + def __init__(self, + module: str, + name: str, + file: str, + lineno: int) -> None: ... + + +def readmodule(module: str, + path: Optional[Sequence[str]] = ... + ) -> Dict[str, Class]: ... + + +def readmodule_ex(module: str, + path: Optional[Sequence[str]] = ... + ) -> Dict[str, Union[Class, Function, List[str]]]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/pydoc.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/pydoc.pyi new file mode 100644 index 0000000..1150741 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/pydoc.pyi @@ -0,0 +1,180 @@ +import sys +from typing import Any, AnyStr, Callable, Container, Dict, IO, List, Mapping, MutableMapping, NoReturn, Optional, Text, Tuple, Type, Union +from types import FunctionType, MethodType, ModuleType, TracebackType +if sys.version_info >= (3,): + from reprlib import Repr +else: + from repr import Repr + +# the return type of sys.exc_info(), used by ErrorDuringImport.__init__ +_Exc_Info = Tuple[Optional[Type[BaseException]], Optional[BaseException], Optional[TracebackType]] + +__author__: str +__date__: str +__version__: str +__credits__: str + +def pathdirs() -> List[str]: ... +def getdoc(object: object) -> Text: ... +def splitdoc(doc: AnyStr) -> Tuple[AnyStr, AnyStr]: ... +def classname(object: object, modname: str) -> str: ... +def isdata(object: object) -> bool: ... +def replace(text: AnyStr, *pairs: AnyStr) -> AnyStr: ... +def cram(text: str, maxlen: int) -> str: ... +def stripid(text: str) -> str: ... +def allmethods(cl: type) -> MutableMapping[str, MethodType]: ... +def visiblename(name: str, all: Optional[Container[str]] = ..., obj: Optional[object] = ...) -> bool: ... +def classify_class_attrs(object: object) -> List[Tuple[str, str, type, str]]: ... + +def ispackage(path: str) -> bool: ... +def source_synopsis(file: IO[AnyStr]) -> Optional[AnyStr]: ... +def synopsis(filename: str, cache: MutableMapping[str, Tuple[int, str]] = ...) -> Optional[str]: ... + +class ErrorDuringImport(Exception): + filename: str + exc: Optional[Type[BaseException]] + value: Optional[BaseException] + tb: Optional[TracebackType] + def __init__(self, filename: str, exc_info: _Exc_Info) -> None: ... + +def importfile(path: str) -> ModuleType: ... +def safeimport(path: str, forceload: bool = ..., cache: MutableMapping[str, ModuleType] = ...) -> ModuleType: ... + +class Doc: + def document(self, object: object, name: Optional[str] = ..., *args: Any) -> str: ... + def fail(self, object: object, name: Optional[str] = ..., *args: Any) -> NoReturn: ... + def docmodule(self, object: object, name: Optional[str] = ..., *args: Any) -> str: ... + def docclass(self, object: object, name: Optional[str] = ..., *args: Any) -> str: ... + def docroutine(self, object: object, name: Optional[str] = ..., *args: Any) -> str: ... + def docother(self, object: object, name: Optional[str] = ..., *args: Any) -> str: ... + def docproperty(self, object: object, name: Optional[str] = ..., *args: Any) -> str: ... + def docdata(self, object: object, name: Optional[str] = ..., *args: Any) -> str: ... + def getdocloc(self, object: object) -> Optional[str]: ... + +class HTMLRepr(Repr): + maxlist: int + maxtuple: int + maxdict: int + maxstring: int + maxother: int + def __init__(self) -> None: ... + def escape(self, text: str) -> str: ... + def repr(self, object: object) -> str: ... + def repr1(self, x: object, level: complex) -> str: ... + def repr_string(self, x: Text, level: complex) -> str: ... + def repr_str(self, x: Text, level: complex) -> str: ... + def repr_instance(self, x: object, level: complex) -> str: ... + def repr_unicode(self, x: AnyStr, level: complex) -> str: ... + +class HTMLDoc(Doc): + def repr(self, object: object) -> str: ... + def escape(self, test: str) -> str: ... + def page(self, title: str, contents: str) -> str: ... + def heading(self, title: str, fgcol: str, bgcol: str, extras: str = ...) -> str: ... + def section(self, title: str, fgcol: str, bgcol: str, contents: str, width: int = ..., prelude: str = ..., marginalia: Optional[str] = ..., gap: str = ...) -> str: ... + def bigsection(self, title: str, *args) -> str: ... + def preformat(self, text: str) -> str: ... + def multicolumn(self, list: List[Any], format: Callable[[Any], str], cols: int = ...) -> str: ... + def grey(self, text: str) -> str: ... + def namelink(self, name: str, *dicts: MutableMapping[str, str]) -> str: ... + def classlink(self, object: object, modname: str) -> str: ... + def modulelink(self, object: object) -> str: ... + def modpkglink(self, data: Tuple[str, str, bool, bool]) -> str: ... + def markup(self, text: str, escape: Optional[Callable[[str], str]] = ..., funcs: Mapping[str, str] = ..., classes: Mapping[str, str] = ..., methods: Mapping[str, str] = ...) -> str: ... + def formattree(self, tree: List[Union[Tuple[type, Tuple[type, ...]], list]], modname: str, parent: Optional[type] = ...) -> str: ... + def docmodule(self, object: object, name: Optional[str] = ..., mod: Optional[str] = ..., *ignored) -> str: ... + def docclass(self, object: object, name: Optional[str] = ..., mod: Optional[str] = ..., funcs: Mapping[str, str] = ..., classes: Mapping[str, str] = ..., *ignored) -> str: ... + def formatvalue(self, object: object) -> str: ... + def docroutine(self, object: object, name: Optional[str] = ..., mod: Optional[str] = ..., funcs: Mapping[str, str] = ..., classes: Mapping[str, str] = ..., methods: Mapping[str, str] = ..., cl: Optional[type] = ..., *ignored) -> str: ... + def docproperty(self, object: object, name: Optional[str] = ..., mod: Optional[str] = ..., cl: Optional[Any] = ..., *ignored) -> str: ... + def docother(self, object: object, name: Optional[str] = ..., mod: Optional[Any] = ..., *ignored) -> str: ... + def docdata(self, object: object, name: Optional[str] = ..., mod: Optional[Any] = ..., cl: Optional[Any] = ..., *ignored) -> str: ... + def index(self, dir: str, shadowed: Optional[MutableMapping[str, bool]] = ...) -> str: ... + +class TextRepr(Repr): + maxlist: int + maxtuple: int + maxdict: int + maxstring: int + maxother: int + def __init__(self) -> None: ... + def repr1(self, x: object, level: complex) -> str: ... + def repr_string(self, x: str, level: complex) -> str: ... + def repr_str(self, x: str, level: complex) -> str: ... + def repr_instance(self, x: object, level: complex) -> str: ... + +class TextDoc(Doc): + def repr(self, object: object) -> str: ... + def bold(self, text: str) -> str: ... + def indent(self, text: str, prefix: str = ...) -> str: ... + def section(self, title: str, contents: str) -> str: ... + def formattree(self, tree: List[Union[Tuple[type, Tuple[type, ...]], list]], modname: str, parent: Optional[type] = ..., prefix: str = ...) -> str: ... + def docmodule(self, object: object, name: Optional[str] = ..., mod: Optional[Any] = ..., *ignored) -> str: ... + def docclass(self, object: object, name: Optional[str] = ..., mod: Optional[str] = ..., *ignored) -> str: ... + def formatvalue(self, object: object) -> str: ... + def docroutine(self, object: object, name: Optional[str] = ..., mod: Optional[str] = ..., cl: Optional[Any] = ..., *ignored) -> str: ... + def docproperty(self, object: object, name: Optional[str] = ..., mod: Optional[Any] = ..., cl: Optional[Any] = ..., *ignored) -> str: ... + def docdata(self, object: object, name: Optional[str] = ..., mod: Optional[str] = ..., cl: Optional[Any] = ..., *ignored) -> str: ... + def docother(self, object: object, name: Optional[str] = ..., mod: Optional[str] = ..., parent: Optional[str] = ..., maxlen: Optional[int] = ..., doc: Optional[Any] = ..., *ignored) -> str: ... + +def pager(text: str) -> None: ... +def getpager() -> Callable[[str], None]: ... +def plain(text: str) -> str: ... +def pipepager(text: str, cmd: str) -> None: ... +def tempfilepager(text: str, cmd: str) -> None: ... +def ttypager(text: str) -> None: ... +def plainpager(text: str) -> None: ... +def describe(thing: Any) -> str: ... +def locate(path: str, forceload: bool = ...) -> object: ... + +text: TextDoc +html: HTMLDoc + +class _OldStyleClass: ... + +def resolve(thing: Union[str, object], forceload: bool = ...) -> Optional[Tuple[object, str]]: ... +def render_doc(thing: Union[str, object], title: str = ..., forceload: bool = ...) -> str: ... +def doc(thing: Union[str, object], title: str = ..., forceload: bool = ...) -> None: ... +def writedoc(thing: Union[str, object], forceload: bool = ...) -> None: ... +def writedocs(dir: str, pkgpath: str = ..., done: Optional[Any] = ...) -> None: ... + +class Helper: + keywords: Dict[str, Union[str, Tuple[str, str]]] + symbols: Dict[str, str] + topics: Dict[str, Union[str, Tuple[str, ...]]] + def __init__(self, input: Optional[IO[str]] = ..., output: Optional[IO[str]] = ...) -> None: ... + input: IO[str] + output: IO[str] + def __call__(self, request: Union[str, Helper, object] = ...) -> None: ... + def interact(self) -> None: ... + def getline(self, prompt: str) -> str: ... + def help(self, request: Any) -> None: ... + def intro(self) -> None: ... + def list(self, items: List[str], columns: int = ..., width: int = ...) -> None: ... + def listkeywords(self) -> None: ... + def listsymbols(self) -> None: ... + def listtopics(self) -> None: ... + def showtopic(self, topic: str, more_xrefs: str = ...) -> None: ... + def showsymbol(self, symbol: str) -> None: ... + def listmodules(self, key: str = ...) -> None: ... + +help: Helper + +# See Python issue #11182: "remove the unused and undocumented pydoc.Scanner class" +# class Scanner: +# roots = ... # type: Any +# state = ... # type: Any +# children = ... # type: Any +# descendp = ... # type: Any +# def __init__(self, roots, children, descendp) -> None: ... +# def next(self): ... + +class ModuleScanner: + quit: bool + def run(self, callback: Callable[[Optional[str], str, str], None], key: Optional[Any] = ..., completer: Optional[Callable[[], None]] = ..., onerror: Optional[Callable] = ...) -> None: ... + +def apropos(key: str) -> None: ... +def serve(port: int, callback: Optional[Callable[[Any], None]] = ..., completer: Optional[Callable[[], None]] = ...) -> None: ... +def gui() -> None: ... +def ispath(x: Any) -> bool: ... +def cli() -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/pyexpat/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/pyexpat/__init__.pyi new file mode 100644 index 0000000..670e561 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/pyexpat/__init__.pyi @@ -0,0 +1,75 @@ +from typing import List, Tuple, Optional, Callable, Any, Protocol, Union, Dict, Text + +import pyexpat.errors as errors +import pyexpat.model as model + +EXPAT_VERSION: str # undocumented +version_info: Tuple[int, int, int] # undocumented +native_encoding: str # undocumented +features: List[Tuple[str, int]] # undocumented + +class ExpatError(Exception): + code: int + lineno: int + offset: int + +error = ExpatError + +class _Reader(Protocol): + def read(self, length: int) -> bytes: ... + +XML_PARAM_ENTITY_PARSING_NEVER: int +XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE: int +XML_PARAM_ENTITY_PARSING_ALWAYS: int + +_Model = Tuple[int, int, Optional[str], tuple] + +class XMLParserType(object): + def Parse(self, data: Union[Text, bytes], isfinal: bool = ...) -> int: ... + def ParseFile(self, file: _Reader) -> int: ... + def SetBase(self, base: Text) -> None: ... + def GetBase(self) -> Optional[str]: ... + def GetInputContext(self) -> Optional[bytes]: ... + def ExternalEntityParserCreate(self, context: Optional[Text], encoding: Text = ...) -> XMLParserType: ... + def SetParamEntityParsing(self, flag: int) -> int: ... + def UseForeignDTD(self, flag: bool = ...) -> None: ... + buffer_size: int + buffer_text: bool + buffer_used: int + namespace_prefixes: bool # undocumented + ordered_attributes: bool + specified_attributes: bool + ErrorByteIndex: int + ErrorCode: int + ErrorColumnNumber: int + ErrorLineNumber: int + CurrentByteIndex: int + CurrentColumnNumber: int + CurrentLineNumber: int + XmlDeclHandler: Optional[Callable[[str, Optional[str], int], Any]] + StartDoctypeDeclHandler: Optional[Callable[[str, Optional[str], Optional[str], bool], Any]] + EndDoctypeDeclHandler: Optional[Callable[[], Any]] + ElementDeclHandler: Optional[Callable[[str, _Model], Any]] + AttlistDeclHandler: Optional[Callable[[str, str, str, Optional[str], bool], Any]] + StartElementHandler: Optional[Union[ + Callable[[str, Dict[str, str]], Any], + Callable[[str, List[str]], Any], + Callable[[str, Union[Dict[str, str]], List[str]], Any]]] + EndElementHandler: Optional[Callable[[str], Any]] + ProcessingInstructionHandler: Optional[Callable[[str, str], Any]] + CharacterDataHandler: Optional[Callable[[str], Any]] + UnparsedEntityDeclHandler: Optional[Callable[[str, Optional[str], str, Optional[str], str], Any]] + EntityDeclHandler: Optional[Callable[[str, bool, Optional[str], Optional[str], str, Optional[str], Optional[str]], Any]] + NotationDeclHandler: Optional[Callable[[str, Optional[str], str, Optional[str]], Any]] + StartNamespaceDeclHandler: Optional[Callable[[str, str], Any]] + EndNamespaceDeclHandler: Optional[Callable[[str], Any]] + CommentHandler: Optional[Callable[[str], Any]] + StartCdataSectionHandler: Optional[Callable[[], Any]] + EndCdataSectionHandler: Optional[Callable[[], Any]] + DefaultHandler: Optional[Callable[[str], Any]] + DefaultHandlerExpand: Optional[Callable[[str], Any]] + NotStandaloneHandler: Optional[Callable[[], int]] + ExternalEntityRefHandler: Optional[Callable[[str, Optional[str], Optional[str], Optional[str]], int]] + +def ErrorString(errno: int) -> str: ... +def ParserCreate(encoding: Optional[Text] = ..., namespace_separator: Optional[Text] = ...) -> XMLParserType: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/pyexpat/errors.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/pyexpat/errors.pyi new file mode 100644 index 0000000..6cde43e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/pyexpat/errors.pyi @@ -0,0 +1,44 @@ +import sys +from typing import Dict + +if sys.version_info >= (3, 2): + codes: Dict[str, int] + messages: Dict[int, str] + +XML_ERROR_ABORTED: str +XML_ERROR_ASYNC_ENTITY: str +XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF: str +XML_ERROR_BAD_CHAR_REF: str +XML_ERROR_BINARY_ENTITY_REF: str +XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING: str +XML_ERROR_DUPLICATE_ATTRIBUTE: str +XML_ERROR_ENTITY_DECLARED_IN_PE: str +XML_ERROR_EXTERNAL_ENTITY_HANDLING: str +XML_ERROR_FEATURE_REQUIRES_XML_DTD: str +XML_ERROR_FINISHED: str +XML_ERROR_INCOMPLETE_PE: str +XML_ERROR_INCORRECT_ENCODING: str +XML_ERROR_INVALID_TOKEN: str +XML_ERROR_JUNK_AFTER_DOC_ELEMENT: str +XML_ERROR_MISPLACED_XML_PI: str +XML_ERROR_NOT_STANDALONE: str +XML_ERROR_NOT_SUSPENDED: str +XML_ERROR_NO_ELEMENTS: str +XML_ERROR_NO_MEMORY: str +XML_ERROR_PARAM_ENTITY_REF: str +XML_ERROR_PARTIAL_CHAR: str +XML_ERROR_PUBLICID: str +XML_ERROR_RECURSIVE_ENTITY_REF: str +XML_ERROR_SUSPENDED: str +XML_ERROR_SUSPEND_PE: str +XML_ERROR_SYNTAX: str +XML_ERROR_TAG_MISMATCH: str +XML_ERROR_TEXT_DECL: str +XML_ERROR_UNBOUND_PREFIX: str +XML_ERROR_UNCLOSED_CDATA_SECTION: str +XML_ERROR_UNCLOSED_TOKEN: str +XML_ERROR_UNDECLARING_PREFIX: str +XML_ERROR_UNDEFINED_ENTITY: str +XML_ERROR_UNEXPECTED_STATE: str +XML_ERROR_UNKNOWN_ENCODING: str +XML_ERROR_XML_DECL: str diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/pyexpat/model.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/pyexpat/model.pyi new file mode 100644 index 0000000..f357cf6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/pyexpat/model.pyi @@ -0,0 +1,11 @@ +XML_CTYPE_ANY: int +XML_CTYPE_CHOICE: int +XML_CTYPE_EMPTY: int +XML_CTYPE_MIXED: int +XML_CTYPE_NAME: int +XML_CTYPE_SEQ: int + +XML_CQUANT_NONE: int +XML_CQUANT_OPT: int +XML_CQUANT_PLUS: int +XML_CQUANT_REP: int diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/quopri.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/quopri.pyi new file mode 100644 index 0000000..2823f8c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/quopri.pyi @@ -0,0 +1,8 @@ +# Stubs for quopri (Python 2 and 3) + +from typing import BinaryIO + +def encode(input: BinaryIO, output: BinaryIO, quotetabs: int, header: int = ...) -> None: ... +def encodestring(s: bytes, quotetabs: int = ..., header: int = ...) -> bytes: ... +def decode(input: BinaryIO, output: BinaryIO, header: int = ...) -> None: ... +def decodestring(s: bytes, header: int = ...) -> bytes: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/readline.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/readline.pyi new file mode 100644 index 0000000..aff2deb --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/readline.pyi @@ -0,0 +1,41 @@ +# Stubs for readline + +from typing import Callable, Optional, Sequence +import sys + +_CompleterT = Optional[Callable[[str, int], Optional[str]]] +_CompDispT = Optional[Callable[[str, Sequence[str], int], None]] + + +def parse_and_bind(string: str) -> None: ... +def read_init_file(filename: str = ...) -> None: ... + +def get_line_buffer() -> str: ... +def insert_text(string: str) -> None: ... +def redisplay() -> None: ... + +def read_history_file(filename: str = ...) -> None: ... +def write_history_file(filename: str = ...) -> None: ... +if sys.version_info >= (3, 5): + def append_history_file(nelements: int, filename: str = ...) -> None: ... +def get_history_length() -> int: ... +def set_history_length(length: int) -> None: ... + +def clear_history() -> None: ... +def get_current_history_length() -> int: ... +def get_history_item(index: int) -> str: ... +def remove_history_item(pos: int) -> None: ... +def replace_history_item(pos: int, line: str) -> None: ... +def add_history(string: str) -> None: ... + +def set_startup_hook(function: Optional[Callable[[], None]] = ...) -> None: ... +def set_pre_input_hook(function: Optional[Callable[[], None]] = ...) -> None: ... + +def set_completer(function: _CompleterT = ...) -> None: ... +def get_completer() -> _CompleterT: ... +def get_completion_type() -> int: ... +def get_begidx() -> int: ... +def get_endidx() -> int: ... +def set_completer_delims(string: str) -> None: ... +def get_completer_delims() -> str: ... +def set_completion_display_matches_hook(function: _CompDispT = ...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/rlcompleter.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/rlcompleter.pyi new file mode 100644 index 0000000..3db9d0c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/rlcompleter.pyi @@ -0,0 +1,14 @@ +# Stubs for rlcompleter + +from typing import Any, Dict, Optional, Union +import sys + +if sys.version_info >= (3,): + _Text = str +else: + _Text = Union[str, unicode] + + +class Completer: + def __init__(self, namespace: Optional[Dict[str, Any]] = ...) -> None: ... + def complete(self, text: _Text, state: int) -> Optional[str]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/sched.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/sched.pyi new file mode 100644 index 0000000..5d5cf33 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/sched.pyi @@ -0,0 +1,27 @@ +import sys +from typing import Any, Callable, Dict, List, NamedTuple, Optional, Text, Tuple + +Event = NamedTuple('Event', [ + ('time', float), + ('priority', Any), + ('action', Callable[..., Any]), + ('argument', Tuple[Any, ...]), + ('kwargs', Dict[Text, Any]), +]) + +class scheduler: + if sys.version_info >= (3, 3): + def __init__(self, timefunc: Callable[[], float] = ..., delayfunc: Callable[[float], None] = ...) -> None: ... + def enterabs(self, time: float, priority: Any, action: Callable[..., Any], argument: Tuple[Any, ...] = ..., kwargs: Dict[str, Any] = ...) -> Event: ... + def enter(self, delay: float, priority: Any, action: Callable[..., Any], argument: Tuple[Any, ...] = ..., kwargs: Dict[str, Any] = ...) -> Event: ... + def run(self, blocking: bool = ...) -> Optional[float]: ... + else: + def __init__(self, timefunc: Callable[[], float], delayfunc: Callable[[float], None]) -> None: ... + def enterabs(self, time: float, priority: Any, action: Callable[..., Any], argument: Tuple[Any, ...]) -> Event: ... + def enter(self, delay: float, priority: Any, action: Callable[..., Any], argument: Tuple[Any, ...]) -> Event: ... + def run(self) -> None: ... + + def cancel(self, event: Event) -> None: ... + def empty(self) -> bool: ... + @property + def queue(self) -> List[Event]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/select.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/select.pyi new file mode 100644 index 0000000..ab9ffc6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/select.pyi @@ -0,0 +1,137 @@ +import sys +from typing import Any, Optional, Sequence, Tuple, Iterable, List, Union + +# When we have protocols, this should change to a protocol with a fileno method +# See https://docs.python.org/3/c-api/file.html#c.PyObject_AsFileDescriptor +_FileDescriptor = Union[int, Any] + +EPOLLERR: int +EPOLLET: int +EPOLLHUP: int +EPOLLIN: int +EPOLLMSG: int +EPOLLONESHOT: int +EPOLLOUT: int +EPOLLPRI: int +EPOLLRDBAND: int +EPOLLRDNORM: int +EPOLLWRBAND: int +EPOLLWRNORM: int +EPOLL_RDHUP: int +KQ_EV_ADD: int +KQ_EV_CLEAR: int +KQ_EV_DELETE: int +KQ_EV_DISABLE: int +KQ_EV_ENABLE: int +KQ_EV_EOF: int +KQ_EV_ERROR: int +KQ_EV_FLAG1: int +KQ_EV_ONESHOT: int +KQ_EV_SYSFLAGS: int +KQ_FILTER_AIO: int +KQ_FILTER_NETDEV: int +KQ_FILTER_PROC: int +KQ_FILTER_READ: int +KQ_FILTER_SIGNAL: int +KQ_FILTER_TIMER: int +KQ_FILTER_VNODE: int +KQ_FILTER_WRITE: int +KQ_NOTE_ATTRIB: int +KQ_NOTE_CHILD: int +KQ_NOTE_DELETE: int +KQ_NOTE_EXEC: int +KQ_NOTE_EXIT: int +KQ_NOTE_EXTEND: int +KQ_NOTE_FORK: int +KQ_NOTE_LINK: int +KQ_NOTE_LINKDOWN: int +KQ_NOTE_LINKINV: int +KQ_NOTE_LINKUP: int +KQ_NOTE_LOWAT: int +KQ_NOTE_PCTRLMASK: int +KQ_NOTE_PDATAMASK: int +KQ_NOTE_RENAME: int +KQ_NOTE_REVOKE: int +KQ_NOTE_TRACK: int +KQ_NOTE_TRACKERR: int +KQ_NOTE_WRITE: int +PIPE_BUF: int +POLLERR: int +POLLHUP: int +POLLIN: int +POLLMSG: int +POLLNVAL: int +POLLOUT: int +POLLPRI: int +POLLRDBAND: int +POLLRDNORM: int +POLLWRBAND: int +POLLWRNORM: int + +class poll: + def __init__(self) -> None: ... + def register(self, fd: _FileDescriptor, eventmask: int = ...) -> None: ... + def modify(self, fd: _FileDescriptor, eventmask: int) -> None: ... + def unregister(self, fd: _FileDescriptor) -> None: ... + def poll(self, timeout: Optional[float] = ...) -> List[Tuple[int, int]]: ... + +def select(rlist: Sequence[Any], wlist: Sequence[Any], xlist: Sequence[Any], + timeout: Optional[float] = ...) -> Tuple[List[Any], + List[Any], + List[Any]]: ... + +if sys.version_info >= (3, 3): + error = OSError +else: + class error(Exception): ... + +# BSD only +class kevent(object): + data: Any + fflags: int + filter: int + flags: int + ident: int + udata: Any + def __init__(self, ident: _FileDescriptor, filter: int = ..., flags: int = ..., fflags: int = ..., data: Any = ..., udata: Any = ...) -> None: ... + +# BSD only +class kqueue(object): + closed: bool + def __init__(self) -> None: ... + def close(self) -> None: ... + def control(self, changelist: Optional[Iterable[kevent]], max_events: int, timeout: float = ...) -> List[kevent]: ... + def fileno(self) -> int: ... + @classmethod + def fromfd(cls, fd: _FileDescriptor) -> kqueue: ... + +# Linux only +class epoll(object): + if sys.version_info >= (3, 3): + def __init__(self, sizehint: int = ..., flags: int = ...) -> None: ... + else: + def __init__(self, sizehint: int = ...) -> None: ... + if sys.version_info >= (3, 4): + def __enter__(self) -> epoll: ... + def __exit__(self, *args: Any) -> None: ... + def close(self) -> None: ... + closed: bool + def fileno(self) -> int: ... + def register(self, fd: _FileDescriptor, eventmask: int = ...) -> None: ... + def modify(self, fd: _FileDescriptor, eventmask: int) -> None: ... + def unregister(self, fd: _FileDescriptor) -> None: ... + def poll(self, timeout: float = ..., maxevents: int = ...) -> List[Tuple[int, int]]: ... + @classmethod + def fromfd(cls, fd: _FileDescriptor) -> epoll: ... + +if sys.version_info >= (3, 3): + # Solaris only + class devpoll: + if sys.version_info >= (3, 4): + def close(self) -> None: ... + closed: bool + def fileno(self) -> int: ... + def register(self, fd: _FileDescriptor, eventmask: int = ...) -> None: ... + def modify(self, fd: _FileDescriptor, eventmask: int = ...) -> None: ... + def unregister(self, fd: _FileDescriptor) -> None: ... + def poll(self, timeout: Optional[float] = ...) -> List[Tuple[int, int]]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/shutil.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/shutil.pyi new file mode 100644 index 0000000..de1f8fc --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/shutil.pyi @@ -0,0 +1,135 @@ +import os +import sys + +# 'bytes' paths are not properly supported: they don't work with all functions, +# sometimes they only work partially (broken exception messages), and the test +# cases don't use them. + +from typing import ( + List, Iterable, Callable, Any, Tuple, Sequence, NamedTuple, IO, + AnyStr, Optional, Union, Set, TypeVar, overload, Type, Protocol, Text +) + +if sys.version_info >= (3, 6): + _Path = Union[str, os.PathLike[str]] + _AnyStr = str + _AnyPath = TypeVar("_AnyPath", str, os.PathLike[str]) + # Return value of some functions that may either return a path-like object that was passed in or + # a string + _PathReturn = Any +elif sys.version_info >= (3,): + _Path = str + _AnyStr = str + _AnyPath = str + _PathReturn = str +else: + _Path = Text + _AnyStr = TypeVar("_AnyStr", str, unicode) + _AnyPath = TypeVar("_AnyPath", str, unicode) + _PathReturn = Type[None] + +if sys.version_info >= (3,): + class Error(OSError): ... + class SameFileError(Error): ... + class SpecialFileError(OSError): ... + class ExecError(OSError): ... + class ReadError(OSError): ... + class RegistryError(Exception): ... +else: + class Error(EnvironmentError): ... + class SpecialFileError(EnvironmentError): ... + class ExecError(EnvironmentError): ... + +_S_co = TypeVar("_S_co", covariant=True) +_S_contra = TypeVar("_S_contra", contravariant=True) + +class _Reader(Protocol[_S_co]): + def read(self, length: int) -> _S_co: ... + +class _Writer(Protocol[_S_contra]): + def write(self, data: _S_contra) -> Any: ... + +def copyfileobj(fsrc: _Reader[AnyStr], fdst: _Writer[AnyStr], + length: int = ...) -> None: ... + +if sys.version_info >= (3,): + def copyfile(src: _Path, dst: _AnyPath, *, + follow_symlinks: bool = ...) -> _AnyPath: ... + def copymode(src: _Path, dst: _Path, *, + follow_symlinks: bool = ...) -> None: ... + def copystat(src: _Path, dst: _Path, *, + follow_symlinks: bool = ...) -> None: ... + def copy(src: _Path, dst: _Path, *, + follow_symlinks: bool = ...) -> _PathReturn: ... + def copy2(src: _Path, dst: _Path, *, + follow_symlinks: bool = ...) -> _PathReturn: ... +else: + def copyfile(src: _Path, dst: _Path) -> None: ... + def copymode(src: _Path, dst: _Path) -> None: ... + def copystat(src: _Path, dst: _Path) -> None: ... + def copy(src: _Path, dst: _Path) -> _PathReturn: ... + def copy2(src: _Path, dst: _Path) -> _PathReturn: ... + +def ignore_patterns(*patterns: _Path) -> Callable[[Any, List[_AnyStr]], Set[_AnyStr]]: ... + +if sys.version_info >= (3,): + _IgnoreFn = Union[None, Callable[[str, List[str]], Iterable[str]], Callable[[_Path, List[str]], Iterable[str]]] + def copytree(src: _Path, dst: _Path, symlinks: bool = ..., + ignore: _IgnoreFn = ..., + copy_function: Callable[[str, str], None] = ..., + ignore_dangling_symlinks: bool = ...) -> _PathReturn: ... +else: + _IgnoreFn = Union[None, Callable[[AnyStr, List[AnyStr]], Iterable[AnyStr]]] + def copytree(src: AnyStr, dst: AnyStr, symlinks: bool = ..., + ignore: _IgnoreFn = ...) -> _PathReturn: ... + +if sys.version_info >= (3,): + @overload + def rmtree(path: bytes, ignore_errors: bool = ..., + onerror: Optional[Callable[[Any, str, Any], Any]] = ...) -> None: ... + @overload + def rmtree(path: _AnyPath, ignore_errors: bool = ..., + onerror: Optional[Callable[[Any, _AnyPath, Any], Any]] = ...) -> None: ... +else: + def rmtree(path: _AnyPath, ignore_errors: bool = ..., + onerror: Optional[Callable[[Any, _AnyPath, Any], Any]] = ...) -> None: ... + +if sys.version_info >= (3, 5): + _CopyFn = Union[Callable[[str, str], None], Callable[[_Path, _Path], None]] + def move(src: _Path, dst: _Path, + copy_function: _CopyFn = ...) -> _PathReturn: ... +else: + def move(src: _Path, dst: _Path) -> _PathReturn: ... + +if sys.version_info >= (3,): + _ntuple_diskusage = NamedTuple('usage', [('total', int), + ('used', int), + ('free', int)]) + def disk_usage(path: _Path) -> _ntuple_diskusage: ... + def chown(path: _Path, user: Optional[str] = ..., + group: Optional[str] = ...) -> None: ... + def which(cmd: _Path, mode: int = ..., + path: Optional[_Path] = ...) -> Optional[str]: ... + +def make_archive(base_name: _AnyStr, format: str, root_dir: Optional[_Path] = ..., + base_dir: Optional[_Path] = ..., verbose: bool = ..., + dry_run: bool = ..., owner: Optional[str] = ..., group: Optional[str] = ..., + logger: Optional[Any] = ...) -> _AnyStr: ... +def get_archive_formats() -> List[Tuple[str, str]]: ... + +def register_archive_format(name: str, function: Callable[..., Any], + extra_args: Optional[Sequence[Union[Tuple[str, Any], List[Any]]]] = ..., + description: str = ...) -> None: ... +def unregister_archive_format(name: str) -> None: ... + +if sys.version_info >= (3,): + # Should be _Path once http://bugs.python.org/issue30218 is fixed + def unpack_archive(filename: str, extract_dir: Optional[_Path] = ..., + format: Optional[str] = ...) -> None: ... + def register_unpack_format(name: str, extensions: List[str], function: Any, + extra_args: Sequence[Tuple[str, Any]] = ..., + description: str = ...) -> None: ... + def unregister_unpack_format(name: str) -> None: ... + def get_unpack_formats() -> List[Tuple[str, List[str], str]]: ... + + def get_terminal_size(fallback: Tuple[int, int] = ...) -> os.terminal_size: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/site.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/site.pyi new file mode 100644 index 0000000..4fdbad8 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/site.pyi @@ -0,0 +1,17 @@ +# Stubs for site + +from typing import List, Iterable, Optional +import sys + +PREFIXES: List[str] +ENABLE_USER_SITE: Optional[bool] +USER_SITE: Optional[str] +USER_BASE: Optional[str] + +if sys.version_info < (3,): + def main() -> None: ... +def addsitedir(sitedir: str, + known_paths: Optional[Iterable[str]] = ...) -> None: ... +def getsitepackages(prefixes: Optional[Iterable[str]] = ...) -> List[str]: ... +def getuserbase() -> str: ... +def getusersitepackages() -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/smtpd.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/smtpd.pyi new file mode 100644 index 0000000..923b8bc --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/smtpd.pyi @@ -0,0 +1,87 @@ +# Stubs for smtpd (Python 2 and 3) +import sys +import socket +import asyncore +import asynchat + +from typing import Any, DefaultDict, List, Optional, Text, Tuple, Type + +_Address = Tuple[str, int] # (host, port) + + +class SMTPChannel(asynchat.async_chat): + COMMAND: int + DATA: int + + if sys.version_info >= (3, 3): + command_size_limits: DefaultDict[str, int] + + if sys.version_info >= (3,): + smtp_server: SMTPServer + conn: socket.socket + addr: Any + received_lines: List[Text] + smtp_state: int + seen_greeting: str + mailfrom: str + rcpttos: List[str] + received_data: str + fqdn: str + peer: str + + command_size_limit: int + data_size_limit: int + + if sys.version_info >= (3, 5): + enable_SMTPUTF8: bool + + if sys.version_info >= (3, 3): + @property + def max_command_size_limit(self) -> int: ... + + if sys.version_info >= (3, 5): + def __init__(self, server: SMTPServer, conn: socket.socket, addr: Any, data_size_limit: int = ..., + map: Optional[asyncore._maptype] = ..., enable_SMTPUTF8: bool = ..., decode_data: bool = ...) -> None: ... + elif sys.version_info >= (3, 4): + def __init__(self, server: SMTPServer, conn: socket.socket, addr: Any, data_size_limit: int = ..., + map: Optional[asyncore._maptype] = ...) -> None: ... + else: + def __init__(self, server: SMTPServer, conn: socket.socket, addr: Any, data_size_limit: int = ...) -> None: ... + def push(self, msg: bytes) -> None: ... + def collect_incoming_data(self, data: bytes) -> None: ... + def found_terminator(self) -> None: ... + def smtp_HELO(self, arg: str) -> None: ... + def smtp_NOOP(self, arg: str) -> None: ... + def smtp_QUIT(self, arg: str) -> None: ... + def smtp_MAIL(self, arg: str) -> None: ... + def smtp_RCPT(self, arg: str) -> None: ... + def smtp_RSET(self, arg: str) -> None: ... + def smtp_DATA(self, arg: str) -> None: ... + if sys.version_info >= (3, 3): + def smtp_EHLO(self, arg: str) -> None: ... + def smtp_HELP(self, arg: str) -> None: ... + def smtp_VRFY(self, arg: str) -> None: ... + def smtp_EXPN(self, arg: str) -> None: ... + +class SMTPServer(asyncore.dispatcher): + channel_class: Type[SMTPChannel] + + data_size_limit: int + enable_SMTPUTF8: bool + + if sys.version_info >= (3, 5): + def __init__(self, localaddr: _Address, remoteaddr: _Address, + data_size_limit: int = ..., map: Optional[asyncore._maptype] = ..., + enable_SMTPUTF8: bool = ..., decode_data: bool = ...) -> None: ... + elif sys.version_info >= (3, 4): + def __init__(self, localaddr: _Address, remoteaddr: _Address, + data_size_limit: int = ..., map: Optional[asyncore._maptype] = ...) -> None: ... + else: + def __init__(self, localaddr: _Address, remoteaddr: _Address, + data_size_limit: int = ...) -> None: ... + def handle_accepted(self, conn: socket.socket, addr: Any) -> None: ... + def process_message(self, peer: _Address, mailfrom: str, rcpttos: List[Text], data: str, **kwargs: Any) -> Optional[str]: ... + +class DebuggingServer(SMTPServer): ... +class PureProxy(SMTPServer): ... +class MailmanProxy(PureProxy): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/sndhdr.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/sndhdr.pyi new file mode 100644 index 0000000..aecd70b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/sndhdr.pyi @@ -0,0 +1,25 @@ +# Stubs for sndhdr (Python 2 and 3) + +import os +import sys +from typing import Any, NamedTuple, Optional, Tuple, Union + +if sys.version_info >= (3, 5): + SndHeaders = NamedTuple('SndHeaders', [ + ('filetype', str), + ('framerate', int), + ('nchannels', int), + ('nframes', int), + ('sampwidth', Union[int, str]), + ]) + _SndHeaders = SndHeaders +else: + _SndHeaders = Tuple[str, int, int, int, Union[int, str]] + +if sys.version_info >= (3, 6): + _Path = Union[str, bytes, os.PathLike[Any]] +else: + _Path = Union[str, bytes] + +def what(filename: _Path) -> Optional[_SndHeaders]: ... +def whathdr(filename: _Path) -> Optional[_SndHeaders]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/socket.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/socket.pyi new file mode 100644 index 0000000..22b2f91 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/socket.pyi @@ -0,0 +1,626 @@ +# Stubs for socket +# Ron Murawski + +# based on: http://docs.python.org/3.2/library/socket.html +# see: http://hg.python.org/cpython/file/3d0686d90f55/Lib/socket.py +# see: http://nullege.com/codes/search/socket +# adapted for Python 2.7 by Michal Pokorny +import sys +from typing import Any, Iterable, Tuple, List, Optional, Union, overload, TypeVar, Text + +_WriteBuffer = Union[bytearray, memoryview] + +# ----- variables and constants ----- + +AF_UNIX: AddressFamily +AF_INET: AddressFamily +AF_INET6: AddressFamily +SOCK_STREAM: SocketKind +SOCK_DGRAM: SocketKind +SOCK_RAW: SocketKind +SOCK_RDM: SocketKind +SOCK_SEQPACKET: SocketKind +SOCK_CLOEXEC: SocketKind +SOCK_NONBLOCK: SocketKind +SOMAXCONN: int +has_ipv6: bool +_GLOBAL_DEFAULT_TIMEOUT: Any +SocketType: Any +SocketIO: Any + +# These are flags that may exist on Python 3.6. Many don't exist on all platforms. +AF_AAL5: AddressFamily +AF_APPLETALK: AddressFamily +AF_ASH: AddressFamily +AF_ATMPVC: AddressFamily +AF_ATMSVC: AddressFamily +AF_AX25: AddressFamily +AF_BLUETOOTH: AddressFamily +AF_BRIDGE: AddressFamily +AF_CAN: AddressFamily +AF_DECnet: AddressFamily +AF_ECONET: AddressFamily +AF_IPX: AddressFamily +AF_IRDA: AddressFamily +AF_KEY: AddressFamily +AF_LLC: AddressFamily +AF_NETBEUI: AddressFamily +AF_NETLINK: AddressFamily +AF_NETROM: AddressFamily +AF_PACKET: AddressFamily +AF_PPPOX: AddressFamily +AF_RDS: AddressFamily +AF_ROSE: AddressFamily +AF_ROUTE: AddressFamily +AF_SECURITY: AddressFamily +AF_SNA: AddressFamily +AF_SYSTEM: AddressFamily +AF_TIPC: AddressFamily +AF_UNSPEC: AddressFamily +AF_WANPIPE: AddressFamily +AF_X25: AddressFamily +AI_ADDRCONFIG: AddressInfo +AI_ALL: AddressInfo +AI_CANONNAME: AddressInfo +AI_DEFAULT: AddressInfo +AI_MASK: AddressInfo +AI_NUMERICHOST: AddressInfo +AI_NUMERICSERV: AddressInfo +AI_PASSIVE: AddressInfo +AI_V4MAPPED: AddressInfo +AI_V4MAPPED_CFG: AddressInfo +BDADDR_ANY: str +BDADDR_LOCAL: str +BTPROTO_HCI: int +BTPROTO_L2CAP: int +BTPROTO_RFCOMM: int +BTPROTO_SCO: int +CAN_EFF_FLAG: int +CAN_EFF_MASK: int +CAN_ERR_FLAG: int +CAN_ERR_MASK: int +CAN_RAW: int +CAN_RAW_ERR_FILTER: int +CAN_RAW_FILTER: int +CAN_RAW_LOOPBACK: int +CAN_RAW_RECV_OWN_MSGS: int +CAN_RTR_FLAG: int +CAN_SFF_MASK: int +CAPI: int +EAGAIN: int +EAI_ADDRFAMILY: int +EAI_AGAIN: int +EAI_BADFLAGS: int +EAI_BADHINTS: int +EAI_FAIL: int +EAI_FAMILY: int +EAI_MAX: int +EAI_MEMORY: int +EAI_NODATA: int +EAI_NONAME: int +EAI_OVERFLOW: int +EAI_PROTOCOL: int +EAI_SERVICE: int +EAI_SOCKTYPE: int +EAI_SYSTEM: int +EBADF: int +EINTR: int +EWOULDBLOCK: int +HCI_DATA_DIR: int +HCI_FILTER: int +HCI_TIME_STAMP: int +INADDR_ALLHOSTS_GROUP: int +INADDR_ANY: int +INADDR_BROADCAST: int +INADDR_LOOPBACK: int +INADDR_MAX_LOCAL_GROUP: int +INADDR_NONE: int +INADDR_UNSPEC_GROUP: int +IPPORT_RESERVED: int +IPPORT_USERRESERVED: int +IPPROTO_AH: int +IPPROTO_BIP: int +IPPROTO_DSTOPTS: int +IPPROTO_EGP: int +IPPROTO_EON: int +IPPROTO_ESP: int +IPPROTO_FRAGMENT: int +IPPROTO_GGP: int +IPPROTO_GRE: int +IPPROTO_HELLO: int +IPPROTO_HOPOPTS: int +IPPROTO_ICMP: int +IPPROTO_ICMPV6: int +IPPROTO_IDP: int +IPPROTO_IGMP: int +IPPROTO_IP: int +IPPROTO_IPCOMP: int +IPPROTO_IPIP: int +IPPROTO_IPV4: int +IPPROTO_IPV6: int +IPPROTO_MAX: int +IPPROTO_MOBILE: int +IPPROTO_ND: int +IPPROTO_NONE: int +IPPROTO_PIM: int +IPPROTO_PUP: int +IPPROTO_RAW: int +IPPROTO_ROUTING: int +IPPROTO_RSVP: int +IPPROTO_SCTP: int +IPPROTO_TCP: int +IPPROTO_TP: int +IPPROTO_UDP: int +IPPROTO_VRRP: int +IPPROTO_XTP: int +IPV6_CHECKSUM: int +IPV6_DONTFRAG: int +IPV6_DSTOPTS: int +IPV6_HOPLIMIT: int +IPV6_HOPOPTS: int +IPV6_JOIN_GROUP: int +IPV6_LEAVE_GROUP: int +IPV6_MULTICAST_HOPS: int +IPV6_MULTICAST_IF: int +IPV6_MULTICAST_LOOP: int +IPV6_NEXTHOP: int +IPV6_PATHMTU: int +IPV6_PKTINFO: int +IPV6_RECVDSTOPTS: int +IPV6_RECVHOPLIMIT: int +IPV6_RECVHOPOPTS: int +IPV6_RECVPATHMTU: int +IPV6_RECVPKTINFO: int +IPV6_RECVRTHDR: int +IPV6_RECVTCLASS: int +IPV6_RTHDR: int +IPV6_RTHDR_TYPE_0: int +IPV6_RTHDRDSTOPTS: int +IPV6_TCLASS: int +IPV6_UNICAST_HOPS: int +IPV6_USE_MIN_MTU: int +IPV6_V6ONLY: int +IP_ADD_MEMBERSHIP: int +IP_DEFAULT_MULTICAST_LOOP: int +IP_DEFAULT_MULTICAST_TTL: int +IP_DROP_MEMBERSHIP: int +IP_HDRINCL: int +IP_MAX_MEMBERSHIPS: int +IP_MULTICAST_IF: int +IP_MULTICAST_LOOP: int +IP_MULTICAST_TTL: int +IP_OPTIONS: int +IP_RECVDSTADDR: int +IP_RECVOPTS: int +IP_RECVRETOPTS: int +IP_RETOPTS: int +IP_TOS: int +IP_TRANSPARENT: int +IP_TTL: int +IPX_TYPE: int +LOCAL_PEERCRED: int +MSG_BCAST: MsgFlag +MSG_BTAG: MsgFlag +MSG_CMSG_CLOEXEC: MsgFlag +MSG_CONFIRM: MsgFlag +MSG_CTRUNC: MsgFlag +MSG_DONTROUTE: MsgFlag +MSG_DONTWAIT: MsgFlag +MSG_EOF: MsgFlag +MSG_EOR: MsgFlag +MSG_ERRQUEUE: MsgFlag +MSG_ETAG: MsgFlag +MSG_FASTOPEN: MsgFlag +MSG_MCAST: MsgFlag +MSG_MORE: MsgFlag +MSG_NOSIGNAL: MsgFlag +MSG_NOTIFICATION: MsgFlag +MSG_OOB: MsgFlag +MSG_PEEK: MsgFlag +MSG_TRUNC: MsgFlag +MSG_WAITALL: MsgFlag +NETLINK_ARPD: int +NETLINK_CRYPTO: int +NETLINK_DNRTMSG: int +NETLINK_FIREWALL: int +NETLINK_IP6_FW: int +NETLINK_NFLOG: int +NETLINK_ROUTE6: int +NETLINK_ROUTE: int +NETLINK_SKIP: int +NETLINK_TAPBASE: int +NETLINK_TCPDIAG: int +NETLINK_USERSOCK: int +NETLINK_W1: int +NETLINK_XFRM: int +NI_DGRAM: int +NI_MAXHOST: int +NI_MAXSERV: int +NI_NAMEREQD: int +NI_NOFQDN: int +NI_NUMERICHOST: int +NI_NUMERICSERV: int +PACKET_BROADCAST: int +PACKET_FASTROUTE: int +PACKET_HOST: int +PACKET_LOOPBACK: int +PACKET_MULTICAST: int +PACKET_OTHERHOST: int +PACKET_OUTGOING: int +PF_CAN: int +PF_PACKET: int +PF_RDS: int +PF_SYSTEM: int +SCM_CREDENTIALS: int +SCM_CREDS: int +SCM_RIGHTS: int +SHUT_RD: int +SHUT_RDWR: int +SHUT_WR: int +SOL_ATALK: int +SOL_AX25: int +SOL_CAN_BASE: int +SOL_CAN_RAW: int +SOL_HCI: int +SOL_IP: int +SOL_IPX: int +SOL_NETROM: int +SOL_RDS: int +SOL_ROSE: int +SOL_SOCKET: int +SOL_TCP: int +SOL_TIPC: int +SOL_UDP: int +SO_ACCEPTCONN: int +SO_BINDTODEVICE: int +SO_BROADCAST: int +SO_DEBUG: int +SO_DONTROUTE: int +SO_ERROR: int +SO_EXCLUSIVEADDRUSE: int +SO_KEEPALIVE: int +SO_LINGER: int +SO_MARK: int +SO_OOBINLINE: int +SO_PASSCRED: int +SO_PEERCRED: int +SO_PRIORITY: int +SO_RCVBUF: int +SO_RCVLOWAT: int +SO_RCVTIMEO: int +SO_REUSEADDR: int +SO_REUSEPORT: int +SO_SETFIB: int +SO_SNDBUF: int +SO_SNDLOWAT: int +SO_SNDTIMEO: int +SO_TYPE: int +SO_USELOOPBACK: int +SYSPROTO_CONTROL: int +TCP_CORK: int +TCP_DEFER_ACCEPT: int +TCP_FASTOPEN: int +TCP_INFO: int +TCP_KEEPCNT: int +TCP_KEEPIDLE: int +TCP_KEEPINTVL: int +TCP_LINGER2: int +TCP_MAXSEG: int +TCP_NODELAY: int +TCP_NOTSENT_LOWAT: int +TCP_QUICKACK: int +TCP_SYNCNT: int +TCP_WINDOW_CLAMP: int +TIPC_ADDR_ID: int +TIPC_ADDR_NAME: int +TIPC_ADDR_NAMESEQ: int +TIPC_CFG_SRV: int +TIPC_CLUSTER_SCOPE: int +TIPC_CONN_TIMEOUT: int +TIPC_CRITICAL_IMPORTANCE: int +TIPC_DEST_DROPPABLE: int +TIPC_HIGH_IMPORTANCE: int +TIPC_IMPORTANCE: int +TIPC_LOW_IMPORTANCE: int +TIPC_MEDIUM_IMPORTANCE: int +TIPC_NODE_SCOPE: int +TIPC_PUBLISHED: int +TIPC_SRC_DROPPABLE: int +TIPC_SUB_CANCEL: int +TIPC_SUB_PORTS: int +TIPC_SUB_SERVICE: int +TIPC_SUBSCR_TIMEOUT: int +TIPC_TOP_SRV: int +TIPC_WAIT_FOREVER: int +TIPC_WITHDRAWN: int +TIPC_ZONE_SCOPE: int + +if sys.version_info >= (3, 3): + RDS_CANCEL_SENT_TO: int + RDS_CMSG_RDMA_ARGS: int + RDS_CMSG_RDMA_DEST: int + RDS_CMSG_RDMA_MAP: int + RDS_CMSG_RDMA_STATUS: int + RDS_CMSG_RDMA_UPDATE: int + RDS_CONG_MONITOR: int + RDS_FREE_MR: int + RDS_GET_MR: int + RDS_GET_MR_FOR_DEST: int + RDS_RDMA_DONTWAIT: int + RDS_RDMA_FENCE: int + RDS_RDMA_INVALIDATE: int + RDS_RDMA_NOTIFY_ME: int + RDS_RDMA_READWRITE: int + RDS_RDMA_SILENT: int + RDS_RDMA_USE_ONCE: int + RDS_RECVERR: int + +if sys.version_info >= (3, 4): + CAN_BCM: int + CAN_BCM_TX_SETUP: int + CAN_BCM_TX_DELETE: int + CAN_BCM_TX_READ: int + CAN_BCM_TX_SEND: int + CAN_BCM_RX_SETUP: int + CAN_BCM_RX_DELETE: int + CAN_BCM_RX_READ: int + CAN_BCM_TX_STATUS: int + CAN_BCM_TX_EXPIRED: int + CAN_BCM_RX_STATUS: int + CAN_BCM_RX_TIMEOUT: int + CAN_BCM_RX_CHANGED: int + AF_LINK: AddressFamily + +if sys.version_info >= (3, 5): + CAN_RAW_FD_FRAMES: int + +if sys.version_info >= (3, 6): + SO_DOMAIN: int + SO_PROTOCOL: int + SO_PEERSEC: int + SO_PASSSEC: int + TCP_USER_TIMEOUT: int + TCP_CONGESTION: int + AF_ALG: AddressFamily + SOL_ALG: int + ALG_SET_KEY: int + ALG_SET_IV: int + ALG_SET_OP: int + ALG_SET_AEAD_ASSOCLEN: int + ALG_SET_AEAD_AUTHSIZE: int + ALG_SET_PUBKEY: int + ALG_OP_DECRYPT: int + ALG_OP_ENCRYPT: int + ALG_OP_SIGN: int + ALG_OP_VERIFY: int + +if sys.platform == 'win32': + SIO_RCVALL: int + SIO_KEEPALIVE_VALS: int + RCVALL_IPLEVEL: int + RCVALL_MAX: int + RCVALL_OFF: int + RCVALL_ON: int + RCVALL_SOCKETLEVELONLY: int + + if sys.version_info >= (3, 6): + SIO_LOOPBACK_FAST_PATH: int + +# enum versions of above flags py 3.4+ +if sys.version_info >= (3, 4): + from enum import IntEnum + + class AddressFamily(IntEnum): + AF_UNIX = ... + AF_INET = ... + AF_INET6 = ... + AF_APPLETALK = ... + AF_ASH = ... + AF_ATMPVC = ... + AF_ATMSVC = ... + AF_AX25 = ... + AF_BLUETOOTH = ... + AF_BRIDGE = ... + AF_DECnet = ... + AF_ECONET = ... + AF_IPX = ... + AF_IRDA = ... + AF_KEY = ... + AF_LLC = ... + AF_NETBEUI = ... + AF_NETLINK = ... + AF_NETROM = ... + AF_PACKET = ... + AF_PPPOX = ... + AF_ROSE = ... + AF_ROUTE = ... + AF_SECURITY = ... + AF_SNA = ... + AF_TIPC = ... + AF_UNSPEC = ... + AF_WANPIPE = ... + AF_X25 = ... + AF_LINK = ... + + class SocketKind(IntEnum): + SOCK_STREAM = ... + SOCK_DGRAM = ... + SOCK_RAW = ... + SOCK_RDM = ... + SOCK_SEQPACKET = ... + SOCK_CLOEXEC = ... + SOCK_NONBLOCK = ... +else: + AddressFamily = int + SocketKind = int + +if sys.version_info >= (3, 6): + from enum import IntFlag + + class AddressInfo(IntFlag): + AI_ADDRCONFIG = ... + AI_ALL = ... + AI_CANONNAME = ... + AI_NUMERICHOST = ... + AI_NUMERICSERV = ... + AI_PASSIVE = ... + AI_V4MAPPED = ... + + class MsgFlag(IntFlag): + MSG_CTRUNC = ... + MSG_DONTROUTE = ... + MSG_DONTWAIT = ... + MSG_EOR = ... + MSG_OOB = ... + MSG_PEEK = ... + MSG_TRUNC = ... + MSG_WAITALL = ... +else: + AddressInfo = int + MsgFlag = int + + +# ----- exceptions ----- +class error(IOError): + ... + +class herror(error): + def __init__(self, herror: int, string: str) -> None: ... + +class gaierror(error): + def __init__(self, error: int, string: str) -> None: ... + +class timeout(error): + ... + + +# Addresses can be either tuples of varying lengths (AF_INET, AF_INET6, +# AF_NETLINK, AF_TIPC) or strings (AF_UNIX). + +_Address = Union[tuple, str] +_RetAddress = Any + +# TODO AF_PACKET and AF_BLUETOOTH address objects + +_CMSG = Tuple[int, int, bytes] +_SelfT = TypeVar('_SelfT', bound=socket) + +# ----- classes ----- +class socket: + family: int + type: int + proto: int + + if sys.version_info < (3,): + def __init__(self, family: int = ..., type: int = ..., proto: int = ...) -> None: ... + else: + def __init__(self, family: int = ..., type: int = ..., proto: int = ..., fileno: Optional[int] = ...) -> None: ... + + if sys.version_info >= (3, 2): + def __enter__(self: _SelfT) -> _SelfT: ... + def __exit__(self, *args: Any) -> None: ... + + # --- methods --- + def accept(self) -> Tuple[socket, _RetAddress]: ... + def bind(self, address: Union[_Address, bytes]) -> None: ... + def close(self) -> None: ... + def connect(self, address: Union[_Address, bytes]) -> None: ... + def connect_ex(self, address: Union[_Address, bytes]) -> int: ... + def detach(self) -> int: ... + def fileno(self) -> int: ... + + def getpeername(self) -> _RetAddress: ... + def getsockname(self) -> _RetAddress: ... + + @overload + def getsockopt(self, level: int, optname: int) -> int: ... + @overload + def getsockopt(self, level: int, optname: int, buflen: int) -> bytes: ... + + def gettimeout(self) -> Optional[float]: ... + def ioctl(self, control: object, + option: Tuple[int, int, int]) -> None: ... + if sys.version_info < (3, 5): + def listen(self, backlog: int) -> None: ... + else: + def listen(self, backlog: int = ...) -> None: ... + # TODO the return value may be BinaryIO or TextIO, depending on mode + def makefile(self, mode: str = ..., buffering: int = ..., + encoding: str = ..., errors: str = ..., + newline: str = ...) -> Any: + ... + def recv(self, bufsize: int, flags: int = ...) -> bytes: ... + + def recvfrom(self, bufsize: int, flags: int = ...) -> Tuple[bytes, _RetAddress]: ... + def recvfrom_into(self, buffer: _WriteBuffer, nbytes: int, + flags: int = ...) -> Tuple[int, _RetAddress]: ... + def recv_into(self, buffer: _WriteBuffer, nbytes: int, + flags: int = ...) -> int: ... + def send(self, data: bytes, flags: int = ...) -> int: ... + def sendall(self, data: bytes, flags: int = ...) -> None: + ... # return type: None on success + @overload + def sendto(self, data: bytes, address: _Address) -> int: ... + @overload + def sendto(self, data: bytes, flags: int, address: _Address) -> int: ... + def setblocking(self, flag: bool) -> None: ... + def settimeout(self, value: Optional[float]) -> None: ... + def setsockopt(self, level: int, optname: int, value: Union[int, bytes]) -> None: ... + def shutdown(self, how: int) -> None: ... + + if sys.version_info >= (3, 3): + def recvmsg(self, __bufsize: int, __ancbufsize: int = ..., + __flags: int = ...) -> Tuple[bytes, List[_CMSG], int, Any]: ... + def recvmsg_into(self, __buffers: Iterable[_WriteBuffer], __ancbufsize: int = ..., + __flags: int = ...) -> Tuple[int, List[_CMSG], int, Any]: ... + def sendmsg(self, __buffers: Iterable[bytes], __ancdata: Iterable[_CMSG] = ..., + __flags: int = ..., __address: _Address = ...) -> int: ... + if sys.version_info >= (3, 4): + def set_inheritable(self, inheritable: bool) -> None: ... + + +# ----- functions ----- +def create_connection(address: Tuple[Optional[str], int], + timeout: Optional[float] = ..., + source_address: Tuple[Union[bytearray, bytes, Text], int] = ...) -> socket: ... + +# the 5th tuple item is an address +# TODO the "Tuple[Any, ...]" should be "Union[Tuple[str, int], Tuple[str, int, int, int]]" but that triggers +# https://github.com/python/mypy/issues/2509 +def getaddrinfo( + host: Optional[Union[bytearray, bytes, Text]], port: Union[str, int, None], family: int = ..., + socktype: int = ..., proto: int = ..., + flags: int = ...) -> List[Tuple[int, int, int, str, Tuple[Any, ...]]]: + ... + +def getfqdn(name: str = ...) -> str: ... +def gethostbyname(hostname: str) -> str: ... +def gethostbyname_ex(hostname: str) -> Tuple[str, List[str], List[str]]: ... +def gethostname() -> str: ... +def gethostbyaddr(ip_address: str) -> Tuple[str, List[str], List[str]]: ... +def getnameinfo(sockaddr: tuple, flags: int) -> Tuple[str, int]: ... +def getprotobyname(protocolname: str) -> int: ... +def getservbyname(servicename: str, protocolname: str = ...) -> int: ... +def getservbyport(port: int, protocolname: str = ...) -> str: ... +def socketpair(family: int = ..., + type: int = ..., + proto: int = ...) -> Tuple[socket, socket]: ... +def fromfd(fd: int, family: int, type: int, proto: int = ...) -> socket: ... +def ntohl(x: int) -> int: ... # param & ret val are 32-bit ints +def ntohs(x: int) -> int: ... # param & ret val are 16-bit ints +def htonl(x: int) -> int: ... # param & ret val are 32-bit ints +def htons(x: int) -> int: ... # param & ret val are 16-bit ints +def inet_aton(ip_string: str) -> bytes: ... # ret val 4 bytes in length +def inet_ntoa(packed_ip: bytes) -> str: ... +def inet_pton(address_family: int, ip_string: str) -> bytes: ... +def inet_ntop(address_family: int, packed_ip: bytes) -> str: ... +def getdefaulttimeout() -> Optional[float]: ... +def setdefaulttimeout(timeout: Optional[float]) -> None: ... + +if sys.version_info >= (3, 3): + def CMSG_LEN(length: int) -> int: ... + def CMSG_SPACE(length: int) -> int: ... + def sethostname(name: str) -> None: ... + def if_nameindex() -> List[Tuple[int, str]]: ... + def if_nametoindex(name: str) -> int: ... + def if_indextoname(index: int) -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/sqlite3/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/sqlite3/__init__.pyi new file mode 100644 index 0000000..d5d20d6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/sqlite3/__init__.pyi @@ -0,0 +1 @@ +from sqlite3.dbapi2 import * # noqa: F403 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/sqlite3/dbapi2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/sqlite3/dbapi2.pyi new file mode 100644 index 0000000..5b3d2a0 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/sqlite3/dbapi2.pyi @@ -0,0 +1,289 @@ +# Filip Hron +# based heavily on Andrey Vlasovskikh's python-skeletons https://github.com/JetBrains/python-skeletons/blob/master/sqlite3.py + +import os +import sys +from typing import Any, Callable, Iterable, Iterator, List, Optional, Text, Tuple, Type, TypeVar, Union +from datetime import date, time, datetime + +_T = TypeVar('_T') + +paramstyle: str +threadsafety: int +apilevel: str +Date = date +Time = time +Timestamp = datetime + +def DateFromTicks(ticks): ... +def TimeFromTicks(ticks): ... +def TimestampFromTicks(ticks): ... + +version_info: str +sqlite_version_info: Tuple[int, int, int] +if sys.version_info >= (3,): + Binary = memoryview +else: + Binary = buffer + +def register_adapters_and_converters(): ... + +# The remaining definitions are imported from _sqlite3. + +PARSE_COLNAMES: int +PARSE_DECLTYPES: int +SQLITE_ALTER_TABLE: int +SQLITE_ANALYZE: int +SQLITE_ATTACH: int +SQLITE_CREATE_INDEX: int +SQLITE_CREATE_TABLE: int +SQLITE_CREATE_TEMP_INDEX: int +SQLITE_CREATE_TEMP_TABLE: int +SQLITE_CREATE_TEMP_TRIGGER: int +SQLITE_CREATE_TEMP_VIEW: int +SQLITE_CREATE_TRIGGER: int +SQLITE_CREATE_VIEW: int +SQLITE_DELETE: int +SQLITE_DENY: int +SQLITE_DETACH: int +SQLITE_DROP_INDEX: int +SQLITE_DROP_TABLE: int +SQLITE_DROP_TEMP_INDEX: int +SQLITE_DROP_TEMP_TABLE: int +SQLITE_DROP_TEMP_TRIGGER: int +SQLITE_DROP_TEMP_VIEW: int +SQLITE_DROP_TRIGGER: int +SQLITE_DROP_VIEW: int +SQLITE_IGNORE: int +SQLITE_INSERT: int +SQLITE_OK: int +SQLITE_PRAGMA: int +SQLITE_READ: int +SQLITE_REINDEX: int +SQLITE_SELECT: int +SQLITE_TRANSACTION: int +SQLITE_UPDATE: int +adapters: Any +converters: Any +sqlite_version: str +version: str + +# TODO: adapt needs to get probed +def adapt(obj, protocol, alternate): ... +def complete_statement(sql: str) -> bool: ... +if sys.version_info >= (3, 7): + def connect(database: Union[bytes, Text, os.PathLike[Text]], + timeout: float = ..., + detect_types: int = ..., + isolation_level: Optional[str] = ..., + check_same_thread: bool = ..., + factory: Optional[Type[Connection]] = ..., + cached_statements: int = ..., + uri: bool = ...) -> Connection: ... +elif sys.version_info >= (3, 4): + def connect(database: Union[bytes, Text], + timeout: float = ..., + detect_types: int = ..., + isolation_level: Optional[str] = ..., + check_same_thread: bool = ..., + factory: Optional[Type[Connection]] = ..., + cached_statements: int = ..., + uri: bool = ...) -> Connection: ... +else: + def connect(database: Union[bytes, Text], + timeout: float = ..., + detect_types: int = ..., + isolation_level: Optional[str] = ..., + check_same_thread: bool = ..., + factory: Optional[Type[Connection]] = ..., + cached_statements: int = ...) -> Connection: ... +def enable_callback_tracebacks(flag: bool) -> None: ... +def enable_shared_cache(do_enable: int) -> None: ... +def register_adapter(type: Type[_T], callable: Callable[[_T], Union[int, float, str, bytes]]) -> None: ... +def register_converter(typename: str, callable: Callable[[bytes], Any]) -> None: ... + +class Cache(object): + def __init__(self, *args, **kwargs) -> None: ... + def display(self, *args, **kwargs) -> None: ... + def get(self, *args, **kwargs) -> None: ... + +class Connection(object): + DataError: Any + DatabaseError: Any + Error: Any + IntegrityError: Any + InterfaceError: Any + InternalError: Any + NotSupportedError: Any + OperationalError: Any + ProgrammingError: Any + Warning: Any + in_transaction: Any + isolation_level: Any + row_factory: Any + text_factory: Any + total_changes: Any + def __init__(self, *args, **kwargs): ... + def close(self) -> None: ... + def commit(self) -> None: ... + def create_aggregate(self, name: str, num_params: int, aggregate_class: type) -> None: ... + def create_collation(self, name: str, callable: Any) -> None: ... + def create_function(self, name: str, num_params: int, func: Any) -> None: ... + def cursor(self, cursorClass: Optional[type] = ...) -> Cursor: ... + def execute(self, sql: str, parameters: Iterable = ...) -> Cursor: ... + # TODO: please check in executemany() if seq_of_parameters type is possible like this + def executemany(self, sql: str, seq_of_parameters: Iterable[Iterable]) -> Cursor: ... + def executescript(self, sql_script: Union[bytes, Text]) -> Cursor: ... + def interrupt(self, *args, **kwargs) -> None: ... + def iterdump(self, *args, **kwargs) -> None: ... + def rollback(self, *args, **kwargs) -> None: ... + # TODO: set_authorizer(authorzer_callback) + # see https://docs.python.org/2/library/sqlite3.html#sqlite3.Connection.set_authorizer + # returns [SQLITE_OK, SQLITE_DENY, SQLITE_IGNORE] so perhaps int + def set_authorizer(self, *args, **kwargs) -> None: ... + # set_progress_handler(handler, n) -> see https://docs.python.org/2/library/sqlite3.html#sqlite3.Connection.set_progress_handler + def set_progress_handler(self, *args, **kwargs) -> None: ... + def set_trace_callback(self, *args, **kwargs): ... + # enable_load_extension and load_extension is not available on python distributions compiled + # without sqlite3 loadable extension support. see footnotes https://docs.python.org/3/library/sqlite3.html#f1 + def enable_load_extension(self, enabled: bool) -> None: ... + def load_extension(self, path: str) -> None: ... + if sys.version_info >= (3, 7): + def backup(self, target: Connection, *, pages: int = ..., + progress: Optional[Callable[[int, int, int], object]] = ..., name: str = ..., + sleep: float = ...) -> None: ... + def __call__(self, *args, **kwargs): ... + def __enter__(self, *args, **kwargs): ... + def __exit__(self, *args, **kwargs): ... + +class Cursor(Iterator[Any]): + arraysize: Any + connection: Any + description: Any + lastrowid: Any + row_factory: Any + rowcount: Any + # TODO: Cursor class accepts exactly 1 argument + # required type is sqlite3.Connection (which is imported as _Connection) + # however, the name of the __init__ variable is unknown + def __init__(self, *args, **kwargs) -> None: ... + def close(self, *args, **kwargs) -> None: ... + def execute(self, sql: str, parameters: Iterable = ...) -> Cursor: ... + def executemany(self, sql: str, seq_of_parameters: Iterable[Iterable]) -> Cursor: ... + def executescript(self, sql_script: Union[bytes, Text]) -> Cursor: ... + def fetchall(self) -> List[Any]: ... + def fetchmany(self, size: Optional[int] = ...) -> List[Any]: ... + def fetchone(self) -> Any: ... + def setinputsizes(self, *args, **kwargs) -> None: ... + def setoutputsize(self, *args, **kwargs) -> None: ... + def __iter__(self) -> Cursor: ... + if sys.version_info >= (3, 0): + def __next__(self) -> Any: ... + else: + def next(self) -> Any: ... + + +class DataError(DatabaseError): ... + +class DatabaseError(Error): ... + +class Error(Exception): ... + +class IntegrityError(DatabaseError): ... + +class InterfaceError(Error): ... + +class InternalError(DatabaseError): ... + +class NotSupportedError(DatabaseError): ... + +class OperationalError(DatabaseError): ... + +class OptimizedUnicode(object): + maketrans: Any + def __init__(self, *args, **kwargs): ... + def capitalize(self, *args, **kwargs): ... + def casefold(self, *args, **kwargs): ... + def center(self, *args, **kwargs): ... + def count(self, *args, **kwargs): ... + def encode(self, *args, **kwargs): ... + def endswith(self, *args, **kwargs): ... + def expandtabs(self, *args, **kwargs): ... + def find(self, *args, **kwargs): ... + def format(self, *args, **kwargs): ... + def format_map(self, *args, **kwargs): ... + def index(self, *args, **kwargs): ... + def isalnum(self, *args, **kwargs): ... + def isalpha(self, *args, **kwargs): ... + def isdecimal(self, *args, **kwargs): ... + def isdigit(self, *args, **kwargs): ... + def isidentifier(self, *args, **kwargs): ... + def islower(self, *args, **kwargs): ... + def isnumeric(self, *args, **kwargs): ... + def isprintable(self, *args, **kwargs): ... + def isspace(self, *args, **kwargs): ... + def istitle(self, *args, **kwargs): ... + def isupper(self, *args, **kwargs): ... + def join(self, *args, **kwargs): ... + def ljust(self, *args, **kwargs): ... + def lower(self, *args, **kwargs): ... + def lstrip(self, *args, **kwargs): ... + def partition(self, *args, **kwargs): ... + def replace(self, *args, **kwargs): ... + def rfind(self, *args, **kwargs): ... + def rindex(self, *args, **kwargs): ... + def rjust(self, *args, **kwargs): ... + def rpartition(self, *args, **kwargs): ... + def rsplit(self, *args, **kwargs): ... + def rstrip(self, *args, **kwargs): ... + def split(self, *args, **kwargs): ... + def splitlines(self, *args, **kwargs): ... + def startswith(self, *args, **kwargs): ... + def strip(self, *args, **kwargs): ... + def swapcase(self, *args, **kwargs): ... + def title(self, *args, **kwargs): ... + def translate(self, *args, **kwargs): ... + def upper(self, *args, **kwargs): ... + def zfill(self, *args, **kwargs): ... + def __add__(self, other): ... + def __contains__(self, *args, **kwargs): ... + def __eq__(self, other): ... + def __format__(self, *args, **kwargs): ... + def __ge__(self, other): ... + def __getitem__(self, index): ... + def __getnewargs__(self, *args, **kwargs): ... + def __gt__(self, other): ... + def __hash__(self): ... + def __iter__(self): ... + def __le__(self, other): ... + def __len__(self, *args, **kwargs): ... + def __lt__(self, other): ... + def __mod__(self, other): ... + def __mul__(self, other): ... + def __ne__(self, other): ... + def __rmod__(self, other): ... + def __rmul__(self, other): ... + +class PrepareProtocol(object): + def __init__(self, *args, **kwargs): ... + +class ProgrammingError(DatabaseError): ... + +class Row(object): + def __init__(self, *args, **kwargs): ... + def keys(self, *args, **kwargs): ... + def __eq__(self, other): ... + def __ge__(self, other): ... + def __getitem__(self, index): ... + def __gt__(self, other): ... + def __hash__(self): ... + def __iter__(self): ... + def __le__(self, other): ... + def __len__(self, *args, **kwargs): ... + def __lt__(self, other): ... + def __ne__(self, other): ... + +class Statement(object): + def __init__(self, *args, **kwargs): ... + +class Warning(Exception): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/sre_compile.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/sre_compile.pyi new file mode 100644 index 0000000..be39a31 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/sre_compile.pyi @@ -0,0 +1,18 @@ +# Source: https://hg.python.org/cpython/file/2.7/Lib/sre_compile.py +# and https://github.com/python/cpython/blob/master/Lib/sre_compile.py + +import sys +from sre_parse import SubPattern +from typing import Any, List, Pattern, Tuple, Type, TypeVar, Union + +MAXCODE: int +if sys.version_info < (3, 0): + STRING_TYPES: Tuple[Type[str], Type[unicode]] + _IsStringType = int +else: + from sre_constants import _NamedIntConstant + def dis(code: List[_NamedIntConstant]) -> None: ... + _IsStringType = bool + +def isstring(obj: Any) -> _IsStringType: ... +def compile(p: Union[str, bytes, SubPattern], flags: int = ...) -> Pattern: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/ssl.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/ssl.pyi new file mode 100644 index 0000000..4b51e40 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/ssl.pyi @@ -0,0 +1,313 @@ +# Stubs for ssl + +from typing import ( + Any, Dict, Callable, List, NamedTuple, Optional, Set, Tuple, Union, +) +import socket +import sys + +_PCTRTT = Tuple[Tuple[str, str], ...] +_PCTRTTT = Tuple[_PCTRTT, ...] +_PeerCertRetDictType = Dict[str, Union[str, _PCTRTTT, _PCTRTT]] +_PeerCertRetType = Union[_PeerCertRetDictType, bytes, None] +_EnumRetType = List[Tuple[bytes, str, Union[Set[str], bool]]] +_PasswordType = Union[Callable[[], Union[str, bytes]], str, bytes] + +if sys.version_info >= (3, 5): + _SC1ArgT = Union[SSLSocket, SSLObject] +else: + _SC1ArgT = SSLSocket +_SrvnmeCbType = Callable[[_SC1ArgT, Optional[str], SSLSocket], Optional[int]] + +class SSLError(OSError): + library: str + reason: str +class SSLZeroReturnError(SSLError): ... +class SSLWantReadError(SSLError): ... +class SSLWantWriteError(SSLError): ... +class SSLSyscallError(SSLError): ... +class SSLEOFError(SSLError): ... + +if sys.version_info >= (3, 7): + class SSLCertVerificationError(SSLError, ValueError): + verify_code: int + verify_message: str + + CertificateError = SSLCertVerificationError +else: + class CertificateError(ValueError): ... + + +def wrap_socket(sock: socket.socket, keyfile: Optional[str] = ..., + certfile: Optional[str] = ..., server_side: bool = ..., + cert_reqs: int = ..., ssl_version: int = ..., + ca_certs: Optional[str] = ..., + do_handshake_on_connect: bool = ..., + suppress_ragged_eofs: bool = ..., + ciphers: Optional[str] = ...) -> SSLSocket: ... + + +if sys.version_info < (3,) or sys.version_info >= (3, 4): + def create_default_context(purpose: Any = ..., *, + cafile: Optional[str] = ..., + capath: Optional[str] = ..., + cadata: Optional[str] = ...) -> SSLContext: ... + +if sys.version_info >= (3, 4): + def _create_unverified_context(protocol: int = ..., *, + cert_reqs: int = ..., + check_hostname: bool = ..., + purpose: Any = ..., + certfile: Optional[str] = ..., + keyfile: Optional[str] = ..., + cafile: Optional[str] = ..., + capath: Optional[str] = ..., + cadata: Optional[str] = ...) -> SSLContext: ... + _create_default_https_context: Callable[..., SSLContext] + +if sys.version_info >= (3, 3): + def RAND_bytes(num: int) -> bytes: ... + def RAND_pseudo_bytes(num: int) -> Tuple[bytes, bool]: ... +def RAND_status() -> bool: ... +def RAND_egd(path: str) -> None: ... +def RAND_add(bytes: bytes, entropy: float) -> None: ... + + +def match_hostname(cert: _PeerCertRetType, hostname: str) -> None: ... +def cert_time_to_seconds(cert_time: str) -> int: ... +def get_server_certificate(addr: Tuple[str, int], ssl_version: int = ..., + ca_certs: Optional[str] = ...) -> str: ... +def DER_cert_to_PEM_cert(der_cert_bytes: bytes) -> str: ... +def PEM_cert_to_DER_cert(pem_cert_string: str) -> bytes: ... +if sys.version_info < (3,) or sys.version_info >= (3, 4): + DefaultVerifyPaths = NamedTuple('DefaultVerifyPaths', + [('cafile', str), ('capath', str), + ('openssl_cafile_env', str), + ('openssl_cafile', str), + ('openssl_capath_env', str), + ('openssl_capath', str)]) + def get_default_verify_paths() -> DefaultVerifyPaths: ... + +if sys.platform == 'win32': + if sys.version_info < (3,) or sys.version_info >= (3, 4): + def enum_certificates(store_name: str) -> _EnumRetType: ... + def enum_crls(store_name: str) -> _EnumRetType: ... + + +CERT_NONE: int +CERT_OPTIONAL: int +CERT_REQUIRED: int + +if sys.version_info < (3,) or sys.version_info >= (3, 4): + VERIFY_DEFAULT: int + VERIFY_CRL_CHECK_LEAF: int + VERIFY_CRL_CHECK_CHAIN: int + VERIFY_X509_STRICT: int + VERIFY_X509_TRUSTED_FIRST: int + +PROTOCOL_SSLv23: int +PROTOCOL_SSLv2: int +PROTOCOL_SSLv3: int +PROTOCOL_TLSv1: int +if sys.version_info < (3,) or sys.version_info >= (3, 4): + PROTOCOL_TLSv1_1: int + PROTOCOL_TLSv1_2: int +if sys.version_info >= (3, 5): + PROTOCOL_TLS: int +if sys.version_info >= (3, 6): + PROTOCOL_TLS_CLIENT: int + PROTOCOL_TLS_SERVER: int + +OP_ALL: int +OP_NO_SSLv2: int +OP_NO_SSLv3: int +OP_NO_TLSv1: int +if sys.version_info < (3,) or sys.version_info >= (3, 4): + OP_NO_TLSv1_1: int + OP_NO_TLSv1_2: int +OP_CIPHER_SERVER_PREFERENCE: int +OP_SINGLE_DH_USE: int +OP_SINGLE_ECDH_USE: int +OP_NO_COMPRESSION: int +if sys.version_info >= (3, 6): + OP_NO_TICKET: int + +if sys.version_info < (3,) or sys.version_info >= (3, 5): + HAS_ALPN: int +HAS_ECDH: bool +HAS_SNI: bool +HAS_NPN: bool +CHANNEL_BINDING_TYPES: List[str] + +OPENSSL_VERSION: str +OPENSSL_VERSION_INFO: Tuple[int, int, int, int, int] +OPENSSL_VERSION_NUMBER: int + +if sys.version_info < (3,) or sys.version_info >= (3, 4): + ALERT_DESCRIPTION_HANDSHAKE_FAILURE: int + ALERT_DESCRIPTION_INTERNAL_ERROR: int + ALERT_DESCRIPTION_ACCESS_DENIED: int + ALERT_DESCRIPTION_BAD_CERTIFICATE: int + ALERT_DESCRIPTION_BAD_CERTIFICATE_HASH_VALUE: int + ALERT_DESCRIPTION_BAD_CERTIFICATE_STATUS_RESPONSE: int + ALERT_DESCRIPTION_BAD_RECORD_MAC: int + ALERT_DESCRIPTION_CERTIFICATE_EXPIRED: int + ALERT_DESCRIPTION_CERTIFICATE_REVOKED: int + ALERT_DESCRIPTION_CERTIFICATE_UNKNOWN: int + ALERT_DESCRIPTION_CERTIFICATE_UNOBTAINABLE: int + ALERT_DESCRIPTION_CLOSE_NOTIFY: int + ALERT_DESCRIPTION_DECODE_ERROR: int + ALERT_DESCRIPTION_DECOMPRESSION_FAILURE: int + ALERT_DESCRIPTION_DECRYPT_ERROR: int + ALERT_DESCRIPTION_ILLEGAL_PARAMETER: int + ALERT_DESCRIPTION_INSUFFICIENT_SECURITY: int + ALERT_DESCRIPTION_NO_RENEGOTIATION: int + ALERT_DESCRIPTION_PROTOCOL_VERSION: int + ALERT_DESCRIPTION_RECORD_OVERFLOW: int + ALERT_DESCRIPTION_UNEXPECTED_MESSAGE: int + ALERT_DESCRIPTION_UNKNOWN_CA: int + ALERT_DESCRIPTION_UNKNOWN_PSK_IDENTITY: int + ALERT_DESCRIPTION_UNRECOGNIZED_NAME: int + ALERT_DESCRIPTION_UNSUPPORTED_CERTIFICATE: int + ALERT_DESCRIPTION_UNSUPPORTED_EXTENSION: int + ALERT_DESCRIPTION_USER_CANCELLED: int + +if sys.version_info < (3,) or sys.version_info >= (3, 4): + _PurposeType = NamedTuple('_PurposeType', [('nid', int), ('shortname', str), ('longname', str), ('oid', str)]) + class Purpose: + SERVER_AUTH: _PurposeType + CLIENT_AUTH: _PurposeType + + +class SSLSocket(socket.socket): + context: SSLContext + server_side: bool + server_hostname: Optional[str] + if sys.version_info >= (3, 6): + session: Optional[SSLSession] + session_reused: Optional[bool] + + def read(self, len: int = ..., + buffer: Optional[bytearray] = ...) -> bytes: ... + def write(self, buf: bytes) -> int: ... + def do_handshake(self) -> None: ... + def getpeercert(self, binary_form: bool = ...) -> _PeerCertRetType: ... + def cipher(self) -> Tuple[str, int, int]: ... + if sys.version_info >= (3, 5): + def shared_cipher(self) -> Optional[List[Tuple[str, int, int]]]: ... + def compression(self) -> Optional[str]: ... + def get_channel_binding(self, cb_type: str = ...) -> Optional[bytes]: ... + if sys.version_info < (3,) or sys.version_info >= (3, 5): + def selected_alpn_protocol(self) -> Optional[str]: ... + def selected_npn_protocol(self) -> Optional[str]: ... + def unwrap(self) -> socket.socket: ... + if sys.version_info < (3,) or sys.version_info >= (3, 5): + def version(self) -> Optional[str]: ... + def pending(self) -> int: ... + + +class SSLContext: + if sys.version_info < (3,) or sys.version_info >= (3, 4): + check_hostname: bool + options: int + @property + def protocol(self) -> int: ... + if sys.version_info < (3,) or sys.version_info >= (3, 4): + verify_flags: int + verify_mode: int + if sys.version_info >= (3, 5): + def __init__(self, protocol: int = ...) -> None: ... + else: + def __init__(self, protocol: int) -> None: ... + if sys.version_info < (3,) or sys.version_info >= (3, 4): + def cert_store_stats(self) -> Dict[str, int]: ... + def load_cert_chain(self, certfile: str, keyfile: Optional[str] = ..., + password: _PasswordType = ...) -> None: ... + if sys.version_info < (3,) or sys.version_info >= (3, 4): + def load_default_certs(self, purpose: _PurposeType = ...) -> None: ... + def load_verify_locations(self, cafile: Optional[str] = ..., + capath: Optional[str] = ..., + cadata: Union[str, bytes, None] = ...) -> None: ... + def get_ca_certs(self, + binary_form: bool = ...) -> Union[List[_PeerCertRetDictType], List[bytes]]: ... + else: + def load_verify_locations(self, + cafile: Optional[str] = ..., + capath: Optional[str] = ...) -> None: ... + def set_default_verify_paths(self) -> None: ... + def set_ciphers(self, ciphers: str) -> None: ... + if sys.version_info < (3,) or sys.version_info >= (3, 5): + def set_alpn_protocols(self, protocols: List[str]) -> None: ... + def set_npn_protocols(self, protocols: List[str]) -> None: ... + def set_servername_callback(self, + server_name_callback: Optional[_SrvnmeCbType]) -> None: ... + def load_dh_params(self, dhfile: str) -> None: ... + def set_ecdh_curve(self, curve_name: str) -> None: ... + def wrap_socket(self, sock: socket.socket, server_side: bool = ..., + do_handshake_on_connect: bool = ..., + suppress_ragged_eofs: bool = ..., + server_hostname: Optional[str] = ...) -> SSLSocket: ... + if sys.version_info >= (3, 5): + def wrap_bio(self, incoming: MemoryBIO, outgoing: MemoryBIO, + server_side: bool = ..., + server_hostname: Optional[str] = ...) -> SSLObject: ... + def session_stats(self) -> Dict[str, int]: ... + + +if sys.version_info >= (3, 5): + class SSLObject: + context: SSLContext + server_side: bool + server_hostname: Optional[str] + if sys.version_info >= (3, 6): + session: Optional[SSLSession] + session_reused: bool + def read(self, len: int = ..., + buffer: Optional[bytearray] = ...) -> bytes: ... + def write(self, buf: bytes) -> int: ... + def getpeercert(self, binary_form: bool = ...) -> _PeerCertRetType: ... + def selected_npn_protocol(self) -> Optional[str]: ... + def cipher(self) -> Tuple[str, int, int]: ... + def shared_cipher(self) -> Optional[List[Tuple[str, int, int]]]: ... + def compression(self) -> Optional[str]: ... + def pending(self) -> int: ... + def do_handshake(self) -> None: ... + def unwrap(self) -> None: ... + def get_channel_binding(self, cb_type: str = ...) -> Optional[bytes]: ... + + class MemoryBIO: + pending: int + eof: bool + def read(self, n: int = ...) -> bytes: ... + def write(self, buf: bytes) -> int: ... + def write_eof(self) -> None: ... + +if sys.version_info >= (3, 6): + class SSLSession: + id: bytes + time: int + timeout: int + ticket_lifetime_hint: int + has_ticket: bool + + +# TODO below documented in cpython but not in docs.python.org +# taken from python 3.4 +SSL_ERROR_EOF: int +SSL_ERROR_INVALID_ERROR_CODE: int +SSL_ERROR_SSL: int +SSL_ERROR_SYSCALL: int +SSL_ERROR_WANT_CONNECT: int +SSL_ERROR_WANT_READ: int +SSL_ERROR_WANT_WRITE: int +SSL_ERROR_WANT_X509_LOOKUP: int +SSL_ERROR_ZERO_RETURN: int + +def get_protocol_name(protocol_code: int) -> str: ... + +AF_INET: int +PEM_FOOTER: str +PEM_HEADER: str +SOCK_STREAM: int +SOL_SOCKET: int +SO_TYPE: int diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/stringprep.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/stringprep.pyi new file mode 100644 index 0000000..e3b7e9d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/stringprep.pyi @@ -0,0 +1,23 @@ +# Stubs for stringprep (Python 2 and 3) + +from typing import Text + +def in_table_a1(code: Text) -> bool: ... +def in_table_b1(code: Text) -> bool: ... +def map_table_b3(code: Text) -> Text: ... +def map_table_b2(a: Text) -> Text: ... +def in_table_c11(code: Text) -> bool: ... +def in_table_c12(code: Text) -> bool: ... +def in_table_c11_c12(code: Text) -> bool: ... +def in_table_c21(code: Text) -> bool: ... +def in_table_c22(code: Text) -> bool: ... +def in_table_c21_c22(code: Text) -> bool: ... +def in_table_c3(code: Text) -> bool: ... +def in_table_c4(code: Text) -> bool: ... +def in_table_c5(code: Text) -> bool: ... +def in_table_c6(code: Text) -> bool: ... +def in_table_c7(code: Text) -> bool: ... +def in_table_c8(code: Text) -> bool: ... +def in_table_c9(code: Text) -> bool: ... +def in_table_d1(code: Text) -> bool: ... +def in_table_d2(code: Text) -> bool: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/struct.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/struct.pyi new file mode 100644 index 0000000..552ee22 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/struct.pyi @@ -0,0 +1,44 @@ +# Stubs for struct + +# Based on http://docs.python.org/3.2/library/struct.html +# Based on http://docs.python.org/2/library/struct.html + +import sys +from typing import Any, Tuple, Text, Union, Iterator +from array import array +from mmap import mmap + +class error(Exception): ... + +_FmtType = Union[bytes, Text] +if sys.version_info >= (3,): + _BufferType = Union[array[int], bytes, bytearray, memoryview, mmap] + _WriteBufferType = Union[array, bytearray, memoryview, mmap] +else: + _BufferType = Union[array[int], bytes, bytearray, buffer, memoryview, mmap] + _WriteBufferType = Union[array[Any], bytearray, buffer, memoryview, mmap] + +def pack(fmt: _FmtType, *v: Any) -> bytes: ... +def pack_into(fmt: _FmtType, buffer: _WriteBufferType, offset: int, *v: Any) -> None: ... +def unpack(fmt: _FmtType, buffer: _BufferType) -> Tuple[Any, ...]: ... +def unpack_from(fmt: _FmtType, buffer: _BufferType, offset: int = ...) -> Tuple[Any, ...]: ... +if sys.version_info >= (3, 4): + def iter_unpack(fmt: _FmtType, buffer: _BufferType) -> Iterator[Tuple[Any, ...]]: ... + +def calcsize(fmt: _FmtType) -> int: ... + +class Struct: + if sys.version_info >= (3, 7): + format: str + else: + format: bytes + size: int + + def __init__(self, format: _FmtType) -> None: ... + + def pack(self, *v: Any) -> bytes: ... + def pack_into(self, buffer: _WriteBufferType, offset: int, *v: Any) -> None: ... + def unpack(self, buffer: _BufferType) -> Tuple[Any, ...]: ... + def unpack_from(self, buffer: _BufferType, offset: int = ...) -> Tuple[Any, ...]: ... + if sys.version_info >= (3, 4): + def iter_unpack(self, buffer: _BufferType) -> Iterator[Tuple[Any, ...]]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/sunau.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/sunau.pyi new file mode 100644 index 0000000..6577c31 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/sunau.pyi @@ -0,0 +1,87 @@ +# Stubs for sunau (Python 2 and 3) + +import sys +from typing import Any, NamedTuple, NoReturn, Optional, Text, IO, Union, Tuple + +_File = Union[Text, IO[bytes]] + +class Error(Exception): ... + +AUDIO_FILE_MAGIC: int +AUDIO_FILE_ENCODING_MULAW_8: int +AUDIO_FILE_ENCODING_LINEAR_8: int +AUDIO_FILE_ENCODING_LINEAR_16: int +AUDIO_FILE_ENCODING_LINEAR_24: int +AUDIO_FILE_ENCODING_LINEAR_32: int +AUDIO_FILE_ENCODING_FLOAT: int +AUDIO_FILE_ENCODING_DOUBLE: int +AUDIO_FILE_ENCODING_ADPCM_G721: int +AUDIO_FILE_ENCODING_ADPCM_G722: int +AUDIO_FILE_ENCODING_ADPCM_G723_3: int +AUDIO_FILE_ENCODING_ADPCM_G723_5: int +AUDIO_FILE_ENCODING_ALAW_8: int +AUDIO_UNKNOWN_SIZE: int + +if sys.version_info < (3, 0): + _sunau_params = Tuple[int, int, int, int, str, str] +else: + _sunau_params = NamedTuple('_sunau_params', [ + ('nchannels', int), + ('sampwidth', int), + ('framerate', int), + ('nframes', int), + ('comptype', str), + ('compname', str), + ]) + +class Au_read: + def __init__(self, f: _File) -> None: ... + if sys.version_info >= (3, 3): + def __enter__(self) -> Au_read: ... + def __exit__(self, *args: Any) -> None: ... + def getfp(self) -> Optional[IO[bytes]]: ... + def rewind(self) -> None: ... + def close(self) -> None: ... + def tell(self) -> int: ... + def getnchannels(self) -> int: ... + def getnframes(self) -> int: ... + def getsampwidth(self) -> int: ... + def getframerate(self) -> int: ... + def getcomptype(self) -> str: ... + def getcompname(self) -> str: ... + def getparams(self) -> _sunau_params: ... + def getmarkers(self) -> None: ... + def getmark(self, id: Any) -> NoReturn: ... + def setpos(self, pos: int) -> None: ... + def readframes(self, nframes: int) -> Optional[bytes]: ... + +class Au_write: + def __init__(self, f: _File) -> None: ... + if sys.version_info >= (3, 3): + def __enter__(self) -> Au_write: ... + def __exit__(self, *args: Any) -> None: ... + def setnchannels(self, nchannels: int) -> None: ... + def getnchannels(self) -> int: ... + def setsampwidth(self, sampwidth: int) -> None: ... + def getsampwidth(self) -> int: ... + def setframerate(self, framerate: float) -> None: ... + def getframerate(self) -> int: ... + def setnframes(self, nframes: int) -> None: ... + def getnframes(self) -> int: ... + def setcomptype(self, comptype: str, compname: str) -> None: ... + def getcomptype(self) -> str: ... + def getcompname(self) -> str: ... + def setparams(self, params: _sunau_params) -> None: ... + def getparams(self) -> _sunau_params: ... + def setmark(self, id: Any, pos: Any, name: Any) -> NoReturn: ... + def getmark(self, id: Any) -> NoReturn: ... + def getmarkers(self) -> None: ... + def tell(self) -> int: ... + # should be any bytes-like object after 3.4, but we don't have a type for that + def writeframesraw(self, data: bytes) -> None: ... + def writeframes(self, data: bytes) -> None: ... + def close(self) -> None: ... + +# Returns a Au_read if mode is rb and Au_write if mode is wb +def open(f: _File, mode: Optional[str] = ...) -> Any: ... +openfp = open diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/symtable.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/symtable.pyi new file mode 100644 index 0000000..fd8b9ad --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/symtable.pyi @@ -0,0 +1,45 @@ +import sys +from typing import List, Sequence, Tuple, Text + +def symtable(code: Text, filename: Text, compile_type: Text) -> SymbolTable: ... + +class SymbolTable(object): + def get_type(self) -> str: ... + def get_id(self) -> int: ... + def get_name(self) -> str: ... + def get_lineno(self) -> int: ... + def is_optimized(self) -> bool: ... + def is_nested(self) -> bool: ... + def has_children(self) -> bool: ... + def has_exec(self) -> bool: ... + if sys.version_info < (3, 0): + def has_import_star(self) -> bool: ... + def get_identifiers(self) -> Sequence[str]: ... + def lookup(self, name: str) -> Symbol: ... + def get_symbols(self) -> List[Symbol]: ... + def get_children(self) -> List[SymbolTable]: ... + +class Function(SymbolTable): + def get_parameters(self) -> Tuple[str, ...]: ... + def get_locals(self) -> Tuple[str, ...]: ... + def get_globals(self) -> Tuple[str, ...]: ... + def get_frees(self) -> Tuple[str, ...]: ... + +class Class(SymbolTable): + def get_methods(self) -> Tuple[str, ...]: ... + +class Symbol(object): + def get_name(self) -> str: ... + def is_referenced(self) -> bool: ... + def is_parameter(self) -> bool: ... + def is_global(self) -> bool: ... + def is_declared_global(self) -> bool: ... + def is_local(self) -> bool: ... + if sys.version_info >= (3, 6): + def is_annotated(self) -> bool: ... + def is_free(self) -> bool: ... + def is_imported(self) -> bool: ... + def is_assigned(self) -> bool: ... + def is_namespace(self) -> bool: ... + def get_namespaces(self) -> Sequence[SymbolTable]: ... + def get_namespace(self) -> SymbolTable: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/sysconfig.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/sysconfig.pyi new file mode 100644 index 0000000..5d6c9cb --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/sysconfig.pyi @@ -0,0 +1,19 @@ +# Stubs for sysconfig + +from typing import overload, Any, Dict, IO, List, Optional, Tuple, Union + +@overload +def get_config_vars() -> Dict[str, Any]: ... +@overload +def get_config_vars(arg: str, *args: str) -> List[Any]: ... +def get_config_var(name: str) -> Optional[str]: ... +def get_scheme_names() -> Tuple[str, ...]: ... +def get_path_names() -> Tuple[str, ...]: ... +def get_path(name: str, scheme: str = ..., vars: Optional[Dict[str, Any]] = ..., expand: bool = ...) -> Optional[str]: ... +def get_paths(scheme: str = ..., vars: Optional[Dict[str, Any]] = ..., expand: bool = ...) -> Dict[str, str]: ... +def get_python_version() -> str: ... +def get_platform() -> str: ... +def is_python_build() -> bool: ... +def parse_config_h(fp: IO[Any], vars: Optional[Dict[str, Any]]) -> Dict[str, Any]: ... +def get_config_h_filename() -> str: ... +def get_makefile_filename() -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/syslog.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/syslog.pyi new file mode 100644 index 0000000..1237a6b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/syslog.pyi @@ -0,0 +1,44 @@ +from typing import overload + +LOG_ALERT: int +LOG_AUTH: int +LOG_CONS: int +LOG_CRIT: int +LOG_CRON: int +LOG_DAEMON: int +LOG_DEBUG: int +LOG_EMERG: int +LOG_ERR: int +LOG_INFO: int +LOG_KERN: int +LOG_LOCAL0: int +LOG_LOCAL1: int +LOG_LOCAL2: int +LOG_LOCAL3: int +LOG_LOCAL4: int +LOG_LOCAL5: int +LOG_LOCAL6: int +LOG_LOCAL7: int +LOG_LPR: int +LOG_MAIL: int +LOG_NDELAY: int +LOG_NEWS: int +LOG_NOTICE: int +LOG_NOWAIT: int +LOG_PERROR: int +LOG_PID: int +LOG_SYSLOG: int +LOG_USER: int +LOG_UUCP: int +LOG_WARNING: int + +def LOG_MASK(a: int) -> int: ... +def LOG_UPTO(a: int) -> int: ... +def closelog() -> None: ... +def openlog(ident: str = ..., logoption: int = ..., facility: int = ...) -> None: ... +def setlogmask(x: int) -> int: ... + +@overload +def syslog(priority: int, message: str) -> None: ... +@overload +def syslog(message: str) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/tabnanny.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/tabnanny.pyi new file mode 100644 index 0000000..cbc8353 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/tabnanny.pyi @@ -0,0 +1,22 @@ +# Stubs for tabnanny (Python 2 and 3) + +import os +import sys +from typing import Iterable, Tuple, Union + +if sys.version_info >= (3, 6): + _Path = Union[str, bytes, os.PathLike] +else: + _Path = Union[str, bytes] + +verbose: int +filename_only: int + +class NannyNag(Exception): + def __init__(self, lineno: int, msg: str, line: str) -> None: ... + def get_lineno(self) -> int: ... + def get_msg(self) -> str: ... + def get_line(self) -> str: ... + +def check(file: _Path) -> None: ... +def process_tokens(tokens: Iterable[Tuple[int, str, Tuple[int, int], Tuple[int, int], str]]) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/tarfile.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/tarfile.pyi new file mode 100644 index 0000000..f598494 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/tarfile.pyi @@ -0,0 +1,189 @@ +# Stubs for tarfile + +from typing import ( + Callable, IO, Iterable, Iterator, List, Mapping, Optional, Type, + Union, +) +import os +import sys +from types import TracebackType + +if sys.version_info >= (3, 6): + _Path = Union[bytes, str, os.PathLike] +elif sys.version_info >= (3,): + _Path = Union[bytes, str] +else: + _Path = Union[str, unicode] + +ENCODING: str + +USTAR_FORMAT: int +GNU_FORMAT: int +PAX_FORMAT: int +DEFAULT_FORMAT: int + +REGTYPE: bytes +AREGTYPE: bytes +LNKTYPE: bytes +SYMTYPE: bytes +DIRTYPE: bytes +FIFOTYPE: bytes +CONTTYPE: bytes +CHRTYPE: bytes +BLKTYPE: bytes +GNUTYPE_SPARSE: bytes + +if sys.version_info < (3,): + TAR_PLAIN: int + TAR_GZIPPED: int + +def open(name: Optional[_Path] = ..., mode: str = ..., + fileobj: Optional[IO[bytes]] = ..., bufsize: int = ..., + *, format: Optional[int] = ..., tarinfo: Optional[TarInfo] = ..., + dereference: Optional[bool] = ..., + ignore_zeros: Optional[bool] = ..., + encoding: Optional[str] = ..., errors: str = ..., + pax_headers: Optional[Mapping[str, str]] = ..., + debug: Optional[int] = ..., + errorlevel: Optional[int] = ..., + compresslevel: Optional[int] = ...) -> TarFile: ... + +class TarFile(Iterable[TarInfo]): + name: Optional[_Path] + mode: str + fileobj: Optional[IO[bytes]] + format: Optional[int] + tarinfo: Optional[TarInfo] + dereference: Optional[bool] + ignore_zeros: Optional[bool] + encoding: Optional[str] + errors: str + pax_headers: Optional[Mapping[str, str]] + debug: Optional[int] + errorlevel: Optional[int] + if sys.version_info < (3,): + posix: bool + def __init__(self, name: Optional[_Path] = ..., mode: str = ..., + fileobj: Optional[IO[bytes]] = ..., + format: Optional[int] = ..., tarinfo: Optional[TarInfo] = ..., + dereference: Optional[bool] = ..., + ignore_zeros: Optional[bool] = ..., + encoding: Optional[str] = ..., errors: str = ..., + pax_headers: Optional[Mapping[str, str]] = ..., + debug: Optional[int] = ..., + errorlevel: Optional[int] = ..., + compresslevel: Optional[int] = ...) -> None: ... + def __enter__(self) -> TarFile: ... + def __exit__(self, + exc_type: Optional[Type[BaseException]], + exc_val: Optional[BaseException], + exc_tb: Optional[TracebackType]) -> bool: ... + def __iter__(self) -> Iterator[TarInfo]: ... + @classmethod + def open(cls, name: Optional[_Path] = ..., mode: str = ..., + fileobj: Optional[IO[bytes]] = ..., bufsize: int = ..., + *, format: Optional[int] = ..., tarinfo: Optional[TarInfo] = ..., + dereference: Optional[bool] = ..., + ignore_zeros: Optional[bool] = ..., + encoding: Optional[str] = ..., errors: str = ..., + pax_headers: Optional[Mapping[str, str]] = ..., + debug: Optional[int] = ..., + errorlevel: Optional[int] = ...) -> TarFile: ... + def getmember(self, name: str) -> TarInfo: ... + def getmembers(self) -> List[TarInfo]: ... + def getnames(self) -> List[str]: ... + if sys.version_info >= (3, 5): + def list(self, verbose: bool = ..., + *, members: Optional[List[TarInfo]] = ...) -> None: ... + else: + def list(self, verbose: bool = ...) -> None: ... + def next(self) -> Optional[TarInfo]: ... + if sys.version_info >= (3, 5): + def extractall(self, path: _Path = ..., + members: Optional[List[TarInfo]] = ..., + *, numeric_owner: bool = ...) -> None: ... + else: + def extractall(self, path: _Path = ..., + members: Optional[List[TarInfo]] = ...) -> None: ... + if sys.version_info >= (3, 5): + def extract(self, member: Union[str, TarInfo], path: _Path = ..., + set_attrs: bool = ..., + *, numeric_owner: bool = ...) -> None: ... + elif sys.version_info >= (3,): + def extract(self, member: Union[str, TarInfo], path: _Path = ..., + set_attrs: bool = ...) -> None: ... + else: + def extract(self, member: Union[str, TarInfo], + path: _Path = ...) -> None: ... + def extractfile(self, + member: Union[str, TarInfo]) -> Optional[IO[bytes]]: ... + if sys.version_info >= (3, 7): + def add(self, name: str, arcname: Optional[str] = ..., + recursive: bool = ..., *, + filter: Optional[Callable[[TarInfo], Optional[TarInfo]]] = ...) -> None: ... + elif sys.version_info >= (3,): + def add(self, name: str, arcname: Optional[str] = ..., + recursive: bool = ..., + exclude: Optional[Callable[[str], bool]] = ..., *, + filter: Optional[Callable[[TarInfo], Optional[TarInfo]]] = ...) -> None: ... + else: + def add(self, name: str, arcname: Optional[str] = ..., + recursive: bool = ..., + exclude: Optional[Callable[[str], bool]] = ..., + filter: Optional[Callable[[TarInfo], Optional[TarInfo]]] = ...) -> None: ... + def addfile(self, tarinfo: TarInfo, + fileobj: Optional[IO[bytes]] = ...) -> None: ... + def gettarinfo(self, name: Optional[str] = ..., + arcname: Optional[str] = ..., + fileobj: Optional[IO[bytes]] = ...) -> TarInfo: ... + def close(self) -> None: ... + +def is_tarfile(name: str) -> bool: ... + +if sys.version_info < (3, 8): + def filemode(mode: int) -> str: ... # undocumented + +if sys.version_info < (3,): + class TarFileCompat: + def __init__(self, filename: str, mode: str = ..., + compression: int = ...) -> None: ... + +class TarError(Exception): ... +class ReadError(TarError): ... +class CompressionError(TarError): ... +class StreamError(TarError): ... +class ExtractError(TarError): ... +class HeaderError(TarError): ... + +class TarInfo: + name: str + size: int + mtime: int + mode: int + type: bytes + linkname: str + uid: int + gid: int + uname: str + gname: str + pax_headers: Mapping[str, str] + def __init__(self, name: str = ...) -> None: ... + if sys.version_info >= (3,): + @classmethod + def frombuf(cls, buf: bytes, encoding: str, errors: str) -> TarInfo: ... + else: + @classmethod + def frombuf(cls, buf: bytes) -> TarInfo: ... + @classmethod + def fromtarfile(cls, tarfile: TarFile) -> TarInfo: ... + def tobuf(self, format: Optional[int] = ..., + encoding: Optional[str] = ..., errors: str = ...) -> bytes: ... + def isfile(self) -> bool: ... + def isreg(self) -> bool: ... + def isdir(self) -> bool: ... + def issym(self) -> bool: ... + def islnk(self) -> bool: ... + def ischr(self) -> bool: ... + def isblk(self) -> bool: ... + def isfifo(self) -> bool: ... + def isdev(self) -> bool: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/telnetlib.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/telnetlib.pyi new file mode 100644 index 0000000..50b90b5 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/telnetlib.pyi @@ -0,0 +1,115 @@ +# Stubs for telnetlib (Python 2 and 3) + +import socket +import sys +from typing import Any, Callable, Match, Optional, Pattern, Sequence, Tuple, Union + +DEBUGLEVEL: int +TELNET_PORT: int + +IAC: bytes +DONT: bytes +DO: bytes +WONT: bytes +WILL: bytes +theNULL: bytes + +SE: bytes +NOP: bytes +DM: bytes +BRK: bytes +IP: bytes +AO: bytes +AYT: bytes +EC: bytes +EL: bytes +GA: bytes +SB: bytes + +BINARY: bytes +ECHO: bytes +RCP: bytes +SGA: bytes +NAMS: bytes +STATUS: bytes +TM: bytes +RCTE: bytes +NAOL: bytes +NAOP: bytes +NAOCRD: bytes +NAOHTS: bytes +NAOHTD: bytes +NAOFFD: bytes +NAOVTS: bytes +NAOVTD: bytes +NAOLFD: bytes +XASCII: bytes +LOGOUT: bytes +BM: bytes +DET: bytes +SUPDUP: bytes +SUPDUPOUTPUT: bytes +SNDLOC: bytes +TTYPE: bytes +EOR: bytes +TUID: bytes +OUTMRK: bytes +TTYLOC: bytes +VT3270REGIME: bytes +X3PAD: bytes +NAWS: bytes +TSPEED: bytes +LFLOW: bytes +LINEMODE: bytes +XDISPLOC: bytes +OLD_ENVIRON: bytes +AUTHENTICATION: bytes +ENCRYPT: bytes +NEW_ENVIRON: bytes + +TN3270E: bytes +XAUTH: bytes +CHARSET: bytes +RSP: bytes +COM_PORT_OPTION: bytes +SUPPRESS_LOCAL_ECHO: bytes +TLS: bytes +KERMIT: bytes +SEND_URL: bytes +FORWARD_X: bytes +PRAGMA_LOGON: bytes +SSPI_LOGON: bytes +PRAGMA_HEARTBEAT: bytes +EXOPL: bytes +NOOPT: bytes + +class Telnet: + def __init__(self, host: Optional[str] = ..., port: int = ..., + timeout: int = ...) -> None: ... + def open(self, host: str, port: int = ..., timeout: int = ...) -> None: ... + def msg(self, msg: str, *args: Any) -> None: ... + def set_debuglevel(self, debuglevel: int) -> None: ... + def close(self) -> None: ... + def get_socket(self) -> socket.socket: ... + def fileno(self) -> int: ... + def write(self, buffer: bytes) -> None: ... + def read_until(self, match: bytes, timeout: Optional[int] = ...) -> bytes: ... + def read_all(self) -> bytes: ... + def read_some(self) -> bytes: ... + def read_very_eager(self) -> bytes: ... + def read_eager(self) -> bytes: ... + def read_lazy(self) -> bytes: ... + def read_very_lazy(self) -> bytes: ... + def read_sb_data(self) -> bytes: ... + def set_option_negotiation_callback(self, callback: Optional[Callable[[socket.socket, bytes, bytes], Any]]) -> None: ... + def process_rawq(self) -> None: ... + def rawq_getchar(self) -> bytes: ... + def fill_rawq(self) -> None: ... + def sock_avail(self) -> bool: ... + def interact(self) -> None: ... + def mt_interact(self) -> None: ... + def listener(self) -> None: ... + def expect(self, list: Sequence[Union[Pattern[bytes], bytes]], timeout: Optional[int] = ...) -> Tuple[int, Optional[Match[bytes]], bytes]: ... + if sys.version_info >= (3, 6): + def __enter__(self) -> Telnet: ... + def __exit__(self, type: Any, value: Any, traceback: Any) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/termios.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/termios.pyi new file mode 100644 index 0000000..d788e16 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/termios.pyi @@ -0,0 +1,248 @@ +# Stubs for termios + +from typing import IO, List, Union + +_FD = Union[int, IO[str]] +_Attr = List[Union[int, List[bytes]]] + +# TODO constants not really documented +B0: int +B1000000: int +B110: int +B115200: int +B1152000: int +B1200: int +B134: int +B150: int +B1500000: int +B1800: int +B19200: int +B200: int +B2000000: int +B230400: int +B2400: int +B2500000: int +B300: int +B3000000: int +B3500000: int +B38400: int +B4000000: int +B460800: int +B4800: int +B50: int +B500000: int +B57600: int +B576000: int +B600: int +B75: int +B921600: int +B9600: int +BRKINT: int +BS0: int +BS1: int +BSDLY: int +CBAUD: int +CBAUDEX: int +CDSUSP: int +CEOF: int +CEOL: int +CEOT: int +CERASE: int +CFLUSH: int +CIBAUD: int +CINTR: int +CKILL: int +CLNEXT: int +CLOCAL: int +CQUIT: int +CR0: int +CR1: int +CR2: int +CR3: int +CRDLY: int +CREAD: int +CRPRNT: int +CRTSCTS: int +CS5: int +CS6: int +CS7: int +CS8: int +CSIZE: int +CSTART: int +CSTOP: int +CSTOPB: int +CSUSP: int +CWERASE: int +ECHO: int +ECHOCTL: int +ECHOE: int +ECHOK: int +ECHOKE: int +ECHONL: int +ECHOPRT: int +EXTA: int +EXTB: int +FF0: int +FF1: int +FFDLY: int +FIOASYNC: int +FIOCLEX: int +FIONBIO: int +FIONCLEX: int +FIONREAD: int +FLUSHO: int +HUPCL: int +ICANON: int +ICRNL: int +IEXTEN: int +IGNBRK: int +IGNCR: int +IGNPAR: int +IMAXBEL: int +INLCR: int +INPCK: int +IOCSIZE_MASK: int +IOCSIZE_SHIFT: int +ISIG: int +ISTRIP: int +IUCLC: int +IXANY: int +IXOFF: int +IXON: int +NCC: int +NCCS: int +NL0: int +NL1: int +NLDLY: int +NOFLSH: int +N_MOUSE: int +N_PPP: int +N_SLIP: int +N_STRIP: int +N_TTY: int +OCRNL: int +OFDEL: int +OFILL: int +OLCUC: int +ONLCR: int +ONLRET: int +ONOCR: int +OPOST: int +PARENB: int +PARMRK: int +PARODD: int +PENDIN: int +TAB0: int +TAB1: int +TAB2: int +TAB3: int +TABDLY: int +TCFLSH: int +TCGETA: int +TCGETS: int +TCIFLUSH: int +TCIOFF: int +TCIOFLUSH: int +TCION: int +TCOFLUSH: int +TCOOFF: int +TCOON: int +TCSADRAIN: int +TCSAFLUSH: int +TCSANOW: int +TCSBRK: int +TCSBRKP: int +TCSETA: int +TCSETAF: int +TCSETAW: int +TCSETS: int +TCSETSF: int +TCSETSW: int +TCXONC: int +TIOCCONS: int +TIOCEXCL: int +TIOCGETD: int +TIOCGICOUNT: int +TIOCGLCKTRMIOS: int +TIOCGPGRP: int +TIOCGSERIAL: int +TIOCGSOFTCAR: int +TIOCGWINSZ: int +TIOCINQ: int +TIOCLINUX: int +TIOCMBIC: int +TIOCMBIS: int +TIOCMGET: int +TIOCMIWAIT: int +TIOCMSET: int +TIOCM_CAR: int +TIOCM_CD: int +TIOCM_CTS: int +TIOCM_DSR: int +TIOCM_DTR: int +TIOCM_LE: int +TIOCM_RI: int +TIOCM_RNG: int +TIOCM_RTS: int +TIOCM_SR: int +TIOCM_ST: int +TIOCNOTTY: int +TIOCNXCL: int +TIOCOUTQ: int +TIOCPKT: int +TIOCPKT_DATA: int +TIOCPKT_DOSTOP: int +TIOCPKT_FLUSHREAD: int +TIOCPKT_FLUSHWRITE: int +TIOCPKT_NOSTOP: int +TIOCPKT_START: int +TIOCPKT_STOP: int +TIOCSCTTY: int +TIOCSERCONFIG: int +TIOCSERGETLSR: int +TIOCSERGETMULTI: int +TIOCSERGSTRUCT: int +TIOCSERGWILD: int +TIOCSERSETMULTI: int +TIOCSERSWILD: int +TIOCSER_TEMT: int +TIOCSETD: int +TIOCSLCKTRMIOS: int +TIOCSPGRP: int +TIOCSSERIAL: int +TIOCSSOFTCAR: int +TIOCSTI: int +TIOCSWINSZ: int +TOSTOP: int +VDISCARD: int +VEOF: int +VEOL: int +VEOL2: int +VERASE: int +VINTR: int +VKILL: int +VLNEXT: int +VMIN: int +VQUIT: int +VREPRINT: int +VSTART: int +VSTOP: int +VSUSP: int +VSWTC: int +VSWTCH: int +VT0: int +VT1: int +VTDLY: int +VTIME: int +VWERASE: int +XCASE: int +XTABS: int + +def tcgetattr(fd: _FD) -> _Attr: ... +def tcsetattr(fd: _FD, when: int, attributes: _Attr) -> None: ... +def tcsendbreak(fd: _FD, duration: int) -> None: ... +def tcdrain(fd: _FD) -> None: ... +def tcflush(fd: _FD, queue: int) -> None: ... +def tcflow(fd: _FD, action: int) -> None: ... + +class error(Exception): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/threading.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/threading.pyi new file mode 100644 index 0000000..3008f7b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/threading.pyi @@ -0,0 +1,187 @@ +# Stubs for threading + +from typing import ( + Any, Callable, Iterable, List, Mapping, Optional, Tuple, Type, Union, + TypeVar, +) +from types import FrameType, TracebackType +import sys + +# TODO recursive type +_TF = Callable[[FrameType, str, Any], Optional[Callable[..., Any]]] + +_PF = Callable[[FrameType, str, Any], None] +_T = TypeVar('_T') + + +def active_count() -> int: ... +if sys.version_info < (3,): + def activeCount() -> int: ... + +def current_thread() -> Thread: ... +def currentThread() -> Thread: ... + +if sys.version_info >= (3,): + def get_ident() -> int: ... + +def enumerate() -> List[Thread]: ... + +if sys.version_info >= (3, 4): + def main_thread() -> Thread: ... + +def settrace(func: _TF) -> None: ... +def setprofile(func: _PF) -> None: ... +def stack_size(size: int = ...) -> int: ... + +if sys.version_info >= (3,): + TIMEOUT_MAX: float + +class ThreadError(Exception): ... + + +class local(object): + def __getattribute__(self, name: str) -> Any: ... + def __setattr__(self, name: str, value: Any) -> None: ... + def __delattr__(self, name: str) -> None: ... + + +class Thread: + name: str + ident: Optional[int] + daemon: bool + if sys.version_info >= (3,): + def __init__(self, group: None = ..., + target: Optional[Callable[..., Any]] = ..., + name: Optional[str] = ..., + args: Iterable = ..., + kwargs: Mapping[str, Any] = ..., + *, daemon: Optional[bool] = ...) -> None: ... + else: + def __init__(self, group: None = ..., + target: Optional[Callable[..., Any]] = ..., + name: Optional[str] = ..., + args: Iterable = ..., + kwargs: Mapping[str, Any] = ...) -> None: ... + def start(self) -> None: ... + def run(self) -> None: ... + def join(self, timeout: Optional[float] = ...) -> None: ... + def getName(self) -> str: ... + def setName(self, name: str) -> None: ... + def is_alive(self) -> bool: ... + def isAlive(self) -> bool: ... + def isDaemon(self) -> bool: ... + def setDaemon(self, daemonic: bool) -> None: ... + + +class _DummyThread(Thread): ... + + +class Lock: + def __init__(self) -> None: ... + def __enter__(self) -> bool: ... + def __exit__(self, exc_type: Optional[Type[BaseException]], + exc_val: Optional[BaseException], + exc_tb: Optional[TracebackType]) -> bool: ... + if sys.version_info >= (3,): + def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ... + else: + def acquire(self, blocking: bool = ...) -> bool: ... + def release(self) -> None: ... + def locked(self) -> bool: ... + + +class _RLock: + def __init__(self) -> None: ... + def __enter__(self) -> bool: ... + def __exit__(self, exc_type: Optional[Type[BaseException]], + exc_val: Optional[BaseException], + exc_tb: Optional[TracebackType]) -> bool: ... + if sys.version_info >= (3,): + def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ... + else: + def acquire(self, blocking: bool = ...) -> bool: ... + def release(self) -> None: ... + + +RLock = _RLock + + +class Condition: + def __init__(self, lock: Union[Lock, _RLock, None] = ...) -> None: ... + def __enter__(self) -> bool: ... + def __exit__(self, exc_type: Optional[Type[BaseException]], + exc_val: Optional[BaseException], + exc_tb: Optional[TracebackType]) -> bool: ... + if sys.version_info >= (3,): + def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ... + else: + def acquire(self, blocking: bool = ...) -> bool: ... + def release(self) -> None: ... + def wait(self, timeout: Optional[float] = ...) -> bool: ... + if sys.version_info >= (3,): + def wait_for(self, predicate: Callable[[], _T], + timeout: Optional[float] = ...) -> _T: ... + def notify(self, n: int = ...) -> None: ... + def notify_all(self) -> None: ... + def notifyAll(self) -> None: ... + + +class Semaphore: + def __init__(self, value: int = ...) -> None: ... + def __enter__(self) -> bool: ... + def __exit__(self, exc_type: Optional[Type[BaseException]], + exc_val: Optional[BaseException], + exc_tb: Optional[TracebackType]) -> bool: ... + if sys.version_info >= (3,): + def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ... + else: + def acquire(self, blocking: bool = ...) -> bool: ... + def release(self) -> None: ... + +class BoundedSemaphore: + def __init__(self, value: int = ...) -> None: ... + def __enter__(self) -> bool: ... + def __exit__(self, exc_type: Optional[Type[BaseException]], + exc_val: Optional[BaseException], + exc_tb: Optional[TracebackType]) -> bool: ... + if sys.version_info >= (3,): + def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ... + else: + def acquire(self, blocking: bool = ...) -> bool: ... + def release(self) -> None: ... + + +class Event: + def __init__(self) -> None: ... + def is_set(self) -> bool: ... + if sys.version_info < (3,): + def isSet(self) -> bool: ... + def set(self) -> None: ... + def clear(self) -> None: ... + def wait(self, timeout: Optional[float] = ...) -> bool: ... + + +class Timer(Thread): + if sys.version_info >= (3,): + def __init__(self, interval: float, function: Callable[..., None], + args: Optional[List[Any]] = ..., + kwargs: Optional[Mapping[str, Any]] = ...) -> None: ... + else: + def __init__(self, interval: float, function: Callable[..., None], + args: List[Any] = ..., + kwargs: Mapping[str, Any] = ...) -> None: ... + def cancel(self) -> None: ... + + +if sys.version_info >= (3,): + class Barrier: + parties: int + n_waiting: int + broken: bool + def __init__(self, parties: int, action: Optional[Callable[[], None]] = ..., + timeout: Optional[float] = ...) -> None: ... + def wait(self, timeout: Optional[float] = ...) -> int: ... + def reset(self) -> None: ... + def abort(self) -> None: ... + + class BrokenBarrierError(RuntimeError): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/time.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/time.pyi new file mode 100644 index 0000000..b04e616 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/time.pyi @@ -0,0 +1,103 @@ +"""Stub file for the 'time' module.""" +# See https://docs.python.org/3/library/time.html + +import sys +from typing import Any, NamedTuple, Tuple, Union, Optional +if sys.version_info >= (3, 3): + from types import SimpleNamespace + +_TimeTuple = Tuple[int, int, int, int, int, int, int, int, int] + +if sys.version_info < (3, 3): + accept2dyear: bool +altzone: int +daylight: int +timezone: int +tzname: Tuple[str, str] + +if sys.version_info >= (3, 7) and sys.platform != 'win32': + CLOCK_BOOTTIME: int # Linux + CLOCK_PROF: int # FreeBSD, NetBSD, OpenBSD + CLOCK_UPTIME: int # FreeBSD, OpenBSD + +if sys.version_info >= (3, 3) and sys.platform != 'win32': + CLOCK_HIGHRES: int = ... # Solaris only + CLOCK_MONOTONIC: int = ... # Unix only + CLOCK_MONOTONIC_RAW: int = ... # Linux 2.6.28 or later + CLOCK_PROCESS_CPUTIME_ID: int = ... # Unix only + CLOCK_REALTIME: int = ... # Unix only + CLOCK_THREAD_CPUTIME_ID: int = ... # Unix only + + +if sys.version_info >= (3, 3): + class struct_time( + NamedTuple( + '_struct_time', + [('tm_year', int), ('tm_mon', int), ('tm_mday', int), + ('tm_hour', int), ('tm_min', int), ('tm_sec', int), + ('tm_wday', int), ('tm_yday', int), ('tm_isdst', int), + ('tm_zone', str), ('tm_gmtoff', int)] + ) + ): + def __init__( + self, + o: Union[ + Tuple[int, int, int, int, int, int, int, int, int], + Tuple[int, int, int, int, int, int, int, int, int, str], + Tuple[int, int, int, int, int, int, int, int, int, str, int] + ], + _arg: Any = ..., + ) -> None: ... + def __new__( + cls, + o: Union[ + Tuple[int, int, int, int, int, int, int, int, int], + Tuple[int, int, int, int, int, int, int, int, int, str], + Tuple[int, int, int, int, int, int, int, int, int, str, int] + ], + _arg: Any = ..., + ) -> struct_time: ... +else: + class struct_time( + NamedTuple( + '_struct_time', + [('tm_year', int), ('tm_mon', int), ('tm_mday', int), + ('tm_hour', int), ('tm_min', int), ('tm_sec', int), + ('tm_wday', int), ('tm_yday', int), ('tm_isdst', int)] + ) + ): + def __init__(self, o: _TimeTuple, _arg: Any = ...) -> None: ... + def __new__(cls, o: _TimeTuple, _arg: Any = ...) -> struct_time: ... + +def asctime(t: Union[_TimeTuple, struct_time] = ...) -> str: ... +def clock() -> float: ... +def ctime(secs: Optional[float] = ...) -> str: ... +def gmtime(secs: Optional[float] = ...) -> struct_time: ... +def localtime(secs: Optional[float] = ...) -> struct_time: ... +def mktime(t: Union[_TimeTuple, struct_time]) -> float: ... +def sleep(secs: float) -> None: ... +def strftime(format: str, t: Union[_TimeTuple, struct_time] = ...) -> str: ... +def strptime(string: str, format: str = ...) -> struct_time: ... +def time() -> float: ... +if sys.platform != 'win32': + def tzset() -> None: ... # Unix only + +if sys.version_info >= (3, 3): + def get_clock_info(name: str) -> SimpleNamespace: ... + def monotonic() -> float: ... + def perf_counter() -> float: ... + def process_time() -> float: ... + if sys.platform != 'win32': + def clock_getres(clk_id: int) -> float: ... # Unix only + def clock_gettime(clk_id: int) -> float: ... # Unix only + def clock_settime(clk_id: int, time: float) -> None: ... # Unix only + +if sys.version_info >= (3, 7): + def clock_gettime_ns(clock_id: int) -> int: ... + def clock_settime_ns(clock_id: int, time: int) -> int: ... + def monotonic_ns() -> int: ... + def perf_counter_ns() -> int: ... + def process_time_ns() -> int: ... + def time_ns() -> int: ... + def thread_time() -> float: ... + def thread_time_ns() -> int: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/timeit.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/timeit.pyi new file mode 100644 index 0000000..bc4cbba --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/timeit.pyi @@ -0,0 +1,34 @@ +# Stubs for timeit (Python 2 and 3) + +import sys +from typing import Any, Callable, Dict, IO, List, Optional, Sequence, Text, Tuple, Union + +_str = Union[str, Text] +_Timer = Callable[[], float] +_stmt = Union[_str, Callable[[], Any]] + +default_timer: _Timer + +class Timer: + if sys.version_info >= (3, 5): + def __init__(self, stmt: _stmt = ..., setup: _stmt = ..., timer: _Timer = ..., + globals: Optional[Dict[str, Any]] = ...) -> None: ... + else: + def __init__(self, stmt: _stmt = ..., setup: _stmt = ..., timer: _Timer = ...) -> None: ... + def print_exc(self, file: Optional[IO[str]] = ...) -> None: ... + def timeit(self, number: int = ...) -> float: ... + def repeat(self, repeat: int = ..., number: int = ...) -> List[float]: ... + if sys.version_info >= (3, 6): + def autorange(self, callback: Optional[Callable[[int, float], Any]] = ...) -> Tuple[int, float]: ... + +if sys.version_info >= (3, 5): + def timeit(stmt: _stmt = ..., setup: _stmt = ..., timer: _Timer = ..., + number: int = ..., globals: Optional[Dict[str, Any]] = ...) -> float: ... + def repeat(stmt: _stmt = ..., setup: _stmt = ..., timer: _Timer = ..., + repeat: int = ..., number: int = ..., globals: Optional[Dict[str, Any]] = ...) -> List[float]: ... +else: + def timeit(stmt: _stmt = ..., setup: _stmt = ..., timer: _Timer = ..., + number: int = ...) -> float: ... + def repeat(stmt: _stmt = ..., setup: _stmt = ..., timer: _Timer = ..., + repeat: int = ..., number: int = ...) -> List[float]: ... +def main(args: Optional[Sequence[str]]) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/token.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/token.pyi new file mode 100644 index 0000000..fa50862 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/token.pyi @@ -0,0 +1,71 @@ +import sys +from typing import Dict + +ENDMARKER: int +NAME: int +NUMBER: int +STRING: int +NEWLINE: int +INDENT: int +DEDENT: int +LPAR: int +RPAR: int +LSQB: int +RSQB: int +COLON: int +COMMA: int +SEMI: int +PLUS: int +MINUS: int +STAR: int +SLASH: int +VBAR: int +AMPER: int +LESS: int +GREATER: int +EQUAL: int +DOT: int +PERCENT: int +if sys.version_info < (3,): + BACKQUOTE: int +LBRACE: int +RBRACE: int +EQEQUAL: int +NOTEQUAL: int +LESSEQUAL: int +GREATEREQUAL: int +TILDE: int +CIRCUMFLEX: int +LEFTSHIFT: int +RIGHTSHIFT: int +DOUBLESTAR: int +PLUSEQUAL: int +MINEQUAL: int +STAREQUAL: int +SLASHEQUAL: int +PERCENTEQUAL: int +AMPEREQUAL: int +VBAREQUAL: int +CIRCUMFLEXEQUAL: int +LEFTSHIFTEQUAL: int +RIGHTSHIFTEQUAL: int +DOUBLESTAREQUAL: int +DOUBLESLASH: int +DOUBLESLASHEQUAL: int +AT: int +if sys.version_info >= (3,): + RARROW: int + ELLIPSIS: int +if sys.version_info >= (3, 5): + ATEQUAL: int + AWAIT: int + ASYNC: int +OP: int +ERRORTOKEN: int +N_TOKENS: int +NT_OFFSET: int +tok_name: Dict[int, str] + +def ISTERMINAL(x: int) -> bool: ... +def ISNONTERMINAL(x: int) -> bool: ... +def ISEOF(x: int) -> bool: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/trace.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/trace.pyi new file mode 100644 index 0000000..af06d39 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/trace.pyi @@ -0,0 +1,35 @@ +# Stubs for trace (Python 2 and 3) + +import os +import sys +import types +from typing import Any, Callable, Mapping, Optional, Sequence, Text, Tuple, TypeVar, Union + +_T = TypeVar('_T') +_localtrace = Callable[[types.FrameType, str, Any], Callable[..., Any]] + +if sys.version_info >= (3, 6): + _Path = Union[Text, os.PathLike] +else: + _Path = Text + +class CoverageResults: + def update(self, other: CoverageResults) -> None: ... + def write_results(self, show_missing: bool = ..., summary: bool = ..., coverdir: Optional[_Path] = ...) -> None: ... + def write_results_file(self, path: _Path, lines: Sequence[str], lnotab: Any, lines_hit: Mapping[int, int], encoding: Optional[str] = ...) -> Tuple[int, int]: ... + +class Trace: + def __init__(self, count: int = ..., trace: int = ..., countfuncs: int = ..., countcallers: int = ..., + ignoremods: Sequence[str] = ..., ignoredirs: Sequence[str] = ..., infile: Optional[_Path] = ..., + outfile: Optional[_Path] = ..., timing: bool = ...) -> None: ... + def run(self, cmd: Union[str, types.CodeType]) -> None: ... + def runctx(self, cmd: Union[str, types.CodeType], globals: Optional[Mapping[str, Any]] = ..., locals: Optional[Mapping[str, Any]] = ...) -> None: ... + def runfunc(self, func: Callable[..., _T], *args: Any, **kw: Any) -> _T: ... + def file_module_function_of(self, frame: types.FrameType) -> Tuple[str, Optional[str], str]: ... + def globaltrace_trackcallers(self, frame: types.FrameType, why: str, arg: Any) -> None: ... + def globaltrace_countfuncs(self, frame: types.FrameType, why: str, arg: Any) -> None: ... + def globaltrace_lt(self, frame: types.FrameType, why: str, arg: Any) -> None: ... + def localtrace_trace_and_count(self, frame: types.FrameType, why: str, arg: Any) -> _localtrace: ... + def localtrace_trace(self, frame: types.FrameType, why: str, arg: Any) -> _localtrace: ... + def localtrace_count(self, frame: types.FrameType, why: str, arg: Any) -> _localtrace: ... + def results(self) -> CoverageResults: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/traceback.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/traceback.pyi new file mode 100644 index 0000000..7adc5eb --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/traceback.pyi @@ -0,0 +1,120 @@ +# Stubs for traceback + +from typing import Any, Dict, Generator, IO, Iterator, List, Mapping, Optional, Protocol, Tuple, Type, Iterable +from types import FrameType, TracebackType +import sys + +_PT = Tuple[str, int, str, Optional[str]] + + +def print_tb(tb: Optional[TracebackType], limit: Optional[int] = ..., + file: Optional[IO[str]] = ...) -> None: ... +if sys.version_info >= (3,): + def print_exception(etype: Optional[Type[BaseException]], + value: Optional[BaseException], + tb: Optional[TracebackType], limit: Optional[int] = ..., + file: Optional[IO[str]] = ..., + chain: bool = ...) -> None: ... + def print_exc(limit: Optional[int] = ..., file: Optional[IO[str]] = ..., + chain: bool = ...) -> None: ... + def print_last(limit: Optional[int] = ..., file: Optional[IO[str]] = ..., + chain: bool = ...) -> None: ... +else: + def print_exception(etype: Optional[Type[BaseException]], + value: Optional[BaseException], + tb: Optional[TracebackType], limit: Optional[int] = ..., + file: Optional[IO[str]] = ...) -> None: ... + def print_exc(limit: Optional[int] = ..., + file: Optional[IO[str]] = ...) -> None: ... + def print_last(limit: Optional[int] = ..., + file: Optional[IO[str]] = ...) -> None: ... +def print_stack(f: Optional[FrameType] = ..., limit: Optional[int] = ..., + file: Optional[IO[str]] = ...) -> None: ... + +if sys.version_info >= (3, 5): + def extract_tb(tb: Optional[TracebackType], limit: Optional[int] = ...) -> StackSummary: ... + def extract_stack(f: Optional[FrameType] = ..., + limit: Optional[int] = ...) -> StackSummary: ... + def format_list(extracted_list: List[FrameSummary]) -> List[str]: ... + class _Writer(Protocol): + def write(self, s: str) -> Any: ... + # undocumented + def print_list(extracted_list: List[FrameSummary], file: Optional[_Writer] = ...) -> None: ... +else: + def extract_tb(tb: Optional[TracebackType], limit: Optional[int] = ...) -> List[_PT]: ... + def extract_stack(f: Optional[FrameType] = ..., + limit: Optional[int] = ...) -> List[_PT]: ... + def format_list(extracted_list: List[_PT]) -> List[str]: ... +def format_exception_only(etype: Optional[Type[BaseException]], + value: Optional[BaseException]) -> List[str]: ... +if sys.version_info >= (3,): + def format_exception(etype: Optional[Type[BaseException]], value: Optional[BaseException], + tb: Optional[TracebackType], limit: Optional[int] = ..., + chain: bool = ...) -> List[str]: ... + def format_exc(limit: Optional[int] = ..., chain: bool = ...) -> str: ... +else: + def format_exception(etype: Optional[Type[BaseException]], + value: Optional[BaseException], + tb: Optional[TracebackType], + limit: Optional[int] = ...) -> List[str]: ... + def format_exc(limit: Optional[int] = ...) -> str: ... +def format_tb(tb: Optional[TracebackType], limit: Optional[int] = ...) -> List[str]: ... +def format_stack(f: Optional[FrameType] = ..., + limit: Optional[int] = ...) -> List[str]: ... +if sys.version_info >= (3, 4): + def clear_frames(tb: TracebackType) -> None: ... +if sys.version_info >= (3, 5): + def walk_stack(f: Optional[FrameType]) -> Iterator[Tuple[FrameType, int]]: ... + def walk_tb(tb: Optional[TracebackType]) -> Iterator[Tuple[FrameType, int]]: ... +if sys.version_info < (3,): + def tb_lineno(tb: TracebackType) -> int: ... + + +if sys.version_info >= (3, 5): + class TracebackException: + __cause__ = ... # type:TracebackException + __context__ = ... # type:TracebackException + __suppress_context__: bool + stack: StackSummary + exc_type: Type[BaseException] + filename: str + lineno: int + text: str + offset: int + msg: str + def __init__(self, exc_type: Type[BaseException], + exc_value: BaseException, exc_traceback: TracebackType, + *, limit: Optional[int] = ..., lookup_lines: bool = ..., + capture_locals: bool = ...) -> None: ... + @classmethod + def from_exception(cls, exc: BaseException, + *, limit: Optional[int] = ..., + lookup_lines: bool = ..., + capture_locals: bool = ...) -> TracebackException: ... + def format(self, *, chain: bool = ...) -> Generator[str, None, None]: ... + def format_exception_only(self) -> Generator[str, None, None]: ... + + class FrameSummary(Iterable): + filename: str + lineno: int + name: str + line: str + locals: Optional[Dict[str, str]] + def __init__(self, filename: str, lineno: int, name: str, + lookup_line: bool = ..., + locals: Optional[Mapping[str, str]] = ..., + line: Optional[str] = ...) -> None: ... + # TODO: more precise typing for __getitem__ and __iter__, + # for a namedtuple-like view on (filename, lineno, name, str). + def __getitem__(self, i: int) -> Any: ... + def __iter__(self) -> Iterator[Any]: ... + + class StackSummary(List[FrameSummary]): + @classmethod + def extract(cls, + frame_gen: Generator[Tuple[FrameType, int], None, None], + *, limit: Optional[int] = ..., lookup_lines: bool = ..., + capture_locals: bool = ...) -> StackSummary: ... + @classmethod + def from_list(cls, a_list: List[_PT]) -> StackSummary: ... + def format(self) -> List[str]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/tty.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/tty.pyi new file mode 100644 index 0000000..2bce1ec --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/tty.pyi @@ -0,0 +1,17 @@ +# Stubs for tty (Python 3.6) + +from typing import IO, Union + +_FD = Union[int, IO[str]] + +# XXX: Undocumented integer constants +IFLAG: int +OFLAG: int +CFLAG: int +LFLAG: int +ISPEED: int +OSPEED: int +CC: int + +def setraw(fd: _FD, when: int = ...) -> None: ... +def setcbreak(fd: _FD, when: int = ...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/turtle.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/turtle.pyi new file mode 100644 index 0000000..c9d9d90 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/turtle.pyi @@ -0,0 +1,501 @@ +from typing import Tuple, overload, Optional, Union, Dict, Any, Sequence, TypeVar, List, Callable, Text +import sys +if sys.version_info >= (3,): + from tkinter import Canvas, PhotoImage +else: + # TODO: Replace these aliases once we have Python 2 stubs for the Tkinter module. + Canvas = Any + PhotoImage = Any + +# Note: '_Color' is the alias we use for arguments and _AnyColor is the +# alias we use for return types. Really, these two aliases should be the +# same, but as per the "no union returns" typeshed policy, we'll return +# Any instead. +_Color = Union[Text, Tuple[float, float, float]] +_AnyColor = Any + +# TODO: Replace this with a TypedDict once it becomes standardized. +_PenState = Dict[str, Any] + +_Speed = Union[str, float] +_PolygonCoords = Sequence[Tuple[float, float]] + +# TODO: Type this more accurately +# Vec2D is actually a custom subclass of 'tuple'. +Vec2D = Tuple[float, float] + +class TurtleScreenBase(object): + cv: Canvas = ... + canvwidth: int = ... + canvheight: int = ... + xscale: float = ... + yscale: float = ... + def __init__(self, cv: Canvas) -> None: ... + if sys.version_info >= (3,): + def mainloop(self) -> None: ... + def textinput(self, title: str, prompt: str) -> Optional[str]: ... + def numinput(self, title: str, prompt: str, default: Optional[float] = ..., minval: Optional[float] = ..., maxval: Optional[float] = ...) -> Optional[float]: ... + +class Terminator(Exception): ... +class TurtleGraphicsError(Exception): ... + +class Shape(object): + def __init__(self, type_: str, data: Union[_PolygonCoords, PhotoImage, None] = ...) -> None: ... + def addcomponent(self, poly: _PolygonCoords, fill: _Color, outline: Optional[_Color] = ...) -> None: ... + +class TurtleScreen(TurtleScreenBase): + def __init__(self, cv: Canvas, mode: str = ..., colormode: float = ..., delay: int = ...) -> None: ... + def clear(self) -> None: ... + @overload + def mode(self) -> str: ... + @overload + def mode(self, mode: str) -> None: ... + def setworldcoordinates(self, llx: float, lly: float, urx: float, ury: float) -> None: ... + def register_shape(self, name: str, shape: Union[_PolygonCoords, Shape, None] = ...) -> None: ... + @overload + def colormode(self) -> float: ... + @overload + def colormode(self, cmode: float) -> None: ... + def reset(self) -> None: ... + def turtles(self) -> List[Turtle]: ... + @overload + def bgcolor(self) -> _AnyColor: ... + @overload + def bgcolor(self, color: _Color) -> None: ... + @overload + def bgcolor(self, r: float, g: float, b: float) -> None: ... + @overload + def tracer(self) -> int: ... + @overload + def tracer(self, n: int, delay: Optional[int] = ...) -> None: ... + @overload + def delay(self) -> int: ... + @overload + def delay(self, delay: int) -> None: ... + def update(self) -> None: ... + def window_width(self) -> int: ... + def window_height(self) -> int: ... + def getcanvas(self) -> Canvas: ... + def getshapes(self) -> List[str]: ... + def onclick(self, fun: Callable[[float, float], Any], btn: int = ..., add: Optional[Any] = ...) -> None: ... + def onkey(self, fun: Callable[[], Any], key: str) -> None: ... + def listen(self, xdummy: Optional[float] = ..., ydummy: Optional[float] = ...) -> None: ... + def ontimer(self, fun: Callable[[], Any], t: int = ...) -> None: ... + @overload + def bgpic(self) -> str: ... + @overload + def bgpic(self, picname: str) -> None: ... + @overload + def screensize(self) -> Tuple[int, int]: ... + @overload + def screensize(self, canvwidth: int, canvheight: int, bg: Optional[_Color] = ...) -> None: ... + onscreenclick = onclick + resetscreen = reset + clearscreen = clear + addshape = register_shape + if sys.version_info >= (3,): + def onkeypress(self, fun: Callable[[], Any], key: Optional[str] = ...) -> None: ... + onkeyrelease = onkey + +class TNavigator(object): + START_ORIENTATION: Dict[str, Vec2D] = ... + DEFAULT_MODE: str = ... + DEFAULT_ANGLEOFFSET: int = ... + DEFAULT_ANGLEORIENT: int = ... + def __init__(self, mode: str = ...) -> None: ... + def reset(self) -> None: ... + def degrees(self, fullcircle: float = ...) -> None: ... + def radians(self) -> None: ... + def forward(self, distance: float) -> None: ... + def back(self, distance: float) -> None: ... + def right(self, angle: float) -> None: ... + def left(self, angle: float) -> None: ... + def pos(self) -> Vec2D: ... + def xcor(self) -> float: ... + def ycor(self) -> float: ... + @overload + def goto(self, x: Tuple[float, float]) -> None: ... + @overload + def goto(self, x: float, y: float) -> None: ... + def home(self) -> None: ... + def setx(self, x: float) -> None: ... + def sety(self, y: float) -> None: ... + @overload + def distance(self, x: Union[TNavigator, Tuple[float, float]]) -> float: ... + @overload + def distance(self, x: float, y: float) -> float: ... + @overload + def towards(self, x: Union[TNavigator, Tuple[float, float]]) -> float: ... + @overload + def towards(self, x: float, y: float) -> float: ... + def heading(self) -> float: ... + def setheading(self, to_angle: float) -> None: ... + def circle(self, radius: float, extent: Optional[float] = ..., steps: Optional[int] = ...) -> None: ... + fd = forward + bk = back + backward = back + rt = right + lt = left + position = pos + setpos = goto + setposition = goto + seth = setheading + + +class TPen(object): + def __init__(self, resizemode: str = ...) -> None: ... + @overload + def resizemode(self) -> str: ... + @overload + def resizemode(self, rmode: str) -> None: ... + @overload + def pensize(self) -> int: ... + @overload + def pensize(self, width: int) -> None: ... + def penup(self) -> None: ... + def pendown(self) -> None: ... + def isdown(self) -> bool: ... + @overload + def speed(self) -> int: ... + @overload + def speed(self, speed: _Speed) -> None: ... + @overload + def pencolor(self) -> _AnyColor: ... + @overload + def pencolor(self, color: _Color) -> None: ... + @overload + def pencolor(self, r: float, g: float, b: float) -> None: ... + @overload + def fillcolor(self) -> _AnyColor: ... + @overload + def fillcolor(self, color: _Color) -> None: ... + @overload + def fillcolor(self, r: float, g: float, b: float) -> None: ... + @overload + def color(self) -> Tuple[_AnyColor, _AnyColor]: ... + @overload + def color(self, color: _Color) -> None: ... + @overload + def color(self, r: float, g: float, b: float) -> None: ... + @overload + def color(self, color1: _Color, color2: _Color) -> None: ... + def showturtle(self) -> None: ... + def hideturtle(self) -> None: ... + def isvisible(self) -> bool: ... + # Note: signatures 1 and 2 overlap unsafely when no arguments are provided + @overload + def pen(self) -> _PenState: ... # type: ignore + @overload + def pen(self, pen: Optional[_PenState] = ..., *, + shown: bool = ..., pendown: bool = ..., pencolor: _Color = ..., fillcolor: _Color = ..., + pensize: int = ..., speed: int = ..., resizemode: str = ..., stretchfactor: Tuple[float, float] = ..., + outline: int = ..., tilt: float = ...) -> None: ... + width = pensize + up = penup + pu = penup + pd = pendown + down = pendown + st = showturtle + ht = hideturtle + +_T = TypeVar('_T') + +class RawTurtle(TPen, TNavigator): + def __init__(self, canvas: Union[Canvas, TurtleScreen, None] = ..., shape: str = ..., undobuffersize: int = ..., visible: bool = ...) -> None: ... + def reset(self) -> None: ... + def setundobuffer(self, size: Optional[int]) -> None: ... + def undobufferentries(self) -> int: ... + def clear(self) -> None: ... + def clone(self: _T) -> _T: ... + @overload + def shape(self) -> str: ... + @overload + def shape(self, name: str) -> None: ... + # Unsafely overlaps when no arguments are provided + @overload + def shapesize(self) -> Tuple[float, float, float]: ... # type: ignore + @overload + def shapesize(self, stretch_wid: Optional[float] = ..., stretch_len: Optional[float] = ..., outline: Optional[float] = ...) -> None: ... + if sys.version_info >= (3,): + @overload + def shearfactor(self) -> float: ... + @overload + def shearfactor(self, shear: float) -> None: ... + # Unsafely overlaps when no arguments are provided + @overload + def shapetransform(self) -> Tuple[float, float, float, float]: ... # type: ignore + @overload + def shapetransform(self, t11: Optional[float] = ..., t12: Optional[float] = ..., t21: Optional[float] = ..., t22: Optional[float] = ...) -> None: ... + def get_shapepoly(self) -> Optional[_PolygonCoords]: ... + def settiltangle(self, angle: float) -> None: ... + @overload + def tiltangle(self) -> float: ... + @overload + def tiltangle(self, angle: float) -> None: ... + def tilt(self, angle: float) -> None: ... + # Can return either 'int' or Tuple[int, ...] based on if the stamp is + # a compound stamp or not. So, as per the "no Union return" policy, + # we return Any. + def stamp(self) -> Any: ... + def clearstamp(self, stampid: Union[int, Tuple[int, ...]]) -> None: ... + def clearstamps(self, n: Optional[int] = ...) -> None: ... + def filling(self) -> bool: ... + def begin_fill(self) -> None: ... + def end_fill(self) -> None: ... + def dot(self, size: Optional[int] = ..., *color: _Color) -> None: ... + def write(self, arg: object, move: bool = ..., align: str = ..., font: Tuple[str, int, str] = ...) -> None: ... + def begin_poly(self) -> None: ... + def end_poly(self) -> None: ... + def get_poly(self) -> Optional[_PolygonCoords]: ... + def getscreen(self) -> TurtleScreen: ... + def getturtle(self: _T) -> _T: ... + getpen = getturtle + def onclick(self, fun: Callable[[float, float], Any], btn: int = ..., add: Optional[bool] = ...) -> None: ... + def onrelease(self, fun: Callable[[float, float], Any], btn: int = ..., add: Optional[bool] = ...) -> None: ... + def ondrag(self, fun: Callable[[float, float], Any], btn: int = ..., add: Optional[bool] = ...) -> None: ... + def undo(self) -> None: ... + turtlesize = shapesize + +class _Screen(TurtleScreen): + def __init__(self) -> None: ... + def setup(self, width: int = ..., height: int = ..., startx: int = ..., starty: int = ...) -> None: ... + def title(self, titlestring: str) -> None: ... + def bye(self) -> None: ... + def exitonclick(self) -> None: ... + +def Screen() -> _Screen: ... + +class Turtle(RawTurtle): + def __init__(self, shape: str = ..., undobuffersize: int = ..., visible: bool = ...) -> None: ... + +RawPen = RawTurtle +Pen = Turtle + +def write_docstringdict(filename: str) -> None: ... + +# Note: it's somewhat unfortunate that we have to copy the function signatures. +# It would be nice if we could partially reduce the redundancy by doing something +# like the following: +# +# _screen: Screen +# clear = _screen.clear +# +# However, it seems pytype does not support this type of syntax in pyi files. + +# Functions copied from TurtleScreenBase: + +# Note: mainloop() was always present in the global scope, but was added to +# TurtleScreenBase in Python 3.0 +def mainloop() -> None: ... +if sys.version_info >= (3,): + def textinput(title: str, prompt: str) -> Optional[str]: ... + def numinput(title: str, prompt: str, default: Optional[float] = ..., minval: Optional[float] = ..., maxval: Optional[float] = ...) -> Optional[float]: ... + +# Functions copied from TurtleScreen: + +def clear() -> None: ... +@overload +def mode() -> str: ... +@overload +def mode(mode: str) -> None: ... +def setworldcoordinates(llx: float, lly: float, urx: float, ury: float) -> None: ... +def register_shape(name: str, shape: Union[_PolygonCoords, Shape, None] = ...) -> None: ... +@overload +def colormode() -> float: ... +@overload +def colormode(cmode: float) -> None: ... +def reset() -> None: ... +def turtles() -> List[Turtle]: ... +@overload +def bgcolor() -> _AnyColor: ... +@overload +def bgcolor(color: _Color) -> None: ... +@overload +def bgcolor(r: float, g: float, b: float) -> None: ... +@overload +def tracer() -> int: ... +@overload +def tracer(n: int, delay: Optional[int] = ...) -> None: ... +@overload +def delay() -> int: ... +@overload +def delay(delay: int) -> None: ... +def update() -> None: ... +def window_width() -> int: ... +def window_height() -> int: ... +def getcanvas() -> Canvas: ... +def getshapes() -> List[str]: ... +def onclick(fun: Callable[[float, float], Any], btn: int = ..., add: Optional[Any] = ...) -> None: ... +def onkey(fun: Callable[[], Any], key: str) -> None: ... +def listen(xdummy: Optional[float] = ..., ydummy: Optional[float] = ...) -> None: ... +def ontimer(fun: Callable[[], Any], t: int = ...) -> None: ... +@overload +def bgpic() -> str: ... +@overload +def bgpic(picname: str) -> None: ... +@overload +def screensize() -> Tuple[int, int]: ... +@overload +def screensize(canvwidth: int, canvheight: int, bg: Optional[_Color] = ...) -> None: ... +onscreenclick = onclick +resetscreen = reset +clearscreen = clear +addshape = register_shape +if sys.version_info >= (3,): + def onkeypress(fun: Callable[[], Any], key: Optional[str] = ...) -> None: ... + onkeyrelease = onkey + +# Functions copied from TNavigator: + +def degrees(fullcircle: float = ...) -> None: ... +def radians() -> None: ... +def forward(distance: float) -> None: ... +def back(distance: float) -> None: ... +def right(angle: float) -> None: ... +def left(angle: float) -> None: ... +def pos() -> Vec2D: ... +def xcor() -> float: ... +def ycor() -> float: ... +@overload +def goto(x: Tuple[float, float]) -> None: ... +@overload +def goto(x: float, y: float) -> None: ... +def home() -> None: ... +def setx(x: float) -> None: ... +def sety(y: float) -> None: ... +@overload +def distance(x: Union[TNavigator, Tuple[float, float]]) -> float: ... +@overload +def distance(x: float, y: float) -> float: ... +@overload +def towards(x: Union[TNavigator, Tuple[float, float]]) -> float: ... +@overload +def towards(x: float, y: float) -> float: ... +def heading() -> float: ... +def setheading(to_angle: float) -> None: ... +def circle(radius: float, extent: Optional[float] = ..., steps: Optional[int] = ...) -> None: ... +fd = forward +bk = back +backward = back +rt = right +lt = left +position = pos +setpos = goto +setposition = goto +seth = setheading + +# Functions copied from TPen: + +@overload +def resizemode() -> str: ... +@overload +def resizemode(rmode: str) -> None: ... +@overload +def pensize() -> int: ... +@overload +def pensize(width: int) -> None: ... +def penup() -> None: ... +def pendown() -> None: ... +def isdown() -> bool: ... +@overload +def speed() -> int: ... +@overload +def speed(speed: _Speed) -> None: ... +@overload +def pencolor() -> _AnyColor: ... +@overload +def pencolor(color: _Color) -> None: ... +@overload +def pencolor(r: float, g: float, b: float) -> None: ... +@overload +def fillcolor() -> _AnyColor: ... +@overload +def fillcolor(color: _Color) -> None: ... +@overload +def fillcolor(r: float, g: float, b: float) -> None: ... +@overload +def color() -> Tuple[_AnyColor, _AnyColor]: ... +@overload +def color(color: _Color) -> None: ... +@overload +def color(r: float, g: float, b: float) -> None: ... +@overload +def color(color1: _Color, color2: _Color) -> None: ... +def showturtle() -> None: ... +def hideturtle() -> None: ... +def isvisible() -> bool: ... +# Note: signatures 1 and 2 overlap unsafely when no arguments are provided +@overload +def pen() -> _PenState: ... # type: ignore +@overload +def pen(pen: Optional[_PenState] = ..., *, + shown: bool = ..., pendown: bool = ..., pencolor: _Color = ..., fillcolor: _Color = ..., + pensize: int = ..., speed: int = ..., resizemode: str = ..., stretchfactor: Tuple[float, float] = ..., + outline: int = ..., tilt: float = ...) -> None: ... +width = pensize +up = penup +pu = penup +pd = pendown +down = pendown +st = showturtle +ht = hideturtle + +# Functions copied from RawTurtle: + +def setundobuffer(size: Optional[int]) -> None: ... +def undobufferentries() -> int: ... +@overload +def shape() -> str: ... +@overload +def shape(name: str) -> None: ... +# Unsafely overlaps when no arguments are provided +@overload +def shapesize() -> Tuple[float, float, float]: ... # type: ignore +@overload +def shapesize(stretch_wid: Optional[float] = ..., stretch_len: Optional[float] = ..., outline: Optional[float] = ...) -> None: ... +if sys.version_info >= (3,): + @overload + def shearfactor() -> float: ... + @overload + def shearfactor(shear: float) -> None: ... + # Unsafely overlaps when no arguments are provided + @overload + def shapetransform() -> Tuple[float, float, float, float]: ... # type: ignore + @overload + def shapetransform(t11: Optional[float] = ..., t12: Optional[float] = ..., t21: Optional[float] = ..., t22: Optional[float] = ...) -> None: ... + def get_shapepoly() -> Optional[_PolygonCoords]: ... +def settiltangle(angle: float) -> None: ... +@overload +def tiltangle() -> float: ... +@overload +def tiltangle(angle: float) -> None: ... +def tilt(angle: float) -> None: ... +# Can return either 'int' or Tuple[int, ...] based on if the stamp is +# a compound stamp or not. So, as per the "no Union return" policy, +# we return Any. +def stamp() -> Any: ... +def clearstamp(stampid: Union[int, Tuple[int, ...]]) -> None: ... +def clearstamps(n: Optional[int] = ...) -> None: ... +def filling() -> bool: ... +def begin_fill() -> None: ... +def end_fill() -> None: ... +def dot(size: Optional[int] = ..., *color: _Color) -> None: ... +def write(arg: object, move: bool = ..., align: str = ..., font: Tuple[str, int, str] = ...) -> None: ... +def begin_poly() -> None: ... +def end_poly() -> None: ... +def get_poly() -> Optional[_PolygonCoords]: ... +def getscreen() -> TurtleScreen: ... +def getturtle() -> Turtle: ... +getpen = getturtle +def onrelease(fun: Callable[[float, float], Any], btn: int = ..., add: Optional[Any] = ...) -> None: ... +def ondrag(fun: Callable[[float, float], Any], btn: int = ..., add: Optional[Any] = ...) -> None: ... +def undo() -> None: ... +turtlesize = shapesize + +# Functions copied from RawTurtle with a few tweaks: + +def clone() -> Turtle: ... + +# Extra functions present only in the global scope: + +done = mainloop diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/unicodedata.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/unicodedata.pyi new file mode 100644 index 0000000..bf4f30b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/unicodedata.pyi @@ -0,0 +1,38 @@ +# Stubs for unicodedata (Python 2.7 and 3.4) +from typing import Any, Text, TypeVar, Union + +ucd_3_2_0: UCD +ucnhash_CAPI: Any +unidata_version: str + +_default = TypeVar('_default') + +def bidirectional(__chr: Text) -> Text: ... +def category(__chr: Text) -> Text: ... +def combining(__chr: Text) -> int: ... +def decimal(__chr: Text, __default: _default = ...) -> Union[int, _default]: ... +def decomposition(__chr: Text) -> Text: ... +def digit(__chr: Text, __default: _default = ...) -> Union[int, _default]: ... +def east_asian_width(__chr: Text) -> Text: ... +def lookup(__name: Union[Text, bytes]) -> Text: ... +def mirrored(__chr: Text) -> int: ... +def name(__chr: Text, __default: _default = ...) -> Union[Text, _default]: ... +def normalize(__form: Text, __unistr: Text) -> Text: ... +def numeric(__chr: Text, __default: _default = ...) -> Union[float, _default]: ... + +class UCD(object): + # The methods below are constructed from the same array in C + # (unicodedata_functions) and hence identical to the methods above. + unidata_version: str + def bidirectional(self, __chr: Text) -> str: ... + def category(self, __chr: Text) -> str: ... + def combining(self, __chr: Text) -> int: ... + def decimal(self, __chr: Text, __default: _default = ...) -> Union[int, _default]: ... + def decomposition(self, __chr: Text) -> str: ... + def digit(self, __chr: Text, __default: _default = ...) -> Union[int, _default]: ... + def east_asian_width(self, __chr: Text) -> str: ... + def lookup(self, __name: Union[Text, bytes]) -> Text: ... + def mirrored(self, __chr: Text) -> int: ... + def name(self, __chr: Text, __default: _default = ...) -> Union[Text, _default]: ... + def normalize(self, __form: Text, __unistr: Text) -> Text: ... + def numeric(self, __chr: Text, __default: _default = ...) -> Union[float, _default]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/uu.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/uu.pyi new file mode 100644 index 0000000..c926dbb --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/uu.pyi @@ -0,0 +1,13 @@ +# Stubs for uu (Python 2 and 3) +import sys +from typing import BinaryIO, Union, Optional, Text + +_File = Union[Text, BinaryIO] + +class Error(Exception): ... + +if sys.version_info >= (3, 7): + def encode(in_file: _File, out_file: _File, name: Optional[str] = ..., mode: Optional[int] = ..., backtick: bool = ...) -> None: ... +else: + def encode(in_file: _File, out_file: _File, name: Optional[str] = ..., mode: Optional[int] = ...) -> None: ... +def decode(in_file: _File, out_file: Optional[_File] = ..., mode: Optional[int] = ..., quiet: int = ...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/uuid.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/uuid.pyi new file mode 100644 index 0000000..9c009d9 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/uuid.pyi @@ -0,0 +1,90 @@ +# Stubs for uuid + +import sys +from typing import Tuple, Optional, Any, Text + +# Because UUID has properties called int and bytes we need to rename these temporarily. +_Int = int +_Bytes = bytes +_FieldsType = Tuple[int, int, int, int, int, int] + +class UUID: + def __init__(self, hex: Optional[Text] = ..., + bytes: Optional[_Bytes] = ..., + bytes_le: Optional[_Bytes] = ..., + fields: Optional[_FieldsType] = ..., + int: Optional[_Int] = ..., + version: Optional[_Int] = ...) -> None: ... + @property + def bytes(self) -> _Bytes: ... + @property + def bytes_le(self) -> _Bytes: ... + @property + def clock_seq(self) -> _Int: ... + @property + def clock_seq_hi_variant(self) -> _Int: ... + @property + def clock_seq_low(self) -> _Int: ... + @property + def fields(self) -> _FieldsType: ... + @property + def hex(self) -> str: ... + @property + def int(self) -> _Int: ... + @property + def node(self) -> _Int: ... + @property + def time(self) -> _Int: ... + @property + def time_hi_version(self) -> _Int: ... + @property + def time_low(self) -> _Int: ... + @property + def time_mid(self) -> _Int: ... + @property + def urn(self) -> str: ... + @property + def variant(self) -> str: ... + @property + def version(self) -> Optional[_Int]: ... + + def __int__(self) -> _Int: ... + + if sys.version_info >= (3,): + def __eq__(self, other: Any) -> bool: ... + def __lt__(self, other: Any) -> bool: ... + def __le__(self, other: Any) -> bool: ... + def __gt__(self, other: Any) -> bool: ... + def __ge__(self, other: Any) -> bool: ... + else: + def get_bytes(self) -> _Bytes: ... + def get_bytes_le(self) -> _Bytes: ... + def get_clock_seq(self) -> _Int: ... + def get_clock_seq_hi_variant(self) -> _Int: ... + def get_clock_seq_low(self) -> _Int: ... + def get_fields(self) -> _FieldsType: ... + def get_hex(self) -> str: ... + def get_node(self) -> _Int: ... + def get_time(self) -> _Int: ... + def get_time_hi_version(self) -> _Int: ... + def get_time_low(self) -> _Int: ... + def get_time_mid(self) -> _Int: ... + def get_urn(self) -> str: ... + def get_variant(self) -> str: ... + def get_version(self) -> Optional[_Int]: ... + def __cmp__(self, other: Any) -> _Int: ... + +def getnode() -> int: ... +def uuid1(node: Optional[_Int] = ..., clock_seq: Optional[_Int] = ...) -> UUID: ... +def uuid3(namespace: UUID, name: str) -> UUID: ... +def uuid4() -> UUID: ... +def uuid5(namespace: UUID, name: str) -> UUID: ... + +NAMESPACE_DNS: UUID +NAMESPACE_URL: UUID +NAMESPACE_OID: UUID +NAMESPACE_X500: UUID +RESERVED_NCS: str +RFC_4122: str +RESERVED_MICROSOFT: str +RESERVED_FUTURE: str diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/warnings.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/warnings.pyi new file mode 100644 index 0000000..a44e43e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/warnings.pyi @@ -0,0 +1,38 @@ +# Stubs for warnings + +from typing import Any, Dict, List, NamedTuple, Optional, TextIO, Tuple, Type, Union +from types import ModuleType, TracebackType + +def warn(message: Union[str, Warning], category: Optional[Type[Warning]] = ..., + stacklevel: int = ...) -> None: ... +def warn_explicit(message: Union[str, Warning], category: Type[Warning], + filename: str, lineno: int, module: Optional[str] = ..., + registry: Optional[Dict[Union[str, Tuple[str, Type[Warning], int]], int]] = ..., + module_globals: Optional[Dict[str, Any]] = ...) -> None: ... +def showwarning(message: str, category: Type[Warning], filename: str, + lineno: int, file: Optional[TextIO] = ..., + line: Optional[str] = ...) -> None: ... +def formatwarning(message: str, category: Type[Warning], filename: str, + lineno: int, line: Optional[str] = ...) -> str: ... +def filterwarnings(action: str, message: str = ..., + category: Type[Warning] = ..., module: str = ..., + lineno: int = ..., append: bool = ...) -> None: ... +def simplefilter(action: str, category: Type[Warning] = ..., lineno: int = ..., + append: bool = ...) -> None: ... +def resetwarnings() -> None: ... + +_Record = NamedTuple('_Record', + [('message', str), + ('category', Type[Warning]), + ('filename', str), + ('lineno', int), + ('file', Optional[TextIO]), + ('line', Optional[str])]) + +class catch_warnings: + def __init__(self, *, record: bool = ..., + module: Optional[ModuleType] = ...) -> None: ... + def __enter__(self) -> Optional[List[_Record]]: ... + def __exit__(self, exc_type: Optional[Type[BaseException]], + exc_val: Optional[BaseException], + exc_tb: Optional[TracebackType]) -> bool: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/wave.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/wave.pyi new file mode 100644 index 0000000..951142a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/wave.pyi @@ -0,0 +1,76 @@ +# Stubs for wave (Python 2 and 3) + +import sys +from typing import ( + Any, NamedTuple, NoReturn, Optional, Text, BinaryIO, Union, Tuple +) + +_File = Union[Text, BinaryIO] + +class Error(Exception): ... + +WAVE_FORMAT_PCM: int + +if sys.version_info < (3, 0): + _wave_params = Tuple[int, int, int, int, str, str] +else: + _wave_params = NamedTuple('_wave_params', [ + ('nchannels', int), + ('sampwidth', int), + ('framerate', int), + ('nframes', int), + ('comptype', str), + ('compname', str), + ]) + +class Wave_read: + def __init__(self, f: _File) -> None: ... + if sys.version_info >= (3, 0): + def __enter__(self) -> Wave_read: ... + def __exit__(self, *args: Any) -> None: ... + def getfp(self) -> Optional[BinaryIO]: ... + def rewind(self) -> None: ... + def close(self) -> None: ... + def tell(self) -> int: ... + def getnchannels(self) -> int: ... + def getnframes(self) -> int: ... + def getsampwidth(self) -> int: ... + def getframerate(self) -> int: ... + def getcomptype(self) -> str: ... + def getcompname(self) -> str: ... + def getparams(self) -> _wave_params: ... + def getmarkers(self) -> None: ... + def getmark(self, id: Any) -> NoReturn: ... + def setpos(self, pos: int) -> None: ... + def readframes(self, nframes: int) -> bytes: ... + +class Wave_write: + def __init__(self, f: _File) -> None: ... + if sys.version_info >= (3, 0): + def __enter__(self) -> Wave_write: ... + def __exit__(self, *args: Any) -> None: ... + def setnchannels(self, nchannels: int) -> None: ... + def getnchannels(self) -> int: ... + def setsampwidth(self, sampwidth: int) -> None: ... + def getsampwidth(self) -> int: ... + def setframerate(self, framerate: float) -> None: ... + def getframerate(self) -> int: ... + def setnframes(self, nframes: int) -> None: ... + def getnframes(self) -> int: ... + def setcomptype(self, comptype: str, compname: str) -> None: ... + def getcomptype(self) -> str: ... + def getcompname(self) -> str: ... + def setparams(self, params: _wave_params) -> None: ... + def getparams(self) -> _wave_params: ... + def setmark(self, id: Any, pos: Any, name: Any) -> NoReturn: ... + def getmark(self, id: Any) -> NoReturn: ... + def getmarkers(self) -> None: ... + def tell(self) -> int: ... + # should be any bytes-like object after 3.4, but we don't have a type for that + def writeframesraw(self, data: bytes) -> None: ... + def writeframes(self, data: bytes) -> None: ... + def close(self) -> None: ... + +# Returns a Wave_read if mode is rb and Wave_write if mode is wb +def open(f: _File, mode: Optional[str] = ...) -> Any: ... +openfp = open diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/weakref.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/weakref.pyi new file mode 100644 index 0000000..e3ddbf2 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/weakref.pyi @@ -0,0 +1,110 @@ +import sys +import types +from typing import ( + TypeVar, Generic, Any, Callable, overload, Mapping, Iterator, Tuple, + Iterable, Optional, Type, MutableMapping, Union, List, Dict +) + +from _weakref import ( + getweakrefcount as getweakrefcount, + getweakrefs as getweakrefs, + ref as ref, + proxy as proxy, + CallableProxyType as CallableProxyType, + ProxyType as ProxyType, + ReferenceType as ReferenceType) +from _weakrefset import WeakSet as WeakSet + +if sys.version_info < (3, 0): + from exceptions import ReferenceError as ReferenceError + +_S = TypeVar('_S') +_T = TypeVar('_T') +_KT = TypeVar('_KT') +_VT = TypeVar('_VT') + +ProxyTypes: Tuple[Type[Any], ...] + +if sys.version_info >= (3, 4): + class WeakMethod(ref[types.MethodType]): + def __new__(cls, meth: types.MethodType, callback: Optional[Callable[[types.MethodType], Any]] = ...) -> WeakMethod: ... + def __call__(self) -> Optional[types.MethodType]: ... + +class WeakValueDictionary(MutableMapping[_KT, _VT]): + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, __map: Union[Mapping[_KT, _VT], Iterable[Tuple[_KT, _VT]]], **kwargs: _VT) -> None: ... + + def __len__(self) -> int: ... + def __getitem__(self, k: _KT) -> _VT: ... + def __setitem__(self, k: _KT, v: _VT) -> None: ... + def __delitem__(self, v: _KT) -> None: ... + if sys.version_info < (3, 0): + def has_key(self, key: object) -> bool: ... + def __contains__(self, o: object) -> bool: ... + def __iter__(self) -> Iterator[_KT]: ... + def __str__(self) -> str: ... + + def copy(self) -> WeakValueDictionary[_KT, _VT]: ... + + if sys.version_info < (3, 0): + def keys(self) -> List[_KT]: ... + def values(self) -> List[_VT]: ... + def items(self) -> List[Tuple[_KT, _VT]]: ... + def iterkeys(self) -> Iterator[_KT]: ... + def itervalues(self) -> Iterator[_VT]: ... + def iteritems(self) -> Iterator[Tuple[_KT, _VT]]: ... + else: + # These are incompatible with Mapping + def keys(self) -> Iterator[_KT]: ... # type: ignore + def values(self) -> Iterator[_VT]: ... # type: ignore + def items(self) -> Iterator[Tuple[_KT, _VT]]: ... # type: ignore + def itervaluerefs(self) -> Iterator[KeyedRef[_KT, _VT]]: ... + def valuerefs(self) -> List[KeyedRef[_KT, _VT]]: ... + +class KeyedRef(ref[_T], Generic[_KT, _T]): + key: _KT + def __init__(self, ob: _T, callback: Callable[[_T], Any], key: _KT) -> None: ... + +class WeakKeyDictionary(MutableMapping[_KT, _VT]): + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, __map: Union[Mapping[_KT, _VT], Iterable[Tuple[_KT, _VT]]], **kwargs: _VT) -> None: ... + + def __len__(self) -> int: ... + def __getitem__(self, k: _KT) -> _VT: ... + def __setitem__(self, k: _KT, v: _VT) -> None: ... + def __delitem__(self, v: _KT) -> None: ... + if sys.version_info < (3, 0): + def has_key(self, key: object) -> bool: ... + def __contains__(self, o: object) -> bool: ... + def __iter__(self) -> Iterator[_KT]: ... + def __str__(self) -> str: ... + + def copy(self) -> WeakKeyDictionary[_KT, _VT]: ... + + if sys.version_info < (3, 0): + def keys(self) -> List[_KT]: ... + def values(self) -> List[_VT]: ... + def items(self) -> List[Tuple[_KT, _VT]]: ... + def iterkeys(self) -> Iterator[_KT]: ... + def itervalues(self) -> Iterator[_VT]: ... + def iteritems(self) -> Iterator[Tuple[_KT, _VT]]: ... + def iterkeyrefs(self) -> Iterator[ref[_KT]]: ... + else: + # These are incompatible with Mapping + def keys(self) -> Iterator[_KT]: ... # type: ignore + def values(self) -> Iterator[_VT]: ... # type: ignore + def items(self) -> Iterator[Tuple[_KT, _VT]]: ... # type: ignore + def keyrefs(self) -> List[ref[_KT]]: ... + +if sys.version_info >= (3, 4): + class finalize: + def __init__(self, obj: _S, func: Callable[..., _T], *args: Any, **kwargs: Any) -> None: ... + def __call__(self, _: Any = ...) -> Optional[_T]: ... + def detach(self) -> Optional[Tuple[_S, _T, Tuple[Any, ...], Dict[str, Any]]]: ... + def peek(self) -> Optional[Tuple[_S, _T, Tuple[Any, ...], Dict[str, Any]]]: ... + alive: bool + atexit: bool diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/webbrowser.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/webbrowser.pyi new file mode 100644 index 0000000..7d1b4cb --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/webbrowser.pyi @@ -0,0 +1,99 @@ +import sys +from typing import Any, Optional, Callable, List, Text, Union, Sequence + +class Error(Exception): ... + +if sys.version_info >= (3, 7): + def register(name: Text, klass: Optional[Callable[[], BaseBrowser]], instance: BaseBrowser = ..., *, preferred: bool = ...) -> None: ... +else: + def register(name: Text, klass: Optional[Callable[[], BaseBrowser]], instance: BaseBrowser = ..., update_tryorder: int = ...) -> None: ... +def get(using: Optional[Text] = ...) -> BaseBrowser: ... +def open(url: Text, new: int = ..., autoraise: bool = ...) -> bool: ... +def open_new(url: Text) -> bool: ... +def open_new_tab(url: Text) -> bool: ... + +class BaseBrowser: + args: List[str] + name: str + basename: str + def __init__(self, name: Text = ...) -> None: ... + def open(self, url: Text, new: int = ..., autoraise: bool = ...) -> bool: ... + def open_new(self, url: Text) -> bool: ... + def open_new_tab(self, url: Text) -> bool: ... + +class GenericBrowser(BaseBrowser): + args: List[str] + name: str + basename: str + def __init__(self, name: Union[Text, Sequence[Text]]) -> None: ... + def open(self, url: Text, new: int = ..., autoraise: bool = ...) -> bool: ... + +class BackgroundBrowser(GenericBrowser): + def open(self, url: Text, new: int = ..., autoraise: bool = ...) -> bool: ... + +class UnixBrowser(BaseBrowser): + raise_opts: List[str] + background: bool + redirect_stdout: bool + remote_args: List[str] + remote_action: str + remote_action_newwin: str + remote_action_newtab: str + def open(self, url: Text, new: int = ..., autoraise: bool = ...) -> bool: ... + +class Mozilla(UnixBrowser): + raise_opts: List[str] + remote_args: List[str] + remote_action: str + remote_action_newwin: str + remote_action_newtab: str + background: bool + +class Galeon(UnixBrowser): + raise_opts: List[str] + remote_args: List[str] + remote_action: str + remote_action_newwin: str + background: bool + +if sys.version_info[:2] == (2, 7) or sys.version_info >= (3, 3): + class Chrome(UnixBrowser): + remote_args: List[str] + remote_action: str + remote_action_newwin: str + remote_action_newtab: str + background: bool + +class Opera(UnixBrowser): + raise_opts: List[str] + remote_args: List[str] + remote_action: str + remote_action_newwin: str + remote_action_newtab: str + background: bool + +class Elinks(UnixBrowser): + remote_args: List[str] + remote_action: str + remote_action_newwin: str + remote_action_newtab: str + background: bool + redirect_stdout: bool + +class Konqueror(BaseBrowser): + def open(self, url: Text, new: int = ..., autoraise: bool = ...) -> bool: ... + +class Grail(BaseBrowser): + def open(self, url: Text, new: int = ..., autoraise: bool = ...) -> bool: ... + +class WindowsDefault(BaseBrowser): + def open(self, url: Text, new: int = ..., autoraise: bool = ...) -> bool: ... + +class MacOSX(BaseBrowser): + name: str + def __init__(self, name: Text) -> None: ... + def open(self, url: Text, new: int = ..., autoraise: bool = ...) -> bool: ... + +class MacOSXOSAScript(BaseBrowser): + def __init__(self, name: Text) -> None: ... + def open(self, url: Text, new: int = ..., autoraise: bool = ...) -> bool: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/wsgiref/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/wsgiref/__init__.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/wsgiref/handlers.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/wsgiref/handlers.pyi new file mode 100644 index 0000000..3271c88 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/wsgiref/handlers.pyi @@ -0,0 +1,87 @@ +import sys +from abc import abstractmethod +from types import TracebackType +from typing import Optional, Dict, MutableMapping, Type, Text, Callable, List, Tuple, IO + +from .headers import Headers +from .types import WSGIApplication, WSGIEnvironment, StartResponse, InputStream, ErrorStream +from .util import FileWrapper, guess_scheme + +_exc_info = Tuple[Optional[Type[BaseException]], + Optional[BaseException], + Optional[TracebackType]] + +def format_date_time(timestamp: Optional[float]) -> str: ... # undocumented +if sys.version_info >= (3, 2): + def read_environ() -> Dict[str, str]: ... + +class BaseHandler: + wsgi_version: Tuple[int, int] # undocumented + wsgi_multithread: bool + wsgi_multiprocess: bool + wsgi_run_once: bool + + origin_server: bool + http_version: str + server_software: Optional[str] + + os_environ: MutableMapping[str, str] + + wsgi_file_wrapper: Optional[Type[FileWrapper]] + headers_class: Type[Headers] # undocumented + + traceback_limit: Optional[int] + error_status: str + error_headers: List[Tuple[Text, Text]] + error_body: bytes + + def run(self, application: WSGIApplication) -> None: ... + + def setup_environ(self) -> None: ... + def finish_response(self) -> None: ... + def get_scheme(self) -> str: ... + def set_content_length(self) -> None: ... + def cleanup_headers(self) -> None: ... + def start_response(self, status: Text, headers: List[Tuple[Text, Text]], exc_info: Optional[_exc_info] = ...) -> Callable[[bytes], None]: ... + def send_preamble(self) -> None: ... + def write(self, data: bytes) -> None: ... + def sendfile(self) -> bool: ... + def finish_content(self) -> None: ... + def close(self) -> None: ... + def send_headers(self) -> None: ... + def result_is_file(self) -> bool: ... + def client_is_modern(self) -> bool: ... + def log_exception(self, exc_info: _exc_info) -> None: ... + def handle_error(self) -> None: ... + def error_output(self, environ: WSGIEnvironment, start_response: StartResponse) -> List[bytes]: ... + + @abstractmethod + def _write(self, data: bytes) -> None: ... + @abstractmethod + def _flush(self) -> None: ... + @abstractmethod + def get_stdin(self) -> InputStream: ... + @abstractmethod + def get_stderr(self) -> ErrorStream: ... + @abstractmethod + def add_cgi_vars(self) -> None: ... + +class SimpleHandler(BaseHandler): + stdin: InputStream + stdout: IO[bytes] + stderr: ErrorStream + base_env: MutableMapping[str, str] + def __init__(self, stdin: InputStream, stdout: IO[bytes], stderr: ErrorStream, environ: MutableMapping[str, str], multithread: bool = ..., multiprocess: bool = ...) -> None: ... + def get_stdin(self) -> InputStream: ... + def get_stderr(self) -> ErrorStream: ... + def add_cgi_vars(self) -> None: ... + def _write(self, data: bytes) -> None: ... + def _flush(self) -> None: ... + +class BaseCGIHandler(SimpleHandler): ... + +class CGIHandler(BaseCGIHandler): + def __init__(self) -> None: ... + +class IISCGIHandler(BaseCGIHandler): + def __init__(self) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/wsgiref/headers.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/wsgiref/headers.pyi new file mode 100644 index 0000000..8539225 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/wsgiref/headers.pyi @@ -0,0 +1,31 @@ +import sys +from typing import overload, Pattern, Optional, List, Tuple + +_HeaderList = List[Tuple[str, str]] + +tspecials: Pattern[str] # undocumented + +class Headers: + if sys.version_info < (3, 5): + def __init__(self, headers: _HeaderList) -> None: ... + else: + def __init__(self, headers: Optional[_HeaderList] = ...) -> None: ... + def __len__(self) -> int: ... + def __setitem__(self, name: str, val: str) -> None: ... + def __delitem__(self, name: str) -> None: ... + def __getitem__(self, name: str) -> Optional[str]: ... + if sys.version_info < (3,): + def has_key(self, name: str) -> bool: ... + def __contains__(self, name: str) -> bool: ... + def get_all(self, name: str) -> List[str]: ... + @overload + def get(self, name: str, default: str) -> str: ... + @overload + def get(self, name: str, default: Optional[str] = ...) -> Optional[str]: ... + def keys(self) -> List[str]: ... + def values(self) -> List[str]: ... + def items(self) -> _HeaderList: ... + if sys.version_info >= (3,): + def __bytes__(self) -> bytes: ... + def setdefault(self, name: str, value: str) -> str: ... + def add_header(self, _name: str, _value: Optional[str], **_params: Optional[str]) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/wsgiref/simple_server.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/wsgiref/simple_server.pyi new file mode 100644 index 0000000..50b8377 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/wsgiref/simple_server.pyi @@ -0,0 +1,40 @@ +import sys +from typing import Optional, List, Type, TypeVar, overload + +from .handlers import SimpleHandler +from .types import WSGIApplication, WSGIEnvironment, StartResponse, ErrorStream + +if sys.version_info < (3,): + from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer +else: + from http.server import HTTPServer, BaseHTTPRequestHandler + +server_version: str # undocumented +sys_version: str # undocumented +software_version: str # undocumented + +class ServerHandler(SimpleHandler): # undocumented + server_software: str + def close(self) -> None: ... + +class WSGIServer(HTTPServer): + application: Optional[WSGIApplication] + base_environ: WSGIEnvironment # only available after call to setup_environ() + def setup_environ(self) -> None: ... + def get_app(self) -> Optional[WSGIApplication]: ... + def set_app(self, application: Optional[WSGIApplication]) -> None: ... + +class WSGIRequestHandler(BaseHTTPRequestHandler): + server_version: str + def get_environ(self) -> WSGIEnvironment: ... + def get_stderr(self) -> ErrorStream: ... + def handle(self) -> None: ... + +def demo_app(environ: WSGIEnvironment, start_response: StartResponse) -> List[bytes]: ... + +_S = TypeVar("_S", bound=WSGIServer) + +@overload +def make_server(host: str, port: int, app: WSGIApplication, *, handler_class: Type[WSGIRequestHandler] = ...) -> WSGIServer: ... +@overload +def make_server(host: str, port: int, app: WSGIApplication, server_class: Type[_S], handler_class: Type[WSGIRequestHandler] = ...) -> _S: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/wsgiref/types.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/wsgiref/types.pyi new file mode 100644 index 0000000..39a913e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/wsgiref/types.pyi @@ -0,0 +1,44 @@ +# Type declaration for a WSGI Function +# +# wsgiref/types.py doesn't exist and neither do the types defined in this +# file. They are provided for type checking purposes. +# +# This means you cannot simply import wsgiref.types in your code. Instead, +# use the `TYPE_CHECKING` flag from the typing module: +# +# from typing import TYPE_CHECKING +# +# if TYPE_CHECKING: +# from wsgiref.types import WSGIApplication +# +# This import is now only taken into account by the type checker. Consequently, +# you need to use 'WSGIApplication' and not simply WSGIApplication when type +# hinting your code. Otherwise Python will raise NameErrors. + +from sys import _OptExcInfo +from typing import Callable, Dict, Iterable, List, Any, Text, Protocol, Tuple, Optional + +class StartResponse(Protocol): + def __call__(self, status: str, headers: List[Tuple[str, str]], exc_info: Optional[_OptExcInfo] = ...) -> Callable[[bytes], Any]: ... + +WSGIEnvironment = Dict[Text, Any] +WSGIApplication = Callable[[WSGIEnvironment, StartResponse], Iterable[bytes]] + +# WSGI input streams per PEP 3333 +class InputStream(Protocol): + def read(self, size: int = ...) -> bytes: ... + def readline(self, size: int = ...) -> bytes: ... + def readlines(self, hint: int = ...) -> List[bytes]: ... + def __iter__(self) -> Iterable[bytes]: ... + +# WSGI error streams per PEP 3333 +class ErrorStream(Protocol): + def flush(self) -> None: ... + def write(self, s: str) -> None: ... + def writelines(self, seq: List[str]) -> None: ... + +class _Readable(Protocol): + def read(self, size: int = ...) -> bytes: ... +# Optional file wrapper in wsgi.file_wrapper +class FileWrapper(Protocol): + def __call__(self, file: _Readable, block_size: int = ...) -> Iterable[bytes]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/wsgiref/util.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/wsgiref/util.pyi new file mode 100644 index 0000000..501ddcd --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/wsgiref/util.pyi @@ -0,0 +1,23 @@ +import sys +from typing import IO, Any, Optional + +from .types import WSGIEnvironment + +class FileWrapper: + filelike: IO[bytes] + blksize: int + def __init__(self, filelike: IO[bytes], bklsize: int = ...) -> None: ... + def __getitem__(self, key: Any) -> bytes: ... + def __iter__(self) -> FileWrapper: ... + if sys.version_info < (3,): + def next(self) -> bytes: ... + else: + def __next__(self) -> bytes: ... + def close(self) -> None: ... # only exists if filelike.close exists + +def guess_scheme(environ: WSGIEnvironment) -> str: ... +def application_uri(environ: WSGIEnvironment) -> str: ... +def request_uri(environ: WSGIEnvironment, include_query: bool = ...) -> str: ... +def shift_path_info(environ: WSGIEnvironment) -> Optional[str]: ... +def setup_testing_defaults(environ: WSGIEnvironment) -> None: ... +def is_hop_by_hop(header_name: str) -> bool: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/wsgiref/validate.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/wsgiref/validate.pyi new file mode 100644 index 0000000..c7fa699 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/wsgiref/validate.pyi @@ -0,0 +1,53 @@ +import sys +from typing import Any, Iterable, Iterator, Optional, NoReturn, Callable + +from wsgiref.types import WSGIApplication, InputStream, ErrorStream + +class WSGIWarning(Warning): ... + +def validator(application: WSGIApplication) -> WSGIApplication: ... + +class InputWrapper: + input: InputStream + def __init__(self, wsgi_input: InputStream) -> None: ... + if sys.version_info < (3,): + def read(self, size: int = ...) -> bytes: ... + def readline(self) -> bytes: ... + else: + def read(self, size: int) -> bytes: ... + def readline(self, size: int = ...) -> bytes: ... + def readlines(self, hint: int = ...) -> bytes: ... + def __iter__(self) -> Iterable[bytes]: ... + def close(self) -> NoReturn: ... + +class ErrorWrapper: + errors: ErrorStream + def __init__(self, wsgi_errors: ErrorStream) -> None: ... + def write(self, s: str) -> None: ... + def flush(self) -> None: ... + def writelines(self, seq: Iterable[str]) -> None: ... + def close(self) -> NoReturn: ... + +class WriteWrapper: + writer: Callable[[bytes], Any] + def __init__(self, wsgi_writer: Callable[[bytes], Any]) -> None: ... + def __call__(self, s: bytes) -> None: ... + +class PartialIteratorWrapper: + iterator: Iterator[bytes] + def __init__(self, wsgi_iterator: Iterator[bytes]) -> None: ... + def __iter__(self) -> IteratorWrapper: ... + +class IteratorWrapper: + original_iterator: Iterator[bytes] + iterator: Iterator[bytes] + closed: bool + check_start_response: Optional[bool] + def __init__(self, wsgi_iterator: Iterator[bytes], check_start_response: Optional[bool]) -> None: ... + def __iter__(self) -> IteratorWrapper: ... + if sys.version_info < (3,): + def next(self) -> bytes: ... + else: + def __next__(self) -> bytes: ... + def close(self) -> None: ... + def __del__(self) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/xdrlib.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/xdrlib.pyi new file mode 100644 index 0000000..864aced --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/xdrlib.pyi @@ -0,0 +1,56 @@ +# Structs for xdrlib (Python 2 and 3) +from typing import Callable, List, Sequence, TypeVar + +_T = TypeVar('_T') + +class Error(Exception): + msg: str + def __init__(self, msg: str) -> None: ... + +class ConversionError(Error): ... + +class Packer: + def __init__(self) -> None: ... + def reset(self) -> None: ... + def get_buffer(self) -> bytes: ... + def get_buf(self) -> bytes: ... + def pack_uint(self, x: int) -> None: ... + def pack_int(self, x: int) -> None: ... + def pack_enum(self, x: int) -> None: ... + def pack_bool(self, x: bool) -> None: ... + def pack_uhyper(self, x: int) -> None: ... + def pack_hyper(self, x: int) -> None: ... + def pack_float(self, x: float) -> None: ... + def pack_double(self, x: float) -> None: ... + def pack_fstring(self, n: int, s: bytes) -> None: ... + def pack_fopaque(self, n: int, s: bytes) -> None: ... + def pack_string(self, s: bytes) -> None: ... + def pack_opaque(self, s: bytes) -> None: ... + def pack_bytes(self, s: bytes) -> None: ... + def pack_list(self, list: Sequence[_T], pack_item: Callable[[_T], None]) -> None: ... + def pack_farray(self, n: int, list: Sequence[_T], pack_item: Callable[[_T], None]) -> None: ... + def pack_array(self, list: Sequence[_T], pack_item: Callable[[_T], None]) -> None: ... + +class Unpacker: + def __init__(self, data: bytes) -> None: ... + def reset(self, data: bytes) -> None: ... + def get_position(self) -> int: ... + def set_position(self, position: int) -> None: ... + def get_buffer(self) -> bytes: ... + def done(self) -> None: ... + def unpack_uint(self) -> int: ... + def unpack_int(self) -> int: ... + def unpack_enum(self) -> int: ... + def unpack_bool(self) -> bool: ... + def unpack_uhyper(self) -> int: ... + def unpack_hyper(self) -> int: ... + def unpack_float(self) -> float: ... + def unpack_double(self) -> float: ... + def unpack_fstring(self, n: int) -> bytes: ... + def unpack_fopaque(self, n: int) -> bytes: ... + def unpack_string(self) -> bytes: ... + def unpack_opaque(self) -> bytes: ... + def unpack_bytes(self) -> bytes: ... + def unpack_list(self, unpack_item: Callable[[], _T]) -> List[_T]: ... + def unpack_farray(self, n: int, unpack_item: Callable[[], _T]) -> List[_T]: ... + def unpack_array(self, unpack_item: Callable[[], _T]) -> List[_T]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/xml/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/xml/__init__.pyi new file mode 100644 index 0000000..c524ac2 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/xml/__init__.pyi @@ -0,0 +1 @@ +import xml.parsers as parsers diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/xml/etree/ElementInclude.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/xml/etree/ElementInclude.pyi new file mode 100644 index 0000000..e8c3cd5 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/xml/etree/ElementInclude.pyi @@ -0,0 +1,17 @@ +# Stubs for xml.etree.ElementInclude (Python 3.4) + +from typing import Union, Optional, Callable +from xml.etree.ElementTree import Element + +XINCLUDE: str +XINCLUDE_INCLUDE: str +XINCLUDE_FALLBACK: str + +class FatalIncludeError(SyntaxError): ... + +def default_loader(href: Union[str, bytes, int], parse: str, encoding: Optional[str] = ...) -> Union[str, Element]: ... + +# TODO: loader is of type default_loader ie it takes a callable that has the +# same signature as default_loader. But default_loader has a keyword argument +# Which can't be represented using Callable... +def include(elem: Element, loader: Optional[Callable[..., Union[str, Element]]] = ...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/xml/etree/ElementPath.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/xml/etree/ElementPath.pyi new file mode 100644 index 0000000..1477b32 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/xml/etree/ElementPath.pyi @@ -0,0 +1,33 @@ +# Stubs for xml.etree.ElementPath (Python 3.4) + +from typing import Pattern, Dict, Generator, Tuple, List, Union, TypeVar, Callable, Optional +from xml.etree.ElementTree import Element + +xpath_tokenizer_re: Pattern + +_token = Tuple[str, str] +_next = Callable[[], _token] +_callback = Callable[[_SelectorContext, List[Element]], Generator[Element, None, None]] + +def xpath_tokenizer(pattern: str, namespaces: Optional[Dict[str, str]] = ...) -> Generator[_token, None, None]: ... +def get_parent_map(context: _SelectorContext) -> Dict[Element, Element]: ... +def prepare_child(next: _next, token: _token) -> _callback: ... +def prepare_star(next: _next, token: _token) -> _callback: ... +def prepare_self(next: _next, token: _token) -> _callback: ... +def prepare_descendant(next: _next, token: _token) -> _callback: ... +def prepare_parent(next: _next, token: _token) -> _callback: ... +def prepare_predicate(next: _next, token: _token) -> _callback: ... + +ops: Dict[str, Callable[[_next, _token], _callback]] + +class _SelectorContext: + parent_map: Dict[Element, Element] + root: Element + def __init__(self, root: Element) -> None: ... + +_T = TypeVar('_T') + +def iterfind(elem: Element, path: str, namespaces: Optional[Dict[str, str]] = ...) -> List[Element]: ... +def find(elem: Element, path: str, namespaces: Optional[Dict[str, str]] = ...) -> Optional[Element]: ... +def findall(elem: Element, path: str, namespaces: Optional[Dict[str, str]] = ...) -> List[Element]: ... +def findtext(elem: Element, path: str, default: Optional[_T] = ..., namespaces: Optional[Dict[str, str]] = ...) -> Union[_T, str]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/xml/etree/ElementTree.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/xml/etree/ElementTree.pyi new file mode 100644 index 0000000..d5f64b6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/xml/etree/ElementTree.pyi @@ -0,0 +1,167 @@ +# Stubs for xml.etree.ElementTree + +from typing import Any, Callable, Dict, Generator, IO, ItemsView, Iterable, Iterator, KeysView, List, MutableSequence, Optional, overload, Sequence, Text, Tuple, TypeVar, Union +import io +import sys + +VERSION: str + +class ParseError(SyntaxError): ... + +def iselement(element: object) -> bool: ... + +_T = TypeVar('_T') + +# Type for parser inputs. Parser will accept any unicode/str/bytes and coerce, +# and this is true in py2 and py3 (even fromstringlist() in python3 can be +# called with a heterogeneous list) +_parser_input_type = Union[bytes, Text] + +# Type for individual tag/attr/ns/text values in args to most functions. +# In py2, the library accepts str or unicode everywhere and coerces +# aggressively. +# In py3, bytes is not coerced to str and so use of bytes is probably an error, +# so we exclude it. (why? the parser never produces bytes when it parses XML, +# so e.g., element.get(b'name') will always return None for parsed XML, even if +# there is a 'name' attribute.) +_str_argument_type = Union[str, Text] + +# Type for return values from individual tag/attr/text values and serialization +if sys.version_info >= (3,): + # note: in python3, everything comes out as str, yay: + _str_result_type = str + # unfortunately, tostring and tostringlist can return either bytes or str + # depending on the value of `encoding` parameter. Client code knows best: + _tostring_result_type = Any +else: + # in python2, if the tag/attribute/text wasn't decode-able as ascii, it + # comes out as a unicode string; otherwise it comes out as str. (see + # _fixtext function in the source). Client code knows best: + _str_result_type = Any + # On the bright side, tostring and tostringlist always return bytes: + _tostring_result_type = bytes + +class Element(MutableSequence[Element]): + tag: _str_result_type + attrib: Dict[_str_result_type, _str_result_type] + text: Optional[_str_result_type] + tail: Optional[_str_result_type] + def __init__(self, tag: Union[_str_argument_type, Callable[..., Element]], attrib: Dict[_str_argument_type, _str_argument_type] = ..., **extra: _str_argument_type) -> None: ... + def append(self, subelement: Element) -> None: ... + def clear(self) -> None: ... + def copy(self) -> Element: ... + def extend(self, elements: Iterable[Element]) -> None: ... + def find(self, path: _str_argument_type, namespaces: Optional[Dict[_str_argument_type, _str_argument_type]] = ...) -> Optional[Element]: ... + def findall(self, path: _str_argument_type, namespaces: Optional[Dict[_str_argument_type, _str_argument_type]] = ...) -> List[Element]: ... + def findtext(self, path: _str_argument_type, default: Optional[_T] = ..., namespaces: Optional[Dict[_str_argument_type, _str_argument_type]] = ...) -> Union[_T, _str_result_type]: ... + def get(self, key: _str_argument_type, default: Optional[_T] = ...) -> Union[_str_result_type, _T]: ... + def getchildren(self) -> List[Element]: ... + def getiterator(self, tag: Optional[_str_argument_type] = ...) -> List[Element]: ... + if sys.version_info >= (3, 2): + def insert(self, index: int, subelement: Element) -> None: ... + else: + def insert(self, index: int, element: Element) -> None: ... + def items(self) -> ItemsView[_str_result_type, _str_result_type]: ... + def iter(self, tag: Optional[_str_argument_type] = ...) -> Generator[Element, None, None]: ... + def iterfind(self, path: _str_argument_type, namespaces: Optional[Dict[_str_argument_type, _str_argument_type]] = ...) -> List[Element]: ... + def itertext(self) -> Generator[_str_result_type, None, None]: ... + def keys(self) -> KeysView[_str_result_type]: ... + def makeelement(self, tag: _str_argument_type, attrib: Dict[_str_argument_type, _str_argument_type]) -> Element: ... + def remove(self, subelement: Element) -> None: ... + def set(self, key: _str_argument_type, value: _str_argument_type) -> None: ... + def __bool__(self) -> bool: ... + def __delitem__(self, i: Union[int, slice]) -> None: ... + @overload + def __getitem__(self, i: int) -> Element: ... + @overload + def __getitem__(self, s: slice) -> MutableSequence[Element]: ... + def __len__(self) -> int: ... + @overload + def __setitem__(self, i: int, o: Element) -> None: ... + @overload + def __setitem__(self, s: slice, o: Iterable[Element]) -> None: ... + + +def SubElement(parent: Element, tag: _str_argument_type, attrib: Dict[_str_argument_type, _str_argument_type] = ..., **extra: _str_argument_type) -> Element: ... +def Comment(text: Optional[_str_argument_type] = ...) -> Element: ... +def ProcessingInstruction(target: _str_argument_type, text: Optional[_str_argument_type] = ...) -> Element: ... + +PI: Callable[..., Element] + +class QName: + text: str + def __init__(self, text_or_uri: _str_argument_type, tag: Optional[_str_argument_type] = ...) -> None: ... + + +_file_or_filename = Union[str, bytes, int, IO[Any]] + +class ElementTree: + def __init__(self, element: Optional[Element] = ..., file: Optional[_file_or_filename] = ...) -> None: ... + def getroot(self) -> Element: ... + def parse(self, source: _file_or_filename, parser: Optional[XMLParser] = ...) -> Element: ... + def iter(self, tag: Optional[_str_argument_type] = ...) -> Generator[Element, None, None]: ... + def getiterator(self, tag: Optional[_str_argument_type] = ...) -> List[Element]: ... + def find(self, path: _str_argument_type, namespaces: Optional[Dict[_str_argument_type, _str_argument_type]] = ...) -> Optional[Element]: ... + def findtext(self, path: _str_argument_type, default: Optional[_T] = ..., namespaces: Optional[Dict[_str_argument_type, _str_argument_type]] = ...) -> Union[_T, _str_result_type]: ... + def findall(self, path: _str_argument_type, namespaces: Optional[Dict[_str_argument_type, _str_argument_type]] = ...) -> List[Element]: ... + def iterfind(self, path: _str_argument_type, namespaces: Optional[Dict[_str_argument_type, _str_argument_type]] = ...) -> List[Element]: ... + if sys.version_info >= (3, 4): + def write(self, file_or_filename: _file_or_filename, encoding: Optional[str] = ..., xml_declaration: Optional[bool] = ..., default_namespace: Optional[_str_argument_type] = ..., method: Optional[str] = ..., *, short_empty_elements: bool = ...) -> None: ... + else: + def write(self, file_or_filename: _file_or_filename, encoding: Optional[str] = ..., xml_declaration: Optional[bool] = ..., default_namespace: Optional[_str_argument_type] = ..., method: Optional[str] = ...) -> None: ... + def write_c14n(self, file: _file_or_filename) -> None: ... + +def register_namespace(prefix: _str_argument_type, uri: _str_argument_type) -> None: ... +if sys.version_info >= (3, 4): + def tostring(element: Element, encoding: Optional[str] = ..., method: Optional[str] = ..., *, short_empty_elements: bool = ...) -> _tostring_result_type: ... + def tostringlist(element: Element, encoding: Optional[str] = ..., method: Optional[str] = ..., *, short_empty_elements: bool = ...) -> List[_tostring_result_type]: ... +else: + def tostring(element: Element, encoding: Optional[str] = ..., method: Optional[str] = ...) -> _tostring_result_type: ... + def tostringlist(element: Element, encoding: Optional[str] = ..., method: Optional[str] = ...) -> List[_tostring_result_type]: ... +def dump(elem: Element) -> None: ... +def parse(source: _file_or_filename, parser: Optional[XMLParser] = ...) -> ElementTree: ... +def iterparse(source: _file_or_filename, events: Optional[Sequence[str]] = ..., parser: Optional[XMLParser] = ...) -> Iterator[Tuple[str, Any]]: ... + +if sys.version_info >= (3, 4): + class XMLPullParser: + def __init__(self, events: Optional[Sequence[str]] = ..., *, _parser: Optional[XMLParser] = ...) -> None: ... + def feed(self, data: bytes) -> None: ... + def close(self) -> None: ... + def read_events(self) -> Iterator[Tuple[str, Element]]: ... + +def XML(text: _parser_input_type, parser: Optional[XMLParser] = ...) -> Element: ... +def XMLID(text: _parser_input_type, parser: Optional[XMLParser] = ...) -> Tuple[Element, Dict[_str_result_type, Element]]: ... + +# This is aliased to XML in the source. +fromstring = XML + +def fromstringlist(sequence: Sequence[_parser_input_type], parser: Optional[XMLParser] = ...) -> Element: ... + +# This type is both not precise enough and too precise. The TreeBuilder +# requires the elementfactory to accept tag and attrs in its args and produce +# some kind of object that has .text and .tail properties. +# I've chosen to constrain the ElementFactory to always produce an Element +# because that is how almost everyone will use it. +# Unfortunately, the type of the factory arguments is dependent on how +# TreeBuilder is called by client code (they could pass strs, bytes or whatever); +# but we don't want to use a too-broad type, or it would be too hard to write +# elementfactories. +_ElementFactory = Callable[[Any, Dict[Any, Any]], Element] + +class TreeBuilder: + def __init__(self, element_factory: Optional[_ElementFactory] = ...) -> None: ... + def close(self) -> Element: ... + def data(self, data: _parser_input_type) -> None: ... + def start(self, tag: _parser_input_type, attrs: Dict[_parser_input_type, _parser_input_type]) -> Element: ... + def end(self, tag: _parser_input_type) -> Element: ... + +class XMLParser: + parser: Any + target: TreeBuilder + # TODO-what is entity used for??? + entity: Any + version: str + def __init__(self, html: int = ..., target: Optional[TreeBuilder] = ..., encoding: Optional[str] = ...) -> None: ... + def doctype(self, name: str, pubid: str, system: str) -> None: ... + def close(self) -> Element: ... + def feed(self, data: _parser_input_type) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/xml/etree/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/xml/etree/__init__.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/xml/etree/cElementTree.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/xml/etree/cElementTree.pyi new file mode 100644 index 0000000..c384968 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/xml/etree/cElementTree.pyi @@ -0,0 +1,3 @@ +# Stubs for xml.etree.cElementTree (Python 3.4) + +from xml.etree.ElementTree import * # noqa: F403 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/xml/parsers/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/xml/parsers/__init__.pyi new file mode 100644 index 0000000..cac0862 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/xml/parsers/__init__.pyi @@ -0,0 +1 @@ +import xml.parsers.expat as expat diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/xml/parsers/expat/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/xml/parsers/expat/__init__.pyi new file mode 100644 index 0000000..73f3758 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/xml/parsers/expat/__init__.pyi @@ -0,0 +1 @@ +from pyexpat import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/xml/parsers/expat/errors.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/xml/parsers/expat/errors.pyi new file mode 100644 index 0000000..e22d769 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/xml/parsers/expat/errors.pyi @@ -0,0 +1 @@ +from pyexpat.errors import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/xml/parsers/expat/model.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/xml/parsers/expat/model.pyi new file mode 100644 index 0000000..d8f44b4 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/xml/parsers/expat/model.pyi @@ -0,0 +1 @@ +from pyexpat.model import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/xml/sax/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/xml/sax/__init__.pyi new file mode 100644 index 0000000..6edf12d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/xml/sax/__init__.pyi @@ -0,0 +1,34 @@ +from typing import Any, List, NoReturn, Optional, Text, Union, IO + +import xml.sax +from xml.sax.xmlreader import InputSource, Locator +from xml.sax.handler import ContentHandler, ErrorHandler + +class SAXException(Exception): + def __init__(self, msg: str, exception: Optional[Exception] = ...) -> None: ... + def getMessage(self) -> str: ... + def getException(self) -> Exception: ... + def __getitem__(self, ix: Any) -> NoReturn: ... + +class SAXParseException(SAXException): + def __init__(self, msg: str, exception: Exception, locator: Locator) -> None: ... + def getColumnNumber(self) -> int: ... + def getLineNumber(self) -> int: ... + def getPublicId(self): ... + def getSystemId(self): ... + +class SAXNotRecognizedException(SAXException): ... +class SAXNotSupportedException(SAXException): ... +class SAXReaderNotAvailable(SAXNotSupportedException): ... + +default_parser_list: List[str] + +def make_parser(parser_list: List[str] = ...) -> xml.sax.xmlreader.XMLReader: ... + +def parse(source: Union[str, IO[str]], handler: xml.sax.handler.ContentHandler, + errorHandler: xml.sax.handler.ErrorHandler = ...) -> None: ... + +def parseString(string: Union[bytes, Text], handler: xml.sax.handler.ContentHandler, + errorHandler: Optional[xml.sax.handler.ErrorHandler] = ...) -> None: ... + +def _create_parser(parser_name: str) -> xml.sax.xmlreader.XMLReader: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/xml/sax/handler.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/xml/sax/handler.pyi new file mode 100644 index 0000000..3a51933 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/xml/sax/handler.pyi @@ -0,0 +1,46 @@ +from typing import Any + +version: Any + +class ErrorHandler: + def error(self, exception): ... + def fatalError(self, exception): ... + def warning(self, exception): ... + +class ContentHandler: + def __init__(self) -> None: ... + def setDocumentLocator(self, locator): ... + def startDocument(self): ... + def endDocument(self): ... + def startPrefixMapping(self, prefix, uri): ... + def endPrefixMapping(self, prefix): ... + def startElement(self, name, attrs): ... + def endElement(self, name): ... + def startElementNS(self, name, qname, attrs): ... + def endElementNS(self, name, qname): ... + def characters(self, content): ... + def ignorableWhitespace(self, whitespace): ... + def processingInstruction(self, target, data): ... + def skippedEntity(self, name): ... + +class DTDHandler: + def notationDecl(self, name, publicId, systemId): ... + def unparsedEntityDecl(self, name, publicId, systemId, ndata): ... + +class EntityResolver: + def resolveEntity(self, publicId, systemId): ... + +feature_namespaces: Any +feature_namespace_prefixes: Any +feature_string_interning: Any +feature_validation: Any +feature_external_ges: Any +feature_external_pes: Any +all_features: Any +property_lexical_handler: Any +property_declaration_handler: Any +property_dom_node: Any +property_xml_string: Any +property_encoding: Any +property_interning_dict: Any +all_properties: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/xml/sax/saxutils.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/xml/sax/saxutils.pyi new file mode 100644 index 0000000..342d6ed --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/xml/sax/saxutils.pyi @@ -0,0 +1,58 @@ +import sys +from typing import Mapping, Text + +from xml.sax import handler +from xml.sax import xmlreader + +def escape(data: Text, entities: Mapping[Text, Text] = ...) -> Text: ... +def unescape(data: Text, entities: Mapping[Text, Text] = ...) -> Text: ... +def quoteattr(data: Text, entities: Mapping[Text, Text] = ...) -> Text: ... + +class XMLGenerator(handler.ContentHandler): + if sys.version_info >= (3, 0): + def __init__(self, out=..., encoding=..., short_empty_elements: bool = ...) -> None: ... + else: + def __init__(self, out=..., encoding=...) -> None: ... + def startDocument(self): ... + def endDocument(self): ... + def startPrefixMapping(self, prefix, uri): ... + def endPrefixMapping(self, prefix): ... + def startElement(self, name, attrs): ... + def endElement(self, name): ... + def startElementNS(self, name, qname, attrs): ... + def endElementNS(self, name, qname): ... + def characters(self, content): ... + def ignorableWhitespace(self, content): ... + def processingInstruction(self, target, data): ... + +class XMLFilterBase(xmlreader.XMLReader): + def __init__(self, parent=...) -> None: ... + def error(self, exception): ... + def fatalError(self, exception): ... + def warning(self, exception): ... + def setDocumentLocator(self, locator): ... + def startDocument(self): ... + def endDocument(self): ... + def startPrefixMapping(self, prefix, uri): ... + def endPrefixMapping(self, prefix): ... + def startElement(self, name, attrs): ... + def endElement(self, name): ... + def startElementNS(self, name, qname, attrs): ... + def endElementNS(self, name, qname): ... + def characters(self, content): ... + def ignorableWhitespace(self, chars): ... + def processingInstruction(self, target, data): ... + def skippedEntity(self, name): ... + def notationDecl(self, name, publicId, systemId): ... + def unparsedEntityDecl(self, name, publicId, systemId, ndata): ... + def resolveEntity(self, publicId, systemId): ... + def parse(self, source): ... + def setLocale(self, locale): ... + def getFeature(self, name): ... + def setFeature(self, name, state): ... + def getProperty(self, name): ... + def setProperty(self, name, value): ... + def getParent(self): ... + def setParent(self, parent): ... + +def prepare_input_source(source, base=...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/xml/sax/xmlreader.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/xml/sax/xmlreader.pyi new file mode 100644 index 0000000..fbc1ac1 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/xml/sax/xmlreader.pyi @@ -0,0 +1,71 @@ +class XMLReader: + def __init__(self) -> None: ... + def parse(self, source): ... + def getContentHandler(self): ... + def setContentHandler(self, handler): ... + def getDTDHandler(self): ... + def setDTDHandler(self, handler): ... + def getEntityResolver(self): ... + def setEntityResolver(self, resolver): ... + def getErrorHandler(self): ... + def setErrorHandler(self, handler): ... + def setLocale(self, locale): ... + def getFeature(self, name): ... + def setFeature(self, name, state): ... + def getProperty(self, name): ... + def setProperty(self, name, value): ... + +class IncrementalParser(XMLReader): + def __init__(self, bufsize=...) -> None: ... + def parse(self, source): ... + def feed(self, data): ... + def prepareParser(self, source): ... + def close(self): ... + def reset(self): ... + +class Locator: + def getColumnNumber(self): ... + def getLineNumber(self): ... + def getPublicId(self): ... + def getSystemId(self): ... + +class InputSource: + def __init__(self, system_id=...) -> None: ... + def setPublicId(self, public_id): ... + def getPublicId(self): ... + def setSystemId(self, system_id): ... + def getSystemId(self): ... + def setEncoding(self, encoding): ... + def getEncoding(self): ... + def setByteStream(self, bytefile): ... + def getByteStream(self): ... + def setCharacterStream(self, charfile): ... + def getCharacterStream(self): ... + +class AttributesImpl: + def __init__(self, attrs) -> None: ... + def getLength(self): ... + def getType(self, name): ... + def getValue(self, name): ... + def getValueByQName(self, name): ... + def getNameByQName(self, name): ... + def getQNameByName(self, name): ... + def getNames(self): ... + def getQNames(self): ... + def __len__(self): ... + def __getitem__(self, name): ... + def keys(self): ... + def has_key(self, name): ... + def __contains__(self, name): ... + def get(self, name, alternative=...): ... + def copy(self): ... + def items(self): ... + def values(self): ... + +class AttributesNSImpl(AttributesImpl): + def __init__(self, attrs, qnames) -> None: ... + def getValueByQName(self, name): ... + def getNameByQName(self, name): ... + def getQNameByName(self, name): ... + def getQNames(self): ... + def copy(self): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/zipfile.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/zipfile.pyi new file mode 100644 index 0000000..a06d3fd --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/zipfile.pyi @@ -0,0 +1,105 @@ +# Stubs for zipfile + +from typing import Callable, Dict, IO, Iterable, List, Optional, Text, Tuple, Type, Union +from types import TracebackType +import os +import sys + + +if sys.version_info >= (3, 6): + _Path = Union[os.PathLike[Text], Text] +else: + _Path = Text +_SZI = Union[Text, ZipInfo] +_DT = Tuple[int, int, int, int, int, int] + + +if sys.version_info >= (3,): + class BadZipFile(Exception): ... + BadZipfile = BadZipFile +else: + class BadZipfile(Exception): ... +error = BadZipfile + +class LargeZipFile(Exception): ... + +class ZipFile: + debug: int + comment: bytes + filelist: List[ZipInfo] + fp: IO[bytes] + NameToInfo: Dict[Text, ZipInfo] + def __init__(self, file: Union[_Path, IO[bytes]], mode: Text = ..., compression: int = ..., + allowZip64: bool = ...) -> None: ... + def __enter__(self) -> ZipFile: ... + def __exit__(self, exc_type: Optional[Type[BaseException]], + exc_val: Optional[BaseException], + exc_tb: Optional[TracebackType]) -> bool: ... + def close(self) -> None: ... + def getinfo(self, name: Text) -> ZipInfo: ... + def infolist(self) -> List[ZipInfo]: ... + def namelist(self) -> List[Text]: ... + def open(self, name: _SZI, mode: Text = ..., + pwd: Optional[bytes] = ...) -> IO[bytes]: ... + def extract(self, member: _SZI, path: Optional[_SZI] = ..., + pwd: bytes = ...) -> str: ... + def extractall(self, path: Optional[_Path] = ..., + members: Optional[Iterable[Text]] = ..., + pwd: Optional[bytes] = ...) -> None: ... + def printdir(self) -> None: ... + def setpassword(self, pwd: bytes) -> None: ... + def read(self, name: _SZI, pwd: Optional[bytes] = ...) -> bytes: ... + def testzip(self) -> Optional[str]: ... + def write(self, filename: _Path, arcname: Optional[_Path] = ..., + compress_type: Optional[int] = ...) -> None: ... + if sys.version_info >= (3,): + def writestr(self, zinfo_or_arcname: _SZI, data: Union[bytes, str], + compress_type: Optional[int] = ...) -> None: ... + else: + def writestr(self, + zinfo_or_arcname: _SZI, bytes: bytes, + compress_type: Optional[int] = ...) -> None: ... + +class PyZipFile(ZipFile): + if sys.version_info >= (3,): + def __init__(self, file: Union[str, IO[bytes]], mode: str = ..., + compression: int = ..., allowZip64: bool = ..., + opimize: int = ...) -> None: ... + def writepy(self, pathname: str, basename: str = ..., + filterfunc: Optional[Callable[[str], bool]] = ...) -> None: ... + else: + def writepy(self, + pathname: Text, basename: Text = ...) -> None: ... + +class ZipInfo: + filename: Text + date_time: _DT + compress_type: int + comment: bytes + extra: bytes + create_system: int + create_version: int + extract_version: int + reserved: int + flag_bits: int + volume: int + internal_attr: int + external_attr: int + header_offset: int + CRC: int + compress_size: int + file_size: int + def __init__(self, filename: Optional[Text] = ..., + date_time: Optional[_DT] = ...) -> None: ... + if sys.version_info >= (3, 6): + def is_dir(self) -> bool: ... + def FileHeader(self, zip64: Optional[bool] = ...) -> bytes: ... + + +def is_zipfile(filename: Union[_Path, IO[bytes]]) -> bool: ... + +ZIP_STORED: int +ZIP_DEFLATED: int +if sys.version_info >= (3, 3): + ZIP_BZIP2: int + ZIP_LZMA: int diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/zipimport.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/zipimport.pyi new file mode 100644 index 0000000..c22531a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/zipimport.pyi @@ -0,0 +1,18 @@ +"""Stub file for the 'zipimport' module.""" + +from typing import Optional +from types import CodeType, ModuleType + +class ZipImportError(ImportError): ... + +class zipimporter(object): + archive: str + prefix: str + def __init__(self, archivepath: str) -> None: ... + def find_module(self, fullname: str, path: str = ...) -> Optional[zipimporter]: ... + def get_code(self, fullname: str) -> CodeType: ... + def get_data(self, pathname: str) -> str: ... + def get_filename(self, fullname: str) -> str: ... + def get_source(self, fullname: str) -> Optional[str]: ... + def is_package(self, fullname: str) -> bool: ... + def load_module(self, fullname: str) -> ModuleType: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/zlib.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/zlib.pyi new file mode 100644 index 0000000..4ea5372 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/2and3/zlib.pyi @@ -0,0 +1,55 @@ +# Stubs for zlib +import sys + +DEFLATED: int +DEF_MEM_LEVEL: int +MAX_WBITS: int +ZLIB_VERSION: str +Z_BEST_COMPRESSION: int +Z_BEST_SPEED: int +Z_DEFAULT_COMPRESSION: int +Z_DEFAULT_STRATEGY: int +Z_FILTERED: int +Z_FINISH: int +Z_FULL_FLUSH: int +Z_HUFFMAN_ONLY: int +Z_NO_FLUSH: int +Z_SYNC_FLUSH: int +if sys.version_info >= (3,): + DEF_BUF_SIZE: int + ZLIB_RUNTIME_VERSION: str + +class error(Exception): ... + + +class _Compress: + def compress(self, data: bytes) -> bytes: ... + def flush(self, mode: int = ...) -> bytes: ... + def copy(self) -> _Compress: ... + + +class _Decompress: + unused_data: bytes + unconsumed_tail: bytes + if sys.version_info >= (3,): + eof: bool + def decompress(self, data: bytes, max_length: int = ...) -> bytes: ... + def flush(self, length: int = ...) -> bytes: ... + def copy(self) -> _Decompress: ... + + +def adler32(data: bytes, value: int = ...) -> int: ... +def compress(data: bytes, level: int = ...) -> bytes: ... +if sys.version_info >= (3,): + def compressobj(level: int = ..., method: int = ..., wbits: int = ..., + memLevel: int = ..., strategy: int = ..., + zdict: bytes = ...) -> _Compress: ... +else: + def compressobj(level: int = ..., method: int = ..., wbits: int = ..., + memlevel: int = ..., strategy: int = ...) -> _Compress: ... +def crc32(data: bytes, value: int = ...) -> int: ... +def decompress(data: bytes, wbits: int = ..., bufsize: int = ...) -> bytes: ... +if sys.version_info >= (3,): + def decompressobj(wbits: int = ..., zdict: bytes = ...) -> _Decompress: ... +else: + def decompressobj(wbits: int = ...) -> _Decompress: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3.5/zipapp.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3.5/zipapp.pyi new file mode 100644 index 0000000..b90b755 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3.5/zipapp.pyi @@ -0,0 +1,16 @@ +# Stubs for zipapp (Python 3.5+) + +from pathlib import Path +import sys +from typing import BinaryIO, Callable, Optional, Union + +_Path = Union[str, Path, BinaryIO] + +class ZipAppError(Exception): ... + +if sys.version_info >= (3, 7): + def create_archive(source: _Path, target: Optional[_Path] = ..., interpreter: Optional[str] = ..., main: Optional[str] = ..., + filter: Optional[Callable[[Path], bool]] = ..., compressed: bool = ...) -> None: ... +else: + def create_archive(source: _Path, target: Optional[_Path] = ..., interpreter: Optional[str] = ..., main: Optional[str] = ...) -> None: ... +def get_interpreter(archive: _Path) -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3.6/secrets.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3.6/secrets.pyi new file mode 100644 index 0000000..5069dba --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3.6/secrets.pyi @@ -0,0 +1,14 @@ +# Stubs for secrets (Python 3.6) + +from typing import Optional, Sequence, TypeVar +from hmac import compare_digest as compare_digest +from random import SystemRandom as SystemRandom + +_T = TypeVar('_T') + +def randbelow(exclusive_upper_bound: int) -> int: ... +def randbits(k: int) -> int: ... +def choice(seq: Sequence[_T]) -> _T: ... +def token_bytes(nbytes: Optional[int] = ...) -> bytes: ... +def token_hex(nbytes: Optional[int] = ...) -> str: ... +def token_urlsafe(nbytes: Optional[int] = ...) -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3.7/contextvars.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3.7/contextvars.pyi new file mode 100644 index 0000000..ab2ae9e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3.7/contextvars.pyi @@ -0,0 +1,30 @@ +from typing import Any, Callable, ClassVar, Generic, Iterator, Mapping, TypeVar, Union + +_T = TypeVar('_T') + +class ContextVar(Generic[_T]): + def __init__(self, name: str, *, default: _T = ...) -> None: ... + @property + def name(self) -> str: ... + def get(self, default: _T = ...) -> _T: ... + def set(self, value: _T) -> Token[_T]: ... + def reset(self, token: Token[_T]) -> None: ... + +class Token(Generic[_T]): + @property + def var(self) -> ContextVar[_T]: ... + @property + def old_value(self) -> Any: ... # returns either _T or MISSING, but that's hard to express + MISSING: ClassVar[object] + +def copy_context() -> Context: ... + +# It doesn't make sense to make this generic, because for most Contexts each ContextVar will have +# a different value. +class Context(Mapping[ContextVar[Any], Any]): + def __init__(self) -> None: ... + def run(self, callable: Callable[..., _T], *args: Any, **kwargs: Any) -> _T: ... + def copy(self) -> Context: ... + def __getitem__(self, key: ContextVar[Any]) -> Any: ... + def __iter__(self) -> Iterator[ContextVar[Any]]: ... + def __len__(self) -> int: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3.7/dataclasses.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3.7/dataclasses.pyi new file mode 100644 index 0000000..f8bcd52 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3.7/dataclasses.pyi @@ -0,0 +1,71 @@ +from typing import overload, Any, Callable, Dict, Generic, Iterable, List, Mapping, Optional, Tuple, Type, TypeVar, Union + + +_T = TypeVar('_T') + +class _MISSING_TYPE: ... +MISSING: _MISSING_TYPE + +@overload +def asdict(obj: Any) -> Dict[str, Any]: ... +@overload +def asdict(obj: Any, *, dict_factory: Callable[[List[Tuple[str, Any]]], _T]) -> _T: ... + +@overload +def astuple(obj: Any) -> Tuple[Any, ...]: ... +@overload +def astuple(obj: Any, *, tuple_factory: Callable[[List[Any]], _T]) -> _T: ... + + +@overload +def dataclass(_cls: Type[_T]) -> Type[_T]: ... + +@overload +def dataclass(*, init: bool = ..., repr: bool = ..., eq: bool = ..., order: bool = ..., + unsafe_hash: bool = ..., frozen: bool = ...) -> Callable[[Type[_T]], Type[_T]]: ... + + +class Field(Generic[_T]): + name: str + type: Type[_T] + default: _T + default_factory: Callable[[], _T] + repr: bool + hash: Optional[bool] + init: bool + compare: bool + metadata: Optional[Mapping[str, Any]] + + +# NOTE: Actual return type is 'Field[_T]', but we want to help type checkers +# to understand the magic that happens at runtime. +@overload # `default` and `default_factory` are optional and mutually exclusive. +def field(*, default: _T, + init: bool = ..., repr: bool = ..., hash: Optional[bool] = ..., compare: bool = ..., + metadata: Optional[Mapping[str, Any]] = ...) -> _T: ... + +@overload +def field(*, default_factory: Callable[[], _T], + init: bool = ..., repr: bool = ..., hash: Optional[bool] = ..., compare: bool = ..., + metadata: Optional[Mapping[str, Any]] = ...) -> _T: ... + +@overload +def field(*, + init: bool = ..., repr: bool = ..., hash: Optional[bool] = ..., compare: bool = ..., + metadata: Optional[Mapping[str, Any]] = ...) -> Any: ... + + +def fields(class_or_instance: Any) -> Tuple[Field[Any], ...]: ... + +def is_dataclass(obj: Any) -> bool: ... + +class FrozenInstanceError(AttributeError): ... + +class InitVar(Generic[_T]): ... + +def make_dataclass(cls_name: str, fields: Iterable[Union[str, Tuple[str, type], Tuple[str, type, Field[Any]]]], *, + bases: Tuple[type, ...] = ..., namespace: Optional[Dict[str, Any]] = ..., + init: bool = ..., repr: bool = ..., eq: bool = ..., order: bool = ..., hash: bool = ..., + frozen: bool = ...): ... + +def replace(obj: _T, **changes: Any) -> _T: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/_ast.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/_ast.pyi new file mode 100644 index 0000000..9f4284e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/_ast.pyi @@ -0,0 +1,409 @@ +import sys +import typing +from typing import Any, Optional, ClassVar + +PyCF_ONLY_AST: int + +_identifier = str + +class AST: + _attributes: ClassVar[typing.Tuple[str, ...]] + _fields: ClassVar[typing.Tuple[str, ...]] + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + # TODO: Not all nodes have all of the following attributes + lineno: int + col_offset: int + if sys.version_info >= (3, 8): + end_lineno: Optional[int] + end_col_offset: Optional[int] + type_comment: Optional[str] + +class mod(AST): + ... + +if sys.version_info >= (3, 8): + class type_ignore(AST): ... + + class TypeIgnore(type_ignore): ... + + class FunctionType(mod): + argtypes: typing.List[expr] + returns: expr + +class Module(mod): + body: typing.List[stmt] + if sys.version_info >= (3, 7): + docstring: Optional[str] + if sys.version_info >= (3, 8): + type_ignores: typing.List[TypeIgnore] + +class Interactive(mod): + body: typing.List[stmt] + +class Expression(mod): + body: expr + +class Suite(mod): + body: typing.List[stmt] + + +class stmt(AST): ... + +class FunctionDef(stmt): + name: _identifier + args: arguments + body: typing.List[stmt] + decorator_list: typing.List[expr] + returns: Optional[expr] + if sys.version_info >= (3, 7): + docstring: Optional[str] + +class AsyncFunctionDef(stmt): + name: _identifier + args: arguments + body: typing.List[stmt] + decorator_list: typing.List[expr] + returns: Optional[expr] + if sys.version_info >= (3, 7): + docstring: Optional[str] + +class ClassDef(stmt): + name: _identifier + bases: typing.List[expr] + keywords: typing.List[keyword] + body: typing.List[stmt] + decorator_list: typing.List[expr] + if sys.version_info >= (3, 7): + docstring: Optional[str] + +class Return(stmt): + value: Optional[expr] + +class Delete(stmt): + targets: typing.List[expr] + +class Assign(stmt): + targets: typing.List[expr] + value: expr + +class AugAssign(stmt): + target: expr + op: operator + value: expr + +if sys.version_info >= (3, 6): + class AnnAssign(stmt): + target: expr + annotation: expr + value: Optional[expr] + simple: int + +class For(stmt): + target: expr + iter: expr + body: typing.List[stmt] + orelse: typing.List[stmt] + +class AsyncFor(stmt): + target: expr + iter: expr + body: typing.List[stmt] + orelse: typing.List[stmt] + +class While(stmt): + test: expr + body: typing.List[stmt] + orelse: typing.List[stmt] + +class If(stmt): + test: expr + body: typing.List[stmt] + orelse: typing.List[stmt] + +class With(stmt): + items: typing.List[withitem] + body: typing.List[stmt] + +class AsyncWith(stmt): + items: typing.List[withitem] + body: typing.List[stmt] + +class Raise(stmt): + exc: Optional[expr] + cause: Optional[expr] + +class Try(stmt): + body: typing.List[stmt] + handlers: typing.List[ExceptHandler] + orelse: typing.List[stmt] + finalbody: typing.List[stmt] + +class Assert(stmt): + test: expr + msg: Optional[expr] + +class Import(stmt): + names: typing.List[alias] + +class ImportFrom(stmt): + module: Optional[_identifier] + names: typing.List[alias] + level: int + +class Global(stmt): + names: typing.List[_identifier] + +class Nonlocal(stmt): + names: typing.List[_identifier] + +class Expr(stmt): + value: expr + +class Pass(stmt): ... +class Break(stmt): ... +class Continue(stmt): ... + + +class slice(AST): + ... + +_slice = slice # this lets us type the variable named 'slice' below + +class Slice(slice): + lower: Optional[expr] + upper: Optional[expr] + step: Optional[expr] + +class ExtSlice(slice): + dims: typing.List[slice] + +class Index(slice): + value: expr + + +class expr(AST): ... + +class BoolOp(expr): + op: boolop + values: typing.List[expr] + +class BinOp(expr): + left: expr + op: operator + right: expr + +class UnaryOp(expr): + op: unaryop + operand: expr + +class Lambda(expr): + args: arguments + body: expr + +class IfExp(expr): + test: expr + body: expr + orelse: expr + +class Dict(expr): + keys: typing.List[expr] + values: typing.List[expr] + +class Set(expr): + elts: typing.List[expr] + +class ListComp(expr): + elt: expr + generators: typing.List[comprehension] + +class SetComp(expr): + elt: expr + generators: typing.List[comprehension] + +class DictComp(expr): + key: expr + value: expr + generators: typing.List[comprehension] + +class GeneratorExp(expr): + elt: expr + generators: typing.List[comprehension] + +class Await(expr): + value: expr + +class Yield(expr): + value: Optional[expr] + +class YieldFrom(expr): + value: expr + +class Compare(expr): + left: expr + ops: typing.List[cmpop] + comparators: typing.List[expr] + +class Call(expr): + func: expr + args: typing.List[expr] + keywords: typing.List[keyword] + +class Num(expr): # Deprecated in 3.8; use Constant + n: complex + +class Str(expr): # Deprecated in 3.8; use Constant + s: str + +if sys.version_info >= (3, 6): + class FormattedValue(expr): + value: expr + conversion: Optional[int] + format_spec: Optional[expr] + + class JoinedStr(expr): + values: typing.List[expr] + +class Bytes(expr): # Deprecated in 3.8; use Constant + s: bytes + +class NameConstant(expr): + value: Any + +if sys.version_info >= (3, 8): + class Constant(expr): + value: Any # None, str, bytes, bool, int, float, complex, Ellipsis + kind: Optional[str] + # Aliases for value, for backwards compatibility + s: Any + n: complex + + class NamedExpr(expr): + target: expr + value: expr + +class Ellipsis(expr): ... + +class Attribute(expr): + value: expr + attr: _identifier + ctx: expr_context + +class Subscript(expr): + value: expr + slice: _slice + ctx: expr_context + +class Starred(expr): + value: expr + ctx: expr_context + +class Name(expr): + id: _identifier + ctx: expr_context + +class List(expr): + elts: typing.List[expr] + ctx: expr_context + +class Tuple(expr): + elts: typing.List[expr] + ctx: expr_context + + +class expr_context(AST): + ... + +class AugLoad(expr_context): ... +class AugStore(expr_context): ... +class Del(expr_context): ... +class Load(expr_context): ... +class Param(expr_context): ... +class Store(expr_context): ... + + +class boolop(AST): + ... + +class And(boolop): ... +class Or(boolop): ... + +class operator(AST): + ... + +class Add(operator): ... +class BitAnd(operator): ... +class BitOr(operator): ... +class BitXor(operator): ... +class Div(operator): ... +class FloorDiv(operator): ... +class LShift(operator): ... +class Mod(operator): ... +class Mult(operator): ... +class MatMult(operator): ... +class Pow(operator): ... +class RShift(operator): ... +class Sub(operator): ... + +class unaryop(AST): + ... + +class Invert(unaryop): ... +class Not(unaryop): ... +class UAdd(unaryop): ... +class USub(unaryop): ... + +class cmpop(AST): + ... + +class Eq(cmpop): ... +class Gt(cmpop): ... +class GtE(cmpop): ... +class In(cmpop): ... +class Is(cmpop): ... +class IsNot(cmpop): ... +class Lt(cmpop): ... +class LtE(cmpop): ... +class NotEq(cmpop): ... +class NotIn(cmpop): ... + + +class comprehension(AST): + target: expr + iter: expr + ifs: typing.List[expr] + if sys.version_info >= (3, 6): + is_async: int + + +class excepthandler(AST): + ... + +class ExceptHandler(excepthandler): + type: Optional[expr] + name: Optional[_identifier] + body: typing.List[stmt] + + +class arguments(AST): + args: typing.List[arg] + vararg: Optional[arg] + kwonlyargs: typing.List[arg] + kw_defaults: typing.List[expr] + kwarg: Optional[arg] + defaults: typing.List[expr] + +class arg(AST): + arg: _identifier + annotation: Optional[expr] + +class keyword(AST): + arg: Optional[_identifier] + value: expr + +class alias(AST): + name: _identifier + asname: Optional[_identifier] + +class withitem(AST): + context_expr: expr + optional_vars: Optional[expr] diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/_compression.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/_compression.pyi new file mode 100644 index 0000000..bf474e6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/_compression.pyi @@ -0,0 +1,16 @@ +from typing import Any +import io + +BUFFER_SIZE: Any + +class BaseStream(io.BufferedIOBase): ... + +class DecompressReader(io.RawIOBase): + def readable(self): ... + def __init__(self, fp, decomp_factory, trailing_error=..., **decomp_args): ... + def close(self): ... + def seekable(self): ... + def readinto(self, b): ... + def read(self, size: int = ...): ... + def seek(self, offset, whence=...): ... + def tell(self): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/_curses.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/_curses.pyi new file mode 100644 index 0000000..16c6fd7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/_curses.pyi @@ -0,0 +1,447 @@ +from typing import Any, BinaryIO, IO, Optional, Tuple, Union, overload + +_chtype = Union[str, bytes, int] + +ALL_MOUSE_EVENTS: int +A_ALTCHARSET: int +A_ATTRIBUTES: int +A_BLINK: int +A_BOLD: int +A_CHARTEXT: int +A_COLOR: int +A_DIM: int +A_HORIZONTAL: int +A_INVIS: int +A_LEFT: int +A_LOW: int +A_NORMAL: int +A_PROTECT: int +A_REVERSE: int +A_RIGHT: int +A_STANDOUT: int +A_TOP: int +A_UNDERLINE: int +A_VERTICAL: int +BUTTON1_CLICKED: int +BUTTON1_DOUBLE_CLICKED: int +BUTTON1_PRESSED: int +BUTTON1_RELEASED: int +BUTTON1_TRIPLE_CLICKED: int +BUTTON2_CLICKED: int +BUTTON2_DOUBLE_CLICKED: int +BUTTON2_PRESSED: int +BUTTON2_RELEASED: int +BUTTON2_TRIPLE_CLICKED: int +BUTTON3_CLICKED: int +BUTTON3_DOUBLE_CLICKED: int +BUTTON3_PRESSED: int +BUTTON3_RELEASED: int +BUTTON3_TRIPLE_CLICKED: int +BUTTON4_CLICKED: int +BUTTON4_DOUBLE_CLICKED: int +BUTTON4_PRESSED: int +BUTTON4_RELEASED: int +BUTTON4_TRIPLE_CLICKED: int +BUTTON_ALT: int +BUTTON_CTRL: int +BUTTON_SHIFT: int +COLOR_BLACK: int +COLOR_BLUE: int +COLOR_CYAN: int +COLOR_GREEN: int +COLOR_MAGENTA: int +COLOR_RED: int +COLOR_WHITE: int +COLOR_YELLOW: int +ERR: int +KEY_A1: int +KEY_A3: int +KEY_B2: int +KEY_BACKSPACE: int +KEY_BEG: int +KEY_BREAK: int +KEY_BTAB: int +KEY_C1: int +KEY_C3: int +KEY_CANCEL: int +KEY_CATAB: int +KEY_CLEAR: int +KEY_CLOSE: int +KEY_COMMAND: int +KEY_COPY: int +KEY_CREATE: int +KEY_CTAB: int +KEY_DC: int +KEY_DL: int +KEY_DOWN: int +KEY_EIC: int +KEY_END: int +KEY_ENTER: int +KEY_EOL: int +KEY_EOS: int +KEY_EXIT: int +KEY_F0: int +KEY_F1: int +KEY_F10: int +KEY_F11: int +KEY_F12: int +KEY_F13: int +KEY_F14: int +KEY_F15: int +KEY_F16: int +KEY_F17: int +KEY_F18: int +KEY_F19: int +KEY_F2: int +KEY_F20: int +KEY_F21: int +KEY_F22: int +KEY_F23: int +KEY_F24: int +KEY_F25: int +KEY_F26: int +KEY_F27: int +KEY_F28: int +KEY_F29: int +KEY_F3: int +KEY_F30: int +KEY_F31: int +KEY_F32: int +KEY_F33: int +KEY_F34: int +KEY_F35: int +KEY_F36: int +KEY_F37: int +KEY_F38: int +KEY_F39: int +KEY_F4: int +KEY_F40: int +KEY_F41: int +KEY_F42: int +KEY_F43: int +KEY_F44: int +KEY_F45: int +KEY_F46: int +KEY_F47: int +KEY_F48: int +KEY_F49: int +KEY_F5: int +KEY_F50: int +KEY_F51: int +KEY_F52: int +KEY_F53: int +KEY_F54: int +KEY_F55: int +KEY_F56: int +KEY_F57: int +KEY_F58: int +KEY_F59: int +KEY_F6: int +KEY_F60: int +KEY_F61: int +KEY_F62: int +KEY_F63: int +KEY_F7: int +KEY_F8: int +KEY_F9: int +KEY_FIND: int +KEY_HELP: int +KEY_HOME: int +KEY_IC: int +KEY_IL: int +KEY_LEFT: int +KEY_LL: int +KEY_MARK: int +KEY_MAX: int +KEY_MESSAGE: int +KEY_MIN: int +KEY_MOUSE: int +KEY_MOVE: int +KEY_NEXT: int +KEY_NPAGE: int +KEY_OPEN: int +KEY_OPTIONS: int +KEY_PPAGE: int +KEY_PREVIOUS: int +KEY_PRINT: int +KEY_REDO: int +KEY_REFERENCE: int +KEY_REFRESH: int +KEY_REPLACE: int +KEY_RESET: int +KEY_RESIZE: int +KEY_RESTART: int +KEY_RESUME: int +KEY_RIGHT: int +KEY_SAVE: int +KEY_SBEG: int +KEY_SCANCEL: int +KEY_SCOMMAND: int +KEY_SCOPY: int +KEY_SCREATE: int +KEY_SDC: int +KEY_SDL: int +KEY_SELECT: int +KEY_SEND: int +KEY_SEOL: int +KEY_SEXIT: int +KEY_SF: int +KEY_SFIND: int +KEY_SHELP: int +KEY_SHOME: int +KEY_SIC: int +KEY_SLEFT: int +KEY_SMESSAGE: int +KEY_SMOVE: int +KEY_SNEXT: int +KEY_SOPTIONS: int +KEY_SPREVIOUS: int +KEY_SPRINT: int +KEY_SR: int +KEY_SREDO: int +KEY_SREPLACE: int +KEY_SRESET: int +KEY_SRIGHT: int +KEY_SRSUME: int +KEY_SSAVE: int +KEY_SSUSPEND: int +KEY_STAB: int +KEY_SUNDO: int +KEY_SUSPEND: int +KEY_UNDO: int +KEY_UP: int +OK: int +REPORT_MOUSE_POSITION: int +_C_API: Any +version: bytes + +def baudrate() -> int: ... +def beep() -> None: ... +def can_change_color() -> bool: ... +def cbreak(flag: bool = ...) -> None: ... +def color_content(color_number: int) -> Tuple[int, int, int]: ... +def color_pair(color_number: int) -> int: ... +def curs_set(visibility: int) -> int: ... +def def_prog_mode() -> None: ... +def def_shell_mode() -> None: ... +def delay_output(ms: int) -> None: ... +def doupdate() -> None: ... +def echo(flag: bool = ...) -> None: ... +def endwin() -> None: ... +def erasechar() -> bytes: ... +def filter() -> None: ... +def flash() -> None: ... +def flushinp() -> None: ... +def getmouse() -> Tuple[int, int, int, int, int]: ... +def getsyx() -> Tuple[int, int]: ... +def getwin(f: BinaryIO) -> _CursesWindow: ... +def halfdelay(tenths: int) -> None: ... +def has_colors() -> bool: ... +def has_ic() -> bool: ... +def has_il() -> bool: ... +def has_key(ch: int) -> bool: ... +def init_color(color_number: int, r: int, g: int, b: int) -> None: ... +def init_pair(pair_number: int, fg: int, bg: int) -> None: ... +def initscr() -> _CursesWindow: ... +def intrflush(ch: bool) -> None: ... +def is_term_resized(nlines: int, ncols: int) -> bool: ... +def isendwin() -> bool: ... +def keyname(k: int) -> bytes: ... +def killchar() -> bytes: ... +def longname() -> bytes: ... +def meta(yes: bool) -> None: ... +def mouseinterval(interval: int) -> None: ... +def mousemask(mousemask: int) -> Tuple[int, int]: ... +def napms(ms: int) -> int: ... +def newpad(nlines: int, ncols: int) -> _CursesWindow: ... +def newwin(nlines: int, ncols: int, begin_y: int = ..., begin_x: int = ...) -> _CursesWindow: ... +def nl(flag: bool = ...) -> None: ... +def nocbreak() -> None: ... +def noecho() -> None: ... +def nonl() -> None: ... +def noqiflush() -> None: ... +def noraw() -> None: ... +def pair_content(pair_number: int) -> Tuple[int, int]: ... +def pair_number(attr: int) -> int: ... +def putp(string: bytes) -> None: ... +def qiflush(flag: bool = ...) -> None: ... +def raw(flag: bool = ...) -> None: ... +def reset_prog_mode() -> None: ... +def reset_shell_mode() -> None: ... +def resetty() -> None: ... +def resize_term(nlines: int, ncols: int) -> None: ... +def resizeterm(nlines: int, ncols: int) -> None: ... +def savetty() -> None: ... +def setsyx(y: int, x: int) -> None: ... +def setupterm(termstr: str = ..., fd: int = ...) -> None: ... +def start_color() -> None: ... +def termattrs() -> int: ... +def termname() -> bytes: ... +def tigetflag(capname: str) -> int: ... +def tigetnum(capname: str) -> int: ... +def tigetstr(capname: str) -> bytes: ... +def tparm(fmt: bytes, i1: int = ..., i2: int = ..., i3: int = ..., i4: int = ..., i5: int = ..., i6: int = ..., i7: int = ..., i8: int = ..., i9: int = ...) -> bytes: ... +def typeahead(fd: int) -> None: ... +def unctrl(ch: _chtype) -> bytes: ... +def unget_wch(ch: _chtype) -> None: ... +def ungetch(ch: _chtype) -> None: ... +def ungetmouse(id: int, x: int, y: int, z: int, bstate: int) -> None: ... +def update_lines_cols() -> int: ... +def use_default_colors() -> None: ... +def use_env(flag: bool) -> None: ... + +class error(Exception): ... + +class _CursesWindow: + encoding: str + @overload + def addch(self, ch: _chtype, attr: int = ...) -> None: ... + @overload + def addch(self, y: int, x: int, ch: _chtype, attr: int = ...) -> None: ... + @overload + def addnstr(self, str: str, n: int, attr: int = ...) -> None: ... + @overload + def addnstr(self, y: int, x: int, str: str, n: int, attr: int = ...) -> None: ... + @overload + def addstr(self, str: str, attr: int = ...) -> None: ... + @overload + def addstr(self, y: int, x: int, str: str, attr: int = ...) -> None: ... + def attroff(self, attr: int) -> None: ... + def attron(self, attr: int) -> None: ... + def attrset(self, attr: int) -> None: ... + def bkgd(self, ch: _chtype, attr: int = ...) -> None: ... + def bkgset(self, ch: _chtype, attr: int = ...) -> None: ... + def border(self, ls: _chtype = ..., rs: _chtype = ..., ts: _chtype = ..., bs: _chtype = ..., tl: _chtype = ..., tr: _chtype = ..., bl: _chtype = ..., br: _chtype = ...) -> None: ... + @overload + def box(self) -> None: ... + @overload + def box(self, vertch: _chtype = ..., horch: _chtype = ...) -> None: ... + @overload + def chgat(self, attr: int) -> None: ... + @overload + def chgat(self, num: int, attr: int) -> None: ... + @overload + def chgat(self, y: int, x: int, attr: int) -> None: ... + @overload + def chgat(self, y: int, x: int, num: int, attr: int) -> None: ... + def clear(self) -> None: ... + def clearok(self, yes: int) -> None: ... + def clrtobot(self) -> None: ... + def clrtoeol(self) -> None: ... + def cursyncup(self) -> None: ... + @overload + def delch(self) -> None: ... + @overload + def delch(self, y: int, x: int) -> None: ... + def deleteln(self) -> None: ... + @overload + def derwin(self, begin_y: int, begin_x: int) -> _CursesWindow: ... + @overload + def derwin(self, nlines: int, ncols: int, begin_y: int, begin_x: int) -> _CursesWindow: ... + def echochar(self, ch: _chtype, attr: int = ...) -> None: ... + def enclose(self, y: int, x: int) -> bool: ... + def erase(self) -> None: ... + def getbegyx(self) -> Tuple[int, int]: ... + def getbkgd(self) -> Tuple[int, int]: ... + @overload + def getch(self) -> _chtype: ... + @overload + def getch(self, y: int, x: int) -> _chtype: ... + @overload + def get_wch(self) -> _chtype: ... + @overload + def get_wch(self, y: int, x: int) -> _chtype: ... + @overload + def getkey(self) -> str: ... + @overload + def getkey(self, y: int, x: int) -> str: ... + def getmaxyx(self) -> Tuple[int, int]: ... + def getparyx(self) -> Tuple[int, int]: ... + @overload + def getstr(self) -> _chtype: ... + @overload + def getstr(self, n: int) -> _chtype: ... + @overload + def getstr(self, y: int, x: int) -> _chtype: ... + @overload + def getstr(self, y: int, x: int, n: int) -> _chtype: ... + def getyx(self) -> Tuple[int, int]: ... + @overload + def hline(self, ch: _chtype, n: int) -> None: ... + @overload + def hline(self, y: int, x: int, ch: _chtype, n: int) -> None: ... + def idcok(self, flag: bool) -> None: ... + def idlok(self, yes: bool) -> None: ... + def immedok(self, flag: bool) -> None: ... + @overload + def inch(self) -> _chtype: ... + @overload + def inch(self, y: int, x: int) -> _chtype: ... + @overload + def insch(self, ch: _chtype, attr: int = ...) -> None: ... + @overload + def insch(self, y: int, x: int, ch: _chtype, attr: int = ...) -> None: ... + def insdelln(self, nlines: int) -> None: ... + def insertln(self) -> None: ... + @overload + def insnstr(self, str: str, n: int, attr: int = ...) -> None: ... + @overload + def insnstr(self, y: int, x: int, str: str, n: int, attr: int = ...) -> None: ... + @overload + def insstr(self, str: str, attr: int = ...) -> None: ... + @overload + def insstr(self, y: int, x: int, str: str, attr: int = ...) -> None: ... + @overload + def instr(self, n: int = ...) -> _chtype: ... + @overload + def instr(self, y: int, x: int, n: int = ...) -> _chtype: ... + def is_linetouched(self, line: int) -> bool: ... + def is_wintouched(self) -> bool: ... + def keypad(self, yes: bool) -> None: ... + def leaveok(self, yes: bool) -> None: ... + def move(self, new_y: int, new_x: int) -> None: ... + def mvderwin(self, y: int, x: int) -> None: ... + def mvwin(self, new_y: int, new_x: int) -> None: ... + def nodelay(self, yes: bool) -> None: ... + def notimeout(self, yes: bool) -> None: ... + def noutrefresh(self) -> None: ... + @overload + def overlay(self, destwin: _CursesWindow) -> None: ... + @overload + def overlay(self, destwin: _CursesWindow, sminrow: int, smincol: int, dminrow: int, dmincol: int, dmaxrow: int, dmaxcol: int) -> None: ... + @overload + def overwrite(self, destwin: _CursesWindow) -> None: ... + @overload + def overwrite(self, destwin: _CursesWindow, sminrow: int, smincol: int, dminrow: int, dmincol: int, dmaxrow: int, dmaxcol: int) -> None: ... + def putwin(self, file: IO[Any]) -> None: ... + def redrawln(self, beg: int, num: int) -> None: ... + def redrawwin(self) -> None: ... + @overload + def refresh(self) -> None: ... + @overload + def refresh(self, pminrow: int, pmincol: int, sminrow: int, smincol: int, smaxrow: int, smaxcol: int) -> None: ... + def resize(self, nlines: int, ncols: int) -> None: ... + def scroll(self, lines: int = ...) -> None: ... + def scrollok(self, flag: bool) -> None: ... + def setscrreg(self, top: int, bottom: int) -> None: ... + def standend(self) -> None: ... + def standout(self) -> None: ... + @overload + def subpad(self, begin_y: int, begin_x: int) -> _CursesWindow: ... + @overload + def subpad(self, nlines: int, ncols: int, begin_y: int, begin_x: int) -> _CursesWindow: ... + @overload + def subwin(self, begin_y: int, begin_x: int) -> _CursesWindow: ... + @overload + def subwin(self, nlines: int, ncols: int, begin_y: int, begin_x: int) -> _CursesWindow: ... + def syncdown(self) -> None: ... + def syncok(self, flag: bool) -> None: ... + def syncup(self) -> None: ... + def timeout(self, delay: int) -> None: ... + def touchline(self, start: int, count: int, changed: bool = ...) -> None: ... + def touchwin(self) -> None: ... + def untouchwin(self) -> None: ... + @overload + def vline(self, ch: _chtype, n: int) -> None: ... + @overload + def vline(self, y: int, x: int, ch: _chtype, n: int) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/_dummy_thread.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/_dummy_thread.pyi new file mode 100644 index 0000000..1260d42 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/_dummy_thread.pyi @@ -0,0 +1,21 @@ +from typing import Any, Callable, Dict, NoReturn, Optional, Tuple + +TIMEOUT_MAX: int +error = RuntimeError + +def start_new_thread(function: Callable[..., Any], args: Tuple[Any, ...], kwargs: Dict[str, Any] = ...) -> None: ... +def exit() -> NoReturn: ... +def get_ident() -> int: ... +def allocate_lock() -> LockType: ... +def stack_size(size: Optional[int] = ...) -> int: ... + +class LockType(object): + locked_status: bool + def __init__(self) -> None: ... + def acquire(self, waitflag: Optional[bool] = ..., timeout: int = ...) -> bool: ... + def __enter__(self, waitflag: Optional[bool] = ..., timeout: int = ...) -> bool: ... + def __exit__(self, typ: Any, val: Any, tb: Any) -> None: ... + def release(self) -> bool: ... + def locked(self) -> bool: ... + +def interrupt_main() -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/_imp.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/_imp.pyi new file mode 100644 index 0000000..7015b3b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/_imp.pyi @@ -0,0 +1,22 @@ +# Stubs for _imp (Python 3.6) + +import sys +import types +from typing import Any, List + +if sys.version_info >= (3, 5): + from importlib.machinery import ModuleSpec + def create_builtin(spec: ModuleSpec) -> types.ModuleType: ... + def create_dynamic(spec: ModuleSpec, file: Any = ...) -> None: ... + +def acquire_lock() -> None: ... +def exec_builtin(mod: types.ModuleType) -> int: ... +def exec_dynamic(mod: types.ModuleType) -> int: ... +def extension_suffixes() -> List[str]: ... +def get_frozen_object(name: str) -> types.CodeType: ... +def init_frozen(name: str) -> types.ModuleType: ... +def is_builtin(name: str) -> int: ... +def is_frozen(name: str) -> bool: ... +def is_frozen_package(name: str) -> bool: ... +def lock_held() -> bool: ... +def release_lock() -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/_importlib_modulespec.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/_importlib_modulespec.pyi new file mode 100644 index 0000000..51cb489 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/_importlib_modulespec.pyi @@ -0,0 +1,45 @@ +# ModuleSpec, ModuleType, Loader are part of a dependency cycle. +# They are officially defined/exported in other places: +# +# - ModuleType in types +# - Loader in importlib.abc +# - ModuleSpec in importlib.machinery (3.4 and later only) +# +# _Loader is the PEP-451-defined interface for a loader type/object. + +from abc import ABCMeta +import sys +from typing import Any, Dict, List, Optional, Protocol + +class _Loader(Protocol): + def load_module(self, fullname: str) -> ModuleType: ... + +class ModuleSpec: + def __init__(self, name: str, loader: Optional[Loader], *, + origin: Optional[str] = ..., loader_state: Any = ..., + is_package: Optional[bool] = ...) -> None: ... + name: str + loader: Optional[_Loader] + origin: Optional[str] + submodule_search_locations: Optional[List[str]] + loader_state: Any + cached: Optional[str] + parent: Optional[str] + has_location: bool + +class ModuleType: + __name__: str + __file__: str + __dict__: Dict[str, Any] + __loader__: Optional[_Loader] + __package__: Optional[str] + __spec__: Optional[ModuleSpec] + def __init__(self, name: str, doc: Optional[str] = ...) -> None: ... + +class Loader(metaclass=ABCMeta): + def load_module(self, fullname: str) -> ModuleType: ... + def module_repr(self, module: ModuleType) -> str: ... + def create_module(self, spec: ModuleSpec) -> Optional[ModuleType]: ... + # Not defined on the actual class for backwards-compatibility reasons, + # but expected in new code. + def exec_module(self, module: ModuleType) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/_json.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/_json.pyi new file mode 100644 index 0000000..217fadd --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/_json.pyi @@ -0,0 +1,30 @@ +"""Stub file for the '_json' module.""" + +from typing import Any, Tuple + +class make_encoder: + sort_keys: Any + skipkeys: Any + key_separator: Any + indent: Any + markers: Any + default: Any + encoder: Any + item_separator: Any + def __init__(self, markers, default, encoder, indent, key_separator, + item_separator, sort_keys, skipkeys, allow_nan) -> None: ... + def __call__(self, *args, **kwargs) -> Any: ... + +class make_scanner: + object_hook: Any + object_pairs_hook: Any + parse_int: Any + parse_constant: Any + parse_float: Any + strict: bool + # TODO: 'context' needs the attrs above (ducktype), but not __call__. + def __init__(self, context: make_scanner) -> None: ... + def __call__(self, string: str, index: int) -> Tuple[Any, int]: ... + +def encode_basestring_ascii(s: str) -> str: ... +def scanstring(string: str, end: int, strict: bool = ...) -> Tuple[str, int]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/_markupbase.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/_markupbase.pyi new file mode 100644 index 0000000..09f69c7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/_markupbase.pyi @@ -0,0 +1,9 @@ +from typing import Tuple + +class ParserBase: + def __init__(self) -> None: ... + def error(self, message: str) -> None: ... + def reset(self) -> None: ... + def getpos(self) -> Tuple[int, int]: ... + + def unknown_decl(self, data: str) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/_operator.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/_operator.pyi new file mode 100644 index 0000000..6d08cd7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/_operator.pyi @@ -0,0 +1,64 @@ +# Stubs for _operator (Python 3.5) + +import sys +from typing import AnyStr + +# In reality the import is the other way around, but this way we can keep the operator stub in 2and3 +from operator import ( + truth as truth, + contains as contains, + indexOf as indexOf, + countOf as countOf, + is_ as is_, + is_not as is_not, + index as index, + add as add, + sub as sub, + mul as mul, + floordiv as floordiv, + truediv as truediv, + mod as mod, + neg as neg, + pos as pos, + abs as abs, + inv as inv, + invert as invert, + length_hint as length_hint, + lshift as lshift, + rshift as rshift, + not_ as not_, + and_ as and_, + xor as xor, + or_ as or_, + iadd as iadd, + isub as isub, + imul as imul, + ifloordiv as ifloordiv, + itruediv as itruediv, + imod as imod, + ilshift as ilshift, + irshift as irshift, + iand as iand, + ixor as ixor, + ior as ior, + concat as concat, + iconcat as iconcat, + getitem as getitem, + setitem as setitem, + delitem as delitem, + pow as pow, + ipow as ipow, + eq as eq, + ne as ne, + lt as lt, + le as le, + gt as gt, + ge as ge, + itemgetter as itemgetter, + attrgetter as attrgetter, + methodcaller as methodcaller, +) +if sys.version_info >= (3, 5): + from operator import matmul as matmul, imatmul as imatmul + +def _compare_digest(a: AnyStr, b: AnyStr) -> bool: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/_posixsubprocess.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/_posixsubprocess.pyi new file mode 100644 index 0000000..67b7d7c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/_posixsubprocess.pyi @@ -0,0 +1,14 @@ +# Stubs for _posixsubprocess + +# NOTE: These are incomplete! + +from typing import Tuple, Sequence, Callable + +def cloexec_pipe() -> Tuple[int, int]: ... +def fork_exec(args: Sequence[str], + executable_list: Sequence[bytes], close_fds: bool, fds_to_keep: Sequence[int], + cwd: str, env_list: Sequence[bytes], + p2cread: int, p2cwrite: int, c2pred: int, c2pwrite: int, + errread: int, errwrite: int, errpipe_read: int, + errpipe_write: int, restore_signals: int, start_new_session: int, + preexec_fn: Callable[[], None]) -> int: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/_stat.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/_stat.pyi new file mode 100644 index 0000000..ffd28cb --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/_stat.pyi @@ -0,0 +1,69 @@ +"""Stub file for the '_stat' module.""" + +SF_APPEND: int +SF_ARCHIVED: int +SF_IMMUTABLE: int +SF_NOUNLINK: int +SF_SNAPSHOT: int +ST_ATIME: int +ST_CTIME: int +ST_DEV: int +ST_GID: int +ST_INO: int +ST_MODE: int +ST_MTIME: int +ST_NLINK: int +ST_SIZE: int +ST_UID: int +S_ENFMT: int +S_IEXEC: int +S_IFBLK: int +S_IFCHR: int +S_IFDIR: int +S_IFDOOR: int +S_IFIFO: int +S_IFLNK: int +S_IFPORT: int +S_IFREG: int +S_IFSOCK: int +S_IFWHT: int +S_IREAD: int +S_IRGRP: int +S_IROTH: int +S_IRUSR: int +S_IRWXG: int +S_IRWXO: int +S_IRWXU: int +S_ISGID: int +S_ISUID: int +S_ISVTX: int +S_IWGRP: int +S_IWOTH: int +S_IWRITE: int +S_IWUSR: int +S_IXGRP: int +S_IXOTH: int +S_IXUSR: int +UF_APPEND: int +UF_COMPRESSED: int +UF_HIDDEN: int +UF_IMMUTABLE: int +UF_NODUMP: int +UF_NOUNLINK: int +UF_OPAQUE: int + +def S_IMODE(mode: int) -> int: ... +def S_IFMT(mode: int) -> int: ... + +def S_ISBLK(mode: int) -> bool: ... +def S_ISCHR(mode: int) -> bool: ... +def S_ISDIR(mode: int) -> bool: ... +def S_ISDOOR(mode: int) -> bool: ... +def S_ISFIFO(mode: int) -> bool: ... +def S_ISLNK(mode: int) -> bool: ... +def S_ISPORT(mode: int) -> bool: ... +def S_ISREG(mode: int) -> bool: ... +def S_ISSOCK(mode: int) -> bool: ... +def S_ISWHT(mode: int) -> bool: ... + +def filemode(mode: int) -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/_subprocess.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/_subprocess.pyi new file mode 100644 index 0000000..76967b9 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/_subprocess.pyi @@ -0,0 +1,38 @@ +# Stubs for _subprocess + +# NOTE: These are incomplete! + +from typing import Mapping, Any, Tuple + +CREATE_NEW_CONSOLE = 0 +CREATE_NEW_PROCESS_GROUP = 0 +STD_INPUT_HANDLE = 0 +STD_OUTPUT_HANDLE = 0 +STD_ERROR_HANDLE = 0 +SW_HIDE = 0 +STARTF_USESTDHANDLES = 0 +STARTF_USESHOWWINDOW = 0 +INFINITE = 0 +DUPLICATE_SAME_ACCESS = 0 +WAIT_OBJECT_0 = 0 + +# TODO not exported by the Python module +class Handle: + def Close(self) -> None: ... + +def GetVersion() -> int: ... +def GetExitCodeProcess(handle: Handle) -> int: ... +def WaitForSingleObject(handle: Handle, timeout: int) -> int: ... +def CreateProcess(executable: str, cmd_line: str, + proc_attrs, thread_attrs, + inherit: int, flags: int, + env_mapping: Mapping[str, str], + curdir: str, + startupinfo: Any) -> Tuple[Any, Handle, int, int]: ... +def GetModuleFileName(module: int) -> str: ... +def GetCurrentProcess() -> Handle: ... +def DuplicateHandle(source_proc: Handle, source: Handle, target_proc: Handle, + target: Any, access: int, inherit: int) -> int: ... +def CreatePipe(pipe_attrs, size: int) -> Tuple[Handle, Handle]: ... +def GetStdHandle(arg: int) -> int: ... +def TerminateProcess(handle: Handle, exit_code: int) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/_thread.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/_thread.pyi new file mode 100644 index 0000000..41f02b0 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/_thread.pyi @@ -0,0 +1,31 @@ +# Stubs for _thread + +from types import TracebackType +from typing import Any, Callable, Dict, NoReturn, Optional, Tuple, Type + +error = RuntimeError + +def _count() -> int: ... + +_dangling: Any + +class LockType: + def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ... + def release(self) -> None: ... + def locked(self) -> bool: ... + def __enter__(self) -> bool: ... + def __exit__( + self, + type: Optional[Type[BaseException]], + value: Optional[BaseException], + traceback: Optional[TracebackType], + ) -> None: ... + +def start_new_thread(function: Callable[..., Any], args: Tuple[Any, ...], kwargs: Dict[str, Any] = ...) -> int: ... +def interrupt_main() -> None: ... +def exit() -> NoReturn: ... +def allocate_lock() -> LockType: ... +def get_ident() -> int: ... +def stack_size(size: int = ...) -> int: ... + +TIMEOUT_MAX: int diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/_threading_local.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/_threading_local.pyi new file mode 100644 index 0000000..a286d2d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/_threading_local.pyi @@ -0,0 +1,18 @@ +# Source: https://github.com/python/cpython/blob/master/Lib/_threading_local.py +from typing import Any, Dict, List, Tuple +from weakref import ReferenceType + +__all__: List[str] +localdict = Dict[Any, Any] + +class _localimpl: + key: str + dicts: Dict[int, Tuple[ReferenceType, localdict]] + def __init__(self) -> None: ... + def get_dict(self) -> localdict: ... + def create_dict(self) -> localdict: ... + +class local: + def __getattribute__(self, name: str) -> Any: ... + def __setattr__(self, name: str, value: Any) -> None: ... + def __delattr__(self, name: str) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/_tracemalloc.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/_tracemalloc.pyi new file mode 100644 index 0000000..21d0033 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/_tracemalloc.pyi @@ -0,0 +1,26 @@ +"""Stub file for the '_tracemalloc' module.""" +# This is an autogenerated file. It serves as a starting point +# for a more precise manual annotation of this module. +# Feel free to edit the source below, but remove this header when you do. + +from typing import Any + +def _get_object_traceback(*args, **kwargs) -> Any: ... + +def _get_traces() -> Any: + raise MemoryError() + +def clear_traces() -> None: ... + +def get_traceback_limit() -> int: ... + +def get_traced_memory() -> tuple: ... + +def get_tracemalloc_memory() -> Any: ... + +def is_tracing() -> bool: ... + +def start(*args, **kwargs) -> None: + raise ValueError() + +def stop() -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/_warnings.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/_warnings.pyi new file mode 100644 index 0000000..6529c40 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/_warnings.pyi @@ -0,0 +1,11 @@ +from typing import Any, List, Optional, Type + +_defaultaction: str +_onceregistry: dict +filters: List[tuple] + +def warn(message: Warning, category: Optional[Type[Warning]] = ..., stacklevel: int = ...) -> None: ... +def warn_explicit(message: Warning, category: Optional[Type[Warning]], + filename: str, lineno: int, + module: Any = ..., registry: dict = ..., + module_globals: dict = ...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/_winapi.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/_winapi.pyi new file mode 100644 index 0000000..af6c923 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/_winapi.pyi @@ -0,0 +1,96 @@ +from typing import Any, Union, Tuple, Optional, overload, Dict, NoReturn, Sequence + +CREATE_NEW_CONSOLE: int +CREATE_NEW_PROCESS_GROUP: int +DUPLICATE_CLOSE_SOURCE: int +DUPLICATE_SAME_ACCESS: int +ERROR_ALREADY_EXISTS: int +ERROR_BROKEN_PIPE: int +ERROR_IO_PENDING: int +ERROR_MORE_DATA: int +ERROR_NETNAME_DELETED: int +ERROR_NO_DATA: int +ERROR_NO_SYSTEM_RESOURCES: int +ERROR_OPERATION_ABORTED: int +ERROR_PIPE_BUSY: int +ERROR_PIPE_CONNECTED: int +ERROR_SEM_TIMEOUT: int +FILE_FLAG_FIRST_PIPE_INSTANCE: int +FILE_FLAG_OVERLAPPED: int +FILE_GENERIC_READ: int +FILE_GENERIC_WRITE: int +GENERIC_READ: int +GENERIC_WRITE: int +INFINITE: int +NMPWAIT_WAIT_FOREVER: int +NULL: int +OPEN_EXISTING: int +PIPE_ACCESS_DUPLEX: int +PIPE_ACCESS_INBOUND: int +PIPE_READMODE_MESSAGE: int +PIPE_TYPE_MESSAGE: int +PIPE_UNLIMITED_INSTANCES: int +PIPE_WAIT: int +PROCESS_ALL_ACCESS: int +PROCESS_DUP_HANDLE: int +STARTF_USESHOWWINDOW: int +STARTF_USESTDHANDLES: int +STD_ERROR_HANDLE: int +STD_INPUT_HANDLE: int +STD_OUTPUT_HANDLE: int +STILL_ACTIVE: int +SW_HIDE: int +WAIT_ABANDONED_0: int +WAIT_OBJECT_0: int +WAIT_TIMEOUT: int + +def CloseHandle(handle: int) -> None: ... + +# TODO: once literal types are supported, overload with Literal[True/False] +@overload +def ConnectNamedPipe(handle: int, overlapped: Union[int, bool]) -> Any: ... +@overload +def ConnectNamedPipe(handle: int) -> None: ... + +def CreateFile(file_name: str, desired_access: int, share_mode: int, security_attributes: int, creation_disposition: int, flags_and_attributes: int, template_file: int) -> int: ... +def CreateJunction(src_path: str, dest_path: str) -> None: ... +def CreateNamedPipe(name: str, open_mode: int, pipe_mode: int, max_instances: int, out_buffer_size: int, in_buffer_size: int, default_timeout: int, security_attributes: int) -> int: ... +def CreatePipe(pipe_attrs: Any, size: int) -> Tuple[int, int]: ... +def CreateProcess(application_name: Optional[str], command_line: Optional[str], proc_attrs: Any, thread_attrs: Any, inherit_handles: bool, creation_flags: int, env_mapping: Dict[str, str], cwd: Optional[str], startup_info: Any) -> Tuple[int, int, int, int]: ... +def DuplicateHandle(source_process_handle: int, source_handle: int, target_process_handle: int, desired_access: int, inherit_handle: bool, options: int = ...) -> int: ... +def ExitProcess(ExitCode: int) -> NoReturn: ... +def GetACP() -> int: ... +def GetFileType(handle: int) -> int: ... +def GetCurrentProcess() -> int: ... +def GetExitCodeProcess(process: int) -> int: ... +def GetLastError() -> int: ... +def GetModuleFileName(module_handle: int) -> str: ... +def GetStdHandle(std_handle: int) -> int: ... +def GetVersion() -> int: ... +def OpenProcess(desired_access: int, inherit_handle: bool, process_id: int) -> int: ... +def PeekNamedPipe(handle: int, size: int = ...) -> Union[Tuple[int, int], Tuple[bytes, int, int]]: ... + +# TODO: once literal types are supported, overload with Literal[True/False] +@overload +def ReadFile(handle: int, size: int, overlapped: Union[int, bool]) -> Any: ... +@overload +def ReadFile(handle: int, size: int) -> Tuple[int, int]: ... + +def SetNamedPipeHandleState(named_pipe: int, mode: Optional[int], max_collection_count: Optional[int], collect_data_timeout: Optional[int]) -> None: ... +def TerminateProcess(handle: int, exit_code: int) -> None: ... +def WaitForMultipleObjects(handle_seq: Sequence[int], wait_flag: bool, milliseconds: int = ...) -> int: ... +def WaitForSingleObject(handle: int, milliseconds: int) -> int: ... +def WaitNamedPipe(name: str, timeout: int) -> None: ... + +# TODO: once literal types are supported, overload with Literal[True/False] +@overload +def WriteFile(handle: int, buffer: bytes, overlapped: Union[int, bool]) -> Any: ... +@overload +def WriteFile(handle: int, buffer: bytes) -> Tuple[bytes, int]: ... + + +class Overlapped: + event: int = ... + def GetOverlappedResult(self, wait: bool) -> Tuple[int, int]: ... + def cancel(self) -> None: ... + def getbuffer(self) -> Optional[bytes]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/abc.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/abc.pyi new file mode 100644 index 0000000..e9c530d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/abc.pyi @@ -0,0 +1,19 @@ +from typing import Any, Callable, Type, TypeVar +# Stubs for abc. + +_T = TypeVar('_T') +_FuncT = TypeVar('_FuncT', bound=Callable[..., Any]) + +# Thesee definitions have special processing in mypy +class ABCMeta(type): + def register(cls: ABCMeta, subclass: Type[_T]) -> Type[_T]: ... + +def abstractmethod(callable: _FuncT) -> _FuncT: ... +class abstractproperty(property): ... +# These two are deprecated and not supported by mypy +def abstractstaticmethod(callable: _FuncT) -> _FuncT: ... +def abstractclassmethod(callable: _FuncT) -> _FuncT: ... + +class ABC(metaclass=ABCMeta): ... + +def get_cache_token() -> object: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/ast.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/ast.pyi new file mode 100644 index 0000000..090d5f8 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/ast.pyi @@ -0,0 +1,39 @@ +# Python 3.5 ast + +import sys +# Rename typing to _typing, as not to conflict with typing imported +# from _ast below when loaded in an unorthodox way by the Dropbox +# internal Bazel integration. +import typing as _typing +from typing import Any, Iterator, Optional, Union, TypeVar + +# The same unorthodox Bazel integration causes issues with sys, which +# is imported in both modules. unfortunately we can't just rename sys, +# since mypy only supports version checks with a sys that is named +# sys. +from _ast import * # type: ignore + +class NodeVisitor(): + def visit(self, node: AST) -> Any: ... + def generic_visit(self, node: AST) -> Any: ... + +class NodeTransformer(NodeVisitor): + def generic_visit(self, node: AST) -> Optional[AST]: ... + +_T = TypeVar('_T', bound=AST) + +if sys.version_info >= (3, 8): + def parse(source: Union[str, bytes], filename: Union[str, bytes] = ..., mode: str = ..., + type_comments: bool = ..., feature_version: int = ...) -> AST: ... +else: + def parse(source: Union[str, bytes], filename: Union[str, bytes] = ..., mode: str = ...) -> AST: ... + +def copy_location(new_node: _T, old_node: AST) -> _T: ... +def dump(node: AST, annotate_fields: bool = ..., include_attributes: bool = ...) -> str: ... +def fix_missing_locations(node: _T) -> _T: ... +def get_docstring(node: AST, clean: bool = ...) -> str: ... +def increment_lineno(node: _T, n: int = ...) -> _T: ... +def iter_child_nodes(node: AST) -> Iterator[AST]: ... +def iter_fields(node: AST) -> Iterator[_typing.Tuple[str, Any]]: ... +def literal_eval(node_or_string: Union[str, AST]) -> Any: ... +def walk(node: AST) -> Iterator[AST]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/asyncio/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/asyncio/__init__.pyi new file mode 100644 index 0000000..b98c2d1 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/asyncio/__init__.pyi @@ -0,0 +1,125 @@ +import sys +from typing import List, Type + +from asyncio.coroutines import ( + coroutine as coroutine, + iscoroutinefunction as iscoroutinefunction, + iscoroutine as iscoroutine, +) +from asyncio.protocols import ( + BaseProtocol as BaseProtocol, + Protocol as Protocol, + DatagramProtocol as DatagramProtocol, + SubprocessProtocol as SubprocessProtocol, +) +from asyncio.streams import ( + StreamReader as StreamReader, + StreamWriter as StreamWriter, + StreamReaderProtocol as StreamReaderProtocol, + open_connection as open_connection, + start_server as start_server, + IncompleteReadError as IncompleteReadError, + LimitOverrunError as LimitOverrunError, +) +from asyncio.subprocess import ( + create_subprocess_exec as create_subprocess_exec, + create_subprocess_shell as create_subprocess_shell, +) +from asyncio.transports import ( + BaseTransport as BaseTransport, + ReadTransport as ReadTransport, + WriteTransport as WriteTransport, + Transport as Transport, + DatagramTransport as DatagramTransport, + SubprocessTransport as SubprocessTransport, +) +from asyncio.futures import ( + Future as Future, + CancelledError as CancelledError, + TimeoutError as TimeoutError, + InvalidStateError as InvalidStateError, + wrap_future as wrap_future, +) +from asyncio.tasks import ( + FIRST_COMPLETED as FIRST_COMPLETED, + FIRST_EXCEPTION as FIRST_EXCEPTION, + ALL_COMPLETED as ALL_COMPLETED, + as_completed as as_completed, + ensure_future as ensure_future, + gather as gather, + run_coroutine_threadsafe as run_coroutine_threadsafe, + shield as shield, + sleep as sleep, + wait as wait, + wait_for as wait_for, + Task as Task, +) +from asyncio.base_events import BaseEventLoop as BaseEventLoop +from asyncio.events import ( + AbstractEventLoopPolicy as AbstractEventLoopPolicy, + AbstractEventLoop as AbstractEventLoop, + AbstractServer as AbstractServer, + Handle as Handle, + TimerHandle as TimerHandle, + get_event_loop_policy as get_event_loop_policy, + set_event_loop_policy as set_event_loop_policy, + get_event_loop as get_event_loop, + set_event_loop as set_event_loop, + new_event_loop as new_event_loop, + get_child_watcher as get_child_watcher, + set_child_watcher as set_child_watcher, +) +from asyncio.queues import ( + Queue as Queue, + PriorityQueue as PriorityQueue, + LifoQueue as LifoQueue, + QueueFull as QueueFull, + QueueEmpty as QueueEmpty, +) +from asyncio.locks import ( + Lock as Lock, + Event as Event, + Condition as Condition, + Semaphore as Semaphore, + BoundedSemaphore as BoundedSemaphore, +) + +if sys.version_info < (3, 5): + from asyncio.queues import JoinableQueue as JoinableQueue +else: + from asyncio.futures import isfuture as isfuture + from asyncio.events import ( + _set_running_loop as _set_running_loop, + _get_running_loop as _get_running_loop, + ) +if sys.platform != 'win32': + from asyncio.streams import ( + open_unix_connection as open_unix_connection, + start_unix_server as start_unix_server, + ) + +if sys.version_info >= (3, 7): + from asyncio.events import ( + get_running_loop as get_running_loop, + ) + from asyncio.tasks import ( + all_tasks as all_tasks, + create_task as create_task, + current_task as current_task, + ) + from asyncio.runners import ( + run as run, + ) + + +# TODO: It should be possible to instantiate these classes, but mypy +# currently disallows this. +# See https://github.com/python/mypy/issues/1843 +SelectorEventLoop: Type[AbstractEventLoop] +if sys.platform == 'win32': + ProactorEventLoop: Type[AbstractEventLoop] +DefaultEventLoopPolicy: Type[AbstractEventLoopPolicy] + +# TODO: AbstractChildWatcher (UNIX only) + +__all__: List[str] diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/asyncio/base_events.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/asyncio/base_events.pyi new file mode 100644 index 0000000..2262a67 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/asyncio/base_events.pyi @@ -0,0 +1,140 @@ +import selectors +from socket import socket +import ssl +import sys +from typing import Any, Awaitable, Callable, Dict, Generator, List, Optional, Sequence, Tuple, TypeVar, Union, overload +from asyncio.futures import Future +from asyncio.coroutines import coroutine +from asyncio.events import AbstractEventLoop, AbstractServer, Handle, TimerHandle +from asyncio.protocols import BaseProtocol +from asyncio.tasks import Task +from asyncio.transports import BaseTransport + +_T = TypeVar('_T') +_Context = Dict[str, Any] +_ExceptionHandler = Callable[[AbstractEventLoop, _Context], Any] +_ProtocolFactory = Callable[[], BaseProtocol] +_SSLContext = Union[bool, None, ssl.SSLContext] +_TransProtPair = Tuple[BaseTransport, BaseProtocol] + +class BaseEventLoop(AbstractEventLoop): + def run_forever(self) -> None: ... + + # Can't use a union, see mypy issue # 1873. + @overload + def run_until_complete(self, future: Generator[Any, None, _T]) -> _T: ... + @overload + def run_until_complete(self, future: Awaitable[_T]) -> _T: ... + + def stop(self) -> None: ... + def is_running(self) -> bool: ... + def is_closed(self) -> bool: ... + def close(self) -> None: ... + if sys.version_info >= (3, 6): + @coroutine + def shutdown_asyncgens(self) -> Generator[Any, None, None]: ... + # Methods scheduling callbacks. All these return Handles. + def call_soon(self, callback: Callable[..., Any], *args: Any) -> Handle: ... + def call_later(self, delay: float, callback: Callable[..., Any], *args: Any) -> TimerHandle: ... + def call_at(self, when: float, callback: Callable[..., Any], *args: Any) -> TimerHandle: ... + def time(self) -> float: ... + # Future methods + if sys.version_info >= (3, 5): + def create_future(self) -> Future[Any]: ... + # Tasks methods + def create_task(self, coro: Union[Awaitable[_T], Generator[Any, None, _T]]) -> Task[_T]: ... + def set_task_factory(self, factory: Optional[Callable[[AbstractEventLoop, Generator[Any, None, _T]], Future[_T]]]) -> None: ... + def get_task_factory(self) -> Optional[Callable[[AbstractEventLoop, Generator[Any, None, _T]], Future[_T]]]: ... + # Methods for interacting with threads + def call_soon_threadsafe(self, callback: Callable[..., Any], *args: Any) -> Handle: ... + @coroutine + def run_in_executor(self, executor: Any, + func: Callable[..., _T], *args: Any) -> Generator[Any, None, _T]: ... + def set_default_executor(self, executor: Any) -> None: ... + # Network I/O methods returning Futures. + @coroutine + # TODO the "Tuple[Any, ...]" should be "Union[Tuple[str, int], Tuple[str, int, int, int]]" but that triggers + # https://github.com/python/mypy/issues/2509 + def getaddrinfo(self, host: Optional[str], port: Union[str, int, None], *, + family: int = ..., type: int = ..., proto: int = ..., + flags: int = ...) -> Generator[Any, None, List[Tuple[int, int, int, str, Tuple[Any, ...]]]]: ... + @coroutine + def getnameinfo(self, sockaddr: tuple, flags: int = ...) -> Generator[Any, None, Tuple[str, int]]: ... + @overload + @coroutine + def create_connection(self, protocol_factory: _ProtocolFactory, host: str = ..., port: int = ..., *, + ssl: _SSLContext = ..., family: int = ..., proto: int = ..., flags: int = ..., sock: None = ..., + local_addr: Optional[str] = ..., server_hostname: Optional[str] = ...) -> Generator[Any, None, _TransProtPair]: ... + @overload + @coroutine + def create_connection(self, protocol_factory: _ProtocolFactory, host: None = ..., port: None = ..., *, + ssl: _SSLContext = ..., family: int = ..., proto: int = ..., flags: int = ..., sock: socket, + local_addr: None = ..., server_hostname: Optional[str] = ...) -> Generator[Any, None, _TransProtPair]: ... + @overload + @coroutine + def create_server(self, protocol_factory: _ProtocolFactory, host: Optional[Union[str, Sequence[str]]] = ..., port: int = ..., *, + family: int = ..., flags: int = ..., + sock: None = ..., backlog: int = ..., ssl: _SSLContext = ..., + reuse_address: Optional[bool] = ..., + reuse_port: Optional[bool] = ...) -> Generator[Any, None, AbstractServer]: ... + @overload + @coroutine + def create_server(self, protocol_factory: _ProtocolFactory, host: None = ..., port: None = ..., *, + family: int = ..., flags: int = ..., + sock: socket, backlog: int = ..., ssl: _SSLContext = ..., + reuse_address: Optional[bool] = ..., + reuse_port: Optional[bool] = ...) -> Generator[Any, None, AbstractServer]: ... + @coroutine + def create_unix_connection(self, protocol_factory: _ProtocolFactory, path: str, *, + ssl: _SSLContext = ..., sock: Optional[socket] = ..., + server_hostname: str = ...) -> Generator[Any, None, _TransProtPair]: ... + @coroutine + def create_unix_server(self, protocol_factory: _ProtocolFactory, path: str, *, + sock: Optional[socket] = ..., backlog: int = ..., ssl: _SSLContext = ...) -> Generator[Any, None, AbstractServer]: ... + @coroutine + def create_datagram_endpoint(self, protocol_factory: _ProtocolFactory, + local_addr: Optional[Tuple[str, int]] = ..., remote_addr: Optional[Tuple[str, int]] = ..., *, + family: int = ..., proto: int = ..., flags: int = ..., + reuse_address: Optional[bool] = ..., reuse_port: Optional[bool] = ..., + allow_broadcast: Optional[bool] = ..., + sock: Optional[socket] = ...) -> Generator[Any, None, _TransProtPair]: ... + @coroutine + def connect_accepted_socket(self, protocol_factory: _ProtocolFactory, sock: socket, *, ssl: _SSLContext = ...) -> Generator[Any, None, _TransProtPair]: ... + # Pipes and subprocesses. + @coroutine + def connect_read_pipe(self, protocol_factory: _ProtocolFactory, pipe: Any) -> Generator[Any, None, _TransProtPair]: ... + @coroutine + def connect_write_pipe(self, protocol_factory: _ProtocolFactory, pipe: Any) -> Generator[Any, None, _TransProtPair]: ... + @coroutine + def subprocess_shell(self, protocol_factory: _ProtocolFactory, cmd: Union[bytes, str], *, stdin: Any = ..., + stdout: Any = ..., stderr: Any = ..., + **kwargs: Any) -> Generator[Any, None, _TransProtPair]: ... + @coroutine + def subprocess_exec(self, protocol_factory: _ProtocolFactory, *args: Any, stdin: Any = ..., + stdout: Any = ..., stderr: Any = ..., + **kwargs: Any) -> Generator[Any, None, _TransProtPair]: ... + def add_reader(self, fd: selectors._FileObject, callback: Callable[..., Any], *args: Any) -> None: ... + def remove_reader(self, fd: selectors._FileObject) -> None: ... + def add_writer(self, fd: selectors._FileObject, callback: Callable[..., Any], *args: Any) -> None: ... + def remove_writer(self, fd: selectors._FileObject) -> None: ... + # Completion based I/O methods returning Futures. + @coroutine + def sock_recv(self, sock: socket, nbytes: int) -> Generator[Any, None, bytes]: ... + @coroutine + def sock_sendall(self, sock: socket, data: bytes) -> Generator[Any, None, None]: ... + @coroutine + def sock_connect(self, sock: socket, address: str) -> Generator[Any, None, None]: ... + @coroutine + def sock_accept(self, sock: socket) -> Generator[Any, None, Tuple[socket, Any]]: ... + # Signal handling. + def add_signal_handler(self, sig: int, callback: Callable[..., Any], *args: Any) -> None: ... + def remove_signal_handler(self, sig: int) -> None: ... + # Error handlers. + def set_exception_handler(self, handler: Optional[_ExceptionHandler]) -> None: ... + if sys.version_info >= (3, 5): + def get_exception_handler(self) -> Optional[_ExceptionHandler]: ... + def default_exception_handler(self, context: _Context) -> None: ... + def call_exception_handler(self, context: _Context) -> None: ... + # Debug flag management. + def get_debug(self) -> bool: ... + def set_debug(self, enabled: bool) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/asyncio/coroutines.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/asyncio/coroutines.pyi new file mode 100644 index 0000000..981ccd5 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/asyncio/coroutines.pyi @@ -0,0 +1,9 @@ +from typing import Any, Callable, Generator, List, TypeVar + +__all__: List[str] + +_F = TypeVar('_F', bound=Callable[..., Any]) + +def coroutine(func: _F) -> _F: ... +def iscoroutinefunction(func: Callable[..., Any]) -> bool: ... +def iscoroutine(obj: Any) -> bool: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/asyncio/events.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/asyncio/events.pyi new file mode 100644 index 0000000..c81d027 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/asyncio/events.pyi @@ -0,0 +1,246 @@ +import selectors +from socket import socket +import ssl +import sys +from typing import Any, Awaitable, Callable, Dict, Generator, List, Optional, Sequence, Tuple, TypeVar, Union, overload +from abc import ABCMeta, abstractmethod +from asyncio.futures import Future +from asyncio.coroutines import coroutine +from asyncio.protocols import BaseProtocol +from asyncio.tasks import Task +from asyncio.transports import BaseTransport + +__all__: List[str] + +_T = TypeVar('_T') +_Context = Dict[str, Any] +_ExceptionHandler = Callable[[AbstractEventLoop, _Context], Any] +_ProtocolFactory = Callable[[], BaseProtocol] +_SSLContext = Union[bool, None, ssl.SSLContext] +_TransProtPair = Tuple[BaseTransport, BaseProtocol] + +class Handle: + _cancelled = False + _args: List[Any] + def __init__(self, callback: Callable[..., Any], args: List[Any], loop: AbstractEventLoop) -> None: ... + def __repr__(self) -> str: ... + def cancel(self) -> None: ... + def _run(self) -> None: ... + +class TimerHandle(Handle): + def __init__(self, when: float, callback: Callable[..., Any], args: List[Any], + loop: AbstractEventLoop) -> None: ... + def __hash__(self) -> int: ... + +class AbstractServer: + sockets: Optional[List[socket]] + def close(self) -> None: ... + @coroutine + def wait_closed(self) -> Generator[Any, None, None]: ... + +class AbstractEventLoop(metaclass=ABCMeta): + slow_callback_duration: float = ... + @abstractmethod + def run_forever(self) -> None: ... + + # Can't use a union, see mypy issue # 1873. + @overload + @abstractmethod + def run_until_complete(self, future: Generator[Any, None, _T]) -> _T: ... + @overload + @abstractmethod + def run_until_complete(self, future: Awaitable[_T]) -> _T: ... + + @abstractmethod + def stop(self) -> None: ... + @abstractmethod + def is_running(self) -> bool: ... + @abstractmethod + def is_closed(self) -> bool: ... + @abstractmethod + def close(self) -> None: ... + if sys.version_info >= (3, 6): + @abstractmethod + @coroutine + def shutdown_asyncgens(self) -> Generator[Any, None, None]: ... + # Methods scheduling callbacks. All these return Handles. + @abstractmethod + def call_soon(self, callback: Callable[..., Any], *args: Any) -> Handle: ... + @abstractmethod + def call_later(self, delay: float, callback: Callable[..., Any], *args: Any) -> TimerHandle: ... + @abstractmethod + def call_at(self, when: float, callback: Callable[..., Any], *args: Any) -> TimerHandle: ... + @abstractmethod + def time(self) -> float: ... + # Future methods + if sys.version_info >= (3, 5): + @abstractmethod + def create_future(self) -> Future[Any]: ... + # Tasks methods + @abstractmethod + def create_task(self, coro: Union[Awaitable[_T], Generator[Any, None, _T]]) -> Task[_T]: ... + @abstractmethod + def set_task_factory(self, factory: Optional[Callable[[AbstractEventLoop, Generator[Any, None, _T]], Future[_T]]]) -> None: ... + @abstractmethod + def get_task_factory(self) -> Optional[Callable[[AbstractEventLoop, Generator[Any, None, _T]], Future[_T]]]: ... + # Methods for interacting with threads + @abstractmethod + def call_soon_threadsafe(self, callback: Callable[..., Any], *args: Any) -> Handle: ... + @abstractmethod + @coroutine + def run_in_executor(self, executor: Any, + func: Callable[..., _T], *args: Any) -> Generator[Any, None, _T]: ... + @abstractmethod + def set_default_executor(self, executor: Any) -> None: ... + # Network I/O methods returning Futures. + @abstractmethod + @coroutine + # TODO the "Tuple[Any, ...]" should be "Union[Tuple[str, int], Tuple[str, int, int, int]]" but that triggers + # https://github.com/python/mypy/issues/2509 + def getaddrinfo(self, host: Optional[str], port: Union[str, int, None], *, + family: int = ..., type: int = ..., proto: int = ..., + flags: int = ...) -> Generator[Any, None, List[Tuple[int, int, int, str, Tuple[Any, ...]]]]: ... + @abstractmethod + @coroutine + def getnameinfo(self, sockaddr: tuple, flags: int = ...) -> Generator[Any, None, Tuple[str, int]]: ... + @overload + @abstractmethod + @coroutine + def create_connection(self, protocol_factory: _ProtocolFactory, host: str = ..., port: int = ..., *, + ssl: _SSLContext = ..., family: int = ..., proto: int = ..., flags: int = ..., sock: None = ..., + local_addr: Optional[str] = ..., server_hostname: Optional[str] = ...) -> Generator[Any, None, _TransProtPair]: ... + @overload + @abstractmethod + @coroutine + def create_connection(self, protocol_factory: _ProtocolFactory, host: None = ..., port: None = ..., *, + ssl: _SSLContext = ..., family: int = ..., proto: int = ..., flags: int = ..., sock: socket, + local_addr: None = ..., server_hostname: Optional[str] = ...) -> Generator[Any, None, _TransProtPair]: ... + @overload + @abstractmethod + @coroutine + def create_server(self, protocol_factory: _ProtocolFactory, host: Optional[Union[str, Sequence[str]]] = ..., port: int = ..., *, + family: int = ..., flags: int = ..., + sock: None = ..., backlog: int = ..., ssl: _SSLContext = ..., + reuse_address: Optional[bool] = ..., + reuse_port: Optional[bool] = ...) -> Generator[Any, None, AbstractServer]: ... + @overload + @abstractmethod + @coroutine + def create_server(self, protocol_factory: _ProtocolFactory, host: None = ..., port: None = ..., *, + family: int = ..., flags: int = ..., + sock: socket, backlog: int = ..., ssl: _SSLContext = ..., + reuse_address: Optional[bool] = ..., + reuse_port: Optional[bool] = ...) -> Generator[Any, None, AbstractServer]: ... + @abstractmethod + @coroutine + def create_unix_connection(self, protocol_factory: _ProtocolFactory, path: str, *, + ssl: _SSLContext = ..., sock: Optional[socket] = ..., + server_hostname: str = ...) -> Generator[Any, None, _TransProtPair]: ... + @abstractmethod + @coroutine + def create_unix_server(self, protocol_factory: _ProtocolFactory, path: str, *, + sock: Optional[socket] = ..., backlog: int = ..., ssl: _SSLContext = ...) -> Generator[Any, None, AbstractServer]: ... + @abstractmethod + @coroutine + def create_datagram_endpoint(self, protocol_factory: _ProtocolFactory, + local_addr: Optional[Tuple[str, int]] = ..., remote_addr: Optional[Tuple[str, int]] = ..., *, + family: int = ..., proto: int = ..., flags: int = ..., + reuse_address: Optional[bool] = ..., reuse_port: Optional[bool] = ..., + allow_broadcast: Optional[bool] = ..., + sock: Optional[socket] = ...) -> Generator[Any, None, _TransProtPair]: ... + @abstractmethod + @coroutine + def connect_accepted_socket(self, protocol_factory: _ProtocolFactory, sock: socket, *, ssl: _SSLContext = ...) -> Generator[Any, None, _TransProtPair]: ... + # Pipes and subprocesses. + @abstractmethod + @coroutine + def connect_read_pipe(self, protocol_factory: _ProtocolFactory, pipe: Any) -> Generator[Any, None, _TransProtPair]: ... + @abstractmethod + @coroutine + def connect_write_pipe(self, protocol_factory: _ProtocolFactory, pipe: Any) -> Generator[Any, None, _TransProtPair]: ... + @abstractmethod + @coroutine + def subprocess_shell(self, protocol_factory: _ProtocolFactory, cmd: Union[bytes, str], *, stdin: Any = ..., + stdout: Any = ..., stderr: Any = ..., + **kwargs: Any) -> Generator[Any, None, _TransProtPair]: ... + @abstractmethod + @coroutine + def subprocess_exec(self, protocol_factory: _ProtocolFactory, *args: Any, stdin: Any = ..., + stdout: Any = ..., stderr: Any = ..., + **kwargs: Any) -> Generator[Any, None, _TransProtPair]: ... + @abstractmethod + def add_reader(self, fd: selectors._FileObject, callback: Callable[..., Any], *args: Any) -> None: ... + @abstractmethod + def remove_reader(self, fd: selectors._FileObject) -> None: ... + @abstractmethod + def add_writer(self, fd: selectors._FileObject, callback: Callable[..., Any], *args: Any) -> None: ... + @abstractmethod + def remove_writer(self, fd: selectors._FileObject) -> None: ... + # Completion based I/O methods returning Futures. + @abstractmethod + @coroutine + def sock_recv(self, sock: socket, nbytes: int) -> Generator[Any, None, bytes]: ... + @abstractmethod + @coroutine + def sock_sendall(self, sock: socket, data: bytes) -> Generator[Any, None, None]: ... + @abstractmethod + @coroutine + def sock_connect(self, sock: socket, address: str) -> Generator[Any, None, None]: ... + @abstractmethod + @coroutine + def sock_accept(self, sock: socket) -> Generator[Any, None, Tuple[socket, Any]]: ... + # Signal handling. + @abstractmethod + def add_signal_handler(self, sig: int, callback: Callable[..., Any], *args: Any) -> None: ... + @abstractmethod + def remove_signal_handler(self, sig: int) -> None: ... + # Error handlers. + @abstractmethod + def set_exception_handler(self, handler: Optional[_ExceptionHandler]) -> None: ... + if sys.version_info >= (3, 5): + @abstractmethod + def get_exception_handler(self) -> Optional[_ExceptionHandler]: ... + @abstractmethod + def default_exception_handler(self, context: _Context) -> None: ... + @abstractmethod + def call_exception_handler(self, context: _Context) -> None: ... + # Debug flag management. + @abstractmethod + def get_debug(self) -> bool: ... + @abstractmethod + def set_debug(self, enabled: bool) -> None: ... + +class AbstractEventLoopPolicy(metaclass=ABCMeta): + @abstractmethod + def get_event_loop(self) -> AbstractEventLoop: ... + @abstractmethod + def set_event_loop(self, loop: Optional[AbstractEventLoop]) -> None: ... + @abstractmethod + def new_event_loop(self) -> AbstractEventLoop: ... + # Child processes handling (Unix only). + @abstractmethod + def get_child_watcher(self) -> Any: ... # TODO: unix_events.AbstractChildWatcher + @abstractmethod + def set_child_watcher(self, watcher: Any) -> None: ... # TODO: unix_events.AbstractChildWatcher + +class BaseDefaultEventLoopPolicy(AbstractEventLoopPolicy, metaclass=ABCMeta): + def __init__(self) -> None: ... + def get_event_loop(self) -> AbstractEventLoop: ... + def set_event_loop(self, loop: Optional[AbstractEventLoop]) -> None: ... + def new_event_loop(self) -> AbstractEventLoop: ... + +def get_event_loop_policy() -> AbstractEventLoopPolicy: ... +def set_event_loop_policy(policy: AbstractEventLoopPolicy) -> None: ... + +def get_event_loop() -> AbstractEventLoop: ... +def set_event_loop(loop: Optional[AbstractEventLoop]) -> None: ... +def new_event_loop() -> AbstractEventLoop: ... + +def get_child_watcher() -> Any: ... # TODO: unix_events.AbstractChildWatcher +def set_child_watcher(watcher: Any) -> None: ... # TODO: unix_events.AbstractChildWatcher + +def _set_running_loop(loop: Optional[AbstractEventLoop]) -> None: ... +def _get_running_loop() -> AbstractEventLoop: ... + +if sys.version_info >= (3, 7): + def get_running_loop() -> AbstractEventLoop: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/asyncio/futures.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/asyncio/futures.pyi new file mode 100644 index 0000000..ed2e4a0 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/asyncio/futures.pyi @@ -0,0 +1,64 @@ +import sys +from typing import Any, Union, Callable, TypeVar, Type, List, Generic, Iterable, Generator, Awaitable, Optional, Tuple +from .events import AbstractEventLoop +from concurrent.futures import ( + CancelledError as CancelledError, + TimeoutError as TimeoutError, + Future as _ConcurrentFuture, + Error, +) + +if sys.version_info >= (3, 7): + from contextvars import Context + +__all__: List[str] + +_T = TypeVar('_T') +_S = TypeVar('_S', bound=Future) + +class InvalidStateError(Error): ... + +class _TracebackLogger: + exc: BaseException + tb: List[str] + def __init__(self, exc: Any, loop: AbstractEventLoop) -> None: ... + def activate(self) -> None: ... + def clear(self) -> None: ... + def __del__(self) -> None: ... + +if sys.version_info >= (3, 5): + def isfuture(obj: object) -> bool: ... + +class Future(Awaitable[_T], Iterable[_T]): + _state: str + _exception: BaseException + _blocking = False + _log_traceback = False + _tb_logger: Type[_TracebackLogger] + def __init__(self, *, loop: Optional[AbstractEventLoop] = ...) -> None: ... + def __repr__(self) -> str: ... + def __del__(self) -> None: ... + if sys.version_info >= (3, 7): + def get_loop(self) -> AbstractEventLoop: ... + def _callbacks(self: _S) -> List[Tuple[Callable[[_S], Any], Context]]: ... + def add_done_callback(self: _S, __fn: Callable[[_S], Any], *, context: Optional[Context] = ...) -> None: ... + else: + @property + def _callbacks(self: _S) -> List[Callable[[_S], Any]]: ... + def add_done_callback(self: _S, __fn: Callable[[_S], Any]) -> None: ... + def cancel(self) -> bool: ... + def _schedule_callbacks(self) -> None: ... + def cancelled(self) -> bool: ... + def done(self) -> bool: ... + def result(self) -> _T: ... + def exception(self) -> BaseException: ... + def remove_done_callback(self: _S, fn: Callable[[_S], Any]) -> int: ... + def set_result(self, result: _T) -> None: ... + def set_exception(self, exception: Union[type, BaseException]) -> None: ... + def _copy_state(self, other: Any) -> None: ... + def __iter__(self) -> Generator[Any, None, _T]: ... + def __await__(self) -> Generator[Any, None, _T]: ... + @property + def _loop(self) -> AbstractEventLoop: ... + +def wrap_future(f: Union[_ConcurrentFuture[_T], Future[_T]]) -> Future[_T]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/asyncio/locks.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/asyncio/locks.pyi new file mode 100644 index 0000000..56b8a67 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/asyncio/locks.pyi @@ -0,0 +1,60 @@ +from typing import Any, Callable, Generator, Iterable, Iterator, List, Type, TypeVar, Union, Optional, Awaitable + +from .coroutines import coroutine +from .events import AbstractEventLoop +from .futures import Future +from types import TracebackType + +_T = TypeVar('_T') + +__all__: List[str] + +class _ContextManager: + def __init__(self, lock: Union[Lock, Semaphore]) -> None: ... + def __enter__(self) -> object: ... + def __exit__(self, *args: Any) -> None: ... + +class _ContextManagerMixin(Future[_ContextManager]): + # Apparently this exists to *prohibit* use as a context manager. + def __enter__(self) -> object: ... + def __exit__(self, *args: Any) -> None: ... + def __aenter__(self) -> Awaitable[None]: ... + def __aexit__(self, exc_type: Optional[Type[BaseException]], exc: Optional[BaseException], tb: Optional[TracebackType]) -> Awaitable[None]: ... + +class Lock(_ContextManagerMixin): + def __init__(self, *, loop: Optional[AbstractEventLoop] = ...) -> None: ... + def locked(self) -> bool: ... + @coroutine + def acquire(self) -> Generator[Any, None, bool]: ... + def release(self) -> None: ... + +class Event: + def __init__(self, *, loop: Optional[AbstractEventLoop] = ...) -> None: ... + def is_set(self) -> bool: ... + def set(self) -> None: ... + def clear(self) -> None: ... + @coroutine + def wait(self) -> Generator[Any, None, bool]: ... + +class Condition(_ContextManagerMixin): + def __init__(self, lock: Optional[Lock] = ..., *, loop: Optional[AbstractEventLoop] = ...) -> None: ... + def locked(self) -> bool: ... + @coroutine + def acquire(self) -> Generator[Any, None, bool]: ... + def release(self) -> None: ... + @coroutine + def wait(self) -> Generator[Any, None, bool]: ... + @coroutine + def wait_for(self, predicate: Callable[[], _T]) -> Generator[Any, None, _T]: ... + def notify(self, n: int = ...) -> None: ... + def notify_all(self) -> None: ... + +class Semaphore(_ContextManagerMixin): + def __init__(self, value: int = ..., *, loop: Optional[AbstractEventLoop] = ...) -> None: ... + def locked(self) -> bool: ... + @coroutine + def acquire(self) -> Generator[Any, None, bool]: ... + def release(self) -> None: ... + +class BoundedSemaphore(Semaphore): + def __init__(self, value: int = ..., *, loop: Optional[AbstractEventLoop] = ...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/asyncio/protocols.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/asyncio/protocols.pyi new file mode 100644 index 0000000..bb258e1 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/asyncio/protocols.pyi @@ -0,0 +1,24 @@ +from asyncio import transports +from typing import List, Optional, Text, Tuple, Union + +__all__: List[str] + + +class BaseProtocol: + def connection_made(self, transport: transports.BaseTransport) -> None: ... + def connection_lost(self, exc: Optional[Exception]) -> None: ... + def pause_writing(self) -> None: ... + def resume_writing(self) -> None: ... + +class Protocol(BaseProtocol): + def data_received(self, data: bytes) -> None: ... + def eof_received(self) -> Optional[bool]: ... + +class DatagramProtocol(BaseProtocol): + def datagram_received(self, data: Union[bytes, Text], addr: Tuple[str, int]) -> None: ... + def error_received(self, exc: Exception) -> None: ... + +class SubprocessProtocol(BaseProtocol): + def pipe_data_received(self, fd: int, data: Union[bytes, Text]) -> None: ... + def pipe_connection_lost(self, fd: int, exc: Optional[Exception]) -> None: ... + def process_exited(self) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/asyncio/queues.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/asyncio/queues.pyi new file mode 100644 index 0000000..dc4e9ef --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/asyncio/queues.pyi @@ -0,0 +1,50 @@ +import sys +from asyncio.events import AbstractEventLoop +from .coroutines import coroutine +from .futures import Future +from typing import Any, Generator, Generic, List, TypeVar, Optional + +__all__: List[str] + + +class QueueEmpty(Exception): ... +class QueueFull(Exception): ... + +_T = TypeVar('_T') + +class Queue(Generic[_T]): + def __init__(self, maxsize: int = ..., *, loop: Optional[AbstractEventLoop] = ...) -> None: ... + def _init(self, maxsize: int) -> None: ... + def _get(self) -> _T: ... + def _put(self, item: _T) -> None: ... + def __repr__(self) -> str: ... + def __str__(self) -> str: ... + def _format(self) -> str: ... + def _consume_done_getters(self) -> None: ... + def _consume_done_putters(self) -> None: ... + def qsize(self) -> int: ... + @property + def maxsize(self) -> int: ... + def empty(self) -> bool: ... + def full(self) -> bool: ... + @coroutine + def put(self, item: _T) -> Generator[Any, None, None]: ... + def put_nowait(self, item: _T) -> None: ... + @coroutine + def get(self) -> Generator[Any, None, _T]: ... + def get_nowait(self) -> _T: ... + @coroutine + def join(self) -> Generator[Any, None, bool]: ... + def task_done(self) -> None: ... + + +class PriorityQueue(Queue[_T]): ... + + +class LifoQueue(Queue[_T]): ... + +if sys.version_info < (3, 5): + class JoinableQueue(Queue[_T]): + def task_done(self) -> None: ... + @coroutine + def join(self) -> Generator[Any, None, bool]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/asyncio/runners.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/asyncio/runners.pyi new file mode 100644 index 0000000..7d8c28c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/asyncio/runners.pyi @@ -0,0 +1,9 @@ +import sys + + +if sys.version_info >= (3, 7): + from typing import Awaitable, TypeVar + + _T = TypeVar('_T') + + def run(main: Awaitable[_T], *, debug: bool = ...) -> _T: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/asyncio/streams.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/asyncio/streams.pyi new file mode 100644 index 0000000..68271c0 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/asyncio/streams.pyi @@ -0,0 +1,119 @@ +import sys +from typing import Any, Awaitable, Callable, Generator, Iterable, List, Optional, Tuple, Union + +from . import coroutines +from . import events +from . import protocols +from . import transports + +_ClientConnectedCallback = Callable[[StreamReader, StreamWriter], Optional[Awaitable[None]]] + + +__all__: List[str] + +class IncompleteReadError(EOFError): + expected: Optional[int] + partial: bytes + def __init__(self, partial: bytes, expected: Optional[int]) -> None: ... + +class LimitOverrunError(Exception): + consumed: int + def __init__(self, message: str, consumed: int) -> None: ... + +@coroutines.coroutine +def open_connection( + host: str = ..., + port: Union[int, str] = ..., + *, + loop: Optional[events.AbstractEventLoop] = ..., + limit: int = ..., + **kwds: Any +) -> Generator[Any, None, Tuple[StreamReader, StreamWriter]]: ... + +@coroutines.coroutine +def start_server( + client_connected_cb: _ClientConnectedCallback, + host: Optional[str] = ..., + port: Optional[Union[int, str]] = ..., + *, + loop: Optional[events.AbstractEventLoop] = ..., + limit: int = ..., + **kwds: Any +) -> Generator[Any, None, events.AbstractServer]: ... + +if sys.platform != 'win32': + if sys.version_info >= (3, 7): + from os import PathLike + _PathType = Union[str, PathLike[str]] + else: + _PathType = str + + @coroutines.coroutine + def open_unix_connection( + path: _PathType = ..., + *, + loop: Optional[events.AbstractEventLoop] = ..., + limit: int = ..., + **kwds: Any + ) -> Generator[Any, None, Tuple[StreamReader, StreamWriter]]: ... + + @coroutines.coroutine + def start_unix_server( + client_connected_cb: _ClientConnectedCallback, + path: _PathType = ..., + *, + loop: Optional[events.AbstractEventLoop] = ..., + limit: int = ..., + **kwds: Any) -> Generator[Any, None, events.AbstractServer]: ... + +class FlowControlMixin(protocols.Protocol): ... + +class StreamReaderProtocol(FlowControlMixin, protocols.Protocol): + def __init__(self, + stream_reader: StreamReader, + client_connected_cb: _ClientConnectedCallback = ..., + loop: Optional[events.AbstractEventLoop] = ...) -> None: ... + def connection_made(self, transport: transports.BaseTransport) -> None: ... + def connection_lost(self, exc: Optional[Exception]) -> None: ... + def data_received(self, data: bytes) -> None: ... + def eof_received(self) -> bool: ... + +class StreamWriter: + def __init__(self, + transport: transports.BaseTransport, + protocol: protocols.BaseProtocol, + reader: Optional[StreamReader], + loop: events.AbstractEventLoop) -> None: ... + @property + def transport(self) -> transports.BaseTransport: ... + def write(self, data: bytes) -> None: ... + def writelines(self, data: Iterable[bytes]) -> None: ... + def write_eof(self) -> None: ... + def can_write_eof(self) -> bool: ... + def close(self) -> None: ... + if sys.version_info >= (3, 7): + def is_closing(self) -> bool: ... + @coroutines.coroutine + def wait_closed(self) -> None: ... + def get_extra_info(self, name: str, default: Any = ...) -> Any: ... + @coroutines.coroutine + def drain(self) -> Generator[Any, None, None]: ... + +class StreamReader: + def __init__(self, + limit: int = ..., + loop: Optional[events.AbstractEventLoop] = ...) -> None: ... + def exception(self) -> Exception: ... + def set_exception(self, exc: Exception) -> None: ... + def set_transport(self, transport: transports.BaseTransport) -> None: ... + def feed_eof(self) -> None: ... + def at_eof(self) -> bool: ... + def feed_data(self, data: bytes) -> None: ... + @coroutines.coroutine + def readline(self) -> Generator[Any, None, bytes]: ... + @coroutines.coroutine + def readuntil(self, separator: bytes = ...) -> Generator[Any, None, bytes]: ... + @coroutines.coroutine + def read(self, n: int = ...) -> Generator[Any, None, bytes]: ... + @coroutines.coroutine + def readexactly(self, n: int) -> Generator[Any, None, bytes]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/asyncio/subprocess.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/asyncio/subprocess.pyi new file mode 100644 index 0000000..46ed302 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/asyncio/subprocess.pyi @@ -0,0 +1,67 @@ +from asyncio import events +from asyncio import protocols +from asyncio import streams +from asyncio import transports +from asyncio.coroutines import coroutine +from typing import Any, Generator, List, Optional, Text, Tuple, Union, IO + +__all__: List[str] + +PIPE: int +STDOUT: int +DEVNULL: int + +class SubprocessStreamProtocol(streams.FlowControlMixin, + protocols.SubprocessProtocol): + stdin: Optional[streams.StreamWriter] + stdout: Optional[streams.StreamReader] + stderr: Optional[streams.StreamReader] + def __init__(self, limit: int, loop: events.AbstractEventLoop) -> None: ... + def connection_made(self, transport: transports.BaseTransport) -> None: ... + def pipe_data_received(self, fd: int, data: Union[bytes, Text]) -> None: ... + def pipe_connection_lost(self, fd: int, exc: Optional[Exception]) -> None: ... + def process_exited(self) -> None: ... + + +class Process: + stdin: Optional[streams.StreamWriter] + stdout: Optional[streams.StreamReader] + stderr: Optional[streams.StreamReader] + pid: int + def __init__(self, + transport: transports.BaseTransport, + protocol: protocols.BaseProtocol, + loop: events.AbstractEventLoop) -> None: ... + @property + def returncode(self) -> int: ... + @coroutine + def wait(self) -> Generator[Any, None, int]: ... + def send_signal(self, signal: int) -> None: ... + def terminate(self) -> None: ... + def kill(self) -> None: ... + @coroutine + def communicate(self, input: Optional[bytes] = ...) -> Generator[Any, None, Tuple[bytes, bytes]]: ... + + +@coroutine +def create_subprocess_shell( + *Args: Union[str, bytes], # Union used instead of AnyStr due to mypy issue #1236 + stdin: Union[int, IO[Any], None] = ..., + stdout: Union[int, IO[Any], None] = ..., + stderr: Union[int, IO[Any], None] = ..., + loop: events.AbstractEventLoop = ..., + limit: int = ..., + **kwds: Any +) -> Generator[Any, None, Process]: ... + +@coroutine +def create_subprocess_exec( + program: Union[str, bytes], # Union used instead of AnyStr due to mypy issue #1236 + *args: Any, + stdin: Union[int, IO[Any], None] = ..., + stdout: Union[int, IO[Any], None] = ..., + stderr: Union[int, IO[Any], None] = ..., + loop: events.AbstractEventLoop = ..., + limit: int = ..., + **kwds: Any +) -> Generator[Any, None, Process]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/asyncio/tasks.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/asyncio/tasks.pyi new file mode 100644 index 0000000..6fe13f5 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/asyncio/tasks.pyi @@ -0,0 +1,77 @@ +import concurrent.futures +import sys +from typing import (Any, TypeVar, Set, Dict, List, TextIO, Union, Tuple, Generic, Callable, + Coroutine, Generator, Iterable, Awaitable, overload, Sequence, Iterator, + Optional) +from types import FrameType +from .events import AbstractEventLoop +from .futures import Future + +__all__: List[str] + +_T = TypeVar('_T') +_T1 = TypeVar('_T1') +_T2 = TypeVar('_T2') +_T3 = TypeVar('_T3') +_T4 = TypeVar('_T4') +_T5 = TypeVar('_T5') +_FutureT = Union[Future[_T], Generator[Any, None, _T], Awaitable[_T]] + +FIRST_EXCEPTION: str +FIRST_COMPLETED: str +ALL_COMPLETED: str + +def as_completed(fs: Sequence[_FutureT[_T]], *, loop: AbstractEventLoop = ..., + timeout: Optional[float] = ...) -> Iterator[Future[_T]]: ... +def ensure_future(coro_or_future: _FutureT[_T], + *, loop: Optional[AbstractEventLoop] = ...) -> Future[_T]: ... +# Prior to Python 3.7 'async' was an alias for 'ensure_future'. +# It became a keyword in 3.7. +@overload +def gather(coro_or_future1: _FutureT[_T1], + *, loop: AbstractEventLoop = ..., return_exceptions: bool = ...) -> Future[Tuple[_T1]]: ... +@overload +def gather(coro_or_future1: _FutureT[_T1], coro_or_future2: _FutureT[_T2], + *, loop: AbstractEventLoop = ..., return_exceptions: bool = ...) -> Future[Tuple[_T1, _T2]]: ... +@overload +def gather(coro_or_future1: _FutureT[_T1], coro_or_future2: _FutureT[_T2], coro_or_future3: _FutureT[_T3], + *, loop: AbstractEventLoop = ..., return_exceptions: bool = ...) -> Future[Tuple[_T1, _T2, _T3]]: ... +@overload +def gather(coro_or_future1: _FutureT[_T1], coro_or_future2: _FutureT[_T2], coro_or_future3: _FutureT[_T3], + coro_or_future4: _FutureT[_T4], + *, loop: AbstractEventLoop = ..., return_exceptions: bool = ...) -> Future[Tuple[_T1, _T2, _T3, _T4]]: ... +@overload +def gather(coro_or_future1: _FutureT[_T1], coro_or_future2: _FutureT[_T2], coro_or_future3: _FutureT[_T3], + coro_or_future4: _FutureT[_T4], coro_or_future5: _FutureT[_T5], + *, loop: AbstractEventLoop = ..., return_exceptions: bool = ...) -> Future[Tuple[_T1, _T2, _T3, _T4, _T5]]: ... +@overload +def gather(coro_or_future1: _FutureT[Any], coro_or_future2: _FutureT[Any], coro_or_future3: _FutureT[Any], + coro_or_future4: _FutureT[Any], coro_or_future5: _FutureT[Any], coro_or_future6: _FutureT[Any], + *coros_or_futures: _FutureT[Any], + loop: AbstractEventLoop = ..., return_exceptions: bool = ...) -> Future[Tuple[Any, ...]]: ... +def run_coroutine_threadsafe(coro: _FutureT[_T], + loop: AbstractEventLoop) -> concurrent.futures.Future[_T]: ... +def shield(arg: _FutureT[_T], *, loop: AbstractEventLoop = ...) -> Future[_T]: ... +def sleep(delay: float, result: _T = ..., loop: AbstractEventLoop = ...) -> Future[_T]: ... +def wait(fs: Iterable[_FutureT[_T]], *, loop: AbstractEventLoop = ..., timeout: Optional[float] = ..., + return_when: str = ...) -> Future[Tuple[Set[Future[_T]], Set[Future[_T]]]]: ... +def wait_for(fut: _FutureT[_T], timeout: Optional[float], + *, loop: AbstractEventLoop = ...) -> Future[_T]: ... + +class Task(Future[_T], Generic[_T]): + @classmethod + def current_task(cls, loop: Optional[AbstractEventLoop] = ...) -> Task: ... + @classmethod + def all_tasks(cls, loop: Optional[AbstractEventLoop] = ...) -> Set[Task]: ... + def __init__(self, coro: Union[Generator[Any, None, _T], Awaitable[_T]], *, loop: AbstractEventLoop = ...) -> None: ... + def __repr__(self) -> str: ... + def get_stack(self, *, limit: int = ...) -> List[FrameType]: ... + def print_stack(self, *, limit: int = ..., file: TextIO = ...) -> None: ... + def cancel(self) -> bool: ... + def _step(self, value: Any = ..., exc: Exception = ...) -> None: ... + def _wakeup(self, future: Future[Any]) -> None: ... + +if sys.version_info >= (3, 7): + def all_tasks(loop: Optional[AbstractEventLoop] = ...) -> Set[Task]: ... + def create_task(coro: Union[Generator[Any, None, _T], Awaitable[_T]]) -> Task: ... + def current_task(loop: Optional[AbstractEventLoop] = ...) -> Optional[Task]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/asyncio/transports.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/asyncio/transports.pyi new file mode 100644 index 0000000..9ea6688 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/asyncio/transports.pyi @@ -0,0 +1,38 @@ +from typing import Dict, Any, TypeVar, Mapping, List, Optional, Tuple + +__all__: List[str] + +class BaseTransport: + def __init__(self, extra: Mapping[Any, Any] = ...) -> None: ... + def get_extra_info(self, name: Any, default: Any = ...) -> Any: ... + def is_closing(self) -> bool: ... + def close(self) -> None: ... + +class ReadTransport(BaseTransport): + def pause_reading(self) -> None: ... + def resume_reading(self) -> None: ... + +class WriteTransport(BaseTransport): + def set_write_buffer_limits( + self, high: int = ..., low: int = ... + ) -> None: ... + def get_write_buffer_size(self) -> int: ... + def write(self, data: Any) -> None: ... + def writelines(self, list_of_data: List[Any]) -> None: ... + def write_eof(self) -> None: ... + def can_write_eof(self) -> bool: ... + def abort(self) -> None: ... + +class Transport(ReadTransport, WriteTransport): ... + +class DatagramTransport(BaseTransport): + def sendto(self, data: Any, addr: Optional[Tuple[str, int]] = ...) -> None: ... + def abort(self) -> None: ... + +class SubprocessTransport(BaseTransport): + def get_pid(self) -> int: ... + def get_returncode(self) -> int: ... + def get_pipe_transport(self, fd: int) -> BaseTransport: ... + def send_signal(self, signal: int) -> int: ... + def terminate(self) -> None: ... + def kill(self) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/atexit.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/atexit.pyi new file mode 100644 index 0000000..24f9389 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/atexit.pyi @@ -0,0 +1,9 @@ +"""Stub file for the 'atexit' module.""" + +from typing import Any, Callable + +def _clear() -> None: ... +def _ncallbacks() -> int: ... +def _run_exitfuncs() -> None: ... +def register(func: Callable[..., Any], *args: Any, **kwargs: Any) -> Callable[..., Any]: ... +def unregister(func: Callable[..., Any]) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/collections/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/collections/__init__.pyi new file mode 100644 index 0000000..524ff6f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/collections/__init__.pyi @@ -0,0 +1,348 @@ +# These are not exported. +import sys +import typing +from typing import ( + TypeVar, Generic, Dict, overload, List, Tuple, + Any, Type, Optional, Union +) +# These are exported. +from . import abc + +from typing import ( + Callable as Callable, + Container as Container, + Hashable as Hashable, + Iterable as Iterable, + Iterator as Iterator, + Sized as Sized, + Generator as Generator, + ByteString as ByteString, + Reversible as Reversible, + Mapping as Mapping, + MappingView as MappingView, + ItemsView as ItemsView, + KeysView as KeysView, + ValuesView as ValuesView, + MutableMapping as MutableMapping, + Sequence as Sequence, + MutableSequence as MutableSequence, + MutableSet as MutableSet, + AbstractSet as Set, +) +if sys.version_info >= (3, 6): + from typing import ( + Collection as Collection, + AsyncGenerator as AsyncGenerator, + ) +if sys.version_info >= (3, 5): + from typing import ( + Awaitable as Awaitable, + Coroutine as Coroutine, + AsyncIterable as AsyncIterable, + AsyncIterator as AsyncIterator, + ) + +_S = TypeVar('_S') +_T = TypeVar('_T') +_KT = TypeVar('_KT') +_VT = TypeVar('_VT') + + +# namedtuple is special-cased in the type checker; the initializer is ignored. +if sys.version_info >= (3, 7): + def namedtuple(typename: str, field_names: Union[str, Iterable[str]], *, + rename: bool = ..., module: Optional[str] = ..., defaults: Optional[Iterable[Any]] = ...) -> Type[tuple]: ... +elif sys.version_info >= (3, 6): + def namedtuple(typename: str, field_names: Union[str, Iterable[str]], *, + verbose: bool = ..., rename: bool = ..., module: Optional[str] = ...) -> Type[tuple]: ... +else: + def namedtuple(typename: str, field_names: Union[str, Iterable[str]], + verbose: bool = ..., rename: bool = ...) -> Type[tuple]: ... + +_UserDictT = TypeVar('_UserDictT', bound=UserDict) + +class UserDict(MutableMapping[_KT, _VT]): + data: Dict[_KT, _VT] + def __init__(self, dict: Optional[Mapping[_KT, _VT]] = ..., **kwargs: _VT) -> None: ... + def __len__(self) -> int: ... + def __getitem__(self, key: _KT) -> _VT: ... + def __setitem__(self, key: _KT, item: _VT) -> None: ... + def __delitem__(self, key: _KT) -> None: ... + def __iter__(self) -> Iterator[_KT]: ... + def __contains__(self, key: object) -> bool: ... + def copy(self: _UserDictT) -> _UserDictT: ... + @classmethod + def fromkeys(cls: Type[_UserDictT], iterable: Iterable[_KT], value: Optional[_VT] = ...) -> _UserDictT: ... + +_UserListT = TypeVar('_UserListT', bound=UserList) + +class UserList(MutableSequence[_T]): + data: List[_T] + def __init__(self, initlist: Optional[Iterable[_T]] = ...) -> None: ... + def __lt__(self, other: object) -> bool: ... + def __le__(self, other: object) -> bool: ... + def __gt__(self, other: object) -> bool: ... + def __ge__(self, other: object) -> bool: ... + def __contains__(self, item: object) -> bool: ... + def __len__(self) -> int: ... + @overload + def __getitem__(self, i: int) -> _T: ... + @overload + def __getitem__(self, i: slice) -> MutableSequence[_T]: ... + @overload + def __setitem__(self, i: int, o: _T) -> None: ... + @overload + def __setitem__(self, i: slice, o: Iterable[_T]) -> None: ... + def __delitem__(self, i: Union[int, slice]) -> None: ... + def __add__(self: _UserListT, other: Iterable[_T]) -> _UserListT: ... + def __iadd__(self: _UserListT, other: Iterable[_T]) -> _UserListT: ... + def __mul__(self: _UserListT, n: int) -> _UserListT: ... + def __imul__(self: _UserListT, n: int) -> _UserListT: ... + def append(self, item: _T) -> None: ... + def insert(self, i: int, item: _T) -> None: ... + def pop(self, i: int = ...) -> _T: ... + def remove(self, item: _T) -> None: ... + def clear(self) -> None: ... + def copy(self: _UserListT) -> _UserListT: ... + def count(self, item: _T) -> int: ... + def index(self, item: _T, *args: Any) -> int: ... + def reverse(self) -> None: ... + def sort(self, *args: Any, **kwds: Any) -> None: ... + def extend(self, other: Iterable[_T]) -> None: ... + +_UserStringT = TypeVar('_UserStringT', bound=UserString) + +class UserString(Sequence[str]): + data: str + def __init__(self, seq: object) -> None: ... + def __int__(self) -> int: ... + def __float__(self) -> float: ... + def __complex__(self) -> complex: ... + if sys.version_info >= (3, 5): + def __getnewargs__(self) -> Tuple[str]: ... + def __lt__(self, string: Union[str, UserString]) -> bool: ... + def __le__(self, string: Union[str, UserString]) -> bool: ... + def __gt__(self, string: Union[str, UserString]) -> bool: ... + def __ge__(self, string: Union[str, UserString]) -> bool: ... + def __contains__(self, char: object) -> bool: ... + def __len__(self) -> int: ... + # It should return a str to implement Sequence correctly, but it doesn't. + def __getitem__(self: _UserStringT, i: Union[int, slice]) -> _UserStringT: ... # type: ignore + def __add__(self: _UserStringT, other: object) -> _UserStringT: ... + def __mul__(self: _UserStringT, n: int) -> _UserStringT: ... + def __mod__(self: _UserStringT, args: Any) -> _UserStringT: ... + def capitalize(self: _UserStringT) -> _UserStringT: ... + if sys.version_info >= (3, 5): + def casefold(self: _UserStringT) -> _UserStringT: ... + def center(self: _UserStringT, width: int, *args: Any) -> _UserStringT: ... + def count(self, sub: Union[str, UserString], start: int = ..., end: int = ...) -> int: ... + def encode(self: _UserStringT, encoding: Optional[str] = ..., errors: Optional[str] = ...) -> _UserStringT: ... + def endswith(self, suffix: Union[str, Tuple[str, ...]], start: int = ..., end: int = ...) -> bool: ... + def expandtabs(self: _UserStringT, tabsize: int = ...) -> _UserStringT: ... + def find(self, sub: Union[str, UserString], start: int = ..., end: int = ...) -> int: ... + def format(self, *args: Any, **kwds: Any) -> str: ... + if sys.version_info >= (3, 5): + def format_map(self, mapping: Mapping[str, Any]) -> str: ... + def index(self, sub: str, start: int = ..., end: int = ...) -> int: ... + def isalpha(self) -> bool: ... + def isalnum(self) -> bool: ... + def isdecimal(self) -> bool: ... + def isdigit(self) -> bool: ... + def isidentifier(self) -> bool: ... + def islower(self) -> bool: ... + def isnumeric(self) -> bool: ... + if sys.version_info >= (3, 5): + def isprintable(self) -> bool: ... + def isspace(self) -> bool: ... + def istitle(self) -> bool: ... + def isupper(self) -> bool: ... + def join(self, seq: Iterable[str]) -> str: ... + def ljust(self: _UserStringT, width: int, *args: Any) -> _UserStringT: ... + def lower(self: _UserStringT) -> _UserStringT: ... + def lstrip(self: _UserStringT, chars: Optional[str] = ...) -> _UserStringT: ... + if sys.version_info >= (3, 5): + @staticmethod + @overload + def maketrans(x: Union[Dict[int, _T], Dict[str, _T], Dict[Union[str, int], _T]]) -> Dict[int, _T]: ... + @staticmethod + @overload + def maketrans(x: str, y: str, z: str = ...) -> Dict[int, Union[int, None]]: ... + def partition(self, sep: str) -> Tuple[str, str, str]: ... + def replace(self: _UserStringT, old: Union[str, UserString], new: Union[str, UserString], maxsplit: int = ...) -> _UserStringT: ... + def rfind(self, sub: Union[str, UserString], start: int = ..., end: int = ...) -> int: ... + def rindex(self, sub: Union[str, UserString], start: int = ..., end: int = ...) -> int: ... + def rjust(self: _UserStringT, width: int, *args: Any) -> _UserStringT: ... + def rpartition(self, sep: str) -> Tuple[str, str, str]: ... + def rstrip(self: _UserStringT, chars: Optional[str] = ...) -> _UserStringT: ... + def split(self, sep: Optional[str] = ..., maxsplit: int = ...) -> List[str]: ... + def rsplit(self, sep: Optional[str] = ..., maxsplit: int = ...) -> List[str]: ... + def splitlines(self, keepends: bool = ...) -> List[str]: ... + def startswith(self, prefix: Union[str, Tuple[str, ...]], start: int = ..., end: int = ...) -> bool: ... + def strip(self: _UserStringT, chars: Optional[str] = ...) -> _UserStringT: ... + def swapcase(self: _UserStringT) -> _UserStringT: ... + def title(self: _UserStringT) -> _UserStringT: ... + def translate(self: _UserStringT, *args: Any) -> _UserStringT: ... + def upper(self: _UserStringT) -> _UserStringT: ... + def zfill(self: _UserStringT, width: int) -> _UserStringT: ... + + +# Technically, deque only derives from MutableSequence in 3.5 (before then, the insert and index +# methods did not exist). +# But in practice it's not worth losing sleep over. +class deque(MutableSequence[_T], Generic[_T]): + @property + def maxlen(self) -> Optional[int]: ... + def __init__(self, iterable: Iterable[_T] = ..., + maxlen: Optional[int] = ...) -> None: ... + def append(self, x: _T) -> None: ... + def appendleft(self, x: _T) -> None: ... + def clear(self) -> None: ... + if sys.version_info >= (3, 5): + def copy(self) -> deque[_T]: ... + def count(self, x: _T) -> int: ... + def extend(self, iterable: Iterable[_T]) -> None: ... + def extendleft(self, iterable: Iterable[_T]) -> None: ... + def insert(self, i: int, x: _T) -> None: ... + def index(self, x: _T, start: int = ..., stop: int = ...) -> int: ... + def pop(self, i: int = ...) -> _T: ... + def popleft(self) -> _T: ... + def remove(self, value: _T) -> None: ... + def reverse(self) -> None: ... + def rotate(self, n: int) -> None: ... + + def __len__(self) -> int: ... + def __iter__(self) -> Iterator[_T]: ... + def __str__(self) -> str: ... + def __hash__(self) -> int: ... + + # These methods of deque don't really take slices, but we need to + # define them as taking a slice to satisfy MutableSequence. + @overload + def __getitem__(self, index: int) -> _T: ... + @overload + def __getitem__(self, s: slice) -> MutableSequence[_T]: + raise TypeError + @overload + def __setitem__(self, i: int, x: _T) -> None: ... + @overload + def __setitem__(self, s: slice, o: Iterable[_T]) -> None: + raise TypeError + @overload + def __delitem__(self, i: int) -> None: ... + @overload + def __delitem__(self, s: slice) -> None: + raise TypeError + + def __contains__(self, o: object) -> bool: ... + def __reversed__(self) -> Iterator[_T]: ... + + def __iadd__(self: _S, iterable: Iterable[_T]) -> _S: ... + + if sys.version_info >= (3, 5): + def __add__(self, other: deque[_T]) -> deque[_T]: ... + def __mul__(self, other: int) -> deque[_T]: ... + def __imul__(self, other: int) -> None: ... + +_CounterT = TypeVar('_CounterT', bound=Counter) + +class Counter(Dict[_T, int], Generic[_T]): + @overload + def __init__(self, **kwargs: int) -> None: ... + @overload + def __init__(self, mapping: Mapping[_T, int]) -> None: ... + @overload + def __init__(self, iterable: Iterable[_T]) -> None: ... + def copy(self: _CounterT) -> _CounterT: ... + def elements(self) -> Iterator[_T]: ... + + def most_common(self, n: Optional[int] = ...) -> List[Tuple[_T, int]]: ... + + @overload + def subtract(self, __mapping: Mapping[_T, int]) -> None: ... + @overload + def subtract(self, iterable: Iterable[_T]) -> None: ... + + # The Iterable[Tuple[...]] argument type is not actually desirable + # (the tuples will be added as keys, breaking type safety) but + # it's included so that the signature is compatible with + # Dict.update. Not sure if we should use '# type: ignore' instead + # and omit the type from the union. + @overload + def update(self, __m: Mapping[_T, int], **kwargs: int) -> None: ... + @overload + def update(self, __m: Union[Iterable[_T], Iterable[Tuple[_T, int]]], **kwargs: int) -> None: ... + @overload + def update(self, **kwargs: int) -> None: ... + + def __add__(self, other: Counter[_T]) -> Counter[_T]: ... + def __sub__(self, other: Counter[_T]) -> Counter[_T]: ... + def __and__(self, other: Counter[_T]) -> Counter[_T]: ... + def __or__(self, other: Counter[_T]) -> Counter[_T]: ... + def __pos__(self) -> Counter[_T]: ... + def __neg__(self) -> Counter[_T]: ... + def __iadd__(self, other: Counter[_T]) -> Counter[_T]: ... + def __isub__(self, other: Counter[_T]) -> Counter[_T]: ... + def __iand__(self, other: Counter[_T]) -> Counter[_T]: ... + def __ior__(self, other: Counter[_T]) -> Counter[_T]: ... + +_OrderedDictT = TypeVar('_OrderedDictT', bound=OrderedDict) + +class _OrderedDictKeysView(KeysView[_KT], Reversible[_KT]): + def __reversed__(self) -> Iterator[_KT]: ... +class _OrderedDictItemsView(ItemsView[_KT, _VT], Reversible[Tuple[_KT, _VT]]): + def __reversed__(self) -> Iterator[Tuple[_KT, _VT]]: ... +class _OrderedDictValuesView(ValuesView[_VT], Reversible[_VT]): + def __reversed__(self) -> Iterator[_VT]: ... + +class OrderedDict(Dict[_KT, _VT], Reversible[_KT], Generic[_KT, _VT]): + def popitem(self, last: bool = ...) -> Tuple[_KT, _VT]: ... + def move_to_end(self, key: _KT, last: bool = ...) -> None: ... + def copy(self: _OrderedDictT) -> _OrderedDictT: ... + def __reversed__(self) -> Iterator[_KT]: ... + def keys(self) -> _OrderedDictKeysView[_KT]: ... + def items(self) -> _OrderedDictItemsView[_KT, _VT]: ... + def values(self) -> _OrderedDictValuesView[_VT]: ... + +_DefaultDictT = TypeVar('_DefaultDictT', bound=defaultdict) + +class defaultdict(Dict[_KT, _VT], Generic[_KT, _VT]): + default_factory: Optional[Callable[[], _VT]] + + @overload + def __init__(self, **kwargs: _VT) -> None: ... + @overload + def __init__(self, default_factory: Optional[Callable[[], _VT]]) -> None: ... + @overload + def __init__(self, default_factory: Optional[Callable[[], _VT]], **kwargs: _VT) -> None: ... + @overload + def __init__(self, default_factory: Optional[Callable[[], _VT]], + map: Mapping[_KT, _VT]) -> None: ... + @overload + def __init__(self, default_factory: Optional[Callable[[], _VT]], + map: Mapping[_KT, _VT], **kwargs: _VT) -> None: ... + @overload + def __init__(self, default_factory: Optional[Callable[[], _VT]], + iterable: Iterable[Tuple[_KT, _VT]]) -> None: ... + @overload + def __init__(self, default_factory: Optional[Callable[[], _VT]], + iterable: Iterable[Tuple[_KT, _VT]], **kwargs: _VT) -> None: ... + def __missing__(self, key: _KT) -> _VT: ... + # TODO __reversed__ + def copy(self: _DefaultDictT) -> _DefaultDictT: ... + +class ChainMap(MutableMapping[_KT, _VT], Generic[_KT, _VT]): + def __init__(self, *maps: Mapping[_KT, _VT]) -> None: ... + + @property + def maps(self) -> List[Mapping[_KT, _VT]]: ... + + def new_child(self, m: Mapping[_KT, _VT] = ...) -> typing.ChainMap[_KT, _VT]: ... + + @property + def parents(self) -> typing.ChainMap[_KT, _VT]: ... + + def __setitem__(self, k: _KT, v: _VT) -> None: ... + def __delitem__(self, v: _KT) -> None: ... + def __getitem__(self, k: _KT) -> _VT: ... + def __iter__(self) -> Iterator[_KT]: ... + def __len__(self) -> int: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/collections/abc.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/collections/abc.pyi new file mode 100644 index 0000000..a957728 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/collections/abc.pyi @@ -0,0 +1,40 @@ +# Stubs for collections.abc (introduced from Python 3.3) +# +# https://docs.python.org/3.3/whatsnew/3.3.html#collections +import sys + +from . import ( + Container as Container, + Hashable as Hashable, + Iterable as Iterable, + Iterator as Iterator, + Sized as Sized, + Callable as Callable, + Mapping as Mapping, + MutableMapping as MutableMapping, + Sequence as Sequence, + MutableSequence as MutableSequence, + Set as Set, + MutableSet as MutableSet, + MappingView as MappingView, + ItemsView as ItemsView, + KeysView as KeysView, + ValuesView as ValuesView, +) + +if sys.version_info >= (3, 5): + from . import ( + Generator as Generator, + ByteString as ByteString, + Awaitable as Awaitable, + Coroutine as Coroutine, + AsyncIterable as AsyncIterable, + AsyncIterator as AsyncIterator, + ) + +if sys.version_info >= (3, 6): + from . import ( + Collection as Collection, + Reversible as Reversible, + AsyncGenerator as AsyncGenerator, + ) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/compileall.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/compileall.pyi new file mode 100644 index 0000000..8d2731c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/compileall.pyi @@ -0,0 +1,20 @@ +# Stubs for compileall (Python 3) + +import os +import sys +from typing import Optional, Union, Pattern + +if sys.version_info < (3, 6): + _Path = Union[str, bytes] + _SuccessType = bool +else: + _Path = Union[str, bytes, os.PathLike] + _SuccessType = int + +# rx can be any object with a 'search' method; once we have Protocols we can change the type +if sys.version_info < (3, 5): + def compile_dir(dir: _Path, maxlevels: int = ..., ddir: Optional[_Path] = ..., force: bool = ..., rx: Optional[Pattern] = ..., quiet: int = ..., legacy: bool = ..., optimize: int = ...) -> _SuccessType: ... +else: + def compile_dir(dir: _Path, maxlevels: int = ..., ddir: Optional[_Path] = ..., force: bool = ..., rx: Optional[Pattern] = ..., quiet: int = ..., legacy: bool = ..., optimize: int = ..., workers: int = ...) -> _SuccessType: ... +def compile_file(fullname: _Path, ddir: Optional[_Path] = ..., force: bool = ..., rx: Optional[Pattern] = ..., quiet: int = ..., legacy: bool = ..., optimize: int = ...) -> _SuccessType: ... +def compile_path(skip_curdir: bool = ..., maxlevels: int = ..., force: bool = ..., quiet: int = ..., legacy: bool = ..., optimize: int = ...) -> _SuccessType: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/concurrent/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/concurrent/__init__.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/concurrent/futures/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/concurrent/futures/__init__.pyi new file mode 100644 index 0000000..4439dca --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/concurrent/futures/__init__.pyi @@ -0,0 +1,3 @@ +from ._base import * # noqa: F403 +from .thread import * # noqa: F403 +from .process import * # noqa: F403 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/concurrent/futures/_base.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/concurrent/futures/_base.pyi new file mode 100644 index 0000000..95189a7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/concurrent/futures/_base.pyi @@ -0,0 +1,56 @@ +from typing import TypeVar, Generic, Any, Iterable, Iterator, Callable, Tuple, Optional, Set, NamedTuple +from types import TracebackType +import sys + +FIRST_COMPLETED: str +FIRST_EXCEPTION: str +ALL_COMPLETED: str +PENDING: Any +RUNNING: Any +CANCELLED: Any +CANCELLED_AND_NOTIFIED: Any +FINISHED: Any +LOGGER: Any + +class Error(Exception): ... +class CancelledError(Error): ... +class TimeoutError(Error): ... + +_T = TypeVar('_T') + +class Future(Generic[_T]): + def __init__(self) -> None: ... + def cancel(self) -> bool: ... + def cancelled(self) -> bool: ... + def running(self) -> bool: ... + def done(self) -> bool: ... + def add_done_callback(self, fn: Callable[[Future[_T]], Any]) -> None: ... + def result(self, timeout: Optional[float] = ...) -> _T: ... + def set_running_or_notify_cancel(self) -> bool: ... + def set_result(self, result: _T) -> None: ... + + if sys.version_info >= (3,): + def exception(self, timeout: Optional[float] = ...) -> Optional[BaseException]: ... + def set_exception(self, exception: Optional[BaseException]) -> None: ... + else: + def exception(self, timeout: Optional[float] = ...) -> Any: ... + def exception_info(self, timeout: Optional[float] = ...) -> Tuple[Any, Optional[TracebackType]]: ... + def set_exception(self, exception: Any) -> None: ... + def set_exception_info(self, exception: Any, traceback: Optional[TracebackType]) -> None: ... + + +class Executor: + def submit(self, fn: Callable[..., _T], *args: Any, **kwargs: Any) -> Future[_T]: ... + if sys.version_info >= (3, 5): + def map(self, func: Callable[..., _T], *iterables: Iterable[Any], timeout: Optional[float] = ..., + chunksize: int = ...) -> Iterator[_T]: ... + else: + def map(self, func: Callable[..., _T], *iterables: Iterable[Any], timeout: Optional[float] = ...,) -> Iterator[_T]: ... + def shutdown(self, wait: bool = ...) -> None: ... + def __enter__(self: _T) -> _T: ... + def __exit__(self, exc_type: Any, exc_val: Any, exc_tb: Any) -> bool: ... + +def as_completed(fs: Iterable[Future[_T]], timeout: Optional[float] = ...) -> Iterator[Future[_T]]: ... + +def wait(fs: Iterable[Future[_T]], timeout: Optional[float] = ..., return_when: str = ...) -> Tuple[Set[Future[_T]], + Set[Future[_T]]]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/concurrent/futures/process.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/concurrent/futures/process.pyi new file mode 100644 index 0000000..ba0cd61 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/concurrent/futures/process.pyi @@ -0,0 +1,17 @@ +from typing import Any, Callable, Optional, Tuple +from ._base import Future, Executor +import sys + +EXTRA_QUEUED_CALLS: Any + +if sys.version_info >= (3,): + class BrokenProcessPool(RuntimeError): ... + +if sys.version_info >= (3, 7): + class ProcessPoolExecutor(Executor): + def __init__(self, max_workers: Optional[int] = ..., + initializer: Optional[Callable[..., None]] = ..., + initargs: Tuple[Any, ...] = ...) -> None: ... +else: + class ProcessPoolExecutor(Executor): + def __init__(self, max_workers: Optional[int] = ...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/concurrent/futures/thread.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/concurrent/futures/thread.pyi new file mode 100644 index 0000000..983594d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/concurrent/futures/thread.pyi @@ -0,0 +1,15 @@ +from typing import Any, Callable, Optional, Tuple +from ._base import Executor, Future +import sys + +class ThreadPoolExecutor(Executor): + if sys.version_info >= (3, 7): + def __init__(self, max_workers: Optional[int] = ..., + thread_name_prefix: str = ..., + initializer: Optional[Callable[..., None]] = ..., + initargs: Tuple[Any, ...] = ...) -> None: ... + elif sys.version_info >= (3, 6) or sys.version_info < (3,): + def __init__(self, max_workers: Optional[int] = ..., + thread_name_prefix: str = ...) -> None: ... + else: + def __init__(self, max_workers: Optional[int] = ...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/configparser.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/configparser.pyi new file mode 100644 index 0000000..17501c1 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/configparser.pyi @@ -0,0 +1,234 @@ +# Based on http://docs.python.org/3.5/library/configparser.html and on +# reading configparser.py. + +import sys +from typing import (AbstractSet, MutableMapping, Mapping, Dict, Sequence, List, + Union, Iterable, Iterator, Callable, Any, IO, overload, + Optional, Pattern, Type, TypeVar) +# Types only used in type comments only +from typing import Optional, Tuple # noqa + +if sys.version_info >= (3, 6): + from os import PathLike + +# Internal type aliases +_section = Mapping[str, str] +_parser = MutableMapping[str, _section] +_converter = Callable[[str], Any] +_converters = Dict[str, _converter] +_T = TypeVar('_T') + +if sys.version_info >= (3, 7): + _Path = Union[str, bytes, PathLike[str]] +elif sys.version_info >= (3, 6): + _Path = Union[str, PathLike[str]] +else: + _Path = str + +DEFAULTSECT: str +MAX_INTERPOLATION_DEPTH: int + +class Interpolation: + def before_get(self, parser: _parser, + section: str, + option: str, + value: str, + defaults: _section) -> str: ... + + def before_set(self, parser: _parser, + section: str, + option: str, + value: str) -> str: ... + + def before_read(self, parser: _parser, + section: str, + option: str, + value: str) -> str: ... + + def before_write(self, parser: _parser, + section: str, + option: str, + value: str) -> str: ... + + +class BasicInterpolation(Interpolation): ... +class ExtendedInterpolation(Interpolation): ... +class LegacyInterpolation(Interpolation): ... + + +class RawConfigParser(_parser): + def __init__(self, + defaults: Optional[_section] = ..., + dict_type: Type[Mapping[str, str]] = ..., + allow_no_value: bool = ..., + *, + delimiters: Sequence[str] = ..., + comment_prefixes: Sequence[str] = ..., + inline_comment_prefixes: Optional[Sequence[str]] = ..., + strict: bool = ..., + empty_lines_in_values: bool = ..., + default_section: str = ..., + interpolation: Optional[Interpolation] = ...) -> None: ... + + def __len__(self) -> int: ... + + def __getitem__(self, section: str) -> SectionProxy: ... + + def __setitem__(self, section: str, options: _section) -> None: ... + + def __delitem__(self, section: str) -> None: ... + + def __iter__(self) -> Iterator[str]: ... + + def defaults(self) -> _section: ... + + def sections(self) -> List[str]: ... + + def add_section(self, section: str) -> None: ... + + def has_section(self, section: str) -> bool: ... + + def options(self, section: str) -> List[str]: ... + + def has_option(self, section: str, option: str) -> bool: ... + + def read(self, filenames: Union[_Path, Iterable[_Path]], + encoding: Optional[str] = ...) -> List[str]: ... + def read_file(self, f: Iterable[str], source: Optional[str] = ...) -> None: ... + def read_string(self, string: str, source: str = ...) -> None: ... + def read_dict(self, dictionary: Mapping[str, Mapping[str, Any]], + source: str = ...) -> None: ... + def readfp(self, fp: Iterable[str], filename: Optional[str] = ...) -> None: ... + + # These get* methods are partially applied (with the same names) in + # SectionProxy; the stubs should be kept updated together + def getint(self, section: str, option: str, *, raw: bool = ..., vars: Optional[_section] = ..., fallback: int = ...) -> int: ... + + def getfloat(self, section: str, option: str, *, raw: bool = ..., vars: Optional[_section] = ..., fallback: float = ...) -> float: ... + + def getboolean(self, section: str, option: str, *, raw: bool = ..., vars: Optional[_section] = ..., fallback: bool = ...) -> bool: ... + + def _get_conv(self, section: str, option: str, conv: Callable[[str], _T], *, raw: bool = ..., vars: Optional[_section] = ..., fallback: _T = ...) -> _T: ... + + # This is incompatible with MutableMapping so we ignore the type + @overload # type: ignore + def get(self, section: str, option: str, *, raw: bool = ..., vars: Optional[_section] = ...) -> str: ... + + @overload # type: ignore + def get(self, section: str, option: str, *, raw: bool = ..., vars: Optional[_section] = ..., fallback: _T) -> Union[str, _T]: ... + + @overload + def items(self, *, raw: bool = ..., vars: Optional[_section] = ...) -> AbstractSet[Tuple[str, SectionProxy]]: ... + + @overload + def items(self, section: str, raw: bool = ..., vars: Optional[_section] = ...) -> List[Tuple[str, str]]: ... + + def set(self, section: str, option: str, value: str) -> None: ... + + def write(self, + fileobject: IO[str], + space_around_delimiters: bool = ...) -> None: ... + + def remove_option(self, section: str, option: str) -> bool: ... + + def remove_section(self, section: str) -> bool: ... + + def optionxform(self, option: str) -> str: ... + + +class ConfigParser(RawConfigParser): + def __init__(self, + defaults: Optional[_section] = ..., + dict_type: Type[Mapping[str, str]] = ..., + allow_no_value: bool = ..., + delimiters: Sequence[str] = ..., + comment_prefixes: Sequence[str] = ..., + inline_comment_prefixes: Optional[Sequence[str]] = ..., + strict: bool = ..., + empty_lines_in_values: bool = ..., + default_section: str = ..., + interpolation: Optional[Interpolation] = ..., + converters: _converters = ...) -> None: ... + +class SafeConfigParser(ConfigParser): ... + +class SectionProxy(MutableMapping[str, str]): + def __init__(self, parser: RawConfigParser, name: str) -> None: ... + def __getitem__(self, key: str) -> str: ... + def __setitem__(self, key: str, value: str) -> None: ... + def __delitem__(self, key: str) -> None: ... + def __contains__(self, key: object) -> bool: ... + def __len__(self) -> int: ... + def __iter__(self) -> Iterator[str]: ... + @property + def parser(self) -> RawConfigParser: ... + @property + def name(self) -> str: ... + def get(self, option: str, fallback: Optional[str] = ..., *, raw: bool = ..., vars: Optional[_section] = ..., **kwargs: Any) -> str: ... # type: ignore + + # These are partially-applied version of the methods with the same names in + # RawConfigParser; the stubs should be kept updated together + def getint(self, option: str, *, raw: bool = ..., vars: Optional[_section] = ..., fallback: int = ...) -> int: ... + def getfloat(self, option: str, *, raw: bool = ..., vars: Optional[_section] = ..., fallback: float = ...) -> float: ... + def getboolean(self, option: str, *, raw: bool = ..., vars: Optional[_section] = ..., fallback: bool = ...) -> bool: ... + + # SectionProxy can have arbitrary attributes when custon converters are used + def __getattr__(self, key: str) -> Callable[..., Any]: ... + +class ConverterMapping(MutableMapping[str, Optional[_converter]]): + GETTERCRE: Pattern + def __init__(self, parser: RawConfigParser) -> None: ... + def __getitem__(self, key: str) -> _converter: ... + def __setitem__(self, key: str, value: Optional[_converter]) -> None: ... + def __delitem__(self, key: str) -> None: ... + def __iter__(self) -> Iterator[str]: ... + def __len__(self) -> int: ... + + +class Error(Exception): ... + + +class NoSectionError(Error): ... + + +class DuplicateSectionError(Error): + section: str + source: Optional[str] + lineno: Optional[int] + + +class DuplicateOptionError(Error): + section: str + option: str + source: Optional[str] + lineno: Optional[int] + + +class NoOptionError(Error): + section: str + option: str + + +class InterpolationError(Error): + section: str + option: str + + +class InterpolationDepthError(InterpolationError): ... + + +class InterpolationMissingOptionError(InterpolationError): + reference: str + + +class InterpolationSyntaxError(InterpolationError): ... + + +class ParsingError(Error): + source: str + errors: Sequence[Tuple[int, str]] + + +class MissingSectionHeaderError(ParsingError): + lineno: int + line: str diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/curses/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/curses/__init__.pyi new file mode 100644 index 0000000..a8d6df4 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/curses/__init__.pyi @@ -0,0 +1,12 @@ +import _curses +from _curses import * # noqa: F403 +from typing import TypeVar, Callable, Any, Sequence, Mapping + +_T = TypeVar('_T') + +LINES: int +COLS: int + +def initscr() -> _curses._CursesWindow: ... +def start_color() -> None: ... +def wrapper(func: Callable[..., _T], *arg: Any, **kwds: Any) -> _T: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/curses/ascii.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/curses/ascii.pyi new file mode 100644 index 0000000..4033769 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/curses/ascii.pyi @@ -0,0 +1,62 @@ +from typing import List, Union, overload, TypeVar + +_Ch = TypeVar('_Ch', str, int) + +NUL: int +SOH: int +STX: int +ETX: int +EOT: int +ENQ: int +ACK: int +BEL: int +BS: int +TAB: int +HT: int +LF: int +NL: int +VT: int +FF: int +CR: int +SO: int +SI: int +DLE: int +DC1: int +DC2: int +DC3: int +DC4: int +NAK: int +SYN: int +ETB: int +CAN: int +EM: int +SUB: int +ESC: int +FS: int +GS: int +RS: int +US: int +SP: int +DEL: int + +controlnames: List[int] + +def isalnum(c: Union[str, int]) -> bool: ... +def isalpha(c: Union[str, int]) -> bool: ... +def isascii(c: Union[str, int]) -> bool: ... +def isblank(c: Union[str, int]) -> bool: ... +def iscntrl(c: Union[str, int]) -> bool: ... +def isdigit(c: Union[str, int]) -> bool: ... +def isgraph(c: Union[str, int]) -> bool: ... +def islower(c: Union[str, int]) -> bool: ... +def isprint(c: Union[str, int]) -> bool: ... +def ispunct(c: Union[str, int]) -> bool: ... +def isspace(c: Union[str, int]) -> bool: ... +def isupper(c: Union[str, int]) -> bool: ... +def isxdigit(c: Union[str, int]) -> bool: ... +def isctrl(c: Union[str, int]) -> bool: ... +def ismeta(c: Union[str, int]) -> bool: ... +def ascii(c: _Ch) -> _Ch: ... +def ctrl(c: _Ch) -> _Ch: ... +def alt(c: _Ch) -> _Ch: ... +def unctrl(c: Union[str, int]) -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/curses/panel.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/curses/panel.pyi new file mode 100644 index 0000000..90f70c4 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/curses/panel.pyi @@ -0,0 +1,20 @@ +from _curses import _CursesWindow + +class _Curses_Panel: # type is (note the space in the class name) + def above(self) -> _Curses_Panel: ... + def below(self) -> _Curses_Panel: ... + def bottom(self) -> None: ... + def hidden(self) -> bool: ... + def hide(self) -> None: ... + def move(self, y: int, x: int) -> None: ... + def replace(self, win: _CursesWindow) -> None: ... + def set_userptr(self, obj: object) -> None: ... + def show(self) -> None: ... + def top(self) -> None: ... + def userptr(self) -> object: ... + def window(self) -> _CursesWindow: ... + +def bottom_panel() -> _Curses_Panel: ... +def new_panel(win: _CursesWindow) -> _Curses_Panel: ... +def top_panel() -> _Curses_Panel: ... +def update_panels() -> _Curses_Panel: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/curses/textpad.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/curses/textpad.pyi new file mode 100644 index 0000000..a218564 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/curses/textpad.pyi @@ -0,0 +1,11 @@ +from _curses import _CursesWindow +from typing import Callable, Union + +def rectangle(win: _CursesWindow, uly: int, ulx: int, lry: int, lrx: int) -> None: ... + +class Textbox: + stripspaces: bool + def __init__(self, w: _CursesWindow, insert_mode: bool = ...) -> None: ... + def edit(self, validate: Callable[[int], int]) -> str: ... + def do_command(self, ch: Union[str, int]) -> None: ... + def gather(self) -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/email/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/email/__init__.pyi new file mode 100644 index 0000000..ec7c25b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/email/__init__.pyi @@ -0,0 +1,26 @@ +# Stubs for email (Python 3.4) + +from typing import Callable, Optional, IO +import sys +from email.message import Message +from email.policy import Policy + +def message_from_string(s: str, _class: Callable[[], Message] = ..., *, policy: Policy = ...) -> Message: ... +def message_from_bytes(s: bytes, _class: Callable[[], Message] = ..., *, policy: Policy = ...) -> Message: ... +def message_from_file(fp: IO[str], _class: Callable[[], Message] = ..., *, policy: Policy = ...) -> Message: ... +def message_from_binary_file(fp: IO[bytes], _class: Callable[[], Message] = ..., *, policy: Policy = ...) -> Message: ... + +# Names in __all__ with no definition: +# base64mime +# charset +# encoders +# errors +# feedparser +# generator +# header +# iterators +# message +# mime +# parser +# quoprimime +# utils diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/email/charset.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/email/charset.pyi new file mode 100644 index 0000000..3a6c19d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/email/charset.pyi @@ -0,0 +1,31 @@ +# Stubs for email.charset (Python 3.4) + +from typing import List, Optional, Iterator, Any + +QP: int # undocumented +BASE64: int # undocumented +SHORTEST: int # undocumented + +class Charset: + input_charset: str + header_encoding: int + body_encoding: int + output_charset: Optional[str] + input_codec: Optional[str] + output_codec: Optional[str] + def __init__(self, input_charset: str = ...) -> None: ... + def get_body_encoding(self) -> str: ... + def get_output_charset(self) -> Optional[str]: ... + def header_encode(self, string: str) -> str: ... + def header_encode_lines(self, string: str, + maxlengths: Iterator[int]) -> List[str]: ... + def body_encode(self, string: str) -> str: ... + def __str__(self) -> str: ... + def __eq__(self, other: Any) -> bool: ... + def __ne__(self, other: Any) -> bool: ... + +def add_charset(charset: str, header_enc: Optional[int] = ..., + body_enc: Optional[int] = ..., + output_charset: Optional[str] = ...) -> None: ... +def add_alias(alias: str, canonical: str) -> None: ... +def add_codec(charset: str, codecname: str) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/email/contentmanager.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/email/contentmanager.pyi new file mode 100644 index 0000000..ed55ef6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/email/contentmanager.pyi @@ -0,0 +1,15 @@ +# Stubs for email.contentmanager (Python 3.4) + +from typing import Any, Callable +from email.message import Message + +class ContentManager: + def __init__(self) -> None: ... + def get_content(self, msg: Message, *args: Any, **kw: Any) -> Any: ... + def set_content(self, msg: Message, obj: Any, *args: Any, + **kw: Any) -> Any: ... + def add_get_handler(self, key: str, handler: Callable[..., Any]) -> None: ... + def add_set_handler(self, typekey: type, + handler: Callable[..., Any]) -> None: ... + +raw_data_manager: ContentManager diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/email/encoders.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/email/encoders.pyi new file mode 100644 index 0000000..bb5c84c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/email/encoders.pyi @@ -0,0 +1,8 @@ +# Stubs for email.encoders (Python 3.4) + +from email.message import Message + +def encode_base64(msg: Message) -> None: ... +def encode_quopri(msg: Message) -> None: ... +def encode_7or8bit(msg: Message) -> None: ... +def encode_noop(msg: Message) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/email/errors.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/email/errors.pyi new file mode 100644 index 0000000..77d9902 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/email/errors.pyi @@ -0,0 +1,19 @@ +# Stubs for email.errors (Python 3.4) + +class MessageError(Exception): ... +class MessageParseError(MessageError): ... +class HeaderParseError(MessageParseError): ... +class BoundaryError(MessageParseError): ... +class MultipartConversionError(MessageError, TypeError): ... + +class MessageDefect(ValueError): ... +class NoBoundaryInMultipartDefect(MessageDefect): ... +class StartBoundaryNotFoundDefect(MessageDefect): ... +class FirstHeaderLineIsContinuationDefect(MessageDefect): ... +class MisplacedEnvelopeHeaderDefect(MessageDefect): ... +class MalformedHeaderDefect(MessageDefect): ... +class MultipartInvariantViolationDefect(MessageDefect): ... +class InvalidBase64PaddingDefect(MessageDefect): ... +class InvalidBase64CharactersDefect(MessageDefect): ... +class CloseBoundaryNotFoundDefect(MessageDefect): ... +class MissingHeaderBodySeparatorDefect(MessageDefect): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/email/feedparser.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/email/feedparser.pyi new file mode 100644 index 0000000..48d940b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/email/feedparser.pyi @@ -0,0 +1,18 @@ +# Stubs for email.feedparser (Python 3.4) + +from typing import Callable +import sys +from email.message import Message +from email.policy import Policy + +class FeedParser: + def __init__(self, _factory: Callable[[], Message] = ..., *, + policy: Policy = ...) -> None: ... + def feed(self, data: str) -> None: ... + def close(self) -> Message: ... + +class BytesFeedParser: + def __init__(self, _factory: Callable[[], Message] = ..., *, + policy: Policy = ...) -> None: ... + def feed(self, data: str) -> None: ... + def close(self) -> Message: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/email/generator.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/email/generator.pyi new file mode 100644 index 0000000..81e733b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/email/generator.pyi @@ -0,0 +1,27 @@ +# Stubs for email.generator (Python 3.4) + +from typing import TextIO, Optional +from email.message import Message +from email.policy import Policy + +class Generator: + def clone(self, fp: TextIO) -> Generator: ... + def write(self, s: str) -> None: ... + def __init__(self, outfp: TextIO, mangle_from_: bool = ..., + maxheaderlen: int = ..., *, + policy: Policy = ...) -> None: ... + def flatten(self, msg: Message, unixfrom: bool = ..., + linesep: Optional[str] = ...) -> None: ... + +class BytesGenerator: + def clone(self, fp: TextIO) -> Generator: ... + def write(self, s: str) -> None: ... + def __init__(self, outfp: TextIO, mangle_from_: bool = ..., + maxheaderlen: int = ..., *, + policy: Policy = ...) -> None: ... + def flatten(self, msg: Message, unixfrom: bool = ..., + linesep: Optional[str] = ...) -> None: ... + +class DecodedGenerator(Generator): + def __init__(self, outfp: TextIO, mangle_from_: bool = ..., + maxheaderlen: int = ..., *, fmt: Optional[str] = ...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/email/header.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/email/header.pyi new file mode 100644 index 0000000..21b9995 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/email/header.pyi @@ -0,0 +1,25 @@ +# Stubs for email.header (Python 3.4) + +from typing import Union, Optional, Any, List, Tuple +from email.charset import Charset + +class Header: + def __init__(self, s: Union[bytes, str, None] = ..., + charset: Union[Charset, str, None] = ..., + maxlinelen: Optional[int] = ..., + header_name: Optional[str] = ..., continuation_ws: str = ..., + errors: str = ...) -> None: ... + def append(self, s: Union[bytes, str], + charset: Union[Charset, str, None] = ..., + errors: str = ...) -> None: ... + def encode(self, splitchars: str = ..., maxlinelen: Optional[int] = ..., + linesep: str = ...) -> str: ... + def __str__(self) -> str: ... + def __eq__(self, other: Any) -> bool: ... + def __ne__(self, other: Any) -> bool: ... + +def decode_header(header: Union[Header, str]) -> List[Tuple[bytes, Optional[str]]]: ... +def make_header(decoded_seq: List[Tuple[bytes, Optional[str]]], + maxlinelen: Optional[int] = ..., + header_name: Optional[str] = ..., + continuation_ws: str = ...) -> Header: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/email/headerregistry.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/email/headerregistry.pyi new file mode 100644 index 0000000..6af1abf --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/email/headerregistry.pyi @@ -0,0 +1,97 @@ +# Stubs for email.headerregistry (Python 3.4) + +from datetime import datetime as _datetime +from typing import Dict, Tuple, Optional, Any, Union, Mapping +from email.errors import MessageDefect +from email.policy import Policy + +class BaseHeader(str): + @property + def name(self) -> str: ... + @property + def defects(self) -> Tuple[MessageDefect, ...]: ... + @property + def max_count(self) -> Optional[int]: ... + def __new__(cls, name: str, value: Any) -> BaseHeader: ... + def init(self, *args: Any, **kw: Any) -> None: ... + def fold(self, *, policy: Policy) -> str: ... + +class UnstructuredHeader: + @classmethod + def parse(cls, string: str, kwds: Dict[str, Any]) -> None: ... + +class UniqueUnstructuredHeader(UnstructuredHeader): ... + +class DateHeader: + datetime: _datetime + @classmethod + def parse(cls, string: Union[str, _datetime], + kwds: Dict[str, Any]) -> None: ... + +class UniqueDateHeader(DateHeader): ... + +class AddressHeader: + groups: Tuple[Group, ...] + addresses: Tuple[Address, ...] + @classmethod + def parse(cls, string: str, kwds: Dict[str, Any]) -> None: ... + +class UniqueAddressHeader(AddressHeader): ... + +class SingleAddressHeader(AddressHeader): + @property + def address(self) -> Address: ... + +class UniqueSingleAddressHeader(SingleAddressHeader): ... + +class MIMEVersionHeader: + version: Optional[str] + major: Optional[int] + minor: Optional[int] + @classmethod + def parse(cls, string: str, kwds: Dict[str, Any]) -> None: ... + +class ParameterizedMIMEHeader: + params: Mapping[str, Any] + @classmethod + def parse(cls, string: str, kwds: Dict[str, Any]) -> None: ... + +class ContentTypeHeader(ParameterizedMIMEHeader): + content_type: str + maintype: str + subtype: str + +class ContentDispositionHeader(ParameterizedMIMEHeader): + content_disposition: str + +class ContentTransferEncodingHeader: + cte: str + @classmethod + def parse(cls, string: str, kwds: Dict[str, Any]) -> None: ... + +class HeaderRegistry: + def __init__(self, base_class: BaseHeader = ..., + default_class: BaseHeader = ..., + use_default_map: bool = ...) -> None: ... + def map_to_type(self, name: str, cls: BaseHeader) -> None: ... + def __getitem__(self, name: str) -> BaseHeader: ... + def __call__(self, name: str, value: Any) -> BaseHeader: ... + +class Address: + display_name: str + username: str + domain: str + @property + def addr_spec(self) -> str: ... + def __init__(self, display_name: str = ..., + username: Optional[str] = ..., + domain: Optional[str] = ..., + addr_spec: Optional[str] = ...) -> None: ... + def __str__(self) -> str: ... + +class Group: + display_name: Optional[str] + addresses: Tuple[Address, ...] + def __init__(self, display_name: Optional[str] = ..., + addresses: Optional[Tuple[Address, ...]] = ...) -> None: ... + def __str__(self) -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/email/iterators.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/email/iterators.pyi new file mode 100644 index 0000000..6a69f39 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/email/iterators.pyi @@ -0,0 +1,8 @@ +# Stubs for email.iterators (Python 3.4) + +from typing import Iterator, Optional +from email.message import Message + +def body_line_iterator(msg: Message, decode: bool = ...) -> Iterator[str]: ... +def typed_subpart_iterator(msg: Message, maintype: str = ..., + subtype: Optional[str] = ...) -> Iterator[str]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/email/message.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/email/message.pyi new file mode 100644 index 0000000..09fbdda --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/email/message.pyi @@ -0,0 +1,105 @@ +# Stubs for email.message (Python 3.4) + +from typing import ( + List, Optional, Union, Tuple, TypeVar, Generator, Sequence, Iterator, Any +) +import sys +from email.charset import Charset +from email.errors import MessageDefect +from email.header import Header +from email.policy import Policy +from email.contentmanager import ContentManager + +_T = TypeVar('_T') + +_PayloadType = Union[List[Message], str, bytes] +_CharsetType = Union[Charset, str, None] +_ParamsType = Union[str, None, Tuple[str, Optional[str], str]] +_ParamType = Union[str, Tuple[Optional[str], Optional[str], str]] +_HeaderType = Union[str, Header] + +class Message: + preamble: Optional[str] + epilogue: Optional[str] + defects: List[MessageDefect] + def __str__(self) -> str: ... + def is_multipart(self) -> bool: ... + def set_unixfrom(self, unixfrom: str) -> None: ... + def get_unixfrom(self) -> Optional[str]: ... + def attach(self, payload: Message) -> None: ... + def get_payload(self, i: int = ..., decode: bool = ...) -> Optional[_PayloadType]: ... + def set_payload(self, payload: _PayloadType, + charset: _CharsetType = ...) -> None: ... + def set_charset(self, charset: _CharsetType) -> None: ... + def get_charset(self) -> _CharsetType: ... + def __len__(self) -> int: ... + def __contains__(self, name: str) -> bool: ... + def __getitem__(self, name: str) -> Optional[_HeaderType]: ... + def __setitem__(self, name: str, val: _HeaderType) -> None: ... + def __delitem__(self, name: str) -> None: ... + def keys(self) -> List[str]: ... + def values(self) -> List[_HeaderType]: ... + def items(self) -> List[Tuple[str, _HeaderType]]: ... + def get(self, name: str, failobj: _T = ...) -> Union[_HeaderType, _T]: ... + def get_all(self, name: str, failobj: _T = ...) -> Union[List[_HeaderType], _T]: ... + def add_header(self, _name: str, _value: str, **_params: _ParamsType) -> None: ... + def replace_header(self, _name: str, _value: _HeaderType) -> None: ... + def get_content_type(self) -> str: ... + def get_content_maintype(self) -> str: ... + def get_content_subtype(self) -> str: ... + def get_default_type(self) -> str: ... + def set_default_type(self, ctype: str) -> None: ... + def get_params(self, failobj: _T = ..., header: str = ..., + unquote: bool = ...) -> Union[List[Tuple[str, str]], _T]: ... + def get_param(self, param: str, failobj: _T = ..., header: str = ..., + unquote: bool = ...) -> Union[_T, _ParamType]: ... + def del_param(self, param: str, header: str = ..., + requote: bool = ...) -> None: ... + def set_type(self, type: str, header: str = ..., + requote: bool = ...) -> None: ... + def get_filename(self, failobj: _T = ...) -> Union[_T, str]: ... + def get_boundary(self, failobj: _T = ...) -> Union[_T, str]: ... + def set_boundary(self, boundary: str) -> None: ... + def get_content_charset(self, failobj: _T = ...) -> Union[_T, str]: ... + def get_charsets(self, failobj: _T = ...) -> Union[_T, List[str]]: ... + def walk(self) -> Generator[Message, None, None]: ... + if sys.version_info >= (3, 5): + def get_content_disposition(self) -> Optional[str]: ... + def as_string(self, unixfrom: bool = ..., maxheaderlen: int = ..., + policy: Optional[Policy] = ...) -> str: ... + def as_bytes(self, unixfrom: bool = ..., + policy: Optional[Policy] = ...) -> bytes: ... + def __bytes__(self) -> bytes: ... + def set_param(self, param: str, value: str, header: str = ..., + requote: bool = ..., charset: str = ..., + language: str = ..., replace: bool = ...) -> None: ... + def __init__(self, policy: Policy = ...) -> None: ... + +class MIMEPart(Message): + def get_body(self, + preferencelist: Sequence[str] = ...) -> Optional[Message]: ... + def iter_attachments(self) -> Iterator[Message]: ... + def iter_parts(self) -> Iterator[Message]: ... + def get_content(self, *args: Any, + content_manager: Optional[ContentManager] = ..., + **kw: Any) -> Any: ... + def set_content(self, *args: Any, + content_manager: Optional[ContentManager] = ..., + **kw: Any) -> None: ... + def make_related(self, boundary: Optional[str] = ...) -> None: ... + def make_alternative(self, boundary: Optional[str] = ...) -> None: ... + def make_mixed(self, boundary: Optional[str] = ...) -> None: ... + def add_related(self, *args: Any, + content_manager: Optional[ContentManager] = ..., + **kw: Any) -> None: ... + def add_alternative(self, *args: Any, + content_manager: Optional[ContentManager] = ..., + **kw: Any) -> None: ... + def add_attachment(self, *args: Any, + content_manager: Optional[ContentManager] = ..., + **kw: Any) -> None: ... + def clear(self) -> None: ... + def clear_content(self) -> None: ... + def is_attachment(self) -> bool: ... + +class EmailMessage(MIMEPart): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/email/mime/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/email/mime/__init__.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/email/mime/application.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/email/mime/application.pyi new file mode 100644 index 0000000..1a40e28 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/email/mime/application.pyi @@ -0,0 +1,11 @@ +# Stubs for email.mime.application (Python 3.4) + +from typing import Callable, Optional, Tuple, Union +from email.mime.nonmultipart import MIMENonMultipart + +_ParamsType = Union[str, None, Tuple[str, Optional[str], str]] + +class MIMEApplication(MIMENonMultipart): + def __init__(self, _data: Union[str, bytes], _subtype: str = ..., + _encoder: Callable[[MIMEApplication], None] = ..., + **_params: _ParamsType) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/email/mime/audio.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/email/mime/audio.pyi new file mode 100644 index 0000000..5bb57d3 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/email/mime/audio.pyi @@ -0,0 +1,11 @@ +# Stubs for email.mime.audio (Python 3.4) + +from typing import Callable, Optional, Tuple, Union +from email.mime.nonmultipart import MIMENonMultipart + +_ParamsType = Union[str, None, Tuple[str, Optional[str], str]] + +class MIMEAudio(MIMENonMultipart): + def __init__(self, _audiodata: Union[str, bytes], _subtype: Optional[str] = ..., + _encoder: Callable[[MIMEAudio], None] = ..., + **_params: _ParamsType) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/email/mime/base.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/email/mime/base.pyi new file mode 100644 index 0000000..448d34b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/email/mime/base.pyi @@ -0,0 +1,10 @@ +# Stubs for email.mime.base (Python 3.4) + +from typing import Optional, Tuple, Union +import email.message + +_ParamsType = Union[str, None, Tuple[str, Optional[str], str]] + +class MIMEBase(email.message.Message): + def __init__(self, _maintype: str, _subtype: str, + **_params: _ParamsType) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/email/mime/image.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/email/mime/image.pyi new file mode 100644 index 0000000..d32d9ee --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/email/mime/image.pyi @@ -0,0 +1,11 @@ +# Stubs for email.mime.image (Python 3.4) + +from typing import Callable, Optional, Tuple, Union +from email.mime.nonmultipart import MIMENonMultipart + +_ParamsType = Union[str, None, Tuple[str, Optional[str], str]] + +class MIMEImage(MIMENonMultipart): + def __init__(self, _imagedata: Union[str, bytes], _subtype: Optional[str] = ..., + _encoder: Callable[[MIMEImage], None] = ..., + **_params: _ParamsType) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/email/mime/message.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/email/mime/message.pyi new file mode 100644 index 0000000..561e8c3 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/email/mime/message.pyi @@ -0,0 +1,7 @@ +# Stubs for email.mime.message (Python 3.4) + +from email.message import Message +from email.mime.nonmultipart import MIMENonMultipart + +class MIMEMessage(MIMENonMultipart): + def __init__(self, _msg: Message, _subtype: str = ...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/email/mime/multipart.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/email/mime/multipart.pyi new file mode 100644 index 0000000..ea5eba1 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/email/mime/multipart.pyi @@ -0,0 +1,12 @@ +# Stubs for email.mime.multipart (Python 3.4) + +from typing import Optional, Sequence, Tuple, Union +from email.message import Message +from email.mime.base import MIMEBase + +_ParamsType = Union[str, None, Tuple[str, Optional[str], str]] + +class MIMEMultipart(MIMEBase): + def __init__(self, _subtype: str = ..., boundary: Optional[str] = ..., + _subparts: Optional[Sequence[Message]] = ..., + **_params: _ParamsType) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/email/mime/nonmultipart.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/email/mime/nonmultipart.pyi new file mode 100644 index 0000000..1fd3ea9 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/email/mime/nonmultipart.pyi @@ -0,0 +1,5 @@ +# Stubs for email.mime.nonmultipart (Python 3.4) + +from email.mime.base import MIMEBase + +class MIMENonMultipart(MIMEBase): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/email/mime/text.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/email/mime/text.pyi new file mode 100644 index 0000000..73adaf5 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/email/mime/text.pyi @@ -0,0 +1,8 @@ +# Stubs for email.mime.text (Python 3.4) + +from typing import Optional +from email.mime.nonmultipart import MIMENonMultipart + +class MIMEText(MIMENonMultipart): + def __init__(self, _text: str, _subtype: str = ..., + _charset: Optional[str] = ...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/email/parser.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/email/parser.pyi new file mode 100644 index 0000000..180e382 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/email/parser.pyi @@ -0,0 +1,33 @@ +# Stubs for email.parser (Python 3.4) + +import email.feedparser +from email.message import Message +from email.policy import Policy +from typing import BinaryIO, Callable, Optional, TextIO + +FeedParser = email.feedparser.FeedParser +BytesFeedParser = email.feedparser.BytesFeedParser + +class Parser: + def __init__(self, _class: Callable[[], Message] = ..., *, + policy: Policy = ...) -> None: ... + def parse(self, fp: TextIO, headersonly: bool = ...) -> Message: ... + def parsestr(self, text: str, headersonly: bool = ...) -> Message: ... + +class HeaderParser(Parser): + def __init__(self, _class: Callable[[], Message] = ..., *, + policy: Policy = ...) -> None: ... + def parse(self, fp: TextIO, headersonly: bool = ...) -> Message: ... + def parsestr(self, text: str, headersonly: bool = ...) -> Message: ... + +class BytesHeaderParser(BytesParser): + def __init__(self, _class: Callable[[], Message] = ..., *, + policy: Policy = ...) -> None: ... + def parse(self, fp: BinaryIO, headersonly: bool = ...) -> Message: ... + def parsebytes(self, text: bytes, headersonly: bool = ...) -> Message: ... + +class BytesParser: + def __init__(self, _class: Callable[[], Message] = ..., *, + policy: Policy = ...) -> None: ... + def parse(self, fp: BinaryIO, headersonly: bool = ...) -> Message: ... + def parsebytes(self, text: bytes, headersonly: bool = ...) -> Message: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/email/policy.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/email/policy.pyi new file mode 100644 index 0000000..e47e643 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/email/policy.pyi @@ -0,0 +1,64 @@ +# Stubs for email.policy (Python 3.4) + +from abc import abstractmethod +from typing import Any, List, Optional, Tuple, Union, Callable +import sys +from email.message import Message +from email.errors import MessageDefect +from email.header import Header +from email.contentmanager import ContentManager + +class Policy: + max_line_length: Optional[int] + linesep: str + cte_type: str + raise_on_defect: bool + if sys.version_info >= (3, 5): + mange_from: bool + def __init__(self, **kw: Any) -> None: ... + def clone(self, **kw: Any) -> Policy: ... + def handle_defect(self, obj: Message, + defect: MessageDefect) -> None: ... + def register_defect(self, obj: Message, + defect: MessageDefect) -> None: ... + def header_max_count(self, name: str) -> Optional[int]: ... + @abstractmethod + def header_source_parse(self, sourcelines: List[str]) -> str: ... + @abstractmethod + def header_store_parse(self, name: str, + value: str) -> Tuple[str, str]: ... + @abstractmethod + def header_fetch_parse(self, name: str, + value: str) -> str: ... + @abstractmethod + def fold(self, name: str, value: str) -> str: ... + @abstractmethod + def fold_binary(self, name: str, value: str) -> bytes: ... + +class Compat32(Policy): + def header_source_parse(self, sourcelines: List[str]) -> str: ... + def header_store_parse(self, name: str, + value: str) -> Tuple[str, str]: ... + def header_fetch_parse(self, name: str, value: str) -> Union[str, Header]: ... # type: ignore + def fold(self, name: str, value: str) -> str: ... + def fold_binary(self, name: str, value: str) -> bytes: ... + +compat32: Compat32 + +class EmailPolicy(Policy): + utf8: bool + refold_source: str + header_factory: Callable[[str, str], str] + content_manager: ContentManager + def header_source_parse(self, sourcelines: List[str]) -> str: ... + def header_store_parse(self, name: str, + value: str) -> Tuple[str, str]: ... + def header_fetch_parse(self, name: str, value: str) -> str: ... + def fold(self, name: str, value: str) -> str: ... + def fold_binary(self, name: str, value: str) -> bytes: ... + +default: EmailPolicy +SMTP: EmailPolicy +SMTPUTF8: EmailPolicy +HTTP: EmailPolicy +strict: EmailPolicy diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/email/utils.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/email/utils.pyi new file mode 100644 index 0000000..6c0a183 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/email/utils.pyi @@ -0,0 +1,33 @@ +# Stubs for email.utils (Python 3.4) + +from typing import List, Optional, Tuple, Union +from email.charset import Charset +import datetime + +_ParamType = Union[str, Tuple[Optional[str], Optional[str], str]] +_PDTZ = Tuple[int, int, int, int, int, int, int, int, int, Optional[int]] + +def quote(str: str) -> str: ... +def unquote(str: str) -> str: ... +def parseaddr(address: Optional[str]) -> Tuple[str, str]: ... +def formataddr(pair: Tuple[Optional[str], str], + charset: Union[str, Charset] = ...) -> str: ... +def getaddresses(fieldvalues: List[str]) -> List[Tuple[str, str]]: ... +def parsedate(date: str) -> Optional[Tuple[int, int, int, int, int, int, int, int, int]]: ... +def parsedate_tz(date: str) -> Optional[_PDTZ]: ... +def parsedate_to_datetime(date: str) -> datetime.datetime: ... +def mktime_tz(tuple: _PDTZ) -> int: ... +def formatdate(timeval: Optional[float] = ..., localtime: bool = ..., + usegmt: bool = ...) -> str: ... +def format_datetime(dt: datetime.datetime, usegmt: bool = ...) -> str: ... +def localtime(dt: Optional[datetime.datetime] = ...) -> datetime.datetime: ... +def make_msgid(idstring: Optional[str] = ..., + domain: Optional[str] = ...) -> str: ... +def decode_rfc2231(s: str) -> Tuple[Optional[str], Optional[str], str]: ... +def encode_rfc2231(s: str, charset: Optional[str] = ..., + language: Optional[str] = ...) -> str: ... +def collapse_rfc2231_value(value: _ParamType, errors: str = ..., + fallback_charset: str = ...) -> str: ... +def decode_params( + params: List[Tuple[str, str]] +) -> List[Tuple[str, _ParamType]]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/encodings/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/encodings/__init__.pyi new file mode 100644 index 0000000..2ae6c0a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/encodings/__init__.pyi @@ -0,0 +1,6 @@ +import codecs + +import typing + +def search_function(encoding: str) -> codecs.CodecInfo: + ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/encodings/utf_8.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/encodings/utf_8.pyi new file mode 100644 index 0000000..d38bd58 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/encodings/utf_8.pyi @@ -0,0 +1,15 @@ +import codecs +from typing import Text, Tuple + +class IncrementalEncoder(codecs.IncrementalEncoder): + def encode(self, input: Text, final: bool = ...) -> bytes: ... + +class IncrementalDecoder(codecs.BufferedIncrementalDecoder): + def _buffer_decode(self, input: bytes, errors: str, final: bool) -> Tuple[Text, int]: ... + +class StreamWriter(codecs.StreamWriter): ... +class StreamReader(codecs.StreamReader): ... + +def getregentry() -> codecs.CodecInfo: ... +def encode(input: Text, errors: Text = ...) -> bytes: ... +def decode(input: bytes, errors: Text = ...) -> Text: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/enum.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/enum.pyi new file mode 100644 index 0000000..703c7cf --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/enum.pyi @@ -0,0 +1,77 @@ +# NB: third_party/2/enum.pyi and stdlib/3.4/enum.pyi must remain consistent! +import sys +from typing import Any, Dict, Iterator, List, Mapping, Type, TypeVar, Union +from abc import ABCMeta + +_T = TypeVar('_T') +_S = TypeVar('_S', bound=Type[Enum]) + +# Note: EnumMeta actually subclasses type directly, not ABCMeta. +# This is a temporary workaround to allow multiple creation of enums with builtins +# such as str as mixins, which due to the handling of ABCs of builtin types, cause +# spurious inconsistent metaclass structure. See #1595. +# Structurally: Iterable[T], Reversible[T], Container[T] where T is the enum itself +class EnumMeta(ABCMeta): + def __iter__(self: Type[_T]) -> Iterator[_T]: ... + def __reversed__(self: Type[_T]) -> Iterator[_T]: ... + def __contains__(self: Type[_T], member: object) -> bool: ... + def __getitem__(self: Type[_T], name: str) -> _T: ... + @property + def __members__(self: Type[_T]) -> Mapping[str, _T]: ... + def __len__(self) -> int: ... + +class Enum(metaclass=EnumMeta): + name: str + value: Any + _name_: str + _value_: Any + _member_names_: List[str] # undocumented + _member_map_: Dict[str, Enum] # undocumented + _value2member_map_: Dict[int, Enum] # undocumented + if sys.version_info >= (3, 7): + _ignore_: Union[str, List[str]] + if sys.version_info >= (3, 6): + _order_: str + @classmethod + def _missing_(cls, value: object) -> Any: ... + @staticmethod + def _generate_next_value_(name: str, start: int, count: int, last_values: List[Any]) -> Any: ... + def __new__(cls: Type[_T], value: object) -> _T: ... + def __repr__(self) -> str: ... + def __str__(self) -> str: ... + def __dir__(self) -> List[str]: ... + def __format__(self, format_spec: str) -> str: ... + def __hash__(self) -> Any: ... + def __reduce_ex__(self, proto: object) -> Any: ... + +class IntEnum(int, Enum): + value: int + +def unique(enumeration: _S) -> _S: ... + +if sys.version_info >= (3, 6): + _auto_null: Any + + # subclassing IntFlag so it picks up all implemented base functions, best modeling behavior of enum.auto() + class auto(IntFlag): + value: Any + + class Flag(Enum): + def __contains__(self: _T, other: _T) -> bool: ... + def __repr__(self) -> str: ... + def __str__(self) -> str: ... + def __bool__(self) -> bool: ... + def __or__(self: _T, other: _T) -> _T: ... + def __and__(self: _T, other: _T) -> _T: ... + def __xor__(self: _T, other: _T) -> _T: ... + def __invert__(self: _T) -> _T: ... + + # The `type: ignore` comment is needed because mypy considers the type + # signatures of several methods defined in int and Flag to be incompatible. + class IntFlag(int, Flag): # type: ignore + def __or__(self: _T, other: Union[int, _T]) -> _T: ... + def __and__(self: _T, other: Union[int, _T]) -> _T: ... + def __xor__(self: _T, other: Union[int, _T]) -> _T: ... + __ror__ = __or__ + __rand__ = __and__ + __rxor__ = __xor__ diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/faulthandler.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/faulthandler.pyi new file mode 100644 index 0000000..1a87c9c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/faulthandler.pyi @@ -0,0 +1,23 @@ +import sys +from typing import Union, Protocol + + +class _HasFileno(Protocol): + def fileno(self) -> int: ... + + +if sys.version_info >= (3, 5): + _File = Union[_HasFileno, int] +else: + _File = _HasFileno + + +def cancel_dump_traceback_later() -> None: ... +def disable() -> None: ... +def dump_traceback(file: _File = ..., all_threads: bool = ...) -> None: ... +def dump_traceback_later(timeout: int, repeat: bool = ..., file: _File = ..., exit: bool = ...) -> None: ... +def enable(file: _File = ..., all_threads: bool = ...) -> None: ... +def is_enabled() -> bool: ... +if sys.platform != "win32": + def register(signum: int, file: _File = ..., all_threads: bool = ..., chain: bool = ...) -> None: ... + def unregister(signum: int) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/fcntl.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/fcntl.pyi new file mode 100644 index 0000000..fdcb4fc --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/fcntl.pyi @@ -0,0 +1,96 @@ +# Stubs for fcntl +from io import IOBase +from typing import Any, IO, Union + +FASYNC: int +FD_CLOEXEC: int +DN_ACCESS: int +DN_ATTRIB: int +DN_CREATE: int +DN_DELETE: int +DN_MODIFY: int +DN_MULTISHOT: int +DN_RENAME: int +F_DUPFD: int +F_DUPFD_CLOEXEC: int +F_FULLFSYNC: int +F_EXLCK: int +F_GETFD: int +F_GETFL: int +F_GETLEASE: int +F_GETLK: int +F_GETLK64: int +F_GETOWN: int +F_NOCACHE: int +F_GETSIG: int +F_NOTIFY: int +F_RDLCK: int +F_SETFD: int +F_SETFL: int +F_SETLEASE: int +F_SETLK: int +F_SETLK64: int +F_SETLKW: int +F_SETLKW64: int +F_SETOWN: int +F_SETSIG: int +F_SHLCK: int +F_UNLCK: int +F_WRLCK: int +I_ATMARK: int +I_CANPUT: int +I_CKBAND: int +I_FDINSERT: int +I_FIND: int +I_FLUSH: int +I_FLUSHBAND: int +I_GETBAND: int +I_GETCLTIME: int +I_GETSIG: int +I_GRDOPT: int +I_GWROPT: int +I_LINK: int +I_LIST: int +I_LOOK: int +I_NREAD: int +I_PEEK: int +I_PLINK: int +I_POP: int +I_PUNLINK: int +I_PUSH: int +I_RECVFD: int +I_SENDFD: int +I_SETCLTIME: int +I_SETSIG: int +I_SRDOPT: int +I_STR: int +I_SWROPT: int +I_UNLINK: int +LOCK_EX: int +LOCK_MAND: int +LOCK_NB: int +LOCK_READ: int +LOCK_RW: int +LOCK_SH: int +LOCK_UN: int +LOCK_WRITE: int + +_AnyFile = Union[int, IO[Any], IOBase] + +# TODO All these return either int or bytes depending on the value of +# cmd (not on the type of arg). +def fcntl(fd: _AnyFile, + cmd: int, + arg: Union[int, bytes] = ...) -> Any: ... +# TODO This function accepts any object supporting a buffer interface, +# as arg, is there a better way to express this than bytes? +def ioctl(fd: _AnyFile, + request: int, + arg: Union[int, bytes] = ..., + mutate_flag: bool = ...) -> Any: ... +def flock(fd: _AnyFile, operation: int) -> None: ... +def lockf(fd: _AnyFile, + cmd: int, + len: int = ..., + start: int = ..., + whence: int = ...) -> Any: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/fnmatch.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/fnmatch.pyi new file mode 100644 index 0000000..4f99b4a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/fnmatch.pyi @@ -0,0 +1,11 @@ +# Stubs for fnmatch + +# Based on http://docs.python.org/3.2/library/fnmatch.html and +# python-lib/fnmatch.py + +from typing import Iterable, List, AnyStr + +def fnmatch(name: AnyStr, pat: AnyStr) -> bool: ... +def fnmatchcase(name: AnyStr, pat: AnyStr) -> bool: ... +def filter(names: Iterable[AnyStr], pat: AnyStr) -> List[AnyStr]: ... +def translate(pat: str) -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/functools.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/functools.pyi new file mode 100644 index 0000000..409e84b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/functools.pyi @@ -0,0 +1,143 @@ +import sys +from typing import Any, Callable, Generic, Dict, Iterable, Mapping, Optional, Sequence, Tuple, Type, TypeVar, NamedTuple, Union, overload + +_AnyCallable = Callable[..., Any] + +_T = TypeVar("_T") +_T2 = TypeVar("_T2") +_T3 = TypeVar("_T3") +_T4 = TypeVar("_T4") +_T5 = TypeVar("_T5") +_S = TypeVar("_S") +@overload +def reduce(function: Callable[[_T, _S], _T], + sequence: Iterable[_S], initial: _T) -> _T: ... +@overload +def reduce(function: Callable[[_T, _T], _T], + sequence: Iterable[_T]) -> _T: ... + + +class _CacheInfo(NamedTuple('CacheInfo', [ + ('hits', int), + ('misses', int), + ('maxsize', int), + ('currsize', int) +])): ... + +class _lru_cache_wrapper(Generic[_T]): + __wrapped__: Callable[..., _T] + def __call__(self, *args: Any, **kwargs: Any) -> _T: ... + def cache_info(self) -> _CacheInfo: ... + def cache_clear(self) -> None: ... + +class lru_cache(): + def __init__(self, maxsize: Optional[int] = ..., typed: bool = ...) -> None: ... + def __call__(self, f: Callable[..., _T]) -> _lru_cache_wrapper[_T]: ... + + +WRAPPER_ASSIGNMENTS: Sequence[str] +WRAPPER_UPDATES: Sequence[str] + +def update_wrapper(wrapper: _AnyCallable, wrapped: _AnyCallable, assigned: Sequence[str] = ..., + updated: Sequence[str] = ...) -> _AnyCallable: ... +def wraps(wrapped: _AnyCallable, assigned: Sequence[str] = ..., updated: Sequence[str] = ...) -> Callable[[_AnyCallable], _AnyCallable]: ... +def total_ordering(cls: type) -> type: ... +def cmp_to_key(mycmp: Callable[[_T, _T], int]) -> Callable[[_T], Any]: ... + +@overload +def partial(__func: Callable[[_T], _S], __arg: _T) -> Callable[[], _S]: ... +@overload +def partial(__func: Callable[[_T, _T2], _S], __arg: _T) -> Callable[[_T2], _S]: ... +@overload +def partial(__func: Callable[[_T, _T2, _T3], _S], __arg: _T) -> Callable[[_T2, _T3], _S]: ... +@overload +def partial(__func: Callable[[_T, _T2, _T3, _T4], _S], __arg: _T) -> Callable[[_T2, _T3, _T4], _S]: ... +@overload +def partial(__func: Callable[[_T, _T2, _T3, _T4, _T5], _S], __arg: _T) -> Callable[[_T2, _T3, _T4, _T5], _S]: ... + +@overload +def partial(__func: Callable[[_T, _T2], _S], + __arg1: _T, + __arg2: _T2) -> Callable[[], _S]: ... +@overload +def partial(__func: Callable[[_T, _T2, _T3], _S], + __arg1: _T, + __arg2: _T2) -> Callable[[_T3], _S]: ... +@overload +def partial(__func: Callable[[_T, _T2, _T3, _T4], _S], + __arg1: _T, + __arg2: _T2) -> Callable[[_T3, _T4], _S]: ... +@overload +def partial(__func: Callable[[_T, _T2, _T3, _T4, _T5], _S], + __arg1: _T, + __arg2: _T2) -> Callable[[_T3, _T4, _T5], _S]: ... + +@overload +def partial(__func: Callable[[_T, _T2, _T3], _S], + __arg1: _T, + __arg2: _T2, + __arg3: _T3) -> Callable[[], _S]: ... +@overload +def partial(__func: Callable[[_T, _T2, _T3, _T4], _S], + __arg1: _T, + __arg2: _T2, + __arg3: _T3) -> Callable[[_T4], _S]: ... +@overload +def partial(__func: Callable[[_T, _T2, _T3, _T4, _T5], _S], + __arg1: _T, + __arg2: _T2, + __arg3: _T3) -> Callable[[_T4, _T5], _S]: ... + +@overload +def partial(__func: Callable[[_T, _T2, _T3, _T4], _S], + __arg1: _T, + __arg2: _T2, + __arg3: _T3, + __arg4: _T4) -> Callable[[], _S]: ... +@overload +def partial(__func: Callable[[_T, _T2, _T3, _T4, _T5], _S], + __arg1: _T, + __arg2: _T2, + __arg3: _T3, + __arg4: _T4) -> Callable[[_T5], _S]: ... + +@overload +def partial(__func: Callable[[_T, _T2, _T3, _T4, _T5], _S], + __arg1: _T, + __arg2: _T2, + __arg3: _T3, + __arg4: _T4, + __arg5: _T5) -> Callable[[], _S]: ... + +@overload +def partial(__func: Callable[..., _S], + *args: Any, + **kwargs: Any) -> Callable[..., _S]: ... + +# With protocols, this could change into a generic protocol that defines __get__ and returns _T +_Descriptor = Any + +class partialmethod(Generic[_T]): + func: Union[Callable[..., _T], _Descriptor] + args: Tuple[Any, ...] + keywords: Dict[str, Any] + + @overload + def __init__(self, func: Callable[..., _T], *args: Any, **keywords: Any) -> None: ... + @overload + def __init__(self, func: _Descriptor, *args: Any, **keywords: Any) -> None: ... + def __get__(self, obj: Any, cls: Type[Any]) -> Callable[..., _T]: ... + @property + def __isabstractmethod__(self) -> bool: ... + +class _SingleDispatchCallable(Generic[_T]): + registry: Mapping[Any, Callable[..., _T]] + def dispatch(self, cls: Any) -> Callable[..., _T]: ... + @overload + def register(self, cls: Any) -> Callable[[Callable[..., _T]], Callable[..., _T]]: ... + @overload + def register(self, cls: Any, func: Callable[..., _T]) -> Callable[..., _T]: ... + def _clear_cache(self) -> None: ... + def __call__(self, *args: Any, **kwargs: Any) -> _T: ... + +def singledispatch(func: Callable[..., _T]) -> _SingleDispatchCallable[_T]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/gc.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/gc.pyi new file mode 100644 index 0000000..d4bb109 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/gc.pyi @@ -0,0 +1,28 @@ +# Stubs for gc + +from typing import Any, Dict, List, Tuple + + +DEBUG_COLLECTABLE: int +DEBUG_LEAK: int +DEBUG_SAVEALL: int +DEBUG_STATS: int +DEBUG_UNCOLLECTABLE: int +callbacks: List[Any] +garbage: List[Any] + +def collect(generations: int = ...) -> int: ... +def disable() -> None: ... +def enable() -> None: ... +def get_count() -> Tuple[int, int, int]: ... +def get_debug() -> int: ... +def get_objects() -> List[Any]: ... +def get_referents(*objs: Any) -> List[Any]: ... +def get_referrers(*objs: Any) -> List[Any]: ... +def get_stats() -> List[Dict[str, Any]]: ... +def get_threshold() -> Tuple[int, int, int]: ... +def is_tracked(obj: Any) -> bool: ... +def isenabled() -> bool: ... +def set_debug(flags: int) -> None: ... +def set_threshold(threshold0: int, threshold1: int = ..., + threshold2: int = ...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/getopt.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/getopt.pyi new file mode 100644 index 0000000..0417a82 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/getopt.pyi @@ -0,0 +1,14 @@ +# Stubs for getopt + +# Based on http://docs.python.org/3.2/library/getopt.html + +from typing import List, Tuple + +def getopt(args: List[str], shortopts: str, longopts: List[str] = ...) -> Tuple[List[Tuple[str, str]], List[str]]: ... +def gnu_getopt(args: List[str], shortopts: str, longopts: List[str] = ...) -> Tuple[List[Tuple[str, str]], List[str]]: ... + +class GetoptError(Exception): + msg: str + opt: str + +error = GetoptError diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/getpass.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/getpass.pyi new file mode 100644 index 0000000..55a8433 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/getpass.pyi @@ -0,0 +1,12 @@ +# Stubs for getpass + +from typing import Optional, TextIO + + +def getpass(prompt: str = ..., stream: Optional[TextIO] = ...) -> str: ... + + +def getuser() -> str: ... + + +class GetPassWarning(UserWarning): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/gettext.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/gettext.pyi new file mode 100644 index 0000000..eeb9b09 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/gettext.pyi @@ -0,0 +1,44 @@ +# Stubs for gettext (Python 3.4) + +from typing import Any, IO, List, Optional, Union, Callable + +class NullTranslations: + def __init__(self, fp: IO[str] = ...) -> None: ... + def add_fallback(self, fallback: NullTranslations) -> None: ... + def gettext(self, message: str) -> str: ... + def lgettext(self, message: str) -> str: ... + def ngettext(self, singular: str, plural: str, n: int) -> str: ... + def lngettext(self, singular: str, plural: str, n: int) -> str: ... + def info(self) -> Any: ... + def charset(self) -> Any: ... + def output_charset(self) -> Any: ... + def set_output_charset(self, charset: Any) -> None: ... + def install(self, names: List[str] = ...) -> None: ... + +class GNUTranslations(NullTranslations): + LE_MAGIC: int + BE_MAGIC: int + +def find(domain: str, localedir: str = ..., languages: List[str] = ..., + all: bool = ...): ... + +def translation(domain: str, localedir: str = ..., languages: List[str] = ..., + class_: Callable[[IO[str]], NullTranslations] = ..., + fallback: bool = ..., codeset: Any = ...) -> NullTranslations: ... + +def install(domain: str, localedir: str = ..., codeset: Any = ..., + names: List[str] = ...): ... + +def textdomain(domain: str = ...) -> str: ... +def bindtextdomain(domain: str, localedir: str = ...) -> str: ... +def bind_textdomain_codeset(domain: str, codeset: str = ...) -> str: ... +def dgettext(domain: str, message: str) -> str: ... +def ldgettext(domain: str, message: str) -> str: ... +def dngettext(domain: str, singular: str, plural: str, n: int) -> str: ... +def ldngettext(domain: str, singular: str, plural: str, n: int) -> str: ... +def gettext(message: str) -> str: ... +def lgettext(message: str) -> str: ... +def ngettext(singular: str, plural: str, n: int) -> str: ... +def lngettext(singular: str, plural: str, n: int) -> str: ... + +Catalog = translation diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/glob.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/glob.pyi new file mode 100644 index 0000000..22ee205 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/glob.pyi @@ -0,0 +1,23 @@ +# Stubs for glob +# Based on http://docs.python.org/3/library/glob.html + +from typing import List, Iterator, AnyStr, Union +import sys + +if sys.version_info >= (3, 6): + def glob0(dirname: AnyStr, pattern: AnyStr) -> List[AnyStr]: ... +else: + def glob0(dirname: AnyStr, basename: AnyStr) -> List[AnyStr]: ... + +def glob1(dirname: AnyStr, pattern: AnyStr) -> List[AnyStr]: ... + +if sys.version_info >= (3, 5): + def glob(pathname: AnyStr, *, recursive: bool = ...) -> List[AnyStr]: ... + def iglob(pathname: AnyStr, *, recursive: bool = ...) -> Iterator[AnyStr]: ... +else: + def glob(pathname: AnyStr) -> List[AnyStr]: ... + def iglob(pathname: AnyStr) -> Iterator[AnyStr]: ... + +def escape(pathname: AnyStr) -> AnyStr: ... + +def has_magic(s: Union[str, bytes]) -> bool: ... # undocumented diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/gzip.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/gzip.pyi new file mode 100644 index 0000000..6f1bf7a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/gzip.pyi @@ -0,0 +1,49 @@ +from typing import Any, IO, Optional +from os.path import _PathType +import _compression +import zlib + +def open(filename, mode: str = ..., compresslevel: int = ..., encoding: Optional[str] = ..., errors: Optional[str] = ..., newline: Optional[str] = ...) -> IO[Any]: ... + +class _PaddedFile: + file: IO[bytes] + def __init__(self, f: IO[bytes], prepend: bytes = ...) -> None: ... + def read(self, size: int) -> bytes: ... + def prepend(self, prepend: bytes = ...) -> None: ... + def seek(self, off: int) -> int: ... + def seekable(self) -> bool: ... + +class GzipFile(_compression.BaseStream): + myfileobj: Optional[IO[bytes]] + mode: str + name: str + compress: zlib._Compress + fileobj: IO[bytes] + def __init__(self, filename: Optional[_PathType] = ..., mode: Optional[str] = ..., compresslevel: int = ..., fileobj: Optional[IO[bytes]] = ..., mtime: Optional[float] = ...) -> None: ... + @property + def filename(self) -> str: ... + @property + def mtime(self) -> Optional[int]: ... + crc: int + def write(self, data: bytes) -> int: ... + def read(self, size: Optional[int] = ...) -> bytes: ... + def read1(self, size: int = ...) -> bytes: ... + def peek(self, n: int) -> bytes: ... + @property + def closed(self) -> bool: ... + def close(self) -> None: ... + def flush(self, zlib_mode: int = ...) -> None: ... + def fileno(self) -> int: ... + def rewind(self) -> None: ... + def readable(self) -> bool: ... + def writable(self) -> bool: ... + def seekable(self) -> bool: ... + def seek(self, offset: int, whence: int = ...) -> int: ... + def readline(self, size: int = ...) -> bytes: ... + +class _GzipReader(_compression.DecompressReader): + def __init__(self, fp: IO[bytes]) -> None: ... + def read(self, size: int = ...) -> bytes: ... + +def compress(data, compresslevel: int = ...) -> bytes: ... +def decompress(data: bytes) -> bytes: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/hashlib.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/hashlib.pyi new file mode 100644 index 0000000..616bb0f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/hashlib.pyi @@ -0,0 +1,69 @@ +# Stubs for hashlib + +import sys +from typing import AbstractSet, Optional, Union + +_DataType = Union[bytes, bytearray, memoryview] + +class _Hash(object): + digest_size: int + block_size: int + + # [Python documentation note] Changed in version 3.4: The name attribute has + # been present in CPython since its inception, but until Python 3.4 was not + # formally specified, so may not exist on some platforms + name: str + + def __init__(self, data: _DataType = ...) -> None: ... + + def copy(self) -> _Hash: ... + def digest(self) -> bytes: ... + def hexdigest(self) -> str: ... + def update(self, arg: _DataType) -> None: ... + +def md5(arg: _DataType = ...) -> _Hash: ... +def sha1(arg: _DataType = ...) -> _Hash: ... +def sha224(arg: _DataType = ...) -> _Hash: ... +def sha256(arg: _DataType = ...) -> _Hash: ... +def sha384(arg: _DataType = ...) -> _Hash: ... +def sha512(arg: _DataType = ...) -> _Hash: ... + +def new(name: str, data: _DataType = ...) -> _Hash: ... + +algorithms_guaranteed: AbstractSet[str] +algorithms_available: AbstractSet[str] + +def pbkdf2_hmac(hash_name: str, password: _DataType, salt: _DataType, iterations: int, dklen: Optional[int] = ...) -> bytes: ... + +if sys.version_info >= (3, 6): + class _VarLenHash(object): + digest_size: int + block_size: int + name: str + + def __init__(self, data: _DataType = ...) -> None: ... + + def copy(self) -> _VarLenHash: ... + def digest(self, length: int) -> bytes: ... + def hexdigest(self, length: int) -> str: ... + def update(self, arg: _DataType) -> None: ... + + sha3_224 = _Hash + sha3_256 = _Hash + sha3_384 = _Hash + sha3_512 = _Hash + shake_128 = _VarLenHash + shake_256 = _VarLenHash + + def scrypt(password: _DataType, *, salt: _DataType, n: int, r: int, p: int, maxmem: int = ..., dklen: int = ...) -> bytes: ... + + class _BlakeHash(_Hash): + MAX_DIGEST_SIZE: int + MAX_KEY_SIZE: int + PERSON_SIZE: int + SALT_SIZE: int + + def __init__(self, data: _DataType = ..., digest_size: int = ..., key: _DataType = ..., salt: _DataType = ..., person: _DataType = ..., fanout: int = ..., depth: int = ..., leaf_size: int = ..., node_offset: int = ..., node_depth: int = ..., inner_size: int = ..., last_node: bool = ...) -> None: ... + + blake2b = _BlakeHash + blake2s = _BlakeHash diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/heapq.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/heapq.pyi new file mode 100644 index 0000000..5c49dfa --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/heapq.pyi @@ -0,0 +1,23 @@ +# Stubs for heapq + +# Based on http://docs.python.org/3.2/library/heapq.html + +import sys +from typing import TypeVar, List, Iterable, Any, Callable, Optional + +_T = TypeVar('_T') + +def heappush(heap: List[_T], item: _T) -> None: ... +def heappop(heap: List[_T]) -> _T: ... +def heappushpop(heap: List[_T], item: _T) -> _T: ... +def heapify(x: List[_T]) -> None: ... +def heapreplace(heap: List[_T], item: _T) -> _T: ... +if sys.version_info >= (3, 5): + def merge(*iterables: Iterable[_T], key: Callable[[_T], Any] = ..., + reverse: bool = ...) -> Iterable[_T]: ... +else: + def merge(*iterables: Iterable[_T]) -> Iterable[_T]: ... +def nlargest(n: int, iterable: Iterable[_T], + key: Optional[Callable[[_T], Any]] = ...) -> List[_T]: ... +def nsmallest(n: int, iterable: Iterable[_T], + key: Callable[[_T], Any] = ...) -> List[_T]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/html/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/html/__init__.pyi new file mode 100644 index 0000000..af2a800 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/html/__init__.pyi @@ -0,0 +1,4 @@ +from typing import AnyStr + +def escape(s: AnyStr, quote: bool = ...) -> AnyStr: ... +def unescape(s: AnyStr) -> AnyStr: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/html/entities.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/html/entities.pyi new file mode 100644 index 0000000..e8ce9f6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/html/entities.pyi @@ -0,0 +1,6 @@ +from typing import Any + +name2codepoint: Any +html5: Any +codepoint2name: Any +entitydefs: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/html/parser.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/html/parser.pyi new file mode 100644 index 0000000..102a2cc --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/html/parser.pyi @@ -0,0 +1,31 @@ +from typing import List, Tuple +from _markupbase import ParserBase +import sys + +class HTMLParser(ParserBase): + if sys.version_info >= (3, 5): + def __init__(self, *, convert_charrefs: bool = ...) -> None: ... + else: + def __init__(self, strict: bool = ..., *, + convert_charrefs: bool = ...) -> None: ... + def feed(self, feed: str) -> None: ... + def close(self) -> None: ... + def reset(self) -> None: ... + def getpos(self) -> Tuple[int, int]: ... + def get_starttag_text(self) -> str: ... + + def handle_starttag(self, tag: str, + attrs: List[Tuple[str, str]]) -> None: ... + def handle_endtag(self, tag: str) -> None: ... + def handle_startendtag(self, tag: str, + attrs: List[Tuple[str, str]]) -> None: ... + def handle_data(self, data: str) -> None: ... + def handle_entityref(self, name: str) -> None: ... + def handle_charref(self, name: str) -> None: ... + def handle_comment(self, data: str) -> None: ... + def handle_decl(self, decl: str) -> None: ... + def handle_pi(self, data: str) -> None: ... + def unknown_decl(self, data: str) -> None: ... + +if sys.version_info < (3, 5): + class HTMLParseError(Exception): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/http/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/http/__init__.pyi new file mode 100644 index 0000000..580250b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/http/__init__.pyi @@ -0,0 +1,69 @@ +import sys + +from enum import IntEnum + +if sys.version_info >= (3, 5): + class HTTPStatus(IntEnum): + + def __init__(self, *a) -> None: ... + + phrase: str + description: str + + CONTINUE = ... + SWITCHING_PROTOCOLS = ... + PROCESSING = ... + OK = ... + CREATED = ... + ACCEPTED = ... + NON_AUTHORITATIVE_INFORMATION = ... + NO_CONTENT = ... + RESET_CONTENT = ... + PARTIAL_CONTENT = ... + MULTI_STATUS = ... + ALREADY_REPORTED = ... + IM_USED = ... + MULTIPLE_CHOICES = ... + MOVED_PERMANENTLY = ... + FOUND = ... + SEE_OTHER = ... + NOT_MODIFIED = ... + USE_PROXY = ... + TEMPORARY_REDIRECT = ... + PERMANENT_REDIRECT = ... + BAD_REQUEST = ... + UNAUTHORIZED = ... + PAYMENT_REQUIRED = ... + FORBIDDEN = ... + NOT_FOUND = ... + METHOD_NOT_ALLOWED = ... + NOT_ACCEPTABLE = ... + PROXY_AUTHENTICATION_REQUIRED = ... + REQUEST_TIMEOUT = ... + CONFLICT = ... + GONE = ... + LENGTH_REQUIRED = ... + PRECONDITION_FAILED = ... + REQUEST_ENTITY_TOO_LARGE = ... + REQUEST_URI_TOO_LONG = ... + UNSUPPORTED_MEDIA_TYPE = ... + REQUESTED_RANGE_NOT_SATISFIABLE = ... + EXPECTATION_FAILED = ... + UNPROCESSABLE_ENTITY = ... + LOCKED = ... + FAILED_DEPENDENCY = ... + UPGRADE_REQUIRED = ... + PRECONDITION_REQUIRED = ... + TOO_MANY_REQUESTS = ... + REQUEST_HEADER_FIELDS_TOO_LARGE = ... + INTERNAL_SERVER_ERROR = ... + NOT_IMPLEMENTED = ... + BAD_GATEWAY = ... + SERVICE_UNAVAILABLE = ... + GATEWAY_TIMEOUT = ... + HTTP_VERSION_NOT_SUPPORTED = ... + VARIANT_ALSO_NEGOTIATES = ... + INSUFFICIENT_STORAGE = ... + LOOP_DETECTED = ... + NOT_EXTENDED = ... + NETWORK_AUTHENTICATION_REQUIRED = ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/http/client.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/http/client.pyi new file mode 100644 index 0000000..5528b01 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/http/client.pyi @@ -0,0 +1,223 @@ +from typing import ( + Any, Dict, IO, Iterable, List, Iterator, Mapping, Optional, + Protocol, Tuple, Type, TypeVar, + Union, + overload, + BinaryIO, +) +import email.message +import io +from socket import socket +import sys +import ssl +import types + +_DataType = Union[bytes, IO[Any], Iterable[bytes], str] +_T = TypeVar('_T') + +HTTP_PORT: int +HTTPS_PORT: int + +CONTINUE: int +SWITCHING_PROTOCOLS: int +PROCESSING: int + +OK: int +CREATED: int +ACCEPTED: int +NON_AUTHORITATIVE_INFORMATION: int +NO_CONTENT: int +RESET_CONTENT: int +PARTIAL_CONTENT: int +MULTI_STATUS: int +IM_USED: int + +MULTIPLE_CHOICES: int +MOVED_PERMANENTLY: int +FOUND: int +SEE_OTHER: int +NOT_MODIFIED: int +USE_PROXY: int +TEMPORARY_REDIRECT: int + +BAD_REQUEST: int +UNAUTHORIZED: int +PAYMENT_REQUIRED: int +FORBIDDEN: int +NOT_FOUND: int +METHOD_NOT_ALLOWED: int +NOT_ACCEPTABLE: int +PROXY_AUTHENTICATION_REQUIRED: int +REQUEST_TIMEOUT: int +CONFLICT: int +GONE: int +LENGTH_REQUIRED: int +PRECONDITION_FAILED: int +REQUEST_ENTITY_TOO_LARGE: int +REQUEST_URI_TOO_LONG: int +UNSUPPORTED_MEDIA_TYPE: int +REQUESTED_RANGE_NOT_SATISFIABLE: int +EXPECTATION_FAILED: int +UNPROCESSABLE_ENTITY: int +LOCKED: int +FAILED_DEPENDENCY: int +UPGRADE_REQUIRED: int +PRECONDITION_REQUIRED: int +TOO_MANY_REQUESTS: int +REQUEST_HEADER_FIELDS_TOO_LARGE: int + +INTERNAL_SERVER_ERROR: int +NOT_IMPLEMENTED: int +BAD_GATEWAY: int +SERVICE_UNAVAILABLE: int +GATEWAY_TIMEOUT: int +HTTP_VERSION_NOT_SUPPORTED: int +INSUFFICIENT_STORAGE: int +NOT_EXTENDED: int +NETWORK_AUTHENTICATION_REQUIRED: int + +responses: Dict[int, str] + +class HTTPMessage(email.message.Message): ... + +if sys.version_info >= (3, 5): + # Ignore errors to work around python/mypy#5027 + class HTTPResponse(io.BufferedIOBase, BinaryIO): # type: ignore + msg: HTTPMessage + headers: HTTPMessage + version: int + debuglevel: int + closed: bool + status: int + reason: str + def __init__(self, sock: socket, debuglevel: int = ..., + method: Optional[str] = ..., url: Optional[str] = ...) -> None: ... + def read(self, amt: Optional[int] = ...) -> bytes: ... + @overload + def getheader(self, name: str) -> Optional[str]: ... + @overload + def getheader(self, name: str, default: _T) -> Union[str, _T]: ... + def getheaders(self) -> List[Tuple[str, str]]: ... + def fileno(self) -> int: ... + def isclosed(self) -> bool: ... + def __iter__(self) -> Iterator[bytes]: ... + def __enter__(self) -> HTTPResponse: ... + def __exit__(self, exc_type: Optional[Type[BaseException]], + exc_val: Optional[BaseException], + exc_tb: Optional[types.TracebackType]) -> bool: ... + def info(self) -> email.message.Message: ... + def geturl(self) -> str: ... + def getcode(self) -> int: ... + def begin(self) -> None: ... +else: + class HTTPResponse(io.RawIOBase, BinaryIO): # type: ignore + msg: HTTPMessage + headers: HTTPMessage + version: int + debuglevel: int + closed: bool + status: int + reason: str + def read(self, amt: Optional[int] = ...) -> bytes: ... + def readinto(self, b: bytearray) -> int: ... + @overload + def getheader(self, name: str) -> Optional[str]: ... + @overload + def getheader(self, name: str, default: _T) -> Union[str, _T]: ... + def getheaders(self) -> List[Tuple[str, str]]: ... + def fileno(self) -> int: ... + def __iter__(self) -> Iterator[bytes]: ... + def __enter__(self) -> HTTPResponse: ... + def __exit__(self, exc_type: Optional[Type[BaseException]], + exc_val: Optional[BaseException], + exc_tb: Optional[types.TracebackType]) -> bool: ... + def info(self) -> email.message.Message: ... + def geturl(self) -> str: ... + def getcode(self) -> int: ... + def begin(self) -> None: ... + +# This is an API stub only for the class below, not a class itself. +# urllib.request uses it for a parameter. +class HTTPConnectionProtocol(Protocol): + if sys.version_info >= (3, 7): + def __call__(self, host: str, port: Optional[int] = ..., + timeout: int = ..., + source_address: Optional[Tuple[str, int]] = ..., + blocksize: int = ...): ... + else: + def __call__(self, host: str, port: Optional[int] = ..., + timeout: int = ..., + source_address: Optional[Tuple[str, int]] = ...): ... + +class HTTPConnection: + host: str = ... + port: int = ... + if sys.version_info >= (3, 7): + def __init__( + self, + host: str, port: Optional[int] = ..., + timeout: int = ..., + source_address: Optional[Tuple[str, int]] = ..., blocksize: int = ... + ) -> None: ... + else: + def __init__( + self, + host: str, port: Optional[int] = ..., + timeout: int = ..., + source_address: Optional[Tuple[str, int]] = ... + ) -> None: ... + if sys.version_info >= (3, 6): + def request(self, method: str, url: str, + body: Optional[_DataType] = ..., + headers: Mapping[str, str] = ..., + *, encode_chunked: bool = ...) -> None: ... + else: + def request(self, method: str, url: str, + body: Optional[_DataType] = ..., + headers: Mapping[str, str] = ...) -> None: ... + def getresponse(self) -> HTTPResponse: ... + def set_debuglevel(self, level: int) -> None: ... + def set_tunnel(self, host: str, port: Optional[int] = ..., + headers: Optional[Mapping[str, str]] = ...) -> None: ... + def connect(self) -> None: ... + def close(self) -> None: ... + def putrequest(self, request: str, selector: str, skip_host: bool = ..., + skip_accept_encoding: bool = ...) -> None: ... + def putheader(self, header: str, *argument: str) -> None: ... + if sys.version_info >= (3, 6): + def endheaders(self, message_body: Optional[_DataType] = ..., + *, encode_chunked: bool = ...) -> None: ... + else: + def endheaders(self, message_body: Optional[_DataType] = ...) -> None: ... + def send(self, data: _DataType) -> None: ... + +class HTTPSConnection(HTTPConnection): + def __init__(self, + host: str, port: Optional[int] = ..., + key_file: Optional[str] = ..., + cert_file: Optional[str] = ..., + timeout: int = ..., + source_address: Optional[Tuple[str, int]] = ..., + *, context: Optional[ssl.SSLContext] = ..., + check_hostname: Optional[bool] = ...) -> None: ... + +class HTTPException(Exception): ... +error = HTTPException + +class NotConnected(HTTPException): ... +class InvalidURL(HTTPException): ... +class UnknownProtocol(HTTPException): ... +class UnknownTransferEncoding(HTTPException): ... +class UnimplementedFileMode(HTTPException): ... +class IncompleteRead(HTTPException): ... + +class ImproperConnectionState(HTTPException): ... +class CannotSendRequest(ImproperConnectionState): ... +class CannotSendHeader(ImproperConnectionState): ... +class ResponseNotReady(ImproperConnectionState): ... + +class BadStatusLine(HTTPException): ... +class LineTooLong(HTTPException): ... + +if sys.version_info >= (3, 5): + class RemoteDisconnected(ConnectionResetError, BadStatusLine): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/http/cookiejar.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/http/cookiejar.pyi new file mode 100644 index 0000000..25701ea --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/http/cookiejar.pyi @@ -0,0 +1,115 @@ +from typing import Dict, Iterable, Iterator, Optional, Sequence, Tuple, TypeVar, Union, overload +from http.client import HTTPResponse +from urllib.request import Request + +_T = TypeVar('_T') + +class LoadError(OSError): ... + + +class CookieJar(Iterable[Cookie]): + def __init__(self, policy: Optional[CookiePolicy] = ...) -> None: ... + def add_cookie_header(self, request: Request) -> None: ... + def extract_cookies(self, response: HTTPResponse, + request: Request) -> None: ... + def set_policy(self, policy: CookiePolicy) -> None: ... + def make_cookies(self, response: HTTPResponse, + request: Request) -> Sequence[Cookie]: ... + def set_cookie(self, cookie: Cookie) -> None: ... + def set_cookie_if_ok(self, cookie: Cookie, + request: Request) -> None: ... + def clear(self, domain: str = ..., path: str = ..., + name: str = ...) -> None: ... + def clear_session_cookies(self) -> None: ... + def __iter__(self) -> Iterator[Cookie]: ... + def __len__(self) -> int: ... + +class FileCookieJar(CookieJar): + filename: str + delayload: bool + def __init__(self, filename: str = ..., delayload: bool = ..., + policy: Optional[CookiePolicy] = ...) -> None: ... + def save(self, filename: Optional[str] = ..., ignore_discard: bool = ..., + ignore_expires: bool = ...) -> None: ... + def load(self, filename: Optional[str] = ..., ignore_discard: bool = ..., + ignore_expires: bool = ...) -> None: ... + def revert(self, filename: Optional[str] = ..., ignore_discard: bool = ..., + ignore_expires: bool = ...) -> None: ... + +class MozillaCookieJar(FileCookieJar): ... +class LWPCookieJar(FileCookieJar): ... + + +class CookiePolicy: + netscape: bool + rfc2965: bool + hide_cookie2: bool + def set_ok(self, cookie: Cookie, request: Request) -> bool: ... + def return_ok(self, cookie: Cookie, request: Request) -> bool: ... + def domain_return_ok(self, domain: str, request: Request) -> bool: ... + def path_return_ok(self, path: str, request: Request) -> bool: ... + + +class DefaultCookiePolicy(CookiePolicy): + rfc2109_as_netscape: bool + strict_domain: bool + strict_rfc2965_unverifiable: bool + strict_ns_unverifiable: bool + strict_ns_domain: int + strict_ns_set_initial_dollar: bool + strict_ns_set_path: bool + DomainStrictNoDots: int + DomainStrictNonDomain: int + DomainRFC2965Match: int + DomainLiberal: int + DomainStrict: int + def __init__(self, blocked_domains: Optional[Sequence[str]] = ..., + allowed_domains: Optional[Sequence[str]] = ..., + netscape: bool = ..., + rfc2965: bool = ..., + rfc2109_as_netscape: Optional[bool] = ..., + hide_cookie2: bool = ..., strict_domain: bool = ..., + strict_rfc2965_unverifiable: bool = ..., + strict_ns_unverifiable: bool = ..., + strict_ns_domain: int = ..., + strict_ns_set_initial_dollar: bool = ..., + strict_ns_set_path: bool = ...) -> None: ... + def blocked_domains(self) -> Tuple[str, ...]: ... + def set_blocked_domains(self, blocked_domains: Sequence[str]) -> None: ... + def is_blocked(self, domain: str) -> bool: ... + def allowed_domains(self) -> Optional[Tuple[str, ...]]: ... + def set_allowed_domains(self, allowed_domains: Optional[Sequence[str]]) -> None: ... + def is_not_allowed(self, domain: str) -> bool: ... + + +class Cookie: + version: Optional[int] + name: str + value: Optional[str] + port: Optional[str] + path: str + secure: bool + expires: Optional[int] + discard: bool + comment: Optional[str] + comment_url: Optional[str] + rfc2109: bool + port_specified: bool + domain: str # undocumented + domain_specified: bool + domain_initial_dot: bool + def __init__(self, version: Optional[int], name: str, value: Optional[str], # undocumented + port: Optional[str], port_specified: bool, + domain: str, domain_specified: bool, domain_initial_dot: bool, + path: str, path_specified: bool, + secure: bool, expires: Optional[int], discard: bool, + comment: Optional[str], comment_url: Optional[str], + rest: Dict[str, str], + rfc2109: bool = ...) -> None: ... + def has_nonstandard_attr(self, name: str) -> bool: ... + @overload + def get_nonstandard_attr(self, name: str) -> Optional[str]: ... + @overload + def get_nonstandard_attr(self, name: str, default: _T = ...) -> Union[str, _T]: ... + def set_nonstandard_attr(self, name: str, value: str) -> None: ... + def is_expired(self, now: int = ...) -> bool: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/http/cookies.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/http/cookies.pyi new file mode 100644 index 0000000..5e5d58a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/http/cookies.pyi @@ -0,0 +1,31 @@ +# Stubs for http.cookies (Python 3.5) + +from typing import Generic, Dict, List, Mapping, MutableMapping, Optional, TypeVar, Union + +_DataType = Union[str, Mapping[str, Union[str, Morsel]]] +_T = TypeVar('_T') + +class CookieError(Exception): ... + +class Morsel(Dict[str, str], Generic[_T]): + value: str + coded_value: _T + key: str + def set(self, key: str, val: str, coded_val: _T) -> None: ... + def isReservedKey(self, K: str) -> bool: ... + def output(self, attrs: Optional[List[str]] = ..., + header: str = ...) -> str: ... + def js_output(self, attrs: Optional[List[str]] = ...) -> str: ... + def OutputString(self, attrs: Optional[List[str]] = ...) -> str: ... + +class BaseCookie(Dict[str, Morsel], Generic[_T]): + def __init__(self, input: Optional[_DataType] = ...) -> None: ... + def value_decode(self, val: str) -> _T: ... + def value_encode(self, val: _T) -> str: ... + def output(self, attrs: Optional[List[str]] = ..., header: str = ..., + sep: str = ...) -> str: ... + def js_output(self, attrs: Optional[List[str]] = ...) -> str: ... + def load(self, rawdata: _DataType) -> None: ... + def __setitem__(self, key: str, value: Union[str, Morsel]) -> None: ... + +class SimpleCookie(BaseCookie): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/http/server.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/http/server.pyi new file mode 100644 index 0000000..7a7729f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/http/server.pyi @@ -0,0 +1,71 @@ +# Stubs for http.server (Python 3.4) + +import sys +from typing import Any, BinaryIO, Dict, List, Mapping, Optional, Tuple, Union +import socketserver +import email.message + +if sys.version_info >= (3, 7): + from builtins import _PathLike + +class HTTPServer(socketserver.TCPServer): + server_name: str + server_port: int + def __init__(self, server_address: Tuple[str, int], + RequestHandlerClass: type) -> None: ... + +class BaseHTTPRequestHandler: + client_address: Tuple[str, int] + server: socketserver.BaseServer + close_connection: bool + requestline: str + command: str + path: str + request_version: str + headers: email.message.Message + rfile: BinaryIO + wfile: BinaryIO + server_version: str + sys_version: str + error_message_format: str + error_content_type: str + protocol_version: str + MessageClass: type + responses: Mapping[int, Tuple[str, str]] + def __init__(self, request: bytes, client_address: Tuple[str, int], + server: socketserver.BaseServer) -> None: ... + def handle(self) -> None: ... + def handle_one_request(self) -> None: ... + def handle_expect_100(self) -> bool: ... + def send_error(self, code: int, message: Optional[str] = ..., + explain: Optional[str] = ...) -> None: ... + def send_response(self, code: int, + message: Optional[str] = ...) -> None: ... + def send_header(self, keyword: str, value: str) -> None: ... + def send_response_only(self, code: int, + message: Optional[str] = ...) -> None: ... + def end_headers(self) -> None: ... + def flush_headers(self) -> None: ... + def log_request(self, code: Union[int, str] = ..., + size: Union[int, str] = ...) -> None: ... + def log_error(self, format: str, *args: Any) -> None: ... + def log_message(self, format: str, *args: Any) -> None: ... + def version_string(self) -> str: ... + def date_time_string(self, timestamp: Optional[int] = ...) -> str: ... + def log_date_time_string(self) -> str: ... + def address_string(self) -> str: ... + +class SimpleHTTPRequestHandler(BaseHTTPRequestHandler): + extensions_map: Dict[str, str] + if sys.version_info >= (3, 7): + def __init__(self, request: bytes, client_address: Tuple[str, int], + server: socketserver.BaseServer, directory: Optional[Union[str, _PathLike[str]]]) -> None: ... + else: + def __init__(self, request: bytes, client_address: Tuple[str, int], + server: socketserver.BaseServer) -> None: ... + def do_GET(self) -> None: ... + def do_HEAD(self) -> None: ... + +class CGIHTTPRequestHandler(SimpleHTTPRequestHandler): + cgi_directories: List[str] + def do_POST(self) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/imp.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/imp.pyi new file mode 100644 index 0000000..3344091 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/imp.pyi @@ -0,0 +1,55 @@ +# Stubs for imp (Python 3.6) + +import os +import sys +import types +from typing import Any, IO, List, Optional, Tuple, TypeVar, Union + +from _imp import (lock_held as lock_held, acquire_lock as acquire_lock, release_lock as release_lock, + get_frozen_object as get_frozen_object, is_frozen_package as is_frozen_package, + init_frozen as init_frozen, is_builtin as is_builtin, is_frozen as is_frozen) + +if sys.version_info >= (3, 5): + from _imp import create_dynamic as create_dynamic + +_T = TypeVar('_T') + +if sys.version_info >= (3, 6): + _Path = Union[str, os.PathLike[str]] +else: + _Path = str + +SEARCH_ERROR: int +PY_SOURCE: int +PY_COMPILED: int +C_EXTENSION: int +PY_RESOURCE: int +PKG_DIRECTORY: int +C_BUILTIN: int +PY_FROZEN: int +PY_CODERESOURCE: int +IMP_HOOK: int + +def new_module(name: str) -> types.ModuleType: ... +def get_magic() -> bytes: ... +def get_tag() -> str: ... +def cache_from_source(path: _Path, debug_override: Optional[bool] = ...) -> str: ... +def source_from_cache(path: _Path) -> str: ... +def get_suffixes() -> List[Tuple[str, str, int]]: ... + +class NullImporter: + def __init__(self, path: _Path) -> None: ... + def find_module(self, fullname: Any) -> None: ... + +# PathLike doesn't work for the pathname argument here +def load_source(name: str, pathname: str, file: Optional[IO[Any]] = ...) -> types.ModuleType: ... +def load_compiled(name: str, pathname: str, file: Optional[IO[Any]] = ...) -> types.ModuleType: ... +def load_package(name: str, path: _Path) -> types.ModuleType: ... +def load_module(name: str, file: IO[Any], filename: str, details: Tuple[str, str, int]) -> types.ModuleType: ... +if sys.version_info >= (3, 6): + def find_module(name: str, path: Union[None, List[str], List[os.PathLike[str]], List[_Path]] = ...) -> Tuple[str, str, Tuple[IO[Any], str, int]]: ... +else: + def find_module(name: str, path: Optional[List[str]] = ...) -> Tuple[str, str, Tuple[IO[Any], str, int]]: ... +def reload(module: types.ModuleType) -> types.ModuleType: ... +def init_builtin(name: str) -> Optional[types.ModuleType]: ... +def load_dynamic(name: str, path: str, file: Optional[IO[Any]] = ...) -> types.ModuleType: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/importlib/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/importlib/__init__.pyi new file mode 100644 index 0000000..d46f7e1 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/importlib/__init__.pyi @@ -0,0 +1,17 @@ +from importlib.abc import Loader +import sys +import types +from typing import Any, Mapping, Optional, Sequence + +def __import__(name: str, globals: Optional[Mapping[str, Any]] = ..., + locals: Optional[Mapping[str, Any]] = ..., + fromlist: Sequence[str] = ..., + level: int = ...) -> types.ModuleType: ... + +def import_module(name: str, package: Optional[str] = ...) -> types.ModuleType: ... + +def find_loader(name: str, path: Optional[str] = ...) -> Optional[Loader]: ... + +def invalidate_caches() -> None: ... + +def reload(module: types.ModuleType) -> types.ModuleType: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/importlib/abc.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/importlib/abc.pyi new file mode 100644 index 0000000..a86e194 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/importlib/abc.pyi @@ -0,0 +1,97 @@ +from abc import ABCMeta, abstractmethod +import os +import sys +import types +from typing import Any, IO, Iterator, Mapping, Optional, Sequence, Tuple, Union + +# Loader is exported from this module, but for circular import reasons +# exists in its own stub file (with ModuleSpec and ModuleType). +from _importlib_modulespec import Loader as Loader # Exported + +from _importlib_modulespec import ModuleSpec + +_Path = Union[bytes, str] + +class Finder(metaclass=ABCMeta): + ... + # Technically this class defines the following method, but its subclasses + # in this module violate its signature. Since this class is deprecated, it's + # easier to simply ignore that this method exists. + # @abstractmethod + # def find_module(self, fullname: str, + # path: Optional[Sequence[_Path]] = ...) -> Optional[Loader]: ... + +class ResourceLoader(Loader): + @abstractmethod + def get_data(self, path: _Path) -> bytes: ... + +class InspectLoader(Loader): + def is_package(self, fullname: str) -> bool: ... + def get_code(self, fullname: str) -> Optional[types.CodeType]: ... + def load_module(self, fullname: str) -> types.ModuleType: ... + @abstractmethod + def get_source(self, fullname: str) -> Optional[str]: ... + def exec_module(self, module: types.ModuleType) -> None: ... + if sys.version_info < (3, 5): + def source_to_code(self, data: Union[bytes, str], + path: str = ...) -> types.CodeType: ... + else: + @staticmethod + def source_to_code(data: Union[bytes, str], + path: str = ...) -> types.CodeType: ... + +class ExecutionLoader(InspectLoader): + @abstractmethod + def get_filename(self, fullname: str) -> _Path: ... + def get_code(self, fullname: str) -> Optional[types.CodeType]: ... + +class SourceLoader(ResourceLoader, ExecutionLoader, metaclass=ABCMeta): + def path_mtime(self, path: _Path) -> float: ... + def set_data(self, path: _Path, data: bytes) -> None: ... + def get_source(self, fullname: str) -> Optional[str]: ... + def path_stats(self, path: _Path) -> Mapping[str, Any]: ... + + +class MetaPathFinder(Finder): + def find_module(self, fullname: str, + path: Optional[Sequence[_Path]]) -> Optional[Loader]: + ... + def invalidate_caches(self) -> None: ... + # Not defined on the actual class, but expected to exist. + def find_spec( + self, fullname: str, path: Optional[Sequence[_Path]], + target: Optional[types.ModuleType] = ... + ) -> Optional[ModuleSpec]: + ... + +class PathEntryFinder(Finder): + def find_module(self, fullname: str) -> Optional[Loader]: ... + def find_loader( + self, fullname: str + ) -> Tuple[Optional[Loader], Sequence[_Path]]: ... + def invalidate_caches(self) -> None: ... + # Not defined on the actual class, but expected to exist. + def find_spec( + self, fullname: str, + target: Optional[types.ModuleType] = ... + ) -> Optional[ModuleSpec]: ... + +class FileLoader(ResourceLoader, ExecutionLoader, metaclass=ABCMeta): + name: str + path: _Path + def __init__(self, fullname: str, path: _Path) -> None: ... + def get_data(self, path: _Path) -> bytes: ... + def get_filename(self, fullname: str) -> _Path: ... + +if sys.version_info >= (3, 7): + _PathLike = Union[bytes, str, os.PathLike[Any]] + + class ResourceReader(metaclass=ABCMeta): + @abstractmethod + def open_resource(self, resource: _PathLike) -> IO[bytes]: ... + @abstractmethod + def resource_path(self, resource: _PathLike) -> str: ... + @abstractmethod + def is_resource(self, name: str) -> bool: ... + @abstractmethod + def contents(self) -> Iterator[str]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/importlib/machinery.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/importlib/machinery.pyi new file mode 100644 index 0000000..036a91f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/importlib/machinery.pyi @@ -0,0 +1,116 @@ +import importlib.abc +import sys +import types +from typing import Any, Callable, List, Optional, Sequence, Tuple, Union + +# ModuleSpec is exported from this module, but for circular import +# reasons exists in its own stub file (with Loader and ModuleType). +from _importlib_modulespec import ModuleSpec as ModuleSpec # Exported + +class BuiltinImporter(importlib.abc.MetaPathFinder, + importlib.abc.InspectLoader): + # MetaPathFinder + @classmethod + def find_module( + cls, fullname: str, + path: Optional[Sequence[importlib.abc._Path]] + ) -> Optional[importlib.abc.Loader]: + ... + @classmethod + def find_spec(cls, fullname: str, + path: Optional[Sequence[importlib.abc._Path]], + target: Optional[types.ModuleType] = ...) -> Optional[ModuleSpec]: + ... + # InspectLoader + @classmethod + def is_package(cls, fullname: str) -> bool: ... + @classmethod + def load_module(cls, fullname: str) -> types.ModuleType: ... + @classmethod + def get_code(cls, fullname: str) -> None: ... + @classmethod + def get_source(cls, fullname: str) -> None: ... + # Loader + @staticmethod + def module_repr(module: types.ModuleType) -> str: ... + @classmethod + def create_module(cls, spec: ModuleSpec) -> Optional[types.ModuleType]: ... + @classmethod + def exec_module(cls, module: types.ModuleType) -> None: ... + +class FrozenImporter(importlib.abc.MetaPathFinder, importlib.abc.InspectLoader): + # MetaPathFinder + @classmethod + def find_module( + cls, fullname: str, + path: Optional[Sequence[importlib.abc._Path]] + ) -> Optional[importlib.abc.Loader]: + ... + @classmethod + def find_spec(cls, fullname: str, + path: Optional[Sequence[importlib.abc._Path]], + target: Optional[types.ModuleType] = ...) -> Optional[ModuleSpec]: + ... + # InspectLoader + @classmethod + def is_package(cls, fullname: str) -> bool: ... + @classmethod + def load_module(cls, fullname: str) -> types.ModuleType: ... + @classmethod + def get_code(cls, fullname: str) -> None: ... + @classmethod + def get_source(cls, fullname: str) -> None: ... + # Loader + @staticmethod + def module_repr(module: types.ModuleType) -> str: ... + @classmethod + def create_module(cls, spec: ModuleSpec) -> Optional[types.ModuleType]: + ... + @staticmethod + def exec_module(module: types.ModuleType) -> None: ... + +class WindowsRegistryFinder(importlib.abc.MetaPathFinder): + @classmethod + def find_module( + cls, fullname: str, + path: Optional[Sequence[importlib.abc._Path]] + ) -> Optional[importlib.abc.Loader]: + ... + @classmethod + def find_spec(cls, fullname: str, + path: Optional[Sequence[importlib.abc._Path]], + target: Optional[types.ModuleType] = ...) -> Optional[ModuleSpec]: + ... + +class PathFinder(importlib.abc.MetaPathFinder): ... + +SOURCE_SUFFIXES: List[str] +DEBUG_BYTECODE_SUFFIXES: List[str] +OPTIMIZED_BYTECODE_SUFFIXES: List[str] +BYTECODE_SUFFIXES: List[str] +EXTENSION_SUFFIXES: List[str] + +def all_suffixes() -> List[str]: ... + +class FileFinder(importlib.abc.PathEntryFinder): + path: str + def __init__( + self, path: str, + *loader_details: Tuple[importlib.abc.Loader, List[str]] + ) -> None: ... + @classmethod + def path_hook( + cls, *loader_details: Tuple[importlib.abc.Loader, List[str]] + ) -> Callable[[str], importlib.abc.PathEntryFinder]: ... + +class SourceFileLoader(importlib.abc.FileLoader, + importlib.abc.SourceLoader): + ... + +class SourcelessFileLoader(importlib.abc.FileLoader, + importlib.abc.SourceLoader): + ... + +class ExtensionFileLoader(importlib.abc.ExecutionLoader): + def get_filename(self, fullname: str) -> importlib.abc._Path: ... + def get_source(self, fullname: str) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/importlib/resources.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/importlib/resources.pyi new file mode 100644 index 0000000..007477d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/importlib/resources.pyi @@ -0,0 +1,25 @@ +import sys +# This is a >=3.7 module, so we conditionally include its source. +if sys.version_info >= (3, 7): + import os + + from pathlib import Path + from types import ModuleType + from typing import ContextManager, Iterator, Union, BinaryIO, TextIO + + Package = Union[str, ModuleType] + Resource = Union[str, os.PathLike] + + def open_binary(package: Package, resource: Resource) -> BinaryIO: ... + def open_text(package: Package, + resource: Resource, + encoding: str = ..., + errors: str = ...) -> TextIO: ... + def read_binary(package: Package, resource: Resource) -> bytes: ... + def read_text(package: Package, + resource: Resource, + encoding: str = ..., + errors: str = ...) -> str: ... + def path(package: Package, resource: Resource) -> ContextManager[Path]: ... + def is_resource(package: Package, name: str) -> bool: ... + def contents(package: Package) -> Iterator[str]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/importlib/util.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/importlib/util.pyi new file mode 100644 index 0000000..706a5dd --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/importlib/util.pyi @@ -0,0 +1,53 @@ +import importlib.abc +import importlib.machinery +import sys +import types +from typing import Any, Callable, List, Optional + +def module_for_loader( + fxn: Callable[..., types.ModuleType] +) -> Callable[..., types.ModuleType]: ... +def set_loader( + fxn: Callable[..., types.ModuleType] +) -> Callable[..., types.ModuleType]: ... +def set_package( + fxn: Callable[..., types.ModuleType] +) -> Callable[..., types.ModuleType]: ... + +def resolve_name(name: str, package: str) -> str: ... + +MAGIC_NUMBER: bytes + +def cache_from_source(path: str, debug_override: Optional[bool] = ..., *, + optimization: Optional[Any] = ...) -> str: ... +def source_from_cache(path: str) -> str: ... +def decode_source(source_bytes: bytes) -> str: ... +def find_spec( + name: str, package: Optional[str] = ... +) -> Optional[importlib.machinery.ModuleSpec]: ... +def spec_from_loader( + name: str, loader: Optional[importlib.abc.Loader], *, + origin: Optional[str] = ..., loader_state: Optional[Any] = ..., + is_package: Optional[bool] = ... +) -> importlib.machinery.ModuleSpec: ... +def spec_from_file_location( + name: str, location: str, *, + loader: Optional[importlib.abc.Loader] = ..., + submodule_search_locations: Optional[List[str]] = ... +) -> importlib.machinery.ModuleSpec: ... + +if sys.version_info >= (3, 5): + def module_from_spec( + spec: importlib.machinery.ModuleSpec + ) -> types.ModuleType: ... + + class LazyLoader(importlib.abc.Loader): + def __init__(self, loader: importlib.abc.Loader) -> None: ... + @classmethod + def factory( + cls, loader: importlib.abc.Loader + ) -> Callable[..., LazyLoader]: ... + def create_module( + self, spec: importlib.machinery.ModuleSpec + ) -> Optional[types.ModuleType]: ... + def exec_module(self, module: types.ModuleType) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/inspect.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/inspect.pyi new file mode 100644 index 0000000..6173715 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/inspect.pyi @@ -0,0 +1,329 @@ +import sys +from typing import (AbstractSet, Any, Callable, Dict, Generator, List, Mapping, + NamedTuple, Optional, Sequence, Tuple, Union, + ) +from types import CodeType, FrameType, ModuleType, TracebackType +from collections import OrderedDict + +# +# Types and members +# +class EndOfBlock(Exception): ... + +class BlockFinder: + indent: int + islambda: bool + started: bool + passline: bool + indecorator: bool + decoratorhasargs: bool + last: int + def tokeneater(self, type: int, token: str, srow_scol: Tuple[int, int], + erow_ecol: Tuple[int, int], line: str) -> None: ... + +CO_OPTIMIZED: int +CO_NEWLOCALS: int +CO_VARARGS: int +CO_VARKEYWORDS: int +CO_NESTED: int +CO_GENERATOR: int +CO_NOFREE: int +if sys.version_info >= (3, 5): + CO_COROUTINE: int + CO_ITERABLE_COROUTINE: int +if sys.version_info >= (3, 6): + CO_ASYNC_GENERATOR: int +TPFLAGS_IS_ABSTRACT: int + +if sys.version_info < (3, 6): + ModuleInfo = NamedTuple('ModuleInfo', [('name', str), + ('suffix', str), + ('mode', str), + ('module_type', int), + ]) + def getmoduleinfo(path: str) -> Optional[ModuleInfo]: ... + +def getmembers(object: object, + predicate: Optional[Callable[[Any], bool]] = ..., + ) -> List[Tuple[str, Any]]: ... +def getmodulename(path: str) -> Optional[str]: ... + +def ismodule(object: object) -> bool: ... +def isclass(object: object) -> bool: ... +def ismethod(object: object) -> bool: ... +def isfunction(object: object) -> bool: ... +def isgeneratorfunction(object: object) -> bool: ... +def isgenerator(object: object) -> bool: ... + +if sys.version_info >= (3, 5): + def iscoroutinefunction(object: object) -> bool: ... + def iscoroutine(object: object) -> bool: ... + def isawaitable(object: object) -> bool: ... +if sys.version_info >= (3, 6): + def isasyncgenfunction(object: object) -> bool: ... + def isasyncgen(object: object) -> bool: ... +def istraceback(object: object) -> bool: ... +def isframe(object: object) -> bool: ... +def iscode(object: object) -> bool: ... +def isbuiltin(object: object) -> bool: ... +def isroutine(object: object) -> bool: ... +def isabstract(object: object) -> bool: ... +def ismethoddescriptor(object: object) -> bool: ... +def isdatadescriptor(object: object) -> bool: ... +def isgetsetdescriptor(object: object) -> bool: ... +def ismemberdescriptor(object: object) -> bool: ... + + +# +# Retrieving source code +# +def findsource(object: object) -> Tuple[List[str], int]: ... +def getabsfile(object: object) -> str: ... +def getblock(lines: Sequence[str]) -> Sequence[str]: ... +def getdoc(object: object) -> str: ... +def getcomments(object: object) -> str: ... +def getfile(object: object) -> str: ... +def getmodule(object: object) -> ModuleType: ... +def getsourcefile(object: object) -> str: ... +# TODO restrict to "module, class, method, function, traceback, frame, +# or code object" +def getsourcelines(object: object) -> Tuple[List[str], int]: ... +# TODO restrict to "a module, class, method, function, traceback, frame, +# or code object" +def getsource(object: object) -> str: ... +def cleandoc(doc: str) -> str: ... +def indentsize(line: str) -> int: ... + + +# +# Introspecting callables with the Signature object +# +def signature(callable: Callable[..., Any], + *, + follow_wrapped: bool = ...) -> Signature: ... + +class Signature: + def __init__(self, + parameters: Optional[Sequence[Parameter]] = ..., + *, + return_annotation: Any = ...) -> None: ... + # TODO: can we be more specific here? + empty: object = ... + + parameters: Mapping[str, Parameter] + + # TODO: can we be more specific here? + return_annotation: Any + + def bind(self, *args: Any, **kwargs: Any) -> BoundArguments: ... + def bind_partial(self, *args: Any, **kwargs: Any) -> BoundArguments: ... + def replace(self, + *, + parameters: Optional[Sequence[Parameter]] = ..., + return_annotation: Any = ...) -> Signature: ... + + if sys.version_info >= (3, 5): + @classmethod + def from_callable(cls, + obj: Callable[..., Any], + *, + follow_wrapped: bool = ...) -> Signature: ... + +# The name is the same as the enum's name in CPython +class _ParameterKind: ... + +class Parameter: + def __init__(self, + name: str, + kind: _ParameterKind, + *, + default: Any = ..., + annotation: Any = ...) -> None: ... + empty: Any = ... + name: str + default: Any + annotation: Any + + kind: _ParameterKind + POSITIONAL_ONLY: _ParameterKind = ... + POSITIONAL_OR_KEYWORD: _ParameterKind = ... + VAR_POSITIONAL: _ParameterKind = ... + KEYWORD_ONLY: _ParameterKind = ... + VAR_KEYWORD: _ParameterKind = ... + + def replace(self, + *, + name: Optional[str] = ..., + kind: Optional[_ParameterKind] = ..., + default: Any = ..., + annotation: Any = ...) -> Parameter: ... + +class BoundArguments: + arguments: OrderedDict[str, Any] + args: Tuple[Any, ...] + kwargs: Dict[str, Any] + signature: Signature + + if sys.version_info >= (3, 5): + def apply_defaults(self) -> None: ... + + +# +# Classes and functions +# + +# TODO: The actual return type should be List[_ClassTreeItem] but mypy doesn't +# seem to be supporting this at the moment: +# _ClassTreeItem = Union[List[_ClassTreeItem], Tuple[type, Tuple[type, ...]]] +def getclasstree(classes: List[type], unique: bool = ...) -> Any: ... + +ArgSpec = NamedTuple('ArgSpec', [('args', List[str]), + ('varargs', str), + ('keywords', str), + ('defaults', tuple), + ]) + +Arguments = NamedTuple('Arguments', [('args', List[str]), + ('varargs', Optional[str]), + ('varkw', Optional[str]), + ]) + +def getargs(co: CodeType) -> Arguments: ... +def getargspec(func: object) -> ArgSpec: ... + +FullArgSpec = NamedTuple('FullArgSpec', [('args', List[str]), + ('varargs', Optional[str]), + ('varkw', Optional[str]), + ('defaults', tuple), + ('kwonlyargs', List[str]), + ('kwonlydefaults', Dict[str, Any]), + ('annotations', Dict[str, Any]), + ]) + +def getfullargspec(func: object) -> FullArgSpec: ... + +# TODO make the field types more specific here +ArgInfo = NamedTuple('ArgInfo', [('args', List[str]), + ('varargs', Optional[str]), + ('keywords', Optional[str]), + ('locals', Dict[str, Any]), + ]) + +def getargvalues(frame: FrameType) -> ArgInfo: ... +def formatannotation(annotation: object, base_module: Optional[str] = ...) -> str: ... +def formatannotationrelativeto(object: object) -> Callable[[object], str]: ... +def formatargspec(args: List[str], + varargs: Optional[str] = ..., + varkw: Optional[str] = ..., + defaults: Optional[Tuple[Any, ...]] = ..., + kwonlyargs: Optional[List[str]] = ..., + kwonlydefaults: Optional[Dict[str, Any]] = ..., + annotations: Dict[str, Any] = ..., + formatarg: Callable[[str], str] = ..., + formatvarargs: Callable[[str], str] = ..., + formatvarkw: Callable[[str], str] = ..., + formatvalue: Callable[[Any], str] = ..., + formatreturns: Callable[[Any], str] = ..., + formatannotations: Callable[[Any], str] = ..., + ) -> str: ... +def formatargvalues(args: List[str], + varargs: Optional[str] = ..., + varkw: Optional[str] = ..., + locals: Optional[Dict[str, Any]] = ..., + formatarg: Optional[Callable[[str], str]] = ..., + formatvarargs: Optional[Callable[[str], str]] = ..., + formatvarkw: Optional[Callable[[str], str]] = ..., + formatvalue: Optional[Callable[[Any], str]] = ..., + ) -> str: ... +def getmro(cls: type) -> Tuple[type, ...]: ... + +def getcallargs(func: Callable[..., Any], + *args: Any, + **kwds: Any) -> Dict[str, Any]: ... + + +ClosureVars = NamedTuple('ClosureVars', [('nonlocals', Mapping[str, Any]), + ('globals', Mapping[str, Any]), + ('builtins', Mapping[str, Any]), + ('unbound', AbstractSet[str]), + ]) +def getclosurevars(func: Callable[..., Any]) -> ClosureVars: ... + +def unwrap(func: Callable[..., Any], + *, + stop: Optional[Callable[[Any], Any]] = ...) -> Any: ... + + +# +# The interpreter stack +# + +Traceback = NamedTuple( + 'Traceback', + [ + ('filename', str), + ('lineno', int), + ('function', str), + ('code_context', List[str]), + ('index', int), + ] +) + +# Python 3.5+ (functions returning it used to return regular tuples) +FrameInfo = NamedTuple('FrameInfo', [('frame', FrameType), + ('filename', str), + ('lineno', int), + ('function', str), + ('code_context', List[str]), + ('index', int), + ]) + +def getframeinfo(frame: Union[FrameType, TracebackType], context: int = ...) -> Traceback: ... +def getouterframes(frame: Any, context: int = ...) -> List[FrameInfo]: ... +def getinnerframes(traceback: TracebackType, context: int = ...) -> List[FrameInfo]: ... +def getlineno(frame: FrameType) -> int: ... +def currentframe() -> Optional[FrameType]: ... +def stack(context: int = ...) -> List[FrameInfo]: ... +def trace(context: int = ...) -> List[FrameInfo]: ... + +# +# Fetching attributes statically +# + +def getattr_static(obj: object, attr: str, default: Optional[Any] = ...) -> Any: ... + + +# +# Current State of Generators and Coroutines +# + +# TODO In the next two blocks of code, can we be more specific regarding the +# type of the "enums"? + +GEN_CREATED: str +GEN_RUNNING: str +GEN_SUSPENDED: str +GEN_CLOSED: str +def getgeneratorstate(generator: Generator[Any, Any, Any]) -> str: ... + +if sys.version_info >= (3, 5): + CORO_CREATED: str + CORO_RUNNING: str + CORO_SUSPENDED: str + CORO_CLOSED: str + # TODO can we be more specific than "object"? + def getcoroutinestate(coroutine: object) -> str: ... + +def getgeneratorlocals(generator: Generator[Any, Any, Any]) -> Dict[str, Any]: ... + +if sys.version_info >= (3, 5): + # TODO can we be more specific than "object"? + def getcoroutinelocals(coroutine: object) -> Dict[str, Any]: ... + +Attribute = NamedTuple('Attribute', [('name', str), + ('kind', str), + ('defining_class', type), + ('object', object), + ]) + +def classify_class_attrs(cls: type) -> List[Attribute]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/io.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/io.pyi new file mode 100644 index 0000000..903fab2 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/io.pyi @@ -0,0 +1,210 @@ +from typing import ( + List, BinaryIO, TextIO, Iterator, Union, Optional, Callable, Tuple, Type, Any, IO, Iterable +) +import builtins +import codecs +from mmap import mmap +import sys +from types import TracebackType +from typing import TypeVar + +_bytearray_like = Union[bytearray, mmap] + +DEFAULT_BUFFER_SIZE: int + +SEEK_SET: int +SEEK_CUR: int +SEEK_END: int + +_T = TypeVar('_T', bound='IOBase') + +open = builtins.open + +BlockingIOError = builtins.BlockingIOError +class UnsupportedOperation(OSError, ValueError): ... + +class IOBase: + def __iter__(self) -> Iterator[bytes]: ... + def __next__(self) -> bytes: ... + def __enter__(self: _T) -> _T: ... + def __exit__(self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], + exc_tb: Optional[TracebackType]) -> bool: ... + def close(self) -> None: ... + def fileno(self) -> int: ... + def flush(self) -> None: ... + def isatty(self) -> bool: ... + def readable(self) -> bool: ... + def readlines(self, hint: int = ...) -> List[bytes]: ... + def seek(self, offset: int, whence: int = ...) -> int: ... + def seekable(self) -> bool: ... + def tell(self) -> int: ... + def truncate(self, size: Optional[int] = ...) -> int: ... + def writable(self) -> bool: ... + def writelines(self, lines: Iterable[Union[bytes, bytearray]]) -> None: ... + def readline(self, size: int = ...) -> bytes: ... + def __del__(self) -> None: ... + @property + def closed(self) -> bool: ... + +class RawIOBase(IOBase): + def readall(self) -> bytes: ... + def readinto(self, b: bytearray) -> Optional[int]: ... + def write(self, b: Union[bytes, bytearray]) -> Optional[int]: ... + def read(self, size: int = ...) -> Optional[bytes]: ... + +class BufferedIOBase(IOBase): + def detach(self) -> RawIOBase: ... + def readinto(self, b: _bytearray_like) -> int: ... + def write(self, b: Union[bytes, bytearray]) -> int: ... + if sys.version_info >= (3, 5): + def readinto1(self, b: _bytearray_like) -> int: ... + def read(self, size: Optional[int] = ...) -> bytes: ... + def read1(self, size: int = ...) -> bytes: ... + + +class FileIO(RawIOBase): + mode: str + name: Union[int, str] + def __init__( + self, + name: Union[str, bytes, int], + mode: str = ..., + closefd: bool = ..., + opener: Optional[Callable[[Union[int, str], str], int]] = ... + ) -> None: ... + +# TODO should extend from BufferedIOBase +class BytesIO(BinaryIO): + def __init__(self, initial_bytes: bytes = ...) -> None: ... + # BytesIO does not contain a "name" field. This workaround is necessary + # to allow BytesIO sub-classes to add this field, as it is defined + # as a read-only property on IO[]. + name: Any + def getvalue(self) -> bytes: ... + def getbuffer(self) -> memoryview: ... + # copied from IOBase + def __iter__(self) -> Iterator[bytes]: ... + def __next__(self) -> bytes: ... + def __enter__(self) -> BytesIO: ... + def __exit__(self, t: Optional[Type[BaseException]] = ..., value: Optional[BaseException] = ..., + traceback: Optional[TracebackType] = ...) -> bool: ... + def close(self) -> None: ... + def fileno(self) -> int: ... + def flush(self) -> None: ... + def isatty(self) -> bool: ... + def readable(self) -> bool: ... + def readlines(self, hint: int = ...) -> List[bytes]: ... + def seek(self, offset: int, whence: int = ...) -> int: ... + def seekable(self) -> bool: ... + def tell(self) -> int: ... + def truncate(self, size: Optional[int] = ...) -> int: ... + def writable(self) -> bool: ... + # TODO should be the next line instead + # def writelines(self, lines: List[Union[bytes, bytearray]]) -> None: ... + def writelines(self, lines: Any) -> None: ... + def readline(self, size: int = ...) -> bytes: ... + def __del__(self) -> None: ... + closed: bool + # copied from BufferedIOBase + def detach(self) -> RawIOBase: ... + def readinto(self, b: _bytearray_like) -> int: ... + def write(self, b: Union[bytes, bytearray]) -> int: ... + if sys.version_info >= (3, 5): + def readinto1(self, b: _bytearray_like) -> int: ... + def read(self, size: Optional[int] = ...) -> bytes: ... + def read1(self, size: int = ...) -> bytes: ... + +class BufferedReader(BufferedIOBase): + def __init__(self, raw: RawIOBase, buffer_size: int = ...) -> None: ... + def peek(self, size: int = ...) -> bytes: ... + +class BufferedWriter(BufferedIOBase): + def __init__(self, raw: RawIOBase, buffer_size: int = ...) -> None: ... + def flush(self) -> None: ... + def write(self, b: Union[bytes, bytearray]) -> int: ... + +class BufferedRandom(BufferedReader, BufferedWriter): + def __init__(self, raw: RawIOBase, buffer_size: int = ...) -> None: ... + def seek(self, offset: int, whence: int = ...) -> int: ... + def tell(self) -> int: ... + +class BufferedRWPair(BufferedIOBase): + def __init__(self, reader: RawIOBase, writer: RawIOBase, + buffer_size: int = ...) -> None: ... + + +class TextIOBase(IOBase): + encoding: str + errors: Optional[str] + newlines: Union[str, Tuple[str, ...], None] + def __iter__(self) -> Iterator[str]: ... # type: ignore + def __next__(self) -> str: ... # type: ignore + def detach(self) -> IOBase: ... + def write(self, s: str) -> int: ... + def writelines(self, lines: List[str]) -> None: ... # type: ignore + def readline(self, size: int = ...) -> str: ... # type: ignore + def readlines(self, hint: int = ...) -> List[str]: ... # type: ignore + def read(self, size: Optional[int] = ...) -> str: ... + def seek(self, offset: int, whence: int = ...) -> int: ... + def tell(self) -> int: ... + +# TODO should extend from TextIOBase +class TextIOWrapper(TextIO): + line_buffering: bool + # TODO uncomment after fixing mypy about using write_through + # def __init__(self, buffer: IO[bytes], encoding: str = ..., + # errors: Optional[str] = ..., newline: Optional[str] = ..., + # line_buffering: bool = ..., write_through: bool = ...) \ + # -> None: ... + def __init__( + self, + buffer: IO[bytes], + encoding: str = ..., + errors: Optional[str] = ..., + newline: Optional[str] = ..., + line_buffering: bool = ..., + write_through: bool = ... + ) -> None: ... + # copied from IOBase + def __exit__(self, t: Optional[Type[BaseException]] = ..., value: Optional[BaseException] = ..., + traceback: Optional[TracebackType] = ...) -> bool: ... + def close(self) -> None: ... + def fileno(self) -> int: ... + def flush(self) -> None: ... + def isatty(self) -> bool: ... + def readable(self) -> bool: ... + def readlines(self, hint: int = ...) -> List[str]: ... + def seekable(self) -> bool: ... + def truncate(self, size: Optional[int] = ...) -> int: ... + def writable(self) -> bool: ... + # TODO should be the next line instead + # def writelines(self, lines: List[str]) -> None: ... + def writelines(self, lines: Any) -> None: ... + def __del__(self) -> None: ... + closed: bool + # copied from TextIOBase + encoding: str + errors: Optional[str] + newlines: Union[str, Tuple[str, ...], None] + def __iter__(self) -> Iterator[str]: ... + def __next__(self) -> str: ... + def __enter__(self) -> TextIO: ... + def detach(self) -> IOBase: ... + def write(self, s: str) -> int: ... + def readline(self, size: int = ...) -> str: ... + def read(self, size: Optional[int] = ...) -> str: ... + def seek(self, offset: int, whence: int = ...) -> int: ... + def tell(self) -> int: ... + +class StringIO(TextIOWrapper): + def __init__(self, initial_value: str = ..., + newline: Optional[str] = ...) -> None: ... + # StringIO does not contain a "name" field. This workaround is necessary + # to allow StringIO sub-classes to add this field, as it is defined + # as a read-only property on IO[]. + name: Any + def getvalue(self) -> str: ... + def __enter__(self) -> StringIO: ... + +class IncrementalNewlineDecoder(codecs.IncrementalDecoder): + def decode(self, input: bytes, final: bool = ...) -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/ipaddress.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/ipaddress.pyi new file mode 100644 index 0000000..f706330 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/ipaddress.pyi @@ -0,0 +1,151 @@ +import sys +from typing import (Any, Container, Generic, Iterable, Iterator, Optional, + overload, SupportsInt, Tuple, TypeVar) + +# Undocumented length constants +IPV4LENGTH: int +IPV6LENGTH: int + +_A = TypeVar("_A", IPv4Address, IPv6Address) +_N = TypeVar("_N", IPv4Network, IPv6Network) +_T = TypeVar("_T") + +def ip_address(address: object) -> Any: ... # morally Union[IPv4Address, IPv6Address] +def ip_network(address: object, strict: bool = ...) -> Any: ... # morally Union[IPv4Network, IPv6Network] +def ip_interface(address: object) -> Any: ... # morally Union[IPv4Interface, IPv6Interface] + +class _IPAddressBase: + def __eq__(self, other: Any) -> bool: ... + def __ge__(self: _T, other: _T) -> bool: ... + def __gt__(self: _T, other: _T) -> bool: ... + def __le__(self: _T, other: _T) -> bool: ... + def __lt__(self: _T, other: _T) -> bool: ... + def __ne__(self, other: Any) -> bool: ... + @property + def compressed(self) -> str: ... + @property + def exploded(self) -> str: ... + if sys.version_info >= (3, 5): + @property + def reverse_pointer(self) -> str: ... + @property + def version(self) -> int: ... + +class _BaseAddress(_IPAddressBase, SupportsInt): + def __init__(self, address: object) -> None: ... + def __add__(self: _T, other: int) -> _T: ... + def __hash__(self) -> int: ... + def __int__(self) -> int: ... + def __sub__(self: _T, other: int) -> _T: ... + @property + def is_global(self) -> bool: ... + @property + def is_link_local(self) -> bool: ... + @property + def is_loopback(self) -> bool: ... + @property + def is_multicast(self) -> bool: ... + @property + def is_private(self) -> bool: ... + @property + def is_reserved(self) -> bool: ... + @property + def is_unspecified(self) -> bool: ... + @property + def max_prefixlen(self) -> int: ... + @property + def packed(self) -> bytes: ... + +class _BaseNetwork(_IPAddressBase, Container, Iterable[_A], Generic[_A]): + network_address: _A + netmask: _A + def __init__(self, address: object, strict: bool = ...) -> None: ... + def __contains__(self, other: Any) -> bool: ... + def __getitem__(self, n: int) -> _A: ... + def __iter__(self) -> Iterator[_A]: ... + def address_exclude(self: _T, other: _T) -> Iterator[_T]: ... + @property + def broadcast_address(self) -> _A: ... + def compare_networks(self: _T, other: _T) -> int: ... + def hosts(self) -> Iterator[_A]: ... + @property + def is_global(self) -> bool: ... + @property + def is_link_local(self) -> bool: ... + @property + def is_loopback(self) -> bool: ... + @property + def is_multicast(self) -> bool: ... + @property + def is_private(self) -> bool: ... + @property + def is_reserved(self) -> bool: ... + @property + def is_unspecified(self) -> bool: ... + @property + def max_prefixlen(self) -> int: ... + @property + def num_addresses(self) -> int: ... + def overlaps(self: _T, other: _T) -> bool: ... + @property + def prefixlen(self) -> int: ... + def subnets(self: _T, prefixlen_diff: int = ..., new_prefix: Optional[int] = ...) -> Iterator[_T]: ... + def supernet(self: _T, prefixlen_diff: int = ..., new_prefix: Optional[int] = ...) -> _T: ... + @property + def with_hostmask(self) -> str: ... + @property + def with_netmask(self) -> str: ... + @property + def with_prefixlen(self) -> str: ... + @property + def hostmask(self) -> _A: ... + +class _BaseInterface(_BaseAddress, Generic[_A, _N]): + hostmask: _A + netmask: _A + network: _N + @property + def ip(self) -> _A: ... + @property + def with_hostmask(self) -> str: ... + @property + def with_netmask(self) -> str: ... + @property + def with_prefixlen(self) -> str: ... + +class IPv4Address(_BaseAddress): ... +class IPv4Network(_BaseNetwork[IPv4Address]): ... +class IPv4Interface(IPv4Address, _BaseInterface[IPv4Address, IPv4Network]): ... + +class IPv6Address(_BaseAddress): + @property + def ipv4_mapped(self) -> Optional[IPv4Address]: ... + @property + def is_site_local(self) -> bool: ... + @property + def sixtofour(self) -> Optional[IPv4Address]: ... + @property + def teredo(self) -> Optional[Tuple[IPv4Address, IPv4Address]]: ... + +class IPv6Network(_BaseNetwork[IPv6Address]): + @property + def is_site_local(self) -> bool: ... + +class IPv6Interface(IPv6Address, _BaseInterface[IPv6Address, IPv6Network]): ... + +def v4_int_to_packed(address: int) -> bytes: ... +def v6_int_to_packed(address: int) -> bytes: ... +@overload +def summarize_address_range(first: IPv4Address, last: IPv4Address) -> Iterator[IPv4Network]: ... +@overload +def summarize_address_range(first: IPv6Address, last: IPv6Address) -> Iterator[IPv6Network]: ... +def collapse_addresses(addresses: Iterable[_N]) -> Iterator[_N]: ... +@overload +def get_mixed_type_key(obj: _A) -> Tuple[int, _A]: ... +@overload +def get_mixed_type_key(obj: IPv4Network) -> Tuple[int, IPv4Address, IPv4Address]: ... +@overload +def get_mixed_type_key(obj: IPv6Network) -> Tuple[int, IPv6Address, IPv6Address]: ... + +class AddressValueError(ValueError): ... +class NetmaskValueError(ValueError): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/itertools.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/itertools.pyi new file mode 100644 index 0000000..f34dd5b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/itertools.pyi @@ -0,0 +1,106 @@ +# Stubs for itertools + +# Based on http://docs.python.org/3.2/library/itertools.html + +from typing import (Iterator, TypeVar, Iterable, overload, Any, Callable, Tuple, + Generic, Optional) + +_T = TypeVar('_T') +_S = TypeVar('_S') +_N = TypeVar('_N', int, float) +Predicate = Callable[[_T], object] + +def count(start: _N = ..., + step: _N = ...) -> Iterator[_N]: ... # more general types? +def cycle(iterable: Iterable[_T]) -> Iterator[_T]: ... + +@overload +def repeat(object: _T) -> Iterator[_T]: ... +@overload +def repeat(object: _T, times: int) -> Iterator[_T]: ... + +def accumulate(iterable: Iterable[_T], func: Callable[[_T, _T], _T] = ...) -> Iterator[_T]: ... + +class chain(Iterator[_T], Generic[_T]): + def __init__(self, *iterables: Iterable[_T]) -> None: ... + def __next__(self) -> _T: ... + def __iter__(self) -> Iterator[_T]: ... + @staticmethod + def from_iterable(iterable: Iterable[Iterable[_S]]) -> Iterator[_S]: ... + +def compress(data: Iterable[_T], selectors: Iterable[Any]) -> Iterator[_T]: ... +def dropwhile(predicate: Predicate[_T], + iterable: Iterable[_T]) -> Iterator[_T]: ... +def filterfalse(predicate: Optional[Predicate[_T]], + iterable: Iterable[_T]) -> Iterator[_T]: ... + +@overload +def groupby(iterable: Iterable[_T], key: None = ...) -> Iterator[Tuple[_T, Iterator[_T]]]: ... +@overload +def groupby(iterable: Iterable[_T], key: Callable[[_T], _S]) -> Iterator[Tuple[_S, Iterator[_T]]]: ... + +@overload +def islice(iterable: Iterable[_T], stop: Optional[int]) -> Iterator[_T]: ... +@overload +def islice(iterable: Iterable[_T], start: Optional[int], stop: Optional[int], + step: Optional[int] = ...) -> Iterator[_T]: ... + +def starmap(func: Callable[..., _S], iterable: Iterable[Iterable[Any]]) -> Iterator[_S]: ... +def takewhile(predicate: Predicate[_T], + iterable: Iterable[_T]) -> Iterator[_T]: ... +def tee(iterable: Iterable[_T], n: int = ...) -> Tuple[Iterator[_T], ...]: ... +def zip_longest(*p: Iterable[Any], + fillvalue: Any = ...) -> Iterator[Any]: ... + +_T1 = TypeVar('_T1') +_T2 = TypeVar('_T2') +_T3 = TypeVar('_T3') +_T4 = TypeVar('_T4') +_T5 = TypeVar('_T5') +_T6 = TypeVar('_T6') + +@overload +def product(iter1: Iterable[_T1]) -> Iterator[Tuple[_T1]]: ... +@overload +def product(iter1: Iterable[_T1], + iter2: Iterable[_T2]) -> Iterator[Tuple[_T1, _T2]]: ... +@overload +def product(iter1: Iterable[_T1], + iter2: Iterable[_T2], + iter3: Iterable[_T3]) -> Iterator[Tuple[_T1, _T2, _T3]]: ... +@overload +def product(iter1: Iterable[_T1], + iter2: Iterable[_T2], + iter3: Iterable[_T3], + iter4: Iterable[_T4]) -> Iterator[Tuple[_T1, _T2, _T3, _T4]]: ... +@overload +def product(iter1: Iterable[_T1], + iter2: Iterable[_T2], + iter3: Iterable[_T3], + iter4: Iterable[_T4], + iter5: Iterable[_T5]) -> Iterator[Tuple[_T1, _T2, _T3, _T4, _T5]]: ... +@overload +def product(iter1: Iterable[_T1], + iter2: Iterable[_T2], + iter3: Iterable[_T3], + iter4: Iterable[_T4], + iter5: Iterable[_T5], + iter6: Iterable[_T6]) -> Iterator[Tuple[_T1, _T2, _T3, _T4, _T5, _T6]]: ... +@overload +def product(iter1: Iterable[Any], + iter2: Iterable[Any], + iter3: Iterable[Any], + iter4: Iterable[Any], + iter5: Iterable[Any], + iter6: Iterable[Any], + iter7: Iterable[Any], + *iterables: Iterable[Any]) -> Iterator[Tuple[Any, ...]]: ... +@overload +def product(*iterables: Iterable[Any], repeat: int = ...) -> Iterator[Tuple[Any, ...]]: ... + +def permutations(iterable: Iterable[_T], + r: Optional[int] = ...) -> Iterator[Tuple[_T, ...]]: ... +def combinations(iterable: Iterable[_T], + r: int) -> Iterator[Tuple[_T, ...]]: ... +def combinations_with_replacement(iterable: Iterable[_T], + r: int) -> Iterator[Tuple[_T, ...]]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/json/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/json/__init__.pyi new file mode 100644 index 0000000..620b239 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/json/__init__.pyi @@ -0,0 +1,58 @@ +import sys +from typing import Any, IO, Optional, Tuple, Callable, Dict, List, Union, Protocol + +from .decoder import JSONDecoder as JSONDecoder +from .encoder import JSONEncoder as JSONEncoder +if sys.version_info >= (3, 5): + from .decoder import JSONDecodeError as JSONDecodeError + +def dumps(obj: Any, + skipkeys: bool = ..., + ensure_ascii: bool = ..., + check_circular: bool = ..., + allow_nan: bool = ..., + cls: Any = ..., + indent: Union[None, int, str] = ..., + separators: Optional[Tuple[str, str]] = ..., + default: Optional[Callable[[Any], Any]] = ..., + sort_keys: bool = ..., + **kwds: Any) -> str: ... + +def dump(obj: Any, + fp: IO[str], + skipkeys: bool = ..., + ensure_ascii: bool = ..., + check_circular: bool = ..., + allow_nan: bool = ..., + cls: Any = ..., + indent: Union[None, int, str] = ..., + separators: Optional[Tuple[str, str]] = ..., + default: Optional[Callable[[Any], Any]] = ..., + sort_keys: bool = ..., + **kwds: Any) -> None: ... + +if sys.version_info >= (3, 6): + _LoadsString = Union[str, bytes, bytearray] +else: + _LoadsString = str +def loads(s: _LoadsString, + encoding: Any = ..., # ignored and deprecated + cls: Any = ..., + object_hook: Optional[Callable[[Dict], Any]] = ..., + parse_float: Optional[Callable[[str], Any]] = ..., + parse_int: Optional[Callable[[str], Any]] = ..., + parse_constant: Optional[Callable[[str], Any]] = ..., + object_pairs_hook: Optional[Callable[[List[Tuple[Any, Any]]], Any]] = ..., + **kwds: Any) -> Any: ... + +class _Reader(Protocol): + def read(self) -> _LoadsString: ... + +def load(fp: _Reader, + cls: Any = ..., + object_hook: Optional[Callable[[Dict], Any]] = ..., + parse_float: Optional[Callable[[str], Any]] = ..., + parse_int: Optional[Callable[[str], Any]] = ..., + parse_constant: Optional[Callable[[str], Any]] = ..., + object_pairs_hook: Optional[Callable[[List[Tuple[Any, Any]]], Any]] = ..., + **kwds: Any) -> Any: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/json/decoder.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/json/decoder.pyi new file mode 100644 index 0000000..8e30c1e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/json/decoder.pyi @@ -0,0 +1,28 @@ +import sys +from typing import Any, Callable, Dict, List, Optional, Tuple + +if sys.version_info >= (3, 5): + class JSONDecodeError(ValueError): + msg: str + doc: str + pos: int + lineno: int + colno: int + def __init__(self, msg: str, doc: str, pos: int) -> None: ... + +class JSONDecoder: + object_hook: Callable[[Dict[str, Any]], Any] + parse_float: Callable[[str], Any] + parse_int: Callable[[str], Any] + parse_constant = ... # Callable[[str], Any] + strict: bool + object_pairs_hook: Callable[[List[Tuple[str, Any]]], Any] + + def __init__(self, object_hook: Optional[Callable[[Dict[str, Any]], Any]] = ..., + parse_float: Optional[Callable[[str], Any]] = ..., + parse_int: Optional[Callable[[str], Any]] = ..., + parse_constant: Optional[Callable[[str], Any]] = ..., + strict: bool = ..., + object_pairs_hook: Optional[Callable[[List[Tuple[str, Any]]], Any]] = ...) -> None: ... + def decode(self, s: str) -> Any: ... + def raw_decode(self, s: str, idx: int = ...) -> Tuple[Any, int]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/json/encoder.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/json/encoder.pyi new file mode 100644 index 0000000..e35f344 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/json/encoder.pyi @@ -0,0 +1,21 @@ +from typing import Any, Callable, Iterator, Optional, Tuple + +class JSONEncoder: + item_separator: str + key_separator: str + + skipkeys: bool + ensure_ascii: bool + check_circular: bool + allow_nan: bool + sort_keys: bool + indent: int + + def __init__(self, skipkeys: bool = ..., ensure_ascii: bool = ..., + check_circular: bool = ..., allow_nan: bool = ..., sort_keys: bool = ..., + indent: Optional[int] = ..., separators: Optional[Tuple[str, str]] = ..., + default: Optional[Callable] = ...) -> None: ... + + def default(self, o: Any) -> Any: ... + def encode(self, o: Any) -> str: ... + def iterencode(self, o: Any, _one_shot: bool = ...) -> Iterator[str]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/lzma.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/lzma.pyi new file mode 100644 index 0000000..cd0a088 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/lzma.pyi @@ -0,0 +1,107 @@ +import io +import sys +from typing import Any, IO, Mapping, Optional, Sequence, Union + +if sys.version_info >= (3, 6): + from os import PathLike + _PathOrFile = Union[str, bytes, IO[Any], PathLike[Any]] +else: + _PathOrFile = Union[str, bytes, IO[Any]] + +_FilterChain = Sequence[Mapping[str, Any]] + +FORMAT_AUTO: int +FORMAT_XZ: int +FORMAT_ALONE: int +FORMAT_RAW: int +CHECK_NONE: int +CHECK_CRC32: int +CHECK_CRC64: int +CHECK_SHA256: int +CHECK_ID_MAX: int +CHECK_UNKNOWN: int +FILTER_LZMA1: int +FILTER_LZMA2: int +FILTER_DELTA: int +FILTER_X86: int +FILTER_IA64: int +FILTER_ARM: int +FILTER_ARMTHUMB: int +FILTER_SPARC: int +FILTER_POWERPC: int +MF_HC3: int +MF_HC4: int +MF_BT2: int +MF_BT3: int +MF_BT4: int +MODE_FAST: int +MODE_NORMAL: int +PRESET_DEFAULT: int +PRESET_EXTREME: int + +# from _lzma.c +class LZMADecompressor(object): + def __init__(self, format: Optional[int] = ..., memlimit: Optional[int] = ..., filters: Optional[_FilterChain] = ...) -> None: ... + def decompress(self, data: bytes, max_length: int = ...) -> bytes: ... + @property + def check(self) -> int: ... + @property + def eof(self) -> bool: ... + @property + def unused_data(self) -> bytes: ... + if sys.version_info >= (3, 5): + @property + def needs_input(self) -> bool: ... + +# from _lzma.c +class LZMACompressor(object): + def __init__(self, + format: Optional[int] = ..., + check: int = ..., + preset: Optional[int] = ..., + filters: Optional[_FilterChain] = ...) -> None: ... + def compress(self, data: bytes) -> bytes: ... + def flush(self) -> bytes: ... + + +class LZMAError(Exception): ... + + +class LZMAFile(io.BufferedIOBase, IO[bytes]): # type: ignore # python/mypy#5027 + def __init__(self, + filename: Optional[_PathOrFile] = ..., + mode: str = ..., + *, + format: Optional[int] = ..., + check: int = ..., + preset: Optional[int] = ..., + filters: Optional[_FilterChain] = ...) -> None: ... + def close(self) -> None: ... + @property + def closed(self) -> bool: ... + def fileno(self) -> int: ... + def seekable(self) -> bool: ... + def readable(self) -> bool: ... + def writable(self) -> bool: ... + def peek(self, size: int = ...) -> bytes: ... + def read(self, size: Optional[int] = ...) -> bytes: ... + def read1(self, size: int = ...) -> bytes: ... + def readline(self, size: int = ...) -> bytes: ... + def write(self, data: bytes) -> int: ... + def seek(self, offset: int, whence: int = ...) -> int: ... + def tell(self) -> int: ... + + +def open(filename: _PathOrFile, + mode: str = ..., + *, + format: Optional[int] = ..., + check: int = ..., + preset: Optional[int] = ..., + filters: Optional[_FilterChain] = ..., + encoding: Optional[str] = ..., + errors: Optional[str] = ..., + newline: Optional[str] = ...) -> IO[Any]: ... +def compress(data: bytes, format: int = ..., check: int = ..., preset: Optional[int] = ..., filters: Optional[_FilterChain] = ...) -> bytes: ... +def decompress(data: bytes, format: int = ..., memlimit: Optional[int] = ..., filters: Optional[_FilterChain] = ...) -> bytes: ... +def is_check_supported(check: int) -> bool: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/msvcrt.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/msvcrt.pyi new file mode 100644 index 0000000..bcab64c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/msvcrt.pyi @@ -0,0 +1,8 @@ +# Stubs for msvcrt + +# NOTE: These are incomplete! + +from typing import overload, BinaryIO, TextIO + +def get_osfhandle(file: int) -> int: ... +def open_osfhandle(handle: int, flags: int) -> int: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/multiprocessing/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/multiprocessing/__init__.pyi new file mode 100644 index 0000000..e5fad0a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/multiprocessing/__init__.pyi @@ -0,0 +1,85 @@ +# Stubs for multiprocessing + +from typing import ( + Any, Callable, ContextManager, Iterable, Mapping, Optional, Dict, List, + Union, Sequence, Tuple +) + +from logging import Logger +from multiprocessing import connection, pool, spawn, synchronize +from multiprocessing.context import ( + BaseContext, + ProcessError as ProcessError, BufferTooShort as BufferTooShort, TimeoutError as TimeoutError, AuthenticationError as AuthenticationError) +from multiprocessing.managers import SyncManager +from multiprocessing.process import current_process as current_process +from multiprocessing.queues import Queue as Queue, SimpleQueue as SimpleQueue, JoinableQueue as JoinableQueue +from multiprocessing.spawn import freeze_support as freeze_support +from multiprocessing.spawn import set_executable as set_executable + +import sys + +# N.B. The functions below are generated at runtime by partially applying +# multiprocessing.context.BaseContext's methods, so the two signatures should +# be identical (modulo self). + +# Sychronization primitives +_LockLike = Union[synchronize.Lock, synchronize.RLock] +def Barrier(parties: int, + action: Optional[Callable] = ..., + timeout: Optional[float] = ...) -> synchronize.Barrier: ... +def BoundedSemaphore(value: int = ...) -> synchronize.BoundedSemaphore: ... +def Condition(lock: Optional[_LockLike] = ...) -> synchronize.Condition: ... +def Event(lock: Optional[_LockLike] = ...) -> synchronize.Event: ... +def Lock() -> synchronize.Lock: ... +def RLock() -> synchronize.RLock: ... +def Semaphore(value: int = ...) -> synchronize.Semaphore: ... + +def Pipe(duplex: bool = ...) -> Tuple[connection.Connection, connection.Connection]: ... + +def Pool(processes: Optional[int] = ..., + initializer: Optional[Callable[..., Any]] = ..., + initargs: Iterable[Any] = ..., + maxtasksperchild: Optional[int] = ...) -> pool.Pool: ... + +class Process(): + name: str + daemon: bool + pid: Optional[int] + exitcode: Optional[int] + authkey: bytes + sentinel: int + # TODO: set type of group to None + def __init__(self, + group: Any = ..., + target: Optional[Callable] = ..., + name: Optional[str] = ..., + args: Iterable[Any] = ..., + kwargs: Mapping[Any, Any] = ..., + *, + daemon: Optional[bool] = ...) -> None: ... + def start(self) -> None: ... + def run(self) -> None: ... + def terminate(self) -> None: ... + if sys.version_info >= (3, 7): + def kill(self) -> None: ... + def close(self) -> None: ... + def is_alive(self) -> bool: ... + def join(self, timeout: Optional[float] = ...) -> None: ... + +class Value(): + value: Any = ... + def __init__(self, typecode_or_type: str, *args: Any, lock: Union[bool, _LockLike] = ...) -> None: ... + def get_lock(self) -> _LockLike: ... + +# ----- multiprocessing function stubs ----- +def active_children() -> List[Process]: ... +def allow_connection_pickling() -> None: ... +def cpu_count() -> int: ... +def get_logger() -> Logger: ... +def log_to_stderr(level: Optional[Union[str, int]] = ...) -> Logger: ... +def Manager() -> SyncManager: ... +def set_forkserver_preload(module_names: List[str]) -> None: ... +def get_all_start_methods() -> List[str]: ... +def get_context(method: Optional[str] = ...) -> BaseContext: ... +def get_start_method(allow_none: Optional[bool]) -> Optional[str]: ... +def set_start_method(method: str, force: Optional[bool] = ...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/multiprocessing/connection.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/multiprocessing/connection.pyi new file mode 100644 index 0000000..76bdca0 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/multiprocessing/connection.pyi @@ -0,0 +1,48 @@ +from typing import Any, Iterable, List, Optional, Tuple, Type, Union +import socket +import sys +import types + +# https://docs.python.org/3/library/multiprocessing.html#address-formats +_Address = Union[str, Tuple[str, int]] + +class _ConnectionBase: + @property + def closed(self) -> bool: ... # undocumented + @property + def readable(self) -> bool: ... # undocumented + @property + def writable(self) -> bool: ... # undocumented + def fileno(self) -> int: ... + def close(self) -> None: ... + def send_bytes(self, + buf: bytes, + offset: int = ..., + size: Optional[int] = ...) -> None: ... + def send(self, obj: Any) -> None: ... + def recv_bytes(self, maxlength: Optional[int] = ...) -> bytes: ... + def recv_bytes_into(self, buf: Any, offset: int = ...) -> int: ... + def recv(self) -> Any: ... + def poll(self, timeout: Optional[float] = ...) -> bool: ... + +class Connection(_ConnectionBase): ... + +if sys.platform == "win32": + class PipeConnection(_ConnectionBase): ... + +class Listener: + def __init__(self, address: Optional[_Address] = ..., family: Optional[str] = ..., backlog: int = ..., authkey: Optional[bytes] = ...) -> None: ... + def accept(self) -> Connection: ... + def close(self) -> None: ... + @property + def address(self) -> _Address: ... + @property + def last_accepted(self) -> Optional[_Address]: ... + def __enter__(self) -> Listener: ... + def __exit__(self, exc_type: Optional[Type[BaseException]], exc_value: Optional[BaseException], exc_tb: Optional[types.TracebackType]) -> None: ... + +def deliver_challenge(connection: Connection, authkey: bytes) -> None: ... +def answer_challenge(connection: Connection, authkey: bytes) -> None: ... +def wait(object_list: Iterable[Union[Connection, socket.socket, int]], timeout: Optional[float] = ...) -> List[Union[Connection, socket.socket, int]]: ... +def Client(address: _Address, family: Optional[str] = ..., authkey: Optional[bytes] = ...) -> Connection: ... +def Pipe(duplex: bool = ...) -> Tuple[Connection, Connection]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/multiprocessing/context.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/multiprocessing/context.pyi new file mode 100644 index 0000000..dada9b3 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/multiprocessing/context.pyi @@ -0,0 +1,179 @@ +# Stubs for multiprocessing.context + +from logging import Logger +import multiprocessing +from multiprocessing import synchronize +from multiprocessing import queues +import sys +from typing import ( + Any, Callable, Iterable, Optional, List, Mapping, Sequence, Tuple, Type, + Union, +) + +_LockLike = Union[synchronize.Lock, synchronize.RLock] + +class ProcessError(Exception): ... + +class BufferTooShort(ProcessError): ... + +class TimeoutError(ProcessError): ... + +class AuthenticationError(ProcessError): ... + +class BaseContext(object): + ProcessError: Type[Exception] + BufferTooShort: Type[Exception] + TimeoutError: Type[Exception] + AuthenticationError: Type[Exception] + + # N.B. The methods below are applied at runtime to generate + # multiprocessing.*, so the signatures should be identical (modulo self). + + @staticmethod + def current_process() -> multiprocessing.Process: ... + @staticmethod + def active_children() -> List[multiprocessing.Process]: ... + def cpu_count(self) -> int: ... + # TODO: change return to SyncManager once a stub exists in multiprocessing.managers + def Manager(self) -> Any: ... + # TODO: change return to Pipe once a stub exists in multiprocessing.connection + def Pipe(self, duplex: bool) -> Any: ... + + def Barrier(self, + parties: int, + action: Optional[Callable] = ..., + timeout: Optional[float] = ...) -> synchronize.Barrier: ... + def BoundedSemaphore(self, + value: int = ...) -> synchronize.BoundedSemaphore: ... + def Condition(self, + lock: Optional[_LockLike] = ...) -> synchronize.Condition: ... + def Event(self, lock: Optional[_LockLike] = ...) -> synchronize.Event: ... + def Lock(self) -> synchronize.Lock: ... + def RLock(self) -> synchronize.RLock: ... + def Semaphore(self, value: int = ...) -> synchronize.Semaphore: ... + + def Queue(self, maxsize: int = ...) -> queues.Queue: ... + def JoinableQueue(self, maxsize: int = ...) -> queues.JoinableQueue: ... + def SimpleQueue(self) -> queues.SimpleQueue: ... + def Pool( + self, + processes: Optional[int] = ..., + initializer: Optional[Callable[..., Any]] = ..., + initargs: Iterable[Any] = ..., + maxtasksperchild: Optional[int] = ... + ) -> multiprocessing.pool.Pool: ... + def Process( + self, + group: Any = ..., + target: Optional[Callable] = ..., + name: Optional[str] = ..., + args: Iterable[Any] = ..., + kwargs: Mapping[Any, Any] = ..., + *, + daemon: Optional[bool] = ... + ) -> multiprocessing.Process: ... + # TODO: typecode_or_type param is a ctype with a base class of _SimpleCData or array.typecode Need to figure out + # how to handle the ctype + # TODO: change return to RawValue once a stub exists in multiprocessing.sharedctypes + def RawValue(self, typecode_or_type: Any, *args: Any) -> Any: ... + # TODO: typecode_or_type param is a ctype with a base class of _SimpleCData or array.typecode Need to figure out + # how to handle the ctype + # TODO: change return to RawArray once a stub exists in multiprocessing.sharedctypes + def RawArray(self, typecode_or_type: Any, size_or_initializer: Union[int, Sequence[Any]]) -> Any: ... + # TODO: typecode_or_type param is a ctype with a base class of _SimpleCData or array.typecode Need to figure out + # how to handle the ctype + # TODO: change return to Value once a stub exists in multiprocessing.sharedctypes + def Value( + self, + typecode_or_type: Any, + *args: Any, + lock: bool = ... + ) -> Any: ... + # TODO: typecode_or_type param is a ctype with a base class of _SimpleCData or array.typecode Need to figure out + # how to handle the ctype + # TODO: change return to Array once a stub exists in multiprocessing.sharedctypes + def Array( + self, + typecode_or_type: Any, + size_or_initializer: Union[int, Sequence[Any]], + *, + lock: bool = ... + ) -> Any: ... + def freeze_support(self) -> None: ... + def get_logger(self) -> Logger: ... + def log_to_stderr(self, level: Optional[str] = ...) -> Logger: ... + def allow_connection_pickling(self) -> None: ... + def set_executable(self, executable: str) -> None: ... + def set_forkserver_preload(self, module_names: List[str]) -> None: ... + def get_context(self, method: Optional[str] = ...) -> BaseContext: ... + def get_start_method(self, allow_none: bool = ...) -> str: ... + def set_start_method(self, method: Optional[str] = ...) -> None: ... + @property + def reducer(self) -> str: ... + @reducer.setter + def reducer(self, reduction: str) -> None: ... + def _check_available(self) -> None: ... + +class Process(object): + _start_method: Optional[str] + @staticmethod + # TODO: type should be BaseProcess once a stub in multiprocessing.process exists + def _Popen(process_obj: Any) -> DefaultContext: ... + +class DefaultContext(object): + Process: Type[multiprocessing.Process] + + def __init__(self, context: BaseContext) -> None: ... + def get_context(self, method: Optional[str] = ...) -> BaseContext: ... + def set_start_method(self, method: str, force: bool = ...) -> None: ... + def get_start_method(self, allow_none: bool = ...) -> str: ... + def get_all_start_methods(self) -> List[str]: ... + +if sys.platform != 'win32': + # TODO: type should be BaseProcess once a stub in multiprocessing.process exists + class ForkProcess(Any): # type: ignore + _start_method: str + @staticmethod + def _Popen(process_obj: Any) -> Any: ... + + # TODO: type should be BaseProcess once a stub in multiprocessing.process exists + class SpawnProcess(Any): # type: ignore + _start_method: str + @staticmethod + def _Popen(process_obj: Any) -> SpawnProcess: ... + + # TODO: type should be BaseProcess once a stub in multiprocessing.process exists + class ForkServerProcess(Any): # type: ignore + _start_method: str + @staticmethod + def _Popen(process_obj: Any) -> Any: ... + + class ForkContext(BaseContext): + _name: str + Process: Type[ForkProcess] + + class SpawnContext(BaseContext): + _name: str + Process: Type[SpawnProcess] + + class ForkServerContext(BaseContext): + _name: str + Process: Type[ForkServerProcess] +else: + # TODO: type should be BaseProcess once a stub in multiprocessing.process exists + class SpawnProcess(Any): # type: ignore + _start_method: str + @staticmethod + # TODO: type should be BaseProcess once a stub in multiprocessing.process exists + def _Popen(process_obj: Process) -> Any: ... + + class SpawnContext(BaseContext): + _name: str + Process: Type[SpawnProcess] + +def _force_start_method(method: str) -> None: ... +# TODO: type should be BaseProcess once a stub in multiprocessing.process exists +def get_spawning_popen() -> Optional[Any]: ... +# TODO: type should be BaseProcess once a stub in multiprocessing.process exists +def set_spawning_popen(popen: Any) -> None: ... +def assert_spawning(obj: Any) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/multiprocessing/dummy/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/multiprocessing/dummy/__init__.pyi new file mode 100644 index 0000000..c169d2d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/multiprocessing/dummy/__init__.pyi @@ -0,0 +1,42 @@ +from typing import Any, Optional, List, Type + +import array +import sys +import threading +import weakref + +from .connection import Pipe +from threading import Lock, RLock, Semaphore, BoundedSemaphore +from threading import Event, Condition, Barrier +from queue import Queue + +JoinableQueue = Queue + + +class DummyProcess(threading.Thread): + _children: weakref.WeakKeyDictionary + _parent: threading.Thread + _pid: None + _start_called: int + exitcode: Optional[int] + def __init__(self, group=..., target=..., name=..., args=..., kwargs=...) -> None: ... + +Process = DummyProcess + +class Namespace(object): + def __init__(self, **kwds) -> None: ... + +class Value(object): + _typecode: Any + _value: Any + value: Any + def __init__(self, typecode, value, lock=...) -> None: ... + + +def Array(typecode, sequence, lock=...) -> array.array: ... +def Manager() -> Any: ... +def Pool(processes=..., initializer=..., initargs=...) -> Any: ... +def active_children() -> List: ... +def current_process() -> threading.Thread: ... +def freeze_support() -> None: ... +def shutdown() -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/multiprocessing/dummy/connection.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/multiprocessing/dummy/connection.pyi new file mode 100644 index 0000000..3baaf28 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/multiprocessing/dummy/connection.pyi @@ -0,0 +1,35 @@ +from typing import Any, List, Optional, Tuple, Type, TypeVar + +from queue import Queue + +families: List[None] + +_TConnection = TypeVar('_TConnection', bound=Connection) +_TListener = TypeVar('_TListener', bound=Listener) + +class Connection(object): + _in: Any + _out: Any + recv: Any + recv_bytes: Any + send: Any + send_bytes: Any + def __enter__(self: _TConnection) -> _TConnection: ... + def __exit__(self, exc_type, exc_value, exc_tb) -> None: ... + def __init__(self, _in, _out) -> None: ... + def close(self) -> None: ... + def poll(self, timeout: float = ...) -> bool: ... + +class Listener(object): + _backlog_queue: Optional[Queue] + @property + def address(self) -> Optional[Queue]: ... + def __enter__(self: _TListener) -> _TListener: ... + def __exit__(self, exc_type, exc_value, exc_tb) -> None: ... + def __init__(self, address=..., family=..., backlog=...) -> None: ... + def accept(self) -> Connection: ... + def close(self) -> None: ... + + +def Client(address) -> Connection: ... +def Pipe(duplex: bool = ...) -> Tuple[Connection, Connection]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/multiprocessing/managers.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/multiprocessing/managers.pyi new file mode 100644 index 0000000..a5ec399 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/multiprocessing/managers.pyi @@ -0,0 +1,47 @@ +# Stubs for multiprocessing.managers + +# NOTE: These are incomplete! + +import queue +import threading +from typing import ( + Any, Callable, ContextManager, Dict, Iterable, List, Mapping, Optional, + Sequence, Tuple, TypeVar, Union, +) + +_T = TypeVar('_T') +_KT = TypeVar('_KT') +_VT = TypeVar('_VT') + +class Namespace: ... + +_Namespace = Namespace + +class BaseManager(ContextManager[BaseManager]): + address: Union[str, Tuple[str, int]] + def connect(self) -> None: ... + @classmethod + def register(cls, typeid: str, callable: Optional[Callable] = ..., + proxytype: Any = ..., + exposed: Optional[Sequence[str]] = ..., + method_to_typeid: Optional[Mapping[str, str]] = ..., + create_method: bool = ...) -> None: ... + def shutdown(self) -> None: ... + def start(self, initializer: Optional[Callable[..., Any]] = ..., + initargs: Iterable[Any] = ...) -> None: ... + +class SyncManager(BaseManager): + def BoundedSemaphore(self, value: Any = ...) -> threading.BoundedSemaphore: ... + def Condition(self, lock: Any = ...) -> threading.Condition: ... + def Event(self) -> threading.Event: ... + def Lock(self) -> threading.Lock: ... + def Namespace(self) -> _Namespace: ... + def Queue(self, maxsize: int = ...) -> queue.Queue: ... + def RLock(self) -> threading.RLock: ... + def Semaphore(self, value: Any = ...) -> threading.Semaphore: ... + def Array(self, typecode: Any, sequence: Sequence[_T]) -> Sequence[_T]: ... + def Value(self, typecode: Any, value: _T) -> _T: ... + def dict(self, sequence: Mapping[_KT, _VT] = ...) -> Dict[_KT, _VT]: ... + def list(self, sequence: Sequence[_T] = ...) -> List[_T]: ... + +class RemoteError(Exception): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/multiprocessing/pool.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/multiprocessing/pool.pyi new file mode 100644 index 0000000..469d83a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/multiprocessing/pool.pyi @@ -0,0 +1,87 @@ +from typing import ( + Any, Callable, ContextManager, Iterable, Mapping, Optional, List, + Type, TypeVar, Generic, Iterator +) +from types import TracebackType + +_PT = TypeVar('_PT', bound='Pool') +_S = TypeVar('_S') +_T = TypeVar('_T') + +class ApplyResult(Generic[_T]): + def get(self, timeout: Optional[float] = ...) -> _T: ... + def wait(self, timeout: Optional[float] = ...) -> None: ... + def ready(self) -> bool: ... + def successful(self) -> bool: ... + +# alias created during issue #17805 +AsyncResult = ApplyResult + +_IMIT = TypeVar('_IMIT', bound=IMapIterator) + +class IMapIterator(Iterator[_T]): + def __iter__(self: _IMIT) -> _IMIT: ... + def next(self, timeout: Optional[float] = ...) -> _T: ... + def __next__(self, timeout: Optional[float] = ...) -> _T: ... + +class IMapUnorderedIterator(IMapIterator): ... + +class Pool(ContextManager[Pool]): + def __init__(self, processes: Optional[int] = ..., + initializer: Optional[Callable[..., None]] = ..., + initargs: Iterable[Any] = ..., + maxtasksperchild: Optional[int] = ..., + context: Optional[Any] = ...) -> None: ... + def apply(self, + func: Callable[..., _T], + args: Iterable[Any] = ..., + kwds: Mapping[str, Any] = ...) -> _T: ... + def apply_async(self, + func: Callable[..., _T], + args: Iterable[Any] = ..., + kwds: Mapping[str, Any] = ..., + callback: Optional[Callable[[_T], None]] = ..., + error_callback: Optional[Callable[[BaseException], None]] = ...) -> AsyncResult[_T]: ... + def map(self, + func: Callable[[_S], _T], + iterable: Iterable[_S] = ..., + chunksize: Optional[int] = ...) -> List[_T]: ... + def map_async(self, func: Callable[[_S], _T], + iterable: Iterable[_S] = ..., + chunksize: Optional[int] = ..., + callback: Optional[Callable[[_T], None]] = ..., + error_callback: Optional[Callable[[BaseException], None]] = ...) -> AsyncResult[List[_T]]: ... + def imap(self, + func: Callable[[_S], _T], + iterable: Iterable[_S] = ..., + chunksize: Optional[int] = ...) -> IMapIterator[_T]: ... + def imap_unordered(self, + func: Callable[[_S], _T], + iterable: Iterable[_S] = ..., + chunksize: Optional[int] = ...) -> IMapIterator[_T]: ... + def starmap(self, + func: Callable[..., _T], + iterable: Iterable[Iterable[Any]] = ..., + chunksize: Optional[int] = ...) -> List[_T]: ... + def starmap_async(self, + func: Callable[..., _T], + iterable: Iterable[Iterable[Any]] = ..., + chunksize: Optional[int] = ..., + callback: Optional[Callable[[_T], None]] = ..., + error_callback: Optional[Callable[[BaseException], None]] = ...) -> AsyncResult[List[_T]]: ... + def close(self) -> None: ... + def terminate(self) -> None: ... + def join(self) -> None: ... + def __enter__(self: _PT) -> _PT: ... + + +class ThreadPool(Pool, ContextManager[ThreadPool]): + + def __init__(self, processes: Optional[int] = ..., + initializer: Optional[Callable[..., Any]] = ..., + initargs: Iterable[Any] = ...) -> None: ... + +# undocumented +RUN: int +CLOSE: int +TERMINATE: int diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/multiprocessing/process.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/multiprocessing/process.pyi new file mode 100644 index 0000000..df8ea93 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/multiprocessing/process.pyi @@ -0,0 +1,5 @@ +from typing import List +from multiprocessing import Process + +def current_process() -> Process: ... +def active_children() -> List[Process]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/multiprocessing/queues.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/multiprocessing/queues.pyi new file mode 100644 index 0000000..c6dd0f2 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/multiprocessing/queues.pyi @@ -0,0 +1,30 @@ +from typing import Any, Generic, Optional, TypeVar + +import queue + +_T = TypeVar('_T') + +class Queue(queue.Queue[_T]): + # FIXME: `ctx` is a circular dependency and it's not actually optional. + # It's marked as such to be able to use the generic Queue in __init__.pyi. + def __init__(self, maxsize: int = ..., *, ctx: Any = ...) -> None: ... + def get(self, block: bool = ..., timeout: Optional[float] = ...) -> _T: ... + def put(self, obj: _T, block: bool = ..., timeout: Optional[float] = ...) -> None: ... + def qsize(self) -> int: ... + def empty(self) -> bool: ... + def full(self) -> bool: ... + def put_nowait(self, item: _T) -> None: ... + def get_nowait(self) -> _T: ... + def close(self) -> None: ... + def join_thread(self) -> None: ... + def cancel_join_thread(self) -> None: ... + +class JoinableQueue(Queue[_T]): + def task_done(self) -> None: ... + def join(self) -> None: ... + +class SimpleQueue(Generic[_T]): + def __init__(self, *, ctx: Any = ...) -> None: ... + def empty(self) -> bool: ... + def get(self) -> _T: ... + def put(self, item: _T) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/multiprocessing/spawn.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/multiprocessing/spawn.pyi new file mode 100644 index 0000000..659253c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/multiprocessing/spawn.pyi @@ -0,0 +1,18 @@ +from typing import Any, Dict, List, Mapping, Optional, Sequence +from types import ModuleType + +WINEXE: bool +WINSERVICE: bool + +def set_executable(exe: str) -> None: ... +def get_executable() -> str: ... +def is_forking(argv: Sequence[str]) -> bool: ... +def freeze_support() -> None: ... +def get_command_line(**kwds: Any) -> List[str]: ... +def spawn_main(pipe_handle: int, parent_pid: Optional[int] = ..., tracker_fd: Optional[int] = ...) -> None: ... +# undocumented +def _main(fd: int) -> Any: ... +def get_preparation_data(name: str) -> Dict[str, Any]: ... +old_main_modules: List[ModuleType] = ... +def prepare(data: Mapping[str, Any]) -> None: ... +def import_main_path(main_path: str) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/multiprocessing/synchronize.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/multiprocessing/synchronize.pyi new file mode 100644 index 0000000..9b22681 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/multiprocessing/synchronize.pyi @@ -0,0 +1,63 @@ +from typing import Callable, ContextManager, Optional, Union + +from multiprocessing.context import BaseContext +import threading +import sys + +_LockLike = Union[Lock, RLock] + +class Barrier(threading.Barrier): + def __init__(self, + parties: int, + action: Optional[Callable] = ..., + timeout: Optional[float] = ..., + * + ctx: BaseContext) -> None: ... + +class BoundedSemaphore(Semaphore): + def __init__(self, value: int = ..., *, ctx: BaseContext) -> None: ... + +class Condition(ContextManager[bool]): + def __init__(self, + lock: Optional[_LockLike] = ..., + *, + ctx: BaseContext) -> None: ... + if sys.version_info >= (3, 7): + def notify(self, n: int = ...) -> None: ... + else: + def notify(self) -> None: ... + def notify_all(self) -> None: ... + def wait(self, timeout: Optional[float] = ...) -> bool: ... + def wait_for(self, + predicate: Callable[[], bool], + timeout: Optional[float] = ...) -> bool: ... + def acquire(self, + block: bool = ..., + timeout: Optional[float] = ...) -> bool: ... + def release(self) -> None: ... + +class Event(ContextManager[bool]): + def __init__(self, + lock: Optional[_LockLike] = ..., + *, + ctx: BaseContext) -> None: ... + def is_set(self) -> bool: ... + def set(self) -> None: ... + def clear(self) -> None: ... + def wait(self, timeout: Optional[float] = ...) -> bool: ... + +class Lock(SemLock): + def __init__(self, *, ctx: BaseContext) -> None: ... + +class RLock(SemLock): + def __init__(self, *, ctx: BaseContext) -> None: ... + +class Semaphore(SemLock): + def __init__(self, value: int = ..., *, ctx: BaseContext) -> None: ... + +# Not part of public API +class SemLock(ContextManager[bool]): + def acquire(self, + block: bool = ..., + timeout: Optional[float] = ...) -> bool: ... + def release(self) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/nntplib.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/nntplib.pyi new file mode 100644 index 0000000..00abdd9 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/nntplib.pyi @@ -0,0 +1,102 @@ +# Stubs for nntplib (Python 3) + +import datetime +import socket +import ssl +from typing import Any, Dict, IO, Iterable, List, NamedTuple, Optional, Tuple, TypeVar, Union + +_SelfT = TypeVar('_SelfT', bound=_NNTPBase) +_File = Union[IO[bytes], bytes, str, None] + + +class NNTPError(Exception): + response: str +class NNTPReplyError(NNTPError): ... +class NNTPTemporaryError(NNTPError): ... +class NNTPPermanentError(NNTPError): ... +class NNTPProtocolError(NNTPError): ... +class NNTPDataError(NNTPError): ... + +NNTP_PORT: int +NNTP_SSL_PORT: int + +GroupInfo = NamedTuple('GroupInfo', [ + ('group', str), + ('last', str), + ('first', str), + ('flag', str), +]) +ArticleInfo = NamedTuple('ArticleInfo', [ + ('number', int), + ('message_id', str), + ('lines', List[bytes]), +]) + +def decode_header(header_str: str) -> str: ... + +class _NNTPBase: + encoding: str + errors: str + + host: str + file: IO[bytes] + debugging: int + welcome: str + readermode_afterauth: bool + tls_on: bool + authenticated: bool + nntp_implementation: str + nntp_version: int + + def __init__(self, file: IO[bytes], host: str, + readermode: Optional[bool] = ..., timeout: float = ...) -> None: ... + def __enter__(self: _SelfT) -> _SelfT: ... + def __exit__(self, *args: Any) -> None: ... + def getwelcome(self) -> str: ... + def getcapabilities(self) -> Dict[str, List[str]]: ... + def set_debuglevel(self, level: int) -> None: ... + def debug(self, level: int) -> None: ... + def capabilities(self) -> Tuple[str, Dict[str, List[str]]]: ... + def newgroups(self, date: Union[datetime.date, datetime.datetime], *, file: _File = ...) -> Tuple[str, List[str]]: ... + def newnews(self, group: str, date: Union[datetime.date, datetime.datetime], *, file: _File = ...) -> Tuple[str, List[str]]: ... + def list(self, group_pattern: Optional[str] = ..., *, file: _File = ...) -> Tuple[str, List[str]]: ... + def description(self, group: str) -> str: ... + def descriptions(self, group_pattern: str) -> Tuple[str, Dict[str, str]]: ... + def group(self, name: str) -> Tuple[str, int, int, int, str]: ... + def help(self, *, file: _File = ...) -> Tuple[str, List[str]]: ... + def stat(self, message_spec: Any = ...) -> Tuple[str, int, str]: ... + def next(self) -> Tuple[str, int, str]: ... + def last(self) -> Tuple[str, int, str]: ... + def head(self, message_spec: Any = ..., *, file: _File = ...) -> Tuple[str, ArticleInfo]: ... + def body(self, message_spec: Any = ..., *, file: _File = ...) -> Tuple[str, ArticleInfo]: ... + def article(self, message_spec: Any = ..., *, file: _File = ...) -> Tuple[str, ArticleInfo]: ... + def slave(self) -> str: ... + def xhdr(self, hdr: str, str: Any, *, file: _File = ...) -> Tuple[str, List[str]]: ... + def xover(self, start: int, end: int, *, file: _File = ...) -> Tuple[str, List[Tuple[int, Dict[str, str]]]]: ... + def over(self, message_spec: Union[None, str, List[Any], Tuple[Any, ...]], *, file: _File = ...) -> Tuple[str, List[Tuple[int, Dict[str, str]]]]: ... + def xgtitle(self, group: str, *, file: _File = ...) -> Tuple[str, List[Tuple[str, str]]]: ... + def xpath(self, id: Any) -> Tuple[str, str]: ... + def date(self) -> Tuple[str, datetime.datetime]: ... + def post(self, data: Union[bytes, Iterable[bytes]]) -> str: ... + def ihave(self, message_id: Any, data: Union[bytes, Iterable[bytes]]) -> str: ... + def quit(self) -> str: ... + def login(self, user: Optional[str] = ..., password: Optional[str] = ..., usenetrc: bool = ...) -> None: ... + def starttls(self, ssl_context: Optional[ssl.SSLContext] = ...) -> None: ... + + +class NNTP(_NNTPBase): + port: int + sock: socket.socket + + def __init__(self, host: str, port: int = ..., user: Optional[str] = ..., password: Optional[str] = ..., + readermode: Optional[bool] = ..., usenetrc: bool = ..., + timeout: float = ...) -> None: ... + + +class NNTP_SSL(_NNTPBase): + sock: socket.socket + + def __init__(self, host: str, port: int = ..., user: Optional[str] = ..., password: Optional[str] = ..., + ssl_context: Optional[ssl.SSLContext] = ..., + readermode: Optional[bool] = ..., usenetrc: bool = ..., + timeout: float = ...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/nturl2path.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/nturl2path.pyi new file mode 100644 index 0000000..b8ad8d6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/nturl2path.pyi @@ -0,0 +1,2 @@ +def url2pathname(url: str) -> str: ... +def pathname2url(p: str) -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/os/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/os/__init__.pyi new file mode 100644 index 0000000..b717926 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/os/__init__.pyi @@ -0,0 +1,722 @@ +# Stubs for os +# Ron Murawski + +from io import TextIOWrapper as _TextIOWrapper +import sys +from typing import ( + Mapping, MutableMapping, Dict, List, Any, Tuple, IO, Iterable, Iterator, NoReturn, overload, Union, AnyStr, + Optional, Generic, Set, Callable, Text, Sequence, NamedTuple, TypeVar, ContextManager +) + +# Re-exported names from other modules. +from builtins import OSError as error +from . import path as path + +_T = TypeVar('_T') + +# ----- os variables ----- + +if sys.version_info >= (3, 2): + supports_bytes_environ: bool + +if sys.version_info >= (3, 3): + supports_dir_fd: Set[Callable[..., Any]] + supports_fd: Set[Callable[..., Any]] + supports_effective_ids: Set[Callable[..., Any]] + supports_follow_symlinks: Set[Callable[..., Any]] + + if sys.platform != 'win32': + # Unix only + PRIO_PROCESS: int + PRIO_PGRP: int + PRIO_USER: int + + F_LOCK: int + F_TLOCK: int + F_ULOCK: int + F_TEST: int + + POSIX_FADV_NORMAL: int + POSIX_FADV_SEQUENTIAL: int + POSIX_FADV_RANDOM: int + POSIX_FADV_NOREUSE: int + POSIX_FADV_WILLNEED: int + POSIX_FADV_DONTNEED: int + + SF_NODISKIO: int + SF_MNOWAIT: int + SF_SYNC: int + + XATTR_SIZE_MAX: int # Linux only + XATTR_CREATE: int # Linux only + XATTR_REPLACE: int # Linux only + + P_PID: int + P_PGID: int + P_ALL: int + + WEXITED: int + WSTOPPED: int + WNOWAIT: int + + CLD_EXITED: int + CLD_DUMPED: int + CLD_TRAPPED: int + CLD_CONTINUED: int + + SCHED_OTHER: int # some flavors of Unix + SCHED_BATCH: int # some flavors of Unix + SCHED_IDLE: int # some flavors of Unix + SCHED_SPORADIC: int # some flavors of Unix + SCHED_FIFO: int # some flavors of Unix + SCHED_RR: int # some flavors of Unix + SCHED_RESET_ON_FORK: int # some flavors of Unix + + RTLD_LAZY: int + RTLD_NOW: int + RTLD_GLOBAL: int + RTLD_LOCAL: int + RTLD_NODELETE: int + RTLD_NOLOAD: int + RTLD_DEEPBIND: int + + +SEEK_SET: int +SEEK_CUR: int +SEEK_END: int +if sys.version_info >= (3, 3) and sys.platform != 'win32': + SEEK_DATA: int # some flavors of Unix + SEEK_HOLE: int # some flavors of Unix + +O_RDONLY: int +O_WRONLY: int +O_RDWR: int +O_APPEND: int +O_CREAT: int +O_EXCL: int +O_TRUNC: int +# We don't use sys.platform for O_* flags to denote platform-dependent APIs because some codes, +# including tests for mypy, use a more finer way than sys.platform before using these APIs +# See https://github.com/python/typeshed/pull/2286 for discussions +O_DSYNC: int # Unix only +O_RSYNC: int # Unix only +O_SYNC: int # Unix only +O_NDELAY: int # Unix only +O_NONBLOCK: int # Unix only +O_NOCTTY: int # Unix only +if sys.version_info >= (3, 3): + O_CLOEXEC: int # Unix only +O_SHLOCK: int # Unix only +O_EXLOCK: int # Unix only +O_BINARY: int # Windows only +O_NOINHERIT: int # Windows only +O_SHORT_LIVED: int # Windows only +O_TEMPORARY: int # Windows only +O_RANDOM: int # Windows only +O_SEQUENTIAL: int # Windows only +O_TEXT: int # Windows only +O_ASYNC: int # Gnu extension if in C library +O_DIRECT: int # Gnu extension if in C library +O_DIRECTORY: int # Gnu extension if in C library +O_NOFOLLOW: int # Gnu extension if in C library +O_NOATIME: int # Gnu extension if in C library +if sys.version_info >= (3, 4): + O_PATH: int # Gnu extension if in C library + O_TMPFILE: int # Gnu extension if in C library +O_LARGEFILE: int # Gnu extension if in C library + +curdir: str +pardir: str +sep: str +if sys.platform == 'win32': + altsep: str +else: + altsep: Optional[str] +extsep: str +pathsep: str +defpath: str +linesep: str +devnull: str +name: str + +F_OK: int +R_OK: int +W_OK: int +X_OK: int + +class _Environ(MutableMapping[AnyStr, AnyStr], Generic[AnyStr]): + def copy(self) -> Dict[AnyStr, AnyStr]: ... + def __delitem__(self, key: AnyStr) -> None: ... + def __getitem__(self, key: AnyStr) -> AnyStr: ... + def __setitem__(self, key: AnyStr, value: AnyStr) -> None: ... + def __iter__(self) -> Iterator[AnyStr]: ... + def __len__(self) -> int: ... + +environ: _Environ[str] +if sys.version_info >= (3, 2): + environb: _Environ[bytes] + +if sys.platform != 'win32': + confstr_names: Dict[str, int] + pathconf_names: Dict[str, int] + sysconf_names: Dict[str, int] + + EX_OK: int + EX_USAGE: int + EX_DATAERR: int + EX_NOINPUT: int + EX_NOUSER: int + EX_NOHOST: int + EX_UNAVAILABLE: int + EX_SOFTWARE: int + EX_OSERR: int + EX_OSFILE: int + EX_CANTCREAT: int + EX_IOERR: int + EX_TEMPFAIL: int + EX_PROTOCOL: int + EX_NOPERM: int + EX_CONFIG: int + EX_NOTFOUND: int + +P_NOWAIT: int +P_NOWAITO: int +P_WAIT: int +if sys.platform == 'win32': + P_DETACH: int + P_OVERLAY: int + +# wait()/waitpid() options +if sys.platform != 'win32': + WNOHANG: int # Unix only + WCONTINUED: int # some Unix systems + WUNTRACED: int # Unix only + +TMP_MAX: int # Undocumented, but used by tempfile + +# ----- os classes (structures) ----- +class stat_result: + # For backward compatibility, the return value of stat() is also + # accessible as a tuple of at least 10 integers giving the most important + # (and portable) members of the stat structure, in the order st_mode, + # st_ino, st_dev, st_nlink, st_uid, st_gid, st_size, st_atime, st_mtime, + # st_ctime. More items may be added at the end by some implementations. + + st_mode: int # protection bits, + st_ino: int # inode number, + st_dev: int # device, + st_nlink: int # number of hard links, + st_uid: int # user id of owner, + st_gid: int # group id of owner, + st_size: int # size of file, in bytes, + st_atime: float # time of most recent access, + st_mtime: float # time of most recent content modification, + st_ctime: float # platform dependent (time of most recent metadata change on Unix, or the time of creation on Windows) + st_atime_ns: int # time of most recent access, in nanoseconds + st_mtime_ns: int # time of most recent content modification in nanoseconds + st_ctime_ns: int # platform dependent (time of most recent metadata change on Unix, or the time of creation on Windows) in nanoseconds + + def __getitem__(self, i: int) -> int: ... + + # not documented + def __init__(self, tuple: Tuple[int, ...]) -> None: ... + + # On some Unix systems (such as Linux), the following attributes may also + # be available: + st_blocks: int # number of blocks allocated for file + st_blksize: int # filesystem blocksize + st_rdev: int # type of device if an inode device + st_flags: int # user defined flags for file + + # On other Unix systems (such as FreeBSD), the following attributes may be + # available (but may be only filled out if root tries to use them): + st_gen: int # file generation number + st_birthtime: int # time of file creation + + # On Mac OS systems, the following attributes may also be available: + st_rsize: int + st_creator: int + st_type: int + +if sys.version_info >= (3, 6): + from builtins import _PathLike as PathLike # See comment in builtins + +_PathType = path._PathType +if sys.version_info >= (3, 3): + _FdOrPathType = Union[int, _PathType] +else: + _FdOrPathType = _PathType + +if sys.version_info >= (3, 6): + class DirEntry(PathLike[AnyStr]): + # This is what the scandir interator yields + # The constructor is hidden + + name: AnyStr + path: AnyStr + def inode(self) -> int: ... + def is_dir(self, *, follow_symlinks: bool = ...) -> bool: ... + def is_file(self, *, follow_symlinks: bool = ...) -> bool: ... + def is_symlink(self) -> bool: ... + def stat(self, *, follow_symlinks: bool = ...) -> stat_result: ... + + def __fspath__(self) -> AnyStr: ... +elif sys.version_info >= (3, 5): + class DirEntry(Generic[AnyStr]): + # This is what the scandir interator yields + # The constructor is hidden + + name: AnyStr + path: AnyStr + def inode(self) -> int: ... + def is_dir(self, *, follow_symlinks: bool = ...) -> bool: ... + def is_file(self, *, follow_symlinks: bool = ...) -> bool: ... + def is_symlink(self) -> bool: ... + def stat(self, *, follow_symlinks: bool = ...) -> stat_result: ... + + +if sys.platform != 'win32': + class statvfs_result: # Unix only + f_bsize: int + f_frsize: int + f_blocks: int + f_bfree: int + f_bavail: int + f_files: int + f_ffree: int + f_favail: int + f_flag: int + f_namemax: int + +# ----- os function stubs ----- +if sys.version_info >= (3, 6): + def fsencode(filename: Union[str, bytes, PathLike]) -> bytes: ... +else: + def fsencode(filename: Union[str, bytes]) -> bytes: ... + +if sys.version_info >= (3, 6): + def fsdecode(filename: Union[str, bytes, PathLike]) -> str: ... +else: + def fsdecode(filename: Union[str, bytes]) -> str: ... + +if sys.version_info >= (3, 6): + @overload + def fspath(path: str) -> str: ... + @overload + def fspath(path: bytes) -> bytes: ... + @overload + def fspath(path: PathLike) -> Any: ... + +def get_exec_path(env: Optional[Mapping[str, str]] = ...) -> List[str]: ... +# NOTE: get_exec_path(): returns List[bytes] when env not None +def getlogin() -> str: ... +def getpid() -> int: ... +def getppid() -> int: ... +def strerror(code: int) -> str: ... +def umask(mask: int) -> int: ... + +if sys.platform != 'win32': + # Unix only + def ctermid() -> str: ... + def getegid() -> int: ... + def geteuid() -> int: ... + def getgid() -> int: ... + if sys.version_info >= (3, 3): + def getgrouplist(user: str, gid: int) -> List[int]: ... + def getgroups() -> List[int]: ... # Unix only, behaves differently on Mac + def initgroups(username: str, gid: int) -> None: ... + def getpgid(pid: int) -> int: ... + def getpgrp() -> int: ... + if sys.version_info >= (3, 3): + def getpriority(which: int, who: int) -> int: ... + def setpriority(which: int, who: int, priority: int) -> None: ... + def getresuid() -> Tuple[int, int, int]: ... + def getresgid() -> Tuple[int, int, int]: ... + def getuid() -> int: ... + def setegid(egid: int) -> None: ... + def seteuid(euid: int) -> None: ... + def setgid(gid: int) -> None: ... + def setgroups(groups: Sequence[int]) -> None: ... + def setpgrp() -> None: ... + def setpgid(pid: int, pgrp: int) -> None: ... + def setregid(rgid: int, egid: int) -> None: ... + def setresgid(rgid: int, egid: int, sgid: int) -> None: ... + def setresuid(ruid: int, euid: int, suid: int) -> None: ... + def setreuid(ruid: int, euid: int) -> None: ... + def getsid(pid: int) -> int: ... + def setsid() -> None: ... + def setuid(uid: int) -> None: ... + if sys.version_info >= (3, 3): + from posix import uname_result + def uname() -> uname_result: ... + else: + def uname() -> Tuple[str, str, str, str, str]: ... + +@overload +def getenv(key: Text) -> Optional[str]: ... +@overload +def getenv(key: Text, default: _T) -> Union[str, _T]: ... +def getenvb(key: bytes, default: bytes = ...) -> bytes: ... +def putenv(key: Union[bytes, Text], value: Union[bytes, Text]) -> None: ... +def unsetenv(key: Union[bytes, Text]) -> None: ... + +# Return IO or TextIO +def fdopen(fd: int, mode: str = ..., buffering: int = ..., encoding: Optional[str] = ..., + errors: str = ..., newline: str = ..., closefd: bool = ...) -> Any: ... +def close(fd: int) -> None: ... +def closerange(fd_low: int, fd_high: int) -> None: ... +def device_encoding(fd: int) -> Optional[str]: ... +def dup(fd: int) -> int: ... +if sys.version_info >= (3, 7): + def dup2(fd: int, fd2: int, inheritable: bool = ...) -> int: ... +elif sys.version_info >= (3, 4): + def dup2(fd: int, fd2: int, inheritable: bool = ...) -> None: ... +else: + def dup2(fd: int, fd2: int) -> None: ... +def fstat(fd: int) -> stat_result: ... +def fsync(fd: int) -> None: ... +def lseek(fd: int, pos: int, how: int) -> int: ... +if sys.version_info >= (3, 3): + def open(file: _PathType, flags: int, mode: int = ..., *, dir_fd: Optional[int] = ...) -> int: ... +else: + def open(file: _PathType, flags: int, mode: int = ...) -> int: ... +def pipe() -> Tuple[int, int]: ... +def read(fd: int, n: int) -> bytes: ... + +if sys.platform != 'win32': + # Unix only + def fchmod(fd: int, mode: int) -> None: ... + def fchown(fd: int, uid: int, gid: int) -> None: ... + def fdatasync(fd: int) -> None: ... # Unix only, not Mac + def fpathconf(fd: int, name: Union[str, int]) -> int: ... + def fstatvfs(fd: int) -> statvfs_result: ... + def ftruncate(fd: int, length: int) -> None: ... + if sys.version_info >= (3, 5): + def get_blocking(fd: int) -> bool: ... + def set_blocking(fd: int, blocking: bool) -> None: ... + def isatty(fd: int) -> bool: ... + if sys.version_info >= (3, 3): + def lockf(__fd: int, __cmd: int, __length: int) -> None: ... + def openpty() -> Tuple[int, int]: ... # some flavors of Unix + if sys.version_info >= (3, 3): + def pipe2(flags: int) -> Tuple[int, int]: ... # some flavors of Unix + def posix_fallocate(fd: int, offset: int, length: int) -> None: ... + def posix_fadvise(fd: int, offset: int, length: int, advice: int) -> None: ... + def pread(fd: int, buffersize: int, offset: int) -> bytes: ... + def pwrite(fd: int, string: bytes, offset: int) -> int: ... + @overload + def sendfile(__out_fd: int, __in_fd: int, offset: Optional[int], count: int) -> int: ... + @overload + def sendfile(__out_fd: int, __in_fd: int, offset: int, count: int, + headers: Sequence[bytes] = ..., trailers: Sequence[bytes] = ..., flags: int = ...) -> int: ... # FreeBSD and Mac OS X only + def readv(fd: int, buffers: Sequence[bytearray]) -> int: ... + def writev(fd: int, buffers: Sequence[bytes]) -> int: ... + +terminal_size = NamedTuple('terminal_size', [('columns', int), ('lines', int)]) +def get_terminal_size(fd: int = ...) -> terminal_size: ... + +if sys.version_info >= (3, 4): + def get_inheritable(fd: int) -> bool: ... + def set_inheritable(fd: int, inheritable: bool) -> None: ... + +if sys.platform != 'win32': + # Unix only + def tcgetpgrp(fd: int) -> int: ... + def tcsetpgrp(fd: int, pg: int) -> None: ... + def ttyname(fd: int) -> str: ... +def write(fd: int, string: bytes) -> int: ... +if sys.version_info >= (3, 3): + def access(path: _FdOrPathType, mode: int, *, dir_fd: Optional[int] = ..., + effective_ids: bool = ..., follow_symlinks: bool = ...) -> bool: ... +else: + def access(path: _PathType, mode: int) -> bool: ... +def chdir(path: _FdOrPathType) -> None: ... +def fchdir(fd: int) -> None: ... +def getcwd() -> str: ... +def getcwdb() -> bytes: ... +if sys.version_info >= (3, 3): + def chmod(path: _FdOrPathType, mode: int, *, dir_fd: Optional[int] = ..., follow_symlinks: bool = ...) -> None: ... + if sys.platform != 'win32': + def chflags(path: _PathType, flags: int, follow_symlinks: bool = ...) -> None: ... # some flavors of Unix + def chown(path: _FdOrPathType, uid: int, gid: int, *, dir_fd: Optional[int] = ..., follow_symlinks: bool = ...) -> None: ... # Unix only +else: + def chmod(path: _PathType, mode: int) -> None: ... + if sys.platform != 'win32': + def chflags(path: _PathType, flags: int) -> None: ... # Some flavors of Unix + def chown(path: _PathType, uid: int, gid: int) -> None: ... # Unix only +if sys.platform != 'win32': + # Unix only + def chroot(path: _PathType) -> None: ... + def lchflags(path: _PathType, flags: int) -> None: ... + def lchmod(path: _PathType, mode: int) -> None: ... + def lchown(path: _PathType, uid: int, gid: int) -> None: ... +if sys.version_info >= (3, 3): + def link(src: _PathType, link_name: _PathType, *, src_dir_fd: Optional[int] = ..., + dst_dir_fd: Optional[int] = ..., follow_symlinks: bool = ...) -> None: ... +else: + def link(src: _PathType, link_name: _PathType) -> None: ... + +if sys.version_info >= (3, 6): + @overload + def listdir(path: Optional[str] = ...) -> List[str]: ... + @overload + def listdir(path: bytes) -> List[bytes]: ... + @overload + def listdir(path: int) -> List[str]: ... + @overload + def listdir(path: PathLike[str]) -> List[str]: ... +elif sys.version_info >= (3, 3): + @overload + def listdir(path: Optional[str] = ...) -> List[str]: ... + @overload + def listdir(path: bytes) -> List[bytes]: ... + @overload + def listdir(path: int) -> List[str]: ... +else: + @overload + def listdir(path: Optional[str] = ...) -> List[str]: ... + @overload + def listdir(path: bytes) -> List[bytes]: ... + +if sys.version_info >= (3, 3): + def lstat(path: _PathType, *, dir_fd: Optional[int] = ...) -> stat_result: ... + def mkdir(path: _PathType, mode: int = ..., *, dir_fd: Optional[int] = ...) -> None: ... + if sys.platform != 'win32': + def mkfifo(path: _PathType, mode: int = ..., *, dir_fd: Optional[int] = ...) -> None: ... # Unix only +else: + def lstat(path: _PathType) -> stat_result: ... + def mkdir(path: _PathType, mode: int = ...) -> None: ... + if sys.platform != 'win32': + def mkfifo(path: _PathType, mode: int = ...) -> None: ... # Unix only +if sys.version_info >= (3, 4): + def makedirs(name: _PathType, mode: int = ..., exist_ok: bool = ...) -> None: ... +else: + def makedirs(path: _PathType, mode: int = ..., exist_ok: bool = ...) -> None: ... +if sys.version_info >= (3, 4): + def mknod(path: _PathType, mode: int = ..., device: int = ..., + *, dir_fd: Optional[int] = ...) -> None: ... +elif sys.version_info >= (3, 3): + def mknod(filename: _PathType, mode: int = ..., device: int = ..., + *, dir_fd: Optional[int] = ...) -> None: ... +else: + def mknod(filename: _PathType, mode: int = ..., device: int = ...) -> None: ... +def major(device: int) -> int: ... +def minor(device: int) -> int: ... +def makedev(major: int, minor: int) -> int: ... +if sys.platform != 'win32': + def pathconf(path: _FdOrPathType, name: Union[str, int]) -> int: ... # Unix only +if sys.version_info >= (3, 6): + def readlink(path: Union[AnyStr, PathLike[AnyStr]], *, dir_fd: Optional[int] = ...) -> AnyStr: ... +elif sys.version_info >= (3, 3): + def readlink(path: AnyStr, *, dir_fd: Optional[int] = ...) -> AnyStr: ... +else: + def readlink(path: AnyStr) -> AnyStr: ... +if sys.version_info >= (3, 3): + def remove(path: _PathType, *, dir_fd: Optional[int] = ...) -> None: ... +else: + def remove(path: _PathType) -> None: ... +if sys.version_info >= (3, 4): + def removedirs(name: _PathType) -> None: ... +else: + def removedirs(path: _PathType) -> None: ... +if sys.version_info >= (3, 3): + def rename(src: _PathType, dst: _PathType, *, + src_dir_fd: Optional[int] = ..., dst_dir_fd: Optional[int] = ...) -> None: ... +else: + def rename(src: _PathType, dst: _PathType) -> None: ... +def renames(old: _PathType, new: _PathType) -> None: ... +if sys.version_info >= (3, 3): + def replace(src: _PathType, dst: _PathType, *, + src_dir_fd: Optional[int] = ..., dst_dir_fd: Optional[int] = ...) -> None: ... + def rmdir(path: _PathType, *, dir_fd: Optional[int] = ...) -> None: ... +else: + def rmdir(path: _PathType) -> None: ... +if sys.version_info >= (3, 7): + class _ScandirIterator(Iterator[DirEntry[AnyStr]], ContextManager[_ScandirIterator[AnyStr]]): + def __next__(self) -> DirEntry[AnyStr]: ... + def close(self) -> None: ... + @overload + def scandir() -> _ScandirIterator[str]: ... + @overload + def scandir(path: int) -> _ScandirIterator[str]: ... + @overload + def scandir(path: Union[AnyStr, PathLike[AnyStr]]) -> _ScandirIterator[AnyStr]: ... +elif sys.version_info >= (3, 6): + class _ScandirIterator(Iterator[DirEntry[AnyStr]], ContextManager[_ScandirIterator[AnyStr]]): + def __next__(self) -> DirEntry[AnyStr]: ... + def close(self) -> None: ... + @overload + def scandir() -> _ScandirIterator[str]: ... + @overload + def scandir(path: Union[AnyStr, PathLike[AnyStr]]) -> _ScandirIterator[AnyStr]: ... +elif sys.version_info >= (3, 5): + @overload + def scandir() -> Iterator[DirEntry[str]]: ... + @overload + def scandir(path: AnyStr) -> Iterator[DirEntry[AnyStr]]: ... +if sys.version_info >= (3, 3): + def stat(path: _FdOrPathType, *, dir_fd: Optional[int] = ..., + follow_symlinks: bool = ...) -> stat_result: ... +else: + def stat(path: _PathType) -> stat_result: ... +if sys.version_info < (3, 7): + @overload + def stat_float_times() -> bool: ... + @overload + def stat_float_times(__newvalue: bool) -> None: ... +if sys.platform != 'win32': + def statvfs(path: _FdOrPathType) -> statvfs_result: ... # Unix only +if sys.version_info >= (3, 3): + def symlink(source: _PathType, link_name: _PathType, + target_is_directory: bool = ..., *, dir_fd: Optional[int] = ...) -> None: ... + if sys.platform != 'win32': + def sync() -> None: ... # Unix only + def truncate(path: _FdOrPathType, length: int) -> None: ... # Unix only up to version 3.4 + def unlink(path: _PathType, *, dir_fd: Optional[int] = ...) -> None: ... + def utime(path: _FdOrPathType, times: Optional[Union[Tuple[int, int], Tuple[float, float]]] = ..., *, + ns: Tuple[int, int] = ..., dir_fd: Optional[int] = ..., + follow_symlinks: bool = ...) -> None: ... +else: + def symlink(source: _PathType, link_name: _PathType, + target_is_directory: bool = ...) -> None: + ... # final argument in Windows only + def unlink(path: _PathType) -> None: ... + def utime(path: _PathType, times: Optional[Tuple[float, float]]) -> None: ... + +if sys.version_info >= (3, 6): + def walk(top: Union[AnyStr, PathLike[AnyStr]], topdown: bool = ..., + onerror: Optional[Callable[[OSError], Any]] = ..., + followlinks: bool = ...) -> Iterator[Tuple[AnyStr, List[AnyStr], + List[AnyStr]]]: ... +else: + def walk(top: AnyStr, topdown: bool = ..., onerror: Optional[Callable[[OSError], Any]] = ..., + followlinks: bool = ...) -> Iterator[Tuple[AnyStr, List[AnyStr], + List[AnyStr]]]: ... +if sys.platform != 'win32' and sys.version_info >= (3, 3): + if sys.version_info >= (3, 7): + @overload + def fwalk(top: Union[str, PathLike[str]] = ..., topdown: bool = ..., + onerror: Optional[Callable] = ..., *, follow_symlinks: bool = ..., + dir_fd: Optional[int] = ...) -> Iterator[Tuple[str, List[str], List[str], int]]: ... + @overload + def fwalk(top: bytes, topdown: bool = ..., + onerror: Optional[Callable] = ..., *, follow_symlinks: bool = ..., + dir_fd: Optional[int] = ...) -> Iterator[Tuple[bytes, List[bytes], List[bytes], int]]: ... + elif sys.version_info >= (3, 6): + def fwalk(top: Union[str, PathLike[str]] = ..., topdown: bool = ..., + onerror: Optional[Callable] = ..., *, follow_symlinks: bool = ..., + dir_fd: Optional[int] = ...) -> Iterator[Tuple[str, List[str], List[str], int]]: ... + else: + def fwalk(top: str = ..., topdown: bool = ..., + onerror: Optional[Callable] = ..., *, follow_symlinks: bool = ..., + dir_fd: Optional[int] = ...) -> Iterator[Tuple[str, List[str], List[str], int]]: ... + def getxattr(path: _FdOrPathType, attribute: _PathType, *, follow_symlinks: bool = ...) -> bytes: ... # Linux only + def listxattr(path: _FdOrPathType, *, follow_symlinks: bool = ...) -> List[str]: ... # Linux only + def removexattr(path: _FdOrPathType, attribute: _PathType, *, follow_symlinks: bool = ...) -> None: ... # Linux only + def setxattr(path: _FdOrPathType, attribute: _PathType, value: bytes, flags: int = ..., *, + follow_symlinks: bool = ...) -> None: ... # Linux only + +def abort() -> NoReturn: ... +# These are defined as execl(file, *args) but the first *arg is mandatory. +def execl(file: _PathType, __arg0: Union[bytes, Text], *args: Union[bytes, Text]) -> NoReturn: ... +def execlp(file: _PathType, __arg0: Union[bytes, Text], *args: Union[bytes, Text]) -> NoReturn: ... + +# These are: execle(file, *args, env) but env is pulled from the last element of the args. +def execle(file: _PathType, __arg0: Union[bytes, Text], *args: Any) -> NoReturn: ... +def execlpe(file: _PathType, __arg0: Union[bytes, Text], *args: Any) -> NoReturn: ... + +# The docs say `args: tuple or list of strings` +# The implementation enforces tuple or list so we can't use Sequence. +_ExecVArgs = Union[Tuple[Union[bytes, Text], ...], List[bytes], List[Text], List[Union[bytes, Text]]] +def execv(path: _PathType, args: _ExecVArgs) -> NoReturn: ... +def execve(path: _FdOrPathType, args: _ExecVArgs, env: Mapping[str, str]) -> NoReturn: ... +def execvp(file: _PathType, args: _ExecVArgs) -> NoReturn: ... +def execvpe(file: _PathType, args: _ExecVArgs, env: Mapping[str, str]) -> NoReturn: ... + +def _exit(n: int) -> NoReturn: ... +def kill(pid: int, sig: int) -> None: ... +if sys.platform != 'win32': + # Unix only + def fork() -> int: ... + def forkpty() -> Tuple[int, int]: ... # some flavors of Unix + def killpg(pgid: int, sig: int) -> None: ... + def nice(increment: int) -> int: ... + def plock(op: int) -> None: ... # ???op is int? + +if sys.version_info >= (3, 0): + class _wrap_close(_TextIOWrapper): + def close(self) -> Optional[int]: ... # type: ignore + def popen(command: str, mode: str = ..., buffering: int = ...) -> _wrap_close: ... +else: + class _wrap_close(IO[Text]): + def close(self) -> Optional[int]: ... + def popen(__cmd: Text, __mode: Text = ..., __bufsize: int = ...) -> _wrap_close: ... + def popen2(__cmd: Text, __mode: Text = ..., __bufsize: int = ...) -> Tuple[IO[Text], IO[Text]]: ... + def popen3(__cmd: Text, __mode: Text = ..., __bufsize: int = ...) -> Tuple[IO[Text], IO[Text], IO[Text]]: ... + def popen4(__cmd: Text, __mode: Text = ..., __bufsize: int = ...) -> Tuple[IO[Text], IO[Text]]: ... + +def spawnl(mode: int, path: _PathType, arg0: Union[bytes, Text], *args: Union[bytes, Text]) -> int: ... +def spawnle(mode: int, path: _PathType, arg0: Union[bytes, Text], + *args: Any) -> int: ... # Imprecise sig +def spawnv(mode: int, path: _PathType, args: List[Union[bytes, Text]]) -> int: ... +def spawnve(mode: int, path: _PathType, args: List[Union[bytes, Text]], + env: Mapping[str, str]) -> int: ... +def system(command: _PathType) -> int: ... +if sys.version_info >= (3, 3): + from posix import times_result + def times() -> times_result: ... +else: + def times() -> Tuple[float, float, float, float, float]: ... +def waitpid(pid: int, options: int) -> Tuple[int, int]: ... + +if sys.platform == 'win32': + def startfile(path: _PathType, operation: Optional[str] = ...) -> None: ... +else: + # Unix only + def spawnlp(mode: int, file: _PathType, arg0: Union[bytes, Text], *args: Union[bytes, Text]) -> int: ... + def spawnlpe(mode: int, file: _PathType, arg0: Union[bytes, Text], *args: Any) -> int: ... # Imprecise signature + def spawnvp(mode: int, file: _PathType, args: List[Union[bytes, Text]]) -> int: ... + def spawnvpe(mode: int, file: _PathType, args: List[Union[bytes, Text]], env: Mapping[str, str]) -> int: ... + def wait() -> Tuple[int, int]: ... # Unix only + if sys.version_info >= (3, 3): + from posix import waitid_result + def waitid(idtype: int, ident: int, options: int) -> waitid_result: ... + def wait3(options: int) -> Tuple[int, int, Any]: ... + def wait4(pid: int, options: int) -> Tuple[int, int, Any]: ... + def WCOREDUMP(status: int) -> bool: ... + def WIFCONTINUED(status: int) -> bool: ... + def WIFSTOPPED(status: int) -> bool: ... + def WIFSIGNALED(status: int) -> bool: ... + def WIFEXITED(status: int) -> bool: ... + def WEXITSTATUS(status: int) -> int: ... + def WSTOPSIG(status: int) -> int: ... + def WTERMSIG(status: int) -> int: ... + +if sys.platform != 'win32' and sys.version_info >= (3, 3): + from posix import sched_param + def sched_get_priority_min(policy: int) -> int: ... # some flavors of Unix + def sched_get_priority_max(policy: int) -> int: ... # some flavors of Unix + def sched_setscheduler(pid: int, policy: int, param: sched_param) -> None: ... # some flavors of Unix + def sched_getscheduler(pid: int) -> int: ... # some flavors of Unix + def sched_setparam(pid: int, param: sched_param) -> None: ... # some flavors of Unix + def sched_getparam(pid: int) -> sched_param: ... # some flavors of Unix + def sched_rr_get_interval(pid: int) -> float: ... # some flavors of Unix + def sched_yield() -> None: ... # some flavors of Unix + def sched_setaffinity(pid: int, mask: Iterable[int]) -> None: ... # some flavors of Unix + def sched_getaffinity(pid: int) -> Set[int]: ... # some flavors of Unix + +if sys.version_info >= (3, 4): + def cpu_count() -> Optional[int]: ... +if sys.platform != 'win32': + # Unix only + def confstr(name: Union[str, int]) -> Optional[str]: ... + def getloadavg() -> Tuple[float, float, float]: ... + def sysconf(name: Union[str, int]) -> int: ... +if sys.version_info >= (3, 6): + def getrandom(size: int, flags: int = ...) -> bytes: ... + def urandom(size: int) -> bytes: ... +else: + def urandom(n: int) -> bytes: ... + +if sys.version_info >= (3, 7): + def register_at_fork(func: Callable[..., object], when: str) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/os/path.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/os/path.pyi new file mode 100644 index 0000000..c0bf576 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/os/path.pyi @@ -0,0 +1,180 @@ +# NB: path.pyi and stdlib/2 and stdlib/3 must remain consistent! +# Stubs for os.path +# Ron Murawski + +import os +import sys +from typing import ( + overload, List, Any, AnyStr, Sequence, Tuple, BinaryIO, TextIO, + TypeVar, Union, Text, Callable, Optional +) + +_T = TypeVar('_T') + +if sys.version_info >= (3, 6): + from builtins import _PathLike + _PathType = Union[bytes, Text, _PathLike] + _StrPath = Union[Text, _PathLike[Text]] + _BytesPath = Union[bytes, _PathLike[bytes]] +else: + _PathType = Union[bytes, Text] + _StrPath = Text + _BytesPath = bytes + +# ----- os.path variables ----- +supports_unicode_filenames: bool +# aliases (also in os) +curdir: str +pardir: str +sep: str +if sys.platform == 'win32': + altsep: str +else: + altsep: Optional[str] +extsep: str +pathsep: str +defpath: str +devnull: str + +# ----- os.path function stubs ----- +if sys.version_info >= (3, 6): + # Overloads are necessary to work around python/mypy#3644. + @overload + def abspath(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def abspath(path: AnyStr) -> AnyStr: ... + @overload + def basename(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def basename(path: AnyStr) -> AnyStr: ... + @overload + def dirname(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def dirname(path: AnyStr) -> AnyStr: ... + @overload + def expanduser(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def expanduser(path: AnyStr) -> AnyStr: ... + @overload + def expandvars(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def expandvars(path: AnyStr) -> AnyStr: ... + @overload + def normcase(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def normcase(path: AnyStr) -> AnyStr: ... + @overload + def normpath(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def normpath(path: AnyStr) -> AnyStr: ... + if sys.platform == 'win32': + @overload + def realpath(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def realpath(path: AnyStr) -> AnyStr: ... + else: + @overload + def realpath(filename: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def realpath(filename: AnyStr) -> AnyStr: ... + +else: + def abspath(path: AnyStr) -> AnyStr: ... + def basename(path: AnyStr) -> AnyStr: ... + def dirname(path: AnyStr) -> AnyStr: ... + def expanduser(path: AnyStr) -> AnyStr: ... + def expandvars(path: AnyStr) -> AnyStr: ... + def normcase(path: AnyStr) -> AnyStr: ... + def normpath(path: AnyStr) -> AnyStr: ... + if sys.platform == 'win32': + def realpath(path: AnyStr) -> AnyStr: ... + else: + def realpath(filename: AnyStr) -> AnyStr: ... + +if sys.version_info >= (3, 6): + # In reality it returns str for sequences of _StrPath and bytes for sequences + # of _BytesPath, but mypy does not accept such a signature. + def commonpath(paths: Sequence[_PathType]) -> Any: ... +elif sys.version_info >= (3, 5): + def commonpath(paths: Sequence[AnyStr]) -> AnyStr: ... + +# NOTE: Empty lists results in '' (str) regardless of contained type. +# Also, in Python 2 mixed sequences of Text and bytes results in either Text or bytes +# So, fall back to Any +def commonprefix(list: Sequence[_PathType]) -> Any: ... + +if sys.version_info >= (3, 3): + def exists(path: Union[_PathType, int]) -> bool: ... +else: + def exists(path: _PathType) -> bool: ... +def lexists(path: _PathType) -> bool: ... + +# These return float if os.stat_float_times() == True, +# but int is a subclass of float. +def getatime(path: _PathType) -> float: ... +def getmtime(path: _PathType) -> float: ... +def getctime(path: _PathType) -> float: ... + +def getsize(path: _PathType) -> int: ... +def isabs(path: _PathType) -> bool: ... +def isfile(path: _PathType) -> bool: ... +def isdir(path: _PathType) -> bool: ... +def islink(path: _PathType) -> bool: ... +def ismount(path: _PathType) -> bool: ... + +if sys.version_info < (3, 0): + # Make sure signatures are disjunct, and allow combinations of bytes and unicode. + # (Since Python 2 allows that, too) + # Note that e.g. os.path.join("a", "b", "c", "d", u"e") will still result in + # a type error. + @overload + def join(__p1: bytes, *p: bytes) -> bytes: ... + @overload + def join(__p1: bytes, __p2: bytes, __p3: bytes, __p4: Text, *p: _PathType) -> Text: ... + @overload + def join(__p1: bytes, __p2: bytes, __p3: Text, *p: _PathType) -> Text: ... + @overload + def join(__p1: bytes, __p2: Text, *p: _PathType) -> Text: ... + @overload + def join(__p1: Text, *p: _PathType) -> Text: ... +elif sys.version_info >= (3, 6): + # Mypy complains that the signatures overlap (same for relpath below), but things seem to behave correctly anyway. + @overload + def join(path: _StrPath, *paths: _StrPath) -> Text: ... + @overload + def join(path: _BytesPath, *paths: _BytesPath) -> bytes: ... +else: + def join(path: AnyStr, *paths: AnyStr) -> AnyStr: ... + +@overload +def relpath(path: _BytesPath, start: Optional[_BytesPath] = ...) -> bytes: ... +@overload +def relpath(path: _StrPath, start: Optional[_StrPath] = ...) -> Text: ... + +def samefile(path1: _PathType, path2: _PathType) -> bool: ... +def sameopenfile(fp1: int, fp2: int) -> bool: ... +def samestat(stat1: os.stat_result, stat2: os.stat_result) -> bool: ... + +if sys.version_info >= (3, 6): + @overload + def split(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... + @overload + def split(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitdrive(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitdrive(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitext(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitext(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... +else: + def split(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + def splitdrive(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + def splitext(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + +if sys.platform == 'win32': + def splitunc(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... # deprecated + +if sys.version_info < (3,): + def walk(path: AnyStr, visit: Callable[[_T, AnyStr, List[AnyStr]], Any], arg: _T) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/pathlib.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/pathlib.pyi new file mode 100644 index 0000000..42968fa --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/pathlib.pyi @@ -0,0 +1,122 @@ +from typing import Any, Generator, IO, Optional, Sequence, Tuple, Type, TypeVar, Union, List +from types import TracebackType +import os +import sys + +_P = TypeVar('_P', bound='PurePath') + +if sys.version_info >= (3, 6): + _PurePathBase = os.PathLike[str] +else: + _PurePathBase = object + +class PurePath(_PurePathBase): + parts: Tuple[str, ...] + drive: str + root: str + anchor: str + name: str + suffix: str + suffixes: List[str] + stem: str + if sys.version_info < (3, 5): + def __init__(self, *pathsegments: str) -> None: ... + elif sys.version_info < (3, 6): + def __new__(cls: Type[_P], *args: Union[str, PurePath]) -> _P: ... + else: + def __new__(cls: Type[_P], *args: Union[str, os.PathLike[str]]) -> _P: ... + def __hash__(self) -> int: ... + def __lt__(self, other: PurePath) -> bool: ... + def __le__(self, other: PurePath) -> bool: ... + def __gt__(self, other: PurePath) -> bool: ... + def __ge__(self, other: PurePath) -> bool: ... + def __truediv__(self: _P, key: Union[str, PurePath]) -> _P: ... + if sys.version_info < (3,): + def __div__(self: _P, key: Union[str, PurePath]) -> _P: ... + def __bytes__(self) -> bytes: ... + def as_posix(self) -> str: ... + def as_uri(self) -> str: ... + def is_absolute(self) -> bool: ... + def is_reserved(self) -> bool: ... + def match(self, path_pattern: str) -> bool: ... + def relative_to(self: _P, *other: Union[str, PurePath]) -> _P: ... + def with_name(self: _P, name: str) -> _P: ... + def with_suffix(self: _P, suffix: str) -> _P: ... + def joinpath(self: _P, *other: Union[str, PurePath]) -> _P: ... + + @property + def parents(self: _P) -> Sequence[_P]: ... + @property + def parent(self: _P) -> _P: ... + +class PurePosixPath(PurePath): ... +class PureWindowsPath(PurePath): ... + +class Path(PurePath): + def __enter__(self) -> Path: ... + def __exit__(self, exc_type: Optional[Type[BaseException]], + exc_value: Optional[BaseException], + traceback: Optional[TracebackType]) -> Optional[bool]: ... + @classmethod + def cwd(cls: Type[_P]) -> _P: ... + def stat(self) -> os.stat_result: ... + def chmod(self, mode: int) -> None: ... + def exists(self) -> bool: ... + def glob(self, pattern: str) -> Generator[Path, None, None]: ... + def group(self) -> str: ... + def is_dir(self) -> bool: ... + def is_file(self) -> bool: ... + def is_symlink(self) -> bool: ... + def is_socket(self) -> bool: ... + def is_fifo(self) -> bool: ... + def is_block_device(self) -> bool: ... + def is_char_device(self) -> bool: ... + def iterdir(self) -> Generator[Path, None, None]: ... + def lchmod(self, mode: int) -> None: ... + def lstat(self) -> os.stat_result: ... + if sys.version_info < (3, 5): + def mkdir(self, mode: int = ..., + parents: bool = ...) -> None: ... + else: + def mkdir(self, mode: int = ..., parents: bool = ..., + exist_ok: bool = ...) -> None: ... + def open(self, mode: str = ..., buffering: int = ..., + encoding: Optional[str] = ..., errors: Optional[str] = ..., + newline: Optional[str] = ...) -> IO[Any]: ... + def owner(self) -> str: ... + def rename(self, target: Union[str, PurePath]) -> None: ... + def replace(self, target: Union[str, PurePath]) -> None: ... + if sys.version_info < (3, 6): + def resolve(self: _P) -> _P: ... + else: + def resolve(self: _P, strict: bool = ...) -> _P: ... + def rglob(self, pattern: str) -> Generator[Path, None, None]: ... + def rmdir(self) -> None: ... + def symlink_to(self, target: Union[str, Path], + target_is_directory: bool = ...) -> None: ... + def touch(self, mode: int = ..., exist_ok: bool = ...) -> None: ... + def unlink(self) -> None: ... + + if sys.version_info >= (3, 5): + @classmethod + def home(cls: Type[_P]) -> _P: ... + if sys.version_info < (3, 6): + def __new__(cls: Type[_P], *args: Union[str, PurePath], + **kwargs: Any) -> _P: ... + else: + def __new__(cls: Type[_P], *args: Union[str, os.PathLike[str]], + **kwargs: Any) -> _P: ... + + def absolute(self: _P) -> _P: ... + def expanduser(self: _P) -> _P: ... + def read_bytes(self) -> bytes: ... + def read_text(self, encoding: Optional[str] = ..., + errors: Optional[str] = ...) -> str: ... + def samefile(self, other_path: Union[str, bytes, int, Path]) -> bool: ... + def write_bytes(self, data: bytes) -> int: ... + def write_text(self, data: str, encoding: Optional[str] = ..., + errors: Optional[str] = ...) -> int: ... + + +class PosixPath(Path, PurePosixPath): ... +class WindowsPath(Path, PureWindowsPath): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/pipes.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/pipes.pyi new file mode 100644 index 0000000..658373e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/pipes.pyi @@ -0,0 +1,19 @@ +# Stubs for pipes + +# Based on http://docs.python.org/3.5/library/pipes.html + +import os + +class Template: + def __init__(self) -> None: ... + def reset(self) -> None: ... + def clone(self) -> Template: ... + def debug(self, flag: bool) -> None: ... + def append(self, cmd: str, kind: str) -> None: ... + def prepend(self, cmd: str, kind: str) -> None: ... + def open(self, file: str, rw: str) -> os._wrap_close: ... + def copy(self, file: str, rw: str) -> os._wrap_close: ... + +# Not documented, but widely used. +# Documented as shlex.quote since 3.3. +def quote(s: str) -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/platform.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/platform.pyi new file mode 100644 index 0000000..728e259 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/platform.pyi @@ -0,0 +1,34 @@ +# Stubs for platform (Python 3.5) + +from os import devnull as DEV_NULL +from os import popen +from typing import Tuple, NamedTuple + +def libc_ver(executable: str = ..., lib: str = ..., version: str = ..., chunksize: int = ...) -> Tuple[str, str]: ... +def linux_distribution(distname: str = ..., version: str = ..., id: str = ..., supported_dists: Tuple[str, ...] = ..., full_distribution_name: bool = ...) -> Tuple[str, str, str]: ... +def dist(distname: str = ..., version: str = ..., id: str = ..., supported_dists: Tuple[str, ...] = ...) -> Tuple[str, str, str]: ... +def win32_ver(release: str = ..., version: str = ..., csd: str = ..., ptype: str = ...) -> Tuple[str, str, str, str]: ... +def mac_ver(release: str = ..., versioninfo: Tuple[str, str, str] = ..., machine: str = ...) -> Tuple[str, Tuple[str, str, str], str]: ... +def java_ver(release: str = ..., vendor: str = ..., vminfo: Tuple[str, str, str] = ..., osinfo: Tuple[str, str, str] = ...) -> Tuple[str, str, Tuple[str, str, str], Tuple[str, str, str]]: ... +def system_alias(system: str, release: str, version: str) -> Tuple[str, str, str]: ... +def architecture(executable: str = ..., bits: str = ..., linkage: str = ...) -> Tuple[str, str]: ... + +uname_result = NamedTuple('uname_result', [('system', str), ('node', str), ('release', str), ('version', str), ('machine', str), ('processor', str)]) + +def uname() -> uname_result: ... +def system() -> str: ... +def node() -> str: ... +def release() -> str: ... +def version() -> str: ... +def machine() -> str: ... +def processor() -> str: ... + +def python_implementation() -> str: ... +def python_version() -> str: ... +def python_version_tuple() -> Tuple[str, str, str]: ... +def python_branch() -> str: ... +def python_revision() -> str: ... +def python_build() -> Tuple[str, str]: ... +def python_compiler() -> str: ... + +def platform(aliased: bool = ..., terse: bool = ...) -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/posix.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/posix.pyi new file mode 100644 index 0000000..6902e5f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/posix.pyi @@ -0,0 +1,112 @@ +# Stubs for posix + +# NOTE: These are incomplete! + +import sys +from typing import NamedTuple, Tuple + +from os import stat_result as stat_result + +uname_result = NamedTuple('uname_result', [ + ('sysname', str), + ('nodename', str), + ('release', str), + ('version', str), + ('machine', str), +]) + +times_result = NamedTuple('times_result', [ + ('user', float), + ('system', float), + ('children_user', float), + ('children_system', float), + ('elapsed', float), +]) + +waitid_result = NamedTuple('waitid_result', [ + ('si_pid', int), + ('si_uid', int), + ('si_signo', int), + ('si_status', int), + ('si_code', int), +]) + +sched_param = NamedTuple('sched_param', [ + ('sched_priority', int), +]) + + +EX_CANTCREAT: int +EX_CONFIG: int +EX_DATAERR: int +EX_IOERR: int +EX_NOHOST: int +EX_NOINPUT: int +EX_NOPERM: int +EX_NOTFOUND: int +EX_NOUSER: int +EX_OK: int +EX_OSERR: int +EX_OSFILE: int +EX_PROTOCOL: int +EX_SOFTWARE: int +EX_TEMPFAIL: int +EX_UNAVAILABLE: int +EX_USAGE: int + +F_OK: int +R_OK: int +W_OK: int +X_OK: int + +if sys.version_info >= (3, 6): + GRND_NONBLOCK: int + GRND_RANDOM: int +NGROUPS_MAX: int + +O_APPEND: int +if sys.version_info >= (3, 4): + O_ACCMODE: int +O_ASYNC: int +O_CREAT: int +O_DIRECT: int +O_DIRECTORY: int +O_DSYNC: int +O_EXCL: int +O_LARGEFILE: int +O_NDELAY: int +O_NOATIME: int +O_NOCTTY: int +O_NOFOLLOW: int +O_NONBLOCK: int +O_RDONLY: int +O_RDWR: int +O_RSYNC: int +O_SYNC: int +O_TRUNC: int +O_WRONLY: int + +ST_APPEND: int +ST_MANDLOCK: int +ST_NOATIME: int +ST_NODEV: int +ST_NODIRATIME: int +ST_NOEXEC: int +ST_NOSUID: int +ST_RDONLY: int +ST_RELATIME: int +ST_SYNCHRONOUS: int +ST_WRITE: int + +TMP_MAX: int +WCONTINUED: int +WCOREDUMP: int +WEXITSTATUS: int +WIFCONTINUED: int +WIFEXITED: int +WIFSIGNALED: int +WIFSTOPPED: int +WNOHANG: int +WSTOPSIG: int +WTERMSIG: int +WUNTRACED: int diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/queue.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/queue.pyi new file mode 100644 index 0000000..9874524 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/queue.pyi @@ -0,0 +1,32 @@ +# Stubs for queue + +# NOTE: These are incomplete! + +from collections import deque +from typing import Any, TypeVar, Generic, Optional + +_T = TypeVar('_T') + +class Empty(Exception): ... +class Full(Exception): ... + +class Queue(Generic[_T]): + maxsize: int + queue: deque # undocumented + def __init__(self, maxsize: int = ...) -> None: ... + def _init(self, maxsize: int) -> None: ... + def empty(self) -> bool: ... + def full(self) -> bool: ... + def get(self, block: bool = ..., timeout: Optional[float] = ...) -> _T: ... + def get_nowait(self) -> _T: ... + def _get(self) -> _T: ... + def put(self, item: _T, block: bool = ..., timeout: Optional[float] = ...) -> None: ... + def put_nowait(self, item: _T) -> None: ... + def _put(self, item: _T) -> None: ... + def join(self) -> None: ... + def qsize(self) -> int: ... + def _qsize(self) -> int: ... + def task_done(self) -> None: ... + +class PriorityQueue(Queue[_T]): ... +class LifoQueue(Queue[_T]): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/random.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/random.pyi new file mode 100644 index 0000000..35ee634 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/random.pyi @@ -0,0 +1,71 @@ +# Stubs for random +# Ron Murawski +# Updated by Jukka Lehtosalo + +# based on http://docs.python.org/3.2/library/random.html + +# ----- random classes ----- + +import _random +import sys +from typing import ( + Any, TypeVar, Sequence, List, Callable, AbstractSet, Union, Optional +) + +_T = TypeVar('_T') + +class Random(_random.Random): + def __init__(self, x: Any = ...) -> None: ... + def seed(self, a: Any = ..., version: int = ...) -> None: ... + def getstate(self) -> tuple: ... + def setstate(self, state: tuple) -> None: ... + def getrandbits(self, k: int) -> int: ... + def randrange(self, start: int, stop: Union[int, None] = ..., step: int = ...) -> int: ... + def randint(self, a: int, b: int) -> int: ... + def choice(self, seq: Sequence[_T]) -> _T: ... + if sys.version_info >= (3, 6): + def choices(self, population: Sequence[_T], weights: Optional[Sequence[float]] = ..., *, cum_weights: Optional[Sequence[float]] = ..., k: int = ...) -> List[_T]: ... + def shuffle(self, x: List[Any], random: Union[Callable[[], float], None] = ...) -> None: ... + def sample(self, population: Union[Sequence[_T], AbstractSet[_T]], k: int) -> List[_T]: ... + def random(self) -> float: ... + def uniform(self, a: float, b: float) -> float: ... + def triangular(self, low: float = ..., high: float = ..., mode: float = ...) -> float: ... + def betavariate(self, alpha: float, beta: float) -> float: ... + def expovariate(self, lambd: float) -> float: ... + def gammavariate(self, alpha: float, beta: float) -> float: ... + def gauss(self, mu: float, sigma: float) -> float: ... + def lognormvariate(self, mu: float, sigma: float) -> float: ... + def normalvariate(self, mu: float, sigma: float) -> float: ... + def vonmisesvariate(self, mu: float, kappa: float) -> float: ... + def paretovariate(self, alpha: float) -> float: ... + def weibullvariate(self, alpha: float, beta: float) -> float: ... + +# SystemRandom is not implemented for all OS's; good on Windows & Linux +class SystemRandom(Random): + ... + +# ----- random function stubs ----- +def seed(a: Any = ..., version: int = ...) -> None: ... +def getstate() -> object: ... +def setstate(state: object) -> None: ... +def getrandbits(k: int) -> int: ... +def randrange(start: int, stop: Union[None, int] = ..., step: int = ...) -> int: ... +def randint(a: int, b: int) -> int: ... +def choice(seq: Sequence[_T]) -> _T: ... +if sys.version_info >= (3, 6): + def choices(population: Sequence[_T], weights: Optional[Sequence[float]] = ..., *, cum_weights: Optional[Sequence[float]] = ..., k: int = ...) -> List[_T]: ... +def shuffle(x: List[Any], random: Union[Callable[[], float], None] = ...) -> None: ... +def sample(population: Union[Sequence[_T], AbstractSet[_T]], k: int) -> List[_T]: ... +def random() -> float: ... +def uniform(a: float, b: float) -> float: ... +def triangular(low: float = ..., high: float = ..., + mode: float = ...) -> float: ... +def betavariate(alpha: float, beta: float) -> float: ... +def expovariate(lambd: float) -> float: ... +def gammavariate(alpha: float, beta: float) -> float: ... +def gauss(mu: float, sigma: float) -> float: ... +def lognormvariate(mu: float, sigma: float) -> float: ... +def normalvariate(mu: float, sigma: float) -> float: ... +def vonmisesvariate(mu: float, kappa: float) -> float: ... +def paretovariate(alpha: float) -> float: ... +def weibullvariate(alpha: float, beta: float) -> float: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/re.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/re.pyi new file mode 100644 index 0000000..a75bfe6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/re.pyi @@ -0,0 +1,155 @@ +# Stubs for re +# Ron Murawski +# 'bytes' support added by Jukka Lehtosalo + +# based on: http://docs.python.org/3.2/library/re.html +# and http://hg.python.org/cpython/file/618ea5612e83/Lib/re.py + +import sys +from typing import ( + List, Iterator, overload, Callable, Tuple, Sequence, Dict, + Generic, AnyStr, Match, Pattern, Any, Optional, Union +) + +# ----- re variables and constants ----- +if sys.version_info >= (3, 6): + import enum + class RegexFlag(enum.IntFlag): + A = 0 + ASCII = 0 + DEBUG = 0 + I = 0 + IGNORECASE = 0 + L = 0 + LOCALE = 0 + M = 0 + MULTILINE = 0 + S = 0 + DOTALL = 0 + X = 0 + VERBOSE = 0 + U = 0 + UNICODE = 0 + T = 0 + TEMPLATE = 0 + + A = RegexFlag.A + ASCII = RegexFlag.ASCII + DEBUG = RegexFlag.DEBUG + I = RegexFlag.I + IGNORECASE = RegexFlag.IGNORECASE + L = RegexFlag.L + LOCALE = RegexFlag.LOCALE + M = RegexFlag.M + MULTILINE = RegexFlag.MULTILINE + S = RegexFlag.S + DOTALL = RegexFlag.DOTALL + X = RegexFlag.X + VERBOSE = RegexFlag.VERBOSE + U = RegexFlag.U + UNICODE = RegexFlag.UNICODE + T = RegexFlag.T + TEMPLATE = RegexFlag.TEMPLATE + _FlagsType = Union[int, RegexFlag] +else: + A = 0 + ASCII = 0 + DEBUG = 0 + I = 0 + IGNORECASE = 0 + L = 0 + LOCALE = 0 + M = 0 + MULTILINE = 0 + S = 0 + DOTALL = 0 + X = 0 + VERBOSE = 0 + U = 0 + UNICODE = 0 + T = 0 + TEMPLATE = 0 + _FlagsType = int + +if sys.version_info < (3, 7): + # undocumented + _pattern_type: type + +class error(Exception): ... + +@overload +def compile(pattern: AnyStr, flags: _FlagsType = ...) -> Pattern[AnyStr]: ... +@overload +def compile(pattern: Pattern[AnyStr], flags: _FlagsType = ...) -> Pattern[AnyStr]: ... + +@overload +def search(pattern: AnyStr, string: AnyStr, flags: _FlagsType = ...) -> Optional[Match[AnyStr]]: ... +@overload +def search(pattern: Pattern[AnyStr], string: AnyStr, flags: _FlagsType = ...) -> Optional[Match[AnyStr]]: ... + +@overload +def match(pattern: AnyStr, string: AnyStr, flags: _FlagsType = ...) -> Optional[Match[AnyStr]]: ... +@overload +def match(pattern: Pattern[AnyStr], string: AnyStr, flags: _FlagsType = ...) -> Optional[Match[AnyStr]]: ... + +# New in Python 3.4 +@overload +def fullmatch(pattern: AnyStr, string: AnyStr, flags: _FlagsType = ...) -> Optional[Match[AnyStr]]: ... +@overload +def fullmatch(pattern: Pattern[AnyStr], string: AnyStr, flags: _FlagsType = ...) -> Optional[Match[AnyStr]]: ... + +@overload +def split(pattern: AnyStr, string: AnyStr, + maxsplit: int = ..., flags: _FlagsType = ...) -> List[AnyStr]: ... +@overload +def split(pattern: Pattern[AnyStr], string: AnyStr, + maxsplit: int = ..., flags: _FlagsType = ...) -> List[AnyStr]: ... + +@overload +def findall(pattern: AnyStr, string: AnyStr, flags: _FlagsType = ...) -> List[Any]: ... +@overload +def findall(pattern: Pattern[AnyStr], string: AnyStr, flags: _FlagsType = ...) -> List[Any]: ... + +# Return an iterator yielding match objects over all non-overlapping matches +# for the RE pattern in string. The string is scanned left-to-right, and +# matches are returned in the order found. Empty matches are included in the +# result unless they touch the beginning of another match. +@overload +def finditer(pattern: AnyStr, string: AnyStr, + flags: _FlagsType = ...) -> Iterator[Match[AnyStr]]: ... +@overload +def finditer(pattern: Pattern[AnyStr], string: AnyStr, + flags: _FlagsType = ...) -> Iterator[Match[AnyStr]]: ... + +@overload +def sub(pattern: AnyStr, repl: AnyStr, string: AnyStr, count: int = ..., + flags: _FlagsType = ...) -> AnyStr: ... +@overload +def sub(pattern: AnyStr, repl: Callable[[Match[AnyStr]], AnyStr], + string: AnyStr, count: int = ..., flags: _FlagsType = ...) -> AnyStr: ... +@overload +def sub(pattern: Pattern[AnyStr], repl: AnyStr, string: AnyStr, count: int = ..., + flags: _FlagsType = ...) -> AnyStr: ... +@overload +def sub(pattern: Pattern[AnyStr], repl: Callable[[Match[AnyStr]], AnyStr], + string: AnyStr, count: int = ..., flags: _FlagsType = ...) -> AnyStr: ... + +@overload +def subn(pattern: AnyStr, repl: AnyStr, string: AnyStr, count: int = ..., + flags: _FlagsType = ...) -> Tuple[AnyStr, int]: ... +@overload +def subn(pattern: AnyStr, repl: Callable[[Match[AnyStr]], AnyStr], + string: AnyStr, count: int = ..., + flags: _FlagsType = ...) -> Tuple[AnyStr, int]: ... +@overload +def subn(pattern: Pattern[AnyStr], repl: AnyStr, string: AnyStr, count: int = ..., + flags: _FlagsType = ...) -> Tuple[AnyStr, int]: ... +@overload +def subn(pattern: Pattern[AnyStr], repl: Callable[[Match[AnyStr]], AnyStr], + string: AnyStr, count: int = ..., + flags: _FlagsType = ...) -> Tuple[AnyStr, int]: ... + +def escape(string: AnyStr) -> AnyStr: ... + +def purge() -> None: ... +def template(pattern: Union[AnyStr, Pattern[AnyStr]], flags: _FlagsType = ...) -> Pattern[AnyStr]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/reprlib.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/reprlib.pyi new file mode 100644 index 0000000..4622518 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/reprlib.pyi @@ -0,0 +1,37 @@ +# Stubs for reprlib (Python 3) + +from array import array +from typing import Any, Callable, Deque, Dict, FrozenSet, List, Set, Tuple + +_ReprFunc = Callable[[Any], str] + +def recursive_repr(fillvalue: str = ...) -> Callable[[_ReprFunc], _ReprFunc]: ... + +class Repr: + maxlevel: int + maxdict: int + maxlist: int + maxtuple: int + maxset: int + maxfrozenset: int + maxdeque: int + maxarray: int + maxlong: int + maxstring: int + maxother: int + def __init__(self) -> None: ... + def repr(self, x: Any) -> str: ... + def repr1(self, x: Any, level: int) -> str: ... + def repr_tuple(self, x: Tuple[Any, ...], level: int) -> str: ... + def repr_list(self, x: List[Any], level: int) -> str: ... + def repr_array(self, x: array, level: int) -> str: ... + def repr_set(self, x: Set[Any], level: int) -> str: ... + def repr_frozenset(self, x: FrozenSet[Any], level: int) -> str: ... + def repr_deque(self, x: Deque[Any], level: int) -> str: ... + def repr_dict(self, x: Dict[Any, Any], level: int) -> str: ... + def repr_str(self, x: str, level: int) -> str: ... + def repr_int(self, x: int, level: int) -> str: ... + def repr_instance(self, x: Any, level: int) -> str: ... + +aRepr: Repr +def repr(x: object) -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/resource.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/resource.pyi new file mode 100644 index 0000000..0d2e30b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/resource.pyi @@ -0,0 +1,42 @@ +# Stubs for resource + +# NOTE: These are incomplete! + +from typing import Tuple, Optional, NamedTuple + +RLIMIT_AS: int +RLIMIT_CORE: int +RLIMIT_CPU: int +RLIMIT_DATA: int +RLIMIT_FSIZE: int +RLIMIT_MEMLOCK: int +RLIMIT_MSGQUEUE: int +RLIMIT_NICE: int +RLIMIT_NOFILE: int +RLIMIT_NPROC: int +RLIMIT_OFILE: int +RLIMIT_RSS: int +RLIMIT_RTPRIO: int +RLIMIT_RTTIME: int +RLIMIT_SIGPENDING: int +RLIMIT_STACK: int +RLIM_INFINITY: int +RUSAGE_CHILDREN: int +RUSAGE_SELF: int +RUSAGE_THREAD: int + +_RUsage = NamedTuple('_RUsage', [('ru_utime', float), ('ru_stime', float), ('ru_maxrss', int), + ('ru_ixrss', int), ('ru_idrss', int), ('ru_isrss', int), + ('ru_minflt', int), ('ru_majflt', int), ('ru_nswap', int), + ('ru_inblock', int), ('ru_oublock', int), ('ru_msgsnd', int), + ('ru_msgrcv', int), ('ru_nsignals', int), ('ru_nvcsw', int), + ('ru_nivcsw', int)]) + +def getpagesize() -> int: ... +def getrlimit(resource: int) -> Tuple[int, int]: ... +def getrusage(who: int) -> _RUsage: ... +def prlimit(pid: int, resource: int, limits: Optional[Tuple[int, int]]) -> Tuple[int, int]: ... +def setrlimit(resource: int, limits: Tuple[int, int]) -> None: ... + +# NOTE: This is an alias of OSError in Python 3.3. +class error(Exception): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/runpy.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/runpy.pyi new file mode 100644 index 0000000..654c53c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/runpy.pyi @@ -0,0 +1,23 @@ +from types import ModuleType +from typing import Dict, Optional, Any + +class _TempModule: + mod_name: str = ... + module: ModuleType = ... + def __init__(self, mod_name): ... + def __enter__(self): ... + def __exit__(self, *args): ... + +class _ModifiedArgv0: + value: Any = ... + def __init__(self, value): ... + def __enter__(self): ... + def __exit__(self, *args): ... + +def run_module(mod_name: str, + init_globals: Optional[Dict[str, Any]] = ..., + run_name: Optional[str] = ..., + alter_sys: bool = ...): ... +def run_path(path_name: str, + init_globals: Optional[Dict[str, Any]] = ..., + run_name: str = ...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/selectors.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/selectors.pyi new file mode 100644 index 0000000..39e68ce --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/selectors.pyi @@ -0,0 +1,90 @@ +# Stubs for selector +# See https://docs.python.org/3/library/selectors.html + +from typing import Any, List, NamedTuple, Mapping, Tuple, Optional, Union +from abc import ABCMeta, abstractmethod +import socket + + +# Type aliases added mainly to preserve some context +# +# See https://github.com/python/typeshed/issues/482 +# for details regarding how _FileObject is typed. +_FileObject = Union[int, socket.socket] +_FileDescriptor = int +_EventMask = int + + +EVENT_READ: _EventMask +EVENT_WRITE: _EventMask + + +SelectorKey = NamedTuple('SelectorKey', [ + ('fileobj', _FileObject), + ('fd', _FileDescriptor), + ('events', _EventMask), + ('data', Any) +]) + + +class BaseSelector(metaclass=ABCMeta): + @abstractmethod + def register(self, fileobj: _FileObject, events: _EventMask, data: Any = ...) -> SelectorKey: ... + + @abstractmethod + def unregister(self, fileobj: _FileObject) -> SelectorKey: ... + + def modify(self, fileobj: _FileObject, events: _EventMask, data: Any = ...) -> SelectorKey: ... + + @abstractmethod + def select(self, timeout: Optional[float] = ...) -> List[Tuple[SelectorKey, _EventMask]]: ... + + def close(self) -> None: ... + + def get_key(self, fileobj: _FileObject) -> SelectorKey: ... + + @abstractmethod + def get_map(self) -> Mapping[_FileObject, SelectorKey]: ... + + def __enter__(self) -> BaseSelector: ... + + def __exit__(self, *args: Any) -> None: ... + +class SelectSelector(BaseSelector): + def register(self, fileobj: _FileObject, events: _EventMask, data: Any = ...) -> SelectorKey: ... + def unregister(self, fileobj: _FileObject) -> SelectorKey: ... + def select(self, timeout: Optional[float] = ...) -> List[Tuple[SelectorKey, _EventMask]]: ... + def get_map(self) -> Mapping[_FileObject, SelectorKey]: ... + +class PollSelector(BaseSelector): + def register(self, fileobj: _FileObject, events: _EventMask, data: Any = ...) -> SelectorKey: ... + def unregister(self, fileobj: _FileObject) -> SelectorKey: ... + def select(self, timeout: Optional[float] = ...) -> List[Tuple[SelectorKey, _EventMask]]: ... + def get_map(self) -> Mapping[_FileObject, SelectorKey]: ... + +class EpollSelector(BaseSelector): + def fileno(self) -> int: ... + def register(self, fileobj: _FileObject, events: _EventMask, data: Any = ...) -> SelectorKey: ... + def unregister(self, fileobj: _FileObject) -> SelectorKey: ... + def select(self, timeout: Optional[float] = ...) -> List[Tuple[SelectorKey, _EventMask]]: ... + def get_map(self) -> Mapping[_FileObject, SelectorKey]: ... + +class DevpollSelector(BaseSelector): + def fileno(self) -> int: ... + def register(self, fileobj: _FileObject, events: _EventMask, data: Any = ...) -> SelectorKey: ... + def unregister(self, fileobj: _FileObject) -> SelectorKey: ... + def select(self, timeout: Optional[float] = ...) -> List[Tuple[SelectorKey, _EventMask]]: ... + def get_map(self) -> Mapping[_FileObject, SelectorKey]: ... + +class KqueueSelector(BaseSelector): + def fileno(self) -> int: ... + def register(self, fileobj: _FileObject, events: _EventMask, data: Any = ...) -> SelectorKey: ... + def unregister(self, fileobj: _FileObject) -> SelectorKey: ... + def select(self, timeout: Optional[float] = ...) -> List[Tuple[SelectorKey, _EventMask]]: ... + def get_map(self) -> Mapping[_FileObject, SelectorKey]: ... + +class DefaultSelector(BaseSelector): + def register(self, fileobj: _FileObject, events: _EventMask, data: Any = ...) -> SelectorKey: ... + def unregister(self, fileobj: _FileObject) -> SelectorKey: ... + def select(self, timeout: Optional[float] = ...) -> List[Tuple[SelectorKey, _EventMask]]: ... + def get_map(self) -> Mapping[_FileObject, SelectorKey]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/shelve.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/shelve.pyi new file mode 100644 index 0000000..4a33969 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/shelve.pyi @@ -0,0 +1,31 @@ +from typing import Any, Dict, Iterator, Optional, Tuple +import collections + + +class Shelf(collections.MutableMapping): + def __init__(self, dict: Dict[bytes, Any], protocol: Optional[int] = ..., writeback: bool = ..., keyencoding: str = ...) -> None: ... + def __iter__(self) -> Iterator[str]: ... + def __len__(self) -> int: ... + def __contains__(self, key: Any) -> bool: ... # key should be str, but it would conflict with superclass's type signature + def get(self, key: str, default: Any = ...) -> Any: ... + def __getitem__(self, key: str) -> Any: ... + def __setitem__(self, key: str, value: Any) -> None: ... + def __delitem__(self, key: str) -> None: ... + def __enter__(self) -> Shelf: ... + def __exit__(self, type: Any, value: Any, traceback: Any) -> None: ... + def close(self) -> None: ... + def __del__(self) -> None: ... + def sync(self) -> None: ... + +class BsdDbShelf(Shelf): + def __init__(self, dict: Dict[bytes, Any], protocol: Optional[int] = ..., writeback: bool = ..., keyencoding: str = ...) -> None: ... + def set_location(self, key: Any) -> Tuple[str, Any]: ... + def next(self) -> Tuple[str, Any]: ... + def previous(self) -> Tuple[str, Any]: ... + def first(self) -> Tuple[str, Any]: ... + def last(self) -> Tuple[str, Any]: ... + +class DbfilenameShelf(Shelf): + def __init__(self, filename: str, flag: str = ..., protocol: Optional[int] = ..., writeback: bool = ...) -> None: ... + +def open(filename: str, flag: str = ..., protocol: Optional[int] = ..., writeback: bool = ...) -> DbfilenameShelf: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/shlex.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/shlex.pyi new file mode 100644 index 0000000..fb398ea --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/shlex.pyi @@ -0,0 +1,50 @@ +# Stubs for shlex + +# Based on http://docs.python.org/3.2/library/shlex.html + +from typing import List, Tuple, Any, TextIO, Union, Optional, Iterable, TypeVar +import sys + +def split(s: str, comments: bool = ..., + posix: bool = ...) -> List[str]: ... + +# Added in 3.3, use (undocumented) pipes.quote in previous versions. +def quote(s: str) -> str: ... + +_SLT = TypeVar('_SLT', bound=shlex) + +class shlex(Iterable[str]): + commenters: str + wordchars: str + whitespace: str + escape: str + quotes: str + escapedquotes: str + whitespace_split: bool + infile: str + instream: TextIO + source: str + debug = 0 + lineno = 0 + token: str + eof: str + if sys.version_info >= (3, 6): + punctuation_chars: str + + if sys.version_info >= (3, 6): + def __init__(self, instream: Union[str, TextIO] = ..., infile: Optional[str] = ..., + posix: bool = ..., punctuation_chars: Union[bool, str] = ...) -> None: ... + else: + def __init__(self, instream: Union[str, TextIO] = ..., infile: Optional[str] = ..., + posix: bool = ...) -> None: ... + def get_token(self) -> str: ... + def push_token(self, tok: str) -> None: ... + def read_token(self) -> str: ... + def sourcehook(self, filename: str) -> Tuple[str, TextIO]: ... + # TODO argument types + def push_source(self, newstream: Any, newfile: Any = ...) -> None: ... + def pop_source(self) -> None: ... + def error_leader(self, infile: str = ..., + lineno: int = ...) -> None: ... + def __iter__(self: _SLT) -> _SLT: ... + def __next__(self) -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/signal.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/signal.pyi new file mode 100644 index 0000000..34a8cdd --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/signal.pyi @@ -0,0 +1,187 @@ +"""Stub file for the 'signal' module.""" + +import sys +from enum import IntEnum +from typing import Any, Callable, List, Tuple, Dict, Generic, Union, Optional, Iterable, Set +from types import FrameType + +class ItimerError(IOError): ... + +ITIMER_PROF: int = ... +ITIMER_REAL: int = ... +ITIMER_VIRTUAL: int = ... + +NSIG: int = ... + +if sys.version_info >= (3, 5): + class Signals(IntEnum): + SIGABRT = ... + SIGALRM = ... + SIGBREAK = ... # Windows + SIGBUS = ... + SIGCHLD = ... + SIGCLD = ... + SIGCONT = ... + SIGEMT = ... + SIGFPE = ... + SIGHUP = ... + SIGILL = ... + SIGINFO = ... + SIGINT = ... + SIGIO = ... + SIGIOT = ... + SIGKILL = ... + SIGPIPE = ... + SIGPOLL = ... + SIGPROF = ... + SIGPWR = ... + SIGQUIT = ... + SIGRTMAX = ... + SIGRTMIN = ... + SIGSEGV = ... + SIGSTOP = ... + SIGSYS = ... + SIGTERM = ... + SIGTRAP = ... + SIGTSTP = ... + SIGTTIN = ... + SIGTTOU = ... + SIGURG = ... + SIGUSR1 = ... + SIGUSR2 = ... + SIGVTALRM = ... + SIGWINCH = ... + SIGXCPU = ... + SIGXFSZ = ... + + class Handlers(IntEnum): + SIG_DFL = ... + SIG_IGN = ... + + SIG_DFL = Handlers.SIG_DFL + SIG_IGN = Handlers.SIG_IGN + + class Sigmasks(IntEnum): + SIG_BLOCK = ... + SIG_UNBLOCK = ... + SIG_SETMASK = ... + + SIG_BLOCK = Sigmasks.SIG_BLOCK + SIG_UNBLOCK = Sigmasks.SIG_UNBLOCK + SIG_SETMASK = Sigmasks.SIG_SETMASK + + _SIG = Signals + _SIGNUM = Union[int, Signals] + _HANDLER = Union[Callable[[Signals, FrameType], None], int, Handlers, None] +else: + SIG_DFL: int = ... + SIG_IGN: int = ... + + SIG_BLOCK: int = ... + SIG_UNBLOCK: int = ... + SIG_SETMASK: int = ... + + _SIG = int + _SIGNUM = int + _HANDLER = Union[Callable[[int, FrameType], None], int, None] + +SIGABRT: _SIG = ... +SIGALRM: _SIG = ... +SIGBREAK: _SIG = ... # Windows +SIGBUS: _SIG = ... +SIGCHLD: _SIG = ... +SIGCLD: _SIG = ... +SIGCONT: _SIG = ... +SIGEMT: _SIG = ... +SIGFPE: _SIG = ... +SIGHUP: _SIG = ... +SIGILL: _SIG = ... +SIGINFO: _SIG = ... +SIGINT: _SIG = ... +SIGIO: _SIG = ... +SIGIOT: _SIG = ... +SIGKILL: _SIG = ... +SIGPIPE: _SIG = ... +SIGPOLL: _SIG = ... +SIGPROF: _SIG = ... +SIGPWR: _SIG = ... +SIGQUIT: _SIG = ... +SIGRTMAX: _SIG = ... +SIGRTMIN: _SIG = ... +SIGSEGV: _SIG = ... +SIGSTOP: _SIG = ... +SIGSYS: _SIG = ... +SIGTERM: _SIG = ... +SIGTRAP: _SIG = ... +SIGTSTP: _SIG = ... +SIGTTIN: _SIG = ... +SIGTTOU: _SIG = ... +SIGURG: _SIG = ... +SIGUSR1: _SIG = ... +SIGUSR2: _SIG = ... +SIGVTALRM: _SIG = ... +SIGWINCH: _SIG = ... +SIGXCPU: _SIG = ... +SIGXFSZ: _SIG = ... + +# Windows +CTRL_C_EVENT: _SIG = ... +CTRL_BREAK_EVENT: _SIG = ... + +class struct_siginfo(Tuple[int, int, int, int, int, int, int]): + def __init__(self, sequence: Iterable[int]) -> None: ... + @property + def si_signo(self) -> int: ... + @property + def si_code(self) -> int: ... + @property + def si_errno(self) -> int: ... + @property + def si_pid(self) -> int: ... + @property + def si_uid(self) -> int: ... + @property + def si_status(self) -> int: ... + @property + def si_band(self) -> int: ... + +def alarm(time: int) -> int: ... + +def default_int_handler(signum: int, frame: FrameType) -> None: + raise KeyboardInterrupt() + +def getitimer(which: int) -> Tuple[float, float]: ... + +def getsignal(signalnum: _SIGNUM) -> _HANDLER: + raise ValueError() + +def pause() -> None: ... + +def pthread_kill(thread_id: int, signum: int) -> None: + raise OSError() + +def pthread_sigmask(how: int, mask: Iterable[int]) -> Set[_SIGNUM]: + raise OSError() + +def set_wakeup_fd(fd: int) -> int: ... + +def setitimer(which: int, seconds: float, interval: float = ...) -> Tuple[float, float]: ... + +def siginterrupt(signalnum: int, flag: bool) -> None: + raise OSError() + +def signal(signalnum: _SIGNUM, handler: _HANDLER) -> _HANDLER: + raise OSError() + +def sigpending() -> Any: + raise OSError() + +def sigtimedwait(sigset: Iterable[int], timeout: float) -> Optional[struct_siginfo]: + raise OSError() + raise ValueError() + +def sigwait(sigset: Iterable[int]) -> _SIGNUM: + raise OSError() + +def sigwaitinfo(sigset: Iterable[int]) -> struct_siginfo: + raise OSError() diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/smtplib.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/smtplib.pyi new file mode 100644 index 0000000..ec8e27f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/smtplib.pyi @@ -0,0 +1,141 @@ +from email.message import Message as _Message +from socket import socket +from ssl import SSLContext +from types import TracebackType +from typing import ( + Any, AnyStr, Dict, Generic, List, Optional, Sequence, Tuple, Union, + Pattern, Type, Callable, Protocol, overload) +import sys + +_Reply = Tuple[int, bytes] +_SendErrs = Dict[str, _Reply] +# Should match source_address for socket.create_connection +_SourceAddress = Tuple[Union[bytearray, bytes, str], int] + +SMTP_PORT: int +SMTP_SSL_PORT: int +CRLF: str +bCRLF: bytes + +OLDSTYLE_AUTH: Pattern[str] + +class SMTPException(OSError): ... +class SMTPServerDisconnected(SMTPException): ... + +class SMTPResponseException(SMTPException): + smtp_code: int + smtp_error: Union[bytes, str] + args: Union[Tuple[int, Union[bytes, str]], Tuple[int, bytes, str]] + def __init__(self, code: int, msg: Union[bytes, str]) -> None: ... + +class SMTPSenderRefused(SMTPResponseException): + smtp_code: int + smtp_error: bytes + sender: str + args: Tuple[int, bytes, str] + def __init__(self, code: int, msg: bytes, sender: str) -> None: ... + +class SMTPRecipientsRefused(SMTPException): + recipients: _SendErrs + args: Tuple[_SendErrs] + def __init__(self, recipients: _SendErrs) -> None: ... + +class SMTPDataError(SMTPResponseException): ... +class SMTPConnectError(SMTPResponseException): ... +class SMTPHeloError(SMTPResponseException): ... +class SMTPAuthenticationError(SMTPResponseException): ... + +def quoteaddr(addrstring: str) -> str: ... +def quotedata(data: str) -> str: ... + +class _AuthObject(Protocol): + @overload + def __call__(self, challenge: None = ...) -> Optional[str]: ... + @overload + def __call__(self, challenge: bytes) -> str: ... + +class SMTP: + debuglevel: int = ... + # Type of file should match what socket.makefile() returns + file: Any = ... + helo_resp: Optional[bytes] = ... + ehlo_msg: str = ... + ehlo_resp: Optional[bytes] = ... + does_esmtp: int = ... + default_port: int = ... + timeout: float + esmtp_features: Dict[str, str] + command_encoding: str + source_address: Optional[_SourceAddress] + local_hostname: str + def __init__(self, host: str = ..., port: int = ..., + local_hostname: Optional[str] = ..., timeout: float = ..., + source_address: Optional[_SourceAddress] = ...) -> None: ... + def __enter__(self) -> SMTP: ... + def __exit__(self, exc_type: Optional[Type[BaseException]], + exc_value: Optional[BaseException], + tb: Optional[TracebackType]) -> None: ... + def set_debuglevel(self, debuglevel: int) -> None: ... + sock: Optional[socket] + def connect(self, host: str = ..., port: int = ..., + source_address: Optional[_SourceAddress] = ...) -> _Reply: ... + def send(self, s: Union[bytes, str]) -> None: ... + def putcmd(self, cmd: str, args: str = ...) -> None: ... + def getreply(self) -> _Reply: ... + def docmd(self, cmd: str, args: str = ...) -> _Reply: ... + def helo(self, name: str = ...) -> _Reply: ... + def ehlo(self, name: str = ...) -> _Reply: ... + def has_extn(self, opt: str) -> bool: ... + def help(self, args: str = ...) -> bytes: ... + def rset(self) -> _Reply: ... + def noop(self) -> _Reply: ... + def mail(self, sender: str, options: Sequence[str] = ...) -> _Reply: ... + def rcpt(self, recip: str, options: Sequence[str] = ...) -> _Reply: ... + def data(self, msg: Union[bytes, str]) -> _Reply: ... + def verify(self, address: str) -> _Reply: ... + vrfy = verify + def expn(self, address: str) -> _Reply: ... + def ehlo_or_helo_if_needed(self) -> None: ... + if sys.version_info >= (3, 5): + user: str + password: str + def auth(self, mechanism: str, authobject: _AuthObject, *, initial_response_ok: bool = ...) -> _Reply: ... + @overload + def auth_cram_md5(self, challenge: None = ...) -> None: ... + @overload + def auth_cram_md5(self, challenge: bytes) -> str: ... + def auth_plain(self, challenge: Optional[bytes] = ...) -> str: ... + def auth_login(self, challenge: Optional[bytes] = ...) -> str: ... + def login(self, user: str, password: str, *, + initial_response_ok: bool = ...) -> _Reply: ... + else: + def login(self, user: str, password: str) -> _Reply: ... + def starttls(self, keyfile: Optional[str] = ..., certfile: Optional[str] = ..., + context: Optional[SSLContext] = ...) -> _Reply: ... + def sendmail(self, from_addr: str, to_addrs: Union[str, Sequence[str]], + msg: Union[bytes, str], mail_options: Sequence[str] = ..., + rcpt_options: List[str] = ...) -> _SendErrs: ... + def send_message(self, msg: _Message, from_addr: Optional[str] = ..., + to_addrs: Optional[Union[str, Sequence[str]]] = ..., + mail_options: List[str] = ..., + rcpt_options: Sequence[str] = ...) -> _SendErrs: ... + def close(self) -> None: ... + def quit(self) -> _Reply: ... + +class SMTP_SSL(SMTP): + keyfile: Optional[str] + certfile: Optional[str] + context: SSLContext + def __init__(self, host: str = ..., port: int = ..., + local_hostname: Optional[str] = ..., + keyfile: Optional[str] = ..., certfile: Optional[str] = ..., + timeout: float = ..., + source_address: Optional[_SourceAddress] = ..., + context: Optional[SSLContext] = ...) -> None: ... + +LMTP_PORT: int + +class LMTP(SMTP): + def __init__(self, host: str = ..., port: int = ..., + local_hostname: Optional[str] = ..., + source_address: Optional[_SourceAddress] = ...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/socketserver.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/socketserver.pyi new file mode 100644 index 0000000..d485b8b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/socketserver.pyi @@ -0,0 +1,99 @@ +# NB: SocketServer.pyi and socketserver.pyi must remain consistent! +# Stubs for socketserver + +from typing import Any, BinaryIO, Optional, Tuple, Type +from socket import SocketType +import sys +import types + +class BaseServer: + address_family: int + RequestHandlerClass: type + server_address: Tuple[str, int] + socket: SocketType + allow_reuse_address: bool + request_queue_size: int + socket_type: int + timeout: Optional[float] + def __init__(self, server_address: Tuple[str, int], + RequestHandlerClass: type) -> None: ... + def fileno(self) -> int: ... + def handle_request(self) -> None: ... + def serve_forever(self, poll_interval: float = ...) -> None: ... + def shutdown(self) -> None: ... + def server_close(self) -> None: ... + def finish_request(self, request: bytes, + client_address: Tuple[str, int]) -> None: ... + def get_request(self) -> None: ... + def handle_error(self, request: bytes, + client_address: Tuple[str, int]) -> None: ... + def handle_timeout(self) -> None: ... + def process_request(self, request: bytes, + client_address: Tuple[str, int]) -> None: ... + def server_activate(self) -> None: ... + def server_bind(self) -> None: ... + def verify_request(self, request: bytes, + client_address: Tuple[str, int]) -> bool: ... + if sys.version_info >= (3, 6): + def __enter__(self) -> BaseServer: ... + def __exit__(self, exc_type: Optional[Type[BaseException]], + exc_val: Optional[BaseException], + exc_tb: Optional[types.TracebackType]) -> bool: ... + if sys.version_info >= (3, 3): + def service_actions(self) -> None: ... + +class TCPServer(BaseServer): + def __init__(self, server_address: Tuple[str, int], + RequestHandlerClass: type, + bind_and_activate: bool = ...) -> None: ... + +class UDPServer(BaseServer): + def __init__(self, server_address: Tuple[str, int], + RequestHandlerClass: type, + bind_and_activate: bool = ...) -> None: ... + +if sys.platform != 'win32': + class UnixStreamServer(BaseServer): + def __init__(self, server_address: Tuple[str, int], + RequestHandlerClass: type, + bind_and_activate: bool = ...) -> None: ... + + class UnixDatagramServer(BaseServer): + def __init__(self, server_address: Tuple[str, int], + RequestHandlerClass: type, + bind_and_activate: bool = ...) -> None: ... + +class ForkingMixIn: ... +class ThreadingMixIn: ... + +class ForkingTCPServer(ForkingMixIn, TCPServer): ... +class ForkingUDPServer(ForkingMixIn, UDPServer): ... +class ThreadingTCPServer(ThreadingMixIn, TCPServer): ... +class ThreadingUDPServer(ThreadingMixIn, UDPServer): ... +if sys.platform != 'win32': + class ThreadingUnixStreamServer(ThreadingMixIn, UnixStreamServer): ... + class ThreadingUnixDatagramServer(ThreadingMixIn, UnixDatagramServer): ... + + +class BaseRequestHandler: + # Those are technically of types, respectively: + # * Union[SocketType, Tuple[bytes, SocketType]] + # * Union[Tuple[str, int], str] + # But there are some concerns that having unions here would cause + # too much inconvenience to people using it (see + # https://github.com/python/typeshed/pull/384#issuecomment-234649696) + request: Any + client_address: Any + + server: BaseServer + def setup(self) -> None: ... + def handle(self) -> None: ... + def finish(self) -> None: ... + +class StreamRequestHandler(BaseRequestHandler): + rfile: BinaryIO + wfile: BinaryIO + +class DatagramRequestHandler(BaseRequestHandler): + rfile: BinaryIO + wfile: BinaryIO diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/spwd.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/spwd.pyi new file mode 100644 index 0000000..0e55d74 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/spwd.pyi @@ -0,0 +1,14 @@ +from typing import List, NamedTuple + +struct_spwd = NamedTuple("struct_spwd", [("sp_namp", str), + ("sp_pwdp", str), + ("sp_lstchg", int), + ("sp_min", int), + ("sp_max", int), + ("sp_warn", int), + ("sp_inact", int), + ("sp_expire", int), + ("sp_flag", int)]) + +def getspall() -> List[struct_spwd]: ... +def getspnam(name: str) -> struct_spwd: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/sre_constants.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/sre_constants.pyi new file mode 100644 index 0000000..85f50ca --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/sre_constants.pyi @@ -0,0 +1,114 @@ +# Source: https://github.com/python/cpython/blob/master/Lib/sre_constants.py + +from typing import Any, Dict, List, Optional, Union + +MAGIC: int + +class error(Exception): + msg: str + pattern: Optional[Union[str, bytes]] + pos: Optional[int] + lineno: int + colno: int + def __init__(self, msg: str, pattern: Union[str, bytes] = ..., pos: int = ...) -> None: ... + +class _NamedIntConstant(int): + name: Any + def __new__(cls, value: int, name: str): ... + +MAXREPEAT: _NamedIntConstant +OPCODES: List[_NamedIntConstant] +ATCODES: List[_NamedIntConstant] +CHCODES: List[_NamedIntConstant] +OP_IGNORE: Dict[_NamedIntConstant, _NamedIntConstant] +AT_MULTILINE: Dict[_NamedIntConstant, _NamedIntConstant] +AT_LOCALE: Dict[_NamedIntConstant, _NamedIntConstant] +AT_UNICODE: Dict[_NamedIntConstant, _NamedIntConstant] +CH_LOCALE: Dict[_NamedIntConstant, _NamedIntConstant] +CH_UNICODE: Dict[_NamedIntConstant, _NamedIntConstant] +SRE_FLAG_TEMPLATE: int +SRE_FLAG_IGNORECASE: int +SRE_FLAG_LOCALE: int +SRE_FLAG_MULTILINE: int +SRE_FLAG_DOTALL: int +SRE_FLAG_UNICODE: int +SRE_FLAG_VERBOSE: int +SRE_FLAG_DEBUG: int +SRE_FLAG_ASCII: int +SRE_INFO_PREFIX: int +SRE_INFO_LITERAL: int +SRE_INFO_CHARSET: int + + +# Stubgen above; manually defined constants below (dynamic at runtime) + +# from OPCODES +FAILURE: _NamedIntConstant +SUCCESS: _NamedIntConstant +ANY: _NamedIntConstant +ANY_ALL: _NamedIntConstant +ASSERT: _NamedIntConstant +ASSERT_NOT: _NamedIntConstant +AT: _NamedIntConstant +BRANCH: _NamedIntConstant +CALL: _NamedIntConstant +CATEGORY: _NamedIntConstant +CHARSET: _NamedIntConstant +BIGCHARSET: _NamedIntConstant +GROUPREF: _NamedIntConstant +GROUPREF_EXISTS: _NamedIntConstant +GROUPREF_IGNORE: _NamedIntConstant +IN: _NamedIntConstant +IN_IGNORE: _NamedIntConstant +INFO: _NamedIntConstant +JUMP: _NamedIntConstant +LITERAL: _NamedIntConstant +LITERAL_IGNORE: _NamedIntConstant +MARK: _NamedIntConstant +MAX_UNTIL: _NamedIntConstant +MIN_UNTIL: _NamedIntConstant +NOT_LITERAL: _NamedIntConstant +NOT_LITERAL_IGNORE: _NamedIntConstant +NEGATE: _NamedIntConstant +RANGE: _NamedIntConstant +REPEAT: _NamedIntConstant +REPEAT_ONE: _NamedIntConstant +SUBPATTERN: _NamedIntConstant +MIN_REPEAT_ONE: _NamedIntConstant +RANGE_IGNORE: _NamedIntConstant +MIN_REPEAT: _NamedIntConstant +MAX_REPEAT: _NamedIntConstant + +# from ATCODES +AT_BEGINNING: _NamedIntConstant +AT_BEGINNING_LINE: _NamedIntConstant +AT_BEGINNING_STRING: _NamedIntConstant +AT_BOUNDARY: _NamedIntConstant +AT_NON_BOUNDARY: _NamedIntConstant +AT_END: _NamedIntConstant +AT_END_LINE: _NamedIntConstant +AT_END_STRING: _NamedIntConstant +AT_LOC_BOUNDARY: _NamedIntConstant +AT_LOC_NON_BOUNDARY: _NamedIntConstant +AT_UNI_BOUNDARY: _NamedIntConstant +AT_UNI_NON_BOUNDARY: _NamedIntConstant + +# from CHCODES +CATEGORY_DIGIT: _NamedIntConstant +CATEGORY_NOT_DIGIT: _NamedIntConstant +CATEGORY_SPACE: _NamedIntConstant +CATEGORY_NOT_SPACE: _NamedIntConstant +CATEGORY_WORD: _NamedIntConstant +CATEGORY_NOT_WORD: _NamedIntConstant +CATEGORY_LINEBREAK: _NamedIntConstant +CATEGORY_NOT_LINEBREAK: _NamedIntConstant +CATEGORY_LOC_WORD: _NamedIntConstant +CATEGORY_LOC_NOT_WORD: _NamedIntConstant +CATEGORY_UNI_DIGIT: _NamedIntConstant +CATEGORY_UNI_NOT_DIGIT: _NamedIntConstant +CATEGORY_UNI_SPACE: _NamedIntConstant +CATEGORY_UNI_NOT_SPACE: _NamedIntConstant +CATEGORY_UNI_WORD: _NamedIntConstant +CATEGORY_UNI_NOT_WORD: _NamedIntConstant +CATEGORY_UNI_LINEBREAK: _NamedIntConstant +CATEGORY_UNI_NOT_LINEBREAK: _NamedIntConstant diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/sre_parse.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/sre_parse.pyi new file mode 100644 index 0000000..93b3c1d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/sre_parse.pyi @@ -0,0 +1,81 @@ +# Source: https://github.com/python/cpython/blob/master/Lib/sre_parse.py + +from typing import ( + Any, Dict, FrozenSet, Iterable, List, Match, + Optional, Pattern as _Pattern, Tuple, Union +) +from sre_constants import _NamedIntConstant as NIC, error as _Error + +SPECIAL_CHARS: str +REPEAT_CHARS: str +DIGITS: FrozenSet[str] +OCTDIGITS: FrozenSet[str] +HEXDIGITS: FrozenSet[str] +ASCIILETTERS: FrozenSet[str] +WHITESPACE: FrozenSet[str] +ESCAPES: Dict[str, Tuple[NIC, int]] +CATEGORIES: Dict[str, Union[Tuple[NIC, NIC], Tuple[NIC, List[Tuple[NIC, NIC]]]]] +FLAGS: Dict[str, int] +GLOBAL_FLAGS: int + +class Verbose(Exception): ... + +class Pattern: + flags: int + groupdict: Dict[str, int] + groupwidths: List[Optional[int]] + lookbehindgroups: Optional[int] + def __init__(self) -> None: ... + @property + def groups(self) -> int: ... + def opengroup(self, name: str = ...) -> int: ... + def closegroup(self, gid: int, p: SubPattern) -> None: ... + def checkgroup(self, gid: int) -> bool: ... + def checklookbehindgroup(self, gid: int, source: Tokenizer) -> None: ... + + +_OpSubpatternType = Tuple[Optional[int], int, int, SubPattern] +_OpGroupRefExistsType = Tuple[int, SubPattern, SubPattern] +_OpInType = List[Tuple[NIC, int]] +_OpBranchType = Tuple[None, List[SubPattern]] +_AvType = Union[_OpInType, _OpBranchType, Iterable[SubPattern], _OpGroupRefExistsType, _OpSubpatternType] +_CodeType = Tuple[NIC, _AvType] + + +class SubPattern: + pattern: Pattern + data: List[_CodeType] + width: Optional[int] + def __init__(self, pattern: Pattern, data: List[_CodeType] = ...) -> None: ... + def dump(self, level: int = ...) -> None: ... + def __len__(self) -> int: ... + def __delitem__(self, index: Union[int, slice]) -> None: ... + def __getitem__(self, index: Union[int, slice]) -> Union[SubPattern, _CodeType]: ... + def __setitem__(self, index: Union[int, slice], code: _CodeType) -> None: ... + def insert(self, index: int, code: _CodeType) -> None: ... + def append(self, code: _CodeType) -> None: ... + def getwidth(self) -> int: ... + + +class Tokenizer: + istext: bool + string: Any + decoded_string: str + index: int + next: Optional[str] + def __init__(self, string: Any) -> None: ... + def match(self, char: str) -> bool: ... + def get(self) -> Optional[str]: ... + def getwhile(self, n: int, charset: Iterable[str]) -> str: ... + def getuntil(self, terminator: str) -> str: ... + @property + def pos(self) -> int: ... + def tell(self) -> int: ... + def seek(self, index: int) -> None: ... + def error(self, msg: str, offset: int = ...) -> _Error: ... + +def fix_flags(src: Union[str, bytes], flag: int) -> int: ... +def parse(str: str, flags: int = ..., pattern: Pattern = ...) -> SubPattern: ... +_TemplateType = Tuple[List[Tuple[int, int]], List[str]] +def parse_template(source: str, pattern: _Pattern) -> _TemplateType: ... +def expand_template(template: _TemplateType, match: Match) -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/stat.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/stat.pyi new file mode 100644 index 0000000..c45a068 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/stat.pyi @@ -0,0 +1,75 @@ +# Stubs for stat + +# Based on http://docs.python.org/3.2/library/stat.html + +import sys +import typing + +def S_ISDIR(mode: int) -> bool: ... +def S_ISCHR(mode: int) -> bool: ... +def S_ISBLK(mode: int) -> bool: ... +def S_ISREG(mode: int) -> bool: ... +def S_ISFIFO(mode: int) -> bool: ... +def S_ISLNK(mode: int) -> bool: ... +def S_ISSOCK(mode: int) -> bool: ... + +def S_IMODE(mode: int) -> int: ... +def S_IFMT(mode: int) -> int: ... + +def filemode(mode: int) -> str: ... + +ST_MODE = 0 +ST_INO = 0 +ST_DEV = 0 +ST_NLINK = 0 +ST_UID = 0 +ST_GID = 0 +ST_SIZE = 0 +ST_ATIME = 0 +ST_MTIME = 0 +ST_CTIME = 0 + +S_IFSOCK = 0 +S_IFLNK = 0 +S_IFREG = 0 +S_IFBLK = 0 +S_IFDIR = 0 +S_IFCHR = 0 +S_IFIFO = 0 +S_ISUID = 0 +S_ISGID = 0 +S_ISVTX = 0 + +S_IRWXU = 0 +S_IRUSR = 0 +S_IWUSR = 0 +S_IXUSR = 0 + +S_IRWXG = 0 +S_IRGRP = 0 +S_IWGRP = 0 +S_IXGRP = 0 + +S_IRWXO = 0 +S_IROTH = 0 +S_IWOTH = 0 +S_IXOTH = 0 + +S_ENFMT = 0 +S_IREAD = 0 +S_IWRITE = 0 +S_IEXEC = 0 + +UF_NODUMP = 0 +UF_IMMUTABLE = 0 +UF_APPEND = 0 +UF_OPAQUE = 0 +UF_NOUNLINK = 0 +if sys.platform == 'darwin': + UF_COMPRESSED = 0 # OS X 10.6+ only + UF_HIDDEN = 0 # OX X 10.5+ only +SF_ARCHIVED = 0 +SF_IMMUTABLE = 0 +SF_APPEND = 0 +SF_NOUNLINK = 0 +SF_SNAPSHOT = 0 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/statistics.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/statistics.pyi new file mode 100644 index 0000000..d9116e5 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/statistics.pyi @@ -0,0 +1,24 @@ +# Stubs for statistics + +from decimal import Decimal +from fractions import Fraction +import sys +from typing import Iterable, Optional, TypeVar + +# Most functions in this module accept homogeneous collections of one of these types +_Number = TypeVar('_Number', float, Decimal, Fraction) + +class StatisticsError(ValueError): ... + +def mean(data: Iterable[_Number]) -> _Number: ... +if sys.version_info >= (3, 6): + def harmonic_mean(data: Iterable[_Number]) -> _Number: ... +def median(data: Iterable[_Number]) -> _Number: ... +def median_low(data: Iterable[_Number]) -> _Number: ... +def median_high(data: Iterable[_Number]) -> _Number: ... +def median_grouped(data: Iterable[_Number]) -> _Number: ... +def mode(data: Iterable[_Number]) -> _Number: ... +def pstdev(data: Iterable[_Number], mu: Optional[_Number] = ...) -> _Number: ... +def pvariance(data: Iterable[_Number], mu: Optional[_Number] = ...) -> _Number: ... +def stdev(data: Iterable[_Number], xbar: Optional[_Number] = ...) -> _Number: ... +def variance(data: Iterable[_Number], xbar: Optional[_Number] = ...) -> _Number: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/string.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/string.pyi new file mode 100644 index 0000000..92fc036 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/string.pyi @@ -0,0 +1,42 @@ +# Stubs for string + +# Based on http://docs.python.org/3.2/library/string.html + +from typing import Mapping, Sequence, Any, Optional, Union, List, Tuple, Iterable + +ascii_letters: str +ascii_lowercase: str +ascii_uppercase: str +digits: str +hexdigits: str +octdigits: str +punctuation: str +printable: str +whitespace: str + +def capwords(s: str, sep: str = ...) -> str: ... + +class Template: + template: str + + def __init__(self, template: str) -> None: ... + def substitute(self, mapping: Mapping[str, str] = ..., **kwds: str) -> str: ... + def safe_substitute(self, mapping: Mapping[str, str] = ..., + **kwds: str) -> str: ... + +# TODO(MichalPokorny): This is probably badly and/or loosely typed. +class Formatter: + def format(self, format_string: str, *args: Any, **kwargs: Any) -> str: ... + def vformat(self, format_string: str, args: Sequence[Any], + kwargs: Mapping[str, Any]) -> str: ... + def parse(self, format_string: str) -> Iterable[Tuple[str, Optional[str], Optional[str], Optional[str]]]: ... + def get_field(self, field_name: str, args: Sequence[Any], + kwargs: Mapping[str, Any]) -> Any: ... + def get_value(self, key: Union[int, str], args: Sequence[Any], + kwargs: Mapping[str, Any]) -> Any: + raise IndexError() + raise KeyError() + def check_unused_args(self, used_args: Sequence[Union[int, str]], args: Sequence[Any], + kwargs: Mapping[str, Any]) -> None: ... + def format_field(self, value: Any, format_spec: str) -> Any: ... + def convert_field(self, value: Any, conversion: str) -> Any: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/subprocess.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/subprocess.pyi new file mode 100644 index 0000000..b242449 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/subprocess.pyi @@ -0,0 +1,365 @@ +# Stubs for subprocess + +# Based on http://docs.python.org/3.6/library/subprocess.html +import sys +from typing import Sequence, Any, Mapping, Callable, Tuple, IO, Optional, Union, List, Type, Text +from types import TracebackType + +# We prefer to annotate inputs to methods (eg subprocess.check_call) with these +# union types. However, outputs (eg check_call return) and class attributes +# (eg TimeoutError.cmd) we prefer to annotate with Any, so the caller does not +# have to use an assertion to confirm which type. +# +# For example: +# +# try: +# x = subprocess.check_output(["ls", "-l"]) +# reveal_type(x) # Any, but morally is _TXT +# except TimeoutError as e: +# reveal_type(e.cmd) # Any, but morally is _CMD +_FILE = Union[None, int, IO[Any]] +_TXT = Union[bytes, Text] +if sys.version_info >= (3, 6): + from builtins import _PathLike + _PATH = Union[bytes, Text, _PathLike] +else: + _PATH = Union[bytes, Text] +# Python 3.6 does't support _CMD being a single PathLike. +# See: https://bugs.python.org/issue31961 +_CMD = Union[_TXT, Sequence[_PATH]] +_ENV = Union[Mapping[bytes, _TXT], Mapping[Text, _TXT]] + +if sys.version_info >= (3, 5): + class CompletedProcess: + # morally: _CMD + args: Any + returncode: int + # morally: Optional[_TXT] + stdout: Any + stderr: Any + def __init__(self, args: _CMD, + returncode: int, + stdout: Optional[_TXT] = ..., + stderr: Optional[_TXT] = ...) -> None: ... + def check_returncode(self) -> None: ... + + if sys.version_info >= (3, 7): + # Nearly the same args as for 3.6, except for capture_output and text + def run(args: _CMD, + bufsize: int = ..., + executable: _PATH = ..., + stdin: _FILE = ..., + stdout: _FILE = ..., + stderr: _FILE = ..., + preexec_fn: Callable[[], Any] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[_PATH] = ..., + env: Optional[_ENV] = ..., + universal_newlines: bool = ..., + startupinfo: Any = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + *, + capture_output: bool = ..., + check: bool = ..., + encoding: Optional[str] = ..., + errors: Optional[str] = ..., + input: Optional[_TXT] = ..., + text: Optional[bool] = ..., + timeout: Optional[float] = ...) -> CompletedProcess: ... + elif sys.version_info >= (3, 6): + # Nearly same args as Popen.__init__ except for timeout, input, and check + def run(args: _CMD, + bufsize: int = ..., + executable: _PATH = ..., + stdin: _FILE = ..., + stdout: _FILE = ..., + stderr: _FILE = ..., + preexec_fn: Callable[[], Any] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[_PATH] = ..., + env: Optional[_ENV] = ..., + universal_newlines: bool = ..., + startupinfo: Any = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + *, + check: bool = ..., + encoding: Optional[str] = ..., + errors: Optional[str] = ..., + input: Optional[_TXT] = ..., + timeout: Optional[float] = ...) -> CompletedProcess: ... + else: + # Nearly same args as Popen.__init__ except for timeout, input, and check + def run(args: _CMD, + timeout: Optional[float] = ..., + input: Optional[_TXT] = ..., + check: bool = ..., + bufsize: int = ..., + executable: _PATH = ..., + stdin: _FILE = ..., + stdout: _FILE = ..., + stderr: _FILE = ..., + preexec_fn: Callable[[], Any] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[_PATH] = ..., + env: Optional[_ENV] = ..., + universal_newlines: bool = ..., + startupinfo: Any = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ...) -> CompletedProcess: ... + +# Same args as Popen.__init__ +def call(args: _CMD, + bufsize: int = ..., + executable: _PATH = ..., + stdin: _FILE = ..., + stdout: _FILE = ..., + stderr: _FILE = ..., + preexec_fn: Callable[[], Any] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[_PATH] = ..., + env: Optional[_ENV] = ..., + universal_newlines: bool = ..., + startupinfo: Any = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + timeout: float = ...) -> int: ... + +# Same args as Popen.__init__ +def check_call(args: _CMD, + bufsize: int = ..., + executable: _PATH = ..., + stdin: _FILE = ..., + stdout: _FILE = ..., + stderr: _FILE = ..., + preexec_fn: Callable[[], Any] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[_PATH] = ..., + env: Optional[_ENV] = ..., + universal_newlines: bool = ..., + startupinfo: Any = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + timeout: float = ...) -> int: ... + +if sys.version_info >= (3, 7): + # 3.7 added text + def check_output(args: _CMD, + bufsize: int = ..., + executable: _PATH = ..., + stdin: _FILE = ..., + stderr: _FILE = ..., + preexec_fn: Callable[[], Any] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[_PATH] = ..., + env: Optional[_ENV] = ..., + universal_newlines: bool = ..., + startupinfo: Any = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + *, + timeout: float = ..., + input: _TXT = ..., + encoding: Optional[str] = ..., + errors: Optional[str] = ..., + text: Optional[bool] = ..., + ) -> Any: ... # morally: -> _TXT +elif sys.version_info >= (3, 6): + # 3.6 added encoding and errors + def check_output(args: _CMD, + bufsize: int = ..., + executable: _PATH = ..., + stdin: _FILE = ..., + stderr: _FILE = ..., + preexec_fn: Callable[[], Any] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[_PATH] = ..., + env: Optional[_ENV] = ..., + universal_newlines: bool = ..., + startupinfo: Any = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + *, + timeout: float = ..., + input: _TXT = ..., + encoding: Optional[str] = ..., + errors: Optional[str] = ..., + ) -> Any: ... # morally: -> _TXT +else: + def check_output(args: _CMD, + bufsize: int = ..., + executable: _PATH = ..., + stdin: _FILE = ..., + stderr: _FILE = ..., + preexec_fn: Callable[[], Any] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[_PATH] = ..., + env: Optional[_ENV] = ..., + universal_newlines: bool = ..., + startupinfo: Any = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + timeout: float = ..., + input: _TXT = ..., + ) -> Any: ... # morally: -> _TXT + + +PIPE: int +STDOUT: int +DEVNULL: int +class SubprocessError(Exception): ... +class TimeoutExpired(SubprocessError): + def __init__(self, cmd: _CMD, timeout: float, output: Optional[_TXT] = ..., stderr: Optional[_TXT] = ...) -> None: ... + # morally: _CMD + cmd: Any + timeout: float + # morally: Optional[_TXT] + output: Any + stdout: Any + stderr: Any + + +class CalledProcessError(Exception): + returncode = 0 + # morally: _CMD + cmd: Any + # morally: Optional[_TXT] + output: Any + + if sys.version_info >= (3, 5): + # morally: Optional[_TXT] + stdout: Any + stderr: Any + + def __init__(self, + returncode: int, + cmd: _CMD, + output: Optional[_TXT] = ..., + stderr: Optional[_TXT] = ...) -> None: ... + +class Popen: + args: _CMD + stdin: IO[Any] + stdout: IO[Any] + stderr: IO[Any] + pid = 0 + returncode = 0 + + if sys.version_info >= (3, 6): + def __init__(self, + args: _CMD, + bufsize: int = ..., + executable: Optional[_PATH] = ..., + stdin: Optional[_FILE] = ..., + stdout: Optional[_FILE] = ..., + stderr: Optional[_FILE] = ..., + preexec_fn: Optional[Callable[[], Any]] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[_PATH] = ..., + env: Optional[_ENV] = ..., + universal_newlines: bool = ..., + startupinfo: Optional[Any] = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + *, + encoding: Optional[str] = ..., + errors: Optional[str] = ...) -> None: ... + else: + def __init__(self, + args: _CMD, + bufsize: int = ..., + executable: Optional[_PATH] = ..., + stdin: Optional[_FILE] = ..., + stdout: Optional[_FILE] = ..., + stderr: Optional[_FILE] = ..., + preexec_fn: Optional[Callable[[], Any]] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[_PATH] = ..., + env: Optional[_ENV] = ..., + universal_newlines: bool = ..., + startupinfo: Optional[Any] = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ...) -> None: ... + + def poll(self) -> int: ... + def wait(self, timeout: Optional[float] = ...) -> int: ... + # Return str/bytes + def communicate(self, + input: Optional[_TXT] = ..., + timeout: Optional[float] = ..., + # morally: -> Tuple[Optional[_TXT], Optional[_TXT]] + ) -> Tuple[Any, Any]: ... + def send_signal(self, signal: int) -> None: ... + def terminate(self) -> None: ... + def kill(self) -> None: ... + def __enter__(self) -> Popen: ... + def __exit__(self, type: Optional[Type[BaseException]], value: Optional[BaseException], traceback: Optional[TracebackType]) -> bool: ... + +# The result really is always a str. +def getstatusoutput(cmd: _TXT) -> Tuple[int, str]: ... +def getoutput(cmd: _TXT) -> str: ... + +def list2cmdline(seq: Sequence[str]) -> str: ... # undocumented + +if sys.platform == 'win32': + class STARTUPINFO: + if sys.version_info >= (3, 7): + def __init__(self, *, dwFlags: int = ..., hStdInput: Optional[Any] = ..., hStdOutput: Optional[Any] = ..., hStdError: Optional[Any] = ..., wShowWindow: int = ..., lpAttributeList: Optional[Mapping[str, Any]] = ...) -> None: ... + dwFlags: int + hStdInput: Optional[Any] + hStdOutput: Optional[Any] + hStdError: Optional[Any] + wShowWindow: int + if sys.version_info >= (3, 7): + lpAttributeList: Mapping[str, Any] + + STD_INPUT_HANDLE: Any + STD_OUTPUT_HANDLE: Any + STD_ERROR_HANDLE: Any + SW_HIDE: int + STARTF_USESTDHANDLES: int + STARTF_USESHOWWINDOW: int + CREATE_NEW_CONSOLE: int + CREATE_NEW_PROCESS_GROUP: int + if sys.version_info >= (3, 7): + ABOVE_NORMAL_PRIORITY_CLASS: int + BELOW_NORMAL_PRIORITY_CLASS: int + HIGH_PRIORITY_CLASS: int + IDLE_PRIORITY_CLASS: int + NORMAL_PRIORITY_CLASS: int + REALTIME_PRIORITY_CLASS: int + CREATE_NO_WINDOW: int + DETACHED_PROCESS: int + CREATE_DEFAULT_ERROR_MODE: int + CREATE_BREAKAWAY_FROM_JOB: int diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/symbol.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/symbol.pyi new file mode 100644 index 0000000..0cf5f1c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/symbol.pyi @@ -0,0 +1,97 @@ +# Stubs for symbol (Python 3) + +import sys +from typing import Dict + +single_input: int +file_input: int +eval_input: int +decorator: int +decorators: int +decorated: int +if sys.version_info >= (3, 5): + async_funcdef: int +funcdef: int +parameters: int +typedargslist: int +tfpdef: int +varargslist: int +vfpdef: int +stmt: int +simple_stmt: int +small_stmt: int +expr_stmt: int +if sys.version_info >= (3, 6): + annassign: int +testlist_star_expr: int +augassign: int +del_stmt: int +pass_stmt: int +flow_stmt: int +break_stmt: int +continue_stmt: int +return_stmt: int +yield_stmt: int +raise_stmt: int +import_stmt: int +import_name: int +import_from: int +import_as_name: int +dotted_as_name: int +import_as_names: int +dotted_as_names: int +dotted_name: int +global_stmt: int +nonlocal_stmt: int +assert_stmt: int +compound_stmt: int +if sys.version_info >= (3, 5): + async_stmt: int +if_stmt: int +while_stmt: int +for_stmt: int +try_stmt: int +with_stmt: int +with_item: int +except_clause: int +suite: int +test: int +test_nocond: int +lambdef: int +lambdef_nocond: int +or_test: int +and_test: int +not_test: int +comparison: int +comp_op: int +star_expr: int +expr: int +xor_expr: int +and_expr: int +shift_expr: int +arith_expr: int +term: int +factor: int +power: int +if sys.version_info >= (3, 5): + atom_expr: int +atom: int +testlist_comp: int +trailer: int +subscriptlist: int +subscript: int +sliceop: int +exprlist: int +testlist: int +dictorsetmaker: int +classdef: int +arglist: int +argument: int +comp_iter: int +comp_for: int +comp_if: int +encoding_decl: int +yield_expr: int +yield_arg: int + +sym_name: Dict[int, str] diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/sys.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/sys.pyi new file mode 100644 index 0000000..3f856bb --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/sys.pyi @@ -0,0 +1,201 @@ +# Stubs for sys +# Ron Murawski + +# based on http://docs.python.org/3.2/library/sys.html + +from typing import ( + List, NoReturn, Sequence, Any, Dict, Tuple, TextIO, overload, Optional, + Union, TypeVar, Callable, Type +) +import sys +from types import FrameType, ModuleType, TracebackType + +from importlib.abc import MetaPathFinder + +_T = TypeVar('_T') + +# The following type alias are stub-only and do not exist during runtime +_ExcInfo = Tuple[Type[BaseException], BaseException, TracebackType] +_OptExcInfo = Tuple[Optional[Type[BaseException]], Optional[BaseException], Optional[TracebackType]] + +# ----- sys variables ----- +abiflags: str +argv: List[str] +base_exec_prefix: str +base_prefix: str +byteorder: str +builtin_module_names: Sequence[str] # actually a tuple of strings +copyright: str +# dllhandle = 0 # Windows only +dont_write_bytecode: bool +__displayhook__: Any # contains the original value of displayhook +__excepthook__: Any # contains the original value of excepthook +exec_prefix: str +executable: str +float_repr_style: str +hexversion: int +last_type: Optional[Type[BaseException]] +last_value: Optional[BaseException] +last_traceback: Optional[TracebackType] +maxsize: int +maxunicode: int +meta_path: List[MetaPathFinder] +modules: Dict[str, ModuleType] +path: List[str] +path_hooks: List[Any] # TODO precise type; function, path to finder +path_importer_cache: Dict[str, Any] # TODO precise type +platform: str +prefix: str +ps1: str +ps2: str +stdin: TextIO +stdout: TextIO +stderr: TextIO +__stdin__: TextIO +__stdout__: TextIO +__stderr__: TextIO +# deprecated and removed in Python 3.3: +subversion: Tuple[str, str, str] +tracebacklimit: int +version: str +api_version: int +warnoptions: Any +# Each entry is a tuple of the form (action, message, category, module, +# lineno) +# winver = '' # Windows only +_xoptions: Dict[Any, Any] + + +flags: _flags +class _flags: + debug: int + division_warning: int + inspect: int + interactive: int + optimize: int + dont_write_bytecode: int + no_user_site: int + no_site: int + ignore_environment: int + verbose: int + bytes_warning: int + quiet: int + hash_randomization: int + if sys.version_info >= (3, 7): + dev_mode: int + +float_info: _float_info +class _float_info: + epsilon: float # DBL_EPSILON + dig: int # DBL_DIG + mant_dig: int # DBL_MANT_DIG + max: float # DBL_MAX + max_exp: int # DBL_MAX_EXP + max_10_exp: int # DBL_MAX_10_EXP + min: float # DBL_MIN + min_exp: int # DBL_MIN_EXP + min_10_exp: int # DBL_MIN_10_EXP + radix: int # FLT_RADIX + rounds: int # FLT_ROUNDS + +hash_info: _hash_info +class _hash_info: + width: int + modulus: int + inf: int + nan: int + imag: int + +implementation: _implementation +class _implementation: + name: str + version: _version_info + hexversion: int + cache_tag: str + +int_info: _int_info +class _int_info: + bits_per_digit: int + sizeof_digit: int + +class _version_info(Tuple[int, int, int, str, int]): + major: int + minor: int + micro: int + releaselevel: str + serial: int +version_info: _version_info + +def call_tracing(fn: Callable[..., _T], args: Any) -> _T: ... +def _clear_type_cache() -> None: ... +def _current_frames() -> Dict[int, Any]: ... +def displayhook(value: Optional[int]) -> None: ... +def excepthook(type_: Type[BaseException], value: BaseException, + traceback: TracebackType) -> None: ... +def exc_info() -> _OptExcInfo: ... +# sys.exit() accepts an optional argument of anything printable +def exit(arg: object = ...) -> NoReturn: + raise SystemExit() +def getcheckinterval() -> int: ... # deprecated +def getdefaultencoding() -> str: ... +if sys.platform != 'win32': + # Unix only + def getdlopenflags() -> int: ... +def getfilesystemencoding() -> str: ... +def getrefcount(arg: Any) -> int: ... +def getrecursionlimit() -> int: ... + +@overload +def getsizeof(obj: object) -> int: ... +@overload +def getsizeof(obj: object, default: int) -> int: ... + +def getswitchinterval() -> float: ... + +@overload +def _getframe() -> FrameType: ... +@overload +def _getframe(depth: int) -> FrameType: ... + +_ProfileFunc = Callable[[FrameType, str, Any], Any] +def getprofile() -> Optional[_ProfileFunc]: ... +def setprofile(profilefunc: Optional[_ProfileFunc]) -> None: ... + +_TraceFunc = Callable[[FrameType, str, Any], Optional[Callable[[FrameType, str, Any], Any]]] +def gettrace() -> Optional[_TraceFunc]: ... +def settrace(tracefunc: Optional[_TraceFunc]) -> None: ... + + +class _WinVersion(Tuple[int, int, int, int, + str, int, int, int, int, + Tuple[int, int, int]]): + major: int + minor: int + build: int + platform: int + service_pack: str + service_pack_minor: int + service_pack_major: int + suite_mast: int + product_type: int + platform_version: Tuple[int, int, int] + + +def getwindowsversion() -> _WinVersion: ... # Windows only + +def intern(string: str) -> str: ... + +if sys.version_info >= (3, 5): + def is_finalizing() -> bool: ... + +if sys.version_info >= (3, 7): + __breakpointhook__: Any # contains the original value of breakpointhook + def breakpointhook(*args: Any, **kwargs: Any) -> Any: ... + +def setcheckinterval(interval: int) -> None: ... # deprecated +def setdlopenflags(n: int) -> None: ... # Linux only +def setrecursionlimit(limit: int) -> None: ... +def setswitchinterval(interval: float) -> None: ... +def settscdump(on_flag: bool) -> None: ... + +def gettotalrefcount() -> int: ... # Debug builds only diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/tempfile.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/tempfile.pyi new file mode 100644 index 0000000..e041b44 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/tempfile.pyi @@ -0,0 +1,123 @@ +# Stubs for tempfile +# Ron Murawski + +# based on http://docs.python.org/3.3/library/tempfile.html + +import sys +from types import TracebackType +from typing import Any, AnyStr, Generic, IO, Iterable, Iterator, List, Optional, overload, Tuple, Type + +# global variables +TMP_MAX: int +tempdir: Optional[str] +template: str + + +if sys.version_info >= (3, 5): + def TemporaryFile( + mode: str = ..., buffering: int = ..., encoding: Optional[str] = ..., + newline: Optional[str] = ..., suffix: Optional[AnyStr] = ..., prefix: Optional[AnyStr] = ..., + dir: Optional[AnyStr] = ... + ) -> IO[Any]: + ... + def NamedTemporaryFile( + mode: str = ..., buffering: int = ..., encoding: Optional[str] = ..., + newline: Optional[str] = ..., suffix: Optional[AnyStr] = ..., prefix: Optional[AnyStr] = ..., + dir: Optional[AnyStr] = ..., delete: bool = ... + ) -> IO[Any]: + ... + + # It does not actually derive from IO[AnyStr], but it does implement the + # protocol. + class SpooledTemporaryFile(IO[AnyStr]): + def __init__(self, max_size: int = ..., mode: str = ..., + buffering: int = ..., encoding: Optional[str] = ..., + newline: Optional[str] = ..., suffix: Optional[str] = ..., + prefix: Optional[str] = ..., dir: Optional[str] = ... + ) -> None: ... + def rollover(self) -> None: ... + def __enter__(self) -> SpooledTemporaryFile: ... + def __exit__(self, exc_type: Optional[Type[BaseException]], + exc_val: Optional[BaseException], + exc_tb: Optional[TracebackType]) -> bool: ... + + # These methods are copied from the abstract methods of IO, because + # SpooledTemporaryFile implements IO. + # See also https://github.com/python/typeshed/pull/2452#issuecomment-420657918. + def close(self) -> None: ... + def fileno(self) -> int: ... + def flush(self) -> None: ... + def isatty(self) -> bool: ... + def read(self, n: int = ...) -> AnyStr: ... + def readable(self) -> bool: ... + def readline(self, limit: int = ...) -> AnyStr: ... + def readlines(self, hint: int = ...) -> List[AnyStr]: ... + def seek(self, offset: int, whence: int = ...) -> int: ... + def seekable(self) -> bool: ... + def tell(self) -> int: ... + def truncate(self, size: Optional[int] = ...) -> int: ... + def writable(self) -> bool: ... + def write(self, s: AnyStr) -> int: ... + def writelines(self, lines: Iterable[AnyStr]) -> None: ... + def __next__(self) -> AnyStr: ... + def __iter__(self) -> Iterator[AnyStr]: ... + + class TemporaryDirectory(Generic[AnyStr]): + name: str + def __init__(self, suffix: Optional[AnyStr] = ..., prefix: Optional[AnyStr] = ..., + dir: Optional[AnyStr] = ...) -> None: ... + def cleanup(self) -> None: ... + def __enter__(self) -> AnyStr: ... + def __exit__(self, exc_type: Optional[Type[BaseException]], + exc_val: Optional[BaseException], + exc_tb: Optional[TracebackType]) -> bool: ... + + def mkstemp(suffix: Optional[AnyStr] = ..., prefix: Optional[AnyStr] = ..., dir: Optional[AnyStr] = ..., + text: bool = ...) -> Tuple[int, AnyStr]: ... + @overload + def mkdtemp() -> str: ... + @overload + def mkdtemp(suffix: Optional[AnyStr] = ..., prefix: Optional[AnyStr] = ..., + dir: Optional[AnyStr] = ...) -> AnyStr: ... + def mktemp(suffix: Optional[AnyStr] = ..., prefix: Optional[AnyStr] = ..., dir: Optional[AnyStr] = ...) -> AnyStr: ... + + def gettempdirb() -> bytes: ... + def gettempprefixb() -> bytes: ... +else: + def TemporaryFile( + mode: str = ..., buffering: int = ..., encoding: Optional[str] = ..., + newline: Optional[str] = ..., suffix: str = ..., prefix: str = ..., + dir: Optional[str] = ... + ) -> IO[Any]: + ... + def NamedTemporaryFile( + mode: str = ..., buffering: int = ..., encoding: Optional[str] = ..., + newline: Optional[str] = ..., suffix: str = ..., prefix: str = ..., + dir: Optional[str] = ..., delete: bool = ... + ) -> IO[Any]: + ... + def SpooledTemporaryFile( + max_size: int = ..., mode: str = ..., buffering: int = ..., + encoding: str = ..., newline: str = ..., suffix: str = ..., + prefix: str = ..., dir: Optional[str] = ... + ) -> IO[Any]: + ... + + class TemporaryDirectory: + name: str + def __init__(self, suffix: str = ..., prefix: str = ..., + dir: Optional[str] = ...) -> None: ... + def cleanup(self) -> None: ... + def __enter__(self) -> str: ... + def __exit__(self, exc_type: Optional[Type[BaseException]], + exc_val: Optional[BaseException], + exc_tb: Optional[TracebackType]) -> bool: ... + + def mkstemp(suffix: str = ..., prefix: str = ..., dir: Optional[str] = ..., + text: bool = ...) -> Tuple[int, str]: ... + def mkdtemp(suffix: str = ..., prefix: str = ..., + dir: Optional[str] = ...) -> str: ... + def mktemp(suffix: str = ..., prefix: str = ..., dir: Optional[str] = ...) -> str: ... + +def gettempdir() -> str: ... +def gettempprefix() -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/textwrap.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/textwrap.pyi new file mode 100644 index 0000000..f61f975 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/textwrap.pyi @@ -0,0 +1,113 @@ +from typing import Callable, List, Optional, Dict, Pattern + +class TextWrapper: + width: int = ... + initial_indent: str = ... + subsequent_indent: str = ... + expand_tabs: bool = ... + replace_whitespace: bool = ... + fix_sentence_endings: bool = ... + drop_whitespace: bool = ... + break_long_words: bool = ... + break_on_hyphens: bool = ... + tabsize: int = ... + max_lines: Optional[int] = ... + placeholder: str = ... + + # Attributes not present in documentation + sentence_end_re: Pattern[str] = ... + wordsep_re: Pattern[str] = ... + wordsep_simple_re: Pattern[str] = ... + whitespace_trans: str = ... + unicode_whitespace_trans: Dict[int, int] = ... + uspace: int = ... + x: int = ... + + def __init__( + self, + width: int = ..., + initial_indent: str = ..., + subsequent_indent: str = ..., + expand_tabs: bool = ..., + replace_whitespace: bool = ..., + fix_sentence_endings: bool = ..., + break_long_words: bool = ..., + drop_whitespace: bool = ..., + break_on_hyphens: bool = ..., + tabsize: int = ..., + *, + max_lines: Optional[int] = ..., + placeholder: str = ...) -> None: + ... + + # Private methods *are* part of the documented API for subclasses. + def _munge_whitespace(self, text: str) -> str: ... + def _split(self, text: str) -> List[str]: ... + def _fix_sentence_endings(self, chunks: List[str]) -> None: ... + def _handle_long_word(self, reversed_chunks: List[str], cur_line: List[str], cur_len: int, width: int) -> None: ... + def _wrap_chunks(self, chunks: List[str]) -> List[str]: ... + def _split_chunks(self, text: str) -> List[str]: ... + + def wrap(self, text: str) -> List[str]: ... + def fill(self, text: str) -> str: ... + + +def wrap( + text: str = ..., + width: int = ..., + *, + initial_indent: str = ..., + subsequent_indent: str = ..., + expand_tabs: bool = ..., + tabsize: int = ..., + replace_whitespace: bool = ..., + fix_sentence_endings: bool = ..., + break_long_words: bool = ..., + break_on_hyphens: bool = ..., + drop_whitespace: bool = ..., + max_lines: int = ..., + placeholder: str = ... +) -> List[str]: + ... + +def fill( + text: str, + width: int = ..., + *, + initial_indent: str = ..., + subsequent_indent: str = ..., + expand_tabs: bool = ..., + tabsize: int = ..., + replace_whitespace: bool = ..., + fix_sentence_endings: bool = ..., + break_long_words: bool = ..., + break_on_hyphens: bool = ..., + drop_whitespace: bool = ..., + max_lines: int = ..., + placeholder: str = ... +) -> str: + ... + +def shorten( + text: str, + width: int, + *, + initial_indent: str = ..., + subsequent_indent: str = ..., + expand_tabs: bool = ..., + tabsize: int = ..., + replace_whitespace: bool = ..., + fix_sentence_endings: bool = ..., + break_long_words: bool = ..., + break_on_hyphens: bool = ..., + drop_whitespace: bool = ..., + # Omit `max_lines: int = None`, it is forced to 1 here. + placeholder: str = ... +) -> str: + ... + +def dedent(text: str) -> str: + ... + +def indent(text: str, prefix: str, predicate: Callable[[str], bool] = ...) -> str: + ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/tkinter/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/tkinter/__init__.pyi new file mode 100644 index 0000000..c638394 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/tkinter/__init__.pyi @@ -0,0 +1,663 @@ +from types import TracebackType +from typing import Any, Optional, Dict, Callable, Type +from tkinter.constants import * # noqa: F403 + +TclError: Any +wantobjects: Any +TkVersion: Any +TclVersion: Any +READABLE: Any +WRITABLE: Any +EXCEPTION: Any + +class Event: ... + +def NoDefaultRoot(): ... + +class Variable: + def __init__(self, master: Optional[Any] = ..., value: Optional[Any] = ..., name: Optional[Any] = ...): ... + def __del__(self): ... + def set(self, value): ... + initialize: Any + def get(self): ... + def trace_variable(self, mode, callback): ... + trace: Any + def trace_vdelete(self, mode, cbname): ... + def trace_vinfo(self): ... + def __eq__(self, other): ... + +class StringVar(Variable): + def __init__(self, master: Optional[Any] = ..., value: Optional[Any] = ..., name: Optional[Any] = ...): ... + def get(self): ... + +class IntVar(Variable): + def __init__(self, master: Optional[Any] = ..., value: Optional[Any] = ..., name: Optional[Any] = ...): ... + def get(self): ... + +class DoubleVar(Variable): + def __init__(self, master: Optional[Any] = ..., value: Optional[Any] = ..., name: Optional[Any] = ...): ... + def get(self): ... + +class BooleanVar(Variable): + def __init__(self, master: Optional[Any] = ..., value: Optional[Any] = ..., name: Optional[Any] = ...): ... + def set(self, value): ... + initialize: Any + def get(self): ... + +def mainloop(n: int = ...): ... + +getint: Any +getdouble: Any + +def getboolean(s): ... + +class Misc: + def destroy(self): ... + def deletecommand(self, name): ... + def tk_strictMotif(self, boolean: Optional[Any] = ...): ... + def tk_bisque(self): ... + def tk_setPalette(self, *args, **kw): ... + def tk_menuBar(self, *args): ... + def wait_variable(self, name: str = ...): ... + waitvar: Any + def wait_window(self, window: Optional[Any] = ...): ... + def wait_visibility(self, window: Optional[Any] = ...): ... + def setvar(self, name: str = ..., value: str = ...): ... + def getvar(self, name: str = ...): ... + def getint(self, s): ... + def getdouble(self, s): ... + def getboolean(self, s): ... + def focus_set(self): ... + focus: Any + def focus_force(self): ... + def focus_get(self): ... + def focus_displayof(self): ... + def focus_lastfor(self): ... + def tk_focusFollowsMouse(self): ... + def tk_focusNext(self): ... + def tk_focusPrev(self): ... + def after(self, ms, func: Optional[Any] = ..., *args): ... + def after_idle(self, func, *args): ... + def after_cancel(self, id): ... + def bell(self, displayof: int = ...): ... + def clipboard_get(self, **kw): ... + def clipboard_clear(self, **kw): ... + def clipboard_append(self, string, **kw): ... + def grab_current(self): ... + def grab_release(self): ... + def grab_set(self): ... + def grab_set_global(self): ... + def grab_status(self): ... + def option_add(self, pattern, value, priority: Optional[Any] = ...): ... + def option_clear(self): ... + def option_get(self, name, className): ... + def option_readfile(self, fileName, priority: Optional[Any] = ...): ... + def selection_clear(self, **kw): ... + def selection_get(self, **kw): ... + def selection_handle(self, command, **kw): ... + def selection_own(self, **kw): ... + def selection_own_get(self, **kw): ... + def send(self, interp, cmd, *args): ... + def lower(self, belowThis: Optional[Any] = ...): ... + def tkraise(self, aboveThis: Optional[Any] = ...): ... + lift: Any + def winfo_atom(self, name, displayof: int = ...): ... + def winfo_atomname(self, id, displayof: int = ...): ... + def winfo_cells(self): ... + def winfo_children(self): ... + def winfo_class(self): ... + def winfo_colormapfull(self): ... + def winfo_containing(self, rootX, rootY, displayof: int = ...): ... + def winfo_depth(self): ... + def winfo_exists(self): ... + def winfo_fpixels(self, number): ... + def winfo_geometry(self): ... + def winfo_height(self): ... + def winfo_id(self): ... + def winfo_interps(self, displayof: int = ...): ... + def winfo_ismapped(self): ... + def winfo_manager(self): ... + def winfo_name(self): ... + def winfo_parent(self): ... + def winfo_pathname(self, id, displayof: int = ...): ... + def winfo_pixels(self, number): ... + def winfo_pointerx(self): ... + def winfo_pointerxy(self): ... + def winfo_pointery(self): ... + def winfo_reqheight(self): ... + def winfo_reqwidth(self): ... + def winfo_rgb(self, color): ... + def winfo_rootx(self): ... + def winfo_rooty(self): ... + def winfo_screen(self): ... + def winfo_screencells(self): ... + def winfo_screendepth(self): ... + def winfo_screenheight(self): ... + def winfo_screenmmheight(self): ... + def winfo_screenmmwidth(self): ... + def winfo_screenvisual(self): ... + def winfo_screenwidth(self): ... + def winfo_server(self): ... + def winfo_toplevel(self): ... + def winfo_viewable(self): ... + def winfo_visual(self): ... + def winfo_visualid(self): ... + def winfo_visualsavailable(self, includeids: int = ...): ... + def winfo_vrootheight(self): ... + def winfo_vrootwidth(self): ... + def winfo_vrootx(self): ... + def winfo_vrooty(self): ... + def winfo_width(self): ... + def winfo_x(self): ... + def winfo_y(self): ... + def update(self): ... + def update_idletasks(self): ... + def bindtags(self, tagList: Optional[Any] = ...): ... + def bind(self, sequence: Optional[Any] = ..., func: Optional[Any] = ..., add: Optional[Any] = ...): ... + def unbind(self, sequence, funcid: Optional[Any] = ...): ... + def bind_all(self, sequence: Optional[Any] = ..., func: Optional[Any] = ..., add: Optional[Any] = ...): ... + def unbind_all(self, sequence): ... + def bind_class(self, className, sequence: Optional[Any] = ..., func: Optional[Any] = ..., add: Optional[Any] = ...): ... + def unbind_class(self, className, sequence): ... + def mainloop(self, n: int = ...): ... + def quit(self): ... + def nametowidget(self, name): ... + register: Any + def configure(self, cnf: Optional[Any] = ..., **kw): ... + config: Any + def cget(self, key): ... + __getitem__: Any + def __setitem__(self, key, value): ... + def keys(self): ... + def pack_propagate(self, flag=...): ... + propagate: Any + def pack_slaves(self): ... + slaves: Any + def place_slaves(self): ... + def grid_anchor(self, anchor: Optional[Any] = ...): ... + anchor: Any + def grid_bbox(self, column: Optional[Any] = ..., row: Optional[Any] = ..., col2: Optional[Any] = ..., + row2: Optional[Any] = ...): ... + bbox: Any + def grid_columnconfigure(self, index, cnf=..., **kw): ... + columnconfigure: Any + def grid_location(self, x, y): ... + def grid_propagate(self, flag=...): ... + def grid_rowconfigure(self, index, cnf=..., **kw): ... + rowconfigure: Any + def grid_size(self): ... + size: Any + def grid_slaves(self, row: Optional[Any] = ..., column: Optional[Any] = ...): ... + def event_add(self, virtual, *sequences): ... + def event_delete(self, virtual, *sequences): ... + def event_generate(self, sequence, **kw): ... + def event_info(self, virtual: Optional[Any] = ...): ... + def image_names(self): ... + def image_types(self): ... + +class CallWrapper: + func: Any + subst: Any + widget: Any + def __init__(self, func, subst, widget): ... + def __call__(self, *args): ... + +class XView: + def xview(self, *args): ... + def xview_moveto(self, fraction): ... + def xview_scroll(self, number, what): ... + +class YView: + def yview(self, *args): ... + def yview_moveto(self, fraction): ... + def yview_scroll(self, number, what): ... + +class Wm: + def wm_aspect(self, minNumer: Optional[Any] = ..., minDenom: Optional[Any] = ..., maxNumer: Optional[Any] = ..., + maxDenom: Optional[Any] = ...): ... + aspect: Any + def wm_attributes(self, *args): ... + attributes: Any + def wm_client(self, name: Optional[Any] = ...): ... + client: Any + def wm_colormapwindows(self, *wlist): ... + colormapwindows: Any + def wm_command(self, value: Optional[Any] = ...): ... + command: Any + def wm_deiconify(self): ... + deiconify: Any + def wm_focusmodel(self, model: Optional[Any] = ...): ... + focusmodel: Any + def wm_forget(self, window): ... + forget: Any + def wm_frame(self): ... + frame: Any + def wm_geometry(self, newGeometry: Optional[Any] = ...): ... + geometry: Any + def wm_grid(self, baseWidth: Optional[Any] = ..., baseHeight: Optional[Any] = ..., widthInc: Optional[Any] = ..., + heightInc: Optional[Any] = ...): ... + grid: Any + def wm_group(self, pathName: Optional[Any] = ...): ... + group: Any + def wm_iconbitmap(self, bitmap: Optional[Any] = ..., default: Optional[Any] = ...): ... + iconbitmap: Any + def wm_iconify(self): ... + iconify: Any + def wm_iconmask(self, bitmap: Optional[Any] = ...): ... + iconmask: Any + def wm_iconname(self, newName: Optional[Any] = ...): ... + iconname: Any + def wm_iconphoto(self, default: bool = ..., *args): ... + iconphoto: Any + def wm_iconposition(self, x: Optional[Any] = ..., y: Optional[Any] = ...): ... + iconposition: Any + def wm_iconwindow(self, pathName: Optional[Any] = ...): ... + iconwindow: Any + def wm_manage(self, widget): ... + manage: Any + def wm_maxsize(self, width: Optional[Any] = ..., height: Optional[Any] = ...): ... + maxsize: Any + def wm_minsize(self, width: Optional[Any] = ..., height: Optional[Any] = ...): ... + minsize: Any + def wm_overrideredirect(self, boolean: Optional[Any] = ...): ... + overrideredirect: Any + def wm_positionfrom(self, who: Optional[Any] = ...): ... + positionfrom: Any + def wm_protocol(self, name: Optional[Any] = ..., func: Optional[Any] = ...): ... + protocol: Any + def wm_resizable(self, width: Optional[Any] = ..., height: Optional[Any] = ...): ... + resizable: Any + def wm_sizefrom(self, who: Optional[Any] = ...): ... + sizefrom: Any + def wm_state(self, newstate: Optional[Any] = ...): ... + state: Any + def wm_title(self, string: Optional[Any] = ...): ... + title: Any + def wm_transient(self, master: Optional[Any] = ...): ... + transient: Any + def wm_withdraw(self): ... + withdraw: Any + +class Tk(Misc, Wm): + master: Optional[Any] + children: Dict[str, Any] + tk: Any + def __init__(self, screenName: Optional[str] = ..., baseName: Optional[str] = ..., className: str = ..., useTk: bool = ..., + sync: bool = ..., use: Optional[str] = ...) -> None: ... + def loadtk(self) -> None: ... + def destroy(self) -> None: ... + def readprofile(self, baseName: str, className: str) -> None: ... + report_callback_exception: Callable[[Type[BaseException], BaseException, TracebackType], Any] + def __getattr__(self, attr: str) -> Any: ... + +def Tcl(screenName: Optional[Any] = ..., baseName: Optional[Any] = ..., className: str = ..., useTk: bool = ...): ... + +class Pack: + def pack_configure(self, cnf=..., **kw): ... + pack: Any + def pack_forget(self): ... + forget: Any + def pack_info(self): ... + info: Any + propagate: Any + slaves: Any + +class Place: + def place_configure(self, cnf=..., **kw): ... + place: Any + def place_forget(self): ... + forget: Any + def place_info(self): ... + info: Any + slaves: Any + +class Grid: + def grid_configure(self, cnf=..., **kw): ... + grid: Any + bbox: Any + columnconfigure: Any + def grid_forget(self): ... + forget: Any + def grid_remove(self): ... + def grid_info(self): ... + info: Any + location: Any + propagate: Any + rowconfigure: Any + size: Any + slaves: Any + +class BaseWidget(Misc): + widgetName: Any + def __init__(self, master, widgetName, cnf=..., kw=..., extra=...): ... + def destroy(self): ... + +class Widget(BaseWidget, Pack, Place, Grid): ... + +class Toplevel(BaseWidget, Wm): + def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... + +class Button(Widget): + def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... + def flash(self): ... + def invoke(self): ... + +class Canvas(Widget, XView, YView): + def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... + def addtag(self, *args): ... + def addtag_above(self, newtag, tagOrId): ... + def addtag_all(self, newtag): ... + def addtag_below(self, newtag, tagOrId): ... + def addtag_closest(self, newtag, x, y, halo: Optional[Any] = ..., start: Optional[Any] = ...): ... + def addtag_enclosed(self, newtag, x1, y1, x2, y2): ... + def addtag_overlapping(self, newtag, x1, y1, x2, y2): ... + def addtag_withtag(self, newtag, tagOrId): ... + def bbox(self, *args): ... + def tag_unbind(self, tagOrId, sequence, funcid: Optional[Any] = ...): ... + def tag_bind(self, tagOrId, sequence: Optional[Any] = ..., func: Optional[Any] = ..., add: Optional[Any] = ...): ... + def canvasx(self, screenx, gridspacing: Optional[Any] = ...): ... + def canvasy(self, screeny, gridspacing: Optional[Any] = ...): ... + def coords(self, *args): ... + def create_arc(self, *args, **kw): ... + def create_bitmap(self, *args, **kw): ... + def create_image(self, *args, **kw): ... + def create_line(self, *args, **kw): ... + def create_oval(self, *args, **kw): ... + def create_polygon(self, *args, **kw): ... + def create_rectangle(self, *args, **kw): ... + def create_text(self, *args, **kw): ... + def create_window(self, *args, **kw): ... + def dchars(self, *args): ... + def delete(self, *args): ... + def dtag(self, *args): ... + def find(self, *args): ... + def find_above(self, tagOrId): ... + def find_all(self): ... + def find_below(self, tagOrId): ... + def find_closest(self, x, y, halo: Optional[Any] = ..., start: Optional[Any] = ...): ... + def find_enclosed(self, x1, y1, x2, y2): ... + def find_overlapping(self, x1, y1, x2, y2): ... + def find_withtag(self, tagOrId): ... + def focus(self, *args): ... + def gettags(self, *args): ... + def icursor(self, *args): ... + def index(self, *args): ... + def insert(self, *args): ... + def itemcget(self, tagOrId, option): ... + def itemconfigure(self, tagOrId, cnf: Optional[Any] = ..., **kw): ... + itemconfig: Any + def tag_lower(self, *args): ... + lower: Any + def move(self, *args): ... + def postscript(self, cnf=..., **kw): ... + def tag_raise(self, *args): ... + lift: Any + def scale(self, *args): ... + def scan_mark(self, x, y): ... + def scan_dragto(self, x, y, gain: int = ...): ... + def select_adjust(self, tagOrId, index): ... + def select_clear(self): ... + def select_from(self, tagOrId, index): ... + def select_item(self): ... + def select_to(self, tagOrId, index): ... + def type(self, tagOrId): ... + +class Checkbutton(Widget): + def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... + def deselect(self): ... + def flash(self): ... + def invoke(self): ... + def select(self): ... + def toggle(self): ... + +class Entry(Widget, XView): + def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... + def delete(self, first, last: Optional[Any] = ...): ... + def get(self): ... + def icursor(self, index): ... + def index(self, index): ... + def insert(self, index, string): ... + def scan_mark(self, x): ... + def scan_dragto(self, x): ... + def selection_adjust(self, index): ... + select_adjust: Any + def selection_clear(self): ... + select_clear: Any + def selection_from(self, index): ... + select_from: Any + def selection_present(self): ... + select_present: Any + def selection_range(self, start, end): ... + select_range: Any + def selection_to(self, index): ... + select_to: Any + +class Frame(Widget): + def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... + +class Label(Widget): + def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... + +class Listbox(Widget, XView, YView): + def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... + def activate(self, index): ... + def bbox(self, index): ... + def curselection(self): ... + def delete(self, first, last: Optional[Any] = ...): ... + def get(self, first, last: Optional[Any] = ...): ... + def index(self, index): ... + def insert(self, index, *elements): ... + def nearest(self, y): ... + def scan_mark(self, x, y): ... + def scan_dragto(self, x, y): ... + def see(self, index): ... + def selection_anchor(self, index): ... + select_anchor: Any + def selection_clear(self, first, last: Optional[Any] = ...): ... # type: ignore + select_clear: Any + def selection_includes(self, index): ... + select_includes: Any + def selection_set(self, first, last: Optional[Any] = ...): ... + select_set: Any + def size(self): ... + def itemcget(self, index, option): ... + def itemconfigure(self, index, cnf: Optional[Any] = ..., **kw): ... + itemconfig: Any + +class Menu(Widget): + def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... + def tk_popup(self, x, y, entry: str = ...): ... + def tk_bindForTraversal(self): ... + def activate(self, index): ... + def add(self, itemType, cnf=..., **kw): ... + def add_cascade(self, cnf=..., **kw): ... + def add_checkbutton(self, cnf=..., **kw): ... + def add_command(self, cnf=..., **kw): ... + def add_radiobutton(self, cnf=..., **kw): ... + def add_separator(self, cnf=..., **kw): ... + def insert(self, index, itemType, cnf=..., **kw): ... + def insert_cascade(self, index, cnf=..., **kw): ... + def insert_checkbutton(self, index, cnf=..., **kw): ... + def insert_command(self, index, cnf=..., **kw): ... + def insert_radiobutton(self, index, cnf=..., **kw): ... + def insert_separator(self, index, cnf=..., **kw): ... + def delete(self, index1, index2: Optional[Any] = ...): ... + def entrycget(self, index, option): ... + def entryconfigure(self, index, cnf: Optional[Any] = ..., **kw): ... + entryconfig: Any + def index(self, index): ... + def invoke(self, index): ... + def post(self, x, y): ... + def type(self, index): ... + def unpost(self): ... + def xposition(self, index): ... + def yposition(self, index): ... + +class Menubutton(Widget): + def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... + +class Message(Widget): + def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... + +class Radiobutton(Widget): + def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... + def deselect(self): ... + def flash(self): ... + def invoke(self): ... + def select(self): ... + +class Scale(Widget): + def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... + def get(self): ... + def set(self, value): ... + def coords(self, value: Optional[Any] = ...): ... + def identify(self, x, y): ... + +class Scrollbar(Widget): + def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... + def activate(self, index: Optional[Any] = ...): ... + def delta(self, deltax, deltay): ... + def fraction(self, x, y): ... + def identify(self, x, y): ... + def get(self): ... + def set(self, first, last): ... + +class Text(Widget, XView, YView): + def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... + def bbox(self, index): ... + def compare(self, index1, op, index2): ... + def count(self, index1, index2, *args): ... + def debug(self, boolean: Optional[Any] = ...): ... + def delete(self, index1, index2: Optional[Any] = ...): ... + def dlineinfo(self, index): ... + def dump(self, index1, index2: Optional[Any] = ..., command: Optional[Any] = ..., **kw): ... + def edit(self, *args): ... + def edit_modified(self, arg: Optional[Any] = ...): ... + def edit_redo(self): ... + def edit_reset(self): ... + def edit_separator(self): ... + def edit_undo(self): ... + def get(self, index1, index2: Optional[Any] = ...): ... + def image_cget(self, index, option): ... + def image_configure(self, index, cnf: Optional[Any] = ..., **kw): ... + def image_create(self, index, cnf=..., **kw): ... + def image_names(self): ... + def index(self, index): ... + def insert(self, index, chars, *args): ... + def mark_gravity(self, markName, direction: Optional[Any] = ...): ... + def mark_names(self): ... + def mark_set(self, markName, index): ... + def mark_unset(self, *markNames): ... + def mark_next(self, index): ... + def mark_previous(self, index): ... + def peer_create(self, newPathName, cnf=..., **kw): ... + def peer_names(self): ... + def replace(self, index1, index2, chars, *args): ... + def scan_mark(self, x, y): ... + def scan_dragto(self, x, y): ... + def search(self, pattern, index, stopindex: Optional[Any] = ..., forwards: Optional[Any] = ..., + backwards: Optional[Any] = ..., exact: Optional[Any] = ..., regexp: Optional[Any] = ..., + nocase: Optional[Any] = ..., count: Optional[Any] = ..., elide: Optional[Any] = ...): ... + def see(self, index): ... + def tag_add(self, tagName, index1, *args): ... + def tag_unbind(self, tagName, sequence, funcid: Optional[Any] = ...): ... + def tag_bind(self, tagName, sequence, func, add: Optional[Any] = ...): ... + def tag_cget(self, tagName, option): ... + def tag_configure(self, tagName, cnf: Optional[Any] = ..., **kw): ... + tag_config: Any + def tag_delete(self, *tagNames): ... + def tag_lower(self, tagName, belowThis: Optional[Any] = ...): ... + def tag_names(self, index: Optional[Any] = ...): ... + def tag_nextrange(self, tagName, index1, index2: Optional[Any] = ...): ... + def tag_prevrange(self, tagName, index1, index2: Optional[Any] = ...): ... + def tag_raise(self, tagName, aboveThis: Optional[Any] = ...): ... + def tag_ranges(self, tagName): ... + def tag_remove(self, tagName, index1, index2: Optional[Any] = ...): ... + def window_cget(self, index, option): ... + def window_configure(self, index, cnf: Optional[Any] = ..., **kw): ... + window_config: Any + def window_create(self, index, cnf=..., **kw): ... + def window_names(self): ... + def yview_pickplace(self, *what): ... + +class _setit: + def __init__(self, var, value, callback: Optional[Any] = ...): ... + def __call__(self, *args): ... + +class OptionMenu(Menubutton): + widgetName: Any + menuname: Any + def __init__(self, master, variable, value, *values, **kwargs): ... + def __getitem__(self, name): ... + def destroy(self): ... + +class Image: + name: Any + tk: Any + def __init__(self, imgtype, name: Optional[Any] = ..., cnf=..., master: Optional[Any] = ..., **kw): ... + def __del__(self): ... + def __setitem__(self, key, value): ... + def __getitem__(self, key): ... + def configure(self, **kw): ... + config: Any + def height(self): ... + def type(self): ... + def width(self): ... + +class PhotoImage(Image): + def __init__(self, name: Optional[Any] = ..., cnf=..., master: Optional[Any] = ..., **kw): ... + def blank(self): ... + def cget(self, option): ... + def __getitem__(self, key): ... + def copy(self): ... + def zoom(self, x, y: str = ...): ... + def subsample(self, x, y: str = ...): ... + def get(self, x, y): ... + def put(self, data, to: Optional[Any] = ...): ... + def write(self, filename, format: Optional[Any] = ..., from_coords: Optional[Any] = ...): ... + +class BitmapImage(Image): + def __init__(self, name: Optional[Any] = ..., cnf=..., master: Optional[Any] = ..., **kw): ... + +def image_names(): ... +def image_types(): ... + +class Spinbox(Widget, XView): + def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... + def bbox(self, index): ... + def delete(self, first, last: Optional[Any] = ...): ... + def get(self): ... + def icursor(self, index): ... + def identify(self, x, y): ... + def index(self, index): ... + def insert(self, index, s): ... + def invoke(self, element): ... + def scan(self, *args): ... + def scan_mark(self, x): ... + def scan_dragto(self, x): ... + def selection(self, *args): ... + def selection_adjust(self, index): ... + def selection_clear(self): ... + def selection_element(self, element: Optional[Any] = ...): ... + +class LabelFrame(Widget): + def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... + +class PanedWindow(Widget): + def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... + def add(self, child, **kw): ... + def remove(self, child): ... + forget: Any + def identify(self, x, y): ... + def proxy(self, *args): ... + def proxy_coord(self): ... + def proxy_forget(self): ... + def proxy_place(self, x, y): ... + def sash(self, *args): ... + def sash_coord(self, index): ... + def sash_mark(self, index): ... + def sash_place(self, index, x, y): ... + def panecget(self, child, option): ... + def paneconfigure(self, tagOrId, cnf: Optional[Any] = ..., **kw): ... + paneconfig: Any + def panes(self): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/tkinter/commondialog.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/tkinter/commondialog.pyi new file mode 100644 index 0000000..d6a8a0d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/tkinter/commondialog.pyi @@ -0,0 +1,8 @@ +from typing import Any, Mapping, Optional + +class Dialog: + command: Optional[Any] = ... + master: Optional[Any] = ... + options: Mapping[str, Any] = ... + def __init__(self, master: Optional[Any] = ..., **options) -> None: ... + def show(self, **options) -> Any: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/tkinter/constants.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/tkinter/constants.pyi new file mode 100644 index 0000000..e21a93e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/tkinter/constants.pyi @@ -0,0 +1,79 @@ +from typing import Any + +NO: Any +YES: Any +TRUE: Any +FALSE: Any +ON: Any +OFF: Any +N: Any +S: Any +W: Any +E: Any +NW: Any +SW: Any +NE: Any +SE: Any +NS: Any +EW: Any +NSEW: Any +CENTER: Any +NONE: Any +X: Any +Y: Any +BOTH: Any +LEFT: Any +TOP: Any +RIGHT: Any +BOTTOM: Any +RAISED: Any +SUNKEN: Any +FLAT: Any +RIDGE: Any +GROOVE: Any +SOLID: Any +HORIZONTAL: Any +VERTICAL: Any +NUMERIC: Any +CHAR: Any +WORD: Any +BASELINE: Any +INSIDE: Any +OUTSIDE: Any +SEL: Any +SEL_FIRST: Any +SEL_LAST: Any +END: Any +INSERT: Any +CURRENT: Any +ANCHOR: Any +ALL: Any +NORMAL: Any +DISABLED: Any +ACTIVE: Any +HIDDEN: Any +CASCADE: Any +CHECKBUTTON: Any +COMMAND: Any +RADIOBUTTON: Any +SEPARATOR: Any +SINGLE: Any +BROWSE: Any +MULTIPLE: Any +EXTENDED: Any +DOTBOX: Any +UNDERLINE: Any +PIESLICE: Any +CHORD: Any +ARC: Any +FIRST: Any +LAST: Any +BUTT: Any +PROJECTING: Any +ROUND: Any +BEVEL: Any +MITER: Any +MOVETO: Any +SCROLL: Any +UNITS: Any +PAGES: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/tkinter/dialog.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/tkinter/dialog.pyi new file mode 100644 index 0000000..3136f21 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/tkinter/dialog.pyi @@ -0,0 +1,10 @@ +from typing import Any, Mapping, Optional +from tkinter import Widget + +DIALOG_ICON: str + +class Dialog(Widget): + widgetName: str = ... + num: int = ... + def __init__(self, master: Optional[Any] = ..., cnf: Mapping[str, Any] = ..., **kw) -> None: ... + def destroy(self) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/tkinter/filedialog.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/tkinter/filedialog.pyi new file mode 100644 index 0000000..6d5f165 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/tkinter/filedialog.pyi @@ -0,0 +1,65 @@ +from typing import Any, Dict, Optional, Tuple +from tkinter import Button, commondialog, Entry, Frame, Listbox, Scrollbar, Toplevel + +dialogstates: Dict[Any, Tuple[Any, Any]] + +class FileDialog: + title: str = ... + master: Any = ... + directory: Optional[Any] = ... + top: Toplevel = ... + botframe: Frame = ... + selection: Entry = ... + filter: Entry = ... + midframe: Entry = ... + filesbar: Scrollbar = ... + files: Listbox = ... + dirsbar: Scrollbar = ... + dirs: Listbox = ... + ok_button: Button = ... + filter_button: Button = ... + cancel_button: Button = ... + def __init__(self, master, title: Optional[Any] = ...) -> None: ... # title is usually a str or None, but e.g. int doesn't raise en exception either + how: Optional[Any] = ... + def go(self, dir_or_file: Any = ..., pattern: str = ..., default: str = ..., key: Optional[Any] = ...): ... + def quit(self, how: Optional[Any] = ...) -> None: ... + def dirs_double_event(self, event) -> None: ... + def dirs_select_event(self, event) -> None: ... + def files_double_event(self, event) -> None: ... + def files_select_event(self, event) -> None: ... + def ok_event(self, event) -> None: ... + def ok_command(self) -> None: ... + def filter_command(self, event: Optional[Any] = ...) -> None: ... + def get_filter(self): ... + def get_selection(self): ... + def cancel_command(self, event: Optional[Any] = ...) -> None: ... + def set_filter(self, dir, pat) -> None: ... + def set_selection(self, file) -> None: ... + +class LoadFileDialog(FileDialog): + title: str = ... + def ok_command(self) -> None: ... + +class SaveFileDialog(FileDialog): + title: str = ... + def ok_command(self): ... + +class _Dialog(commondialog.Dialog): ... + +class Open(_Dialog): + command: str = ... + +class SaveAs(_Dialog): + command: str = ... + +class Directory(commondialog.Dialog): + command: str = ... + +def askopenfilename(**options): ... +def asksaveasfilename(**options): ... +def askopenfilenames(**options): ... +def askopenfile(mode: str = ..., **options): ... +def askopenfiles(mode: str = ..., **options): ... +def asksaveasfile(mode: str = ..., **options): ... +def askdirectory(**options): ... +def test() -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/tkinter/messagebox.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/tkinter/messagebox.pyi new file mode 100644 index 0000000..b44e660 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/tkinter/messagebox.pyi @@ -0,0 +1,31 @@ +from tkinter.commondialog import Dialog +from typing import Any, Optional + +ERROR: str +INFO: str +QUESTION: str +WARNING: str +ABORTRETRYIGNORE: str +OK: str +OKCANCEL: str +RETRYCANCEL: str +YESNO: str +YESNOCANCEL: str +ABORT: str +RETRY: str +IGNORE: str +CANCEL: str +YES: str +NO: str + +class Message(Dialog): + command: str = ... + +def showinfo(title: Optional[str] = ..., message: Optional[str] = ..., **options: Any) -> str: ... +def showwarning(title: Optional[str] = ..., message: Optional[str] = ..., **options: Any) -> str: ... +def showerror(title: Optional[str] = ..., message: Optional[str] = ..., **options: Any) -> str: ... +def askquestion(title: Optional[str] = ..., message: Optional[str] = ..., **options: Any) -> str: ... +def askokcancel(title: Optional[str] = ..., message: Optional[str] = ..., **options: Any) -> bool: ... +def askyesno(title: Optional[str] = ..., message: Optional[str] = ..., **options: Any) -> bool: ... +def askyesnocancel(title: Optional[str] = ..., message: Optional[str] = ..., **options: Any) -> Optional[bool]: ... +def askretrycancel(title: Optional[str] = ..., message: Optional[str] = ..., **options: Any) -> bool: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/tkinter/ttk.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/tkinter/ttk.pyi new file mode 100644 index 0000000..0362f17 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/tkinter/ttk.pyi @@ -0,0 +1,160 @@ +import sys +from typing import Any, Optional +import tkinter + +def tclobjs_to_py(adict): ... +def setup_master(master: Optional[Any] = ...): ... + +class Style: + master: Any + tk: Any + def __init__(self, master: Optional[Any] = ...): ... + def configure(self, style, query_opt: Optional[Any] = ..., **kw): ... + def map(self, style, query_opt: Optional[Any] = ..., **kw): ... + def lookup(self, style, option, state: Optional[Any] = ..., default: Optional[Any] = ...): ... + def layout(self, style, layoutspec: Optional[Any] = ...): ... + def element_create(self, elementname, etype, *args, **kw): ... + def element_names(self): ... + def element_options(self, elementname): ... + def theme_create(self, themename, parent: Optional[Any] = ..., settings: Optional[Any] = ...): ... + def theme_settings(self, themename, settings): ... + def theme_names(self): ... + def theme_use(self, themename: Optional[Any] = ...): ... + +class Widget(tkinter.Widget): + def __init__(self, master, widgetname, kw: Optional[Any] = ...): ... + def identify(self, x, y): ... + def instate(self, statespec, callback: Optional[Any] = ..., *args, **kw): ... + def state(self, statespec: Optional[Any] = ...): ... + +class Button(Widget): + def __init__(self, master: Optional[Any] = ..., **kw): ... + def invoke(self): ... + +class Checkbutton(Widget): + def __init__(self, master: Optional[Any] = ..., **kw): ... + def invoke(self): ... + +class Entry(Widget, tkinter.Entry): + def __init__(self, master: Optional[Any] = ..., widget: Optional[Any] = ..., **kw): ... + def bbox(self, index): ... + def identify(self, x, y): ... + def validate(self): ... + +class Combobox(Entry): + def __init__(self, master: Optional[Any] = ..., **kw): ... + def current(self, newindex: Optional[Any] = ...): ... + def set(self, value): ... + +class Frame(Widget): + def __init__(self, master: Optional[Any] = ..., **kw): ... + +class Label(Widget): + def __init__(self, master: Optional[Any] = ..., **kw): ... + +class Labelframe(Widget): + def __init__(self, master: Optional[Any] = ..., **kw): ... + +LabelFrame: Any + +class Menubutton(Widget): + def __init__(self, master: Optional[Any] = ..., **kw): ... + +class Notebook(Widget): + def __init__(self, master: Optional[Any] = ..., **kw): ... + def add(self, child, **kw): ... + def forget(self, tab_id): ... + def hide(self, tab_id): ... + def identify(self, x, y): ... + def index(self, tab_id): ... + def insert(self, pos, child, **kw): ... + def select(self, tab_id: Optional[Any] = ...): ... + def tab(self, tab_id, option: Optional[Any] = ..., **kw): ... + def tabs(self): ... + def enable_traversal(self): ... + +class Panedwindow(Widget, tkinter.PanedWindow): + def __init__(self, master: Optional[Any] = ..., **kw): ... + forget: Any + def insert(self, pos, child, **kw): ... + def pane(self, pane, option: Optional[Any] = ..., **kw): ... + def sashpos(self, index, newpos: Optional[Any] = ...): ... + +PanedWindow: Any + +class Progressbar(Widget): + def __init__(self, master: Optional[Any] = ..., **kw): ... + def start(self, interval: Optional[Any] = ...): ... + def step(self, amount: Optional[Any] = ...): ... + def stop(self): ... + +class Radiobutton(Widget): + def __init__(self, master: Optional[Any] = ..., **kw): ... + def invoke(self): ... + +class Scale(Widget, tkinter.Scale): + def __init__(self, master: Optional[Any] = ..., **kw): ... + def configure(self, cnf: Optional[Any] = ..., **kw): ... + def get(self, x: Optional[Any] = ..., y: Optional[Any] = ...): ... + +class Scrollbar(Widget, tkinter.Scrollbar): + def __init__(self, master: Optional[Any] = ..., **kw): ... + +class Separator(Widget): + def __init__(self, master: Optional[Any] = ..., **kw): ... + +class Sizegrip(Widget): + def __init__(self, master: Optional[Any] = ..., **kw): ... + +if sys.version_info >= (3, 7): + class Spinbox(Entry): + def __init__(self, master: Any = ..., **kw: Any) -> None: ... + def set(self, value: Any) -> None: ... + +class Treeview(Widget, tkinter.XView, tkinter.YView): + def __init__(self, master: Optional[Any] = ..., **kw): ... + def bbox(self, item, column: Optional[Any] = ...): ... + def get_children(self, item: Optional[Any] = ...): ... + def set_children(self, item, *newchildren): ... + def column(self, column, option: Optional[Any] = ..., **kw): ... + def delete(self, *items): ... + def detach(self, *items): ... + def exists(self, item): ... + def focus(self, item: Optional[Any] = ...): ... + def heading(self, column, option: Optional[Any] = ..., **kw): ... + def identify(self, component, x, y): ... + def identify_row(self, y): ... + def identify_column(self, x): ... + def identify_region(self, x, y): ... + def identify_element(self, x, y): ... + def index(self, item): ... + def insert(self, parent, index, iid: Optional[Any] = ..., **kw): ... + def item(self, item, option: Optional[Any] = ..., **kw): ... + def move(self, item, parent, index): ... + reattach: Any + def next(self, item): ... + def parent(self, item): ... + def prev(self, item): ... + def see(self, item): ... + def selection(self, selop: Optional[Any] = ..., items: Optional[Any] = ...): ... + def selection_set(self, items): ... + def selection_add(self, items): ... + def selection_remove(self, items): ... + def selection_toggle(self, items): ... + def set(self, item, column: Optional[Any] = ..., value: Optional[Any] = ...): ... + def tag_bind(self, tagname, sequence: Optional[Any] = ..., callback: Optional[Any] = ...): ... + def tag_configure(self, tagname, option: Optional[Any] = ..., **kw): ... + def tag_has(self, tagname, item: Optional[Any] = ...): ... + +class LabeledScale(Frame): + label: Any + scale: Any + def __init__(self, master: Optional[Any] = ..., variable: Optional[Any] = ..., from_: int = ..., to: int = ..., **kw): ... + def destroy(self): ... + value: Any + +class OptionMenu(Menubutton): + def __init__(self, master, variable, default: Optional[Any] = ..., *values, **kwargs): ... + def __getitem__(self, item): ... + def set_menu(self, default: Optional[Any] = ..., *values): ... + def destroy(self): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/tokenize.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/tokenize.pyi new file mode 100644 index 0000000..33c8a2d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/tokenize.pyi @@ -0,0 +1,114 @@ +from typing import Any, Callable, Generator, Iterable, List, NamedTuple, Optional, Union, Sequence, TextIO, Tuple +from builtins import open as _builtin_open +import sys +from token import * # noqa: F403 + +COMMENT: int +NL: int +ENCODING: int + +_Position = Tuple[int, int] + +_TokenInfo = NamedTuple('TokenInfo', [ + ('type', int), + ('string', str), + ('start', _Position), + ('end', _Position), + ('line', str) +]) + +class TokenInfo(_TokenInfo): + @property + def exact_type(self) -> int: ... + +# Backwards compatible tokens can be sequences of a shorter length too +_Token = Union[TokenInfo, Sequence[Union[int, str, _Position]]] + +class TokenError(Exception): ... +class StopTokenizing(Exception): ... + +class Untokenizer: + tokens: List[str] + prev_row: int + prev_col: int + encoding: Optional[str] + def __init__(self) -> None: ... + def add_whitespace(self, start: _Position) -> None: ... + def untokenize(self, iterable: Iterable[_Token]) -> str: ... + def compat(self, token: Sequence[Union[int, str]], iterable: Iterable[_Token]) -> None: ... + +def untokenize(iterable: Iterable[_Token]) -> Any: ... +def detect_encoding(readline: Callable[[], bytes]) -> Tuple[str, Sequence[bytes]]: ... +def tokenize(readline: Callable[[], bytes]) -> Generator[TokenInfo, None, None]: ... +def generate_tokens(readline: Callable[[], str]) -> Generator[TokenInfo, None, None]: ... + +if sys.version_info >= (3, 6): + from os import PathLike + def open(filename: Union[str, bytes, int, PathLike]) -> TextIO: ... +else: + def open(filename: Union[str, bytes, int]) -> TextIO: ... + +# Names in __all__ with no definition: +# AMPER +# AMPEREQUAL +# ASYNC +# AT +# ATEQUAL +# AWAIT +# CIRCUMFLEX +# CIRCUMFLEXEQUAL +# COLON +# COMMA +# DEDENT +# DOT +# DOUBLESLASH +# DOUBLESLASHEQUAL +# DOUBLESTAR +# DOUBLESTAREQUAL +# ELLIPSIS +# ENDMARKER +# EQEQUAL +# EQUAL +# ERRORTOKEN +# GREATER +# GREATEREQUAL +# INDENT +# ISEOF +# ISNONTERMINAL +# ISTERMINAL +# LBRACE +# LEFTSHIFT +# LEFTSHIFTEQUAL +# LESS +# LESSEQUAL +# LPAR +# LSQB +# MINEQUAL +# MINUS +# NAME +# NEWLINE +# NOTEQUAL +# NT_OFFSET +# NUMBER +# N_TOKENS +# OP +# PERCENT +# PERCENTEQUAL +# PLUS +# PLUSEQUAL +# RARROW +# RBRACE +# RIGHTSHIFT +# RIGHTSHIFTEQUAL +# RPAR +# RSQB +# SEMI +# SLASH +# SLASHEQUAL +# STAR +# STAREQUAL +# STRING +# TILDE +# VBAR +# VBAREQUAL +# tok_name diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/tracemalloc.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/tracemalloc.pyi new file mode 100644 index 0000000..8758cc6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/tracemalloc.pyi @@ -0,0 +1,70 @@ +# Stubs for tracemalloc (Python 3.4+) + +import sys +from typing import List, Optional, Sequence, Tuple, Union, overload + +def clear_traces() -> None: ... +def get_object_traceback(obj: object) -> Optional[Traceback]: ... +def get_traceback_limit() -> int: ... +def get_traced_memory() -> Tuple[int, int]: ... +def get_tracemalloc_memory() -> int: ... +def is_tracing() -> bool: ... +def start(nframe: int = ...) -> None: ... +def stop() -> None: ... +def take_snapshot() -> Snapshot: ... + +if sys.version_info >= (3, 6): + class DomainFilter: + inclusive: bool + domain: int + def __init__(self, inclusive: bool, domain: int) -> None: ... + +class Filter: + if sys.version_info >= (3, 6): + domain: Optional[int] + inclusive: bool + lineno: Optional[int] + filename_pattern: str + all_frames: bool + def __init__(self, inclusive: bool, filename_pattern: str, lineno: Optional[int] = ..., all_frames: bool = ..., domain: Optional[int] = ...) -> None: ... + +class Frame: + filename: str + lineno: int + +class Snapshot: + def compare_to(self, old_snapshot: Snapshot, key_type: str, cumulative: bool = ...) -> List[StatisticDiff]: ... + def dump(self, filename: str) -> None: ... + if sys.version_info >= (3, 6): + def filter_traces(self, filters: Sequence[Union[DomainFilter, Filter]]) -> Snapshot: ... + else: + def filter_traces(self, filters: Sequence[Filter]) -> Snapshot: ... + @classmethod + def load(cls, filename: str) -> Snapshot: ... + def statistics(self, key_type: str, cumulative: bool = ...) -> List[Statistic]: ... + traceback_limit: int + traces: Sequence[Trace] + +class Statistic: + count: int + size: int + traceback: Traceback + +class StatisticDiff: + count: int + count_diff: int + size: int + size_diff: int + traceback: Traceback + +class Trace: + size: int + traceback: Traceback + +class Traceback(Sequence[Frame]): + def format(self, limit: Optional[int] = ...) -> List[str]: ... + @overload + def __getitem__(self, i: int) -> Frame: ... + @overload + def __getitem__(self, s: slice) -> Sequence[Frame]: ... + def __len__(self) -> int: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/types.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/types.pyi new file mode 100644 index 0000000..11ee600 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/types.pyi @@ -0,0 +1,208 @@ +# Stubs for types +# Note, all classes "defined" here require special handling. + +# TODO parts of this should be conditional on version + +import sys +from typing import ( + Any, Awaitable, Callable, Dict, Generic, Iterator, Mapping, Optional, Tuple, TypeVar, + Union, overload, Type +) + +# ModuleType is exported from this module, but for circular import +# reasons exists in its own stub file (with ModuleSpec and Loader). +from _importlib_modulespec import ModuleType as ModuleType # Exported + +_T = TypeVar('_T') +_T_co = TypeVar('_T_co', covariant=True) +_T_contra = TypeVar('_T_contra', contravariant=True) +_KT = TypeVar('_KT') +_VT = TypeVar('_VT') + +class _Cell: + cell_contents: Any + +class FunctionType: + __closure__: Optional[Tuple[_Cell, ...]] + __code__: CodeType + __defaults__: Optional[Tuple[Any, ...]] + __dict__: Dict[str, Any] + __globals__: Dict[str, Any] + __name__: str + __qualname__: str + __annotations__: Dict[str, Any] + __kwdefaults__: Dict[str, Any] + def __init__(self, code: CodeType, globals: Dict[str, Any], name: Optional[str] = ..., argdefs: Optional[Tuple[object, ...]] = ..., closure: Optional[Tuple[_Cell, ...]] = ...) -> None: ... + def __call__(self, *args: Any, **kwargs: Any) -> Any: ... + def __get__(self, obj: Optional[object], type: Optional[type]) -> MethodType: ... +LambdaType = FunctionType + +class CodeType: + """Create a code object. Not for the faint of heart.""" + co_argcount: int + co_kwonlyargcount: int + co_nlocals: int + co_stacksize: int + co_flags: int + co_code: bytes + co_consts: Tuple[Any, ...] + co_names: Tuple[str, ...] + co_varnames: Tuple[str, ...] + co_filename: str + co_name: str + co_firstlineno: int + co_lnotab: bytes + co_freevars: Tuple[str, ...] + co_cellvars: Tuple[str, ...] + def __init__( + self, + argcount: int, + kwonlyargcount: int, + nlocals: int, + stacksize: int, + flags: int, + codestring: bytes, + constants: Tuple[Any, ...], + names: Tuple[str, ...], + varnames: Tuple[str, ...], + filename: str, + name: str, + firstlineno: int, + lnotab: bytes, + freevars: Tuple[str, ...] = ..., + cellvars: Tuple[str, ...] = ..., + ) -> None: ... + +class MappingProxyType(Mapping[_KT, _VT], Generic[_KT, _VT]): + def __init__(self, mapping: Mapping[_KT, _VT]) -> None: ... + def __getitem__(self, k: _KT) -> _VT: ... + def __iter__(self) -> Iterator[_KT]: ... + def __len__(self) -> int: ... + def copy(self) -> Mapping[_KT, _VT]: ... + +class SimpleNamespace: + def __init__(self, **kwargs: Any) -> None: ... + def __getattribute__(self, name: str) -> Any: ... + def __setattr__(self, name: str, value: Any) -> None: ... + def __delattr__(self, name: str) -> None: ... + +class GeneratorType: + gi_code: CodeType + gi_frame: FrameType + gi_running: bool + gi_yieldfrom: Optional[GeneratorType] + def __iter__(self) -> GeneratorType: ... + def __next__(self) -> Any: ... + def close(self) -> None: ... + def send(self, arg: Any) -> Any: ... + @overload + def throw(self, val: BaseException) -> Any: ... + @overload + def throw(self, typ: type, val: BaseException = ..., tb: TracebackType = ...) -> Any: ... + +if sys.version_info >= (3, 6): + class AsyncGeneratorType(Generic[_T_co, _T_contra]): + ag_await: Optional[Awaitable[Any]] + ag_frame: FrameType + ag_running: bool + ag_code: CodeType + def __aiter__(self) -> Awaitable[AsyncGeneratorType[_T_co, _T_contra]]: ... + def __anext__(self) -> Awaitable[_T_co]: ... + def asend(self, val: _T_contra) -> Awaitable[_T_co]: ... + @overload + def athrow(self, val: BaseException) -> Awaitable[_T_co]: ... + @overload + def athrow(self, typ: Type[BaseException], val: BaseException, tb: TracebackType = ...) -> Awaitable[_T_co]: ... + def aclose(self) -> Awaitable[_T_co]: ... + +class CoroutineType: + cr_await: Optional[Any] + cr_code: CodeType + cr_frame: FrameType + cr_running: bool + def close(self) -> None: ... + def send(self, arg: Any) -> Any: ... + @overload + def throw(self, val: BaseException) -> Any: ... + @overload + def throw(self, typ: type, val: BaseException = ..., tb: TracebackType = ...) -> Any: ... + +class _StaticFunctionType: + """Fictional type to correct the type of MethodType.__func__. + + FunctionType is a descriptor, so mypy follows the descriptor protocol and + converts MethodType.__func__ back to MethodType (the return type of + FunctionType.__get__). But this is actually a special case; MethodType is + implemented in C and its attribute access doesn't go through + __getattribute__. + + By wrapping FunctionType in _StaticFunctionType, we get the right result; + similar to wrapping a function in staticmethod() at runtime to prevent it + being bound as a method. + """ + def __get__(self, obj: Optional[object], type: Optional[type]) -> FunctionType: ... + +class MethodType: + __func__: _StaticFunctionType + __self__: object + __name__: str + __qualname__: str + def __init__(self, func: Callable, obj: object) -> None: ... + def __call__(self, *args: Any, **kwargs: Any) -> Any: ... +class BuiltinFunctionType: + __self__: Union[object, ModuleType] + __name__: str + __qualname__: str + def __call__(self, *args: Any, **kwargs: Any) -> Any: ... +BuiltinMethodType = BuiltinFunctionType + +class TracebackType: + if sys.version_info >= (3, 7): + def __init__(self, tb_next: Optional[TracebackType], tb_frame: FrameType, tb_lasti: int, tb_lineno: int) -> None: ... + tb_next: Optional[TracebackType] + else: + @property + def tb_next(self) -> Optional[TracebackType]: ... + # the rest are read-only even in 3.7 + @property + def tb_frame(self) -> FrameType: ... + @property + def tb_lasti(self) -> int: ... + @property + def tb_lineno(self) -> int: ... + +class FrameType: + f_back: FrameType + f_builtins: Dict[str, Any] + f_code: CodeType + f_globals: Dict[str, Any] + f_lasti: int + f_lineno: int + f_locals: Dict[str, Any] + f_trace: Callable[[], None] + if sys.version_info >= (3, 7): + f_trace_lines: bool + f_trace_opcodes: bool + + def clear(self) -> None: ... + +class GetSetDescriptorType: + __name__: str + __objclass__: type + def __get__(self, obj: Any, type: type = ...) -> Any: ... + def __set__(self, obj: Any) -> None: ... + def __delete__(self, obj: Any) -> None: ... +class MemberDescriptorType: + __name__: str + __objclass__: type + def __get__(self, obj: Any, type: type = ...) -> Any: ... + def __set__(self, obj: Any) -> None: ... + def __delete__(self, obj: Any) -> None: ... + +def new_class(name: str, bases: Tuple[type, ...] = ..., kwds: Dict[str, Any] = ..., exec_body: Callable[[Dict[str, Any]], None] = ...) -> type: ... +def prepare_class(name: str, bases: Tuple[type, ...] = ..., kwds: Dict[str, Any] = ...) -> Tuple[type, Dict[str, Any], Dict[str, Any]]: ... + +# Actually a different type, but `property` is special and we want that too. +DynamicClassAttribute = property + +def coroutine(f: Callable[..., Any]) -> CoroutineType: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/typing.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/typing.pyi new file mode 100644 index 0000000..c99c1f9 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/typing.pyi @@ -0,0 +1,597 @@ +# Stubs for typing + +import sys +from abc import abstractmethod, ABCMeta +from types import CodeType, FrameType, TracebackType +import collections # Needed by aliases like DefaultDict, see mypy issue 2986 + +# Definitions of special type checking related constructs. Their definition +# are not used, so their value does not matter. + +overload = object() +Any = object() +TypeVar = object() +_promote = object() +no_type_check = object() + +class _SpecialForm: + def __getitem__(self, typeargs: Any) -> Any: ... + +Tuple: _SpecialForm = ... +Generic: _SpecialForm = ... +Protocol: _SpecialForm = ... +Callable: _SpecialForm = ... +Type: _SpecialForm = ... +ClassVar: _SpecialForm = ... + +class GenericMeta(type): ... + +# Return type that indicates a function does not return. +# This type is equivalent to the None type, but the no-op Union is necessary to +# distinguish the None type from the None value. +NoReturn = Union[None] + +# Type aliases and type constructors + +class TypeAlias: + # Class for defining generic aliases for library types. + def __init__(self, target_type: type) -> None: ... + def __getitem__(self, typeargs: Any) -> Any: ... + +Union = TypeAlias(object) +Optional = TypeAlias(object) +List = TypeAlias(object) +Dict = TypeAlias(object) +DefaultDict = TypeAlias(object) +Set = TypeAlias(object) +FrozenSet = TypeAlias(object) +Counter = TypeAlias(object) +Deque = TypeAlias(object) +ChainMap = TypeAlias(object) + +# Predefined type variables. +AnyStr = TypeVar('AnyStr', str, bytes) + +# Abstract base classes. + +# These type variables are used by the container types. +_T = TypeVar('_T') +_S = TypeVar('_S') +_KT = TypeVar('_KT') # Key type. +_VT = TypeVar('_VT') # Value type. +_T_co = TypeVar('_T_co', covariant=True) # Any type covariant containers. +_V_co = TypeVar('_V_co', covariant=True) # Any type covariant containers. +_KT_co = TypeVar('_KT_co', covariant=True) # Key type covariant containers. +_VT_co = TypeVar('_VT_co', covariant=True) # Value type covariant containers. +_T_contra = TypeVar('_T_contra', contravariant=True) # Ditto contravariant. +_TC = TypeVar('_TC', bound=Type[object]) +_C = TypeVar("_C", bound=Callable) + +def runtime(cls: _TC) -> _TC: ... + +@runtime +class SupportsInt(Protocol, metaclass=ABCMeta): + @abstractmethod + def __int__(self) -> int: ... + +@runtime +class SupportsFloat(Protocol, metaclass=ABCMeta): + @abstractmethod + def __float__(self) -> float: ... + +@runtime +class SupportsComplex(Protocol, metaclass=ABCMeta): + @abstractmethod + def __complex__(self) -> complex: ... + +@runtime +class SupportsBytes(Protocol, metaclass=ABCMeta): + @abstractmethod + def __bytes__(self) -> bytes: ... + +@runtime +class SupportsAbs(Protocol[_T_co]): + @abstractmethod + def __abs__(self) -> _T_co: ... + +@runtime +class SupportsRound(Protocol[_T_co]): + @overload + @abstractmethod + def __round__(self) -> int: ... + @overload + @abstractmethod + def __round__(self, ndigits: int) -> _T_co: ... + +@runtime +class Reversible(Protocol[_T_co]): + @abstractmethod + def __reversed__(self) -> Iterator[_T_co]: ... + +@runtime +class Sized(Protocol, metaclass=ABCMeta): + @abstractmethod + def __len__(self) -> int: ... + +@runtime +class Hashable(Protocol, metaclass=ABCMeta): + # TODO: This is special, in that a subclass of a hashable class may not be hashable + # (for example, list vs. object). It's not obvious how to represent this. This class + # is currently mostly useless for static checking. + @abstractmethod + def __hash__(self) -> int: ... + +@runtime +class Iterable(Protocol[_T_co]): + @abstractmethod + def __iter__(self) -> Iterator[_T_co]: ... + +@runtime +class Iterator(Iterable[_T_co], Protocol[_T_co]): + @abstractmethod + def __next__(self) -> _T_co: ... + def __iter__(self) -> Iterator[_T_co]: ... + +class Generator(Iterator[_T_co], Generic[_T_co, _T_contra, _V_co]): + @abstractmethod + def __next__(self) -> _T_co: ... + + @abstractmethod + def send(self, value: _T_contra) -> _T_co: ... + + @abstractmethod + def throw(self, typ: Type[BaseException], val: Optional[BaseException] = ..., + tb: Optional[TracebackType] = ...) -> _T_co: ... + + @abstractmethod + def close(self) -> None: ... + + @abstractmethod + def __iter__(self) -> Generator[_T_co, _T_contra, _V_co]: ... + + @property + def gi_code(self) -> CodeType: ... + @property + def gi_frame(self) -> FrameType: ... + @property + def gi_running(self) -> bool: ... + @property + def gi_yieldfrom(self) -> Optional[Generator]: ... + +# TODO: Several types should only be defined if sys.python_version >= (3, 5): +# Awaitable, AsyncIterator, AsyncIterable, Coroutine, Collection. +# See https: //github.com/python/typeshed/issues/655 for why this is not easy. + +@runtime +class Awaitable(Protocol[_T_co]): + @abstractmethod + def __await__(self) -> Generator[Any, None, _T_co]: ... + +class Coroutine(Awaitable[_V_co], Generic[_T_co, _T_contra, _V_co]): + @property + def cr_await(self) -> Optional[Any]: ... + @property + def cr_code(self) -> CodeType: ... + @property + def cr_frame(self) -> FrameType: ... + @property + def cr_running(self) -> bool: ... + + @abstractmethod + def send(self, value: _T_contra) -> _T_co: ... + + @abstractmethod + def throw(self, typ: Type[BaseException], val: Optional[BaseException] = ..., + tb: Optional[TracebackType] = ...) -> _T_co: ... + + @abstractmethod + def close(self) -> None: ... + + +# NOTE: This type does not exist in typing.py or PEP 484. +# The parameters correspond to Generator, but the 4th is the original type. +class AwaitableGenerator(Awaitable[_V_co], Generator[_T_co, _T_contra, _V_co], + Generic[_T_co, _T_contra, _V_co, _S], metaclass=ABCMeta): ... + +@runtime +class AsyncIterable(Protocol[_T_co]): + @abstractmethod + def __aiter__(self) -> AsyncIterator[_T_co]: ... + +@runtime +class AsyncIterator(AsyncIterable[_T_co], + Protocol[_T_co]): + @abstractmethod + def __anext__(self) -> Awaitable[_T_co]: ... + def __aiter__(self) -> AsyncIterator[_T_co]: ... + +if sys.version_info >= (3, 6): + class AsyncGenerator(AsyncIterator[_T_co], Generic[_T_co, _T_contra]): + @abstractmethod + def __anext__(self) -> Awaitable[_T_co]: ... + + @abstractmethod + def asend(self, value: _T_contra) -> Awaitable[_T_co]: ... + + @abstractmethod + def athrow(self, typ: Type[BaseException], val: Optional[BaseException] = ..., + tb: Any = ...) -> Awaitable[_T_co]: ... + + @abstractmethod + def aclose(self) -> Awaitable[None]: ... + + @abstractmethod + def __aiter__(self) -> AsyncGenerator[_T_co, _T_contra]: ... + + @property + def ag_await(self) -> Any: ... + @property + def ag_code(self) -> CodeType: ... + @property + def ag_frame(self) -> FrameType: ... + @property + def ag_running(self) -> bool: ... + +@runtime +class Container(Protocol[_T_co]): + @abstractmethod + def __contains__(self, __x: object) -> bool: ... + + +if sys.version_info >= (3, 6): + @runtime + class Collection(Iterable[_T_co], Container[_T_co], Protocol[_T_co]): + # Implement Sized (but don't have it as a base class). + @abstractmethod + def __len__(self) -> int: ... + + _Collection = Collection +else: + @runtime + class _Collection(Iterable[_T_co], Container[_T_co], Protocol[_T_co]): + # Implement Sized (but don't have it as a base class). + @abstractmethod + def __len__(self) -> int: ... + +class Sequence(_Collection[_T_co], Reversible[_T_co], Generic[_T_co]): + @overload + @abstractmethod + def __getitem__(self, i: int) -> _T_co: ... + @overload + @abstractmethod + def __getitem__(self, s: slice) -> Sequence[_T_co]: ... + # Mixin methods + if sys.version_info >= (3, 5): + def index(self, x: Any, start: int = ..., end: int = ...) -> int: ... + else: + def index(self, x: Any) -> int: ... + def count(self, x: Any) -> int: ... + def __contains__(self, x: object) -> bool: ... + def __iter__(self) -> Iterator[_T_co]: ... + def __reversed__(self) -> Iterator[_T_co]: ... + +class MutableSequence(Sequence[_T], Generic[_T]): + @abstractmethod + def insert(self, index: int, object: _T) -> None: ... + @overload + @abstractmethod + def __getitem__(self, i: int) -> _T: ... + @overload + @abstractmethod + def __getitem__(self, s: slice) -> MutableSequence[_T]: ... + @overload + @abstractmethod + def __setitem__(self, i: int, o: _T) -> None: ... + @overload + @abstractmethod + def __setitem__(self, s: slice, o: Iterable[_T]) -> None: ... + @overload + @abstractmethod + def __delitem__(self, i: int) -> None: ... + @overload + @abstractmethod + def __delitem__(self, i: slice) -> None: ... + # Mixin methods + def append(self, object: _T) -> None: ... + def clear(self) -> None: ... + def extend(self, iterable: Iterable[_T]) -> None: ... + def reverse(self) -> None: ... + def pop(self, index: int = ...) -> _T: ... + def remove(self, object: _T) -> None: ... + def __iadd__(self, x: Iterable[_T]) -> MutableSequence[_T]: ... + +class AbstractSet(_Collection[_T_co], Generic[_T_co]): + @abstractmethod + def __contains__(self, x: object) -> bool: ... + # Mixin methods + def __le__(self, s: AbstractSet[Any]) -> bool: ... + def __lt__(self, s: AbstractSet[Any]) -> bool: ... + def __gt__(self, s: AbstractSet[Any]) -> bool: ... + def __ge__(self, s: AbstractSet[Any]) -> bool: ... + def __and__(self, s: AbstractSet[Any]) -> AbstractSet[_T_co]: ... + def __or__(self, s: AbstractSet[_T]) -> AbstractSet[Union[_T_co, _T]]: ... + def __sub__(self, s: AbstractSet[Any]) -> AbstractSet[_T_co]: ... + def __xor__(self, s: AbstractSet[_T]) -> AbstractSet[Union[_T_co, _T]]: ... + # TODO: Argument can be a more general ABC? + def isdisjoint(self, s: AbstractSet[Any]) -> bool: ... + +class MutableSet(AbstractSet[_T], Generic[_T]): + @abstractmethod + def add(self, x: _T) -> None: ... + @abstractmethod + def discard(self, x: _T) -> None: ... + # Mixin methods + def clear(self) -> None: ... + def pop(self) -> _T: ... + def remove(self, element: _T) -> None: ... + def __ior__(self, s: AbstractSet[_S]) -> MutableSet[Union[_T, _S]]: ... + def __iand__(self, s: AbstractSet[Any]) -> MutableSet[_T]: ... + def __ixor__(self, s: AbstractSet[_S]) -> MutableSet[Union[_T, _S]]: ... + def __isub__(self, s: AbstractSet[Any]) -> MutableSet[_T]: ... + +class MappingView: + def __len__(self) -> int: ... + +class ItemsView(MappingView, AbstractSet[Tuple[_KT_co, _VT_co]], Generic[_KT_co, _VT_co]): + def __and__(self, o: Iterable[_T]) -> AbstractSet[Union[Tuple[_KT_co, _VT_co], _T]]: ... + def __contains__(self, o: object) -> bool: ... + def __iter__(self) -> Iterator[Tuple[_KT_co, _VT_co]]: ... + def __or__(self, o: Iterable[_T]) -> AbstractSet[Union[Tuple[_KT_co, _VT_co], _T]]: ... + def __xor__(self, o: Iterable[_T]) -> AbstractSet[Union[Tuple[_KT_co, _VT_co], _T]]: ... + +class KeysView(MappingView, AbstractSet[_KT_co], Generic[_KT_co]): + def __and__(self, o: Iterable[_T]) -> AbstractSet[Union[_KT_co, _T]]: ... + def __contains__(self, o: object) -> bool: ... + def __iter__(self) -> Iterator[_KT_co]: ... + def __or__(self, o: Iterable[_T]) -> AbstractSet[Union[_KT_co, _T]]: ... + def __xor__(self, o: Iterable[_T]) -> AbstractSet[Union[_KT_co, _T]]: ... + +class ValuesView(MappingView, Iterable[_VT_co], Generic[_VT_co]): + def __contains__(self, o: object) -> bool: ... + def __iter__(self) -> Iterator[_VT_co]: ... + +@runtime +class ContextManager(Protocol[_T_co]): + def __enter__(self) -> _T_co: ... + def __exit__(self, __exc_type: Optional[Type[BaseException]], + __exc_value: Optional[BaseException], + __traceback: Optional[TracebackType]) -> Optional[bool]: ... + +if sys.version_info >= (3, 5): + @runtime + class AsyncContextManager(Protocol[_T_co]): + def __aenter__(self) -> Awaitable[_T_co]: ... + def __aexit__(self, exc_type: Optional[Type[BaseException]], + exc_value: Optional[BaseException], + traceback: Optional[TracebackType]) -> Awaitable[Optional[bool]]: ... + +class Mapping(_Collection[_KT], Generic[_KT, _VT_co]): + # TODO: We wish the key type could also be covariant, but that doesn't work, + # see discussion in https: //github.com/python/typing/pull/273. + @abstractmethod + def __getitem__(self, k: _KT) -> _VT_co: + ... + # Mixin methods + @overload + def get(self, k: _KT) -> Optional[_VT_co]: ... + @overload + def get(self, k: _KT, default: Union[_VT_co, _T]) -> Union[_VT_co, _T]: ... + def items(self) -> AbstractSet[Tuple[_KT, _VT_co]]: ... + def keys(self) -> AbstractSet[_KT]: ... + def values(self) -> ValuesView[_VT_co]: ... + def __contains__(self, o: object) -> bool: ... + +class MutableMapping(Mapping[_KT, _VT], Generic[_KT, _VT]): + @abstractmethod + def __setitem__(self, k: _KT, v: _VT) -> None: ... + @abstractmethod + def __delitem__(self, v: _KT) -> None: ... + + def clear(self) -> None: ... + @overload + def pop(self, k: _KT) -> _VT: ... + @overload + def pop(self, k: _KT, default: Union[_VT, _T] = ...) -> Union[_VT, _T]: ... + def popitem(self) -> Tuple[_KT, _VT]: ... + def setdefault(self, k: _KT, default: _VT = ...) -> _VT: ... + # 'update' used to take a Union, but using overloading is better. + # The second overloaded type here is a bit too general, because + # Mapping[Tuple[_KT, _VT], W] is a subclass of Iterable[Tuple[_KT, _VT]], + # but will always have the behavior of the first overloaded type + # at runtime, leading to keys of a mix of types _KT and Tuple[_KT, _VT]. + # We don't currently have any way of forcing all Mappings to use + # the first overload, but by using overloading rather than a Union, + # mypy will commit to using the first overload when the argument is + # known to be a Mapping with unknown type parameters, which is closer + # to the behavior we want. See mypy issue #1430. + @overload + def update(self, __m: Mapping[_KT, _VT], **kwargs: _VT) -> None: ... + @overload + def update(self, __m: Iterable[Tuple[_KT, _VT]], **kwargs: _VT) -> None: ... + @overload + def update(self, **kwargs: _VT) -> None: ... + +Text = str + +TYPE_CHECKING = True + +class IO(Iterator[AnyStr], Generic[AnyStr]): + # TODO detach + # TODO use abstract properties + @property + def mode(self) -> str: ... + @property + def name(self) -> str: ... + @abstractmethod + def close(self) -> None: ... + @property + def closed(self) -> bool: ... + @abstractmethod + def fileno(self) -> int: ... + @abstractmethod + def flush(self) -> None: ... + @abstractmethod + def isatty(self) -> bool: ... + # TODO what if n is None? + @abstractmethod + def read(self, n: int = ...) -> AnyStr: ... + @abstractmethod + def readable(self) -> bool: ... + @abstractmethod + def readline(self, limit: int = ...) -> AnyStr: ... + @abstractmethod + def readlines(self, hint: int = ...) -> list[AnyStr]: ... + @abstractmethod + def seek(self, offset: int, whence: int = ...) -> int: ... + @abstractmethod + def seekable(self) -> bool: ... + @abstractmethod + def tell(self) -> int: ... + @abstractmethod + def truncate(self, size: Optional[int] = ...) -> int: ... + @abstractmethod + def writable(self) -> bool: ... + # TODO buffer objects + @abstractmethod + def write(self, s: AnyStr) -> int: ... + @abstractmethod + def writelines(self, lines: Iterable[AnyStr]) -> None: ... + + @abstractmethod + def __next__(self) -> AnyStr: ... + @abstractmethod + def __iter__(self) -> Iterator[AnyStr]: ... + @abstractmethod + def __enter__(self) -> IO[AnyStr]: ... + @abstractmethod + def __exit__(self, t: Optional[Type[BaseException]], value: Optional[BaseException], + traceback: Optional[TracebackType]) -> bool: ... + +class BinaryIO(IO[bytes]): + # TODO readinto + # TODO read1? + # TODO peek? + @overload + @abstractmethod + def write(self, s: bytearray) -> int: ... + @overload + @abstractmethod + def write(self, s: bytes) -> int: ... + + @abstractmethod + def __enter__(self) -> BinaryIO: ... + +class TextIO(IO[str]): + # TODO use abstractproperty + @property + def buffer(self) -> BinaryIO: ... + @property + def encoding(self) -> str: ... + @property + def errors(self) -> Optional[str]: ... + @property + def line_buffering(self) -> int: ... # int on PyPy, bool on CPython + @property + def newlines(self) -> Any: ... # None, str or tuple + @abstractmethod + def __enter__(self) -> TextIO: ... + +class ByteString(Sequence[int], metaclass=ABCMeta): ... + +class Match(Generic[AnyStr]): + pos = 0 + endpos = 0 + lastindex = 0 + lastgroup: AnyStr + string: AnyStr + + # The regular expression object whose match() or search() method produced + # this match instance. + re: Pattern[AnyStr] + + def expand(self, template: AnyStr) -> AnyStr: ... + + @overload + def group(self, group1: int = ...) -> AnyStr: ... + @overload + def group(self, group1: str) -> AnyStr: ... + @overload + def group(self, group1: int, group2: int, + *groups: int) -> Sequence[AnyStr]: ... + @overload + def group(self, group1: str, group2: str, + *groups: str) -> Sequence[AnyStr]: ... + + def groups(self, default: AnyStr = ...) -> Sequence[AnyStr]: ... + def groupdict(self, default: AnyStr = ...) -> dict[str, AnyStr]: ... + def start(self, group: Union[int, str] = ...) -> int: ... + def end(self, group: Union[int, str] = ...) -> int: ... + def span(self, group: Union[int, str] = ...) -> Tuple[int, int]: ... + if sys.version_info >= (3, 6): + def __getitem__(self, g: Union[int, str]) -> AnyStr: ... + +class Pattern(Generic[AnyStr]): + flags = 0 + groupindex: Mapping[str, int] + groups = 0 + pattern: AnyStr + + def search(self, string: AnyStr, pos: int = ..., + endpos: int = ...) -> Optional[Match[AnyStr]]: ... + def match(self, string: AnyStr, pos: int = ..., + endpos: int = ...) -> Optional[Match[AnyStr]]: ... + # New in Python 3.4 + def fullmatch(self, string: AnyStr, pos: int = ..., + endpos: int = ...) -> Optional[Match[AnyStr]]: ... + def split(self, string: AnyStr, maxsplit: int = ...) -> list[AnyStr]: ... + def findall(self, string: AnyStr, pos: int = ..., + endpos: int = ...) -> list[Any]: ... + def finditer(self, string: AnyStr, pos: int = ..., + endpos: int = ...) -> Iterator[Match[AnyStr]]: ... + + @overload + def sub(self, repl: AnyStr, string: AnyStr, + count: int = ...) -> AnyStr: ... + @overload + def sub(self, repl: Callable[[Match[AnyStr]], AnyStr], string: AnyStr, + count: int = ...) -> AnyStr: ... + + @overload + def subn(self, repl: AnyStr, string: AnyStr, + count: int = ...) -> Tuple[AnyStr, int]: ... + @overload + def subn(self, repl: Callable[[Match[AnyStr]], AnyStr], string: AnyStr, + count: int = ...) -> Tuple[AnyStr, int]: ... + +# Functions + +def get_type_hints(obj: Callable, globalns: Optional[dict[str, Any]] = ..., + localns: Optional[dict[str, Any]] = ...) -> dict[str, Any]: ... + +@overload +def cast(tp: Type[_T], obj: Any) -> _T: ... +@overload +def cast(tp: str, obj: Any) -> Any: ... + +# Type constructors + +# NamedTuple is special-cased in the type checker +class NamedTuple(tuple): + _field_types: collections.OrderedDict[str, Type[Any]] + _field_defaults: Dict[str, Any] = ... + _fields: Tuple[str, ...] + _source: str + + def __init__(self, typename: str, fields: Iterable[Tuple[str, Any]] = ..., *, + verbose: bool = ..., rename: bool = ..., **kwargs: Any) -> None: ... + + @classmethod + def _make(cls: Type[_T], iterable: Iterable[Any]) -> _T: ... + + def _asdict(self) -> collections.OrderedDict[str, Any]: ... + def _replace(self: _T, **kwargs: Any) -> _T: ... + +def NewType(name: str, tp: Type[_T]) -> Type[_T]: ... + +# This itself is only available during type checking +def type_check_only(func_or_cls: _C) -> _C: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/unittest/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/unittest/__init__.pyi new file mode 100644 index 0000000..3ed602c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/unittest/__init__.pyi @@ -0,0 +1,31 @@ +# Stubs for unittest + +from typing import Iterable, List, Optional, Type, Union +from types import ModuleType + +from unittest.case import * +from unittest.loader import * +from unittest.result import * +from unittest.runner import * +from unittest.signals import * +from unittest.suite import * + + +# not really documented +class TestProgram: + result: TestResult + def runTests(self) -> None: ... # undocumented + + +def main(module: Union[None, str, ModuleType] = ..., + defaultTest: Union[str, Iterable[str], None] = ..., + argv: Optional[List[str]] = ..., + testRunner: Union[Type[TestRunner], TestRunner, None] = ..., + testLoader: TestLoader = ..., exit: bool = ..., verbosity: int = ..., + failfast: Optional[bool] = ..., catchbreak: Optional[bool] = ..., + buffer: Optional[bool] = ..., + warnings: Optional[str] = ...) -> TestProgram: ... + + +def load_tests(loader: TestLoader, tests: TestSuite, + pattern: Optional[str]) -> TestSuite: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/unittest/case.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/unittest/case.pyi new file mode 100644 index 0000000..f71e5e4 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/unittest/case.pyi @@ -0,0 +1,224 @@ +from typing import ( + Any, AnyStr, Callable, Container, ContextManager, Dict, FrozenSet, Generic, + Iterable, List, NoReturn, Optional, overload, Pattern, Sequence, Set, + Tuple, Type, TypeVar, Union, +) +import logging +import unittest.result +from types import TracebackType + + +_E = TypeVar('_E', bound=BaseException) +_FT = TypeVar('_FT', bound=Callable[..., Any]) + + +def expectedFailure(func: _FT) -> _FT: ... +def skip(reason: str) -> Callable[[_FT], _FT]: ... +def skipIf(condition: object, reason: str) -> Callable[[_FT], _FT]: ... +def skipUnless(condition: object, reason: str) -> Callable[[_FT], _FT]: ... + + +class SkipTest(Exception): + def __init__(self, reason: str) -> None: ... + + +class TestCase: + failureException: Type[BaseException] + longMessage: bool + maxDiff: Optional[int] + # undocumented + _testMethodName: str + # undocumented + _testMethodDoc: str + def __init__(self, methodName: str = ...) -> None: ... + def setUp(self) -> None: ... + def tearDown(self) -> None: ... + @classmethod + def setUpClass(cls) -> None: ... + @classmethod + def tearDownClass(cls) -> None: ... + def run(self, result: Optional[unittest.result.TestResult] = ...) -> Optional[unittest.result.TestResult]: ... + def __call__(self, result: Optional[unittest.result.TestResult] = ...) -> Optional[unittest.result.TestResult]: ... + def skipTest(self, reason: Any) -> None: ... + def subTest(self, msg: Any = ..., **params: Any) -> ContextManager[None]: ... + def debug(self) -> None: ... + def _addSkip( + self, result: unittest.result.TestResult, test_case: unittest.case.TestCase, reason: str + ) -> None: ... + def assertEqual(self, first: Any, second: Any, msg: Any = ...) -> None: ... + def assertNotEqual(self, first: Any, second: Any, + msg: Any = ...) -> None: ... + def assertTrue(self, expr: Any, msg: Any = ...) -> None: ... + def assertFalse(self, expr: Any, msg: Any = ...) -> None: ... + def assertIs(self, expr1: Any, expr2: Any, msg: Any = ...) -> None: ... + def assertIsNot(self, expr1: Any, expr2: Any, msg: Any = ...) -> None: ... + def assertIsNone(self, obj: Any, msg: Any = ...) -> None: ... + def assertIsNotNone(self, obj: Any, msg: Any = ...) -> None: ... + def assertIn(self, member: Any, + container: Union[Iterable[Any], Container[Any]], + msg: Any = ...) -> None: ... + def assertNotIn(self, member: Any, + container: Union[Iterable[Any], Container[Any]], + msg: Any = ...) -> None: ... + def assertIsInstance(self, obj: Any, + cls: Union[type, Tuple[type, ...]], + msg: Any = ...) -> None: ... + def assertNotIsInstance(self, obj: Any, + cls: Union[type, Tuple[type, ...]], + msg: Any = ...) -> None: ... + def assertGreater(self, a: Any, b: Any, msg: Any = ...) -> None: ... + def assertGreaterEqual(self, a: Any, b: Any, msg: Any = ...) -> None: ... + def assertLess(self, a: Any, b: Any, msg: Any = ...) -> None: ... + def assertLessEqual(self, a: Any, b: Any, msg: Any = ...) -> None: ... + @overload + def assertRaises(self, # type: ignore + expected_exception: Union[Type[BaseException], Tuple[Type[BaseException], ...]], + callable: Callable[..., Any], + *args: Any, **kwargs: Any) -> None: ... + @overload + def assertRaises(self, + expected_exception: Union[Type[_E], Tuple[Type[_E], ...]], + msg: Any = ...) -> _AssertRaisesContext[_E]: ... + @overload + def assertRaisesRegex(self, # type: ignore + expected_exception: Union[Type[BaseException], Tuple[Type[BaseException], ...]], + expected_regex: Union[str, bytes, Pattern[str], Pattern[bytes]], + callable: Callable[..., Any], + *args: Any, **kwargs: Any) -> None: ... + @overload + def assertRaisesRegex(self, + expected_exception: Union[Type[_E], Tuple[Type[_E], ...]], + expected_regex: Union[str, bytes, Pattern[str], Pattern[bytes]], + msg: Any = ...) -> _AssertRaisesContext[_E]: ... + @overload + def assertWarns(self, # type: ignore + expected_warning: Union[Type[Warning], Tuple[Type[Warning], ...]], + callable: Callable[..., Any], + *args: Any, **kwargs: Any) -> None: ... + @overload + def assertWarns(self, + expected_warning: Union[Type[Warning], Tuple[Type[Warning], ...]], + msg: Any = ...) -> _AssertWarnsContext: ... + @overload + def assertWarnsRegex(self, # type: ignore + expected_warning: Union[Type[Warning], Tuple[Type[Warning], ...]], + expected_regex: Union[str, bytes, Pattern[str], Pattern[bytes]], + callable: Callable[..., Any], + *args: Any, **kwargs: Any) -> None: ... + @overload + def assertWarnsRegex(self, + expected_warning: Union[Type[Warning], Tuple[Type[Warning], ...]], + expected_regex: Union[str, bytes, Pattern[str], Pattern[bytes]], + msg: Any = ...) -> _AssertWarnsContext: ... + def assertLogs( + self, logger: Optional[logging.Logger] = ..., + level: Union[int, str, None] = ... + ) -> _AssertLogsContext: ... + def assertAlmostEqual(self, first: float, second: float, places: int = ..., + msg: Any = ..., delta: float = ...) -> None: ... + @overload + def assertNotAlmostEqual(self, first: float, second: float, *, + msg: Any = ...) -> None: ... + @overload + def assertNotAlmostEqual(self, first: float, second: float, + places: int = ..., msg: Any = ...) -> None: ... + @overload + def assertNotAlmostEqual(self, first: float, second: float, *, + msg: Any = ..., delta: float = ...) -> None: ... + def assertRegex(self, text: AnyStr, expected_regex: Union[AnyStr, Pattern[AnyStr]], + msg: Any = ...) -> None: ... + def assertNotRegex(self, text: AnyStr, unexpected_regex: Union[AnyStr, Pattern[AnyStr]], + msg: Any = ...) -> None: ... + def assertCountEqual(self, first: Iterable[Any], second: Iterable[Any], + msg: Any = ...) -> None: ... + def addTypeEqualityFunc(self, typeobj: Type[Any], + function: Callable[..., None]) -> None: ... + def assertMultiLineEqual(self, first: str, second: str, + msg: Any = ...) -> None: ... + def assertSequenceEqual(self, seq1: Sequence[Any], seq2: Sequence[Any], + msg: Any = ..., + seq_type: Type[Sequence[Any]] = ...) -> None: ... + def assertListEqual(self, list1: List[Any], list2: List[Any], + msg: Any = ...) -> None: ... + def assertTupleEqual(self, tuple1: Tuple[Any, ...], tuple2: Tuple[Any, ...], + msg: Any = ...) -> None: ... + def assertSetEqual(self, set1: Union[Set[Any], FrozenSet[Any]], + set2: Union[Set[Any], FrozenSet[Any]], msg: Any = ...) -> None: ... + def assertDictEqual(self, d1: Dict[Any, Any], d2: Dict[Any, Any], + msg: Any = ...) -> None: ... + def fail(self, msg: Any = ...) -> NoReturn: ... + def countTestCases(self) -> int: ... + def defaultTestResult(self) -> unittest.result.TestResult: ... + def id(self) -> str: ... + def shortDescription(self) -> Optional[str]: ... + def addCleanup(self, function: Callable[..., Any], *args: Any, + **kwargs: Any) -> None: ... + def doCleanups(self) -> None: ... + def _formatMessage(self, msg: Optional[str], standardMsg: str) -> str: ... # undocumented + def _getAssertEqualityFunc(self, first: Any, second: Any) -> Callable[..., None]: ... # undocumented + # below is deprecated + def failUnlessEqual(self, first: Any, second: Any, + msg: Any = ...) -> None: ... + def assertEquals(self, first: Any, second: Any, msg: Any = ...) -> None: ... + def failIfEqual(self, first: Any, second: Any, msg: Any = ...) -> None: ... + def assertNotEquals(self, first: Any, second: Any, + msg: Any = ...) -> None: ... + def failUnless(self, expr: bool, msg: Any = ...) -> None: ... + def assert_(self, expr: bool, msg: Any = ...) -> None: ... + def failIf(self, expr: bool, msg: Any = ...) -> None: ... + @overload + def failUnlessRaises(self, # type: ignore + exception: Union[Type[BaseException], Tuple[Type[BaseException], ...]], + callable: Callable[..., Any] = ..., + *args: Any, **kwargs: Any) -> None: ... + @overload + def failUnlessRaises(self, + exception: Union[Type[_E], Tuple[Type[_E], ...]], + msg: Any = ...) -> _AssertRaisesContext[_E]: ... + def failUnlessAlmostEqual(self, first: float, second: float, + places: int = ..., msg: Any = ...) -> None: ... + def assertAlmostEquals(self, first: float, second: float, places: int = ..., + msg: Any = ..., delta: float = ...) -> None: ... + def failIfAlmostEqual(self, first: float, second: float, places: int = ..., + msg: Any = ...) -> None: ... + def assertNotAlmostEquals(self, first: float, second: float, + places: int = ..., msg: Any = ..., + delta: float = ...) -> None: ... + def assertRegexpMatches(self, text: AnyStr, regex: Union[AnyStr, Pattern[AnyStr]], + msg: Any = ...) -> None: ... + @overload + def assertRaisesRegexp(self, # type: ignore + exception: Union[Type[BaseException], Tuple[Type[BaseException], ...]], + callable: Callable[..., Any] = ..., + *args: Any, **kwargs: Any) -> None: ... + @overload + def assertRaisesRegexp(self, + exception: Union[Type[_E], Tuple[Type[_E], ...]], + msg: Any = ...) -> _AssertRaisesContext[_E]: ... + +class FunctionTestCase(TestCase): + def __init__(self, testFunc: Callable[[], None], + setUp: Optional[Callable[[], None]] = ..., + tearDown: Optional[Callable[[], None]] = ..., + description: Optional[str] = ...) -> None: ... + +class _AssertRaisesContext(Generic[_E]): + exception: _E + def __enter__(self) -> _AssertRaisesContext[_E]: ... + def __exit__(self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], + exc_tb: Optional[TracebackType]) -> bool: ... + +class _AssertWarnsContext: + warning: Warning + filename: str + lineno: int + def __enter__(self) -> _AssertWarnsContext: ... + def __exit__(self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], + exc_tb: Optional[TracebackType]) -> bool: ... + +class _AssertLogsContext: + records: List[logging.LogRecord] + output: List[str] + def __enter__(self) -> _AssertLogsContext: ... + def __exit__(self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], + exc_tb: Optional[TracebackType]) -> bool: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/unittest/loader.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/unittest/loader.pyi new file mode 100644 index 0000000..53b81ad --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/unittest/loader.pyi @@ -0,0 +1,32 @@ +import sys +import unittest.case +import unittest.suite +import unittest.result +from types import ModuleType +from typing import Any, Callable, List, Optional, Sequence, Type + + +class TestLoader: + if sys.version_info >= (3, 5): + errors: List[Type[BaseException]] + testMethodPrefix: str + sortTestMethodsUsing: Callable[[str, str], bool] + suiteClass: Callable[[List[unittest.case.TestCase]], unittest.suite.TestSuite] + def loadTestsFromTestCase(self, + testCaseClass: Type[unittest.case.TestCase]) -> unittest.suite.TestSuite: ... + if sys.version_info >= (3, 5): + def loadTestsFromModule(self, module: ModuleType, + *, pattern: Any = ...) -> unittest.suite.TestSuite: ... + else: + def loadTestsFromModule(self, + module: ModuleType) -> unittest.suite.TestSuite: ... + def loadTestsFromName(self, name: str, + module: Optional[ModuleType] = ...) -> unittest.suite.TestSuite: ... + def loadTestsFromNames(self, names: Sequence[str], + module: Optional[ModuleType] = ...) -> unittest.suite.TestSuite: ... + def getTestCaseNames(self, + testCaseClass: Type[unittest.case.TestCase]) -> Sequence[str]: ... + def discover(self, start_dir: str, pattern: str = ..., + top_level_dir: Optional[str] = ...) -> unittest.suite.TestSuite: ... + +defaultTestLoader: TestLoader diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/unittest/mock.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/unittest/mock.pyi new file mode 100644 index 0000000..cb3db61 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/unittest/mock.pyi @@ -0,0 +1,146 @@ +# Stubs for mock + +import sys +from typing import Any, Optional, Text, Type + +FILTER_DIR: Any + +class _slotted: ... + +class _SentinelObject: + name: Any + def __init__(self, name: Any) -> None: ... + +class _Sentinel: + def __init__(self) -> None: ... + def __getattr__(self, name: str) -> Any: ... + +sentinel: Any +DEFAULT: Any + +class _CallList(list): + def __contains__(self, value: Any) -> bool: ... + +class _MockIter: + obj: Any + def __init__(self, obj: Any) -> None: ... + def __iter__(self) -> Any: ... + def __next__(self) -> Any: ... + +class Base: + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + +# TODO: Defining this and other mock classes as classes in this stub causes +# many false positives with mypy and production code. See if we can +# improve mypy somehow and use a class with an "Any" base class. +NonCallableMock: Any + +class CallableMixin(Base): + side_effect: Any + def __init__(self, spec: Optional[Any] = ..., side_effect: Optional[Any] = ..., return_value: Any = ..., wraps: Optional[Any] = ..., name: Optional[Any] = ..., spec_set: Optional[Any] = ..., parent: Optional[Any] = ..., _spec_state: Optional[Any] = ..., _new_name: Any = ..., _new_parent: Optional[Any] = ..., **kwargs: Any) -> None: ... + def __call__(_mock_self, *args: Any, **kwargs: Any) -> Any: ... + +Mock: Any + +class _patch: + attribute_name: Any + getter: Any + attribute: Any + new: Any + new_callable: Any + spec: Any + create: bool + has_local: Any + spec_set: Any + autospec: Any + kwargs: Any + additional_patchers: Any + def __init__(self, getter: Any, attribute: Any, new: Any, spec: Any, create: Any, spec_set: Any, autospec: Any, new_callable: Any, kwargs: Any) -> None: ... + def copy(self) -> Any: ... + def __call__(self, func: Any) -> Any: ... + def decorate_class(self, klass: Any) -> Any: ... + def decorate_callable(self, func: Any) -> Any: ... + def get_original(self) -> Any: ... + target: Any + temp_original: Any + is_local: Any + def __enter__(self) -> Any: ... + def __exit__(self, *exc_info: Any) -> Any: ... + def start(self) -> Any: ... + def stop(self) -> Any: ... + +class _patch_dict: + in_dict: Any + values: Any + clear: Any + def __init__(self, in_dict: Any, values: Any = ..., clear: Any = ..., **kwargs: Any) -> None: ... + def __call__(self, f: Any) -> Any: ... + def decorate_class(self, klass: Any) -> Any: ... + def __enter__(self) -> Any: ... + def __exit__(self, *args: Any) -> Any: ... + start: Any + stop: Any + +class _patcher: + TEST_PREFIX: str + dict: Type[_patch_dict] + def __call__(self, target: Any, new: Optional[Any] = ..., spec: Optional[Any] = ..., create: bool = ..., spec_set: Optional[Any] = ..., autospec: Optional[Any] = ..., new_callable: Optional[Any] = ..., **kwargs: Any) -> _patch: ... + def object(self, target: Any, attribute: Text, new: Optional[Any] = ..., spec: Optional[Any] = ..., create: bool = ..., spec_set: Optional[Any] = ..., autospec: Optional[Any] = ..., new_callable: Optional[Any] = ..., **kwargs: Any) -> _patch: ... + def multiple(self, target: Any, spec: Optional[Any] = ..., create: bool = ..., spec_set: Optional[Any] = ..., autospec: Optional[Any] = ..., new_callable: Optional[Any] = ..., **kwargs: Any) -> _patch: ... + def stopall(self) -> None: ... + +patch: _patcher + +class MagicMixin: + def __init__(self, *args: Any, **kw: Any) -> None: ... + +NonCallableMagicMock: Any +MagicMock: Any + +class MagicProxy: + name: Any + parent: Any + def __init__(self, name: Any, parent: Any) -> None: ... + def __call__(self, *args: Any, **kwargs: Any) -> Any: ... + def create_mock(self) -> Any: ... + def __get__(self, obj: Any, _type: Optional[Any] = ...) -> Any: ... + +class _ANY: + def __eq__(self, other: Any) -> bool: ... + def __ne__(self, other: Any) -> bool: ... + +ANY: Any + +class _Call(tuple): + def __new__(cls, value: Any = ..., name: Optional[Any] = ..., parent: Optional[Any] = ..., two: bool = ..., from_kall: bool = ...) -> Any: ... + name: Any + parent: Any + from_kall: Any + def __init__(self, value: Any = ..., name: Optional[Any] = ..., parent: Optional[Any] = ..., two: bool = ..., from_kall: bool = ...) -> None: ... + def __eq__(self, other: Any) -> bool: ... + __ne__: Any + def __call__(self, *args: Any, **kwargs: Any) -> Any: ... + def __getattr__(self, attr: Any) -> Any: ... + def count(self, *args: Any, **kwargs: Any) -> Any: ... + def index(self, *args: Any, **kwargs: Any) -> Any: ... + def call_list(self) -> Any: ... + +call: Any + +def create_autospec(spec: Any, spec_set: Any = ..., instance: Any = ..., _parent: Optional[Any] = ..., _name: Optional[Any] = ..., **kwargs: Any) -> Any: ... + +class _SpecState: + spec: Any + ids: Any + spec_set: Any + parent: Any + instance: Any + name: Any + def __init__(self, spec: Any, spec_set: Any = ..., parent: Optional[Any] = ..., name: Optional[Any] = ..., ids: Optional[Any] = ..., instance: Any = ...) -> None: ... + +def mock_open(mock: Optional[Any] = ..., read_data: Any = ...) -> Any: ... + +PropertyMock: Any + +if sys.version_info >= (3, 7): + def seal(mock: Any) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/unittest/result.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/unittest/result.pyi new file mode 100644 index 0000000..cb85399 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/unittest/result.pyi @@ -0,0 +1,36 @@ +from typing import Any, List, Optional, Tuple, Type +from types import TracebackType +import unittest.case + + +_SysExcInfoType = Tuple[Optional[Type[BaseException]], + Optional[BaseException], + Optional[TracebackType]] + + +class TestResult: + errors: List[Tuple[unittest.case.TestCase, str]] + failures: List[Tuple[unittest.case.TestCase, str]] + skipped: List[Tuple[unittest.case.TestCase, str]] + expectedFailures: List[Tuple[unittest.case.TestCase, str]] + unexpectedSuccesses: List[unittest.case.TestCase] + shouldStop: bool + testsRun: int + buffer: bool + failfast: bool + tb_locals: bool + def wasSuccessful(self) -> bool: ... + def stop(self) -> None: ... + def startTest(self, test: unittest.case.TestCase) -> None: ... + def stopTest(self, test: unittest.case.TestCase) -> None: ... + def startTestRun(self) -> None: ... + def stopTestRun(self) -> None: ... + def addError(self, test: unittest.case.TestCase, err: _SysExcInfoType) -> None: ... + def addFailure(self, test: unittest.case.TestCase, err: _SysExcInfoType) -> None: ... + def addSuccess(self, test: unittest.case.TestCase) -> None: ... + def addSkip(self, test: unittest.case.TestCase, reason: str) -> None: ... + def addExpectedFailure(self, test: unittest.case.TestCase, + err: _SysExcInfoType) -> None: ... + def addUnexpectedSuccess(self, test: unittest.case.TestCase) -> None: ... + def addSubTest(self, test: unittest.case.TestCase, subtest: unittest.case.TestCase, + outcome: Optional[_SysExcInfoType]) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/unittest/runner.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/unittest/runner.pyi new file mode 100644 index 0000000..786bc19 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/unittest/runner.pyi @@ -0,0 +1,40 @@ +from typing import Callable, Optional, TextIO, Tuple, Type, Union +import sys +import unittest.case +import unittest.result +import unittest.suite + + +_ResultClassType = Callable[[TextIO, bool, int], unittest.result.TestResult] + + +class TextTestResult(unittest.result.TestResult): + separator1: str + separator2: str + def __init__(self, stream: TextIO, descriptions: bool, + verbosity: int) -> None: ... + def getDescription(self, test: unittest.case.TestCase) -> str: ... + def printErrors(self) -> None: ... + def printErrorList(self, flavour: str, errors: Tuple[unittest.case.TestCase, str]) -> None: ... + + +class TestRunner: + def run(self, test: Union[unittest.suite.TestSuite, unittest.case.TestCase]) -> unittest.result.TestResult: ... + + +class TextTestRunner(TestRunner): + if sys.version_info >= (3, 5): + def __init__(self, stream: Optional[TextIO] = ..., + descriptions: bool = ..., verbosity: int = ..., + failfast: bool = ..., buffer: bool = ..., + resultclass: Optional[_ResultClassType] = ..., + warnings: Optional[Type[Warning]] = ..., + *, tb_locals: bool = ...) -> None: ... + else: + def __init__(self, + stream: Optional[TextIO] = ..., + descriptions: bool = ..., verbosity: int = ..., + failfast: bool = ..., buffer: bool = ..., + resultclass: Optional[_ResultClassType] = ..., + warnings: Optional[Type[Warning]] = ...) -> None: ... + def _makeResult(self) -> unittest.result.TestResult: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/unittest/signals.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/unittest/signals.pyi new file mode 100644 index 0000000..a4616b7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/unittest/signals.pyi @@ -0,0 +1,14 @@ +from typing import Any, Callable, overload, TypeVar +import unittest.result + + +_F = TypeVar('_F', bound=Callable[..., Any]) + + +def installHandler() -> None: ... +def registerResult(result: unittest.result.TestResult) -> None: ... +def removeResult(result: unittest.result.TestResult) -> bool: ... +@overload +def removeHandler() -> None: ... +@overload +def removeHandler(function: _F) -> _F: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/unittest/suite.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/unittest/suite.pyi new file mode 100644 index 0000000..54e9e69 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/unittest/suite.pyi @@ -0,0 +1,22 @@ +from typing import Iterable, Iterator, List, Union +import unittest.case +import unittest.result + + +_TestType = Union[unittest.case.TestCase, TestSuite] + + +class BaseTestSuite(Iterable[_TestType]): + _tests: List[unittest.case.TestCase] + _removed_tests: int + def __init__(self, tests: Iterable[_TestType] = ...) -> None: ... + def __call__(self, result: unittest.result.TestResult) -> unittest.result.TestResult: ... + def addTest(self, test: _TestType) -> None: ... + def addTests(self, tests: Iterable[_TestType]) -> None: ... + def run(self, result: unittest.result.TestResult) -> unittest.result.TestResult: ... + def debug(self) -> None: ... + def countTestCases(self) -> int: ... + def __iter__(self) -> Iterator[_TestType]: ... + + +class TestSuite(BaseTestSuite): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/urllib/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/urllib/__init__.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/urllib/error.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/urllib/error.pyi new file mode 100644 index 0000000..191c765 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/urllib/error.pyi @@ -0,0 +1,12 @@ +from typing import Dict, Union +from urllib.response import addinfourl + +# Stubs for urllib.error + +class URLError(IOError): + reason: Union[str, BaseException] +class HTTPError(URLError, addinfourl): + code: int + headers: Dict[str, str] + def __init__(self, url, code, msg, hdrs, fp) -> None: ... +class ContentTooShortError(URLError): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/urllib/parse.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/urllib/parse.pyi new file mode 100644 index 0000000..8d7cc4a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/urllib/parse.pyi @@ -0,0 +1,146 @@ +# Stubs for urllib.parse +from typing import Any, List, Dict, Tuple, AnyStr, Generic, overload, Sequence, Mapping, Union, NamedTuple, Callable, Optional +import sys + +_Str = Union[bytes, str] + + +uses_relative: List[str] +uses_netloc: List[str] +uses_params: List[str] +non_hierarchical: List[str] +uses_query: List[str] +uses_fragment: List[str] +scheme_chars: str +MAX_CACHE_SIZE = 0 + +class _ResultMixinBase(Generic[AnyStr]): + def geturl(self) -> AnyStr: ... + +class _ResultMixinStr(_ResultMixinBase[str]): + def encode(self, encoding: str = ..., errors: str = ...) -> _ResultMixinBytes: ... + + +class _ResultMixinBytes(_ResultMixinBase[str]): + def decode(self, encoding: str = ..., errors: str = ...) -> _ResultMixinStr: ... + + +class _NetlocResultMixinBase(Generic[AnyStr]): + username: AnyStr + password: AnyStr + hostname: AnyStr + port: int + +class _NetlocResultMixinStr(_NetlocResultMixinBase[str], _ResultMixinStr): ... + +class _NetlocResultMixinBytes(_NetlocResultMixinBase[bytes], _ResultMixinBytes): ... + +class _DefragResultBase(tuple, Generic[AnyStr]): + url: AnyStr + fragment: AnyStr + + +_SplitResultBase = NamedTuple( + '_SplitResultBase', + [ + ('scheme', str), ('netloc', str), ('path', str), ('query', str), ('fragment', str) + ] +) +_SplitResultBytesBase = NamedTuple( + '_SplitResultBytesBase', + [ + ('scheme', bytes), ('netloc', bytes), ('path', bytes), ('query', bytes), ('fragment', bytes) + ] +) + +_ParseResultBase = NamedTuple( + '_ParseResultBase', + [ + ('scheme', str), ('netloc', str), ('path', str), ('params', str), ('query', str), ('fragment', str) + ] +) +_ParseResultBytesBase = NamedTuple( + '_ParseResultBytesBase', + [ + ('scheme', bytes), ('netloc', bytes), ('path', bytes), ('params', bytes), ('query', bytes), ('fragment', bytes) + ] +) + +# Structured result objects for string data +class DefragResult(_DefragResultBase[str], _ResultMixinStr): ... + +class SplitResult(_SplitResultBase, _NetlocResultMixinStr): ... + +class ParseResult(_ParseResultBase, _NetlocResultMixinStr): ... + +# Structured result objects for bytes data +class DefragResultBytes(_DefragResultBase[bytes], _ResultMixinBytes): ... + +class SplitResultBytes(_SplitResultBytesBase, _NetlocResultMixinBytes): ... + +class ParseResultBytes(_ParseResultBytesBase, _NetlocResultMixinBytes): ... + + +def parse_qs(qs: AnyStr, keep_blank_values: bool = ..., strict_parsing: bool = ..., encoding: str = ..., errors: str = ...) -> Dict[AnyStr, List[AnyStr]]: ... + +def parse_qsl(qs: AnyStr, keep_blank_values: bool = ..., strict_parsing: bool = ..., encoding: str = ..., errors: str = ...) -> List[Tuple[AnyStr, AnyStr]]: ... + + +@overload +def quote(string: str, safe: _Str = ..., encoding: str = ..., errors: str = ...) -> str: ... +@overload +def quote(string: bytes, safe: _Str = ...) -> str: ... + +def quote_from_bytes(bs: bytes, safe: _Str = ...) -> str: ... + +@overload +def quote_plus(string: str, safe: _Str = ..., encoding: str = ..., errors: str = ...) -> str: ... +@overload +def quote_plus(string: bytes, safe: _Str = ...) -> str: ... + +def unquote(string: str, encoding: str = ..., errors: str = ...) -> str: ... + +def unquote_to_bytes(string: _Str) -> bytes: ... + +def unquote_plus(string: str, encoding: str = ..., errors: str = ...) -> str: ... + +@overload +def urldefrag(url: str) -> DefragResult: ... +@overload +def urldefrag(url: bytes) -> DefragResultBytes: ... + +if sys.version_info >= (3, 5): + def urlencode(query: Union[Mapping[Any, Any], + Mapping[Any, Sequence[Any]], + Sequence[Tuple[Any, Any]], + Sequence[Tuple[Any, Sequence[Any]]]], + doseq: bool = ..., safe: AnyStr = ..., encoding: str = ..., errors: str = ..., + quote_via: Callable[[str, AnyStr, str, str], str] = ...) -> str: ... +else: + def urlencode(query: Union[Mapping[Any, Any], + Mapping[Any, Sequence[Any]], + Sequence[Tuple[Any, Any]], + Sequence[Tuple[Any, Sequence[Any]]]], + doseq: bool = ..., safe: AnyStr = ..., encoding: str = ..., errors: str = ...) -> str: ... + +def urljoin(base: AnyStr, url: Optional[AnyStr], allow_fragments: bool = ...) -> AnyStr: ... + +@overload +def urlparse(url: str, scheme: str = ..., allow_fragments: bool = ...) -> ParseResult: ... +@overload +def urlparse(url: bytes, scheme: bytes = ..., allow_fragments: bool = ...) -> ParseResultBytes: ... + +@overload +def urlsplit(url: str, scheme: str = ..., allow_fragments: bool = ...) -> SplitResult: ... +@overload +def urlsplit(url: bytes, scheme: bytes = ..., allow_fragments: bool = ...) -> SplitResultBytes: ... + +@overload +def urlunparse(components: Tuple[AnyStr, AnyStr, AnyStr, AnyStr, AnyStr, AnyStr]) -> AnyStr: ... +@overload +def urlunparse(components: Sequence[AnyStr]) -> AnyStr: ... + +@overload +def urlunsplit(components: Tuple[AnyStr, AnyStr, AnyStr, AnyStr, AnyStr]) -> AnyStr: ... +@overload +def urlunsplit(components: Sequence[AnyStr]) -> AnyStr: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/urllib/request.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/urllib/request.pyi new file mode 100644 index 0000000..a1a5568 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/urllib/request.pyi @@ -0,0 +1,222 @@ +# Stubs for urllib.request (Python 3.4) + +from typing import ( + Any, Callable, ClassVar, Dict, List, IO, Mapping, Optional, Sequence, Tuple, + TypeVar, Union, overload, NoReturn, +) +from http.client import HTTPResponse, HTTPMessage, HTTPConnectionProtocol +from http.cookiejar import CookieJar +from email.message import Message +from urllib.response import addinfourl +import ssl +import sys +import os + +_T = TypeVar('_T') +_UrlopenRet = Union[_HTTPResponse, addinfourl] + +class _HTTPResponse(HTTPResponse): + url: str + msg: str # type: ignore + +def urlopen( + url: Union[str, Request], data: Optional[bytes] = ..., + timeout: float = ..., *, cafile: Optional[str] = ..., + capath: Optional[str] = ..., cadefault: bool = ..., + context: Optional[ssl.SSLContext] = ... +) -> _UrlopenRet: ... +def install_opener(opener: OpenerDirector) -> None: ... +def build_opener( + *handlers: Union[BaseHandler, Callable[[], BaseHandler]] +) -> OpenerDirector: ... +def url2pathname(path: str) -> str: ... +def pathname2url(path: str) -> str: ... +def getproxies() -> Dict[str, str]: ... +def parse_http_list(s: str) -> List[str]: ... +def parse_keqv_list(l: List[str]) -> Dict[str, str]: ... + +class Request: + @property + def full_url(self) -> str: ... + @full_url.setter + def full_url(self, value: str) -> None: ... + @full_url.deleter + def full_url(self) -> None: ... + type: str + host: str + origin_req_host: str + selector: str + data: Optional[bytes] + headers: Dict[str, str] + unverifiable: bool + method: Optional[str] + def __init__(self, url: str, data: Optional[bytes] = ..., + headers: Dict[str, str] = ..., origin_req_host: Optional[str] = ..., + unverifiable: bool = ..., method: Optional[str] = ...) -> None: ... + def get_method(self) -> str: ... + def add_header(self, key: str, val: str) -> None: ... + def add_unredirected_header(self, key: str, val: str) -> None: ... + def has_header(self, header_name: str) -> bool: ... + def remove_header(self, header_name: str) -> None: ... + def get_full_url(self) -> str: ... + def set_proxy(self, host: str, type: str) -> None: ... + @overload + def get_header(self, header_name: str) -> Optional[str]: ... + @overload + def get_header(self, header_name: str, default: _T) -> Union[str, _T]: ... + def header_items(self) -> List[Tuple[str, str]]: ... + +class OpenerDirector: + addheaders: List[Tuple[str, str]] + def add_handler(self, handler: BaseHandler) -> None: ... + def open(self, url: Union[str, Request], data: Optional[bytes] = ..., + timeout: float = ...) -> _UrlopenRet: ... + def error(self, proto: str, *args: Any) -> _UrlopenRet: ... + + +class BaseHandler: + handler_order: ClassVar[int] + parent: OpenerDirector + def add_parent(self, parent: OpenerDirector) -> None: ... + def close(self) -> None: ... + def http_error_nnn(self, req: Request, fp: IO[str], code: int, msg: int, + hdrs: Mapping[str, str]) -> _UrlopenRet: ... + +class HTTPDefaultErrorHandler(BaseHandler): ... + +class HTTPRedirectHandler(BaseHandler): + def redirect_request(self, req: Request, fp: IO[str], code: int, msg: str, + hdrs: Mapping[str, str], + newurl: str) -> Optional[Request]: ... + def http_error_301(self, req: Request, fp: IO[str], code: int, msg: int, + hdrs: Mapping[str, str]) -> Optional[_UrlopenRet]: ... + def http_error_302(self, req: Request, fp: IO[str], code: int, msg: int, + hdrs: Mapping[str, str]) -> Optional[_UrlopenRet]: ... + def http_error_303(self, req: Request, fp: IO[str], code: int, msg: int, + hdrs: Mapping[str, str]) -> Optional[_UrlopenRet]: ... + def http_error_307(self, req: Request, fp: IO[str], code: int, msg: int, + hdrs: Mapping[str, str]) -> Optional[_UrlopenRet]: ... + +class HTTPCookieProcessor(BaseHandler): + cookiejar: CookieJar + def __init__(self, cookiejar: Optional[CookieJar] = ...) -> None: ... + +class ProxyHandler(BaseHandler): + def __init__(self, proxies: Optional[Dict[str, str]] = ...) -> None: ... + # TODO add a method for every (common) proxy protocol + +class HTTPPasswordMgr: + def add_password(self, realm: str, uri: Union[str, Sequence[str]], + user: str, passwd: str) -> None: ... + def find_user_password(self, realm: str, authuri: str) -> Tuple[Optional[str], Optional[str]]: ... + +class HTTPPasswordMgrWithDefaultRealm(HTTPPasswordMgr): + def add_password(self, realm: str, uri: Union[str, Sequence[str]], + user: str, passwd: str) -> None: ... + def find_user_password(self, realm: str, authuri: str) -> Tuple[Optional[str], Optional[str]]: ... + +if sys.version_info >= (3, 5): + class HTTPPasswordMgrWithPriorAuth(HTTPPasswordMgrWithDefaultRealm): + def add_password(self, realm: str, uri: Union[str, Sequence[str]], + user: str, passwd: str, + is_authenticated: bool = ...) -> None: ... + def update_authenticated(self, uri: Union[str, Sequence[str]], + is_authenticated: bool = ...) -> None: ... + def is_authenticated(self, authuri: str) -> bool: ... + +class AbstractBasicAuthHandler: + def __init__(self, + password_mgr: Optional[HTTPPasswordMgr] = ...) -> None: ... + def http_error_auth_reqed(self, authreq: str, host: str, req: Request, + headers: Mapping[str, str]) -> None: ... + +class HTTPBasicAuthHandler(AbstractBasicAuthHandler, BaseHandler): + def http_error_401(self, req: Request, fp: IO[str], code: int, msg: int, + hdrs: Mapping[str, str]) -> Optional[_UrlopenRet]: ... + +class ProxyBasicAuthHandler(AbstractBasicAuthHandler, BaseHandler): + def http_error_407(self, req: Request, fp: IO[str], code: int, msg: int, + hdrs: Mapping[str, str]) -> Optional[_UrlopenRet]: ... + +class AbstractDigestAuthHandler: + def __init__(self, passwd: Optional[HTTPPasswordMgr] = ...) -> None: ... + def reset_retry_count(self) -> None: ... + def http_error_auth_reqed(self, auth_header: str, host: str, req: Request, + headers: Mapping[str, str]) -> None: ... + def retry_http_digest_auth(self, req: Request, auth: str) -> Optional[_UrlopenRet]: ... + def get_cnonce(self, nonce: str) -> str: ... + def get_authorization(self, req: Request, chal: Mapping[str, str]) -> str: ... + def get_algorithm_impls(self, algorithm: str) -> Tuple[Callable[[str], str], Callable[[str, str], str]]: ... + def get_entity_digest(self, data: Optional[bytes], chal: Mapping[str, str]) -> Optional[str]: ... + +class HTTPDigestAuthHandler(BaseHandler, AbstractDigestAuthHandler): + def http_error_401(self, req: Request, fp: IO[str], code: int, msg: int, + hdrs: Mapping[str, str]) -> Optional[_UrlopenRet]: ... + +class ProxyDigestAuthHandler(BaseHandler, AbstractDigestAuthHandler): + def http_error_407(self, req: Request, fp: IO[str], code: int, msg: int, + hdrs: Mapping[str, str]) -> Optional[_UrlopenRet]: ... + +class AbstractHTTPHandler(BaseHandler): # undocumented + def __init__(self, debuglevel: int = ...) -> None: ... + def set_http_debuglevel(self, level: int) -> None: ... + def do_request_(self, request: Request) -> Request: ... + def do_open(self, + http_class: HTTPConnectionProtocol, + req: Request, + **http_conn_args: Any) -> HTTPResponse: ... + +class HTTPHandler(AbstractHTTPHandler): + def http_open(self, req: Request) -> HTTPResponse: ... + def http_request(self, request: Request) -> Request: ... # undocumented + +class HTTPSHandler(AbstractHTTPHandler): + def __init__(self, debuglevel: int = ..., + context: Optional[ssl.SSLContext] = ..., + check_hostname: Optional[bool] = ...) -> None: ... + def https_open(self, req: Request) -> HTTPResponse: ... + def https_request(self, request: Request) -> Request: ... # undocumented + +class FileHandler(BaseHandler): + def file_open(self, req: Request) -> addinfourl: ... + +class DataHandler(BaseHandler): + def data_open(self, req: Request) -> addinfourl: ... + +class FTPHandler(BaseHandler): + def ftp_open(self, req: Request) -> addinfourl: ... + +class CacheFTPHandler(FTPHandler): + def setTimeout(self, t: float) -> None: ... + def setMaxConns(self, m: int) -> None: ... + +class UnknownHandler(BaseHandler): + def unknown_open(self, req: Request) -> NoReturn: ... + +class HTTPErrorProcessor(BaseHandler): + def http_response(self, request, response) -> _UrlopenRet: ... + def https_response(self, request, response) -> _UrlopenRet: ... + +if sys.version_info >= (3, 6): + def urlretrieve(url: str, filename: Optional[Union[str, os.PathLike]] = ..., + reporthook: Optional[Callable[[int, int, int], None]] = ..., + data: Optional[bytes] = ...) -> Tuple[str, HTTPMessage]: ... +else: + def urlretrieve(url: str, filename: Optional[str] = ..., + reporthook: Optional[Callable[[int, int, int], None]] = ..., + data: Optional[bytes] = ...) -> Tuple[str, HTTPMessage]: ... +def urlcleanup() -> None: ... + +class URLopener: + version: ClassVar[str] + def __init__(self, proxies: Optional[Dict[str, str]] = ..., + **x509: str) -> None: ... + def open(self, fullurl: str, data: Optional[bytes] = ...) -> _UrlopenRet: ... + def open_unknown(self, fullurl: str, + data: Optional[bytes] = ...) -> _UrlopenRet: ... + def retrieve(self, url: str, filename: Optional[str] = ..., + reporthook: Optional[Callable[[int, int, int], None]] = ..., + data: Optional[bytes] = ...) -> Tuple[str, Optional[Message]]: ... + +class FancyURLopener(URLopener): + def prompt_user_passwd(self, host: str, realm: str) -> Tuple[str, str]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/urllib/response.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/urllib/response.pyi new file mode 100644 index 0000000..ef3507d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/urllib/response.pyi @@ -0,0 +1,41 @@ +# private module, we only expose what's needed + +from typing import BinaryIO, Iterable, List, Mapping, Optional, Type, TypeVar +from types import TracebackType + +_AIUT = TypeVar("_AIUT", bound=addbase) + +class addbase(BinaryIO): + def __enter__(self: _AIUT) -> _AIUT: ... + def __exit__(self, type: Optional[Type[BaseException]], value: Optional[BaseException], traceback: Optional[TracebackType]) -> bool: ... + def __iter__(self: _AIUT) -> _AIUT: ... + def __next__(self) -> bytes: ... + def close(self) -> None: ... + # These methods don't actually exist, but the class inherits at runtime from + # tempfile._TemporaryFileWrapper, which uses __getattr__ to delegate to the + # underlying file object. To satisfy the BinaryIO interface, we pretend that this + # class has these additional methods. + def fileno(self) -> int: ... + def flush(self) -> None: ... + def isatty(self) -> bool: ... + def read(self, n: int = ...) -> bytes: ... + def readable(self) -> bool: ... + def readline(self, limit: int = ...) -> bytes: ... + def readlines(self, hint: int = ...) -> List[bytes]: ... + def seek(self, offset: int, whence: int = ...) -> int: ... + def seekable(self) -> bool: ... + def tell(self) -> int: ... + def truncate(self, size: Optional[int] = ...) -> int: ... + def writable(self) -> bool: ... + def write(self, s: bytes) -> int: ... + def writelines(self, lines: Iterable[bytes]) -> None: ... + +class addinfo(addbase): + headers: Mapping[str, str] + def info(self) -> Mapping[str, str]: ... + +class addinfourl(addinfo): + url: str + code: int + def geturl(self) -> str: ... + def getcode(self) -> int: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/urllib/robotparser.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/urllib/robotparser.pyi new file mode 100644 index 0000000..36150ab --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/stdlib/3/urllib/robotparser.pyi @@ -0,0 +1,18 @@ +# Stubs for urllib.robotparser (Python 3.4) + +from typing import Iterable, NamedTuple, Optional +import sys + +_RequestRate = NamedTuple('_RequestRate', [('requests', int), ('seconds', int)]) + +class RobotFileParser: + def __init__(self, url: str = ...) -> None: ... + def set_url(self, url: str) -> None: ... + def read(self) -> None: ... + def parse(self, lines: Iterable[str]) -> None: ... + def can_fetch(self, user_agent: str, url: str) -> bool: ... + def mtime(self) -> int: ... + def modified(self) -> None: ... + if sys.version_info >= (3, 6): + def crawl_delay(self, useragent: str) -> Optional[str]: ... + def request_rate(self, useragent: str) -> Optional[_RequestRate]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/tests/check_consistent.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/tests/check_consistent.py new file mode 100755 index 0000000..0566b49 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/tests/check_consistent.py @@ -0,0 +1,43 @@ +#!/usr/bin/env python3 + +# Symlinks are bad on Windows, so we cannot use them in typeshed. +# This checks that certain files are duplicated exactly. + +import os +import filecmp + +consistent_files = [ + {'stdlib/2and3/builtins.pyi', 'stdlib/2/__builtin__.pyi'}, + {'stdlib/2/SocketServer.pyi', 'stdlib/3/socketserver.pyi'}, + {'stdlib/2/os2emxpath.pyi', 'stdlib/2and3/posixpath.pyi', + 'stdlib/2and3/ntpath.pyi', 'stdlib/2and3/macpath.pyi', + 'stdlib/2/os/path.pyi', 'stdlib/3/os/path.pyi'}, + {'stdlib/3/enum.pyi', 'third_party/2/enum.pyi'}, + {'stdlib/2/os/path.pyi', 'stdlib/3/os/path.pyi'}, + {'stdlib/3/unittest/mock.pyi', 'third_party/2and3/mock.pyi'}, + {'stdlib/3/concurrent/__init__.pyi', 'third_party/2/concurrent/__init__.pyi'}, + {'stdlib/3/concurrent/futures/__init__.pyi', 'third_party/2/concurrent/futures/__init__.pyi'}, + {'stdlib/3/concurrent/futures/_base.pyi', 'third_party/2/concurrent/futures/_base.pyi'}, + {'stdlib/3/concurrent/futures/thread.pyi', 'third_party/2/concurrent/futures/thread.pyi'}, + {'stdlib/3/concurrent/futures/process.pyi', 'third_party/2/concurrent/futures/process.pyi'}, + {'stdlib/3.7/dataclasses.pyi', 'third_party/3/dataclasses.pyi'}, + {'stdlib/3/pathlib.pyi', 'third_party/2/pathlib2.pyi'}, + {'stdlib/3.7/contextvars.pyi', 'third_party/3.5/contextvars.pyi'}, +] + +def main(): + files = [os.path.join(root, file) for root, dir, files in os.walk('.') for file in files] + no_symlink = 'You cannot use symlinks in typeshed, please copy {} to its link.' + for file in files: + _, ext = os.path.splitext(file) + if ext == '.pyi' and os.path.islink(file): + raise ValueError(no_symlink.format(file)) + for file1, *others in consistent_files: + f1 = os.path.join(os.getcwd(), file1) + for file2 in others: + f2 = os.path.join(os.getcwd(), file2) + if not filecmp.cmp(f1, f2): + raise ValueError('File {f1} does not match file {f2}. Please copy it to {f2}'.format(f1=file1, f2=file2)) + +if __name__ == '__main__': + main() diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/tests/mypy_blacklist.txt b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/tests/mypy_blacklist.txt new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/tests/mypy_selftest.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/tests/mypy_selftest.py new file mode 100755 index 0000000..fd7f23b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/tests/mypy_selftest.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python3 +"""Script to run mypy's test suite against this version of typeshed.""" + +from pathlib import Path +import shutil +import subprocess +import sys +import tempfile + + +if __name__ == '__main__': + with tempfile.TemporaryDirectory() as tempdir: + dirpath = Path(tempdir) + subprocess.run(['python2.7', '-m', 'pip', 'install', '--user', 'typing'], check=True) + subprocess.run(['git', 'clone', '--depth', '1', 'git://github.com/python/mypy', + str(dirpath / 'mypy')], check=True) + subprocess.run([sys.executable, '-m', 'pip', 'install', '-U', '-r', + str(dirpath / 'mypy/test-requirements.txt')], check=True) + shutil.copytree('stdlib', str(dirpath / 'mypy/mypy/typeshed/stdlib')) + shutil.copytree('third_party', str(dirpath / 'mypy/mypy/typeshed/third_party')) + try: + subprocess.run(['pytest', '-n12'], cwd=str(dirpath / 'mypy'), check=True) + except subprocess.CalledProcessError as e: + print('mypy tests failed', file=sys.stderr) + sys.exit(e.returncode) + else: + print('mypy tests succeeded', file=sys.stderr) + sys.exit(0) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/tests/mypy_test.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/tests/mypy_test.py new file mode 100755 index 0000000..d4ffca1 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/tests/mypy_test.py @@ -0,0 +1,156 @@ +#!/usr/bin/env python3 +"""Test runner for typeshed. + +Depends on mypy being installed. + +Approach: + +1. Parse sys.argv +2. Compute appropriate arguments for mypy +3. Stuff those arguments into sys.argv +4. Run mypy.main('') +5. Repeat steps 2-4 for other mypy runs (e.g. --py2) +""" + +import os +import re +import sys +import argparse + +parser = argparse.ArgumentParser(description="Test runner for typeshed. " + "Patterns are unanchored regexps on the full path.") +parser.add_argument('-v', '--verbose', action='count', default=0, help="More output") +parser.add_argument('-n', '--dry-run', action='store_true', help="Don't actually run mypy") +parser.add_argument('-x', '--exclude', type=str, nargs='*', help="Exclude pattern") +parser.add_argument('-p', '--python-version', type=str, nargs='*', + help="These versions only (major[.minor])") +parser.add_argument('--warn-unused-ignores', action='store_true', + help="Run mypy with --warn-unused-ignores " + "(hint: only get rid of warnings that are " + "unused for all platforms and Python versions)") + +parser.add_argument('filter', type=str, nargs='*', help="Include pattern (default all)") + + +def log(args, *varargs): + if args.verbose >= 2: + print(*varargs) + + +def match(fn, args, blacklist): + if blacklist.match(fn): + log(args, fn, 'exluded by blacklist') + return False + if not args.filter and not args.exclude: + log(args, fn, 'accept by default') + return True + if args.exclude: + for f in args.exclude: + if re.search(f, fn): + log(args, fn, 'excluded by pattern', f) + return False + if args.filter: + for f in args.filter: + if re.search(f, fn): + log(args, fn, 'accepted by pattern', f) + return True + if args.filter: + log(args, fn, 'rejected (no pattern matches)') + return False + log(args, fn, 'accepted (no exclude pattern matches)') + return True + + +def libpath(major, minor): + versions = ['%d.%d' % (major, minor) + for minor in reversed(range(minor + 1))] + versions.append(str(major)) + versions.append('2and3') + paths = [] + for v in versions: + for top in ['stdlib', 'third_party']: + p = os.path.join(top, v) + if os.path.isdir(p): + paths.append(p) + return paths + + +def main(): + args = parser.parse_args() + + with open(os.path.join(os.path.dirname(__file__), "mypy_blacklist.txt")) as f: + blacklist = re.compile("(%s)$" % "|".join( + re.findall(r"^\s*([^\s#]+)\s*(?:#.*)?$", f.read(), flags=re.M))) + + try: + from mypy.main import main as mypy_main + except ImportError: + print("Cannot import mypy. Did you install it?") + sys.exit(1) + + versions = [(3, 7), (3, 6), (3, 5), (3, 4), (2, 7)] + if args.python_version: + versions = [v for v in versions + if any(('%d.%d' % v).startswith(av) for av in args.python_version)] + if not versions: + print("--- no versions selected ---") + sys.exit(1) + + code = 0 + runs = 0 + for major, minor in versions: + roots = libpath(major, minor) + files = [] + seen = {'__builtin__', 'builtins', 'typing'} # Always ignore these. + for root in roots: + names = os.listdir(root) + for name in names: + full = os.path.join(root, name) + mod, ext = os.path.splitext(name) + if mod in seen or mod.startswith('.'): + continue + if ext in ['.pyi', '.py']: + if match(full, args, blacklist): + seen.add(mod) + files.append(full) + elif (os.path.isfile(os.path.join(full, '__init__.pyi')) or + os.path.isfile(os.path.join(full, '__init__.py'))): + for r, ds, fs in os.walk(full): + ds.sort() + fs.sort() + for f in fs: + m, x = os.path.splitext(f) + if x in ['.pyi', '.py']: + fn = os.path.join(r, f) + if match(fn, args, blacklist): + seen.add(mod) + files.append(fn) + if files: + runs += 1 + flags = ['--python-version', '%d.%d' % (major, minor)] + flags.append('--strict-optional') + flags.append('--no-site-packages') + flags.append('--show-traceback') + flags.append('--no-implicit-optional') + if args.warn_unused_ignores: + flags.append('--warn-unused-ignores') + sys.argv = ['mypy'] + flags + files + if args.verbose: + print("running", ' '.join(sys.argv)) + else: + print("running mypy", ' '.join(flags), "# with", len(files), "files") + try: + if not args.dry_run: + mypy_main('', sys.stdout, sys.stderr) + except SystemExit as err: + code = max(code, err.code) + if code: + print("--- exit status", code, "---") + sys.exit(code) + if not runs: + print("--- nothing to do; exit 1 ---") + sys.exit(1) + + +if __name__ == '__main__': + main() diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/tests/pytype_blacklist.txt b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/tests/pytype_blacklist.txt new file mode 100644 index 0000000..8fdd78b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/tests/pytype_blacklist.txt @@ -0,0 +1,17 @@ +# Pytype blacklist. Files will not be tested with pytype. + +# pytype has its own version of these files, and thus doesn't mind if it +# can't parse the typeshed version: +stdlib/2/__builtin__.pyi +stdlib/2/typing.pyi +stdlib/2and3/builtins.pyi +stdlib/3/typing.pyi + +# third_party stubs with constructs that pytype doesn't yet support: +third_party/2/fb303/FacebookService.pyi +third_party/2/scribe/scribe.pyi +third_party/2and3/attr/__init__.pyi +third_party/2and3/attr/converters.pyi +third_party/2and3/attr/filters.pyi +third_party/2and3/attr/validators.pyi +third_party/2and3/pynamodb/models.pyi diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/tests/pytype_test.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/tests/pytype_test.py new file mode 100755 index 0000000..bb4793a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/tests/pytype_test.py @@ -0,0 +1,213 @@ +#!/usr/bin/env python +r"""Test runner for typeshed. + +Depends on pytype being installed. + +If pytype is installed: + 1. For every pyi, do nothing if it is in pytype_blacklist.txt. + 2. Otherwise, call 'pytype.io.parse_pyi'. +Option two will load the file and all the builtins, typeshed dependencies. This +will also discover incorrect usage of imported modules. +""" + +import argparse +import collections +import itertools +import os +from pytype import config +from pytype import io +import re +import subprocess +import sys +import traceback + +parser = argparse.ArgumentParser(description='Pytype/typeshed tests.') +parser.add_argument('-n', '--dry-run', action='store_true', default=False, + help='Don\'t actually run tests') +# Default to '' so that symlinking typeshed subdirs in cwd will work. +parser.add_argument('--typeshed-location', type=str, default='', + help='Path to typeshed installation.') +# Set to true to print a stack trace every time an exception is thrown. +parser.add_argument('--print-stderr', action='store_true', default=False, + help='Print stderr every time an error is encountered.') +# We need to invoke python2.7 and 3.6. +parser.add_argument('--python27-exe', type=str, default='python2.7', + help='Path to a python 2.7 interpreter.') +parser.add_argument('--python36-exe', type=str, default='python3.6', + help='Path to a python 3.6 interpreter.') + + +TYPESHED_SUBDIRS = ['stdlib', 'third_party'] + + +TYPESHED_HOME = 'TYPESHED_HOME' +UNSET = object() # marker for tracking the TYPESHED_HOME environment variable + + +def main(): + args = parser.parse_args() + code = pytype_test(args) + sys.exit(code) + + +class PathMatcher(object): + def __init__(self, patterns): + if patterns: + self.matcher = re.compile('(%s)$' % '|'.join(patterns)) + else: + self.matcher = None + + def search(self, path): + if not self.matcher: + return False + return self.matcher.search(path) + + +def load_blacklist(typeshed_location): + filename = os.path.join(typeshed_location, 'tests', 'pytype_blacklist.txt') + skip_re = re.compile(r'^\s*([^\s#]+)\s*(?:#.*)?$') + skip = [] + + with open(filename) as f: + for line in f: + skip_match = skip_re.match(line) + if skip_match: + skip.append(skip_match.group(1)) + + return skip + + +def run_pytype(args, dry_run, typeshed_location): + """Runs pytype, returning the stderr if any.""" + if dry_run: + return None + old_typeshed_home = os.environ.get(TYPESHED_HOME, UNSET) + os.environ[TYPESHED_HOME] = typeshed_location + try: + io.parse_pyi(config.Options(args)) + except Exception: + stderr = traceback.format_exc() + else: + stderr = None + if old_typeshed_home is UNSET: + del os.environ[TYPESHED_HOME] + else: + os.environ[TYPESHED_HOME] = old_typeshed_home + return stderr + + +def _get_relative(filename): + top = 0 + for d in TYPESHED_SUBDIRS: + try: + top = filename.index(d) + except ValueError: + continue + else: + break + return filename[top:] + + +def _get_module_name(filename): + """Converts a filename {subdir}/m.n/module/foo to module.foo.""" + return '.'.join(_get_relative(filename).split(os.path.sep)[2:]).replace( + '.pyi', '').replace('.__init__', '') + + +def can_run(path, exe, *args): + exe = os.path.join(path, exe) + try: + subprocess.Popen( + [exe] + list(args), stdout=subprocess.PIPE, stderr=subprocess.PIPE + ).communicate() + return True + except OSError: + return False + + +def _is_version(path, version): + return any('%s/%s' % (d, version) in path for d in TYPESHED_SUBDIRS) + + +def pytype_test(args): + """Test with pytype, returning 0 for success and 1 for failure.""" + typeshed_location = args.typeshed_location or os.getcwd() + paths = [os.path.join(typeshed_location, d) for d in TYPESHED_SUBDIRS] + + for p in paths: + if not os.path.isdir(p): + print('Cannot find typeshed subdir at %s ' + '(specify parent dir via --typeshed-location)' % p) + return 1 + + for python_version_str in ('27', '36'): + dest = 'python%s_exe' % python_version_str + version = '.'.join(list(python_version_str)) + arg = '--python%s-exe' % python_version_str + if not can_run('', getattr(args, dest), '--version'): + print('Cannot run Python {version}. (point to a valid executable ' + 'via {arg})'.format(version=version, arg=arg)) + return 1 + + skipped = PathMatcher(load_blacklist(typeshed_location)) + files = [] + bad = [] + + def _parse(filename, major_version): + if major_version == 3: + version = '3.6' + exe = args.python36_exe + else: + version = '2.7' + exe = args.python27_exe + options = [ + '--module-name=%s' % _get_module_name(filename), + '--parse-pyi', + '-V %s' % version, + '--python_exe=%s' % exe, + ] + return run_pytype(options + [filename], + dry_run=args.dry_run, + typeshed_location=typeshed_location) + + for root, _, filenames in itertools.chain.from_iterable( + os.walk(p) for p in paths): + for f in sorted(f for f in filenames if f.endswith('.pyi')): + f = os.path.join(root, f) + rel = _get_relative(f) + if not skipped.search(rel): + if _is_version(f, '2and3'): + files.append((f, 2)) + files.append((f, 3)) + elif _is_version(f, '2'): + files.append((f, 2)) + elif _is_version(f, '3'): + files.append((f, 3)) + else: + print('Unrecognized path: %s' % f) + + errors = 0 + total_tests = len(files) + print('Testing files with pytype...') + for i, (f, version) in enumerate(files): + stderr = _parse(f, version) + if stderr: + if args.print_stderr: + print(stderr) + errors += 1 + # We strip off the stack trace and just leave the last line with the + # actual error; to see the stack traces use --print_stderr. + bad.append((_get_relative(f), stderr.rstrip().rsplit('\n', 1)[-1])) + + runs = i + 1 + if runs % 25 == 0: + print(' %3d/%d with %3d errors' % (runs, total_tests, errors)) + + print('Ran pytype with %d pyis, got %d errors.' % (total_tests, errors)) + for f, err in bad: + print('%s: %s' % (f, err)) + return int(bool(errors)) + + +if __name__ == '__main__': + main() diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/OpenSSL/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/OpenSSL/__init__.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/OpenSSL/crypto.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/OpenSSL/crypto.pyi new file mode 100644 index 0000000..395e630 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/OpenSSL/crypto.pyi @@ -0,0 +1,191 @@ +# Stubs for OpenSSL.crypto (Python 2) + +from typing import Any, Callable, Iterable, List, Optional, Set, Text, Tuple, Union + +from cryptography.hazmat.primitives.asymmetric import dsa, rsa +from datetime import datetime + +FILETYPE_PEM: int +FILETYPE_ASN1: int +FILETYPE_TEXT: int +TYPE_RSA: int +TYPE_DSA: int + +class Error(Exception): ... + +_Key = Union[rsa.RSAPublicKey, rsa.RSAPrivateKey, dsa.DSAPublicKey, dsa.DSAPrivateKey] + +class PKey: + def __init__(self) -> None: ... + def to_cryptography_key(self) -> _Key: ... + @classmethod + def from_cryptography_key(cls, crypto_key: _Key): ... + def generate_key(self, type: int, bits: int) -> None: ... + def check(self) -> bool: ... + def type(self) -> int: ... + def bits(self) -> int: ... + +class _EllipticCurve: + name: Text + +def get_elliptic_curves() -> Set[_EllipticCurve]: ... +def get_elliptic_curve(name: str) -> _EllipticCurve: ... + +class X509Name: + def __init__(self, name: X509Name) -> None: ... + countryName: Union[str, unicode] + stateOrProvinceName: Union[str, unicode] + localityName: Union[str, unicode] + organizationName: Union[str, unicode] + organizationalUnitName: Union[str, unicode] + commonName: Union[str, unicode] + emailAddress: Union[str, unicode] + C: Union[str, unicode] + ST: Union[str, unicode] + L: Union[str, unicode] + O: Union[str, unicode] + OU: Union[str, unicode] + CN: Union[str, unicode] + def hash(self) -> int: ... + def der(self) -> bytes: ... + def get_components(self) -> List[Tuple[str, str]]: ... + +class X509Extension: + def __init__(self, type_name: bytes, critical: bool, value: bytes, subject: Optional[X509] = ..., + issuer: Optional[X509] = ...) -> None: ... + def get_critical(self) -> bool: ... + def get_short_name(self) -> str: ... + def get_data(self) -> str: ... + +class X509Req: + def __init__(self) -> None: ... + def set_pubkey(self, pkey: PKey) -> None: ... + def get_pubkey(self) -> PKey: ... + def set_version(self, version: int) -> None: ... + def get_version(self) -> int: ... + def get_subject(self) -> X509Name: ... + def add_extensions(self, extensions: Iterable[X509Extension]) -> None: ... + def get_extensions(self) -> List[X509Extension]: ... + def sign(self, pkey: PKey, digest: str) -> None: ... + def verify(self, pkey: PKey) -> bool: ... + +class X509: + def __init__(self) -> None: ... + def set_version(self, version: int) -> None: ... + def get_version(self) -> int: ... + def get_pubkey(self) -> PKey: ... + def set_pubkey(self, pkey: PKey) -> None: ... + def sign(self, pkey: PKey, digest: str) -> None: ... + def get_signature_algorithm(self) -> str: ... + def digest(self, digest_name: str) -> str: ... + def subject_name_hash(self) -> str: ... + def set_serial_number(self, serial: int) -> None: ... + def get_serial_number(self) -> int: ... + def gmtime_adj_notAfter(self, amount: int) -> None: ... + def gmtime_adj_notBefore(self, amount: int) -> None: ... + def has_expired(self) -> bool: ... + def get_notBefore(self) -> str: ... + def set_notBefore(self, when: str) -> None: ... + def get_notAfter(self) -> str: ... + def set_notAfter(self, when: str) -> None: ... + def get_issuer(self) -> X509Name: ... + def set_issuer(self, issuer: X509Name) -> None: ... + def get_subject(self) -> X509Name: ... + def set_subject(self, subject: X509Name) -> None: ... + def get_extension_count(self) -> int: ... + def add_extensions(self, extensions: Iterable[X509Extension]) -> None: ... + def get_extension(self, index: int) -> X509Extension: ... + +class X509StoreFlags: + CRL_CHECK: int + CRL_CHECK_ALL: int + IGNORE_CRITICAL: int + X509_STRICT: int + ALLOW_PROXY_CERTS: int + POLICY_CHECK: int + EXPLICIT_POLICY: int + INHIBIT_MAP: int + NOTIFY_POLICY: int + CHECK_SS_SIGNATURE: int + CB_ISSUER_CHECK: int + +class X509Store: + def __init__(self) -> None: ... + def add_cert(self, cert: X509) -> None: ... + def add_crl(self, crl: CRL) -> None: ... + def set_flags(self, flags: int) -> None: ... + def set_time(self, vfy_time: datetime) -> None: ... + +class X509StoreContextError(Exception): + certificate: X509 + def __init__(self, message: str, certificate: X509) -> None: ... + +class X509StoreContext: + def __init__(self, store: X509Store, certificate: X509) -> None: ... + def set_store(self, store: X509Store) -> None: ... + def verify_certificate(self) -> None: ... + +def load_certificate(type: int, buffer: Union[str, unicode]) -> X509: ... +def dump_certificate(type: int, cert: X509) -> bytes: ... +def dump_publickey(type: int, pkey: PKey) -> bytes: ... +def dump_privatekey(type: int, pkey: PKey, cipher: Optional[str] = ..., + passphrase: Optional[Union[str, Callable[[int], int]]] = ...) -> bytes: ... + +class Revoked: + def __init__(self) -> None: ... + def set_serial(self, hex_str: str) -> None: ... + def get_serial(self) -> str: ... + def set_reason(self, reason: str) -> None: ... + def get_reason(self) -> str: ... + def all_reasons(self) -> List[str]: ... + def set_rev_date(self, when: str) -> None: ... + def get_rev_date(self) -> str: ... + +class CRL: + def __init__(self) -> None: ... + def get_revoked(self) -> Tuple[Revoked, ...]: ... + def add_revoked(self, revoked: Revoked) -> None: ... + def get_issuer(self) -> X509Name: ... + def set_version(self, version: int) -> None: ... + def set_lastUpdate(self, when: str) -> None: ... + def set_nextUpdate(self, when: str) -> None: ... + def sign(self, issuer_cert: X509, issuer_key: PKey, digest: str) -> None: ... + def export(self, cert: X509, key: PKey, type: int = ..., days: int = ..., digest: str = ...) -> bytes: ... + +class PKCS7: + def type_is_signed(self) -> bool: ... + def type_is_enveloped(self) -> bool: ... + def type_is_signedAndEnveloped(self) -> bool: ... + def type_is_data(self) -> bool: ... + def get_type_name(self) -> str: ... + +class PKCS12: + def __init__(self) -> None: ... + def get_certificate(self) -> X509: ... + def set_certificate(self, cert: X509) -> None: ... + def get_privatekey(self) -> PKey: ... + def set_privatekey(self, pkey: PKey) -> None: ... + def get_ca_certificates(self) -> Tuple[X509, ...]: ... + def set_ca_certificates(self, cacerts: Iterable[X509]) -> None: ... + def set_friendlyname(self, name: bytes) -> None: ... + def get_friendlyname(self) -> bytes: ... + def export(self, passphrase: Optional[str] = ..., iter: int = ..., maciter: int = ...): ... + +class NetscapeSPKI: + def __init__(self) -> None: ... + def sign(self, pkey: PKey, digest: str) -> None: ... + def verify(self, key: PKey) -> bool: ... + def b64_encode(self) -> str: ... + def get_pubkey(self) -> PKey: ... + def set_pubkey(self, pkey: PKey) -> None: ... + +def load_publickey(type: int, buffer: Union[str, unicode]) -> PKey: ... +def load_privatekey(type: int, buffer: bytes, passphrase: Optional[Union[str, Callable[[int], int]]] = ...): ... +def dump_certificate_request(type: int, req: X509Req): ... +def load_certificate_request(type, buffer: Union[str, unicode]) -> X509Req: ... +def sign(pkey: PKey, data: Union[str, unicode], digest: str) -> bytes: ... +def verify(cert: X509, signature: bytes, data: Union[str, unicode], digest: str) -> None: ... +def dump_crl(type: int, crl: CRL) -> bytes: ... +def load_crl(type: int, buffer: Union[str, unicode]) -> CRL: ... +def load_pkcs7_data(type: int, buffer: Union[str, unicode]) -> PKCS7: ... +def load_pkcs12(buffer: Union[str, unicode], passphrase: Optional[Union[str, Callable[[int], int]]] = ...) -> PKCS12: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/concurrent/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/concurrent/__init__.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/concurrent/futures/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/concurrent/futures/__init__.pyi new file mode 100644 index 0000000..4439dca --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/concurrent/futures/__init__.pyi @@ -0,0 +1,3 @@ +from ._base import * # noqa: F403 +from .thread import * # noqa: F403 +from .process import * # noqa: F403 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/concurrent/futures/_base.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/concurrent/futures/_base.pyi new file mode 100644 index 0000000..95189a7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/concurrent/futures/_base.pyi @@ -0,0 +1,56 @@ +from typing import TypeVar, Generic, Any, Iterable, Iterator, Callable, Tuple, Optional, Set, NamedTuple +from types import TracebackType +import sys + +FIRST_COMPLETED: str +FIRST_EXCEPTION: str +ALL_COMPLETED: str +PENDING: Any +RUNNING: Any +CANCELLED: Any +CANCELLED_AND_NOTIFIED: Any +FINISHED: Any +LOGGER: Any + +class Error(Exception): ... +class CancelledError(Error): ... +class TimeoutError(Error): ... + +_T = TypeVar('_T') + +class Future(Generic[_T]): + def __init__(self) -> None: ... + def cancel(self) -> bool: ... + def cancelled(self) -> bool: ... + def running(self) -> bool: ... + def done(self) -> bool: ... + def add_done_callback(self, fn: Callable[[Future[_T]], Any]) -> None: ... + def result(self, timeout: Optional[float] = ...) -> _T: ... + def set_running_or_notify_cancel(self) -> bool: ... + def set_result(self, result: _T) -> None: ... + + if sys.version_info >= (3,): + def exception(self, timeout: Optional[float] = ...) -> Optional[BaseException]: ... + def set_exception(self, exception: Optional[BaseException]) -> None: ... + else: + def exception(self, timeout: Optional[float] = ...) -> Any: ... + def exception_info(self, timeout: Optional[float] = ...) -> Tuple[Any, Optional[TracebackType]]: ... + def set_exception(self, exception: Any) -> None: ... + def set_exception_info(self, exception: Any, traceback: Optional[TracebackType]) -> None: ... + + +class Executor: + def submit(self, fn: Callable[..., _T], *args: Any, **kwargs: Any) -> Future[_T]: ... + if sys.version_info >= (3, 5): + def map(self, func: Callable[..., _T], *iterables: Iterable[Any], timeout: Optional[float] = ..., + chunksize: int = ...) -> Iterator[_T]: ... + else: + def map(self, func: Callable[..., _T], *iterables: Iterable[Any], timeout: Optional[float] = ...,) -> Iterator[_T]: ... + def shutdown(self, wait: bool = ...) -> None: ... + def __enter__(self: _T) -> _T: ... + def __exit__(self, exc_type: Any, exc_val: Any, exc_tb: Any) -> bool: ... + +def as_completed(fs: Iterable[Future[_T]], timeout: Optional[float] = ...) -> Iterator[Future[_T]]: ... + +def wait(fs: Iterable[Future[_T]], timeout: Optional[float] = ..., return_when: str = ...) -> Tuple[Set[Future[_T]], + Set[Future[_T]]]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/concurrent/futures/process.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/concurrent/futures/process.pyi new file mode 100644 index 0000000..ba0cd61 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/concurrent/futures/process.pyi @@ -0,0 +1,17 @@ +from typing import Any, Callable, Optional, Tuple +from ._base import Future, Executor +import sys + +EXTRA_QUEUED_CALLS: Any + +if sys.version_info >= (3,): + class BrokenProcessPool(RuntimeError): ... + +if sys.version_info >= (3, 7): + class ProcessPoolExecutor(Executor): + def __init__(self, max_workers: Optional[int] = ..., + initializer: Optional[Callable[..., None]] = ..., + initargs: Tuple[Any, ...] = ...) -> None: ... +else: + class ProcessPoolExecutor(Executor): + def __init__(self, max_workers: Optional[int] = ...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/concurrent/futures/thread.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/concurrent/futures/thread.pyi new file mode 100644 index 0000000..983594d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/concurrent/futures/thread.pyi @@ -0,0 +1,15 @@ +from typing import Any, Callable, Optional, Tuple +from ._base import Executor, Future +import sys + +class ThreadPoolExecutor(Executor): + if sys.version_info >= (3, 7): + def __init__(self, max_workers: Optional[int] = ..., + thread_name_prefix: str = ..., + initializer: Optional[Callable[..., None]] = ..., + initargs: Tuple[Any, ...] = ...) -> None: ... + elif sys.version_info >= (3, 6) or sys.version_info < (3,): + def __init__(self, max_workers: Optional[int] = ..., + thread_name_prefix: str = ...) -> None: ... + else: + def __init__(self, max_workers: Optional[int] = ...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/cryptography/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/cryptography/__init__.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/cryptography/hazmat/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/cryptography/hazmat/__init__.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/cryptography/hazmat/primitives/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/cryptography/hazmat/primitives/__init__.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/cryptography/hazmat/primitives/asymmetric/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/cryptography/hazmat/primitives/asymmetric/__init__.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/cryptography/hazmat/primitives/asymmetric/dsa.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/cryptography/hazmat/primitives/asymmetric/dsa.pyi new file mode 100644 index 0000000..cfb0c73 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/cryptography/hazmat/primitives/asymmetric/dsa.pyi @@ -0,0 +1,4 @@ +# Minimal stub expressing only the classes required by OpenSSL.crypto. + +class DSAPrivateKey: ... +class DSAPublicKey: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/cryptography/hazmat/primitives/asymmetric/rsa.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/cryptography/hazmat/primitives/asymmetric/rsa.pyi new file mode 100644 index 0000000..006e822 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/cryptography/hazmat/primitives/asymmetric/rsa.pyi @@ -0,0 +1,58 @@ +from cryptography.hazmat.primitives.serialization import Encoding, KeySerializationEncryption, PrivateFormat, PublicFormat +from typing import Tuple + +class RSAPrivateKey: + def signer(self, padding, algorithm): ... + def decrypt(self, ciphertext: bytes, padding) -> bytes: ... + def public_key(self) -> RSAPublicKey: ... + @property + def key_size(self) -> int: ... + def sign(self, data: bytes, padding, algorithm) -> bytes: ... + +class RSAPrivateKeyWithSerialization(RSAPrivateKey): + def private_numbers(self) -> RSAPrivateNumbers: ... + def private_bytes(self, encoding: Encoding, format: PrivateFormat, + encryption_algorithm: KeySerializationEncryption) -> bytes: ... + +class RSAPublicKey: + def verifier(self, signature: bytes, padding, algorithm): ... + def encrypt(self, plaintext: bytes, padding) -> bytes: ... + @property + def key_size(self) -> int: ... + def public_numbers(self) -> RSAPublicNumbers: ... + def public_bytes(self, encoding: Encoding, format: PublicFormat) -> bytes: ... + def verify(self, signature: bytes, data: bytes, padding, algorithm) -> None: ... + +RSAPublicKeyWithSerialization = RSAPublicKey + +def generate_private_key(public_exponent: int, key_size: int, backend) -> RSAPrivateKey: ... +def rsa_crt_iqmp(p: int, q: int) -> int: ... +def rsa_crt_dmp1(private_exponent: int, p: int) -> int: ... +def rsa_crt_dmq1(private_exponent: int, q: int) -> int: ... +def rsa_recover_prime_factors(n: int, e: int, d: int) -> Tuple[int, int]: ... + +class RSAPrivateNumbers: + def __init__(self, p: int, q: int, d: int, dmp1: int, dmq1: int, iqmp: int, public_numbers: RSAPublicNumbers) -> None: ... + @property + def p(self) -> int: ... + @property + def q(self) -> int: ... + @property + def d(self) -> int: ... + @property + def dmp1(self) -> int: ... + @property + def dmq1(self) -> int: ... + @property + def iqmp(self) -> int: ... + @property + def public_numbers(self) -> RSAPublicNumbers: ... + def private_key(self, backend) -> RSAPrivateKey: ... + +class RSAPublicNumbers: + def __init__(self, e: int, n: int) -> None: ... + @property + def p(self) -> int: ... + @property + def q(self) -> int: ... + def public_key(self, backend) -> RSAPublicKey: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/cryptography/hazmat/primitives/serialization.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/cryptography/hazmat/primitives/serialization.pyi new file mode 100644 index 0000000..bec4e89 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/cryptography/hazmat/primitives/serialization.pyi @@ -0,0 +1,33 @@ +from typing import Any, Optional +from enum import Enum + +def load_pem_private_key(data: bytes, password: Optional[bytes], backend): ... +def load_pem_public_key(data: bytes, backend): ... +def load_der_private_key(data: bytes, password: Optional[bytes], backend): ... +def load_der_public_key(data: bytes, backend): ... +def load_ssh_public_key(data: bytes, backend): ... + +class Encoding(Enum): + PEM: str + DER: str + OpenSSH: str + +class PrivateFormat(Enum): + PKCS8: str + TraditionalOpenSSL: str + +class PublicFormat(Enum): + SubjectPublicKeyInfo: str + PKCS1: str + OpenSSH: str + +class ParameterFormat(Enum): + PKCS3: str + +class KeySerializationEncryption: ... + +class BestAvailableEncryption(KeySerializationEncryption): + password: Any + def __init__(self, password) -> None: ... + +class NoEncryption(KeySerializationEncryption): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/enum.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/enum.pyi new file mode 100644 index 0000000..703c7cf --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/enum.pyi @@ -0,0 +1,77 @@ +# NB: third_party/2/enum.pyi and stdlib/3.4/enum.pyi must remain consistent! +import sys +from typing import Any, Dict, Iterator, List, Mapping, Type, TypeVar, Union +from abc import ABCMeta + +_T = TypeVar('_T') +_S = TypeVar('_S', bound=Type[Enum]) + +# Note: EnumMeta actually subclasses type directly, not ABCMeta. +# This is a temporary workaround to allow multiple creation of enums with builtins +# such as str as mixins, which due to the handling of ABCs of builtin types, cause +# spurious inconsistent metaclass structure. See #1595. +# Structurally: Iterable[T], Reversible[T], Container[T] where T is the enum itself +class EnumMeta(ABCMeta): + def __iter__(self: Type[_T]) -> Iterator[_T]: ... + def __reversed__(self: Type[_T]) -> Iterator[_T]: ... + def __contains__(self: Type[_T], member: object) -> bool: ... + def __getitem__(self: Type[_T], name: str) -> _T: ... + @property + def __members__(self: Type[_T]) -> Mapping[str, _T]: ... + def __len__(self) -> int: ... + +class Enum(metaclass=EnumMeta): + name: str + value: Any + _name_: str + _value_: Any + _member_names_: List[str] # undocumented + _member_map_: Dict[str, Enum] # undocumented + _value2member_map_: Dict[int, Enum] # undocumented + if sys.version_info >= (3, 7): + _ignore_: Union[str, List[str]] + if sys.version_info >= (3, 6): + _order_: str + @classmethod + def _missing_(cls, value: object) -> Any: ... + @staticmethod + def _generate_next_value_(name: str, start: int, count: int, last_values: List[Any]) -> Any: ... + def __new__(cls: Type[_T], value: object) -> _T: ... + def __repr__(self) -> str: ... + def __str__(self) -> str: ... + def __dir__(self) -> List[str]: ... + def __format__(self, format_spec: str) -> str: ... + def __hash__(self) -> Any: ... + def __reduce_ex__(self, proto: object) -> Any: ... + +class IntEnum(int, Enum): + value: int + +def unique(enumeration: _S) -> _S: ... + +if sys.version_info >= (3, 6): + _auto_null: Any + + # subclassing IntFlag so it picks up all implemented base functions, best modeling behavior of enum.auto() + class auto(IntFlag): + value: Any + + class Flag(Enum): + def __contains__(self: _T, other: _T) -> bool: ... + def __repr__(self) -> str: ... + def __str__(self) -> str: ... + def __bool__(self) -> bool: ... + def __or__(self: _T, other: _T) -> _T: ... + def __and__(self: _T, other: _T) -> _T: ... + def __xor__(self: _T, other: _T) -> _T: ... + def __invert__(self: _T) -> _T: ... + + # The `type: ignore` comment is needed because mypy considers the type + # signatures of several methods defined in int and Flag to be incompatible. + class IntFlag(int, Flag): # type: ignore + def __or__(self: _T, other: Union[int, _T]) -> _T: ... + def __and__(self: _T, other: Union[int, _T]) -> _T: ... + def __xor__(self: _T, other: Union[int, _T]) -> _T: ... + __ror__ = __or__ + __rand__ = __and__ + __rxor__ = __xor__ diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/fb303/FacebookService.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/fb303/FacebookService.pyi new file mode 100644 index 0000000..ead5d24 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/fb303/FacebookService.pyi @@ -0,0 +1,297 @@ +from typing import Any +from thrift.Thrift import TProcessor # type: ignore + +fastbinary: Any + +class Iface: + def getName(self): ... + def getVersion(self): ... + def getStatus(self): ... + def getStatusDetails(self): ... + def getCounters(self): ... + def getCounter(self, key): ... + def setOption(self, key, value): ... + def getOption(self, key): ... + def getOptions(self): ... + def getCpuProfile(self, profileDurationInSec): ... + def aliveSince(self): ... + def reinitialize(self): ... + def shutdown(self): ... + +class Client(Iface): + def __init__(self, iprot, oprot=...) -> None: ... + def getName(self): ... + def send_getName(self): ... + def recv_getName(self): ... + def getVersion(self): ... + def send_getVersion(self): ... + def recv_getVersion(self): ... + def getStatus(self): ... + def send_getStatus(self): ... + def recv_getStatus(self): ... + def getStatusDetails(self): ... + def send_getStatusDetails(self): ... + def recv_getStatusDetails(self): ... + def getCounters(self): ... + def send_getCounters(self): ... + def recv_getCounters(self): ... + def getCounter(self, key): ... + def send_getCounter(self, key): ... + def recv_getCounter(self): ... + def setOption(self, key, value): ... + def send_setOption(self, key, value): ... + def recv_setOption(self): ... + def getOption(self, key): ... + def send_getOption(self, key): ... + def recv_getOption(self): ... + def getOptions(self): ... + def send_getOptions(self): ... + def recv_getOptions(self): ... + def getCpuProfile(self, profileDurationInSec): ... + def send_getCpuProfile(self, profileDurationInSec): ... + def recv_getCpuProfile(self): ... + def aliveSince(self): ... + def send_aliveSince(self): ... + def recv_aliveSince(self): ... + def reinitialize(self): ... + def send_reinitialize(self): ... + def shutdown(self): ... + def send_shutdown(self): ... + +class Processor(Iface, TProcessor): + def __init__(self, handler) -> None: ... + def process(self, iprot, oprot): ... + def process_getName(self, seqid, iprot, oprot): ... + def process_getVersion(self, seqid, iprot, oprot): ... + def process_getStatus(self, seqid, iprot, oprot): ... + def process_getStatusDetails(self, seqid, iprot, oprot): ... + def process_getCounters(self, seqid, iprot, oprot): ... + def process_getCounter(self, seqid, iprot, oprot): ... + def process_setOption(self, seqid, iprot, oprot): ... + def process_getOption(self, seqid, iprot, oprot): ... + def process_getOptions(self, seqid, iprot, oprot): ... + def process_getCpuProfile(self, seqid, iprot, oprot): ... + def process_aliveSince(self, seqid, iprot, oprot): ... + def process_reinitialize(self, seqid, iprot, oprot): ... + def process_shutdown(self, seqid, iprot, oprot): ... + +class getName_args: + thrift_spec: Any + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class getName_result: + thrift_spec: Any + success: Any + def __init__(self, success=...) -> None: ... + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class getVersion_args: + thrift_spec: Any + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class getVersion_result: + thrift_spec: Any + success: Any + def __init__(self, success=...) -> None: ... + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class getStatus_args: + thrift_spec: Any + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class getStatus_result: + thrift_spec: Any + success: Any + def __init__(self, success=...) -> None: ... + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class getStatusDetails_args: + thrift_spec: Any + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class getStatusDetails_result: + thrift_spec: Any + success: Any + def __init__(self, success=...) -> None: ... + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class getCounters_args: + thrift_spec: Any + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class getCounters_result: + thrift_spec: Any + success: Any + def __init__(self, success=...) -> None: ... + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class getCounter_args: + thrift_spec: Any + key: Any + def __init__(self, key=...) -> None: ... + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class getCounter_result: + thrift_spec: Any + success: Any + def __init__(self, success=...) -> None: ... + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class setOption_args: + thrift_spec: Any + key: Any + value: Any + def __init__(self, key=..., value=...) -> None: ... + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class setOption_result: + thrift_spec: Any + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class getOption_args: + thrift_spec: Any + key: Any + def __init__(self, key=...) -> None: ... + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class getOption_result: + thrift_spec: Any + success: Any + def __init__(self, success=...) -> None: ... + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class getOptions_args: + thrift_spec: Any + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class getOptions_result: + thrift_spec: Any + success: Any + def __init__(self, success=...) -> None: ... + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class getCpuProfile_args: + thrift_spec: Any + profileDurationInSec: Any + def __init__(self, profileDurationInSec=...) -> None: ... + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class getCpuProfile_result: + thrift_spec: Any + success: Any + def __init__(self, success=...) -> None: ... + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class aliveSince_args: + thrift_spec: Any + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class aliveSince_result: + thrift_spec: Any + success: Any + def __init__(self, success=...) -> None: ... + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class reinitialize_args: + thrift_spec: Any + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class shutdown_args: + thrift_spec: Any + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/fb303/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/fb303/__init__.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/gflags.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/gflags.pyi new file mode 100644 index 0000000..87edd4e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/gflags.pyi @@ -0,0 +1,242 @@ +from typing import Any, Callable, Dict, Iterable, IO, List, Optional, Sequence, Union +from types import ModuleType + +class Error(Exception): ... +FlagsError = Error + +class DuplicateFlag(FlagsError): ... + +class CantOpenFlagFileError(FlagsError): ... + +class DuplicateFlagCannotPropagateNoneToSwig(DuplicateFlag): ... + +class DuplicateFlagError(DuplicateFlag): + def __init__(self, flagname: str, flag_values: FlagValues, other_flag_values: FlagValues = ...) -> None: ... + +class IllegalFlagValueError(FlagsError): ... +IllegalFlagValue = IllegalFlagValueError + +class UnrecognizedFlag(FlagsError): ... + +class UnrecognizedFlagError(UnrecognizedFlag): + def __init__(self, flagname: str, flagvalue: str = ...) -> None: ... + +def get_help_width() -> int: ... +GetHelpWidth = get_help_width +def CutCommonSpacePrefix(text) -> str: ... +def text_wrap(text: str, length: int = ..., indent: str = ..., firstline_indent: str = ..., tabs: str = ...) -> str: ... +TextWrap = text_wrap +def doc_to_help(doc: str) -> str: ... +DocToHelp = doc_to_help + +class FlagValues: + def __init__(self) -> None: ... + def UseGnuGetOpt(self, use_gnu_getopt: bool = ...) -> None: ... + def is_gnu_getopt(self) -> bool: ... + IsGnuGetOpt = is_gnu_getopt + # TODO dict type + def FlagDict(self) -> dict: ... + def flags_by_module_dict(self) -> Dict[str, List[Flag]]: ... + FlagsByModuleDict = flags_by_module_dict + def flags_by_module_id_dict(self) -> Dict[int, List[Flag]]: ... + FlagsByModuleIdDict = flags_by_module_id_dict + def key_flags_by_module_dict(self) -> Dict[str, List[Flag]]: ... + KeyFlagsByModuleDict = key_flags_by_module_dict + def find_module_defining_flag(self, flagname: str, default: str = ...) -> str: ... + FindModuleDefiningFlag = find_module_defining_flag + def find_module_id_defining_flag(self, flagname: str, default: int = ...) -> int: ... + FindModuleIdDefiningFlag = find_module_id_defining_flag + def append_flag_values(self, flag_values: FlagValues) -> None: ... + AppendFlagValues = append_flag_values + def remove_flag_values(self, flag_values: FlagValues) -> None: ... + RemoveFlagValues = remove_flag_values + def __setitem__(self, name: str, flag: Flag) -> None: ... + def __getitem__(self, name: str) -> Flag: ... + def __getattr__(self, name: str) -> Any: ... + def __setattr__(self, name: str, value: Any): ... + def __delattr__(self, flag_name: str) -> None: ... + def set_default(self, name: str, value: Any) -> None: ... + SetDefault = set_default + def __contains__(self, name: str) -> bool: ... + has_key = __contains__ + def __iter__(self) -> Iterable[str]: ... + def __call__(self, argv: List[str], known_only: bool = ...) -> List[str]: ... + def reset(self) -> None: ... + Reset = reset + def RegisteredFlags(self) -> List[str]: ... + def flag_values_dict(self) -> Dict[str, Any]: ... + FlagValuesDict = flag_values_dict + def __str__(self) -> str: ... + def GetHelp(self, prefix: str = ...) -> str: ... + def module_help(self, module: Union[ModuleType, str]) -> str: ... + ModuleHelp = module_help + def main_module_help(self) -> str: ... + MainModuleHelp = main_module_help + def get(self, name: str, default: Any) -> Any: ... + def ShortestUniquePrefixes(self, fl: Dict[str, Flag]) -> Dict[str, str]: ... + def ExtractFilename(self, flagfile_str: str) -> str: ... + def read_flags_from_files(self, argv: List[str], force_gnu: bool = ...) -> List[str]: ... + ReadFlagsFromFiles = read_flags_from_files + def flags_into_string(self) -> str: ... + FlagsIntoString = flags_into_string + def append_flags_into_file(self, filename: str) -> None: ... + AppendFlagsIntoFile = append_flags_into_file + def write_help_in_xml_format(self, outfile: IO[str] = ...) -> None: ... + WriteHelpInXMLFormat = write_help_in_xml_format + # TODO validator: gflags_validators.Validator + def AddValidator(self, validator: Any) -> None: ... + +FLAGS: FlagValues + +class Flag: + name: str + default: Any + default_as_str: str + value: Any + help: str + short_name: str + boolean = False + present = False + parser: ArgumentParser + serializer: ArgumentSerializer + allow_override = False + + def __init__(self, parser: ArgumentParser, serializer: ArgumentSerializer, name: str, + default: Optional[str], help_string: str, short_name: str = ..., boolean: bool = ..., + allow_override: bool = ...) -> None: ... + def Parse(self, argument: Any) -> Any: ... + def Unparse(self) -> None: ... + def Serialize(self) -> str: ... + def SetDefault(self, value: Any) -> None: ... + def Type(self) -> str: ... + def WriteInfoInXMLFormat(self, outfile: IO[str], module_name: str, is_key: bool = ..., indent: str = ...) -> None: ... + +class ArgumentParser(object): + syntactic_help: str + # TODO what is this + def parse(self, argument: Any) -> Any: ... + Parser = parse + def flag_type(self) -> str: ... + Type = flag_type + def WriteCustomInfoInXMLFormat(self, outfile: IO[str], indent: str) -> None: ... + +class ArgumentSerializer: + def Serialize(self, value: Any) -> unicode: ... + +class ListSerializer(ArgumentSerializer): + def __init__(self, list_sep: str) -> None: ... + def Serialize(self, value: List[Any]) -> str: ... + +def register_validator(flag_name: str, + checker: Callable[[Any], bool], + message: str = ..., + flag_values: FlagValues = ...) -> None: ... +RegisterValidator = register_validator +def mark_flag_as_required(flag_name: str, flag_values: FlagValues = ...) -> None: ... +MarkFlagAsRequired = mark_flag_as_required + +def DEFINE(parser: ArgumentParser, name: str, default: Any, help: str, + flag_values: FlagValues = ..., serializer: ArgumentSerializer = ..., **args: Any) -> None: ... +def DEFINE_flag(flag: Flag, flag_values: FlagValues = ...) -> None: ... +def declare_key_flag(flag_name: str, flag_values: FlagValues = ...) -> None: ... +DECLARE_key_flag = declare_key_flag +def adopt_module_key_flags(module: ModuleType, flag_values: FlagValues = ...) -> None: ... +ADOPT_module_key_flags = adopt_module_key_flags +def DEFINE_string(name: str, default: Optional[str], help: str, flag_values: FlagValues = ..., **args: Any): ... + +class BooleanParser(ArgumentParser): + def Convert(self, argument: Any) -> bool: ... + def Parse(self, argument: Any) -> bool: ... + +class BooleanFlag(Flag): + def __init__(self, name: str, default: Optional[bool], help: str, short_name=..., **args: Any) -> None: ... + +def DEFINE_boolean(name: str, default: Optional[bool], help: str, flag_values: FlagValues = ..., **args: Any) -> None: ... + +DEFINE_bool = DEFINE_boolean + +class HelpFlag(BooleanFlag): + def __init__(self) -> None: ... + def Parse(self, arg: Any) -> None: ... + +class HelpXMLFlag(BooleanFlag): + def __init__(self) -> None: ... + def Parse(self, arg: Any) -> None: ... + +class HelpshortFlag(BooleanFlag): + def __init__(self) -> None: ... + def Parse(self, arg: Any) -> None: ... + +class NumericParser(ArgumentParser): + def IsOutsideBounds(self, val: float) -> bool: ... + def Parse(self, argument: Any) -> float: ... + def WriteCustomInfoInXMLFormat(self, outfile: IO[str], indent: str) -> None: ... + def Convert(self, argument: Any) -> Any: ... + +class FloatParser(NumericParser): + number_article: str + number_name: str + syntactic_help: str + def __init__(self, lower_bound: float = ..., upper_bound: float = ...) -> None: ... + def Convert(self, argument: Any) -> float: ... + +def DEFINE_float(name: str, default: Optional[float], help: str, lower_bound: float = ..., + upper_bound: float = ..., flag_values: FlagValues = ..., **args: Any) -> None: ... + +class IntegerParser(NumericParser): + number_article: str + number_name: str + syntactic_help: str + def __init__(self, lower_bound: int = ..., upper_bound: int = ...) -> None: ... + def Convert(self, argument: Any) -> int: ... + +def DEFINE_integer(name: str, default: Optional[int], help: str, lower_bound: int = ..., + upper_bound: int = ..., flag_values: FlagValues = ..., **args: Any) -> None: ... + +class EnumParser(ArgumentParser): + def __init__(self, enum_values: List[str]) -> None: ... + def Parse(self, argument: Any) -> Any: ... + +class EnumFlag(Flag): + def __init__(self, name: str, default: Optional[str], help: str, enum_values: List[str], + short_name: str, **args: Any) -> None: ... + +def DEFINE_enum(name: str, default: Optional[str], enum_values: List[str], help: str, + flag_values: FlagValues = ..., **args: Any) -> None: ... + +class BaseListParser(ArgumentParser): + def __init__(self, token: str = ..., name: str = ...) -> None: ... + def Parse(self, argument: Any) -> list: ... + +class ListParser(BaseListParser): + def __init__(self) -> None: ... + def WriteCustomInfoInXMLFormat(self, outfile: IO[str], indent: str): ... + +class WhitespaceSeparatedListParser(BaseListParser): + def __init__(self) -> None: ... + def WriteCustomInfoInXMLFormat(self, outfile: IO[str], indent: str): ... + +def DEFINE_list(name: str, default: Optional[List[str]], help: str, flag_values: FlagValues = ..., **args: Any) -> None: ... +def DEFINE_spaceseplist(name: str, default: Optional[List[str]], help: str, flag_values: FlagValues = ..., + **args: Any) -> None: ... + +class MultiFlag(Flag): + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + def Parse(self, arguments: Any) -> None: ... + def Serialize(self) -> str: ... + +def DEFINE_multi_string(name: str, default: Optional[Union[str, List[str]]], help: str, + flag_values: FlagValues = ..., **args: Any) -> None: ... +DEFINE_multistring = DEFINE_multi_string + +def DEFINE_multi_integer(name: str, default: Optional[Union[int, List[int]]], help: str, lower_bound: int = ..., + upper_bound: int = ..., flag_values: FlagValues = ..., **args: Any) -> None: ... +DEFINE_multi_int = DEFINE_multi_integer + +def DEFINE_multi_float(name: str, default: Optional[Union[float, List[float]]], help: str, + lower_bound: float = ..., upper_bound: float = ..., + flag_values: FlagValues = ..., **args: Any) -> None: ... + +def DEFINE_multi_enum(name: str, default: Optional[Union[Sequence[str], str]], + enum_values: Sequence[str], help: str, + flag_values: FlagValues = ..., case_sensitive: bool = ..., **args: Any): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/kazoo/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/kazoo/__init__.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/kazoo/client.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/kazoo/client.pyi new file mode 100644 index 0000000..0d3fc00 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/kazoo/client.pyi @@ -0,0 +1,97 @@ +from typing import Any + +string_types: Any +bytes_types: Any +LOST_STATES: Any +ENVI_VERSION: Any +ENVI_VERSION_KEY: Any +log: Any + +class KazooClient: + logger: Any + handler: Any + auth_data: Any + default_acl: Any + randomize_hosts: Any + hosts: Any + chroot: Any + state: Any + state_listeners: Any + read_only: Any + retry: Any + Barrier: Any + Counter: Any + DoubleBarrier: Any + ChildrenWatch: Any + DataWatch: Any + Election: Any + NonBlockingLease: Any + MultiNonBlockingLease: Any + Lock: Any + Party: Any + Queue: Any + LockingQueue: Any + SetPartitioner: Any + Semaphore: Any + ShallowParty: Any + def __init__(self, hosts=..., timeout=..., client_id=..., handler=..., default_acl=..., auth_data=..., read_only=..., + randomize_hosts=..., connection_retry=..., command_retry=..., logger=..., **kwargs) -> None: ... + @property + def client_state(self): ... + @property + def client_id(self): ... + @property + def connected(self): ... + def set_hosts(self, hosts, randomize_hosts=...): ... + def add_listener(self, listener): ... + def remove_listener(self, listener): ... + def start(self, timeout=...): ... + def start_async(self): ... + def stop(self): ... + def restart(self): ... + def close(self): ... + def command(self, cmd=...): ... + def server_version(self, retries=...): ... + def add_auth(self, scheme, credential): ... + def add_auth_async(self, scheme, credential): ... + def unchroot(self, path): ... + def sync_async(self, path): ... + def sync(self, path): ... + def create(self, path, value=..., acl=..., ephemeral=..., sequence=..., makepath=...): ... + def create_async(self, path, value=..., acl=..., ephemeral=..., sequence=..., makepath=...): ... + def ensure_path(self, path, acl=...): ... + def ensure_path_async(self, path, acl=...): ... + def exists(self, path, watch=...): ... + def exists_async(self, path, watch=...): ... + def get(self, path, watch=...): ... + def get_async(self, path, watch=...): ... + def get_children(self, path, watch=..., include_data=...): ... + def get_children_async(self, path, watch=..., include_data=...): ... + def get_acls(self, path): ... + def get_acls_async(self, path): ... + def set_acls(self, path, acls, version=...): ... + def set_acls_async(self, path, acls, version=...): ... + def set(self, path, value, version=...): ... + def set_async(self, path, value, version=...): ... + def transaction(self): ... + def delete(self, path, version=..., recursive=...): ... + def delete_async(self, path, version=...): ... + def reconfig(self, joining, leaving, new_members, from_config=...): ... + def reconfig_async(self, joining, leaving, new_members, from_config): ... + +class TransactionRequest: + client: Any + operations: Any + committed: Any + def __init__(self, client) -> None: ... + def create(self, path, value=..., acl=..., ephemeral=..., sequence=...): ... + def delete(self, path, version=...): ... + def set_data(self, path, value, version=...): ... + def check(self, path, version): ... + def commit_async(self): ... + def commit(self): ... + def __enter__(self): ... + def __exit__(self, exc_type, exc_value, exc_tb): ... + +class KazooState: + ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/kazoo/exceptions.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/kazoo/exceptions.pyi new file mode 100644 index 0000000..4dd76cc --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/kazoo/exceptions.pyi @@ -0,0 +1,58 @@ +from typing import Any + +class KazooException(Exception): ... +class ZookeeperError(KazooException): ... +class CancelledError(KazooException): ... +class ConfigurationError(KazooException): ... +class ZookeeperStoppedError(KazooException): ... +class ConnectionDropped(KazooException): ... +class LockTimeout(KazooException): ... +class WriterNotClosedException(KazooException): ... + +EXCEPTIONS: Any + +class RolledBackError(ZookeeperError): ... +class SystemZookeeperError(ZookeeperError): ... +class RuntimeInconsistency(ZookeeperError): ... +class DataInconsistency(ZookeeperError): ... +class ConnectionLoss(ZookeeperError): ... +class MarshallingError(ZookeeperError): ... +class UnimplementedError(ZookeeperError): ... +class OperationTimeoutError(ZookeeperError): ... +class BadArgumentsError(ZookeeperError): ... +class NewConfigNoQuorumError(ZookeeperError): ... +class ReconfigInProcessError(ZookeeperError): ... +class APIError(ZookeeperError): ... +class NoNodeError(ZookeeperError): ... +class NoAuthError(ZookeeperError): ... +class BadVersionError(ZookeeperError): ... +class NoChildrenForEphemeralsError(ZookeeperError): ... +class NodeExistsError(ZookeeperError): ... +class NotEmptyError(ZookeeperError): ... +class SessionExpiredError(ZookeeperError): ... +class InvalidCallbackError(ZookeeperError): ... +class InvalidACLError(ZookeeperError): ... +class AuthFailedError(ZookeeperError): ... +class SessionMovedError(ZookeeperError): ... +class NotReadOnlyCallError(ZookeeperError): ... +class ConnectionClosedError(SessionExpiredError): ... + +ConnectionLossException: Any +MarshallingErrorException: Any +SystemErrorException: Any +RuntimeInconsistencyException: Any +DataInconsistencyException: Any +UnimplementedException: Any +OperationTimeoutException: Any +BadArgumentsException: Any +ApiErrorException: Any +NoNodeException: Any +NoAuthException: Any +BadVersionException: Any +NoChildrenForEphemeralsException: Any +NodeExistsException: Any +InvalidACLException: Any +AuthFailedException: Any +NotEmptyException: Any +SessionExpiredException: Any +InvalidCallbackException: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/kazoo/recipe/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/kazoo/recipe/__init__.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/kazoo/recipe/watchers.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/kazoo/recipe/watchers.pyi new file mode 100644 index 0000000..111a48c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/kazoo/recipe/watchers.pyi @@ -0,0 +1,21 @@ +from typing import Any + +log: Any + +class DataWatch: + def __init__(self, client, path, func=..., *args, **kwargs) -> None: ... + def __call__(self, func): ... + +class ChildrenWatch: + def __init__(self, client, path, func=..., allow_session_lost=..., send_event=...) -> None: ... + def __call__(self, func): ... + +class PatientChildrenWatch: + client: Any + path: Any + children: Any + time_boundary: Any + children_changed: Any + def __init__(self, client, path, time_boundary=...) -> None: ... + asy: Any + def start(self): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/pathlib2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/pathlib2.pyi new file mode 100644 index 0000000..42968fa --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/pathlib2.pyi @@ -0,0 +1,122 @@ +from typing import Any, Generator, IO, Optional, Sequence, Tuple, Type, TypeVar, Union, List +from types import TracebackType +import os +import sys + +_P = TypeVar('_P', bound='PurePath') + +if sys.version_info >= (3, 6): + _PurePathBase = os.PathLike[str] +else: + _PurePathBase = object + +class PurePath(_PurePathBase): + parts: Tuple[str, ...] + drive: str + root: str + anchor: str + name: str + suffix: str + suffixes: List[str] + stem: str + if sys.version_info < (3, 5): + def __init__(self, *pathsegments: str) -> None: ... + elif sys.version_info < (3, 6): + def __new__(cls: Type[_P], *args: Union[str, PurePath]) -> _P: ... + else: + def __new__(cls: Type[_P], *args: Union[str, os.PathLike[str]]) -> _P: ... + def __hash__(self) -> int: ... + def __lt__(self, other: PurePath) -> bool: ... + def __le__(self, other: PurePath) -> bool: ... + def __gt__(self, other: PurePath) -> bool: ... + def __ge__(self, other: PurePath) -> bool: ... + def __truediv__(self: _P, key: Union[str, PurePath]) -> _P: ... + if sys.version_info < (3,): + def __div__(self: _P, key: Union[str, PurePath]) -> _P: ... + def __bytes__(self) -> bytes: ... + def as_posix(self) -> str: ... + def as_uri(self) -> str: ... + def is_absolute(self) -> bool: ... + def is_reserved(self) -> bool: ... + def match(self, path_pattern: str) -> bool: ... + def relative_to(self: _P, *other: Union[str, PurePath]) -> _P: ... + def with_name(self: _P, name: str) -> _P: ... + def with_suffix(self: _P, suffix: str) -> _P: ... + def joinpath(self: _P, *other: Union[str, PurePath]) -> _P: ... + + @property + def parents(self: _P) -> Sequence[_P]: ... + @property + def parent(self: _P) -> _P: ... + +class PurePosixPath(PurePath): ... +class PureWindowsPath(PurePath): ... + +class Path(PurePath): + def __enter__(self) -> Path: ... + def __exit__(self, exc_type: Optional[Type[BaseException]], + exc_value: Optional[BaseException], + traceback: Optional[TracebackType]) -> Optional[bool]: ... + @classmethod + def cwd(cls: Type[_P]) -> _P: ... + def stat(self) -> os.stat_result: ... + def chmod(self, mode: int) -> None: ... + def exists(self) -> bool: ... + def glob(self, pattern: str) -> Generator[Path, None, None]: ... + def group(self) -> str: ... + def is_dir(self) -> bool: ... + def is_file(self) -> bool: ... + def is_symlink(self) -> bool: ... + def is_socket(self) -> bool: ... + def is_fifo(self) -> bool: ... + def is_block_device(self) -> bool: ... + def is_char_device(self) -> bool: ... + def iterdir(self) -> Generator[Path, None, None]: ... + def lchmod(self, mode: int) -> None: ... + def lstat(self) -> os.stat_result: ... + if sys.version_info < (3, 5): + def mkdir(self, mode: int = ..., + parents: bool = ...) -> None: ... + else: + def mkdir(self, mode: int = ..., parents: bool = ..., + exist_ok: bool = ...) -> None: ... + def open(self, mode: str = ..., buffering: int = ..., + encoding: Optional[str] = ..., errors: Optional[str] = ..., + newline: Optional[str] = ...) -> IO[Any]: ... + def owner(self) -> str: ... + def rename(self, target: Union[str, PurePath]) -> None: ... + def replace(self, target: Union[str, PurePath]) -> None: ... + if sys.version_info < (3, 6): + def resolve(self: _P) -> _P: ... + else: + def resolve(self: _P, strict: bool = ...) -> _P: ... + def rglob(self, pattern: str) -> Generator[Path, None, None]: ... + def rmdir(self) -> None: ... + def symlink_to(self, target: Union[str, Path], + target_is_directory: bool = ...) -> None: ... + def touch(self, mode: int = ..., exist_ok: bool = ...) -> None: ... + def unlink(self) -> None: ... + + if sys.version_info >= (3, 5): + @classmethod + def home(cls: Type[_P]) -> _P: ... + if sys.version_info < (3, 6): + def __new__(cls: Type[_P], *args: Union[str, PurePath], + **kwargs: Any) -> _P: ... + else: + def __new__(cls: Type[_P], *args: Union[str, os.PathLike[str]], + **kwargs: Any) -> _P: ... + + def absolute(self: _P) -> _P: ... + def expanduser(self: _P) -> _P: ... + def read_bytes(self) -> bytes: ... + def read_text(self, encoding: Optional[str] = ..., + errors: Optional[str] = ...) -> str: ... + def samefile(self, other_path: Union[str, bytes, int, Path]) -> bool: ... + def write_bytes(self, data: bytes) -> int: ... + def write_text(self, data: str, encoding: Optional[str] = ..., + errors: Optional[str] = ...) -> int: ... + + +class PosixPath(Path, PurePosixPath): ... +class WindowsPath(Path, PureWindowsPath): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/pymssql.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/pymssql.pyi new file mode 100644 index 0000000..8e08ee3 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/pymssql.pyi @@ -0,0 +1,48 @@ +from datetime import datetime, date, time + +from typing import Any, Dict, Tuple, Iterable, List, Optional, Union, Sequence + +Scalar = Union[int, float, str, datetime, date, time] +Result = Union[Tuple[Scalar, ...], Dict[str, Scalar]] + +class Connection(object): + def __init__(self, user, password, host, database, timeout, + login_timeout, charset, as_dict) -> None: ... + def autocommit(self, status: bool) -> None: ... + def close(self) -> None: ... + def commit(self) -> None: ... + def cursor(self) -> Cursor: ... + def rollback(self) -> None: ... + +class Cursor(object): + def __init__(self) -> None: ... + def __iter__(self): ... + def __next__(self) -> Any: ... + def callproc(self, procname: str, **kwargs) -> None: ... + def close(self) -> None: ... + def execute(self, stmt: str, + params: Optional[Union[Scalar, Tuple[Scalar, ...], + Dict[str, Scalar]]]) -> None: ... + def executemany(self, stmt: str, + params: Optional[Sequence[Tuple[Scalar, ...]]]) -> None: ... + def fetchall(self) -> List[Result]: ... + def fetchmany(self, size: Optional[int]) -> List[Result]: ... + def fetchone(self) -> Result: ... + +def connect(server: Optional[str], + user: Optional[str], + password: Optional[str], + database: Optional[str], + timeout: Optional[int], + login_timeout: Optional[int], + charset: Optional[str], + as_dict: Optional[bool], + host: Optional[str], + appname: Optional[str], + port: Optional[str], + + conn_properties: Optional[Union[str, Sequence[str]]], + autocommit: Optional[bool], + tds_version: Optional[str]) -> Connection: ... +def get_max_connections() -> int: ... +def set_max_connections(n: int) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/redis/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/redis/__init__.pyi new file mode 100644 index 0000000..333de49 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/redis/__init__.pyi @@ -0,0 +1,24 @@ +from . import client +from . import connection +from . import utils +from . import exceptions + +Redis = client.Redis +StrictRedis = client.StrictRedis +BlockingConnectionPool = connection.BlockingConnectionPool +ConnectionPool = connection.ConnectionPool +Connection = connection.Connection +SSLConnection = connection.SSLConnection +UnixDomainSocketConnection = connection.UnixDomainSocketConnection +from_url = utils.from_url +AuthenticationError = exceptions.AuthenticationError +BusyLoadingError = exceptions.BusyLoadingError +ConnectionError = exceptions.ConnectionError +DataError = exceptions.DataError +InvalidResponse = exceptions.InvalidResponse +PubSubError = exceptions.PubSubError +ReadOnlyError = exceptions.ReadOnlyError +RedisError = exceptions.RedisError +ResponseError = exceptions.ResponseError +TimeoutError = exceptions.TimeoutError +WatchError = exceptions.WatchError diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/redis/client.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/redis/client.pyi new file mode 100644 index 0000000..f416761 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/redis/client.pyi @@ -0,0 +1,292 @@ +from typing import Any + +SYM_EMPTY: Any + +def list_or_args(keys, args): ... +def timestamp_to_datetime(response): ... +def string_keys_to_dict(key_string, callback): ... +def dict_merge(*dicts): ... +def parse_debug_object(response): ... +def parse_object(response, infotype): ... +def parse_info(response): ... + +SENTINEL_STATE_TYPES: Any + +def parse_sentinel_state(item): ... +def parse_sentinel_master(response): ... +def parse_sentinel_masters(response): ... +def parse_sentinel_slaves_and_sentinels(response): ... +def parse_sentinel_get_master(response): ... +def pairs_to_dict(response): ... +def pairs_to_dict_typed(response, type_info): ... +def zset_score_pairs(response, **options): ... +def sort_return_tuples(response, **options): ... +def int_or_none(response): ... +def float_or_none(response): ... +def bool_ok(response): ... +def parse_client_list(response, **options): ... +def parse_config_get(response, **options): ... +def parse_scan(response, **options): ... +def parse_hscan(response, **options): ... +def parse_zscan(response, **options): ... +def parse_slowlog_get(response, **options): ... + +class StrictRedis: + RESPONSE_CALLBACKS: Any + @classmethod + def from_url(cls, url, db=..., **kwargs): ... + connection_pool: Any + response_callbacks: Any + def __init__(self, host=..., port=..., db=..., password=..., socket_timeout=..., socket_connect_timeout=..., + socket_keepalive=..., socket_keepalive_options=..., connection_pool=..., unix_socket_path=..., encoding=..., + encoding_errors=..., charset=..., errors=..., decode_responses=..., retry_on_timeout=..., ssl=..., + ssl_keyfile=..., ssl_certfile=..., ssl_cert_reqs=..., ssl_ca_certs=...) -> None: ... + def set_response_callback(self, command, callback): ... + def pipeline(self, transaction=..., shard_hint=...): ... + def transaction(self, func, *watches, **kwargs): ... + def lock(self, name, timeout=..., sleep=..., blocking_timeout=..., lock_class=..., thread_local=...): ... + def pubsub(self, **kwargs): ... + def execute_command(self, *args, **options): ... + def parse_response(self, connection, command_name, **options): ... + def bgrewriteaof(self): ... + def bgsave(self): ... + def client_kill(self, address): ... + def client_list(self): ... + def client_getname(self): ... + def client_setname(self, name): ... + def config_get(self, pattern=...): ... + def config_set(self, name, value): ... + def config_resetstat(self): ... + def config_rewrite(self): ... + def dbsize(self): ... + def debug_object(self, key): ... + def echo(self, value): ... + def flushall(self): ... + def flushdb(self): ... + def info(self, section=...): ... + def lastsave(self): ... + def object(self, infotype, key): ... + def ping(self): ... + def save(self): ... + def sentinel(self, *args): ... + def sentinel_get_master_addr_by_name(self, service_name): ... + def sentinel_master(self, service_name): ... + def sentinel_masters(self): ... + def sentinel_monitor(self, name, ip, port, quorum): ... + def sentinel_remove(self, name): ... + def sentinel_sentinels(self, service_name): ... + def sentinel_set(self, name, option, value): ... + def sentinel_slaves(self, service_name): ... + def shutdown(self): ... + def slaveof(self, host=..., port=...): ... + def slowlog_get(self, num=...): ... + def slowlog_len(self): ... + def slowlog_reset(self): ... + def time(self): ... + def append(self, key, value): ... + def bitcount(self, key, start=..., end=...): ... + def bitop(self, operation, dest, *keys): ... + def bitpos(self, key, bit, start=..., end=...): ... + def decr(self, name, amount=...): ... + def delete(self, *names): ... + def __delitem__(self, name): ... + def dump(self, name): ... + def exists(self, name): ... + __contains__: Any + def expire(self, name, time): ... + def expireat(self, name, when): ... + def get(self, name): ... + def __getitem__(self, name): ... + def getbit(self, name, offset): ... + def getrange(self, key, start, end): ... + def getset(self, name, value): ... + def incr(self, name, amount=...): ... + def incrby(self, name, amount=...): ... + def incrbyfloat(self, name, amount=...): ... + def keys(self, pattern=...): ... + def mget(self, keys, *args): ... + def mset(self, *args, **kwargs): ... + def msetnx(self, *args, **kwargs): ... + def move(self, name, db): ... + def persist(self, name): ... + def pexpire(self, name, time): ... + def pexpireat(self, name, when): ... + def psetex(self, name, time_ms, value): ... + def pttl(self, name): ... + def randomkey(self): ... + def rename(self, src, dst): ... + def renamenx(self, src, dst): ... + def restore(self, name, ttl, value): ... + def set(self, name, value, ex=..., px=..., nx=..., xx=...): ... + def __setitem__(self, name, value): ... + def setbit(self, name, offset, value): ... + def setex(self, name, time, value): ... + def setnx(self, name, value): ... + def setrange(self, name, offset, value): ... + def strlen(self, name): ... + def substr(self, name, start, end=...): ... + def ttl(self, name): ... + def type(self, name): ... + def watch(self, *names): ... + def unwatch(self): ... + def blpop(self, keys, timeout=...): ... + def brpop(self, keys, timeout=...): ... + def brpoplpush(self, src, dst, timeout=...): ... + def lindex(self, name, index): ... + def linsert(self, name, where, refvalue, value): ... + def llen(self, name): ... + def lpop(self, name): ... + def lpush(self, name, *values): ... + def lpushx(self, name, value): ... + def lrange(self, name, start, end): ... + def lrem(self, name, count, value): ... + def lset(self, name, index, value): ... + def ltrim(self, name, start, end): ... + def rpop(self, name): ... + def rpoplpush(self, src, dst): ... + def rpush(self, name, *values): ... + def rpushx(self, name, value): ... + def sort(self, name, start=..., num=..., by=..., get=..., desc=..., alpha=..., store=..., groups=...): ... + def scan(self, cursor=..., match=..., count=...): ... + def scan_iter(self, match=..., count=...): ... + def sscan(self, name, cursor=..., match=..., count=...): ... + def sscan_iter(self, name, match=..., count=...): ... + def hscan(self, name, cursor=..., match=..., count=...): ... + def hscan_iter(self, name, match=..., count=...): ... + def zscan(self, name, cursor=..., match=..., count=..., score_cast_func=...): ... + def zscan_iter(self, name, match=..., count=..., score_cast_func=...): ... + def sadd(self, name, *values): ... + def scard(self, name): ... + def sdiff(self, keys, *args): ... + def sdiffstore(self, dest, keys, *args): ... + def sinter(self, keys, *args): ... + def sinterstore(self, dest, keys, *args): ... + def sismember(self, name, value): ... + def smembers(self, name): ... + def smove(self, src, dst, value): ... + def spop(self, name): ... + def srandmember(self, name, number=...): ... + def srem(self, name, *values): ... + def sunion(self, keys, *args): ... + def sunionstore(self, dest, keys, *args): ... + def zadd(self, name, *args, **kwargs): ... + def zcard(self, name): ... + def zcount(self, name, min, max): ... + def zincrby(self, name, value, amount=...): ... + def zinterstore(self, dest, keys, aggregate=...): ... + def zlexcount(self, name, min, max): ... + def zrange(self, name, start, end, desc=..., withscores=..., score_cast_func=...): ... + def zrangebylex(self, name, min, max, start=..., num=...): ... + def zrangebyscore(self, name, min, max, start=..., num=..., withscores=..., score_cast_func=...): ... + def zrank(self, name, value): ... + def zrem(self, name, *values): ... + def zremrangebylex(self, name, min, max): ... + def zremrangebyrank(self, name, min, max): ... + def zremrangebyscore(self, name, min, max): ... + def zrevrange(self, name, start, end, withscores=..., score_cast_func=...): ... + def zrevrangebyscore(self, name, max, min, start=..., num=..., withscores=..., score_cast_func=...): ... + def zrevrank(self, name, value): ... + def zscore(self, name, value): ... + def zunionstore(self, dest, keys, aggregate=...): ... + def pfadd(self, name, *values): ... + def pfcount(self, name): ... + def pfmerge(self, dest, *sources): ... + def hdel(self, name, *keys): ... + def hexists(self, name, key): ... + def hget(self, name, key): ... + def hgetall(self, name): ... + def hincrby(self, name, key, amount=...): ... + def hincrbyfloat(self, name, key, amount=...): ... + def hkeys(self, name): ... + def hlen(self, name): ... + def hset(self, name, key, value): ... + def hsetnx(self, name, key, value): ... + def hmset(self, name, mapping): ... + def hmget(self, name, keys, *args): ... + def hvals(self, name): ... + def publish(self, channel, message): ... + def eval(self, script, numkeys, *keys_and_args): ... + def evalsha(self, sha, numkeys, *keys_and_args): ... + def script_exists(self, *args): ... + def script_flush(self): ... + def script_kill(self): ... + def script_load(self, script): ... + def register_script(self, script): ... + +class Redis(StrictRedis): + RESPONSE_CALLBACKS: Any + def pipeline(self, transaction=..., shard_hint=...): ... + def setex(self, name, value, time): ... + def lrem(self, name, value, num=...): ... + def zadd(self, name, *args, **kwargs): ... + +class PubSub: + PUBLISH_MESSAGE_TYPES: Any + UNSUBSCRIBE_MESSAGE_TYPES: Any + connection_pool: Any + shard_hint: Any + ignore_subscribe_messages: Any + connection: Any + encoding: Any + encoding_errors: Any + decode_responses: Any + def __init__(self, connection_pool, shard_hint=..., ignore_subscribe_messages=...) -> None: ... + def __del__(self): ... + channels: Any + patterns: Any + def reset(self): ... + def close(self): ... + def on_connect(self, connection): ... + def encode(self, value): ... + @property + def subscribed(self): ... + def execute_command(self, *args, **kwargs): ... + def parse_response(self, block=...): ... + def psubscribe(self, *args, **kwargs): ... + def punsubscribe(self, *args): ... + def subscribe(self, *args, **kwargs): ... + def unsubscribe(self, *args): ... + def listen(self): ... + def get_message(self, ignore_subscribe_messages=...): ... + def handle_message(self, response, ignore_subscribe_messages=...): ... + def run_in_thread(self, sleep_time=...): ... + +class BasePipeline: + UNWATCH_COMMANDS: Any + connection_pool: Any + connection: Any + response_callbacks: Any + transaction: Any + shard_hint: Any + watching: Any + def __init__(self, connection_pool, response_callbacks, transaction, shard_hint) -> None: ... + def __enter__(self): ... + def __exit__(self, exc_type, exc_value, traceback): ... + def __del__(self): ... + def __len__(self): ... + command_stack: Any + scripts: Any + explicit_transaction: Any + def reset(self): ... + def multi(self): ... + def execute_command(self, *args, **kwargs): ... + def immediate_execute_command(self, *args, **options): ... + def pipeline_execute_command(self, *args, **options): ... + def raise_first_error(self, commands, response): ... + def annotate_exception(self, exception, number, command): ... + def parse_response(self, connection, command_name, **options): ... + def load_scripts(self): ... + def execute(self, raise_on_error=...): ... + def watch(self, *names): ... + def unwatch(self): ... + def script_load_for_pipeline(self, script): ... + +class StrictPipeline(BasePipeline, StrictRedis): ... +class Pipeline(BasePipeline, Redis): ... + +class Script: + registered_client: Any + script: Any + sha: Any + def __init__(self, registered_client, script) -> None: ... + def __call__(self, keys=..., args=..., client=...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/redis/connection.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/redis/connection.pyi new file mode 100644 index 0000000..7b7ddef --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/redis/connection.pyi @@ -0,0 +1,134 @@ +from typing import Any + +ssl_available: Any +hiredis_version: Any +HIREDIS_SUPPORTS_CALLABLE_ERRORS: Any +HIREDIS_SUPPORTS_BYTE_BUFFER: Any +msg: Any +HIREDIS_USE_BYTE_BUFFER: Any +SYM_STAR: Any +SYM_DOLLAR: Any +SYM_CRLF: Any +SYM_EMPTY: Any +SERVER_CLOSED_CONNECTION_ERROR: Any + +class Token: + value: Any + def __init__(self, value) -> None: ... + +class BaseParser: + EXCEPTION_CLASSES: Any + def parse_error(self, response): ... + +class SocketBuffer: + socket_read_size: Any + bytes_written: Any + bytes_read: Any + def __init__(self, socket, socket_read_size) -> None: ... + @property + def length(self): ... + def read(self, length): ... + def readline(self): ... + def purge(self): ... + def close(self): ... + +class PythonParser(BaseParser): + encoding: Any + socket_read_size: Any + def __init__(self, socket_read_size) -> None: ... + def __del__(self): ... + def on_connect(self, connection): ... + def on_disconnect(self): ... + def can_read(self): ... + def read_response(self): ... + +class HiredisParser(BaseParser): + socket_read_size: Any + def __init__(self, socket_read_size) -> None: ... + def __del__(self): ... + def on_connect(self, connection): ... + def on_disconnect(self): ... + def can_read(self): ... + def read_response(self): ... + +DefaultParser: Any + +class Connection: + description_format: Any + pid: Any + host: Any + port: Any + db: Any + password: Any + socket_timeout: Any + socket_connect_timeout: Any + socket_keepalive: Any + socket_keepalive_options: Any + retry_on_timeout: Any + encoding: Any + encoding_errors: Any + decode_responses: Any + def __init__(self, host=..., port=..., db=..., password=..., socket_timeout=..., socket_connect_timeout=..., + socket_keepalive=..., socket_keepalive_options=..., retry_on_timeout=..., encoding=..., encoding_errors=..., + decode_responses=..., parser_class=..., socket_read_size=...) -> None: ... + def __del__(self): ... + def register_connect_callback(self, callback): ... + def clear_connect_callbacks(self): ... + def connect(self): ... + def on_connect(self): ... + def disconnect(self): ... + def send_packed_command(self, command): ... + def send_command(self, *args): ... + def can_read(self): ... + def read_response(self): ... + def encode(self, value): ... + def pack_command(self, *args): ... + def pack_commands(self, commands): ... + +class SSLConnection(Connection): + description_format: Any + keyfile: Any + certfile: Any + cert_reqs: Any + ca_certs: Any + def __init__(self, ssl_keyfile=..., ssl_certfile=..., ssl_cert_reqs=..., ssl_ca_certs=..., **kwargs) -> None: ... + +class UnixDomainSocketConnection(Connection): + description_format: Any + pid: Any + path: Any + db: Any + password: Any + socket_timeout: Any + retry_on_timeout: Any + encoding: Any + encoding_errors: Any + decode_responses: Any + def __init__(self, path=..., db=..., password=..., socket_timeout=..., encoding=..., encoding_errors=..., + decode_responses=..., retry_on_timeout=..., parser_class=..., socket_read_size=...) -> None: ... + +class ConnectionPool: + @classmethod + def from_url(cls, url, db=..., **kwargs): ... + connection_class: Any + connection_kwargs: Any + max_connections: Any + def __init__(self, connection_class=..., max_connections=..., **connection_kwargs) -> None: ... + pid: Any + def reset(self): ... + def get_connection(self, command_name, *keys, **options): ... + def make_connection(self): ... + def release(self, connection): ... + def disconnect(self): ... + +class BlockingConnectionPool(ConnectionPool): + queue_class: Any + timeout: Any + def __init__(self, max_connections=..., timeout=..., connection_class=..., queue_class=..., **connection_kwargs) -> None: ... + pid: Any + pool: Any + def reset(self): ... + def make_connection(self): ... + def get_connection(self, command_name, *keys, **options): ... + def release(self, connection): ... + def disconnect(self): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/redis/exceptions.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/redis/exceptions.pyi new file mode 100644 index 0000000..e0cd08a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/redis/exceptions.pyi @@ -0,0 +1,17 @@ +class RedisError(Exception): ... + +def __unicode__(self): ... + +class AuthenticationError(RedisError): ... +class ConnectionError(RedisError): ... +class TimeoutError(RedisError): ... +class BusyLoadingError(ConnectionError): ... +class InvalidResponse(RedisError): ... +class ResponseError(RedisError): ... +class DataError(RedisError): ... +class PubSubError(RedisError): ... +class WatchError(RedisError): ... +class NoScriptError(ResponseError): ... +class ExecAbortError(ResponseError): ... +class ReadOnlyError(ResponseError): ... +class LockError(RedisError, ValueError): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/redis/utils.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/redis/utils.pyi new file mode 100644 index 0000000..9559abb --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/redis/utils.pyi @@ -0,0 +1,8 @@ +from typing import Any + +HIREDIS_AVAILABLE: Any + +def from_url(url, db=..., **kwargs): ... +def pipeline(redis_obj): ... + +class dummy: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/routes/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/routes/__init__.pyi new file mode 100644 index 0000000..8a1261f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/routes/__init__.pyi @@ -0,0 +1,15 @@ +from . import mapper +from . import util + +class _RequestConfig: + def __getattr__(self, name): ... + def __setattr__(self, name, value): ... + def __delattr__(self, name): ... + def load_wsgi_environ(self, environ): ... + +def request_config(original=...): ... + +Mapper = mapper.Mapper +redirect_to = util.redirect_to +url_for = util.url_for +URLGenerator = util.URLGenerator diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/routes/mapper.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/routes/mapper.pyi new file mode 100644 index 0000000..f834d08 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/routes/mapper.pyi @@ -0,0 +1,67 @@ +from typing import Any + +COLLECTION_ACTIONS: Any +MEMBER_ACTIONS: Any + +def strip_slashes(name): ... + +class SubMapperParent: + def submapper(self, **kargs): ... + def collection(self, collection_name, resource_name, path_prefix=..., member_prefix=..., controller=..., + collection_actions=..., member_actions=..., member_options=..., **kwargs): ... + +class SubMapper(SubMapperParent): + kwargs: Any + obj: Any + collection_name: Any + member: Any + resource_name: Any + formatted: Any + def __init__(self, obj, resource_name=..., collection_name=..., actions=..., formatted=..., **kwargs) -> None: ... + def connect(self, *args, **kwargs): ... + def link(self, rel=..., name=..., action=..., method=..., formatted=..., **kwargs): ... + def new(self, **kwargs): ... + def edit(self, **kwargs): ... + def action(self, name=..., action=..., method=..., formatted=..., **kwargs): ... + def index(self, name=..., **kwargs): ... + def show(self, name=..., **kwargs): ... + def create(self, **kwargs): ... + def update(self, **kwargs): ... + def delete(self, **kwargs): ... + def add_actions(self, actions): ... + def __enter__(self): ... + def __exit__(self, type, value, tb): ... + +class Mapper(SubMapperParent): + matchlist: Any + maxkeys: Any + minkeys: Any + urlcache: Any + prefix: Any + req_data: Any + directory: Any + always_scan: Any + controller_scan: Any + debug: Any + append_slash: Any + sub_domains: Any + sub_domains_ignore: Any + domain_match: Any + explicit: Any + encoding: Any + decode_errors: Any + hardcode_names: Any + minimization: Any + create_regs_lock: Any + def __init__(self, controller_scan=..., directory=..., always_scan=..., register=..., explicit=...) -> None: ... + environ: Any + def extend(self, routes, path_prefix=...): ... + def make_route(self, *args, **kargs): ... + def connect(self, *args, **kargs): ... + def create_regs(self, *args, **kwargs): ... + def match(self, url=..., environ=...): ... + def routematch(self, url=..., environ=...): ... + obj: Any + def generate(self, *args, **kargs): ... + def resource(self, member_name, collection_name, **kwargs): ... + def redirect(self, match_path, destination_path, *args, **kwargs): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/routes/util.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/routes/util.pyi new file mode 100644 index 0000000..e3be1d4 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/routes/util.pyi @@ -0,0 +1,20 @@ +from typing import Any + +class RoutesException(Exception): ... +class MatchException(RoutesException): ... +class GenerationException(RoutesException): ... + +def url_for(*args, **kargs): ... + +class URLGenerator: + mapper: Any + environ: Any + def __init__(self, mapper, environ) -> None: ... + def __call__(self, *args, **kargs): ... + def current(self, *args, **kwargs): ... + +def redirect_to(*args, **kargs): ... +def cache_hostinfo(environ): ... +def controller_scan(directory=...): ... +def as_unicode(value, encoding, errors=...): ... +def ascii_characters(string): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/scribe/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/scribe/__init__.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/scribe/scribe.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/scribe/scribe.pyi new file mode 100644 index 0000000..3530bf8 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/scribe/scribe.pyi @@ -0,0 +1,39 @@ +from typing import Any + +import fb303.FacebookService +from .ttypes import * # noqa: F403 +from thrift.Thrift import TProcessor # type: ignore # We don't have thrift stubs in typeshed + +class Iface(fb303.FacebookService.Iface): + def Log(self, messages): ... + +class Client(fb303.FacebookService.Client, Iface): + def __init__(self, iprot, oprot=...) -> None: ... + def Log(self, messages): ... + def send_Log(self, messages): ... + def recv_Log(self): ... + +class Processor(fb303.FacebookService.Processor, Iface, TProcessor): + def __init__(self, handler) -> None: ... + def process(self, iprot, oprot): ... + def process_Log(self, seqid, iprot, oprot): ... + +class Log_args: + thrift_spec: Any + messages: Any + def __init__(self, messages=...) -> None: ... + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class Log_result: + thrift_spec: Any + success: Any + def __init__(self, success=...) -> None: ... + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/scribe/ttypes.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/scribe/ttypes.pyi new file mode 100644 index 0000000..5bb7ded --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/scribe/ttypes.pyi @@ -0,0 +1,18 @@ +from typing import Any + +fastbinary: Any + +class ResultCode: + OK: Any + TRY_LATER: Any + +class LogEntry: + thrift_spec: Any + category: Any + message: Any + def __init__(self, category=..., message=...) -> None: ... + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/__init__.pyi new file mode 100644 index 0000000..3bed050 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/__init__.pyi @@ -0,0 +1,96 @@ +# Stubs for six (Python 2.7) + +from __future__ import print_function + +import types +from typing import ( + Any, AnyStr, Callable, Dict, Iterable, Mapping, NoReturn, Optional, + Pattern, Text, Tuple, Type, TypeVar, Union, overload, ValuesView, KeysView, ItemsView, +) +import typing +import unittest + +# Exports +from __builtin__ import unichr as unichr +from StringIO import StringIO as StringIO, StringIO as BytesIO +from functools import wraps as wraps +from . import moves + + +_T = TypeVar('_T') +_K = TypeVar('_K') +_V = TypeVar('_V') + +# TODO make constant, then move this stub to 2and3 +# https://github.com/python/typeshed/issues/17 +PY2 = True +PY3 = False +PY34 = False + +string_types = (str, unicode) +integer_types = (int, long) +class_types = (type, types.ClassType) +text_type = unicode +binary_type = str + +MAXSIZE: int + +# def add_move +# def remove_move + +def advance_iterator(it: typing.Iterator[_T]) -> _T: ... +next = advance_iterator + +def callable(obj: object) -> bool: ... + +def get_unbound_function(unbound: types.MethodType) -> types.FunctionType: ... +def create_bound_method(func: types.FunctionType, obj: object) -> types.MethodType: ... +def create_unbound_method(func: types.FunctionType, cls: Union[type, types.ClassType]) -> types.MethodType: ... + +class Iterator: + def next(self) -> Any: ... + +def get_method_function(meth: types.MethodType) -> types.FunctionType: ... +def get_method_self(meth: types.MethodType) -> Optional[object]: ... +def get_function_closure(fun: types.FunctionType) -> Optional[Tuple[types._Cell, ...]]: ... +def get_function_code(fun: types.FunctionType) -> types.CodeType: ... +def get_function_defaults(fun: types.FunctionType) -> Optional[Tuple[Any, ...]]: ... +def get_function_globals(fun: types.FunctionType) -> Dict[str, Any]: ... + +def iterkeys(d: Mapping[_K, _V]) -> typing.Iterator[_K]: ... +def itervalues(d: Mapping[_K, _V]) -> typing.Iterator[_V]: ... +def iteritems(d: Mapping[_K, _V]) -> typing.Iterator[Tuple[_K, _V]]: ... +# def iterlists + +def viewkeys(d: Mapping[_K, _V]) -> KeysView[_K]: ... +def viewvalues(d: Mapping[_K, _V]) -> ValuesView[_V]: ... +def viewitems(d: Mapping[_K, _V]) -> ItemsView[_K, _V]: ... + +def b(s: str) -> binary_type: ... +def u(s: str) -> text_type: ... +int2byte = chr +def byte2int(bs: binary_type) -> int: ... +def indexbytes(buf: binary_type, i: int) -> int: ... +def iterbytes(buf: binary_type) -> typing.Iterator[int]: ... + +def assertCountEqual(self: unittest.TestCase, first: Iterable[_T], second: Iterable[_T], msg: str = ...) -> None: ... +@overload +def assertRaisesRegex(self: unittest.TestCase, msg: str = ...) -> Any: ... +@overload +def assertRaisesRegex(self: unittest.TestCase, callable_obj: Callable[..., Any], *args: Any, **kwargs: Any) -> Any: ... +def assertRegex(self: unittest.TestCase, text: AnyStr, expected_regex: Union[AnyStr, Pattern[AnyStr]], + msg: str = ...) -> None: ... + +def reraise(tp: Optional[Type[BaseException]], value: Optional[BaseException], + tb: Optional[types.TracebackType] = ...) -> NoReturn: ... +def exec_(_code_: Union[unicode, types.CodeType], _globs_: Dict[str, Any] = ..., _locs_: Dict[str, Any] = ...): ... +def raise_from(value: Union[BaseException, Type[BaseException]], from_value: Optional[BaseException]) -> NoReturn: ... + +print_ = print + +def with_metaclass(meta: type, *bases: type) -> type: ... +def add_metaclass(metaclass: type) -> Callable[[_T], _T]: ... +def ensure_binary(s: Union[bytes, Text], encoding: str = ..., errors: str = ...) -> bytes: ... +def ensure_str(s: Union[bytes, Text], encoding: str = ..., errors: str = ...) -> str: ... +def ensure_text(s: Union[bytes, Text], encoding: str = ..., errors: str = ...) -> Text: ... +def python_2_unicode_compatible(klass: _T) -> _T: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/BaseHTTPServer.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/BaseHTTPServer.pyi new file mode 100644 index 0000000..16f7a9d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/BaseHTTPServer.pyi @@ -0,0 +1 @@ +from BaseHTTPServer import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/SimpleHTTPServer.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/SimpleHTTPServer.pyi new file mode 100644 index 0000000..97cfe77 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/SimpleHTTPServer.pyi @@ -0,0 +1 @@ +from SimpleHTTPServer import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/__init__.pyi new file mode 100644 index 0000000..ade0304 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/__init__.pyi @@ -0,0 +1,66 @@ +# Stubs for six.moves +# +# Note: Commented out items means they weren't implemented at the time. +# Uncomment them when the modules have been added to the typeshed. +from cStringIO import StringIO as cStringIO +from itertools import ifilter as filter +from itertools import ifilterfalse as filterfalse +from __builtin__ import raw_input as input +from __builtin__ import intern as intern +from itertools import imap as map +from os import getcwdu as getcwd +from os import getcwd as getcwdb +from __builtin__ import xrange as range +from __builtin__ import reload as reload_module +from __builtin__ import reduce as reduce +from pipes import quote as shlex_quote +from StringIO import StringIO as StringIO +from UserDict import UserDict as UserDict +from UserList import UserList as UserList +from UserString import UserString as UserString +from __builtin__ import xrange as xrange +from itertools import izip as zip +from itertools import izip_longest as zip_longest +import __builtin__ as builtins +from . import configparser +# import copy_reg as copyreg +# import gdbm as dbm_gnu +from . import _dummy_thread +from . import http_cookiejar +from . import http_cookies +from . import html_entities +from . import html_parser +from . import http_client +# import email.MIMEMultipart as email_mime_multipart +# import email.MIMENonMultipart as email_mime_nonmultipart +from . import email_mime_text +# import email.MIMEBase as email_mime_base +from . import BaseHTTPServer +# import CGIHTTPServer as CGIHTTPServer +from . import SimpleHTTPServer +from . import cPickle +from . import queue +from . import reprlib +from . import socketserver +from . import _thread +# import Tkinter as tkinter +# import Dialog as tkinter_dialog +# import FileDialog as tkinter_filedialog +# import ScrolledText as tkinter_scrolledtext +# import SimpleDialog as tkinter_simpledialog +# import Tix as tkinter_tix +# import ttk as tkinter_ttk +# import Tkconstants as tkinter_constants +# import Tkdnd as tkinter_dnd +# import tkColorChooser as tkinter_colorchooser +# import tkCommonDialog as tkinter_commondialog +# import tkFileDialog as tkinter_tkfiledialog +# import tkFont as tkinter_font +# import tkMessageBox as tkinter_messagebox +# import tkSimpleDialog as tkinter_tksimpledialog +from . import urllib_parse +from . import urllib_error +from . import urllib +from . import urllib_robotparser +from . import xmlrpc_client +# import SimpleXMLRPCServer as xmlrpc_server diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/_dummy_thread.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/_dummy_thread.pyi new file mode 100644 index 0000000..3efe922 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/_dummy_thread.pyi @@ -0,0 +1 @@ +from dummy_thread import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/_thread.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/_thread.pyi new file mode 100644 index 0000000..b27f4c7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/_thread.pyi @@ -0,0 +1 @@ +from thread import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/cPickle.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/cPickle.pyi new file mode 100644 index 0000000..ca829a7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/cPickle.pyi @@ -0,0 +1 @@ +from cPickle import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/configparser.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/configparser.pyi new file mode 100644 index 0000000..b2da53a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/configparser.pyi @@ -0,0 +1 @@ +from ConfigParser import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/email_mime_base.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/email_mime_base.pyi new file mode 100644 index 0000000..4df155c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/email_mime_base.pyi @@ -0,0 +1 @@ +from email.mime.base import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/email_mime_multipart.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/email_mime_multipart.pyi new file mode 100644 index 0000000..4f31241 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/email_mime_multipart.pyi @@ -0,0 +1 @@ +from email.mime.multipart import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/email_mime_nonmultipart.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/email_mime_nonmultipart.pyi new file mode 100644 index 0000000..c15c8c0 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/email_mime_nonmultipart.pyi @@ -0,0 +1 @@ +from email.mime.nonmultipart import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/email_mime_text.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/email_mime_text.pyi new file mode 100644 index 0000000..214bf1e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/email_mime_text.pyi @@ -0,0 +1 @@ +from email.MIMEText import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/html_entities.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/html_entities.pyi new file mode 100644 index 0000000..9e15d01 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/html_entities.pyi @@ -0,0 +1 @@ +from htmlentitydefs import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/html_parser.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/html_parser.pyi new file mode 100644 index 0000000..984cee6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/html_parser.pyi @@ -0,0 +1 @@ +from HTMLParser import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/http_client.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/http_client.pyi new file mode 100644 index 0000000..24ef0b4 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/http_client.pyi @@ -0,0 +1 @@ +from httplib import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/http_cookiejar.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/http_cookiejar.pyi new file mode 100644 index 0000000..1357ad3 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/http_cookiejar.pyi @@ -0,0 +1 @@ +from cookielib import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/http_cookies.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/http_cookies.pyi new file mode 100644 index 0000000..5115c0d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/http_cookies.pyi @@ -0,0 +1 @@ +from Cookie import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/queue.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/queue.pyi new file mode 100644 index 0000000..7ce3ccb --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/queue.pyi @@ -0,0 +1 @@ +from Queue import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/reprlib.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/reprlib.pyi new file mode 100644 index 0000000..40ad103 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/reprlib.pyi @@ -0,0 +1 @@ +from repr import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/socketserver.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/socketserver.pyi new file mode 100644 index 0000000..c80a6e7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/socketserver.pyi @@ -0,0 +1 @@ +from SocketServer import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/urllib/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/urllib/__init__.pyi new file mode 100644 index 0000000..d08209c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/urllib/__init__.pyi @@ -0,0 +1,5 @@ +import six.moves.urllib.error as error +import six.moves.urllib.parse as parse +import six.moves.urllib.request as request +import six.moves.urllib.response as response +import six.moves.urllib.robotparser as robotparser diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/urllib/error.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/urllib/error.pyi new file mode 100644 index 0000000..044327e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/urllib/error.pyi @@ -0,0 +1,3 @@ +from urllib2 import URLError as URLError +from urllib2 import HTTPError as HTTPError +from urllib import ContentTooShortError as ContentTooShortError diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/urllib/parse.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/urllib/parse.pyi new file mode 100644 index 0000000..4096c27 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/urllib/parse.pyi @@ -0,0 +1,24 @@ +# Stubs for six.moves.urllib.parse +from urlparse import ParseResult as ParseResult +from urlparse import SplitResult as SplitResult +from urlparse import parse_qs as parse_qs +from urlparse import parse_qsl as parse_qsl +from urlparse import urldefrag as urldefrag +from urlparse import urljoin as urljoin +from urlparse import urlparse as urlparse +from urlparse import urlsplit as urlsplit +from urlparse import urlunparse as urlunparse +from urlparse import urlunsplit as urlunsplit +from urllib import quote as quote +from urllib import quote_plus as quote_plus +from urllib import unquote as unquote +from urllib import unquote_plus as unquote_plus +from urllib import urlencode as urlencode +from urllib import splitquery as splitquery +from urllib import splittag as splittag +from urllib import splituser as splituser +from urlparse import uses_fragment as uses_fragment +from urlparse import uses_netloc as uses_netloc +from urlparse import uses_params as uses_params +from urlparse import uses_query as uses_query +from urlparse import uses_relative as uses_relative diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/urllib/request.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/urllib/request.pyi new file mode 100644 index 0000000..6aadde1 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/urllib/request.pyi @@ -0,0 +1,36 @@ +# Stubs for six.moves.urllib.request +from urllib2 import urlopen as urlopen +from urllib2 import install_opener as install_opener +from urllib2 import build_opener as build_opener +from urllib import pathname2url as pathname2url +from urllib import url2pathname as url2pathname +from urllib import getproxies as getproxies +from urllib2 import Request as Request +from urllib2 import OpenerDirector as OpenerDirector +from urllib2 import HTTPDefaultErrorHandler as HTTPDefaultErrorHandler +from urllib2 import HTTPRedirectHandler as HTTPRedirectHandler +from urllib2 import HTTPCookieProcessor as HTTPCookieProcessor +from urllib2 import ProxyHandler as ProxyHandler +from urllib2 import BaseHandler as BaseHandler +from urllib2 import HTTPPasswordMgr as HTTPPasswordMgr +from urllib2 import HTTPPasswordMgrWithDefaultRealm as HTTPPasswordMgrWithDefaultRealm +from urllib2 import AbstractBasicAuthHandler as AbstractBasicAuthHandler +from urllib2 import HTTPBasicAuthHandler as HTTPBasicAuthHandler +from urllib2 import ProxyBasicAuthHandler as ProxyBasicAuthHandler +from urllib2 import AbstractDigestAuthHandler as AbstractDigestAuthHandler +from urllib2 import HTTPDigestAuthHandler as HTTPDigestAuthHandler +from urllib2 import ProxyDigestAuthHandler as ProxyDigestAuthHandler +from urllib2 import HTTPHandler as HTTPHandler +from urllib2 import HTTPSHandler as HTTPSHandler +from urllib2 import FileHandler as FileHandler +from urllib2 import FTPHandler as FTPHandler +from urllib2 import CacheFTPHandler as CacheFTPHandler +from urllib2 import UnknownHandler as UnknownHandler +from urllib2 import HTTPErrorProcessor as HTTPErrorProcessor +from urllib import urlretrieve as urlretrieve +from urllib import urlcleanup as urlcleanup +from urllib import URLopener as URLopener +from urllib import FancyURLopener as FancyURLopener +from urllib import proxy_bypass as proxy_bypass +from urllib2 import parse_http_list as parse_http_list +from urllib2 import parse_keqv_list as parse_keqv_list diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/urllib/response.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/urllib/response.pyi new file mode 100644 index 0000000..83e117f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/urllib/response.pyi @@ -0,0 +1,5 @@ +# Stubs for six.moves.urllib.response +from urllib import addbase as addbase +from urllib import addclosehook as addclosehook +from urllib import addinfo as addinfo +from urllib import addinfourl as addinfourl diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/urllib/robotparser.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/urllib/robotparser.pyi new file mode 100644 index 0000000..11eef50 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/urllib/robotparser.pyi @@ -0,0 +1 @@ +from robotparser import RobotFileParser as RobotFileParser diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/urllib_error.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/urllib_error.pyi new file mode 100644 index 0000000..b560812 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/urllib_error.pyi @@ -0,0 +1 @@ +from .urllib.error import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/urllib_parse.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/urllib_parse.pyi new file mode 100644 index 0000000..bdb4d1c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/urllib_parse.pyi @@ -0,0 +1 @@ +from .urllib.parse import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/urllib_request.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/urllib_request.pyi new file mode 100644 index 0000000..dc03dce --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/urllib_request.pyi @@ -0,0 +1 @@ +from .urllib.request import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/urllib_response.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/urllib_response.pyi new file mode 100644 index 0000000..bbee522 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/urllib_response.pyi @@ -0,0 +1 @@ +from .urllib.response import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/urllib_robotparser.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/urllib_robotparser.pyi new file mode 100644 index 0000000..ddb63b7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/urllib_robotparser.pyi @@ -0,0 +1 @@ +from robotparser import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/xmlrpc_client.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/xmlrpc_client.pyi new file mode 100644 index 0000000..1b3bd74 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/six/moves/xmlrpc_client.pyi @@ -0,0 +1 @@ +from xmlrpclib import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/tornado/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/tornado/__init__.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/tornado/concurrent.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/tornado/concurrent.pyi new file mode 100644 index 0000000..91fc326 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/tornado/concurrent.pyi @@ -0,0 +1,43 @@ +from typing import Any + +futures: Any + +class ReturnValueIgnoredError(Exception): ... + +class _TracebackLogger: + exc_info: Any + formatted_tb: Any + def __init__(self, exc_info) -> None: ... + def activate(self): ... + def clear(self): ... + def __del__(self): ... + +class Future: + def __init__(self) -> None: ... + def cancel(self): ... + def cancelled(self): ... + def running(self): ... + def done(self): ... + def result(self, timeout=...): ... + def exception(self, timeout=...): ... + def add_done_callback(self, fn): ... + def set_result(self, result): ... + def set_exception(self, exception): ... + def exc_info(self): ... + def set_exc_info(self, exc_info): ... + def __del__(self): ... + +TracebackFuture: Any +FUTURES: Any + +def is_future(x): ... + +class DummyExecutor: + def submit(self, fn, *args, **kwargs): ... + def shutdown(self, wait=...): ... + +dummy_executor: Any + +def run_on_executor(*args, **kwargs): ... +def return_future(f): ... +def chain_future(a, b): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/tornado/gen.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/tornado/gen.pyi new file mode 100644 index 0000000..ee3954b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/tornado/gen.pyi @@ -0,0 +1,109 @@ +from typing import Any +from collections import namedtuple + +singledispatch: Any + +class KeyReuseError(Exception): ... +class UnknownKeyError(Exception): ... +class LeakedCallbackError(Exception): ... +class BadYieldError(Exception): ... +class ReturnValueIgnoredError(Exception): ... +class TimeoutError(Exception): ... + +def engine(func): ... +def coroutine(func, replace_callback=...): ... + +class Return(Exception): + value: Any + def __init__(self, value=...) -> None: ... + +class WaitIterator: + current_index: Any + def __init__(self, *args, **kwargs) -> None: ... + def done(self): ... + def next(self): ... + +class YieldPoint: + def start(self, runner): ... + def is_ready(self): ... + def get_result(self): ... + +class Callback(YieldPoint): + key: Any + def __init__(self, key) -> None: ... + runner: Any + def start(self, runner): ... + def is_ready(self): ... + def get_result(self): ... + +class Wait(YieldPoint): + key: Any + def __init__(self, key) -> None: ... + runner: Any + def start(self, runner): ... + def is_ready(self): ... + def get_result(self): ... + +class WaitAll(YieldPoint): + keys: Any + def __init__(self, keys) -> None: ... + runner: Any + def start(self, runner): ... + def is_ready(self): ... + def get_result(self): ... + +def Task(func, *args, **kwargs): ... + +class YieldFuture(YieldPoint): + future: Any + io_loop: Any + def __init__(self, future, io_loop=...) -> None: ... + runner: Any + key: Any + result_fn: Any + def start(self, runner): ... + def is_ready(self): ... + def get_result(self): ... + +class Multi(YieldPoint): + keys: Any + children: Any + unfinished_children: Any + quiet_exceptions: Any + def __init__(self, children, quiet_exceptions=...) -> None: ... + def start(self, runner): ... + def is_ready(self): ... + def get_result(self): ... + +def multi_future(children, quiet_exceptions=...): ... +def maybe_future(x): ... +def with_timeout(timeout, future, io_loop=..., quiet_exceptions=...): ... +def sleep(duration): ... + +moment: Any + +class Runner: + gen: Any + result_future: Any + future: Any + yield_point: Any + pending_callbacks: Any + results: Any + running: Any + finished: Any + had_exception: Any + io_loop: Any + stack_context_deactivate: Any + def __init__(self, gen, result_future, first_yielded) -> None: ... + def register_callback(self, key): ... + def is_ready(self, key): ... + def set_result(self, key, result): ... + def pop_result(self, key): ... + def run(self): ... + def handle_yield(self, yielded): ... + def result_callback(self, key): ... + def handle_exception(self, typ, value, tb): ... + +Arguments = namedtuple('Arguments', ['args', 'kwargs']) + +def convert_yielded(yielded): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/tornado/httpclient.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/tornado/httpclient.pyi new file mode 100644 index 0000000..f107093 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/tornado/httpclient.pyi @@ -0,0 +1,96 @@ +from typing import Any +from tornado.util import Configurable + +class HTTPClient: + def __init__(self, async_client_class=..., **kwargs) -> None: ... + def __del__(self): ... + def close(self): ... + def fetch(self, request, **kwargs): ... + +class AsyncHTTPClient(Configurable): + @classmethod + def configurable_base(cls): ... + @classmethod + def configurable_default(cls): ... + def __new__(cls, io_loop=..., force_instance=..., **kwargs): ... + io_loop: Any + defaults: Any + def initialize(self, io_loop, defaults=...): ... + def close(self): ... + def fetch(self, request, callback=..., raise_error=..., **kwargs): ... + def fetch_impl(self, request, callback): ... + @classmethod + def configure(cls, impl, **kwargs): ... + +class HTTPRequest: + proxy_host: Any + proxy_port: Any + proxy_username: Any + proxy_password: Any + url: Any + method: Any + body_producer: Any + auth_username: Any + auth_password: Any + auth_mode: Any + connect_timeout: Any + request_timeout: Any + follow_redirects: Any + max_redirects: Any + user_agent: Any + decompress_response: Any + network_interface: Any + streaming_callback: Any + header_callback: Any + prepare_curl_callback: Any + allow_nonstandard_methods: Any + validate_cert: Any + ca_certs: Any + allow_ipv6: Any + client_key: Any + client_cert: Any + ssl_options: Any + expect_100_continue: Any + start_time: Any + def __init__(self, url, method=..., headers=..., body=..., auth_username=..., auth_password=..., auth_mode=..., + connect_timeout=..., request_timeout=..., if_modified_since=..., follow_redirects=..., max_redirects=..., + user_agent=..., use_gzip=..., network_interface=..., streaming_callback=..., header_callback=..., + prepare_curl_callback=..., proxy_host=..., proxy_port=..., proxy_username=..., proxy_password=..., + allow_nonstandard_methods=..., validate_cert=..., ca_certs=..., allow_ipv6=..., client_key=..., client_cert=..., + body_producer=..., expect_100_continue=..., decompress_response=..., ssl_options=...) -> None: ... + @property + def headers(self): ... + @headers.setter + def headers(self, value): ... + @property + def body(self): ... + @body.setter + def body(self, value): ... + +class HTTPResponse: + request: Any + code: Any + reason: Any + headers: Any + buffer: Any + effective_url: Any + error: Any + request_time: Any + time_info: Any + def __init__(self, request, code, headers=..., buffer=..., effective_url=..., error=..., request_time=..., time_info=..., + reason=...) -> None: ... + body: Any + def rethrow(self): ... + +class HTTPError(Exception): + code: Any + response: Any + def __init__(self, code, message=..., response=...) -> None: ... + +class _RequestProxy: + request: Any + defaults: Any + def __init__(self, request, defaults) -> None: ... + def __getattr__(self, name): ... + +def main(): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/tornado/httpserver.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/tornado/httpserver.pyi new file mode 100644 index 0000000..9bcf99a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/tornado/httpserver.pyi @@ -0,0 +1,43 @@ +from typing import Any +from tornado import httputil +from tornado.tcpserver import TCPServer +from tornado.util import Configurable + +class HTTPServer(TCPServer, Configurable, httputil.HTTPServerConnectionDelegate): + def __init__(self, *args, **kwargs) -> None: ... + request_callback: Any + no_keep_alive: Any + xheaders: Any + protocol: Any + conn_params: Any + def initialize(self, request_callback, no_keep_alive=..., io_loop=..., xheaders=..., ssl_options=..., protocol=..., + decompress_request=..., chunk_size=..., max_header_size=..., idle_connection_timeout=..., body_timeout=..., + max_body_size=..., max_buffer_size=...): ... + @classmethod + def configurable_base(cls): ... + @classmethod + def configurable_default(cls): ... + def close_all_connections(self): ... + def handle_stream(self, stream, address): ... + def start_request(self, server_conn, request_conn): ... + def on_close(self, server_conn): ... + +class _HTTPRequestContext: + address: Any + protocol: Any + address_family: Any + remote_ip: Any + def __init__(self, stream, address, protocol) -> None: ... + +class _ServerRequestAdapter(httputil.HTTPMessageDelegate): + server: Any + connection: Any + request: Any + delegate: Any + def __init__(self, server, server_conn, request_conn) -> None: ... + def headers_received(self, start_line, headers): ... + def data_received(self, chunk): ... + def finish(self): ... + def on_connection_close(self): ... + +HTTPRequest: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/tornado/httputil.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/tornado/httputil.pyi new file mode 100644 index 0000000..bfc81fa --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/tornado/httputil.pyi @@ -0,0 +1,90 @@ +from typing import Any +from tornado.util import ObjectDict +from collections import namedtuple + +class SSLError(Exception): ... + +class _NormalizedHeaderCache(dict): + size: Any + queue: Any + def __init__(self, size) -> None: ... + def __missing__(self, key): ... + +class HTTPHeaders(dict): + def __init__(self, *args, **kwargs) -> None: ... + def add(self, name, value): ... + def get_list(self, name): ... + def get_all(self): ... + def parse_line(self, line): ... + @classmethod + def parse(cls, headers): ... + def __setitem__(self, name, value): ... + def __getitem__(self, name): ... + def __delitem__(self, name): ... + def __contains__(self, name): ... + def get(self, name, default=...): ... + def update(self, *args, **kwargs): ... + def copy(self): ... + __copy__: Any + def __deepcopy__(self, memo_dict): ... + +class HTTPServerRequest: + method: Any + uri: Any + version: Any + headers: Any + body: Any + remote_ip: Any + protocol: Any + host: Any + files: Any + connection: Any + arguments: Any + query_arguments: Any + body_arguments: Any + def __init__(self, method=..., uri=..., version=..., headers=..., body=..., host=..., files=..., connection=..., + start_line=...) -> None: ... + def supports_http_1_1(self): ... + @property + def cookies(self): ... + def write(self, chunk, callback=...): ... + def finish(self): ... + def full_url(self): ... + def request_time(self): ... + def get_ssl_certificate(self, binary_form=...): ... + +class HTTPInputError(Exception): ... +class HTTPOutputError(Exception): ... + +class HTTPServerConnectionDelegate: + def start_request(self, server_conn, request_conn): ... + def on_close(self, server_conn): ... + +class HTTPMessageDelegate: + def headers_received(self, start_line, headers): ... + def data_received(self, chunk): ... + def finish(self): ... + def on_connection_close(self): ... + +class HTTPConnection: + def write_headers(self, start_line, headers, chunk=..., callback=...): ... + def write(self, chunk, callback=...): ... + def finish(self): ... + +def url_concat(url, args): ... + +class HTTPFile(ObjectDict): ... + +def parse_body_arguments(content_type, body, arguments, files, headers=...): ... +def parse_multipart_form_data(boundary, data, arguments, files): ... +def format_timestamp(ts): ... + +RequestStartLine = namedtuple('RequestStartLine', ['method', 'path', 'version']) + +def parse_request_start_line(line): ... + +ResponseStartLine = namedtuple('ResponseStartLine', ['version', 'code', 'reason']) + +def parse_response_start_line(line): ... +def doctests(): ... +def split_host_and_port(netloc): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/tornado/ioloop.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/tornado/ioloop.pyi new file mode 100644 index 0000000..92c3548 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/tornado/ioloop.pyi @@ -0,0 +1,84 @@ +from typing import Any +from tornado.util import Configurable + +signal: Any + +class TimeoutError(Exception): ... + +class IOLoop(Configurable): + NONE: Any + READ: Any + WRITE: Any + ERROR: Any + @staticmethod + def instance(): ... + @staticmethod + def initialized(): ... + def install(self): ... + @staticmethod + def clear_instance(): ... + @staticmethod + def current(instance=...): ... + def make_current(self): ... + @staticmethod + def clear_current(): ... + @classmethod + def configurable_base(cls): ... + @classmethod + def configurable_default(cls): ... + def initialize(self, make_current=...): ... + def close(self, all_fds=...): ... + def add_handler(self, fd, handler, events): ... + def update_handler(self, fd, events): ... + def remove_handler(self, fd): ... + def set_blocking_signal_threshold(self, seconds, action): ... + def set_blocking_log_threshold(self, seconds): ... + def log_stack(self, signal, frame): ... + def start(self): ... + def stop(self): ... + def run_sync(self, func, timeout=...): ... + def time(self): ... + def add_timeout(self, deadline, callback, *args, **kwargs): ... + def call_later(self, delay, callback, *args, **kwargs): ... + def call_at(self, when, callback, *args, **kwargs): ... + def remove_timeout(self, timeout): ... + def add_callback(self, callback, *args, **kwargs): ... + def add_callback_from_signal(self, callback, *args, **kwargs): ... + def spawn_callback(self, callback, *args, **kwargs): ... + def add_future(self, future, callback): ... + def handle_callback_exception(self, callback): ... + def split_fd(self, fd): ... + def close_fd(self, fd): ... + +class PollIOLoop(IOLoop): + time_func: Any + def initialize(self, impl, time_func=..., **kwargs): ... + def close(self, all_fds=...): ... + def add_handler(self, fd, handler, events): ... + def update_handler(self, fd, events): ... + def remove_handler(self, fd): ... + def set_blocking_signal_threshold(self, seconds, action): ... + def start(self): ... + def stop(self): ... + def time(self): ... + def call_at(self, deadline, callback, *args, **kwargs): ... + def remove_timeout(self, timeout): ... + def add_callback(self, callback, *args, **kwargs): ... + def add_callback_from_signal(self, callback, *args, **kwargs): ... + +class _Timeout: + deadline: Any + callback: Any + tiebreaker: Any + def __init__(self, deadline, callback, io_loop) -> None: ... + def __lt__(self, other): ... + def __le__(self, other): ... + +class PeriodicCallback: + callback: Any + callback_time: Any + io_loop: Any + def __init__(self, callback, callback_time, io_loop=...) -> None: ... + def start(self): ... + def stop(self): ... + def is_running(self): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/tornado/locks.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/tornado/locks.pyi new file mode 100644 index 0000000..723e991 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/tornado/locks.pyi @@ -0,0 +1,45 @@ +from typing import Any, Optional + +class _TimeoutGarbageCollector: + def __init__(self): ... + +class Condition(_TimeoutGarbageCollector): + io_loop: Any + def __init__(self): ... + def wait(self, timeout: Optional[Any] = ...): ... + def notify(self, n: int = ...): ... + def notify_all(self): ... + +class Event: + def __init__(self): ... + def is_set(self): ... + def set(self): ... + def clear(self): ... + def wait(self, timeout: Optional[Any] = ...): ... + +class _ReleasingContextManager: + def __init__(self, obj): ... + def __enter__(self): ... + def __exit__(self, exc_type, exc_val, exc_tb): ... + +class Semaphore(_TimeoutGarbageCollector): + def __init__(self, value: int = ...): ... + def release(self): ... + def acquire(self, timeout: Optional[Any] = ...): ... + def __enter__(self): ... + __exit__: Any + def __aenter__(self): ... + def __aexit__(self, typ, value, tb): ... + +class BoundedSemaphore(Semaphore): + def __init__(self, value: int = ...): ... + def release(self): ... + +class Lock: + def __init__(self): ... + def acquire(self, timeout: Optional[Any] = ...): ... + def release(self): ... + def __enter__(self): ... + __exit__: Any + def __aenter__(self): ... + def __aexit__(self, typ, value, tb): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/tornado/netutil.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/tornado/netutil.pyi new file mode 100644 index 0000000..53c8fc7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/tornado/netutil.pyi @@ -0,0 +1,45 @@ +from typing import Any +from tornado.util import Configurable + +ssl: Any +certifi: Any +xrange: Any +ssl_match_hostname: Any +SSLCertificateError: Any + +def bind_sockets(port, address=..., family=..., backlog=..., flags=...): ... +def bind_unix_socket(file, mode=..., backlog=...): ... +def add_accept_handler(sock, callback, io_loop=...): ... +def is_valid_ip(ip): ... + +class Resolver(Configurable): + @classmethod + def configurable_base(cls): ... + @classmethod + def configurable_default(cls): ... + def resolve(self, host, port, family=..., callback=...): ... + def close(self): ... + +class ExecutorResolver(Resolver): + io_loop: Any + executor: Any + close_executor: Any + def initialize(self, io_loop=..., executor=..., close_executor=...): ... + def close(self): ... + def resolve(self, host, port, family=...): ... + +class BlockingResolver(ExecutorResolver): + def initialize(self, io_loop=...): ... + +class ThreadedResolver(ExecutorResolver): + def initialize(self, io_loop=..., num_threads=...): ... + +class OverrideResolver(Resolver): + resolver: Any + mapping: Any + def initialize(self, resolver, mapping): ... + def close(self): ... + def resolve(self, host, port, *args, **kwargs): ... + +def ssl_options_to_context(ssl_options): ... +def ssl_wrap_socket(socket, ssl_options, server_hostname=..., **kwargs): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/tornado/process.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/tornado/process.pyi new file mode 100644 index 0000000..c467454 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/tornado/process.pyi @@ -0,0 +1,24 @@ +from typing import Any, Optional + +long = int +CalledProcessError: Any + +def cpu_count() -> int: ... +def fork_processes(num_processes, max_restarts: int = ...) -> Optional[int]: ... +def task_id() -> int: ... + +class Subprocess: + STREAM: Any = ... + io_loop: Any = ... + stdin: Any = ... + stdout: Any = ... + stderr: Any = ... + proc: Any = ... + returncode: Any = ... + def __init__(self, *args, **kwargs) -> None: ... + def set_exit_callback(self, callback): ... + def wait_for_exit(self, raise_error: bool = ...): ... + @classmethod + def initialize(cls, io_loop: Optional[Any] = ...): ... + @classmethod + def uninitialize(cls): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/tornado/tcpserver.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/tornado/tcpserver.pyi new file mode 100644 index 0000000..28fe6a4 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/tornado/tcpserver.pyi @@ -0,0 +1,17 @@ +from typing import Any + +ssl: Any + +class TCPServer: + io_loop: Any + ssl_options: Any + max_buffer_size: Any + read_chunk_size: Any + def __init__(self, io_loop=..., ssl_options=..., max_buffer_size=..., read_chunk_size=...) -> None: ... + def listen(self, port, address=...): ... + def add_sockets(self, sockets): ... + def add_socket(self, socket): ... + def bind(self, port, address=..., family=..., backlog=...): ... + def start(self, num_processes=...): ... + def stop(self): ... + def handle_stream(self, stream, address): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/tornado/testing.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/tornado/testing.pyi new file mode 100644 index 0000000..25fd0e5 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/tornado/testing.pyi @@ -0,0 +1,60 @@ +from typing import Any, Optional +import unittest +import logging + +AsyncHTTPClient: Any +gen: Any +HTTPServer: Any +IOLoop: Any +netutil: Any +SimpleAsyncHTTPClient: Any + +def get_unused_port(): ... +def bind_unused_port(): ... + +class AsyncTestCase(unittest.TestCase): + def __init__(self, *args, **kwargs): ... + io_loop: Any + def setUp(self): ... + def tearDown(self): ... + def get_new_ioloop(self): ... + def run(self, result: Optional[Any] = ...): ... + def stop(self, _arg: Optional[Any] = ..., **kwargs): ... + def wait(self, condition: Optional[Any] = ..., timeout: float = ...): ... + +class AsyncHTTPTestCase(AsyncTestCase): + http_client: Any + http_server: Any + def setUp(self): ... + def get_http_client(self): ... + def get_http_server(self): ... + def get_app(self): ... + def fetch(self, path, **kwargs): ... + def get_httpserver_options(self): ... + def get_http_port(self): ... + def get_protocol(self): ... + def get_url(self, path): ... + def tearDown(self): ... + +class AsyncHTTPSTestCase(AsyncHTTPTestCase): + def get_http_client(self): ... + def get_httpserver_options(self): ... + def get_ssl_options(self): ... + def get_protocol(self): ... + +def gen_test(f): ... + +class LogTrapTestCase(unittest.TestCase): + def run(self, result: Optional[Any] = ...): ... + +class ExpectLog(logging.Filter): + logger: Any + regex: Any + required: Any + matched: Any + def __init__(self, logger, regex, required: bool = ...): ... + def filter(self, record): ... + def __enter__(self): ... + def __exit__(self, typ, value, tb): ... + +def main(**kwargs): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/tornado/util.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/tornado/util.pyi new file mode 100644 index 0000000..1f6e0d2 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/tornado/util.pyi @@ -0,0 +1,46 @@ +from typing import Any + +xrange: Any + +class ObjectDict(dict): + def __getattr__(self, name): ... + def __setattr__(self, name, value): ... + +class GzipDecompressor: + decompressobj: Any + def __init__(self) -> None: ... + def decompress(self, value, max_length=...): ... + @property + def unconsumed_tail(self): ... + def flush(self): ... + +unicode_type: Any +basestring_type: Any + +def import_object(name): ... + +bytes_type: Any + +def errno_from_exception(e): ... + +class Configurable: + def __new__(cls, *args, **kwargs): ... + @classmethod + def configurable_base(cls): ... + @classmethod + def configurable_default(cls): ... + def initialize(self): ... + @classmethod + def configure(cls, impl, **kwargs): ... + @classmethod + def configured_class(cls): ... + +class ArgReplacer: + name: Any + arg_pos: Any + def __init__(self, func, name) -> None: ... + def get_old_value(self, args, kwargs, default=...): ... + def replace(self, new_value, args, kwargs): ... + +def timedelta_to_seconds(td): ... +def doctests(): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/tornado/web.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/tornado/web.pyi new file mode 100644 index 0000000..c63f414 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2/tornado/web.pyi @@ -0,0 +1,257 @@ +from typing import Any +from tornado import httputil + +MIN_SUPPORTED_SIGNED_VALUE_VERSION: Any +MAX_SUPPORTED_SIGNED_VALUE_VERSION: Any +DEFAULT_SIGNED_VALUE_VERSION: Any +DEFAULT_SIGNED_VALUE_MIN_VERSION: Any + +class RequestHandler: + SUPPORTED_METHODS: Any + application: Any + request: Any + path_args: Any + path_kwargs: Any + ui: Any + def __init__(self, application, request, **kwargs) -> None: ... + def initialize(self): ... + @property + def settings(self): ... + def head(self, *args, **kwargs): ... + def get(self, *args, **kwargs): ... + def post(self, *args, **kwargs): ... + def delete(self, *args, **kwargs): ... + def patch(self, *args, **kwargs): ... + def put(self, *args, **kwargs): ... + def options(self, *args, **kwargs): ... + def prepare(self): ... + def on_finish(self): ... + def on_connection_close(self): ... + def clear(self): ... + def set_default_headers(self): ... + def set_status(self, status_code, reason=...): ... + def get_status(self): ... + def set_header(self, name, value): ... + def add_header(self, name, value): ... + def clear_header(self, name): ... + def get_argument(self, name, default=..., strip=...): ... + def get_arguments(self, name, strip=...): ... + def get_body_argument(self, name, default=..., strip=...): ... + def get_body_arguments(self, name, strip=...): ... + def get_query_argument(self, name, default=..., strip=...): ... + def get_query_arguments(self, name, strip=...): ... + def decode_argument(self, value, name=...): ... + @property + def cookies(self): ... + def get_cookie(self, name, default=...): ... + def set_cookie(self, name, value, domain=..., expires=..., path=..., expires_days=..., **kwargs): ... + def clear_cookie(self, name, path=..., domain=...): ... + def clear_all_cookies(self, path=..., domain=...): ... + def set_secure_cookie(self, name, value, expires_days=..., version=..., **kwargs): ... + def create_signed_value(self, name, value, version=...): ... + def get_secure_cookie(self, name, value=..., max_age_days=..., min_version=...): ... + def get_secure_cookie_key_version(self, name, value=...): ... + def redirect(self, url, permanent=..., status=...): ... + def write(self, chunk): ... + def render(self, template_name, **kwargs): ... + def render_string(self, template_name, **kwargs): ... + def get_template_namespace(self): ... + def create_template_loader(self, template_path): ... + def flush(self, include_footers=..., callback=...): ... + def finish(self, chunk=...): ... + def send_error(self, status_code=..., **kwargs): ... + def write_error(self, status_code, **kwargs): ... + @property + def locale(self): ... + @locale.setter + def locale(self, value): ... + def get_user_locale(self): ... + def get_browser_locale(self, default=...): ... + @property + def current_user(self): ... + @current_user.setter + def current_user(self, value): ... + def get_current_user(self): ... + def get_login_url(self): ... + def get_template_path(self): ... + @property + def xsrf_token(self): ... + def check_xsrf_cookie(self): ... + def xsrf_form_html(self): ... + def static_url(self, path, include_host=..., **kwargs): ... + def require_setting(self, name, feature=...): ... + def reverse_url(self, name, *args): ... + def compute_etag(self): ... + def set_etag_header(self): ... + def check_etag_header(self): ... + def data_received(self, chunk): ... + def log_exception(self, typ, value, tb): ... + +def asynchronous(method): ... +def stream_request_body(cls): ... +def removeslash(method): ... +def addslash(method): ... + +class Application(httputil.HTTPServerConnectionDelegate): + transforms: Any + handlers: Any + named_handlers: Any + default_host: Any + settings: Any + ui_modules: Any + ui_methods: Any + def __init__(self, handlers=..., default_host=..., transforms=..., **settings) -> None: ... + def listen(self, port, address=..., **kwargs): ... + def add_handlers(self, host_pattern, host_handlers): ... + def add_transform(self, transform_class): ... + def start_request(self, server_conn, request_conn): ... + def __call__(self, request): ... + def reverse_url(self, name, *args): ... + def log_request(self, handler): ... + +class _RequestDispatcher(httputil.HTTPMessageDelegate): + application: Any + connection: Any + request: Any + chunks: Any + handler_class: Any + handler_kwargs: Any + path_args: Any + path_kwargs: Any + def __init__(self, application, connection) -> None: ... + def headers_received(self, start_line, headers): ... + stream_request_body: Any + def set_request(self, request): ... + def data_received(self, data): ... + def finish(self): ... + def on_connection_close(self): ... + handler: Any + def execute(self): ... + +class HTTPError(Exception): + status_code: Any + log_message: Any + args: Any + reason: Any + def __init__(self, status_code, log_message=..., *args, **kwargs) -> None: ... + +class Finish(Exception): ... + +class MissingArgumentError(HTTPError): + arg_name: Any + def __init__(self, arg_name) -> None: ... + +class ErrorHandler(RequestHandler): + def initialize(self, status_code): ... + def prepare(self): ... + def check_xsrf_cookie(self): ... + +class RedirectHandler(RequestHandler): + def initialize(self, url, permanent=...): ... + def get(self): ... + +class StaticFileHandler(RequestHandler): + CACHE_MAX_AGE: Any + root: Any + default_filename: Any + def initialize(self, path, default_filename=...): ... + @classmethod + def reset(cls): ... + def head(self, path): ... + path: Any + absolute_path: Any + modified: Any + def get(self, path, include_body=...): ... + def compute_etag(self): ... + def set_headers(self): ... + def should_return_304(self): ... + @classmethod + def get_absolute_path(cls, root, path): ... + def validate_absolute_path(self, root, absolute_path): ... + @classmethod + def get_content(cls, abspath, start=..., end=...): ... + @classmethod + def get_content_version(cls, abspath): ... + def get_content_size(self): ... + def get_modified_time(self): ... + def get_content_type(self): ... + def set_extra_headers(self, path): ... + def get_cache_time(self, path, modified, mime_type): ... + @classmethod + def make_static_url(cls, settings, path, include_version=...): ... + def parse_url_path(self, url_path): ... + @classmethod + def get_version(cls, settings, path): ... + +class FallbackHandler(RequestHandler): + fallback: Any + def initialize(self, fallback): ... + def prepare(self): ... + +class OutputTransform: + def __init__(self, request) -> None: ... + def transform_first_chunk(self, status_code, headers, chunk, finishing): ... + def transform_chunk(self, chunk, finishing): ... + +class GZipContentEncoding(OutputTransform): + CONTENT_TYPES: Any + MIN_LENGTH: Any + def __init__(self, request) -> None: ... + def transform_first_chunk(self, status_code, headers, chunk, finishing): ... + def transform_chunk(self, chunk, finishing): ... + +def authenticated(method): ... + +class UIModule: + handler: Any + request: Any + ui: Any + locale: Any + def __init__(self, handler) -> None: ... + @property + def current_user(self): ... + def render(self, *args, **kwargs): ... + def embedded_javascript(self): ... + def javascript_files(self): ... + def embedded_css(self): ... + def css_files(self): ... + def html_head(self): ... + def html_body(self): ... + def render_string(self, path, **kwargs): ... + +class _linkify(UIModule): + def render(self, text, **kwargs): ... + +class _xsrf_form_html(UIModule): + def render(self): ... + +class TemplateModule(UIModule): + def __init__(self, handler) -> None: ... + def render(self, path, **kwargs): ... + def embedded_javascript(self): ... + def javascript_files(self): ... + def embedded_css(self): ... + def css_files(self): ... + def html_head(self): ... + def html_body(self): ... + +class _UIModuleNamespace: + handler: Any + ui_modules: Any + def __init__(self, handler, ui_modules) -> None: ... + def __getitem__(self, key): ... + def __getattr__(self, key): ... + +class URLSpec: + regex: Any + handler_class: Any + kwargs: Any + name: Any + def __init__(self, pattern, handler, kwargs=..., name=...) -> None: ... + def reverse(self, *args): ... + +url: Any + +def create_signed_value(secret, name, value, version=..., clock=..., key_version=...): ... +def decode_signed_value(secret, name, value, max_age_days=..., clock=..., min_version=...): ... +def get_signature_key_version(value): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/AES.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/AES.pyi new file mode 100644 index 0000000..144ccfa --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/AES.pyi @@ -0,0 +1,19 @@ +from typing import Any, Union, Text +from .blockalgo import BlockAlgo + +__revision__: str + +class AESCipher(BlockAlgo): + def __init__(self, key: Union[bytes, Text], *args, **kwargs) -> None: ... + +def new(key: Union[bytes, Text], *args, **kwargs) -> AESCipher: ... + +MODE_ECB: int +MODE_CBC: int +MODE_CFB: int +MODE_PGP: int +MODE_OFB: int +MODE_CTR: int +MODE_OPENPGP: int +block_size: int +key_size: int diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/ARC2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/ARC2.pyi new file mode 100644 index 0000000..24a12ea --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/ARC2.pyi @@ -0,0 +1,19 @@ +from typing import Any, Union, Text +from .blockalgo import BlockAlgo + +__revision__: str + +class RC2Cipher(BlockAlgo): + def __init__(self, key: Union[bytes, Text], *args, **kwargs) -> None: ... + +def new(key: Union[bytes, Text], *args, **kwargs) -> RC2Cipher: ... + +MODE_ECB: int +MODE_CBC: int +MODE_CFB: int +MODE_PGP: int +MODE_OFB: int +MODE_CTR: int +MODE_OPENPGP: int +block_size: int +key_size: int diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/ARC4.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/ARC4.pyi new file mode 100644 index 0000000..109e2bf --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/ARC4.pyi @@ -0,0 +1,15 @@ +from typing import Any, Union, Text + +__revision__: str + +class ARC4Cipher: + block_size: int + key_size: int + def __init__(self, key: Union[bytes, Text], *args, **kwargs) -> None: ... + def encrypt(self, plaintext): ... + def decrypt(self, ciphertext): ... + +def new(key: Union[bytes, Text], *args, **kwargs) -> ARC4Cipher: ... + +block_size: int +key_size: int diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/Blowfish.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/Blowfish.pyi new file mode 100644 index 0000000..e29ca6b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/Blowfish.pyi @@ -0,0 +1,19 @@ +from typing import Any, Union, Text +from .blockalgo import BlockAlgo + +__revision__: str + +class BlowfishCipher(BlockAlgo): + def __init__(self, key: Union[bytes, Text], *args, **kwargs) -> None: ... + +def new(key: Union[bytes, Text], *args, **kwargs) -> BlowfishCipher: ... + +MODE_ECB: int +MODE_CBC: int +MODE_CFB: int +MODE_PGP: int +MODE_OFB: int +MODE_CTR: int +MODE_OPENPGP: int +block_size: int +key_size: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/CAST.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/CAST.pyi new file mode 100644 index 0000000..b291919 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/CAST.pyi @@ -0,0 +1,19 @@ +from typing import Any, Union, Text +from .blockalgo import BlockAlgo + +__revision__: str + +class CAST128Cipher(BlockAlgo): + def __init__(self, key: Union[bytes, Text], *args, **kwargs) -> None: ... + +def new(key: Union[bytes, Text], *args, **kwargs) -> CAST128Cipher: ... + +MODE_ECB: int +MODE_CBC: int +MODE_CFB: int +MODE_PGP: int +MODE_OFB: int +MODE_CTR: int +MODE_OPENPGP: int +block_size: int +key_size: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/DES.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/DES.pyi new file mode 100644 index 0000000..30a40dd --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/DES.pyi @@ -0,0 +1,19 @@ +from typing import Any, Union, Text +from .blockalgo import BlockAlgo + +__revision__: str + +class DESCipher(BlockAlgo): + def __init__(self, key: Union[bytes, Text], *args, **kwargs) -> None: ... + +def new(key: Union[bytes, Text], *args, **kwargs) -> DESCipher: ... + +MODE_ECB: int +MODE_CBC: int +MODE_CFB: int +MODE_PGP: int +MODE_OFB: int +MODE_CTR: int +MODE_OPENPGP: int +block_size: int +key_size: int diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/DES3.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/DES3.pyi new file mode 100644 index 0000000..59ccd8f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/DES3.pyi @@ -0,0 +1,20 @@ +from typing import Any, Union, Text + +from .blockalgo import BlockAlgo + +__revision__: str + +class DES3Cipher(BlockAlgo): + def __init__(self, key: Union[bytes, Text], *args, **kwargs) -> None: ... + +def new(key: Union[bytes, Text], *args, **kwargs) -> DES3Cipher: ... + +MODE_ECB: int +MODE_CBC: int +MODE_CFB: int +MODE_PGP: int +MODE_OFB: int +MODE_CTR: int +MODE_OPENPGP: int +block_size: int +key_size: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/PKCS1_OAEP.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/PKCS1_OAEP.pyi new file mode 100644 index 0000000..50980a4 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/PKCS1_OAEP.pyi @@ -0,0 +1,13 @@ +from typing import Any, Optional, Union, Text + +from Crypto.PublicKey.RSA import _RSAobj + +class PKCS1OAEP_Cipher: + def __init__(self, key: _RSAobj, hashAlgo: Any, mgfunc: Any, label: Any) -> None: ... + def can_encrypt(self): ... + def can_decrypt(self): ... + def encrypt(self, message: Union[bytes, Text]) -> bytes: ... + def decrypt(self, ct: bytes) -> bytes: ... + + +def new(key: _RSAobj, hashAlgo: Optional[Any] = ..., mgfunc: Optional[Any] = ..., label: Any = ...) -> PKCS1OAEP_Cipher: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/PKCS1_v1_5.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/PKCS1_v1_5.pyi new file mode 100644 index 0000000..c2b9ea1 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/PKCS1_v1_5.pyi @@ -0,0 +1,13 @@ +from typing import Any, Union, Text + +from Crypto.PublicKey.RSA import _RSAobj + +class PKCS115_Cipher: + def __init__(self, key: _RSAobj) -> None: ... + def can_encrypt(self) -> bool: ... + def can_decrypt(self) -> bool: ... + rf: Any + def encrypt(self, message: Union[bytes, Text]) -> bytes: ... + def decrypt(self, ct: bytes, sentinel: Any) -> bytes: ... + +def new(key: _RSAobj) -> PKCS115_Cipher: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/XOR.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/XOR.pyi new file mode 100644 index 0000000..4c952c2 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/XOR.pyi @@ -0,0 +1,16 @@ +from typing import Any, Union, Text + +__revision__: str + +class XORCipher: + block_size: int + key_size: int + def __init__(self, key: Union[bytes, Text], *args, **kwargs) -> None: ... + def encrypt(self, plaintext: Union[bytes, Text]) -> bytes: ... + def decrypt(self, ciphertext: bytes) -> bytes: ... + + +def new(key: Union[bytes, Text], *args, **kwargs) -> XORCipher: ... + +block_size: int +key_size: int diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/__init__.pyi new file mode 100644 index 0000000..309f274 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/__init__.pyi @@ -0,0 +1,11 @@ +# Names in __all__ with no definition: +# AES +# ARC2 +# ARC4 +# Blowfish +# CAST +# DES +# DES3 +# PKCS1_OAEP +# PKCS1_v1_5 +# XOR diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/blockalgo.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/blockalgo.pyi new file mode 100644 index 0000000..8286b7a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/blockalgo.pyi @@ -0,0 +1,17 @@ +from typing import Any, Union, Text + +MODE_ECB: int +MODE_CBC: int +MODE_CFB: int +MODE_PGP: int +MODE_OFB: int +MODE_CTR: int +MODE_OPENPGP: int + +class BlockAlgo: + mode: int + block_size: int + IV: Any + def __init__(self, factory: Any, key: Union[bytes, Text], *args, **kwargs) -> None: ... + def encrypt(self, plaintext: Union[bytes, Text]) -> bytes: ... + def decrypt(self, ciphertext: bytes) -> bytes: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/HMAC.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/HMAC.pyi new file mode 100644 index 0000000..5e2337d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/HMAC.pyi @@ -0,0 +1,16 @@ +from typing import Any, Optional + +digest_size: Any + +class HMAC: + digest_size: Any + digestmod: Any + outer: Any + inner: Any + def __init__(self, key, msg: Optional[Any] = ..., digestmod: Optional[Any] = ...) -> None: ... + def update(self, msg): ... + def copy(self): ... + def digest(self): ... + def hexdigest(self): ... + +def new(key, msg: Optional[Any] = ..., digestmod: Optional[Any] = ...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/MD2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/MD2.pyi new file mode 100644 index 0000000..1575b11 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/MD2.pyi @@ -0,0 +1,13 @@ +from typing import Any, Optional +from Crypto.Hash.hashalgo import HashAlgo + +class MD2Hash(HashAlgo): + oid: Any + digest_size: int + block_size: int + def __init__(self, data: Optional[Any] = ...) -> None: ... + def new(self, data: Optional[Any] = ...): ... + +def new(data: Optional[Any] = ...): ... + +digest_size: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/MD4.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/MD4.pyi new file mode 100644 index 0000000..644b3bd --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/MD4.pyi @@ -0,0 +1,13 @@ +from typing import Any, Optional +from Crypto.Hash.hashalgo import HashAlgo + +class MD4Hash(HashAlgo): + oid: Any + digest_size: int + block_size: int + def __init__(self, data: Optional[Any] = ...) -> None: ... + def new(self, data: Optional[Any] = ...): ... + +def new(data: Optional[Any] = ...): ... + +digest_size: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/MD5.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/MD5.pyi new file mode 100644 index 0000000..52261ab --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/MD5.pyi @@ -0,0 +1,13 @@ +from typing import Any, Optional +from Crypto.Hash.hashalgo import HashAlgo + +class MD5Hash(HashAlgo): + oid: Any + digest_size: int + block_size: int + def __init__(self, data: Optional[Any] = ...) -> None: ... + def new(self, data: Optional[Any] = ...): ... + +def new(data: Optional[Any] = ...): ... + +digest_size: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/RIPEMD.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/RIPEMD.pyi new file mode 100644 index 0000000..3fe4ac5 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/RIPEMD.pyi @@ -0,0 +1,13 @@ +from typing import Any, Optional +from Crypto.Hash.hashalgo import HashAlgo + +class RIPEMD160Hash(HashAlgo): + oid: Any + digest_size: int + block_size: int + def __init__(self, data: Optional[Any] = ...) -> None: ... + def new(self, data: Optional[Any] = ...): ... + +def new(data: Optional[Any] = ...): ... + +digest_size: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA.pyi new file mode 100644 index 0000000..145abd8 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA.pyi @@ -0,0 +1,13 @@ +from typing import Any, Optional +from Crypto.Hash.hashalgo import HashAlgo + +class SHA1Hash(HashAlgo): + oid: Any + digest_size: int + block_size: int + def __init__(self, data: Optional[Any] = ...) -> None: ... + def new(self, data: Optional[Any] = ...): ... + +def new(data: Optional[Any] = ...): ... + +digest_size: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA224.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA224.pyi new file mode 100644 index 0000000..fcd170f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA224.pyi @@ -0,0 +1,13 @@ +from typing import Any, Optional +from Crypto.Hash.hashalgo import HashAlgo + +class SHA224Hash(HashAlgo): + oid: Any + digest_size: int + block_size: int + def __init__(self, data: Optional[Any] = ...) -> None: ... + def new(self, data: Optional[Any] = ...): ... + +def new(data: Optional[Any] = ...): ... + +digest_size: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA256.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA256.pyi new file mode 100644 index 0000000..2ee9472 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA256.pyi @@ -0,0 +1,13 @@ +from typing import Any, Optional +from Crypto.Hash.hashalgo import HashAlgo + +class SHA256Hash(HashAlgo): + oid: Any + digest_size: int + block_size: int + def __init__(self, data: Optional[Any] = ...) -> None: ... + def new(self, data: Optional[Any] = ...): ... + +def new(data: Optional[Any] = ...): ... + +digest_size: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA384.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA384.pyi new file mode 100644 index 0000000..ce63a32 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA384.pyi @@ -0,0 +1,13 @@ +from typing import Any, Optional +from Crypto.Hash.hashalgo import HashAlgo + +class SHA384Hash(HashAlgo): + oid: Any + digest_size: int + block_size: int + def __init__(self, data: Optional[Any] = ...) -> None: ... + def new(self, data: Optional[Any] = ...): ... + +def new(data: Optional[Any] = ...): ... + +digest_size: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA512.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA512.pyi new file mode 100644 index 0000000..c59eb76 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA512.pyi @@ -0,0 +1,13 @@ +from typing import Any, Optional +from Crypto.Hash.hashalgo import HashAlgo + +class SHA512Hash(HashAlgo): + oid: Any + digest_size: int + block_size: int + def __init__(self, data: Optional[Any] = ...) -> None: ... + def new(self, data: Optional[Any] = ...): ... + +def new(data: Optional[Any] = ...): ... + +digest_size: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/__init__.pyi new file mode 100644 index 0000000..9af06f4 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/__init__.pyi @@ -0,0 +1,11 @@ +# Names in __all__ with no definition: +# HMAC +# MD2 +# MD4 +# MD5 +# RIPEMD +# SHA +# SHA224 +# SHA256 +# SHA384 +# SHA512 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/hashalgo.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/hashalgo.pyi new file mode 100644 index 0000000..7c57e03 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/hashalgo.pyi @@ -0,0 +1,11 @@ +from typing import Any, Optional + +class HashAlgo: + digest_size: Any + block_size: Any + def __init__(self, hashFactory, data: Optional[Any] = ...) -> None: ... + def update(self, data): ... + def digest(self): ... + def hexdigest(self): ... + def copy(self): ... + def new(self, data: Optional[Any] = ...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Protocol/AllOrNothing.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Protocol/AllOrNothing.pyi new file mode 100644 index 0000000..a7ae7d6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Protocol/AllOrNothing.pyi @@ -0,0 +1,10 @@ +from typing import Any, Optional + +__revision__: str + +def isInt(x): ... + +class AllOrNothing: + def __init__(self, ciphermodule, mode: Optional[Any] = ..., IV: Optional[Any] = ...) -> None: ... + def digest(self, text): ... + def undigest(self, blocks): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Protocol/Chaffing.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Protocol/Chaffing.pyi new file mode 100644 index 0000000..d70e9f6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Protocol/Chaffing.pyi @@ -0,0 +1,5 @@ +__revision__: str + +class Chaff: + def __init__(self, factor: float = ..., blocksper: int = ...) -> None: ... + def chaff(self, blocks): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Protocol/KDF.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Protocol/KDF.pyi new file mode 100644 index 0000000..a10d839 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Protocol/KDF.pyi @@ -0,0 +1,7 @@ +from typing import Any, Optional +from Crypto.Hash import SHA as SHA1 + +__revision__: str + +def PBKDF1(password, salt, dkLen, count: int = ..., hashAlgo: Optional[Any] = ...): ... +def PBKDF2(password, salt, dkLen: int = ..., count: int = ..., prf: Optional[Any] = ...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Protocol/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Protocol/__init__.pyi new file mode 100644 index 0000000..e3744e5 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Protocol/__init__.pyi @@ -0,0 +1,4 @@ +# Names in __all__ with no definition: +# AllOrNothing +# Chaffing +# KDF diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/DSA.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/DSA.pyi new file mode 100644 index 0000000..bc48d23 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/DSA.pyi @@ -0,0 +1,27 @@ +from typing import Any, Optional +from .pubkey import pubkey + +class _DSAobj(pubkey): + keydata: Any + implementation: Any + key: Any + def __init__(self, implementation, key) -> None: ... + def __getattr__(self, attrname): ... + def sign(self, M, K): ... + def verify(self, M, signature): ... + def has_private(self): ... + def size(self): ... + def can_blind(self): ... + def can_encrypt(self): ... + def can_sign(self): ... + def publickey(self): ... + +class DSAImplementation: + error: Any + def __init__(self, **kwargs) -> None: ... + def generate(self, bits, randfunc: Optional[Any] = ..., progress_func: Optional[Any] = ...): ... + def construct(self, tup): ... + +generate: Any +construct: Any +error: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/ElGamal.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/ElGamal.pyi new file mode 100644 index 0000000..1a256a3 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/ElGamal.pyi @@ -0,0 +1,19 @@ +from typing import Any, Optional + +from Crypto.PublicKey.pubkey import pubkey +from Crypto.PublicKey.pubkey import * # noqa: F403 + +class error(Exception): ... + +def generate(bits, randfunc, progress_func: Optional[Any] = ...): ... +def construct(tup): ... + +class ElGamalobj(pubkey): + keydata: Any + def encrypt(self, plaintext, K): ... + def decrypt(self, ciphertext): ... + def sign(self, M, K): ... + def verify(self, M, signature): ... + def size(self): ... + def has_private(self): ... + def publickey(self): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/RSA.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/RSA.pyi new file mode 100644 index 0000000..5ce7b91 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/RSA.pyi @@ -0,0 +1,32 @@ +from typing import Any, Optional, Union, Text +from .pubkey import pubkey + +class _RSAobj(pubkey): + keydata: Any + implementation: Any + key: Any + def __init__(self, implementation, key, randfunc: Optional[Any] = ...) -> None: ... + def __getattr__(self, attrname): ... + def encrypt(self, plaintext, K): ... + def decrypt(self, ciphertext): ... + def sign(self, M, K): ... + def verify(self, M, signature): ... + def has_private(self): ... + def size(self): ... + def can_blind(self): ... + def can_encrypt(self): ... + def can_sign(self): ... + def publickey(self): ... + def exportKey(self, format: str = ..., passphrase: Optional[Any] = ..., pkcs: int = ...): ... + +class RSAImplementation: + error: Any + def __init__(self, **kwargs) -> None: ... + def generate(self, bits, randfunc: Optional[Any] = ..., progress_func: Optional[Any] = ..., e: int = ...): ... + def construct(self, tup): ... + def importKey(self, externKey: Any, passphrase: Union[None, bytes, Text] = ...) -> _RSAobj: ... + +generate: Any +construct: Any +importKey: Any +error: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/__init__.pyi new file mode 100644 index 0000000..36d9e94 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/__init__.pyi @@ -0,0 +1,4 @@ +# Names in __all__ with no definition: +# DSA +# ElGamal +# RSA diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/pubkey.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/pubkey.pyi new file mode 100644 index 0000000..b9281ad --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/pubkey.pyi @@ -0,0 +1,21 @@ +from Crypto.Util.number import * # noqa: F403 + +__revision__: str + +class pubkey: + def __init__(self) -> None: ... + def encrypt(self, plaintext, K): ... + def decrypt(self, ciphertext): ... + def sign(self, M, K): ... + def verify(self, M, signature): ... + def validate(self, M, signature): ... + def blind(self, M, B): ... + def unblind(self, M, B): ... + def can_sign(self): ... + def can_encrypt(self): ... + def can_blind(self): ... + def size(self): ... + def has_private(self): ... + def publickey(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/Fortuna/FortunaAccumulator.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/Fortuna/FortunaAccumulator.pyi new file mode 100644 index 0000000..40149bf --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/Fortuna/FortunaAccumulator.pyi @@ -0,0 +1,25 @@ +from typing import Any + +__revision__: str + +class FortunaPool: + digest_size: Any + def __init__(self) -> None: ... + def append(self, data): ... + def digest(self): ... + def hexdigest(self): ... + length: int + def reset(self): ... + +def which_pools(r): ... + +class FortunaAccumulator: + min_pool_size: int + reseed_interval: float + reseed_count: int + generator: Any + last_reseed: Any + pools: Any + def __init__(self) -> None: ... + def random_data(self, bytes): ... + def add_random_event(self, source_number, pool_number, data): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/Fortuna/FortunaGenerator.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/Fortuna/FortunaGenerator.pyi new file mode 100644 index 0000000..047ac93 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/Fortuna/FortunaGenerator.pyi @@ -0,0 +1,16 @@ +from typing import Any + +__revision__: str + +class AESGenerator: + block_size: Any + key_size: int + max_blocks_per_request: Any + counter: Any + key: Any + block_size_shift: Any + blocks_per_key: Any + max_bytes_per_request: Any + def __init__(self) -> None: ... + def reseed(self, seed): ... + def pseudo_random_data(self, bytes): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/Fortuna/SHAd256.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/Fortuna/SHAd256.pyi new file mode 100644 index 0000000..1fbd51f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/Fortuna/SHAd256.pyi @@ -0,0 +1,13 @@ +from typing import Any, Optional + +class _SHAd256: + digest_size: Any + def __init__(self, internal_api_check, sha256_hash_obj) -> None: ... + def copy(self): ... + def digest(self): ... + def hexdigest(self): ... + def update(self, data): ... + +digest_size: Any + +def new(data: Optional[Any] = ...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/Fortuna/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/Fortuna/__init__.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/OSRNG/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/OSRNG/__init__.pyi new file mode 100644 index 0000000..d1f1427 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/OSRNG/__init__.pyi @@ -0,0 +1 @@ +__revision__: str diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/OSRNG/fallback.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/OSRNG/fallback.pyi new file mode 100644 index 0000000..72df987 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/OSRNG/fallback.pyi @@ -0,0 +1,5 @@ +from .rng_base import BaseRNG + +class PythonOSURandomRNG(BaseRNG): + name: str + def __init__(self) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/OSRNG/posix.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/OSRNG/posix.pyi new file mode 100644 index 0000000..bbaf740 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/OSRNG/posix.pyi @@ -0,0 +1,6 @@ +from typing import Any, Optional +from .rng_base import BaseRNG + +class DevURandomRNG(BaseRNG): + name: str + def __init__(self, devname: Optional[Any] = ...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/OSRNG/rng_base.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/OSRNG/rng_base.pyi new file mode 100644 index 0000000..12e3d81 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/OSRNG/rng_base.pyi @@ -0,0 +1,11 @@ +__revision__: str + +class BaseRNG: + closed: bool + def __init__(self) -> None: ... + def __del__(self): ... + def __enter__(self): ... + def __exit__(self): ... + def close(self): ... + def flush(self): ... + def read(self, N: int = ...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/__init__.pyi new file mode 100644 index 0000000..f30acfd --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/__init__.pyi @@ -0,0 +1 @@ +def new(*args, **kwargs): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/random.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/random.pyi new file mode 100644 index 0000000..88ea62e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/random.pyi @@ -0,0 +1,17 @@ +from typing import Any, Optional + +class StrongRandom: + def __init__(self, rng: Optional[Any] = ..., randfunc: Optional[Any] = ...) -> None: ... + def getrandbits(self, k): ... + def randrange(self, *args): ... + def randint(self, a, b): ... + def choice(self, seq): ... + def shuffle(self, x): ... + def sample(self, population, k): ... + +getrandbits: Any +randrange: Any +randint: Any +choice: Any +shuffle: Any +sample: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Signature/PKCS1_PSS.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Signature/PKCS1_PSS.pyi new file mode 100644 index 0000000..8341c2b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Signature/PKCS1_PSS.pyi @@ -0,0 +1,9 @@ +from typing import Any, Optional + +class PSS_SigScheme: + def __init__(self, key, mgfunc, saltLen) -> None: ... + def can_sign(self): ... + def sign(self, mhash): ... + def verify(self, mhash, S): ... + +def new(key, mgfunc: Optional[Any] = ..., saltLen: Optional[Any] = ...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Signature/PKCS1_v1_5.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Signature/PKCS1_v1_5.pyi new file mode 100644 index 0000000..4a2b225 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Signature/PKCS1_v1_5.pyi @@ -0,0 +1,7 @@ +class PKCS115_SigScheme: + def __init__(self, key) -> None: ... + def can_sign(self): ... + def sign(self, mhash): ... + def verify(self, mhash, S): ... + +def new(key): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Signature/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Signature/__init__.pyi new file mode 100644 index 0000000..560f06f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Signature/__init__.pyi @@ -0,0 +1,3 @@ +# Names in __all__ with no definition: +# PKCS1_PSS +# PKCS1_v1_5 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/Counter.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/Counter.pyi new file mode 100644 index 0000000..4aae7f2 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/Counter.pyi @@ -0,0 +1,3 @@ +from typing import Any + +def new(nbits, prefix: Any = ..., suffix: Any = ..., initial_value: int = ..., overflow: int = ..., little_endian: bool = ..., allow_wraparound: bool = ..., disable_shortcut: bool = ...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/RFC1751.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/RFC1751.pyi new file mode 100644 index 0000000..e1e8f5e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/RFC1751.pyi @@ -0,0 +1,9 @@ +from typing import Any + +__revision__: str +binary: Any + +def key_to_english(key): ... +def english_to_key(s): ... + +wordlist: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/__init__.pyi new file mode 100644 index 0000000..1747299 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/__init__.pyi @@ -0,0 +1,6 @@ +# Names in __all__ with no definition: +# RFC1751 +# asn1 +# number +# randpool +# strxor diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/asn1.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/asn1.pyi new file mode 100644 index 0000000..03d4b29 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/asn1.pyi @@ -0,0 +1,45 @@ +from typing import Any, Optional + +class DerObject: + typeTags: Any + typeTag: Any + payload: Any + def __init__(self, ASN1Type: Optional[Any] = ..., payload: Any = ...) -> None: ... + def isType(self, ASN1Type): ... + def encode(self): ... + def decode(self, derEle, noLeftOvers: int = ...): ... + +class DerInteger(DerObject): + value: Any + def __init__(self, value: int = ...) -> None: ... + payload: Any + def encode(self): ... + def decode(self, derEle, noLeftOvers: int = ...): ... + +class DerSequence(DerObject): + def __init__(self, startSeq: Optional[Any] = ...) -> None: ... + def __delitem__(self, n): ... + def __getitem__(self, n): ... + def __setitem__(self, key, value): ... + def __setslice__(self, i, j, sequence): ... + def __delslice__(self, i, j): ... + def __getslice__(self, i, j): ... + def __len__(self): ... + def append(self, item): ... + def hasInts(self): ... + def hasOnlyInts(self): ... + payload: Any + def encode(self): ... + def decode(self, derEle, noLeftOvers: int = ...): ... + +class DerOctetString(DerObject): + payload: Any + def __init__(self, value: Any = ...) -> None: ... + def decode(self, derEle, noLeftOvers: int = ...): ... + +class DerNull(DerObject): + def __init__(self) -> None: ... + +class DerObjectId(DerObject): + def __init__(self) -> None: ... + def decode(self, derEle, noLeftOvers: int = ...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/number.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/number.pyi new file mode 100644 index 0000000..4ffbd03 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/number.pyi @@ -0,0 +1,22 @@ +from typing import Any, Optional +from warnings import warn as _warn + +__revision__: str +bignum: Any + +def size(N): ... +def getRandomNumber(N, randfunc: Optional[Any] = ...): ... +def getRandomInteger(N, randfunc: Optional[Any] = ...): ... +def getRandomRange(a, b, randfunc: Optional[Any] = ...): ... +def getRandomNBitInteger(N, randfunc: Optional[Any] = ...): ... +def GCD(x, y): ... +def inverse(u, v): ... +def getPrime(N, randfunc: Optional[Any] = ...): ... +def getStrongPrime(N, e: int = ..., false_positive_prob: float = ..., randfunc: Optional[Any] = ...): ... +def isPrime(N, false_positive_prob: float = ..., randfunc: Optional[Any] = ...): ... +def long_to_bytes(n, blocksize: int = ...): ... +def bytes_to_long(s): ... +def long2str(n, blocksize: int = ...): ... +def str2long(s): ... + +sieve_base: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/randpool.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/randpool.pyi new file mode 100644 index 0000000..4d90f92 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/randpool.pyi @@ -0,0 +1,16 @@ +from typing import Any, Optional + +__revision__: str + +class RandomPool: + bytes: Any + bits: Any + entropy: Any + def __init__(self, numbytes: int = ..., cipher: Optional[Any] = ..., hash: Optional[Any] = ..., file: Optional[Any] = ...) -> None: ... + def get_bytes(self, N): ... + def randomize(self, N: int = ...): ... + def stir(self, s: str = ...): ... + def stir_n(self, N: int = ...): ... + def add_event(self, s: str = ...): ... + def getBytes(self, N): ... + def addEvent(self, event, s: str = ...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/strxor.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/strxor.pyi new file mode 100644 index 0000000..cb6269b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/strxor.pyi @@ -0,0 +1,2 @@ +def strxor(*args, **kwargs): ... +def strxor_c(*args, **kwargs): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/__init__.pyi new file mode 100644 index 0000000..6d8e124 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/__init__.pyi @@ -0,0 +1,7 @@ +# Names in __all__ with no definition: +# Cipher +# Hash +# Protocol +# PublicKey +# Signature +# Util diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/pct_warnings.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/pct_warnings.pyi new file mode 100644 index 0000000..b77e975 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/Crypto/pct_warnings.pyi @@ -0,0 +1,7 @@ +class CryptoWarning(Warning): ... +class CryptoDeprecationWarning(DeprecationWarning, CryptoWarning): ... +class CryptoRuntimeWarning(RuntimeWarning, CryptoWarning): ... +class RandomPool_DeprecationWarning(CryptoDeprecationWarning): ... +class ClockRewindWarning(CryptoRuntimeWarning): ... +class GetRandomNumber_DeprecationWarning(CryptoDeprecationWarning): ... +class PowmInsecureWarning(CryptoRuntimeWarning): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/atomicwrites/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/atomicwrites/__init__.pyi new file mode 100644 index 0000000..07edff6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/atomicwrites/__init__.pyi @@ -0,0 +1,13 @@ +from typing import AnyStr, Callable, ContextManager, IO, Optional, Text, Type + +def replace_atomic(src: AnyStr, dst: AnyStr) -> None: ... +def move_atomic(src: AnyStr, dst: AnyStr) -> None: ... +class AtomicWriter(object): + def __init__(self, path: AnyStr, mode: Text = ..., overwrite: bool = ...) -> None: ... + def open(self) -> ContextManager[IO]: ... + def _open(self, get_fileobject: Callable) -> ContextManager[IO]: ... + def get_fileobject(self, dir: Optional[AnyStr] = ..., **kwargs) -> IO: ... + def sync(self, f: IO) -> None: ... + def commit(self, f: IO) -> None: ... + def rollback(self, f: IO) -> None: ... +def atomic_write(path: AnyStr, writer_cls: Type[AtomicWriter] = ..., **cls_kwargs: object) -> ContextManager[IO]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/attr/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/attr/__init__.pyi new file mode 100644 index 0000000..fcb93b1 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/attr/__init__.pyi @@ -0,0 +1,255 @@ +from typing import ( + Any, + Callable, + Dict, + Generic, + List, + Optional, + Sequence, + Mapping, + Tuple, + Type, + TypeVar, + Union, + overload, +) + +# `import X as X` is required to make these public +from . import exceptions as exceptions +from . import filters as filters +from . import converters as converters +from . import validators as validators + +_T = TypeVar("_T") +_C = TypeVar("_C", bound=type) + +_ValidatorType = Callable[[Any, Attribute[_T], _T], Any] +_ConverterType = Callable[[Any], _T] +_FilterType = Callable[[Attribute[_T], _T], bool] +# FIXME: in reality, if multiple validators are passed they must be in a list or tuple, +# but those are invariant and so would prevent subtypes of _ValidatorType from working +# when passed in a list or tuple. +_ValidatorArgType = Union[_ValidatorType[_T], Sequence[_ValidatorType[_T]]] + +# _make -- + +NOTHING: object + +# NOTE: Factory lies about its return type to make this possible: `x: List[int] = Factory(list)` +# Work around mypy issue #4554 in the common case by using an overload. +@overload +def Factory(factory: Callable[[], _T]) -> _T: ... +@overload +def Factory( + factory: Union[Callable[[Any], _T], Callable[[], _T]], + takes_self: bool = ..., +) -> _T: ... + +class Attribute(Generic[_T]): + name: str + default: Optional[_T] + validator: Optional[_ValidatorType[_T]] + repr: bool + cmp: bool + hash: Optional[bool] + init: bool + converter: Optional[_ConverterType[_T]] + metadata: Dict[Any, Any] + type: Optional[Type[_T]] + kw_only: bool + def __lt__(self, x: Attribute[_T]) -> bool: ... + def __le__(self, x: Attribute[_T]) -> bool: ... + def __gt__(self, x: Attribute[_T]) -> bool: ... + def __ge__(self, x: Attribute[_T]) -> bool: ... + +# NOTE: We had several choices for the annotation to use for type arg: +# 1) Type[_T] +# - Pros: Handles simple cases correctly +# - Cons: Might produce less informative errors in the case of conflicting TypeVars +# e.g. `attr.ib(default='bad', type=int)` +# 2) Callable[..., _T] +# - Pros: Better error messages than #1 for conflicting TypeVars +# - Cons: Terrible error messages for validator checks. +# e.g. attr.ib(type=int, validator=validate_str) +# -> error: Cannot infer function type argument +# 3) type (and do all of the work in the mypy plugin) +# - Pros: Simple here, and we could customize the plugin with our own errors. +# - Cons: Would need to write mypy plugin code to handle all the cases. +# We chose option #1. + +# `attr` lies about its return type to make the following possible: +# attr() -> Any +# attr(8) -> int +# attr(validator=) -> Whatever the callable expects. +# This makes this type of assignments possible: +# x: int = attr(8) +# +# This form catches explicit None or no default but with no other arguments returns Any. +@overload +def attrib( + default: None = ..., + validator: None = ..., + repr: bool = ..., + cmp: bool = ..., + hash: Optional[bool] = ..., + init: bool = ..., + convert: None = ..., + metadata: Optional[Mapping[Any, Any]] = ..., + type: None = ..., + converter: None = ..., + factory: None = ..., + kw_only: bool = ..., +) -> Any: ... + +# This form catches an explicit None or no default and infers the type from the other arguments. +@overload +def attrib( + default: None = ..., + validator: Optional[_ValidatorArgType[_T]] = ..., + repr: bool = ..., + cmp: bool = ..., + hash: Optional[bool] = ..., + init: bool = ..., + convert: Optional[_ConverterType[_T]] = ..., + metadata: Optional[Mapping[Any, Any]] = ..., + type: Optional[Type[_T]] = ..., + converter: Optional[_ConverterType[_T]] = ..., + factory: Optional[Callable[[], _T]] = ..., + kw_only: bool = ..., +) -> _T: ... + +# This form catches an explicit default argument. +@overload +def attrib( + default: _T, + validator: Optional[_ValidatorArgType[_T]] = ..., + repr: bool = ..., + cmp: bool = ..., + hash: Optional[bool] = ..., + init: bool = ..., + convert: Optional[_ConverterType[_T]] = ..., + metadata: Optional[Mapping[Any, Any]] = ..., + type: Optional[Type[_T]] = ..., + converter: Optional[_ConverterType[_T]] = ..., + factory: Optional[Callable[[], _T]] = ..., + kw_only: bool = ..., +) -> _T: ... + +# This form covers type=non-Type: e.g. forward references (str), Any +@overload +def attrib( + default: Optional[_T] = ..., + validator: Optional[_ValidatorArgType[_T]] = ..., + repr: bool = ..., + cmp: bool = ..., + hash: Optional[bool] = ..., + init: bool = ..., + convert: Optional[_ConverterType[_T]] = ..., + metadata: Optional[Mapping[Any, Any]] = ..., + type: object = ..., + converter: Optional[_ConverterType[_T]] = ..., + factory: Optional[Callable[[], _T]] = ..., + kw_only: bool = ..., +) -> Any: ... +@overload +def attrs( + maybe_cls: _C, + these: Optional[Dict[str, Any]] = ..., + repr_ns: Optional[str] = ..., + repr: bool = ..., + cmp: bool = ..., + hash: Optional[bool] = ..., + init: bool = ..., + slots: bool = ..., + frozen: bool = ..., + weakref_slot: bool = ..., + str: bool = ..., + auto_attribs: bool = ..., + kw_only: bool = ..., + cache_hash: bool = ..., + auto_exc: bool = ..., +) -> _C: ... +@overload +def attrs( + maybe_cls: None = ..., + these: Optional[Dict[str, Any]] = ..., + repr_ns: Optional[str] = ..., + repr: bool = ..., + cmp: bool = ..., + hash: Optional[bool] = ..., + init: bool = ..., + slots: bool = ..., + frozen: bool = ..., + weakref_slot: bool = ..., + str: bool = ..., + auto_attribs: bool = ..., + kw_only: bool = ..., + cache_hash: bool = ..., + auto_exc: bool = ..., +) -> Callable[[_C], _C]: ... + +# TODO: add support for returning NamedTuple from the mypy plugin +class _Fields(Tuple[Attribute[Any], ...]): + def __getattr__(self, name: str) -> Attribute[Any]: ... + +def fields(cls: type) -> _Fields: ... +def fields_dict(cls: type) -> Dict[str, Attribute[Any]]: ... +def validate(inst: Any) -> None: ... + +# TODO: add support for returning a proper attrs class from the mypy plugin +# we use Any instead of _CountingAttr so that e.g. `make_class('Foo', [attr.ib()])` is valid +def make_class( + name: str, + attrs: Union[List[str], Tuple[str, ...], Dict[str, Any]], + bases: Tuple[type, ...] = ..., + repr_ns: Optional[str] = ..., + repr: bool = ..., + cmp: bool = ..., + hash: Optional[bool] = ..., + init: bool = ..., + slots: bool = ..., + frozen: bool = ..., + weakref_slot: bool = ..., + str: bool = ..., + auto_attribs: bool = ..., + kw_only: bool = ..., + cache_hash: bool = ..., + auto_exc: bool = ..., +) -> type: ... + +# _funcs -- + +# TODO: add support for returning TypedDict from the mypy plugin +# FIXME: asdict/astuple do not honor their factory args. waiting on one of these: +# https://github.com/python/mypy/issues/4236 +# https://github.com/python/typing/issues/253 +def asdict( + inst: Any, + recurse: bool = ..., + filter: Optional[_FilterType[Any]] = ..., + dict_factory: Type[Mapping[Any, Any]] = ..., + retain_collection_types: bool = ..., +) -> Dict[str, Any]: ... + +# TODO: add support for returning NamedTuple from the mypy plugin +def astuple( + inst: Any, + recurse: bool = ..., + filter: Optional[_FilterType[Any]] = ..., + tuple_factory: Type[Sequence[Any]] = ..., + retain_collection_types: bool = ..., +) -> Tuple[Any, ...]: ... +def has(cls: type) -> bool: ... +def assoc(inst: _T, **changes: Any) -> _T: ... +def evolve(inst: _T, **changes: Any) -> _T: ... + +# _config -- + +def set_run_validators(run: bool) -> None: ... +def get_run_validators() -> bool: ... + +# aliases -- + +s = attributes = attrs +ib = attr = attrib +dataclass = attrs # Technically, partial(attrs, auto_attribs=True) ;) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/attr/converters.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/attr/converters.pyi new file mode 100644 index 0000000..63b2a38 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/attr/converters.pyi @@ -0,0 +1,12 @@ +from typing import TypeVar, Optional, Callable, overload +from . import _ConverterType + +_T = TypeVar("_T") + +def optional( + converter: _ConverterType[_T] +) -> _ConverterType[Optional[_T]]: ... +@overload +def default_if_none(default: _T) -> _ConverterType[_T]: ... +@overload +def default_if_none(*, factory: Callable[[], _T]) -> _ConverterType[_T]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/attr/exceptions.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/attr/exceptions.pyi new file mode 100644 index 0000000..48fffcc --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/attr/exceptions.pyi @@ -0,0 +1,7 @@ +class FrozenInstanceError(AttributeError): + msg: str = ... + +class AttrsAttributeNotFoundError(ValueError): ... +class NotAnAttrsClassError(ValueError): ... +class DefaultAlreadySetError(RuntimeError): ... +class UnannotatedAttributeError(RuntimeError): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/attr/filters.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/attr/filters.pyi new file mode 100644 index 0000000..68368fe --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/attr/filters.pyi @@ -0,0 +1,5 @@ +from typing import Union, Any +from . import Attribute, _FilterType + +def include(*what: Union[type, Attribute[Any]]) -> _FilterType[Any]: ... +def exclude(*what: Union[type, Attribute[Any]]) -> _FilterType[Any]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/attr/validators.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/attr/validators.pyi new file mode 100644 index 0000000..01af068 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/attr/validators.pyi @@ -0,0 +1,24 @@ +from typing import Container, List, Union, TypeVar, Type, Any, Optional, Tuple +from . import _ValidatorType + +_T = TypeVar("_T") + +def instance_of( + type: Union[Tuple[Type[_T], ...], Type[_T]] +) -> _ValidatorType[_T]: ... +def provides(interface: Any) -> _ValidatorType[Any]: ... +def optional( + validator: Union[_ValidatorType[_T], List[_ValidatorType[_T]]] +) -> _ValidatorType[Optional[_T]]: ... +def in_(options: Container[_T]) -> _ValidatorType[_T]: ... +def and_(*validators: _ValidatorType[_T]) -> _ValidatorType[_T]: ... +def deep_iterable( + member_validator: _ValidatorType[_T], + iterable_validator: Optional[_ValidatorType[_T]], +) -> _ValidatorType[_T]: ... +def deep_mapping( + key_validator: _ValidatorType[_T], + value_validator: _ValidatorType[_T], + mapping_validator: Optional[_ValidatorType[_T]], +) -> _ValidatorType[_T]: ... +def is_callable() -> _ValidatorType[_T]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/backports/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/backports/__init__.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/backports/ssl_match_hostname.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/backports/ssl_match_hostname.pyi new file mode 100644 index 0000000..c219980 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/backports/ssl_match_hostname.pyi @@ -0,0 +1,3 @@ +class CertificateError(ValueError): ... + +def match_hostname(cert, hostname): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/backports_abc.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/backports_abc.pyi new file mode 100644 index 0000000..b48ae33 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/backports_abc.pyi @@ -0,0 +1,15 @@ +from typing import Any + +def mk_gen(): ... +def mk_awaitable(): ... +def mk_coroutine(): ... + +Generator: Any +Awaitable: Any +Coroutine: Any + +def isawaitable(obj): ... + +PATCHED: Any + +def patch(patch_inspect: bool = ...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/bleach/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/bleach/__init__.pyi new file mode 100644 index 0000000..3a1ad2c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/bleach/__init__.pyi @@ -0,0 +1,32 @@ +from typing import Any, Container, Iterable, Optional, Text + +from bleach.linkifier import DEFAULT_CALLBACKS as DEFAULT_CALLBACKS, Linker as Linker +from bleach.sanitizer import ( + ALLOWED_ATTRIBUTES as ALLOWED_ATTRIBUTES, + ALLOWED_PROTOCOLS as ALLOWED_PROTOCOLS, + ALLOWED_STYLES as ALLOWED_STYLES, + ALLOWED_TAGS as ALLOWED_TAGS, + Cleaner as Cleaner, +) + +from .linkifier import _Callback + +__releasedate__: Text +__version__: Text +VERSION: Any # packaging.version.Version + +def clean( + text: Text, + tags: Container[Text] = ..., + attributes: Any = ..., + styles: Container[Text] = ..., + protocols: Container[Text] = ..., + strip: bool = ..., + strip_comments: bool = ..., +) -> Text: ... +def linkify( + text: Text, + callbacks: Iterable[_Callback] = ..., + skip_tags: Optional[Container[Text]] = ..., + parse_email: bool = ..., +) -> Text: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/bleach/callbacks.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/bleach/callbacks.pyi new file mode 100644 index 0000000..25c5c01 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/bleach/callbacks.pyi @@ -0,0 +1,6 @@ +from typing import MutableMapping, Any, Text + +_Attrs = MutableMapping[Any, Text] + +def nofollow(attrs: _Attrs, new: bool = ...) -> _Attrs: ... +def target_blank(attrs: _Attrs, new: bool = ...) -> _Attrs: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/bleach/linkifier.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/bleach/linkifier.pyi new file mode 100644 index 0000000..f6ef3ce --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/bleach/linkifier.pyi @@ -0,0 +1,31 @@ +from typing import Any, Container, Iterable, List, MutableMapping, Optional, Pattern, Protocol, Text + +_Attrs = MutableMapping[Any, Text] + +class _Callback(Protocol): + def __call__(self, attrs: _Attrs, new: bool = ...) -> _Attrs: ... + +DEFAULT_CALLBACKS: List[_Callback] + +TLDS: List[Text] + +def build_url_re(tlds: Iterable[Text] = ..., protocols: Iterable[Text] = ...) -> Pattern[Text]: ... + +URL_RE: Pattern[Text] +PROTO_RE: Pattern[Text] +EMAIL_RE: Pattern[Text] + +class Linker(object): + def __init__( + self, + callbacks: Iterable[_Callback] = ..., + skip_tags: Optional[Container[Text]] = ..., + parse_email: bool = ..., + url_re: Pattern[Text] = ..., + email_re: Pattern[Text] = ..., + recognized_tags: Optional[Container[Text]] = ..., + ) -> None: ... + def linkify(self, text: Text) -> Text: ... + +class LinkifyFilter(object): # TODO: derives from html5lib.Filter + def __getattr__(self, item: str) -> Any: ... # incomplete diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/bleach/sanitizer.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/bleach/sanitizer.pyi new file mode 100644 index 0000000..c6a7283 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/bleach/sanitizer.pyi @@ -0,0 +1,34 @@ +from typing import Any, Callable, Container, Dict, Iterable, List, Optional, Pattern, Text, Type, Union + +ALLOWED_TAGS: List[Text] +ALLOWED_ATTRIBUTES: Dict[Text, List[Text]] +ALLOWED_STYLES: List[Text] +ALLOWED_PROTOCOLS: List[Text] + +INVISIBLE_CHARACTERS: Text +INVISIBLE_CHARACTERS_RE: Pattern[Text] +INVISIBLE_REPLACEMENT_CHAR: Text + +# A html5lib Filter class +_Filter = Any + +class Cleaner(object): + def __init__( + self, + tags: Container[Text] = ..., + attributes: Any = ..., + styles: Container[Text] = ..., + protocols: Container[Text] = ..., + strip: bool = ..., + strip_comments: bool = ..., + filters: Optional[Iterable[_Filter]] = ..., + ) -> None: ... + def clean(self, text: Text) -> Text: ... + +_AttributeFilter = Callable[[Text, Text, Text], bool] +_AttributeDict = Dict[Text, Union[Container[Text], _AttributeFilter]] + +def attribute_filter_factory(attributes: Union[_AttributeFilter, _AttributeDict, Container[Text]]) -> _AttributeFilter: ... + +class BleachSanitizerFilter(object): # TODO: derives from html5lib.sanitizer.Filter + def __getattr__(self, item: str) -> Any: ... # incomplete diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/bleach/utils.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/bleach/utils.pyi new file mode 100644 index 0000000..984c554 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/bleach/utils.pyi @@ -0,0 +1,8 @@ +from collections import OrderedDict +from typing import overload, Mapping, Any, Text + +@overload +def alphabetize_attributes(attrs: None) -> None: ... +@overload +def alphabetize_attributes(attrs: Mapping[Any, Text]) -> OrderedDict[Any, Text]: ... +def force_unicode(text: Text) -> Text: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/__init__.pyi new file mode 100644 index 0000000..8426785 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/__init__.pyi @@ -0,0 +1,76 @@ +from typing import Any, Optional, Text +import logging + +from .s3.connection import S3Connection + +Version: Any +UserAgent: Any +config: Any +BUCKET_NAME_RE: Any +TOO_LONG_DNS_NAME_COMP: Any +GENERATION_RE: Any +VERSION_RE: Any +ENDPOINTS_PATH: Any + +def init_logging(): ... + +class NullHandler(logging.Handler): + def emit(self, record): ... + +log: Any +perflog: Any + +def set_file_logger(name, filepath, level: Any = ..., format_string: Optional[Any] = ...): ... +def set_stream_logger(name, level: Any = ..., format_string: Optional[Any] = ...): ... +def connect_sqs(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_s3(aws_access_key_id: Optional[Text] = ..., aws_secret_access_key: Optional[Text] = ..., **kwargs) -> S3Connection: ... +def connect_gs(gs_access_key_id: Optional[Any] = ..., gs_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_ec2(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_elb(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_autoscale(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_cloudwatch(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_sdb(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_fps(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_mturk(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_cloudfront(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_vpc(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_rds(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_rds2(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_emr(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_sns(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_iam(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_route53(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_cloudformation(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_euca(host: Optional[Any] = ..., aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., port: int = ..., path: str = ..., is_secure: bool = ..., **kwargs): ... +def connect_glacier(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_ec2_endpoint(url, aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_walrus(host: Optional[Any] = ..., aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., port: int = ..., path: str = ..., is_secure: bool = ..., **kwargs): ... +def connect_ses(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_sts(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_ia(ia_access_key_id: Optional[Any] = ..., ia_secret_access_key: Optional[Any] = ..., is_secure: bool = ..., **kwargs): ... +def connect_dynamodb(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_swf(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_cloudsearch(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_cloudsearch2(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., sign_request: bool = ..., **kwargs): ... +def connect_cloudsearchdomain(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_beanstalk(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_elastictranscoder(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_opsworks(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_redshift(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_support(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_cloudtrail(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_directconnect(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_kinesis(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_logs(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_route53domains(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_cognito_identity(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_cognito_sync(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_kms(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_awslambda(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_codedeploy(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_configservice(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_cloudhsm(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_ec2containerservice(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_machinelearning(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def storage_uri(uri_str, default_scheme: str = ..., debug: int = ..., validate: bool = ..., bucket_storage_uri_class: Any = ..., suppress_consec_slashes: bool = ..., is_latest: bool = ...): ... +def storage_uri_for_key(key): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/auth.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/auth.pyi new file mode 100644 index 0000000..033d1d7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/auth.pyi @@ -0,0 +1,108 @@ +from typing import Any, Optional +from boto.auth_handler import AuthHandler + +SIGV4_DETECT: Any + +class HmacKeys: + host: Any + def __init__(self, host, config, provider) -> None: ... + def update_provider(self, provider): ... + def algorithm(self): ... + def sign_string(self, string_to_sign): ... + +class AnonAuthHandler(AuthHandler, HmacKeys): + capability: Any + def __init__(self, host, config, provider) -> None: ... + def add_auth(self, http_request, **kwargs): ... + +class HmacAuthV1Handler(AuthHandler, HmacKeys): + capability: Any + def __init__(self, host, config, provider) -> None: ... + def update_provider(self, provider): ... + def add_auth(self, http_request, **kwargs): ... + +class HmacAuthV2Handler(AuthHandler, HmacKeys): + capability: Any + def __init__(self, host, config, provider) -> None: ... + def update_provider(self, provider): ... + def add_auth(self, http_request, **kwargs): ... + +class HmacAuthV3Handler(AuthHandler, HmacKeys): + capability: Any + def __init__(self, host, config, provider) -> None: ... + def add_auth(self, http_request, **kwargs): ... + +class HmacAuthV3HTTPHandler(AuthHandler, HmacKeys): + capability: Any + def __init__(self, host, config, provider) -> None: ... + def headers_to_sign(self, http_request): ... + def canonical_headers(self, headers_to_sign): ... + def string_to_sign(self, http_request): ... + def add_auth(self, req, **kwargs): ... + +class HmacAuthV4Handler(AuthHandler, HmacKeys): + capability: Any + service_name: Any + region_name: Any + def __init__(self, host, config, provider, service_name: Optional[Any] = ..., region_name: Optional[Any] = ...) -> None: ... + def headers_to_sign(self, http_request): ... + def host_header(self, host, http_request): ... + def query_string(self, http_request): ... + def canonical_query_string(self, http_request): ... + def canonical_headers(self, headers_to_sign): ... + def signed_headers(self, headers_to_sign): ... + def canonical_uri(self, http_request): ... + def payload(self, http_request): ... + def canonical_request(self, http_request): ... + def scope(self, http_request): ... + def split_host_parts(self, host): ... + def determine_region_name(self, host): ... + def determine_service_name(self, host): ... + def credential_scope(self, http_request): ... + def string_to_sign(self, http_request, canonical_request): ... + def signature(self, http_request, string_to_sign): ... + def add_auth(self, req, **kwargs): ... + +class S3HmacAuthV4Handler(HmacAuthV4Handler, AuthHandler): + capability: Any + region_name: Any + def __init__(self, *args, **kwargs) -> None: ... + def clean_region_name(self, region_name): ... + def canonical_uri(self, http_request): ... + def canonical_query_string(self, http_request): ... + def host_header(self, host, http_request): ... + def headers_to_sign(self, http_request): ... + def determine_region_name(self, host): ... + def determine_service_name(self, host): ... + def mangle_path_and_params(self, req): ... + def payload(self, http_request): ... + def add_auth(self, req, **kwargs): ... + def presign(self, req, expires, iso_date: Optional[Any] = ...): ... + +class STSAnonHandler(AuthHandler): + capability: Any + def add_auth(self, http_request, **kwargs): ... + +class QuerySignatureHelper(HmacKeys): + def add_auth(self, http_request, **kwargs): ... + +class QuerySignatureV0AuthHandler(QuerySignatureHelper, AuthHandler): + SignatureVersion: int + capability: Any + +class QuerySignatureV1AuthHandler(QuerySignatureHelper, AuthHandler): + SignatureVersion: int + capability: Any + def __init__(self, *args, **kw) -> None: ... + +class QuerySignatureV2AuthHandler(QuerySignatureHelper, AuthHandler): + SignatureVersion: int + capability: Any + +class POSTPathQSV2AuthHandler(QuerySignatureV2AuthHandler, AuthHandler): + capability: Any + def add_auth(self, req, **kwargs): ... + +def get_auth_handler(host, config, provider, requested_capability: Optional[Any] = ...): ... +def detect_potential_sigv4(func): ... +def detect_potential_s3sigv4(func): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/auth_handler.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/auth_handler.pyi new file mode 100644 index 0000000..018e6d1 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/auth_handler.pyi @@ -0,0 +1,9 @@ +from typing import Any +from boto.plugin import Plugin + +class NotReadyToAuthenticate(Exception): ... + +class AuthHandler(Plugin): + capability: Any + def __init__(self, host, config, provider) -> None: ... + def add_auth(self, http_request): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/compat.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/compat.pyi new file mode 100644 index 0000000..ce99703 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/compat.pyi @@ -0,0 +1,17 @@ +import sys + +from typing import Any +from base64 import encodestring as encodebytes + +from six.moves import http_client + +expanduser: Any + +if sys.version_info >= (3, 0): + StandardError = Exception +else: + from __builtin__ import StandardError as StandardError + +long_type: Any +unquote_str: Any +parse_qs_safe: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/connection.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/connection.pyi new file mode 100644 index 0000000..820d6e3 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/connection.pyi @@ -0,0 +1,115 @@ +from typing import Any, Dict, Optional, Text +from six.moves import http_client + +HAVE_HTTPS_CONNECTION: bool +ON_APP_ENGINE: Any +PORTS_BY_SECURITY: Any +DEFAULT_CA_CERTS_FILE: Any + +class HostConnectionPool: + queue: Any + def __init__(self) -> None: ... + def size(self): ... + def put(self, conn): ... + def get(self): ... + def clean(self): ... + +class ConnectionPool: + CLEAN_INTERVAL: float + STALE_DURATION: float + host_to_pool: Any + last_clean_time: float + mutex: Any + def __init__(self) -> None: ... + def size(self): ... + def get_http_connection(self, host, port, is_secure): ... + def put_http_connection(self, host, port, is_secure, conn): ... + def clean(self): ... + +class HTTPRequest: + method: Any + protocol: Any + host: Any + port: Any + path: Any + auth_path: Any + params: Any + headers: Any + body: Any + def __init__(self, method, protocol, host, port, path, auth_path, params, headers, body) -> None: ... + def authorize(self, connection, **kwargs): ... + +class HTTPResponse(http_client.HTTPResponse): + def __init__(self, *args, **kwargs) -> None: ... + def read(self, amt: Optional[Any] = ...): ... + +class AWSAuthConnection: + suppress_consec_slashes: Any + num_retries: int + is_secure: Any + https_validate_certificates: Any + ca_certificates_file: Any + port: Any + http_exceptions: Any + http_unretryable_exceptions: Any + socket_exception_values: Any + https_connection_factory: Any + protocol: str + host: Any + path: Any + debug: Any + host_header: Any + http_connection_kwargs: Any + provider: Any + auth_service_name: Any + request_hook: Any + def __init__(self, host, aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., is_secure: bool = ..., port: Optional[Any] = ..., proxy: Optional[Any] = ..., proxy_port: Optional[Any] = ..., proxy_user: Optional[Any] = ..., proxy_pass: Optional[Any] = ..., debug: int = ..., https_connection_factory: Optional[Any] = ..., path: str = ..., provider: str = ..., security_token: Optional[Any] = ..., suppress_consec_slashes: bool = ..., validate_certs: bool = ..., profile_name: Optional[Any] = ...) -> None: ... + auth_region_name: Any + @property + def connection(self): ... + @property + def aws_access_key_id(self): ... + @property + def gs_access_key_id(self) -> Any: ... + access_key: Any + @property + def aws_secret_access_key(self): ... + @property + def gs_secret_access_key(self): ... + secret_key: Any + @property + def profile_name(self): ... + def get_path(self, path: str = ...): ... + def server_name(self, port: Optional[Any] = ...): ... + proxy: Any + proxy_port: Any + proxy_user: Any + proxy_pass: Any + no_proxy: Any + use_proxy: Any + def handle_proxy(self, proxy, proxy_port, proxy_user, proxy_pass): ... + def get_http_connection(self, host, port, is_secure): ... + def skip_proxy(self, host): ... + def new_http_connection(self, host, port, is_secure): ... + def put_http_connection(self, host, port, is_secure, connection): ... + def proxy_ssl(self, host: Optional[Any] = ..., port: Optional[Any] = ...): ... + def prefix_proxy_to_path(self, path, host: Optional[Any] = ...): ... + def get_proxy_auth_header(self): ... + def get_proxy_url_with_auth(self): ... + def set_host_header(self, request): ... + def set_request_hook(self, hook): ... + def build_base_http_request(self, method, path, auth_path, params: Optional[Any] = ..., headers: Optional[Any] = ..., data: str = ..., host: Optional[Any] = ...): ... + def make_request(self, method, path, headers: Optional[Any] = ..., data: str = ..., host: Optional[Any] = ..., auth_path: Optional[Any] = ..., sender: Optional[Any] = ..., override_num_retries: Optional[Any] = ..., params: Optional[Any] = ..., retry_handler: Optional[Any] = ...): ... + def close(self): ... + +class AWSQueryConnection(AWSAuthConnection): + APIVersion: str + ResponseError: Any + def __init__(self, aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., is_secure: bool = ..., port: Optional[Any] = ..., proxy: Optional[Any] = ..., proxy_port: Optional[Any] = ..., proxy_user: Optional[Any] = ..., proxy_pass: Optional[Any] = ..., host: Optional[Any] = ..., debug: int = ..., https_connection_factory: Optional[Any] = ..., path: str = ..., security_token: Optional[Any] = ..., validate_certs: bool = ..., profile_name: Optional[Any] = ..., provider: str = ...) -> None: ... + def get_utf8_value(self, value): ... + def make_request(self, action, params: Optional[Any] = ..., path: str = ..., verb: str = ..., *args, **kwargs): ... # type: ignore # https://github.com/python/mypy/issues/1237 + def build_list_params(self, params, items, label): ... + def build_complex_list_params(self, params, items, label, names): ... + def get_list(self, action, params, markers, path: str = ..., parent: Optional[Any] = ..., verb: str = ...): ... + def get_object(self, action, params, cls, path: str = ..., parent: Optional[Any] = ..., verb: str = ...): ... + def get_status(self, action, params, path: str = ..., parent: Optional[Any] = ..., verb: str = ...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/ec2/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/ec2/__init__.pyi new file mode 100644 index 0000000..d671c90 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/ec2/__init__.pyi @@ -0,0 +1,7 @@ +from typing import Any + +RegionData: Any + +def regions(**kw_params): ... +def connect_to_region(region_name, **kw_params): ... +def get_region(region_name, **kw_params): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/elb/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/elb/__init__.pyi new file mode 100644 index 0000000..16cf5b4 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/elb/__init__.pyi @@ -0,0 +1,39 @@ +from typing import Any +from boto.connection import AWSQueryConnection + +RegionData: Any + +def regions(): ... +def connect_to_region(region_name, **kw_params): ... + +class ELBConnection(AWSQueryConnection): + APIVersion: Any + DefaultRegionName: Any + DefaultRegionEndpoint: Any + region: Any + def __init__(self, aws_access_key_id=..., aws_secret_access_key=..., is_secure=..., port=..., proxy=..., proxy_port=..., proxy_user=..., proxy_pass=..., debug=..., https_connection_factory=..., region=..., path=..., security_token=..., validate_certs=..., profile_name=...) -> None: ... + def build_list_params(self, params, items, label): ... + def get_all_load_balancers(self, load_balancer_names=..., marker=...): ... + def create_load_balancer(self, name, zones, listeners=..., subnets=..., security_groups=..., scheme=..., complex_listeners=...): ... + def create_load_balancer_listeners(self, name, listeners=..., complex_listeners=...): ... + def delete_load_balancer(self, name): ... + def delete_load_balancer_listeners(self, name, ports): ... + def enable_availability_zones(self, load_balancer_name, zones_to_add): ... + def disable_availability_zones(self, load_balancer_name, zones_to_remove): ... + def modify_lb_attribute(self, load_balancer_name, attribute, value): ... + def get_all_lb_attributes(self, load_balancer_name): ... + def get_lb_attribute(self, load_balancer_name, attribute): ... + def register_instances(self, load_balancer_name, instances): ... + def deregister_instances(self, load_balancer_name, instances): ... + def describe_instance_health(self, load_balancer_name, instances=...): ... + def configure_health_check(self, name, health_check): ... + def set_lb_listener_SSL_certificate(self, lb_name, lb_port, ssl_certificate_id): ... + def create_app_cookie_stickiness_policy(self, name, lb_name, policy_name): ... + def create_lb_cookie_stickiness_policy(self, cookie_expiration_period, lb_name, policy_name): ... + def create_lb_policy(self, lb_name, policy_name, policy_type, policy_attributes): ... + def delete_lb_policy(self, lb_name, policy_name): ... + def set_lb_policies_of_listener(self, lb_name, lb_port, policies): ... + def set_lb_policies_of_backend_server(self, lb_name, instance_port, policies): ... + def apply_security_groups_to_lb(self, name, security_groups): ... + def attach_lb_to_subnets(self, name, subnets): ... + def detach_lb_from_subnets(self, name, subnets): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/exception.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/exception.pyi new file mode 100644 index 0000000..e83a074 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/exception.pyi @@ -0,0 +1,146 @@ +from typing import Any, Optional +from boto.compat import StandardError + +class BotoClientError(StandardError): + reason: Any + def __init__(self, reason, *args) -> None: ... + +class SDBPersistenceError(StandardError): ... +class StoragePermissionsError(BotoClientError): ... +class S3PermissionsError(StoragePermissionsError): ... +class GSPermissionsError(StoragePermissionsError): ... + +class BotoServerError(StandardError): + status: Any + reason: Any + body: Any + request_id: Any + error_code: Any + message: str + box_usage: Any + def __init__(self, status, reason, body: Optional[Any] = ..., *args) -> None: ... + def __getattr__(self, name): ... + def __setattr__(self, name, value): ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + +class ConsoleOutput: + parent: Any + instance_id: Any + timestamp: Any + comment: Any + output: Any + def __init__(self, parent: Optional[Any] = ...) -> None: ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + +class StorageCreateError(BotoServerError): + bucket: Any + def __init__(self, status, reason, body: Optional[Any] = ...) -> None: ... + def endElement(self, name, value, connection): ... + +class S3CreateError(StorageCreateError): ... +class GSCreateError(StorageCreateError): ... +class StorageCopyError(BotoServerError): ... +class S3CopyError(StorageCopyError): ... +class GSCopyError(StorageCopyError): ... + +class SQSError(BotoServerError): + detail: Any + type: Any + def __init__(self, status, reason, body: Optional[Any] = ...) -> None: ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + +class SQSDecodeError(BotoClientError): + message: Any + def __init__(self, reason, message) -> None: ... + +class StorageResponseError(BotoServerError): + resource: Any + def __init__(self, status, reason, body: Optional[Any] = ...) -> None: ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + +class S3ResponseError(StorageResponseError): ... +class GSResponseError(StorageResponseError): ... + +class EC2ResponseError(BotoServerError): + errors: Any + def __init__(self, status, reason, body: Optional[Any] = ...) -> None: ... + def startElement(self, name, attrs, connection): ... + request_id: Any + def endElement(self, name, value, connection): ... + +class JSONResponseError(BotoServerError): + status: Any + reason: Any + body: Any + error_message: Any + error_code: Any + def __init__(self, status, reason, body: Optional[Any] = ..., *args) -> None: ... + +class DynamoDBResponseError(JSONResponseError): ... +class SWFResponseError(JSONResponseError): ... +class EmrResponseError(BotoServerError): ... + +class _EC2Error: + connection: Any + error_code: Any + error_message: Any + def __init__(self, connection: Optional[Any] = ...) -> None: ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + +class SDBResponseError(BotoServerError): ... +class AWSConnectionError(BotoClientError): ... +class StorageDataError(BotoClientError): ... +class S3DataError(StorageDataError): ... +class GSDataError(StorageDataError): ... + +class InvalidUriError(Exception): + message: Any + def __init__(self, message) -> None: ... + +class InvalidAclError(Exception): + message: Any + def __init__(self, message) -> None: ... + +class InvalidCorsError(Exception): + message: Any + def __init__(self, message) -> None: ... + +class NoAuthHandlerFound(Exception): ... + +class InvalidLifecycleConfigError(Exception): + message: Any + def __init__(self, message) -> None: ... + +class ResumableTransferDisposition: + START_OVER: str + WAIT_BEFORE_RETRY: str + ABORT_CUR_PROCESS: str + ABORT: str + +class ResumableUploadException(Exception): + message: Any + disposition: Any + def __init__(self, message, disposition) -> None: ... + +class ResumableDownloadException(Exception): + message: Any + disposition: Any + def __init__(self, message, disposition) -> None: ... + +class TooManyRecordsException(Exception): + message: Any + def __init__(self, message) -> None: ... + +class PleaseRetryException(Exception): + message: Any + response: Any + def __init__(self, message, response: Optional[Any] = ...) -> None: ... + +class InvalidInstanceMetadataError(Exception): + MSG: str + def __init__(self, msg) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/kms/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/kms/__init__.pyi new file mode 100644 index 0000000..41fff60 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/kms/__init__.pyi @@ -0,0 +1,5 @@ +from typing import List +import boto.regioninfo + +def regions() -> List[boto.regioninfo.RegionInfo]: ... +def connect_to_region(region_name, **kw_params): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/kms/exceptions.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/kms/exceptions.pyi new file mode 100644 index 0000000..5ac2ecd --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/kms/exceptions.pyi @@ -0,0 +1,17 @@ +from boto.exception import BotoServerError + +class InvalidGrantTokenException(BotoServerError): ... +class DisabledException(BotoServerError): ... +class LimitExceededException(BotoServerError): ... +class DependencyTimeoutException(BotoServerError): ... +class InvalidMarkerException(BotoServerError): ... +class AlreadyExistsException(BotoServerError): ... +class InvalidCiphertextException(BotoServerError): ... +class KeyUnavailableException(BotoServerError): ... +class InvalidAliasNameException(BotoServerError): ... +class UnsupportedOperationException(BotoServerError): ... +class InvalidArnException(BotoServerError): ... +class KMSInternalException(BotoServerError): ... +class InvalidKeyUsageException(BotoServerError): ... +class MalformedPolicyDocumentException(BotoServerError): ... +class NotFoundException(BotoServerError): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/kms/layer1.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/kms/layer1.pyi new file mode 100644 index 0000000..f48ce66 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/kms/layer1.pyi @@ -0,0 +1,37 @@ +from typing import Any, Dict, List, Mapping, Optional, Type +from boto.connection import AWSQueryConnection + +class KMSConnection(AWSQueryConnection): + APIVersion: str + DefaultRegionName: str + DefaultRegionEndpoint: str + ServiceName: str + TargetPrefix: str + ResponseError: Type[Exception] + region: Any + def __init__(self, **kwargs) -> None: ... + def create_alias(self, alias_name: str, target_key_id: str) -> Optional[Dict[str, Any]]: ... + def create_grant(self, key_id: str, grantee_principal: str, retiring_principal: Optional[str] = ..., operations: Optional[List[str]] = ..., constraints: Optional[Dict[str, Dict[str, str]]] = ..., grant_tokens: Optional[List[str]] = ...) -> Optional[Dict[str, Any]]: ... + def create_key(self, policy: Optional[str] = ..., description: Optional[str] = ..., key_usage: Optional[str] = ...) -> Optional[Dict[str, Any]]: ... + def decrypt(self, ciphertext_blob: bytes, encryption_context: Optional[Mapping[str, Any]] = ..., grant_tokens: Optional[List[str]] = ...) -> Optional[Dict[str, Any]]: ... + def delete_alias(self, alias_name: str) -> Optional[Dict[str, Any]]: ... + def describe_key(self, key_id: str) -> Optional[Dict[str, Any]]: ... + def disable_key(self, key_id: str) -> Optional[Dict[str, Any]]: ... + def disable_key_rotation(self, key_id: str) -> Optional[Dict[str, Any]]: ... + def enable_key(self, key_id: str) -> Optional[Dict[str, Any]]: ... + def enable_key_rotation(self, key_id: str) -> Optional[Dict[str, Any]]: ... + def encrypt(self, key_id: str, plaintext: bytes, encryption_context: Optional[Mapping[str, Any]] = ..., grant_tokens: Optional[List[str]] = ...) -> Optional[Dict[str, Any]]: ... + def generate_data_key(self, key_id: str, encryption_context: Optional[Mapping[str, Any]] = ..., number_of_bytes: Optional[int] = ..., key_spec: Optional[str] = ..., grant_tokens: Optional[List[str]] = ...) -> Optional[Dict[str, Any]]: ... + def generate_data_key_without_plaintext(self, key_id: str, encryption_context: Optional[Mapping[str, Any]] = ..., key_spec: Optional[str] = ..., number_of_bytes: Optional[int] = ..., grant_tokens: Optional[List[str]] = ...) -> Optional[Dict[str, Any]]: ... + def generate_random(self, number_of_bytes: Optional[int] = ...) -> Optional[Dict[str, Any]]: ... + def get_key_policy(self, key_id: str, policy_name: str) -> Optional[Dict[str, Any]]: ... + def get_key_rotation_status(self, key_id: str) -> Optional[Dict[str, Any]]: ... + def list_aliases(self, limit: Optional[int] = ..., marker: Optional[str] = ...) -> Optional[Dict[str, Any]]: ... + def list_grants(self, key_id: str, limit: Optional[int] = ..., marker: Optional[str] = ...) -> Optional[Dict[str, Any]]: ... + def list_key_policies(self, key_id: str, limit: Optional[int] = ..., marker: Optional[str] = ...) -> Optional[Dict[str, Any]]: ... + def list_keys(self, limit: Optional[int] = ..., marker: Optional[str] = ...) -> Optional[Dict[str, Any]]: ... + def put_key_policy(self, key_id: str, policy_name: str, policy: str) -> Optional[Dict[str, Any]]: ... + def re_encrypt(self, ciphertext_blob: bytes, destination_key_id: str, source_encryption_context: Optional[Mapping[str, Any]] = ..., destination_encryption_context: Optional[Mapping[str, Any]] = ..., grant_tokens: Optional[List[str]] = ...) -> Optional[Dict[str, Any]]: ... + def retire_grant(self, grant_token: str) -> Optional[Dict[str, Any]]: ... + def revoke_grant(self, key_id: str, grant_id: str) -> Optional[Dict[str, Any]]: ... + def update_key_description(self, key_id: str, description: str) -> Optional[Dict[str, Any]]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/plugin.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/plugin.pyi new file mode 100644 index 0000000..e7d5f1b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/plugin.pyi @@ -0,0 +1,9 @@ +from typing import Any, Optional + +class Plugin: + capability: Any + @classmethod + def is_capable(cls, requested_capability): ... + +def get_plugin(cls, requested_capability: Optional[Any] = ...): ... +def load_plugins(config): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/regioninfo.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/regioninfo.pyi new file mode 100644 index 0000000..525b565 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/regioninfo.pyi @@ -0,0 +1,16 @@ +from typing import Any, Optional + +def load_endpoint_json(path): ... +def merge_endpoints(defaults, additions): ... +def load_regions(): ... +def get_regions(service_name, region_cls: Optional[Any] = ..., connection_cls: Optional[Any] = ...): ... + +class RegionInfo: + connection: Any + name: Any + endpoint: Any + connection_cls: Any + def __init__(self, connection: Optional[Any] = ..., name: Optional[Any] = ..., endpoint: Optional[Any] = ..., connection_cls: Optional[Any] = ...) -> None: ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + def connect(self, **kw_params): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/s3/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/s3/__init__.pyi new file mode 100644 index 0000000..d88955e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/s3/__init__.pyi @@ -0,0 +1,14 @@ +from typing import Optional + +from .connection import S3Connection + +from boto.connection import AWSAuthConnection +from boto.regioninfo import RegionInfo + +from typing import List, Type, Text + +class S3RegionInfo(RegionInfo): + def connect(self, name: Optional[Text] = ..., endpoint: Optional[str] = ..., connection_cls: Optional[Type[AWSAuthConnection]] = ..., **kw_params) -> S3Connection: ... + +def regions() -> List[S3RegionInfo]: ... +def connect_to_region(region_name: Text, **kw_params): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/s3/acl.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/s3/acl.pyi new file mode 100644 index 0000000..168f914 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/s3/acl.pyi @@ -0,0 +1,39 @@ +from .connection import S3Connection +from .user import User +from typing import Any, Dict, Optional, List, Text, Union + +CannedACLStrings: List[str] + +class Policy: + parent: Any + namespace: Any + acl: ACL + def __init__(self, parent: Optional[Any] = ...) -> None: ... + owner: User + def startElement(self, name: Text, attrs: Dict[str, Any], connection: S3Connection) -> Union[None, User, ACL]: ... + def endElement(self, name: Text, value: Any, connection: S3Connection) -> None: ... + def to_xml(self) -> str: ... + +class ACL: + policy: Policy + grants: List[Grant] + def __init__(self, policy: Optional[Policy] = ...) -> None: ... + def add_grant(self, grant: Grant) -> None: ... + def add_email_grant(self, permission: Text, email_address: Text) -> None: ... + def add_user_grant(self, permission: Text, user_id: Text, display_name: Optional[Text] = ...) -> None: ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name: Text, value: Any, connection: S3Connection) -> None: ... + def to_xml(self) -> str: ... + +class Grant: + NameSpace: Text + permission: Text + id: Text + display_name: Text + uri: Text + email_address: Text + type: Text + def __init__(self, permission: Optional[Text] = ..., type: Optional[Text] = ..., id: Optional[Text] = ..., display_name: Optional[Text] = ..., uri: Optional[Text] = ..., email_address: Optional[Text] = ...) -> None: ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name: Text, value: Any, connection: S3Connection) -> None: ... + def to_xml(self) -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/s3/bucket.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/s3/bucket.pyi new file mode 100644 index 0000000..daed502 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/s3/bucket.pyi @@ -0,0 +1,94 @@ +from .bucketlistresultset import BucketListResultSet +from .connection import S3Connection +from .key import Key + +from typing import Any, Dict, Optional, Text, Type, List + +class S3WebsiteEndpointTranslate: + trans_region: Dict[str, str] + @classmethod + def translate_region(self, reg: Text) -> str: ... + +S3Permissions: List[str] + +class Bucket: + LoggingGroup: str + BucketPaymentBody: str + VersioningBody: str + VersionRE: str + MFADeleteRE: str + name: Text + connection: S3Connection + key_class: Type[Key] + def __init__(self, connection: Optional[S3Connection] = ..., name: Optional[Text] = ..., key_class: Type[Key] = ...) -> None: ... + def __iter__(self): ... + def __contains__(self, key_name) -> bool: ... + def startElement(self, name, attrs, connection): ... + creation_date: Any + def endElement(self, name, value, connection): ... + def set_key_class(self, key_class): ... + def lookup(self, key_name, headers: Optional[Dict[Text, Text]] = ...): ... + def get_key(self, key_name, headers: Optional[Dict[Text, Text]] = ..., version_id: Optional[Any] = ..., response_headers: Optional[Dict[Text, Text]] = ..., validate: bool = ...) -> Key: ... + def list(self, prefix: Text = ..., delimiter: Text = ..., marker: Text = ..., headers: Optional[Dict[Text, Text]] = ..., encoding_type: Optional[Any] = ...) -> BucketListResultSet: ... + def list_versions(self, prefix: str = ..., delimiter: str = ..., key_marker: str = ..., version_id_marker: str = ..., headers: Optional[Dict[Text, Text]] = ..., encoding_type: Optional[Text] = ...) -> BucketListResultSet: ... + def list_multipart_uploads(self, key_marker: str = ..., upload_id_marker: str = ..., headers: Optional[Dict[Text, Text]] = ..., encoding_type: Optional[Any] = ...): ... + def validate_kwarg_names(self, kwargs, names): ... + def get_all_keys(self, headers: Optional[Dict[Text, Text]] = ..., **params): ... + def get_all_versions(self, headers: Optional[Dict[Text, Text]] = ..., **params): ... + def validate_get_all_versions_params(self, params): ... + def get_all_multipart_uploads(self, headers: Optional[Dict[Text, Text]] = ..., **params): ... + def new_key(self, key_name: Optional[Any] = ...): ... + def generate_url(self, expires_in, method: str = ..., headers: Optional[Dict[Text, Text]] = ..., force_http: bool = ..., response_headers: Optional[Dict[Text, Text]] = ..., expires_in_absolute: bool = ...): ... + def delete_keys(self, keys, quiet: bool = ..., mfa_token: Optional[Any] = ..., headers: Optional[Dict[Text, Text]] = ...): ... + def delete_key(self, key_name, headers: Optional[Dict[Text, Text]] = ..., version_id: Optional[Any] = ..., mfa_token: Optional[Any] = ...): ... + def copy_key(self, new_key_name, src_bucket_name, src_key_name, metadata: Optional[Any] = ..., src_version_id: Optional[Any] = ..., storage_class: str = ..., preserve_acl: bool = ..., encrypt_key: bool = ..., headers: Optional[Dict[Text, Text]] = ..., query_args: Optional[Any] = ...): ... + def set_canned_acl(self, acl_str, key_name: str = ..., headers: Optional[Dict[Text, Text]] = ..., version_id: Optional[Any] = ...): ... + def get_xml_acl(self, key_name: str = ..., headers: Optional[Dict[Text, Text]] = ..., version_id: Optional[Any] = ...): ... + def set_xml_acl(self, acl_str, key_name: str = ..., headers: Optional[Dict[Text, Text]] = ..., version_id: Optional[Any] = ..., query_args: str = ...): ... + def set_acl(self, acl_or_str, key_name: str = ..., headers: Optional[Dict[Text, Text]] = ..., version_id: Optional[Any] = ...): ... + def get_acl(self, key_name: str = ..., headers: Optional[Dict[Text, Text]] = ..., version_id: Optional[Any] = ...): ... + def set_subresource(self, subresource, value, key_name: str = ..., headers: Optional[Dict[Text, Text]] = ..., version_id: Optional[Any] = ...): ... + def get_subresource(self, subresource, key_name: str = ..., headers: Optional[Dict[Text, Text]] = ..., version_id: Optional[Any] = ...): ... + def make_public(self, recursive: bool = ..., headers: Optional[Dict[Text, Text]] = ...): ... + def add_email_grant(self, permission, email_address, recursive: bool = ..., headers: Optional[Dict[Text, Text]] = ...): ... + def add_user_grant(self, permission, user_id, recursive: bool = ..., headers: Optional[Dict[Text, Text]] = ..., display_name: Optional[Any] = ...): ... + def list_grants(self, headers: Optional[Dict[Text, Text]] = ...): ... + def get_location(self): ... + def set_xml_logging(self, logging_str, headers: Optional[Dict[Text, Text]] = ...): ... + def enable_logging(self, target_bucket, target_prefix: str = ..., grants: Optional[Any] = ..., headers: Optional[Dict[Text, Text]] = ...): ... + def disable_logging(self, headers: Optional[Dict[Text, Text]] = ...): ... + def get_logging_status(self, headers: Optional[Dict[Text, Text]] = ...): ... + def set_as_logging_target(self, headers: Optional[Dict[Text, Text]] = ...): ... + def get_request_payment(self, headers: Optional[Dict[Text, Text]] = ...): ... + def set_request_payment(self, payer: str = ..., headers: Optional[Dict[Text, Text]] = ...): ... + def configure_versioning(self, versioning, mfa_delete: bool = ..., mfa_token: Optional[Any] = ..., headers: Optional[Dict[Text, Text]] = ...): ... + def get_versioning_status(self, headers: Optional[Dict[Text, Text]] = ...): ... + def configure_lifecycle(self, lifecycle_config, headers: Optional[Dict[Text, Text]] = ...): ... + def get_lifecycle_config(self, headers: Optional[Dict[Text, Text]] = ...): ... + def delete_lifecycle_configuration(self, headers: Optional[Dict[Text, Text]] = ...): ... + def configure_website(self, suffix: Optional[Any] = ..., error_key: Optional[Any] = ..., redirect_all_requests_to: Optional[Any] = ..., routing_rules: Optional[Any] = ..., headers: Optional[Dict[Text, Text]] = ...): ... + def set_website_configuration(self, config, headers: Optional[Dict[Text, Text]] = ...): ... + def set_website_configuration_xml(self, xml, headers: Optional[Dict[Text, Text]] = ...): ... + def get_website_configuration(self, headers: Optional[Dict[Text, Text]] = ...): ... + def get_website_configuration_obj(self, headers: Optional[Dict[Text, Text]] = ...): ... + def get_website_configuration_with_xml(self, headers: Optional[Dict[Text, Text]] = ...): ... + def get_website_configuration_xml(self, headers: Optional[Dict[Text, Text]] = ...): ... + def delete_website_configuration(self, headers: Optional[Dict[Text, Text]] = ...): ... + def get_website_endpoint(self): ... + def get_policy(self, headers: Optional[Dict[Text, Text]] = ...): ... + def set_policy(self, policy, headers: Optional[Dict[Text, Text]] = ...): ... + def delete_policy(self, headers: Optional[Dict[Text, Text]] = ...): ... + def set_cors_xml(self, cors_xml, headers: Optional[Dict[Text, Text]] = ...): ... + def set_cors(self, cors_config, headers: Optional[Dict[Text, Text]] = ...): ... + def get_cors_xml(self, headers: Optional[Dict[Text, Text]] = ...): ... + def get_cors(self, headers: Optional[Dict[Text, Text]] = ...): ... + def delete_cors(self, headers: Optional[Dict[Text, Text]] = ...): ... + def initiate_multipart_upload(self, key_name, headers: Optional[Dict[Text, Text]] = ..., reduced_redundancy: bool = ..., metadata: Optional[Any] = ..., encrypt_key: bool = ..., policy: Optional[Any] = ...): ... + def complete_multipart_upload(self, key_name, upload_id, xml_body, headers: Optional[Dict[Text, Text]] = ...): ... + def cancel_multipart_upload(self, key_name, upload_id, headers: Optional[Dict[Text, Text]] = ...): ... + def delete(self, headers: Optional[Dict[Text, Text]] = ...): ... + def get_tags(self): ... + def get_xml_tags(self): ... + def set_xml_tags(self, tag_str, headers: Optional[Dict[Text, Text]] = ..., query_args: str = ...): ... + def set_tags(self, tags, headers: Optional[Dict[Text, Text]] = ...): ... + def delete_tags(self, headers: Optional[Dict[Text, Text]] = ...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/s3/bucketlistresultset.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/s3/bucketlistresultset.pyi new file mode 100644 index 0000000..b33d84d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/s3/bucketlistresultset.pyi @@ -0,0 +1,40 @@ +from .bucket import Bucket +from .key import Key + +from typing import Any, Iterable, Iterator, Optional + +def bucket_lister(bucket, prefix: str = ..., delimiter: str = ..., marker: str = ..., headers: Optional[Any] = ..., encoding_type: Optional[Any] = ...): ... + +class BucketListResultSet(Iterable[Key]): + bucket: Any + prefix: Any + delimiter: Any + marker: Any + headers: Any + encoding_type: Any + def __init__(self, bucket: Optional[Any] = ..., prefix: str = ..., delimiter: str = ..., marker: str = ..., headers: Optional[Any] = ..., encoding_type: Optional[Any] = ...) -> None: ... + def __iter__(self) -> Iterator[Key]: ... + +def versioned_bucket_lister(bucket, prefix: str = ..., delimiter: str = ..., key_marker: str = ..., version_id_marker: str = ..., headers: Optional[Any] = ..., encoding_type: Optional[Any] = ...): ... + +class VersionedBucketListResultSet: + bucket: Any + prefix: Any + delimiter: Any + key_marker: Any + version_id_marker: Any + headers: Any + encoding_type: Any + def __init__(self, bucket: Optional[Any] = ..., prefix: str = ..., delimiter: str = ..., key_marker: str = ..., version_id_marker: str = ..., headers: Optional[Any] = ..., encoding_type: Optional[Any] = ...) -> None: ... + def __iter__(self) -> Iterator[Key]: ... + +def multipart_upload_lister(bucket, key_marker: str = ..., upload_id_marker: str = ..., headers: Optional[Any] = ..., encoding_type: Optional[Any] = ...): ... + +class MultiPartUploadListResultSet: + bucket: Any + key_marker: Any + upload_id_marker: Any + headers: Any + encoding_type: Any + def __init__(self, bucket: Optional[Any] = ..., key_marker: str = ..., upload_id_marker: str = ..., headers: Optional[Any] = ..., encoding_type: Optional[Any] = ...) -> None: ... + def __iter__(self): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/s3/bucketlogging.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/s3/bucketlogging.pyi new file mode 100644 index 0000000..4eaa1ab --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/s3/bucketlogging.pyi @@ -0,0 +1,11 @@ +from typing import Any, Optional + +class BucketLogging: + target: Any + prefix: Any + grants: Any + def __init__(self, target: Optional[Any] = ..., prefix: Optional[Any] = ..., grants: Optional[Any] = ...) -> None: ... + def add_grant(self, grant): ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + def to_xml(self): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/s3/connection.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/s3/connection.pyi new file mode 100644 index 0000000..9148e68 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/s3/connection.pyi @@ -0,0 +1,67 @@ +from .bucket import Bucket + +from typing import Any, Dict, Optional, Text, Type +from boto.connection import AWSAuthConnection +from boto.exception import BotoClientError + +def check_lowercase_bucketname(n): ... +def assert_case_insensitive(f): ... + +class _CallingFormat: + def get_bucket_server(self, server, bucket): ... + def build_url_base(self, connection, protocol, server, bucket, key: str = ...): ... + def build_host(self, server, bucket): ... + def build_auth_path(self, bucket, key: str = ...): ... + def build_path_base(self, bucket, key: str = ...): ... + +class SubdomainCallingFormat(_CallingFormat): + def get_bucket_server(self, server, bucket): ... + +class VHostCallingFormat(_CallingFormat): + def get_bucket_server(self, server, bucket): ... + +class OrdinaryCallingFormat(_CallingFormat): + def get_bucket_server(self, server, bucket): ... + def build_path_base(self, bucket, key: str = ...): ... + +class ProtocolIndependentOrdinaryCallingFormat(OrdinaryCallingFormat): + def build_url_base(self, connection, protocol, server, bucket, key: str = ...): ... + +class Location: + DEFAULT: str + EU: str + EUCentral1: str + USWest: str + USWest2: str + SAEast: str + APNortheast: str + APSoutheast: str + APSoutheast2: str + CNNorth1: str + +class NoHostProvided: ... +class HostRequiredError(BotoClientError): ... + +class S3Connection(AWSAuthConnection): + DefaultHost: Any + DefaultCallingFormat: Any + QueryString: str + calling_format: Any + bucket_class: Type[Bucket] + anon: Any + def __init__(self, aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., is_secure: bool = ..., port: Optional[Any] = ..., proxy: Optional[Any] = ..., proxy_port: Optional[Any] = ..., proxy_user: Optional[Any] = ..., proxy_pass: Optional[Any] = ..., host: Any = ..., debug: int = ..., https_connection_factory: Optional[Any] = ..., calling_format: Any = ..., path: str = ..., provider: str = ..., bucket_class: Type[Bucket] = ..., security_token: Optional[Any] = ..., suppress_consec_slashes: bool = ..., anon: bool = ..., validate_certs: Optional[Any] = ..., profile_name: Optional[Any] = ...) -> None: ... + def __iter__(self): ... + def __contains__(self, bucket_name): ... + def set_bucket_class(self, bucket_class: Type[Bucket]) -> None: ... + def build_post_policy(self, expiration_time, conditions): ... + def build_post_form_args(self, bucket_name, key, expires_in: int = ..., acl: Optional[Any] = ..., success_action_redirect: Optional[Any] = ..., max_content_length: Optional[Any] = ..., http_method: str = ..., fields: Optional[Any] = ..., conditions: Optional[Any] = ..., storage_class: str = ..., server_side_encryption: Optional[Any] = ...): ... + def generate_url_sigv4(self, expires_in, method, bucket: str = ..., key: str = ..., headers: Optional[Dict[Text, Text]] = ..., force_http: bool = ..., response_headers: Optional[Dict[Text, Text]] = ..., version_id: Optional[Any] = ..., iso_date: Optional[Any] = ...): ... + def generate_url(self, expires_in, method, bucket: str = ..., key: str = ..., headers: Optional[Dict[Text, Text]] = ..., query_auth: bool = ..., force_http: bool = ..., response_headers: Optional[Dict[Text, Text]] = ..., expires_in_absolute: bool = ..., version_id: Optional[Any] = ...): ... + def get_all_buckets(self, headers: Optional[Dict[Text, Text]] = ...): ... + def get_canonical_user_id(self, headers: Optional[Dict[Text, Text]] = ...): ... + def get_bucket(self, bucket_name: Text, validate: bool = ..., headers: Optional[Dict[Text, Text]] = ...) -> Bucket: ... + def head_bucket(self, bucket_name, headers: Optional[Dict[Text, Text]] = ...): ... + def lookup(self, bucket_name, validate: bool = ..., headers: Optional[Dict[Text, Text]] = ...): ... + def create_bucket(self, bucket_name, headers: Optional[Dict[Text, Text]] = ..., location: Any = ..., policy: Optional[Any] = ...): ... + def delete_bucket(self, bucket, headers: Optional[Dict[Text, Text]] = ...): ... + def make_request(self, method, bucket: str = ..., key: str = ..., headers: Optional[Any] = ..., data: str = ..., query_args: Optional[Any] = ..., sender: Optional[Any] = ..., override_num_retries: Optional[Any] = ..., retry_handler: Optional[Any] = ..., *args, **kwargs): ... # type: ignore # https://github.com/python/mypy/issues/1237 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/s3/cors.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/s3/cors.pyi new file mode 100644 index 0000000..6ffe8ee --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/s3/cors.pyi @@ -0,0 +1,19 @@ +from typing import Any, Optional + +class CORSRule: + allowed_method: Any + allowed_origin: Any + id: Any + allowed_header: Any + max_age_seconds: Any + expose_header: Any + def __init__(self, allowed_method: Optional[Any] = ..., allowed_origin: Optional[Any] = ..., id: Optional[Any] = ..., allowed_header: Optional[Any] = ..., max_age_seconds: Optional[Any] = ..., expose_header: Optional[Any] = ...) -> None: ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + def to_xml(self) -> str: ... + +class CORSConfiguration(list): + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + def to_xml(self) -> str: ... + def add_rule(self, allowed_method, allowed_origin, id: Optional[Any] = ..., allowed_header: Optional[Any] = ..., max_age_seconds: Optional[Any] = ..., expose_header: Optional[Any] = ...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/s3/deletemarker.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/s3/deletemarker.pyi new file mode 100644 index 0000000..b2955c0 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/s3/deletemarker.pyi @@ -0,0 +1,12 @@ +from typing import Any, Optional + +class DeleteMarker: + bucket: Any + name: Any + version_id: Any + is_latest: bool + last_modified: Any + owner: Any + def __init__(self, bucket: Optional[Any] = ..., name: Optional[Any] = ...) -> None: ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/s3/key.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/s3/key.pyi new file mode 100644 index 0000000..4200e7a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/s3/key.pyi @@ -0,0 +1,232 @@ +from typing import Any, Callable, Dict, Optional, Text, Union, overload + +class Key: + DefaultContentType: str + RestoreBody: str + BufferSize: Any + base_user_settable_fields: Any + base_fields: Any + bucket: Any + name: str + metadata: Any + cache_control: Any + content_type: Any + content_encoding: Any + content_disposition: Any + content_language: Any + filename: Any + etag: Any + is_latest: bool + last_modified: Any + owner: Any + path: Any + resp: Any + mode: Any + size: Any + version_id: Any + source_version_id: Any + delete_marker: bool + encrypted: Any + ongoing_restore: Any + expiry_date: Any + local_hashes: Any + def __init__(self, bucket: Optional[Any] = ..., name: Optional[Any] = ...) -> None: ... + def __iter__(self): ... + @property + def provider(self): ... + key: Any + md5: Any + base64md5: Any + storage_class: Any + def get_md5_from_hexdigest(self, md5_hexdigest): ... + def handle_encryption_headers(self, resp): ... + def handle_version_headers(self, resp, force: bool = ...): ... + def handle_restore_headers(self, response): ... + def handle_addl_headers(self, headers): ... + def open_read( + self, + headers: Optional[Dict[Text, Text]] = ..., + query_args: str = ..., + override_num_retries: Optional[Any] = ..., + response_headers: Optional[Dict[Text, Text]] = ..., + ): ... + def open_write(self, headers: Optional[Dict[Text, Text]] = ..., override_num_retries: Optional[Any] = ...): ... + def open( + self, + mode: str = ..., + headers: Optional[Dict[Text, Text]] = ..., + query_args: Optional[Any] = ..., + override_num_retries: Optional[Any] = ..., + ): ... + closed: bool + def close(self, fast: bool = ...): ... + def next(self): ... + __next__: Any + def read(self, size: int = ...): ... + def change_storage_class(self, new_storage_class, dst_bucket: Optional[Any] = ..., validate_dst_bucket: bool = ...): ... + def copy( + self, + dst_bucket, + dst_key, + metadata: Optional[Any] = ..., + reduced_redundancy: bool = ..., + preserve_acl: bool = ..., + encrypt_key: bool = ..., + validate_dst_bucket: bool = ..., + ): ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + def exists(self, headers: Optional[Dict[Text, Text]] = ...): ... + def delete(self, headers: Optional[Dict[Text, Text]] = ...): ... + def get_metadata(self, name): ... + def set_metadata(self, name, value): ... + def update_metadata(self, d): ... + def set_acl(self, acl_str, headers: Optional[Dict[Text, Text]] = ...): ... + def get_acl(self, headers: Optional[Dict[Text, Text]] = ...): ... + def get_xml_acl(self, headers: Optional[Dict[Text, Text]] = ...): ... + def set_xml_acl(self, acl_str, headers: Optional[Dict[Text, Text]] = ...): ... + def set_canned_acl(self, acl_str, headers: Optional[Dict[Text, Text]] = ...): ... + def get_redirect(self): ... + def set_redirect(self, redirect_location, headers: Optional[Dict[Text, Text]] = ...): ... + def make_public(self, headers: Optional[Dict[Text, Text]] = ...): ... + def generate_url( + self, + expires_in, + method: str = ..., + headers: Optional[Dict[Text, Text]] = ..., + query_auth: bool = ..., + force_http: bool = ..., + response_headers: Optional[Dict[Text, Text]] = ..., + expires_in_absolute: bool = ..., + version_id: Optional[Any] = ..., + policy: Optional[Any] = ..., + reduced_redundancy: bool = ..., + encrypt_key: bool = ..., + ): ... + def send_file( + self, + fp, + headers: Optional[Dict[Text, Text]] = ..., + cb: Optional[Callable[[int, int], Any]] = ..., + num_cb: int = ..., + query_args: Optional[Any] = ..., + chunked_transfer: bool = ..., + size: Optional[Any] = ..., + ): ... + def should_retry(self, response, chunked_transfer: bool = ...): ... + def compute_md5(self, fp, size: Optional[Any] = ...): ... + def set_contents_from_stream( + self, + fp, + headers: Optional[Dict[Text, Text]] = ..., + replace: bool = ..., + cb: Optional[Callable[[int, int], Any]] = ..., + num_cb: int = ..., + policy: Optional[Any] = ..., + reduced_redundancy: bool = ..., + query_args: Optional[Any] = ..., + size: Optional[Any] = ..., + ): ... + def set_contents_from_file( + self, + fp, + headers: Optional[Dict[Text, Text]] = ..., + replace: bool = ..., + cb: Optional[Callable[[int, int], Any]] = ..., + num_cb: int = ..., + policy: Optional[Any] = ..., + md5: Optional[Any] = ..., + reduced_redundancy: bool = ..., + query_args: Optional[Any] = ..., + encrypt_key: bool = ..., + size: Optional[Any] = ..., + rewind: bool = ..., + ): ... + def set_contents_from_filename( + self, + filename, + headers: Optional[Dict[Text, Text]] = ..., + replace: bool = ..., + cb: Optional[Callable[[int, int], Any]] = ..., + num_cb: int = ..., + policy: Optional[Any] = ..., + md5: Optional[Any] = ..., + reduced_redundancy: bool = ..., + encrypt_key: bool = ..., + ): ... + def set_contents_from_string( + self, + string_data: Union[Text, bytes], + headers: Optional[Dict[Text, Text]] = ..., + replace: bool = ..., + cb: Optional[Callable[[int, int], Any]] = ..., + num_cb: int = ..., + policy: Optional[Any] = ..., + md5: Optional[Any] = ..., + reduced_redundancy: bool = ..., + encrypt_key: bool = ..., + ) -> None: ... + def get_file( + self, + fp, + headers: Optional[Dict[Text, Text]] = ..., + cb: Optional[Callable[[int, int], Any]] = ..., + num_cb: int = ..., + torrent: bool = ..., + version_id: Optional[Any] = ..., + override_num_retries: Optional[Any] = ..., + response_headers: Optional[Dict[Text, Text]] = ..., + ): ... + def get_torrent_file( + self, fp, headers: Optional[Dict[Text, Text]] = ..., cb: Optional[Callable[[int, int], Any]] = ..., num_cb: int = ... + ): ... + def get_contents_to_file( + self, + fp, + headers: Optional[Dict[Text, Text]] = ..., + cb: Optional[Callable[[int, int], Any]] = ..., + num_cb: int = ..., + torrent: bool = ..., + version_id: Optional[Any] = ..., + res_download_handler: Optional[Any] = ..., + response_headers: Optional[Dict[Text, Text]] = ..., + ): ... + def get_contents_to_filename( + self, + filename, + headers: Optional[Dict[Text, Text]] = ..., + cb: Optional[Callable[[int, int], Any]] = ..., + num_cb: int = ..., + torrent: bool = ..., + version_id: Optional[Any] = ..., + res_download_handler: Optional[Any] = ..., + response_headers: Optional[Dict[Text, Text]] = ..., + ): ... + @overload + def get_contents_as_string( + self, + headers: Optional[Dict[Text, Text]] = ..., + cb: Optional[Callable[[int, int], Any]] = ..., + num_cb: int = ..., + torrent: bool = ..., + version_id: Optional[Any] = ..., + response_headers: Optional[Dict[Text, Text]] = ..., + encoding: None = ..., + ) -> bytes: ... + @overload + def get_contents_as_string( + self, + headers: Optional[Dict[Text, Text]] = ..., + cb: Optional[Callable[[int, int], Any]] = ..., + num_cb: int = ..., + torrent: bool = ..., + version_id: Optional[Any] = ..., + response_headers: Optional[Dict[Text, Text]] = ..., + *, encoding: Text, + ) -> Text: ... + def add_email_grant(self, permission, email_address, headers: Optional[Dict[Text, Text]] = ...): ... + def add_user_grant( + self, permission, user_id, headers: Optional[Dict[Text, Text]] = ..., display_name: Optional[Any] = ... + ): ... + def set_remote_metadata(self, metadata_plus, metadata_minus, preserve_acl, headers: Optional[Dict[Text, Text]] = ...): ... + def restore(self, days, headers: Optional[Dict[Text, Text]] = ...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/s3/keyfile.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/s3/keyfile.pyi new file mode 100644 index 0000000..121da16 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/s3/keyfile.pyi @@ -0,0 +1,29 @@ +from typing import Any + +class KeyFile: + key: Any + location: int + closed: bool + softspace: int + mode: str + encoding: str + errors: str + newlines: str + name: Any + def __init__(self, key) -> None: ... + def tell(self): ... + def seek(self, pos, whence: Any = ...): ... + def read(self, size): ... + def close(self): ... + def isatty(self): ... + def getkey(self): ... + def write(self, buf): ... + def fileno(self): ... + def flush(self): ... + def next(self): ... + def readinto(self): ... + def readline(self): ... + def readlines(self): ... + def truncate(self): ... + def writelines(self): ... + def xreadlines(self): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/s3/lifecycle.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/s3/lifecycle.pyi new file mode 100644 index 0000000..0b775ef --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/s3/lifecycle.pyi @@ -0,0 +1,51 @@ +from typing import Any, Optional + +class Rule: + id: Any + prefix: Any + status: Any + expiration: Any + transition: Any + def __init__(self, id: Optional[Any] = ..., prefix: Optional[Any] = ..., status: Optional[Any] = ..., expiration: Optional[Any] = ..., transition: Optional[Any] = ...) -> None: ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + def to_xml(self): ... + +class Expiration: + days: Any + date: Any + def __init__(self, days: Optional[Any] = ..., date: Optional[Any] = ...) -> None: ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + def to_xml(self): ... + +class Transition: + days: Any + date: Any + storage_class: Any + def __init__(self, days: Optional[Any] = ..., date: Optional[Any] = ..., storage_class: Optional[Any] = ...) -> None: ... + def to_xml(self): ... + +class Transitions(list): + transition_properties: int + current_transition_property: int + temp_days: Any + temp_date: Any + temp_storage_class: Any + def __init__(self) -> None: ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + def to_xml(self): ... + def add_transition(self, days: Optional[Any] = ..., date: Optional[Any] = ..., storage_class: Optional[Any] = ...): ... + @property + def days(self): ... + @property + def date(self): ... + @property + def storage_class(self): ... + +class Lifecycle(list): + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + def to_xml(self): ... + def add_rule(self, id: Optional[Any] = ..., prefix: str = ..., status: str = ..., expiration: Optional[Any] = ..., transition: Optional[Any] = ...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/s3/multidelete.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/s3/multidelete.pyi new file mode 100644 index 0000000..fa0c8dd --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/s3/multidelete.pyi @@ -0,0 +1,27 @@ +from typing import Any, Optional + +class Deleted: + key: Any + version_id: Any + delete_marker: Any + delete_marker_version_id: Any + def __init__(self, key: Optional[Any] = ..., version_id: Optional[Any] = ..., delete_marker: bool = ..., delete_marker_version_id: Optional[Any] = ...) -> None: ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + +class Error: + key: Any + version_id: Any + code: Any + message: Any + def __init__(self, key: Optional[Any] = ..., version_id: Optional[Any] = ..., code: Optional[Any] = ..., message: Optional[Any] = ...) -> None: ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + +class MultiDeleteResult: + bucket: Any + deleted: Any + errors: Any + def __init__(self, bucket: Optional[Any] = ...) -> None: ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/s3/multipart.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/s3/multipart.pyi new file mode 100644 index 0000000..8463c4d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/s3/multipart.pyi @@ -0,0 +1,49 @@ +from typing import Any, Optional + +class CompleteMultiPartUpload: + bucket: Any + location: Any + bucket_name: Any + key_name: Any + etag: Any + version_id: Any + encrypted: Any + def __init__(self, bucket: Optional[Any] = ...) -> None: ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + +class Part: + bucket: Any + part_number: Any + last_modified: Any + etag: Any + size: Any + def __init__(self, bucket: Optional[Any] = ...) -> None: ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + +def part_lister(mpupload, part_number_marker: Optional[Any] = ...): ... + +class MultiPartUpload: + bucket: Any + bucket_name: Any + key_name: Any + id: Any + initiator: Any + owner: Any + storage_class: Any + initiated: Any + part_number_marker: Any + next_part_number_marker: Any + max_parts: Any + is_truncated: bool + def __init__(self, bucket: Optional[Any] = ...) -> None: ... + def __iter__(self): ... + def to_xml(self): ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + def get_all_parts(self, max_parts: Optional[Any] = ..., part_number_marker: Optional[Any] = ..., encoding_type: Optional[Any] = ...): ... + def upload_part_from_file(self, fp, part_num, headers: Optional[Any] = ..., replace: bool = ..., cb: Optional[Any] = ..., num_cb: int = ..., md5: Optional[Any] = ..., size: Optional[Any] = ...): ... + def copy_part_from_key(self, src_bucket_name, src_key_name, part_num, start: Optional[Any] = ..., end: Optional[Any] = ..., src_version_id: Optional[Any] = ..., headers: Optional[Any] = ...): ... + def complete_upload(self): ... + def cancel_upload(self): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/s3/prefix.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/s3/prefix.pyi new file mode 100644 index 0000000..de8f3a3 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/s3/prefix.pyi @@ -0,0 +1,10 @@ +from typing import Any, Optional + +class Prefix: + bucket: Any + name: Any + def __init__(self, bucket: Optional[Any] = ..., name: Optional[Any] = ...) -> None: ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + @property + def provider(self): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/s3/tagging.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/s3/tagging.pyi new file mode 100644 index 0000000..9dec4e3 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/s3/tagging.pyi @@ -0,0 +1,22 @@ +from typing import Any, Optional + +class Tag: + key: Any + value: Any + def __init__(self, key: Optional[Any] = ..., value: Optional[Any] = ...) -> None: ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + def to_xml(self): ... + def __eq__(self, other): ... + +class TagSet(list): + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + def add_tag(self, key, value): ... + def to_xml(self): ... + +class Tags(list): + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + def to_xml(self): ... + def add_tag_set(self, tag_set): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/s3/user.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/s3/user.pyi new file mode 100644 index 0000000..c5cc11c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/s3/user.pyi @@ -0,0 +1,10 @@ +from typing import Any, Optional + +class User: + type: Any + id: Any + display_name: Any + def __init__(self, parent: Optional[Any] = ..., id: str = ..., display_name: str = ...) -> None: ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + def to_xml(self, element_name: str = ...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/s3/website.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/s3/website.pyi new file mode 100644 index 0000000..2a92866 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/s3/website.pyi @@ -0,0 +1,62 @@ +from typing import Any, Optional + +def tag(key, value): ... + +class WebsiteConfiguration: + suffix: Any + error_key: Any + redirect_all_requests_to: Any + routing_rules: Any + def __init__(self, suffix: Optional[Any] = ..., error_key: Optional[Any] = ..., redirect_all_requests_to: Optional[Any] = ..., routing_rules: Optional[Any] = ...) -> None: ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + def to_xml(self): ... + +class _XMLKeyValue: + translator: Any + container: Any + def __init__(self, translator, container: Optional[Any] = ...) -> None: ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + def to_xml(self): ... + +class RedirectLocation(_XMLKeyValue): + TRANSLATOR: Any + hostname: Any + protocol: Any + def __init__(self, hostname: Optional[Any] = ..., protocol: Optional[Any] = ...) -> None: ... + def to_xml(self): ... + +class RoutingRules(list): + def add_rule(self, rule): ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + def to_xml(self): ... + +class RoutingRule: + condition: Any + redirect: Any + def __init__(self, condition: Optional[Any] = ..., redirect: Optional[Any] = ...) -> None: ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + def to_xml(self): ... + @classmethod + def when(cls, key_prefix: Optional[Any] = ..., http_error_code: Optional[Any] = ...): ... + def then_redirect(self, hostname: Optional[Any] = ..., protocol: Optional[Any] = ..., replace_key: Optional[Any] = ..., replace_key_prefix: Optional[Any] = ..., http_redirect_code: Optional[Any] = ...): ... + +class Condition(_XMLKeyValue): + TRANSLATOR: Any + key_prefix: Any + http_error_code: Any + def __init__(self, key_prefix: Optional[Any] = ..., http_error_code: Optional[Any] = ...) -> None: ... + def to_xml(self): ... + +class Redirect(_XMLKeyValue): + TRANSLATOR: Any + hostname: Any + protocol: Any + replace_key: Any + replace_key_prefix: Any + http_redirect_code: Any + def __init__(self, hostname: Optional[Any] = ..., protocol: Optional[Any] = ..., replace_key: Optional[Any] = ..., replace_key_prefix: Optional[Any] = ..., http_redirect_code: Optional[Any] = ...) -> None: ... + def to_xml(self): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/utils.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/utils.pyi new file mode 100644 index 0000000..6552b0a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/boto/utils.pyi @@ -0,0 +1,239 @@ +import datetime +import logging.handlers +import subprocess +import sys +import time + +import boto.connection +from typing import ( + Any, + Callable, + ContextManager, + Dict, + IO, + Iterable, + List, + Mapping, + Optional, + Sequence, + Tuple, + Type, + TypeVar, + Union, +) + +_KT = TypeVar('_KT') +_VT = TypeVar('_VT') + +if sys.version_info[0] >= 3: + # TODO move _StringIO definition into boto.compat once stubs exist and rename to StringIO + import io + _StringIO = io.StringIO + + from hashlib import _Hash + _HashType = _Hash + + from email.message import Message as _Message +else: + # TODO move _StringIO definition into boto.compat once stubs exist and rename to StringIO + import StringIO + _StringIO = StringIO.StringIO + + from hashlib import _hash + _HashType = _hash + + # TODO use email.message.Message once stubs exist + _Message = Any + +_Provider = Any # TODO replace this with boto.provider.Provider once stubs exist +_LockType = Any # TODO replace this with _thread.LockType once stubs exist + + +JSONDecodeError: Type[ValueError] +qsa_of_interest: List[str] + + +def unquote_v(nv: str) -> Union[str, Tuple[str, str]]: ... +def canonical_string( + method: str, + path: str, + headers: Mapping[str, Optional[str]], + expires: Optional[int] = ..., + provider: Optional[_Provider] = ..., +) -> str: ... +def merge_meta( + headers: Mapping[str, str], + metadata: Mapping[str, str], + provider: Optional[_Provider] = ..., +) -> Mapping[str, str]: ... +def get_aws_metadata( + headers: Mapping[str, str], + provider: Optional[_Provider] = ..., +) -> Mapping[str, str]: ... +def retry_url( + url: str, + retry_on_404: bool = ..., + num_retries: int = ..., + timeout: Optional[int] = ..., +) -> str: ... + +class LazyLoadMetadata(Dict[_KT, _VT]): + def __init__( + self, + url: str, + num_retries: int, + timeout: Optional[int] = ..., + ) -> None: ... + +def get_instance_metadata( + version: str = ..., + url: str = ..., + data: str = ..., + timeout: Optional[int] = ..., + num_retries: int = ..., +) -> Optional[LazyLoadMetadata]: ... +def get_instance_identity( + version: str = ..., + url: str = ..., + timeout: Optional[int] = ..., + num_retries: int = ..., +) -> Optional[Mapping[str, Any]]: ... +def get_instance_userdata( + version: str = ..., + sep: Optional[str] = ..., + url: str = ..., + timeout: Optional[int] = ..., + num_retries: int = ..., +) -> Mapping[str, str]: ... + +ISO8601: str +ISO8601_MS: str +RFC1123: str +LOCALE_LOCK: _LockType + +def setlocale(name: Union[str, Tuple[str, str]]) -> ContextManager[str]: ... +def get_ts(ts: Optional[time.struct_time] = ...) -> str: ... +def parse_ts(ts: str) -> datetime.datetime: ... +def find_class(module_name: str, class_name: Optional[str] = ...) -> Optional[Type[Any]]: ... +def update_dme(username: str, password: str, dme_id: str, ip_address: str) -> str: ... +def fetch_file( + uri: str, + file: Optional[IO[str]] = ..., + username: Optional[str] = ..., + password: Optional[str] = ..., +) -> Optional[IO[str]]: ... + +class ShellCommand: + exit_code: int + command: subprocess._CMD + log_fp: _StringIO + wait: bool + fail_fast: bool + + def __init__( + self, + command: subprocess._CMD, + wait: bool = ..., + fail_fast: bool = ..., + cwd: Optional[subprocess._TXT] = ..., + ) -> None: ... + + process: subprocess.Popen + + def run(self, cwd: Optional[subprocess._CMD] = ...) -> Optional[int]: ... + def setReadOnly(self, value) -> None: ... + def getStatus(self) -> Optional[int]: ... + + status: Optional[int] + + def getOutput(self) -> str: ... + + output: str + +class AuthSMTPHandler(logging.handlers.SMTPHandler): + username: str + password: str + def __init__( + self, + mailhost: str, + username: str, + password: str, + fromaddr: str, + toaddrs: Sequence[str], + subject: str, + ) -> None: ... + +class LRUCache(Dict[_KT, _VT]): + class _Item: + previous: Optional[LRUCache._Item] + next: Optional[LRUCache._Item] + key = ... + value = ... + def __init__(self, key, value) -> None: ... + + _dict: Dict[_KT, LRUCache._Item] + capacity: int + head: Optional[LRUCache._Item] + tail: Optional[LRUCache._Item] + + def __init__(self, capacity: int) -> None: ... + + +# This exists to work around Password.str's name shadowing the str type +_str = str + +class Password: + hashfunc: Callable[[bytes], _HashType] + str: Optional[_str] + + def __init__( + self, + str: Optional[_str] = ..., + hashfunc: Optional[Callable[[bytes], _HashType]] = ..., + ) -> None: ... + def set(self, value: Union[bytes, _str]) -> None: ... + def __eq__(self, other: Any) -> bool: ... + def __len__(self) -> int: ... + +def notify( + subject: str, + body: Optional[str] = ..., + html_body: Optional[Union[Sequence[str], str]] = ..., + to_string: Optional[str] = ..., + attachments: Optional[Iterable[_Message]] = ..., + append_instance_id: bool = ..., +) -> None: ... +def get_utf8_value(value: str) -> bytes: ... +def mklist(value: Any) -> List: ... +def pythonize_name(name: str) -> str: ... +def write_mime_multipart( + content: List[Tuple[str, str]], + compress: bool = ..., + deftype: str = ..., + delimiter: str = ..., +) -> str: ... +def guess_mime_type(content: str, deftype: str) -> str: ... +def compute_md5( + fp: IO[Any], + buf_size: int = ..., + size: Optional[int] = ..., +) -> Tuple[str, str, int]: ... +def compute_hash( + fp: IO[Any], + buf_size: int = ..., + size: Optional[int] = ..., + hash_algorithm: Any = ..., +) -> Tuple[str, str, int]: ... +def find_matching_headers(name: str, headers: Mapping[str, Optional[str]]) -> List[str]: ... +def merge_headers_by_name(name: str, headers: Mapping[str, Optional[str]]) -> str: ... + +class RequestHook: + def handle_request_data( + self, + request: boto.connection.HTTPRequest, + response: boto.connection.HTTPResponse, + error: bool = ..., + ) -> Any: ... + +def host_is_ipv6(hostname: str) -> bool: ... +def parse_host(hostname: str) -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/certifi.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/certifi.pyi new file mode 100644 index 0000000..c809e6d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/certifi.pyi @@ -0,0 +1,2 @@ +def where() -> str: ... +def old_where() -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/characteristic/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/characteristic/__init__.pyi new file mode 100644 index 0000000..20bd6e5 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/characteristic/__init__.pyi @@ -0,0 +1,34 @@ +from typing import Sequence, Callable, Union, Any, Optional, AnyStr, TypeVar, Type + +def with_repr(attrs: Sequence[Union[AnyStr, Attribute]]) -> Callable[..., Any]: ... +def with_cmp(attrs: Sequence[Union[AnyStr, Attribute]]) -> Callable[..., Any]: ... +def with_init(attrs: Sequence[Union[AnyStr, Attribute]]) -> Callable[..., Any]: ... +def immutable(attrs: Sequence[Union[AnyStr, Attribute]]) -> Callable[..., Any]: ... + +def strip_leading_underscores(attribute_name: AnyStr) -> AnyStr: ... + +NOTHING = Any + +_T = TypeVar('_T') + +def attributes( + attrs: Sequence[Union[AnyStr, Attribute]], + apply_with_cmp: bool = ..., + apply_with_init: bool = ..., + apply_with_repr: bool = ..., + apply_immutable: bool = ..., + store_attributes: Optional[Callable[[type, Attribute], Any]] = ..., + **kw: Optional[dict]) -> Callable[[Type[_T]], Type[_T]]: ... + +class Attribute: + def __init__( + self, + name: AnyStr, + exclude_from_cmp: bool = ..., + exclude_from_init: bool = ..., + exclude_from_repr: bool = ..., + exclude_from_immutable: bool = ..., + default_value: Any = ..., + default_factory: Optional[Callable[[None], Any]] = ..., + instance_of: Optional[Any] = ..., + init_aliaser: Optional[Callable[[AnyStr], AnyStr]] = ...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/click/README.md b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/click/README.md new file mode 100644 index 0000000..debe701 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/click/README.md @@ -0,0 +1,11 @@ +# click 6.6, Python 3 + +`__init__.pyi` is almost a copy of `click/__init__.py`. It's a shortcut module +anyway in the actual sources so it works well with minimal changes. + +The types are pretty complete but they were created mostly for public API use +so some internal modules (`_compat`) or functions (`core._bashcomplete`) are +deliberately missing. If you feel the need to add those, pull requests accepted. + +Speaking of pull requests, it would be great if the option decorators informed +the type checker on what types the command callback should accept. diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/click/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/click/__init__.pyi new file mode 100644 index 0000000..4733c6d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/click/__init__.pyi @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +""" + click + ~~~~~ + + Click is a simple Python module that wraps the stdlib's optparse to make + writing command line scripts fun. Unlike other modules, it's based around + a simple API that does not come with too much magic and is composable. + + In case optparse ever gets removed from the stdlib, it will be shipped by + this module. + + :copyright: (c) 2014 by Armin Ronacher. + :license: BSD, see LICENSE for more details. +""" + +# Core classes +from .core import ( + Context as Context, + BaseCommand as BaseCommand, + Command as Command, + MultiCommand as MultiCommand, + Group as Group, + CommandCollection as CommandCollection, + Parameter as Parameter, + Option as Option, + Argument as Argument, +) + +# Globals +from .globals import get_current_context as get_current_context + +# Decorators +from .decorators import ( + pass_context as pass_context, + pass_obj as pass_obj, + make_pass_decorator as make_pass_decorator, + command as command, + group as group, + argument as argument, + option as option, + confirmation_option as confirmation_option, + password_option as password_option, + version_option as version_option, + help_option as help_option, +) + +# Types +from .types import ( + ParamType as ParamType, + File as File, + Path as Path, + Choice as Choice, + IntRange as IntRange, + Tuple as Tuple, + STRING as STRING, + INT as INT, + FLOAT as FLOAT, + BOOL as BOOL, + UUID as UUID, + UNPROCESSED as UNPROCESSED, +) + +# Utilities +from .utils import ( + echo as echo, + get_binary_stream as get_binary_stream, + get_text_stream as get_text_stream, + open_file as open_file, + format_filename as format_filename, + get_app_dir as get_app_dir, + get_os_args as get_os_args, +) + +# Terminal functions +from .termui import ( + prompt as prompt, + confirm as confirm, + get_terminal_size as get_terminal_size, + echo_via_pager as echo_via_pager, + progressbar as progressbar, + clear as clear, + style as style, + unstyle as unstyle, + secho as secho, + edit as edit, + launch as launch, + getchar as getchar, + pause as pause, +) + +# Exceptions +from .exceptions import ( + ClickException as ClickException, + UsageError as UsageError, + BadParameter as BadParameter, + FileError as FileError, + Abort as Abort, + NoSuchOption as NoSuchOption, + BadOptionUsage as BadOptionUsage, + BadArgumentUsage as BadArgumentUsage, + MissingParameter as MissingParameter, +) + +# Formatting +from .formatting import HelpFormatter as HelpFormatter, wrap_text as wrap_text + +# Parsing +from .parser import OptionParser as OptionParser + +# Controls if click should emit the warning about the use of unicode +# literals. +disable_unicode_literals_warning: bool + + +__version__: str diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/click/_termui_impl.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/click/_termui_impl.pyi new file mode 100644 index 0000000..f938c1c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/click/_termui_impl.pyi @@ -0,0 +1,14 @@ +from typing import ContextManager, Iterator, Generic, TypeVar, Optional + +_T = TypeVar("_T") + +class ProgressBar(object, Generic[_T]): + def update(self, n_steps: int) -> None: ... + def finish(self) -> None: ... + def __enter__(self) -> ProgressBar[_T]: ... + def __exit__(self, exc_type, exc_value, tb) -> None: ... + def __iter__(self) -> ProgressBar[_T]: ... + def next(self) -> _T: ... + def __next__(self) -> _T: ... + length: Optional[int] + label: str diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/click/core.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/click/core.pyi new file mode 100644 index 0000000..2cc32f0 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/click/core.pyi @@ -0,0 +1,474 @@ +from typing import ( + Any, + Callable, + ContextManager, + Dict, + Generator, + Iterable, + List, + Mapping, + NoReturn, + Optional, + Sequence, + Set, + Tuple, + TypeVar, + Union, +) + +from click.formatting import HelpFormatter +from click.parser import OptionParser + +def invoke_param_callback( + callback: Callable[[Context, Parameter, Optional[str]], Any], + ctx: Context, + param: Parameter, + value: Optional[str] +) -> Any: + ... + + +def augment_usage_errors( + ctx: Context, param: Optional[Parameter] = ... +) -> ContextManager[None]: + ... + + +def iter_params_for_processing( + invocation_order: Sequence[Parameter], + declaration_order: Iterable[Parameter], +) -> Iterable[Parameter]: + ... + + +class Context: + parent: Optional[Context] + command: Command + info_name: Optional[str] + params: Dict + args: List[str] + protected_args: List[str] + obj: Any + default_map: Mapping[str, Any] + invoked_subcommand: Optional[str] + terminal_width: Optional[int] + max_content_width: Optional[int] + allow_extra_args: bool + allow_interspersed_args: bool + ignore_unknown_options: bool + help_option_names: List[str] + token_normalize_func: Optional[Callable[[str], str]] + resilient_parsing: bool + auto_envvar_prefix: Optional[str] + color: Optional[bool] + _meta: Dict[str, Any] + _close_callbacks: List + _depth: int + + # properties + meta: Dict[str, Any] + command_path: str + + def __init__( + self, + command: Command, + parent: Optional[Context] = ..., + info_name: Optional[str] = ..., + obj: Optional[Any] = ..., + auto_envvar_prefix: Optional[str] = ..., + default_map: Optional[Mapping[str, Any]] = ..., + terminal_width: Optional[int] = ..., + max_content_width: Optional[int] = ..., + resilient_parsing: bool = ..., + allow_extra_args: Optional[bool] = ..., + allow_interspersed_args: Optional[bool] = ..., + ignore_unknown_options: Optional[bool] = ..., + help_option_names: Optional[List[str]] = ..., + token_normalize_func: Optional[Callable[[str], str]] = ..., + color: Optional[bool] = ... + ) -> None: + ... + + def scope(self, cleanup: bool = ...) -> ContextManager[Context]: + ... + + def make_formatter(self) -> HelpFormatter: + ... + + def call_on_close(self, f: Callable) -> Callable: + ... + + def close(self) -> None: + ... + + def find_root(self) -> Context: + ... + + def find_object(self, object_type: type) -> Any: + ... + + def ensure_object(self, object_type: type) -> Any: + ... + + def lookup_default(self, name: str) -> Any: + ... + + def fail(self, message: str) -> NoReturn: + ... + + def abort(self) -> NoReturn: + ... + + def exit(self, code: Union[int, str] = ...) -> NoReturn: + ... + + def get_usage(self) -> str: + ... + + def get_help(self) -> str: + ... + + def invoke( + self, callback: Union[Command, Callable], *args, **kwargs + ) -> Any: + ... + + def forward( + self, callback: Union[Command, Callable], *args, **kwargs + ) -> Any: + ... + +class BaseCommand: + allow_extra_args: bool + allow_interspersed_args: bool + ignore_unknown_options: bool + name: str + context_settings: Dict + + def __init__(self, name: str, context_settings: Optional[Dict] = ...) -> None: + ... + + def get_usage(self, ctx: Context) -> str: + ... + + def get_help(self, ctx: Context) -> str: + ... + + def make_context( + self, info_name: str, args: List[str], parent: Optional[Context] = ..., **extra + ) -> Context: + ... + + def parse_args(self, ctx: Context, args: List[str]) -> List[str]: + ... + + def invoke(self, ctx: Context) -> Any: + ... + + def main( + self, + args: Optional[List[str]] = ..., + prog_name: Optional[str] = ..., + complete_var: Optional[str] = ..., + standalone_mode: bool = ..., + **extra + ) -> Any: + ... + + def __call__(self, *args, **kwargs) -> Any: + ... + + +class Command(BaseCommand): + callback: Optional[Callable] + params: List[Parameter] + help: Optional[str] + epilog: Optional[str] + short_help: Optional[str] + options_metavar: str + add_help_option: bool + hidden: bool + deprecated: bool + + def __init__( + self, + name: str, + context_settings: Optional[Dict] = ..., + callback: Optional[Callable] = ..., + params: Optional[List[Parameter]] = ..., + help: Optional[str] = ..., + epilog: Optional[str] = ..., + short_help: Optional[str] = ..., + options_metavar: str = ..., + add_help_option: bool = ..., + hidden: bool = ..., + deprecated: bool = ..., + ) -> None: + ... + + def get_params(self, ctx: Context) -> List[Parameter]: + ... + + def format_usage( + self, + ctx: Context, + formatter: HelpFormatter + ) -> None: + ... + + def collect_usage_pieces(self, ctx: Context) -> List[str]: + ... + + def get_help_option_names(self, ctx: Context) -> Set[str]: + ... + + def get_help_option(self, ctx: Context) -> Optional[Option]: + ... + + def make_parser(self, ctx: Context) -> OptionParser: + ... + + def format_help(self, ctx: Context, formatter: HelpFormatter) -> None: + ... + + def format_help_text(self, ctx: Context, formatter: HelpFormatter) -> None: + ... + + def format_options(self, ctx: Context, formatter: HelpFormatter) -> None: + ... + + def format_epilog(self, ctx: Context, formatter: HelpFormatter) -> None: + ... + + +_T = TypeVar('_T') +_F = TypeVar('_F', bound=Callable[..., Any]) + + +class MultiCommand(Command): + no_args_is_help: bool + invoke_without_command: bool + subcommand_metavar: str + chain: bool + result_callback: Callable + + def __init__( + self, + name: Optional[str] = ..., + invoke_without_command: bool = ..., + no_args_is_help: Optional[bool] = ..., + subcommand_metavar: Optional[str] = ..., + chain: bool = ..., + result_callback: Optional[Callable] = ..., + **attrs + ) -> None: + ... + + def resultcallback( + self, replace: bool = ... + ) -> Callable[[_F], _F]: + ... + + def format_commands(self, ctx: Context, formatter: HelpFormatter) -> None: + ... + + def resolve_command( + self, ctx: Context, args: List[str] + ) -> Tuple[str, Command, List[str]]: + ... + + def get_command(self, ctx: Context, cmd_name: str) -> Optional[Command]: + ... + + def list_commands(self, ctx: Context) -> Iterable[str]: + ... + + +class Group(MultiCommand): + commands: Dict[str, Command] + + def __init__( + self, name: Optional[str] = ..., commands: Optional[Dict[str, Command]] = ..., **attrs + ) -> None: + ... + + def add_command(self, cmd: Command, name: Optional[str] = ...): + ... + + def command(self, *args, **kwargs) -> Callable[[Callable], Command]: + ... + + def group(self, *args, **kwargs) -> Callable[[Callable], Group]: + ... + + +class CommandCollection(MultiCommand): + sources: List[MultiCommand] + + def __init__( + self, name: Optional[str] = ..., sources: Optional[List[MultiCommand]] = ..., **attrs + ) -> None: + ... + + def add_source(self, multi_cmd: MultiCommand) -> None: + ... + + +class _ParamType: + name: str + is_composite: bool + envvar_list_splitter: Optional[str] + + def __call__( + self, + value: Optional[str], + param: Optional[Parameter] = ..., + ctx: Optional[Context] = ..., + ) -> Any: + ... + + def get_metavar(self, param: Parameter) -> str: + ... + + def get_missing_message(self, param: Parameter) -> str: + ... + + def convert( + self, + value: str, + param: Optional[Parameter], + ctx: Optional[Context], + ) -> Any: + ... + + def split_envvar_value(self, rv: str) -> List[str]: + ... + + def fail(self, message: str, param: Optional[Parameter] = ..., ctx: Optional[Context] = ...) -> None: + ... + + +# This type is here to resolve https://github.com/python/mypy/issues/5275 +_ConvertibleType = Union[type, _ParamType, Tuple[type, ...], Callable[[str], Any], Callable[[Optional[str]], Any]] + + +class Parameter: + param_type_name: str + name: str + opts: List[str] + secondary_opts: List[str] + type: _ParamType + required: bool + callback: Optional[Callable[[Context, Parameter, str], Any]] + nargs: int + multiple: bool + expose_value: bool + default: Any + is_eager: bool + metavar: Optional[str] + envvar: Union[str, List[str], None] + # properties + human_readable_name: str + + def __init__( + self, + param_decls: Optional[List[str]] = ..., + type: Optional[_ConvertibleType] = ..., + required: bool = ..., + default: Optional[Any] = ..., + callback: Optional[Callable[[Context, Parameter, str], Any]] = ..., + nargs: Optional[int] = ..., + metavar: Optional[str] = ..., + expose_value: bool = ..., + is_eager: bool = ..., + envvar: Optional[Union[str, List[str]]] = ... + ) -> None: + ... + + def make_metavar(self) -> str: + ... + + def get_default(self, ctx: Context) -> Any: + ... + + def add_to_parser(self, parser: OptionParser, ctx: Context) -> None: + ... + + def consume_value(self, ctx: Context, opts: Dict[str, Any]) -> Any: + ... + + def type_cast_value(self, ctx: Context, value: Any) -> Any: + ... + + def process_value(self, ctx: Context, value: Any) -> Any: + ... + + def value_is_missing(self, value: Any) -> bool: + ... + + def full_process_value(self, ctx: Context, value: Any) -> Any: + ... + + def resolve_envvar_value(self, ctx: Context) -> str: + ... + + def value_from_envvar(self, ctx: Context) -> Union[str, List[str]]: + ... + + def handle_parse_result( + self, ctx: Context, opts: Dict[str, Any], args: List[str] + ) -> Tuple[Any, List[str]]: + ... + + def get_help_record(self, ctx: Context) -> Tuple[str, str]: + ... + + def get_usage_pieces(self, ctx: Context) -> List[str]: + ... + + +class Option(Parameter): + prompt: str # sic + confirmation_prompt: bool + hide_input: bool + is_flag: bool + flag_value: Any + is_bool_flag: bool + count: bool + multiple: bool + allow_from_autoenv: bool + help: Optional[str] + show_default: bool + show_choices: bool + + def __init__( + self, + param_decls: Optional[List[str]] = ..., + show_default: bool = ..., + prompt: Union[bool, str] = ..., + confirmation_prompt: bool = ..., + hide_input: bool = ..., + is_flag: Optional[bool] = ..., + flag_value: Optional[Any] = ..., + multiple: bool = ..., + count: bool = ..., + allow_from_autoenv: bool = ..., + type: Optional[_ConvertibleType] = ..., + help: Optional[str] = ..., + show_choices: bool = ..., + **attrs + ) -> None: + ... + + def prompt_for_value(self, ctx: Context) -> Any: + ... + + +class Argument(Parameter): + def __init__( + self, + param_decls: Optional[List[str]] = ..., + required: Optional[bool] = ..., + **attrs + ) -> None: + ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/click/decorators.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/click/decorators.pyi new file mode 100644 index 0000000..44f4ad7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/click/decorators.pyi @@ -0,0 +1,336 @@ +from distutils.version import Version +from typing import Any, Callable, Dict, List, Optional, Tuple, Type, TypeVar, Union, Text, overload + +from click.core import Command, Group, Argument, Option, Parameter, Context, _ConvertibleType + +_T = TypeVar('_T') +_F = TypeVar('_F', bound=Callable[..., Any]) + +# Until https://github.com/python/mypy/issues/3924 is fixed you can't do the following: +# _Decorator = Callable[[_F], _F] + +_Callback = Callable[ + [Context, Union[Option, Parameter], Any], + Any +] + +def pass_context(_T) -> _T: + ... + + +def pass_obj(_T) -> _T: + ... + + +def make_pass_decorator( + object_type: type, ensure: bool = ... +) -> Callable[[_T], _T]: + ... + + +# NOTE: Decorators below have **attrs converted to concrete constructor +# arguments from core.pyi to help with type checking. + +def command( + name: Optional[str] = ..., + cls: Optional[Type[Command]] = ..., + # Command + context_settings: Optional[Dict] = ..., + help: Optional[str] = ..., + epilog: Optional[str] = ..., + short_help: Optional[str] = ..., + options_metavar: str = ..., + add_help_option: bool = ..., + hidden: bool = ..., + deprecated: bool = ..., +) -> Callable[[Callable], Command]: + ... + + +# This inherits attrs from Group, MultiCommand and Command. + +def group( + name: Optional[str] = ..., + cls: Type[Command] = ..., + # Group + commands: Optional[Dict[str, Command]] = ..., + # MultiCommand + invoke_without_command: bool = ..., + no_args_is_help: Optional[bool] = ..., + subcommand_metavar: Optional[str] = ..., + chain: bool = ..., + result_callback: Optional[Callable] = ..., + # Command + help: Optional[str] = ..., + epilog: Optional[str] = ..., + short_help: Optional[str] = ..., + options_metavar: str = ..., + add_help_option: bool = ..., + hidden: bool = ..., + deprecated: bool = ..., + # User-defined + **kwargs: Any, +) -> Callable[[Callable], Group]: + ... + + +def argument( + *param_decls: str, + cls: Type[Argument] = ..., + # Argument + required: Optional[bool] = ..., + # Parameter + type: Optional[_ConvertibleType] = ..., + default: Optional[Any] = ..., + callback: Optional[_Callback] = ..., + nargs: Optional[int] = ..., + metavar: Optional[str] = ..., + expose_value: bool = ..., + is_eager: bool = ..., + envvar: Optional[Union[str, List[str]]] = ..., + autocompletion: Optional[Callable[[Any, List[str], str], List[Union[str, Tuple[str, str]]]]] = ..., +) -> Callable[[_F], _F]: + ... + + +@overload +def option( + *param_decls: str, + cls: Type[Option] = ..., + # Option + show_default: bool = ..., + prompt: Union[bool, Text] = ..., + confirmation_prompt: bool = ..., + hide_input: bool = ..., + is_flag: Optional[bool] = ..., + flag_value: Optional[Any] = ..., + multiple: bool = ..., + count: bool = ..., + allow_from_autoenv: bool = ..., + type: Optional[_ConvertibleType] = ..., + help: Optional[str] = ..., + show_choices: bool = ..., + # Parameter + default: Optional[Any] = ..., + required: bool = ..., + callback: Optional[_Callback] = ..., + nargs: Optional[int] = ..., + metavar: Optional[str] = ..., + expose_value: bool = ..., + is_eager: bool = ..., + envvar: Optional[Union[str, List[str]]] = ..., + # User-defined + **kwargs: Any, +) -> Callable[[_F], _F]: + ... + + +@overload +def option( + *param_decls: str, + cls: Type[Option] = ..., + # Option + show_default: bool = ..., + prompt: Union[bool, Text] = ..., + confirmation_prompt: bool = ..., + hide_input: bool = ..., + is_flag: Optional[bool] = ..., + flag_value: Optional[Any] = ..., + multiple: bool = ..., + count: bool = ..., + allow_from_autoenv: bool = ..., + type: _T = ..., + help: Optional[str] = ..., + show_choices: bool = ..., + # Parameter + default: Optional[Any] = ..., + required: bool = ..., + callback: Optional[Callable[[Context, Union[Option, Parameter], Union[bool, int, str]], _T]] = ..., + nargs: Optional[int] = ..., + metavar: Optional[str] = ..., + expose_value: bool = ..., + is_eager: bool = ..., + envvar: Optional[Union[str, List[str]]] = ..., + # User-defined + **kwargs: Any, +) -> Callable[[_F], _F]: + ... + + +@overload +def option( + *param_decls: str, + cls: Type[Option] = ..., + # Option + show_default: bool = ..., + prompt: Union[bool, Text] = ..., + confirmation_prompt: bool = ..., + hide_input: bool = ..., + is_flag: Optional[bool] = ..., + flag_value: Optional[Any] = ..., + multiple: bool = ..., + count: bool = ..., + allow_from_autoenv: bool = ..., + type: Type[str] = ..., + help: Optional[str] = ..., + show_choices: bool = ..., + # Parameter + default: Optional[Any] = ..., + required: bool = ..., + callback: Callable[[Context, Union[Option, Parameter], str], Any] = ..., + nargs: Optional[int] = ..., + metavar: Optional[str] = ..., + expose_value: bool = ..., + is_eager: bool = ..., + envvar: Optional[Union[str, List[str]]] = ..., + # User-defined + **kwargs: Any, +) -> Callable[[_F], _F]: + ... + + +@overload +def option( + *param_decls: str, + cls: Type[Option] = ..., + # Option + show_default: bool = ..., + prompt: Union[bool, Text] = ..., + confirmation_prompt: bool = ..., + hide_input: bool = ..., + is_flag: Optional[bool] = ..., + flag_value: Optional[Any] = ..., + multiple: bool = ..., + count: bool = ..., + allow_from_autoenv: bool = ..., + type: Type[int] = ..., + help: Optional[str] = ..., + show_choices: bool = ..., + # Parameter + default: Optional[Any] = ..., + required: bool = ..., + callback: Callable[[Context, Union[Option, Parameter], int], Any] = ..., + nargs: Optional[int] = ..., + metavar: Optional[str] = ..., + expose_value: bool = ..., + is_eager: bool = ..., + envvar: Optional[Union[str, List[str]]] = ..., + # User-defined + **kwargs: Any, +) -> Callable[[_F], _F]: + ... + + +def confirmation_option( + *param_decls: str, + cls: Type[Option] = ..., + # Option + show_default: bool = ..., + prompt: Union[bool, Text] = ..., + confirmation_prompt: bool = ..., + hide_input: bool = ..., + is_flag: bool = ..., + flag_value: Optional[Any] = ..., + multiple: bool = ..., + count: bool = ..., + allow_from_autoenv: bool = ..., + type: Optional[_ConvertibleType] = ..., + help: str = ..., + show_choices: bool = ..., + # Parameter + default: Optional[Any] = ..., + callback: Optional[_Callback] = ..., + nargs: Optional[int] = ..., + metavar: Optional[str] = ..., + expose_value: bool = ..., + is_eager: bool = ..., + envvar: Optional[Union[str, List[str]]] = ... +) -> Callable[[_F], _F]: + ... + + +def password_option( + *param_decls: str, + cls: Type[Option] = ..., + # Option + show_default: bool = ..., + prompt: Union[bool, Text] = ..., + confirmation_prompt: bool = ..., + hide_input: bool = ..., + is_flag: Optional[bool] = ..., + flag_value: Optional[Any] = ..., + multiple: bool = ..., + count: bool = ..., + allow_from_autoenv: bool = ..., + type: Optional[_ConvertibleType] = ..., + help: Optional[str] = ..., + show_choices: bool = ..., + # Parameter + default: Optional[Any] = ..., + callback: Optional[_Callback] = ..., + nargs: Optional[int] = ..., + metavar: Optional[str] = ..., + expose_value: bool = ..., + is_eager: bool = ..., + envvar: Optional[Union[str, List[str]]] = ... +) -> Callable[[_F], _F]: + ... + + +def version_option( + version: Optional[Union[str, Version]] = ..., + *param_decls: str, + cls: Type[Option] = ..., + # Option + prog_name: Optional[str] = ..., + message: Optional[str] = ..., + show_default: bool = ..., + prompt: Union[bool, Text] = ..., + confirmation_prompt: bool = ..., + hide_input: bool = ..., + is_flag: bool = ..., + flag_value: Optional[Any] = ..., + multiple: bool = ..., + count: bool = ..., + allow_from_autoenv: bool = ..., + type: Optional[_ConvertibleType] = ..., + help: str = ..., + show_choices: bool = ..., + # Parameter + default: Optional[Any] = ..., + callback: Optional[_Callback] = ..., + nargs: Optional[int] = ..., + metavar: Optional[str] = ..., + expose_value: bool = ..., + is_eager: bool = ..., + envvar: Optional[Union[str, List[str]]] = ... +) -> Callable[[_F], _F]: + ... + + +def help_option( + *param_decls: str, + cls: Type[Option] = ..., + # Option + show_default: bool = ..., + prompt: Union[bool, Text] = ..., + confirmation_prompt: bool = ..., + hide_input: bool = ..., + is_flag: bool = ..., + flag_value: Optional[Any] = ..., + multiple: bool = ..., + count: bool = ..., + allow_from_autoenv: bool = ..., + type: Optional[_ConvertibleType] = ..., + help: str = ..., + show_choices: bool = ..., + # Parameter + default: Optional[Any] = ..., + callback: Optional[_Callback] = ..., + nargs: Optional[int] = ..., + metavar: Optional[str] = ..., + expose_value: bool = ..., + is_eager: bool = ..., + envvar: Optional[Union[str, List[str]]] = ... +) -> Callable[[_F], _F]: + ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/click/exceptions.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/click/exceptions.pyi new file mode 100644 index 0000000..7e081be --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/click/exceptions.pyi @@ -0,0 +1,96 @@ +from typing import IO, List, Optional, Any + +from click.core import Context, Parameter + + +class ClickException(Exception): + exit_code: int + message: str + + def __init__(self, message: str) -> None: + ... + + def format_message(self) -> str: + ... + + def show(self, file: Optional[Any] = ...) -> None: + ... + + +class UsageError(ClickException): + ctx: Optional[Context] + + def __init__(self, message: str, ctx: Optional[Context] = ...) -> None: + ... + + def show(self, file: Optional[IO] = ...) -> None: + ... + + +class BadParameter(UsageError): + param: Optional[Parameter] + param_hint: Optional[str] + + def __init__( + self, + message: str, + ctx: Optional[Context] = ..., + param: Optional[Parameter] = ..., + param_hint: Optional[str] = ... + ) -> None: + ... + + +class MissingParameter(BadParameter): + param_type: str # valid values: 'parameter', 'option', 'argument' + + def __init__( + self, + message: Optional[str] = ..., + ctx: Optional[Context] = ..., + param: Optional[Parameter] = ..., + param_hint: Optional[str] = ..., + param_type: Optional[str] = ... + ) -> None: + ... + + +class NoSuchOption(UsageError): + option_name: str + possibilities: Optional[List[str]] + + def __init__( + self, + option_name: str, + message: Optional[str] = ..., + possibilities: Optional[List[str]] = ..., + ctx: Optional[Context] = ... + ) -> None: + ... + + +class BadOptionUsage(UsageError): + def __init__(self, message: str, ctx: Optional[Context] = ...) -> None: + ... + + +class BadArgumentUsage(UsageError): + def __init__(self, message: str, ctx: Optional[Context] = ...) -> None: + ... + + +class FileError(ClickException): + ui_filename: str + filename: str + + def __init__(self, filename: str, hint: Optional[str] = ...) -> None: + ... + + +class Abort(RuntimeError): + ... + + +class Exit(RuntimeError): + def __init__(self, code: int = ...) -> None: + ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/click/formatting.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/click/formatting.pyi new file mode 100644 index 0000000..bcd3048 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/click/formatting.pyi @@ -0,0 +1,86 @@ +from typing import ContextManager, Generator, Iterable, List, Optional, Tuple + + +FORCED_WIDTH: Optional[int] + + +def measure_table(rows: Iterable[Iterable[str]]) -> Tuple[int, ...]: + ... + + +def iter_rows( + rows: Iterable[Iterable[str]], col_count: int +) -> Generator[Tuple[str, ...], None, None]: + ... + + +def wrap_text( + text: str, + width: int = ..., + initial_indent: str = ..., + subsequent_indent: str = ..., + preserve_paragraphs: bool = ... +) -> str: + ... + + +class HelpFormatter: + indent_increment: int + width: Optional[int] + current_indent: int + buffer: List[str] + + def __init__( + self, + indent_increment: int = ..., + width: Optional[int] = ..., + max_width: Optional[int] = ..., + ) -> None: + ... + + def write(self, string: str) -> None: + ... + + def indent(self) -> None: + ... + + def dedent(self) -> None: + ... + + def write_usage( + self, + prog: str, + args: str = ..., + prefix: str = ..., + ): + ... + + def write_heading(self, heading: str) -> None: + ... + + def write_paragraph(self) -> None: + ... + + def write_text(self, text: str) -> None: + ... + + def write_dl( + self, + rows: Iterable[Iterable[str]], + col_max: int = ..., + col_spacing: int = ..., + ) -> None: + ... + + def section(self, name) -> ContextManager[None]: + ... + + def indentation(self) -> ContextManager[None]: + ... + + def getvalue(self) -> str: + ... + + +def join_options(options: List[str]) -> Tuple[str, bool]: + ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/click/globals.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/click/globals.pyi new file mode 100644 index 0000000..11adce3 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/click/globals.pyi @@ -0,0 +1,18 @@ +from click.core import Context +from typing import Optional + + +def get_current_context(silent: bool = ...) -> Context: + ... + + +def push_context(ctx: Context) -> None: + ... + + +def pop_context() -> None: + ... + + +def resolve_color_default(color: Optional[bool] = ...) -> Optional[bool]: + ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/click/parser.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/click/parser.pyi new file mode 100644 index 0000000..f5869a2 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/click/parser.pyi @@ -0,0 +1,102 @@ +from typing import Any, Dict, Iterable, List, Optional, Set, Tuple + +from click.core import Context + + +def _unpack_args( + args: Iterable[str], nargs_spec: Iterable[int] +) -> Tuple[Tuple[Optional[Tuple[str, ...]], ...], List[str]]: + ... + + +def split_opt(opt: str) -> Tuple[str, str]: + ... + + +def normalize_opt(opt: str, ctx: Context) -> str: + ... + + +def split_arg_string(string: str) -> List[str]: + ... + + +class Option: + dest: str + action: str + nargs: int + const: Any + obj: Any + prefixes: Set[str] + _short_opts: List[str] + _long_opts: List[str] + # properties + takes_value: bool + + def __init__( + self, + opts: Iterable[str], + dest: str, + action: Optional[str] = ..., + nargs: int = ..., + const: Optional[Any] = ..., + obj: Optional[Any] = ... + ) -> None: + ... + + def process(self, value: Any, state: ParsingState) -> None: + ... + + +class Argument: + dest: str + nargs: int + obj: Any + + def __init__(self, dest: str, nargs: int = ..., obj: Optional[Any] = ...) -> None: + ... + + def process(self, value: Any, state: ParsingState) -> None: + ... + + +class ParsingState: + opts: Dict[str, Any] + largs: List[str] + rargs: List[str] + order: List[Any] + + def __init__(self, rargs: List[str]) -> None: + ... + + +class OptionParser: + ctx: Optional[Context] + allow_interspersed_args: bool + ignore_unknown_options: bool + _short_opt: Dict[str, Option] + _long_opt: Dict[str, Option] + _opt_prefixes: Set[str] + _args: List[Argument] + + def __init__(self, ctx: Optional[Context] = ...) -> None: + ... + + def add_option( + self, + opts: Iterable[str], + dest: str, + action: Optional[str] = ..., + nargs: int = ..., + const: Optional[Any] = ..., + obj: Optional[Any] = ... + ) -> None: + ... + + def add_argument(self, dest: str, nargs: int = ..., obj: Optional[Any] = ...) -> None: + ... + + def parse_args( + self, args: List[str] + ) -> Tuple[Dict[str, Any], List[str], List[Any]]: + ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/click/termui.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/click/termui.pyi new file mode 100644 index 0000000..95b6850 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/click/termui.pyi @@ -0,0 +1,169 @@ +from typing import ( + Any, + Callable, + Generator, + Iterable, + IO, + List, + Optional, + Text, + overload, + Tuple, + TypeVar, +) + +from click.core import _ConvertibleType +from click._termui_impl import ProgressBar as _ProgressBar + + +def hidden_prompt_func(prompt: str) -> str: + ... + + +def _build_prompt( + text: str, + suffix: str, + show_default: bool = ..., + default: Optional[str] = ..., +) -> str: + ... + + +def prompt( + text: str, + default: Optional[str] = ..., + hide_input: bool = ..., + confirmation_prompt: bool = ..., + type: Optional[_ConvertibleType] = ..., + value_proc: Optional[Callable[[Optional[str]], Any]] = ..., + prompt_suffix: str = ..., + show_default: bool = ..., + err: bool = ..., + show_choices: bool = ..., +) -> Any: + ... + + +def confirm( + text: str, + default: bool = ..., + abort: bool = ..., + prompt_suffix: str = ..., + show_default: bool = ..., + err: bool = ..., +) -> bool: + ... + + +def get_terminal_size() -> Tuple[int, int]: + ... + + +def echo_via_pager(text: str, color: Optional[bool] = ...) -> None: + ... + + +_T = TypeVar('_T') + +@overload +def progressbar( + iterable: Iterable[_T], + length: Optional[int] = ..., + label: Optional[str] = ..., + show_eta: bool = ..., + show_percent: Optional[bool] = ..., + show_pos: bool = ..., + item_show_func: Optional[Callable[[_T], str]] = ..., + fill_char: str = ..., + empty_char: str = ..., + bar_template: str = ..., + info_sep: str = ..., + width: int = ..., + file: Optional[IO] = ..., + color: Optional[bool] = ..., +) -> _ProgressBar[_T]: + ... + +@overload +def progressbar( + iterable: None = ..., + length: Optional[int] = ..., + label: Optional[str] = ..., + show_eta: bool = ..., + show_percent: Optional[bool] = ..., + show_pos: bool = ..., + item_show_func: Optional[Callable[[_T], str]] = ..., + fill_char: str = ..., + empty_char: str = ..., + bar_template: str = ..., + info_sep: str = ..., + width: int = ..., + file: Optional[IO] = ..., + color: Optional[bool] = ..., +) -> _ProgressBar[int]: + ... + +def clear() -> None: + ... + + +def style( + text: str, + fg: Optional[str] = ..., + bg: Optional[str] = ..., + bold: Optional[bool] = ..., + dim: Optional[bool] = ..., + underline: Optional[bool] = ..., + blink: Optional[bool] = ..., + reverse: Optional[bool] = ..., + reset: bool = ..., +) -> str: + ... + + +def unstyle(text: str) -> str: + ... + + +# Styling options copied from style() for nicer type checking. +def secho( + text: str, + file: Optional[IO] = ..., + nl: bool = ..., + err: bool = ..., + color: Optional[bool] = ..., + fg: Optional[str] = ..., + bg: Optional[str] = ..., + bold: Optional[bool] = ..., + dim: Optional[bool] = ..., + underline: Optional[bool] = ..., + blink: Optional[bool] = ..., + reverse: Optional[bool] = ..., + reset: bool = ..., +): + ... + + +def edit( + text: Optional[str] = ..., + editor: Optional[str] = ..., + env: Optional[str] = ..., + require_save: bool = ..., + extension: str = ..., + filename: Optional[str] = ..., +) -> str: + ... + + +def launch(url: str, wait: bool = ..., locate: bool = ...) -> int: + ... + + +def getchar(echo: bool = ...) -> Text: + ... + + +def pause( + info: str = ..., err: bool = ... +) -> None: + ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/click/testing.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/click/testing.pyi new file mode 100644 index 0000000..c743516 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/click/testing.pyi @@ -0,0 +1,63 @@ +from typing import (IO, Any, BinaryIO, ContextManager, Dict, Iterable, List, + Mapping, Optional, Text, Tuple, Union) + +from .core import BaseCommand + +clickpkg: Any + +class EchoingStdin: + def __init__(self, input: BinaryIO, output: BinaryIO) -> None: ... + def __getattr__(self, x: str) -> Any: ... + def read(self, n: int = ...) -> bytes: ... + def readline(self, n: int = ...) -> bytes: ... + def readlines(self) -> List[bytes]: ... + def __iter__(self) -> Iterable[bytes]: ... + +def make_input_stream(input: Optional[Union[bytes, Text, IO]], charset: Text) -> BinaryIO: ... + +class Result: + runner: CliRunner + exit_code: int + exception: Any + exc_info: Optional[Any] + def __init__( + self, + runner: CliRunner, + exit_code: int, + exception: Any, + exc_info: Optional[Any] = ..., + ) -> None: ... + @property + def output(self) -> Text: ... + +class CliRunner: + charset: str + env: Mapping[str, str] + echo_stdin: bool + def __init__( + self, + charset: Optional[Text] = ..., + env: Optional[Mapping[str, str]] = ..., + echo_stdin: bool = ..., + ) -> None: + ... + def get_default_prog_name(self, cli: BaseCommand) -> str: ... + def make_env(self, overrides: Optional[Mapping[str, str]] = ...) -> Dict[str, str]: ... + def isolation( + self, + input: Optional[IO] = ..., + env: Optional[Mapping[str, str]] = ..., + color: bool = ..., + ) -> ContextManager[BinaryIO]: ... + def invoke( + self, + cli: BaseCommand, + args: Optional[Union[str, Iterable[str]]] = ..., + input: Optional[IO] = ..., + env: Optional[Mapping[str, str]] = ..., + catch_exceptions: bool = ..., + color: bool = ..., + **extra: Any, + ) -> Result: + ... + def isolated_filesystem(self) -> ContextManager[str]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/click/types.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/click/types.pyi new file mode 100644 index 0000000..7f1e0ba --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/click/types.pyi @@ -0,0 +1,269 @@ +from typing import Any, Callable, IO, Iterable, List, Optional, TypeVar, Union, Tuple as _PyTuple, Type +import datetime +import uuid + +from click.core import Context, Parameter, _ParamType as ParamType, _ConvertibleType + +class BoolParamType(ParamType): + def __call__( + self, + value: Optional[str], + param: Optional[Parameter] = ..., + ctx: Optional[Context] = ..., + ) -> bool: + ... + + def convert( + self, + value: str, + param: Optional[Parameter], + ctx: Optional[Context], + ) -> bool: + ... + + +class CompositeParamType(ParamType): + arity: int + + +class Choice(ParamType): + choices: Iterable[str] + def __init__( + self, + choices: Iterable[str], + case_sensitive: bool = ..., + ) -> None: + ... + + +class DateTime(ParamType): + def __init__( + self, + formats: Optional[List[str]] = ..., + ) -> None: + ... + + def convert( + self, + value: str, + param: Optional[Parameter], + ctx: Optional[Context], + ) -> datetime.datetime: + ... + + +class FloatParamType(ParamType): + def __call__( + self, + value: Optional[str], + param: Optional[Parameter] = ..., + ctx: Optional[Context] = ..., + ) -> float: + ... + + def convert( + self, + value: str, + param: Optional[Parameter], + ctx: Optional[Context], + ) -> float: + ... + + +class FloatRange(FloatParamType): + ... + + +class File(ParamType): + def __init__( + self, + mode: str = ..., + encoding: Optional[str] = ..., + errors: Optional[str] = ..., + lazy: Optional[bool] = ..., + atomic: Optional[bool] = ..., + ) -> None: + ... + + def __call__( + self, + value: Optional[str], + param: Optional[Parameter] = ..., + ctx: Optional[Context] = ..., + ) -> IO: + ... + + def convert( + self, + value: str, + param: Optional[Parameter], + ctx: Optional[Context], + ) -> IO: + ... + + def resolve_lazy_flag(self, value: str) -> bool: + ... + + +_F = TypeVar('_F') # result of the function +_Func = Callable[[Optional[str]], _F] + + +class FuncParamType(ParamType): + func: _Func + + def __init__(self, func: _Func) -> None: + ... + + def __call__( + self, + value: Optional[str], + param: Optional[Parameter] = ..., + ctx: Optional[Context] = ..., + ) -> _F: + ... + + def convert( + self, + value: str, + param: Optional[Parameter], + ctx: Optional[Context], + ) -> _F: + ... + + +class IntParamType(ParamType): + def __call__( + self, + value: Optional[str], + param: Optional[Parameter] = ..., + ctx: Optional[Context] = ..., + ) -> int: + ... + + def convert( + self, + value: str, + param: Optional[Parameter], + ctx: Optional[Context], + ) -> int: + ... + + +class IntRange(IntParamType): + def __init__( + self, min: Optional[int] = ..., max: Optional[int] = ..., clamp: bool = ... + ) -> None: + ... + + +_PathType = TypeVar('_PathType', str, bytes) + + +class Path(ParamType): + def __init__( + self, + exists: bool = ..., + file_okay: bool = ..., + dir_okay: bool = ..., + writable: bool = ..., + readable: bool = ..., + resolve_path: bool = ..., + allow_dash: bool = ..., + path_type: Optional[Type[_PathType]] = ..., + ) -> None: + ... + + def coerce_path_result(self, rv: Union[str, bytes]) -> _PathType: + ... + + def __call__( + self, + value: Optional[str], + param: Optional[Parameter] = ..., + ctx: Optional[Context] = ..., + ) -> _PathType: + ... + + def convert( + self, + value: str, + param: Optional[Parameter], + ctx: Optional[Context], + ) -> _PathType: + ... + +class StringParamType(ParamType): + def __call__( + self, + value: Optional[str], + param: Optional[Parameter] = ..., + ctx: Optional[Context] = ..., + ) -> str: + ... + + def convert( + self, + value: str, + param: Optional[Parameter], + ctx: Optional[Context], + ) -> str: + ... + + +class Tuple(CompositeParamType): + types: List[ParamType] + + def __init__(self, types: Iterable[Any]) -> None: + ... + + def __call__( + self, + value: Optional[str], + param: Optional[Parameter] = ..., + ctx: Optional[Context] = ..., + ) -> Tuple: + ... + + def convert( + self, + value: str, + param: Optional[Parameter], + ctx: Optional[Context], + ) -> Tuple: + ... + + +class UnprocessedParamType(ParamType): + ... + + +class UUIDParameterType(ParamType): + def __call__( + self, + value: Optional[str], + param: Optional[Parameter] = ..., + ctx: Optional[Context] = ..., + ) -> uuid.UUID: + ... + + def convert( + self, + value: str, + param: Optional[Parameter], + ctx: Optional[Context], + ) -> uuid.UUID: + ... + + +def convert_type(ty: Optional[_ConvertibleType], default: Optional[Any] = ...) -> ParamType: + ... + +# parameter type shortcuts + +BOOL: BoolParamType +FLOAT: FloatParamType +INT: IntParamType +STRING: StringParamType +UNPROCESSED: UnprocessedParamType +UUID: UUIDParameterType diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/click/utils.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/click/utils.pyi new file mode 100644 index 0000000..547c5e8 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/click/utils.pyi @@ -0,0 +1,116 @@ +from typing import Any, Callable, Iterator, IO, List, Optional, TypeVar, Union, Text + +_T = TypeVar('_T') + + +def _posixify(name: str) -> str: + ... + + +def safecall(func: _T) -> _T: + ... + + +def make_str(value: Any) -> str: + ... + + +def make_default_short_help(help: str, max_length: int = ...): + ... + + +class LazyFile: + name: str + mode: str + encoding: Optional[str] + errors: str + atomic: bool + + def __init__( + self, + filename: str, + mode: str = ..., + encoding: Optional[str] = ..., + errors: str = ..., + atomic: bool = ... + ) -> None: + ... + + def open(self) -> IO: + ... + + def close(self) -> None: + ... + + def close_intelligently(self) -> None: + ... + + def __enter__(self) -> LazyFile: + ... + + def __exit__(self, exc_type, exc_value, tb): + ... + + def __iter__(self) -> Iterator: + ... + + +class KeepOpenFile: + _file: IO + + def __init__(self, file: IO) -> None: + ... + + def __enter__(self) -> KeepOpenFile: + ... + + def __exit__(self, exc_type, exc_value, tb): + ... + + def __iter__(self) -> Iterator: + ... + + +def echo( + message: object = ..., + file: Optional[IO] = ..., + nl: bool = ..., + err: bool = ..., + color: Optional[bool] = ..., +) -> None: + ... + + +def get_binary_stream(name: str) -> IO[bytes]: + ... + + +def get_text_stream( + name: str, encoding: Optional[str] = ..., errors: str = ... +) -> IO[str]: + ... + + +def open_file( + filename: str, + mode: str = ..., + encoding: Optional[str] = ..., + errors: str = ..., + lazy: bool = ..., + atomic: bool = ... +) -> Union[IO, LazyFile, KeepOpenFile]: + ... + + +def get_os_args() -> List[str]: + ... + + +def format_filename(filename: str, shorten: bool = ...) -> str: + ... + + +def get_app_dir( + app_name: str, roaming: bool = ..., force_posix: bool = ... +) -> str: + ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/croniter.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/croniter.pyi new file mode 100644 index 0000000..0d01b7e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/croniter.pyi @@ -0,0 +1,41 @@ +import datetime +from typing import Any, Dict, Iterator, List, Optional, Text, Tuple, Type, TypeVar, Union + +_RetType = Union[Type[float], Type[datetime.datetime]] +_SelfT = TypeVar('_SelfT', bound=croniter) + +class CroniterError(ValueError): ... +class CroniterBadCronError(CroniterError): ... +class CroniterBadDateError(CroniterError): ... +class CroniterNotAlphaError(CroniterError): ... + +class croniter(Iterator[Any]): + MONTHS_IN_YEAR: int + RANGES: Tuple[Tuple[int, int], ...] + DAYS: Tuple[int, ...] + ALPHACONV: Tuple[Dict[str, Any], ...] + LOWMAP: Tuple[Dict[int, Any], ...] + bad_length: str + tzinfo: Optional[datetime.tzinfo] + cur: float + expanded: List[List[str]] + start_time: float + dst_start_time: float + nth_weekday_of_month: Dict[str, Any] + def __init__(self, expr_format: Text, start_time: Optional[Union[float, datetime.datetime]] = ..., ret_type: Optional[_RetType] = ...) -> None: ... + # Most return value depend on ret_type, which can be passed in both as a method argument and as + # a constructor argument. + def get_next(self, ret_type: Optional[_RetType] = ...) -> Any: ... + def get_prev(self, ret_type: Optional[_RetType] = ...) -> Any: ... + def get_current(self, ret_type: Optional[_RetType] = ...) -> Any: ... + def __iter__(self: _SelfT) -> _SelfT: ... + def __next__(self, ret_type: Optional[_RetType] = ...) -> Any: ... + def next(self, ret_type: Optional[_RetType] = ...) -> Any: ... + def all_next(self, ret_type: Optional[_RetType] = ...) -> Iterator[Any]: ... + def all_prev(self, ret_type: Optional[_RetType] = ...) -> Iterator[Any]: ... + def iter(self, ret_type: Optional[_RetType] = ...) -> Iterator[Any]: ... + def is_leap(self, year: int) -> bool: ... + @classmethod + def expand(cls, expr_format: Text) -> Tuple[List[List[str]], Dict[str, Any]]: ... + @classmethod + def is_valid(cls, expression: Text) -> bool: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/dateutil/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/dateutil/__init__.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/dateutil/_common.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/dateutil/_common.pyi new file mode 100644 index 0000000..1311a17 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/dateutil/_common.pyi @@ -0,0 +1,15 @@ +from typing import Optional + +class weekday(object): + def __init__(self, weekday: int, n: Optional[int] = ...) -> None: ... + + def __call__(self, n: int) -> weekday: ... + + def __eq__(self, other) -> bool: ... + + def __repr__(self) -> str: ... + + def __hash__(self) -> int: ... + + weekday: int + n: int diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/dateutil/parser.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/dateutil/parser.pyi new file mode 100644 index 0000000..045a793 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/dateutil/parser.pyi @@ -0,0 +1,46 @@ +from typing import List, Tuple, Optional, Callable, Union, IO, Any, Dict, Mapping, Text +from datetime import datetime, tzinfo + +_FileOrStr = Union[bytes, Text, IO[str], IO[Any]] + + +class parserinfo(object): + JUMP: List[str] + WEEKDAYS: List[Tuple[str, str]] + MONTHS: List[Tuple[str, str]] + HMS: List[Tuple[str, str, str]] + AMPM: List[Tuple[str, str]] + UTCZONE: List[str] + PERTAIN: List[str] + TZOFFSET: Dict[str, int] + + def __init__(self, dayfirst: bool = ..., yearfirst: bool = ...) -> None: ... + def jump(self, name: Text) -> bool: ... + def weekday(self, name: Text) -> Optional[int]: ... + def month(self, name: Text) -> Optional[int]: ... + def hms(self, name: Text) -> Optional[int]: ... + def ampm(self, name: Text) -> Optional[int]: ... + def pertain(self, name: Text) -> bool: ... + def utczone(self, name: Text) -> bool: ... + def tzoffset(self, name: Text) -> Optional[int]: ... + def convertyear(self, year: int) -> int: ... + def validate(self, res: datetime) -> bool: ... + +class parser(object): + def __init__(self, info: Optional[parserinfo] = ...) -> None: ... + def parse(self, timestr: _FileOrStr, + default: Optional[datetime] = ..., + ignoretz: bool = ..., tzinfos: Optional[Mapping[Text, tzinfo]] = ..., + **kwargs: Any) -> datetime: ... + +def isoparse(dt_str: Union[str, bytes, IO[str], IO[bytes]]) -> datetime: ... + +DEFAULTPARSER: parser +def parse(timestr: _FileOrStr, parserinfo: Optional[parserinfo] = ..., **kwargs: Any) -> datetime: ... +class _tzparser: ... + +DEFAULTTZPARSER: _tzparser + +class InvalidDatetimeError(ValueError): ... +class InvalidDateError(InvalidDatetimeError): ... +class InvalidTimeError(InvalidDatetimeError): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/dateutil/relativedelta.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/dateutil/relativedelta.pyi new file mode 100644 index 0000000..40ee586 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/dateutil/relativedelta.pyi @@ -0,0 +1,91 @@ +from typing import overload, Any, List, Optional, SupportsFloat, TypeVar, Union +from datetime import date, datetime, timedelta + +from ._common import weekday + + +_SelfT = TypeVar('_SelfT', bound=relativedelta) +_DateT = TypeVar('_DateT', date, datetime) +# Work around attribute and type having the same name. +_weekday = weekday + +MO: weekday +TU: weekday +WE: weekday +TH: weekday +FR: weekday +SA: weekday +SU: weekday + + +class relativedelta(object): + years: int + months: int + days: int + leapdays: int + hours: int + minutes: int + seconds: int + microseconds: int + year: Optional[int] + month: Optional[int] + weekday: Optional[_weekday] + day: Optional[int] + hour: Optional[int] + minute: Optional[int] + second: Optional[int] + microsecond: Optional[int] + def __init__(self, + dt1: Optional[date] = ..., + dt2: Optional[date] = ..., + years: Optional[int] = ..., months: Optional[int] = ..., + days: Optional[int] = ..., leapdays: Optional[int] = ..., + weeks: Optional[int] = ..., + hours: Optional[int] = ..., minutes: Optional[int] = ..., + seconds: Optional[int] = ..., microseconds: Optional[int] = ..., + year: Optional[int] = ..., month: Optional[int] = ..., + day: Optional[int] = ..., + weekday: Optional[Union[int, _weekday]] = ..., + yearday: Optional[int] = ..., + nlyearday: Optional[int] = ..., + hour: Optional[int] = ..., minute: Optional[int] = ..., + second: Optional[int] = ..., + microsecond: Optional[int] = ...) -> None: ... + @property + def weeks(self) -> int: ... + @weeks.setter + def weeks(self, value: int) -> None: ... + def normalized(self: _SelfT) -> _SelfT: ... + # TODO: use Union when mypy will handle it properly in overloaded operator + # methods (#2129, #1442, #1264 in mypy) + @overload + def __add__(self: _SelfT, other: relativedelta) -> _SelfT: ... + @overload + def __add__(self: _SelfT, other: timedelta) -> _SelfT: ... + @overload + def __add__(self, other: _DateT) -> _DateT: ... + @overload + def __radd__(self: _SelfT, other: relativedelta) -> _SelfT: ... + @overload + def __radd__(self: _SelfT, other: timedelta) -> _SelfT: ... + @overload + def __radd__(self, other: _DateT) -> _DateT: ... + @overload + def __rsub__(self: _SelfT, other: relativedelta) -> _SelfT: ... + @overload + def __rsub__(self: _SelfT, other: timedelta) -> _SelfT: ... + @overload + def __rsub__(self, other: _DateT) -> _DateT: ... + def __sub__(self: _SelfT, other: relativedelta) -> _SelfT: ... + def __neg__(self: _SelfT) -> _SelfT: ... + def __bool__(self) -> bool: ... + def __nonzero__(self) -> bool: ... + def __mul__(self: _SelfT, other: SupportsFloat) -> _SelfT: ... + def __rmul__(self: _SelfT, other: SupportsFloat) -> _SelfT: ... + def __eq__(self, other) -> bool: ... + def __ne__(self, other: object) -> bool: ... + def __div__(self: _SelfT, other: SupportsFloat) -> _SelfT: ... + def __truediv__(self: _SelfT, other: SupportsFloat) -> _SelfT: ... + def __repr__(self) -> str: ... + def __abs__(self: _SelfT) -> _SelfT: ... + def __hash__(self) -> int: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/dateutil/rrule.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/dateutil/rrule.pyi new file mode 100644 index 0000000..f8ab9d2 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/dateutil/rrule.pyi @@ -0,0 +1,103 @@ +from ._common import weekday as weekdaybase +from typing import Any, Iterable, Optional, Union +import datetime + +YEARLY: int +MONTHLY: int +WEEKLY: int +DAILY: int +HOURLY: int +MINUTELY: int +SECONDLY: int + +class weekday(weekdaybase): + ... + +MO: weekday +TU: weekday +WE: weekday +TH: weekday +FR: weekday +SA: weekday +SU: weekday + +class rrulebase: + def __init__(self, cache: bool = ...) -> None: ... + def __iter__(self): ... + def __getitem__(self, item): ... + def __contains__(self, item): ... + def count(self): ... + def before(self, dt, inc: bool = ...): ... + def after(self, dt, inc: bool = ...): ... + def xafter(self, dt, count: Optional[Any] = ..., inc: bool = ...): ... + def between(self, after, before, inc: bool = ..., count: int = ...): ... + +class rrule(rrulebase): + def __init__(self, + freq, + dtstart: Optional[datetime.datetime] = ..., + interval: int = ..., + wkst: Optional[Union[weekday, int]] = ..., + count: Optional[int] = ..., + until: Optional[Union[datetime.datetime, int]] = ..., + bysetpos: Optional[Union[int, Iterable[int]]] = ..., + bymonth: Optional[Union[int, Iterable[int]]] = ..., + bymonthday: Optional[Union[int, Iterable[int]]] = ..., + byyearday: Optional[Union[int, Iterable[int]]] = ..., + byeaster: Optional[Union[int, Iterable[int]]] = ..., + byweekno: Optional[Union[int, Iterable[int]]] = ..., + byweekday: Optional[Union[int, Iterable[int]]] = ..., + byhour: Optional[Union[int, Iterable[int]]] = ..., + byminute: Optional[Union[int, Iterable[int]]] = ..., + bysecond: Optional[Union[int, Iterable[int]]] = ..., + cache: bool = ...) -> None: ... + def replace(self, **kwargs): ... + +class _iterinfo: + rrule: Any = ... + def __init__(self, rrule) -> None: ... + yearlen: int = ... + nextyearlen: int = ... + yearordinal: int = ... + yearweekday: int = ... + mmask: Any = ... + mdaymask: Any = ... + nmdaymask: Any = ... + wdaymask: Any = ... + mrange: Any = ... + wnomask: Any = ... + nwdaymask: Any = ... + eastermask: Any = ... + lastyear: int = ... + lastmonth: int = ... + def rebuild(self, year, month): ... + def ydayset(self, year, month, day): ... + def mdayset(self, year, month, day): ... + def wdayset(self, year, month, day): ... + def ddayset(self, year, month, day): ... + def htimeset(self, hour, minute, second): ... + def mtimeset(self, hour, minute, second): ... + def stimeset(self, hour, minute, second): ... + +class rruleset(rrulebase): + class _genitem: + dt: Any = ... + genlist: Any = ... + gen: Any = ... + def __init__(self, genlist, gen) -> None: ... + def __next__(self): ... + next: Any = ... + def __lt__(self, other): ... + def __gt__(self, other): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + def __init__(self, cache: bool = ...) -> None: ... + def rrule(self, rrule): ... + def rdate(self, rdate): ... + def exrule(self, exrule): ... + def exdate(self, exdate): ... + +class _rrulestr: + def __call__(self, s, **kwargs): ... + +rrulestr: _rrulestr diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/dateutil/tz/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/dateutil/tz/__init__.pyi new file mode 100644 index 0000000..5a5e45f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/dateutil/tz/__init__.pyi @@ -0,0 +1,15 @@ +from .tz import ( + tzutc as tzutc, + tzoffset as tzoffset, + tzlocal as tzlocal, + tzfile as tzfile, + tzrange as tzrange, + tzstr as tzstr, + tzical as tzical, + gettz as gettz, + datetime_exists as datetime_exists, + datetime_ambiguous as datetime_ambiguous, + resolve_imaginary as resolve_imaginary, +) + +UTC: tzutc diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/dateutil/tz/_common.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/dateutil/tz/_common.pyi new file mode 100644 index 0000000..32b06ed --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/dateutil/tz/_common.pyi @@ -0,0 +1,24 @@ +from typing import Any, Optional +from datetime import datetime, tzinfo, timedelta + +def tzname_in_python2(namefunc): ... +def enfold(dt: datetime, fold: int = ...): ... + +class _DatetimeWithFold(datetime): + @property + def fold(self): ... + +class _tzinfo(tzinfo): + def is_ambiguous(self, dt: datetime) -> bool: ... + def fromutc(self, dt: datetime) -> datetime: ... + +class tzrangebase(_tzinfo): + def __init__(self) -> None: ... + def utcoffset(self, dt: Optional[datetime]) -> Optional[timedelta]: ... + def dst(self, dt: Optional[datetime]) -> Optional[timedelta]: ... + def tzname(self, dt: Optional[datetime]) -> str: ... + def fromutc(self, dt: datetime) -> datetime: ... + def is_ambiguous(self, dt: datetime) -> bool: ... + __hash__: Any + def __ne__(self, other): ... + __reduce__: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/dateutil/tz/tz.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/dateutil/tz/tz.pyi new file mode 100644 index 0000000..7139507 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/dateutil/tz/tz.pyi @@ -0,0 +1,96 @@ +from typing import Any, Optional, Union, IO, Text, Tuple, List +import datetime +from ._common import tzname_in_python2 as tzname_in_python2, _tzinfo as _tzinfo +from ._common import tzrangebase as tzrangebase, enfold as enfold +from ..relativedelta import relativedelta + +_FileObj = Union[str, Text, IO[str], IO[Text]] + +ZERO: datetime.timedelta +EPOCH: datetime.datetime +EPOCHORDINAL: int + +class tzutc(datetime.tzinfo): + def utcoffset(self, dt: Optional[datetime.datetime]) -> Optional[datetime.timedelta]: ... + def dst(self, dt: Optional[datetime.datetime]) -> Optional[datetime.timedelta]: ... + def tzname(self, dt: Optional[datetime.datetime]) -> str: ... + def is_ambiguous(self, dt: Optional[datetime.datetime]) -> bool: ... + def __eq__(self, other): ... + __hash__: Any + def __ne__(self, other): ... + __reduce__: Any + +class tzoffset(datetime.tzinfo): + def __init__(self, name, offset) -> None: ... + def utcoffset(self, dt: Optional[datetime.datetime]) -> Optional[datetime.timedelta]: ... + def dst(self, dt: Optional[datetime.datetime]) -> Optional[datetime.timedelta]: ... + def is_ambiguous(self, dt: Optional[datetime.datetime]) -> bool: ... + def tzname(self, dt: Optional[datetime.datetime]) -> str: ... + def __eq__(self, other): ... + __hash__: Any + def __ne__(self, other): ... + __reduce__: Any + + @classmethod + def instance(cls, name, offset) -> tzoffset: ... + +class tzlocal(_tzinfo): + def __init__(self) -> None: ... + def utcoffset(self, dt: Optional[datetime.datetime]) -> Optional[datetime.timedelta]: ... + def dst(self, dt: Optional[datetime.datetime]) -> Optional[datetime.timedelta]: ... + def tzname(self, dt: Optional[datetime.datetime]) -> str: ... + def is_ambiguous(self, dt: Optional[datetime.datetime]) -> bool: ... + def __eq__(self, other): ... + __hash__: Any + def __ne__(self, other): ... + __reduce__: Any + +class _ttinfo: + def __init__(self) -> None: ... + def __eq__(self, other): ... + __hash__: Any + def __ne__(self, other): ... + +class tzfile(_tzinfo): + def __init__(self, fileobj: _FileObj, filename: Optional[Text] = ...) -> None: ... + def is_ambiguous(self, dt: Optional[datetime.datetime], idx: Optional[int] = ...) -> bool: ... + def utcoffset(self, dt: Optional[datetime.datetime]) -> Optional[datetime.timedelta]: ... + def dst(self, dt: Optional[datetime.datetime]) -> Optional[datetime.timedelta]: ... + def tzname(self, dt: Optional[datetime.datetime]) -> str: ... + def __eq__(self, other): ... + __hash__: Any + def __ne__(self, other): ... + def __reduce__(self): ... + def __reduce_ex__(self, protocol): ... + +class tzrange(tzrangebase): + hasdst: bool + def __init__(self, stdabbr: Text, stdoffset: Union[int, datetime.timedelta, None] = ..., dstabbr: Optional[Text] = ..., dstoffset: Union[int, datetime.timedelta, None] = ..., start: Optional[relativedelta] = ..., end: Optional[relativedelta] = ...) -> None: ... + def transitions(self, year: int) -> Tuple[datetime.datetime, datetime.datetime]: ... + def __eq__(self, other): ... + +class tzstr(tzrange): + hasdst: bool + def __init__(self, s: Union[bytes, _FileObj], posix_offset: bool = ...) -> None: ... + + @classmethod + def instance(cls, name, offset) -> tzoffset: ... + +class tzical: + def __init__(self, fileobj: _FileObj) -> None: ... + def keys(self): ... + def get(self, tzid: Optional[Any] = ...): ... + +TZFILES: List[str] +TZPATHS: List[str] + +def datetime_exists(dt: datetime.datetime, tz: Optional[datetime.tzinfo] = ...) -> bool: ... +def datetime_ambiguous(dt: datetime.datetime, tz: Optional[datetime.tzinfo] = ...) -> bool: ... +def resolve_imaginary(dt: datetime.datetime) -> datetime.datetime: ... + + +class _GetTZ: + def __call__(self, name: Optional[Text] = ...) -> Optional[datetime.tzinfo]: ... + def nocache(self, name: Optional[Text]) -> Optional[datetime.tzinfo]: ... + +gettz: _GetTZ diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/dateutil/utils.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/dateutil/utils.pyi new file mode 100644 index 0000000..b722053 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/dateutil/utils.pyi @@ -0,0 +1,7 @@ +from typing import Optional +from datetime import datetime, tzinfo, timedelta + + +def default_tzinfo(dt: datetime, tzinfo: tzinfo) -> datetime: ... +def today(tzinfo: Optional[tzinfo] = ...) -> datetime: ... +def within_delta(dt1: datetime, dt2: datetime, delta: timedelta) -> bool: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/emoji.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/emoji.pyi new file mode 100644 index 0000000..fe193b1 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/emoji.pyi @@ -0,0 +1,18 @@ +from typing import Tuple, Pattern, List, Dict, Union + +_DEFAULT_DELIMITER: str + +def emojize( + string: str, + use_aliases: bool = ..., + delimiters: Tuple[str, str] = ... +) -> str: ... + +def demojize( + string: str, + delimiters: Tuple[str, str] = ... +) -> str: ... + +def get_emoji_regexp() -> Pattern: ... + +def emoji_lis(string: str) -> List[Dict[str, Union[int, str]]]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/first.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/first.pyi new file mode 100644 index 0000000..f03f3a3 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/first.pyi @@ -0,0 +1,13 @@ +from typing import Any, Callable, Iterable, Optional, overload, TypeVar, Union + +_T = TypeVar('_T') +_S = TypeVar('_S') + +@overload +def first(iterable: Iterable[_T]) -> Optional[_T]: ... +@overload +def first(iterable: Iterable[_T], default: _S) -> Union[_T, _S]: ... +@overload +def first(iterable: Iterable[_T], default: _S, key: Optional[Callable[[_T], Any]]) -> Union[_T, _S]: ... +@overload +def first(iterable: Iterable[_T], *, key: Optional[Callable[[_T], Any]]) -> Optional[_T]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/flask/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/flask/__init__.pyi new file mode 100644 index 0000000..caeac5e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/flask/__init__.pyi @@ -0,0 +1,45 @@ +# Stubs for flask (Python 3.6) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from .app import Flask as Flask +from .blueprints import Blueprint as Blueprint +from .config import Config as Config +from .ctx import after_this_request as after_this_request +from .ctx import copy_current_request_context as copy_current_request_context +from .ctx import has_app_context as has_app_context +from .ctx import has_request_context as has_request_context +from .globals import current_app as current_app +from .globals import g as g +from .globals import request as request +from .globals import session as session +from .helpers import flash as flash +from .helpers import get_flashed_messages as get_flashed_messages +from .helpers import get_template_attribute as get_template_attribute +from .helpers import make_response as make_response +from .helpers import safe_join as safe_join +from .helpers import send_file as send_file +from .helpers import send_from_directory as send_from_directory +from .helpers import stream_with_context as stream_with_context +from .helpers import url_for as url_for +from .json import jsonify as jsonify +from .signals import appcontext_popped as appcontext_popped +from .signals import appcontext_pushed as appcontext_pushed +from .signals import appcontext_tearing_down as appcontext_tearing_down +from .signals import before_render_template as before_render_template +from .signals import got_request_exception as got_request_exception +from .signals import message_flashed as message_flashed +from .signals import request_finished as request_finished +from .signals import request_started as request_started +from .signals import request_tearing_down as request_tearing_down +from .signals import signals_available as signals_available +from .signals import template_rendered as template_rendered +from .templating import render_template as render_template +from .templating import render_template_string as render_template_string +from .wrappers import Request as Request +from .wrappers import Response as Response + +from werkzeug.exceptions import abort as abort +from werkzeug.utils import redirect as redirect +from jinja2 import Markup as Markup +from jinja2 import escape as escape diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/flask/app.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/flask/app.pyi new file mode 100644 index 0000000..5be3d6d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/flask/app.pyi @@ -0,0 +1,148 @@ +# Stubs for flask.app (Python 3.6) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from .blueprints import Blueprint +from .config import Config, ConfigAttribute +from .ctx import AppContext, RequestContext, _AppCtxGlobals +from .globals import _request_ctx_stack, g, request, session +from .helpers import _PackageBoundObject, find_package, get_debug_flag, get_env, get_flashed_messages, get_load_dotenv, locked_cached_property, url_for +from .logging import create_logger +from .sessions import SecureCookieSessionInterface +from .signals import appcontext_tearing_down, got_request_exception, request_finished, request_started, request_tearing_down +from .templating import DispatchingJinjaLoader, Environment +from .wrappers import Request, Response +from .testing import FlaskClient +from typing import Any, Callable, ContextManager, Dict, List, Optional, Type, TypeVar, Union, Text +from datetime import timedelta + +def setupmethod(f: Any): ... + +_T = TypeVar('_T') + +class Flask(_PackageBoundObject): + request_class: type = ... + response_class: type = ... + jinja_environment: type = ... + app_ctx_globals_class: type = ... + config_class: Type[Config] = ... + testing: Any = ... + secret_key: Union[Text, bytes, None] = ... + session_cookie_name: Any = ... + permanent_session_lifetime: timedelta = ... + send_file_max_age_default: timedelta = ... + use_x_sendfile: Any = ... + json_encoder: Any = ... + json_decoder: Any = ... + jinja_options: Any = ... + default_config: Any = ... + url_rule_class: type = ... + test_client_class: type = ... + test_cli_runner_class: type = ... + session_interface: Any = ... + import_name: str = ... + template_folder: str = ... + root_path: Optional[Union[str, Text]] = ... + static_url_path: Any = ... + static_folder: Optional[str] = ... + instance_path: Union[str, Text] = ... + config: Config = ... + view_functions: Any = ... + error_handler_spec: Any = ... + url_build_error_handlers: Any = ... + before_request_funcs: Dict[Optional[str], List[Callable[[], Any]]] = ... + before_first_request_funcs: List[Callable[[], None]] = ... + after_request_funcs: Dict[Optional[str], List[Callable[[Response], Response]]] = ... + teardown_request_funcs: Dict[Optional[str], List[Callable[[Optional[Exception]], Any]]] = ... + teardown_appcontext_funcs: List[Callable[[Optional[Exception]], Any]] = ... + url_value_preprocessors: Any = ... + url_default_functions: Any = ... + template_context_processors: Any = ... + shell_context_processors: Any = ... + blueprints: Any = ... + extensions: Any = ... + url_map: Any = ... + subdomain_matching: Any = ... + cli: Any = ... + def __init__(self, import_name: str, static_url_path: Optional[str] = ..., static_folder: Optional[str] = ..., static_host: Optional[str] = ..., host_matching: bool = ..., subdomain_matching: bool = ..., template_folder: str = ..., instance_path: Optional[str] = ..., instance_relative_config: bool = ..., root_path: Optional[str] = ...) -> None: ... + @property + def name(self) -> str: ... + @property + def propagate_exceptions(self) -> bool: ... + @property + def preserve_context_on_exception(self): ... + @property + def logger(self): ... + @property + def jinja_env(self): ... + @property + def got_first_request(self) -> bool: ... + def make_config(self, instance_relative: bool = ...): ... + def auto_find_instance_path(self): ... + def open_instance_resource(self, resource: Union[str, Text], mode: str = ...): ... + templates_auto_reload: Any = ... + def create_jinja_environment(self): ... + def create_global_jinja_loader(self): ... + def select_jinja_autoescape(self, filename: Any): ... + def update_template_context(self, context: Any) -> None: ... + def make_shell_context(self): ... + env: Optional[str] = ... + debug: bool = ... + def run(self, host: Optional[str] = ..., port: Optional[Union[int, str]] = ..., debug: Optional[bool] = ..., load_dotenv: bool = ..., **options: Any) -> None: ... + def test_client(self, use_cookies: bool = ..., **kwargs: Any) -> FlaskClient: ... + def test_cli_runner(self, **kwargs: Any): ... + def open_session(self, request: Any): ... + def save_session(self, session: Any, response: Any): ... + def make_null_session(self): ... + def register_blueprint(self, blueprint: Blueprint, **options: Any) -> None: ... + def iter_blueprints(self): ... + def add_url_rule(self, rule: str, endpoint: Optional[str] = ..., view_func: Callable[..., Any] = ..., provide_automatic_options: Optional[bool] = ..., **options: Any) -> None: ... + def route(self, rule: str, **options: Any) -> Callable[[Callable[..., _T]], Callable[..., _T]]: ... + def endpoint(self, endpoint: str) -> Callable[[Callable[..., _T]], Callable[..., _T]]: ... + def errorhandler(self, code_or_exception: Union[int, Type[Exception]]) -> Callable[[Callable[..., _T]], Callable[..., _T]]: ... + def register_error_handler(self, code_or_exception: Union[int, Type[Exception]], f: Callable[..., Any]) -> None: ... + def template_filter(self, name: Optional[Any] = ...): ... + def add_template_filter(self, f: Any, name: Optional[Any] = ...) -> None: ... + def template_test(self, name: Optional[Any] = ...): ... + def add_template_test(self, f: Any, name: Optional[Any] = ...) -> None: ... + def template_global(self, name: Optional[Any] = ...): ... + def add_template_global(self, f: Any, name: Optional[Any] = ...) -> None: ... + def before_request(self, f: Callable[[], _T]) -> Callable[[], _T]: ... + def before_first_request(self, f: Callable[[], _T]) -> Callable[[], _T]: ... + def after_request(self, f: Callable[[Response], Response]) -> Callable[[Response], Response]: ... + def teardown_request(self, f: Callable[[Optional[Exception]], _T]) -> Callable[[Optional[Exception]], _T]: ... + def teardown_appcontext(self, f: Callable[[Optional[Exception]], _T]) -> Callable[[Optional[Exception]], _T]: ... + def context_processor(self, f: Any): ... + def shell_context_processor(self, f: Any): ... + def url_value_preprocessor(self, f: Any): ... + def url_defaults(self, f: Any): ... + def handle_http_exception(self, e: Any): ... + def trap_http_exception(self, e: Any): ... + def handle_user_exception(self, e: Any): ... + def handle_exception(self, e: Any): ... + def log_exception(self, exc_info: Any) -> None: ... + def raise_routing_exception(self, request: Any) -> None: ... + def dispatch_request(self): ... + def full_dispatch_request(self): ... + def finalize_request(self, rv: Any, from_error_handler: bool = ...): ... + def try_trigger_before_first_request_functions(self): ... + def make_default_options_response(self): ... + def should_ignore_error(self, error: Any): ... + def make_response(self, rv: Any): ... + def create_url_adapter(self, request: Any): ... + def inject_url_defaults(self, endpoint: Any, values: Any) -> None: ... + def handle_url_build_error(self, error: Any, endpoint: Any, values: Any): ... + def preprocess_request(self): ... + def process_response(self, response: Any): ... + def do_teardown_request(self, exc: Any = ...) -> None: ... + def do_teardown_appcontext(self, exc: Any = ...) -> None: ... + def app_context(self): ... + def request_context(self, environ: Any): ... + def test_request_context(self, *args: Any, **kwargs: Any) -> ContextManager[RequestContext]: ... + def wsgi_app(self, environ: Any, start_response: Any): ... + def __call__(self, environ: Any, start_response: Any): ... + + # These are not preset at runtime but we add them since monkeypatching this + # class is quite common. + def __setattr__(self, name: str, value: Any): ... + def __getattr__(self, name: str): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/flask/blueprints.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/flask/blueprints.pyi new file mode 100644 index 0000000..d43f8e4 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/flask/blueprints.pyi @@ -0,0 +1,64 @@ +# Stubs for flask.blueprints (Python 3.6) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from .helpers import _PackageBoundObject +from typing import Any, Callable, Optional, Type, TypeVar, Union + +_T = TypeVar('_T') + +class BlueprintSetupState: + app: Any = ... + blueprint: Any = ... + options: Any = ... + first_registration: Any = ... + subdomain: Any = ... + url_prefix: Any = ... + url_defaults: Any = ... + def __init__(self, blueprint: Any, app: Any, options: Any, first_registration: Any) -> None: ... + def add_url_rule(self, rule: str, endpoint: Optional[str] = ..., view_func: Callable[..., Any] = ..., **options: Any) -> None: ... + +class Blueprint(_PackageBoundObject): + warn_on_modifications: bool = ... + json_encoder: Any = ... + json_decoder: Any = ... + import_name: str = ... + template_folder: Optional[str] = ... + root_path: str = ... + name: str = ... + url_prefix: Optional[str] = ... + subdomain: Optional[str] = ... + static_folder: Optional[str] = ... + static_url_path: Optional[str] = ... + deferred_functions: Any = ... + url_values_defaults: Any = ... + def __init__(self, name: str, import_name: str, static_folder: Optional[str] = ..., static_url_path: Optional[str] = ..., template_folder: Optional[str] = ..., url_prefix: Optional[str] = ..., subdomain: Optional[str] = ..., url_defaults: Optional[Any] = ..., root_path: Optional[str] = ...) -> None: ... + def record(self, func: Any) -> None: ... + def record_once(self, func: Any): ... + def make_setup_state(self, app: Any, options: Any, first_registration: bool = ...): ... + def register(self, app: Any, options: Any, first_registration: bool = ...) -> None: ... + def route(self, rule: str, **options: Any) -> Callable[[Callable[..., Any]], Callable[..., Any]]: ... + def add_url_rule(self, rule: str, endpoint: Optional[str] = ..., view_func: Callable[..., Any] = ..., **options: Any) -> None: ... + def endpoint(self, endpoint: str) -> Callable[[Callable[..., _T]], Callable[..., _T]]: ... + def app_template_filter(self, name: Optional[Any] = ...): ... + def add_app_template_filter(self, f: Any, name: Optional[Any] = ...) -> None: ... + def app_template_test(self, name: Optional[Any] = ...): ... + def add_app_template_test(self, f: Any, name: Optional[Any] = ...) -> None: ... + def app_template_global(self, name: Optional[Any] = ...): ... + def add_app_template_global(self, f: Any, name: Optional[Any] = ...) -> None: ... + def before_request(self, f: Any): ... + def before_app_request(self, f: Any): ... + def before_app_first_request(self, f: Any): ... + def after_request(self, f: Any): ... + def after_app_request(self, f: Any): ... + def teardown_request(self, f: Any): ... + def teardown_app_request(self, f: Any): ... + def context_processor(self, f: Any): ... + def app_context_processor(self, f: Any): ... + def app_errorhandler(self, code: Any): ... + def url_value_preprocessor(self, f: Any): ... + def url_defaults(self, f: Any): ... + def app_url_value_preprocessor(self, f: Any): ... + def app_url_defaults(self, f: Any): ... + def errorhandler(self, code_or_exception: Union[int, Type[Exception]]) -> Callable[[Callable[..., _T]], Callable[..., _T]]: ... + def register_error_handler(self, code_or_exception: Union[int, Type[Exception]], f: Callable[..., Any]) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/flask/cli.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/flask/cli.pyi new file mode 100644 index 0000000..15d3243 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/flask/cli.pyi @@ -0,0 +1,64 @@ +# Stubs for flask.cli (Python 3.6) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +import click +from .globals import current_app +from .helpers import get_debug_flag, get_env, get_load_dotenv +from typing import Any, Optional + +class NoAppException(click.UsageError): ... + +def find_best_app(script_info: Any, module: Any): ... +def call_factory(script_info: Any, app_factory: Any, arguments: Any = ...): ... +def find_app_by_string(script_info: Any, module: Any, app_name: Any): ... +def prepare_import(path: Any): ... +def locate_app(script_info: Any, module_name: Any, app_name: Any, raise_if_not_found: bool = ...): ... +def get_version(ctx: Any, param: Any, value: Any): ... + +version_option: Any + +class DispatchingApp: + loader: Any = ... + def __init__(self, loader: Any, use_eager_loading: bool = ...) -> None: ... + def __call__(self, environ: Any, start_response: Any): ... + +class ScriptInfo: + app_import_path: Any = ... + create_app: Any = ... + data: Any = ... + def __init__(self, app_import_path: Optional[Any] = ..., create_app: Optional[Any] = ...) -> None: ... + def load_app(self): ... + +pass_script_info: Any + +def with_appcontext(f: Any): ... + +class AppGroup(click.Group): + def command(self, *args: Any, **kwargs: Any): ... + def group(self, *args: Any, **kwargs: Any): ... + +class FlaskGroup(AppGroup): + create_app: Any = ... + load_dotenv: Any = ... + def __init__(self, add_default_commands: bool = ..., create_app: Optional[Any] = ..., add_version_option: bool = ..., load_dotenv: bool = ..., **extra: Any) -> None: ... + def get_command(self, ctx: Any, name: Any): ... + def list_commands(self, ctx: Any): ... + def main(self, *args: Any, **kwargs: Any): ... + +def load_dotenv(path: Optional[Any] = ...): ... +def show_server_banner(env: Any, debug: Any, app_import_path: Any, eager_loading: Any): ... + +class CertParamType(click.ParamType): + name: str = ... + path_type: Any = ... + def __init__(self) -> None: ... + def convert(self, value: Any, param: Any, ctx: Any): ... + +def run_command(info: Any, host: Any, port: Any, reload: Any, debugger: Any, eager_loading: Any, with_threads: Any, cert: Any) -> None: ... +def shell_command() -> None: ... +def routes_command(sort: Any, all_methods: Any): ... + +cli: Any + +def main(as_module: bool = ...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/flask/config.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/flask/config.pyi new file mode 100644 index 0000000..6b925e7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/flask/config.pyi @@ -0,0 +1,22 @@ +# Stubs for flask.config (Python 3.6) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from typing import Any, Optional, Dict + +class ConfigAttribute: + __name__: Any = ... + get_converter: Any = ... + def __init__(self, name: Any, get_converter: Optional[Any] = ...) -> None: ... + def __get__(self, obj: Any, type: Optional[Any] = ...): ... + def __set__(self, obj: Any, value: Any) -> None: ... + +class Config(Dict[str, Any]): + root_path: Any = ... + def __init__(self, root_path: Any, defaults: Optional[Any] = ...) -> None: ... + def from_envvar(self, variable_name: Any, silent: bool = ...): ... + def from_pyfile(self, filename: Any, silent: bool = ...): ... + def from_object(self, obj: Any) -> None: ... + def from_json(self, filename: Any, silent: bool = ...): ... + def from_mapping(self, *mapping: Any, **kwargs: Any): ... + def get_namespace(self, namespace: Any, lowercase: bool = ..., trim_namespace: bool = ...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/flask/ctx.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/flask/ctx.pyi new file mode 100644 index 0000000..09fdea3 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/flask/ctx.pyi @@ -0,0 +1,46 @@ +# Stubs for flask.ctx (Python 3.6) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from .globals import _app_ctx_stack, _request_ctx_stack +from .signals import appcontext_popped, appcontext_pushed +from typing import Any, Optional + +class _AppCtxGlobals: + def get(self, name: Any, default: Optional[Any] = ...): ... + def pop(self, name: Any, default: Any = ...): ... + def setdefault(self, name: Any, default: Optional[Any] = ...): ... + def __contains__(self, item: Any): ... + def __iter__(self): ... + +def after_this_request(f: Any): ... +def copy_current_request_context(f: Any): ... +def has_request_context(): ... +def has_app_context(): ... + +class AppContext: + app: Any = ... + url_adapter: Any = ... + g: Any = ... + def __init__(self, app: Any) -> None: ... + def push(self) -> None: ... + def pop(self, exc: Any = ...) -> None: ... + def __enter__(self): ... + def __exit__(self, exc_type: Any, exc_value: Any, tb: Any) -> None: ... + +class RequestContext: + app: Any = ... + request: Any = ... + url_adapter: Any = ... + flashes: Any = ... + session: Any = ... + preserved: bool = ... + def __init__(self, app: Any, environ: Any, request: Optional[Any] = ...) -> None: ... + g: Any = ... + def copy(self): ... + def match_request(self) -> None: ... + def push(self) -> None: ... + def pop(self, exc: Any = ...) -> None: ... + def auto_pop(self, exc: Any) -> None: ... + def __enter__(self): ... + def __exit__(self, exc_type: Any, exc_value: Any, tb: Any) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/flask/debughelpers.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/flask/debughelpers.pyi new file mode 100644 index 0000000..5a4cbea --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/flask/debughelpers.pyi @@ -0,0 +1,21 @@ +# Stubs for flask.debughelpers (Python 3.6) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from .app import Flask +from .blueprints import Blueprint +from .globals import _request_ctx_stack +from typing import Any + +class UnexpectedUnicodeError(AssertionError, UnicodeError): ... + +class DebugFilesKeyError(KeyError, AssertionError): + msg: Any = ... + def __init__(self, request: Any, key: Any) -> None: ... + +class FormDataRoutingRedirect(AssertionError): + def __init__(self, request: Any) -> None: ... + +def attach_enctype_error_multidict(request: Any): ... +def explain_template_loading_attempts(app: Any, template: Any, attempts: Any) -> None: ... +def explain_ignored_app_run() -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/flask/globals.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/flask/globals.pyi new file mode 100644 index 0000000..8ce1caf --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/flask/globals.pyi @@ -0,0 +1,18 @@ +# Stubs for flask.globals (Python 3.6) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from .app import Flask +from .wrappers import Request +from typing import Any +from werkzeug.local import LocalStack + +class _FlaskLocalProxy(Flask): + def _get_current_object(self) -> Flask: ... + +_request_ctx_stack: LocalStack +_app_ctx_stack: LocalStack +current_app: _FlaskLocalProxy +request: Request +session: Any +g: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/flask/helpers.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/flask/helpers.pyi new file mode 100644 index 0000000..726f8a0 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/flask/helpers.pyi @@ -0,0 +1,48 @@ +# Stubs for flask.helpers (Python 3.6) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from .globals import _app_ctx_stack, _request_ctx_stack, current_app, request, session +from .signals import message_flashed +from typing import Any, Optional + +def get_env(): ... +def get_debug_flag(): ... +def get_load_dotenv(default: bool = ...): ... +def stream_with_context(generator_or_function: Any): ... +def make_response(*args: Any): ... +def url_for(endpoint: Any, **values: Any): ... +def get_template_attribute(template_name: Any, attribute: Any): ... +def flash(message: Any, category: str = ...) -> None: ... +def get_flashed_messages(with_categories: bool = ..., category_filter: Any = ...): ... +def send_file(filename_or_fp: Any, mimetype: Optional[Any] = ..., as_attachment: bool = ..., attachment_filename: Optional[Any] = ..., add_etags: bool = ..., cache_timeout: Optional[Any] = ..., conditional: bool = ..., last_modified: Optional[Any] = ...): ... +def safe_join(directory: Any, *pathnames: Any): ... +def send_from_directory(directory: Any, filename: Any, **options: Any): ... +def get_root_path(import_name: Any): ... +def find_package(import_name: Any): ... + +class locked_cached_property: + __name__: Any = ... + __module__: Any = ... + __doc__: Any = ... + func: Any = ... + lock: Any = ... + def __init__(self, func: Any, name: Optional[Any] = ..., doc: Optional[Any] = ...) -> None: ... + def __get__(self, obj: Any, type: Optional[Any] = ...): ... + +class _PackageBoundObject: + import_name: Any = ... + template_folder: Any = ... + root_path: Any = ... + def __init__(self, import_name: Any, template_folder: Optional[Any] = ..., root_path: Optional[Any] = ...) -> None: ... + static_folder: Any = ... + static_url_path: Any = ... + @property + def has_static_folder(self): ... + def jinja_loader(self): ... + def get_send_file_max_age(self, filename: Any): ... + def send_static_file(self, filename: Any): ... + def open_resource(self, resource: Any, mode: str = ...): ... + +def total_seconds(td: Any): ... +def is_ip(value: Any): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/flask/json/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/flask/json/__init__.pyi new file mode 100644 index 0000000..24047ea --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/flask/json/__init__.pyi @@ -0,0 +1,19 @@ +# Stubs for flask.json (Python 3.6) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +import json as _json +from typing import Any + +class JSONEncoder(_json.JSONEncoder): + def default(self, o: Any): ... + +class JSONDecoder(_json.JSONDecoder): ... + +def dumps(obj: Any, **kwargs: Any): ... +def dump(obj: Any, fp: Any, **kwargs: Any) -> None: ... +def loads(s: Any, **kwargs: Any): ... +def load(fp: Any, **kwargs: Any): ... +def htmlsafe_dumps(obj: Any, **kwargs: Any): ... +def htmlsafe_dump(obj: Any, fp: Any, **kwargs: Any) -> None: ... +def jsonify(*args: Any, **kwargs: Any): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/flask/json/tag.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/flask/json/tag.pyi new file mode 100644 index 0000000..b1648dc --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/flask/json/tag.pyi @@ -0,0 +1,71 @@ +# Stubs for flask.json.tag (Python 3.6) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from typing import Any, Optional + +class JSONTag: + key: Any = ... + serializer: Any = ... + def __init__(self, serializer: Any) -> None: ... + def check(self, value: Any) -> None: ... + def to_json(self, value: Any) -> None: ... + def to_python(self, value: Any) -> None: ... + def tag(self, value: Any): ... + +class TagDict(JSONTag): + key: str = ... + def check(self, value: Any): ... + def to_json(self, value: Any): ... + def to_python(self, value: Any): ... + +class PassDict(JSONTag): + def check(self, value: Any): ... + def to_json(self, value: Any): ... + tag: Any = ... + +class TagTuple(JSONTag): + key: str = ... + def check(self, value: Any): ... + def to_json(self, value: Any): ... + def to_python(self, value: Any): ... + +class PassList(JSONTag): + def check(self, value: Any): ... + def to_json(self, value: Any): ... + tag: Any = ... + +class TagBytes(JSONTag): + key: str = ... + def check(self, value: Any): ... + def to_json(self, value: Any): ... + def to_python(self, value: Any): ... + +class TagMarkup(JSONTag): + key: str = ... + def check(self, value: Any): ... + def to_json(self, value: Any): ... + def to_python(self, value: Any): ... + +class TagUUID(JSONTag): + key: str = ... + def check(self, value: Any): ... + def to_json(self, value: Any): ... + def to_python(self, value: Any): ... + +class TagDateTime(JSONTag): + key: str = ... + def check(self, value: Any): ... + def to_json(self, value: Any): ... + def to_python(self, value: Any): ... + +class TaggedJSONSerializer: + default_tags: Any = ... + tags: Any = ... + order: Any = ... + def __init__(self) -> None: ... + def register(self, tag_class: Any, force: bool = ..., index: Optional[Any] = ...) -> None: ... + def tag(self, value: Any): ... + def untag(self, value: Any): ... + def dumps(self, value: Any): ... + def loads(self, value: Any): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/flask/logging.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/flask/logging.pyi new file mode 100644 index 0000000..e43d51d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/flask/logging.pyi @@ -0,0 +1,13 @@ +# Stubs for flask.logging (Python 3.6) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from .globals import request +from typing import Any + +def wsgi_errors_stream(): ... +def has_level_handler(logger: Any): ... + +default_handler: Any + +def create_logger(app: Any): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/flask/sessions.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/flask/sessions.pyi new file mode 100644 index 0000000..b0d238d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/flask/sessions.pyi @@ -0,0 +1,60 @@ +# Stubs for flask.sessions (Python 3.6) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from abc import ABCMeta +from typing import Any, MutableMapping, Optional +from werkzeug.datastructures import CallbackDict + +class SessionMixin(MutableMapping, metaclass=ABCMeta): + @property + def permanent(self): ... + @permanent.setter + def permanent(self, value: Any) -> None: ... + new: bool = ... + modified: bool = ... + accessed: bool = ... + +class SecureCookieSession(CallbackDict, SessionMixin): + modified: bool = ... + accessed: bool = ... + def __init__(self, initial: Optional[Any] = ...) -> None: ... + def __getitem__(self, key: Any): ... + def get(self, key: Any, default: Optional[Any] = ...): ... + def setdefault(self, key: Any, default: Optional[Any] = ...): ... + +class NullSession(SecureCookieSession): + __setitem__: Any = ... + __delitem__: Any = ... + clear: Any = ... + pop: Any = ... + popitem: Any = ... + update: Any = ... + setdefault: Any = ... + +class SessionInterface: + null_session_class: Any = ... + pickle_based: bool = ... + def make_null_session(self, app: Any): ... + def is_null_session(self, obj: Any): ... + def get_cookie_domain(self, app: Any): ... + def get_cookie_path(self, app: Any): ... + def get_cookie_httponly(self, app: Any): ... + def get_cookie_secure(self, app: Any): ... + def get_cookie_samesite(self, app: Any): ... + def get_expiration_time(self, app: Any, session: Any): ... + def should_set_cookie(self, app: Any, session: Any): ... + def open_session(self, app: Any, request: Any) -> None: ... + def save_session(self, app: Any, session: Any, response: Any) -> None: ... + +session_json_serializer: Any + +class SecureCookieSessionInterface(SessionInterface): + salt: str = ... + digest_method: Any = ... + key_derivation: str = ... + serializer: Any = ... + session_class: Any = ... + def get_signing_serializer(self, app: Any): ... + def open_session(self, app: Any, request: Any): ... + def save_session(self, app: Any, session: Any, response: Any): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/flask/signals.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/flask/signals.pyi new file mode 100644 index 0000000..0aa7ac3 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/flask/signals.pyi @@ -0,0 +1,33 @@ +# Stubs for flask.signals (Python 3.6) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from typing import Any, Optional + +signals_available: bool + +class Namespace: + def signal(self, name: Any, doc: Optional[Any] = ...): ... + +class _FakeSignal: + name: Any = ... + __doc__: Any = ... + def __init__(self, name: Any, doc: Optional[Any] = ...) -> None: ... + send: Any = ... + connect: Any = ... + disconnect: Any = ... + has_receivers_for: Any = ... + receivers_for: Any = ... + temporarily_connected_to: Any = ... + connected_to: Any = ... + +template_rendered: Any +before_render_template: Any +request_started: Any +request_finished: Any +request_tearing_down: Any +got_request_exception: Any +appcontext_tearing_down: Any +appcontext_pushed: Any +appcontext_popped: Any +message_flashed: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/flask/templating.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/flask/templating.pyi new file mode 100644 index 0000000..1da102d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/flask/templating.pyi @@ -0,0 +1,21 @@ +# Stubs for flask.templating (Python 3.6) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from .globals import _app_ctx_stack, _request_ctx_stack +from .signals import before_render_template, template_rendered +from jinja2 import BaseLoader, Environment as BaseEnvironment +from typing import Any + +class Environment(BaseEnvironment): + app: Any = ... + def __init__(self, app: Any, **options: Any) -> None: ... + +class DispatchingJinjaLoader(BaseLoader): + app: Any = ... + def __init__(self, app: Any) -> None: ... + def get_source(self, environment: Any, template: Any): ... + def list_templates(self): ... + +def render_template(template_name_or_list: Any, **context: Any): ... +def render_template_string(source: Any, **context: Any): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/flask/testing.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/flask/testing.pyi new file mode 100644 index 0000000..813eeca --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/flask/testing.pyi @@ -0,0 +1,34 @@ +# Stubs for flask.testing (Python 3.6) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from click import BaseCommand +from click.testing import CliRunner, Result +from typing import Any, IO, Iterable, Mapping, Optional, Union +from werkzeug.test import Client + +def make_test_environ_builder(app: Any, path: str = ..., base_url: Optional[Any] = ..., subdomain: Optional[Any] = ..., url_scheme: Optional[Any] = ..., *args: Any, **kwargs: Any): ... + +class FlaskClient(Client): + preserve_context: bool = ... + environ_base: Any = ... + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + def session_transaction(self, *args: Any, **kwargs: Any) -> None: ... + def open(self, *args: Any, **kwargs: Any): ... + def __enter__(self): ... + def __exit__(self, exc_type: Any, exc_value: Any, tb: Any) -> None: ... + +class FlaskCliRunner(CliRunner): + app: Any = ... + def __init__(self, app: Any, **kwargs: Any) -> None: ... + def invoke( + self, + cli: Optional[BaseCommand] = ..., + args: Optional[Union[str, Iterable[str]]] = ..., + input: Optional[IO] = ..., + env: Optional[Mapping[str, str]] = ..., + catch_exceptions: bool = ..., + color: bool = ..., + **extra: Any, + ) -> Result: + ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/flask/views.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/flask/views.pyi new file mode 100644 index 0000000..a2637b3 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/flask/views.pyi @@ -0,0 +1,22 @@ +# Stubs for flask.views (Python 3.6) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from .globals import request +from typing import Any + +http_method_funcs: Any + +class View: + methods: Any = ... + provide_automatic_options: Any = ... + decorators: Any = ... + def dispatch_request(self, *args: Any, **kwargs: Any) -> Any: ... + @classmethod + def as_view(cls, name: Any, *class_args: Any, **class_kwargs: Any): ... + +class MethodViewType(type): + def __init__(self, name: Any, bases: Any, d: Any) -> None: ... + +class MethodView(View, metaclass=MethodViewType): + def dispatch_request(self, *args: Any, **kwargs: Any) -> Any: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/flask/wrappers.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/flask/wrappers.pyi new file mode 100644 index 0000000..df8869e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/flask/wrappers.pyi @@ -0,0 +1,35 @@ +# Stubs for flask.wrappers (Python 3.6) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from typing import Any, Dict, Optional +from werkzeug.exceptions import HTTPException +from werkzeug.routing import Rule +from werkzeug.wrappers import Request as RequestBase, Response as ResponseBase + +class JSONMixin: + @property + def is_json(self) -> bool: ... + @property + def json(self): ... + def get_json(self, force: bool = ..., silent: bool = ..., cache: bool = ...): ... + def on_json_loading_failed(self, e: Any) -> None: ... + +class Request(RequestBase, JSONMixin): + url_rule: Optional[Rule] = ... + view_args: Dict[str, Any] = ... + routing_exception: Optional[HTTPException] = ... + # Request is making the max_content_length readonly, where it was not the + # case in its supertype. + # We would require something like https://github.com/python/typing/issues/241 + @property + def max_content_length(self) -> Optional[int]: ... # type: ignore + @property + def endpoint(self) -> Optional[str]: ... + @property + def blueprint(self) -> Optional[str]: ... + +class Response(ResponseBase, JSONMixin): + default_mimetype: str = ... + @property + def max_cookie_size(self) -> int: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/__init__.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/__init__.pyi new file mode 100644 index 0000000..aae1f93 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/__init__.pyi @@ -0,0 +1 @@ +__version__: bytes diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/any_pb2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/any_pb2.pyi new file mode 100644 index 0000000..c2a7295 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/any_pb2.pyi @@ -0,0 +1,22 @@ +from google.protobuf.message import ( + Message, +) +from google.protobuf.internal import well_known_types + +from typing import ( + Optional, + Text, +) + + +class Any(Message, well_known_types.Any_): + type_url: Text + value: bytes + + def __init__(self, + type_url: Optional[Text] = ..., + value: Optional[bytes] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> Any: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/any_test_pb2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/any_test_pb2.pyi new file mode 100644 index 0000000..d352bad --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/any_test_pb2.pyi @@ -0,0 +1,32 @@ +from google.protobuf.any_pb2 import ( + Any, +) +from google.protobuf.internal.containers import ( + RepeatedCompositeFieldContainer, +) +from google.protobuf.message import ( + Message, +) +from typing import ( + Iterable, + Optional, +) + + +class TestAny(Message): + int32_value: int + + @property + def any_value(self) -> Any: ... + + @property + def repeated_any_value(self) -> RepeatedCompositeFieldContainer[Any]: ... + + def __init__(self, + int32_value: Optional[int] = ..., + any_value: Optional[Any] = ..., + repeated_any_value: Optional[Iterable[Any]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAny: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/api_pb2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/api_pb2.pyi new file mode 100644 index 0000000..3646878 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/api_pb2.pyi @@ -0,0 +1,87 @@ +from google.protobuf.internal.containers import ( + RepeatedCompositeFieldContainer, +) +from google.protobuf.message import ( + Message, +) +from google.protobuf.source_context_pb2 import ( + SourceContext, +) +from google.protobuf.type_pb2 import ( + Option, + Syntax, +) +from typing import ( + Iterable, + Optional, + Text, +) + + +class Api(Message): + name: Text + version: Text + syntax: Syntax + + @property + def methods(self) -> RepeatedCompositeFieldContainer[Method]: ... + + @property + def options(self) -> RepeatedCompositeFieldContainer[Option]: ... + + @property + def source_context(self) -> SourceContext: ... + + @property + def mixins(self) -> RepeatedCompositeFieldContainer[Mixin]: ... + + def __init__(self, + name: Optional[Text] = ..., + methods: Optional[Iterable[Method]] = ..., + options: Optional[Iterable[Option]] = ..., + version: Optional[Text] = ..., + source_context: Optional[SourceContext] = ..., + mixins: Optional[Iterable[Mixin]] = ..., + syntax: Optional[Syntax] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> Api: ... + + +class Method(Message): + name: Text + request_type_url: Text + request_streaming: bool + response_type_url: Text + response_streaming: bool + syntax: Syntax + + @property + def options(self) -> RepeatedCompositeFieldContainer[Option]: ... + + def __init__(self, + name: Optional[Text] = ..., + request_type_url: Optional[Text] = ..., + request_streaming: Optional[bool] = ..., + response_type_url: Optional[Text] = ..., + response_streaming: Optional[bool] = ..., + options: Optional[Iterable[Option]] = ..., + syntax: Optional[Syntax] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> Method: ... + + +class Mixin(Message): + name: Text + root: Text + + def __init__(self, + name: Optional[Text] = ..., + root: Optional[Text] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> Mixin: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/compiler/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/compiler/__init__.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/compiler/plugin_pb2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/compiler/plugin_pb2.pyi new file mode 100644 index 0000000..d1037fa --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/compiler/plugin_pb2.pyi @@ -0,0 +1,82 @@ +from google.protobuf.descriptor_pb2 import ( + FileDescriptorProto, +) +from google.protobuf.internal.containers import ( + RepeatedCompositeFieldContainer, + RepeatedScalarFieldContainer, +) +from google.protobuf.message import ( + Message, +) +from typing import ( + Iterable, + Optional, + Text, +) + + +class Version(Message): + major: int + minor: int + patch: int + suffix: Text + + def __init__(self, + major: Optional[int] = ..., + minor: Optional[int] = ..., + patch: Optional[int] = ..., + suffix: Optional[Text] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> Version: ... + + +class CodeGeneratorRequest(Message): + file_to_generate: RepeatedScalarFieldContainer[Text] + parameter: Text + + @property + def proto_file(self) -> RepeatedCompositeFieldContainer[FileDescriptorProto]: ... + + @property + def compiler_version(self) -> Version: ... + + def __init__(self, + file_to_generate: Optional[Iterable[Text]] = ..., + parameter: Optional[Text] = ..., + proto_file: Optional[Iterable[FileDescriptorProto]] = ..., + compiler_version: Optional[Version] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> CodeGeneratorRequest: ... + + +class CodeGeneratorResponse(Message): + + class File(Message): + name: Text + insertion_point: Text + content: Text + + def __init__(self, + name: Optional[Text] = ..., + insertion_point: Optional[Text] = ..., + content: Optional[Text] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> CodeGeneratorResponse.File: ... + error: Text + + @property + def file(self) -> RepeatedCompositeFieldContainer[CodeGeneratorResponse.File]: ... + + def __init__(self, + error: Optional[Text] = ..., + file: Optional[Iterable[CodeGeneratorResponse.File]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> CodeGeneratorResponse: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/descriptor.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/descriptor.pyi new file mode 100644 index 0000000..44352c6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/descriptor.pyi @@ -0,0 +1,182 @@ +from typing import Any + +from .message import Message +from .descriptor_pb2 import ( + EnumOptions, + EnumValueOptions, + FieldOptions, + FileOptions, + MessageOptions, + MethodOptions, + OneofOptions, + ServiceOptions, +) + +class Error(Exception): ... +class TypeTransformationError(Error): ... + +class DescriptorMetaclass(type): + def __instancecheck__(self, obj): ... + +class DescriptorBase(metaclass=DescriptorMetaclass): + has_options: Any + def __init__(self, options, options_class_name) -> None: ... + def GetOptions(self): ... + +class _NestedDescriptorBase(DescriptorBase): + name: Any + full_name: Any + file: Any + containing_type: Any + def __init__(self, options, options_class_name, name, full_name, file, containing_type, serialized_start=..., serialized_end=...) -> None: ... + def GetTopLevelContainingType(self): ... + def CopyToProto(self, proto): ... + +class Descriptor(_NestedDescriptorBase): + def __new__(cls, name, full_name, filename, containing_type, fields, nested_types, enum_types, extensions, options=..., is_extendable=..., extension_ranges=..., oneofs=..., file=..., serialized_start=..., serialized_end=..., syntax=...): ... + fields: Any + fields_by_number: Any + fields_by_name: Any + nested_types: Any + nested_types_by_name: Any + enum_types: Any + enum_types_by_name: Any + enum_values_by_name: Any + extensions: Any + extensions_by_name: Any + is_extendable: Any + extension_ranges: Any + oneofs: Any + oneofs_by_name: Any + syntax: Any + def __init__(self, name, full_name, filename, containing_type, fields, nested_types, enum_types, extensions, options=..., is_extendable=..., extension_ranges=..., oneofs=..., file=..., serialized_start=..., serialized_end=..., syntax=...) -> None: ... + def EnumValueName(self, enum, value): ... + def CopyToProto(self, proto): ... + def GetOptions(self) -> MessageOptions: ... + +class FieldDescriptor(DescriptorBase): + TYPE_DOUBLE: Any + TYPE_FLOAT: Any + TYPE_INT64: Any + TYPE_UINT64: Any + TYPE_INT32: Any + TYPE_FIXED64: Any + TYPE_FIXED32: Any + TYPE_BOOL: Any + TYPE_STRING: Any + TYPE_GROUP: Any + TYPE_MESSAGE: Any + TYPE_BYTES: Any + TYPE_UINT32: Any + TYPE_ENUM: Any + TYPE_SFIXED32: Any + TYPE_SFIXED64: Any + TYPE_SINT32: Any + TYPE_SINT64: Any + MAX_TYPE: Any + CPPTYPE_INT32: Any + CPPTYPE_INT64: Any + CPPTYPE_UINT32: Any + CPPTYPE_UINT64: Any + CPPTYPE_DOUBLE: Any + CPPTYPE_FLOAT: Any + CPPTYPE_BOOL: Any + CPPTYPE_ENUM: Any + CPPTYPE_STRING: Any + CPPTYPE_MESSAGE: Any + MAX_CPPTYPE: Any + LABEL_OPTIONAL: Any + LABEL_REQUIRED: Any + LABEL_REPEATED: Any + MAX_LABEL: Any + MAX_FIELD_NUMBER: Any + FIRST_RESERVED_FIELD_NUMBER: Any + LAST_RESERVED_FIELD_NUMBER: Any + def __new__(cls, name, full_name, index, number, type, cpp_type, label, default_value, message_type, enum_type, containing_type, is_extension, extension_scope, options=..., file=..., has_default_value=..., containing_oneof=...): ... + name: Any + full_name: Any + index: Any + number: Any + type: Any + cpp_type: Any + label: Any + has_default_value: Any + default_value: Any + containing_type: Any + message_type: Any + enum_type: Any + is_extension: Any + extension_scope: Any + containing_oneof: Any + def __init__(self, name, full_name, index, number, type, cpp_type, label, default_value, message_type, enum_type, containing_type, is_extension, extension_scope, options=..., file=..., has_default_value=..., containing_oneof=...) -> None: ... + @staticmethod + def ProtoTypeToCppProtoType(proto_type): ... + def GetOptions(self) -> FieldOptions: ... + +class EnumDescriptor(_NestedDescriptorBase): + def __new__(cls, name, full_name, filename, values, containing_type=..., options=..., file=..., serialized_start=..., serialized_end=...): ... + values: Any + values_by_name: Any + values_by_number: Any + def __init__(self, name, full_name, filename, values, containing_type=..., options=..., file=..., serialized_start=..., serialized_end=...) -> None: ... + def CopyToProto(self, proto): ... + def GetOptions(self) -> EnumOptions: ... + +class EnumValueDescriptor(DescriptorBase): + def __new__(cls, name, index, number, type=..., options=...): ... + name: Any + index: Any + number: Any + type: Any + def __init__(self, name, index, number, type=..., options=...) -> None: ... + def GetOptions(self) -> EnumValueOptions: ... + +class OneofDescriptor: + def __new__(cls, name, full_name, index, containing_type, fields): ... + name: Any + full_name: Any + index: Any + containing_type: Any + fields: Any + def __init__(self, name, full_name, index, containing_type, fields) -> None: ... + def GetOptions(self) -> OneofOptions: ... + +class ServiceDescriptor(_NestedDescriptorBase): + index: Any + methods: Any + methods_by_name: Any + def __init__(self, name, full_name, index, methods, options=..., file=..., serialized_start=..., serialized_end=...) -> None: ... + def FindMethodByName(self, name): ... + def CopyToProto(self, proto): ... + def GetOptions(self) -> ServiceOptions: ... + +class MethodDescriptor(DescriptorBase): + name: Any + full_name: Any + index: Any + containing_service: Any + input_type: Any + output_type: Any + def __init__(self, name, full_name, index, containing_service, input_type, output_type, options=...) -> None: ... + def GetOptions(self) -> MethodOptions: ... + +class FileDescriptor(DescriptorBase): + def __new__(cls, name, package, options=..., serialized_pb=..., dependencies=..., public_dependencies=..., syntax=..., pool=...): ... + _options: Any + pool: Any + message_types_by_name: Any + name: Any + package: Any + syntax: Any + serialized_pb: Any + enum_types_by_name: Any + extensions_by_name: Any + services_by_name: Any + dependencies: Any + public_dependencies: Any + def __init__(self, name, package, options=..., serialized_pb=..., dependencies=..., public_dependencies=..., syntax=..., pool=...) -> None: ... + def CopyToProto(self, proto): ... + def GetOptions(self) -> FileOptions: ... + +def MakeDescriptor(desc_proto, package=..., build_file_if_cpp=..., syntax=...): ... +def _ParseOptions(message: Message, string: bytes) -> Message: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/descriptor_pb2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/descriptor_pb2.pyi new file mode 100644 index 0000000..d0fbcdc --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/descriptor_pb2.pyi @@ -0,0 +1,732 @@ +from google.protobuf.internal.containers import ( + RepeatedCompositeFieldContainer, + RepeatedScalarFieldContainer, +) +from google.protobuf.message import ( + Message, +) +from typing import ( + Iterable, + List, + Optional, + Text, + Tuple, + cast, +) + + +class FileDescriptorSet(Message): + + @property + def file(self) -> RepeatedCompositeFieldContainer[FileDescriptorProto]: ... + + def __init__(self, + file: Optional[Iterable[FileDescriptorProto]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> FileDescriptorSet: ... + + +class FileDescriptorProto(Message): + name: Text + package: Text + dependency: RepeatedScalarFieldContainer[Text] + public_dependency: RepeatedScalarFieldContainer[int] + weak_dependency: RepeatedScalarFieldContainer[int] + syntax: Text + + @property + def message_type( + self) -> RepeatedCompositeFieldContainer[DescriptorProto]: ... + + @property + def enum_type( + self) -> RepeatedCompositeFieldContainer[EnumDescriptorProto]: ... + + @property + def service( + self) -> RepeatedCompositeFieldContainer[ServiceDescriptorProto]: ... + + @property + def extension( + self) -> RepeatedCompositeFieldContainer[FieldDescriptorProto]: ... + + @property + def options(self) -> FileOptions: ... + + @property + def source_code_info(self) -> SourceCodeInfo: ... + + def __init__(self, + name: Optional[Text] = ..., + package: Optional[Text] = ..., + dependency: Optional[Iterable[Text]] = ..., + public_dependency: Optional[Iterable[int]] = ..., + weak_dependency: Optional[Iterable[int]] = ..., + message_type: Optional[Iterable[DescriptorProto]] = ..., + enum_type: Optional[Iterable[EnumDescriptorProto]] = ..., + service: Optional[Iterable[ServiceDescriptorProto]] = ..., + extension: Optional[Iterable[FieldDescriptorProto]] = ..., + options: Optional[FileOptions] = ..., + source_code_info: Optional[SourceCodeInfo] = ..., + syntax: Optional[Text] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> FileDescriptorProto: ... + + +class DescriptorProto(Message): + + class ExtensionRange(Message): + start: int + end: int + + @property + def options(self) -> ExtensionRangeOptions: ... + + def __init__(self, + start: Optional[int] = ..., + end: Optional[int] = ..., + options: Optional[ExtensionRangeOptions] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> DescriptorProto.ExtensionRange: ... + + class ReservedRange(Message): + start: int + end: int + + def __init__(self, + start: Optional[int] = ..., + end: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> DescriptorProto.ReservedRange: ... + name: Text + reserved_name: RepeatedScalarFieldContainer[Text] + + @property + def field( + self) -> RepeatedCompositeFieldContainer[FieldDescriptorProto]: ... + + @property + def extension( + self) -> RepeatedCompositeFieldContainer[FieldDescriptorProto]: ... + + @property + def nested_type( + self) -> RepeatedCompositeFieldContainer[DescriptorProto]: ... + + @property + def enum_type( + self) -> RepeatedCompositeFieldContainer[EnumDescriptorProto]: ... + + @property + def extension_range( + self) -> RepeatedCompositeFieldContainer[DescriptorProto.ExtensionRange]: ... + + @property + def oneof_decl( + self) -> RepeatedCompositeFieldContainer[OneofDescriptorProto]: ... + + @property + def options(self) -> MessageOptions: ... + + @property + def reserved_range( + self) -> RepeatedCompositeFieldContainer[DescriptorProto.ReservedRange]: ... + + def __init__(self, + name: Optional[Text] = ..., + field: Optional[Iterable[FieldDescriptorProto]] = ..., + extension: Optional[Iterable[FieldDescriptorProto]] = ..., + nested_type: Optional[Iterable[DescriptorProto]] = ..., + enum_type: Optional[Iterable[EnumDescriptorProto]] = ..., + extension_range: Optional[Iterable[DescriptorProto.ExtensionRange]] = ..., + oneof_decl: Optional[Iterable[OneofDescriptorProto]] = ..., + options: Optional[MessageOptions] = ..., + reserved_range: Optional[Iterable[DescriptorProto.ReservedRange]] = ..., + reserved_name: Optional[Iterable[Text]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> DescriptorProto: ... + + +class ExtensionRangeOptions(Message): + + @property + def uninterpreted_option( + self) -> RepeatedCompositeFieldContainer[UninterpretedOption]: ... + + def __init__(self, + uninterpreted_option: Optional[Iterable[UninterpretedOption]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> ExtensionRangeOptions: ... + + +class FieldDescriptorProto(Message): + + class Type(int): + + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> FieldDescriptorProto.Type: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[FieldDescriptorProto.Type]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, FieldDescriptorProto.Type]]: ... + TYPE_DOUBLE: FieldDescriptorProto.Type + TYPE_FLOAT: FieldDescriptorProto.Type + TYPE_INT64: FieldDescriptorProto.Type + TYPE_UINT64: FieldDescriptorProto.Type + TYPE_INT32: FieldDescriptorProto.Type + TYPE_FIXED64: FieldDescriptorProto.Type + TYPE_FIXED32: FieldDescriptorProto.Type + TYPE_BOOL: FieldDescriptorProto.Type + TYPE_STRING: FieldDescriptorProto.Type + TYPE_GROUP: FieldDescriptorProto.Type + TYPE_MESSAGE: FieldDescriptorProto.Type + TYPE_BYTES: FieldDescriptorProto.Type + TYPE_UINT32: FieldDescriptorProto.Type + TYPE_ENUM: FieldDescriptorProto.Type + TYPE_SFIXED32: FieldDescriptorProto.Type + TYPE_SFIXED64: FieldDescriptorProto.Type + TYPE_SINT32: FieldDescriptorProto.Type + TYPE_SINT64: FieldDescriptorProto.Type + + class Label(int): + + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> FieldDescriptorProto.Label: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[FieldDescriptorProto.Label]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, FieldDescriptorProto.Label]]: ... + LABEL_OPTIONAL: FieldDescriptorProto.Label + LABEL_REQUIRED: FieldDescriptorProto.Label + LABEL_REPEATED: FieldDescriptorProto.Label + name: Text + number: int + label: FieldDescriptorProto.Label + type: FieldDescriptorProto.Type + type_name: Text + extendee: Text + default_value: Text + oneof_index: int + json_name: Text + + @property + def options(self) -> FieldOptions: ... + + def __init__(self, + name: Optional[Text] = ..., + number: Optional[int] = ..., + label: Optional[FieldDescriptorProto.Label] = ..., + type: Optional[FieldDescriptorProto.Type] = ..., + type_name: Optional[Text] = ..., + extendee: Optional[Text] = ..., + default_value: Optional[Text] = ..., + oneof_index: Optional[int] = ..., + json_name: Optional[Text] = ..., + options: Optional[FieldOptions] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> FieldDescriptorProto: ... + + +class OneofDescriptorProto(Message): + name: Text + + @property + def options(self) -> OneofOptions: ... + + def __init__(self, + name: Optional[Text] = ..., + options: Optional[OneofOptions] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> OneofDescriptorProto: ... + + +class EnumDescriptorProto(Message): + + class EnumReservedRange(Message): + start: int + end: int + + def __init__(self, + start: Optional[int] = ..., + end: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> EnumDescriptorProto.EnumReservedRange: ... + name: Text + reserved_name: RepeatedScalarFieldContainer[Text] + + @property + def value( + self) -> RepeatedCompositeFieldContainer[EnumValueDescriptorProto]: ... + + @property + def options(self) -> EnumOptions: ... + + @property + def reserved_range( + self) -> RepeatedCompositeFieldContainer[EnumDescriptorProto.EnumReservedRange]: ... + + def __init__(self, + name: Optional[Text] = ..., + value: Optional[Iterable[EnumValueDescriptorProto]] = ..., + options: Optional[EnumOptions] = ..., + reserved_range: Optional[Iterable[EnumDescriptorProto.EnumReservedRange]] = ..., + reserved_name: Optional[Iterable[Text]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> EnumDescriptorProto: ... + + +class EnumValueDescriptorProto(Message): + name: Text + number: int + + @property + def options(self) -> EnumValueOptions: ... + + def __init__(self, + name: Optional[Text] = ..., + number: Optional[int] = ..., + options: Optional[EnumValueOptions] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> EnumValueDescriptorProto: ... + + +class ServiceDescriptorProto(Message): + name: Text + + @property + def method( + self) -> RepeatedCompositeFieldContainer[MethodDescriptorProto]: ... + + @property + def options(self) -> ServiceOptions: ... + + def __init__(self, + name: Optional[Text] = ..., + method: Optional[Iterable[MethodDescriptorProto]] = ..., + options: Optional[ServiceOptions] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> ServiceDescriptorProto: ... + + +class MethodDescriptorProto(Message): + name: Text + input_type: Text + output_type: Text + client_streaming: bool + server_streaming: bool + + @property + def options(self) -> MethodOptions: ... + + def __init__(self, + name: Optional[Text] = ..., + input_type: Optional[Text] = ..., + output_type: Optional[Text] = ..., + options: Optional[MethodOptions] = ..., + client_streaming: Optional[bool] = ..., + server_streaming: Optional[bool] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> MethodDescriptorProto: ... + + +class FileOptions(Message): + + class OptimizeMode(int): + + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> FileOptions.OptimizeMode: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[FileOptions.OptimizeMode]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, FileOptions.OptimizeMode]]: ... + SPEED: FileOptions.OptimizeMode + CODE_SIZE: FileOptions.OptimizeMode + LITE_RUNTIME: FileOptions.OptimizeMode + java_package: Text + java_outer_classname: Text + java_multiple_files: bool + java_generate_equals_and_hash: bool + java_string_check_utf8: bool + optimize_for: FileOptions.OptimizeMode + go_package: Text + cc_generic_services: bool + java_generic_services: bool + py_generic_services: bool + php_generic_services: bool + deprecated: bool + cc_enable_arenas: bool + objc_class_prefix: Text + csharp_namespace: Text + swift_prefix: Text + php_class_prefix: Text + php_namespace: Text + + @property + def uninterpreted_option( + self) -> RepeatedCompositeFieldContainer[UninterpretedOption]: ... + + def __init__(self, + java_package: Optional[Text] = ..., + java_outer_classname: Optional[Text] = ..., + java_multiple_files: Optional[bool] = ..., + java_generate_equals_and_hash: Optional[bool] = ..., + java_string_check_utf8: Optional[bool] = ..., + optimize_for: Optional[FileOptions.OptimizeMode] = ..., + go_package: Optional[Text] = ..., + cc_generic_services: Optional[bool] = ..., + java_generic_services: Optional[bool] = ..., + py_generic_services: Optional[bool] = ..., + php_generic_services: Optional[bool] = ..., + deprecated: Optional[bool] = ..., + cc_enable_arenas: Optional[bool] = ..., + objc_class_prefix: Optional[Text] = ..., + csharp_namespace: Optional[Text] = ..., + swift_prefix: Optional[Text] = ..., + php_class_prefix: Optional[Text] = ..., + php_namespace: Optional[Text] = ..., + uninterpreted_option: Optional[Iterable[UninterpretedOption]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> FileOptions: ... + + +class MessageOptions(Message): + message_set_wire_format: bool + no_standard_descriptor_accessor: bool + deprecated: bool + map_entry: bool + + @property + def uninterpreted_option( + self) -> RepeatedCompositeFieldContainer[UninterpretedOption]: ... + + def __init__(self, + message_set_wire_format: Optional[bool] = ..., + no_standard_descriptor_accessor: Optional[bool] = ..., + deprecated: Optional[bool] = ..., + map_entry: Optional[bool] = ..., + uninterpreted_option: Optional[Iterable[UninterpretedOption]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> MessageOptions: ... + + +class FieldOptions(Message): + + class CType(int): + + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> FieldOptions.CType: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[FieldOptions.CType]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, FieldOptions.CType]]: ... + STRING: FieldOptions.CType + CORD: FieldOptions.CType + STRING_PIECE: FieldOptions.CType + + class JSType(int): + + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> FieldOptions.JSType: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[FieldOptions.JSType]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, FieldOptions.JSType]]: ... + JS_NORMAL: FieldOptions.JSType + JS_STRING: FieldOptions.JSType + JS_NUMBER: FieldOptions.JSType + ctype: FieldOptions.CType + packed: bool + jstype: FieldOptions.JSType + lazy: bool + deprecated: bool + weak: bool + + @property + def uninterpreted_option( + self) -> RepeatedCompositeFieldContainer[UninterpretedOption]: ... + + def __init__(self, + ctype: Optional[FieldOptions.CType] = ..., + packed: Optional[bool] = ..., + jstype: Optional[FieldOptions.JSType] = ..., + lazy: Optional[bool] = ..., + deprecated: Optional[bool] = ..., + weak: Optional[bool] = ..., + uninterpreted_option: Optional[Iterable[UninterpretedOption]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> FieldOptions: ... + + +class OneofOptions(Message): + + @property + def uninterpreted_option( + self) -> RepeatedCompositeFieldContainer[UninterpretedOption]: ... + + def __init__(self, + uninterpreted_option: Optional[Iterable[UninterpretedOption]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> OneofOptions: ... + + +class EnumOptions(Message): + allow_alias: bool + deprecated: bool + + @property + def uninterpreted_option( + self) -> RepeatedCompositeFieldContainer[UninterpretedOption]: ... + + def __init__(self, + allow_alias: Optional[bool] = ..., + deprecated: Optional[bool] = ..., + uninterpreted_option: Optional[Iterable[UninterpretedOption]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> EnumOptions: ... + + +class EnumValueOptions(Message): + deprecated: bool + + @property + def uninterpreted_option( + self) -> RepeatedCompositeFieldContainer[UninterpretedOption]: ... + + def __init__(self, + deprecated: Optional[bool] = ..., + uninterpreted_option: Optional[Iterable[UninterpretedOption]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> EnumValueOptions: ... + + +class ServiceOptions(Message): + deprecated: bool + + @property + def uninterpreted_option( + self) -> RepeatedCompositeFieldContainer[UninterpretedOption]: ... + + def __init__(self, + deprecated: Optional[bool] = ..., + uninterpreted_option: Optional[Iterable[UninterpretedOption]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> ServiceOptions: ... + + +class MethodOptions(Message): + + class IdempotencyLevel(int): + + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> MethodOptions.IdempotencyLevel: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[MethodOptions.IdempotencyLevel]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, MethodOptions.IdempotencyLevel]]: ... + IDEMPOTENCY_UNKNOWN: MethodOptions.IdempotencyLevel + NO_SIDE_EFFECTS: MethodOptions.IdempotencyLevel + IDEMPOTENT: MethodOptions.IdempotencyLevel + deprecated: bool + idempotency_level: MethodOptions.IdempotencyLevel + + @property + def uninterpreted_option( + self) -> RepeatedCompositeFieldContainer[UninterpretedOption]: ... + + def __init__(self, + deprecated: Optional[bool] = ..., + idempotency_level: Optional[MethodOptions.IdempotencyLevel] = ..., + uninterpreted_option: Optional[Iterable[UninterpretedOption]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> MethodOptions: ... + + +class UninterpretedOption(Message): + + class NamePart(Message): + name_part: Text + is_extension: bool + + def __init__(self, + name_part: Text, + is_extension: bool, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> UninterpretedOption.NamePart: ... + identifier_value: Text + positive_int_value: int + negative_int_value: int + double_value: float + string_value: bytes + aggregate_value: Text + + @property + def name( + self) -> RepeatedCompositeFieldContainer[UninterpretedOption.NamePart]: ... + + def __init__(self, + name: Optional[Iterable[UninterpretedOption.NamePart]] = ..., + identifier_value: Optional[Text] = ..., + positive_int_value: Optional[int] = ..., + negative_int_value: Optional[int] = ..., + double_value: Optional[float] = ..., + string_value: Optional[bytes] = ..., + aggregate_value: Optional[Text] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> UninterpretedOption: ... + + +class SourceCodeInfo(Message): + + class Location(Message): + path: RepeatedScalarFieldContainer[int] + span: RepeatedScalarFieldContainer[int] + leading_comments: Text + trailing_comments: Text + leading_detached_comments: RepeatedScalarFieldContainer[Text] + + def __init__(self, + path: Optional[Iterable[int]] = ..., + span: Optional[Iterable[int]] = ..., + leading_comments: Optional[Text] = ..., + trailing_comments: Optional[Text] = ..., + leading_detached_comments: Optional[Iterable[Text]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> SourceCodeInfo.Location: ... + + @property + def location( + self) -> RepeatedCompositeFieldContainer[SourceCodeInfo.Location]: ... + + def __init__(self, + location: Optional[Iterable[SourceCodeInfo.Location]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> SourceCodeInfo: ... + + +class GeneratedCodeInfo(Message): + + class Annotation(Message): + path: RepeatedScalarFieldContainer[int] + source_file: Text + begin: int + end: int + + def __init__(self, + path: Optional[Iterable[int]] = ..., + source_file: Optional[Text] = ..., + begin: Optional[int] = ..., + end: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> GeneratedCodeInfo.Annotation: ... + + @property + def annotation( + self) -> RepeatedCompositeFieldContainer[GeneratedCodeInfo.Annotation]: ... + + def __init__(self, + annotation: Optional[Iterable[GeneratedCodeInfo.Annotation]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> GeneratedCodeInfo: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/descriptor_pool.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/descriptor_pool.pyi new file mode 100644 index 0000000..f1ade52 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/descriptor_pool.pyi @@ -0,0 +1,18 @@ +from typing import Any, Optional + +class DescriptorPool: + def __new__(cls, descriptor_db: Optional[Any] = ...): ... + def __init__(self, descriptor_db: Optional[Any] = ...) -> None: ... + def Add(self, file_desc_proto): ... + def AddSerializedFile(self, serialized_file_desc_proto): ... + def AddDescriptor(self, desc): ... + def AddEnumDescriptor(self, enum_desc): ... + def AddFileDescriptor(self, file_desc): ... + def FindFileByName(self, file_name): ... + def FindFileContainingSymbol(self, symbol): ... + def FindMessageTypeByName(self, full_name): ... + def FindEnumTypeByName(self, full_name): ... + def FindFieldByName(self, full_name): ... + def FindExtensionByName(self, full_name): ... + +def Default(): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/duration_pb2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/duration_pb2.pyi new file mode 100644 index 0000000..378c2e5 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/duration_pb2.pyi @@ -0,0 +1,21 @@ +from google.protobuf.message import ( + Message, +) +from google.protobuf.internal import well_known_types + +from typing import ( + Optional, +) + + +class Duration(Message, well_known_types.Duration): + seconds: int + nanos: int + + def __init__(self, + seconds: Optional[int] = ..., + nanos: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> Duration: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/empty_pb2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/empty_pb2.pyi new file mode 100644 index 0000000..295ebfa --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/empty_pb2.pyi @@ -0,0 +1,12 @@ +from google.protobuf.message import ( + Message, +) + + +class Empty(Message): + + def __init__(self, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> Empty: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/field_mask_pb2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/field_mask_pb2.pyi new file mode 100644 index 0000000..1c96a02 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/field_mask_pb2.pyi @@ -0,0 +1,24 @@ +from google.protobuf.internal.containers import ( + RepeatedScalarFieldContainer, +) +from google.protobuf.internal import well_known_types + +from google.protobuf.message import ( + Message, +) +from typing import ( + Iterable, + Optional, + Text, +) + + +class FieldMask(Message, well_known_types.FieldMask): + paths: RepeatedScalarFieldContainer[Text] + + def __init__(self, + paths: Optional[Iterable[Text]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> FieldMask: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/__init__.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/containers.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/containers.pyi new file mode 100644 index 0000000..33e603c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/containers.pyi @@ -0,0 +1,54 @@ +from google.protobuf.descriptor import Descriptor +from google.protobuf.internal.message_listener import MessageListener +from google.protobuf.message import Message +from typing import ( + Sequence, TypeVar, Generic, Any, Iterator, Iterable, + Union, Optional, Callable, overload, List +) + +_T = TypeVar('_T') +class BaseContainer(Sequence[_T]): + def __init__(self, message_listener: MessageListener) -> None: ... + def __len__(self) -> int: ... + def __ne__(self, other: object) -> bool: ... + def __hash__(self) -> int: ... + def __repr__(self) -> str: ... + def sort(self, *, key: Optional[Callable[[_T], Any]] = ..., reverse: bool = ...) -> None: ... + @overload + def __getitem__(self, key: int) -> _T: ... + @overload + def __getitem__(self, key: slice) -> List[_T]: ... + +class RepeatedScalarFieldContainer(BaseContainer[_T]): + def __init__(self, message_listener: MessageListener, message_descriptor: Descriptor) -> None: ... + def append(self, value: _T) -> None: ... + def insert(self, key: int, value: _T) -> None: ... + def extend(self, elem_seq: Optional[Iterable[_T]]) -> None: ... + def MergeFrom(self, other: RepeatedScalarFieldContainer[_T]) -> None: ... + def remove(self, elem: _T) -> None: ... + def pop(self, key: int = ...) -> _T: ... + @overload + def __setitem__(self, key: int, value: _T) -> None: ... + @overload + def __setitem__(self, key: slice, value: Iterable[_T]) -> None: ... + def __getslice__(self, start: int, stop: int) -> List[_T]: ... + def __setslice__(self, start: int, stop: int, values: Iterable[_T]) -> None: ... + def __delitem__(self, key: Union[int, slice]) -> None: ... + def __delslice__(self, start: int, stop: int) -> None: ... + +class RepeatedCompositeFieldContainer(BaseContainer[_T]): + def __init__(self, message_listener: MessageListener, type_checker: Any) -> None: ... + def add(self, **kwargs: Any) -> _T: ... + def extend(self, elem_seq: Iterable[_T]) -> None: ... + def MergeFrom(self, other: RepeatedCompositeFieldContainer[_T]) -> None: ... + def remove(self, elem: _T) -> None: ... + def pop(self, key: int = ...) -> _T: ... + def __getslice__(self, start: int, stop: int) -> List[_T]: ... + def __delitem__(self, key: Union[int, slice]) -> None: ... + def __delslice__(self, start: int, stop: int) -> None: ... + +# Classes not yet typed +class Mapping(Any): ... +class MutableMapping(Mapping): ... +class ScalarMap(MutableMapping): ... +class MessageMap(MutableMapping): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/decoder.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/decoder.pyi new file mode 100644 index 0000000..24774ee --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/decoder.pyi @@ -0,0 +1,30 @@ +from typing import Any + +def ReadTag(buffer, pos): ... +def EnumDecoder(field_number, is_repeated, is_packed, key, new_default): ... + +Int32Decoder: Any +Int64Decoder: Any +UInt32Decoder: Any +UInt64Decoder: Any +SInt32Decoder: Any +SInt64Decoder: Any +Fixed32Decoder: Any +Fixed64Decoder: Any +SFixed32Decoder: Any +SFixed64Decoder: Any +FloatDecoder: Any +DoubleDecoder: Any +BoolDecoder: Any + +def StringDecoder(field_number, is_repeated, is_packed, key, new_default): ... +def BytesDecoder(field_number, is_repeated, is_packed, key, new_default): ... +def GroupDecoder(field_number, is_repeated, is_packed, key, new_default): ... +def MessageDecoder(field_number, is_repeated, is_packed, key, new_default): ... + +MESSAGE_SET_ITEM_TAG: Any + +def MessageSetItemDecoder(extensions_by_number): ... +def MapDecoder(field_descriptor, new_default, is_message_map): ... + +SkipField: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/encoder.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/encoder.pyi new file mode 100644 index 0000000..7a7923f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/encoder.pyi @@ -0,0 +1,34 @@ +from typing import Any + +Int32Sizer: Any +UInt32Sizer: Any +SInt32Sizer: Any +Fixed32Sizer: Any +Fixed64Sizer: Any +BoolSizer: Any + +def StringSizer(field_number, is_repeated, is_packed): ... +def BytesSizer(field_number, is_repeated, is_packed): ... +def GroupSizer(field_number, is_repeated, is_packed): ... +def MessageSizer(field_number, is_repeated, is_packed): ... +def MessageSetItemSizer(field_number): ... +def MapSizer(field_descriptor): ... +def TagBytes(field_number, wire_type): ... + +Int32Encoder: Any +UInt32Encoder: Any +SInt32Encoder: Any +Fixed32Encoder: Any +Fixed64Encoder: Any +SFixed32Encoder: Any +SFixed64Encoder: Any +FloatEncoder: Any +DoubleEncoder: Any + +def BoolEncoder(field_number, is_repeated, is_packed): ... +def StringEncoder(field_number, is_repeated, is_packed): ... +def BytesEncoder(field_number, is_repeated, is_packed): ... +def GroupEncoder(field_number, is_repeated, is_packed): ... +def MessageEncoder(field_number, is_repeated, is_packed): ... +def MessageSetItemEncoder(field_number): ... +def MapEncoder(field_descriptor): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/enum_type_wrapper.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/enum_type_wrapper.pyi new file mode 100644 index 0000000..61d6ea1 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/enum_type_wrapper.pyi @@ -0,0 +1,11 @@ +from typing import Any, List, Tuple + +class EnumTypeWrapper(object): + def __init__(self, enum_type: Any) -> None: ... + def Name(self, number: int) -> bytes: ... + def Value(self, name: bytes) -> int: ... + def keys(self) -> List[bytes]: ... + def values(self) -> List[int]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, int]]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/message_listener.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/message_listener.pyi new file mode 100644 index 0000000..e8d33a5 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/message_listener.pyi @@ -0,0 +1,5 @@ +class MessageListener(object): + def Modified(self) -> None: ... + +class NullMessageListener(MessageListener): + def Modified(self) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/well_known_types.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/well_known_types.pyi new file mode 100644 index 0000000..91a42a3 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/well_known_types.pyi @@ -0,0 +1,92 @@ +from typing import Any, Optional +from datetime import datetime + +class Error(Exception): ... +class ParseError(Error): ... + +# This is named 'Any' in the original, but that conflicts with typing.Any, +# and we really only need this file to mix in. +class Any_: + type_url: Any = ... + value: Any = ... + def Pack(self, msg: Any, type_url_prefix: bytes = ..., deterministic: Optional[Any] = ...) -> None: ... + def Unpack(self, msg: Any): ... + def TypeName(self): ... + def Is(self, descriptor: Any): ... + +class Timestamp: + def ToJsonString(self) -> str: ... + seconds: Any = ... + nanos: Any = ... + def FromJsonString(self, value: Any) -> None: ... + def GetCurrentTime(self) -> None: ... + def ToNanoseconds(self): ... + def ToMicroseconds(self): ... + def ToMilliseconds(self): ... + def ToSeconds(self): ... + def FromNanoseconds(self, nanos: Any) -> None: ... + def FromMicroseconds(self, micros: Any) -> None: ... + def FromMilliseconds(self, millis: Any) -> None: ... + def FromSeconds(self, seconds: Any) -> None: ... + def ToDatetime(self) -> datetime: ... + def FromDatetime(self, dt: datetime) -> None: ... + +class Duration: + def ToJsonString(self) -> str: ... + seconds: Any = ... + nanos: Any = ... + def FromJsonString(self, value: Any) -> None: ... + def ToNanoseconds(self): ... + def ToMicroseconds(self): ... + def ToMilliseconds(self): ... + def ToSeconds(self): ... + def FromNanoseconds(self, nanos: Any) -> None: ... + def FromMicroseconds(self, micros: Any) -> None: ... + def FromMilliseconds(self, millis: Any) -> None: ... + def FromSeconds(self, seconds: Any) -> None: ... + def ToTimedelta(self): ... + def FromTimedelta(self, td: Any) -> None: ... + +class FieldMask: + def ToJsonString(self) -> str: ... + def FromJsonString(self, value: Any) -> None: ... + def IsValidForDescriptor(self, message_descriptor: Any): ... + def AllFieldsFromDescriptor(self, message_descriptor: Any) -> None: ... + def CanonicalFormFromMask(self, mask: Any) -> None: ... + def Union(self, mask1: Any, mask2: Any) -> None: ... + def Intersect(self, mask1: Any, mask2: Any) -> None: ... + def MergeMessage(self, source: Any, destination: Any, replace_message_field: bool = ..., replace_repeated_field: bool = ...) -> None: ... + +class _FieldMaskTree: + def __init__(self, field_mask: Optional[Any] = ...) -> None: ... + def MergeFromFieldMask(self, field_mask: Any) -> None: ... + def AddPath(self, path: Any): ... + def ToFieldMask(self, field_mask: Any) -> None: ... + def IntersectPath(self, path: Any, intersection: Any): ... + def AddLeafNodes(self, prefix: Any, node: Any) -> None: ... + def MergeMessage(self, source: Any, destination: Any, replace_message: Any, replace_repeated: Any) -> None: ... + +class Struct: + def __getitem__(self, key: Any): ... + def __contains__(self, item: Any): ... + def __setitem__(self, key: Any, value: Any) -> None: ... + def __delitem__(self, key: Any) -> None: ... + def __len__(self): ... + def __iter__(self): ... + def keys(self): ... + def values(self): ... + def items(self): ... + def get_or_create_list(self, key: Any): ... + def get_or_create_struct(self, key: Any): ... + def update(self, dictionary: Any) -> None: ... + +class ListValue: + def __len__(self): ... + def append(self, value: Any) -> None: ... + def extend(self, elem_seq: Any) -> None: ... + def __getitem__(self, index: Any): ... + def __setitem__(self, index: Any, value: Any) -> None: ... + def __delitem__(self, key: Any) -> None: ... + def items(self) -> None: ... + def add_struct(self): ... + def add_list(self): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/wire_format.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/wire_format.pyi new file mode 100644 index 0000000..3dcbd04 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/wire_format.pyi @@ -0,0 +1,50 @@ +from typing import Any + +TAG_TYPE_BITS: Any +TAG_TYPE_MASK: Any +WIRETYPE_VARINT: Any +WIRETYPE_FIXED64: Any +WIRETYPE_LENGTH_DELIMITED: Any +WIRETYPE_START_GROUP: Any +WIRETYPE_END_GROUP: Any +WIRETYPE_FIXED32: Any +INT32_MAX: Any +INT32_MIN: Any +UINT32_MAX: Any +INT64_MAX: Any +INT64_MIN: Any +UINT64_MAX: Any +FORMAT_UINT32_LITTLE_ENDIAN: Any +FORMAT_UINT64_LITTLE_ENDIAN: Any +FORMAT_FLOAT_LITTLE_ENDIAN: Any +FORMAT_DOUBLE_LITTLE_ENDIAN: Any + +def PackTag(field_number, wire_type): ... +def UnpackTag(tag): ... +def ZigZagEncode(value): ... +def ZigZagDecode(value): ... +def Int32ByteSize(field_number, int32): ... +def Int32ByteSizeNoTag(int32): ... +def Int64ByteSize(field_number, int64): ... +def UInt32ByteSize(field_number, uint32): ... +def UInt64ByteSize(field_number, uint64): ... +def SInt32ByteSize(field_number, int32): ... +def SInt64ByteSize(field_number, int64): ... +def Fixed32ByteSize(field_number, fixed32): ... +def Fixed64ByteSize(field_number, fixed64): ... +def SFixed32ByteSize(field_number, sfixed32): ... +def SFixed64ByteSize(field_number, sfixed64): ... +def FloatByteSize(field_number, flt): ... +def DoubleByteSize(field_number, double): ... +def BoolByteSize(field_number, b): ... +def EnumByteSize(field_number, enum): ... +def StringByteSize(field_number, string): ... +def BytesByteSize(field_number, b): ... +def GroupByteSize(field_number, message): ... +def MessageByteSize(field_number, message): ... +def MessageSetItemByteSize(field_number, msg): ... +def TagByteSize(field_number): ... + +NON_PACKABLE_TYPES: Any + +def IsTypePackable(field_type): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/json_format.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/json_format.pyi new file mode 100644 index 0000000..e61ccb8 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/json_format.pyi @@ -0,0 +1,31 @@ +import sys +from typing import Any, Dict, Text, TypeVar, Union +from google.protobuf.message import Message + +_MessageVar = TypeVar('_MessageVar', bound=Message) + +class Error(Exception): ... + +class ParseError(Error): ... + +class SerializeToJsonError(Error): ... + +def MessageToJson( + message: Message, + including_default_value_fields: bool = ..., + preserving_proto_field_name: bool = ..., + indent: int = ..., + sort_keys: bool = ..., + use_integers_for_enums: bool = ... +) -> str: ... + +def MessageToDict( + message: Message, + including_default_value_fields: bool = ..., + preserving_proto_field_name: bool = ..., + use_integers_for_enums: bool = ... +) -> Dict[Text, Any]: ... + +def Parse(text: Union[bytes, Text], message: _MessageVar, ignore_unknown_fields: bool = ...) -> _MessageVar: ... + +def ParseDict(js_dict: Any, message: _MessageVar, ignore_unknown_fields: bool = ...) -> _MessageVar: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/map_proto2_unittest_pb2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/map_proto2_unittest_pb2.pyi new file mode 100644 index 0000000..fd12d10 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/map_proto2_unittest_pb2.pyi @@ -0,0 +1,428 @@ +from google.protobuf.message import ( + Message, +) +from google.protobuf.unittest_import_pb2 import ( + ImportEnumForMap, +) +from typing import ( + List, + Mapping, + MutableMapping, + Optional, + Text, + Tuple, + cast, +) + + +class Proto2MapEnum(int): + + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> Proto2MapEnum: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[Proto2MapEnum]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, Proto2MapEnum]]: ... +PROTO2_MAP_ENUM_FOO: Proto2MapEnum +PROTO2_MAP_ENUM_BAR: Proto2MapEnum +PROTO2_MAP_ENUM_BAZ: Proto2MapEnum + + +class Proto2MapEnumPlusExtra(int): + + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> Proto2MapEnumPlusExtra: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[Proto2MapEnumPlusExtra]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, Proto2MapEnumPlusExtra]]: ... +E_PROTO2_MAP_ENUM_FOO: Proto2MapEnumPlusExtra +E_PROTO2_MAP_ENUM_BAR: Proto2MapEnumPlusExtra +E_PROTO2_MAP_ENUM_BAZ: Proto2MapEnumPlusExtra +E_PROTO2_MAP_ENUM_EXTRA: Proto2MapEnumPlusExtra + + +class TestEnumMap(Message): + + class KnownMapFieldEntry(Message): + key: int + value: Proto2MapEnum + + def __init__(self, + key: Optional[int] = ..., + value: Optional[Proto2MapEnum] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestEnumMap.KnownMapFieldEntry: ... + + class UnknownMapFieldEntry(Message): + key: int + value: Proto2MapEnum + + def __init__(self, + key: Optional[int] = ..., + value: Optional[Proto2MapEnum] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestEnumMap.UnknownMapFieldEntry: ... + + @property + def known_map_field(self) -> MutableMapping[int, Proto2MapEnum]: ... + + @property + def unknown_map_field(self) -> MutableMapping[int, Proto2MapEnum]: ... + + def __init__(self, + known_map_field: Optional[Mapping[int, Proto2MapEnum]] = ..., + unknown_map_field: Optional[Mapping[int, Proto2MapEnum]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestEnumMap: ... + + +class TestEnumMapPlusExtra(Message): + + class KnownMapFieldEntry(Message): + key: int + value: Proto2MapEnumPlusExtra + + def __init__(self, + key: Optional[int] = ..., + value: Optional[Proto2MapEnumPlusExtra] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestEnumMapPlusExtra.KnownMapFieldEntry: ... + + class UnknownMapFieldEntry(Message): + key: int + value: Proto2MapEnumPlusExtra + + def __init__(self, + key: Optional[int] = ..., + value: Optional[Proto2MapEnumPlusExtra] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestEnumMapPlusExtra.UnknownMapFieldEntry: ... + + @property + def known_map_field(self) -> MutableMapping[int, Proto2MapEnumPlusExtra]: ... + + @property + def unknown_map_field(self) -> MutableMapping[int, Proto2MapEnumPlusExtra]: ... + + def __init__(self, + known_map_field: Optional[Mapping[int, Proto2MapEnumPlusExtra]] = ..., + unknown_map_field: Optional[Mapping[int, Proto2MapEnumPlusExtra]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestEnumMapPlusExtra: ... + + +class TestImportEnumMap(Message): + + class ImportEnumAmpEntry(Message): + key: int + value: ImportEnumForMap + + def __init__(self, + key: Optional[int] = ..., + value: Optional[ImportEnumForMap] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestImportEnumMap.ImportEnumAmpEntry: ... + + @property + def import_enum_amp(self) -> MutableMapping[int, ImportEnumForMap]: ... + + def __init__(self, + import_enum_amp: Optional[Mapping[int, ImportEnumForMap]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestImportEnumMap: ... + + +class TestIntIntMap(Message): + + class MEntry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestIntIntMap.MEntry: ... + + @property + def m(self) -> MutableMapping[int, int]: ... + + def __init__(self, + m: Optional[Mapping[int, int]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestIntIntMap: ... + + +class TestMaps(Message): + + class MInt32Entry(Message): + key: int + + @property + def value(self) -> TestIntIntMap: ... + + def __init__(self, + key: Optional[int] = ..., + value: Optional[TestIntIntMap] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMaps.MInt32Entry: ... + + class MInt64Entry(Message): + key: int + + @property + def value(self) -> TestIntIntMap: ... + + def __init__(self, + key: Optional[int] = ..., + value: Optional[TestIntIntMap] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMaps.MInt64Entry: ... + + class MUint32Entry(Message): + key: int + + @property + def value(self) -> TestIntIntMap: ... + + def __init__(self, + key: Optional[int] = ..., + value: Optional[TestIntIntMap] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMaps.MUint32Entry: ... + + class MUint64Entry(Message): + key: int + + @property + def value(self) -> TestIntIntMap: ... + + def __init__(self, + key: Optional[int] = ..., + value: Optional[TestIntIntMap] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMaps.MUint64Entry: ... + + class MSint32Entry(Message): + key: int + + @property + def value(self) -> TestIntIntMap: ... + + def __init__(self, + key: Optional[int] = ..., + value: Optional[TestIntIntMap] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMaps.MSint32Entry: ... + + class MSint64Entry(Message): + key: int + + @property + def value(self) -> TestIntIntMap: ... + + def __init__(self, + key: Optional[int] = ..., + value: Optional[TestIntIntMap] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMaps.MSint64Entry: ... + + class MFixed32Entry(Message): + key: int + + @property + def value(self) -> TestIntIntMap: ... + + def __init__(self, + key: Optional[int] = ..., + value: Optional[TestIntIntMap] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMaps.MFixed32Entry: ... + + class MFixed64Entry(Message): + key: int + + @property + def value(self) -> TestIntIntMap: ... + + def __init__(self, + key: Optional[int] = ..., + value: Optional[TestIntIntMap] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMaps.MFixed64Entry: ... + + class MSfixed32Entry(Message): + key: int + + @property + def value(self) -> TestIntIntMap: ... + + def __init__(self, + key: Optional[int] = ..., + value: Optional[TestIntIntMap] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMaps.MSfixed32Entry: ... + + class MSfixed64Entry(Message): + key: int + + @property + def value(self) -> TestIntIntMap: ... + + def __init__(self, + key: Optional[int] = ..., + value: Optional[TestIntIntMap] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMaps.MSfixed64Entry: ... + + class MBoolEntry(Message): + key: bool + + @property + def value(self) -> TestIntIntMap: ... + + def __init__(self, + key: Optional[bool] = ..., + value: Optional[TestIntIntMap] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMaps.MBoolEntry: ... + + class MStringEntry(Message): + key: Text + + @property + def value(self) -> TestIntIntMap: ... + + def __init__(self, + key: Optional[Text] = ..., + value: Optional[TestIntIntMap] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMaps.MStringEntry: ... + + @property + def m_int32(self) -> MutableMapping[int, TestIntIntMap]: ... + + @property + def m_int64(self) -> MutableMapping[int, TestIntIntMap]: ... + + @property + def m_uint32(self) -> MutableMapping[int, TestIntIntMap]: ... + + @property + def m_uint64(self) -> MutableMapping[int, TestIntIntMap]: ... + + @property + def m_sint32(self) -> MutableMapping[int, TestIntIntMap]: ... + + @property + def m_sint64(self) -> MutableMapping[int, TestIntIntMap]: ... + + @property + def m_fixed32(self) -> MutableMapping[int, TestIntIntMap]: ... + + @property + def m_fixed64(self) -> MutableMapping[int, TestIntIntMap]: ... + + @property + def m_sfixed32(self) -> MutableMapping[int, TestIntIntMap]: ... + + @property + def m_sfixed64(self) -> MutableMapping[int, TestIntIntMap]: ... + + @property + def m_bool(self) -> MutableMapping[bool, TestIntIntMap]: ... + + @property + def m_string(self) -> MutableMapping[Text, TestIntIntMap]: ... + + def __init__(self, + m_int32: Optional[Mapping[int, TestIntIntMap]] = ..., + m_int64: Optional[Mapping[int, TestIntIntMap]] = ..., + m_uint32: Optional[Mapping[int, TestIntIntMap]] = ..., + m_uint64: Optional[Mapping[int, TestIntIntMap]] = ..., + m_sint32: Optional[Mapping[int, TestIntIntMap]] = ..., + m_sint64: Optional[Mapping[int, TestIntIntMap]] = ..., + m_fixed32: Optional[Mapping[int, TestIntIntMap]] = ..., + m_fixed64: Optional[Mapping[int, TestIntIntMap]] = ..., + m_sfixed32: Optional[Mapping[int, TestIntIntMap]] = ..., + m_sfixed64: Optional[Mapping[int, TestIntIntMap]] = ..., + m_bool: Optional[Mapping[bool, TestIntIntMap]] = ..., + m_string: Optional[Mapping[Text, TestIntIntMap]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMaps: ... + + +class TestSubmessageMaps(Message): + + @property + def m(self) -> TestMaps: ... + + def __init__(self, + m: Optional[TestMaps] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestSubmessageMaps: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/map_unittest_pb2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/map_unittest_pb2.pyi new file mode 100644 index 0000000..25058bb --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/map_unittest_pb2.pyi @@ -0,0 +1,882 @@ +from google.protobuf.message import ( + Message, +) +from google.protobuf.unittest_no_arena_pb2 import ( + ForeignMessage, +) +from google.protobuf.unittest_pb2 import ( + ForeignMessage as ForeignMessage1, + TestAllTypes, + TestRequired, +) +from typing import ( + List, + Mapping, + MutableMapping, + Optional, + Text, + Tuple, + cast, +) + + +class MapEnum(int): + + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> MapEnum: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[MapEnum]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, MapEnum]]: ... + + +MAP_ENUM_FOO: MapEnum +MAP_ENUM_BAR: MapEnum +MAP_ENUM_BAZ: MapEnum + + +class TestMap(Message): + + class MapInt32Int32Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMap.MapInt32Int32Entry: ... + + class MapInt64Int64Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMap.MapInt64Int64Entry: ... + + class MapUint32Uint32Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMap.MapUint32Uint32Entry: ... + + class MapUint64Uint64Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMap.MapUint64Uint64Entry: ... + + class MapSint32Sint32Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMap.MapSint32Sint32Entry: ... + + class MapSint64Sint64Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMap.MapSint64Sint64Entry: ... + + class MapFixed32Fixed32Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMap.MapFixed32Fixed32Entry: ... + + class MapFixed64Fixed64Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMap.MapFixed64Fixed64Entry: ... + + class MapSfixed32Sfixed32Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMap.MapSfixed32Sfixed32Entry: ... + + class MapSfixed64Sfixed64Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMap.MapSfixed64Sfixed64Entry: ... + + class MapInt32FloatEntry(Message): + key: int + value: float + + def __init__(self, + key: Optional[int] = ..., + value: Optional[float] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMap.MapInt32FloatEntry: ... + + class MapInt32DoubleEntry(Message): + key: int + value: float + + def __init__(self, + key: Optional[int] = ..., + value: Optional[float] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMap.MapInt32DoubleEntry: ... + + class MapBoolBoolEntry(Message): + key: bool + value: bool + + def __init__(self, + key: Optional[bool] = ..., + value: Optional[bool] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMap.MapBoolBoolEntry: ... + + class MapStringStringEntry(Message): + key: Text + value: Text + + def __init__(self, + key: Optional[Text] = ..., + value: Optional[Text] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMap.MapStringStringEntry: ... + + class MapInt32BytesEntry(Message): + key: int + value: bytes + + def __init__(self, + key: Optional[int] = ..., + value: Optional[bytes] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMap.MapInt32BytesEntry: ... + + class MapInt32EnumEntry(Message): + key: int + value: MapEnum + + def __init__(self, + key: Optional[int] = ..., + value: Optional[MapEnum] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMap.MapInt32EnumEntry: ... + + class MapInt32ForeignMessageEntry(Message): + key: int + + @property + def value(self) -> ForeignMessage1: ... + + def __init__(self, + key: Optional[int] = ..., + value: Optional[ForeignMessage1] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMap.MapInt32ForeignMessageEntry: ... + + class MapStringForeignMessageEntry(Message): + key: Text + + @property + def value(self) -> ForeignMessage1: ... + + def __init__(self, + key: Optional[Text] = ..., + value: Optional[ForeignMessage1] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestMap.MapStringForeignMessageEntry: ... + + class MapInt32AllTypesEntry(Message): + key: int + + @property + def value(self) -> TestAllTypes: ... + + def __init__(self, + key: Optional[int] = ..., + value: Optional[TestAllTypes] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMap.MapInt32AllTypesEntry: ... + + @property + def map_int32_int32(self) -> MutableMapping[int, int]: ... + + @property + def map_int64_int64(self) -> MutableMapping[int, int]: ... + + @property + def map_uint32_uint32(self) -> MutableMapping[int, int]: ... + + @property + def map_uint64_uint64(self) -> MutableMapping[int, int]: ... + + @property + def map_sint32_sint32(self) -> MutableMapping[int, int]: ... + + @property + def map_sint64_sint64(self) -> MutableMapping[int, int]: ... + + @property + def map_fixed32_fixed32(self) -> MutableMapping[int, int]: ... + + @property + def map_fixed64_fixed64(self) -> MutableMapping[int, int]: ... + + @property + def map_sfixed32_sfixed32(self) -> MutableMapping[int, int]: ... + + @property + def map_sfixed64_sfixed64(self) -> MutableMapping[int, int]: ... + + @property + def map_int32_float(self) -> MutableMapping[int, float]: ... + + @property + def map_int32_double(self) -> MutableMapping[int, float]: ... + + @property + def map_bool_bool(self) -> MutableMapping[bool, bool]: ... + + @property + def map_string_string(self) -> MutableMapping[Text, Text]: ... + + @property + def map_int32_bytes(self) -> MutableMapping[int, bytes]: ... + + @property + def map_int32_enum(self) -> MutableMapping[int, MapEnum]: ... + + @property + def map_int32_foreign_message( + self) -> MutableMapping[int, ForeignMessage1]: ... + + @property + def map_string_foreign_message( + self) -> MutableMapping[Text, ForeignMessage1]: ... + + @property + def map_int32_all_types(self) -> MutableMapping[int, TestAllTypes]: ... + + def __init__(self, + map_int32_int32: Optional[Mapping[int, int]] = ..., + map_int64_int64: Optional[Mapping[int, int]] = ..., + map_uint32_uint32: Optional[Mapping[int, int]] = ..., + map_uint64_uint64: Optional[Mapping[int, int]] = ..., + map_sint32_sint32: Optional[Mapping[int, int]] = ..., + map_sint64_sint64: Optional[Mapping[int, int]] = ..., + map_fixed32_fixed32: Optional[Mapping[int, int]] = ..., + map_fixed64_fixed64: Optional[Mapping[int, int]] = ..., + map_sfixed32_sfixed32: Optional[Mapping[int, int]] = ..., + map_sfixed64_sfixed64: Optional[Mapping[int, int]] = ..., + map_int32_float: Optional[Mapping[int, float]] = ..., + map_int32_double: Optional[Mapping[int, float]] = ..., + map_bool_bool: Optional[Mapping[bool, bool]] = ..., + map_string_string: Optional[Mapping[Text, Text]] = ..., + map_int32_bytes: Optional[Mapping[int, bytes]] = ..., + map_int32_enum: Optional[Mapping[int, MapEnum]] = ..., + map_int32_foreign_message: Optional[Mapping[int, ForeignMessage1]] = ..., + map_string_foreign_message: Optional[Mapping[Text, ForeignMessage1]] = ..., + map_int32_all_types: Optional[Mapping[int, TestAllTypes]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMap: ... + + +class TestMapSubmessage(Message): + + @property + def test_map(self) -> TestMap: ... + + def __init__(self, + test_map: Optional[TestMap] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMapSubmessage: ... + + +class TestMessageMap(Message): + + class MapInt32MessageEntry(Message): + key: int + + @property + def value(self) -> TestAllTypes: ... + + def __init__(self, + key: Optional[int] = ..., + value: Optional[TestAllTypes] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMessageMap.MapInt32MessageEntry: ... + + @property + def map_int32_message(self) -> MutableMapping[int, TestAllTypes]: ... + + def __init__(self, + map_int32_message: Optional[Mapping[int, TestAllTypes]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMessageMap: ... + + +class TestSameTypeMap(Message): + + class Map1Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestSameTypeMap.Map1Entry: ... + + class Map2Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestSameTypeMap.Map2Entry: ... + + @property + def map1(self) -> MutableMapping[int, int]: ... + + @property + def map2(self) -> MutableMapping[int, int]: ... + + def __init__(self, + map1: Optional[Mapping[int, int]] = ..., + map2: Optional[Mapping[int, int]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestSameTypeMap: ... + + +class TestRequiredMessageMap(Message): + + class MapFieldEntry(Message): + key: int + + @property + def value(self) -> TestRequired: ... + + def __init__(self, + key: Optional[int] = ..., + value: Optional[TestRequired] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestRequiredMessageMap.MapFieldEntry: ... + + @property + def map_field(self) -> MutableMapping[int, TestRequired]: ... + + def __init__(self, + map_field: Optional[Mapping[int, TestRequired]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestRequiredMessageMap: ... + + +class TestArenaMap(Message): + + class MapInt32Int32Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestArenaMap.MapInt32Int32Entry: ... + + class MapInt64Int64Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestArenaMap.MapInt64Int64Entry: ... + + class MapUint32Uint32Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestArenaMap.MapUint32Uint32Entry: ... + + class MapUint64Uint64Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestArenaMap.MapUint64Uint64Entry: ... + + class MapSint32Sint32Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestArenaMap.MapSint32Sint32Entry: ... + + class MapSint64Sint64Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestArenaMap.MapSint64Sint64Entry: ... + + class MapFixed32Fixed32Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestArenaMap.MapFixed32Fixed32Entry: ... + + class MapFixed64Fixed64Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestArenaMap.MapFixed64Fixed64Entry: ... + + class MapSfixed32Sfixed32Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestArenaMap.MapSfixed32Sfixed32Entry: ... + + class MapSfixed64Sfixed64Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestArenaMap.MapSfixed64Sfixed64Entry: ... + + class MapInt32FloatEntry(Message): + key: int + value: float + + def __init__(self, + key: Optional[int] = ..., + value: Optional[float] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestArenaMap.MapInt32FloatEntry: ... + + class MapInt32DoubleEntry(Message): + key: int + value: float + + def __init__(self, + key: Optional[int] = ..., + value: Optional[float] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestArenaMap.MapInt32DoubleEntry: ... + + class MapBoolBoolEntry(Message): + key: bool + value: bool + + def __init__(self, + key: Optional[bool] = ..., + value: Optional[bool] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestArenaMap.MapBoolBoolEntry: ... + + class MapStringStringEntry(Message): + key: Text + value: Text + + def __init__(self, + key: Optional[Text] = ..., + value: Optional[Text] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestArenaMap.MapStringStringEntry: ... + + class MapInt32BytesEntry(Message): + key: int + value: bytes + + def __init__(self, + key: Optional[int] = ..., + value: Optional[bytes] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestArenaMap.MapInt32BytesEntry: ... + + class MapInt32EnumEntry(Message): + key: int + value: MapEnum + + def __init__(self, + key: Optional[int] = ..., + value: Optional[MapEnum] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestArenaMap.MapInt32EnumEntry: ... + + class MapInt32ForeignMessageEntry(Message): + key: int + + @property + def value(self) -> ForeignMessage1: ... + + def __init__(self, + key: Optional[int] = ..., + value: Optional[ForeignMessage1] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestArenaMap.MapInt32ForeignMessageEntry: ... + + class MapInt32ForeignMessageNoArenaEntry(Message): + key: int + + @property + def value(self) -> ForeignMessage: ... + + def __init__(self, + key: Optional[int] = ..., + value: Optional[ForeignMessage] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestArenaMap.MapInt32ForeignMessageNoArenaEntry: ... + + @property + def map_int32_int32(self) -> MutableMapping[int, int]: ... + + @property + def map_int64_int64(self) -> MutableMapping[int, int]: ... + + @property + def map_uint32_uint32(self) -> MutableMapping[int, int]: ... + + @property + def map_uint64_uint64(self) -> MutableMapping[int, int]: ... + + @property + def map_sint32_sint32(self) -> MutableMapping[int, int]: ... + + @property + def map_sint64_sint64(self) -> MutableMapping[int, int]: ... + + @property + def map_fixed32_fixed32(self) -> MutableMapping[int, int]: ... + + @property + def map_fixed64_fixed64(self) -> MutableMapping[int, int]: ... + + @property + def map_sfixed32_sfixed32(self) -> MutableMapping[int, int]: ... + + @property + def map_sfixed64_sfixed64(self) -> MutableMapping[int, int]: ... + + @property + def map_int32_float(self) -> MutableMapping[int, float]: ... + + @property + def map_int32_double(self) -> MutableMapping[int, float]: ... + + @property + def map_bool_bool(self) -> MutableMapping[bool, bool]: ... + + @property + def map_string_string(self) -> MutableMapping[Text, Text]: ... + + @property + def map_int32_bytes(self) -> MutableMapping[int, bytes]: ... + + @property + def map_int32_enum(self) -> MutableMapping[int, MapEnum]: ... + + @property + def map_int32_foreign_message( + self) -> MutableMapping[int, ForeignMessage1]: ... + + @property + def map_int32_foreign_message_no_arena( + self) -> MutableMapping[int, ForeignMessage]: ... + + def __init__(self, + map_int32_int32: Optional[Mapping[int, int]] = ..., + map_int64_int64: Optional[Mapping[int, int]] = ..., + map_uint32_uint32: Optional[Mapping[int, int]] = ..., + map_uint64_uint64: Optional[Mapping[int, int]] = ..., + map_sint32_sint32: Optional[Mapping[int, int]] = ..., + map_sint64_sint64: Optional[Mapping[int, int]] = ..., + map_fixed32_fixed32: Optional[Mapping[int, int]] = ..., + map_fixed64_fixed64: Optional[Mapping[int, int]] = ..., + map_sfixed32_sfixed32: Optional[Mapping[int, int]] = ..., + map_sfixed64_sfixed64: Optional[Mapping[int, int]] = ..., + map_int32_float: Optional[Mapping[int, float]] = ..., + map_int32_double: Optional[Mapping[int, float]] = ..., + map_bool_bool: Optional[Mapping[bool, bool]] = ..., + map_string_string: Optional[Mapping[Text, Text]] = ..., + map_int32_bytes: Optional[Mapping[int, bytes]] = ..., + map_int32_enum: Optional[Mapping[int, MapEnum]] = ..., + map_int32_foreign_message: Optional[Mapping[int, ForeignMessage1]] = ..., + map_int32_foreign_message_no_arena: Optional[Mapping[int, ForeignMessage]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestArenaMap: ... + + +class MessageContainingEnumCalledType(Message): + + class Type(int): + + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> MessageContainingEnumCalledType.Type: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[MessageContainingEnumCalledType.Type]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, + MessageContainingEnumCalledType.Type]]: ... + TYPE_FOO: MessageContainingEnumCalledType.Type + + class TypeEntry(Message): + key: Text + + @property + def value(self) -> MessageContainingEnumCalledType: ... + + def __init__(self, + key: Optional[Text] = ..., + value: Optional[MessageContainingEnumCalledType] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> MessageContainingEnumCalledType.TypeEntry: ... + + @property + def type(self) -> MutableMapping[Text, + MessageContainingEnumCalledType]: ... + + def __init__(self, + type: Optional[Mapping[Text, MessageContainingEnumCalledType]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> MessageContainingEnumCalledType: ... + + +class MessageContainingMapCalledEntry(Message): + + class EntryEntry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> MessageContainingMapCalledEntry.EntryEntry: ... + + @property + def entry(self) -> MutableMapping[int, int]: ... + + def __init__(self, + entry: Optional[Mapping[int, int]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> MessageContainingMapCalledEntry: ... + + +class TestRecursiveMapMessage(Message): + + class AEntry(Message): + key: Text + + @property + def value(self) -> TestRecursiveMapMessage: ... + + def __init__(self, + key: Optional[Text] = ..., + value: Optional[TestRecursiveMapMessage] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestRecursiveMapMessage.AEntry: ... + + @property + def a(self) -> MutableMapping[Text, TestRecursiveMapMessage]: ... + + def __init__(self, + a: Optional[Mapping[Text, TestRecursiveMapMessage]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestRecursiveMapMessage: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/message.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/message.pyi new file mode 100644 index 0000000..4bf8cab --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/message.pyi @@ -0,0 +1,46 @@ +from typing import Any, Sequence, Optional, Tuple + +from .descriptor import ( + DescriptorBase, + FieldDescriptor, +) + +class Error(Exception): ... +class DecodeError(Error): ... +class EncodeError(Error): ... + +class _ExtensionDict: + def __getitem__(self, extension_handle: DescriptorBase) -> Any: ... + def __setitem__(self, extension_handle: DescriptorBase, value: Any) -> None: ... + +class Message: + DESCRIPTOR: Any + def __deepcopy__(self, memo=...): ... + def __eq__(self, other_msg): ... + def __ne__(self, other_msg): ... + def MergeFrom(self, other_msg: Message) -> None: ... + def CopyFrom(self, other_msg: Message) -> None: ... + def Clear(self) -> None: ... + def SetInParent(self) -> None: ... + def IsInitialized(self) -> bool: ... + def MergeFromString(self, serialized: Any) -> int: ... # TODO: we need to be able to call buffer() on serialized + def ParseFromString(self, serialized: Any) -> None: ... + def SerializeToString(self, deterministic: bool = ...) -> bytes: ... + def SerializePartialToString(self, deterministic: bool = ...) -> bytes: ... + def ListFields(self) -> Sequence[Tuple[FieldDescriptor, Any]]: ... + def HasExtension(self, extension_handle): ... + def ClearExtension(self, extension_handle): ... + def ByteSize(self) -> int: ... + @property + def Extensions(self) -> _ExtensionDict: ... + + # Intentionally left out typing on these three methods, because they are + # stringly typed and it is not useful to call them on a Message directly. + # We prefer more specific typing on individual subclasses of Message + # See https://github.com/dropbox/mypy-protobuf/issues/62 for details + def HasField(self, field_name: Any) -> bool: ... + def ClearField(self, field_name: Any) -> None: ... + def WhichOneof(self, oneof_group: Any) -> Any: ... + + # TODO: check kwargs + def __init__(self, **kwargs) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/message_factory.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/message_factory.pyi new file mode 100644 index 0000000..ad31e22 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/message_factory.pyi @@ -0,0 +1,13 @@ +from typing import Any, Dict, Iterable, Optional, Type + +from .message import Message +from .descriptor import Descriptor +from .descriptor_pool import DescriptorPool + +class MessageFactory: + pool: Any + def __init__(self, pool: Optional[DescriptorPool] = ...) -> None: ... + def GetPrototype(self, descriptor: Descriptor) -> Type[Message]: ... + def GetMessages(self, files: Iterable[bytes]) -> Dict[bytes, Type[Message]]: ... + +def GetMessages(file_protos: Iterable[bytes]) -> Dict[bytes, Type[Message]]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/reflection.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/reflection.pyi new file mode 100644 index 0000000..3ca5055 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/reflection.pyi @@ -0,0 +1,6 @@ +class GeneratedProtocolMessageType(type): + def __new__(cls, name, bases, dictionary): ... + def __init__(self, name, bases, dictionary) -> None: ... + +def ParseMessage(descriptor, byte_str): ... +def MakeClass(descriptor): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/service.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/service.pyi new file mode 100644 index 0000000..4874d53 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/service.pyi @@ -0,0 +1,39 @@ +from concurrent.futures import Future +from typing import Callable, Optional, Text, Type + +from google.protobuf.descriptor import MethodDescriptor, ServiceDescriptor +from google.protobuf.message import Message + +class RpcException(Exception): ... + +class Service: + @staticmethod + def GetDescriptor() -> ServiceDescriptor: ... + def CallMethod( + self, + method_descriptor: MethodDescriptor, + rpc_controller: RpcController, + request: Message, + done: Optional[Callable[[Message], None]], + ) -> Optional[Future[Message]]: ... + def GetRequestClass(self, method_descriptor: MethodDescriptor) -> Type[Message]: ... + def GetResponseClass(self, method_descriptor: MethodDescriptor) -> Type[Message]: ... + +class RpcController: + def Reset(self) -> None: ... + def Failed(self) -> bool: ... + def ErrorText(self) -> Optional[Text]: ... + def StartCancel(self) -> None: ... + def SetFailed(self, reason: Text) -> None: ... + def IsCanceled(self) -> bool: ... + def NotifyOnCancel(self, callback: Callable[[], None]) -> None: ... + +class RpcChannel: + def CallMethod( + self, + method_descriptor: MethodDescriptor, + rpc_controller: RpcController, + request: Message, + response_class: Type[Message], + done: Optional[Callable[[Message], None]], + ) -> Optional[Future[Message]]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/source_context_pb2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/source_context_pb2.pyi new file mode 100644 index 0000000..527ac1a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/source_context_pb2.pyi @@ -0,0 +1,18 @@ +from google.protobuf.message import ( + Message, +) +from typing import ( + Optional, + Text, +) + + +class SourceContext(Message): + file_name: Text + + def __init__(self, + file_name: Optional[Text] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> SourceContext: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/struct_pb2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/struct_pb2.pyi new file mode 100644 index 0000000..21afcc7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/struct_pb2.pyi @@ -0,0 +1,105 @@ +from google.protobuf.internal.containers import ( + RepeatedCompositeFieldContainer, +) +from google.protobuf.internal import well_known_types + +from google.protobuf.message import ( + Message, +) +from typing import ( + Iterable, + List, + Mapping, + MutableMapping, + Optional, + Text, + Tuple, + cast, +) + + +class NullValue(int): + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> NullValue: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[NullValue]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, NullValue]]: ... + + +NULL_VALUE: NullValue + + +class Struct(Message, well_known_types.Struct): + class FieldsEntry(Message): + key: Text + + @property + def value(self) -> Value: ... + + def __init__(self, + key: Optional[Text] = ..., + value: Optional[Value] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> Struct.FieldsEntry: ... + + @property + def fields(self) -> MutableMapping[Text, Value]: ... + + def __init__(self, + fields: Optional[Mapping[Text, Value]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> Struct: ... + + +class _Value(Message): + null_value: NullValue + number_value: float + string_value: Text + bool_value: bool + + @property + def struct_value(self) -> Struct: ... + + @property + def list_value(self) -> ListValue: ... + + def __init__(self, + null_value: Optional[NullValue] = ..., + number_value: Optional[float] = ..., + string_value: Optional[Text] = ..., + bool_value: Optional[bool] = ..., + struct_value: Optional[Struct] = ..., + list_value: Optional[ListValue] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> _Value: ... + + +Value = _Value + + +class ListValue(Message, well_known_types.ListValue): + + @property + def values(self) -> RepeatedCompositeFieldContainer[Value]: ... + + def __init__(self, + values: Optional[Iterable[Value]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> ListValue: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/symbol_database.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/symbol_database.pyi new file mode 100644 index 0000000..477d80e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/symbol_database.pyi @@ -0,0 +1,14 @@ +from typing import Dict, Iterable, Type + +from .descriptor import EnumDescriptor, FileDescriptor +from .message import Message +from .message_factory import MessageFactory + +class SymbolDatabase(MessageFactory): + def RegisterMessage(self, message: Type[Message]) -> Type[Message]: ... + def RegisterEnumDescriptor(self, enum_descriptor: Type[EnumDescriptor]) -> EnumDescriptor: ... + def RegisterFileDescriptor(self, file_descriptor: Type[FileDescriptor]) -> FileDescriptor: ... + def GetSymbol(self, symbol: bytes) -> Type[Message]: ... + def GetMessages(self, files: Iterable[bytes]) -> Dict[bytes, Type[Message]]: ... + +def Default(): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/test_messages_proto2_pb2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/test_messages_proto2_pb2.pyi new file mode 100644 index 0000000..03e34be --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/test_messages_proto2_pb2.pyi @@ -0,0 +1,627 @@ +from google.protobuf.internal.containers import ( + RepeatedCompositeFieldContainer, + RepeatedScalarFieldContainer, +) +from google.protobuf.message import ( + Message, +) +import builtins +from typing import ( + Iterable, + List, + Mapping, + MutableMapping, + Optional, + Text, + Tuple, + cast, +) + + +class ForeignEnumProto2(int): + + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> ForeignEnumProto2: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[ForeignEnumProto2]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, ForeignEnumProto2]]: ... + + +FOREIGN_FOO: ForeignEnumProto2 +FOREIGN_BAR: ForeignEnumProto2 +FOREIGN_BAZ: ForeignEnumProto2 + + +class TestAllTypesProto2(Message): + + class NestedEnum(int): + + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> TestAllTypesProto2.NestedEnum: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[TestAllTypesProto2.NestedEnum]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, TestAllTypesProto2.NestedEnum]]: ... + FOO: TestAllTypesProto2.NestedEnum + BAR: TestAllTypesProto2.NestedEnum + BAZ: TestAllTypesProto2.NestedEnum + NEG: TestAllTypesProto2.NestedEnum + + class NestedMessage(Message): + a: int + + @property + def corecursive(self) -> TestAllTypesProto2: ... + + def __init__(self, + a: Optional[int] = ..., + corecursive: Optional[TestAllTypesProto2] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllTypesProto2.NestedMessage: ... + + class MapInt32Int32Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestAllTypesProto2.MapInt32Int32Entry: ... + + class MapInt64Int64Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestAllTypesProto2.MapInt64Int64Entry: ... + + class MapUint32Uint32Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestAllTypesProto2.MapUint32Uint32Entry: ... + + class MapUint64Uint64Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestAllTypesProto2.MapUint64Uint64Entry: ... + + class MapSint32Sint32Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestAllTypesProto2.MapSint32Sint32Entry: ... + + class MapSint64Sint64Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestAllTypesProto2.MapSint64Sint64Entry: ... + + class MapFixed32Fixed32Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestAllTypesProto2.MapFixed32Fixed32Entry: ... + + class MapFixed64Fixed64Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestAllTypesProto2.MapFixed64Fixed64Entry: ... + + class MapSfixed32Sfixed32Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestAllTypesProto2.MapSfixed32Sfixed32Entry: ... + + class MapSfixed64Sfixed64Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestAllTypesProto2.MapSfixed64Sfixed64Entry: ... + + class MapInt32FloatEntry(Message): + key: int + value: float + + def __init__(self, + key: Optional[int] = ..., + value: Optional[float] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestAllTypesProto2.MapInt32FloatEntry: ... + + class MapInt32DoubleEntry(Message): + key: int + value: float + + def __init__(self, + key: Optional[int] = ..., + value: Optional[float] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestAllTypesProto2.MapInt32DoubleEntry: ... + + class MapBoolBoolEntry(Message): + key: bool + value: bool + + def __init__(self, + key: Optional[bool] = ..., + value: Optional[bool] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllTypesProto2.MapBoolBoolEntry: ... + + class MapStringStringEntry(Message): + key: Text + value: Text + + def __init__(self, + key: Optional[Text] = ..., + value: Optional[Text] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestAllTypesProto2.MapStringStringEntry: ... + + class MapStringBytesEntry(Message): + key: Text + value: bytes + + def __init__(self, + key: Optional[Text] = ..., + value: Optional[bytes] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestAllTypesProto2.MapStringBytesEntry: ... + + class MapStringNestedMessageEntry(Message): + key: Text + + @property + def value(self) -> TestAllTypesProto2.NestedMessage: ... + + def __init__(self, + key: Optional[Text] = ..., + value: Optional[TestAllTypesProto2.NestedMessage] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestAllTypesProto2.MapStringNestedMessageEntry: ... + + class MapStringForeignMessageEntry(Message): + key: Text + + @property + def value(self) -> ForeignMessageProto2: ... + + def __init__(self, + key: Optional[Text] = ..., + value: Optional[ForeignMessageProto2] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestAllTypesProto2.MapStringForeignMessageEntry: ... + + class MapStringNestedEnumEntry(Message): + key: Text + value: TestAllTypesProto2.NestedEnum + + def __init__(self, + key: Optional[Text] = ..., + value: Optional[TestAllTypesProto2.NestedEnum] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestAllTypesProto2.MapStringNestedEnumEntry: ... + + class MapStringForeignEnumEntry(Message): + key: Text + value: ForeignEnumProto2 + + def __init__(self, + key: Optional[Text] = ..., + value: Optional[ForeignEnumProto2] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestAllTypesProto2.MapStringForeignEnumEntry: ... + + class Data(Message): + group_int32: int + group_uint32: int + + def __init__(self, + group_int32: Optional[int] = ..., + group_uint32: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllTypesProto2.Data: ... + + class MessageSetCorrect(Message): + + def __init__(self, + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestAllTypesProto2.MessageSetCorrect: ... + + class MessageSetCorrectExtension1(Message): + bytes: Text + + def __init__(self, + bytes: Optional[Text] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: builtins.bytes) -> TestAllTypesProto2.MessageSetCorrectExtension1: ... + + class MessageSetCorrectExtension2(Message): + i: int + + def __init__(self, + i: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestAllTypesProto2.MessageSetCorrectExtension2: ... + optional_int32: int + optional_int64: int + optional_uint32: int + optional_uint64: int + optional_sint32: int + optional_sint64: int + optional_fixed32: int + optional_fixed64: int + optional_sfixed32: int + optional_sfixed64: int + optional_float: float + optional_double: float + optional_bool: bool + optional_string: Text + optional_bytes: bytes + optional_nested_enum: TestAllTypesProto2.NestedEnum + optional_foreign_enum: ForeignEnumProto2 + optional_string_piece: Text + optional_cord: Text + repeated_int32: RepeatedScalarFieldContainer[int] + repeated_int64: RepeatedScalarFieldContainer[int] + repeated_uint32: RepeatedScalarFieldContainer[int] + repeated_uint64: RepeatedScalarFieldContainer[int] + repeated_sint32: RepeatedScalarFieldContainer[int] + repeated_sint64: RepeatedScalarFieldContainer[int] + repeated_fixed32: RepeatedScalarFieldContainer[int] + repeated_fixed64: RepeatedScalarFieldContainer[int] + repeated_sfixed32: RepeatedScalarFieldContainer[int] + repeated_sfixed64: RepeatedScalarFieldContainer[int] + repeated_float: RepeatedScalarFieldContainer[float] + repeated_double: RepeatedScalarFieldContainer[float] + repeated_bool: RepeatedScalarFieldContainer[bool] + repeated_string: RepeatedScalarFieldContainer[Text] + repeated_bytes: RepeatedScalarFieldContainer[bytes] + repeated_nested_enum: RepeatedScalarFieldContainer[TestAllTypesProto2.NestedEnum] + repeated_foreign_enum: RepeatedScalarFieldContainer[ForeignEnumProto2] + repeated_string_piece: RepeatedScalarFieldContainer[Text] + repeated_cord: RepeatedScalarFieldContainer[Text] + oneof_uint32: int + oneof_string: Text + oneof_bytes: bytes + oneof_bool: bool + oneof_uint64: int + oneof_float: float + oneof_double: float + oneof_enum: TestAllTypesProto2.NestedEnum + fieldname1: int + field_name2: int + _field_name3: int + field__name4_: int + field0name5: int + field_0_name6: int + fieldName7: int + FieldName8: int + field_Name9: int + Field_Name10: int + FIELD_NAME11: int + FIELD_name12: int + __field_name13: int + __Field_name14: int + field__name15: int + field__Name16: int + field_name17__: int + Field_name18__: int + + @property + def optional_nested_message(self) -> TestAllTypesProto2.NestedMessage: ... + + @property + def optional_foreign_message(self) -> ForeignMessageProto2: ... + + @property + def recursive_message(self) -> TestAllTypesProto2: ... + + @property + def repeated_nested_message( + self) -> RepeatedCompositeFieldContainer[TestAllTypesProto2.NestedMessage]: ... + + @property + def repeated_foreign_message( + self) -> RepeatedCompositeFieldContainer[ForeignMessageProto2]: ... + + @property + def map_int32_int32(self) -> MutableMapping[int, int]: ... + + @property + def map_int64_int64(self) -> MutableMapping[int, int]: ... + + @property + def map_uint32_uint32(self) -> MutableMapping[int, int]: ... + + @property + def map_uint64_uint64(self) -> MutableMapping[int, int]: ... + + @property + def map_sint32_sint32(self) -> MutableMapping[int, int]: ... + + @property + def map_sint64_sint64(self) -> MutableMapping[int, int]: ... + + @property + def map_fixed32_fixed32(self) -> MutableMapping[int, int]: ... + + @property + def map_fixed64_fixed64(self) -> MutableMapping[int, int]: ... + + @property + def map_sfixed32_sfixed32(self) -> MutableMapping[int, int]: ... + + @property + def map_sfixed64_sfixed64(self) -> MutableMapping[int, int]: ... + + @property + def map_int32_float(self) -> MutableMapping[int, float]: ... + + @property + def map_int32_double(self) -> MutableMapping[int, float]: ... + + @property + def map_bool_bool(self) -> MutableMapping[bool, bool]: ... + + @property + def map_string_string(self) -> MutableMapping[Text, Text]: ... + + @property + def map_string_bytes(self) -> MutableMapping[Text, bytes]: ... + + @property + def map_string_nested_message( + self) -> MutableMapping[Text, TestAllTypesProto2.NestedMessage]: ... + + @property + def map_string_foreign_message( + self) -> MutableMapping[Text, ForeignMessageProto2]: ... + + @property + def map_string_nested_enum( + self) -> MutableMapping[Text, TestAllTypesProto2.NestedEnum]: ... + + @property + def map_string_foreign_enum( + self) -> MutableMapping[Text, ForeignEnumProto2]: ... + + @property + def oneof_nested_message(self) -> TestAllTypesProto2.NestedMessage: ... + + @property + def data(self) -> TestAllTypesProto2.Data: ... + + def __init__(self, + optional_int32: Optional[int] = ..., + optional_int64: Optional[int] = ..., + optional_uint32: Optional[int] = ..., + optional_uint64: Optional[int] = ..., + optional_sint32: Optional[int] = ..., + optional_sint64: Optional[int] = ..., + optional_fixed32: Optional[int] = ..., + optional_fixed64: Optional[int] = ..., + optional_sfixed32: Optional[int] = ..., + optional_sfixed64: Optional[int] = ..., + optional_float: Optional[float] = ..., + optional_double: Optional[float] = ..., + optional_bool: Optional[bool] = ..., + optional_string: Optional[Text] = ..., + optional_bytes: Optional[bytes] = ..., + optional_nested_message: Optional[TestAllTypesProto2.NestedMessage] = ..., + optional_foreign_message: Optional[ForeignMessageProto2] = ..., + optional_nested_enum: Optional[TestAllTypesProto2.NestedEnum] = ..., + optional_foreign_enum: Optional[ForeignEnumProto2] = ..., + optional_string_piece: Optional[Text] = ..., + optional_cord: Optional[Text] = ..., + recursive_message: Optional[TestAllTypesProto2] = ..., + repeated_int32: Optional[Iterable[int]] = ..., + repeated_int64: Optional[Iterable[int]] = ..., + repeated_uint32: Optional[Iterable[int]] = ..., + repeated_uint64: Optional[Iterable[int]] = ..., + repeated_sint32: Optional[Iterable[int]] = ..., + repeated_sint64: Optional[Iterable[int]] = ..., + repeated_fixed32: Optional[Iterable[int]] = ..., + repeated_fixed64: Optional[Iterable[int]] = ..., + repeated_sfixed32: Optional[Iterable[int]] = ..., + repeated_sfixed64: Optional[Iterable[int]] = ..., + repeated_float: Optional[Iterable[float]] = ..., + repeated_double: Optional[Iterable[float]] = ..., + repeated_bool: Optional[Iterable[bool]] = ..., + repeated_string: Optional[Iterable[Text]] = ..., + repeated_bytes: Optional[Iterable[bytes]] = ..., + repeated_nested_message: Optional[Iterable[TestAllTypesProto2.NestedMessage]] = ..., + repeated_foreign_message: Optional[Iterable[ForeignMessageProto2]] = ..., + repeated_nested_enum: Optional[Iterable[TestAllTypesProto2.NestedEnum]] = ..., + repeated_foreign_enum: Optional[Iterable[ForeignEnumProto2]] = ..., + repeated_string_piece: Optional[Iterable[Text]] = ..., + repeated_cord: Optional[Iterable[Text]] = ..., + map_int32_int32: Optional[Mapping[int, int]] = ..., + map_int64_int64: Optional[Mapping[int, int]] = ..., + map_uint32_uint32: Optional[Mapping[int, int]] = ..., + map_uint64_uint64: Optional[Mapping[int, int]] = ..., + map_sint32_sint32: Optional[Mapping[int, int]] = ..., + map_sint64_sint64: Optional[Mapping[int, int]] = ..., + map_fixed32_fixed32: Optional[Mapping[int, int]] = ..., + map_fixed64_fixed64: Optional[Mapping[int, int]] = ..., + map_sfixed32_sfixed32: Optional[Mapping[int, int]] = ..., + map_sfixed64_sfixed64: Optional[Mapping[int, int]] = ..., + map_int32_float: Optional[Mapping[int, float]] = ..., + map_int32_double: Optional[Mapping[int, float]] = ..., + map_bool_bool: Optional[Mapping[bool, bool]] = ..., + map_string_string: Optional[Mapping[Text, Text]] = ..., + map_string_bytes: Optional[Mapping[Text, bytes]] = ..., + map_string_nested_message: Optional[Mapping[Text, TestAllTypesProto2.NestedMessage]] = ..., + map_string_foreign_message: Optional[Mapping[Text, ForeignMessageProto2]] = ..., + map_string_nested_enum: Optional[Mapping[Text, TestAllTypesProto2.NestedEnum]] = ..., + map_string_foreign_enum: Optional[Mapping[Text, ForeignEnumProto2]] = ..., + oneof_uint32: Optional[int] = ..., + oneof_nested_message: Optional[TestAllTypesProto2.NestedMessage] = ..., + oneof_string: Optional[Text] = ..., + oneof_bytes: Optional[bytes] = ..., + oneof_bool: Optional[bool] = ..., + oneof_uint64: Optional[int] = ..., + oneof_float: Optional[float] = ..., + oneof_double: Optional[float] = ..., + oneof_enum: Optional[TestAllTypesProto2.NestedEnum] = ..., + data: Optional[TestAllTypesProto2.Data] = ..., + fieldname1: Optional[int] = ..., + field_name2: Optional[int] = ..., + _field_name3: Optional[int] = ..., + field__name4_: Optional[int] = ..., + field0name5: Optional[int] = ..., + field_0_name6: Optional[int] = ..., + fieldName7: Optional[int] = ..., + FieldName8: Optional[int] = ..., + field_Name9: Optional[int] = ..., + Field_Name10: Optional[int] = ..., + FIELD_NAME11: Optional[int] = ..., + FIELD_name12: Optional[int] = ..., + __field_name13: Optional[int] = ..., + __Field_name14: Optional[int] = ..., + field__name15: Optional[int] = ..., + field__Name16: Optional[int] = ..., + field_name17__: Optional[int] = ..., + Field_name18__: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllTypesProto2: ... + + +class ForeignMessageProto2(Message): + c: int + + def __init__(self, + c: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> ForeignMessageProto2: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/test_messages_proto3_pb2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/test_messages_proto3_pb2.pyi new file mode 100644 index 0000000..5a9cce3 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/test_messages_proto3_pb2.pyi @@ -0,0 +1,700 @@ +from google.protobuf.any_pb2 import ( + Any, +) +from google.protobuf.duration_pb2 import ( + Duration, +) +from google.protobuf.field_mask_pb2 import ( + FieldMask, +) +from google.protobuf.internal.containers import ( + RepeatedCompositeFieldContainer, + RepeatedScalarFieldContainer, +) +from google.protobuf.message import ( + Message, +) +from google.protobuf.struct_pb2 import ( + Struct, + Value, +) +from google.protobuf.timestamp_pb2 import ( + Timestamp, +) +from google.protobuf.wrappers_pb2 import ( + BoolValue, + BytesValue, + DoubleValue, + FloatValue, + Int32Value, + Int64Value, + StringValue, + UInt32Value, + UInt64Value, +) +from typing import ( + Iterable, + List, + Mapping, + MutableMapping, + Optional, + Text, + Tuple, + cast, +) + + +class ForeignEnum(int): + + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> ForeignEnum: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[ForeignEnum]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, ForeignEnum]]: ... +FOREIGN_FOO: ForeignEnum +FOREIGN_BAR: ForeignEnum +FOREIGN_BAZ: ForeignEnum + + +class TestAllTypesProto3(Message): + + class NestedEnum(int): + + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> TestAllTypesProto3.NestedEnum: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[TestAllTypesProto3.NestedEnum]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, TestAllTypesProto3.NestedEnum]]: ... + FOO: TestAllTypesProto3.NestedEnum + BAR: TestAllTypesProto3.NestedEnum + BAZ: TestAllTypesProto3.NestedEnum + NEG: TestAllTypesProto3.NestedEnum + + class NestedMessage(Message): + a: int + + @property + def corecursive(self) -> TestAllTypesProto3: ... + + def __init__(self, + a: Optional[int] = ..., + corecursive: Optional[TestAllTypesProto3] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllTypesProto3.NestedMessage: ... + + class MapInt32Int32Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllTypesProto3.MapInt32Int32Entry: ... + + class MapInt64Int64Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllTypesProto3.MapInt64Int64Entry: ... + + class MapUint32Uint32Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllTypesProto3.MapUint32Uint32Entry: ... + + class MapUint64Uint64Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllTypesProto3.MapUint64Uint64Entry: ... + + class MapSint32Sint32Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllTypesProto3.MapSint32Sint32Entry: ... + + class MapSint64Sint64Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllTypesProto3.MapSint64Sint64Entry: ... + + class MapFixed32Fixed32Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllTypesProto3.MapFixed32Fixed32Entry: ... + + class MapFixed64Fixed64Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllTypesProto3.MapFixed64Fixed64Entry: ... + + class MapSfixed32Sfixed32Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllTypesProto3.MapSfixed32Sfixed32Entry: ... + + class MapSfixed64Sfixed64Entry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllTypesProto3.MapSfixed64Sfixed64Entry: ... + + class MapInt32FloatEntry(Message): + key: int + value: float + + def __init__(self, + key: Optional[int] = ..., + value: Optional[float] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllTypesProto3.MapInt32FloatEntry: ... + + class MapInt32DoubleEntry(Message): + key: int + value: float + + def __init__(self, + key: Optional[int] = ..., + value: Optional[float] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllTypesProto3.MapInt32DoubleEntry: ... + + class MapBoolBoolEntry(Message): + key: bool + value: bool + + def __init__(self, + key: Optional[bool] = ..., + value: Optional[bool] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllTypesProto3.MapBoolBoolEntry: ... + + class MapStringStringEntry(Message): + key: Text + value: Text + + def __init__(self, + key: Optional[Text] = ..., + value: Optional[Text] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllTypesProto3.MapStringStringEntry: ... + + class MapStringBytesEntry(Message): + key: Text + value: bytes + + def __init__(self, + key: Optional[Text] = ..., + value: Optional[bytes] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllTypesProto3.MapStringBytesEntry: ... + + class MapStringNestedMessageEntry(Message): + key: Text + + @property + def value(self) -> TestAllTypesProto3.NestedMessage: ... + + def __init__(self, + key: Optional[Text] = ..., + value: Optional[TestAllTypesProto3.NestedMessage] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllTypesProto3.MapStringNestedMessageEntry: ... + + class MapStringForeignMessageEntry(Message): + key: Text + + @property + def value(self) -> ForeignMessage: ... + + def __init__(self, + key: Optional[Text] = ..., + value: Optional[ForeignMessage] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllTypesProto3.MapStringForeignMessageEntry: ... + + class MapStringNestedEnumEntry(Message): + key: Text + value: TestAllTypesProto3.NestedEnum + + def __init__(self, + key: Optional[Text] = ..., + value: Optional[TestAllTypesProto3.NestedEnum] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllTypesProto3.MapStringNestedEnumEntry: ... + + class MapStringForeignEnumEntry(Message): + key: Text + value: ForeignEnum + + def __init__(self, + key: Optional[Text] = ..., + value: Optional[ForeignEnum] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllTypesProto3.MapStringForeignEnumEntry: ... + optional_int32: int + optional_int64: int + optional_uint32: int + optional_uint64: int + optional_sint32: int + optional_sint64: int + optional_fixed32: int + optional_fixed64: int + optional_sfixed32: int + optional_sfixed64: int + optional_float: float + optional_double: float + optional_bool: bool + optional_string: Text + optional_bytes: bytes + optional_nested_enum: TestAllTypesProto3.NestedEnum + optional_foreign_enum: ForeignEnum + optional_string_piece: Text + optional_cord: Text + repeated_int32: RepeatedScalarFieldContainer[int] + repeated_int64: RepeatedScalarFieldContainer[int] + repeated_uint32: RepeatedScalarFieldContainer[int] + repeated_uint64: RepeatedScalarFieldContainer[int] + repeated_sint32: RepeatedScalarFieldContainer[int] + repeated_sint64: RepeatedScalarFieldContainer[int] + repeated_fixed32: RepeatedScalarFieldContainer[int] + repeated_fixed64: RepeatedScalarFieldContainer[int] + repeated_sfixed32: RepeatedScalarFieldContainer[int] + repeated_sfixed64: RepeatedScalarFieldContainer[int] + repeated_float: RepeatedScalarFieldContainer[float] + repeated_double: RepeatedScalarFieldContainer[float] + repeated_bool: RepeatedScalarFieldContainer[bool] + repeated_string: RepeatedScalarFieldContainer[Text] + repeated_bytes: RepeatedScalarFieldContainer[bytes] + repeated_nested_enum: RepeatedScalarFieldContainer[TestAllTypesProto3.NestedEnum] + repeated_foreign_enum: RepeatedScalarFieldContainer[ForeignEnum] + repeated_string_piece: RepeatedScalarFieldContainer[Text] + repeated_cord: RepeatedScalarFieldContainer[Text] + oneof_uint32: int + oneof_string: Text + oneof_bytes: bytes + oneof_bool: bool + oneof_uint64: int + oneof_float: float + oneof_double: float + oneof_enum: TestAllTypesProto3.NestedEnum + fieldname1: int + field_name2: int + _field_name3: int + field__name4_: int + field0name5: int + field_0_name6: int + fieldName7: int + FieldName8: int + field_Name9: int + Field_Name10: int + FIELD_NAME11: int + FIELD_name12: int + __field_name13: int + __Field_name14: int + field__name15: int + field__Name16: int + field_name17__: int + Field_name18__: int + + @property + def optional_nested_message(self) -> TestAllTypesProto3.NestedMessage: ... + + @property + def optional_foreign_message(self) -> ForeignMessage: ... + + @property + def recursive_message(self) -> TestAllTypesProto3: ... + + @property + def repeated_nested_message(self) -> RepeatedCompositeFieldContainer[TestAllTypesProto3.NestedMessage]: ... + + @property + def repeated_foreign_message(self) -> RepeatedCompositeFieldContainer[ForeignMessage]: ... + + @property + def map_int32_int32(self) -> MutableMapping[int, int]: ... + + @property + def map_int64_int64(self) -> MutableMapping[int, int]: ... + + @property + def map_uint32_uint32(self) -> MutableMapping[int, int]: ... + + @property + def map_uint64_uint64(self) -> MutableMapping[int, int]: ... + + @property + def map_sint32_sint32(self) -> MutableMapping[int, int]: ... + + @property + def map_sint64_sint64(self) -> MutableMapping[int, int]: ... + + @property + def map_fixed32_fixed32(self) -> MutableMapping[int, int]: ... + + @property + def map_fixed64_fixed64(self) -> MutableMapping[int, int]: ... + + @property + def map_sfixed32_sfixed32(self) -> MutableMapping[int, int]: ... + + @property + def map_sfixed64_sfixed64(self) -> MutableMapping[int, int]: ... + + @property + def map_int32_float(self) -> MutableMapping[int, float]: ... + + @property + def map_int32_double(self) -> MutableMapping[int, float]: ... + + @property + def map_bool_bool(self) -> MutableMapping[bool, bool]: ... + + @property + def map_string_string(self) -> MutableMapping[Text, Text]: ... + + @property + def map_string_bytes(self) -> MutableMapping[Text, bytes]: ... + + @property + def map_string_nested_message(self) -> MutableMapping[Text, TestAllTypesProto3.NestedMessage]: ... + + @property + def map_string_foreign_message(self) -> MutableMapping[Text, ForeignMessage]: ... + + @property + def map_string_nested_enum(self) -> MutableMapping[Text, TestAllTypesProto3.NestedEnum]: ... + + @property + def map_string_foreign_enum(self) -> MutableMapping[Text, ForeignEnum]: ... + + @property + def oneof_nested_message(self) -> TestAllTypesProto3.NestedMessage: ... + + @property + def optional_bool_wrapper(self) -> BoolValue: ... + + @property + def optional_int32_wrapper(self) -> Int32Value: ... + + @property + def optional_int64_wrapper(self) -> Int64Value: ... + + @property + def optional_uint32_wrapper(self) -> UInt32Value: ... + + @property + def optional_uint64_wrapper(self) -> UInt64Value: ... + + @property + def optional_float_wrapper(self) -> FloatValue: ... + + @property + def optional_double_wrapper(self) -> DoubleValue: ... + + @property + def optional_string_wrapper(self) -> StringValue: ... + + @property + def optional_bytes_wrapper(self) -> BytesValue: ... + + @property + def repeated_bool_wrapper(self) -> RepeatedCompositeFieldContainer[BoolValue]: ... + + @property + def repeated_int32_wrapper(self) -> RepeatedCompositeFieldContainer[Int32Value]: ... + + @property + def repeated_int64_wrapper(self) -> RepeatedCompositeFieldContainer[Int64Value]: ... + + @property + def repeated_uint32_wrapper(self) -> RepeatedCompositeFieldContainer[UInt32Value]: ... + + @property + def repeated_uint64_wrapper(self) -> RepeatedCompositeFieldContainer[UInt64Value]: ... + + @property + def repeated_float_wrapper(self) -> RepeatedCompositeFieldContainer[FloatValue]: ... + + @property + def repeated_double_wrapper(self) -> RepeatedCompositeFieldContainer[DoubleValue]: ... + + @property + def repeated_string_wrapper(self) -> RepeatedCompositeFieldContainer[StringValue]: ... + + @property + def repeated_bytes_wrapper(self) -> RepeatedCompositeFieldContainer[BytesValue]: ... + + @property + def optional_duration(self) -> Duration: ... + + @property + def optional_timestamp(self) -> Timestamp: ... + + @property + def optional_field_mask(self) -> FieldMask: ... + + @property + def optional_struct(self) -> Struct: ... + + @property + def optional_any(self) -> Any: ... + + @property + def optional_value(self) -> Value: ... + + @property + def repeated_duration(self) -> RepeatedCompositeFieldContainer[Duration]: ... + + @property + def repeated_timestamp(self) -> RepeatedCompositeFieldContainer[Timestamp]: ... + + @property + def repeated_fieldmask(self) -> RepeatedCompositeFieldContainer[FieldMask]: ... + + @property + def repeated_struct(self) -> RepeatedCompositeFieldContainer[Struct]: ... + + @property + def repeated_any(self) -> RepeatedCompositeFieldContainer[Any]: ... + + @property + def repeated_value(self) -> RepeatedCompositeFieldContainer[Value]: ... + + def __init__(self, + optional_int32: Optional[int] = ..., + optional_int64: Optional[int] = ..., + optional_uint32: Optional[int] = ..., + optional_uint64: Optional[int] = ..., + optional_sint32: Optional[int] = ..., + optional_sint64: Optional[int] = ..., + optional_fixed32: Optional[int] = ..., + optional_fixed64: Optional[int] = ..., + optional_sfixed32: Optional[int] = ..., + optional_sfixed64: Optional[int] = ..., + optional_float: Optional[float] = ..., + optional_double: Optional[float] = ..., + optional_bool: Optional[bool] = ..., + optional_string: Optional[Text] = ..., + optional_bytes: Optional[bytes] = ..., + optional_nested_message: Optional[TestAllTypesProto3.NestedMessage] = ..., + optional_foreign_message: Optional[ForeignMessage] = ..., + optional_nested_enum: Optional[TestAllTypesProto3.NestedEnum] = ..., + optional_foreign_enum: Optional[ForeignEnum] = ..., + optional_string_piece: Optional[Text] = ..., + optional_cord: Optional[Text] = ..., + recursive_message: Optional[TestAllTypesProto3] = ..., + repeated_int32: Optional[Iterable[int]] = ..., + repeated_int64: Optional[Iterable[int]] = ..., + repeated_uint32: Optional[Iterable[int]] = ..., + repeated_uint64: Optional[Iterable[int]] = ..., + repeated_sint32: Optional[Iterable[int]] = ..., + repeated_sint64: Optional[Iterable[int]] = ..., + repeated_fixed32: Optional[Iterable[int]] = ..., + repeated_fixed64: Optional[Iterable[int]] = ..., + repeated_sfixed32: Optional[Iterable[int]] = ..., + repeated_sfixed64: Optional[Iterable[int]] = ..., + repeated_float: Optional[Iterable[float]] = ..., + repeated_double: Optional[Iterable[float]] = ..., + repeated_bool: Optional[Iterable[bool]] = ..., + repeated_string: Optional[Iterable[Text]] = ..., + repeated_bytes: Optional[Iterable[bytes]] = ..., + repeated_nested_message: Optional[Iterable[TestAllTypesProto3.NestedMessage]] = ..., + repeated_foreign_message: Optional[Iterable[ForeignMessage]] = ..., + repeated_nested_enum: Optional[Iterable[TestAllTypesProto3.NestedEnum]] = ..., + repeated_foreign_enum: Optional[Iterable[ForeignEnum]] = ..., + repeated_string_piece: Optional[Iterable[Text]] = ..., + repeated_cord: Optional[Iterable[Text]] = ..., + map_int32_int32: Optional[Mapping[int, int]] = ..., + map_int64_int64: Optional[Mapping[int, int]] = ..., + map_uint32_uint32: Optional[Mapping[int, int]] = ..., + map_uint64_uint64: Optional[Mapping[int, int]] = ..., + map_sint32_sint32: Optional[Mapping[int, int]] = ..., + map_sint64_sint64: Optional[Mapping[int, int]] = ..., + map_fixed32_fixed32: Optional[Mapping[int, int]] = ..., + map_fixed64_fixed64: Optional[Mapping[int, int]] = ..., + map_sfixed32_sfixed32: Optional[Mapping[int, int]] = ..., + map_sfixed64_sfixed64: Optional[Mapping[int, int]] = ..., + map_int32_float: Optional[Mapping[int, float]] = ..., + map_int32_double: Optional[Mapping[int, float]] = ..., + map_bool_bool: Optional[Mapping[bool, bool]] = ..., + map_string_string: Optional[Mapping[Text, Text]] = ..., + map_string_bytes: Optional[Mapping[Text, bytes]] = ..., + map_string_nested_message: Optional[Mapping[Text, TestAllTypesProto3.NestedMessage]] = ..., + map_string_foreign_message: Optional[Mapping[Text, ForeignMessage]] = ..., + map_string_nested_enum: Optional[Mapping[Text, TestAllTypesProto3.NestedEnum]] = ..., + map_string_foreign_enum: Optional[Mapping[Text, ForeignEnum]] = ..., + oneof_uint32: Optional[int] = ..., + oneof_nested_message: Optional[TestAllTypesProto3.NestedMessage] = ..., + oneof_string: Optional[Text] = ..., + oneof_bytes: Optional[bytes] = ..., + oneof_bool: Optional[bool] = ..., + oneof_uint64: Optional[int] = ..., + oneof_float: Optional[float] = ..., + oneof_double: Optional[float] = ..., + oneof_enum: Optional[TestAllTypesProto3.NestedEnum] = ..., + optional_bool_wrapper: Optional[BoolValue] = ..., + optional_int32_wrapper: Optional[Int32Value] = ..., + optional_int64_wrapper: Optional[Int64Value] = ..., + optional_uint32_wrapper: Optional[UInt32Value] = ..., + optional_uint64_wrapper: Optional[UInt64Value] = ..., + optional_float_wrapper: Optional[FloatValue] = ..., + optional_double_wrapper: Optional[DoubleValue] = ..., + optional_string_wrapper: Optional[StringValue] = ..., + optional_bytes_wrapper: Optional[BytesValue] = ..., + repeated_bool_wrapper: Optional[Iterable[BoolValue]] = ..., + repeated_int32_wrapper: Optional[Iterable[Int32Value]] = ..., + repeated_int64_wrapper: Optional[Iterable[Int64Value]] = ..., + repeated_uint32_wrapper: Optional[Iterable[UInt32Value]] = ..., + repeated_uint64_wrapper: Optional[Iterable[UInt64Value]] = ..., + repeated_float_wrapper: Optional[Iterable[FloatValue]] = ..., + repeated_double_wrapper: Optional[Iterable[DoubleValue]] = ..., + repeated_string_wrapper: Optional[Iterable[StringValue]] = ..., + repeated_bytes_wrapper: Optional[Iterable[BytesValue]] = ..., + optional_duration: Optional[Duration] = ..., + optional_timestamp: Optional[Timestamp] = ..., + optional_field_mask: Optional[FieldMask] = ..., + optional_struct: Optional[Struct] = ..., + optional_any: Optional[Any] = ..., + optional_value: Optional[Value] = ..., + repeated_duration: Optional[Iterable[Duration]] = ..., + repeated_timestamp: Optional[Iterable[Timestamp]] = ..., + repeated_fieldmask: Optional[Iterable[FieldMask]] = ..., + repeated_struct: Optional[Iterable[Struct]] = ..., + repeated_any: Optional[Iterable[Any]] = ..., + repeated_value: Optional[Iterable[Value]] = ..., + fieldname1: Optional[int] = ..., + field_name2: Optional[int] = ..., + _field_name3: Optional[int] = ..., + field__name4_: Optional[int] = ..., + field0name5: Optional[int] = ..., + field_0_name6: Optional[int] = ..., + fieldName7: Optional[int] = ..., + FieldName8: Optional[int] = ..., + field_Name9: Optional[int] = ..., + Field_Name10: Optional[int] = ..., + FIELD_NAME11: Optional[int] = ..., + FIELD_name12: Optional[int] = ..., + __field_name13: Optional[int] = ..., + __Field_name14: Optional[int] = ..., + field__name15: Optional[int] = ..., + field__Name16: Optional[int] = ..., + field_name17__: Optional[int] = ..., + Field_name18__: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllTypesProto3: ... + + +class ForeignMessage(Message): + c: int + + def __init__(self, + c: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> ForeignMessage: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/timestamp_pb2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/timestamp_pb2.pyi new file mode 100644 index 0000000..77ae305 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/timestamp_pb2.pyi @@ -0,0 +1,21 @@ +from google.protobuf.message import ( + Message, +) +from google.protobuf.internal import well_known_types + +from typing import ( + Optional, +) + + +class Timestamp(Message, well_known_types.Timestamp): + seconds: int + nanos: int + + def __init__(self, + seconds: Optional[int] = ..., + nanos: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> Timestamp: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/type_pb2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/type_pb2.pyi new file mode 100644 index 0000000..e3ff9b1 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/type_pb2.pyi @@ -0,0 +1,215 @@ +from google.protobuf.any_pb2 import ( + Any, +) +from google.protobuf.internal.containers import ( + RepeatedCompositeFieldContainer, + RepeatedScalarFieldContainer, +) +from google.protobuf.message import ( + Message, +) +from google.protobuf.source_context_pb2 import ( + SourceContext, +) +from typing import ( + Iterable, + List, + Optional, + Text, + Tuple, + cast, +) + + +class Syntax(int): + + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> Syntax: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[Syntax]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, Syntax]]: ... + + +SYNTAX_PROTO2: Syntax +SYNTAX_PROTO3: Syntax + + +class Type(Message): + name: Text + oneofs: RepeatedScalarFieldContainer[Text] + syntax: Syntax + + @property + def fields(self) -> RepeatedCompositeFieldContainer[Field]: ... + + @property + def options(self) -> RepeatedCompositeFieldContainer[Option]: ... + + @property + def source_context(self) -> SourceContext: ... + + def __init__(self, + name: Optional[Text] = ..., + fields: Optional[Iterable[Field]] = ..., + oneofs: Optional[Iterable[Text]] = ..., + options: Optional[Iterable[Option]] = ..., + source_context: Optional[SourceContext] = ..., + syntax: Optional[Syntax] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> Type: ... + + +class Field(Message): + + class Kind(int): + + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> Field.Kind: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[Field.Kind]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, Field.Kind]]: ... + TYPE_UNKNOWN: Field.Kind + TYPE_DOUBLE: Field.Kind + TYPE_FLOAT: Field.Kind + TYPE_INT64: Field.Kind + TYPE_UINT64: Field.Kind + TYPE_INT32: Field.Kind + TYPE_FIXED64: Field.Kind + TYPE_FIXED32: Field.Kind + TYPE_BOOL: Field.Kind + TYPE_STRING: Field.Kind + TYPE_GROUP: Field.Kind + TYPE_MESSAGE: Field.Kind + TYPE_BYTES: Field.Kind + TYPE_UINT32: Field.Kind + TYPE_ENUM: Field.Kind + TYPE_SFIXED32: Field.Kind + TYPE_SFIXED64: Field.Kind + TYPE_SINT32: Field.Kind + TYPE_SINT64: Field.Kind + + class Cardinality(int): + + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> Field.Cardinality: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[Field.Cardinality]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, Field.Cardinality]]: ... + CARDINALITY_UNKNOWN: Field.Cardinality + CARDINALITY_OPTIONAL: Field.Cardinality + CARDINALITY_REQUIRED: Field.Cardinality + CARDINALITY_REPEATED: Field.Cardinality + kind: Field.Kind + cardinality: Field.Cardinality + number: int + name: Text + type_url: Text + oneof_index: int + packed: bool + json_name: Text + default_value: Text + + @property + def options(self) -> RepeatedCompositeFieldContainer[Option]: ... + + def __init__(self, + kind: Optional[Field.Kind] = ..., + cardinality: Optional[Field.Cardinality] = ..., + number: Optional[int] = ..., + name: Optional[Text] = ..., + type_url: Optional[Text] = ..., + oneof_index: Optional[int] = ..., + packed: Optional[bool] = ..., + options: Optional[Iterable[Option]] = ..., + json_name: Optional[Text] = ..., + default_value: Optional[Text] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> Field: ... + + +class Enum(Message): + name: Text + syntax: Syntax + + @property + def enumvalue(self) -> RepeatedCompositeFieldContainer[EnumValue]: ... + + @property + def options(self) -> RepeatedCompositeFieldContainer[Option]: ... + + @property + def source_context(self) -> SourceContext: ... + + def __init__(self, + name: Optional[Text] = ..., + enumvalue: Optional[Iterable[EnumValue]] = ..., + options: Optional[Iterable[Option]] = ..., + source_context: Optional[SourceContext] = ..., + syntax: Optional[Syntax] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> Enum: ... + + +class EnumValue(Message): + name: Text + number: int + + @property + def options(self) -> RepeatedCompositeFieldContainer[Option]: ... + + def __init__(self, + name: Optional[Text] = ..., + number: Optional[int] = ..., + options: Optional[Iterable[Option]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> EnumValue: ... + + +class Option(Message): + name: Text + + @property + def value(self) -> Any: ... + + def __init__(self, + name: Optional[Text] = ..., + value: Optional[Any] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> Option: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_arena_pb2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_arena_pb2.pyi new file mode 100644 index 0000000..89d6042 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_arena_pb2.pyi @@ -0,0 +1,43 @@ +from google.protobuf.internal.containers import ( + RepeatedCompositeFieldContainer, +) +from google.protobuf.message import ( + Message, +) +from google.protobuf.unittest_no_arena_import_pb2 import ( + ImportNoArenaNestedMessage, +) +from typing import ( + Iterable, + Optional, +) + + +class NestedMessage(Message): + d: int + + def __init__(self, + d: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> NestedMessage: ... + + +class ArenaMessage(Message): + + @property + def repeated_nested_message( + self) -> RepeatedCompositeFieldContainer[NestedMessage]: ... + + @property + def repeated_import_no_arena_message( + self) -> RepeatedCompositeFieldContainer[ImportNoArenaNestedMessage]: ... + + def __init__(self, + repeated_nested_message: Optional[Iterable[NestedMessage]] = ..., + repeated_import_no_arena_message: Optional[Iterable[ImportNoArenaNestedMessage]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> ArenaMessage: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_custom_options_pb2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_custom_options_pb2.pyi new file mode 100644 index 0000000..5028e07 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_custom_options_pb2.pyi @@ -0,0 +1,472 @@ +from google.protobuf.descriptor_pb2 import ( + FileOptions, +) +from google.protobuf.internal.containers import ( + RepeatedCompositeFieldContainer, + RepeatedScalarFieldContainer, +) +from google.protobuf.message import ( + Message, +) +from typing import ( + Iterable, + List, + Optional, + Text, + Tuple, + cast, +) + + +class MethodOpt1(int): + + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> MethodOpt1: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[MethodOpt1]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, MethodOpt1]]: ... + + +METHODOPT1_VAL1: MethodOpt1 +METHODOPT1_VAL2: MethodOpt1 + + +class AggregateEnum(int): + + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> AggregateEnum: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[AggregateEnum]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, AggregateEnum]]: ... + + +VALUE: AggregateEnum + + +class TestMessageWithCustomOptions(Message): + + class AnEnum(int): + + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> TestMessageWithCustomOptions.AnEnum: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[TestMessageWithCustomOptions.AnEnum]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, + TestMessageWithCustomOptions.AnEnum]]: ... + ANENUM_VAL1: TestMessageWithCustomOptions.AnEnum + ANENUM_VAL2: TestMessageWithCustomOptions.AnEnum + field1: Text + oneof_field: int + + def __init__(self, + field1: Optional[Text] = ..., + oneof_field: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMessageWithCustomOptions: ... + + +class CustomOptionFooRequest(Message): + + def __init__(self, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> CustomOptionFooRequest: ... + + +class CustomOptionFooResponse(Message): + + def __init__(self, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> CustomOptionFooResponse: ... + + +class CustomOptionFooClientMessage(Message): + + def __init__(self, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> CustomOptionFooClientMessage: ... + + +class CustomOptionFooServerMessage(Message): + + def __init__(self, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> CustomOptionFooServerMessage: ... + + +class DummyMessageContainingEnum(Message): + + class TestEnumType(int): + + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> DummyMessageContainingEnum.TestEnumType: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[DummyMessageContainingEnum.TestEnumType]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, + DummyMessageContainingEnum.TestEnumType]]: ... + TEST_OPTION_ENUM_TYPE1: DummyMessageContainingEnum.TestEnumType + TEST_OPTION_ENUM_TYPE2: DummyMessageContainingEnum.TestEnumType + + def __init__(self, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> DummyMessageContainingEnum: ... + + +class DummyMessageInvalidAsOptionType(Message): + + def __init__(self, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> DummyMessageInvalidAsOptionType: ... + + +class CustomOptionMinIntegerValues(Message): + + def __init__(self, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> CustomOptionMinIntegerValues: ... + + +class CustomOptionMaxIntegerValues(Message): + + def __init__(self, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> CustomOptionMaxIntegerValues: ... + + +class CustomOptionOtherValues(Message): + + def __init__(self, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> CustomOptionOtherValues: ... + + +class SettingRealsFromPositiveInts(Message): + + def __init__(self, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> SettingRealsFromPositiveInts: ... + + +class SettingRealsFromNegativeInts(Message): + + def __init__(self, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> SettingRealsFromNegativeInts: ... + + +class ComplexOptionType1(Message): + foo: int + foo2: int + foo3: int + foo4: RepeatedScalarFieldContainer[int] + + def __init__(self, + foo: Optional[int] = ..., + foo2: Optional[int] = ..., + foo3: Optional[int] = ..., + foo4: Optional[Iterable[int]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> ComplexOptionType1: ... + + +class ComplexOptionType2(Message): + + class ComplexOptionType4(Message): + waldo: int + + def __init__(self, + waldo: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> ComplexOptionType2.ComplexOptionType4: ... + baz: int + + @property + def bar(self) -> ComplexOptionType1: ... + + @property + def fred(self) -> ComplexOptionType2.ComplexOptionType4: ... + + @property + def barney( + self) -> RepeatedCompositeFieldContainer[ComplexOptionType2.ComplexOptionType4]: ... + + def __init__(self, + bar: Optional[ComplexOptionType1] = ..., + baz: Optional[int] = ..., + fred: Optional[ComplexOptionType2.ComplexOptionType4] = ..., + barney: Optional[Iterable[ComplexOptionType2.ComplexOptionType4]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> ComplexOptionType2: ... + + +class ComplexOptionType3(Message): + + class ComplexOptionType5(Message): + plugh: int + + def __init__(self, + plugh: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> ComplexOptionType3.ComplexOptionType5: ... + qux: int + + @property + def complexoptiontype5(self) -> ComplexOptionType3.ComplexOptionType5: ... + + def __init__(self, + qux: Optional[int] = ..., + complexoptiontype5: Optional[ComplexOptionType3.ComplexOptionType5] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> ComplexOptionType3: ... + + +class ComplexOpt6(Message): + xyzzy: int + + def __init__(self, + xyzzy: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> ComplexOpt6: ... + + +class VariousComplexOptions(Message): + + def __init__(self, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> VariousComplexOptions: ... + + +class AggregateMessageSet(Message): + + def __init__(self, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> AggregateMessageSet: ... + + +class AggregateMessageSetElement(Message): + s: Text + + def __init__(self, + s: Optional[Text] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> AggregateMessageSetElement: ... + + +class Aggregate(Message): + i: int + s: Text + + @property + def sub(self) -> Aggregate: ... + + @property + def file(self) -> FileOptions: ... + + @property + def mset(self) -> AggregateMessageSet: ... + + def __init__(self, + i: Optional[int] = ..., + s: Optional[Text] = ..., + sub: Optional[Aggregate] = ..., + file: Optional[FileOptions] = ..., + mset: Optional[AggregateMessageSet] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> Aggregate: ... + + +class AggregateMessage(Message): + fieldname: int + + def __init__(self, + fieldname: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> AggregateMessage: ... + + +class NestedOptionType(Message): + + class NestedEnum(int): + + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> NestedOptionType.NestedEnum: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[NestedOptionType.NestedEnum]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, NestedOptionType.NestedEnum]]: ... + NESTED_ENUM_VALUE: NestedOptionType.NestedEnum + + class NestedMessage(Message): + nested_field: int + + def __init__(self, + nested_field: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> NestedOptionType.NestedMessage: ... + + def __init__(self, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> NestedOptionType: ... + + +class OldOptionType(Message): + + class TestEnum(int): + + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> OldOptionType.TestEnum: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[OldOptionType.TestEnum]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, OldOptionType.TestEnum]]: ... + OLD_VALUE: OldOptionType.TestEnum + value: OldOptionType.TestEnum + + def __init__(self, + value: OldOptionType.TestEnum, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> OldOptionType: ... + + +class NewOptionType(Message): + + class TestEnum(int): + + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> NewOptionType.TestEnum: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[NewOptionType.TestEnum]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, NewOptionType.TestEnum]]: ... + OLD_VALUE: NewOptionType.TestEnum + NEW_VALUE: NewOptionType.TestEnum + value: NewOptionType.TestEnum + + def __init__(self, + value: NewOptionType.TestEnum, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> NewOptionType: ... + + +class TestMessageWithRequiredEnumOption(Message): + + def __init__(self, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMessageWithRequiredEnumOption: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_import_pb2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_import_pb2.pyi new file mode 100644 index 0000000..92f1914 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_import_pb2.pyi @@ -0,0 +1,66 @@ +from google.protobuf.message import ( + Message, +) +from typing import ( + List, + Optional, + Tuple, + cast, +) + + +class ImportEnum(int): + + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> ImportEnum: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[ImportEnum]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, ImportEnum]]: ... + + +IMPORT_FOO: ImportEnum +IMPORT_BAR: ImportEnum +IMPORT_BAZ: ImportEnum + + +class ImportEnumForMap(int): + + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> ImportEnumForMap: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[ImportEnumForMap]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, ImportEnumForMap]]: ... + + +UNKNOWN: ImportEnumForMap +FOO: ImportEnumForMap +BAR: ImportEnumForMap + + +class ImportMessage(Message): + d: int + + def __init__(self, + d: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> ImportMessage: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_import_public_pb2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_import_public_pb2.pyi new file mode 100644 index 0000000..c8e13ff --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_import_public_pb2.pyi @@ -0,0 +1,17 @@ +from google.protobuf.message import ( + Message, +) +from typing import ( + Optional, +) + + +class PublicImportMessage(Message): + e: int + + def __init__(self, + e: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> PublicImportMessage: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_mset_pb2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_mset_pb2.pyi new file mode 100644 index 0000000..6366320 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_mset_pb2.pyi @@ -0,0 +1,75 @@ +from google.protobuf.internal.containers import ( + RepeatedCompositeFieldContainer, +) +from google.protobuf.message import ( + Message, +) +from google.protobuf.unittest_mset_wire_format_pb2 import ( + TestMessageSet, +) +import builtins +from typing import ( + Iterable, + Optional, + Text, +) + + +class TestMessageSetContainer(Message): + + @property + def message_set(self) -> TestMessageSet: ... + + def __init__(self, + message_set: Optional[TestMessageSet] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMessageSetContainer: ... + + +class TestMessageSetExtension1(Message): + i: int + + def __init__(self, + i: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMessageSetExtension1: ... + + +class TestMessageSetExtension2(Message): + str: Text + + def __init__(self, + bytes: Optional[Text] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: builtins.bytes) -> TestMessageSetExtension2: ... + + +class RawMessageSet(Message): + + class Item(Message): + type_id: int + message: bytes + + def __init__(self, + type_id: int, + message: bytes, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> RawMessageSet.Item: ... + + @property + def item(self) -> RepeatedCompositeFieldContainer[RawMessageSet.Item]: ... + + def __init__(self, + item: Optional[Iterable[RawMessageSet.Item]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> RawMessageSet: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_mset_wire_format_pb2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_mset_wire_format_pb2.pyi new file mode 100644 index 0000000..acb24a4 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_mset_wire_format_pb2.pyi @@ -0,0 +1,28 @@ +from google.protobuf.message import ( + Message, +) +from typing import ( + Optional, +) + + +class TestMessageSet(Message): + + def __init__(self, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMessageSet: ... + + +class TestMessageSetWireFormatContainer(Message): + + @property + def message_set(self) -> TestMessageSet: ... + + def __init__(self, + message_set: Optional[TestMessageSet] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMessageSetWireFormatContainer: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_no_arena_import_pb2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_no_arena_import_pb2.pyi new file mode 100644 index 0000000..c02e4d3 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_no_arena_import_pb2.pyi @@ -0,0 +1,17 @@ +from google.protobuf.message import ( + Message, +) +from typing import ( + Optional, +) + + +class ImportNoArenaNestedMessage(Message): + d: int + + def __init__(self, + d: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> ImportNoArenaNestedMessage: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_no_arena_pb2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_no_arena_pb2.pyi new file mode 100644 index 0000000..8a25622 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_no_arena_pb2.pyi @@ -0,0 +1,315 @@ +from google.protobuf.internal.containers import ( + RepeatedCompositeFieldContainer, + RepeatedScalarFieldContainer, +) +from google.protobuf.message import ( + Message, +) +from google.protobuf.unittest_arena_pb2 import ( + ArenaMessage, +) +from google.protobuf.unittest_import_pb2 import ( + ImportEnum, + ImportMessage, +) +from google.protobuf.unittest_import_public_pb2 import ( + PublicImportMessage, +) +from typing import ( + Iterable, + List, + Optional, + Text, + Tuple, + cast, +) + + +class ForeignEnum(int): + + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> ForeignEnum: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[ForeignEnum]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, ForeignEnum]]: ... + + +FOREIGN_FOO: ForeignEnum +FOREIGN_BAR: ForeignEnum +FOREIGN_BAZ: ForeignEnum + + +class TestAllTypes(Message): + + class NestedEnum(int): + + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> TestAllTypes.NestedEnum: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[TestAllTypes.NestedEnum]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, TestAllTypes.NestedEnum]]: ... + FOO: TestAllTypes.NestedEnum + BAR: TestAllTypes.NestedEnum + BAZ: TestAllTypes.NestedEnum + NEG: TestAllTypes.NestedEnum + + class NestedMessage(Message): + bb: int + + def __init__(self, + bb: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllTypes.NestedMessage: ... + + class OptionalGroup(Message): + a: int + + def __init__(self, + a: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllTypes.OptionalGroup: ... + + class RepeatedGroup(Message): + a: int + + def __init__(self, + a: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllTypes.RepeatedGroup: ... + optional_int32: int + optional_int64: int + optional_uint32: int + optional_uint64: int + optional_sint32: int + optional_sint64: int + optional_fixed32: int + optional_fixed64: int + optional_sfixed32: int + optional_sfixed64: int + optional_float: float + optional_double: float + optional_bool: bool + optional_string: Text + optional_bytes: bytes + optional_nested_enum: TestAllTypes.NestedEnum + optional_foreign_enum: ForeignEnum + optional_import_enum: ImportEnum + optional_string_piece: Text + optional_cord: Text + repeated_int32: RepeatedScalarFieldContainer[int] + repeated_int64: RepeatedScalarFieldContainer[int] + repeated_uint32: RepeatedScalarFieldContainer[int] + repeated_uint64: RepeatedScalarFieldContainer[int] + repeated_sint32: RepeatedScalarFieldContainer[int] + repeated_sint64: RepeatedScalarFieldContainer[int] + repeated_fixed32: RepeatedScalarFieldContainer[int] + repeated_fixed64: RepeatedScalarFieldContainer[int] + repeated_sfixed32: RepeatedScalarFieldContainer[int] + repeated_sfixed64: RepeatedScalarFieldContainer[int] + repeated_float: RepeatedScalarFieldContainer[float] + repeated_double: RepeatedScalarFieldContainer[float] + repeated_bool: RepeatedScalarFieldContainer[bool] + repeated_string: RepeatedScalarFieldContainer[Text] + repeated_bytes: RepeatedScalarFieldContainer[bytes] + repeated_nested_enum: RepeatedScalarFieldContainer[TestAllTypes.NestedEnum] + repeated_foreign_enum: RepeatedScalarFieldContainer[ForeignEnum] + repeated_import_enum: RepeatedScalarFieldContainer[ImportEnum] + repeated_string_piece: RepeatedScalarFieldContainer[Text] + repeated_cord: RepeatedScalarFieldContainer[Text] + default_int32: int + default_int64: int + default_uint32: int + default_uint64: int + default_sint32: int + default_sint64: int + default_fixed32: int + default_fixed64: int + default_sfixed32: int + default_sfixed64: int + default_float: float + default_double: float + default_bool: bool + default_string: Text + default_bytes: bytes + default_nested_enum: TestAllTypes.NestedEnum + default_foreign_enum: ForeignEnum + default_import_enum: ImportEnum + default_string_piece: Text + default_cord: Text + oneof_uint32: int + oneof_string: Text + oneof_bytes: bytes + + @property + def optionalgroup(self) -> TestAllTypes.OptionalGroup: ... + + @property + def optional_nested_message(self) -> TestAllTypes.NestedMessage: ... + + @property + def optional_foreign_message(self) -> ForeignMessage: ... + + @property + def optional_import_message(self) -> ImportMessage: ... + + @property + def optional_public_import_message(self) -> PublicImportMessage: ... + + @property + def optional_message(self) -> TestAllTypes.NestedMessage: ... + + @property + def repeatedgroup( + self) -> RepeatedCompositeFieldContainer[TestAllTypes.RepeatedGroup]: ... + + @property + def repeated_nested_message( + self) -> RepeatedCompositeFieldContainer[TestAllTypes.NestedMessage]: ... + + @property + def repeated_foreign_message( + self) -> RepeatedCompositeFieldContainer[ForeignMessage]: ... + + @property + def repeated_import_message( + self) -> RepeatedCompositeFieldContainer[ImportMessage]: ... + + @property + def repeated_lazy_message( + self) -> RepeatedCompositeFieldContainer[TestAllTypes.NestedMessage]: ... + + @property + def oneof_nested_message(self) -> TestAllTypes.NestedMessage: ... + + @property + def lazy_oneof_nested_message(self) -> TestAllTypes.NestedMessage: ... + + def __init__(self, + optional_int32: Optional[int] = ..., + optional_int64: Optional[int] = ..., + optional_uint32: Optional[int] = ..., + optional_uint64: Optional[int] = ..., + optional_sint32: Optional[int] = ..., + optional_sint64: Optional[int] = ..., + optional_fixed32: Optional[int] = ..., + optional_fixed64: Optional[int] = ..., + optional_sfixed32: Optional[int] = ..., + optional_sfixed64: Optional[int] = ..., + optional_float: Optional[float] = ..., + optional_double: Optional[float] = ..., + optional_bool: Optional[bool] = ..., + optional_string: Optional[Text] = ..., + optional_bytes: Optional[bytes] = ..., + optionalgroup: Optional[TestAllTypes.OptionalGroup] = ..., + optional_nested_message: Optional[TestAllTypes.NestedMessage] = ..., + optional_foreign_message: Optional[ForeignMessage] = ..., + optional_import_message: Optional[ImportMessage] = ..., + optional_nested_enum: Optional[TestAllTypes.NestedEnum] = ..., + optional_foreign_enum: Optional[ForeignEnum] = ..., + optional_import_enum: Optional[ImportEnum] = ..., + optional_string_piece: Optional[Text] = ..., + optional_cord: Optional[Text] = ..., + optional_public_import_message: Optional[PublicImportMessage] = ..., + optional_message: Optional[TestAllTypes.NestedMessage] = ..., + repeated_int32: Optional[Iterable[int]] = ..., + repeated_int64: Optional[Iterable[int]] = ..., + repeated_uint32: Optional[Iterable[int]] = ..., + repeated_uint64: Optional[Iterable[int]] = ..., + repeated_sint32: Optional[Iterable[int]] = ..., + repeated_sint64: Optional[Iterable[int]] = ..., + repeated_fixed32: Optional[Iterable[int]] = ..., + repeated_fixed64: Optional[Iterable[int]] = ..., + repeated_sfixed32: Optional[Iterable[int]] = ..., + repeated_sfixed64: Optional[Iterable[int]] = ..., + repeated_float: Optional[Iterable[float]] = ..., + repeated_double: Optional[Iterable[float]] = ..., + repeated_bool: Optional[Iterable[bool]] = ..., + repeated_string: Optional[Iterable[Text]] = ..., + repeated_bytes: Optional[Iterable[bytes]] = ..., + repeatedgroup: Optional[Iterable[TestAllTypes.RepeatedGroup]] = ..., + repeated_nested_message: Optional[Iterable[TestAllTypes.NestedMessage]] = ..., + repeated_foreign_message: Optional[Iterable[ForeignMessage]] = ..., + repeated_import_message: Optional[Iterable[ImportMessage]] = ..., + repeated_nested_enum: Optional[Iterable[TestAllTypes.NestedEnum]] = ..., + repeated_foreign_enum: Optional[Iterable[ForeignEnum]] = ..., + repeated_import_enum: Optional[Iterable[ImportEnum]] = ..., + repeated_string_piece: Optional[Iterable[Text]] = ..., + repeated_cord: Optional[Iterable[Text]] = ..., + repeated_lazy_message: Optional[Iterable[TestAllTypes.NestedMessage]] = ..., + default_int32: Optional[int] = ..., + default_int64: Optional[int] = ..., + default_uint32: Optional[int] = ..., + default_uint64: Optional[int] = ..., + default_sint32: Optional[int] = ..., + default_sint64: Optional[int] = ..., + default_fixed32: Optional[int] = ..., + default_fixed64: Optional[int] = ..., + default_sfixed32: Optional[int] = ..., + default_sfixed64: Optional[int] = ..., + default_float: Optional[float] = ..., + default_double: Optional[float] = ..., + default_bool: Optional[bool] = ..., + default_string: Optional[Text] = ..., + default_bytes: Optional[bytes] = ..., + default_nested_enum: Optional[TestAllTypes.NestedEnum] = ..., + default_foreign_enum: Optional[ForeignEnum] = ..., + default_import_enum: Optional[ImportEnum] = ..., + default_string_piece: Optional[Text] = ..., + default_cord: Optional[Text] = ..., + oneof_uint32: Optional[int] = ..., + oneof_nested_message: Optional[TestAllTypes.NestedMessage] = ..., + oneof_string: Optional[Text] = ..., + oneof_bytes: Optional[bytes] = ..., + lazy_oneof_nested_message: Optional[TestAllTypes.NestedMessage] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllTypes: ... + + +class ForeignMessage(Message): + c: int + + def __init__(self, + c: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> ForeignMessage: ... + + +class TestNoArenaMessage(Message): + + @property + def arena_message(self) -> ArenaMessage: ... + + def __init__(self, + arena_message: Optional[ArenaMessage] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestNoArenaMessage: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_no_generic_services_pb2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_no_generic_services_pb2.pyi new file mode 100644 index 0000000..b65863b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_no_generic_services_pb2.pyi @@ -0,0 +1,40 @@ +from google.protobuf.message import ( + Message, +) +from typing import ( + List, + Optional, + Tuple, + cast, +) + + +class TestEnum(int): + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> TestEnum: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[TestEnum]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, TestEnum]]: ... + + +FOO: TestEnum + + +class TestMessage(Message): + a: int + + def __init__(self, + a: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMessage: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_pb2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_pb2.pyi new file mode 100644 index 0000000..7f05257 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_pb2.pyi @@ -0,0 +1,1777 @@ +from google.protobuf.internal.containers import ( + RepeatedCompositeFieldContainer, + RepeatedScalarFieldContainer, +) +from google.protobuf.message import ( + Message, +) +from google.protobuf.unittest_import_pb2 import ( + ImportEnum, + ImportMessage, +) +from google.protobuf.unittest_import_public_pb2 import ( + PublicImportMessage, +) +from typing import ( + Iterable, + List, + Mapping, + MutableMapping, + Optional, + Text, + Tuple, + cast, +) + + +class ForeignEnum(int): + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> ForeignEnum: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[ForeignEnum]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, ForeignEnum]]: ... + + +FOREIGN_FOO: ForeignEnum +FOREIGN_BAR: ForeignEnum +FOREIGN_BAZ: ForeignEnum + + +class TestEnumWithDupValue(int): + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> TestEnumWithDupValue: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[TestEnumWithDupValue]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, TestEnumWithDupValue]]: ... + + +FOO1: TestEnumWithDupValue +BAR1: TestEnumWithDupValue +BAZ: TestEnumWithDupValue +FOO2: TestEnumWithDupValue +BAR2: TestEnumWithDupValue + + +class TestSparseEnum(int): + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> TestSparseEnum: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[TestSparseEnum]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, TestSparseEnum]]: ... + + +SPARSE_A: TestSparseEnum +SPARSE_B: TestSparseEnum +SPARSE_C: TestSparseEnum +SPARSE_D: TestSparseEnum +SPARSE_E: TestSparseEnum +SPARSE_F: TestSparseEnum +SPARSE_G: TestSparseEnum + + +class TestAllTypes(Message): + class NestedEnum(int): + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> TestAllTypes.NestedEnum: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[TestAllTypes.NestedEnum]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, TestAllTypes.NestedEnum]]: ... + FOO: TestAllTypes.NestedEnum + BAR: TestAllTypes.NestedEnum + BAZ: TestAllTypes.NestedEnum + NEG: TestAllTypes.NestedEnum + + class NestedMessage(Message): + bb: int + + def __init__(self, + bb: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllTypes.NestedMessage: ... + + class OptionalGroup(Message): + a: int + + def __init__(self, + a: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllTypes.OptionalGroup: ... + + class RepeatedGroup(Message): + a: int + + def __init__(self, + a: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllTypes.RepeatedGroup: ... + optional_int32: int + optional_int64: int + optional_uint32: int + optional_uint64: int + optional_sint32: int + optional_sint64: int + optional_fixed32: int + optional_fixed64: int + optional_sfixed32: int + optional_sfixed64: int + optional_float: float + optional_double: float + optional_bool: bool + optional_string: Text + optional_bytes: bytes + optional_nested_enum: TestAllTypes.NestedEnum + optional_foreign_enum: ForeignEnum + optional_import_enum: ImportEnum + optional_string_piece: Text + optional_cord: Text + repeated_int32: RepeatedScalarFieldContainer[int] + repeated_int64: RepeatedScalarFieldContainer[int] + repeated_uint32: RepeatedScalarFieldContainer[int] + repeated_uint64: RepeatedScalarFieldContainer[int] + repeated_sint32: RepeatedScalarFieldContainer[int] + repeated_sint64: RepeatedScalarFieldContainer[int] + repeated_fixed32: RepeatedScalarFieldContainer[int] + repeated_fixed64: RepeatedScalarFieldContainer[int] + repeated_sfixed32: RepeatedScalarFieldContainer[int] + repeated_sfixed64: RepeatedScalarFieldContainer[int] + repeated_float: RepeatedScalarFieldContainer[float] + repeated_double: RepeatedScalarFieldContainer[float] + repeated_bool: RepeatedScalarFieldContainer[bool] + repeated_string: RepeatedScalarFieldContainer[Text] + repeated_bytes: RepeatedScalarFieldContainer[bytes] + repeated_nested_enum: RepeatedScalarFieldContainer[TestAllTypes.NestedEnum] + repeated_foreign_enum: RepeatedScalarFieldContainer[ForeignEnum] + repeated_import_enum: RepeatedScalarFieldContainer[ImportEnum] + repeated_string_piece: RepeatedScalarFieldContainer[Text] + repeated_cord: RepeatedScalarFieldContainer[Text] + default_int32: int + default_int64: int + default_uint32: int + default_uint64: int + default_sint32: int + default_sint64: int + default_fixed32: int + default_fixed64: int + default_sfixed32: int + default_sfixed64: int + default_float: float + default_double: float + default_bool: bool + default_string: Text + default_bytes: bytes + default_nested_enum: TestAllTypes.NestedEnum + default_foreign_enum: ForeignEnum + default_import_enum: ImportEnum + default_string_piece: Text + default_cord: Text + oneof_uint32: int + oneof_string: Text + oneof_bytes: bytes + + @property + def optionalgroup(self) -> TestAllTypes.OptionalGroup: ... + + @property + def optional_nested_message(self) -> TestAllTypes.NestedMessage: ... + + @property + def optional_foreign_message(self) -> ForeignMessage: ... + + @property + def optional_import_message(self) -> ImportMessage: ... + + @property + def optional_public_import_message(self) -> PublicImportMessage: ... + + @property + def optional_lazy_message(self) -> TestAllTypes.NestedMessage: ... + + @property + def repeatedgroup( + self) -> RepeatedCompositeFieldContainer[TestAllTypes.RepeatedGroup]: ... + + @property + def repeated_nested_message( + self) -> RepeatedCompositeFieldContainer[TestAllTypes.NestedMessage]: ... + + @property + def repeated_foreign_message( + self) -> RepeatedCompositeFieldContainer[ForeignMessage]: ... + + @property + def repeated_import_message( + self) -> RepeatedCompositeFieldContainer[ImportMessage]: ... + + @property + def repeated_lazy_message( + self) -> RepeatedCompositeFieldContainer[TestAllTypes.NestedMessage]: ... + + @property + def oneof_nested_message(self) -> TestAllTypes.NestedMessage: ... + + def __init__(self, + optional_int32: Optional[int] = ..., + optional_int64: Optional[int] = ..., + optional_uint32: Optional[int] = ..., + optional_uint64: Optional[int] = ..., + optional_sint32: Optional[int] = ..., + optional_sint64: Optional[int] = ..., + optional_fixed32: Optional[int] = ..., + optional_fixed64: Optional[int] = ..., + optional_sfixed32: Optional[int] = ..., + optional_sfixed64: Optional[int] = ..., + optional_float: Optional[float] = ..., + optional_double: Optional[float] = ..., + optional_bool: Optional[bool] = ..., + optional_string: Optional[Text] = ..., + optional_bytes: Optional[bytes] = ..., + optionalgroup: Optional[TestAllTypes.OptionalGroup] = ..., + optional_nested_message: Optional[TestAllTypes.NestedMessage] = ..., + optional_foreign_message: Optional[ForeignMessage] = ..., + optional_import_message: Optional[ImportMessage] = ..., + optional_nested_enum: Optional[TestAllTypes.NestedEnum] = ..., + optional_foreign_enum: Optional[ForeignEnum] = ..., + optional_import_enum: Optional[ImportEnum] = ..., + optional_string_piece: Optional[Text] = ..., + optional_cord: Optional[Text] = ..., + optional_public_import_message: Optional[PublicImportMessage] = ..., + optional_lazy_message: Optional[TestAllTypes.NestedMessage] = ..., + repeated_int32: Optional[Iterable[int]] = ..., + repeated_int64: Optional[Iterable[int]] = ..., + repeated_uint32: Optional[Iterable[int]] = ..., + repeated_uint64: Optional[Iterable[int]] = ..., + repeated_sint32: Optional[Iterable[int]] = ..., + repeated_sint64: Optional[Iterable[int]] = ..., + repeated_fixed32: Optional[Iterable[int]] = ..., + repeated_fixed64: Optional[Iterable[int]] = ..., + repeated_sfixed32: Optional[Iterable[int]] = ..., + repeated_sfixed64: Optional[Iterable[int]] = ..., + repeated_float: Optional[Iterable[float]] = ..., + repeated_double: Optional[Iterable[float]] = ..., + repeated_bool: Optional[Iterable[bool]] = ..., + repeated_string: Optional[Iterable[Text]] = ..., + repeated_bytes: Optional[Iterable[bytes]] = ..., + repeatedgroup: Optional[Iterable[TestAllTypes.RepeatedGroup]] = ..., + repeated_nested_message: Optional[Iterable[TestAllTypes.NestedMessage]] = ..., + repeated_foreign_message: Optional[Iterable[ForeignMessage]] = ..., + repeated_import_message: Optional[Iterable[ImportMessage]] = ..., + repeated_nested_enum: Optional[Iterable[TestAllTypes.NestedEnum]] = ..., + repeated_foreign_enum: Optional[Iterable[ForeignEnum]] = ..., + repeated_import_enum: Optional[Iterable[ImportEnum]] = ..., + repeated_string_piece: Optional[Iterable[Text]] = ..., + repeated_cord: Optional[Iterable[Text]] = ..., + repeated_lazy_message: Optional[Iterable[TestAllTypes.NestedMessage]] = ..., + default_int32: Optional[int] = ..., + default_int64: Optional[int] = ..., + default_uint32: Optional[int] = ..., + default_uint64: Optional[int] = ..., + default_sint32: Optional[int] = ..., + default_sint64: Optional[int] = ..., + default_fixed32: Optional[int] = ..., + default_fixed64: Optional[int] = ..., + default_sfixed32: Optional[int] = ..., + default_sfixed64: Optional[int] = ..., + default_float: Optional[float] = ..., + default_double: Optional[float] = ..., + default_bool: Optional[bool] = ..., + default_string: Optional[Text] = ..., + default_bytes: Optional[bytes] = ..., + default_nested_enum: Optional[TestAllTypes.NestedEnum] = ..., + default_foreign_enum: Optional[ForeignEnum] = ..., + default_import_enum: Optional[ImportEnum] = ..., + default_string_piece: Optional[Text] = ..., + default_cord: Optional[Text] = ..., + oneof_uint32: Optional[int] = ..., + oneof_nested_message: Optional[TestAllTypes.NestedMessage] = ..., + oneof_string: Optional[Text] = ..., + oneof_bytes: Optional[bytes] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllTypes: ... + + +class NestedTestAllTypes(Message): + + @property + def child(self) -> NestedTestAllTypes: ... + + @property + def payload(self) -> TestAllTypes: ... + + @property + def repeated_child( + self) -> RepeatedCompositeFieldContainer[NestedTestAllTypes]: ... + + def __init__(self, + child: Optional[NestedTestAllTypes] = ..., + payload: Optional[TestAllTypes] = ..., + repeated_child: Optional[Iterable[NestedTestAllTypes]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> NestedTestAllTypes: ... + + +class TestDeprecatedFields(Message): + deprecated_int32: int + deprecated_int32_in_oneof: int + + def __init__(self, + deprecated_int32: Optional[int] = ..., + deprecated_int32_in_oneof: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestDeprecatedFields: ... + + +class TestDeprecatedMessage(Message): + + def __init__(self, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestDeprecatedMessage: ... + + +class ForeignMessage(Message): + c: int + d: int + + def __init__(self, + c: Optional[int] = ..., + d: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> ForeignMessage: ... + + +class TestReservedFields(Message): + + def __init__(self, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestReservedFields: ... + + +class TestAllExtensions(Message): + + def __init__(self, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllExtensions: ... + + +class OptionalGroup_extension(Message): + a: int + + def __init__(self, + a: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> OptionalGroup_extension: ... + + +class RepeatedGroup_extension(Message): + a: int + + def __init__(self, + a: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> RepeatedGroup_extension: ... + + +class TestGroup(Message): + class OptionalGroup(Message): + a: int + + def __init__(self, + a: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestGroup.OptionalGroup: ... + optional_foreign_enum: ForeignEnum + + @property + def optionalgroup(self) -> TestGroup.OptionalGroup: ... + + def __init__(self, + optionalgroup: Optional[TestGroup.OptionalGroup] = ..., + optional_foreign_enum: Optional[ForeignEnum] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestGroup: ... + + +class TestGroupExtension(Message): + + def __init__(self, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestGroupExtension: ... + + +class TestNestedExtension(Message): + class OptionalGroup_extension(Message): + a: int + + def __init__(self, + a: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestNestedExtension.OptionalGroup_extension: ... + + def __init__(self, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestNestedExtension: ... + + +class TestRequired(Message): + a: int + dummy2: int + b: int + dummy4: int + dummy5: int + dummy6: int + dummy7: int + dummy8: int + dummy9: int + dummy10: int + dummy11: int + dummy12: int + dummy13: int + dummy14: int + dummy15: int + dummy16: int + dummy17: int + dummy18: int + dummy19: int + dummy20: int + dummy21: int + dummy22: int + dummy23: int + dummy24: int + dummy25: int + dummy26: int + dummy27: int + dummy28: int + dummy29: int + dummy30: int + dummy31: int + dummy32: int + c: int + + def __init__(self, + a: int, + b: int, + c: int, + dummy2: Optional[int] = ..., + dummy4: Optional[int] = ..., + dummy5: Optional[int] = ..., + dummy6: Optional[int] = ..., + dummy7: Optional[int] = ..., + dummy8: Optional[int] = ..., + dummy9: Optional[int] = ..., + dummy10: Optional[int] = ..., + dummy11: Optional[int] = ..., + dummy12: Optional[int] = ..., + dummy13: Optional[int] = ..., + dummy14: Optional[int] = ..., + dummy15: Optional[int] = ..., + dummy16: Optional[int] = ..., + dummy17: Optional[int] = ..., + dummy18: Optional[int] = ..., + dummy19: Optional[int] = ..., + dummy20: Optional[int] = ..., + dummy21: Optional[int] = ..., + dummy22: Optional[int] = ..., + dummy23: Optional[int] = ..., + dummy24: Optional[int] = ..., + dummy25: Optional[int] = ..., + dummy26: Optional[int] = ..., + dummy27: Optional[int] = ..., + dummy28: Optional[int] = ..., + dummy29: Optional[int] = ..., + dummy30: Optional[int] = ..., + dummy31: Optional[int] = ..., + dummy32: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestRequired: ... + + +class TestRequiredForeign(Message): + dummy: int + + @property + def optional_message(self) -> TestRequired: ... + + @property + def repeated_message( + self) -> RepeatedCompositeFieldContainer[TestRequired]: ... + + def __init__(self, + optional_message: Optional[TestRequired] = ..., + repeated_message: Optional[Iterable[TestRequired]] = ..., + dummy: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestRequiredForeign: ... + + +class TestRequiredMessage(Message): + + @property + def optional_message(self) -> TestRequired: ... + + @property + def repeated_message( + self) -> RepeatedCompositeFieldContainer[TestRequired]: ... + + @property + def required_message(self) -> TestRequired: ... + + def __init__(self, + required_message: TestRequired, + optional_message: Optional[TestRequired] = ..., + repeated_message: Optional[Iterable[TestRequired]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestRequiredMessage: ... + + +class TestForeignNested(Message): + + @property + def foreign_nested(self) -> TestAllTypes.NestedMessage: ... + + def __init__(self, + foreign_nested: Optional[TestAllTypes.NestedMessage] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestForeignNested: ... + + +class TestEmptyMessage(Message): + + def __init__(self, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestEmptyMessage: ... + + +class TestEmptyMessageWithExtensions(Message): + + def __init__(self, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestEmptyMessageWithExtensions: ... + + +class TestMultipleExtensionRanges(Message): + + def __init__(self, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMultipleExtensionRanges: ... + + +class TestReallyLargeTagNumber(Message): + a: int + bb: int + + def __init__(self, + a: Optional[int] = ..., + bb: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestReallyLargeTagNumber: ... + + +class TestRecursiveMessage(Message): + i: int + + @property + def a(self) -> TestRecursiveMessage: ... + + def __init__(self, + a: Optional[TestRecursiveMessage] = ..., + i: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestRecursiveMessage: ... + + +class TestMutualRecursionA(Message): + class SubMessage(Message): + + @property + def b(self) -> TestMutualRecursionB: ... + + def __init__(self, + b: Optional[TestMutualRecursionB] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMutualRecursionA.SubMessage: ... + + class SubGroup(Message): + + @property + def sub_message(self) -> TestMutualRecursionA.SubMessage: ... + + @property + def not_in_this_scc(self) -> TestAllTypes: ... + + def __init__(self, + sub_message: Optional[TestMutualRecursionA.SubMessage] = ..., + not_in_this_scc: Optional[TestAllTypes] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMutualRecursionA.SubGroup: ... + + @property + def bb(self) -> TestMutualRecursionB: ... + + @property + def subgroup(self) -> TestMutualRecursionA.SubGroup: ... + + def __init__(self, + bb: Optional[TestMutualRecursionB] = ..., + subgroup: Optional[TestMutualRecursionA.SubGroup] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMutualRecursionA: ... + + +class TestMutualRecursionB(Message): + optional_int32: int + + @property + def a(self) -> TestMutualRecursionA: ... + + def __init__(self, + a: Optional[TestMutualRecursionA] = ..., + optional_int32: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMutualRecursionB: ... + + +class TestIsInitialized(Message): + class SubMessage(Message): + class SubGroup(Message): + i: int + + def __init__(self, + i: int, + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestIsInitialized.SubMessage.SubGroup: ... + + @property + def subgroup(self) -> TestIsInitialized.SubMessage.SubGroup: ... + + def __init__(self, + subgroup: Optional[TestIsInitialized.SubMessage.SubGroup] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestIsInitialized.SubMessage: ... + + @property + def sub_message(self) -> TestIsInitialized.SubMessage: ... + + def __init__(self, + sub_message: Optional[TestIsInitialized.SubMessage] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestIsInitialized: ... + + +class TestDupFieldNumber(Message): + class Foo(Message): + a: int + + def __init__(self, + a: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestDupFieldNumber.Foo: ... + + class Bar(Message): + a: int + + def __init__(self, + a: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestDupFieldNumber.Bar: ... + a: int + + @property + def foo(self) -> TestDupFieldNumber.Foo: ... + + @property + def bar(self) -> TestDupFieldNumber.Bar: ... + + def __init__(self, + a: Optional[int] = ..., + foo: Optional[TestDupFieldNumber.Foo] = ..., + bar: Optional[TestDupFieldNumber.Bar] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestDupFieldNumber: ... + + +class TestEagerMessage(Message): + + @property + def sub_message(self) -> TestAllTypes: ... + + def __init__(self, + sub_message: Optional[TestAllTypes] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestEagerMessage: ... + + +class TestLazyMessage(Message): + + @property + def sub_message(self) -> TestAllTypes: ... + + def __init__(self, + sub_message: Optional[TestAllTypes] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestLazyMessage: ... + + +class TestNestedMessageHasBits(Message): + class NestedMessage(Message): + nestedmessage_repeated_int32: RepeatedScalarFieldContainer[int] + + @property + def nestedmessage_repeated_foreignmessage( + self) -> RepeatedCompositeFieldContainer[ForeignMessage]: ... + + def __init__(self, + nestedmessage_repeated_int32: Optional[Iterable[int]] = ..., + nestedmessage_repeated_foreignmessage: Optional[Iterable[ForeignMessage]] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestNestedMessageHasBits.NestedMessage: ... + + @property + def optional_nested_message( + self) -> TestNestedMessageHasBits.NestedMessage: ... + + def __init__(self, + optional_nested_message: Optional[TestNestedMessageHasBits.NestedMessage] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestNestedMessageHasBits: ... + + +class TestCamelCaseFieldNames(Message): + PrimitiveField: int + StringField: Text + EnumField: ForeignEnum + StringPieceField: Text + CordField: Text + RepeatedPrimitiveField: RepeatedScalarFieldContainer[int] + RepeatedStringField: RepeatedScalarFieldContainer[Text] + RepeatedEnumField: RepeatedScalarFieldContainer[ForeignEnum] + RepeatedStringPieceField: RepeatedScalarFieldContainer[Text] + RepeatedCordField: RepeatedScalarFieldContainer[Text] + + @property + def MessageField(self) -> ForeignMessage: ... + + @property + def RepeatedMessageField( + self) -> RepeatedCompositeFieldContainer[ForeignMessage]: ... + + def __init__(self, + PrimitiveField: Optional[int] = ..., + StringField: Optional[Text] = ..., + EnumField: Optional[ForeignEnum] = ..., + MessageField: Optional[ForeignMessage] = ..., + StringPieceField: Optional[Text] = ..., + CordField: Optional[Text] = ..., + RepeatedPrimitiveField: Optional[Iterable[int]] = ..., + RepeatedStringField: Optional[Iterable[Text]] = ..., + RepeatedEnumField: Optional[Iterable[ForeignEnum]] = ..., + RepeatedMessageField: Optional[Iterable[ForeignMessage]] = ..., + RepeatedStringPieceField: Optional[Iterable[Text]] = ..., + RepeatedCordField: Optional[Iterable[Text]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestCamelCaseFieldNames: ... + + +class TestFieldOrderings(Message): + class NestedMessage(Message): + oo: int + bb: int + + def __init__(self, + oo: Optional[int] = ..., + bb: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestFieldOrderings.NestedMessage: ... + my_string: Text + my_int: int + my_float: float + + @property + def optional_nested_message(self) -> TestFieldOrderings.NestedMessage: ... + + def __init__(self, + my_string: Optional[Text] = ..., + my_int: Optional[int] = ..., + my_float: Optional[float] = ..., + optional_nested_message: Optional[TestFieldOrderings.NestedMessage] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestFieldOrderings: ... + + +class TestExtensionOrderings1(Message): + my_string: Text + + def __init__(self, + my_string: Optional[Text] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestExtensionOrderings1: ... + + +class TestExtensionOrderings2(Message): + class TestExtensionOrderings3(Message): + my_string: Text + + def __init__(self, + my_string: Optional[Text] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestExtensionOrderings2.TestExtensionOrderings3: ... + my_string: Text + + def __init__(self, + my_string: Optional[Text] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestExtensionOrderings2: ... + + +class TestExtremeDefaultValues(Message): + escaped_bytes: bytes + large_uint32: int + large_uint64: int + small_int32: int + small_int64: int + really_small_int32: int + really_small_int64: int + utf8_string: Text + zero_float: float + one_float: float + small_float: float + negative_one_float: float + negative_float: float + large_float: float + small_negative_float: float + inf_double: float + neg_inf_double: float + nan_double: float + inf_float: float + neg_inf_float: float + nan_float: float + cpp_trigraph: Text + string_with_zero: Text + bytes_with_zero: bytes + string_piece_with_zero: Text + cord_with_zero: Text + replacement_string: Text + + def __init__(self, + escaped_bytes: Optional[bytes] = ..., + large_uint32: Optional[int] = ..., + large_uint64: Optional[int] = ..., + small_int32: Optional[int] = ..., + small_int64: Optional[int] = ..., + really_small_int32: Optional[int] = ..., + really_small_int64: Optional[int] = ..., + utf8_string: Optional[Text] = ..., + zero_float: Optional[float] = ..., + one_float: Optional[float] = ..., + small_float: Optional[float] = ..., + negative_one_float: Optional[float] = ..., + negative_float: Optional[float] = ..., + large_float: Optional[float] = ..., + small_negative_float: Optional[float] = ..., + inf_double: Optional[float] = ..., + neg_inf_double: Optional[float] = ..., + nan_double: Optional[float] = ..., + inf_float: Optional[float] = ..., + neg_inf_float: Optional[float] = ..., + nan_float: Optional[float] = ..., + cpp_trigraph: Optional[Text] = ..., + string_with_zero: Optional[Text] = ..., + bytes_with_zero: Optional[bytes] = ..., + string_piece_with_zero: Optional[Text] = ..., + cord_with_zero: Optional[Text] = ..., + replacement_string: Optional[Text] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestExtremeDefaultValues: ... + + +class SparseEnumMessage(Message): + sparse_enum: TestSparseEnum + + def __init__(self, + sparse_enum: Optional[TestSparseEnum] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> SparseEnumMessage: ... + + +class OneString(Message): + data: Text + + def __init__(self, + data: Optional[Text] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> OneString: ... + + +class MoreString(Message): + data: RepeatedScalarFieldContainer[Text] + + def __init__(self, + data: Optional[Iterable[Text]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> MoreString: ... + + +class OneBytes(Message): + data: bytes + + def __init__(self, + data: Optional[bytes] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> OneBytes: ... + + +class MoreBytes(Message): + data: RepeatedScalarFieldContainer[bytes] + + def __init__(self, + data: Optional[Iterable[bytes]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> MoreBytes: ... + + +class Int32Message(Message): + data: int + + def __init__(self, + data: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> Int32Message: ... + + +class Uint32Message(Message): + data: int + + def __init__(self, + data: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> Uint32Message: ... + + +class Int64Message(Message): + data: int + + def __init__(self, + data: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> Int64Message: ... + + +class Uint64Message(Message): + data: int + + def __init__(self, + data: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> Uint64Message: ... + + +class BoolMessage(Message): + data: bool + + def __init__(self, + data: Optional[bool] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> BoolMessage: ... + + +class TestOneof(Message): + class FooGroup(Message): + a: int + b: Text + + def __init__(self, + a: Optional[int] = ..., + b: Optional[Text] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestOneof.FooGroup: ... + foo_int: int + foo_string: Text + + @property + def foo_message(self) -> TestAllTypes: ... + + @property + def foogroup(self) -> TestOneof.FooGroup: ... + + def __init__(self, + foo_int: Optional[int] = ..., + foo_string: Optional[Text] = ..., + foo_message: Optional[TestAllTypes] = ..., + foogroup: Optional[TestOneof.FooGroup] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestOneof: ... + + +class TestOneofBackwardsCompatible(Message): + class FooGroup(Message): + a: int + b: Text + + def __init__(self, + a: Optional[int] = ..., + b: Optional[Text] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestOneofBackwardsCompatible.FooGroup: ... + foo_int: int + foo_string: Text + + @property + def foo_message(self) -> TestAllTypes: ... + + @property + def foogroup(self) -> TestOneofBackwardsCompatible.FooGroup: ... + + def __init__(self, + foo_int: Optional[int] = ..., + foo_string: Optional[Text] = ..., + foo_message: Optional[TestAllTypes] = ..., + foogroup: Optional[TestOneofBackwardsCompatible.FooGroup] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestOneofBackwardsCompatible: ... + + +class TestOneof2(Message): + class NestedEnum(int): + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> TestOneof2.NestedEnum: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[TestOneof2.NestedEnum]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, TestOneof2.NestedEnum]]: ... + FOO: TestOneof2.NestedEnum + BAR: TestOneof2.NestedEnum + BAZ: TestOneof2.NestedEnum + + class FooGroup(Message): + a: int + b: Text + + def __init__(self, + a: Optional[int] = ..., + b: Optional[Text] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestOneof2.FooGroup: ... + + class NestedMessage(Message): + qux_int: int + corge_int: RepeatedScalarFieldContainer[int] + + def __init__(self, + qux_int: Optional[int] = ..., + corge_int: Optional[Iterable[int]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestOneof2.NestedMessage: ... + foo_int: int + foo_string: Text + foo_cord: Text + foo_string_piece: Text + foo_bytes: bytes + foo_enum: TestOneof2.NestedEnum + bar_int: int + bar_string: Text + bar_cord: Text + bar_string_piece: Text + bar_bytes: bytes + bar_enum: TestOneof2.NestedEnum + baz_int: int + baz_string: Text + + @property + def foo_message(self) -> TestOneof2.NestedMessage: ... + + @property + def foogroup(self) -> TestOneof2.FooGroup: ... + + @property + def foo_lazy_message(self) -> TestOneof2.NestedMessage: ... + + def __init__(self, + foo_int: Optional[int] = ..., + foo_string: Optional[Text] = ..., + foo_cord: Optional[Text] = ..., + foo_string_piece: Optional[Text] = ..., + foo_bytes: Optional[bytes] = ..., + foo_enum: Optional[TestOneof2.NestedEnum] = ..., + foo_message: Optional[TestOneof2.NestedMessage] = ..., + foogroup: Optional[TestOneof2.FooGroup] = ..., + foo_lazy_message: Optional[TestOneof2.NestedMessage] = ..., + bar_int: Optional[int] = ..., + bar_string: Optional[Text] = ..., + bar_cord: Optional[Text] = ..., + bar_string_piece: Optional[Text] = ..., + bar_bytes: Optional[bytes] = ..., + bar_enum: Optional[TestOneof2.NestedEnum] = ..., + baz_int: Optional[int] = ..., + baz_string: Optional[Text] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestOneof2: ... + + +class TestRequiredOneof(Message): + class NestedMessage(Message): + required_double: float + + def __init__(self, + required_double: float, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestRequiredOneof.NestedMessage: ... + foo_int: int + foo_string: Text + + @property + def foo_message(self) -> TestRequiredOneof.NestedMessage: ... + + def __init__(self, + foo_int: Optional[int] = ..., + foo_string: Optional[Text] = ..., + foo_message: Optional[TestRequiredOneof.NestedMessage] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestRequiredOneof: ... + + +class TestPackedTypes(Message): + packed_int32: RepeatedScalarFieldContainer[int] + packed_int64: RepeatedScalarFieldContainer[int] + packed_uint32: RepeatedScalarFieldContainer[int] + packed_uint64: RepeatedScalarFieldContainer[int] + packed_sint32: RepeatedScalarFieldContainer[int] + packed_sint64: RepeatedScalarFieldContainer[int] + packed_fixed32: RepeatedScalarFieldContainer[int] + packed_fixed64: RepeatedScalarFieldContainer[int] + packed_sfixed32: RepeatedScalarFieldContainer[int] + packed_sfixed64: RepeatedScalarFieldContainer[int] + packed_float: RepeatedScalarFieldContainer[float] + packed_double: RepeatedScalarFieldContainer[float] + packed_bool: RepeatedScalarFieldContainer[bool] + packed_enum: RepeatedScalarFieldContainer[ForeignEnum] + + def __init__(self, + packed_int32: Optional[Iterable[int]] = ..., + packed_int64: Optional[Iterable[int]] = ..., + packed_uint32: Optional[Iterable[int]] = ..., + packed_uint64: Optional[Iterable[int]] = ..., + packed_sint32: Optional[Iterable[int]] = ..., + packed_sint64: Optional[Iterable[int]] = ..., + packed_fixed32: Optional[Iterable[int]] = ..., + packed_fixed64: Optional[Iterable[int]] = ..., + packed_sfixed32: Optional[Iterable[int]] = ..., + packed_sfixed64: Optional[Iterable[int]] = ..., + packed_float: Optional[Iterable[float]] = ..., + packed_double: Optional[Iterable[float]] = ..., + packed_bool: Optional[Iterable[bool]] = ..., + packed_enum: Optional[Iterable[ForeignEnum]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestPackedTypes: ... + + +class TestUnpackedTypes(Message): + unpacked_int32: RepeatedScalarFieldContainer[int] + unpacked_int64: RepeatedScalarFieldContainer[int] + unpacked_uint32: RepeatedScalarFieldContainer[int] + unpacked_uint64: RepeatedScalarFieldContainer[int] + unpacked_sint32: RepeatedScalarFieldContainer[int] + unpacked_sint64: RepeatedScalarFieldContainer[int] + unpacked_fixed32: RepeatedScalarFieldContainer[int] + unpacked_fixed64: RepeatedScalarFieldContainer[int] + unpacked_sfixed32: RepeatedScalarFieldContainer[int] + unpacked_sfixed64: RepeatedScalarFieldContainer[int] + unpacked_float: RepeatedScalarFieldContainer[float] + unpacked_double: RepeatedScalarFieldContainer[float] + unpacked_bool: RepeatedScalarFieldContainer[bool] + unpacked_enum: RepeatedScalarFieldContainer[ForeignEnum] + + def __init__(self, + unpacked_int32: Optional[Iterable[int]] = ..., + unpacked_int64: Optional[Iterable[int]] = ..., + unpacked_uint32: Optional[Iterable[int]] = ..., + unpacked_uint64: Optional[Iterable[int]] = ..., + unpacked_sint32: Optional[Iterable[int]] = ..., + unpacked_sint64: Optional[Iterable[int]] = ..., + unpacked_fixed32: Optional[Iterable[int]] = ..., + unpacked_fixed64: Optional[Iterable[int]] = ..., + unpacked_sfixed32: Optional[Iterable[int]] = ..., + unpacked_sfixed64: Optional[Iterable[int]] = ..., + unpacked_float: Optional[Iterable[float]] = ..., + unpacked_double: Optional[Iterable[float]] = ..., + unpacked_bool: Optional[Iterable[bool]] = ..., + unpacked_enum: Optional[Iterable[ForeignEnum]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestUnpackedTypes: ... + + +class TestPackedExtensions(Message): + + def __init__(self, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestPackedExtensions: ... + + +class TestUnpackedExtensions(Message): + + def __init__(self, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestUnpackedExtensions: ... + + +class TestDynamicExtensions(Message): + class DynamicEnumType(int): + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> TestDynamicExtensions.DynamicEnumType: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[TestDynamicExtensions.DynamicEnumType]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, + TestDynamicExtensions.DynamicEnumType]]: ... + DYNAMIC_FOO: TestDynamicExtensions.DynamicEnumType + DYNAMIC_BAR: TestDynamicExtensions.DynamicEnumType + DYNAMIC_BAZ: TestDynamicExtensions.DynamicEnumType + + class DynamicMessageType(Message): + dynamic_field: int + + def __init__(self, + dynamic_field: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestDynamicExtensions.DynamicMessageType: ... + scalar_extension: int + enum_extension: ForeignEnum + dynamic_enum_extension: TestDynamicExtensions.DynamicEnumType + repeated_extension: RepeatedScalarFieldContainer[Text] + packed_extension: RepeatedScalarFieldContainer[int] + + @property + def message_extension(self) -> ForeignMessage: ... + + @property + def dynamic_message_extension( + self) -> TestDynamicExtensions.DynamicMessageType: ... + + def __init__(self, + scalar_extension: Optional[int] = ..., + enum_extension: Optional[ForeignEnum] = ..., + dynamic_enum_extension: Optional[TestDynamicExtensions.DynamicEnumType] = ..., + message_extension: Optional[ForeignMessage] = ..., + dynamic_message_extension: Optional[TestDynamicExtensions.DynamicMessageType] = ..., + repeated_extension: Optional[Iterable[Text]] = ..., + packed_extension: Optional[Iterable[int]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestDynamicExtensions: ... + + +class TestRepeatedScalarDifferentTagSizes(Message): + repeated_fixed32: RepeatedScalarFieldContainer[int] + repeated_int32: RepeatedScalarFieldContainer[int] + repeated_fixed64: RepeatedScalarFieldContainer[int] + repeated_int64: RepeatedScalarFieldContainer[int] + repeated_float: RepeatedScalarFieldContainer[float] + repeated_uint64: RepeatedScalarFieldContainer[int] + + def __init__(self, + repeated_fixed32: Optional[Iterable[int]] = ..., + repeated_int32: Optional[Iterable[int]] = ..., + repeated_fixed64: Optional[Iterable[int]] = ..., + repeated_int64: Optional[Iterable[int]] = ..., + repeated_float: Optional[Iterable[float]] = ..., + repeated_uint64: Optional[Iterable[int]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestRepeatedScalarDifferentTagSizes: ... + + +class TestParsingMerge(Message): + class RepeatedFieldsGenerator(Message): + class Group1(Message): + + @property + def field1(self) -> TestAllTypes: ... + + def __init__(self, + field1: Optional[TestAllTypes] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestParsingMerge.RepeatedFieldsGenerator.Group1: ... + + class Group2(Message): + + @property + def field1(self) -> TestAllTypes: ... + + def __init__(self, + field1: Optional[TestAllTypes] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestParsingMerge.RepeatedFieldsGenerator.Group2: ... + + @property + def field1(self) -> RepeatedCompositeFieldContainer[TestAllTypes]: ... + + @property + def field2(self) -> RepeatedCompositeFieldContainer[TestAllTypes]: ... + + @property + def field3(self) -> RepeatedCompositeFieldContainer[TestAllTypes]: ... + + @property + def group1( + self) -> RepeatedCompositeFieldContainer[TestParsingMerge.RepeatedFieldsGenerator.Group1]: ... + + @property + def group2( + self) -> RepeatedCompositeFieldContainer[TestParsingMerge.RepeatedFieldsGenerator.Group2]: ... + + @property + def ext1(self) -> RepeatedCompositeFieldContainer[TestAllTypes]: ... + + @property + def ext2(self) -> RepeatedCompositeFieldContainer[TestAllTypes]: ... + + def __init__(self, + field1: Optional[Iterable[TestAllTypes]] = ..., + field2: Optional[Iterable[TestAllTypes]] = ..., + field3: Optional[Iterable[TestAllTypes]] = ..., + group1: Optional[Iterable[TestParsingMerge.RepeatedFieldsGenerator.Group1]] = ..., + group2: Optional[Iterable[TestParsingMerge.RepeatedFieldsGenerator.Group2]] = ..., + ext1: Optional[Iterable[TestAllTypes]] = ..., + ext2: Optional[Iterable[TestAllTypes]] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestParsingMerge.RepeatedFieldsGenerator: ... + + class OptionalGroup(Message): + + @property + def optional_group_all_types(self) -> TestAllTypes: ... + + def __init__(self, + optional_group_all_types: Optional[TestAllTypes] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestParsingMerge.OptionalGroup: ... + + class RepeatedGroup(Message): + + @property + def repeated_group_all_types(self) -> TestAllTypes: ... + + def __init__(self, + repeated_group_all_types: Optional[TestAllTypes] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestParsingMerge.RepeatedGroup: ... + + @property + def required_all_types(self) -> TestAllTypes: ... + + @property + def optional_all_types(self) -> TestAllTypes: ... + + @property + def repeated_all_types( + self) -> RepeatedCompositeFieldContainer[TestAllTypes]: ... + + @property + def optionalgroup(self) -> TestParsingMerge.OptionalGroup: ... + + @property + def repeatedgroup( + self) -> RepeatedCompositeFieldContainer[TestParsingMerge.RepeatedGroup]: ... + + def __init__(self, + required_all_types: TestAllTypes, + optional_all_types: Optional[TestAllTypes] = ..., + repeated_all_types: Optional[Iterable[TestAllTypes]] = ..., + optionalgroup: Optional[TestParsingMerge.OptionalGroup] = ..., + repeatedgroup: Optional[Iterable[TestParsingMerge.RepeatedGroup]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestParsingMerge: ... + + +class TestCommentInjectionMessage(Message): + a: Text + + def __init__(self, + a: Optional[Text] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestCommentInjectionMessage: ... + + +class FooRequest(Message): + + def __init__(self, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> FooRequest: ... + + +class FooResponse(Message): + + def __init__(self, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> FooResponse: ... + + +class FooClientMessage(Message): + + def __init__(self, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> FooClientMessage: ... + + +class FooServerMessage(Message): + + def __init__(self, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> FooServerMessage: ... + + +class BarRequest(Message): + + def __init__(self, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> BarRequest: ... + + +class BarResponse(Message): + + def __init__(self, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> BarResponse: ... + + +class TestJsonName(Message): + field_name1: int + fieldName2: int + FieldName3: int + _field_name4: int + FIELD_NAME5: int + field_name6: int + + def __init__(self, + field_name1: Optional[int] = ..., + fieldName2: Optional[int] = ..., + FieldName3: Optional[int] = ..., + _field_name4: Optional[int] = ..., + FIELD_NAME5: Optional[int] = ..., + field_name6: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestJsonName: ... + + +class TestHugeFieldNumbers(Message): + class OptionalGroup(Message): + group_a: int + + def __init__(self, + group_a: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestHugeFieldNumbers.OptionalGroup: ... + + class StringStringMapEntry(Message): + key: Text + value: Text + + def __init__(self, + key: Optional[Text] = ..., + value: Optional[Text] = ..., + ) -> None: ... + + @classmethod + def FromString( + cls, s: bytes) -> TestHugeFieldNumbers.StringStringMapEntry: ... + optional_int32: int + fixed_32: int + repeated_int32: RepeatedScalarFieldContainer[int] + packed_int32: RepeatedScalarFieldContainer[int] + optional_enum: ForeignEnum + optional_string: Text + optional_bytes: bytes + oneof_uint32: int + oneof_string: Text + oneof_bytes: bytes + + @property + def optional_message(self) -> ForeignMessage: ... + + @property + def optionalgroup(self) -> TestHugeFieldNumbers.OptionalGroup: ... + + @property + def string_string_map(self) -> MutableMapping[Text, Text]: ... + + @property + def oneof_test_all_types(self) -> TestAllTypes: ... + + def __init__(self, + optional_int32: Optional[int] = ..., + fixed_32: Optional[int] = ..., + repeated_int32: Optional[Iterable[int]] = ..., + packed_int32: Optional[Iterable[int]] = ..., + optional_enum: Optional[ForeignEnum] = ..., + optional_string: Optional[Text] = ..., + optional_bytes: Optional[bytes] = ..., + optional_message: Optional[ForeignMessage] = ..., + optionalgroup: Optional[TestHugeFieldNumbers.OptionalGroup] = ..., + string_string_map: Optional[Mapping[Text, Text]] = ..., + oneof_uint32: Optional[int] = ..., + oneof_test_all_types: Optional[TestAllTypes] = ..., + oneof_string: Optional[Text] = ..., + oneof_bytes: Optional[bytes] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestHugeFieldNumbers: ... + + +class TestExtensionInsideTable(Message): + field1: int + field2: int + field3: int + field4: int + field6: int + field7: int + field8: int + field9: int + field10: int + + def __init__(self, + field1: Optional[int] = ..., + field2: Optional[int] = ..., + field3: Optional[int] = ..., + field4: Optional[int] = ..., + field6: Optional[int] = ..., + field7: Optional[int] = ..., + field8: Optional[int] = ..., + field9: Optional[int] = ..., + field10: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestExtensionInsideTable: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_proto3_arena_pb2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_proto3_arena_pb2.pyi new file mode 100644 index 0000000..9464062 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_proto3_arena_pb2.pyi @@ -0,0 +1,332 @@ +from google.protobuf.internal.containers import ( + RepeatedCompositeFieldContainer, + RepeatedScalarFieldContainer, +) +from google.protobuf.message import ( + Message, +) +from google.protobuf.unittest_import_pb2 import ( + ImportMessage, +) +from google.protobuf.unittest_import_public_pb2 import ( + PublicImportMessage, +) +from typing import ( + Iterable, + List, + Optional, + Text, + Tuple, + cast, +) + + +class ForeignEnum(int): + + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> ForeignEnum: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[ForeignEnum]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, ForeignEnum]]: ... + + +FOREIGN_ZERO: ForeignEnum +FOREIGN_FOO: ForeignEnum +FOREIGN_BAR: ForeignEnum +FOREIGN_BAZ: ForeignEnum + + +class TestAllTypes(Message): + + class NestedEnum(int): + + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> TestAllTypes.NestedEnum: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[TestAllTypes.NestedEnum]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, TestAllTypes.NestedEnum]]: ... + ZERO: TestAllTypes.NestedEnum + FOO: TestAllTypes.NestedEnum + BAR: TestAllTypes.NestedEnum + BAZ: TestAllTypes.NestedEnum + NEG: TestAllTypes.NestedEnum + + class NestedMessage(Message): + bb: int + + def __init__(self, + bb: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllTypes.NestedMessage: ... + optional_int32: int + optional_int64: int + optional_uint32: int + optional_uint64: int + optional_sint32: int + optional_sint64: int + optional_fixed32: int + optional_fixed64: int + optional_sfixed32: int + optional_sfixed64: int + optional_float: float + optional_double: float + optional_bool: bool + optional_string: Text + optional_bytes: bytes + optional_nested_enum: TestAllTypes.NestedEnum + optional_foreign_enum: ForeignEnum + optional_string_piece: Text + optional_cord: Text + repeated_int32: RepeatedScalarFieldContainer[int] + repeated_int64: RepeatedScalarFieldContainer[int] + repeated_uint32: RepeatedScalarFieldContainer[int] + repeated_uint64: RepeatedScalarFieldContainer[int] + repeated_sint32: RepeatedScalarFieldContainer[int] + repeated_sint64: RepeatedScalarFieldContainer[int] + repeated_fixed32: RepeatedScalarFieldContainer[int] + repeated_fixed64: RepeatedScalarFieldContainer[int] + repeated_sfixed32: RepeatedScalarFieldContainer[int] + repeated_sfixed64: RepeatedScalarFieldContainer[int] + repeated_float: RepeatedScalarFieldContainer[float] + repeated_double: RepeatedScalarFieldContainer[float] + repeated_bool: RepeatedScalarFieldContainer[bool] + repeated_string: RepeatedScalarFieldContainer[Text] + repeated_bytes: RepeatedScalarFieldContainer[bytes] + repeated_nested_enum: RepeatedScalarFieldContainer[TestAllTypes.NestedEnum] + repeated_foreign_enum: RepeatedScalarFieldContainer[ForeignEnum] + repeated_string_piece: RepeatedScalarFieldContainer[Text] + repeated_cord: RepeatedScalarFieldContainer[Text] + oneof_uint32: int + oneof_string: Text + oneof_bytes: bytes + + @property + def optional_nested_message(self) -> TestAllTypes.NestedMessage: ... + + @property + def optional_foreign_message(self) -> ForeignMessage: ... + + @property + def optional_import_message(self) -> ImportMessage: ... + + @property + def optional_public_import_message(self) -> PublicImportMessage: ... + + @property + def optional_lazy_message(self) -> TestAllTypes.NestedMessage: ... + + @property + def optional_lazy_import_message(self) -> ImportMessage: ... + + @property + def repeated_nested_message( + self) -> RepeatedCompositeFieldContainer[TestAllTypes.NestedMessage]: ... + + @property + def repeated_foreign_message( + self) -> RepeatedCompositeFieldContainer[ForeignMessage]: ... + + @property + def repeated_import_message( + self) -> RepeatedCompositeFieldContainer[ImportMessage]: ... + + @property + def repeated_lazy_message( + self) -> RepeatedCompositeFieldContainer[TestAllTypes.NestedMessage]: ... + + @property + def oneof_nested_message(self) -> TestAllTypes.NestedMessage: ... + + def __init__(self, + optional_int32: Optional[int] = ..., + optional_int64: Optional[int] = ..., + optional_uint32: Optional[int] = ..., + optional_uint64: Optional[int] = ..., + optional_sint32: Optional[int] = ..., + optional_sint64: Optional[int] = ..., + optional_fixed32: Optional[int] = ..., + optional_fixed64: Optional[int] = ..., + optional_sfixed32: Optional[int] = ..., + optional_sfixed64: Optional[int] = ..., + optional_float: Optional[float] = ..., + optional_double: Optional[float] = ..., + optional_bool: Optional[bool] = ..., + optional_string: Optional[Text] = ..., + optional_bytes: Optional[bytes] = ..., + optional_nested_message: Optional[TestAllTypes.NestedMessage] = ..., + optional_foreign_message: Optional[ForeignMessage] = ..., + optional_import_message: Optional[ImportMessage] = ..., + optional_nested_enum: Optional[TestAllTypes.NestedEnum] = ..., + optional_foreign_enum: Optional[ForeignEnum] = ..., + optional_string_piece: Optional[Text] = ..., + optional_cord: Optional[Text] = ..., + optional_public_import_message: Optional[PublicImportMessage] = ..., + optional_lazy_message: Optional[TestAllTypes.NestedMessage] = ..., + optional_lazy_import_message: Optional[ImportMessage] = ..., + repeated_int32: Optional[Iterable[int]] = ..., + repeated_int64: Optional[Iterable[int]] = ..., + repeated_uint32: Optional[Iterable[int]] = ..., + repeated_uint64: Optional[Iterable[int]] = ..., + repeated_sint32: Optional[Iterable[int]] = ..., + repeated_sint64: Optional[Iterable[int]] = ..., + repeated_fixed32: Optional[Iterable[int]] = ..., + repeated_fixed64: Optional[Iterable[int]] = ..., + repeated_sfixed32: Optional[Iterable[int]] = ..., + repeated_sfixed64: Optional[Iterable[int]] = ..., + repeated_float: Optional[Iterable[float]] = ..., + repeated_double: Optional[Iterable[float]] = ..., + repeated_bool: Optional[Iterable[bool]] = ..., + repeated_string: Optional[Iterable[Text]] = ..., + repeated_bytes: Optional[Iterable[bytes]] = ..., + repeated_nested_message: Optional[Iterable[TestAllTypes.NestedMessage]] = ..., + repeated_foreign_message: Optional[Iterable[ForeignMessage]] = ..., + repeated_import_message: Optional[Iterable[ImportMessage]] = ..., + repeated_nested_enum: Optional[Iterable[TestAllTypes.NestedEnum]] = ..., + repeated_foreign_enum: Optional[Iterable[ForeignEnum]] = ..., + repeated_string_piece: Optional[Iterable[Text]] = ..., + repeated_cord: Optional[Iterable[Text]] = ..., + repeated_lazy_message: Optional[Iterable[TestAllTypes.NestedMessage]] = ..., + oneof_uint32: Optional[int] = ..., + oneof_nested_message: Optional[TestAllTypes.NestedMessage] = ..., + oneof_string: Optional[Text] = ..., + oneof_bytes: Optional[bytes] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAllTypes: ... + + +class TestPackedTypes(Message): + packed_int32: RepeatedScalarFieldContainer[int] + packed_int64: RepeatedScalarFieldContainer[int] + packed_uint32: RepeatedScalarFieldContainer[int] + packed_uint64: RepeatedScalarFieldContainer[int] + packed_sint32: RepeatedScalarFieldContainer[int] + packed_sint64: RepeatedScalarFieldContainer[int] + packed_fixed32: RepeatedScalarFieldContainer[int] + packed_fixed64: RepeatedScalarFieldContainer[int] + packed_sfixed32: RepeatedScalarFieldContainer[int] + packed_sfixed64: RepeatedScalarFieldContainer[int] + packed_float: RepeatedScalarFieldContainer[float] + packed_double: RepeatedScalarFieldContainer[float] + packed_bool: RepeatedScalarFieldContainer[bool] + packed_enum: RepeatedScalarFieldContainer[ForeignEnum] + + def __init__(self, + packed_int32: Optional[Iterable[int]] = ..., + packed_int64: Optional[Iterable[int]] = ..., + packed_uint32: Optional[Iterable[int]] = ..., + packed_uint64: Optional[Iterable[int]] = ..., + packed_sint32: Optional[Iterable[int]] = ..., + packed_sint64: Optional[Iterable[int]] = ..., + packed_fixed32: Optional[Iterable[int]] = ..., + packed_fixed64: Optional[Iterable[int]] = ..., + packed_sfixed32: Optional[Iterable[int]] = ..., + packed_sfixed64: Optional[Iterable[int]] = ..., + packed_float: Optional[Iterable[float]] = ..., + packed_double: Optional[Iterable[float]] = ..., + packed_bool: Optional[Iterable[bool]] = ..., + packed_enum: Optional[Iterable[ForeignEnum]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestPackedTypes: ... + + +class TestUnpackedTypes(Message): + repeated_int32: RepeatedScalarFieldContainer[int] + repeated_int64: RepeatedScalarFieldContainer[int] + repeated_uint32: RepeatedScalarFieldContainer[int] + repeated_uint64: RepeatedScalarFieldContainer[int] + repeated_sint32: RepeatedScalarFieldContainer[int] + repeated_sint64: RepeatedScalarFieldContainer[int] + repeated_fixed32: RepeatedScalarFieldContainer[int] + repeated_fixed64: RepeatedScalarFieldContainer[int] + repeated_sfixed32: RepeatedScalarFieldContainer[int] + repeated_sfixed64: RepeatedScalarFieldContainer[int] + repeated_float: RepeatedScalarFieldContainer[float] + repeated_double: RepeatedScalarFieldContainer[float] + repeated_bool: RepeatedScalarFieldContainer[bool] + repeated_nested_enum: RepeatedScalarFieldContainer[TestAllTypes.NestedEnum] + + def __init__(self, + repeated_int32: Optional[Iterable[int]] = ..., + repeated_int64: Optional[Iterable[int]] = ..., + repeated_uint32: Optional[Iterable[int]] = ..., + repeated_uint64: Optional[Iterable[int]] = ..., + repeated_sint32: Optional[Iterable[int]] = ..., + repeated_sint64: Optional[Iterable[int]] = ..., + repeated_fixed32: Optional[Iterable[int]] = ..., + repeated_fixed64: Optional[Iterable[int]] = ..., + repeated_sfixed32: Optional[Iterable[int]] = ..., + repeated_sfixed64: Optional[Iterable[int]] = ..., + repeated_float: Optional[Iterable[float]] = ..., + repeated_double: Optional[Iterable[float]] = ..., + repeated_bool: Optional[Iterable[bool]] = ..., + repeated_nested_enum: Optional[Iterable[TestAllTypes.NestedEnum]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestUnpackedTypes: ... + + +class NestedTestAllTypes(Message): + + @property + def child(self) -> NestedTestAllTypes: ... + + @property + def payload(self) -> TestAllTypes: ... + + @property + def repeated_child( + self) -> RepeatedCompositeFieldContainer[NestedTestAllTypes]: ... + + def __init__(self, + child: Optional[NestedTestAllTypes] = ..., + payload: Optional[TestAllTypes] = ..., + repeated_child: Optional[Iterable[NestedTestAllTypes]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> NestedTestAllTypes: ... + + +class ForeignMessage(Message): + c: int + + def __init__(self, + c: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> ForeignMessage: ... + + +class TestEmptyMessage(Message): + + def __init__(self, + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestEmptyMessage: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/util/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/util/__init__.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/util/json_format_proto3_pb2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/util/json_format_proto3_pb2.pyi new file mode 100644 index 0000000..0462313 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/util/json_format_proto3_pb2.pyi @@ -0,0 +1,659 @@ +from google.protobuf.any_pb2 import ( + Any, +) +from google.protobuf.duration_pb2 import ( + Duration, +) +from google.protobuf.field_mask_pb2 import ( + FieldMask, +) +from google.protobuf.internal.containers import ( + RepeatedCompositeFieldContainer, + RepeatedScalarFieldContainer, +) +from google.protobuf.message import ( + Message, +) +from google.protobuf.struct_pb2 import ( + ListValue, + Struct, + Value, +) +from google.protobuf.timestamp_pb2 import ( + Timestamp, +) +from google.protobuf.unittest_pb2 import ( + TestAllExtensions, +) +from google.protobuf.wrappers_pb2 import ( + BoolValue, + BytesValue, + DoubleValue, + FloatValue, + Int32Value, + Int64Value, + StringValue, + UInt32Value, + UInt64Value, +) +from typing import ( + Iterable, + List, + Mapping, + MutableMapping, + Optional, + Text, + Tuple, + cast, +) + + +class EnumType(int): + + @classmethod + def Name(cls, number: int) -> bytes: ... + + @classmethod + def Value(cls, name: bytes) -> EnumType: ... + + @classmethod + def keys(cls) -> List[bytes]: ... + + @classmethod + def values(cls) -> List[EnumType]: ... + + @classmethod + def items(cls) -> List[Tuple[bytes, EnumType]]: ... + + +FOO: EnumType +BAR: EnumType + + +class MessageType(Message): + value: int + + def __init__(self, + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> MessageType: ... + + +class TestMessage(Message): + bool_value: bool + int32_value: int + int64_value: int + uint32_value: int + uint64_value: int + float_value: float + double_value: float + string_value: Text + bytes_value: bytes + enum_value: EnumType + repeated_bool_value: RepeatedScalarFieldContainer[bool] + repeated_int32_value: RepeatedScalarFieldContainer[int] + repeated_int64_value: RepeatedScalarFieldContainer[int] + repeated_uint32_value: RepeatedScalarFieldContainer[int] + repeated_uint64_value: RepeatedScalarFieldContainer[int] + repeated_float_value: RepeatedScalarFieldContainer[float] + repeated_double_value: RepeatedScalarFieldContainer[float] + repeated_string_value: RepeatedScalarFieldContainer[Text] + repeated_bytes_value: RepeatedScalarFieldContainer[bytes] + repeated_enum_value: RepeatedScalarFieldContainer[EnumType] + + @property + def message_value(self) -> MessageType: ... + + @property + def repeated_message_value( + self) -> RepeatedCompositeFieldContainer[MessageType]: ... + + def __init__(self, + bool_value: Optional[bool] = ..., + int32_value: Optional[int] = ..., + int64_value: Optional[int] = ..., + uint32_value: Optional[int] = ..., + uint64_value: Optional[int] = ..., + float_value: Optional[float] = ..., + double_value: Optional[float] = ..., + string_value: Optional[Text] = ..., + bytes_value: Optional[bytes] = ..., + enum_value: Optional[EnumType] = ..., + message_value: Optional[MessageType] = ..., + repeated_bool_value: Optional[Iterable[bool]] = ..., + repeated_int32_value: Optional[Iterable[int]] = ..., + repeated_int64_value: Optional[Iterable[int]] = ..., + repeated_uint32_value: Optional[Iterable[int]] = ..., + repeated_uint64_value: Optional[Iterable[int]] = ..., + repeated_float_value: Optional[Iterable[float]] = ..., + repeated_double_value: Optional[Iterable[float]] = ..., + repeated_string_value: Optional[Iterable[Text]] = ..., + repeated_bytes_value: Optional[Iterable[bytes]] = ..., + repeated_enum_value: Optional[Iterable[EnumType]] = ..., + repeated_message_value: Optional[Iterable[MessageType]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMessage: ... + + +class TestOneof(Message): + oneof_int32_value: int + oneof_string_value: Text + oneof_bytes_value: bytes + oneof_enum_value: EnumType + + @property + def oneof_message_value(self) -> MessageType: ... + + def __init__(self, + oneof_int32_value: Optional[int] = ..., + oneof_string_value: Optional[Text] = ..., + oneof_bytes_value: Optional[bytes] = ..., + oneof_enum_value: Optional[EnumType] = ..., + oneof_message_value: Optional[MessageType] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestOneof: ... + + +class TestMap(Message): + + class BoolMapEntry(Message): + key: bool + value: int + + def __init__(self, + key: Optional[bool] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMap.BoolMapEntry: ... + + class Int32MapEntry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMap.Int32MapEntry: ... + + class Int64MapEntry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMap.Int64MapEntry: ... + + class Uint32MapEntry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMap.Uint32MapEntry: ... + + class Uint64MapEntry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMap.Uint64MapEntry: ... + + class StringMapEntry(Message): + key: Text + value: int + + def __init__(self, + key: Optional[Text] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMap.StringMapEntry: ... + + @property + def bool_map(self) -> MutableMapping[bool, int]: ... + + @property + def int32_map(self) -> MutableMapping[int, int]: ... + + @property + def int64_map(self) -> MutableMapping[int, int]: ... + + @property + def uint32_map(self) -> MutableMapping[int, int]: ... + + @property + def uint64_map(self) -> MutableMapping[int, int]: ... + + @property + def string_map(self) -> MutableMapping[Text, int]: ... + + def __init__(self, + bool_map: Optional[Mapping[bool, int]] = ..., + int32_map: Optional[Mapping[int, int]] = ..., + int64_map: Optional[Mapping[int, int]] = ..., + uint32_map: Optional[Mapping[int, int]] = ..., + uint64_map: Optional[Mapping[int, int]] = ..., + string_map: Optional[Mapping[Text, int]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestMap: ... + + +class TestNestedMap(Message): + + class BoolMapEntry(Message): + key: bool + value: int + + def __init__(self, + key: Optional[bool] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestNestedMap.BoolMapEntry: ... + + class Int32MapEntry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestNestedMap.Int32MapEntry: ... + + class Int64MapEntry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestNestedMap.Int64MapEntry: ... + + class Uint32MapEntry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestNestedMap.Uint32MapEntry: ... + + class Uint64MapEntry(Message): + key: int + value: int + + def __init__(self, + key: Optional[int] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestNestedMap.Uint64MapEntry: ... + + class StringMapEntry(Message): + key: Text + value: int + + def __init__(self, + key: Optional[Text] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestNestedMap.StringMapEntry: ... + + class MapMapEntry(Message): + key: Text + + @property + def value(self) -> TestNestedMap: ... + + def __init__(self, + key: Optional[Text] = ..., + value: Optional[TestNestedMap] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestNestedMap.MapMapEntry: ... + + @property + def bool_map(self) -> MutableMapping[bool, int]: ... + + @property + def int32_map(self) -> MutableMapping[int, int]: ... + + @property + def int64_map(self) -> MutableMapping[int, int]: ... + + @property + def uint32_map(self) -> MutableMapping[int, int]: ... + + @property + def uint64_map(self) -> MutableMapping[int, int]: ... + + @property + def string_map(self) -> MutableMapping[Text, int]: ... + + @property + def map_map(self) -> MutableMapping[Text, TestNestedMap]: ... + + def __init__(self, + bool_map: Optional[Mapping[bool, int]] = ..., + int32_map: Optional[Mapping[int, int]] = ..., + int64_map: Optional[Mapping[int, int]] = ..., + uint32_map: Optional[Mapping[int, int]] = ..., + uint64_map: Optional[Mapping[int, int]] = ..., + string_map: Optional[Mapping[Text, int]] = ..., + map_map: Optional[Mapping[Text, TestNestedMap]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestNestedMap: ... + + +class TestWrapper(Message): + + @property + def bool_value(self) -> BoolValue: ... + + @property + def int32_value(self) -> Int32Value: ... + + @property + def int64_value(self) -> Int64Value: ... + + @property + def uint32_value(self) -> UInt32Value: ... + + @property + def uint64_value(self) -> UInt64Value: ... + + @property + def float_value(self) -> FloatValue: ... + + @property + def double_value(self) -> DoubleValue: ... + + @property + def string_value(self) -> StringValue: ... + + @property + def bytes_value(self) -> BytesValue: ... + + @property + def repeated_bool_value( + self) -> RepeatedCompositeFieldContainer[BoolValue]: ... + + @property + def repeated_int32_value( + self) -> RepeatedCompositeFieldContainer[Int32Value]: ... + + @property + def repeated_int64_value( + self) -> RepeatedCompositeFieldContainer[Int64Value]: ... + + @property + def repeated_uint32_value( + self) -> RepeatedCompositeFieldContainer[UInt32Value]: ... + + @property + def repeated_uint64_value( + self) -> RepeatedCompositeFieldContainer[UInt64Value]: ... + + @property + def repeated_float_value( + self) -> RepeatedCompositeFieldContainer[FloatValue]: ... + + @property + def repeated_double_value( + self) -> RepeatedCompositeFieldContainer[DoubleValue]: ... + + @property + def repeated_string_value( + self) -> RepeatedCompositeFieldContainer[StringValue]: ... + + @property + def repeated_bytes_value( + self) -> RepeatedCompositeFieldContainer[BytesValue]: ... + + def __init__(self, + bool_value: Optional[BoolValue] = ..., + int32_value: Optional[Int32Value] = ..., + int64_value: Optional[Int64Value] = ..., + uint32_value: Optional[UInt32Value] = ..., + uint64_value: Optional[UInt64Value] = ..., + float_value: Optional[FloatValue] = ..., + double_value: Optional[DoubleValue] = ..., + string_value: Optional[StringValue] = ..., + bytes_value: Optional[BytesValue] = ..., + repeated_bool_value: Optional[Iterable[BoolValue]] = ..., + repeated_int32_value: Optional[Iterable[Int32Value]] = ..., + repeated_int64_value: Optional[Iterable[Int64Value]] = ..., + repeated_uint32_value: Optional[Iterable[UInt32Value]] = ..., + repeated_uint64_value: Optional[Iterable[UInt64Value]] = ..., + repeated_float_value: Optional[Iterable[FloatValue]] = ..., + repeated_double_value: Optional[Iterable[DoubleValue]] = ..., + repeated_string_value: Optional[Iterable[StringValue]] = ..., + repeated_bytes_value: Optional[Iterable[BytesValue]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestWrapper: ... + + +class TestTimestamp(Message): + + @property + def value(self) -> Timestamp: ... + + @property + def repeated_value(self) -> RepeatedCompositeFieldContainer[Timestamp]: ... + + def __init__(self, + value: Optional[Timestamp] = ..., + repeated_value: Optional[Iterable[Timestamp]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestTimestamp: ... + + +class TestDuration(Message): + + @property + def value(self) -> Duration: ... + + @property + def repeated_value(self) -> RepeatedCompositeFieldContainer[Duration]: ... + + def __init__(self, + value: Optional[Duration] = ..., + repeated_value: Optional[Iterable[Duration]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestDuration: ... + + +class TestFieldMask(Message): + + @property + def value(self) -> FieldMask: ... + + def __init__(self, + value: Optional[FieldMask] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestFieldMask: ... + + +class TestStruct(Message): + + @property + def value(self) -> Struct: ... + + @property + def repeated_value(self) -> RepeatedCompositeFieldContainer[Struct]: ... + + def __init__(self, + value: Optional[Struct] = ..., + repeated_value: Optional[Iterable[Struct]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestStruct: ... + + +class TestAny(Message): + + @property + def value(self) -> Any: ... + + @property + def repeated_value(self) -> RepeatedCompositeFieldContainer[Any]: ... + + def __init__(self, + value: Optional[Any] = ..., + repeated_value: Optional[Iterable[Any]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestAny: ... + + +class TestValue(Message): + + @property + def value(self) -> Value: ... + + @property + def repeated_value(self) -> RepeatedCompositeFieldContainer[Value]: ... + + def __init__(self, + value: Optional[Value] = ..., + repeated_value: Optional[Iterable[Value]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestValue: ... + + +class TestListValue(Message): + + @property + def value(self) -> ListValue: ... + + @property + def repeated_value(self) -> RepeatedCompositeFieldContainer[ListValue]: ... + + def __init__(self, + value: Optional[ListValue] = ..., + repeated_value: Optional[Iterable[ListValue]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestListValue: ... + + +class TestBoolValue(Message): + + class BoolMapEntry(Message): + key: bool + value: int + + def __init__(self, + key: Optional[bool] = ..., + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestBoolValue.BoolMapEntry: ... + bool_value: bool + + @property + def bool_map(self) -> MutableMapping[bool, int]: ... + + def __init__(self, + bool_value: Optional[bool] = ..., + bool_map: Optional[Mapping[bool, int]] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestBoolValue: ... + + +class TestCustomJsonName(Message): + value: int + + def __init__(self, + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestCustomJsonName: ... + + +class TestExtensions(Message): + + @property + def extensions(self) -> TestAllExtensions: ... + + def __init__(self, + extensions: Optional[TestAllExtensions] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestExtensions: ... + + +class TestEnumValue(Message): + enum_value1: EnumType + enum_value2: EnumType + enum_value3: EnumType + + def __init__(self, + enum_value1: Optional[EnumType] = ..., + enum_value2: Optional[EnumType] = ..., + enum_value3: Optional[EnumType] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> TestEnumValue: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/wrappers_pb2.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/wrappers_pb2.pyi new file mode 100644 index 0000000..6ff865d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/google/protobuf/wrappers_pb2.pyi @@ -0,0 +1,106 @@ +from google.protobuf.message import ( + Message, +) +from typing import ( + Optional, + Text, +) + + +class DoubleValue(Message): + value: float + + def __init__(self, + value: Optional[float] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> DoubleValue: ... + + +class FloatValue(Message): + value: float + + def __init__(self, + value: Optional[float] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> FloatValue: ... + + +class Int64Value(Message): + value: int + + def __init__(self, + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> Int64Value: ... + + +class UInt64Value(Message): + value: int + + def __init__(self, + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> UInt64Value: ... + + +class Int32Value(Message): + value: int + + def __init__(self, + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> Int32Value: ... + + +class UInt32Value(Message): + value: int + + def __init__(self, + value: Optional[int] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> UInt32Value: ... + + +class BoolValue(Message): + value: bool + + def __init__(self, + value: Optional[bool] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> BoolValue: ... + + +class StringValue(Message): + value: Text + + def __init__(self, + value: Optional[Text] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> StringValue: ... + + +class BytesValue(Message): + value: bytes + + def __init__(self, + value: Optional[bytes] = ..., + ) -> None: ... + + @classmethod + def FromString(cls, s: bytes) -> BytesValue: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/itsdangerous.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/itsdangerous.pyi new file mode 100644 index 0000000..32bbf2b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/itsdangerous.pyi @@ -0,0 +1,153 @@ +from datetime import datetime +from typing import Any, Callable, IO, Mapping, MutableMapping, Optional, Tuple, Union, Text, Generator + +_serializer = Any # must be an object that has "dumps" and "loads" attributes (e.g. the json module) + +def want_bytes(s: Union[Text, bytes], encoding: Text = ..., errors: Text = ...) -> bytes: ... + +class BadData(Exception): + message: str + def __init__(self, message: str) -> None: ... + +class BadPayload(BadData): + original_error: Optional[Exception] + def __init__(self, message: str, original_error: Optional[Exception] = ...) -> None: ... + +class BadSignature(BadData): + payload: Optional[Any] + def __init__(self, message: str, payload: Optional[Any] = ...) -> None: ... + +class BadTimeSignature(BadSignature): + date_signed: Optional[int] + def __init__(self, message: str, payload: Optional[Any] = ..., date_signed: Optional[int] = ...) -> None: ... + +class BadHeader(BadSignature): + header: Any + original_error: Any + def __init__(self, message, payload: Optional[Any] = ..., header: Optional[Any] = ..., original_error: Optional[Any] = ...) -> None: ... + +class SignatureExpired(BadTimeSignature): ... + +def base64_encode(string: Union[Text, bytes]) -> bytes: ... +def base64_decode(string: Union[Text, bytes]) -> bytes: ... + +class SigningAlgorithm(object): + def get_signature(self, key: bytes, value: bytes) -> bytes: ... + def verify_signature(self, key: bytes, value: bytes, sig: bytes) -> bool: ... + +class NoneAlgorithm(SigningAlgorithm): + def get_signature(self, key: bytes, value: bytes) -> bytes: ... + +class HMACAlgorithm(SigningAlgorithm): + default_digest_method: Callable + digest_method: Callable + def __init__(self, digest_method: Optional[Callable] = ...) -> None: ... + def get_signature(self, key: bytes, value: bytes) -> bytes: ... + +class Signer(object): + default_digest_method: Callable = ... + default_key_derivation: str = ... + + secret_key: bytes + sep: bytes + salt: Union[Text, bytes] + key_derivation: str + digest_method: Callable + algorithm: SigningAlgorithm + + def __init__(self, + secret_key: Union[Text, bytes], + salt: Optional[Union[Text, bytes]] = ..., + sep: Optional[Union[Text, bytes]] = ..., + key_derivation: Optional[str] = ..., + digest_method: Optional[Callable] = ..., + algorithm: Optional[SigningAlgorithm] = ...) -> None: ... + def derive_key(self) -> bytes: ... + def get_signature(self, value: Union[Text, bytes]) -> bytes: ... + def sign(self, value: Union[Text, bytes]) -> bytes: ... + def verify_signature(self, value: bytes, sig: Union[Text, bytes]) -> bool: ... + def unsign(self, signed_value: Union[Text, bytes]) -> bytes: ... + def validate(self, signed_value: Union[Text, bytes]) -> bool: ... + +class TimestampSigner(Signer): + def get_timestamp(self) -> int: ... + def timestamp_to_datetime(self, ts: float) -> datetime: ... + def sign(self, value: Union[Text, bytes]) -> bytes: ... + def unsign(self, value: Union[Text, bytes], max_age: Optional[int] = ..., + return_timestamp: bool = ...) -> Any: ... # morally -> Union[bytes, Tuple[bytes, datetime]] + def validate(self, signed_value: Union[Text, bytes], max_age: Optional[int] = ...) -> bool: ... + +class Serializer(object): + default_serializer: _serializer = ... + default_signer: Callable[..., Signer] = ... + + secret_key: bytes + salt: bytes + serializer: _serializer + is_text_serializer: bool + signer: Callable[..., Signer] + signer_kwargs: MutableMapping[str, Any] + + def __init__(self, secret_key: Union[Text, bytes], salt: Optional[Union[Text, bytes]] = ..., + serializer: Optional[_serializer] = ..., signer: Optional[Callable[..., Signer]] = ..., + signer_kwargs: Optional[MutableMapping[str, Any]] = ...) -> None: ... + def load_payload(self, payload: bytes, serializer: Optional[_serializer] = ...) -> Any: ... + def dump_payload(self, obj: Any) -> bytes: ... + def make_signer(self, salt: Optional[Union[Text, bytes]] = ...) -> Signer: ... + def iter_unsigners(self, salt: Optional[Union[Text, bytes]] = ...) -> Generator[Any, None, None]: ... + def dumps(self, obj: Any, salt: Optional[Union[Text, bytes]] = ...) -> Any: ... # morally -> Union[str, bytes] + def dump(self, obj: Any, f: IO[Any], salt: Optional[Union[Text, bytes]] = ...) -> None: ... + def loads(self, s: Union[Text, bytes], salt: Optional[Union[Text, bytes]] = ...) -> Any: ... + def load(self, f: IO[Any], salt: Optional[Union[Text, bytes]] = ...): ... + def loads_unsafe(self, s: Union[Text, bytes], salt: Optional[Union[Text, bytes]] = ...) -> Tuple[bool, Optional[Any]]: ... + def load_unsafe(self, f: IO[Any], salt: Optional[Union[Text, bytes]] = ...) -> Tuple[bool, Optional[Any]]: ... + +class TimedSerializer(Serializer): + def loads(self, s: Union[Text, bytes], salt: Optional[Union[Text, bytes]] = ..., max_age: Optional[int] = ..., + return_timestamp: bool = ...) -> Any: ... # morally -> Union[Any, Tuple[Any, datetime]] + def loads_unsafe(self, s: Union[Text, bytes], salt: Optional[Union[Text, bytes]] = ..., + max_age: Optional[int] = ...) -> Tuple[bool, Any]: ... + +class JSONWebSignatureSerializer(Serializer): + jws_algorithms: MutableMapping[Text, SigningAlgorithm] = ... + default_algorithm: Text = ... + default_serializer: Any = ... + + algorithm_name: Text + algorithm: SigningAlgorithm + + def __init__(self, secret_key: Union[Text, bytes], salt: Optional[Union[Text, bytes]] = ..., + serializer: Optional[_serializer] = ..., signer: Optional[Callable[..., Signer]] = ..., + signer_kwargs: Optional[MutableMapping[str, Any]] = ..., algorithm_name: Optional[Text] = ...) -> None: ... + def load_payload(self, payload: Union[Text, bytes], serializer: Optional[_serializer] = ..., + return_header: bool = ...) -> Any: ... # morally -> Union[Any, Tuple[Any, MutableMapping[str, Any]]] + def dump_payload(self, header: Mapping[str, Any], obj: Any) -> bytes: ... # type: ignore + def make_algorithm(self, algorithm_name: Text) -> SigningAlgorithm: ... + def make_signer(self, salt: Optional[Union[Text, bytes]] = ..., algorithm: SigningAlgorithm = ...) -> Signer: ... + def make_header(self, header_fields: Optional[Mapping[str, Any]]) -> MutableMapping[str, Any]: ... + def dumps(self, obj: Any, salt: Optional[Union[Text, bytes]] = ..., + header_fields: Optional[Mapping[str, Any]] = ...) -> str: ... + def loads(self, s: Union[Text, bytes], salt: Optional[Union[Text, bytes]] = ..., + return_header: bool = ...) -> Any: ... # morally -> Union[Any, Tuple[Any, MutableMapping[str, Any]]] + def loads_unsafe(self, s: Union[Text, bytes], salt: Optional[Union[Text, bytes]] = ..., + return_header: bool = ...) -> Tuple[bool, Any]: ... + +class TimedJSONWebSignatureSerializer(JSONWebSignatureSerializer): + DEFAULT_EXPIRES_IN: int = ... + expires_in: int + def __init__(self, secret_key: Union[Text, bytes], expires_in: Optional[int] = ..., salt: Optional[Union[Text, bytes]] = ..., + serializer: Optional[_serializer] = ..., signer: Optional[Callable[..., Signer]] = ..., + signer_kwargs: Optional[MutableMapping[str, Any]] = ..., algorithm_name: Optional[Text] = ...) -> None: ... + def make_header(self, header_fields: Optional[Mapping[str, Any]]) -> MutableMapping[str, Any]: ... + def loads(self, s: Union[Text, bytes], salt: Optional[Union[Text, bytes]] = ..., + return_header: bool = ...) -> Any: ... # morally -> Union[Any, Tuple[Any, MutableMapping[str, Any]]] + def get_issue_date(self, header: Mapping[str, Any]) -> Optional[datetime]: ... + def now(self) -> int: ... + +class _URLSafeSerializerMixin(object): + default_serializer: _serializer = ... + def load_payload(self, payload: bytes, serializer: Optional[_serializer] = ...) -> Any: ... + def dump_payload(self, obj: Any) -> bytes: ... + +class URLSafeSerializer(_URLSafeSerializerMixin, Serializer): ... +class URLSafeTimedSerializer(_URLSafeSerializerMixin, TimedSerializer): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/jinja2/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/jinja2/__init__.pyi new file mode 100644 index 0000000..063f73d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/jinja2/__init__.pyi @@ -0,0 +1,7 @@ +from jinja2.environment import Environment as Environment, Template as Template +from jinja2.loaders import BaseLoader as BaseLoader, FileSystemLoader as FileSystemLoader, PackageLoader as PackageLoader, DictLoader as DictLoader, FunctionLoader as FunctionLoader, PrefixLoader as PrefixLoader, ChoiceLoader as ChoiceLoader, ModuleLoader as ModuleLoader +from jinja2.bccache import BytecodeCache as BytecodeCache, FileSystemBytecodeCache as FileSystemBytecodeCache, MemcachedBytecodeCache as MemcachedBytecodeCache +from jinja2.runtime import Undefined as Undefined, DebugUndefined as DebugUndefined, StrictUndefined as StrictUndefined, make_logging_undefined as make_logging_undefined +from jinja2.exceptions import TemplateError as TemplateError, UndefinedError as UndefinedError, TemplateNotFound as TemplateNotFound, TemplatesNotFound as TemplatesNotFound, TemplateSyntaxError as TemplateSyntaxError, TemplateAssertionError as TemplateAssertionError +from jinja2.filters import environmentfilter as environmentfilter, contextfilter as contextfilter, evalcontextfilter as evalcontextfilter +from jinja2.utils import Markup as Markup, escape as escape, clear_caches as clear_caches, environmentfunction as environmentfunction, evalcontextfunction as evalcontextfunction, contextfunction as contextfunction, is_undefined as is_undefined, select_autoescape as select_autoescape diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/jinja2/_compat.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/jinja2/_compat.pyi new file mode 100644 index 0000000..1e37a7a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/jinja2/_compat.pyi @@ -0,0 +1,34 @@ +from typing import Any, Optional +import sys + +if sys.version_info[0] >= 3: + from io import BytesIO + from urllib.parse import quote_from_bytes as url_quote +else: + from cStringIO import StringIO as BytesIO + from urllib import quote as url_quote + +PY2: Any +PYPY: Any +unichr: Any +range_type: Any +text_type: Any +string_types: Any +integer_types: Any +iterkeys: Any +itervalues: Any +iteritems: Any +NativeStringIO: Any + +def reraise(tp, value, tb: Optional[Any] = ...): ... + +ifilter: Any +imap: Any +izip: Any +intern: Any +implements_iterator: Any +implements_to_string: Any +encode_filename: Any +get_next: Any + +def with_metaclass(meta, *bases): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/jinja2/_stringdefs.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/jinja2/_stringdefs.pyi new file mode 100644 index 0000000..060f888 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/jinja2/_stringdefs.pyi @@ -0,0 +1,40 @@ +from typing import Any + +Cc: str +Cf: str +Cn: str +Co: str +Cs: Any +Ll: str +Lm: str +Lo: str +Lt: str +Lu: str +Mc: str +Me: str +Mn: str +Nd: str +Nl: str +No: str +Pc: str +Pd: str +Pe: str +Pf: str +Pi: str +Po: str +Ps: str +Sc: str +Sk: str +Sm: str +So: str +Zl: str +Zp: str +Zs: str +cats: Any + +def combine(*args): ... + +xid_start: str +xid_continue: str + +def allexcept(*args): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/jinja2/bccache.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/jinja2/bccache.pyi new file mode 100644 index 0000000..754736a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/jinja2/bccache.pyi @@ -0,0 +1,44 @@ +from typing import Any, Optional + +marshal_dump: Any +marshal_load: Any +bc_version: int +bc_magic: Any + +class Bucket: + environment: Any + key: Any + checksum: Any + def __init__(self, environment, key, checksum) -> None: ... + code: Any + def reset(self): ... + def load_bytecode(self, f): ... + def write_bytecode(self, f): ... + def bytecode_from_string(self, string): ... + def bytecode_to_string(self): ... + +class BytecodeCache: + def load_bytecode(self, bucket): ... + def dump_bytecode(self, bucket): ... + def clear(self): ... + def get_cache_key(self, name, filename: Optional[Any] = ...): ... + def get_source_checksum(self, source): ... + def get_bucket(self, environment, name, filename, source): ... + def set_bucket(self, bucket): ... + +class FileSystemBytecodeCache(BytecodeCache): + directory: Any + pattern: Any + def __init__(self, directory: Optional[Any] = ..., pattern: str = ...) -> None: ... + def load_bytecode(self, bucket): ... + def dump_bytecode(self, bucket): ... + def clear(self): ... + +class MemcachedBytecodeCache(BytecodeCache): + client: Any + prefix: Any + timeout: Any + ignore_memcache_errors: Any + def __init__(self, client, prefix: str = ..., timeout: Optional[Any] = ..., ignore_memcache_errors: bool = ...) -> None: ... + def load_bytecode(self, bucket): ... + def dump_bytecode(self, bucket): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/jinja2/compiler.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/jinja2/compiler.pyi new file mode 100644 index 0000000..7b1a537 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/jinja2/compiler.pyi @@ -0,0 +1,176 @@ +from typing import Any, Optional +from keyword import iskeyword as is_python_keyword +from jinja2.visitor import NodeVisitor + +operators: Any +dict_item_iter: str + +unoptimize_before_dead_code: bool + +def generate(node, environment, name, filename, stream: Optional[Any] = ..., defer_init: bool = ...): ... +def has_safe_repr(value): ... +def find_undeclared(nodes, names): ... + +class Identifiers: + declared: Any + outer_undeclared: Any + undeclared: Any + declared_locally: Any + declared_parameter: Any + def __init__(self) -> None: ... + def add_special(self, name): ... + def is_declared(self, name): ... + def copy(self): ... + +class Frame: + eval_ctx: Any + identifiers: Any + toplevel: bool + rootlevel: bool + require_output_check: Any + buffer: Any + block: Any + assigned_names: Any + parent: Any + def __init__(self, eval_ctx, parent: Optional[Any] = ...) -> None: ... + def copy(self): ... + def inspect(self, nodes): ... + def find_shadowed(self, extra: Any = ...): ... + def inner(self): ... + def soft(self): ... + __copy__: Any + +class VisitorExit(RuntimeError): ... + +class DependencyFinderVisitor(NodeVisitor): + filters: Any + tests: Any + def __init__(self) -> None: ... + def visit_Filter(self, node): ... + def visit_Test(self, node): ... + def visit_Block(self, node): ... + +class UndeclaredNameVisitor(NodeVisitor): + names: Any + undeclared: Any + def __init__(self, names) -> None: ... + def visit_Name(self, node): ... + def visit_Block(self, node): ... + +class FrameIdentifierVisitor(NodeVisitor): + identifiers: Any + def __init__(self, identifiers) -> None: ... + def visit_Name(self, node): ... + def visit_If(self, node): ... + def visit_Macro(self, node): ... + def visit_Import(self, node): ... + def visit_FromImport(self, node): ... + def visit_Assign(self, node): ... + def visit_For(self, node): ... + def visit_CallBlock(self, node): ... + def visit_FilterBlock(self, node): ... + def visit_AssignBlock(self, node): ... + def visit_Scope(self, node): ... + def visit_Block(self, node): ... + +class CompilerExit(Exception): ... + +class CodeGenerator(NodeVisitor): + environment: Any + name: Any + filename: Any + stream: Any + created_block_context: bool + defer_init: Any + import_aliases: Any + blocks: Any + extends_so_far: int + has_known_extends: bool + code_lineno: int + tests: Any + filters: Any + debug_info: Any + def __init__(self, environment, name, filename, stream: Optional[Any] = ..., defer_init: bool = ...) -> None: ... + def fail(self, msg, lineno): ... + def temporary_identifier(self): ... + def buffer(self, frame): ... + def return_buffer_contents(self, frame): ... + def indent(self): ... + def outdent(self, step: int = ...): ... + def start_write(self, frame, node: Optional[Any] = ...): ... + def end_write(self, frame): ... + def simple_write(self, s, frame, node: Optional[Any] = ...): ... + def blockvisit(self, nodes, frame): ... + def write(self, x): ... + def writeline(self, x, node: Optional[Any] = ..., extra: int = ...): ... + def newline(self, node: Optional[Any] = ..., extra: int = ...): ... + def signature(self, node, frame, extra_kwargs: Optional[Any] = ...): ... + def pull_locals(self, frame): ... + def pull_dependencies(self, nodes): ... + def unoptimize_scope(self, frame): ... + def push_scope(self, frame, extra_vars: Any = ...): ... + def pop_scope(self, aliases, frame): ... + def function_scoping(self, node, frame, children: Optional[Any] = ..., find_special: bool = ...): ... + def macro_body(self, node, frame, children: Optional[Any] = ...): ... + def macro_def(self, node, frame): ... + def position(self, node): ... + def visit_Template(self, node, frame: Optional[Any] = ...): ... + def visit_Block(self, node, frame): ... + def visit_Extends(self, node, frame): ... + def visit_Include(self, node, frame): ... + def visit_Import(self, node, frame): ... + def visit_FromImport(self, node, frame): ... + def visit_For(self, node, frame): ... + def visit_If(self, node, frame): ... + def visit_Macro(self, node, frame): ... + def visit_CallBlock(self, node, frame): ... + def visit_FilterBlock(self, node, frame): ... + def visit_ExprStmt(self, node, frame): ... + def visit_Output(self, node, frame): ... + def make_assignment_frame(self, frame): ... + def export_assigned_vars(self, frame, assignment_frame): ... + def visit_Assign(self, node, frame): ... + def visit_AssignBlock(self, node, frame): ... + def visit_Name(self, node, frame): ... + def visit_Const(self, node, frame): ... + def visit_TemplateData(self, node, frame): ... + def visit_Tuple(self, node, frame): ... + def visit_List(self, node, frame): ... + def visit_Dict(self, node, frame): ... + def binop(self, interceptable: bool = ...): ... + def uaop(self, interceptable: bool = ...): ... + visit_Add: Any + visit_Sub: Any + visit_Mul: Any + visit_Div: Any + visit_FloorDiv: Any + visit_Pow: Any + visit_Mod: Any + visit_And: Any + visit_Or: Any + visit_Pos: Any + visit_Neg: Any + visit_Not: Any + def visit_Concat(self, node, frame): ... + def visit_Compare(self, node, frame): ... + def visit_Operand(self, node, frame): ... + def visit_Getattr(self, node, frame): ... + def visit_Getitem(self, node, frame): ... + def visit_Slice(self, node, frame): ... + def visit_Filter(self, node, frame): ... + def visit_Test(self, node, frame): ... + def visit_CondExpr(self, node, frame): ... + def visit_Call(self, node, frame, forward_caller: bool = ...): ... + def visit_Keyword(self, node, frame): ... + def visit_MarkSafe(self, node, frame): ... + def visit_MarkSafeIfAutoescape(self, node, frame): ... + def visit_EnvironmentAttribute(self, node, frame): ... + def visit_ExtensionAttribute(self, node, frame): ... + def visit_ImportedName(self, node, frame): ... + def visit_InternalName(self, node, frame): ... + def visit_ContextReference(self, node, frame): ... + def visit_Continue(self, node, frame): ... + def visit_Break(self, node, frame): ... + def visit_Scope(self, node, frame): ... + def visit_EvalContextModifier(self, node, frame): ... + def visit_ScopedEvalContextModifier(self, node, frame): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/jinja2/constants.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/jinja2/constants.pyi new file mode 100644 index 0000000..55ea3ea --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/jinja2/constants.pyi @@ -0,0 +1 @@ +LOREM_IPSUM_WORDS: str diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/jinja2/debug.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/jinja2/debug.pyi new file mode 100644 index 0000000..f495a4d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/jinja2/debug.pyi @@ -0,0 +1,37 @@ +from typing import Any, Optional + +tproxy: Any +raise_helper: str + +class TracebackFrameProxy: + tb: Any + def __init__(self, tb) -> None: ... + @property + def tb_next(self): ... + def set_next(self, next): ... + @property + def is_jinja_frame(self): ... + def __getattr__(self, name): ... + +def make_frame_proxy(frame): ... + +class ProcessedTraceback: + exc_type: Any + exc_value: Any + frames: Any + def __init__(self, exc_type, exc_value, frames) -> None: ... + def render_as_text(self, limit: Optional[Any] = ...): ... + def render_as_html(self, full: bool = ...): ... + @property + def is_template_syntax_error(self): ... + @property + def exc_info(self): ... + @property + def standard_exc_info(self): ... + +def make_traceback(exc_info, source_hint: Optional[Any] = ...): ... +def translate_syntax_error(error, source: Optional[Any] = ...): ... +def translate_exception(exc_info, initial_skip: int = ...): ... +def fake_exc_info(exc_info, filename, lineno): ... + +tb_set_next: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/jinja2/defaults.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/jinja2/defaults.pyi new file mode 100644 index 0000000..e89d3ce --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/jinja2/defaults.pyi @@ -0,0 +1,21 @@ +from typing import Any +from jinja2.filters import FILTERS as DEFAULT_FILTERS +from jinja2.tests import TESTS as DEFAULT_TESTS + +BLOCK_START_STRING: str +BLOCK_END_STRING: str +VARIABLE_START_STRING: str +VARIABLE_END_STRING: str +COMMENT_START_STRING: str +COMMENT_END_STRING: str +LINE_STATEMENT_PREFIX: Any +LINE_COMMENT_PREFIX: Any +TRIM_BLOCKS: bool +LSTRIP_BLOCKS: bool +NEWLINE_SEQUENCE: str +KEEP_TRAILING_NEWLINE: bool +DEFAULT_NAMESPACE: Any + +# Names in __all__ with no definition: +# DEFAULT_FILTERS +# DEFAULT_TESTS diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/jinja2/environment.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/jinja2/environment.pyi new file mode 100644 index 0000000..f5997a3 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/jinja2/environment.pyi @@ -0,0 +1,125 @@ +import sys +from typing import Any, Callable, Dict, Iterator, List, Optional, Text, Type, Union + +from .bccache import BytecodeCache +from .loaders import BaseLoader +from .runtime import Context, Undefined + +if sys.version_info >= (3, 6): + from typing import Awaitable, AsyncIterator + +def get_spontaneous_environment(*args): ... +def create_cache(size): ... +def copy_cache(cache): ... +def load_extensions(environment, extensions): ... + +class Environment: + sandboxed: bool + overlayed: bool + linked_to: Any + shared: bool + exception_handler: Any + exception_formatter: Any + code_generator_class: Any + context_class: Any + block_start_string: Text + block_end_string: Text + variable_start_string: Text + variable_end_string: Text + comment_start_string: Text + comment_end_string: Text + line_statement_prefix: Text + line_comment_prefix: Text + trim_blocks: bool + lstrip_blocks: Any + newline_sequence: Text + keep_trailing_newline: bool + undefined: Type[Undefined] + optimized: bool + finalize: Callable + autoescape: Any + filters: Any + tests: Any + globals: Dict[str, Any] + loader: BaseLoader + cache: Any + bytecode_cache: BytecodeCache + auto_reload: bool + extensions: List + def __init__(self, block_start_string: Text = ..., block_end_string: Text = ..., variable_start_string: Text = ..., variable_end_string: Text = ..., comment_start_string: Any = ..., comment_end_string: Text = ..., line_statement_prefix: Text = ..., line_comment_prefix: Text = ..., trim_blocks: bool = ..., lstrip_blocks: bool = ..., newline_sequence: Text = ..., keep_trailing_newline: bool = ..., extensions: List = ..., optimized: bool = ..., undefined: Type[Undefined] = ..., finalize: Optional[Callable] = ..., autoescape: Union[bool, Callable[[str], bool]] = ..., loader: Optional[BaseLoader] = ..., cache_size: int = ..., auto_reload: bool = ..., bytecode_cache: Optional[BytecodeCache] = ..., enable_async: bool = ...) -> None: ... + def add_extension(self, extension): ... + def extend(self, **attributes): ... + def overlay(self, block_start_string: Text = ..., block_end_string: Text = ..., variable_start_string: Text = ..., variable_end_string: Text = ..., comment_start_string: Any = ..., comment_end_string: Text = ..., line_statement_prefix: Text = ..., line_comment_prefix: Text = ..., trim_blocks: bool = ..., lstrip_blocks: bool = ..., extensions: List = ..., optimized: bool = ..., undefined: Type[Undefined] = ..., finalize: Callable = ..., autoescape: bool = ..., loader: Optional[BaseLoader] = ..., cache_size: int = ..., auto_reload: bool = ..., bytecode_cache: Optional[BytecodeCache] = ...): ... + lexer: Any + def iter_extensions(self): ... + def getitem(self, obj, argument): ... + def getattr(self, obj, attribute): ... + def call_filter(self, name, value, args: Optional[Any] = ..., kwargs: Optional[Any] = ..., context: Optional[Any] = ..., eval_ctx: Optional[Any] = ...): ... + def call_test(self, name, value, args: Optional[Any] = ..., kwargs: Optional[Any] = ...): ... + def parse(self, source, name: Optional[Any] = ..., filename: Optional[Any] = ...): ... + def lex(self, source, name: Optional[Any] = ..., filename: Optional[Any] = ...): ... + def preprocess(self, source: Text, name: Optional[Any] = ..., filename: Optional[Any] = ...): ... + def compile(self, source, name: Optional[Any] = ..., filename: Optional[Any] = ..., raw: bool = ..., defer_init: bool = ...): ... + def compile_expression(self, source: Text, undefined_to_none: bool = ...): ... + def compile_templates(self, target, extensions: Optional[Any] = ..., filter_func: Optional[Any] = ..., zip: str = ..., log_function: Optional[Any] = ..., ignore_errors: bool = ..., py_compile: bool = ...): ... + def list_templates(self, extensions: Optional[Any] = ..., filter_func: Optional[Any] = ...): ... + def handle_exception(self, exc_info: Optional[Any] = ..., rendered: bool = ..., source_hint: Optional[Any] = ...): ... + def join_path(self, template: Union[Template, Text], parent: Text) -> Text: ... + def get_template(self, name: Union[Template, Text], parent: Optional[Text] = ..., globals: Optional[Any] = ...) -> Template: ... + def select_template(self, names: List[Union[Template, Text]], parent: Optional[Text] = ..., globals: Optional[Dict[str, Any]] = ...) -> Template: ... + def get_or_select_template(self, template_name_or_list: Union[Union[Template, Text], List[Union[Template, Text]]], parent: Optional[Text] = ..., globals: Optional[Dict[str, Any]] = ...) -> Template: ... + def from_string(self, source: Text, globals: Optional[Dict[str, Any]] = ..., template_class: Optional[Type[Template]] = ...) -> Template: ... + def make_globals(self, d: Optional[Dict[str, Any]]) -> Dict[str, Any]: ... + + # Frequently added extensions are included here: + # from InternationalizationExtension: + def install_gettext_translations(self, translations: Any, newstyle: Optional[bool]): ... + def install_null_translations(self, newstyle: Optional[bool]): ... + def install_gettext_callables(self, gettext: Callable, ngettext: Callable, + newstyle: Optional[bool]): ... + def uninstall_gettext_translations(self, translations: Any): ... + def extract_translations(self, source: Any, gettext_functions: Any): ... + newstyle_gettext: bool + +class Template: + def __new__(cls, source, block_start_string: Any = ..., block_end_string: Any = ..., variable_start_string: Any = ..., variable_end_string: Any = ..., comment_start_string: Any = ..., comment_end_string: Any = ..., line_statement_prefix: Any = ..., line_comment_prefix: Any = ..., trim_blocks: Any = ..., lstrip_blocks: Any = ..., newline_sequence: Any = ..., keep_trailing_newline: Any = ..., extensions: Any = ..., optimized: bool = ..., undefined: Any = ..., finalize: Optional[Any] = ..., autoescape: bool = ...): ... + environment: Environment = ... + @classmethod + def from_code(cls, environment, code, globals, uptodate: Optional[Any] = ...): ... + @classmethod + def from_module_dict(cls, environment, module_dict, globals): ... + def render(self, *args, **kwargs) -> Text: ... + def stream(self, *args, **kwargs) -> TemplateStream: ... + def generate(self, *args, **kwargs) -> Iterator[Text]: ... + def new_context(self, vars: Optional[Dict[str, Any]] = ..., shared: bool = ..., locals: Optional[Dict[str, Any]] = ...) -> Context: ... + def make_module(self, vars: Optional[Dict[str, Any]] = ..., shared: bool = ..., locals: Optional[Dict[str, Any]] = ...) -> Context: ... + @property + def module(self) -> Any: ... + def get_corresponding_lineno(self, lineno): ... + @property + def is_up_to_date(self) -> bool: ... + @property + def debug_info(self): ... + + if sys.version_info >= (3, 6): + def render_async(self, *args, **kwargs) -> Awaitable[Text]: ... + def generate_async(self, *args, **kwargs) -> AsyncIterator[Text]: ... + + +class TemplateModule: + __name__: Any + def __init__(self, template, context) -> None: ... + def __html__(self): ... + +class TemplateExpression: + def __init__(self, template, undefined_to_none) -> None: ... + def __call__(self, *args, **kwargs): ... + +class TemplateStream: + def __init__(self, gen) -> None: ... + def dump(self, fp, encoding: Optional[Text] = ..., errors: Text = ...): ... + buffered: bool + def disable_buffering(self) -> None: ... + def enable_buffering(self, size: int = ...) -> None: ... + def __iter__(self): ... + def __next__(self): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/jinja2/exceptions.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/jinja2/exceptions.pyi new file mode 100644 index 0000000..8f6be75 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/jinja2/exceptions.pyi @@ -0,0 +1,31 @@ +from typing import Any, Optional, Text + +class TemplateError(Exception): + def __init__(self, message: Optional[Text] = ...) -> None: ... + @property + def message(self): ... + def __unicode__(self): ... + +class TemplateNotFound(IOError, LookupError, TemplateError): + message: Any + name: Any + templates: Any + def __init__(self, name, message: Optional[Text] = ...) -> None: ... + +class TemplatesNotFound(TemplateNotFound): + templates: Any + def __init__(self, names: Any = ..., message: Optional[Text] = ...) -> None: ... + +class TemplateSyntaxError(TemplateError): + lineno: int + name: Text + filename: Text + source: Text + translated: bool + def __init__(self, message: Text, lineno: int, name: Optional[Text] = ..., filename: Optional[Text] = ...) -> None: ... + +class TemplateAssertionError(TemplateSyntaxError): ... +class TemplateRuntimeError(TemplateError): ... +class UndefinedError(TemplateRuntimeError): ... +class SecurityError(TemplateRuntimeError): ... +class FilterArgumentError(TemplateRuntimeError): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/jinja2/ext.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/jinja2/ext.pyi new file mode 100644 index 0000000..2835860 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/jinja2/ext.pyi @@ -0,0 +1,58 @@ +from typing import Any, Optional + +GETTEXT_FUNCTIONS: Any + +class ExtensionRegistry(type): + def __new__(cls, name, bases, d): ... + +class Extension: + tags: Any + priority: int + environment: Any + def __init__(self, environment) -> None: ... + def bind(self, environment): ... + def preprocess(self, source, name, filename: Optional[Any] = ...): ... + def filter_stream(self, stream): ... + def parse(self, parser): ... + def attr(self, name, lineno: Optional[Any] = ...): ... + def call_method(self, name, args: Optional[Any] = ..., kwargs: Optional[Any] = ..., dyn_args: Optional[Any] = ..., dyn_kwargs: Optional[Any] = ..., lineno: Optional[Any] = ...): ... + +class InternationalizationExtension(Extension): + tags: Any + def __init__(self, environment) -> None: ... + def parse(self, parser): ... + +class ExprStmtExtension(Extension): + tags: Any + def parse(self, parser): ... + +class LoopControlExtension(Extension): + tags: Any + def parse(self, parser): ... + +class WithExtension(Extension): + tags: Any + def parse(self, parser): ... + +class AutoEscapeExtension(Extension): + tags: Any + def parse(self, parser): ... + +def extract_from_ast(node, gettext_functions: Any = ..., babel_style: bool = ...): ... + +class _CommentFinder: + tokens: Any + comment_tags: Any + offset: int + last_lineno: int + def __init__(self, tokens, comment_tags) -> None: ... + def find_backwards(self, offset): ... + def find_comments(self, lineno): ... + +def babel_extract(fileobj, keywords, comment_tags, options): ... + +i18n: Any +do: Any +loopcontrols: Any +with_: Any +autoescape: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/jinja2/filters.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/jinja2/filters.pyi new file mode 100644 index 0000000..e0d9c8e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/jinja2/filters.pyi @@ -0,0 +1,57 @@ +from typing import Any, Optional + +def contextfilter(f): ... +def evalcontextfilter(f): ... +def environmentfilter(f): ... +def make_attrgetter(environment, attribute): ... +def do_forceescape(value): ... +def do_urlencode(value): ... +def do_replace(eval_ctx, s, old, new, count: Optional[Any] = ...): ... +def do_upper(s): ... +def do_lower(s): ... +def do_xmlattr(_eval_ctx, d, autospace: bool = ...): ... +def do_capitalize(s): ... +def do_title(s): ... +def do_dictsort(value, case_sensitive: bool = ..., by: str = ...): ... +def do_sort(environment, value, reverse: bool = ..., case_sensitive: bool = ..., attribute: Optional[Any] = ...): ... +def do_default(value, default_value: str = ..., boolean: bool = ...): ... +def do_join(eval_ctx, value, d: str = ..., attribute: Optional[Any] = ...): ... +def do_center(value, width: int = ...): ... +def do_first(environment, seq): ... +def do_last(environment, seq): ... +def do_random(environment, seq): ... +def do_filesizeformat(value, binary: bool = ...): ... +def do_pprint(value, verbose: bool = ...): ... +def do_urlize(eval_ctx, value, trim_url_limit: Optional[Any] = ..., nofollow: bool = ..., target: Optional[Any] = ...): ... +def do_indent(s, width: int = ..., indentfirst: bool = ...): ... +def do_truncate(s, length: int = ..., killwords: bool = ..., end: str = ...): ... +def do_wordwrap(environment, s, width: int = ..., break_long_words: bool = ..., wrapstring: Optional[Any] = ...): ... +def do_wordcount(s): ... +def do_int(value, default: int = ..., base: int = ...): ... +def do_float(value, default: float = ...): ... +def do_format(value, *args, **kwargs): ... +def do_trim(value): ... +def do_striptags(value): ... +def do_slice(value, slices, fill_with: Optional[Any] = ...): ... +def do_batch(value, linecount, fill_with: Optional[Any] = ...): ... +def do_round(value, precision: int = ..., method: str = ...): ... +def do_groupby(environment, value, attribute): ... + +class _GroupTuple(tuple): + grouper: Any + list: Any + def __new__(cls, xxx_todo_changeme): ... + +def do_sum(environment, iterable, attribute: Optional[Any] = ..., start: int = ...): ... +def do_list(value): ... +def do_mark_safe(value): ... +def do_mark_unsafe(value): ... +def do_reverse(value): ... +def do_attr(environment, obj, name): ... +def do_map(*args, **kwargs): ... +def do_select(*args, **kwargs): ... +def do_reject(*args, **kwargs): ... +def do_selectattr(*args, **kwargs): ... +def do_rejectattr(*args, **kwargs): ... + +FILTERS: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/jinja2/lexer.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/jinja2/lexer.pyi new file mode 100644 index 0000000..182a2fb --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/jinja2/lexer.pyi @@ -0,0 +1,117 @@ +from typing import Any, Optional + +whitespace_re: Any +string_re: Any +integer_re: Any +name_re: Any +float_re: Any +newline_re: Any +TOKEN_ADD: Any +TOKEN_ASSIGN: Any +TOKEN_COLON: Any +TOKEN_COMMA: Any +TOKEN_DIV: Any +TOKEN_DOT: Any +TOKEN_EQ: Any +TOKEN_FLOORDIV: Any +TOKEN_GT: Any +TOKEN_GTEQ: Any +TOKEN_LBRACE: Any +TOKEN_LBRACKET: Any +TOKEN_LPAREN: Any +TOKEN_LT: Any +TOKEN_LTEQ: Any +TOKEN_MOD: Any +TOKEN_MUL: Any +TOKEN_NE: Any +TOKEN_PIPE: Any +TOKEN_POW: Any +TOKEN_RBRACE: Any +TOKEN_RBRACKET: Any +TOKEN_RPAREN: Any +TOKEN_SEMICOLON: Any +TOKEN_SUB: Any +TOKEN_TILDE: Any +TOKEN_WHITESPACE: Any +TOKEN_FLOAT: Any +TOKEN_INTEGER: Any +TOKEN_NAME: Any +TOKEN_STRING: Any +TOKEN_OPERATOR: Any +TOKEN_BLOCK_BEGIN: Any +TOKEN_BLOCK_END: Any +TOKEN_VARIABLE_BEGIN: Any +TOKEN_VARIABLE_END: Any +TOKEN_RAW_BEGIN: Any +TOKEN_RAW_END: Any +TOKEN_COMMENT_BEGIN: Any +TOKEN_COMMENT_END: Any +TOKEN_COMMENT: Any +TOKEN_LINESTATEMENT_BEGIN: Any +TOKEN_LINESTATEMENT_END: Any +TOKEN_LINECOMMENT_BEGIN: Any +TOKEN_LINECOMMENT_END: Any +TOKEN_LINECOMMENT: Any +TOKEN_DATA: Any +TOKEN_INITIAL: Any +TOKEN_EOF: Any +operators: Any +reverse_operators: Any +operator_re: Any +ignored_tokens: Any +ignore_if_empty: Any + +def describe_token(token): ... +def describe_token_expr(expr): ... +def count_newlines(value): ... +def compile_rules(environment): ... + +class Failure: + message: Any + error_class: Any + def __init__(self, message, cls: Any = ...) -> None: ... + def __call__(self, lineno, filename): ... + +class Token(tuple): + lineno: Any + type: Any + value: Any + def __new__(cls, lineno, type, value): ... + def test(self, expr): ... + def test_any(self, *iterable): ... + +class TokenStreamIterator: + stream: Any + def __init__(self, stream) -> None: ... + def __iter__(self): ... + def __next__(self): ... + +class TokenStream: + name: Any + filename: Any + closed: bool + current: Any + def __init__(self, generator, name, filename) -> None: ... + def __iter__(self): ... + def __bool__(self): ... + __nonzero__: Any + eos: Any + def push(self, token): ... + def look(self): ... + def skip(self, n: int = ...): ... + def next_if(self, expr): ... + def skip_if(self, expr): ... + def __next__(self): ... + def close(self): ... + def expect(self, expr): ... + +def get_lexer(environment): ... + +class Lexer: + newline_sequence: Any + keep_trailing_newline: Any + rules: Any + def __init__(self, environment) -> None: ... + def tokenize(self, source, name: Optional[Any] = ..., filename: Optional[Any] = ..., state: Optional[Any] = ...): ... + def wrap(self, stream, name: Optional[Any] = ..., filename: Optional[Any] = ...): ... + def tokeniter(self, source, name, filename: Optional[Any] = ..., state: Optional[Any] = ...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/jinja2/loaders.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/jinja2/loaders.pyi new file mode 100644 index 0000000..330de41 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/jinja2/loaders.pyi @@ -0,0 +1,70 @@ +from typing import Any, Callable, Iterable, List, Optional, Text, Tuple, Union +from types import ModuleType + +from .environment import Environment + +def split_template_path(template: Text) -> List[Text]: ... + +class BaseLoader: + has_source_access: bool + def get_source(self, environment, template): ... + def list_templates(self): ... + def load(self, environment, name, globals: Optional[Any] = ...): ... + +class FileSystemLoader(BaseLoader): + searchpath: Text + encoding: Any + followlinks: Any + def __init__(self, searchpath: Union[Text, Iterable[Text]], encoding: Text = ..., followlinks: bool = ...) -> None: ... + def get_source(self, environment: Environment, template: Text) -> Tuple[Text, Text, Callable]: ... + def list_templates(self): ... + +class PackageLoader(BaseLoader): + encoding: Text + manager: Any + filesystem_bound: Any + provider: Any + package_path: Any + def __init__(self, package_name: Text, package_path: Text = ..., encoding: Text = ...) -> None: ... + def get_source(self, environment: Environment, template: Text) -> Tuple[Text, Text, Callable]: ... + def list_templates(self): ... + +class DictLoader(BaseLoader): + mapping: Any + def __init__(self, mapping) -> None: ... + def get_source(self, environment: Environment, template: Text) -> Tuple[Text, Text, Callable]: ... + def list_templates(self): ... + +class FunctionLoader(BaseLoader): + load_func: Any + def __init__(self, load_func) -> None: ... + def get_source(self, environment: Environment, template: Text) -> Tuple[Text, Optional[Text], Optional[Callable]]: ... + +class PrefixLoader(BaseLoader): + mapping: Any + delimiter: Any + def __init__(self, mapping, delimiter: str = ...) -> None: ... + def get_loader(self, template): ... + def get_source(self, environment: Environment, template: Text) -> Tuple[Text, Text, Callable]: ... + def load(self, environment, name, globals: Optional[Any] = ...): ... + def list_templates(self): ... + +class ChoiceLoader(BaseLoader): + loaders: Any + def __init__(self, loaders) -> None: ... + def get_source(self, environment: Environment, template: Text) -> Tuple[Text, Text, Callable]: ... + def load(self, environment, name, globals: Optional[Any] = ...): ... + def list_templates(self): ... + +class _TemplateModule(ModuleType): ... + +class ModuleLoader(BaseLoader): + has_source_access: bool + module: Any + package_name: Any + def __init__(self, path) -> None: ... + @staticmethod + def get_template_key(name): ... + @staticmethod + def get_module_filename(name): ... + def load(self, environment, name, globals: Optional[Any] = ...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/jinja2/meta.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/jinja2/meta.pyi new file mode 100644 index 0000000..46ca83b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/jinja2/meta.pyi @@ -0,0 +1,11 @@ +from typing import Any +from jinja2.compiler import CodeGenerator + +class TrackingCodeGenerator(CodeGenerator): + undeclared_identifiers: Any + def __init__(self, environment) -> None: ... + def write(self, x): ... + def pull_locals(self, frame): ... + +def find_undeclared_variables(ast): ... +def find_referenced_templates(ast): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/jinja2/nodes.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/jinja2/nodes.pyi new file mode 100644 index 0000000..4fb410d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/jinja2/nodes.pyi @@ -0,0 +1,250 @@ +from typing import Any, Optional + +class Impossible(Exception): ... + +class NodeType(type): + def __new__(cls, name, bases, d): ... + +class EvalContext: + environment: Any + autoescape: Any + volatile: bool + def __init__(self, environment, template_name: Optional[Any] = ...) -> None: ... + def save(self): ... + def revert(self, old): ... + +def get_eval_context(node, ctx): ... + +class Node: + fields: Any + attributes: Any + abstract: bool + def __init__(self, *fields, **attributes) -> None: ... + def iter_fields(self, exclude: Optional[Any] = ..., only: Optional[Any] = ...): ... + def iter_child_nodes(self, exclude: Optional[Any] = ..., only: Optional[Any] = ...): ... + def find(self, node_type): ... + def find_all(self, node_type): ... + def set_ctx(self, ctx): ... + def set_lineno(self, lineno, override: bool = ...): ... + def set_environment(self, environment): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + __hash__: Any + +class Stmt(Node): + abstract: bool + +class Helper(Node): + abstract: bool + +class Template(Node): + fields: Any + +class Output(Stmt): + fields: Any + +class Extends(Stmt): + fields: Any + +class For(Stmt): + fields: Any + +class If(Stmt): + fields: Any + +class Macro(Stmt): + fields: Any + +class CallBlock(Stmt): + fields: Any + +class FilterBlock(Stmt): + fields: Any + +class Block(Stmt): + fields: Any + +class Include(Stmt): + fields: Any + +class Import(Stmt): + fields: Any + +class FromImport(Stmt): + fields: Any + +class ExprStmt(Stmt): + fields: Any + +class Assign(Stmt): + fields: Any + +class AssignBlock(Stmt): + fields: Any + +class Expr(Node): + abstract: bool + def as_const(self, eval_ctx: Optional[Any] = ...): ... + def can_assign(self): ... + +class BinExpr(Expr): + fields: Any + operator: Any + abstract: bool + def as_const(self, eval_ctx: Optional[Any] = ...): ... + +class UnaryExpr(Expr): + fields: Any + operator: Any + abstract: bool + def as_const(self, eval_ctx: Optional[Any] = ...): ... + +class Name(Expr): + fields: Any + def can_assign(self): ... + +class Literal(Expr): + abstract: bool + +class Const(Literal): + fields: Any + def as_const(self, eval_ctx: Optional[Any] = ...): ... + @classmethod + def from_untrusted(cls, value, lineno: Optional[Any] = ..., environment: Optional[Any] = ...): ... + +class TemplateData(Literal): + fields: Any + def as_const(self, eval_ctx: Optional[Any] = ...): ... + +class Tuple(Literal): + fields: Any + def as_const(self, eval_ctx: Optional[Any] = ...): ... + def can_assign(self): ... + +class List(Literal): + fields: Any + def as_const(self, eval_ctx: Optional[Any] = ...): ... + +class Dict(Literal): + fields: Any + def as_const(self, eval_ctx: Optional[Any] = ...): ... + +class Pair(Helper): + fields: Any + def as_const(self, eval_ctx: Optional[Any] = ...): ... + +class Keyword(Helper): + fields: Any + def as_const(self, eval_ctx: Optional[Any] = ...): ... + +class CondExpr(Expr): + fields: Any + def as_const(self, eval_ctx: Optional[Any] = ...): ... + +class Filter(Expr): + fields: Any + def as_const(self, eval_ctx: Optional[Any] = ...): ... + +class Test(Expr): + fields: Any + +class Call(Expr): + fields: Any + def as_const(self, eval_ctx: Optional[Any] = ...): ... + +class Getitem(Expr): + fields: Any + def as_const(self, eval_ctx: Optional[Any] = ...): ... + def can_assign(self): ... + +class Getattr(Expr): + fields: Any + def as_const(self, eval_ctx: Optional[Any] = ...): ... + def can_assign(self): ... + +class Slice(Expr): + fields: Any + def as_const(self, eval_ctx: Optional[Any] = ...): ... + +class Concat(Expr): + fields: Any + def as_const(self, eval_ctx: Optional[Any] = ...): ... + +class Compare(Expr): + fields: Any + def as_const(self, eval_ctx: Optional[Any] = ...): ... + +class Operand(Helper): + fields: Any + +class Mul(BinExpr): + operator: str + +class Div(BinExpr): + operator: str + +class FloorDiv(BinExpr): + operator: str + +class Add(BinExpr): + operator: str + +class Sub(BinExpr): + operator: str + +class Mod(BinExpr): + operator: str + +class Pow(BinExpr): + operator: str + +class And(BinExpr): + operator: str + def as_const(self, eval_ctx: Optional[Any] = ...): ... + +class Or(BinExpr): + operator: str + def as_const(self, eval_ctx: Optional[Any] = ...): ... + +class Not(UnaryExpr): + operator: str + +class Neg(UnaryExpr): + operator: str + +class Pos(UnaryExpr): + operator: str + +class EnvironmentAttribute(Expr): + fields: Any + +class ExtensionAttribute(Expr): + fields: Any + +class ImportedName(Expr): + fields: Any + +class InternalName(Expr): + fields: Any + def __init__(self) -> None: ... + +class MarkSafe(Expr): + fields: Any + def as_const(self, eval_ctx: Optional[Any] = ...): ... + +class MarkSafeIfAutoescape(Expr): + fields: Any + def as_const(self, eval_ctx: Optional[Any] = ...): ... + +class ContextReference(Expr): ... +class Continue(Stmt): ... +class Break(Stmt): ... + +class Scope(Stmt): + fields: Any + +class EvalContextModifier(Stmt): + fields: Any + +class ScopedEvalContextModifier(EvalContextModifier): + fields: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/jinja2/optimizer.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/jinja2/optimizer.pyi new file mode 100644 index 0000000..b55b08a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/jinja2/optimizer.pyi @@ -0,0 +1,29 @@ +from typing import Any +from jinja2.visitor import NodeTransformer + +def optimize(node, environment): ... + +class Optimizer(NodeTransformer): + environment: Any + def __init__(self, environment) -> None: ... + def visit_If(self, node): ... + def fold(self, node): ... + visit_Add: Any + visit_Sub: Any + visit_Mul: Any + visit_Div: Any + visit_FloorDiv: Any + visit_Pow: Any + visit_Mod: Any + visit_And: Any + visit_Or: Any + visit_Pos: Any + visit_Neg: Any + visit_Not: Any + visit_Compare: Any + visit_Getitem: Any + visit_Getattr: Any + visit_Call: Any + visit_Filter: Any + visit_Test: Any + visit_CondExpr: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/jinja2/parser.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/jinja2/parser.pyi new file mode 100644 index 0000000..a16ae8d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/jinja2/parser.pyi @@ -0,0 +1,60 @@ +from typing import Any, Optional + +class Parser: + environment: Any + stream: Any + name: Any + filename: Any + closed: bool + extensions: Any + def __init__(self, environment, source, name: Optional[Any] = ..., filename: Optional[Any] = ..., state: Optional[Any] = ...) -> None: ... + def fail(self, msg, lineno: Optional[Any] = ..., exc: Any = ...): ... + def fail_unknown_tag(self, name, lineno: Optional[Any] = ...): ... + def fail_eof(self, end_tokens: Optional[Any] = ..., lineno: Optional[Any] = ...): ... + def is_tuple_end(self, extra_end_rules: Optional[Any] = ...): ... + def free_identifier(self, lineno: Optional[Any] = ...): ... + def parse_statement(self): ... + def parse_statements(self, end_tokens, drop_needle: bool = ...): ... + def parse_set(self): ... + def parse_for(self): ... + def parse_if(self): ... + def parse_block(self): ... + def parse_extends(self): ... + def parse_import_context(self, node, default): ... + def parse_include(self): ... + def parse_import(self): ... + def parse_from(self): ... + def parse_signature(self, node): ... + def parse_call_block(self): ... + def parse_filter_block(self): ... + def parse_macro(self): ... + def parse_print(self): ... + def parse_assign_target(self, with_tuple: bool = ..., name_only: bool = ..., extra_end_rules: Optional[Any] = ...): ... + def parse_expression(self, with_condexpr: bool = ...): ... + def parse_condexpr(self): ... + def parse_or(self): ... + def parse_and(self): ... + def parse_not(self): ... + def parse_compare(self): ... + def parse_add(self): ... + def parse_sub(self): ... + def parse_concat(self): ... + def parse_mul(self): ... + def parse_div(self): ... + def parse_floordiv(self): ... + def parse_mod(self): ... + def parse_pow(self): ... + def parse_unary(self, with_filter: bool = ...): ... + def parse_primary(self): ... + def parse_tuple(self, simplified: bool = ..., with_condexpr: bool = ..., extra_end_rules: Optional[Any] = ..., explicit_parentheses: bool = ...): ... + def parse_list(self): ... + def parse_dict(self): ... + def parse_postfix(self, node): ... + def parse_filter_expr(self, node): ... + def parse_subscript(self, node): ... + def parse_subscribed(self): ... + def parse_call(self, node): ... + def parse_filter(self, node, start_inline: bool = ...): ... + def parse_test(self, node): ... + def subparse(self, end_tokens: Optional[Any] = ...): ... + def parse(self): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/jinja2/runtime.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/jinja2/runtime.pyi new file mode 100644 index 0000000..271c0ef --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/jinja2/runtime.pyi @@ -0,0 +1,130 @@ +from typing import Any, Dict, Optional, Text, Union +from jinja2.utils import Markup as Markup, escape as escape, missing as missing, concat as concat +from jinja2.exceptions import TemplateRuntimeError as TemplateRuntimeError, TemplateNotFound as TemplateNotFound + +from jinja2.environment import Environment + +to_string: Any +identity: Any + +def markup_join(seq): ... +def unicode_join(seq): ... + +class TemplateReference: + def __init__(self, context) -> None: ... + def __getitem__(self, name): ... + +class Context: + parent: Union[Context, Dict[str, Any]] + vars: Dict[str, Any] + environment: Environment + eval_ctx: Any + exported_vars: Any + name: Text + blocks: Dict[str, Any] + def __init__(self, environment: Environment, parent: Union[Context, Dict[str, Any]], name: Text, blocks: Dict[str, Any]) -> None: ... + def super(self, name, current): ... + def get(self, key, default: Optional[Any] = ...): ... + def resolve(self, key): ... + def get_exported(self): ... + def get_all(self): ... + def call(__self, __obj, *args, **kwargs): ... + def derived(self, locals: Optional[Any] = ...): ... + keys: Any + values: Any + items: Any + iterkeys: Any + itervalues: Any + iteritems: Any + def __contains__(self, name): ... + def __getitem__(self, key): ... + +class BlockReference: + name: Any + def __init__(self, name, context, stack, depth) -> None: ... + @property + def super(self): ... + def __call__(self): ... + +class LoopContext: + index0: int + depth0: Any + def __init__(self, iterable, recurse: Optional[Any] = ..., depth0: int = ...) -> None: ... + def cycle(self, *args): ... + first: Any + last: Any + index: Any + revindex: Any + revindex0: Any + depth: Any + def __len__(self): ... + def __iter__(self): ... + def loop(self, iterable): ... + __call__: Any + @property + def length(self): ... + +class LoopContextIterator: + context: Any + def __init__(self, context) -> None: ... + def __iter__(self): ... + def __next__(self): ... + +class Macro: + name: Any + arguments: Any + defaults: Any + catch_kwargs: Any + catch_varargs: Any + caller: Any + def __init__(self, environment, func, name, arguments, defaults, catch_kwargs, catch_varargs, caller) -> None: ... + def __call__(self, *args, **kwargs): ... + +class Undefined: + def __init__(self, hint: Optional[Any] = ..., obj: Any = ..., name: Optional[Any] = ..., exc: Any = ...) -> None: ... + def __getattr__(self, name): ... + __add__: Any + __radd__: Any + __mul__: Any + __rmul__: Any + __div__: Any + __rdiv__: Any + __truediv__: Any + __rtruediv__: Any + __floordiv__: Any + __rfloordiv__: Any + __mod__: Any + __rmod__: Any + __pos__: Any + __neg__: Any + __call__: Any + __getitem__: Any + __lt__: Any + __le__: Any + __gt__: Any + __ge__: Any + __int__: Any + __float__: Any + __complex__: Any + __pow__: Any + __rpow__: Any + def __eq__(self, other): ... + def __ne__(self, other): ... + def __hash__(self): ... + def __len__(self): ... + def __iter__(self): ... + def __nonzero__(self): ... + __bool__: Any + +def make_logging_undefined(logger: Optional[Any] = ..., base: Optional[Any] = ...): ... + +class DebugUndefined(Undefined): ... + +class StrictUndefined(Undefined): + __iter__: Any + __len__: Any + __nonzero__: Any + __eq__: Any + __ne__: Any + __bool__: Any + __hash__: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/jinja2/sandbox.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/jinja2/sandbox.pyi new file mode 100644 index 0000000..518deca --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/jinja2/sandbox.pyi @@ -0,0 +1,34 @@ +from typing import Any +from jinja2.environment import Environment + +MAX_RANGE: int +UNSAFE_FUNCTION_ATTRIBUTES: Any +UNSAFE_METHOD_ATTRIBUTES: Any +UNSAFE_GENERATOR_ATTRIBUTES: Any + +def safe_range(*args): ... +def unsafe(f): ... +def is_internal_attribute(obj, attr): ... +def modifies_known_mutable(obj, attr): ... + +class SandboxedEnvironment(Environment): + sandboxed: bool + default_binop_table: Any + default_unop_table: Any + intercepted_binops: Any + intercepted_unops: Any + def intercept_unop(self, operator): ... + binop_table: Any + unop_table: Any + def __init__(self, *args, **kwargs) -> None: ... + def is_safe_attribute(self, obj, attr, value): ... + def is_safe_callable(self, obj): ... + def call_binop(self, context, operator, left, right): ... + def call_unop(self, context, operator, arg): ... + def getitem(self, obj, argument): ... + def getattr(self, obj, attribute): ... + def unsafe_undefined(self, obj, attribute): ... + def call(__self, __context, __obj, *args, **kwargs): ... + +class ImmutableSandboxedEnvironment(SandboxedEnvironment): + def is_safe_attribute(self, obj, attr, value): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/jinja2/tests.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/jinja2/tests.pyi new file mode 100644 index 0000000..2645fe9 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/jinja2/tests.pyi @@ -0,0 +1,24 @@ +from typing import Any + +number_re: Any +regex_type: Any +test_callable: Any + +def test_odd(value): ... +def test_even(value): ... +def test_divisibleby(value, num): ... +def test_defined(value): ... +def test_undefined(value): ... +def test_none(value): ... +def test_lower(value): ... +def test_upper(value): ... +def test_string(value): ... +def test_mapping(value): ... +def test_number(value): ... +def test_sequence(value): ... +def test_equalto(value, other): ... +def test_sameas(value, other): ... +def test_iterable(value): ... +def test_escaped(value): ... + +TESTS: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/jinja2/utils.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/jinja2/utils.pyi new file mode 100644 index 0000000..bf5ff83 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/jinja2/utils.pyi @@ -0,0 +1,61 @@ +from typing import Any, Callable, Iterable, Optional + +from markupsafe import Markup as Markup, escape as escape, soft_unicode as soft_unicode + +missing: Any +internal_code: Any +concat: Any + +def contextfunction(f): ... +def evalcontextfunction(f): ... +def environmentfunction(f): ... +def internalcode(f): ... +def is_undefined(obj): ... +def select_autoescape(enabled_extensions: Iterable[str] = ..., disabled_extensions: Iterable[str] = ..., default_for_string: bool = ..., default: bool = ...) -> Callable[[str], bool]: ... +def consume(iterable): ... +def clear_caches(): ... +def import_string(import_name, silent: bool = ...): ... +def open_if_exists(filename, mode: str = ...): ... +def object_type_repr(obj): ... +def pformat(obj, verbose: bool = ...): ... +def urlize(text, trim_url_limit: Optional[Any] = ..., nofollow: bool = ..., target: Optional[Any] = ...): ... +def generate_lorem_ipsum(n: int = ..., html: bool = ..., min: int = ..., max: int = ...): ... +def unicode_urlencode(obj, charset: str = ..., for_qs: bool = ...): ... + +class LRUCache: + capacity: Any + def __init__(self, capacity) -> None: ... + def __getnewargs__(self): ... + def copy(self): ... + def get(self, key, default: Optional[Any] = ...): ... + def setdefault(self, key, default: Optional[Any] = ...): ... + def clear(self): ... + def __contains__(self, key): ... + def __len__(self): ... + def __getitem__(self, key): ... + def __setitem__(self, key, value): ... + def __delitem__(self, key): ... + def items(self): ... + def iteritems(self): ... + def values(self): ... + def itervalue(self): ... + def keys(self): ... + def iterkeys(self): ... + __iter__: Any + def __reversed__(self): ... + __copy__: Any + +class Cycler: + items: Any + def __init__(self, *items) -> None: ... + pos: int + def reset(self): ... + @property + def current(self): ... + def __next__(self): ... + +class Joiner: + sep: Any + used: bool + def __init__(self, sep: str = ...) -> None: ... + def __call__(self): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/jinja2/visitor.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/jinja2/visitor.pyi new file mode 100644 index 0000000..ef34328 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/jinja2/visitor.pyi @@ -0,0 +1,8 @@ +class NodeVisitor: + def get_visitor(self, node): ... + def visit(self, node, *args, **kwargs): ... + def generic_visit(self, node, *args, **kwargs): ... + +class NodeTransformer(NodeVisitor): + def generic_visit(self, node, *args, **kwargs): ... + def visit_list(self, node, *args, **kwargs): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/markupsafe/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/markupsafe/__init__.pyi new file mode 100644 index 0000000..44d15da --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/markupsafe/__init__.pyi @@ -0,0 +1,53 @@ +import sys + +from typing import Any, Callable, Dict, Iterable, List, Optional, Sequence, Text, Tuple, Union +from collections import Mapping +from markupsafe._compat import text_type +import string +from markupsafe._native import escape as escape, escape_silent as escape_silent, soft_unicode as soft_unicode + +class Markup(text_type): + def __new__(cls, base: Text = ..., encoding: Optional[Text] = ..., errors: Text = ...) -> Markup: ... + def __html__(self) -> Markup: ... + def __add__(self, other: text_type) -> Markup: ... + def __radd__(self, other: text_type) -> Markup: ... + def __mul__(self, num: int) -> Markup: ... + def __rmul__(self, num: int) -> Markup: ... + def __mod__(self, *args: Any) -> Markup: ... + def join(self, seq: Iterable[text_type]): ... + def split(self, sep: Optional[text_type] = ..., maxsplit: int = ...) -> List[text_type]: ... + def rsplit(self, sep: Optional[text_type] = ..., maxsplit: int = ...) -> List[text_type]: ... + def splitlines(self, keepends: bool = ...) -> List[text_type]: ... + def unescape(self) -> Text: ... + def striptags(self) -> Text: ... + @classmethod + def escape(cls, s: text_type) -> Markup: ... + def partition(self, sep: text_type) -> Tuple[Markup, Markup, Markup]: ... + def rpartition(self, sep: text_type) -> Tuple[Markup, Markup, Markup]: ... + def format(self, *args, **kwargs) -> Markup: ... + def __html_format__(self, format_spec) -> Markup: ... + def __getslice__(self, start: int, stop: int) -> Markup: ... + def __getitem__(self, i: Union[int, slice]) -> Markup: ... + def capitalize(self) -> Markup: ... + def title(self) -> Markup: ... + def lower(self) -> Markup: ... + def upper(self) -> Markup: ... + def swapcase(self) -> Markup: ... + def replace(self, old: text_type, new: text_type, count: int = ...) -> Markup: ... + def ljust(self, width: int, fillchar: text_type = ...) -> Markup: ... + def rjust(self, width: int, fillchar: text_type = ...) -> Markup: ... + def lstrip(self, chars: Optional[text_type] = ...) -> Markup: ... + def rstrip(self, chars: Optional[text_type] = ...) -> Markup: ... + def strip(self, chars: Optional[text_type] = ...) -> Markup: ... + def center(self, width: int, fillchar: text_type = ...) -> Markup: ... + def zfill(self, width: int) -> Markup: ... + def translate(self, table: Union[Mapping[int, Union[int, text_type, None]], Sequence[Union[int, text_type, None]]]) -> Markup: ... + def expandtabs(self, tabsize: int = ...) -> Markup: ... + +class EscapeFormatter(string.Formatter): + escape: Callable[[text_type], Markup] + def __init__(self, escape: Callable[[text_type], Markup]) -> None: ... + def format_field(self, value: text_type, format_spec: text_type) -> Markup: ... + +if sys.version_info[0] >= 3: + soft_str = soft_unicode diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/markupsafe/_compat.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/markupsafe/_compat.pyi new file mode 100644 index 0000000..7257425 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/markupsafe/_compat.pyi @@ -0,0 +1,19 @@ +import sys + +from typing import Any, Iterator, Mapping, Text, Tuple, TypeVar + +_K = TypeVar('_K') +_V = TypeVar('_V') + +PY2: bool +def iteritems(d: Mapping[_K, _V]) -> Iterator[Tuple[_K, _V]]: ... +if sys.version_info[0] >= 3: + text_type = str + string_types = str, + unichr = chr + int_types = int, +else: + from __builtin__ import unichr as unichr + text_type = unicode + string_types = (str, unicode) + int_types = (int, long) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/markupsafe/_constants.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/markupsafe/_constants.pyi new file mode 100644 index 0000000..a0d67ed --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/markupsafe/_constants.pyi @@ -0,0 +1,3 @@ +from typing import Any, Dict, Text + +HTML_ENTITIES: Dict[Text, int] diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/markupsafe/_native.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/markupsafe/_native.pyi new file mode 100644 index 0000000..ecf20c6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/markupsafe/_native.pyi @@ -0,0 +1,7 @@ +from . import Markup +from ._compat import text_type, string_types +from typing import Union, Text + +def escape(s: Union[Markup, Text]) -> Markup: ... +def escape_silent(s: Union[None, Markup, Text]) -> Markup: ... +def soft_unicode(s: Text) -> text_type: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/markupsafe/_speedups.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/markupsafe/_speedups.pyi new file mode 100644 index 0000000..ecf20c6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/markupsafe/_speedups.pyi @@ -0,0 +1,7 @@ +from . import Markup +from ._compat import text_type, string_types +from typing import Union, Text + +def escape(s: Union[Markup, Text]) -> Markup: ... +def escape_silent(s: Union[None, Markup, Text]) -> Markup: ... +def soft_unicode(s: Text) -> text_type: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/mock.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/mock.pyi new file mode 100644 index 0000000..cb3db61 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/mock.pyi @@ -0,0 +1,146 @@ +# Stubs for mock + +import sys +from typing import Any, Optional, Text, Type + +FILTER_DIR: Any + +class _slotted: ... + +class _SentinelObject: + name: Any + def __init__(self, name: Any) -> None: ... + +class _Sentinel: + def __init__(self) -> None: ... + def __getattr__(self, name: str) -> Any: ... + +sentinel: Any +DEFAULT: Any + +class _CallList(list): + def __contains__(self, value: Any) -> bool: ... + +class _MockIter: + obj: Any + def __init__(self, obj: Any) -> None: ... + def __iter__(self) -> Any: ... + def __next__(self) -> Any: ... + +class Base: + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + +# TODO: Defining this and other mock classes as classes in this stub causes +# many false positives with mypy and production code. See if we can +# improve mypy somehow and use a class with an "Any" base class. +NonCallableMock: Any + +class CallableMixin(Base): + side_effect: Any + def __init__(self, spec: Optional[Any] = ..., side_effect: Optional[Any] = ..., return_value: Any = ..., wraps: Optional[Any] = ..., name: Optional[Any] = ..., spec_set: Optional[Any] = ..., parent: Optional[Any] = ..., _spec_state: Optional[Any] = ..., _new_name: Any = ..., _new_parent: Optional[Any] = ..., **kwargs: Any) -> None: ... + def __call__(_mock_self, *args: Any, **kwargs: Any) -> Any: ... + +Mock: Any + +class _patch: + attribute_name: Any + getter: Any + attribute: Any + new: Any + new_callable: Any + spec: Any + create: bool + has_local: Any + spec_set: Any + autospec: Any + kwargs: Any + additional_patchers: Any + def __init__(self, getter: Any, attribute: Any, new: Any, spec: Any, create: Any, spec_set: Any, autospec: Any, new_callable: Any, kwargs: Any) -> None: ... + def copy(self) -> Any: ... + def __call__(self, func: Any) -> Any: ... + def decorate_class(self, klass: Any) -> Any: ... + def decorate_callable(self, func: Any) -> Any: ... + def get_original(self) -> Any: ... + target: Any + temp_original: Any + is_local: Any + def __enter__(self) -> Any: ... + def __exit__(self, *exc_info: Any) -> Any: ... + def start(self) -> Any: ... + def stop(self) -> Any: ... + +class _patch_dict: + in_dict: Any + values: Any + clear: Any + def __init__(self, in_dict: Any, values: Any = ..., clear: Any = ..., **kwargs: Any) -> None: ... + def __call__(self, f: Any) -> Any: ... + def decorate_class(self, klass: Any) -> Any: ... + def __enter__(self) -> Any: ... + def __exit__(self, *args: Any) -> Any: ... + start: Any + stop: Any + +class _patcher: + TEST_PREFIX: str + dict: Type[_patch_dict] + def __call__(self, target: Any, new: Optional[Any] = ..., spec: Optional[Any] = ..., create: bool = ..., spec_set: Optional[Any] = ..., autospec: Optional[Any] = ..., new_callable: Optional[Any] = ..., **kwargs: Any) -> _patch: ... + def object(self, target: Any, attribute: Text, new: Optional[Any] = ..., spec: Optional[Any] = ..., create: bool = ..., spec_set: Optional[Any] = ..., autospec: Optional[Any] = ..., new_callable: Optional[Any] = ..., **kwargs: Any) -> _patch: ... + def multiple(self, target: Any, spec: Optional[Any] = ..., create: bool = ..., spec_set: Optional[Any] = ..., autospec: Optional[Any] = ..., new_callable: Optional[Any] = ..., **kwargs: Any) -> _patch: ... + def stopall(self) -> None: ... + +patch: _patcher + +class MagicMixin: + def __init__(self, *args: Any, **kw: Any) -> None: ... + +NonCallableMagicMock: Any +MagicMock: Any + +class MagicProxy: + name: Any + parent: Any + def __init__(self, name: Any, parent: Any) -> None: ... + def __call__(self, *args: Any, **kwargs: Any) -> Any: ... + def create_mock(self) -> Any: ... + def __get__(self, obj: Any, _type: Optional[Any] = ...) -> Any: ... + +class _ANY: + def __eq__(self, other: Any) -> bool: ... + def __ne__(self, other: Any) -> bool: ... + +ANY: Any + +class _Call(tuple): + def __new__(cls, value: Any = ..., name: Optional[Any] = ..., parent: Optional[Any] = ..., two: bool = ..., from_kall: bool = ...) -> Any: ... + name: Any + parent: Any + from_kall: Any + def __init__(self, value: Any = ..., name: Optional[Any] = ..., parent: Optional[Any] = ..., two: bool = ..., from_kall: bool = ...) -> None: ... + def __eq__(self, other: Any) -> bool: ... + __ne__: Any + def __call__(self, *args: Any, **kwargs: Any) -> Any: ... + def __getattr__(self, attr: Any) -> Any: ... + def count(self, *args: Any, **kwargs: Any) -> Any: ... + def index(self, *args: Any, **kwargs: Any) -> Any: ... + def call_list(self) -> Any: ... + +call: Any + +def create_autospec(spec: Any, spec_set: Any = ..., instance: Any = ..., _parent: Optional[Any] = ..., _name: Optional[Any] = ..., **kwargs: Any) -> Any: ... + +class _SpecState: + spec: Any + ids: Any + spec_set: Any + parent: Any + instance: Any + name: Any + def __init__(self, spec: Any, spec_set: Any = ..., parent: Optional[Any] = ..., name: Optional[Any] = ..., ids: Optional[Any] = ..., instance: Any = ...) -> None: ... + +def mock_open(mock: Optional[Any] = ..., read_data: Any = ...) -> Any: ... + +PropertyMock: Any + +if sys.version_info >= (3, 7): + def seal(mock: Any) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/mypy_extensions.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/mypy_extensions.pyi new file mode 100644 index 0000000..f9c9ff6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/mypy_extensions.pyi @@ -0,0 +1,44 @@ +import abc +import sys +from typing import ( + Dict, Type, TypeVar, Optional, Union, Any, Generic, Mapping, ItemsView, KeysView, ValuesView +) + +_T = TypeVar('_T') +_U = TypeVar('_U') + +# Internal mypy fallback type for all typed dicts (does not exist at runtime) +class _TypedDict(Mapping[str, object], metaclass=abc.ABCMeta): + def copy(self: _T) -> _T: ... + # Using NoReturn so that only calls using mypy plugin hook that specialize the signature + # can go through. + def setdefault(self, k: NoReturn, default: object) -> object: ... + # Mypy plugin hook for 'pop' expects that 'default' has a type variable type. + def pop(self, k: NoReturn, default: _T = ...) -> object: ... + def update(self: _T, __m: _T) -> None: ... + if sys.version_info < (3, 0): + def has_key(self, k: str) -> bool: ... + def viewitems(self) -> ItemsView[str, object]: ... + def viewkeys(self) -> KeysView[str]: ... + def viewvalues(self) -> ValuesView[object]: ... + def __delitem__(self, k: NoReturn) -> None: ... + +def TypedDict(typename: str, fields: Dict[str, Type[_T]], total: bool = ...) -> Type[dict]: ... + +def Arg(type: _T = ..., name: Optional[str] = ...) -> _T: ... +def DefaultArg(type: _T = ..., name: Optional[str] = ...) -> _T: ... +def NamedArg(type: _T = ..., name: Optional[str] = ...) -> _T: ... +def DefaultNamedArg(type: _T = ..., name: Optional[str] = ...) -> _T: ... +def VarArg(type: _T = ...) -> _T: ... +def KwArg(type: _T = ...) -> _T: ... + +# Return type that indicates a function does not return. +# This type is equivalent to the None type, but the no-op Union is necessary to +# distinguish the None type from the None value. +NoReturn = Union[None] # Deprecated: Use typing.NoReturn instead. + +# This is intended as a class decorator, but mypy rejects abstract classes +# when a Type[_T] is expected, so we can't give it the type we want +def trait(cls: Any) -> Any: ... + +class FlexibleAlias(Generic[_T, _U]): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pycurl.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pycurl.pyi new file mode 100644 index 0000000..0d9da02 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pycurl.pyi @@ -0,0 +1,605 @@ +# TODO(MichalPokorny): more precise types + +from typing import Any, Tuple + +GLOBAL_ACK_EINTR: int +GLOBAL_ALL: int +GLOBAL_DEFAULT: int +GLOBAL_NOTHING: int +GLOBAL_SSL: int +GLOBAL_WIN32: int + +def global_init(option: int) -> None: ... +def global_cleanup() -> None: ... + +version: str + +def version_info() -> Tuple[int, str, int, str, int, str, + int, str, tuple, Any, int, Any]: ... + +class error(Exception): ... + +class Curl(object): + def close(self) -> None: ... + def setopt(self, option: int, value: Any) -> None: ... + def perform(self) -> None: ... + def getinfo(self, info: Any) -> Any: ... + def reset(self) -> None: ... + def unsetopt(self, option: int) -> Any: ... + def pause(self, bitmask: Any) -> Any: ... + def errstr(self) -> str: ... + + # TODO(MichalPokorny): wat? + USERPWD: int + +class CurlMulti(object): + def close(self) -> None: ... + def add_handle(self, obj: Curl) -> None: ... + def remove_handle(self, obj: Curl) -> None: ... + def perform(self) -> Tuple[Any, int]: ... + def fdset(self) -> tuple: ... + def select(self, timeout: float = ...) -> int: ... + def info_read(self, max_objects: int = ...) -> tuple: ... + +class CurlShare(object): + def close(self) -> None: ... + def setopt(self, option: int, value: Any) -> Any: ... + +ACCEPTTIMEOUT_MS: int +ACCEPT_ENCODING: int +ADDRESS_SCOPE: int +APPCONNECT_TIME: int +APPEND: int +AUTOREFERER: int +BUFFERSIZE: int +CAINFO: int +CAPATH: int +CLOSESOCKETFUNCTION: int +COMPILE_DATE: str +COMPILE_LIBCURL_VERSION_NUM: int +COMPILE_PY_VERSION_HEX: int +CONDITION_UNMET: int +CONNECTTIMEOUT: int +CONNECTTIMEOUT_MS: int +CONNECT_ONLY: int +CONNECT_TIME: int +CONTENT_LENGTH_DOWNLOAD: int +CONTENT_LENGTH_UPLOAD: int +CONTENT_TYPE: int +COOKIE: int +COOKIEFILE: int +COOKIEJAR: int +COOKIELIST: int +COOKIESESSION: int +COPYPOSTFIELDS: int +CRLF: int +CRLFILE: int +CSELECT_ERR: int +CSELECT_IN: int +CSELECT_OUT: int +CURL_HTTP_VERSION_1_0: int +CURL_HTTP_VERSION_1_1: int +CURL_HTTP_VERSION_2: int +CURL_HTTP_VERSION_2_0: int +CURL_HTTP_VERSION_LAST: int +CURL_HTTP_VERSION_NONE: int +CUSTOMREQUEST: int +DEBUGFUNCTION: int +DIRLISTONLY: int +DNS_CACHE_TIMEOUT: int +DNS_SERVERS: int +DNS_USE_GLOBAL_CACHE: int +EFFECTIVE_URL: int +EGDSOCKET: int +ENCODING: int +EXPECT_100_TIMEOUT_MS: int +FAILONERROR: int +FILE: int +FOLLOWLOCATION: int +FORBID_REUSE: int +FORM_BUFFER: int +FORM_BUFFERPTR: int +FORM_CONTENTS: int +FORM_CONTENTTYPE: int +FORM_FILE: int +FORM_FILENAME: int +FRESH_CONNECT: int +FTPAPPEND: int +FTPAUTH_DEFAULT: int +FTPAUTH_SSL: int +FTPAUTH_TLS: int +FTPLISTONLY: int +FTPMETHOD_DEFAULT: int +FTPMETHOD_MULTICWD: int +FTPMETHOD_NOCWD: int +FTPMETHOD_SINGLECWD: int +FTPPORT: int +FTPSSLAUTH: int +FTPSSL_ALL: int +FTPSSL_CONTROL: int +FTPSSL_NONE: int +FTPSSL_TRY: int +FTP_ACCOUNT: int +FTP_ALTERNATIVE_TO_USER: int +FTP_CREATE_MISSING_DIRS: int +FTP_ENTRY_PATH: int +FTP_FILEMETHOD: int +FTP_RESPONSE_TIMEOUT: int +FTP_SKIP_PASV_IP: int +FTP_SSL: int +FTP_SSL_CCC: int +FTP_USE_EPRT: int +FTP_USE_EPSV: int +FTP_USE_PRET: int +GSSAPI_DELEGATION: int +GSSAPI_DELEGATION_FLAG: int +GSSAPI_DELEGATION_NONE: int +GSSAPI_DELEGATION_POLICY_FLAG: int +HEADER: int +HEADERFUNCTION: int +HEADEROPT: int +HEADER_SEPARATE: int +HEADER_SIZE: int +HEADER_UNIFIED: int +HTTP200ALIASES: int +HTTPAUTH: int +HTTPAUTH_ANY: int +HTTPAUTH_ANYSAFE: int +HTTPAUTH_AVAIL: int +HTTPAUTH_BASIC: int +HTTPAUTH_DIGEST: int +HTTPAUTH_DIGEST_IE: int +HTTPAUTH_GSSNEGOTIATE: int +HTTPAUTH_NEGOTIATE: int +HTTPAUTH_NONE: int +HTTPAUTH_NTLM: int +HTTPAUTH_NTLM_WB: int +HTTPAUTH_ONLY: int +HTTPGET: int +HTTPHEADER: int +HTTPPOST: int +HTTPPROXYTUNNEL: int +HTTP_CODE: int +HTTP_CONNECTCODE: int +HTTP_CONTENT_DECODING: int +HTTP_TRANSFER_DECODING: int +HTTP_VERSION: int +IGNORE_CONTENT_LENGTH: int +INFILE: int +INFILESIZE: int +INFILESIZE_LARGE: int +INFOTYPE_DATA_IN: int +INFOTYPE_DATA_OUT: int +INFOTYPE_HEADER_IN: int +INFOTYPE_HEADER_OUT: int +INFOTYPE_SSL_DATA_IN: int +INFOTYPE_SSL_DATA_OUT: int +INFOTYPE_TEXT: int +INFO_CERTINFO: int +INFO_COOKIELIST: int +INFO_FILETIME: int +INFO_RTSP_CLIENT_CSEQ: int +INFO_RTSP_CSEQ_RECV: int +INFO_RTSP_SERVER_CSEQ: int +INFO_RTSP_SESSION_ID: int +INTERFACE: int +IOCMD_NOP: int +IOCMD_RESTARTREAD: int +IOCTLDATA: int +IOCTLFUNCTION: int +IOE_FAILRESTART: int +IOE_OK: int +IOE_UNKNOWNCMD: int +IPRESOLVE: int +IPRESOLVE_V4: int +IPRESOLVE_V6: int +IPRESOLVE_WHATEVER: int +ISSUERCERT: int +KEYPASSWD: int +KHMATCH_MISMATCH: int +KHMATCH_MISSING: int +KHMATCH_OK: int +KHSTAT_DEFER: int +KHSTAT_FINE: int +KHSTAT_FINE_ADD_TO_FILE: int +KHSTAT_REJECT: int +KHTYPE_DSS: int +KHTYPE_RSA: int +KHTYPE_RSA1: int +KHTYPE_UNKNOWN: int +KRB4LEVEL: int +KRBLEVEL: int +LASTSOCKET: int +LOCALPORT: int +LOCALPORTRANGE: int +LOCAL_IP: int +LOCAL_PORT: int +LOCK_DATA_COOKIE: int +LOCK_DATA_DNS: int +LOCK_DATA_SSL_SESSION: int +LOGIN_OPTIONS: int +LOW_SPEED_LIMIT: int +LOW_SPEED_TIME: int +MAIL_AUTH: int +MAIL_FROM: int +MAIL_RCPT: int +MAXCONNECTS: int +MAXFILESIZE: int +MAXFILESIZE_LARGE: int +MAXREDIRS: int +MAX_RECV_SPEED_LARGE: int +MAX_SEND_SPEED_LARGE: int +M_CHUNK_LENGTH_PENALTY_SIZE: int +M_CONTENT_LENGTH_PENALTY_SIZE: int +M_MAXCONNECTS: int +M_MAX_HOST_CONNECTIONS: int +M_MAX_PIPELINE_LENGTH: int +M_MAX_TOTAL_CONNECTIONS: int +M_PIPELINING: int +M_PIPELINING_SERVER_BL: int +M_PIPELINING_SITE_BL: int +M_SOCKETFUNCTION: int +M_TIMERFUNCTION: int +NAMELOOKUP_TIME: int +NETRC: int +NETRC_FILE: int +NETRC_IGNORED: int +NETRC_OPTIONAL: int +NETRC_REQUIRED: int +NEW_DIRECTORY_PERMS: int +NEW_FILE_PERMS: int +NOBODY: int +NOPROGRESS: int +NOPROXY: int +NOSIGNAL: int +NUM_CONNECTS: int +OPENSOCKETFUNCTION: int +OPT_CERTINFO: int +OPT_FILETIME: int +OS_ERRNO: int +PASSWORD: int +PATH_AS_IS: int +PAUSE_ALL: int +PAUSE_CONT: int +PAUSE_RECV: int +PAUSE_SEND: int +PINNEDPUBLICKEY: int +PIPEWAIT: int +PIPE_HTTP1: int +PIPE_MULTIPLEX: int +PIPE_NOTHING: int +POLL_IN: int +POLL_INOUT: int +POLL_NONE: int +POLL_OUT: int +POLL_REMOVE: int +PORT: int +POST: int +POST301: int +POSTFIELDS: int +POSTFIELDSIZE: int +POSTFIELDSIZE_LARGE: int +POSTQUOTE: int +POSTREDIR: int +PREQUOTE: int +PRETRANSFER_TIME: int +PRIMARY_IP: int +PRIMARY_PORT: int +PROGRESSFUNCTION: int +PROTOCOLS: int +PROTO_ALL: int +PROTO_DICT: int +PROTO_FILE: int +PROTO_FTP: int +PROTO_FTPS: int +PROTO_GOPHER: int +PROTO_HTTP: int +PROTO_HTTPS: int +PROTO_IMAP: int +PROTO_IMAPS: int +PROTO_LDAP: int +PROTO_LDAPS: int +PROTO_POP3: int +PROTO_POP3S: int +PROTO_RTMP: int +PROTO_RTMPE: int +PROTO_RTMPS: int +PROTO_RTMPT: int +PROTO_RTMPTE: int +PROTO_RTMPTS: int +PROTO_RTSP: int +PROTO_SCP: int +PROTO_SFTP: int +PROTO_SMB: int +PROTO_SMBS: int +PROTO_SMTP: int +PROTO_SMTPS: int +PROTO_TELNET: int +PROTO_TFTP: int +PROXY: int +PROXYAUTH: int +PROXYAUTH_AVAIL: int +PROXYHEADER: int +PROXYPASSWORD: int +PROXYPORT: int +PROXYTYPE: int +PROXYTYPE_HTTP: int +PROXYTYPE_HTTP_1_0: int +PROXYTYPE_SOCKS4: int +PROXYTYPE_SOCKS4A: int +PROXYTYPE_SOCKS5: int +PROXYTYPE_SOCKS5_HOSTNAME: int +PROXYUSERNAME: int +PROXYUSERPWD: int +PROXY_SERVICE_NAME: int +PROXY_TRANSFER_MODE: int +PUT: int +QUOTE: int +RANDOM_FILE: int +RANGE: int +READDATA: int +READFUNCTION: int +READFUNC_ABORT: int +READFUNC_PAUSE: int +REDIRECT_COUNT: int +REDIRECT_TIME: int +REDIRECT_URL: int +REDIR_POST_301: int +REDIR_POST_302: int +REDIR_POST_303: int +REDIR_POST_ALL: int +REDIR_PROTOCOLS: int +REFERER: int +REQUEST_SIZE: int +RESOLVE: int +RESPONSE_CODE: int +RESUME_FROM: int +RESUME_FROM_LARGE: int +SASL_IR: int +SEEKFUNCTION: int +SEEKFUNC_CANTSEEK: int +SEEKFUNC_FAIL: int +SEEKFUNC_OK: int +SERVICE_NAME: int +SHARE: int +SH_SHARE: int +SH_UNSHARE: int +SIZE_DOWNLOAD: int +SIZE_UPLOAD: int +SOCKET_TIMEOUT: int +SOCKOPTFUNCTION: int +SOCKOPT_ALREADY_CONNECTED: int +SOCKOPT_ERROR: int +SOCKOPT_OK: int +SOCKS5_GSSAPI_NEC: int +SOCKS5_GSSAPI_SERVICE: int +SOCKTYPE_ACCEPT: int +SOCKTYPE_IPCXN: int +SPEED_DOWNLOAD: int +SPEED_UPLOAD: int +SSH_AUTH_ANY: int +SSH_AUTH_DEFAULT: int +SSH_AUTH_HOST: int +SSH_AUTH_KEYBOARD: int +SSH_AUTH_NONE: int +SSH_AUTH_PASSWORD: int +SSH_AUTH_PUBLICKEY: int +SSH_AUTH_TYPES: int +SSH_HOST_PUBLIC_KEY_MD5: int +SSH_KEYFUNCTION: int +SSH_KNOWNHOSTS: int +SSH_PRIVATE_KEYFILE: int +SSH_PUBLIC_KEYFILE: int +SSLCERT: int +SSLCERTPASSWD: int +SSLCERTTYPE: int +SSLENGINE: int +SSLENGINE_DEFAULT: int +SSLKEY: int +SSLKEYPASSWD: int +SSLKEYTYPE: int +SSLOPT_ALLOW_BEAST: int +SSLVERSION: int +SSLVERSION_DEFAULT: int +SSLVERSION_SSLv2: int +SSLVERSION_SSLv3: int +SSLVERSION_TLSv1: int +SSLVERSION_TLSv1_0: int +SSLVERSION_TLSv1_1: int +SSLVERSION_TLSv1_2: int +SSL_CIPHER_LIST: int +SSL_ENABLE_ALPN: int +SSL_ENABLE_NPN: int +SSL_ENGINES: int +SSL_FALSESTART: int +SSL_OPTIONS: int +SSL_SESSIONID_CACHE: int +SSL_VERIFYHOST: int +SSL_VERIFYPEER: int +SSL_VERIFYRESULT: int +SSL_VERIFYSTATUS: int +STARTTRANSFER_TIME: int +STDERR: int +TCP_KEEPALIVE: int +TCP_KEEPIDLE: int +TCP_KEEPINTVL: int +TCP_NODELAY: int +TELNETOPTIONS: int +TFTP_BLKSIZE: int +TIMECONDITION: int +TIMECONDITION_IFMODSINCE: int +TIMECONDITION_IFUNMODSINCE: int +TIMECONDITION_LASTMOD: int +TIMECONDITION_NONE: int +TIMEOUT: int +TIMEOUT_MS: int +TIMEVALUE: int +TLSAUTH_PASSWORD: int +TLSAUTH_TYPE: int +TLSAUTH_USERNAME: int +TOTAL_TIME: int +TRANSFERTEXT: int +TRANSFER_ENCODING: int +UNIX_SOCKET_PATH: int +UNRESTRICTED_AUTH: int +UPLOAD: int +URL: int +USERAGENT: int +USERNAME: int +USERPWD: int +USESSL_ALL: int +USESSL_CONTROL: int +USESSL_NONE: int +USESSL_TRY: int +USE_SSL: int +VERBOSE: int +VERSION_ASYNCHDNS: int +VERSION_CONV: int +VERSION_CURLDEBUG: int +VERSION_DEBUG: int +VERSION_GSSAPI: int +VERSION_GSSNEGOTIATE: int +VERSION_HTTP2: int +VERSION_IDN: int +VERSION_IPV6: int +VERSION_KERBEROS4: int +VERSION_KERBEROS5: int +VERSION_LARGEFILE: int +VERSION_LIBZ: int +VERSION_NTLM: int +VERSION_NTLM_WB: int +VERSION_SPNEGO: int +VERSION_SSL: int +VERSION_SSPI: int +VERSION_TLSAUTH_SRP: int +VERSION_UNIX_SOCKETS: int +WILDCARDMATCH: int +WRITEDATA: int +WRITEFUNCTION: int +WRITEFUNC_PAUSE: int +WRITEHEADER: int +XFERINFOFUNCTION: int +XOAUTH2_BEARER: int + +E_ABORTED_BY_CALLBACK: int +E_AGAIN: int +E_ALREADY_COMPLETE: int +E_BAD_CALLING_ORDER: int +E_BAD_CONTENT_ENCODING: int +E_BAD_DOWNLOAD_RESUME: int +E_BAD_FUNCTION_ARGUMENT: int +E_BAD_PASSWORD_ENTERED: int +E_CALL_MULTI_PERFORM: int +E_CHUNK_FAILED: int +E_CONV_FAILED: int +E_CONV_REQD: int +E_COULDNT_CONNECT: int +E_COULDNT_RESOLVE_HOST: int +E_COULDNT_RESOLVE_PROXY: int +E_FAILED_INIT: int +E_FILESIZE_EXCEEDED: int +E_FILE_COULDNT_READ_FILE: int +E_FTP_ACCEPT_FAILED: int +E_FTP_ACCEPT_TIMEOUT: int +E_FTP_ACCESS_DENIED: int +E_FTP_BAD_DOWNLOAD_RESUME: int +E_FTP_BAD_FILE_LIST: int +E_FTP_CANT_GET_HOST: int +E_FTP_CANT_RECONNECT: int +E_FTP_COULDNT_GET_SIZE: int +E_FTP_COULDNT_RETR_FILE: int +E_FTP_COULDNT_SET_ASCII: int +E_FTP_COULDNT_SET_BINARY: int +E_FTP_COULDNT_SET_TYPE: int +E_FTP_COULDNT_STOR_FILE: int +E_FTP_COULDNT_USE_REST: int +E_FTP_PARTIAL_FILE: int +E_FTP_PORT_FAILED: int +E_FTP_PRET_FAILED: int +E_FTP_QUOTE_ERROR: int +E_FTP_SSL_FAILED: int +E_FTP_USER_PASSWORD_INCORRECT: int +E_FTP_WEIRD_227_FORMAT: int +E_FTP_WEIRD_PASS_REPLY: int +E_FTP_WEIRD_PASV_REPLY: int +E_FTP_WEIRD_SERVER_REPLY: int +E_FTP_WEIRD_USER_REPLY: int +E_FTP_WRITE_ERROR: int +E_FUNCTION_NOT_FOUND: int +E_GOT_NOTHING: int +E_HTTP2: int +E_HTTP_NOT_FOUND: int +E_HTTP_PORT_FAILED: int +E_HTTP_POST_ERROR: int +E_HTTP_RANGE_ERROR: int +E_HTTP_RETURNED_ERROR: int +E_INTERFACE_FAILED: int +E_LDAP_CANNOT_BIND: int +E_LDAP_INVALID_URL: int +E_LDAP_SEARCH_FAILED: int +E_LIBRARY_NOT_FOUND: int +E_LOGIN_DENIED: int +E_MALFORMAT_USER: int +E_MULTI_ADDED_ALREADY: int +E_MULTI_BAD_EASY_HANDLE: int +E_MULTI_BAD_HANDLE: int +E_MULTI_BAD_SOCKET: int +E_MULTI_CALL_MULTI_PERFORM: int +E_MULTI_CALL_MULTI_SOCKET: int +E_MULTI_INTERNAL_ERROR: int +E_MULTI_OK: int +E_MULTI_OUT_OF_MEMORY: int +E_MULTI_UNKNOWN_OPTION: int +E_NOT_BUILT_IN: int +E_NO_CONNECTION_AVAILABLE: int +E_OK: int +E_OPERATION_TIMEDOUT: int +E_OPERATION_TIMEOUTED: int +E_OUT_OF_MEMORY: int +E_PARTIAL_FILE: int +E_PEER_FAILED_VERIFICATION: int +E_QUOTE_ERROR: int +E_RANGE_ERROR: int +E_READ_ERROR: int +E_RECV_ERROR: int +E_REMOTE_ACCESS_DENIED: int +E_REMOTE_DISK_FULL: int +E_REMOTE_FILE_EXISTS: int +E_REMOTE_FILE_NOT_FOUND: int +E_RTSP_CSEQ_ERROR: int +E_RTSP_SESSION_ERROR: int +E_SEND_ERROR: int +E_SEND_FAIL_REWIND: int +E_SHARE_IN_USE: int +E_SSH: int +E_SSL_CACERT: int +E_SSL_CACERT_BADFILE: int +E_SSL_CERTPROBLEM: int +E_SSL_CIPHER: int +E_SSL_CONNECT_ERROR: int +E_SSL_CRL_BADFILE: int +E_SSL_ENGINE_INITFAILED: int +E_SSL_ENGINE_NOTFOUND: int +E_SSL_ENGINE_SETFAILED: int +E_SSL_INVALIDCERTSTATUS: int +E_SSL_ISSUER_ERROR: int +E_SSL_PEER_CERTIFICATE: int +E_SSL_PINNEDPUBKEYNOTMATCH: int +E_SSL_SHUTDOWN_FAILED: int +E_TELNET_OPTION_SYNTAX: int +E_TFTP_DISKFULL: int +E_TFTP_EXISTS: int +E_TFTP_ILLEGAL: int +E_TFTP_NOSUCHUSER: int +E_TFTP_NOTFOUND: int +E_TFTP_PERM: int +E_TFTP_UNKNOWNID: int +E_TOO_MANY_REDIRECTS: int +E_UNKNOWN_OPTION: int +E_UNKNOWN_TELNET_OPTION: int +E_UNSUPPORTED_PROTOCOL: int +E_UPLOAD_FAILED: int +E_URL_MALFORMAT: int +E_URL_MALFORMAT_USER: int +E_USE_SSL_FAILED: int +E_WRITE_ERROR: int diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pymysql/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pymysql/__init__.pyi new file mode 100644 index 0000000..523c601 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pymysql/__init__.pyi @@ -0,0 +1,61 @@ +import sys +from typing import Union, Tuple, Callable, FrozenSet + +from .connections import Connection as _Connection +from .constants import FIELD_TYPE as FIELD_TYPE +from .converters import escape_dict as escape_dict, escape_sequence as escape_sequence, escape_string as escape_string +from .err import ( + Warning as Warning, + Error as Error, + InterfaceError as InterfaceError, + DataError as DataError, + DatabaseError as DatabaseError, + OperationalError as OperationalError, + IntegrityError as IntegrityError, + InternalError as InternalError, + NotSupportedError as NotSupportedError, + ProgrammingError as ProgrammingError, + MySQLError as MySQLError, +) +from .times import ( + Date as Date, + Time as Time, + Timestamp as Timestamp, + DateFromTicks as DateFromTicks, + TimeFromTicks as TimeFromTicks, + TimestampFromTicks as TimestampFromTicks, +) + +threadsafety: int +apilevel: str +paramstyle: str + +class DBAPISet(FrozenSet[int]): + def __ne__(self, other) -> bool: ... + def __eq__(self, other) -> bool: ... + def __hash__(self) -> int: ... + +STRING: DBAPISet +BINARY: DBAPISet +NUMBER: DBAPISet +DATE: DBAPISet +TIME: DBAPISet +TIMESTAMP: DBAPISet +DATETIME: DBAPISet +ROWID: DBAPISet + +if sys.version_info >= (3, 0): + def Binary(x) -> bytes: ... +else: + def Binary(x) -> bytearray: ... +def Connect(*args, **kwargs) -> _Connection: ... +def get_client_info() -> str: ... + +connect: Callable[..., _Connection] +Connection: Callable[..., _Connection] +__version__: str +version_info: Tuple[int, int, int, str, int] +NULL: str + +def thread_safe() -> bool: ... +def install_as_MySQLdb() -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pymysql/charset.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pymysql/charset.pyi new file mode 100644 index 0000000..c47679a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pymysql/charset.pyi @@ -0,0 +1,16 @@ +from typing import Any + +MBLENGTH: Any + +class Charset: + is_default: Any + def __init__(self, id, name, collation, is_default): ... + +class Charsets: + def __init__(self): ... + def add(self, c): ... + def by_id(self, id): ... + def by_name(self, name): ... + +def charset_by_name(name): ... +def charset_by_id(id): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pymysql/connections.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pymysql/connections.pyi new file mode 100644 index 0000000..4f1cd04 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pymysql/connections.pyi @@ -0,0 +1,145 @@ +from typing import Any, Optional, Type +from .charset import MBLENGTH as MBLENGTH, charset_by_name as charset_by_name, charset_by_id as charset_by_id +from .cursors import Cursor as Cursor +from .constants import FIELD_TYPE as FIELD_TYPE, FLAG as FLAG +from .constants import SERVER_STATUS as SERVER_STATUS +from .constants import CLIENT as CLIENT +from .constants import COMMAND as COMMAND +from .util import join_bytes as join_bytes, byte2int as byte2int, int2byte as int2byte +from .converters import escape_item as escape_item, encoders as encoders, decoders as decoders +from .err import raise_mysql_exception as raise_mysql_exception, Warning as Warning, Error as Error, InterfaceError as InterfaceError, DataError as DataError, DatabaseError as DatabaseError, OperationalError as OperationalError, IntegrityError as IntegrityError, InternalError as InternalError, NotSupportedError as NotSupportedError, ProgrammingError as ProgrammingError + +sha_new: Any +SSL_ENABLED: Any +DEFAULT_USER: Any +DEBUG: Any +NULL_COLUMN: Any +UNSIGNED_CHAR_COLUMN: Any +UNSIGNED_SHORT_COLUMN: Any +UNSIGNED_INT24_COLUMN: Any +UNSIGNED_INT64_COLUMN: Any +UNSIGNED_CHAR_LENGTH: Any +UNSIGNED_SHORT_LENGTH: Any +UNSIGNED_INT24_LENGTH: Any +UNSIGNED_INT64_LENGTH: Any +DEFAULT_CHARSET: Any + +def dump_packet(data): ... + +SCRAMBLE_LENGTH_323: Any + +class RandStruct_323: + max_value: Any + seed1: Any + seed2: Any + def __init__(self, seed1, seed2): ... + def my_rnd(self): ... + +def pack_int24(n): ... +def unpack_uint16(n): ... +def unpack_int24(n): ... +def unpack_int32(n): ... +def unpack_int64(n): ... +def defaulterrorhandler(connection, cursor, errorclass, errorvalue): ... + +class MysqlPacket: + connection: Any + def __init__(self, connection): ... + def packet_number(self): ... + def get_all_data(self): ... + def read(self, size): ... + def read_all(self): ... + def advance(self, length): ... + def rewind(self, position: int = ...): ... + def peek(self, size): ... + def get_bytes(self, position, length: int = ...): ... + def read_length_coded_binary(self): ... + def read_length_coded_string(self): ... + def is_ok_packet(self): ... + def is_eof_packet(self): ... + def is_resultset_packet(self): ... + def is_error_packet(self): ... + def check_error(self): ... + def dump(self): ... + +class FieldDescriptorPacket(MysqlPacket): + def __init__(self, *args): ... + def description(self): ... + def get_column_length(self): ... + +class Connection: + errorhandler: Any + ssl: Any + host: Any + port: Any + user: Any + password: Any + db: Any + unix_socket: Any + charset: Any + use_unicode: Any + client_flag: Any + cursorclass: Any + connect_timeout: Any + messages: Any + encoders: Any + decoders: Any + host_info: Any + def __init__(self, host: str = ..., user: Optional[Any] = ..., passwd: str = ..., db: Optional[Any] = ..., + port: int = ..., unix_socket: Optional[Any] = ..., charset: str = ..., sql_mode: Optional[Any] = ..., + read_default_file: Optional[Any] = ..., conv=..., use_unicode: Optional[Any] = ..., client_flag: int = ..., + cursorclass=..., init_command: Optional[Any] = ..., connect_timeout: Optional[Any] = ..., + ssl: Optional[Any] = ..., read_default_group: Optional[Any] = ..., compress: Optional[Any] = ..., + named_pipe: Optional[Any] = ...): ... + socket: Any + rfile: Any + wfile: Any + def close(self): ... + def autocommit(self, value): ... + def commit(self): ... + def begin(self) -> None: ... + def rollback(self): ... + def escape(self, obj): ... + def literal(self, obj): ... + def cursor(self, cursor: Optional[Type[Cursor]] = ...): ... + def __enter__(self): ... + def __exit__(self, exc, value, traceback): ... + def query(self, sql): ... + def next_result(self, unbuffered: bool = ...): ... + def affected_rows(self): ... + def kill(self, thread_id): ... + def ping(self, reconnect: bool = ...): ... + def set_charset(self, charset): ... + def read_packet(self, packet_type=...): ... + def insert_id(self): ... + def thread_id(self): ... + def character_set_name(self): ... + def get_host_info(self): ... + def get_proto_info(self): ... + def get_server_info(self): ... + def show_warnings(self): ... + Warning: Any + Error: Any + InterfaceError: Any + DatabaseError: Any + DataError: Any + OperationalError: Any + IntegrityError: Any + InternalError: Any + ProgrammingError: Any + NotSupportedError: Any + +class MySQLResult: + connection: Any + affected_rows: Any + insert_id: Any + server_status: Any + warning_count: Any + message: Any + field_count: Any + description: Any + rows: Any + has_next: Any + def __init__(self, connection): ... + first_packet: Any + def read(self): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/CLIENT.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/CLIENT.pyi new file mode 100644 index 0000000..ac8fb55 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/CLIENT.pyi @@ -0,0 +1,18 @@ +LONG_PASSWORD: int +FOUND_ROWS: int +LONG_FLAG: int +CONNECT_WITH_DB: int +NO_SCHEMA: int +COMPRESS: int +ODBC: int +LOCAL_FILES: int +IGNORE_SPACE: int +PROTOCOL_41: int +INTERACTIVE: int +SSL: int +IGNORE_SIGPIPE: int +TRANSACTIONS: int +SECURE_CONNECTION: int +MULTI_STATEMENTS: int +MULTI_RESULTS: int +CAPABILITIES: int diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/COMMAND.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/COMMAND.pyi new file mode 100644 index 0000000..1163e6b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/COMMAND.pyi @@ -0,0 +1,22 @@ +COM_SLEEP: int +COM_QUIT: int +COM_INIT_DB: int +COM_QUERY: int +COM_FIELD_LIST: int +COM_CREATE_DB: int +COM_DROP_DB: int +COM_REFRESH: int +COM_SHUTDOWN: int +COM_STATISTICS: int +COM_PROCESS_INFO: int +COM_CONNECT: int +COM_PROCESS_KILL: int +COM_DEBUG: int +COM_PING: int +COM_TIME: int +COM_DELAYED_INSERT: int +COM_CHANGE_USER: int +COM_BINLOG_DUMP: int +COM_TABLE_DUMP: int +COM_CONNECT_OUT: int +COM_REGISTER_SLAVE: int diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/ER.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/ER.pyi new file mode 100644 index 0000000..5f0a432 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/ER.pyi @@ -0,0 +1,471 @@ +ERROR_FIRST: int +HASHCHK: int +NISAMCHK: int +NO: int +YES: int +CANT_CREATE_FILE: int +CANT_CREATE_TABLE: int +CANT_CREATE_DB: int +DB_CREATE_EXISTS: int +DB_DROP_EXISTS: int +DB_DROP_DELETE: int +DB_DROP_RMDIR: int +CANT_DELETE_FILE: int +CANT_FIND_SYSTEM_REC: int +CANT_GET_STAT: int +CANT_GET_WD: int +CANT_LOCK: int +CANT_OPEN_FILE: int +FILE_NOT_FOUND: int +CANT_READ_DIR: int +CANT_SET_WD: int +CHECKREAD: int +DISK_FULL: int +DUP_KEY: int +ERROR_ON_CLOSE: int +ERROR_ON_READ: int +ERROR_ON_RENAME: int +ERROR_ON_WRITE: int +FILE_USED: int +FILSORT_ABORT: int +FORM_NOT_FOUND: int +GET_ERRNO: int +ILLEGAL_HA: int +KEY_NOT_FOUND: int +NOT_FORM_FILE: int +NOT_KEYFILE: int +OLD_KEYFILE: int +OPEN_AS_READONLY: int +OUTOFMEMORY: int +OUT_OF_SORTMEMORY: int +UNEXPECTED_EOF: int +CON_COUNT_ERROR: int +OUT_OF_RESOURCES: int +BAD_HOST_ERROR: int +HANDSHAKE_ERROR: int +DBACCESS_DENIED_ERROR: int +ACCESS_DENIED_ERROR: int +NO_DB_ERROR: int +UNKNOWN_COM_ERROR: int +BAD_NULL_ERROR: int +BAD_DB_ERROR: int +TABLE_EXISTS_ERROR: int +BAD_TABLE_ERROR: int +NON_UNIQ_ERROR: int +SERVER_SHUTDOWN: int +BAD_FIELD_ERROR: int +WRONG_FIELD_WITH_GROUP: int +WRONG_GROUP_FIELD: int +WRONG_SUM_SELECT: int +WRONG_VALUE_COUNT: int +TOO_LONG_IDENT: int +DUP_FIELDNAME: int +DUP_KEYNAME: int +DUP_ENTRY: int +WRONG_FIELD_SPEC: int +PARSE_ERROR: int +EMPTY_QUERY: int +NONUNIQ_TABLE: int +INVALID_DEFAULT: int +MULTIPLE_PRI_KEY: int +TOO_MANY_KEYS: int +TOO_MANY_KEY_PARTS: int +TOO_LONG_KEY: int +KEY_COLUMN_DOES_NOT_EXITS: int +BLOB_USED_AS_KEY: int +TOO_BIG_FIELDLENGTH: int +WRONG_AUTO_KEY: int +READY: int +NORMAL_SHUTDOWN: int +GOT_SIGNAL: int +SHUTDOWN_COMPLETE: int +FORCING_CLOSE: int +IPSOCK_ERROR: int +NO_SUCH_INDEX: int +WRONG_FIELD_TERMINATORS: int +BLOBS_AND_NO_TERMINATED: int +TEXTFILE_NOT_READABLE: int +FILE_EXISTS_ERROR: int +LOAD_INFO: int +ALTER_INFO: int +WRONG_SUB_KEY: int +CANT_REMOVE_ALL_FIELDS: int +CANT_DROP_FIELD_OR_KEY: int +INSERT_INFO: int +UPDATE_TABLE_USED: int +NO_SUCH_THREAD: int +KILL_DENIED_ERROR: int +NO_TABLES_USED: int +TOO_BIG_SET: int +NO_UNIQUE_LOGFILE: int +TABLE_NOT_LOCKED_FOR_WRITE: int +TABLE_NOT_LOCKED: int +BLOB_CANT_HAVE_DEFAULT: int +WRONG_DB_NAME: int +WRONG_TABLE_NAME: int +TOO_BIG_SELECT: int +UNKNOWN_ERROR: int +UNKNOWN_PROCEDURE: int +WRONG_PARAMCOUNT_TO_PROCEDURE: int +WRONG_PARAMETERS_TO_PROCEDURE: int +UNKNOWN_TABLE: int +FIELD_SPECIFIED_TWICE: int +INVALID_GROUP_FUNC_USE: int +UNSUPPORTED_EXTENSION: int +TABLE_MUST_HAVE_COLUMNS: int +RECORD_FILE_FULL: int +UNKNOWN_CHARACTER_SET: int +TOO_MANY_TABLES: int +TOO_MANY_FIELDS: int +TOO_BIG_ROWSIZE: int +STACK_OVERRUN: int +WRONG_OUTER_JOIN: int +NULL_COLUMN_IN_INDEX: int +CANT_FIND_UDF: int +CANT_INITIALIZE_UDF: int +UDF_NO_PATHS: int +UDF_EXISTS: int +CANT_OPEN_LIBRARY: int +CANT_FIND_DL_ENTRY: int +FUNCTION_NOT_DEFINED: int +HOST_IS_BLOCKED: int +HOST_NOT_PRIVILEGED: int +PASSWORD_ANONYMOUS_USER: int +PASSWORD_NOT_ALLOWED: int +PASSWORD_NO_MATCH: int +UPDATE_INFO: int +CANT_CREATE_THREAD: int +WRONG_VALUE_COUNT_ON_ROW: int +CANT_REOPEN_TABLE: int +INVALID_USE_OF_NULL: int +REGEXP_ERROR: int +MIX_OF_GROUP_FUNC_AND_FIELDS: int +NONEXISTING_GRANT: int +TABLEACCESS_DENIED_ERROR: int +COLUMNACCESS_DENIED_ERROR: int +ILLEGAL_GRANT_FOR_TABLE: int +GRANT_WRONG_HOST_OR_USER: int +NO_SUCH_TABLE: int +NONEXISTING_TABLE_GRANT: int +NOT_ALLOWED_COMMAND: int +SYNTAX_ERROR: int +DELAYED_CANT_CHANGE_LOCK: int +TOO_MANY_DELAYED_THREADS: int +ABORTING_CONNECTION: int +NET_PACKET_TOO_LARGE: int +NET_READ_ERROR_FROM_PIPE: int +NET_FCNTL_ERROR: int +NET_PACKETS_OUT_OF_ORDER: int +NET_UNCOMPRESS_ERROR: int +NET_READ_ERROR: int +NET_READ_INTERRUPTED: int +NET_ERROR_ON_WRITE: int +NET_WRITE_INTERRUPTED: int +TOO_LONG_STRING: int +TABLE_CANT_HANDLE_BLOB: int +TABLE_CANT_HANDLE_AUTO_INCREMENT: int +DELAYED_INSERT_TABLE_LOCKED: int +WRONG_COLUMN_NAME: int +WRONG_KEY_COLUMN: int +WRONG_MRG_TABLE: int +DUP_UNIQUE: int +BLOB_KEY_WITHOUT_LENGTH: int +PRIMARY_CANT_HAVE_NULL: int +TOO_MANY_ROWS: int +REQUIRES_PRIMARY_KEY: int +NO_RAID_COMPILED: int +UPDATE_WITHOUT_KEY_IN_SAFE_MODE: int +KEY_DOES_NOT_EXITS: int +CHECK_NO_SUCH_TABLE: int +CHECK_NOT_IMPLEMENTED: int +CANT_DO_THIS_DURING_AN_TRANSACTION: int +ERROR_DURING_COMMIT: int +ERROR_DURING_ROLLBACK: int +ERROR_DURING_FLUSH_LOGS: int +ERROR_DURING_CHECKPOINT: int +NEW_ABORTING_CONNECTION: int +DUMP_NOT_IMPLEMENTED: int +FLUSH_MASTER_BINLOG_CLOSED: int +INDEX_REBUILD: int +MASTER: int +MASTER_NET_READ: int +MASTER_NET_WRITE: int +FT_MATCHING_KEY_NOT_FOUND: int +LOCK_OR_ACTIVE_TRANSACTION: int +UNKNOWN_SYSTEM_VARIABLE: int +CRASHED_ON_USAGE: int +CRASHED_ON_REPAIR: int +WARNING_NOT_COMPLETE_ROLLBACK: int +TRANS_CACHE_FULL: int +SLAVE_MUST_STOP: int +SLAVE_NOT_RUNNING: int +BAD_SLAVE: int +MASTER_INFO: int +SLAVE_THREAD: int +TOO_MANY_USER_CONNECTIONS: int +SET_CONSTANTS_ONLY: int +LOCK_WAIT_TIMEOUT: int +LOCK_TABLE_FULL: int +READ_ONLY_TRANSACTION: int +DROP_DB_WITH_READ_LOCK: int +CREATE_DB_WITH_READ_LOCK: int +WRONG_ARGUMENTS: int +NO_PERMISSION_TO_CREATE_USER: int +UNION_TABLES_IN_DIFFERENT_DIR: int +LOCK_DEADLOCK: int +TABLE_CANT_HANDLE_FT: int +CANNOT_ADD_FOREIGN: int +NO_REFERENCED_ROW: int +ROW_IS_REFERENCED: int +CONNECT_TO_MASTER: int +QUERY_ON_MASTER: int +ERROR_WHEN_EXECUTING_COMMAND: int +WRONG_USAGE: int +WRONG_NUMBER_OF_COLUMNS_IN_SELECT: int +CANT_UPDATE_WITH_READLOCK: int +MIXING_NOT_ALLOWED: int +DUP_ARGUMENT: int +USER_LIMIT_REACHED: int +SPECIFIC_ACCESS_DENIED_ERROR: int +LOCAL_VARIABLE: int +GLOBAL_VARIABLE: int +NO_DEFAULT: int +WRONG_VALUE_FOR_VAR: int +WRONG_TYPE_FOR_VAR: int +VAR_CANT_BE_READ: int +CANT_USE_OPTION_HERE: int +NOT_SUPPORTED_YET: int +MASTER_FATAL_ERROR_READING_BINLOG: int +SLAVE_IGNORED_TABLE: int +INCORRECT_GLOBAL_LOCAL_VAR: int +WRONG_FK_DEF: int +KEY_REF_DO_NOT_MATCH_TABLE_REF: int +OPERAND_COLUMNS: int +SUBQUERY_NO_1_ROW: int +UNKNOWN_STMT_HANDLER: int +CORRUPT_HELP_DB: int +CYCLIC_REFERENCE: int +AUTO_CONVERT: int +ILLEGAL_REFERENCE: int +DERIVED_MUST_HAVE_ALIAS: int +SELECT_REDUCED: int +TABLENAME_NOT_ALLOWED_HERE: int +NOT_SUPPORTED_AUTH_MODE: int +SPATIAL_CANT_HAVE_NULL: int +COLLATION_CHARSET_MISMATCH: int +SLAVE_WAS_RUNNING: int +SLAVE_WAS_NOT_RUNNING: int +TOO_BIG_FOR_UNCOMPRESS: int +ZLIB_Z_MEM_ERROR: int +ZLIB_Z_BUF_ERROR: int +ZLIB_Z_DATA_ERROR: int +CUT_VALUE_GROUP_CONCAT: int +WARN_TOO_FEW_RECORDS: int +WARN_TOO_MANY_RECORDS: int +WARN_NULL_TO_NOTNULL: int +WARN_DATA_OUT_OF_RANGE: int +WARN_DATA_TRUNCATED: int +WARN_USING_OTHER_HANDLER: int +CANT_AGGREGATE_2COLLATIONS: int +DROP_USER: int +REVOKE_GRANTS: int +CANT_AGGREGATE_3COLLATIONS: int +CANT_AGGREGATE_NCOLLATIONS: int +VARIABLE_IS_NOT_STRUCT: int +UNKNOWN_COLLATION: int +SLAVE_IGNORED_SSL_PARAMS: int +SERVER_IS_IN_SECURE_AUTH_MODE: int +WARN_FIELD_RESOLVED: int +BAD_SLAVE_UNTIL_COND: int +MISSING_SKIP_SLAVE: int +UNTIL_COND_IGNORED: int +WRONG_NAME_FOR_INDEX: int +WRONG_NAME_FOR_CATALOG: int +WARN_QC_RESIZE: int +BAD_FT_COLUMN: int +UNKNOWN_KEY_CACHE: int +WARN_HOSTNAME_WONT_WORK: int +UNKNOWN_STORAGE_ENGINE: int +WARN_DEPRECATED_SYNTAX: int +NON_UPDATABLE_TABLE: int +FEATURE_DISABLED: int +OPTION_PREVENTS_STATEMENT: int +DUPLICATED_VALUE_IN_TYPE: int +TRUNCATED_WRONG_VALUE: int +TOO_MUCH_AUTO_TIMESTAMP_COLS: int +INVALID_ON_UPDATE: int +UNSUPPORTED_PS: int +GET_ERRMSG: int +GET_TEMPORARY_ERRMSG: int +UNKNOWN_TIME_ZONE: int +WARN_INVALID_TIMESTAMP: int +INVALID_CHARACTER_STRING: int +WARN_ALLOWED_PACKET_OVERFLOWED: int +CONFLICTING_DECLARATIONS: int +SP_NO_RECURSIVE_CREATE: int +SP_ALREADY_EXISTS: int +SP_DOES_NOT_EXIST: int +SP_DROP_FAILED: int +SP_STORE_FAILED: int +SP_LILABEL_MISMATCH: int +SP_LABEL_REDEFINE: int +SP_LABEL_MISMATCH: int +SP_UNINIT_VAR: int +SP_BADSELECT: int +SP_BADRETURN: int +SP_BADSTATEMENT: int +UPDATE_LOG_DEPRECATED_IGNORED: int +UPDATE_LOG_DEPRECATED_TRANSLATED: int +QUERY_INTERRUPTED: int +SP_WRONG_NO_OF_ARGS: int +SP_COND_MISMATCH: int +SP_NORETURN: int +SP_NORETURNEND: int +SP_BAD_CURSOR_QUERY: int +SP_BAD_CURSOR_SELECT: int +SP_CURSOR_MISMATCH: int +SP_CURSOR_ALREADY_OPEN: int +SP_CURSOR_NOT_OPEN: int +SP_UNDECLARED_VAR: int +SP_WRONG_NO_OF_FETCH_ARGS: int +SP_FETCH_NO_DATA: int +SP_DUP_PARAM: int +SP_DUP_VAR: int +SP_DUP_COND: int +SP_DUP_CURS: int +SP_CANT_ALTER: int +SP_SUBSELECT_NYI: int +STMT_NOT_ALLOWED_IN_SF_OR_TRG: int +SP_VARCOND_AFTER_CURSHNDLR: int +SP_CURSOR_AFTER_HANDLER: int +SP_CASE_NOT_FOUND: int +FPARSER_TOO_BIG_FILE: int +FPARSER_BAD_HEADER: int +FPARSER_EOF_IN_COMMENT: int +FPARSER_ERROR_IN_PARAMETER: int +FPARSER_EOF_IN_UNKNOWN_PARAMETER: int +VIEW_NO_EXPLAIN: int +FRM_UNKNOWN_TYPE: int +WRONG_OBJECT: int +NONUPDATEABLE_COLUMN: int +VIEW_SELECT_DERIVED: int +VIEW_SELECT_CLAUSE: int +VIEW_SELECT_VARIABLE: int +VIEW_SELECT_TMPTABLE: int +VIEW_WRONG_LIST: int +WARN_VIEW_MERGE: int +WARN_VIEW_WITHOUT_KEY: int +VIEW_INVALID: int +SP_NO_DROP_SP: int +SP_GOTO_IN_HNDLR: int +TRG_ALREADY_EXISTS: int +TRG_DOES_NOT_EXIST: int +TRG_ON_VIEW_OR_TEMP_TABLE: int +TRG_CANT_CHANGE_ROW: int +TRG_NO_SUCH_ROW_IN_TRG: int +NO_DEFAULT_FOR_FIELD: int +DIVISION_BY_ZERO: int +TRUNCATED_WRONG_VALUE_FOR_FIELD: int +ILLEGAL_VALUE_FOR_TYPE: int +VIEW_NONUPD_CHECK: int +VIEW_CHECK_FAILED: int +PROCACCESS_DENIED_ERROR: int +RELAY_LOG_FAIL: int +PASSWD_LENGTH: int +UNKNOWN_TARGET_BINLOG: int +IO_ERR_LOG_INDEX_READ: int +BINLOG_PURGE_PROHIBITED: int +FSEEK_FAIL: int +BINLOG_PURGE_FATAL_ERR: int +LOG_IN_USE: int +LOG_PURGE_UNKNOWN_ERR: int +RELAY_LOG_INIT: int +NO_BINARY_LOGGING: int +RESERVED_SYNTAX: int +WSAS_FAILED: int +DIFF_GROUPS_PROC: int +NO_GROUP_FOR_PROC: int +ORDER_WITH_PROC: int +LOGGING_PROHIBIT_CHANGING_OF: int +NO_FILE_MAPPING: int +WRONG_MAGIC: int +PS_MANY_PARAM: int +KEY_PART_0: int +VIEW_CHECKSUM: int +VIEW_MULTIUPDATE: int +VIEW_NO_INSERT_FIELD_LIST: int +VIEW_DELETE_MERGE_VIEW: int +CANNOT_USER: int +XAER_NOTA: int +XAER_INVAL: int +XAER_RMFAIL: int +XAER_OUTSIDE: int +XAER_RMERR: int +XA_RBROLLBACK: int +NONEXISTING_PROC_GRANT: int +PROC_AUTO_GRANT_FAIL: int +PROC_AUTO_REVOKE_FAIL: int +DATA_TOO_LONG: int +SP_BAD_SQLSTATE: int +STARTUP: int +LOAD_FROM_FIXED_SIZE_ROWS_TO_VAR: int +CANT_CREATE_USER_WITH_GRANT: int +WRONG_VALUE_FOR_TYPE: int +TABLE_DEF_CHANGED: int +SP_DUP_HANDLER: int +SP_NOT_VAR_ARG: int +SP_NO_RETSET: int +CANT_CREATE_GEOMETRY_OBJECT: int +FAILED_ROUTINE_BREAK_BINLOG: int +BINLOG_UNSAFE_ROUTINE: int +BINLOG_CREATE_ROUTINE_NEED_SUPER: int +EXEC_STMT_WITH_OPEN_CURSOR: int +STMT_HAS_NO_OPEN_CURSOR: int +COMMIT_NOT_ALLOWED_IN_SF_OR_TRG: int +NO_DEFAULT_FOR_VIEW_FIELD: int +SP_NO_RECURSION: int +TOO_BIG_SCALE: int +TOO_BIG_PRECISION: int +M_BIGGER_THAN_D: int +WRONG_LOCK_OF_SYSTEM_TABLE: int +CONNECT_TO_FOREIGN_DATA_SOURCE: int +QUERY_ON_FOREIGN_DATA_SOURCE: int +FOREIGN_DATA_SOURCE_DOESNT_EXIST: int +FOREIGN_DATA_STRING_INVALID_CANT_CREATE: int +FOREIGN_DATA_STRING_INVALID: int +CANT_CREATE_FEDERATED_TABLE: int +TRG_IN_WRONG_SCHEMA: int +STACK_OVERRUN_NEED_MORE: int +TOO_LONG_BODY: int +WARN_CANT_DROP_DEFAULT_KEYCACHE: int +TOO_BIG_DISPLAYWIDTH: int +XAER_DUPID: int +DATETIME_FUNCTION_OVERFLOW: int +CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG: int +VIEW_PREVENT_UPDATE: int +PS_NO_RECURSION: int +SP_CANT_SET_AUTOCOMMIT: int +MALFORMED_DEFINER: int +VIEW_FRM_NO_USER: int +VIEW_OTHER_USER: int +NO_SUCH_USER: int +FORBID_SCHEMA_CHANGE: int +ROW_IS_REFERENCED_2: int +NO_REFERENCED_ROW_2: int +SP_BAD_VAR_SHADOW: int +TRG_NO_DEFINER: int +OLD_FILE_FORMAT: int +SP_RECURSION_LIMIT: int +SP_PROC_TABLE_CORRUPT: int +SP_WRONG_NAME: int +TABLE_NEEDS_UPGRADE: int +SP_NO_AGGREGATE: int +MAX_PREPARED_STMT_COUNT_REACHED: int +VIEW_RECURSIVE: int +NON_GROUPING_FIELD_USED: int +TABLE_CANT_HANDLE_SPKEYS: int +NO_TRIGGERS_ON_SYSTEM_SCHEMA: int +USERNAME: int +HOSTNAME: int +WRONG_STRING_LENGTH: int +ERROR_LAST: int diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/FIELD_TYPE.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/FIELD_TYPE.pyi new file mode 100644 index 0000000..f1938b0 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/FIELD_TYPE.pyi @@ -0,0 +1,29 @@ +DECIMAL: int +TINY: int +SHORT: int +LONG: int +FLOAT: int +DOUBLE: int +NULL: int +TIMESTAMP: int +LONGLONG: int +INT24: int +DATE: int +TIME: int +DATETIME: int +YEAR: int +NEWDATE: int +VARCHAR: int +BIT: int +NEWDECIMAL: int +ENUM: int +SET: int +TINY_BLOB: int +MEDIUM_BLOB: int +LONG_BLOB: int +BLOB: int +VAR_STRING: int +STRING: int +GEOMETRY: int +CHAR: int +INTERVAL: int diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/FLAG.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/FLAG.pyi new file mode 100644 index 0000000..04b99fa --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/FLAG.pyi @@ -0,0 +1,17 @@ +from typing import Any + +NOT_NULL: Any +PRI_KEY: Any +UNIQUE_KEY: Any +MULTIPLE_KEY: Any +BLOB: Any +UNSIGNED: Any +ZEROFILL: Any +BINARY: Any +ENUM: Any +AUTO_INCREMENT: Any +TIMESTAMP: Any +SET: Any +PART_KEY: Any +GROUP: Any +UNIQUE: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/SERVER_STATUS.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/SERVER_STATUS.pyi new file mode 100644 index 0000000..437b893 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/SERVER_STATUS.pyi @@ -0,0 +1,10 @@ +SERVER_STATUS_IN_TRANS: int +SERVER_STATUS_AUTOCOMMIT: int +SERVER_MORE_RESULTS_EXISTS: int +SERVER_QUERY_NO_GOOD_INDEX_USED: int +SERVER_QUERY_NO_INDEX_USED: int +SERVER_STATUS_CURSOR_EXISTS: int +SERVER_STATUS_LAST_ROW_SENT: int +SERVER_STATUS_DB_DROPPED: int +SERVER_STATUS_NO_BACKSLASH_ESCAPES: int +SERVER_STATUS_METADATA_CHANGED: int diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/__init__.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pymysql/converters.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pymysql/converters.pyi new file mode 100644 index 0000000..fdd7602 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pymysql/converters.pyi @@ -0,0 +1,46 @@ +from typing import Any +from .constants import FIELD_TYPE as FIELD_TYPE, FLAG as FLAG +from .charset import charset_by_id as charset_by_id + +PYTHON3: Any +ESCAPE_REGEX: Any +ESCAPE_MAP: Any + +def escape_item(val, charset): ... +def escape_dict(val, charset): ... +def escape_sequence(val, charset): ... +def escape_set(val, charset): ... +def escape_bool(value): ... +def escape_object(value): ... + +escape_int: Any + +escape_long: Any + +def escape_float(value): ... +def escape_string(value): ... +def escape_unicode(value): ... +def escape_None(value): ... +def escape_timedelta(obj): ... +def escape_time(obj): ... +def escape_datetime(obj): ... +def escape_date(obj): ... +def escape_struct_time(obj): ... +def convert_datetime(connection, field, obj): ... +def convert_timedelta(connection, field, obj): ... +def convert_time(connection, field, obj): ... +def convert_date(connection, field, obj): ... +def convert_mysql_timestamp(connection, field, timestamp): ... +def convert_set(s): ... +def convert_bit(connection, field, b): ... +def convert_characters(connection, field, data): ... +def convert_int(connection, field, data): ... +def convert_long(connection, field, data): ... +def convert_float(connection, field, data): ... + +encoders: Any +decoders: Any +conversions: Any + +def convert_decimal(connection, field, data): ... +def escape_decimal(obj): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pymysql/cursors.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pymysql/cursors.pyi new file mode 100644 index 0000000..e080085 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pymysql/cursors.pyi @@ -0,0 +1,46 @@ +from typing import Union, Tuple, Any, Dict, Optional, Text, Iterator, List +from .connections import Connection + +Gen = Union[Tuple[Any, ...], Dict[str, Any]] + +class Cursor: + connection: Connection + description: Tuple[Text, ...] + rownumber: int + rowcount: int + arraysize: int + messages: Any + errorhandler: Any + lastrowid: int + def __init__(self, connection: Connection) -> None: ... + def __del__(self) -> None: ... + def close(self) -> None: ... + def setinputsizes(self, *args): ... + def setoutputsizes(self, *args): ... + def nextset(self): ... + def execute(self, query: str, args: Optional[Any] = ...) -> int: ... + def executemany(self, query: str, args) -> int: ... + def callproc(self, procname, args=...): ... + def fetchone(self) -> Optional[Gen]: ... + def fetchmany(self, size: Optional[int] = ...) -> Union[Optional[Gen], List[Gen]]: ... + def fetchall(self) -> Optional[Tuple[Gen, ...]]: ... + def scroll(self, value: int, mode: str = ...): ... + def __iter__(self): ... + +class DictCursor(Cursor): + def fetchone(self) -> Optional[Dict[str, Any]]: ... + def fetchmany(self, size: Optional[int] = ...) -> Optional[Tuple[Dict[str, Any], ...]]: ... + def fetchall(self) -> Optional[Tuple[Dict[str, Any], ...]]: ... + +class DictCursorMixin: + dict_type: Any + +class SSCursor(Cursor): + # fetchall return type is incompatible with the supertype. + def fetchall(self) -> List[Gen]: ... # type: ignore + def fetchall_unbuffered(self) -> Iterator[Tuple[Gen, ...]]: ... + def __iter__(self) -> Iterator[Tuple[Gen, ...]]: ... + def fetchmany(self, size: Optional[int] = ...) -> List[Gen]: ... + def scroll(self, value: int, mode: str = ...) -> None: ... + +class SSDictCursor(DictCursorMixin, SSCursor): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pymysql/err.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pymysql/err.pyi new file mode 100644 index 0000000..29d4f55 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pymysql/err.pyi @@ -0,0 +1,18 @@ +from typing import Dict +from .constants import ER as ER + +class MySQLError(Exception): ... +class Warning(MySQLError): ... +class Error(MySQLError): ... +class InterfaceError(Error): ... +class DatabaseError(Error): ... +class DataError(DatabaseError): ... +class OperationalError(DatabaseError): ... +class IntegrityError(DatabaseError): ... +class InternalError(DatabaseError): ... +class ProgrammingError(DatabaseError): ... +class NotSupportedError(DatabaseError): ... + +error_map: Dict + +def raise_mysql_exception(data) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pymysql/times.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pymysql/times.pyi new file mode 100644 index 0000000..c798e65 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pymysql/times.pyi @@ -0,0 +1,10 @@ +from typing import Any + +Date: Any +Time: Any +TimeDelta: Any +Timestamp: Any + +def DateFromTicks(ticks): ... +def TimeFromTicks(ticks): ... +def TimestampFromTicks(ticks): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pymysql/util.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pymysql/util.pyi new file mode 100644 index 0000000..3d9a65b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pymysql/util.pyi @@ -0,0 +1,3 @@ +def byte2int(b): ... +def int2byte(i): ... +def join_bytes(bs): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pynamodb/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pynamodb/__init__.pyi new file mode 100644 index 0000000..83e691d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pynamodb/__init__.pyi @@ -0,0 +1 @@ +__license__: str diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pynamodb/attributes.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pynamodb/attributes.pyi new file mode 100644 index 0000000..3c82474 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pynamodb/attributes.pyi @@ -0,0 +1,96 @@ +from typing import Any, Callable, Dict, Generic, Iterable, List, Mapping, Optional, Text, Type, TypeVar, Union, Set + +from datetime import datetime + +_T = TypeVar('_T') +_KT = TypeVar('_KT') +_VT = TypeVar('_VT') +_MT = TypeVar('_MT', bound='MapAttribute') + +class Attribute(Generic[_T]): + attr_name: Optional[Text] + attr_type: Text + null: bool + default: Any + is_hash_key: bool + is_range_key: bool + def __init__(self, hash_key: bool = ..., range_key: bool = ..., null: Optional[bool] = ..., default: Optional[Union[_T, Callable[..., _T]]] = ..., attr_name: Optional[Text] = ...) -> None: ... + def __set__(self, instance: Any, value: Optional[_T]) -> None: ... + def serialize(self, value: Any) -> Any: ... + def deserialize(self, value: Any) -> Any: ... + def get_value(self, value: Any) -> Any: ... + def between(self, lower: Any, upper: Any) -> Any: ... + def is_in(self, *values: Any) -> Any: ... + def exists(self) -> Any: ... + def does_not_exist(self) -> Any: ... + def is_type(self) -> Any: ... + def startswith(self, prefix: str) -> Any: ... + def contains(self, item: Any) -> Any: ... + def append(self, other: Any) -> Any: ... + def prepend(self, other: Any) -> Any: ... + def set(self, value: Any) -> Any: ... + def remove(self) -> Any: ... + def add(self, *values: Any) -> Any: ... + def delete(self, *values: Any) -> Any: ... + +class SetMixin(object): + def serialize(self, value): ... + def deserialize(self, value): ... + +class BinaryAttribute(Attribute[bytes]): + def __get__(self, instance: Any, owner: Any) -> bytes: ... + +class BinarySetAttribute(SetMixin, Attribute[Set[bytes]]): + def __get__(self, instance: Any, owner: Any) -> Set[bytes]: ... + +class UnicodeSetAttribute(SetMixin, Attribute[Set[Text]]): + def element_serialize(self, value: Any) -> Any: ... + def element_deserialize(self, value: Any) -> Any: ... + def __get__(self, instance: Any, owner: Any) -> Set[Text]: ... + +class UnicodeAttribute(Attribute[Text]): + def __get__(self, instance: Any, owner: Any) -> Text: ... + +class JSONAttribute(Attribute[Any]): + def __get__(self, instance: Any, owner: Any) -> Any: ... + +class LegacyBooleanAttribute(Attribute[bool]): + def __get__(self, instance: Any, owner: Any) -> bool: ... + +class BooleanAttribute(Attribute[bool]): + def __get__(self, instance: Any, owner: Any) -> bool: ... + +class NumberSetAttribute(SetMixin, Attribute[Set[float]]): + def __get__(self, instance: Any, owner: Any) -> Set[float]: ... + +class NumberAttribute(Attribute[float]): + def __get__(self, instance: Any, owner: Any) -> float: ... + +class UTCDateTimeAttribute(Attribute[datetime]): + def __get__(self, instance: Any, owner: Any) -> datetime: ... + +class NullAttribute(Attribute[None]): + def __get__(self, instance: Any, owner: Any) -> None: ... + +class MapAttributeMeta(type): + def __init__(self, name, bases, attrs) -> None: ... + +class MapAttribute(Generic[_KT, _VT], Attribute[Mapping[_KT, _VT]], metaclass=MapAttributeMeta): + attribute_values: Any + def __init__(self, hash_key: bool = ..., range_key: bool = ..., null: Optional[bool] = ..., default: Optional[Union[Any, Callable[..., Any]]] = ..., attr_name: Optional[Text] = ..., **attrs) -> None: ... + def __iter__(self) -> Iterable[_VT]: ... + def __getattr__(self, attr: str) -> _VT: ... + def __getitem__(self, item: _KT) -> _VT: ... + def __set__(self, instance: Any, value: Union[None, MapAttribute[_KT, _VT], Mapping[_KT, _VT]]) -> None: ... + def __get__(self: _MT, instance: Any, owner: Any) -> _MT: ... + def is_type_safe(self, key: Any, value: Any) -> bool: ... + def validate(self) -> bool: ... + +class ListAttribute(Generic[_T], Attribute[List[_T]]): + element_type: Any + def __init__(self, hash_key: bool = ..., range_key: bool = ..., null: Optional[bool] = ..., default: Optional[Union[Any, Callable[..., Any]]] = ..., attr_name: Optional[Text] = ..., of: Optional[Type[_T]] = ...) -> None: ... + def __get__(self, instance: Any, owner: Any) -> List[_T]: ... + +DESERIALIZE_CLASS_MAP: Dict[Text, Attribute] +SERIALIZE_CLASS_MAP: Dict[Type, Attribute] +SERIALIZE_KEY_MAP: Dict[Type, Text] diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pynamodb/connection/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pynamodb/connection/__init__.pyi new file mode 100644 index 0000000..1860736 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pynamodb/connection/__init__.pyi @@ -0,0 +1,2 @@ +from pynamodb.connection.base import Connection as Connection +from pynamodb.connection.table import TableConnection as TableConnection diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pynamodb/connection/base.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pynamodb/connection/base.pyi new file mode 100644 index 0000000..9c75150 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pynamodb/connection/base.pyi @@ -0,0 +1,78 @@ +from typing import Any, Dict, Optional, Text + +BOTOCORE_EXCEPTIONS: Any +log: Any + +class MetaTable: + data: Dict + def __init__(self, data: Dict) -> None: ... + @property + def range_keyname(self) -> Optional[Text]: ... + @property + def hash_keyname(self) -> Text: ... + def get_index_hash_keyname(self, index_name: Text) -> Optional[Text]: ... + def get_item_attribute_map(self, attributes, item_key: Any = ..., pythonic_key: bool = ...): ... + def get_attribute_type(self, attribute_name, value: Optional[Any] = ...): ... + def get_identifier_map(self, hash_key, range_key: Optional[Any] = ..., key: Any = ...): ... + def get_exclusive_start_key_map(self, exclusive_start_key): ... + +class Connection: + host: Any + region: Any + session_cls: Any + def __init__(self, region: Optional[Any] = ..., host: Optional[Any] = ..., session_cls: Optional[Any] = ..., + request_timeout_seconds: Optional[Any] = ..., max_retry_attempts: Optional[Any] = ..., + base_backoff_ms: Optional[Any] = ...) -> None: ... + def dispatch(self, operation_name, operation_kwargs): ... + @property + def session(self): ... + @property + def requests_session(self): ... + @property + def client(self): ... + def get_meta_table(self, table_name: Text, refresh: bool = ...): ... + def create_table(self, table_name: Text, attribute_definitions: Optional[Any] = ..., key_schema: Optional[Any] = ..., + read_capacity_units: Optional[Any] = ..., write_capacity_units: Optional[Any] = ..., + global_secondary_indexes: Optional[Any] = ..., local_secondary_indexes: Optional[Any] = ..., + stream_specification: Optional[Any] = ...): ... + def delete_table(self, table_name: Text): ... + def update_table(self, table_name: Text, read_capacity_units: Optional[Any] = ..., write_capacity_units: Optional[Any] = ..., + global_secondary_index_updates: Optional[Any] = ...): ... + def list_tables(self, exclusive_start_table_name: Optional[Any] = ..., limit: Optional[Any] = ...): ... + def describe_table(self, table_name: Text): ... + def get_conditional_operator(self, operator): ... + def get_item_attribute_map(self, table_name: Text, attributes, item_key: Any = ..., pythonic_key: bool = ...): ... + def get_expected_map(self, table_name: Text, expected): ... + def parse_attribute(self, attribute, return_type: bool = ...): ... + def get_attribute_type(self, table_name: Text, attribute_name, value: Optional[Any] = ...): ... + def get_identifier_map(self, table_name: Text, hash_key, range_key: Optional[Any] = ..., key: Any = ...): ... + def get_query_filter_map(self, table_name: Text, query_filters): ... + def get_consumed_capacity_map(self, return_consumed_capacity): ... + def get_return_values_map(self, return_values): ... + def get_item_collection_map(self, return_item_collection_metrics): ... + def get_exclusive_start_key_map(self, table_name: Text, exclusive_start_key): ... + def delete_item(self, table_name: Text, hash_key, range_key: Optional[Any] = ..., expected: Optional[Any] = ..., + conditional_operator: Optional[Any] = ..., return_values: Optional[Any] = ..., + return_consumed_capacity: Optional[Any] = ..., return_item_collection_metrics: Optional[Any] = ...): ... + def update_item(self, table_name: Text, hash_key, range_key: Optional[Any] = ..., attribute_updates: Optional[Any] = ..., + expected: Optional[Any] = ..., return_consumed_capacity: Optional[Any] = ..., + conditional_operator: Optional[Any] = ..., return_item_collection_metrics: Optional[Any] = ..., + return_values: Optional[Any] = ...): ... + def put_item(self, table_name: Text, hash_key, range_key: Optional[Any] = ..., attributes: Optional[Any] = ..., + expected: Optional[Any] = ..., conditional_operator: Optional[Any] = ..., return_values: Optional[Any] = ..., + return_consumed_capacity: Optional[Any] = ..., return_item_collection_metrics: Optional[Any] = ...): ... + def batch_write_item(self, table_name: Text, put_items: Optional[Any] = ..., delete_items: Optional[Any] = ..., + return_consumed_capacity: Optional[Any] = ..., return_item_collection_metrics: Optional[Any] = ...): ... + def batch_get_item(self, table_name: Text, keys, consistent_read: Optional[Any] = ..., + return_consumed_capacity: Optional[Any] = ..., attributes_to_get: Optional[Any] = ...): ... + def get_item(self, table_name: Text, hash_key, range_key: Optional[Any] = ..., consistent_read: bool = ..., + attributes_to_get: Optional[Any] = ...): ... + def scan(self, table_name: Text, attributes_to_get: Optional[Any] = ..., limit: Optional[Any] = ..., + conditional_operator: Optional[Any] = ..., scan_filter: Optional[Any] = ..., + return_consumed_capacity: Optional[Any] = ..., exclusive_start_key: Optional[Any] = ..., + segment: Optional[Any] = ..., total_segments: Optional[Any] = ...): ... + def query(self, table_name: Text, hash_key, attributes_to_get: Optional[Any] = ..., consistent_read: bool = ..., + exclusive_start_key: Optional[Any] = ..., index_name: Optional[Any] = ..., key_conditions: Optional[Any] = ..., + query_filters: Optional[Any] = ..., conditional_operator: Optional[Any] = ..., limit: Optional[Any] = ..., + return_consumed_capacity: Optional[Any] = ..., scan_index_forward: Optional[Any] = ..., + select: Optional[Any] = ...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pynamodb/connection/table.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pynamodb/connection/table.pyi new file mode 100644 index 0000000..0f820af --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pynamodb/connection/table.pyi @@ -0,0 +1,18 @@ +from typing import Any, Optional + +class TableConnection: + table_name: Any + connection: Any + def __init__(self, table_name, region: Optional[Any] = ..., host: Optional[Any] = ..., session_cls: Optional[Any] = ..., request_timeout_seconds: Optional[Any] = ..., max_retry_attempts: Optional[Any] = ..., base_backoff_ms: Optional[Any] = ...) -> None: ... + def delete_item(self, hash_key, range_key: Optional[Any] = ..., expected: Optional[Any] = ..., conditional_operator: Optional[Any] = ..., return_values: Optional[Any] = ..., return_consumed_capacity: Optional[Any] = ..., return_item_collection_metrics: Optional[Any] = ...): ... + def update_item(self, hash_key, range_key: Optional[Any] = ..., attribute_updates: Optional[Any] = ..., expected: Optional[Any] = ..., conditional_operator: Optional[Any] = ..., return_consumed_capacity: Optional[Any] = ..., return_item_collection_metrics: Optional[Any] = ..., return_values: Optional[Any] = ...): ... + def put_item(self, hash_key, range_key: Optional[Any] = ..., attributes: Optional[Any] = ..., expected: Optional[Any] = ..., conditional_operator: Optional[Any] = ..., return_values: Optional[Any] = ..., return_consumed_capacity: Optional[Any] = ..., return_item_collection_metrics: Optional[Any] = ...): ... + def batch_write_item(self, put_items: Optional[Any] = ..., delete_items: Optional[Any] = ..., return_consumed_capacity: Optional[Any] = ..., return_item_collection_metrics: Optional[Any] = ...): ... + def batch_get_item(self, keys, consistent_read: Optional[Any] = ..., return_consumed_capacity: Optional[Any] = ..., attributes_to_get: Optional[Any] = ...): ... + def get_item(self, hash_key, range_key: Optional[Any] = ..., consistent_read: bool = ..., attributes_to_get: Optional[Any] = ...): ... + def scan(self, attributes_to_get: Optional[Any] = ..., limit: Optional[Any] = ..., conditional_operator: Optional[Any] = ..., scan_filter: Optional[Any] = ..., return_consumed_capacity: Optional[Any] = ..., segment: Optional[Any] = ..., total_segments: Optional[Any] = ..., exclusive_start_key: Optional[Any] = ...): ... + def query(self, hash_key, attributes_to_get: Optional[Any] = ..., consistent_read: bool = ..., exclusive_start_key: Optional[Any] = ..., index_name: Optional[Any] = ..., key_conditions: Optional[Any] = ..., query_filters: Optional[Any] = ..., limit: Optional[Any] = ..., return_consumed_capacity: Optional[Any] = ..., scan_index_forward: Optional[Any] = ..., conditional_operator: Optional[Any] = ..., select: Optional[Any] = ...): ... + def describe_table(self): ... + def delete_table(self): ... + def update_table(self, read_capacity_units: Optional[Any] = ..., write_capacity_units: Optional[Any] = ..., global_secondary_index_updates: Optional[Any] = ...): ... + def create_table(self, attribute_definitions: Optional[Any] = ..., key_schema: Optional[Any] = ..., read_capacity_units: Optional[Any] = ..., write_capacity_units: Optional[Any] = ..., global_secondary_indexes: Optional[Any] = ..., local_secondary_indexes: Optional[Any] = ..., stream_specification: Optional[Any] = ...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pynamodb/connection/util.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pynamodb/connection/util.pyi new file mode 100644 index 0000000..20635c6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pynamodb/connection/util.pyi @@ -0,0 +1,3 @@ +from typing import Text + +def pythonic(var_name: Text) -> Text: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pynamodb/constants.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pynamodb/constants.pyi new file mode 100644 index 0000000..7c26cd6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pynamodb/constants.pyi @@ -0,0 +1,166 @@ +from typing import Any + +BATCH_WRITE_ITEM: str +DESCRIBE_TABLE: str +BATCH_GET_ITEM: str +CREATE_TABLE: str +UPDATE_TABLE: str +DELETE_TABLE: str +LIST_TABLES: str +UPDATE_ITEM: str +DELETE_ITEM: str +GET_ITEM: str +PUT_ITEM: str +QUERY: str +SCAN: str +GLOBAL_SECONDARY_INDEX_UPDATES: str +RETURN_ITEM_COLL_METRICS: str +EXCLUSIVE_START_TABLE_NAME: str +RETURN_CONSUMED_CAPACITY: str +COMPARISON_OPERATOR: str +SCAN_INDEX_FORWARD: str +ATTR_DEFINITIONS: str +ATTR_VALUE_LIST: str +TABLE_DESCRIPTION: str +UNPROCESSED_KEYS: str +UNPROCESSED_ITEMS: str +CONSISTENT_READ: str +DELETE_REQUEST: str +RETURN_VALUES: str +REQUEST_ITEMS: str +ATTRS_TO_GET: str +ATTR_UPDATES: str +TABLE_STATUS: str +SCAN_FILTER: str +TABLE_NAME: str +KEY_SCHEMA: str +ATTR_NAME: str +ATTR_TYPE: str +ITEM_COUNT: str +CAMEL_COUNT: str +PUT_REQUEST: str +INDEX_NAME: str +ATTRIBUTES: str +TABLE_KEY: str +RESPONSES: str +RANGE_KEY: str +KEY_TYPE: str +ACTION: str +UPDATE: str +EXISTS: str +SELECT: str +ACTIVE: str +LIMIT: str +ITEMS: str +ITEM: str +KEYS: str +UTC: str +KEY: str +DEFAULT_ENCODING: str +DEFAULT_REGION: str +DATETIME_FORMAT: str +SERVICE_NAME: str +HTTP_OK: int +HTTP_BAD_REQUEST: int +PROVISIONED_THROUGHPUT: str +READ_CAPACITY_UNITS: str +WRITE_CAPACITY_UNITS: str +STRING_SHORT: str +STRING_SET_SHORT: str +NUMBER_SHORT: str +NUMBER_SET_SHORT: str +BINARY_SHORT: str +BINARY_SET_SHORT: str +MAP_SHORT: str +LIST_SHORT: str +BOOLEAN: str +BOOLEAN_SHORT: str +STRING: str +STRING_SET: str +NUMBER: str +NUMBER_SET: str +BINARY: str +BINARY_SET: str +MAP: str +LIST: str +SHORT_ATTR_TYPES: Any +ATTR_TYPE_MAP: Any +LOCAL_SECONDARY_INDEX: str +LOCAL_SECONDARY_INDEXES: str +GLOBAL_SECONDARY_INDEX: str +GLOBAL_SECONDARY_INDEXES: str +PROJECTION: str +PROJECTION_TYPE: str +NON_KEY_ATTRIBUTES: str +KEYS_ONLY: str +ALL: str +INCLUDE: str +STREAM_VIEW_TYPE: str +STREAM_SPECIFICATION: str +STREAM_ENABLED: str +STREAM_NEW_IMAGE: str +STREAM_OLD_IMAGE: str +STREAM_NEW_AND_OLD_IMAGE: str +STREAM_KEYS_ONLY: str +EXCLUSIVE_START_KEY: str +LAST_EVALUATED_KEY: str +QUERY_FILTER: str +BEGINS_WITH: str +BETWEEN: str +EQ: str +NE: str +LE: str +LT: str +GE: str +GT: str +IN: str +KEY_CONDITIONS: str +COMPARISON_OPERATOR_VALUES: Any +QUERY_OPERATOR_MAP: Any +NOT_NULL: str +NULL: str +CONTAINS: str +NOT_CONTAINS: str +ALL_ATTRIBUTES: str +ALL_PROJECTED_ATTRIBUTES: str +SPECIFIC_ATTRIBUTES: str +COUNT: str +SELECT_VALUES: Any +SCAN_OPERATOR_MAP: Any +QUERY_FILTER_OPERATOR_MAP: Any +DELETE_FILTER_OPERATOR_MAP: Any +UPDATE_FILTER_OPERATOR_MAP: Any +PUT_FILTER_OPERATOR_MAP: Any +SEGMENT: str +TOTAL_SEGMENTS: str +SCAN_FILTER_VALUES: Any +QUERY_FILTER_VALUES: Any +DELETE_FILTER_VALUES: Any +VALUE: str +EXPECTED: str +CONSUMED_CAPACITY: str +CAPACITY_UNITS: str +INDEXES: str +TOTAL: str +NONE: str +RETURN_CONSUMED_CAPACITY_VALUES: Any +SIZE: str +RETURN_ITEM_COLL_METRICS_VALUES: Any +ALL_OLD: str +UPDATED_OLD: str +ALL_NEW: str +UPDATED_NEW: str +RETURN_VALUES_VALUES: Any +PUT: str +DELETE: str +ADD: str +ATTR_UPDATE_ACTIONS: Any +BATCH_GET_PAGE_LIMIT: int +BATCH_WRITE_PAGE_LIMIT: int +META_CLASS_NAME: str +REGION: str +HOST: str +CONDITIONAL_OPERATOR: str +AND: str +OR: str +CONDITIONAL_OPERATORS: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pynamodb/exceptions.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pynamodb/exceptions.pyi new file mode 100644 index 0000000..728db4a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pynamodb/exceptions.pyi @@ -0,0 +1,23 @@ +from typing import Any, Optional, Text + +class PynamoDBException(Exception): + msg: str + cause: Any + def __init__(self, msg: Optional[Text] = ..., cause: Optional[Exception] = ...) -> None: ... + +class PynamoDBConnectionError(PynamoDBException): ... +class DeleteError(PynamoDBConnectionError): ... +class QueryError(PynamoDBConnectionError): ... +class ScanError(PynamoDBConnectionError): ... +class PutError(PynamoDBConnectionError): ... +class UpdateError(PynamoDBConnectionError): ... +class GetError(PynamoDBConnectionError): ... +class TableError(PynamoDBConnectionError): ... +class DoesNotExist(PynamoDBException): ... + +class TableDoesNotExist(PynamoDBException): + def __init__(self, table_name) -> None: ... + +class VerboseClientError(Exception): + MSG_TEMPLATE: Any + def __init__(self, error_response, operation_name, verbose_properties: Optional[Any] = ...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pynamodb/indexes.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pynamodb/indexes.pyi new file mode 100644 index 0000000..66e8ae7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pynamodb/indexes.pyi @@ -0,0 +1,30 @@ +from typing import Any, Optional + +class IndexMeta(type): + def __init__(self, name, bases, attrs) -> None: ... + +class Index(metaclass=IndexMeta): + Meta: Any + def __init__(self) -> None: ... + @classmethod + def count(cls, hash_key, consistent_read: bool = ..., **filters) -> int: ... + @classmethod + def query(self, hash_key, scan_index_forward: Optional[Any] = ..., consistent_read: bool = ..., limit: Optional[Any] = ..., last_evaluated_key: Optional[Any] = ..., attributes_to_get: Optional[Any] = ..., **filters): ... + +class GlobalSecondaryIndex(Index): ... +class LocalSecondaryIndex(Index): ... + +class Projection(object): + projection_type: Any + non_key_attributes: Any + +class KeysOnlyProjection(Projection): + projection_type: Any + +class IncludeProjection(Projection): + projection_type: Any + non_key_attributes: Any + def __init__(self, non_attr_keys: Optional[Any] = ...) -> None: ... + +class AllProjection(Projection): + projection_type: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pynamodb/models.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pynamodb/models.pyi new file mode 100644 index 0000000..5943a58 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pynamodb/models.pyi @@ -0,0 +1,107 @@ +from .attributes import Attribute +from .exceptions import DoesNotExist as DoesNotExist +from typing import Any, Dict, Generic, Iterable, Iterator, List, Optional, Sequence, Tuple, Type, TypeVar, Text, Union + +log: Any + +class DefaultMeta: ... + +class ResultSet(Iterable): + results: Any + operation: Any + arguments: Any + def __init__(self, results, operation, arguments) -> None: ... + def __iter__(self): ... + +class MetaModel(type): + def __init__(self, name: Text, bases: Tuple[type, ...], attrs: Dict[Any, Any]) -> None: ... + +_T = TypeVar('_T', bound='Model') +KeyType = Union[Text, bytes, float, int, Tuple] + +class Model(metaclass=MetaModel): + DoesNotExist = DoesNotExist + attribute_values: Dict[Text, Any] + def __init__(self, hash_key: Optional[KeyType] = ..., range_key: Optional[Any] = ..., **attrs) -> None: ... + @classmethod + def has_map_or_list_attributes(cls: Type[_T]) -> bool: ... + @classmethod + def batch_get(cls: Type[_T], items: Iterable[Union[KeyType, Iterable[KeyType]]], consistent_read: Optional[bool] = ..., attributes_to_get: Optional[Sequence[Text]] = ...) -> Iterator[_T]: ... + @classmethod + def batch_write(cls: Type[_T], auto_commit: bool = ...) -> BatchWrite[_T]: ... + def delete(self, condition: Optional[Any] = ..., conditional_operator: Optional[Text] = ..., **expected_values) -> Any: ... + def update(self, attributes: Optional[Dict[Text, Dict[Text, Any]]] = ..., actions: Optional[List[Any]] = ..., condition: Optional[Any] = ..., conditional_operator: Optional[Text] = ..., **expected_values) -> Any: ... + def update_item(self, attribute: Text, value: Optional[Any] = ..., action: Optional[Text] = ..., conditional_operator: Optional[Text] = ..., **expected_values): ... + def save(self, condition: Optional[Any] = ..., conditional_operator: Optional[Text] = ..., **expected_values) -> Dict[str, Any]: ... + def refresh(self, consistent_read: bool = ...): ... + @classmethod + def get(cls: Type[_T], hash_key: KeyType, range_key: Optional[KeyType] = ..., consistent_read: bool = ...) -> _T: ... + @classmethod + def from_raw_data(cls: Type[_T], data) -> _T: ... + @classmethod + def count(cls: Type[_T], hash_key: Optional[KeyType] = ..., consistent_read: bool = ..., index_name: Optional[Text] = ..., limit: Optional[int] = ..., **filters) -> int: ... + @classmethod + def query(cls: Type[_T], hash_key: KeyType, consistent_read: bool = ..., index_name: Optional[Text] = ..., scan_index_forward: Optional[Any] = ..., conditional_operator: Optional[Text] = ..., limit: Optional[int] = ..., last_evaluated_key: Optional[Any] = ..., attributes_to_get: Optional[Iterable[Text]] = ..., page_size: Optional[int] = ..., **filters) -> Iterator[_T]: ... + @classmethod + def rate_limited_scan( + cls: Type[_T], + # TODO: annotate Condition class + filter_condition: Optional[Any] = ..., + attributes_to_get: Optional[Sequence[Text]] = ..., + segment: Optional[int] = ..., + total_segments: Optional[int] = ..., + limit: Optional[int] = ..., + conditional_operator: Optional[Text] = ..., + last_evaluated_key: Optional[Any] = ..., + page_size: Optional[int] = ..., + timeout_seconds: Optional[int] = ..., + read_capacity_to_consume_per_second: int = ..., + allow_rate_limited_scan_without_consumed_capacity: Optional[bool] = ..., + max_sleep_between_retry: int = ..., + max_consecutive_exceptions: int = ..., + consistent_read: Optional[bool] = ..., + index_name: Optional[str] = ..., + **filters: Any + ) -> Iterator[_T]: ... + @classmethod + def scan(cls: Type[_T], segment: Optional[int] = ..., total_segments: Optional[int] = ..., limit: Optional[int] = ..., conditional_operator: Optional[Text] = ..., last_evaluated_key: Optional[Any] = ..., page_size: Optional[int] = ..., **filters) -> Iterator[_T]: ... + @classmethod + def exists(cls: Type[_T]) -> bool: ... + @classmethod + def delete_table(cls): ... + @classmethod + def describe_table(cls): ... + @classmethod + def create_table(cls: Type[_T], wait: bool = ..., read_capacity_units: Optional[Any] = ..., write_capacity_units: Optional[Any] = ...): ... + @classmethod + def dumps(cls): ... + @classmethod + def dump(cls, filename): ... + @classmethod + def loads(cls, data): ... + @classmethod + def load(cls, filename): ... + @classmethod + def add_throttle_record(cls, records): ... + @classmethod + def get_throttle(cls): ... + @classmethod + def get_attributes(cls) -> Dict[str, Attribute]: ... + @classmethod + def _get_attributes(cls) -> Dict[str, Attribute]: ... + +class ModelContextManager(Generic[_T]): + model: Type[_T] + auto_commit: bool + max_operations: int + pending_operations: List[Dict[Text, Any]] + def __init__(self, model: Type[_T], auto_commit: bool = ...) -> None: ... + def __enter__(self) -> ModelContextManager[_T]: ... + +class BatchWrite(Generic[_T], ModelContextManager[_T]): + def save(self, put_item: _T) -> None: ... + def delete(self, del_item: _T) -> None: ... + def __enter__(self) -> BatchWrite[_T]: ... + def __exit__(self, exc_type, exc_val, exc_tb) -> None: ... + pending_operations: Any + def commit(self) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pynamodb/settings.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pynamodb/settings.pyi new file mode 100644 index 0000000..76fc417 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pynamodb/settings.pyi @@ -0,0 +1,8 @@ +from typing import Any + +log: Any +default_settings_dict: Any +OVERRIDE_SETTINGS_PATH: Any +override_settings: Any + +def get_settings_value(key): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pynamodb/throttle.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pynamodb/throttle.pyi new file mode 100644 index 0000000..6948b68 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pynamodb/throttle.pyi @@ -0,0 +1,19 @@ +from typing import Any, Optional + +log: Any + +class ThrottleBase: + capacity: Any + window: Any + records: Any + sleep_interval: Any + def __init__(self, capacity, window: int = ..., initial_sleep: Optional[Any] = ...) -> None: ... + def add_record(self, record): ... + def throttle(self): ... + +class NoThrottle(ThrottleBase): + def __init__(self) -> None: ... + def add_record(self, record): ... + +class Throttle(ThrottleBase): + def throttle(self): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pynamodb/types.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pynamodb/types.pyi new file mode 100644 index 0000000..14195f0 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pynamodb/types.pyi @@ -0,0 +1,5 @@ +STRING: str +NUMBER: str +BINARY: str +HASH: str +RANGE: str diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pytz/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pytz/__init__.pyi new file mode 100644 index 0000000..20655d1 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/pytz/__init__.pyi @@ -0,0 +1,41 @@ +from typing import Optional, List, Set, Mapping, Union +import datetime + +class BaseTzInfo(datetime.tzinfo): + zone: str = ... + def localize(self, dt: datetime.datetime, is_dst: bool = ...) -> datetime.datetime: ... + def normalize(self, dt: datetime.datetime) -> datetime.datetime: ... + +class _UTCclass(BaseTzInfo): + def tzname(self, dt: Optional[datetime.datetime]) -> str: ... + def utcoffset(self, dt: Optional[datetime.datetime]) -> datetime.timedelta: ... + def dst(self, dt: Optional[datetime.datetime]) -> datetime.timedelta: ... + +class _StaticTzInfo(BaseTzInfo): + def tzname(self, dt: Optional[datetime.datetime], is_dst: Optional[bool] = ...) -> str: ... + def utcoffset(self, dt: Optional[datetime.datetime], is_dst: Optional[bool] = ...) -> datetime.timedelta: ... + def dst(self, dt: Optional[datetime.datetime], is_dst: Optional[bool] = ...) -> datetime.timedelta: ... + +class _DstTzInfo(BaseTzInfo): + def tzname(self, dt: Optional[datetime.datetime], is_dst: Optional[bool] = ...) -> str: ... + def utcoffset(self, dt: Optional[datetime.datetime], is_dst: Optional[bool] = ...) -> Optional[datetime.timedelta]: ... + def dst(self, dt: Optional[datetime.datetime], is_dst: Optional[bool] = ...) -> Optional[datetime.timedelta]: ... + +class UnknownTimeZoneError(KeyError): ... +class InvalidTimeError(Exception): ... +class AmbiguousTimeError(InvalidTimeError): ... +class NonExistentTimeError(InvalidTimeError): ... + +utc: _UTCclass +UTC: _UTCclass +def timezone(zone: str) -> Union[_UTCclass, _StaticTzInfo, _DstTzInfo]: ... + +all_timezones: List[str] +all_timezones_set: Set[str] +common_timezones: List[str] +common_timezones_set: Set[str] +country_timezones: Mapping[str, List[str]] +country_names: Mapping[str, str] +ZERO: datetime.timedelta +HOUR: datetime.timedelta +VERSION: str diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/__init__.pyi new file mode 100644 index 0000000..7705d78 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/__init__.pyi @@ -0,0 +1,40 @@ +# Stubs for requests (based on version 2.6.0, Python 3) + +from typing import Any +from . import models +from . import api +from . import sessions +from . import status_codes +from . import exceptions +from . import packages +import logging + +__title__: Any +__build__: Any +__license__: Any +__copyright__: Any +__version__: Any + +Request = models.Request +Response = models.Response +PreparedRequest = models.PreparedRequest +request = api.request +get = api.get +head = api.head +post = api.post +patch = api.patch +put = api.put +delete = api.delete +options = api.options +session = sessions.session +Session = sessions.Session +codes = status_codes.codes +RequestException = exceptions.RequestException +Timeout = exceptions.Timeout +URLRequired = exceptions.URLRequired +TooManyRedirects = exceptions.TooManyRedirects +HTTPError = exceptions.HTTPError +ConnectionError = exceptions.ConnectionError + +class NullHandler(logging.Handler): + def emit(self, record): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/adapters.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/adapters.pyi new file mode 100644 index 0000000..1900567 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/adapters.pyi @@ -0,0 +1,79 @@ +# Stubs for requests.adapters (Python 3) + +from typing import Any, Container, Union, Text, Tuple, Optional, Mapping +from . import models +from .packages.urllib3 import poolmanager +from .packages.urllib3 import response +from .packages.urllib3.util import retry +from . import compat +from . import utils +from . import structures +from .packages.urllib3 import exceptions as urllib3_exceptions +from . import cookies +from . import exceptions +from . import auth + +PreparedRequest = models.PreparedRequest +Response = models.Response +PoolManager = poolmanager.PoolManager +proxy_from_url = poolmanager.proxy_from_url +HTTPResponse = response.HTTPResponse +Retry = retry.Retry +DEFAULT_CA_BUNDLE_PATH = utils.DEFAULT_CA_BUNDLE_PATH +get_encoding_from_headers = utils.get_encoding_from_headers +prepend_scheme_if_needed = utils.prepend_scheme_if_needed +get_auth_from_url = utils.get_auth_from_url +urldefragauth = utils.urldefragauth +CaseInsensitiveDict = structures.CaseInsensitiveDict +ConnectTimeoutError = urllib3_exceptions.ConnectTimeoutError +MaxRetryError = urllib3_exceptions.MaxRetryError +ProtocolError = urllib3_exceptions.ProtocolError +ReadTimeoutError = urllib3_exceptions.ReadTimeoutError +ResponseError = urllib3_exceptions.ResponseError +extract_cookies_to_jar = cookies.extract_cookies_to_jar +ConnectionError = exceptions.ConnectionError +ConnectTimeout = exceptions.ConnectTimeout +ReadTimeout = exceptions.ReadTimeout +SSLError = exceptions.SSLError +ProxyError = exceptions.ProxyError +RetryError = exceptions.RetryError + +DEFAULT_POOLBLOCK: Any +DEFAULT_POOLSIZE: Any +DEFAULT_RETRIES: Any + +class BaseAdapter: + def __init__(self) -> None: ... + def send(self, + request: PreparedRequest, + stream: bool = ..., + timeout: Union[None, float, Tuple[float, float]] = ..., + verify: Union[bool, str] = ..., + cert: Union[None, Union[bytes, Text], Container[Union[bytes, Text]]] = ..., + proxies: Optional[Mapping[str, str]] = ...) -> Response: ... + def close(self) -> None: ... + +class HTTPAdapter(BaseAdapter): + __attrs__: Any + max_retries: Any + config: Any + proxy_manager: Any + def __init__(self, pool_connections=..., pool_maxsize=..., max_retries=..., + pool_block=...) -> None: ... + poolmanager: Any + def init_poolmanager(self, connections, maxsize, block=..., **pool_kwargs): ... + def proxy_manager_for(self, proxy, **proxy_kwargs): ... + def cert_verify(self, conn, url, verify, cert): ... + def build_response(self, req, resp): ... + def get_connection(self, url, proxies=...): ... + def close(self): ... + def request_url(self, request, proxies): ... + def add_headers(self, request, **kwargs): ... + def proxy_headers(self, proxy): ... + def send(self, + request: PreparedRequest, + stream: bool = ..., + timeout: Union[None, float, Tuple[float, float]] = ..., + verify: Union[bool, str] = ..., + cert: Union[None, Union[bytes, Text], Container[Union[bytes, Text]]] = ..., + proxies: Optional[Mapping[str, str]] = ...) -> Response: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/api.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/api.pyi new file mode 100644 index 0000000..df3003c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/api.pyi @@ -0,0 +1,40 @@ +# Stubs for requests.api (Python 3) + +import sys +from typing import Optional, Union, Any, Iterable, Mapping, MutableMapping, Tuple, IO, Text + +from .models import Response + +if sys.version_info >= (3,): + _Text = str +else: + _Text = Union[str, Text] + +_ParamsMappingValueType = Union[_Text, bytes, int, float, Iterable[Union[_Text, bytes, int, float]]] +_Data = Union[ + None, + _Text, + bytes, + MutableMapping[str, Any], + MutableMapping[Text, Any], + Iterable[Tuple[_Text, Optional[_Text]]], + IO +] + +def request(method: str, url: str, **kwargs) -> Response: ... +def get(url: Union[_Text, bytes], + params: Optional[ + Union[Mapping[Union[_Text, bytes, int, float], _ParamsMappingValueType], + Union[_Text, bytes], + Tuple[Union[_Text, bytes, int, float], _ParamsMappingValueType], + Mapping[_Text, _ParamsMappingValueType], + Mapping[bytes, _ParamsMappingValueType], + Mapping[int, _ParamsMappingValueType], + Mapping[float, _ParamsMappingValueType]]] = ..., + **kwargs) -> Response: ... +def options(url: _Text, **kwargs) -> Response: ... +def head(url: _Text, **kwargs) -> Response: ... +def post(url: _Text, data: _Data = ..., json=..., **kwargs) -> Response: ... +def put(url: _Text, data: _Data = ..., json=..., **kwargs) -> Response: ... +def patch(url: _Text, data: _Data = ..., json=..., **kwargs) -> Response: ... +def delete(url: _Text, **kwargs) -> Response: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/auth.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/auth.pyi new file mode 100644 index 0000000..48d4b08 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/auth.pyi @@ -0,0 +1,44 @@ +# Stubs for requests.auth (Python 3) + +from typing import Any, Text, Union +from . import compat +from . import cookies +from . import models +from . import utils +from . import status_codes + +extract_cookies_to_jar = cookies.extract_cookies_to_jar +parse_dict_header = utils.parse_dict_header +to_native_string = utils.to_native_string +codes = status_codes.codes + +CONTENT_TYPE_FORM_URLENCODED: Any +CONTENT_TYPE_MULTI_PART: Any + +def _basic_auth_str(username: Union[bytes, Text], password: Union[bytes, Text]) -> str: ... + +class AuthBase: + def __call__(self, r: models.PreparedRequest) -> models.PreparedRequest: ... + +class HTTPBasicAuth(AuthBase): + username: Any + password: Any + def __init__(self, username, password) -> None: ... + def __call__(self, r): ... + +class HTTPProxyAuth(HTTPBasicAuth): + def __call__(self, r): ... + +class HTTPDigestAuth(AuthBase): + username: Any + password: Any + last_nonce: Any + nonce_count: Any + chal: Any + pos: Any + num_401_calls: Any + def __init__(self, username, password) -> None: ... + def build_digest_header(self, method, url): ... + def handle_redirect(self, r, **kwargs): ... + def handle_401(self, r, **kwargs): ... + def __call__(self, r): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/compat.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/compat.pyi new file mode 100644 index 0000000..63b92f6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/compat.pyi @@ -0,0 +1,6 @@ +# Stubs for requests.compat (Python 3.4) + +from typing import Any +import collections + +OrderedDict = collections.OrderedDict diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/cookies.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/cookies.pyi new file mode 100644 index 0000000..1208dce --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/cookies.pyi @@ -0,0 +1,67 @@ +# Stubs for requests.cookies (Python 3) + +import sys +from typing import Any, MutableMapping +import collections +from . import compat + +if sys.version_info < (3, 0): + from cookielib import CookieJar +else: + from http.cookiejar import CookieJar + +class MockRequest: + type: Any + def __init__(self, request) -> None: ... + def get_type(self): ... + def get_host(self): ... + def get_origin_req_host(self): ... + def get_full_url(self): ... + def is_unverifiable(self): ... + def has_header(self, name): ... + def get_header(self, name, default=...): ... + def add_header(self, key, val): ... + def add_unredirected_header(self, name, value): ... + def get_new_headers(self): ... + @property + def unverifiable(self): ... + @property + def origin_req_host(self): ... + @property + def host(self): ... + +class MockResponse: + def __init__(self, headers) -> None: ... + def info(self): ... + def getheaders(self, name): ... + +def extract_cookies_to_jar(jar, request, response): ... +def get_cookie_header(jar, request): ... +def remove_cookie_by_name(cookiejar, name, domain=..., path=...): ... + +class CookieConflictError(RuntimeError): ... + +class RequestsCookieJar(CookieJar, MutableMapping): + def get(self, name, default=..., domain=..., path=...): ... + def set(self, name, value, **kwargs): ... + def iterkeys(self): ... + def keys(self): ... + def itervalues(self): ... + def values(self): ... + def iteritems(self): ... + def items(self): ... + def list_domains(self): ... + def list_paths(self): ... + def multiple_domains(self): ... + def get_dict(self, domain=..., path=...): ... + def __getitem__(self, name): ... + def __setitem__(self, name, value): ... + def __delitem__(self, name): ... + def set_cookie(self, cookie, *args, **kwargs): ... + def update(self, other): ... + def copy(self): ... + +def create_cookie(name, value, **kwargs): ... +def morsel_to_cookie(morsel): ... +def cookiejar_from_dict(cookie_dict, cookiejar=..., overwrite=...): ... +def merge_cookies(cookiejar, cookies): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/exceptions.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/exceptions.pyi new file mode 100644 index 0000000..3669692 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/exceptions.pyi @@ -0,0 +1,26 @@ +# Stubs for requests.exceptions (Python 3) + +from typing import Any +from .packages.urllib3.exceptions import HTTPError as BaseHTTPError + +class RequestException(IOError): + response: Any + request: Any + def __init__(self, *args, **kwargs) -> None: ... + +class HTTPError(RequestException): ... +class ConnectionError(RequestException): ... +class ProxyError(ConnectionError): ... +class SSLError(ConnectionError): ... +class Timeout(RequestException): ... +class ConnectTimeout(ConnectionError, Timeout): ... +class ReadTimeout(Timeout): ... +class URLRequired(RequestException): ... +class TooManyRedirects(RequestException): ... +class MissingSchema(RequestException, ValueError): ... +class InvalidSchema(RequestException, ValueError): ... +class InvalidURL(RequestException, ValueError): ... +class ChunkedEncodingError(RequestException): ... +class ContentDecodingError(RequestException, BaseHTTPError): ... +class StreamConsumedError(RequestException, TypeError): ... +class RetryError(RequestException): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/hooks.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/hooks.pyi new file mode 100644 index 0000000..278076a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/hooks.pyi @@ -0,0 +1,8 @@ +# Stubs for requests.hooks (Python 3) + +from typing import Any + +HOOKS: Any + +def default_hooks(): ... +def dispatch_hook(key, hooks, hook_data, **kwargs): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/models.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/models.pyi new file mode 100644 index 0000000..2bcea94 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/models.pyi @@ -0,0 +1,142 @@ +# Stubs for requests.models (Python 3) + +from typing import (Any, Dict, Iterator, List, MutableMapping, Optional, Text, + Union) +import datetime +import types + +from . import hooks +from . import structures +from . import auth +from . import cookies +from .cookies import RequestsCookieJar +from .packages.urllib3 import fields +from .packages.urllib3 import filepost +from .packages.urllib3 import util +from .packages.urllib3 import exceptions as urllib3_exceptions +from . import exceptions +from . import utils +from . import compat +from . import status_codes + + +default_hooks = hooks.default_hooks +CaseInsensitiveDict = structures.CaseInsensitiveDict +HTTPBasicAuth = auth.HTTPBasicAuth +cookiejar_from_dict = cookies.cookiejar_from_dict +get_cookie_header = cookies.get_cookie_header +RequestField = fields.RequestField +encode_multipart_formdata = filepost.encode_multipart_formdata +parse_url = util.parse_url +DecodeError = urllib3_exceptions.DecodeError +ReadTimeoutError = urllib3_exceptions.ReadTimeoutError +ProtocolError = urllib3_exceptions.ProtocolError +LocationParseError = urllib3_exceptions.LocationParseError +HTTPError = exceptions.HTTPError +MissingSchema = exceptions.MissingSchema +InvalidURL = exceptions.InvalidURL +ChunkedEncodingError = exceptions.ChunkedEncodingError +ContentDecodingError = exceptions.ContentDecodingError +ConnectionError = exceptions.ConnectionError +StreamConsumedError = exceptions.StreamConsumedError +guess_filename = utils.guess_filename +get_auth_from_url = utils.get_auth_from_url +requote_uri = utils.requote_uri +stream_decode_response_unicode = utils.stream_decode_response_unicode +to_key_val_list = utils.to_key_val_list +parse_header_links = utils.parse_header_links +iter_slices = utils.iter_slices +guess_json_utf = utils.guess_json_utf +super_len = utils.super_len +to_native_string = utils.to_native_string +codes = status_codes.codes + +REDIRECT_STATI: Any +DEFAULT_REDIRECT_LIMIT: Any +CONTENT_CHUNK_SIZE: Any +ITER_CHUNK_SIZE: Any +json_dumps: Any + +class RequestEncodingMixin: + @property + def path_url(self): ... + +class RequestHooksMixin: + def register_hook(self, event, hook): ... + def deregister_hook(self, event, hook): ... + +class Request(RequestHooksMixin): + hooks: Any + method: Any + url: Any + headers: Any + files: Any + data: Any + json: Any + params: Any + auth: Any + cookies: Any + def __init__(self, method=..., url=..., headers=..., files=..., data=..., params=..., + auth=..., cookies=..., hooks=..., json=...) -> None: ... + def prepare(self): ... + +class PreparedRequest(RequestEncodingMixin, RequestHooksMixin): + method: Optional[Union[str, Text]] + url: Optional[Union[str, Text]] + headers: CaseInsensitiveDict + body: Optional[Union[bytes, Text]] + hooks: Any + def __init__(self) -> None: ... + def prepare(self, method=..., url=..., headers=..., files=..., data=..., params=..., + auth=..., cookies=..., hooks=..., json=...): ... + def copy(self): ... + def prepare_method(self, method): ... + def prepare_url(self, url, params): ... + def prepare_headers(self, headers): ... + def prepare_body(self, data, files, json=...): ... + def prepare_content_length(self, body): ... + def prepare_auth(self, auth, url=...): ... + def prepare_cookies(self, cookies): ... + def prepare_hooks(self, hooks): ... + +class Response: + __attrs__: Any + status_code: int + headers: MutableMapping[str, str] + raw: Any + url: str + encoding: str + history: List[Response] + reason: str + cookies: RequestsCookieJar + elapsed: datetime.timedelta + request: PreparedRequest + def __init__(self) -> None: ... + def __bool__(self) -> bool: ... + def __nonzero__(self) -> bool: ... + def __iter__(self) -> Iterator[bytes]: ... + def __enter__(self) -> Response: ... + def __exit__(self, *args: Any) -> None: ... + @property + def ok(self) -> bool: ... + @property + def is_redirect(self) -> bool: ... + @property + def is_permanent_redirect(self) -> bool: ... + @property + def apparent_encoding(self) -> str: ... + def iter_content(self, chunk_size: Optional[int] = ..., + decode_unicode: bool = ...) -> Iterator[Any]: ... + def iter_lines(self, + chunk_size: Optional[int] = ..., + decode_unicode: bool = ..., + delimiter: Union[Text, bytes] = ...) -> Iterator[Any]: ... + @property + def content(self) -> bytes: ... + @property + def text(self) -> str: ... + def json(self, **kwargs) -> Any: ... + @property + def links(self) -> Dict[Any, Any]: ... + def raise_for_status(self) -> None: ... + def close(self) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/packages/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/packages/__init__.pyi new file mode 100644 index 0000000..b50dba3 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/packages/__init__.pyi @@ -0,0 +1,4 @@ +class VendorAlias: + def __init__(self, package_names) -> None: ... + def find_module(self, fullname, path=...): ... + def load_module(self, name): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/__init__.pyi new file mode 100644 index 0000000..f575800 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/__init__.pyi @@ -0,0 +1,31 @@ +from typing import Any +from . import connectionpool +from . import filepost +from . import poolmanager +from . import response +from .util import request as _request +from .util import url +from .util import timeout +from .util import retry +import logging + +__license__: Any + +HTTPConnectionPool = connectionpool.HTTPConnectionPool +HTTPSConnectionPool = connectionpool.HTTPSConnectionPool +connection_from_url = connectionpool.connection_from_url +encode_multipart_formdata = filepost.encode_multipart_formdata +PoolManager = poolmanager.PoolManager +ProxyManager = poolmanager.ProxyManager +proxy_from_url = poolmanager.proxy_from_url +HTTPResponse = response.HTTPResponse +make_headers = _request.make_headers +get_host = url.get_host +Timeout = timeout.Timeout +Retry = retry.Retry + +class NullHandler(logging.Handler): + def emit(self, record): ... + +def add_stderr_logger(level=...): ... +def disable_warnings(category=...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/_collections.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/_collections.pyi new file mode 100644 index 0000000..64e3d22 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/_collections.pyi @@ -0,0 +1,47 @@ +from typing import Any +from collections import MutableMapping + +class RLock: + def __enter__(self): ... + def __exit__(self, exc_type, exc_value, traceback): ... + +class RecentlyUsedContainer(MutableMapping): + ContainerCls: Any + dispose_func: Any + lock: Any + def __init__(self, maxsize=..., dispose_func=...) -> None: ... + def __getitem__(self, key): ... + def __setitem__(self, key, value): ... + def __delitem__(self, key): ... + def __len__(self): ... + def __iter__(self): ... + def clear(self): ... + def keys(self): ... + +class HTTPHeaderDict(dict): + def __init__(self, headers=..., **kwargs) -> None: ... + def __setitem__(self, key, val): ... + def __getitem__(self, key): ... + def __delitem__(self, key): ... + def __contains__(self, key): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + values: Any + get: Any + update: Any + iterkeys: Any + itervalues: Any + def pop(self, key, default=...): ... + def discard(self, key): ... + def add(self, key, val): ... + def extend(self, *args, **kwargs): ... + def getlist(self, key): ... + getheaders: Any + getallmatchingheaders: Any + iget: Any + def copy(self): ... + def iteritems(self): ... + def itermerged(self): ... + def items(self): ... + @classmethod + def from_httplib(cls, message, duplicates=...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/connection.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/connection.pyi new file mode 100644 index 0000000..99af027 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/connection.pyi @@ -0,0 +1,71 @@ +# Stubs for requests.packages.urllib3.connection (Python 3.4) + +import sys +from typing import Any +from . import packages +import ssl +from . import exceptions +from .packages import ssl_match_hostname +from .util import ssl_ +from . import util + +if sys.version_info < (3, 0): + from httplib import HTTPConnection as _HTTPConnection + from httplib import HTTPException as HTTPException + + class ConnectionError(Exception): ... +else: + from http.client import HTTPConnection as _HTTPConnection + from http.client import HTTPException as HTTPException + from builtins import ConnectionError as ConnectionError + + +class DummyConnection: ... + +BaseSSLError = ssl.SSLError + +ConnectTimeoutError = exceptions.ConnectTimeoutError +SystemTimeWarning = exceptions.SystemTimeWarning +SecurityWarning = exceptions.SecurityWarning +match_hostname = ssl_match_hostname.match_hostname +resolve_cert_reqs = ssl_.resolve_cert_reqs +resolve_ssl_version = ssl_.resolve_ssl_version +ssl_wrap_socket = ssl_.ssl_wrap_socket +assert_fingerprint = ssl_.assert_fingerprint +connection = util.connection + +port_by_scheme: Any +RECENT_DATE: Any + +class HTTPConnection(_HTTPConnection): + default_port: Any + default_socket_options: Any + is_verified: Any + source_address: Any + socket_options: Any + def __init__(self, *args, **kw) -> None: ... + def connect(self): ... + +class HTTPSConnection(HTTPConnection): + default_port: Any + key_file: Any + cert_file: Any + def __init__(self, host, port=..., key_file=..., cert_file=..., strict=..., timeout=..., **kw) -> None: ... + sock: Any + def connect(self): ... + +class VerifiedHTTPSConnection(HTTPSConnection): + cert_reqs: Any + ca_certs: Any + ssl_version: Any + assert_fingerprint: Any + key_file: Any + cert_file: Any + assert_hostname: Any + def set_cert(self, key_file=..., cert_file=..., cert_reqs=..., ca_certs=..., assert_hostname=..., assert_fingerprint=...): ... + sock: Any + auto_open: Any + is_verified: Any + def connect(self): ... + +UnverifiedHTTPSConnection = HTTPSConnection diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/connectionpool.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/connectionpool.pyi new file mode 100644 index 0000000..a4e8ac1 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/connectionpool.pyi @@ -0,0 +1,85 @@ +from typing import Any +from . import exceptions +from .packages import ssl_match_hostname +from . import packages +from .connection import ( + HTTPException as HTTPException, + BaseSSLError as BaseSSLError, + ConnectionError as ConnectionError, +) +from . import request +from . import response +from . import connection +from .util import connection as _connection +from .util import retry +from .util import timeout +from .util import url + +ClosedPoolError = exceptions.ClosedPoolError +ProtocolError = exceptions.ProtocolError +EmptyPoolError = exceptions.EmptyPoolError +HostChangedError = exceptions.HostChangedError +LocationValueError = exceptions.LocationValueError +MaxRetryError = exceptions.MaxRetryError +ProxyError = exceptions.ProxyError +ReadTimeoutError = exceptions.ReadTimeoutError +SSLError = exceptions.SSLError +TimeoutError = exceptions.TimeoutError +InsecureRequestWarning = exceptions.InsecureRequestWarning +CertificateError = ssl_match_hostname.CertificateError +port_by_scheme = connection.port_by_scheme +DummyConnection = connection.DummyConnection +HTTPConnection = connection.HTTPConnection +HTTPSConnection = connection.HTTPSConnection +VerifiedHTTPSConnection = connection.VerifiedHTTPSConnection +RequestMethods = request.RequestMethods +HTTPResponse = response.HTTPResponse +is_connection_dropped = _connection.is_connection_dropped +Retry = retry.Retry +Timeout = timeout.Timeout +get_host = url.get_host + +xrange: Any +log: Any + +class ConnectionPool: + scheme: Any + QueueCls: Any + host: Any + port: Any + def __init__(self, host, port=...) -> None: ... + def __enter__(self): ... + def __exit__(self, exc_type, exc_val, exc_tb): ... + def close(self): ... + +class HTTPConnectionPool(ConnectionPool, RequestMethods): + scheme: Any + ConnectionCls: Any + strict: Any + timeout: Any + retries: Any + pool: Any + block: Any + proxy: Any + proxy_headers: Any + num_connections: Any + num_requests: Any + conn_kw: Any + def __init__(self, host, port=..., strict=..., timeout=..., maxsize=..., block=..., headers=..., retries=..., _proxy=..., _proxy_headers=..., **conn_kw) -> None: ... + def close(self): ... + def is_same_host(self, url): ... + def urlopen(self, method, url, body=..., headers=..., retries=..., redirect=..., assert_same_host=..., timeout=..., pool_timeout=..., release_conn=..., **response_kw): ... + +class HTTPSConnectionPool(HTTPConnectionPool): + scheme: Any + ConnectionCls: Any + key_file: Any + cert_file: Any + cert_reqs: Any + ca_certs: Any + ssl_version: Any + assert_hostname: Any + assert_fingerprint: Any + def __init__(self, host, port=..., strict=..., timeout=..., maxsize=..., block=..., headers=..., retries=..., _proxy=..., _proxy_headers=..., key_file=..., cert_file=..., cert_reqs=..., ca_certs=..., ssl_version=..., assert_hostname=..., assert_fingerprint=..., **conn_kw) -> None: ... + +def connection_from_url(url, **kw): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/contrib/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/contrib/__init__.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/exceptions.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/exceptions.pyi new file mode 100644 index 0000000..ddb4e83 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/exceptions.pyi @@ -0,0 +1,50 @@ +from typing import Any + +class HTTPError(Exception): ... +class HTTPWarning(Warning): ... + +class PoolError(HTTPError): + pool: Any + def __init__(self, pool, message) -> None: ... + def __reduce__(self): ... + +class RequestError(PoolError): + url: Any + def __init__(self, pool, url, message) -> None: ... + def __reduce__(self): ... + +class SSLError(HTTPError): ... +class ProxyError(HTTPError): ... +class DecodeError(HTTPError): ... +class ProtocolError(HTTPError): ... + +ConnectionError: Any + +class MaxRetryError(RequestError): + reason: Any + def __init__(self, pool, url, reason=...) -> None: ... + +class HostChangedError(RequestError): + retries: Any + def __init__(self, pool, url, retries=...) -> None: ... + +class TimeoutStateError(HTTPError): ... +class TimeoutError(HTTPError): ... +class ReadTimeoutError(TimeoutError, RequestError): ... +class ConnectTimeoutError(TimeoutError): ... +class EmptyPoolError(PoolError): ... +class ClosedPoolError(PoolError): ... +class LocationValueError(ValueError, HTTPError): ... + +class LocationParseError(LocationValueError): + location: Any + def __init__(self, location) -> None: ... + +class ResponseError(HTTPError): + GENERIC_ERROR: Any + SPECIFIC_ERROR: Any + +class SecurityWarning(HTTPWarning): ... +class InsecureRequestWarning(SecurityWarning): ... +class SystemTimeWarning(SecurityWarning): ... +class InsecurePlatformWarning(SecurityWarning): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/fields.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/fields.pyi new file mode 100644 index 0000000..9d691dc --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/fields.pyi @@ -0,0 +1,16 @@ +# Stubs for requests.packages.urllib3.fields (Python 3.4) + +from typing import Any +from . import packages + +def guess_content_type(filename, default=...): ... +def format_header_param(name, value): ... + +class RequestField: + data: Any + headers: Any + def __init__(self, name, data, filename=..., headers=...) -> None: ... + @classmethod + def from_tuples(cls, fieldname, value): ... + def render_headers(self): ... + def make_multipart(self, content_disposition=..., content_type=..., content_location=...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/filepost.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/filepost.pyi new file mode 100644 index 0000000..afcc837 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/filepost.pyi @@ -0,0 +1,15 @@ +from typing import Any +from . import packages +# from .packages import six +from . import fields + +# six = packages.six +# b = six.b +RequestField = fields.RequestField + +writer: Any + +def choose_boundary(): ... +def iter_field_objects(fields): ... +def iter_fields(fields): ... +def encode_multipart_formdata(fields, boundary=...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/packages/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/packages/__init__.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/packages/ssl_match_hostname/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/packages/ssl_match_hostname/__init__.pyi new file mode 100644 index 0000000..1915c0e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/packages/ssl_match_hostname/__init__.pyi @@ -0,0 +1,4 @@ +import ssl + +CertificateError = ssl.CertificateError +match_hostname = ssl.match_hostname diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.pyi new file mode 100644 index 0000000..c219980 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.pyi @@ -0,0 +1,3 @@ +class CertificateError(ValueError): ... + +def match_hostname(cert, hostname): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/poolmanager.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/poolmanager.pyi new file mode 100644 index 0000000..9568488 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/poolmanager.pyi @@ -0,0 +1,27 @@ +from typing import Any +from .request import RequestMethods + +class PoolManager(RequestMethods): + proxy: Any + connection_pool_kw: Any + pools: Any + def __init__(self, num_pools=..., headers=..., **connection_pool_kw) -> None: ... + def __enter__(self): ... + def __exit__(self, exc_type, exc_val, exc_tb): ... + def clear(self): ... + def connection_from_host(self, host, port=..., scheme=...): ... + def connection_from_url(self, url): ... + # TODO: This was the original signature -- copied another one from base class to fix complaint. + # def urlopen(self, method, url, redirect=True, **kw): ... + def urlopen(self, method, url, body=..., headers=..., encode_multipart=..., multipart_boundary=..., **kw): ... + +class ProxyManager(PoolManager): + proxy: Any + proxy_headers: Any + def __init__(self, proxy_url, num_pools=..., headers=..., proxy_headers=..., **connection_pool_kw) -> None: ... + def connection_from_host(self, host, port=..., scheme=...): ... + # TODO: This was the original signature -- copied another one from base class to fix complaint. + # def urlopen(self, method, url, redirect=True, **kw): ... + def urlopen(self, method, url, body=..., headers=..., encode_multipart=..., multipart_boundary=..., **kw): ... + +def proxy_from_url(url, **kw): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/request.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/request.pyi new file mode 100644 index 0000000..fd79126 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/request.pyi @@ -0,0 +1,9 @@ +from typing import Any + +class RequestMethods: + headers: Any + def __init__(self, headers=...) -> None: ... + def urlopen(self, method, url, body=..., headers=..., encode_multipart=..., multipart_boundary=..., **kw): ... + def request(self, method, url, fields=..., headers=..., **urlopen_kw): ... + def request_encode_url(self, method, url, fields=..., **urlopen_kw): ... + def request_encode_body(self, method, url, fields=..., headers=..., encode_multipart=..., multipart_boundary=..., **urlopen_kw): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/response.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/response.pyi new file mode 100644 index 0000000..de0aa33 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/response.pyi @@ -0,0 +1,53 @@ +from typing import Any +import io +from . import _collections +from . import exceptions +from .connection import HTTPException as HTTPException, BaseSSLError as BaseSSLError +from .util import response + +HTTPHeaderDict = _collections.HTTPHeaderDict +ProtocolError = exceptions.ProtocolError +DecodeError = exceptions.DecodeError +ReadTimeoutError = exceptions.ReadTimeoutError +binary_type = bytes # six.binary_type +PY3 = True # six.PY3 +is_fp_closed = response.is_fp_closed + +class DeflateDecoder: + def __init__(self) -> None: ... + def __getattr__(self, name): ... + def decompress(self, data): ... + +class GzipDecoder: + def __init__(self) -> None: ... + def __getattr__(self, name): ... + def decompress(self, data): ... + +class HTTPResponse(io.IOBase): + CONTENT_DECODERS: Any + REDIRECT_STATUSES: Any + headers: Any + status: Any + version: Any + reason: Any + strict: Any + decode_content: Any + def __init__(self, body=..., headers=..., status=..., version=..., reason=..., strict=..., preload_content=..., decode_content=..., original_response=..., pool=..., connection=...) -> None: ... + def get_redirect_location(self): ... + def release_conn(self): ... + @property + def data(self): ... + def tell(self): ... + def read(self, amt=..., decode_content=..., cache_content=...): ... + def stream(self, amt=..., decode_content=...): ... + @classmethod + def from_httplib(cls, r, **response_kw): ... + def getheaders(self): ... + def getheader(self, name, default=...): ... + def close(self): ... + @property + def closed(self): ... + def fileno(self): ... + def flush(self): ... + def readable(self): ... + def readinto(self, b): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/__init__.pyi new file mode 100644 index 0000000..53bdac9 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/__init__.pyi @@ -0,0 +1,25 @@ +from . import connection +from . import request +from . import response +from . import ssl_ +from . import timeout +from . import retry +from . import url +import ssl + +is_connection_dropped = connection.is_connection_dropped +make_headers = request.make_headers +is_fp_closed = response.is_fp_closed +SSLContext = ssl.SSLContext +HAS_SNI = ssl_.HAS_SNI +assert_fingerprint = ssl_.assert_fingerprint +resolve_cert_reqs = ssl_.resolve_cert_reqs +resolve_ssl_version = ssl_.resolve_ssl_version +ssl_wrap_socket = ssl_.ssl_wrap_socket +current_time = timeout.current_time +Timeout = timeout.Timeout +Retry = retry.Retry +get_host = url.get_host +parse_url = url.parse_url +split_first = url.split_first +Url = url.Url diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/connection.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/connection.pyi new file mode 100644 index 0000000..db77bd0 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/connection.pyi @@ -0,0 +1,8 @@ +from typing import Any + +poll: Any +select: Any +HAS_IPV6: bool + +def is_connection_dropped(conn): ... +def create_connection(address, timeout=..., source_address=..., socket_options=...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/request.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/request.pyi new file mode 100644 index 0000000..a7e112f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/request.pyi @@ -0,0 +1,8 @@ +from typing import Any +# from ..packages import six + +# b = six.b + +ACCEPT_ENCODING: Any + +def make_headers(keep_alive=..., accept_encoding=..., user_agent=..., basic_auth=..., proxy_basic_auth=..., disable_cache=...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/response.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/response.pyi new file mode 100644 index 0000000..30463da --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/response.pyi @@ -0,0 +1 @@ +def is_fp_closed(obj): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/retry.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/retry.pyi new file mode 100644 index 0000000..c7c2178 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/retry.pyi @@ -0,0 +1,32 @@ +from typing import Any +from .. import exceptions +from .. import packages + +ConnectTimeoutError = exceptions.ConnectTimeoutError +MaxRetryError = exceptions.MaxRetryError +ProtocolError = exceptions.ProtocolError +ReadTimeoutError = exceptions.ReadTimeoutError +ResponseError = exceptions.ResponseError + +log: Any + +class Retry: + DEFAULT_METHOD_WHITELIST: Any + BACKOFF_MAX: Any + total: Any + connect: Any + read: Any + redirect: Any + status_forcelist: Any + method_whitelist: Any + backoff_factor: Any + raise_on_redirect: Any + def __init__(self, total=..., connect=..., read=..., redirect=..., method_whitelist=..., status_forcelist=..., backoff_factor=..., raise_on_redirect=..., _observed_errors=...) -> None: ... + def new(self, **kw): ... + @classmethod + def from_int(cls, retries, redirect=..., default=...): ... + def get_backoff_time(self): ... + def sleep(self): ... + def is_forced_retry(self, method, status_code): ... + def is_exhausted(self): ... + def increment(self, method=..., url=..., response=..., error=..., _pool=..., _stacktrace=...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/ssl_.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/ssl_.pyi new file mode 100644 index 0000000..fe1a3a0 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/ssl_.pyi @@ -0,0 +1,20 @@ +from typing import Any +from .. import exceptions +import ssl + +SSLError = exceptions.SSLError +InsecurePlatformWarning = exceptions.InsecurePlatformWarning +SSLContext = ssl.SSLContext + +HAS_SNI: Any +create_default_context: Any +OP_NO_SSLv2: Any +OP_NO_SSLv3: Any +OP_NO_COMPRESSION: Any + +def assert_fingerprint(cert, fingerprint): ... +def resolve_cert_reqs(candidate): ... +def resolve_ssl_version(candidate): ... +def create_urllib3_context(ssl_version=..., cert_reqs=..., options=..., ciphers=...): ... +def ssl_wrap_socket(sock, keyfile=..., certfile=..., cert_reqs=..., ca_certs=..., + server_hostname=..., ssl_version=..., ciphers=..., ssl_context=...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/timeout.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/timeout.pyi new file mode 100644 index 0000000..0f3c97c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/timeout.pyi @@ -0,0 +1,20 @@ +from typing import Any +from .. import exceptions + +TimeoutStateError = exceptions.TimeoutStateError + +def current_time(): ... + +class Timeout: + DEFAULT_TIMEOUT: Any + total: Any + def __init__(self, total=..., connect=..., read=...) -> None: ... + @classmethod + def from_float(cls, timeout): ... + def clone(self): ... + def start_connect(self): ... + def get_connect_duration(self): ... + @property + def connect_timeout(self): ... + @property + def read_timeout(self): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/url.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/url.pyi new file mode 100644 index 0000000..0e40ba5 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/url.pyi @@ -0,0 +1,22 @@ +from typing import Any +from .. import exceptions + +LocationParseError = exceptions.LocationParseError + +url_attrs: Any + +class Url: + slots: Any + def __new__(cls, scheme=..., auth=..., host=..., port=..., path=..., query=..., fragment=...): ... + @property + def hostname(self): ... + @property + def request_uri(self): ... + @property + def netloc(self): ... + @property + def url(self): ... + +def split_first(s, delims): ... +def parse_url(url): ... +def get_host(url): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/sessions.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/sessions.pyi new file mode 100644 index 0000000..33c7b79 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/sessions.pyi @@ -0,0 +1,113 @@ +# Stubs for requests.sessions (Python 3) + +from typing import Any, Union, List, MutableMapping, Text, Optional, IO, Tuple, Callable, Iterable +from . import adapters +from . import auth as _auth +from . import compat +from . import cookies +from . import models +from .models import Response +from . import hooks +from . import utils +from . import exceptions +from .packages.urllib3 import _collections +from . import structures +from . import status_codes + +BaseAdapter = adapters.BaseAdapter +OrderedDict = compat.OrderedDict +cookiejar_from_dict = cookies.cookiejar_from_dict +extract_cookies_to_jar = cookies.extract_cookies_to_jar +RequestsCookieJar = cookies.RequestsCookieJar +merge_cookies = cookies.merge_cookies +Request = models.Request +PreparedRequest = models.PreparedRequest +DEFAULT_REDIRECT_LIMIT = models.DEFAULT_REDIRECT_LIMIT +default_hooks = hooks.default_hooks +dispatch_hook = hooks.dispatch_hook +to_key_val_list = utils.to_key_val_list +default_headers = utils.default_headers +to_native_string = utils.to_native_string +TooManyRedirects = exceptions.TooManyRedirects +InvalidSchema = exceptions.InvalidSchema +ChunkedEncodingError = exceptions.ChunkedEncodingError +ContentDecodingError = exceptions.ContentDecodingError +RecentlyUsedContainer = _collections.RecentlyUsedContainer +CaseInsensitiveDict = structures.CaseInsensitiveDict +HTTPAdapter = adapters.HTTPAdapter +requote_uri = utils.requote_uri +get_environ_proxies = utils.get_environ_proxies +get_netrc_auth = utils.get_netrc_auth +should_bypass_proxies = utils.should_bypass_proxies +get_auth_from_url = utils.get_auth_from_url +codes = status_codes.codes +REDIRECT_STATI = models.REDIRECT_STATI + +REDIRECT_CACHE_SIZE: Any + +def merge_setting(request_setting, session_setting, dict_class=...): ... +def merge_hooks(request_hooks, session_hooks, dict_class=...): ... + +class SessionRedirectMixin: + def resolve_redirects(self, resp, req, stream=..., timeout=..., verify=..., cert=..., + proxies=...): ... + def rebuild_auth(self, prepared_request, response): ... + def rebuild_proxies(self, prepared_request, proxies): ... + +_Data = Union[None, bytes, MutableMapping[Text, Text], IO] + +_Hook = Callable[[Response], Any] +_Hooks = MutableMapping[Text, List[_Hook]] +_HooksInput = MutableMapping[Text, Union[Iterable[_Hook], _Hook]] + +class Session(SessionRedirectMixin): + __attrs__: Any + headers: MutableMapping[Text, Text] + auth: Union[None, Tuple[Text, Text], _auth.AuthBase, Callable[[Request], Request]] + proxies: MutableMapping[Text, Text] + hooks: _Hooks + params: Union[bytes, MutableMapping[Text, Text]] + stream: bool + verify: Union[None, bool, Text] + cert: Union[None, Text, Tuple[Text, Text]] + max_redirects: int + trust_env: bool + cookies: RequestsCookieJar + adapters: MutableMapping + redirect_cache: RecentlyUsedContainer + def __init__(self) -> None: ... + def __enter__(self) -> Session: ... + def __exit__(self, *args) -> None: ... + def prepare_request(self, request): ... + def request(self, method: str, url: str, + params: Union[None, bytes, MutableMapping[Text, Text]] = ..., + data: _Data = ..., + headers: Optional[MutableMapping[Text, Text]] = ..., + cookies: Union[None, RequestsCookieJar, MutableMapping[Text, Text]] = ..., + files: Optional[MutableMapping[Text, IO]] = ..., + auth: Union[None, Tuple[Text, Text], _auth.AuthBase, Callable[[Request], Request]] = ..., + timeout: Union[None, float, Tuple[float, float]] = ..., + allow_redirects: Optional[bool] = ..., + proxies: Optional[MutableMapping[Text, Text]] = ..., + hooks: Optional[_HooksInput] = ..., + stream: Optional[bool] = ..., + verify: Union[None, bool, Text] = ..., + cert: Union[Text, Tuple[Text, Text], None] = ..., + json: Optional[Any] = ..., + ) -> Response: ... + def get(self, url: Union[Text, bytes], **kwargs) -> Response: ... + def options(self, url: Union[Text, bytes], **kwargs) -> Response: ... + def head(self, url: Union[Text, bytes], **kwargs) -> Response: ... + def post(self, url: Union[Text, bytes], data: _Data = ..., json: Optional[Any] = ..., **kwargs) -> Response: ... + def put(self, url: Union[Text, bytes], data: _Data = ..., **kwargs) -> Response: ... + def patch(self, url: Union[Text, bytes], data: _Data = ..., **kwargs) -> Response: ... + def delete(self, url: Union[Text, bytes], **kwargs) -> Response: ... + def send(self, request, **kwargs): ... + def merge_environment_settings(self, url, proxies, stream, verify, cert): ... + def get_adapter(self, url): ... + def close(self) -> None: ... + def mount(self, prefix: + Union[Text, bytes], + adapter: BaseAdapter) -> None: ... + +def session() -> Session: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/status_codes.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/status_codes.pyi new file mode 100644 index 0000000..f9bf820 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/status_codes.pyi @@ -0,0 +1,4 @@ +from typing import Any +from .structures import LookupDict + +codes: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/structures.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/structures.pyi new file mode 100644 index 0000000..92cf27a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/structures.pyi @@ -0,0 +1,19 @@ +from typing import Any, Dict, Iterable, Iterator, Mapping, MutableMapping, Optional, Tuple, TypeVar, Union, Generic + +_VT = TypeVar('_VT') + +class CaseInsensitiveDict(MutableMapping[str, _VT], Generic[_VT]): + def __init__(self, data: Optional[Union[Mapping[str, _VT], Iterable[Tuple[str, _VT]]]] = ..., **kwargs: _VT) -> None: ... + def lower_items(self) -> Iterator[Tuple[str, _VT]]: ... + def __setitem__(self, key: str, value: _VT) -> None: ... + def __getitem__(self, key: str) -> _VT: ... + def __delitem__(self, key: str) -> None: ... + def __iter__(self) -> Iterator[str]: ... + def __len__(self) -> int: ... + +class LookupDict(Dict[str, _VT]): + name: Any + def __init__(self, name: Any = ...) -> None: ... + def __getitem__(self, key: str) -> Optional[_VT]: ... # type: ignore + def __getattr__(self, attr: str) -> _VT: ... + def __setattr__(self, attr: str, value: _VT) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/utils.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/utils.pyi new file mode 100644 index 0000000..396a374 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/requests/utils.pyi @@ -0,0 +1,53 @@ +# Stubs for requests.utils (Python 3) + +from typing import Any +from . import compat +from . import cookies +from . import structures +from . import exceptions + +OrderedDict = compat.OrderedDict +RequestsCookieJar = cookies.RequestsCookieJar +cookiejar_from_dict = cookies.cookiejar_from_dict +CaseInsensitiveDict = structures.CaseInsensitiveDict +InvalidURL = exceptions.InvalidURL + +NETRC_FILES: Any +DEFAULT_CA_BUNDLE_PATH: Any + +def dict_to_sequence(d): ... +def super_len(o): ... +def get_netrc_auth(url): ... +def guess_filename(obj): ... +def from_key_val_list(value): ... +def to_key_val_list(value): ... +def parse_list_header(value): ... +def parse_dict_header(value): ... +def unquote_header_value(value, is_filename=...): ... +def dict_from_cookiejar(cj): ... +def add_dict_to_cookiejar(cj, cookie_dict): ... +def get_encodings_from_content(content): ... +def get_encoding_from_headers(headers): ... +def stream_decode_response_unicode(iterator, r): ... +def iter_slices(string, slice_length): ... +def get_unicode_from_response(r): ... + +UNRESERVED_SET: Any + +def unquote_unreserved(uri): ... +def requote_uri(uri): ... +def address_in_network(ip, net): ... +def dotted_netmask(mask): ... +def is_ipv4_address(string_ip): ... +def is_valid_cidr(string_network): ... +def set_environ(env_name, value): ... +def should_bypass_proxies(url): ... +def get_environ_proxies(url): ... +def default_user_agent(name=...): ... +def default_headers(): ... +def parse_header_links(value): ... +def guess_json_utf(data): ... +def prepend_scheme_if_needed(url, new_scheme): ... +def get_auth_from_url(url): ... +def to_native_string(string, encoding=...): ... +def urldefragauth(url): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/simplejson/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/simplejson/__init__.pyi new file mode 100644 index 0000000..6221b4e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/simplejson/__init__.pyi @@ -0,0 +1,13 @@ +from typing import Any, IO, Text, Union + +from simplejson.scanner import JSONDecodeError as JSONDecodeError +from simplejson.decoder import JSONDecoder as JSONDecoder +from simplejson.encoder import JSONEncoder as JSONEncoder, JSONEncoderForHTML as JSONEncoderForHTML + +_LoadsString = Union[Text, bytes, bytearray] + + +def dumps(obj: Any, *args: Any, **kwds: Any) -> str: ... +def dump(obj: Any, fp: IO[str], *args: Any, **kwds: Any) -> None: ... +def loads(s: _LoadsString, **kwds: Any) -> Any: ... +def load(fp: IO[str], **kwds: Any) -> Any: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/simplejson/decoder.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/simplejson/decoder.pyi new file mode 100644 index 0000000..59111ce --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/simplejson/decoder.pyi @@ -0,0 +1,6 @@ +from typing import Any, Match + +class JSONDecoder(object): + def __init__(self, **kwargs): ... + def decode(self, s: str, _w: Match[str], _PY3: bool): ... + def raw_decode(self, s: str, idx: int, _w: Match[str], _PY3: bool): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/simplejson/encoder.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/simplejson/encoder.pyi new file mode 100644 index 0000000..0e31806 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/simplejson/encoder.pyi @@ -0,0 +1,9 @@ +from typing import Any, IO + +class JSONEncoder(object): + def __init__(self, *args, **kwargs): ... + def encode(self, o: Any): ... + def default(self, o: Any): ... + def iterencode(self, o: Any, _one_shot: bool): ... + +class JSONEncoderForHTML(JSONEncoder): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/simplejson/scanner.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/simplejson/scanner.pyi new file mode 100644 index 0000000..5de484a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/simplejson/scanner.pyi @@ -0,0 +1,11 @@ +from typing import Optional + +class JSONDecodeError(ValueError): + msg: str = ... + doc: str = ... + pos: int = ... + end: Optional[int] = ... + lineno: int = ... + colno: int = ... + endlineno: Optional[int] = ... + endcolno: Optional[int] = ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/singledispatch.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/singledispatch.pyi new file mode 100644 index 0000000..e89ac12 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/singledispatch.pyi @@ -0,0 +1,17 @@ +from typing import Any, Callable, Generic, Mapping, Optional, TypeVar, overload + + +_T = TypeVar("_T") + + +class _SingleDispatchCallable(Generic[_T]): + registry: Mapping[Any, Callable[..., _T]] + def dispatch(self, cls: Any) -> Callable[..., _T]: ... + @overload + def register(self, cls: Any) -> Callable[[Callable[..., _T]], Callable[..., _T]]: ... + @overload + def register(self, cls: Any, func: Callable[..., _T]) -> Callable[..., _T]: ... + def _clear_cache(self) -> None: ... + def __call__(self, *args: Any, **kwargs: Any) -> _T: ... + +def singledispatch(func: Callable[..., _T]) -> _SingleDispatchCallable[_T]: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/tabulate.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/tabulate.pyi new file mode 100644 index 0000000..a360515 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/tabulate.pyi @@ -0,0 +1,18 @@ +# Stub for tabulate: https://bitbucket.org/astanin/python-tabulate +from typing import Any, Dict, Iterable, Sequence, Union + + +def __getattr__(name: str) -> Any: ... + +def tabulate( + tabular_data: Iterable[Iterable[Any]], + headers: Union[str, Dict[str, str], Sequence[str]] = ..., + tablefmt: str = ..., + floatfmt: str = ..., + numalign: str = ..., + stralign: str = ..., + missingval: str = ..., + showindex: str = ..., + disable_numparse: bool = ... +) -> str: + ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/termcolor.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/termcolor.pyi new file mode 100644 index 0000000..e1ad18b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/termcolor.pyi @@ -0,0 +1,21 @@ +# Stub for termcolor: https://pypi.python.org/pypi/termcolor +from typing import Any, Iterable, Optional, Text + + +def colored( + text: Text, + color: Optional[Text] = ..., + on_color: Optional[Text] = ..., + attrs: Optional[Iterable[Text]] = ..., +) -> Text: + ... + + +def cprint( + text: Text, + color: Optional[Text] = ..., + on_color: Optional[Text] = ..., + attrs: Optional[Iterable[Text]] = ..., + **kwargs: Any, +) -> None: + ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/toml.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/toml.pyi new file mode 100644 index 0000000..2639178 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/toml.pyi @@ -0,0 +1,24 @@ +from typing import Any, IO, List, Mapping, MutableMapping, Optional, Protocol, Text, Type, Union +import datetime +import sys + +if sys.version_info >= (3, 4): + import pathlib + if sys.version_info >= (3, 6): + import os + _PathLike = Union[Text, pathlib.PurePath, os.PathLike] + else: + _PathLike = Union[Text, pathlib.PurePath] +else: + _PathLike = Text + +class _Writable(Protocol): + def write(self, obj: str) -> Any: ... + +class TomlDecodeError(Exception): ... + +def load(f: Union[_PathLike, List[Text], IO[str]], _dict: Type[MutableMapping[str, Any]] = ...) -> MutableMapping[str, Any]: ... +def loads(s: Text, _dict: Type[MutableMapping[str, Any]] = ...) -> MutableMapping[str, Any]: ... + +def dump(o: Mapping[str, Any], f: _Writable) -> str: ... +def dumps(o: Mapping[str, Any]) -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/typing_extensions.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/typing_extensions.pyi new file mode 100644 index 0000000..fdc9d87 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/typing_extensions.pyi @@ -0,0 +1,58 @@ +import abc +import sys +from typing import Callable +from typing import ClassVar as ClassVar +from typing import ContextManager as ContextManager +from typing import Counter as Counter +from typing import DefaultDict as DefaultDict +from typing import Deque as Deque +from typing import NewType as NewType +from typing import NoReturn as NoReturn +from typing import overload as overload +from typing import Text as Text +from typing import Type as Type +from typing import TYPE_CHECKING as TYPE_CHECKING +from typing import TypeVar, Any, Mapping, ItemsView, KeysView, ValuesView, Dict, Type + +_T = TypeVar('_T') +_F = TypeVar('_F', bound=Callable[..., Any]) +_TC = TypeVar('_TC', bound=Type[object]) +class _SpecialForm: + def __getitem__(self, typeargs: Any) -> Any: ... +def runtime(cls: _TC) -> _TC: ... +Protocol: _SpecialForm = ... +Final: _SpecialForm = ... +def final(f: _F) -> _F: ... +Literal: _SpecialForm = ... + +# Internal mypy fallback type for all typed dicts (does not exist at runtime) +class _TypedDict(Mapping[str, object], metaclass=abc.ABCMeta): + def copy(self: _T) -> _T: ... + # Using NoReturn so that only calls using mypy plugin hook that specialize the signature + # can go through. + def setdefault(self, k: NoReturn, default: object) -> object: ... + # Mypy plugin hook for 'pop' expects that 'default' has a type variable type. + def pop(self, k: NoReturn, default: _T = ...) -> object: ... + def update(self: _T, __m: _T) -> None: ... + if sys.version_info < (3, 0): + def has_key(self, k: str) -> bool: ... + def viewitems(self) -> ItemsView[str, object]: ... + def viewkeys(self) -> KeysView[str]: ... + def viewvalues(self) -> ValuesView[object]: ... + def __delitem__(self, k: NoReturn) -> None: ... + +# TypedDict is a (non-subscriptable) special form. +TypedDict: object = ... + +if sys.version_info >= (3, 3): + from typing import ChainMap as ChainMap + +if sys.version_info >= (3, 5): + from typing import AsyncIterable as AsyncIterable + from typing import AsyncIterator as AsyncIterator + from typing import AsyncContextManager as AsyncContextManager + from typing import Awaitable as Awaitable + from typing import Coroutine as Coroutine + +if sys.version_info >= (3, 6): + from typing import AsyncGenerator as AsyncGenerator diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/ujson.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/ujson.pyi new file mode 100644 index 0000000..7e00659 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/ujson.pyi @@ -0,0 +1,51 @@ +# Stubs for ujson +# See: https://pypi.python.org/pypi/ujson +from typing import Any, AnyStr, IO, Optional + +__version__: str + +def encode( + obj: Any, + ensure_ascii: bool = ..., + double_precision: int = ..., + encode_html_chars: bool = ..., + escape_forward_slashes: bool = ..., + sort_keys: bool = ..., + indent: int = ..., +) -> str: ... + +def dumps( + obj: Any, + ensure_ascii: bool = ..., + double_precision: int = ..., + encode_html_chars: bool = ..., + escape_forward_slashes: bool = ..., + sort_keys: bool = ..., + indent: int = ..., +) -> str: ... + +def dump( + obj: Any, + fp: IO[str], + ensure_ascii: bool = ..., + double_precision: int = ..., + encode_html_chars: bool = ..., + escape_forward_slashes: bool = ..., + sort_keys: bool = ..., + indent: int = ..., +) -> None: ... + +def decode( + s: AnyStr, + precise_float: bool = ..., +) -> Any: ... + +def loads( + s: AnyStr, + precise_float: bool = ..., +) -> Any: ... + +def load( + fp: IO[AnyStr], + precise_float: bool = ..., +) -> Any: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/__init__.pyi new file mode 100644 index 0000000..2de398a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/__init__.pyi @@ -0,0 +1,150 @@ +from types import ModuleType +from typing import Any + +from werkzeug import _internal +from werkzeug import datastructures +from werkzeug import debug +from werkzeug import exceptions +from werkzeug import formparser +from werkzeug import http +from werkzeug import local +from werkzeug import security +from werkzeug import serving +from werkzeug import test +from werkzeug import testapp +from werkzeug import urls +from werkzeug import useragents +from werkzeug import utils +from werkzeug import wrappers +from werkzeug import wsgi + +class module(ModuleType): + def __getattr__(self, name): ... + def __dir__(self): ... + + +__version__: Any + +run_simple = serving.run_simple +test_app = testapp.test_app +UserAgent = useragents.UserAgent +_easteregg = _internal._easteregg +DebuggedApplication = debug.DebuggedApplication +MultiDict = datastructures.MultiDict +CombinedMultiDict = datastructures.CombinedMultiDict +Headers = datastructures.Headers +EnvironHeaders = datastructures.EnvironHeaders +ImmutableList = datastructures.ImmutableList +ImmutableDict = datastructures.ImmutableDict +ImmutableMultiDict = datastructures.ImmutableMultiDict +TypeConversionDict = datastructures.TypeConversionDict +ImmutableTypeConversionDict = datastructures.ImmutableTypeConversionDict +Accept = datastructures.Accept +MIMEAccept = datastructures.MIMEAccept +CharsetAccept = datastructures.CharsetAccept +LanguageAccept = datastructures.LanguageAccept +RequestCacheControl = datastructures.RequestCacheControl +ResponseCacheControl = datastructures.ResponseCacheControl +ETags = datastructures.ETags +HeaderSet = datastructures.HeaderSet +WWWAuthenticate = datastructures.WWWAuthenticate +Authorization = datastructures.Authorization +FileMultiDict = datastructures.FileMultiDict +CallbackDict = datastructures.CallbackDict +FileStorage = datastructures.FileStorage +OrderedMultiDict = datastructures.OrderedMultiDict +ImmutableOrderedMultiDict = datastructures.ImmutableOrderedMultiDict +escape = utils.escape +environ_property = utils.environ_property +append_slash_redirect = utils.append_slash_redirect +redirect = utils.redirect +cached_property = utils.cached_property +import_string = utils.import_string +dump_cookie = http.dump_cookie +parse_cookie = http.parse_cookie +unescape = utils.unescape +format_string = utils.format_string +find_modules = utils.find_modules +header_property = utils.header_property +html = utils.html +xhtml = utils.xhtml +HTMLBuilder = utils.HTMLBuilder +validate_arguments = utils.validate_arguments +ArgumentValidationError = utils.ArgumentValidationError +bind_arguments = utils.bind_arguments +secure_filename = utils.secure_filename +BaseResponse = wrappers.BaseResponse +BaseRequest = wrappers.BaseRequest +Request = wrappers.Request +Response = wrappers.Response +AcceptMixin = wrappers.AcceptMixin +ETagRequestMixin = wrappers.ETagRequestMixin +ETagResponseMixin = wrappers.ETagResponseMixin +ResponseStreamMixin = wrappers.ResponseStreamMixin +CommonResponseDescriptorsMixin = wrappers.CommonResponseDescriptorsMixin +UserAgentMixin = wrappers.UserAgentMixin +AuthorizationMixin = wrappers.AuthorizationMixin +WWWAuthenticateMixin = wrappers.WWWAuthenticateMixin +CommonRequestDescriptorsMixin = wrappers.CommonRequestDescriptorsMixin +Local = local.Local +LocalManager = local.LocalManager +LocalProxy = local.LocalProxy +LocalStack = local.LocalStack +release_local = local.release_local +generate_password_hash = security.generate_password_hash +check_password_hash = security.check_password_hash +Client = test.Client +EnvironBuilder = test.EnvironBuilder +create_environ = test.create_environ +run_wsgi_app = test.run_wsgi_app +get_current_url = wsgi.get_current_url +get_host = wsgi.get_host +pop_path_info = wsgi.pop_path_info +peek_path_info = wsgi.peek_path_info +SharedDataMiddleware = wsgi.SharedDataMiddleware +DispatcherMiddleware = wsgi.DispatcherMiddleware +ClosingIterator = wsgi.ClosingIterator +FileWrapper = wsgi.FileWrapper +make_line_iter = wsgi.make_line_iter +LimitedStream = wsgi.LimitedStream +responder = wsgi.responder +wrap_file = wsgi.wrap_file +extract_path_info = wsgi.extract_path_info +parse_etags = http.parse_etags +parse_date = http.parse_date +http_date = http.http_date +cookie_date = http.cookie_date +parse_cache_control_header = http.parse_cache_control_header +is_resource_modified = http.is_resource_modified +parse_accept_header = http.parse_accept_header +parse_set_header = http.parse_set_header +quote_etag = http.quote_etag +unquote_etag = http.unquote_etag +generate_etag = http.generate_etag +dump_header = http.dump_header +parse_list_header = http.parse_list_header +parse_dict_header = http.parse_dict_header +parse_authorization_header = http.parse_authorization_header +parse_www_authenticate_header = http.parse_www_authenticate_header +remove_entity_headers = http.remove_entity_headers +is_entity_header = http.is_entity_header +remove_hop_by_hop_headers = http.remove_hop_by_hop_headers +parse_options_header = http.parse_options_header +dump_options_header = http.dump_options_header +is_hop_by_hop_header = http.is_hop_by_hop_header +unquote_header_value = http.unquote_header_value +quote_header_value = http.quote_header_value +HTTP_STATUS_CODES = http.HTTP_STATUS_CODES +url_decode = urls.url_decode +url_encode = urls.url_encode +url_quote = urls.url_quote +url_quote_plus = urls.url_quote_plus +url_unquote = urls.url_unquote +url_unquote_plus = urls.url_unquote_plus +url_fix = urls.url_fix +Href = urls.Href +iri_to_uri = urls.iri_to_uri +uri_to_iri = urls.uri_to_iri +parse_form_data = formparser.parse_form_data +abort = exceptions.Aborter +Aborter = exceptions.Aborter diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/_compat.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/_compat.pyi new file mode 100644 index 0000000..bc4340d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/_compat.pyi @@ -0,0 +1,48 @@ +import sys +from typing import Any, Optional, Text + +if sys.version_info < (3,): + import StringIO as BytesIO +else: + from io import StringIO as BytesIO + +PY2: Any +WIN: Any +unichr: Any +text_type: Any +string_types: Any +integer_types: Any +iterkeys: Any +itervalues: Any +iteritems: Any +iterlists: Any +iterlistvalues: Any +int_to_byte: Any +iter_bytes: Any + +def fix_tuple_repr(obj): ... +def implements_iterator(cls): ... +def implements_to_string(cls): ... +def native_string_result(func): ... +def implements_bool(cls): ... + +range_type: Any +NativeStringIO: Any + +def make_literal_wrapper(reference): ... +def normalize_string_tuple(tup): ... +def try_coerce_native(s): ... + +wsgi_get_bytes: Any + +def wsgi_decoding_dance(s, charset: Text = ..., errors: Text = ...): ... +def wsgi_encoding_dance(s, charset: Text = ..., errors: Text = ...): ... +def to_bytes(x, charset: Text = ..., errors: Text = ...): ... +def to_native(x, charset: Text = ..., errors: Text = ...): ... +def reraise(tp, value, tb: Optional[Any] = ...): ... + +imap: Any +izip: Any +ifilter: Any + +def to_unicode(x, charset: Text = ..., errors: Text = ..., allow_none_charset: bool = ...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/_internal.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/_internal.pyi new file mode 100644 index 0000000..64f63a1 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/_internal.pyi @@ -0,0 +1,19 @@ +from typing import Any, Optional + +class _Missing: + def __reduce__(self): ... + +class _DictAccessorProperty: + read_only: Any + name: Any + default: Any + load_func: Any + dump_func: Any + __doc__: Any + def __init__(self, name, default: Optional[Any] = ..., load_func: Optional[Any] = ..., dump_func: Optional[Any] = ..., + read_only: Optional[Any] = ..., doc: Optional[Any] = ...): ... + def __get__(self, obj, type: Optional[Any] = ...): ... + def __set__(self, obj, value): ... + def __delete__(self, obj): ... + +def _easteregg(app: Optional[Any] = ...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/_reloader.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/_reloader.pyi new file mode 100644 index 0000000..be23222 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/_reloader.pyi @@ -0,0 +1,29 @@ +from typing import Any, Optional + +class ReloaderLoop: + name: Any + extra_files: Any + interval: float + def __init__(self, extra_files: Optional[Any] = ..., interval: float = ...): ... + def run(self): ... + def restart_with_reloader(self): ... + def trigger_reload(self, filename): ... + def log_reload(self, filename): ... + +class StatReloaderLoop(ReloaderLoop): + name: Any + def run(self): ... + +class WatchdogReloaderLoop(ReloaderLoop): + observable_paths: Any + name: Any + observer_class: Any + event_handler: Any + should_reload: Any + def __init__(self, *args, **kwargs): ... + def trigger_reload(self, filename): ... + def run(self): ... + +reloader_loops: Any + +def run_with_reloader(main_func, extra_files: Optional[Any] = ..., interval: float = ..., reloader_type: str = ...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/__init__.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/atom.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/atom.pyi new file mode 100644 index 0000000..d02a482 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/atom.pyi @@ -0,0 +1,50 @@ +from typing import Any, Optional + +XHTML_NAMESPACE: Any + +def format_iso8601(obj): ... + +class AtomFeed: + default_generator: Any + title: Any + title_type: Any + url: Any + feed_url: Any + id: Any + updated: Any + author: Any + icon: Any + logo: Any + rights: Any + rights_type: Any + subtitle: Any + subtitle_type: Any + generator: Any + links: Any + entries: Any + def __init__(self, title: Optional[Any] = ..., entries: Optional[Any] = ..., **kwargs): ... + def add(self, *args, **kwargs): ... + def generate(self): ... + def to_string(self): ... + def get_response(self): ... + def __call__(self, environ, start_response): ... + +class FeedEntry: + title: Any + title_type: Any + content: Any + content_type: Any + url: Any + id: Any + updated: Any + summary: Any + summary_type: Any + author: Any + published: Any + rights: Any + links: Any + categories: Any + xml_base: Any + def __init__(self, title: Optional[Any] = ..., content: Optional[Any] = ..., feed_url: Optional[Any] = ..., **kwargs): ... + def generate(self): ... + def to_string(self): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/cache.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/cache.pyi new file mode 100644 index 0000000..9ef76da --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/cache.pyi @@ -0,0 +1,84 @@ +from typing import Any, Optional + +class BaseCache: + default_timeout: float + def __init__(self, default_timeout: float = ...): ... + def get(self, key): ... + def delete(self, key): ... + def get_many(self, *keys): ... + def get_dict(self, *keys): ... + def set(self, key, value, timeout: Optional[float] = ...): ... + def add(self, key, value, timeout: Optional[float] = ...): ... + def set_many(self, mapping, timeout: Optional[float] = ...): ... + def delete_many(self, *keys): ... + def has(self, key): ... + def clear(self): ... + def inc(self, key, delta=...): ... + def dec(self, key, delta=...): ... + +class NullCache(BaseCache): ... + +class SimpleCache(BaseCache): + clear: Any + def __init__(self, threshold: int = ..., default_timeout: float = ...): ... + def get(self, key): ... + def set(self, key, value, timeout: Optional[float] = ...): ... + def add(self, key, value, timeout: Optional[float] = ...): ... + def delete(self, key): ... + def has(self, key): ... + +class MemcachedCache(BaseCache): + key_prefix: Any + def __init__(self, servers: Optional[Any] = ..., default_timeout: float = ..., key_prefix: Optional[Any] = ...): ... + def get(self, key): ... + def get_dict(self, *keys): ... + def add(self, key, value, timeout: Optional[float] = ...): ... + def set(self, key, value, timeout: Optional[float] = ...): ... + def get_many(self, *keys): ... + def set_many(self, mapping, timeout: Optional[float] = ...): ... + def delete(self, key): ... + def delete_many(self, *keys): ... + def has(self, key): ... + def clear(self): ... + def inc(self, key, delta=...): ... + def dec(self, key, delta=...): ... + def import_preferred_memcache_lib(self, servers): ... + +GAEMemcachedCache: Any + +class RedisCache(BaseCache): + key_prefix: Any + def __init__(self, host: str = ..., port: int = ..., password: Optional[Any] = ..., db: int = ..., + default_timeout: float = ..., key_prefix: Optional[Any] = ..., **kwargs): ... + def dump_object(self, value): ... + def load_object(self, value): ... + def get(self, key): ... + def get_many(self, *keys): ... + def set(self, key, value, timeout: Optional[float] = ...): ... + def add(self, key, value, timeout: Optional[float] = ...): ... + def set_many(self, mapping, timeout: Optional[float] = ...): ... + def delete(self, key): ... + def delete_many(self, *keys): ... + def has(self, key): ... + def clear(self): ... + def inc(self, key, delta=...): ... + def dec(self, key, delta=...): ... + +class FileSystemCache(BaseCache): + def __init__(self, cache_dir, threshold: int = ..., default_timeout: float = ..., mode: int = ...): ... + def clear(self): ... + def get(self, key): ... + def add(self, key, value, timeout: Optional[float] = ...): ... + def set(self, key, value, timeout: Optional[float] = ...): ... + def delete(self, key): ... + def has(self, key): ... + +class UWSGICache(BaseCache): + cache: Any + def __init__(self, default_timeout: float = ..., cache: str = ...): ... + def get(self, key): ... + def delete(self, key): ... + def set(self, key, value, timeout: Optional[float] = ...): ... + def add(self, key, value, timeout: Optional[float] = ...): ... + def clear(self): ... + def has(self, key): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/fixers.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/fixers.pyi new file mode 100644 index 0000000..97c6e56 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/fixers.pyi @@ -0,0 +1,38 @@ +from typing import Any, Sequence, Optional, Iterable +from wsgiref.types import WSGIApplication, WSGIEnvironment, StartResponse + +class CGIRootFix: + app: Any + app_root: Any + def __init__(self, app, app_root: str = ...): ... + def __call__(self, environ, start_response): ... + +LighttpdCGIRootFix: Any + +class PathInfoFromRequestUriFix: + app: Any + def __init__(self, app): ... + def __call__(self, environ, start_response): ... + +class ProxyFix(object): + app: WSGIApplication + num_proxies: int + def __init__(self, app: WSGIApplication, num_proxies: int = ...) -> None: ... + def get_remote_addr(self, forwarded_for: Sequence[str]) -> Optional[str]: ... + def __call__(self, environ: WSGIEnvironment, start_response: StartResponse) -> Iterable[bytes]: ... + +class HeaderRewriterFix: + app: Any + remove_headers: Any + add_headers: Any + def __init__(self, app, remove_headers: Optional[Any] = ..., add_headers: Optional[Any] = ...): ... + def __call__(self, environ, start_response): ... + +class InternetExplorerFix: + app: Any + fix_vary: Any + fix_attach: Any + def __init__(self, app, fix_vary: bool = ..., fix_attach: bool = ...): ... + def fix_headers(self, environ, headers, status: Optional[Any] = ...): ... + def run_fixed(self, environ, start_response): ... + def __call__(self, environ, start_response): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/iterio.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/iterio.pyi new file mode 100644 index 0000000..c7ce70c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/iterio.pyi @@ -0,0 +1,39 @@ +from typing import Any, Optional, Text, Union + +greenlet: Any + +class IterIO: + def __new__(cls, obj, sentinel: Union[Text, bytes] = ...): ... + def __iter__(self): ... + def tell(self): ... + def isatty(self): ... + def seek(self, pos, mode: int = ...): ... + def truncate(self, size: Optional[Any] = ...): ... + def write(self, s): ... + def writelines(self, list): ... + def read(self, n: int = ...): ... + def readlines(self, sizehint: int = ...): ... + def readline(self, length: Optional[Any] = ...): ... + def flush(self): ... + def __next__(self): ... + +class IterI(IterIO): + sentinel: Any + def __new__(cls, func, sentinel: Union[Text, bytes] = ...): ... + closed: Any + def close(self): ... + def write(self, s): ... + def writelines(self, list): ... + def flush(self): ... + +class IterO(IterIO): + sentinel: Any + closed: Any + pos: Any + def __new__(cls, gen, sentinel: Union[Text, bytes] = ...): ... + def __iter__(self): ... + def close(self): ... + def seek(self, pos, mode: int = ...): ... + def read(self, n: int = ...): ... + def readline(self, length: Optional[Any] = ...): ... + def readlines(self, sizehint: int = ...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/jsrouting.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/jsrouting.pyi new file mode 100644 index 0000000..46f1972 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/jsrouting.pyi @@ -0,0 +1,10 @@ +from typing import Any + +def dumps(*args): ... +def render_template(name_parts, rules, converters): ... +def generate_map(map, name: str = ...): ... +def generate_adapter(adapter, name: str = ..., map_name: str = ...): ... +def js_to_url_function(converter): ... +def NumberConverter_js_to_url(conv): ... + +js_to_url_functions: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/limiter.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/limiter.pyi new file mode 100644 index 0000000..0734a24 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/limiter.pyi @@ -0,0 +1,7 @@ +from typing import Any + +class StreamLimitMiddleware: + app: Any + maximum_size: Any + def __init__(self, app, maximum_size=...): ... + def __call__(self, environ, start_response): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/lint.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/lint.pyi new file mode 100644 index 0000000..7fd7c6a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/lint.pyi @@ -0,0 +1,43 @@ +from typing import Any + +class WSGIWarning(Warning): ... +class HTTPWarning(Warning): ... + +def check_string(context, obj, stacklevel: int = ...): ... + +class InputStream: + def __init__(self, stream): ... + def read(self, *args): ... + def readline(self, *args): ... + def __iter__(self): ... + def close(self): ... + +class ErrorStream: + def __init__(self, stream): ... + def write(self, s): ... + def flush(self): ... + def writelines(self, seq): ... + def close(self): ... + +class GuardedWrite: + def __init__(self, write, chunks): ... + def __call__(self, s): ... + +class GuardedIterator: + closed: Any + headers_set: Any + chunks: Any + def __init__(self, iterator, headers_set, chunks): ... + def __iter__(self): ... + def next(self): ... + def close(self): ... + def __del__(self): ... + +class LintMiddleware: + app: Any + def __init__(self, app): ... + def check_environ(self, environ): ... + def check_start_response(self, status, headers, exc_info): ... + def check_headers(self, headers): ... + def check_iterator(self, app_iter): ... + def __call__(self, *args, **kwargs): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/profiler.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/profiler.pyi new file mode 100644 index 0000000..601c4f1 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/profiler.pyi @@ -0,0 +1,15 @@ +from typing import Any, Optional + +available: Any + +class MergeStream: + streams: Any + def __init__(self, *streams): ... + def write(self, data): ... + +class ProfilerMiddleware: + def __init__(self, app, stream: Optional[Any] = ..., sort_by=..., restrictions=..., profile_dir: Optional[Any] = ...): ... + def __call__(self, environ, start_response): ... + +def make_action(app_factory, hostname: str = ..., port: int = ..., threaded: bool = ..., processes: int = ..., + stream: Optional[Any] = ..., sort_by=..., restrictions=...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/securecookie.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/securecookie.pyi new file mode 100644 index 0000000..009ad2d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/securecookie.pyi @@ -0,0 +1,28 @@ +from typing import Any, Optional +from hmac import new as hmac +from hashlib import sha1 as _default_hash +from werkzeug.contrib.sessions import ModificationTrackingDict + +class UnquoteError(Exception): ... + +class SecureCookie(ModificationTrackingDict): + hash_method: Any + serialization_method: Any + quote_base64: Any + secret_key: Any + new: Any + def __init__(self, data: Optional[Any] = ..., secret_key: Optional[Any] = ..., new: bool = ...): ... + @property + def should_save(self): ... + @classmethod + def quote(cls, value): ... + @classmethod + def unquote(cls, value): ... + def serialize(self, expires: Optional[Any] = ...): ... + @classmethod + def unserialize(cls, string, secret_key): ... + @classmethod + def load_cookie(cls, request, key: str = ..., secret_key: Optional[Any] = ...): ... + def save_cookie(self, response, key: str = ..., expires: Optional[Any] = ..., session_expires: Optional[Any] = ..., + max_age: Optional[Any] = ..., path: str = ..., domain: Optional[Any] = ..., secure: Optional[Any] = ..., + httponly: bool = ..., force: bool = ...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/sessions.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/sessions.pyi new file mode 100644 index 0000000..b4b4ec2 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/sessions.pyi @@ -0,0 +1,57 @@ +from typing import Any, Optional, Text +from werkzeug.datastructures import CallbackDict + +def generate_key(salt: Optional[Any] = ...): ... + +class ModificationTrackingDict(CallbackDict): + modified: Any + def __init__(self, *args, **kwargs): ... + def copy(self): ... + def __copy__(self): ... + +class Session(ModificationTrackingDict): + sid: Any + new: Any + def __init__(self, data, sid, new: bool = ...): ... + @property + def should_save(self): ... + +class SessionStore: + session_class: Any + def __init__(self, session_class: Optional[Any] = ...): ... + def is_valid_key(self, key): ... + def generate_key(self, salt: Optional[Any] = ...): ... + def new(self): ... + def save(self, session): ... + def save_if_modified(self, session): ... + def delete(self, session): ... + def get(self, sid): ... + +class FilesystemSessionStore(SessionStore): + path: Any + filename_template: str + renew_missing: Any + mode: Any + def __init__(self, path: Optional[Any] = ..., filename_template: Text = ..., session_class: Optional[Any] = ..., + renew_missing: bool = ..., mode: int = ...): ... + def get_session_filename(self, sid): ... + def save(self, session): ... + def delete(self, session): ... + def get(self, sid): ... + def list(self): ... + +class SessionMiddleware: + app: Any + store: Any + cookie_name: Any + cookie_age: Any + cookie_expires: Any + cookie_path: Any + cookie_domain: Any + cookie_secure: Any + cookie_httponly: Any + environ_key: Any + def __init__(self, app, store, cookie_name: str = ..., cookie_age: Optional[Any] = ..., cookie_expires: Optional[Any] = ..., + cookie_path: str = ..., cookie_domain: Optional[Any] = ..., cookie_secure: Optional[Any] = ..., + cookie_httponly: bool = ..., environ_key: str = ...): ... + def __call__(self, environ, start_response): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/testtools.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/testtools.pyi new file mode 100644 index 0000000..860ebb7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/testtools.pyi @@ -0,0 +1,9 @@ +from typing import Any +from werkzeug.wrappers import Response + +class ContentAccessors: + def xml(self): ... + def lxml(self): ... + def json(self): ... + +class TestResponse(Response, ContentAccessors): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/wrappers.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/wrappers.pyi new file mode 100644 index 0000000..683eda0 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/wrappers.pyi @@ -0,0 +1,27 @@ +from typing import Any + +def is_known_charset(charset): ... + +class JSONRequestMixin: + def json(self): ... + +class ProtobufRequestMixin: + protobuf_check_initialization: Any + def parse_protobuf(self, proto_type): ... + +class RoutingArgsRequestMixin: + routing_args: Any + routing_vars: Any + +class ReverseSlashBehaviorRequestMixin: + def path(self): ... + def script_root(self): ... + +class DynamicCharsetRequestMixin: + default_charset: Any + def unknown_charset(self, charset): ... + def charset(self): ... + +class DynamicCharsetResponseMixin: + default_charset: Any + charset: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/datastructures.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/datastructures.pyi new file mode 100644 index 0000000..f10665f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/datastructures.pyi @@ -0,0 +1,425 @@ +import collections +from typing import Any, Optional, Mapping, Dict, TypeVar, Callable, Union, overload, Text +from collections import Container, Iterable, MutableSet + +_K = TypeVar("_K") +_V = TypeVar("_V") +_R = TypeVar("_R") +_D = TypeVar("_D") + +def is_immutable(self): ... +def iter_multi_items(mapping): ... +def native_itermethods(names): ... + +class ImmutableListMixin: + def __hash__(self): ... + def __reduce_ex__(self, protocol): ... + def __delitem__(self, key): ... + def __delslice__(self, i, j): ... + def __iadd__(self, other): ... + __imul__: Any + def __setitem__(self, key, value): ... + def __setslice__(self, i, j, value): ... + def append(self, item): ... + remove: Any + def extend(self, iterable): ... + def insert(self, pos, value): ... + def pop(self, index: int = ...): ... + def reverse(self): ... + def sort(self, cmp: Optional[Any] = ..., key: Optional[Any] = ..., reverse: Optional[Any] = ...): ... + +class ImmutableList(ImmutableListMixin, list): ... + +class ImmutableDictMixin: + @classmethod + def fromkeys(cls, *args, **kwargs): ... + def __reduce_ex__(self, protocol): ... + def __hash__(self): ... + def setdefault(self, key, default: Optional[Any] = ...): ... + def update(self, *args, **kwargs): ... + def pop(self, key, default: Optional[Any] = ...): ... + def popitem(self): ... + def __setitem__(self, key, value): ... + def __delitem__(self, key): ... + def clear(self): ... + +class ImmutableMultiDictMixin(ImmutableDictMixin): + def __reduce_ex__(self, protocol): ... + def add(self, key, value): ... + def popitemlist(self): ... + def poplist(self, key): ... + def setlist(self, key, new_list): ... + def setlistdefault(self, key, default_list: Optional[Any] = ...): ... + +class UpdateDictMixin: + on_update: Any + def setdefault(self, key, default: Optional[Any] = ...): ... + def pop(self, key, default=...): ... + __setitem__: Any + __delitem__: Any + clear: Any + popitem: Any + update: Any + +class TypeConversionDict(Dict[_K, _V]): + @overload + def get(self, key: _K, *, type: None = ...) -> Optional[_V]: ... + @overload + def get(self, key: _K, default: _D, type: None = ...) -> Union[_V, _D]: ... + @overload + def get(self, key: _K, *, type: Callable[[_V], _R]) -> Optional[_R]: ... + @overload + def get(self, key: _K, default: _D, type: Callable[[_V], _R]) -> Union[_R, _D]: ... + +class ImmutableTypeConversionDict(ImmutableDictMixin, TypeConversionDict[_K, _V]): + def copy(self) -> TypeConversionDict[_K, _V]: ... + def __copy__(self) -> ImmutableTypeConversionDict[_K, _V]: ... + +class ViewItems: + def __init__(self, multi_dict, method, repr_name, *a, **kw): ... + def __iter__(self): ... + +class MultiDict(TypeConversionDict): + def __init__(self, mapping: Optional[Any] = ...): ... + def __getitem__(self, key): ... + def __setitem__(self, key, value): ... + def add(self, key, value): ... + def getlist(self, key, type: Optional[Any] = ...): ... + def setlist(self, key, new_list): ... + def setdefault(self, key, default: Optional[Any] = ...): ... + def setlistdefault(self, key, default_list: Optional[Any] = ...): ... + def items(self, multi: bool = ...): ... + def lists(self): ... + def keys(self): ... + __iter__: Any + def values(self): ... + def listvalues(self): ... + def copy(self): ... + def deepcopy(self, memo: Optional[Any] = ...): ... + def to_dict(self, flat: bool = ...): ... + def update(self, other_dict): ... + def pop(self, key, default=...): ... + def popitem(self): ... + def poplist(self, key): ... + def popitemlist(self): ... + def __copy__(self): ... + def __deepcopy__(self, memo): ... + +class _omd_bucket: + prev: Any + key: Any + value: Any + next: Any + def __init__(self, omd, key, value): ... + def unlink(self, omd): ... + +class OrderedMultiDict(MultiDict): + def __init__(self, mapping: Optional[Any] = ...): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + def __reduce_ex__(self, protocol): ... + def __getitem__(self, key): ... + def __setitem__(self, key, value): ... + def __delitem__(self, key): ... + def keys(self): ... + __iter__: Any + def values(self): ... + def items(self, multi: bool = ...): ... + def lists(self): ... + def listvalues(self): ... + def add(self, key, value): ... + def getlist(self, key, type: Optional[Any] = ...): ... + def setlist(self, key, new_list): ... + def setlistdefault(self, key, default_list: Optional[Any] = ...): ... + def update(self, mapping): ... + def poplist(self, key): ... + def pop(self, key, default=...): ... + def popitem(self): ... + def popitemlist(self): ... + +class Headers(collections.Mapping): + def __init__(self, defaults: Optional[Any] = ...): ... + def __getitem__(self, key, _get_mode: bool = ...): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + @overload + def get(self, key: str, *, type: None = ...) -> Optional[str]: ... + @overload + def get(self, key: str, default: _D, type: None = ...) -> Union[str, _D]: ... + @overload + def get(self, key: str, *, type: Callable[[str], _R]) -> Optional[_R]: ... + @overload + def get(self, key: str, default: _D, type: Callable[[str], _R]) -> Union[_R, _D]: ... + @overload + def get(self, key: str, *, as_bytes: bool) -> Any: ... + @overload + def get(self, key: str, *, type: None, as_bytes: bool) -> Any: ... + @overload + def get(self, key: str, *, type: Callable[[Any], _R], as_bytes: bool) -> Optional[_R]: ... + @overload + def get(self, key: str, default: Any, type: None, as_bytes: bool) -> Any: ... + @overload + def get(self, key: str, default: _D, type: Callable[[Any], _R], as_bytes: bool) -> Union[_R, _D]: ... + def getlist(self, key, type: Optional[Any] = ..., as_bytes: bool = ...): ... + def get_all(self, name): ... + def items(self, lower: bool = ...): ... + def keys(self, lower: bool = ...): ... + def values(self): ... + def extend(self, iterable): ... + def __delitem__(self, key: Any) -> None: ... + def remove(self, key): ... + def pop(self, **kwargs): ... + def popitem(self): ... + def __contains__(self, key): ... + has_key: Any + def __iter__(self): ... + def __len__(self): ... + def add(self, _key, _value, **kw): ... + def add_header(self, _key, _value, **_kw): ... + def clear(self): ... + def set(self, _key, _value, **kw): ... + def setdefault(self, key, value): ... + def __setitem__(self, key, value): ... + def to_list(self, charset: Text = ...): ... + def to_wsgi_list(self): ... + def copy(self): ... + def __copy__(self): ... + +class ImmutableHeadersMixin: + def __delitem__(self, key: str) -> None: ... + def __setitem__(self, key, value): ... + set: Any + def add(self, *args, **kwargs): ... + remove: Any + add_header: Any + def extend(self, iterable): ... + def insert(self, pos, value): ... + def pop(self, **kwargs): ... + def popitem(self): ... + def setdefault(self, key, default): ... + +class EnvironHeaders(ImmutableHeadersMixin, Headers): + environ: Any + def __init__(self, environ): ... + def __eq__(self, other): ... + def __getitem__(self, key, _get_mode: bool = ...): ... + def __len__(self): ... + def __iter__(self): ... + def copy(self): ... + +class CombinedMultiDict(ImmutableMultiDictMixin, MultiDict): + def __reduce_ex__(self, protocol): ... + dicts: Any + def __init__(self, dicts: Optional[Any] = ...): ... + @classmethod + def fromkeys(cls): ... + def __getitem__(self, key): ... + def get(self, key, default: Optional[Any] = ..., type: Optional[Any] = ...): ... + def getlist(self, key, type: Optional[Any] = ...): ... + def keys(self): ... + __iter__: Any + def items(self, multi: bool = ...): ... + def values(self): ... + def lists(self): ... + def listvalues(self): ... + def copy(self): ... + def to_dict(self, flat: bool = ...): ... + def __len__(self): ... + def __contains__(self, key): ... + has_key: Any + +class FileMultiDict(MultiDict): + def add_file(self, name, file, filename: Optional[Any] = ..., content_type: Optional[Any] = ...): ... + +class ImmutableDict(ImmutableDictMixin, dict): + def copy(self): ... + def __copy__(self): ... + +class ImmutableMultiDict(ImmutableMultiDictMixin, MultiDict): + def copy(self): ... + def __copy__(self): ... + +class ImmutableOrderedMultiDict(ImmutableMultiDictMixin, OrderedMultiDict): + def copy(self): ... + def __copy__(self): ... + +class Accept(ImmutableList): + provided: Any + def __init__(self, values=...): ... + def __getitem__(self, key): ... + def quality(self, key): ... + def __contains__(self, value): ... + def index(self, key): ... + def find(self, key): ... + def values(self): ... + def to_header(self): ... + def best_match(self, matches, default: Optional[Any] = ...): ... + @property + def best(self): ... + +class MIMEAccept(Accept): + @property + def accept_html(self): ... + @property + def accept_xhtml(self): ... + @property + def accept_json(self): ... + +class LanguageAccept(Accept): ... +class CharsetAccept(Accept): ... + +def cache_property(key, empty, type): ... + +class _CacheControl(UpdateDictMixin, dict): + no_cache: Any + no_store: Any + max_age: Any + no_transform: Any + on_update: Any + provided: Any + def __init__(self, values=..., on_update: Optional[Any] = ...): ... + def to_header(self): ... + +class RequestCacheControl(ImmutableDictMixin, _CacheControl): + max_stale: Any + min_fresh: Any + no_transform: Any + only_if_cached: Any + +class ResponseCacheControl(_CacheControl): + public: Any + private: Any + must_revalidate: Any + proxy_revalidate: Any + s_maxage: Any + +class CallbackDict(UpdateDictMixin, dict): + on_update: Any + def __init__(self, initial: Optional[Any] = ..., on_update: Optional[Any] = ...): ... + +class HeaderSet(MutableSet): + on_update: Any + def __init__(self, headers: Optional[Any] = ..., on_update: Optional[Any] = ...): ... + def add(self, header): ... + def remove(self, header): ... + def update(self, iterable): ... + def discard(self, header): ... + def find(self, header): ... + def index(self, header): ... + def clear(self): ... + def as_set(self, preserve_casing: bool = ...): ... + def to_header(self): ... + def __getitem__(self, idx): ... + def __delitem__(self, idx): ... + def __setitem__(self, idx, value): ... + def __contains__(self, header): ... + def __len__(self): ... + def __iter__(self): ... + def __nonzero__(self): ... + +class ETags(Container, Iterable): + star_tag: Any + def __init__(self, strong_etags: Optional[Any] = ..., weak_etags: Optional[Any] = ..., star_tag: bool = ...): ... + def as_set(self, include_weak: bool = ...): ... + def is_weak(self, etag): ... + def contains_weak(self, etag): ... + def contains(self, etag): ... + def contains_raw(self, etag): ... + def to_header(self): ... + def __call__(self, etag: Optional[Any] = ..., data: Optional[Any] = ..., include_weak: bool = ...): ... + def __bool__(self): ... + __nonzero__: Any + def __iter__(self): ... + def __contains__(self, etag): ... + +class IfRange: + etag: Any + date: Any + def __init__(self, etag: Optional[Any] = ..., date: Optional[Any] = ...): ... + def to_header(self): ... + +class Range: + units: Any + ranges: Any + def __init__(self, units, ranges): ... + def range_for_length(self, length): ... + def make_content_range(self, length): ... + def to_header(self): ... + def to_content_range_header(self, length): ... + +class ContentRange: + on_update: Any + units: Optional[str] + start: Any + stop: Any + length: Any + def __init__(self, units: Optional[str], start, stop, length: Optional[Any] = ..., on_update: Optional[Any] = ...): ... + def set(self, start, stop, length: Optional[Any] = ..., units: Optional[str] = ...): ... + def unset(self) -> None: ... + def to_header(self): ... + def __nonzero__(self): ... + __bool__: Any + +class Authorization(ImmutableDictMixin, Dict[str, Any]): + type: str + def __init__(self, auth_type: str, data: Optional[Mapping[str, Any]] = ...) -> None: ... + @property + def username(self) -> Optional[str]: ... + @property + def password(self) -> Optional[str]: ... + @property + def realm(self) -> Optional[str]: ... + @property + def nonce(self) -> Optional[str]: ... + @property + def uri(self) -> Optional[str]: ... + @property + def nc(self) -> Optional[str]: ... + @property + def cnonce(self) -> Optional[str]: ... + @property + def response(self) -> Optional[str]: ... + @property + def opaque(self) -> Optional[str]: ... + @property + def qop(self) -> Optional[str]: ... + +class WWWAuthenticate(UpdateDictMixin, dict): + on_update: Any + def __init__(self, auth_type: Optional[Any] = ..., values: Optional[Any] = ..., on_update: Optional[Any] = ...): ... + def set_basic(self, realm: str = ...): ... + def set_digest(self, realm, nonce, qop=..., opaque: Optional[Any] = ..., algorithm: Optional[Any] = ..., + stale: bool = ...): ... + def to_header(self): ... + @staticmethod + def auth_property(name, doc: Optional[Any] = ...): ... + type: Any + realm: Any + domain: Any + nonce: Any + opaque: Any + algorithm: Any + qop: Any + stale: Any + +class FileStorage: + name: Any + stream: Any + filename: Any + headers: Any + def __init__(self, stream: Optional[Any] = ..., filename: Optional[Any] = ..., name: Optional[Any] = ..., + content_type: Optional[Any] = ..., content_length: Optional[Any] = ..., headers: Optional[Any] = ...): ... + @property + def content_type(self): ... + @property + def content_length(self): ... + @property + def mimetype(self): ... + @property + def mimetype_params(self): ... + def save(self, dst, buffer_size: int = ...): ... + def close(self): ... + def __nonzero__(self): ... + __bool__: Any + def __getattr__(self, name): ... + def __iter__(self): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/debug/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/debug/__init__.pyi new file mode 100644 index 0000000..d920ed0 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/debug/__init__.pyi @@ -0,0 +1,41 @@ +from typing import Any, Optional +from werkzeug.wrappers import BaseRequest as Request, BaseResponse as Response + +PIN_TIME: Any + +def hash_pin(pin): ... +def get_machine_id(): ... + +class _ConsoleFrame: + console: Any + id: Any + def __init__(self, namespace): ... + +def get_pin_and_cookie_name(app): ... + +class DebuggedApplication: + app: Any + evalex: Any + frames: Any + tracebacks: Any + request_key: Any + console_path: Any + console_init_func: Any + show_hidden_frames: Any + secret: Any + pin_logging: Any + pin: Any + def __init__(self, app, evalex: bool = ..., request_key: str = ..., console_path: str = ..., + console_init_func: Optional[Any] = ..., show_hidden_frames: bool = ..., lodgeit_url: Optional[Any] = ..., + pin_security: bool = ..., pin_logging: bool = ...): ... + @property + def pin_cookie_name(self): ... + def debug_application(self, environ, start_response): ... + def execute_command(self, request, command, frame): ... + def display_console(self, request): ... + def paste_traceback(self, request, traceback): ... + def get_resource(self, request, filename): ... + def check_pin_trust(self, environ): ... + def pin_auth(self, request): ... + def log_pin_request(self): ... + def __call__(self, environ, start_response): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/debug/console.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/debug/console.pyi new file mode 100644 index 0000000..0323377 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/debug/console.pyi @@ -0,0 +1,44 @@ +from typing import Any, Optional +import code + +class HTMLStringO: + def __init__(self): ... + def isatty(self): ... + def close(self): ... + def flush(self): ... + def seek(self, n, mode: int = ...): ... + def readline(self): ... + def reset(self): ... + def write(self, x): ... + def writelines(self, x): ... + +class ThreadedStream: + @staticmethod + def push(): ... + @staticmethod + def fetch(): ... + @staticmethod + def displayhook(obj): ... + def __setattr__(self, name, value): ... + def __dir__(self): ... + def __getattribute__(self, name): ... + +class _ConsoleLoader: + def __init__(self): ... + def register(self, code, source): ... + def get_source_by_code(self, code): ... + +class _InteractiveConsole(code.InteractiveInterpreter): + globals: Any + more: Any + buffer: Any + def __init__(self, globals, locals): ... + def runsource(self, source): ... + def runcode(self, code): ... + def showtraceback(self): ... + def showsyntaxerror(self, filename: Optional[Any] = ...): ... + def write(self, data): ... + +class Console: + def __init__(self, globals: Optional[Any] = ..., locals: Optional[Any] = ...): ... + def eval(self, code): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/debug/repr.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/debug/repr.pyi new file mode 100644 index 0000000..4955919 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/debug/repr.pyi @@ -0,0 +1,33 @@ +from typing import Any, Optional + +deque: Any +missing: Any +RegexType: Any +HELP_HTML: Any +OBJECT_DUMP_HTML: Any + +def debug_repr(obj): ... +def dump(obj=...): ... + +class _Helper: + def __call__(self, topic: Optional[Any] = ...): ... + +helper: Any + +class DebugReprGenerator: + def __init__(self): ... + list_repr: Any + tuple_repr: Any + set_repr: Any + frozenset_repr: Any + deque_repr: Any + def regex_repr(self, obj): ... + def string_repr(self, obj, limit: int = ...): ... + def dict_repr(self, d, recursive, limit: int = ...): ... + def object_repr(self, obj): ... + def dispatch_repr(self, obj, recursive): ... + def fallback_repr(self): ... + def repr(self, obj): ... + def dump_object(self, obj): ... + def dump_locals(self, d): ... + def render_object_dump(self, items, title, repr: Optional[Any] = ...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/debug/tbtools.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/debug/tbtools.pyi new file mode 100644 index 0000000..90beed9 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/debug/tbtools.pyi @@ -0,0 +1,63 @@ +from typing import Any, Optional + +UTF8_COOKIE: Any +system_exceptions: Any +HEADER: Any +FOOTER: Any +PAGE_HTML: Any +CONSOLE_HTML: Any +SUMMARY_HTML: Any +FRAME_HTML: Any +SOURCE_LINE_HTML: Any + +def render_console_html(secret, evalex_trusted: bool = ...): ... +def get_current_traceback(ignore_system_exceptions: bool = ..., show_hidden_frames: bool = ..., skip: int = ...): ... + +class Line: + lineno: Any + code: Any + in_frame: Any + current: Any + def __init__(self, lineno, code): ... + def classes(self): ... + def render(self): ... + +class Traceback: + exc_type: Any + exc_value: Any + exception_type: Any + frames: Any + def __init__(self, exc_type, exc_value, tb): ... + def filter_hidden_frames(self): ... + def is_syntax_error(self): ... + def exception(self): ... + def log(self, logfile: Optional[Any] = ...): ... + def paste(self): ... + def render_summary(self, include_title: bool = ...): ... + def render_full(self, evalex: bool = ..., secret: Optional[Any] = ..., evalex_trusted: bool = ...): ... + def generate_plaintext_traceback(self): ... + def plaintext(self): ... + id: Any + +class Frame: + lineno: Any + function_name: Any + locals: Any + globals: Any + filename: Any + module: Any + loader: Any + code: Any + hide: Any + info: Any + def __init__(self, exc_type, exc_value, tb): ... + def render(self): ... + def render_line_context(self): ... + def get_annotated_lines(self): ... + def eval(self, code, mode: str = ...): ... + def sourcelines(self): ... + def get_context_lines(self, context: int = ...): ... + @property + def current_line(self): ... + def console(self): ... + id: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/exceptions.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/exceptions.pyi new file mode 100644 index 0000000..3686046 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/exceptions.pyi @@ -0,0 +1,161 @@ +from typing import Any, Dict, Tuple, List, Text, NoReturn, Optional, Protocol, Type, Union, Iterable + +from wsgiref.types import WSGIEnvironment, StartResponse +from werkzeug.wrappers import Response + +class _EnvironContainer(Protocol): + @property + def environ(self) -> WSGIEnvironment: ... + +class HTTPException(Exception): + code: Optional[int] + description: Optional[str] + response: Optional[Response] + def __init__(self, description: Optional[str] = ..., response: Optional[Response] = ...) -> None: ... + @classmethod + def wrap(cls, exception: Type[Exception], name: Optional[str] = ...) -> Any: ... + @property + def name(self) -> str: ... + def get_description(self, environ: Optional[WSGIEnvironment] = ...) -> Text: ... + def get_body(self, environ: Optional[WSGIEnvironment] = ...) -> Text: ... + def get_headers(self, environ: Optional[WSGIEnvironment] = ...) -> List[Tuple[str, str]]: ... + def get_response(self, environ: Optional[Union[WSGIEnvironment, _EnvironContainer]] = ...) -> Response: ... + def __call__(self, environ: WSGIEnvironment, start_response: StartResponse) -> Iterable[bytes]: ... + +default_exceptions: Dict[int, Type[HTTPException]] + +class BadRequest(HTTPException): + code: int + description: str + +class ClientDisconnected(BadRequest): ... +class SecurityError(BadRequest): ... +class BadHost(BadRequest): ... + +class Unauthorized(HTTPException): + code: int + description: str + +class Forbidden(HTTPException): + code: int + description: str + +class NotFound(HTTPException): + code: int + description: str + +class MethodNotAllowed(HTTPException): + code: int + description: str + valid_methods: Any + def __init__(self, valid_methods: Optional[Any] = ..., description: Optional[Any] = ...): ... + def get_headers(self, environ): ... + +class NotAcceptable(HTTPException): + code: int + description: str + +class RequestTimeout(HTTPException): + code: int + description: str + +class Conflict(HTTPException): + code: int + description: str + +class Gone(HTTPException): + code: int + description: str + +class LengthRequired(HTTPException): + code: int + description: str + +class PreconditionFailed(HTTPException): + code: int + description: str + +class RequestEntityTooLarge(HTTPException): + code: int + description: str + +class RequestURITooLarge(HTTPException): + code: int + description: str + +class UnsupportedMediaType(HTTPException): + code: int + description: str + +class RequestedRangeNotSatisfiable(HTTPException): + code: int + description: str + length: Any + units: str + def __init__(self, length: Optional[Any] = ..., units: str = ..., description: Optional[Any] = ...): ... + def get_headers(self, environ): ... + +class ExpectationFailed(HTTPException): + code: int + description: str + +class ImATeapot(HTTPException): + code: int + description: str + +class UnprocessableEntity(HTTPException): + code: int + description: str + +class Locked(HTTPException): + code: int + description: str + +class PreconditionRequired(HTTPException): + code: int + description: str + +class TooManyRequests(HTTPException): + code: int + description: str + +class RequestHeaderFieldsTooLarge(HTTPException): + code: int + description: str + +class UnavailableForLegalReasons(HTTPException): + code: int + description: str + +class InternalServerError(HTTPException): + code: int + description: str + +class NotImplemented(HTTPException): + code: int + description: str + +class BadGateway(HTTPException): + code: int + description: str + +class ServiceUnavailable(HTTPException): + code: int + description: str + +class GatewayTimeout(HTTPException): + code: int + description: str + +class HTTPVersionNotSupported(HTTPException): + code: int + description: str + +class Aborter: + mapping: Any + def __init__(self, mapping: Optional[Any] = ..., extra: Optional[Any] = ...) -> None: ... + def __call__(self, code: Union[int, Response], *args: Any, **kwargs: Any) -> NoReturn: ... + +def abort(status: Union[int, Response], *args: Any, **kwargs: Any) -> NoReturn: ... + +class BadRequestKeyError(BadRequest, KeyError): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/filesystem.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/filesystem.pyi new file mode 100644 index 0000000..58695fa --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/filesystem.pyi @@ -0,0 +1,7 @@ +from typing import Any + +has_likely_buggy_unicode_filesystem: Any + +class BrokenFilesystemWarning(RuntimeWarning, UnicodeWarning): ... + +def get_filesystem_encoding(): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/formparser.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/formparser.pyi new file mode 100644 index 0000000..d0e6a73 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/formparser.pyi @@ -0,0 +1,45 @@ +from typing import Any, Optional, Text + +def default_stream_factory(total_content_length, filename, content_type, content_length: Optional[Any] = ...): ... +def parse_form_data(environ, stream_factory: Optional[Any] = ..., charset: Text = ..., errors: Text = ..., + max_form_memory_size: Optional[Any] = ..., max_content_length: Optional[Any] = ..., + cls: Optional[Any] = ..., silent: bool = ...): ... +def exhaust_stream(f): ... + +class FormDataParser: + stream_factory: Any + charset: Text + errors: Text + max_form_memory_size: Any + max_content_length: Any + cls: Any + silent: Any + def __init__(self, stream_factory: Optional[Any] = ..., charset: Text = ..., errors: Text = ..., + max_form_memory_size: Optional[Any] = ..., max_content_length: Optional[Any] = ..., cls: Optional[Any] = ..., + silent: bool = ...): ... + def get_parse_func(self, mimetype, options): ... + def parse_from_environ(self, environ): ... + def parse(self, stream, mimetype, content_length, options: Optional[Any] = ...): ... + parse_functions: Any + +def is_valid_multipart_boundary(boundary): ... +def parse_multipart_headers(iterable): ... + +class MultiPartParser: + charset: Text + errors: Text + max_form_memory_size: Any + stream_factory: Any + cls: Any + buffer_size: Any + def __init__(self, stream_factory: Optional[Any] = ..., charset: Text = ..., errors: Text = ..., + max_form_memory_size: Optional[Any] = ..., cls: Optional[Any] = ..., buffer_size=...): ... + def fail(self, message): ... + def get_part_encoding(self, headers): ... + def get_part_charset(self, headers) -> Text: ... + def start_file_streaming(self, filename, headers, total_content_length): ... + def in_memory_threshold_reached(self, bytes): ... + def validate_boundary(self, boundary): ... + def parse_lines(self, file, boundary, content_length, cap_at_buffer: bool = ...): ... + def parse_parts(self, file, boundary, content_length): ... + def parse(self, file, boundary, content_length): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/http.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/http.pyi new file mode 100644 index 0000000..2e078ff --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/http.pyi @@ -0,0 +1,92 @@ +import sys +from datetime import datetime, timedelta +from typing import ( + Dict, Text, Union, Tuple, Any, Optional, Mapping, Iterable, Callable, List, Type, + TypeVar, Protocol, overload, SupportsInt, +) +from wsgiref.types import WSGIEnvironment + +from .datastructures import ( + Headers, Accept, RequestCacheControl, HeaderSet, Authorization, WWWAuthenticate, + IfRange, Range, ContentRange, ETags, TypeConversionDict, +) + +if sys.version_info < (3,): + _Str = TypeVar('_Str', str, unicode) + _ToBytes = Union[bytes, bytearray, buffer, unicode] + _ETagData = Union[str, unicode, bytearray, buffer, memoryview] +else: + _Str = str + _ToBytes = Union[bytes, bytearray, memoryview, str] + _ETagData = Union[bytes, bytearray, memoryview] + +_T = TypeVar("_T") +_U = TypeVar("_U") + +HTTP_STATUS_CODES: Dict[int, str] + +def wsgi_to_bytes(data: Union[bytes, Text]) -> bytes: ... +def bytes_to_wsgi(data: bytes) -> str: ... +def quote_header_value(value: Any, extra_chars: str = ..., allow_token: bool = ...) -> str: ... +def unquote_header_value(value: _Str, is_filename: bool = ...) -> _Str: ... +def dump_options_header(header: Optional[_Str], options: Mapping[_Str, Any]) -> _Str: ... +def dump_header(iterable: Union[Iterable[Any], Dict[_Str, Any]], allow_token: bool = ...) -> _Str: ... +def parse_list_header(value: _Str) -> List[_Str]: ... +@overload +def parse_dict_header(value: Union[bytes, Text]) -> Dict[Text, Optional[Text]]: ... +@overload +def parse_dict_header(value: Union[bytes, Text], cls: Type[_T]) -> _T: ... +@overload +def parse_options_header(value: None, multiple: bool = ...) -> Tuple[str, Dict[str, Optional[str]]]: ... +@overload +def parse_options_header(value: _Str) -> Tuple[_Str, Dict[_Str, Optional[_Str]]]: ... +# actually returns Tuple[_Str, Dict[_Str, Optional[_Str]], ...] +@overload +def parse_options_header(value: _Str, multiple: bool = ...) -> Tuple[Any, ...]: ... +@overload +def parse_accept_header(value: Optional[Text]) -> Accept: ... +@overload +def parse_accept_header(value: Optional[_Str], cls: Callable[[Optional[_Str]], _T]) -> _T: ... +@overload +def parse_cache_control_header(value: Union[None, bytes, Text], + on_update: Optional[Callable[[RequestCacheControl], Any]] = ...) -> RequestCacheControl: ... +@overload +def parse_cache_control_header(value: Union[None, bytes, Text], on_update: _T, + cls: Callable[[Dict[Text, Optional[Text]], _T], _U]) -> _U: ... +@overload +def parse_cache_control_header(value: Union[None, bytes, Text], *, + cls: Callable[[Dict[Text, Optional[Text]], None], _U]) -> _U: ... +def parse_set_header(value: Text, on_update: Optional[Callable[[HeaderSet], Any]] = ...) -> HeaderSet: ... +def parse_authorization_header(value: Union[None, bytes, Text]) -> Optional[Authorization]: ... +def parse_www_authenticate_header(value: Union[None, bytes, Text], + on_update: Optional[Callable[[WWWAuthenticate], Any]] = ...) -> WWWAuthenticate: ... +def parse_if_range_header(value: Optional[Text]) -> IfRange: ... +def parse_range_header(value: Optional[Text], make_inclusive: bool = ...) -> Optional[Range]: ... +def parse_content_range_header(value: Optional[Text], + on_update: Optional[Callable[[ContentRange], Any]] = ...) -> Optional[ContentRange]: ... +def quote_etag(etag: _Str, weak: bool = ...) -> _Str: ... +def unquote_etag(etag: Optional[_Str]) -> Tuple[Optional[_Str], Optional[_Str]]: ... +def parse_etags(value: Optional[Text]) -> ETags: ... +def generate_etag(data: _ETagData) -> str: ... +def parse_date(value: Optional[str]) -> Optional[datetime]: ... +def cookie_date(expires: Union[None, float, datetime] = ...) -> str: ... +def http_date(timestamp: Union[None, float, datetime] = ...) -> str: ... +def parse_age(value: Optional[SupportsInt] = ...) -> Optional[timedelta]: ... +def dump_age(age: Union[None, timedelta, SupportsInt]) -> Optional[str]: ... +def is_resource_modified(environ: WSGIEnvironment, etag: Optional[Text] = ..., data: Optional[_ETagData] = ..., + last_modified: Union[None, Text, datetime] = ..., ignore_if_range: bool = ...) -> bool: ... +def remove_entity_headers(headers: Union[List[Tuple[Text, Text]], Headers], allowed: Iterable[Text] = ...) -> None: ... +def remove_hop_by_hop_headers(headers: Union[List[Tuple[Text, Text]], Headers]) -> None: ... +def is_entity_header(header: Text) -> bool: ... +def is_hop_by_hop_header(header: Text) -> bool: ... +@overload +def parse_cookie(header: Union[None, WSGIEnvironment, Text, bytes], charset: Text = ..., + errors: Text = ...) -> TypeConversionDict: ... +@overload +def parse_cookie(header: Union[None, WSGIEnvironment, Text, bytes], charset: Text = ..., + errors: Text = ..., cls: Optional[Callable[[Iterable[Tuple[Text, Text]]], _T]] = ...) -> _T: ... +def dump_cookie(key: _ToBytes, value: _ToBytes = ..., max_age: Union[None, float, timedelta] = ..., + expires: Union[None, Text, float, datetime] = ..., path: Union[None, tuple, str, bytes] = ..., + domain: Union[None, str, bytes] = ..., secure: bool = ..., httponly: bool = ..., charset: Text = ..., + sync_expires: bool = ...) -> str: ... +def is_byte_range_valid(start: Optional[int], stop: Optional[int], length: Optional[int]) -> bool: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/local.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/local.pyi new file mode 100644 index 0000000..0fe642d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/local.pyi @@ -0,0 +1,100 @@ +from typing import Any, Optional + +def release_local(local): ... + +class Local: + def __init__(self): ... + def __iter__(self): ... + def __call__(self, proxy): ... + def __release_local__(self): ... + def __getattr__(self, name): ... + def __setattr__(self, name, value): ... + def __delattr__(self, name): ... + +class LocalStack: + def __init__(self): ... + def __release_local__(self): ... + def _get__ident_func__(self): ... + def _set__ident_func__(self, value): ... + __ident_func__: Any + def __call__(self): ... + def push(self, obj): ... + def pop(self): ... + @property + def top(self): ... + +class LocalManager: + locals: Any + ident_func: Any + def __init__(self, locals: Optional[Any] = ..., ident_func: Optional[Any] = ...): ... + def get_ident(self): ... + def cleanup(self): ... + def make_middleware(self, app): ... + def middleware(self, func): ... + +class LocalProxy: + def __init__(self, local, name: Optional[Any] = ...): ... + @property + def __dict__(self): ... + def __bool__(self): ... + def __unicode__(self): ... + def __dir__(self): ... + def __getattr__(self, name): ... + def __setitem__(self, key, value): ... + def __delitem__(self, key): ... + __getslice__: Any + def __setslice__(self, i, j, seq): ... + def __delslice__(self, i, j): ... + __setattr__: Any + __delattr__: Any + __lt__: Any + __le__: Any + __eq__: Any + __ne__: Any + __gt__: Any + __ge__: Any + __cmp__: Any + __hash__: Any + __call__: Any + __len__: Any + __getitem__: Any + __iter__: Any + __contains__: Any + __add__: Any + __sub__: Any + __mul__: Any + __floordiv__: Any + __mod__: Any + __divmod__: Any + __pow__: Any + __lshift__: Any + __rshift__: Any + __and__: Any + __xor__: Any + __or__: Any + __div__: Any + __truediv__: Any + __neg__: Any + __pos__: Any + __abs__: Any + __invert__: Any + __complex__: Any + __int__: Any + __long__: Any + __float__: Any + __oct__: Any + __hex__: Any + __index__: Any + __coerce__: Any + __enter__: Any + __exit__: Any + __radd__: Any + __rsub__: Any + __rmul__: Any + __rdiv__: Any + __rtruediv__: Any + __rfloordiv__: Any + __rmod__: Any + __rdivmod__: Any + __copy__: Any + __deepcopy__: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/posixemulation.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/posixemulation.pyi new file mode 100644 index 0000000..f666929 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/posixemulation.pyi @@ -0,0 +1,7 @@ +from typing import Any +from ._compat import to_unicode as to_unicode +from .filesystem import get_filesystem_encoding as get_filesystem_encoding + +can_rename_open_file: Any + +def rename(src, dst): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/routing.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/routing.pyi new file mode 100644 index 0000000..347af55 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/routing.pyi @@ -0,0 +1,189 @@ +from typing import Any, Optional, Text +from werkzeug.exceptions import HTTPException + +def parse_converter_args(argstr): ... +def parse_rule(rule): ... + +class RoutingException(Exception): ... + +class RequestRedirect(HTTPException, RoutingException): + code: Any + new_url: Any + def __init__(self, new_url): ... + def get_response(self, environ): ... + +class RequestSlash(RoutingException): ... + +class RequestAliasRedirect(RoutingException): + matched_values: Any + def __init__(self, matched_values): ... + +class BuildError(RoutingException, LookupError): + endpoint: Any + values: Any + method: Any + adapter: Optional[MapAdapter] + def __init__(self, endpoint, values, method, adapter: Optional[MapAdapter] = ...) -> None: ... + @property + def suggested(self) -> Optional[Rule]: ... + def closest_rule(self, adapter: Optional[MapAdapter]) -> Optional[Rule]: ... + +class ValidationError(ValueError): ... + +class RuleFactory: + def get_rules(self, map): ... + +class Subdomain(RuleFactory): + subdomain: Any + rules: Any + def __init__(self, subdomain, rules): ... + def get_rules(self, map): ... + +class Submount(RuleFactory): + path: Any + rules: Any + def __init__(self, path, rules): ... + def get_rules(self, map): ... + +class EndpointPrefix(RuleFactory): + prefix: Any + rules: Any + def __init__(self, prefix, rules): ... + def get_rules(self, map): ... + +class RuleTemplate: + rules: Any + def __init__(self, rules): ... + def __call__(self, *args, **kwargs): ... + +class RuleTemplateFactory(RuleFactory): + rules: Any + context: Any + def __init__(self, rules, context): ... + def get_rules(self, map): ... + +class Rule(RuleFactory): + rule: Any + is_leaf: Any + map: Any + strict_slashes: Any + subdomain: Any + host: Any + defaults: Any + build_only: Any + alias: Any + methods: Any + endpoint: Any + redirect_to: Any + arguments: Any + def __init__(self, string, defaults: Optional[Any] = ..., subdomain: Optional[Any] = ..., methods: Optional[Any] = ..., + build_only: bool = ..., endpoint: Optional[Any] = ..., strict_slashes: Optional[Any] = ..., + redirect_to: Optional[Any] = ..., alias: bool = ..., host: Optional[Any] = ...): ... + def empty(self): ... + def get_empty_kwargs(self): ... + def get_rules(self, map): ... + def refresh(self): ... + def bind(self, map, rebind: bool = ...): ... + def get_converter(self, variable_name, converter_name, args, kwargs): ... + def compile(self): ... + def match(self, path, method: Optional[Any] = ...): ... + def build(self, values, append_unknown: bool = ...): ... + def provides_defaults_for(self, rule): ... + def suitable_for(self, values, method: Optional[Any] = ...): ... + def match_compare_key(self): ... + def build_compare_key(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class BaseConverter: + regex: Any + weight: Any + map: Any + def __init__(self, map): ... + def to_python(self, value): ... + def to_url(self, value): ... + +class UnicodeConverter(BaseConverter): + regex: Any + def __init__(self, map, minlength: int = ..., maxlength: Optional[Any] = ..., length: Optional[Any] = ...): ... + +class AnyConverter(BaseConverter): + regex: Any + def __init__(self, map, *items): ... + +class PathConverter(BaseConverter): + regex: Any + weight: Any + +class NumberConverter(BaseConverter): + weight: Any + fixed_digits: Any + min: Any + max: Any + def __init__(self, map, fixed_digits: int = ..., min: Optional[Any] = ..., max: Optional[Any] = ...): ... + def to_python(self, value): ... + def to_url(self, value): ... + +class IntegerConverter(NumberConverter): + regex: Any + num_convert: Any + +class FloatConverter(NumberConverter): + regex: Any + num_convert: Any + def __init__(self, map, min: Optional[Any] = ..., max: Optional[Any] = ...): ... + +class UUIDConverter(BaseConverter): + regex: Any + def to_python(self, value): ... + def to_url(self, value): ... + +DEFAULT_CONVERTERS: Any + +class Map: + default_converters: Any + default_subdomain: Any + charset: Text + encoding_errors: Text + strict_slashes: Any + redirect_defaults: Any + host_matching: Any + converters: Any + sort_parameters: Any + sort_key: Any + def __init__(self, rules: Optional[Any] = ..., default_subdomain: str = ..., charset: Text = ..., + strict_slashes: bool = ..., redirect_defaults: bool = ..., converters: Optional[Any] = ..., + sort_parameters: bool = ..., sort_key: Optional[Any] = ..., encoding_errors: Text = ..., + host_matching: bool = ...): ... + def is_endpoint_expecting(self, endpoint, *arguments): ... + def iter_rules(self, endpoint: Optional[Any] = ...): ... + def add(self, rulefactory): ... + def bind(self, server_name, script_name: Optional[Any] = ..., subdomain: Optional[Any] = ..., url_scheme: str = ..., + default_method: str = ..., path_info: Optional[Any] = ..., query_args: Optional[Any] = ...): ... + def bind_to_environ(self, environ, server_name: Optional[Any] = ..., subdomain: Optional[Any] = ...): ... + def update(self): ... + +class MapAdapter: + map: Any + server_name: Any + script_name: Any + subdomain: Any + url_scheme: Any + path_info: Any + default_method: Any + query_args: Any + def __init__(self, map, server_name, script_name, subdomain, url_scheme, path_info, default_method, + query_args: Optional[Any] = ...): ... + def dispatch(self, view_func, path_info: Optional[Any] = ..., method: Optional[Any] = ..., + catch_http_exceptions: bool = ...): ... + def match(self, path_info: Optional[Any] = ..., method: Optional[Any] = ..., return_rule: bool = ..., + query_args: Optional[Any] = ...): ... + def test(self, path_info: Optional[Any] = ..., method: Optional[Any] = ...): ... + def allowed_methods(self, path_info: Optional[Any] = ...): ... + def get_host(self, domain_part): ... + def get_default_redirect(self, rule, method, values, query_args): ... + def encode_query_args(self, query_args): ... + def make_redirect_url(self, path_info, query_args: Optional[Any] = ..., domain_part: Optional[Any] = ...): ... + def make_alias_redirect_url(self, path, endpoint, values, method, query_args): ... + def build(self, endpoint, values: Optional[Any] = ..., method: Optional[Any] = ..., force_external: bool = ..., + append_unknown: bool = ...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/script.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/script.pyi new file mode 100644 index 0000000..b9db97a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/script.pyi @@ -0,0 +1,14 @@ +from typing import Any, Optional + +argument_types: Any +converters: Any + +def run(namespace: Optional[Any] = ..., action_prefix: str = ..., args: Optional[Any] = ...): ... +def fail(message, code: int = ...): ... +def find_actions(namespace, action_prefix): ... +def print_usage(actions): ... +def analyse_action(func): ... +def make_shell(init_func: Optional[Any] = ..., banner: Optional[Any] = ..., use_ipython: bool = ...): ... +def make_runserver(app_factory, hostname: str = ..., port: int = ..., use_reloader: bool = ..., use_debugger: bool = ..., + use_evalex: bool = ..., threaded: bool = ..., processes: int = ..., static_files: Optional[Any] = ..., + extra_files: Optional[Any] = ..., ssl_context: Optional[Any] = ...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/security.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/security.pyi new file mode 100644 index 0000000..fcb2652 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/security.pyi @@ -0,0 +1,12 @@ +from typing import Any, Optional + +SALT_CHARS: Any +DEFAULT_PBKDF2_ITERATIONS: Any + +def pbkdf2_hex(data, salt, iterations=..., keylen: Optional[Any] = ..., hashfunc: Optional[Any] = ...): ... +def pbkdf2_bin(data, salt, iterations=..., keylen: Optional[Any] = ..., hashfunc: Optional[Any] = ...): ... +def safe_str_cmp(a, b): ... +def gen_salt(length): ... +def generate_password_hash(password, method: str = ..., salt_length: int = ...): ... +def check_password_hash(pwhash, password): ... +def safe_join(directory, filename): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/serving.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/serving.pyi new file mode 100644 index 0000000..54bce97 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/serving.pyi @@ -0,0 +1,93 @@ +import sys +from typing import Any, Optional + +if sys.version_info < (3,): + from SocketServer import ThreadingMixIn, ForkingMixIn + from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler +else: + from socketserver import ThreadingMixIn, ForkingMixIn + from http.server import HTTPServer, BaseHTTPRequestHandler + +class _SslDummy: + def __getattr__(self, name): ... + +ssl: Any +LISTEN_QUEUE: Any +can_open_by_fd: Any + +class WSGIRequestHandler(BaseHTTPRequestHandler): + @property + def server_version(self): ... + def make_environ(self): ... + environ: Any + close_connection: Any + def run_wsgi(self): ... + def handle(self): ... + def initiate_shutdown(self): ... + def connection_dropped(self, error, environ: Optional[Any] = ...): ... + raw_requestline: Any + def handle_one_request(self): ... + def send_response(self, code, message: Optional[Any] = ...): ... + def version_string(self): ... + def address_string(self): ... + def port_integer(self): ... + def log_request(self, code: object = ..., size: object = ...) -> None: ... + def log_error(self, *args): ... + def log_message(self, format, *args): ... + def log(self, type, message, *args): ... + +BaseRequestHandler: Any + +def generate_adhoc_ssl_pair(cn: Optional[Any] = ...): ... +def make_ssl_devcert(base_path, host: Optional[Any] = ..., cn: Optional[Any] = ...): ... +def generate_adhoc_ssl_context(): ... +def load_ssl_context(cert_file, pkey_file: Optional[Any] = ..., protocol: Optional[Any] = ...): ... + +class _SSLContext: + def __init__(self, protocol): ... + def load_cert_chain(self, certfile, keyfile: Optional[Any] = ..., password: Optional[Any] = ...): ... + def wrap_socket(self, sock, **kwargs): ... + +def is_ssl_error(error: Optional[Any] = ...): ... +def select_ip_version(host, port): ... + +class BaseWSGIServer(HTTPServer): + multithread: Any + multiprocess: Any + request_queue_size: Any + address_family: Any + app: Any + passthrough_errors: Any + shutdown_signal: Any + host: Any + port: Any + socket: Any + server_address: Any + ssl_context: Any + def __init__(self, host, port, app, handler: Optional[Any] = ..., passthrough_errors: bool = ..., + ssl_context: Optional[Any] = ..., fd: Optional[Any] = ...): ... + def log(self, type, message, *args): ... + def serve_forever(self): ... + def handle_error(self, request, client_address): ... + def get_request(self): ... + +class ThreadedWSGIServer(ThreadingMixIn, BaseWSGIServer): + multithread: Any + daemon_threads: Any + +class ForkingWSGIServer(ForkingMixIn, BaseWSGIServer): + multiprocess: Any + max_children: Any + def __init__(self, host, port, app, processes: int = ..., handler: Optional[Any] = ..., passthrough_errors: bool = ..., + ssl_context: Optional[Any] = ..., fd: Optional[Any] = ...): ... + +def make_server(host: Optional[Any] = ..., port: Optional[Any] = ..., app: Optional[Any] = ..., threaded: bool = ..., + processes: int = ..., request_handler: Optional[Any] = ..., passthrough_errors: bool = ..., + ssl_context: Optional[Any] = ..., fd: Optional[Any] = ...): ... +def is_running_from_reloader(): ... +def run_simple(hostname, port, application, use_reloader: bool = ..., use_debugger: bool = ..., use_evalex: bool = ..., + extra_files: Optional[Any] = ..., reloader_interval: int = ..., reloader_type: str = ..., threaded: bool = ..., + processes: int = ..., request_handler: Optional[Any] = ..., static_files: Optional[Any] = ..., + passthrough_errors: bool = ..., ssl_context: Optional[Any] = ...): ... +def run_with_reloader(*args, **kwargs): ... +def main(): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/test.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/test.pyi new file mode 100644 index 0000000..c67189e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/test.pyi @@ -0,0 +1,94 @@ +import sys +from typing import Any, Optional, Text + +if sys.version_info < (3,): + from urllib2 import Request as U2Request + from cookielib import CookieJar +else: + from urllib.request import Request as U2Request + from http.cookiejar import CookieJar + +def stream_encode_multipart(values, use_tempfile: int = ..., threshold=..., boundary: Optional[Any] = ..., + charset: Text = ...): ... +def encode_multipart(values, boundary: Optional[Any] = ..., charset: Text = ...): ... +def File(fd, filename: Optional[Any] = ..., mimetype: Optional[Any] = ...): ... + +class _TestCookieHeaders: + headers: Any + def __init__(self, headers): ... + def getheaders(self, name): ... + def get_all(self, name, default: Optional[Any] = ...): ... + +class _TestCookieResponse: + headers: Any + def __init__(self, headers): ... + def info(self): ... + +class _TestCookieJar(CookieJar): + def inject_wsgi(self, environ): ... + def extract_wsgi(self, environ, headers): ... + +class EnvironBuilder: + server_protocol: Any + wsgi_version: Any + request_class: Any + charset: Text + path: Any + base_url: Any + query_string: Any + args: Any + method: Any + headers: Any + content_type: Any + errors_stream: Any + multithread: Any + multiprocess: Any + run_once: Any + environ_base: Any + environ_overrides: Any + input_stream: Any + content_length: Any + closed: Any + def __init__(self, path: str = ..., base_url: Optional[Any] = ..., query_string: Optional[Any] = ..., + method: str = ..., input_stream: Optional[Any] = ..., content_type: Optional[Any] = ..., + content_length: Optional[Any] = ..., errors_stream: Optional[Any] = ..., multithread: bool = ..., + multiprocess: bool = ..., run_once: bool = ..., headers: Optional[Any] = ..., data: Optional[Any] = ..., + environ_base: Optional[Any] = ..., environ_overrides: Optional[Any] = ..., charset: Text = ...): ... + form: Any + files: Any + @property + def server_name(self): ... + @property + def server_port(self): ... + def __del__(self): ... + def close(self): ... + def get_environ(self): ... + def get_request(self, cls: Optional[Any] = ...): ... + +class ClientRedirectError(Exception): ... + +class Client: + application: Any + response_wrapper: Any + cookie_jar: Any + allow_subdomain_redirects: Any + def __init__(self, application, response_wrapper: Optional[Any] = ..., use_cookies: bool = ..., + allow_subdomain_redirects: bool = ...): ... + def set_cookie(self, server_name, key, value: str = ..., max_age: Optional[Any] = ..., expires: Optional[Any] = ..., + path: str = ..., domain: Optional[Any] = ..., secure: Optional[Any] = ..., httponly: bool = ..., + charset: Text = ...): ... + def delete_cookie(self, server_name, key, path: str = ..., domain: Optional[Any] = ...): ... + def run_wsgi_app(self, environ, buffered: bool = ...): ... + def resolve_redirect(self, response, new_location, environ, buffered: bool = ...): ... + def open(self, *args, **kwargs): ... + def get(self, *args, **kw): ... + def patch(self, *args, **kw): ... + def post(self, *args, **kw): ... + def head(self, *args, **kw): ... + def put(self, *args, **kw): ... + def delete(self, *args, **kw): ... + def options(self, *args, **kw): ... + def trace(self, *args, **kw): ... + +def create_environ(*args, **kwargs): ... +def run_wsgi_app(app, environ, buffered: bool = ...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/testapp.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/testapp.pyi new file mode 100644 index 0000000..e45ea4a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/testapp.pyi @@ -0,0 +1,9 @@ +from typing import Any +from werkzeug.wrappers import BaseRequest as Request, BaseResponse as Response + +logo: Any +TEMPLATE: Any + +def iter_sys_path(): ... +def render_testapp(req): ... +def test_app(environ, start_response): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/urls.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/urls.pyi new file mode 100644 index 0000000..e0b1306 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/urls.pyi @@ -0,0 +1,72 @@ +from collections import namedtuple +from typing import Any, Optional, Text + + +_URLTuple = namedtuple( + '_URLTuple', + ['scheme', 'netloc', 'path', 'query', 'fragment'] +) + + +class BaseURL(_URLTuple): + def replace(self, **kwargs): ... + @property + def host(self): ... + @property + def ascii_host(self): ... + @property + def port(self): ... + @property + def auth(self): ... + @property + def username(self): ... + @property + def raw_username(self): ... + @property + def password(self): ... + @property + def raw_password(self): ... + def decode_query(self, *args, **kwargs): ... + def join(self, *args, **kwargs): ... + def to_url(self): ... + def decode_netloc(self): ... + def to_uri_tuple(self): ... + def to_iri_tuple(self): ... + def get_file_location(self, pathformat: Optional[Any] = ...): ... + +class URL(BaseURL): + def encode_netloc(self): ... + def encode(self, charset: Text = ..., errors: Text = ...): ... + +class BytesURL(BaseURL): + def encode_netloc(self): ... + def decode(self, charset: Text = ..., errors: Text = ...): ... + +def url_parse(url, scheme: Optional[Any] = ..., allow_fragments: bool = ...): ... +def url_quote(string, charset: Text = ..., errors: Text = ..., safe: str = ..., unsafe: str = ...): ... +def url_quote_plus(string, charset: Text = ..., errors: Text = ..., safe: str = ...): ... +def url_unparse(components): ... +def url_unquote(string, charset: Text = ..., errors: Text = ..., unsafe: str = ...): ... +def url_unquote_plus(s, charset: Text = ..., errors: Text = ...): ... +def url_fix(s, charset: Text = ...): ... +def uri_to_iri(uri, charset: Text = ..., errors: Text = ...): ... +def iri_to_uri(iri, charset: Text = ..., errors: Text = ..., safe_conversion: bool = ...): ... +def url_decode(s, charset: Text = ..., decode_keys: bool = ..., include_empty: bool = ..., errors: Text = ..., + separator: str = ..., cls: Optional[Any] = ...): ... +def url_decode_stream(stream, charset: Text = ..., decode_keys: bool = ..., include_empty: bool = ..., errors: Text = ..., + separator: str = ..., cls: Optional[Any] = ..., limit: Optional[Any] = ..., + return_iterator: bool = ...): ... +def url_encode(obj, charset: Text = ..., encode_keys: bool = ..., sort: bool = ..., key: Optional[Any] = ..., + separator: bytes = ...): ... +def url_encode_stream(obj, stream: Optional[Any] = ..., charset: Text = ..., encode_keys: bool = ..., sort: bool = ..., + key: Optional[Any] = ..., separator: bytes = ...): ... +def url_join(base, url, allow_fragments: bool = ...): ... + +class Href: + base: Any + charset: Text + sort: Any + key: Any + def __init__(self, base: str = ..., charset: Text = ..., sort: bool = ..., key: Optional[Any] = ...): ... + def __getattr__(self, name): ... + def __call__(self, *path, **query): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/useragents.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/useragents.pyi new file mode 100644 index 0000000..c7e8363 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/useragents.pyi @@ -0,0 +1,14 @@ +from typing import Any + +class UserAgentParser: + platforms: Any + browsers: Any + def __init__(self): ... + def __call__(self, user_agent): ... + +class UserAgent: + string: Any + def __init__(self, environ_or_string): ... + def to_header(self): ... + def __nonzero__(self): ... + __bool__: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/utils.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/utils.pyi new file mode 100644 index 0000000..92465ef --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/utils.pyi @@ -0,0 +1,58 @@ +from typing import Any, Optional, overload, Type, TypeVar +from werkzeug._internal import _DictAccessorProperty +from werkzeug.wrappers import Response + +class cached_property(property): + __name__: Any + __module__: Any + __doc__: Any + func: Any + def __init__(self, func, name: Optional[Any] = ..., doc: Optional[Any] = ...): ... + def __set__(self, obj, value): ... + def __get__(self, obj, type: Optional[Any] = ...): ... + +class environ_property(_DictAccessorProperty): + read_only: Any + def lookup(self, obj): ... + +class header_property(_DictAccessorProperty): + def lookup(self, obj): ... + +class HTMLBuilder: + def __init__(self, dialect): ... + def __call__(self, s): ... + def __getattr__(self, tag): ... + +html: Any +xhtml: Any + +def get_content_type(mimetype, charset): ... +def format_string(string, context): ... +def secure_filename(filename): ... +def escape(s, quote: Optional[Any] = ...): ... +def unescape(s): ... + +# 'redirect' returns a werkzeug Response, unless you give it +# another Response type to use instead. +_RC = TypeVar("_RC", bound=Response) +@overload +def redirect(location, code: int = ..., Response: None = ...) -> Response: ... +@overload +def redirect(location, code: int = ..., Response: Type[_RC] = ...) -> _RC: ... + +def append_slash_redirect(environ, code: int = ...): ... +def import_string(import_name, silent: bool = ...): ... +def find_modules(import_path, include_packages: bool = ..., recursive: bool = ...): ... +def validate_arguments(func, args, kwargs, drop_extra: bool = ...): ... +def bind_arguments(func, args, kwargs): ... + +class ArgumentValidationError(ValueError): + missing: Any + extra: Any + extra_positional: Any + def __init__(self, missing: Optional[Any] = ..., extra: Optional[Any] = ..., extra_positional: Optional[Any] = ...): ... + +class ImportStringError(ImportError): + import_name: Any + exception: Any + def __init__(self, import_name, exception): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/wrappers.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/wrappers.pyi new file mode 100644 index 0000000..74cb6ff --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/wrappers.pyi @@ -0,0 +1,249 @@ +from datetime import datetime +from typing import ( + Any, Callable, Iterable, Iterator, Mapping, MutableMapping, Optional, Sequence, Text, Tuple, Type, TypeVar, Union, +) + +from wsgiref.types import WSGIEnvironment, InputStream + +from .datastructures import ( + Authorization, CombinedMultiDict, EnvironHeaders, Headers, ImmutableMultiDict, + MultiDict, ImmutableTypeConversionDict, HeaderSet, + Accept, MIMEAccept, CharsetAccept, LanguageAccept, +) +from .useragents import UserAgent + +class BaseRequest: + charset: str + encoding_errors: str + max_content_length: Optional[int] + max_form_memory_size: int + parameter_storage_class: Type + list_storage_class: Type + dict_storage_class: Type + form_data_parser_class: Type + trusted_hosts: Optional[Sequence[Text]] + disable_data_descriptor: Any + environ: WSGIEnvironment = ... + shallow: Any + def __init__(self, environ: WSGIEnvironment, populate_request: bool = ..., shallow: bool = ...) -> None: ... + @property + def url_charset(self) -> str: ... + @classmethod + def from_values(cls, *args, **kwargs) -> BaseRequest: ... + @classmethod + def application(cls, f): ... + @property + def want_form_data_parsed(self): ... + def make_form_data_parser(self): ... + def close(self) -> None: ... + def __enter__(self): ... + def __exit__(self, exc_type, exc_value, tb): ... + @property + def stream(self) -> InputStream: ... + input_stream: InputStream + args: ImmutableMultiDict + @property + def data(self) -> bytes: ... + # TODO: once Literal types are supported, overload with as_text + def get_data(self, cache: bool = ..., as_text: bool = ..., parse_form_data: bool = ...) -> Any: ... # returns bytes if as_text is False (the default), else Text + form: ImmutableMultiDict + values: CombinedMultiDict + files: MultiDict + @property + def cookies(self) -> ImmutableTypeConversionDict[str, str]: ... + headers: EnvironHeaders + path: Text + full_path: Text + script_root: Text + url: Text + base_url: Text + url_root: Text + host_url: Text + host: Text + query_string: bytes + method: Text + @property + def access_route(self) -> Sequence[str]: ... + @property + def remote_addr(self) -> str: ... + remote_user: Text + scheme: str + is_xhr: bool + is_secure: bool + is_multithread: bool + is_multiprocess: bool + is_run_once: bool + + # These are not preset at runtime but we add them since monkeypatching this + # class is quite common. + def __setattr__(self, name: str, value: Any): ... + def __getattr__(self, name: str): ... + +_OnCloseT = TypeVar('_OnCloseT', bound=Callable[[], Any]) +_SelfT = TypeVar('_SelfT', bound=BaseResponse) + +class BaseResponse: + charset: str + default_status: int + default_mimetype: str + implicit_sequence_conversion: bool + autocorrect_location_header: bool + automatically_set_content_length: bool + headers: Headers + status_code: int + status: str + direct_passthrough: bool + response: Iterable[bytes] + def __init__(self, response: Optional[Union[str, bytes, bytearray, Iterable[str], Iterable[bytes]]] = ..., + status: Optional[Union[Text, int]] = ..., + headers: Optional[Union[Headers, + Mapping[Text, Text], + Sequence[Tuple[Text, Text]]]] = ..., + mimetype: Optional[Text] = ..., + content_type: Optional[Text] = ..., + direct_passthrough: bool = ...) -> None: ... + def call_on_close(self, func: _OnCloseT) -> _OnCloseT: ... + @classmethod + def force_type(cls: Type[_SelfT], response: object, environ: Optional[WSGIEnvironment] = ...) -> _SelfT: ... + @classmethod + def from_app(cls: Type[_SelfT], app: Any, environ: WSGIEnvironment, buffered: bool = ...) -> _SelfT: ... + # TODO: once Literal types are supported, overload with as_text + def get_data(self, as_text: bool = ...) -> Any: ... # returns bytes if as_text is False (the default), else Text + def set_data(self, value: Union[bytes, Text]) -> None: ... + data: Any + def calculate_content_length(self) -> Optional[int]: ... + def make_sequence(self) -> None: ... + def iter_encoded(self) -> Iterator[bytes]: ... + def set_cookie(self, key, value: str = ..., max_age: Optional[Any] = ..., expires: Optional[Any] = ..., + path: str = ..., domain: Optional[Any] = ..., secure: bool = ..., httponly: bool = ...): ... + def delete_cookie(self, key, path: str = ..., domain: Optional[Any] = ...): ... + @property + def is_streamed(self) -> bool: ... + @property + def is_sequence(self) -> bool: ... + def close(self) -> None: ... + def __enter__(self): ... + def __exit__(self, exc_type, exc_value, tb): ... + # The no_etag argument if fictional, but required for compatibility with + # ETagResponseMixin + def freeze(self, no_etag: bool = ...) -> None: ... + def get_wsgi_headers(self, environ): ... + def get_app_iter(self, environ): ... + def get_wsgi_response(self, environ): ... + def __call__(self, environ, start_response): ... + +class AcceptMixin(object): + @property + def accept_mimetypes(self) -> MIMEAccept: ... + @property + def accept_charsets(self) -> CharsetAccept: ... + @property + def accept_encodings(self) -> Accept: ... + @property + def accept_languages(self) -> LanguageAccept: ... + +class ETagRequestMixin: + @property + def cache_control(self): ... + @property + def if_match(self): ... + @property + def if_none_match(self): ... + @property + def if_modified_since(self): ... + @property + def if_unmodified_since(self): ... + @property + def if_range(self): ... + @property + def range(self): ... + +class UserAgentMixin: + @property + def user_agent(self) -> UserAgent: ... + +class AuthorizationMixin: + @property + def authorization(self) -> Optional[Authorization]: ... + +class StreamOnlyMixin: + disable_data_descriptor: Any + want_form_data_parsed: Any + +class ETagResponseMixin: + @property + def cache_control(self): ... + status_code: Any + def make_conditional(self, request_or_environ, accept_ranges: bool = ..., complete_length: Optional[Any] = ...): ... + def add_etag(self, overwrite: bool = ..., weak: bool = ...): ... + def set_etag(self, etag, weak: bool = ...): ... + def get_etag(self): ... + def freeze(self, no_etag: bool = ...) -> None: ... + accept_ranges: Any + content_range: Any + +class ResponseStream: + mode: Any + response: Any + closed: Any + def __init__(self, response): ... + def write(self, value): ... + def writelines(self, seq): ... + def close(self): ... + def flush(self): ... + def isatty(self): ... + @property + def encoding(self): ... + +class ResponseStreamMixin: + @property + def stream(self) -> ResponseStream: ... + +class CommonRequestDescriptorsMixin: + @property + def content_type(self) -> Optional[str]: ... + @property + def content_length(self) -> Optional[int]: ... + @property + def content_encoding(self) -> Optional[str]: ... + @property + def content_md5(self) -> Optional[str]: ... + @property + def referrer(self) -> Optional[str]: ... + @property + def date(self) -> Optional[datetime]: ... + @property + def max_forwards(self) -> Optional[int]: ... + @property + def mimetype(self) -> str: ... + @property + def mimetype_params(self) -> Mapping[str, str]: ... + @property + def pragma(self) -> HeaderSet: ... + +class CommonResponseDescriptorsMixin: + mimetype: Optional[str] = ... + @property + def mimetype_params(self) -> MutableMapping[str, str]: ... + location: Optional[str] = ... + age: Any = ... # get: Optional[datetime.timedelta] + content_type: Optional[str] = ... + content_length: Optional[int] = ... + content_location: Optional[str] = ... + content_encoding: Optional[str] = ... + content_md5: Optional[str] = ... + date: Any = ... # get: Optional[datetime.datetime] + expires: Any = ... # get: Optional[datetime.datetime] + last_modified: Any = ... # get: Optional[datetime.datetime] + retry_after: Any = ... # get: Optional[datetime.datetime] + vary: Optional[str] = ... + content_language: Optional[str] = ... + allow: Optional[str] = ... + +class WWWAuthenticateMixin: + @property + def www_authenticate(self): ... + +class Request(BaseRequest, AcceptMixin, ETagRequestMixin, UserAgentMixin, AuthorizationMixin, CommonRequestDescriptorsMixin): ... +class PlainRequest(StreamOnlyMixin, Request): ... +class Response(BaseResponse, ETagResponseMixin, ResponseStreamMixin, CommonResponseDescriptorsMixin, WWWAuthenticateMixin): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/wsgi.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/wsgi.pyi new file mode 100644 index 0000000..87deff4 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/werkzeug/wsgi.pyi @@ -0,0 +1,91 @@ +from typing import Any, Optional, Protocol, Iterable, Text +from wsgiref.types import WSGIEnvironment, InputStream + +def responder(f): ... +def get_current_url(environ, root_only: bool = ..., strip_querystring: bool = ..., host_only: bool = ..., + trusted_hosts: Optional[Any] = ...): ... +def host_is_trusted(hostname, trusted_list): ... +def get_host(environ, trusted_hosts: Optional[Any] = ...): ... +def get_content_length(environ: WSGIEnvironment) -> Optional[int]: ... +def get_input_stream(environ: WSGIEnvironment, safe_fallback: bool = ...) -> InputStream: ... +def get_query_string(environ): ... +def get_path_info(environ, charset: Text = ..., errors: Text = ...): ... +def get_script_name(environ, charset: Text = ..., errors: Text = ...): ... +def pop_path_info(environ, charset: Text = ..., errors: Text = ...): ... +def peek_path_info(environ, charset: Text = ..., errors: Text = ...): ... +def extract_path_info(environ_or_baseurl, path_or_url, charset: Text = ..., errors: Text = ..., + collapse_http_schemes: bool = ...): ... + +class SharedDataMiddleware: + app: Any + exports: Any + cache: Any + cache_timeout: Any + fallback_mimetype: Any + def __init__(self, app, exports, disallow: Optional[Any] = ..., cache: bool = ..., cache_timeout=..., + fallback_mimetype: str = ...): ... + def is_allowed(self, filename): ... + def get_file_loader(self, filename): ... + def get_package_loader(self, package, package_path): ... + def get_directory_loader(self, directory): ... + def generate_etag(self, mtime, file_size, real_filename): ... + def __call__(self, environ, start_response): ... + +class DispatcherMiddleware: + app: Any + mounts: Any + def __init__(self, app, mounts: Optional[Any] = ...): ... + def __call__(self, environ, start_response): ... + +class ClosingIterator: + def __init__(self, iterable, callbacks: Optional[Any] = ...): ... + def __iter__(self): ... + def __next__(self): ... + def close(self): ... + +class _Readable(Protocol): + def read(self, size: int = ...) -> bytes: ... + +def wrap_file(environ: WSGIEnvironment, file: _Readable, buffer_size: int = ...) -> Iterable[bytes]: ... + +class FileWrapper: + file: _Readable + buffer_size: int + def __init__(self, file: _Readable, buffer_size: int = ...) -> None: ... + def close(self) -> None: ... + def seekable(self) -> bool: ... + def seek(self, offset: int, whence: int = ...) -> None: ... + def tell(self) -> Optional[int]: ... + def __iter__(self) -> FileWrapper: ... + def __next__(self) -> bytes: ... + +class _RangeWrapper: + iterable: Any + byte_range: Any + start_byte: Any + end_byte: Any + read_length: Any + seekable: Any + end_reached: Any + def __init__(self, iterable, start_byte: int = ..., byte_range: Optional[Any] = ...): ... + def __iter__(self): ... + def __next__(self): ... + def close(self): ... + +def make_line_iter(stream, limit: Optional[Any] = ..., buffer_size=..., cap_at_buffer: bool = ...): ... +def make_chunk_iter(stream, separator, limit: Optional[Any] = ..., buffer_size=..., cap_at_buffer: bool = ...): ... + +class LimitedStream: + limit: Any + def __init__(self, stream, limit): ... + def __iter__(self): ... + @property + def is_exhausted(self): ... + def on_exhausted(self): ... + def on_disconnect(self): ... + def exhaust(self, chunk_size=...): ... + def read(self, size: Optional[Any] = ...): ... + def readline(self, size: Optional[Any] = ...): ... + def readlines(self, size: Optional[Any] = ...): ... + def tell(self): ... + def __next__(self): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/yaml/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/yaml/__init__.pyi new file mode 100644 index 0000000..c0fc6a9 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/yaml/__init__.pyi @@ -0,0 +1,82 @@ +from typing import Any, IO, Iterator, Optional, overload, Sequence, Text, Union +import sys +from yaml.error import * # noqa: F403 +from yaml.tokens import * # noqa: F403 +from yaml.events import * # noqa: F403 +from yaml.nodes import * # noqa: F403 +from yaml.loader import * # noqa: F403 +from yaml.dumper import * # noqa: F403 +from . import resolver # Help mypy a bit; this is implied by loader and dumper +from .cyaml import * + +if sys.version_info < (3,): + _Str = Union[Text, str] +else: + _Str = str +# FIXME: the functions really return py2:unicode/py3:str if encoding is None, otherwise py2:str/py3:bytes. Waiting for python/mypy#5621 +_Yaml = Any + +__with_libyaml__: Any +__version__: str + +def scan(stream, Loader=...): ... +def parse(stream, Loader=...): ... +def compose(stream, Loader=...): ... +def compose_all(stream, Loader=...): ... +def load(stream: Union[str, IO[str]], Loader=...) -> Any: ... +def load_all(stream: Union[str, IO[str]], Loader=...) -> Iterator[Any]: ... +def full_load(stream: Union[str, IO[str]]) -> Any: ... +def full_load_all(stream: Union[str, IO[str]]) -> Iterator[Any]: ... +def safe_load(stream: Union[str, IO[str]]) -> Any: ... +def safe_load_all(stream: Union[str, IO[str]]) -> Iterator[Any]: ... +def emit(events, stream=..., Dumper=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=...): ... + +@overload +def serialize_all(nodes, stream: IO[str], Dumper=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=..., encoding=..., explicit_start=..., explicit_end=..., version=..., tags=...) -> None: ... +@overload +def serialize_all(nodes, stream: None = ..., Dumper=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=..., encoding: Optional[_Str] = ..., explicit_start=..., explicit_end=..., version=..., tags=...) -> _Yaml: ... + +@overload +def serialize(node, stream: IO[str], Dumper=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=..., encoding=..., explicit_start=..., explicit_end=..., version=..., tags=...) -> None: ... +@overload +def serialize(node, stream: None = ..., Dumper=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=..., encoding: Optional[_Str] = ..., explicit_start=..., explicit_end=..., version=..., tags=...) -> _Yaml: ... + +@overload +def dump_all(documents: Sequence[Any], stream: IO[str], Dumper=..., default_style=..., default_flow_style=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=..., encoding=..., explicit_start=..., explicit_end=..., version=..., tags=...) -> None: ... +@overload +def dump_all(documents: Sequence[Any], stream: None = ..., Dumper=..., default_style=..., default_flow_style=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=..., encoding: Optional[_Str] = ..., explicit_start=..., explicit_end=..., version=..., tags=...) -> _Yaml: ... + +@overload +def dump(data: Any, stream: IO[str], Dumper=..., default_style=..., default_flow_style=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=..., encoding=..., explicit_start=..., explicit_end=..., version=..., tags=...) -> None: ... +@overload +def dump(data: Any, stream: None = ..., Dumper=..., default_style=..., default_flow_style=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=..., encoding: Optional[_Str] = ..., explicit_start=..., explicit_end=..., version=..., tags=...) -> _Yaml: ... + +@overload +def safe_dump_all(documents: Sequence[Any], stream: IO[str], default_style=..., default_flow_style=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=..., encoding=..., explicit_start=..., explicit_end=..., version=..., tags=...) -> None: ... +@overload +def safe_dump_all(documents: Sequence[Any], stream: None = ..., default_style=..., default_flow_style=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=..., encoding: Optional[_Str] = ..., explicit_start=..., explicit_end=..., version=..., tags=...) -> _Yaml: ... + +@overload +def safe_dump(data: Any, stream: IO[str], default_style=..., default_flow_style=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=..., encoding=..., explicit_start=..., explicit_end=..., version=..., tags=...) -> None: ... +@overload +def safe_dump(data: Any, stream: None = ..., default_style=..., default_flow_style=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=..., encoding: Optional[_Str] = ..., explicit_start=..., explicit_end=..., version=..., tags=...) -> _Yaml: ... + +def add_implicit_resolver(tag, regexp, first=..., Loader=..., Dumper=...): ... +def add_path_resolver(tag, path, kind=..., Loader=..., Dumper=...): ... +def add_constructor(tag, constructor, Loader=...): ... +def add_multi_constructor(tag_prefix, multi_constructor, Loader=...): ... +def add_representer(data_type, representer, Dumper=...): ... +def add_multi_representer(data_type, multi_representer, Dumper=...): ... + +class YAMLObjectMetaclass(type): + def __init__(self, name, bases, kwds) -> None: ... + +class YAMLObject(metaclass=YAMLObjectMetaclass): + yaml_loader: Any + yaml_dumper: Any + yaml_tag: Any + yaml_flow_style: Any + @classmethod + def from_yaml(cls, loader, node): ... + @classmethod + def to_yaml(cls, dumper, data): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/yaml/composer.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/yaml/composer.pyi new file mode 100644 index 0000000..f1e2c03 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/yaml/composer.pyi @@ -0,0 +1,17 @@ +from typing import Any +from yaml.error import Mark, YAMLError, MarkedYAMLError +from yaml.nodes import Node, ScalarNode, CollectionNode, SequenceNode, MappingNode + +class ComposerError(MarkedYAMLError): ... + +class Composer: + anchors: Any + def __init__(self) -> None: ... + def check_node(self): ... + def get_node(self): ... + def get_single_node(self): ... + def compose_document(self): ... + def compose_node(self, parent, index): ... + def compose_scalar_node(self, anchor): ... + def compose_sequence_node(self, anchor): ... + def compose_mapping_node(self, anchor): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/yaml/constructor.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/yaml/constructor.pyi new file mode 100644 index 0000000..27bcdbe --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/yaml/constructor.pyi @@ -0,0 +1,68 @@ +from yaml.error import Mark, YAMLError, MarkedYAMLError +from yaml.nodes import Node, ScalarNode, CollectionNode, SequenceNode, MappingNode + +from typing import Any + +class ConstructorError(MarkedYAMLError): ... + +class BaseConstructor: + yaml_constructors: Any + yaml_multi_constructors: Any + constructed_objects: Any + recursive_objects: Any + state_generators: Any + deep_construct: Any + def __init__(self) -> None: ... + def check_data(self): ... + def get_data(self): ... + def get_single_data(self): ... + def construct_document(self, node): ... + def construct_object(self, node, deep=...): ... + def construct_scalar(self, node): ... + def construct_sequence(self, node, deep=...): ... + def construct_mapping(self, node, deep=...): ... + def construct_pairs(self, node, deep=...): ... + @classmethod + def add_constructor(cls, tag, constructor): ... + @classmethod + def add_multi_constructor(cls, tag_prefix, multi_constructor): ... + +class SafeConstructor(BaseConstructor): + def construct_scalar(self, node): ... + def flatten_mapping(self, node): ... + def construct_mapping(self, node, deep=...): ... + def construct_yaml_null(self, node): ... + bool_values: Any + def construct_yaml_bool(self, node): ... + def construct_yaml_int(self, node): ... + inf_value: Any + nan_value: Any + def construct_yaml_float(self, node): ... + def construct_yaml_binary(self, node): ... + timestamp_regexp: Any + def construct_yaml_timestamp(self, node): ... + def construct_yaml_omap(self, node): ... + def construct_yaml_pairs(self, node): ... + def construct_yaml_set(self, node): ... + def construct_yaml_str(self, node): ... + def construct_yaml_seq(self, node): ... + def construct_yaml_map(self, node): ... + def construct_yaml_object(self, node, cls): ... + def construct_undefined(self, node): ... + +class Constructor(SafeConstructor): + def construct_python_str(self, node): ... + def construct_python_unicode(self, node): ... + def construct_python_long(self, node): ... + def construct_python_complex(self, node): ... + def construct_python_tuple(self, node): ... + def find_python_module(self, name, mark): ... + def find_python_name(self, name, mark): ... + def construct_python_name(self, suffix, node): ... + def construct_python_module(self, suffix, node): ... + class classobj: ... + def make_python_instance(self, suffix, node, args=..., kwds=..., newobj=...): ... + def set_python_instance_state(self, instance, state): ... + def construct_python_object(self, suffix, node): ... + def construct_python_object_apply(self, suffix, node, newobj=...): ... + def construct_python_object_new(self, suffix, node): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/yaml/cyaml.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/yaml/cyaml.pyi new file mode 100644 index 0000000..0eef815 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/yaml/cyaml.pyi @@ -0,0 +1,47 @@ +from typing import Any, IO, Mapping, Optional, Sequence, Text, Union +from typing_extensions import Protocol + +from yaml.constructor import BaseConstructor, Constructor, SafeConstructor +from yaml.representer import BaseRepresenter, Representer, SafeRepresenter +from yaml.resolver import BaseResolver, Resolver +from yaml.serializer import Serializer + +class _Readable(Protocol): + def read(self, size: int) -> Union[Text, bytes]: ... + +class CParser: + def __init__(self, stream: Union[str, bytes, _Readable]) -> None: ... + +class CBaseLoader(CParser, BaseConstructor, BaseResolver): + def __init__(self, stream: Union[str, bytes, _Readable]) -> None: ... + +class CLoader(CParser, SafeConstructor, Resolver): + def __init__(self, stream: Union[str, bytes, _Readable]) -> None: ... + +class CSafeLoader(CParser, SafeConstructor, Resolver): + def __init__(self, stream: Union[str, bytes, _Readable]) -> None: ... + +class CDangerLoader(CParser, Constructor, Resolver): ... # undocumented + +class CEmitter(object): + def __init__(self, stream: IO[Any], canonical: Optional[Any] = ..., + indent: Optional[int] = ..., width: Optional[int] = ..., + allow_unicode: Optional[Any] = ..., line_break: Optional[str] = ..., + encoding: Optional[Text] = ..., explicit_start: Optional[Any] = ..., + explicit_end: Optional[Any] = ..., version: Optional[Sequence[int]] = ..., + tags: Optional[Mapping[Text, Text]] = ...) -> None: ... + +class CBaseDumper(CEmitter, BaseRepresenter, BaseResolver): + def __init__(self, stream: IO[Any], default_style: Optional[str] = ..., + default_flow_style: Optional[bool] = ..., canonical: Optional[Any] = ..., + indent: Optional[int] = ..., width: Optional[int] = ..., + allow_unicode: Optional[Any] = ..., line_break: Optional[str] = ..., + encoding: Optional[Text] = ..., explicit_start: Optional[Any] = ..., + explicit_end: Optional[Any] = ..., version: Optional[Sequence[int]] = ..., + tags: Optional[Mapping[Text, Text]] = ...) -> None: ... + +class CDumper(CEmitter, SafeRepresenter, Resolver): ... + +CSafeDumper = CDumper + +class CDangerDumper(CEmitter, Serializer, Representer, Resolver): ... # undocumented diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/yaml/dumper.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/yaml/dumper.pyi new file mode 100644 index 0000000..0586f13 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/yaml/dumper.pyi @@ -0,0 +1,13 @@ +from yaml.emitter import Emitter +from yaml.serializer import Serializer +from yaml.representer import BaseRepresenter, Representer, SafeRepresenter +from yaml.resolver import BaseResolver, Resolver + +class BaseDumper(Emitter, Serializer, BaseRepresenter, BaseResolver): + def __init__(self, stream, default_style=..., default_flow_style=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=..., encoding=..., explicit_start=..., explicit_end=..., version=..., tags=...) -> None: ... + +class SafeDumper(Emitter, Serializer, SafeRepresenter, Resolver): + def __init__(self, stream, default_style=..., default_flow_style=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=..., encoding=..., explicit_start=..., explicit_end=..., version=..., tags=...) -> None: ... + +class Dumper(Emitter, Serializer, Representer, Resolver): + def __init__(self, stream, default_style=..., default_flow_style=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=..., encoding=..., explicit_start=..., explicit_end=..., version=..., tags=...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/yaml/emitter.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/yaml/emitter.pyi new file mode 100644 index 0000000..5ca9cbb --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/yaml/emitter.pyi @@ -0,0 +1,106 @@ +from typing import Any +from yaml.error import YAMLError + +class EmitterError(YAMLError): ... + +class ScalarAnalysis: + scalar: Any + empty: Any + multiline: Any + allow_flow_plain: Any + allow_block_plain: Any + allow_single_quoted: Any + allow_double_quoted: Any + allow_block: Any + def __init__(self, scalar, empty, multiline, allow_flow_plain, allow_block_plain, allow_single_quoted, allow_double_quoted, allow_block) -> None: ... + +class Emitter: + DEFAULT_TAG_PREFIXES: Any + stream: Any + encoding: Any + states: Any + state: Any + events: Any + event: Any + indents: Any + indent: Any + flow_level: Any + root_context: Any + sequence_context: Any + mapping_context: Any + simple_key_context: Any + line: Any + column: Any + whitespace: Any + indention: Any + open_ended: Any + canonical: Any + allow_unicode: Any + best_indent: Any + best_width: Any + best_line_break: Any + tag_prefixes: Any + prepared_anchor: Any + prepared_tag: Any + analysis: Any + style: Any + def __init__(self, stream, canonical=..., indent=..., width=..., allow_unicode=..., line_break=...) -> None: ... + def dispose(self): ... + def emit(self, event): ... + def need_more_events(self): ... + def need_events(self, count): ... + def increase_indent(self, flow=..., indentless=...): ... + def expect_stream_start(self): ... + def expect_nothing(self): ... + def expect_first_document_start(self): ... + def expect_document_start(self, first=...): ... + def expect_document_end(self): ... + def expect_document_root(self): ... + def expect_node(self, root=..., sequence=..., mapping=..., simple_key=...): ... + def expect_alias(self): ... + def expect_scalar(self): ... + def expect_flow_sequence(self): ... + def expect_first_flow_sequence_item(self): ... + def expect_flow_sequence_item(self): ... + def expect_flow_mapping(self): ... + def expect_first_flow_mapping_key(self): ... + def expect_flow_mapping_key(self): ... + def expect_flow_mapping_simple_value(self): ... + def expect_flow_mapping_value(self): ... + def expect_block_sequence(self): ... + def expect_first_block_sequence_item(self): ... + def expect_block_sequence_item(self, first=...): ... + def expect_block_mapping(self): ... + def expect_first_block_mapping_key(self): ... + def expect_block_mapping_key(self, first=...): ... + def expect_block_mapping_simple_value(self): ... + def expect_block_mapping_value(self): ... + def check_empty_sequence(self): ... + def check_empty_mapping(self): ... + def check_empty_document(self): ... + def check_simple_key(self): ... + def process_anchor(self, indicator): ... + def process_tag(self): ... + def choose_scalar_style(self): ... + def process_scalar(self): ... + def prepare_version(self, version): ... + def prepare_tag_handle(self, handle): ... + def prepare_tag_prefix(self, prefix): ... + def prepare_tag(self, tag): ... + def prepare_anchor(self, anchor): ... + def analyze_scalar(self, scalar): ... + def flush_stream(self): ... + def write_stream_start(self): ... + def write_stream_end(self): ... + def write_indicator(self, indicator, need_whitespace, whitespace=..., indention=...): ... + def write_indent(self): ... + def write_line_break(self, data=...): ... + def write_version_directive(self, version_text): ... + def write_tag_directive(self, handle_text, prefix_text): ... + def write_single_quoted(self, text, split=...): ... + ESCAPE_REPLACEMENTS: Any + def write_double_quoted(self, text, split=...): ... + def determine_block_hints(self, text): ... + def write_folded(self, text): ... + def write_literal(self, text): ... + def write_plain(self, text, split=...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/yaml/error.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/yaml/error.pyi new file mode 100644 index 0000000..e567dd0 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/yaml/error.pyi @@ -0,0 +1,21 @@ +from typing import Any + +class Mark: + name: Any + index: Any + line: Any + column: Any + buffer: Any + pointer: Any + def __init__(self, name, index, line, column, buffer, pointer) -> None: ... + def get_snippet(self, indent=..., max_length=...): ... + +class YAMLError(Exception): ... + +class MarkedYAMLError(YAMLError): + context: Any + context_mark: Any + problem: Any + problem_mark: Any + note: Any + def __init__(self, context=..., context_mark=..., problem=..., problem_mark=..., note=...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/yaml/events.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/yaml/events.pyi new file mode 100644 index 0000000..7096d15 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/yaml/events.pyi @@ -0,0 +1,62 @@ +from typing import Any + +class Event: + start_mark: Any + end_mark: Any + def __init__(self, start_mark=..., end_mark=...) -> None: ... + +class NodeEvent(Event): + anchor: Any + start_mark: Any + end_mark: Any + def __init__(self, anchor, start_mark=..., end_mark=...) -> None: ... + +class CollectionStartEvent(NodeEvent): + anchor: Any + tag: Any + implicit: Any + start_mark: Any + end_mark: Any + flow_style: Any + def __init__(self, anchor, tag, implicit, start_mark=..., end_mark=..., flow_style=...) -> None: ... + +class CollectionEndEvent(Event): ... + +class StreamStartEvent(Event): + start_mark: Any + end_mark: Any + encoding: Any + def __init__(self, start_mark=..., end_mark=..., encoding=...) -> None: ... + +class StreamEndEvent(Event): ... + +class DocumentStartEvent(Event): + start_mark: Any + end_mark: Any + explicit: Any + version: Any + tags: Any + def __init__(self, start_mark=..., end_mark=..., explicit=..., version=..., tags=...) -> None: ... + +class DocumentEndEvent(Event): + start_mark: Any + end_mark: Any + explicit: Any + def __init__(self, start_mark=..., end_mark=..., explicit=...) -> None: ... + +class AliasEvent(NodeEvent): ... + +class ScalarEvent(NodeEvent): + anchor: Any + tag: Any + implicit: Any + value: Any + start_mark: Any + end_mark: Any + style: Any + def __init__(self, anchor, tag, implicit, value, start_mark=..., end_mark=..., style=...) -> None: ... + +class SequenceStartEvent(CollectionStartEvent): ... +class SequenceEndEvent(CollectionEndEvent): ... +class MappingStartEvent(CollectionStartEvent): ... +class MappingEndEvent(CollectionEndEvent): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/yaml/loader.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/yaml/loader.pyi new file mode 100644 index 0000000..0e9afea --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/yaml/loader.pyi @@ -0,0 +1,15 @@ +from yaml.reader import Reader +from yaml.scanner import Scanner +from yaml.parser import Parser +from yaml.composer import Composer +from yaml.constructor import BaseConstructor, SafeConstructor, Constructor +from yaml.resolver import BaseResolver, Resolver + +class BaseLoader(Reader, Scanner, Parser, Composer, BaseConstructor, BaseResolver): + def __init__(self, stream) -> None: ... + +class SafeLoader(Reader, Scanner, Parser, Composer, SafeConstructor, Resolver): + def __init__(self, stream) -> None: ... + +class Loader(Reader, Scanner, Parser, Composer, Constructor, Resolver): + def __init__(self, stream) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/yaml/nodes.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/yaml/nodes.pyi new file mode 100644 index 0000000..f31fa7d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/yaml/nodes.pyi @@ -0,0 +1,31 @@ +from typing import Any + +class Node: + tag: Any + value: Any + start_mark: Any + end_mark: Any + def __init__(self, tag, value, start_mark, end_mark) -> None: ... + +class ScalarNode(Node): + id: Any + tag: Any + value: Any + start_mark: Any + end_mark: Any + style: Any + def __init__(self, tag, value, start_mark=..., end_mark=..., style=...) -> None: ... + +class CollectionNode(Node): + tag: Any + value: Any + start_mark: Any + end_mark: Any + flow_style: Any + def __init__(self, tag, value, start_mark=..., end_mark=..., flow_style=...) -> None: ... + +class SequenceNode(CollectionNode): + id: Any + +class MappingNode(CollectionNode): + id: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/yaml/parser.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/yaml/parser.pyi new file mode 100644 index 0000000..4253e11 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/yaml/parser.pyi @@ -0,0 +1,44 @@ +from typing import Any +from yaml.error import MarkedYAMLError + +class ParserError(MarkedYAMLError): ... + +class Parser: + DEFAULT_TAGS: Any + current_event: Any + yaml_version: Any + tag_handles: Any + states: Any + marks: Any + state: Any + def __init__(self) -> None: ... + def dispose(self): ... + def check_event(self, *choices): ... + def peek_event(self): ... + def get_event(self): ... + def parse_stream_start(self): ... + def parse_implicit_document_start(self): ... + def parse_document_start(self): ... + def parse_document_end(self): ... + def parse_document_content(self): ... + def process_directives(self): ... + def parse_block_node(self): ... + def parse_flow_node(self): ... + def parse_block_node_or_indentless_sequence(self): ... + def parse_node(self, block=..., indentless_sequence=...): ... + def parse_block_sequence_first_entry(self): ... + def parse_block_sequence_entry(self): ... + def parse_indentless_sequence_entry(self): ... + def parse_block_mapping_first_key(self): ... + def parse_block_mapping_key(self): ... + def parse_block_mapping_value(self): ... + def parse_flow_sequence_first_entry(self): ... + def parse_flow_sequence_entry(self, first=...): ... + def parse_flow_sequence_entry_mapping_key(self): ... + def parse_flow_sequence_entry_mapping_value(self): ... + def parse_flow_sequence_entry_mapping_end(self): ... + def parse_flow_mapping_first_key(self): ... + def parse_flow_mapping_key(self, first=...): ... + def parse_flow_mapping_value(self): ... + def parse_flow_mapping_empty_value(self): ... + def process_empty_scalar(self, mark): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/yaml/reader.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/yaml/reader.pyi new file mode 100644 index 0000000..05adf0c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/yaml/reader.pyi @@ -0,0 +1,34 @@ +from typing import Any +from yaml.error import YAMLError + +class ReaderError(YAMLError): + name: Any + character: Any + position: Any + encoding: Any + reason: Any + def __init__(self, name, position, character, encoding, reason) -> None: ... + +class Reader: + name: Any + stream: Any + stream_pointer: Any + eof: Any + buffer: Any + pointer: Any + raw_buffer: Any + raw_decode: Any + encoding: Any + index: Any + line: Any + column: Any + def __init__(self, stream) -> None: ... + def peek(self, index=...): ... + def prefix(self, length=...): ... + def forward(self, length=...): ... + def get_mark(self): ... + def determine_encoding(self): ... + NON_PRINTABLE: Any + def check_printable(self, data): ... + def update(self, length): ... + def update_raw(self, size=...): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/yaml/representer.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/yaml/representer.pyi new file mode 100644 index 0000000..7d4bbcc --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/yaml/representer.pyi @@ -0,0 +1,54 @@ +from typing import Any +from yaml.error import YAMLError + +class RepresenterError(YAMLError): ... + +class BaseRepresenter: + yaml_representers: Any + yaml_multi_representers: Any + default_style: Any + default_flow_style: Any + represented_objects: Any + object_keeper: Any + alias_key: Any + def __init__(self, default_style=..., default_flow_style=...) -> None: ... + def represent(self, data): ... + def get_classobj_bases(self, cls): ... + def represent_data(self, data): ... + @classmethod + def add_representer(cls, data_type, representer): ... + @classmethod + def add_multi_representer(cls, data_type, representer): ... + def represent_scalar(self, tag, value, style=...): ... + def represent_sequence(self, tag, sequence, flow_style=...): ... + def represent_mapping(self, tag, mapping, flow_style=...): ... + def ignore_aliases(self, data): ... + +class SafeRepresenter(BaseRepresenter): + def ignore_aliases(self, data): ... + def represent_none(self, data): ... + def represent_str(self, data): ... + def represent_unicode(self, data): ... + def represent_bool(self, data): ... + def represent_int(self, data): ... + def represent_long(self, data): ... + inf_value: Any + def represent_float(self, data): ... + def represent_list(self, data): ... + def represent_dict(self, data): ... + def represent_set(self, data): ... + def represent_date(self, data): ... + def represent_datetime(self, data): ... + def represent_yaml_object(self, tag, data, cls, flow_style=...): ... + def represent_undefined(self, data): ... + +class Representer(SafeRepresenter): + def represent_str(self, data): ... + def represent_unicode(self, data): ... + def represent_long(self, data): ... + def represent_complex(self, data): ... + def represent_tuple(self, data): ... + def represent_name(self, data): ... + def represent_module(self, data): ... + def represent_instance(self, data): ... + def represent_object(self, data): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/yaml/resolver.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/yaml/resolver.pyi new file mode 100644 index 0000000..7297560 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/yaml/resolver.pyi @@ -0,0 +1,24 @@ +from typing import Any +from yaml.error import YAMLError + +class ResolverError(YAMLError): ... + +class BaseResolver: + DEFAULT_SCALAR_TAG: Any + DEFAULT_SEQUENCE_TAG: Any + DEFAULT_MAPPING_TAG: Any + yaml_implicit_resolvers: Any + yaml_path_resolvers: Any + resolver_exact_paths: Any + resolver_prefix_paths: Any + def __init__(self) -> None: ... + @classmethod + def add_implicit_resolver(cls, tag, regexp, first): ... + @classmethod + def add_path_resolver(cls, tag, path, kind=...): ... + def descend_resolver(self, current_node, current_index): ... + def ascend_resolver(self): ... + def check_resolver_prefix(self, depth, path, kind, current_node, current_index): ... + def resolve(self, kind, value, implicit): ... + +class Resolver(BaseResolver): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/yaml/scanner.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/yaml/scanner.pyi new file mode 100644 index 0000000..33f45da --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/yaml/scanner.pyi @@ -0,0 +1,96 @@ +from typing import Any +from yaml.error import MarkedYAMLError + +class ScannerError(MarkedYAMLError): ... + +class SimpleKey: + token_number: Any + required: Any + index: Any + line: Any + column: Any + mark: Any + def __init__(self, token_number, required, index, line, column, mark) -> None: ... + +class Scanner: + done: Any + flow_level: Any + tokens: Any + tokens_taken: Any + indent: Any + indents: Any + allow_simple_key: Any + possible_simple_keys: Any + def __init__(self) -> None: ... + def check_token(self, *choices): ... + def peek_token(self): ... + def get_token(self): ... + def need_more_tokens(self): ... + def fetch_more_tokens(self): ... + def next_possible_simple_key(self): ... + def stale_possible_simple_keys(self): ... + def save_possible_simple_key(self): ... + def remove_possible_simple_key(self): ... + def unwind_indent(self, column): ... + def add_indent(self, column): ... + def fetch_stream_start(self): ... + def fetch_stream_end(self): ... + def fetch_directive(self): ... + def fetch_document_start(self): ... + def fetch_document_end(self): ... + def fetch_document_indicator(self, TokenClass): ... + def fetch_flow_sequence_start(self): ... + def fetch_flow_mapping_start(self): ... + def fetch_flow_collection_start(self, TokenClass): ... + def fetch_flow_sequence_end(self): ... + def fetch_flow_mapping_end(self): ... + def fetch_flow_collection_end(self, TokenClass): ... + def fetch_flow_entry(self): ... + def fetch_block_entry(self): ... + def fetch_key(self): ... + def fetch_value(self): ... + def fetch_alias(self): ... + def fetch_anchor(self): ... + def fetch_tag(self): ... + def fetch_literal(self): ... + def fetch_folded(self): ... + def fetch_block_scalar(self, style): ... + def fetch_single(self): ... + def fetch_double(self): ... + def fetch_flow_scalar(self, style): ... + def fetch_plain(self): ... + def check_directive(self): ... + def check_document_start(self): ... + def check_document_end(self): ... + def check_block_entry(self): ... + def check_key(self): ... + def check_value(self): ... + def check_plain(self): ... + def scan_to_next_token(self): ... + def scan_directive(self): ... + def scan_directive_name(self, start_mark): ... + def scan_yaml_directive_value(self, start_mark): ... + def scan_yaml_directive_number(self, start_mark): ... + def scan_tag_directive_value(self, start_mark): ... + def scan_tag_directive_handle(self, start_mark): ... + def scan_tag_directive_prefix(self, start_mark): ... + def scan_directive_ignored_line(self, start_mark): ... + def scan_anchor(self, TokenClass): ... + def scan_tag(self): ... + def scan_block_scalar(self, style): ... + def scan_block_scalar_indicators(self, start_mark): ... + def scan_block_scalar_ignored_line(self, start_mark): ... + def scan_block_scalar_indentation(self): ... + def scan_block_scalar_breaks(self, indent): ... + def scan_flow_scalar(self, style): ... + ESCAPE_REPLACEMENTS: Any + ESCAPE_CODES: Any + def scan_flow_scalar_non_spaces(self, double, start_mark): ... + def scan_flow_scalar_spaces(self, double, start_mark): ... + def scan_flow_scalar_breaks(self, double, start_mark): ... + def scan_plain(self): ... + def scan_plain_spaces(self, indent, start_mark): ... + def scan_tag_handle(self, name, start_mark): ... + def scan_tag_uri(self, name, start_mark): ... + def scan_uri_escapes(self, name, start_mark): ... + def scan_line_break(self): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/yaml/serializer.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/yaml/serializer.pyi new file mode 100644 index 0000000..0c169e8 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/yaml/serializer.pyi @@ -0,0 +1,23 @@ +from typing import Any +from yaml.error import YAMLError + +class SerializerError(YAMLError): ... + +class Serializer: + ANCHOR_TEMPLATE: Any + use_encoding: Any + use_explicit_start: Any + use_explicit_end: Any + use_version: Any + use_tags: Any + serialized_nodes: Any + anchors: Any + last_anchor_id: Any + closed: Any + def __init__(self, encoding=..., explicit_start=..., explicit_end=..., version=..., tags=...) -> None: ... + def open(self): ... + def close(self): ... + def serialize(self, node): ... + def anchor_node(self, node): ... + def generate_anchor(self, node): ... + def serialize_node(self, node, parent, index): ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/yaml/tokens.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/yaml/tokens.pyi new file mode 100644 index 0000000..b258ec7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/2and3/yaml/tokens.pyi @@ -0,0 +1,93 @@ +from typing import Any + +class Token: + start_mark: Any + end_mark: Any + def __init__(self, start_mark, end_mark) -> None: ... + +class DirectiveToken(Token): + id: Any + name: Any + value: Any + start_mark: Any + end_mark: Any + def __init__(self, name, value, start_mark, end_mark) -> None: ... + +class DocumentStartToken(Token): + id: Any + +class DocumentEndToken(Token): + id: Any + +class StreamStartToken(Token): + id: Any + start_mark: Any + end_mark: Any + encoding: Any + def __init__(self, start_mark=..., end_mark=..., encoding=...) -> None: ... + +class StreamEndToken(Token): + id: Any + +class BlockSequenceStartToken(Token): + id: Any + +class BlockMappingStartToken(Token): + id: Any + +class BlockEndToken(Token): + id: Any + +class FlowSequenceStartToken(Token): + id: Any + +class FlowMappingStartToken(Token): + id: Any + +class FlowSequenceEndToken(Token): + id: Any + +class FlowMappingEndToken(Token): + id: Any + +class KeyToken(Token): + id: Any + +class ValueToken(Token): + id: Any + +class BlockEntryToken(Token): + id: Any + +class FlowEntryToken(Token): + id: Any + +class AliasToken(Token): + id: Any + value: Any + start_mark: Any + end_mark: Any + def __init__(self, value, start_mark, end_mark) -> None: ... + +class AnchorToken(Token): + id: Any + value: Any + start_mark: Any + end_mark: Any + def __init__(self, value, start_mark, end_mark) -> None: ... + +class TagToken(Token): + id: Any + value: Any + start_mark: Any + end_mark: Any + def __init__(self, value, start_mark, end_mark) -> None: ... + +class ScalarToken(Token): + id: Any + value: Any + plain: Any + start_mark: Any + end_mark: Any + style: Any + def __init__(self, value, plain, start_mark, end_mark, style=...) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3.5/contextvars.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3.5/contextvars.pyi new file mode 100644 index 0000000..ab2ae9e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3.5/contextvars.pyi @@ -0,0 +1,30 @@ +from typing import Any, Callable, ClassVar, Generic, Iterator, Mapping, TypeVar, Union + +_T = TypeVar('_T') + +class ContextVar(Generic[_T]): + def __init__(self, name: str, *, default: _T = ...) -> None: ... + @property + def name(self) -> str: ... + def get(self, default: _T = ...) -> _T: ... + def set(self, value: _T) -> Token[_T]: ... + def reset(self, token: Token[_T]) -> None: ... + +class Token(Generic[_T]): + @property + def var(self) -> ContextVar[_T]: ... + @property + def old_value(self) -> Any: ... # returns either _T or MISSING, but that's hard to express + MISSING: ClassVar[object] + +def copy_context() -> Context: ... + +# It doesn't make sense to make this generic, because for most Contexts each ContextVar will have +# a different value. +class Context(Mapping[ContextVar[Any], Any]): + def __init__(self) -> None: ... + def run(self, callable: Callable[..., _T], *args: Any, **kwargs: Any) -> _T: ... + def copy(self) -> Context: ... + def __getitem__(self, key: ContextVar[Any]) -> Any: ... + def __iter__(self) -> Iterator[ContextVar[Any]]: ... + def __len__(self) -> int: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/dataclasses.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/dataclasses.pyi new file mode 100644 index 0000000..f8bcd52 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/dataclasses.pyi @@ -0,0 +1,71 @@ +from typing import overload, Any, Callable, Dict, Generic, Iterable, List, Mapping, Optional, Tuple, Type, TypeVar, Union + + +_T = TypeVar('_T') + +class _MISSING_TYPE: ... +MISSING: _MISSING_TYPE + +@overload +def asdict(obj: Any) -> Dict[str, Any]: ... +@overload +def asdict(obj: Any, *, dict_factory: Callable[[List[Tuple[str, Any]]], _T]) -> _T: ... + +@overload +def astuple(obj: Any) -> Tuple[Any, ...]: ... +@overload +def astuple(obj: Any, *, tuple_factory: Callable[[List[Any]], _T]) -> _T: ... + + +@overload +def dataclass(_cls: Type[_T]) -> Type[_T]: ... + +@overload +def dataclass(*, init: bool = ..., repr: bool = ..., eq: bool = ..., order: bool = ..., + unsafe_hash: bool = ..., frozen: bool = ...) -> Callable[[Type[_T]], Type[_T]]: ... + + +class Field(Generic[_T]): + name: str + type: Type[_T] + default: _T + default_factory: Callable[[], _T] + repr: bool + hash: Optional[bool] + init: bool + compare: bool + metadata: Optional[Mapping[str, Any]] + + +# NOTE: Actual return type is 'Field[_T]', but we want to help type checkers +# to understand the magic that happens at runtime. +@overload # `default` and `default_factory` are optional and mutually exclusive. +def field(*, default: _T, + init: bool = ..., repr: bool = ..., hash: Optional[bool] = ..., compare: bool = ..., + metadata: Optional[Mapping[str, Any]] = ...) -> _T: ... + +@overload +def field(*, default_factory: Callable[[], _T], + init: bool = ..., repr: bool = ..., hash: Optional[bool] = ..., compare: bool = ..., + metadata: Optional[Mapping[str, Any]] = ...) -> _T: ... + +@overload +def field(*, + init: bool = ..., repr: bool = ..., hash: Optional[bool] = ..., compare: bool = ..., + metadata: Optional[Mapping[str, Any]] = ...) -> Any: ... + + +def fields(class_or_instance: Any) -> Tuple[Field[Any], ...]: ... + +def is_dataclass(obj: Any) -> bool: ... + +class FrozenInstanceError(AttributeError): ... + +class InitVar(Generic[_T]): ... + +def make_dataclass(cls_name: str, fields: Iterable[Union[str, Tuple[str, type], Tuple[str, type, Field[Any]]]], *, + bases: Tuple[type, ...] = ..., namespace: Optional[Dict[str, Any]] = ..., + init: bool = ..., repr: bool = ..., eq: bool = ..., order: bool = ..., hash: bool = ..., + frozen: bool = ...): ... + +def replace(obj: _T, **changes: Any) -> _T: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/docutils/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/docutils/__init__.pyi new file mode 100644 index 0000000..024e962 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/docutils/__init__.pyi @@ -0,0 +1,3 @@ +from typing import Any + +def __getattr__(name) -> Any: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/docutils/examples.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/docutils/examples.pyi new file mode 100644 index 0000000..ec73a29 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/docutils/examples.pyi @@ -0,0 +1,5 @@ +from typing import Any + +html_parts: Any + +def __getattr__(name) -> Any: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/docutils/nodes.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/docutils/nodes.pyi new file mode 100644 index 0000000..382112b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/docutils/nodes.pyi @@ -0,0 +1,10 @@ +from typing import Any, List + +class reference: + def __init__(self, + rawsource: str = ..., + text: str = ..., + *children: List[Any], + **attributes) -> None: ... + +def __getattr__(name) -> Any: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/docutils/parsers/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/docutils/parsers/__init__.pyi new file mode 100644 index 0000000..024e962 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/docutils/parsers/__init__.pyi @@ -0,0 +1,3 @@ +from typing import Any + +def __getattr__(name) -> Any: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/docutils/parsers/rst/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/docutils/parsers/rst/__init__.pyi new file mode 100644 index 0000000..024e962 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/docutils/parsers/rst/__init__.pyi @@ -0,0 +1,3 @@ +from typing import Any + +def __getattr__(name) -> Any: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/docutils/parsers/rst/nodes.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/docutils/parsers/rst/nodes.pyi new file mode 100644 index 0000000..024e962 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/docutils/parsers/rst/nodes.pyi @@ -0,0 +1,3 @@ +from typing import Any + +def __getattr__(name) -> Any: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/docutils/parsers/rst/roles.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/docutils/parsers/rst/roles.pyi new file mode 100644 index 0000000..58b9cd7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/docutils/parsers/rst/roles.pyi @@ -0,0 +1,12 @@ +import docutils.nodes +import docutils.parsers.rst.states + +from typing import Callable, Any, List, Dict, Tuple + +def register_local_role(name: str, + role_fn: Callable[[str, str, str, int, docutils.parsers.rst.states.Inliner, Dict, List], + Tuple[List[docutils.nodes.reference], List[docutils.nodes.reference]]] + ) -> None: + ... + +def __getattr__(name) -> Any: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/docutils/parsers/rst/states.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/docutils/parsers/rst/states.pyi new file mode 100644 index 0000000..ac00fe1 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/docutils/parsers/rst/states.pyi @@ -0,0 +1,8 @@ +import typing +from typing import Any + +class Inliner: + def __init__(self) -> None: + ... + +def __getattr__(name) -> Any: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/jwt/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/jwt/__init__.pyi new file mode 100644 index 0000000..da8eb40 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/jwt/__init__.pyi @@ -0,0 +1,43 @@ +from typing import Mapping, Any, Optional, Union, Dict + +from . import algorithms + +def decode(jwt: Union[str, bytes], key: Union[str, bytes] = ..., + verify: bool = ..., algorithms: Optional[Any] = ..., + options: Optional[Mapping[Any, Any]] = ..., + **kwargs: Any) -> Dict[str, Any]: ... + +def encode(payload: Mapping[str, Any], key: Union[str, bytes], + algorithm: str = ..., headers: Optional[Mapping[str, Any]] = ..., + json_encoder: Optional[Any] = ...) -> bytes: ... + +def register_algorithm(alg_id: str, + alg_obj: algorithms.Algorithm) -> None: ... + +def unregister_algorithm(alg_id: str) -> None: ... + +class PyJWTError(Exception): ... +class InvalidTokenError(PyJWTError): ... +class DecodeError(InvalidTokenError): ... +class ExpiredSignatureError(InvalidTokenError): ... +class InvalidAudienceError(InvalidTokenError): ... +class InvalidIssuerError(InvalidTokenError): ... +class InvalidIssuedAtError(InvalidTokenError): ... +class ImmatureSignatureError(InvalidTokenError): ... +class InvalidKeyError(PyJWTError): ... +class InvalidAlgorithmError(InvalidTokenError): ... +class MissingRequiredClaimError(InvalidTokenError): ... +class InvalidSignatureError(DecodeError): ... + +# Compatibility aliases (deprecated) +ExpiredSignature = ExpiredSignatureError +InvalidAudience = InvalidAudienceError +InvalidIssuer = InvalidIssuerError + +# These aren't actually documented, but the package +# exports them in __init__.py, so we should at least +# make sure that mypy doesn't raise spurious errors +# if they're used. +get_unverified_header: Any +PyJWT: Any +PyJWS: Any diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/jwt/algorithms.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/jwt/algorithms.pyi new file mode 100644 index 0000000..7177dc7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/jwt/algorithms.pyi @@ -0,0 +1,83 @@ +import sys +from hashlib import _Hash +from typing import Any, Set, Dict, Optional, ClassVar, Union, Generic, TypeVar + +requires_cryptography = Set[str] + +def get_default_algorithms() -> Dict[str, Algorithm]: ... + +_K = TypeVar("_K") + +class Algorithm(Generic[_K]): + def prepare_key(self, key: _K) -> _K: ... + def sign(self, msg: bytes, key: _K) -> bytes: ... + def verify(self, msg: bytes, key: _K, sig: bytes) -> bool: ... + @staticmethod + def to_jwk(key_obj: Any) -> str: ... # should be key_obj: _K, see python/mypy#1337 + @staticmethod + def from_jwk(jwk: str) -> Any: ... # should return _K, see python/mypy#1337 + + +class NoneAlgorithm(Algorithm[None]): + def prepare_key(self, key: Optional[str]) -> None: ... + +class _HashAlg: + def __call__(self, arg: Union[bytes, bytearray, memoryview] = ...) -> _Hash: ... + +if sys.version_info >= (3, 6): + _LoadsString = Union[str, bytes, bytearray] +else: + _LoadsString = str + +class HMACAlgorithm(Algorithm[bytes]): + SHA256: ClassVar[_HashAlg] + SHA384: ClassVar[_HashAlg] + SHA512: ClassVar[_HashAlg] + hash_alg: _HashAlg + def __init__(self, _HashAlg) -> None: ... + def prepare_key(self, key: Union[str, bytes]) -> bytes: ... + @staticmethod + def to_jwk(key_obj: Union[str, bytes]) -> str: ... + @staticmethod + def from_jwk(jwk: _LoadsString) -> bytes: ... + +# Only defined if cryptography is installed. Types should be tightened when +# cryptography gets type hints. +# See https://github.com/python/typeshed/issues/2542 +class RSAAlgorithm(Algorithm): + SHA256: ClassVar[Any] + SHA384: ClassVar[Any] + SHA512: ClassVar[Any] + hash_alg: Any + def __init__(self, hash_alg: Any) -> None: ... + def prepare_key(self, key: Any) -> Any: ... + @staticmethod + def to_jwk(key_obj: Any) -> str: ... + @staticmethod + def from_jwk(jwk: _LoadsString) -> Any: ... + def sign(self, msg: bytes, key: Any) -> bytes: ... + def verify(self, msg: bytes, key: Any, sig: bytes) -> bool: ... + +# Only defined if cryptography is installed. Types should be tightened when +# cryptography gets type hints. +# See https://github.com/python/typeshed/issues/2542 +class ECAlgorithm(Algorithm): + SHA256: ClassVar[Any] + SHA384: ClassVar[Any] + SHA512: ClassVar[Any] + hash_alg: Any + def __init__(self, hash_alg: Any) -> None: ... + def prepare_key(self, key: Any) -> Any: ... + @staticmethod + def to_jwk(key_obj: Any) -> str: ... + @staticmethod + def from_jwk(jwk: _LoadsString) -> Any: ... + def sign(self, msg: bytes, key: Any) -> bytes: ... + def verify(self, msg: bytes, key: Any, sig: bytes) -> bool: ... + +# Only defined if cryptography is installed. Types should be tightened when +# cryptography gets type hints. +# See https://github.com/python/typeshed/issues/2542 +class RSAPSSAlgorithm(RSAAlgorithm): + def sign(self, msg: bytes, key: Any) -> bytes: ... + def verify(self, msg: bytes, key: Any, sig: bytes) -> bool: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/jwt/contrib/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/jwt/contrib/__init__.pyi new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/jwt/contrib/algorithms/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/jwt/contrib/algorithms/__init__.pyi new file mode 100644 index 0000000..b2bb1f6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/jwt/contrib/algorithms/__init__.pyi @@ -0,0 +1 @@ +from hashlib import _Hash as _HashAlg diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/jwt/contrib/algorithms/py_ecdsa.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/jwt/contrib/algorithms/py_ecdsa.pyi new file mode 100644 index 0000000..e1342cc --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/jwt/contrib/algorithms/py_ecdsa.pyi @@ -0,0 +1,10 @@ +from typing import Any +from jwt.algorithms import Algorithm + +from . import _HashAlg + +class ECAlgorithm(Algorithm): + SHA256: _HashAlg + SHA384: _HashAlg + SHA512: _HashAlg + def __init__(self, hash_alg: _HashAlg) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/jwt/contrib/algorithms/pycrypto.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/jwt/contrib/algorithms/pycrypto.pyi new file mode 100644 index 0000000..763b46a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/jwt/contrib/algorithms/pycrypto.pyi @@ -0,0 +1,10 @@ +from typing import Any +from jwt.algorithms import Algorithm + +from . import _HashAlg + +class RSAAlgorithm(Algorithm): + SHA256: _HashAlg + SHA384: _HashAlg + SHA512: _HashAlg + def __init__(self, hash_alg: _HashAlg) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/orjson.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/orjson.pyi new file mode 100644 index 0000000..9c1cdc1 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/orjson.pyi @@ -0,0 +1,14 @@ +# https://github.com/ijl/orjson/blob/master/orjson.pyi + +from typing import Any, Callable, Optional, Union + +def dumps( + __obj: Any, default: Optional[Callable[[Any], Any]] = ..., option: Optional[int] = ... +) -> bytes: ... +def loads(__obj: Union[bytes, str]) -> Any: ... + +class JSONDecodeError(ValueError): ... +class JSONEncodeError(TypeError): ... + +OPT_STRICT_INTEGER: int +OPT_NAIVE_UTC: int diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/pkg_resources/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/pkg_resources/__init__.pyi new file mode 100644 index 0000000..55914e1 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/pkg_resources/__init__.pyi @@ -0,0 +1,253 @@ +# Stubs for pkg_resources (Python 3.4) + +from typing import Any, Callable, Dict, IO, Iterable, Generator, Optional, Sequence, Tuple, List, Union, TypeVar, overload +from abc import ABCMeta +import importlib.abc +import types +import zipimport + +_T = TypeVar("_T") +_NestedStr = Union[str, Iterable[Union[str, Iterable[Any]]]] +_InstallerType = Callable[[Requirement], Optional[Distribution]] +_EPDistType = Union[Distribution, Requirement, str] +_MetadataType = Optional[IResourceProvider] +_PkgReqType = Union[str, Requirement] +_DistFinderType = Callable[[str, _Importer, bool], Generator[Distribution, None, None]] +_NSHandlerType = Callable[[_Importer, str, str, types.ModuleType], str] + +def declare_namespace(name: str) -> None: ... +def fixup_namespace_packages(path_item: str) -> None: ... + +class WorkingSet: + entries: List[str] + def __init__(self, entries: Optional[Iterable[str]] = ...) -> None: ... + def require(self, *requirements: _NestedStr) -> Sequence[Distribution]: ... + def run_script(self, requires: str, script_name: str) -> None: ... + def iter_entry_points(self, group: str, name: Optional[str] = ...) -> Generator[EntryPoint, None, None]: ... + def add_entry(self, entry: str) -> None: ... + def __contains__(self, dist: Distribution) -> bool: ... + def __iter__(self) -> Generator[Distribution, None, None]: ... + def find(self, req: Requirement) -> Optional[Distribution]: ... + def resolve( + self, requirements: Sequence[Requirement], env: Optional[Environment] = ..., installer: Optional[_InstallerType] = ... + ) -> List[Distribution]: ... + def add(self, dist: Distribution, entry: Optional[str] = ..., insert: bool = ..., replace: bool = ...) -> None: ... + def subscribe(self, callback: Callable[[Distribution], None]) -> None: ... + def find_plugins( + self, plugin_env: Environment, full_env: Optional[Environment] = ..., fallback: bool = ... + ) -> Tuple[List[Distribution], Dict[Distribution, Exception]]: ... + +working_set: WorkingSet + +def require(*requirements: Union[str, Sequence[str]]) -> Sequence[Distribution]: ... +def run_script(requires: str, script_name: str) -> None: ... +def iter_entry_points(group: str, name: Optional[str] = ...) -> Generator[EntryPoint, None, None]: ... +def add_activation_listener(callback: Callable[[Distribution], None]) -> None: ... + +class Environment: + def __init__( + self, search_path: Optional[Sequence[str]] = ..., platform: Optional[str] = ..., python: Optional[str] = ... + ) -> None: ... + def __getitem__(self, project_name: str) -> List[Distribution]: ... + def __iter__(self) -> Generator[str, None, None]: ... + def add(self, dist: Distribution) -> None: ... + def remove(self, dist: Distribution) -> None: ... + def can_add(self, dist: Distribution) -> bool: ... + def __add__(self, other: Union[Distribution, Environment]) -> Environment: ... + def __iadd__(self, other: Union[Distribution, Environment]) -> Environment: ... + @overload + def best_match(self, req: Requirement, working_set: WorkingSet) -> Distribution: ... + @overload + def best_match(self, req: Requirement, working_set: WorkingSet, installer: Callable[[Requirement], _T] = ...) -> _T: ... + @overload + def obtain(self, requirement: Requirement) -> None: ... + @overload + def obtain(self, requirement: Requirement, installer: Callable[[Requirement], _T] = ...) -> _T: ... + def scan(self, search_path: Optional[Sequence[str]] = ...) -> None: ... + +def parse_requirements(strs: Union[str, Iterable[str]]) -> Generator[Requirement, None, None]: ... + +class Requirement: + unsafe_name: str + project_name: str + key: str + extras: Tuple[str, ...] + specs: List[Tuple[str, str]] + # TODO: change this to Optional[packaging.markers.Marker] once we can import + # packaging.markers + marker: Optional[Any] + @staticmethod + def parse(s: Union[str, Iterable[str]]) -> Requirement: ... + def __contains__(self, item: Union[Distribution, str, Tuple[str, ...]]) -> bool: ... + def __eq__(self, other_requirement: Any) -> bool: ... + +def load_entry_point(dist: _EPDistType, group: str, name: str) -> None: ... +def get_entry_info(dist: _EPDistType, group: str, name: str) -> Optional[EntryPoint]: ... +@overload +def get_entry_map(dist: _EPDistType) -> Dict[str, Dict[str, EntryPoint]]: ... +@overload +def get_entry_map(dist: _EPDistType, group: str) -> Dict[str, EntryPoint]: ... + +class EntryPoint: + name: str + module_name: str + attrs: Tuple[str, ...] + extras: Tuple[str, ...] + dist: Optional[Distribution] + def __init__( + self, + name: str, + module_name: str, + attrs: Tuple[str, ...] = ..., + extras: Tuple[str, ...] = ..., + dist: Optional[Distribution] = ..., + ) -> None: ... + @classmethod + def parse(cls, src: str, dist: Optional[Distribution] = ...) -> EntryPoint: ... + @classmethod + def parse_group( + cls, group: str, lines: Union[str, Sequence[str]], dist: Optional[Distribution] = ... + ) -> Dict[str, EntryPoint]: ... + @classmethod + def parse_map( + cls, data: Union[Dict[str, Union[str, Sequence[str]]], str, Sequence[str]], dist: Optional[Distribution] = ... + ) -> Dict[str, EntryPoint]: ... + def load(self, require: bool = ..., env: Optional[Environment] = ..., installer: Optional[_InstallerType] = ...) -> Any: ... + def require(self, env: Optional[Environment] = ..., installer: Optional[_InstallerType] = ...) -> None: ... + def resolve(self) -> Any: ... + +def find_distributions(path_item: str, only: bool = ...) -> Generator[Distribution, None, None]: ... +def get_distribution(dist: Union[Requirement, str, Distribution]) -> Distribution: ... + +class Distribution(IResourceProvider, IMetadataProvider): + PKG_INFO: str + location: str + project_name: str + key: str + extras: List[str] + version: str + parsed_version: Tuple[str, ...] + py_version: str + platform: Optional[str] + precedence: int + def __init__( + self, + location: Optional[str] = ..., + metadata: Optional[str] = ..., + project_name: Optional[str] = ..., + version: Optional[str] = ..., + py_version: str = ..., + platform: Optional[str] = ..., + precedence: int = ..., + ) -> None: ... + @classmethod + def from_location( + cls, location: str, basename: str, metadata: Optional[str] = ..., **kw: Union[str, None, int] + ) -> Distribution: ... + @classmethod + def from_filename(cls, filename: str, metadata: Optional[str] = ..., **kw: Union[str, None, int]) -> Distribution: ... + def activate(self, path: Optional[List[str]] = ...) -> None: ... + def as_requirement(self) -> Requirement: ... + def requires(self, extras: Tuple[str, ...] = ...) -> List[Requirement]: ... + def clone(self, **kw: Union[str, int, None]) -> Requirement: ... + def egg_name(self) -> str: ... + def __cmp__(self, other: Any) -> bool: ... + def get_entry_info(self, group: str, name: str) -> Optional[EntryPoint]: ... + @overload + def get_entry_map(self) -> Dict[str, Dict[str, EntryPoint]]: ... + @overload + def get_entry_map(self, group: str) -> Dict[str, EntryPoint]: ... + def load_entry_point(self, group: str, name: str) -> None: ... + +EGG_DIST: int +BINARY_DIST: int +SOURCE_DIST: int +CHECKOUT_DIST: int +DEVELOP_DIST: int + +def resource_exists(package_or_requirement: _PkgReqType, resource_name: str) -> bool: ... +def resource_stream(package_or_requirement: _PkgReqType, resource_name: str) -> IO[bytes]: ... +def resource_string(package_or_requirement: _PkgReqType, resource_name: str) -> bytes: ... +def resource_isdir(package_or_requirement: _PkgReqType, resource_name: str) -> bool: ... +def resource_listdir(package_or_requirement: _PkgReqType, resource_name: str) -> List[str]: ... +def resource_filename(package_or_requirement: _PkgReqType, resource_name: str) -> str: ... +def set_extraction_path(path: str) -> None: ... +def cleanup_resources(force: bool = ...) -> List[str]: ... + +class IResourceManager: + def resource_exists(self, package_or_requirement: _PkgReqType, resource_name: str) -> bool: ... + def resource_stream(self, package_or_requirement: _PkgReqType, resource_name: str) -> IO[bytes]: ... + def resource_string(self, package_or_requirement: _PkgReqType, resource_name: str) -> bytes: ... + def resource_isdir(self, package_or_requirement: _PkgReqType, resource_name: str) -> bool: ... + def resource_listdir(self, package_or_requirement: _PkgReqType, resource_name: str) -> List[str]: ... + def resource_filename(self, package_or_requirement: _PkgReqType, resource_name: str) -> str: ... + def set_extraction_path(self, path: str) -> None: ... + def cleanup_resources(self, force: bool = ...) -> List[str]: ... + def get_cache_path(self, archive_name: str, names: Tuple[str, ...] = ...) -> str: ... + def extraction_error(self) -> None: ... + def postprocess(self, tempname: str, filename: str) -> None: ... + +@overload +def get_provider(package_or_requirement: str) -> IResourceProvider: ... +@overload +def get_provider(package_or_requirement: Requirement) -> Distribution: ... + +class IMetadataProvider: + def has_metadata(self, name: str) -> bool: ... + def metadata_isdir(self, name: str) -> bool: ... + def metadata_listdir(self, name: str) -> List[str]: ... + def get_metadata(self, name: str) -> str: ... + def get_metadata_lines(self, name: str) -> Generator[str, None, None]: ... + def run_script(self, script_name: str, namespace: Dict[str, Any]) -> None: ... + +class ResolutionError(Exception): ... +class DistributionNotFound(ResolutionError): ... +class VersionConflict(ResolutionError): ... +class UnknownExtra(ResolutionError): ... + +class ExtractionError(Exception): + manager: IResourceManager + cache_path: str + original_error: Exception + +class _Importer(importlib.abc.MetaPathFinder, importlib.abc.InspectLoader, metaclass=ABCMeta): ... + +def register_finder(importer_type: type, distribution_finder: _DistFinderType) -> None: ... +def register_loader_type(loader_type: type, provider_factory: Callable[[types.ModuleType], IResourceProvider]) -> None: ... +def register_namespace_handler(importer_type: type, namespace_handler: _NSHandlerType) -> None: ... + +class IResourceProvider(IMetadataProvider): ... +class NullProvider: ... +class EggProvider(NullProvider): ... +class DefaultProvider(EggProvider): ... + +class PathMetadata(DefaultProvider, IResourceProvider): + def __init__(self, path: str, egg_info: str) -> None: ... + +class ZipProvider(EggProvider): ... + +class EggMetadata(ZipProvider, IResourceProvider): + def __init__(self, zipimporter: zipimport.zipimporter) -> None: ... + +class EmptyProvider(NullProvider): ... + +empty_provider: EmptyProvider + +class FileMetadata(EmptyProvider, IResourceProvider): + def __init__(self, path_to_pkg_info: str) -> None: ... + +def parse_version(v: str) -> Tuple[str, ...]: ... +def yield_lines(strs: _NestedStr) -> Generator[str, None, None]: ... +def split_sections(strs: _NestedStr) -> Generator[Tuple[Optional[str], str], None, None]: ... +def safe_name(name: str) -> str: ... +def safe_version(version: str) -> str: ... +def safe_extra(extra: str) -> str: ... +def to_filename(name_or_version: str) -> str: ... +def get_build_platform() -> str: ... +def get_platform() -> str: ... +def get_supported_platform() -> str: ... +def compatible_platforms(provided: Optional[str], required: Optional[str]) -> bool: ... +def get_default_cache() -> str: ... +def get_importer(path_item: str) -> _Importer: ... +def ensure_directory(path: str) -> None: ... +def normalize_path(filename: str) -> str: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/pkg_resources/py31compat.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/pkg_resources/py31compat.pyi new file mode 100644 index 0000000..e7b17a3 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/pkg_resources/py31compat.pyi @@ -0,0 +1,14 @@ +from typing import Text +import os +import sys + +needs_makedirs: bool + +def _makedirs_31(path: Text, exist_ok: bool = ...) -> None: ... + +# _makedirs_31 has special behavior to handle an edge case that was removed in +# 3.4.1. No one should be using 3.4 instead of 3.4.1, so this should be fine. +if sys.version_info >= (3,): + makedirs = os.makedirs +else: + makedirs = _makedirs_31 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/__init__.pyi new file mode 100644 index 0000000..b785eac --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/__init__.pyi @@ -0,0 +1,108 @@ +# Stubs for six (Python 3.5) + +from __future__ import print_function + +from typing import ( + Any, + AnyStr, + Callable, + Dict, + ItemsView, + Iterable, + KeysView, + Mapping, + NoReturn, + Optional, + Pattern, + Text, + Tuple, + Type, + TypeVar, + Union, + ValuesView, + overload, +) +import types +import typing +import unittest + +# Exports +from io import StringIO as StringIO, BytesIO as BytesIO +from builtins import next as next +from functools import wraps as wraps +from . import moves + +_T = TypeVar('_T') +_K = TypeVar('_K') +_V = TypeVar('_V') + +# TODO make constant, then move this stub to 2and3 +# https://github.com/python/typeshed/issues/17 +PY2 = False +PY3 = True +PY34: bool + +string_types = str, +integer_types = int, +class_types = type, +text_type = str +binary_type = bytes + +MAXSIZE: int + +# def add_move +# def remove_move + +def callable(obj: object) -> bool: ... + +def get_unbound_function(unbound: types.FunctionType) -> types.FunctionType: ... +def create_bound_method(func: types.FunctionType, obj: object) -> types.MethodType: ... +def create_unbound_method(func: types.FunctionType, cls: type) -> types.FunctionType: ... + +Iterator = object + +def get_method_function(meth: types.MethodType) -> types.FunctionType: ... +def get_method_self(meth: types.MethodType) -> Optional[object]: ... +def get_function_closure(fun: types.FunctionType) -> Optional[Tuple[types._Cell, ...]]: ... +def get_function_code(fun: types.FunctionType) -> types.CodeType: ... +def get_function_defaults(fun: types.FunctionType) -> Optional[Tuple[Any, ...]]: ... +def get_function_globals(fun: types.FunctionType) -> Dict[str, Any]: ... + +def iterkeys(d: Mapping[_K, _V]) -> typing.Iterator[_K]: ... +def itervalues(d: Mapping[_K, _V]) -> typing.Iterator[_V]: ... +def iteritems(d: Mapping[_K, _V]) -> typing.Iterator[Tuple[_K, _V]]: ... +# def iterlists + +def viewkeys(d: Mapping[_K, _V]) -> KeysView[_K]: ... +def viewvalues(d: Mapping[_K, _V]) -> ValuesView[_V]: ... +def viewitems(d: Mapping[_K, _V]) -> ItemsView[_K, _V]: ... + +def b(s: str) -> binary_type: ... +def u(s: str) -> text_type: ... + +unichr = chr +def int2byte(i: int) -> bytes: ... +def byte2int(bs: binary_type) -> int: ... +def indexbytes(buf: binary_type, i: int) -> int: ... +def iterbytes(buf: binary_type) -> typing.Iterator[int]: ... + +def assertCountEqual(self: unittest.TestCase, first: Iterable[_T], second: Iterable[_T], msg: Optional[str] = ...) -> None: ... +@overload +def assertRaisesRegex(self: unittest.TestCase, msg: Optional[str] = ...) -> Any: ... +@overload +def assertRaisesRegex(self: unittest.TestCase, callable_obj: Callable[..., Any], *args: Any, **kwargs: Any) -> Any: ... +def assertRegex(self: unittest.TestCase, text: AnyStr, expected_regex: Union[AnyStr, Pattern[AnyStr]], msg: Optional[str] = ...) -> None: ... + +exec_ = exec + +def reraise(tp: Optional[Type[BaseException]], value: Optional[BaseException], tb: Optional[types.TracebackType] = ...) -> NoReturn: ... +def raise_from(value: Union[BaseException, Type[BaseException]], from_value: Optional[BaseException]) -> NoReturn: ... + +print_ = print + +def with_metaclass(meta: type, *bases: type) -> type: ... +def add_metaclass(metaclass: type) -> Callable[[_T], _T]: ... +def ensure_binary(s: Union[bytes, Text], encoding: str = ..., errors: str = ...) -> bytes: ... +def ensure_str(s: Union[bytes, Text], encoding: str = ..., errors: str = ...) -> str: ... +def ensure_text(s: Union[bytes, Text], encoding: str = ..., errors: str = ...) -> Text: ... +def python_2_unicode_compatible(klass: _T) -> _T: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/BaseHTTPServer.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/BaseHTTPServer.pyi new file mode 100644 index 0000000..0e1ad71 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/BaseHTTPServer.pyi @@ -0,0 +1 @@ +from http.server import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/CGIHTTPServer.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/CGIHTTPServer.pyi new file mode 100644 index 0000000..0e1ad71 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/CGIHTTPServer.pyi @@ -0,0 +1 @@ +from http.server import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/SimpleHTTPServer.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/SimpleHTTPServer.pyi new file mode 100644 index 0000000..0e1ad71 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/SimpleHTTPServer.pyi @@ -0,0 +1 @@ +from http.server import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/__init__.pyi new file mode 100644 index 0000000..3d6efce --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/__init__.pyi @@ -0,0 +1,69 @@ +# Stubs for six.moves +# +# Note: Commented out items means they weren't implemented at the time. +# Uncomment them when the modules have been added to the typeshed. +import sys + +from io import StringIO as cStringIO +from builtins import filter as filter +from itertools import filterfalse as filterfalse +from builtins import input as input +from sys import intern as intern +from builtins import map as map +from os import getcwd as getcwd +from os import getcwdb as getcwdb +from builtins import range as range +from functools import reduce as reduce +from shlex import quote as shlex_quote +from io import StringIO as StringIO +from collections import UserDict as UserDict +from collections import UserList as UserList +from collections import UserString as UserString +from builtins import range as xrange +from builtins import zip as zip +from itertools import zip_longest as zip_longest +from . import builtins +from . import configparser +# import copyreg as copyreg +# import dbm.gnu as dbm_gnu +from . import _dummy_thread +from . import http_cookiejar +from . import http_cookies +from . import html_entities +from . import html_parser +from . import http_client +from . import email_mime_multipart +from . import email_mime_nonmultipart +from . import email_mime_text +from . import email_mime_base +from . import BaseHTTPServer +from . import CGIHTTPServer +from . import SimpleHTTPServer +from . import cPickle +from . import queue +from . import reprlib +from . import socketserver +from . import _thread +from . import tkinter +from . import tkinter_dialog +from . import tkinter_filedialog +# import tkinter.scrolledtext as tkinter_scrolledtext +# import tkinter.simpledialog as tkinter_simpledialog +# import tkinter.tix as tkinter_tix +from . import tkinter_ttk +from . import tkinter_constants +# import tkinter.dnd as tkinter_dnd +# import tkinter.colorchooser as tkinter_colorchooser +from . import tkinter_commondialog +from . import tkinter_tkfiledialog +# import tkinter.font as tkinter_font +# import tkinter.messagebox as tkinter_messagebox +# import tkinter.simpledialog as tkinter_tksimpledialog +from . import urllib_parse +from . import urllib_error +from . import urllib +from . import urllib_robotparser +# import xmlrpc.client as xmlrpc_client +# import xmlrpc.server as xmlrpc_server + +from importlib import reload as reload_module diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/_dummy_thread.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/_dummy_thread.pyi new file mode 100644 index 0000000..2487961 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/_dummy_thread.pyi @@ -0,0 +1 @@ +from _dummy_thread import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/_thread.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/_thread.pyi new file mode 100644 index 0000000..25952a6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/_thread.pyi @@ -0,0 +1 @@ +from _thread import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/builtins.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/builtins.pyi new file mode 100644 index 0000000..9596ba0 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/builtins.pyi @@ -0,0 +1 @@ +from builtins import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/cPickle.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/cPickle.pyi new file mode 100644 index 0000000..2b944b5 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/cPickle.pyi @@ -0,0 +1 @@ +from pickle import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/configparser.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/configparser.pyi new file mode 100644 index 0000000..044861c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/configparser.pyi @@ -0,0 +1 @@ +from configparser import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/email_mime_base.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/email_mime_base.pyi new file mode 100644 index 0000000..4df155c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/email_mime_base.pyi @@ -0,0 +1 @@ +from email.mime.base import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/email_mime_multipart.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/email_mime_multipart.pyi new file mode 100644 index 0000000..4f31241 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/email_mime_multipart.pyi @@ -0,0 +1 @@ +from email.mime.multipart import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/email_mime_nonmultipart.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/email_mime_nonmultipart.pyi new file mode 100644 index 0000000..c15c8c0 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/email_mime_nonmultipart.pyi @@ -0,0 +1 @@ +from email.mime.nonmultipart import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/email_mime_text.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/email_mime_text.pyi new file mode 100644 index 0000000..51e1473 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/email_mime_text.pyi @@ -0,0 +1 @@ +from email.mime.text import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/html_entities.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/html_entities.pyi new file mode 100644 index 0000000..c1244dd --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/html_entities.pyi @@ -0,0 +1 @@ +from html.entities import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/html_parser.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/html_parser.pyi new file mode 100644 index 0000000..6db6dd8 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/html_parser.pyi @@ -0,0 +1 @@ +from html.parser import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/http_client.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/http_client.pyi new file mode 100644 index 0000000..36d29b9 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/http_client.pyi @@ -0,0 +1 @@ +from http.client import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/http_cookiejar.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/http_cookiejar.pyi new file mode 100644 index 0000000..88a1aed --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/http_cookiejar.pyi @@ -0,0 +1 @@ +from http.cookiejar import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/http_cookies.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/http_cookies.pyi new file mode 100644 index 0000000..9c59a53 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/http_cookies.pyi @@ -0,0 +1 @@ +from http.cookies import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/queue.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/queue.pyi new file mode 100644 index 0000000..fe7be53 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/queue.pyi @@ -0,0 +1 @@ +from queue import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/reprlib.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/reprlib.pyi new file mode 100644 index 0000000..c329846 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/reprlib.pyi @@ -0,0 +1 @@ +from reprlib import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/socketserver.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/socketserver.pyi new file mode 100644 index 0000000..6101c8b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/socketserver.pyi @@ -0,0 +1 @@ +from socketserver import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/tkinter.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/tkinter.pyi new file mode 100644 index 0000000..fc4d53a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/tkinter.pyi @@ -0,0 +1 @@ +from tkinter import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_commondialog.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_commondialog.pyi new file mode 100644 index 0000000..34eb419 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_commondialog.pyi @@ -0,0 +1 @@ +from tkinter.commondialog import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_constants.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_constants.pyi new file mode 100644 index 0000000..3c04f6d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_constants.pyi @@ -0,0 +1 @@ +from tkinter.constants import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_dialog.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_dialog.pyi new file mode 100644 index 0000000..0da73c2 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_dialog.pyi @@ -0,0 +1 @@ +from tkinter.dialog import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_filedialog.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_filedialog.pyi new file mode 100644 index 0000000..c4cc7c4 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_filedialog.pyi @@ -0,0 +1 @@ +from tkinter.filedialog import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_tkfiledialog.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_tkfiledialog.pyi new file mode 100644 index 0000000..c4cc7c4 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_tkfiledialog.pyi @@ -0,0 +1 @@ +from tkinter.filedialog import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_ttk.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_ttk.pyi new file mode 100644 index 0000000..14576f6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_ttk.pyi @@ -0,0 +1 @@ +from tkinter.ttk import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/urllib/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/urllib/__init__.pyi new file mode 100644 index 0000000..d08209c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/urllib/__init__.pyi @@ -0,0 +1,5 @@ +import six.moves.urllib.error as error +import six.moves.urllib.parse as parse +import six.moves.urllib.request as request +import six.moves.urllib.response as response +import six.moves.urllib.robotparser as robotparser diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/urllib/error.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/urllib/error.pyi new file mode 100644 index 0000000..83f0d22 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/urllib/error.pyi @@ -0,0 +1,3 @@ +from urllib.error import URLError as URLError +from urllib.error import HTTPError as HTTPError +from urllib.error import ContentTooShortError as ContentTooShortError diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/urllib/parse.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/urllib/parse.pyi new file mode 100644 index 0000000..8b4310a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/urllib/parse.pyi @@ -0,0 +1,27 @@ +# Stubs for six.moves.urllib.parse +# +# Note: Commented out items means they weren't implemented at the time. +# Uncomment them when the modules have been added to the typeshed. +from urllib.parse import ParseResult as ParseResult +from urllib.parse import SplitResult as SplitResult +from urllib.parse import parse_qs as parse_qs +from urllib.parse import parse_qsl as parse_qsl +from urllib.parse import urldefrag as urldefrag +from urllib.parse import urljoin as urljoin +from urllib.parse import urlparse as urlparse +from urllib.parse import urlsplit as urlsplit +from urllib.parse import urlunparse as urlunparse +from urllib.parse import urlunsplit as urlunsplit +from urllib.parse import quote as quote +from urllib.parse import quote_plus as quote_plus +from urllib.parse import unquote as unquote +from urllib.parse import unquote_plus as unquote_plus +from urllib.parse import urlencode as urlencode +# from urllib.parse import splitquery as splitquery +# from urllib.parse import splittag as splittag +# from urllib.parse import splituser as splituser +from urllib.parse import uses_fragment as uses_fragment +from urllib.parse import uses_netloc as uses_netloc +from urllib.parse import uses_params as uses_params +from urllib.parse import uses_query as uses_query +from urllib.parse import uses_relative as uses_relative diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/urllib/request.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/urllib/request.pyi new file mode 100644 index 0000000..b01dea7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/urllib/request.pyi @@ -0,0 +1,39 @@ +# Stubs for six.moves.urllib.request +# +# Note: Commented out items means they weren't implemented at the time. +# Uncomment them when the modules have been added to the typeshed. +from urllib.request import urlopen as urlopen +from urllib.request import install_opener as install_opener +from urllib.request import build_opener as build_opener +from urllib.request import pathname2url as pathname2url +from urllib.request import url2pathname as url2pathname +from urllib.request import getproxies as getproxies +from urllib.request import Request as Request +from urllib.request import OpenerDirector as OpenerDirector +from urllib.request import HTTPDefaultErrorHandler as HTTPDefaultErrorHandler +from urllib.request import HTTPRedirectHandler as HTTPRedirectHandler +from urllib.request import HTTPCookieProcessor as HTTPCookieProcessor +from urllib.request import ProxyHandler as ProxyHandler +from urllib.request import BaseHandler as BaseHandler +from urllib.request import HTTPPasswordMgr as HTTPPasswordMgr +from urllib.request import HTTPPasswordMgrWithDefaultRealm as HTTPPasswordMgrWithDefaultRealm +from urllib.request import AbstractBasicAuthHandler as AbstractBasicAuthHandler +from urllib.request import HTTPBasicAuthHandler as HTTPBasicAuthHandler +from urllib.request import ProxyBasicAuthHandler as ProxyBasicAuthHandler +from urllib.request import AbstractDigestAuthHandler as AbstractDigestAuthHandler +from urllib.request import HTTPDigestAuthHandler as HTTPDigestAuthHandler +from urllib.request import ProxyDigestAuthHandler as ProxyDigestAuthHandler +from urllib.request import HTTPHandler as HTTPHandler +from urllib.request import HTTPSHandler as HTTPSHandler +from urllib.request import FileHandler as FileHandler +from urllib.request import FTPHandler as FTPHandler +from urllib.request import CacheFTPHandler as CacheFTPHandler +from urllib.request import UnknownHandler as UnknownHandler +from urllib.request import HTTPErrorProcessor as HTTPErrorProcessor +from urllib.request import urlretrieve as urlretrieve +from urllib.request import urlcleanup as urlcleanup +from urllib.request import URLopener as URLopener +from urllib.request import FancyURLopener as FancyURLopener +# from urllib.request import proxy_bypass as proxy_bypass +from urllib.request import parse_http_list as parse_http_list +from urllib.request import parse_keqv_list as parse_keqv_list diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/urllib/response.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/urllib/response.pyi new file mode 100644 index 0000000..9f681ea --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/urllib/response.pyi @@ -0,0 +1,8 @@ +# Stubs for six.moves.urllib.response +# +# Note: Commented out items means they weren't implemented at the time. +# Uncomment them when the modules have been added to the typeshed. +# from urllib.response import addbase as addbase +# from urllib.response import addclosehook as addclosehook +# from urllib.response import addinfo as addinfo +from urllib.response import addinfourl as addinfourl diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/urllib/robotparser.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/urllib/robotparser.pyi new file mode 100644 index 0000000..bccda14 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/urllib/robotparser.pyi @@ -0,0 +1 @@ +from urllib.robotparser import RobotFileParser as RobotFileParser diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/urllib_error.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/urllib_error.pyi new file mode 100644 index 0000000..2720072 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/urllib_error.pyi @@ -0,0 +1 @@ +from urllib.error import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/urllib_parse.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/urllib_parse.pyi new file mode 100644 index 0000000..b557bbb --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/urllib_parse.pyi @@ -0,0 +1 @@ +from urllib.parse import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/urllib_request.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/urllib_request.pyi new file mode 100644 index 0000000..dc03dce --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/urllib_request.pyi @@ -0,0 +1 @@ +from .urllib.request import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/urllib_response.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/urllib_response.pyi new file mode 100644 index 0000000..bbee522 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/urllib_response.pyi @@ -0,0 +1 @@ +from .urllib.response import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/urllib_robotparser.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/urllib_robotparser.pyi new file mode 100644 index 0000000..bbf5c3c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/six/moves/urllib_robotparser.pyi @@ -0,0 +1 @@ +from urllib.robotparser import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/typed_ast/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/typed_ast/__init__.pyi new file mode 100644 index 0000000..f260032 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/typed_ast/__init__.pyi @@ -0,0 +1,2 @@ +# This module is a fork of the CPython 2 and 3 ast modules with PEP 484 support. +# See: https://github.com/python/typed_ast diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/typed_ast/ast27.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/typed_ast/ast27.pyi new file mode 100644 index 0000000..c564342 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/typed_ast/ast27.pyi @@ -0,0 +1,361 @@ +import typing +from typing import Any, Optional, Union, Generic, Iterator + +class NodeVisitor(): + def visit(self, node: AST) -> Any: ... + def generic_visit(self, node: AST) -> None: ... + +class NodeTransformer(NodeVisitor): + def generic_visit(self, node: AST) -> None: ... + +def parse(source: Union[str, bytes], filename: Union[str, bytes] = ..., mode: str = ...) -> AST: ... +def copy_location(new_node: AST, old_node: AST) -> AST: ... +def dump(node: AST, annotate_fields: bool = ..., include_attributes: bool = ...) -> str: ... +def fix_missing_locations(node: AST) -> AST: ... +def get_docstring(node: AST, clean: bool = ...) -> Optional[bytes]: ... +def increment_lineno(node: AST, n: int = ...) -> AST: ... +def iter_child_nodes(node: AST) -> Iterator[AST]: ... +def iter_fields(node: AST) -> Iterator[typing.Tuple[str, Any]]: ... +def literal_eval(node_or_string: Union[str, AST]) -> Any: ... +def walk(node: AST) -> Iterator[AST]: ... + +PyCF_ONLY_AST: int + +# ast classes + +identifier = str + +class AST: + _attributes: typing.Tuple[str, ...] + _fields: typing.Tuple[str, ...] + def __init__(self, *args, **kwargs) -> None: ... + +class mod(AST): + ... + +class Module(mod): + body: typing.List[stmt] + type_ignores: typing.List[TypeIgnore] + +class Interactive(mod): + body: typing.List[stmt] + +class Expression(mod): + body: expr + +class FunctionType(mod): + argtypes: typing.List[expr] + returns: expr + +class Suite(mod): + body: typing.List[stmt] + + +class stmt(AST): + lineno: int + col_offset: int + +class FunctionDef(stmt): + name: identifier + args: arguments + body: typing.List[stmt] + decorator_list: typing.List[expr] + type_comment: Optional[str] + +class ClassDef(stmt): + name: identifier + bases: typing.List[expr] + body: typing.List[stmt] + decorator_list: typing.List[expr] + +class Return(stmt): + value: Optional[expr] + +class Delete(stmt): + targets: typing.List[expr] + +class Assign(stmt): + targets: typing.List[expr] + value: expr + type_comment: Optional[str] + +class AugAssign(stmt): + target: expr + op: operator + value: expr + +class Print(stmt): + dest: Optional[expr] + values: typing.List[expr] + nl: bool + +class For(stmt): + target: expr + iter: expr + body: typing.List[stmt] + orelse: typing.List[stmt] + type_comment: Optional[str] + +class While(stmt): + test: expr + body: typing.List[stmt] + orelse: typing.List[stmt] + +class If(stmt): + test: expr + body: typing.List[stmt] + orelse: typing.List[stmt] + +class With(stmt): + context_expr: expr + optional_vars: Optional[expr] + body: typing.List[stmt] + type_comment: Optional[str] + +class Raise(stmt): + type: Optional[expr] + inst: Optional[expr] + tback: Optional[expr] + +class TryExcept(stmt): + body: typing.List[stmt] + handlers: typing.List[ExceptHandler] + orelse: typing.List[stmt] + +class TryFinally(stmt): + body: typing.List[stmt] + finalbody: typing.List[stmt] + +class Assert(stmt): + test: expr + msg: Optional[expr] + +class Import(stmt): + names: typing.List[alias] + +class ImportFrom(stmt): + module: Optional[identifier] + names: typing.List[alias] + level: Optional[int] + +class Exec(stmt): + body: expr + globals: Optional[expr] + locals: Optional[expr] + +class Global(stmt): + names: typing.List[identifier] + +class Expr(stmt): + value: expr + +class Pass(stmt): ... +class Break(stmt): ... +class Continue(stmt): ... + + +class slice(AST): + ... + +_slice = slice # this lets us type the variable named 'slice' below + +class Slice(slice): + lower: Optional[expr] + upper: Optional[expr] + step: Optional[expr] + +class ExtSlice(slice): + dims: typing.List[slice] + +class Index(slice): + value: expr + +class Ellipsis(slice): ... + + +class expr(AST): + lineno: int + col_offset: int + +class BoolOp(expr): + op: boolop + values: typing.List[expr] + +class BinOp(expr): + left: expr + op: operator + right: expr + +class UnaryOp(expr): + op: unaryop + operand: expr + +class Lambda(expr): + args: arguments + body: expr + +class IfExp(expr): + test: expr + body: expr + orelse: expr + +class Dict(expr): + keys: typing.List[expr] + values: typing.List[expr] + +class Set(expr): + elts: typing.List[expr] + +class ListComp(expr): + elt: expr + generators: typing.List[comprehension] + +class SetComp(expr): + elt: expr + generators: typing.List[comprehension] + +class DictComp(expr): + key: expr + value: expr + generators: typing.List[comprehension] + +class GeneratorExp(expr): + elt: expr + generators: typing.List[comprehension] + +class Yield(expr): + value: Optional[expr] + +class Compare(expr): + left: expr + ops: typing.List[cmpop] + comparators: typing.List[expr] + +class Call(expr): + func: expr + args: typing.List[expr] + keywords: typing.List[keyword] + starargs: Optional[expr] + kwargs: Optional[expr] + +class Repr(expr): + value: expr + +class Num(expr): + n: Union[int, float, complex] + +class Str(expr): + s: bytes + kind: str + +class Attribute(expr): + value: expr + attr: identifier + ctx: expr_context + +class Subscript(expr): + value: expr + slice: _slice + ctx: expr_context + +class Name(expr): + id: identifier + ctx: expr_context + +class List(expr): + elts: typing.List[expr] + ctx: expr_context + +class Tuple(expr): + elts: typing.List[expr] + ctx: expr_context + + +class expr_context(AST): + ... + +class AugLoad(expr_context): ... +class AugStore(expr_context): ... +class Del(expr_context): ... +class Load(expr_context): ... +class Param(expr_context): ... +class Store(expr_context): ... + + +class boolop(AST): + ... + +class And(boolop): ... +class Or(boolop): ... + +class operator(AST): + ... + +class Add(operator): ... +class BitAnd(operator): ... +class BitOr(operator): ... +class BitXor(operator): ... +class Div(operator): ... +class FloorDiv(operator): ... +class LShift(operator): ... +class Mod(operator): ... +class Mult(operator): ... +class Pow(operator): ... +class RShift(operator): ... +class Sub(operator): ... + +class unaryop(AST): + ... + +class Invert(unaryop): ... +class Not(unaryop): ... +class UAdd(unaryop): ... +class USub(unaryop): ... + +class cmpop(AST): + ... + +class Eq(cmpop): ... +class Gt(cmpop): ... +class GtE(cmpop): ... +class In(cmpop): ... +class Is(cmpop): ... +class IsNot(cmpop): ... +class Lt(cmpop): ... +class LtE(cmpop): ... +class NotEq(cmpop): ... +class NotIn(cmpop): ... + + +class comprehension(AST): + target: expr + iter: expr + ifs: typing.List[expr] + + +class ExceptHandler(AST): + type: Optional[expr] + name: Optional[expr] + body: typing.List[stmt] + lineno: int + col_offset: int + + +class arguments(AST): + args: typing.List[expr] + vararg: Optional[identifier] + kwarg: Optional[identifier] + defaults: typing.List[expr] + type_comments: typing.List[Optional[str]] + +class keyword(AST): + arg: identifier + value: expr + +class alias(AST): + name: identifier + asname: Optional[identifier] + + +class TypeIgnore(AST): + lineno: int diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/typed_ast/ast3.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/typed_ast/ast3.pyi new file mode 100644 index 0000000..1962b46 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/typed_ast/ast3.pyi @@ -0,0 +1,413 @@ +import typing +from typing import Any, Optional, Union, Generic, Iterator + +class NodeVisitor(): + def visit(self, node: AST) -> Any: ... + def generic_visit(self, node: AST) -> None: ... + +class NodeTransformer(NodeVisitor): + def generic_visit(self, node: AST) -> None: ... + +def parse(source: Union[str, bytes], + filename: Union[str, bytes] = ..., + mode: str = ..., + feature_version: int = ...) -> AST: ... +def copy_location(new_node: AST, old_node: AST) -> AST: ... +def dump(node: AST, annotate_fields: bool = ..., include_attributes: bool = ...) -> str: ... +def fix_missing_locations(node: AST) -> AST: ... +def get_docstring(node: AST, clean: bool = ...) -> str: ... +def increment_lineno(node: AST, n: int = ...) -> AST: ... +def iter_child_nodes(node: AST) -> Iterator[AST]: ... +def iter_fields(node: AST) -> Iterator[typing.Tuple[str, Any]]: ... +def literal_eval(node_or_string: Union[str, AST]) -> Any: ... +def walk(node: AST) -> Iterator[AST]: ... + +PyCF_ONLY_AST: int + +# ast classes + +identifier = str + +class AST: + _attributes: typing.Tuple[str, ...] + _fields: typing.Tuple[str, ...] + def __init__(self, *args, **kwargs) -> None: ... + +class mod(AST): + ... + +class Module(mod): + body: typing.List[stmt] + type_ignores: typing.List[TypeIgnore] + +class Interactive(mod): + body: typing.List[stmt] + +class Expression(mod): + body: expr + +class FunctionType(mod): + argtypes: typing.List[expr] + returns: expr + +class Suite(mod): + body: typing.List[stmt] + + +class stmt(AST): + lineno: int + col_offset: int + +class FunctionDef(stmt): + name: identifier + args: arguments + body: typing.List[stmt] + decorator_list: typing.List[expr] + returns: Optional[expr] + type_comment: Optional[str] + +class AsyncFunctionDef(stmt): + name: identifier + args: arguments + body: typing.List[stmt] + decorator_list: typing.List[expr] + returns: Optional[expr] + type_comment: Optional[str] + +class ClassDef(stmt): + name: identifier + bases: typing.List[expr] + keywords: typing.List[keyword] + body: typing.List[stmt] + decorator_list: typing.List[expr] + +class Return(stmt): + value: Optional[expr] + +class Delete(stmt): + targets: typing.List[expr] + +class Assign(stmt): + targets: typing.List[expr] + value: expr + type_comment: Optional[str] + +class AugAssign(stmt): + target: expr + op: operator + value: expr + +class AnnAssign(stmt): + target: expr + annotation: expr + value: Optional[expr] + simple: int + +class For(stmt): + target: expr + iter: expr + body: typing.List[stmt] + orelse: typing.List[stmt] + type_comment: Optional[str] + +class AsyncFor(stmt): + target: expr + iter: expr + body: typing.List[stmt] + orelse: typing.List[stmt] + type_comment: Optional[str] + +class While(stmt): + test: expr + body: typing.List[stmt] + orelse: typing.List[stmt] + +class If(stmt): + test: expr + body: typing.List[stmt] + orelse: typing.List[stmt] + +class With(stmt): + items: typing.List[withitem] + body: typing.List[stmt] + type_comment: Optional[str] + +class AsyncWith(stmt): + items: typing.List[withitem] + body: typing.List[stmt] + type_comment: Optional[str] + +class Raise(stmt): + exc: Optional[expr] + cause: Optional[expr] + +class Try(stmt): + body: typing.List[stmt] + handlers: typing.List[ExceptHandler] + orelse: typing.List[stmt] + finalbody: typing.List[stmt] + +class Assert(stmt): + test: expr + msg: Optional[expr] + +class Import(stmt): + names: typing.List[alias] + +class ImportFrom(stmt): + module: Optional[identifier] + names: typing.List[alias] + level: Optional[int] + +class Global(stmt): + names: typing.List[identifier] + +class Nonlocal(stmt): + names: typing.List[identifier] + +class Expr(stmt): + value: expr + +class Pass(stmt): ... +class Break(stmt): ... +class Continue(stmt): ... + + +class slice(AST): + ... + +_slice = slice # this lets us type the variable named 'slice' below + +class Slice(slice): + lower: Optional[expr] + upper: Optional[expr] + step: Optional[expr] + +class ExtSlice(slice): + dims: typing.List[slice] + +class Index(slice): + value: expr + + +class expr(AST): + lineno: int + col_offset: int + +class BoolOp(expr): + op: boolop + values: typing.List[expr] + +class BinOp(expr): + left: expr + op: operator + right: expr + +class UnaryOp(expr): + op: unaryop + operand: expr + +class Lambda(expr): + args: arguments + body: expr + +class IfExp(expr): + test: expr + body: expr + orelse: expr + +class Dict(expr): + keys: typing.List[expr] + values: typing.List[expr] + +class Set(expr): + elts: typing.List[expr] + +class ListComp(expr): + elt: expr + generators: typing.List[comprehension] + +class SetComp(expr): + elt: expr + generators: typing.List[comprehension] + +class DictComp(expr): + key: expr + value: expr + generators: typing.List[comprehension] + +class GeneratorExp(expr): + elt: expr + generators: typing.List[comprehension] + +class Await(expr): + value: expr + +class Yield(expr): + value: Optional[expr] + +class YieldFrom(expr): + value: expr + +class Compare(expr): + left: expr + ops: typing.List[cmpop] + comparators: typing.List[expr] + +class Call(expr): + func: expr + args: typing.List[expr] + keywords: typing.List[keyword] + +class Num(expr): + n: Union[float, int, complex] + +class Str(expr): + s: str + kind: str + +class FormattedValue(expr): + value: expr + conversion: typing.Optional[int] + format_spec: typing.Optional[expr] + +class JoinedStr(expr): + values: typing.List[expr] + +class Bytes(expr): + s: bytes + +class NameConstant(expr): + value: Any + +class Ellipsis(expr): ... + +class Attribute(expr): + value: expr + attr: identifier + ctx: expr_context + +class Subscript(expr): + value: expr + slice: _slice + ctx: expr_context + +class Starred(expr): + value: expr + ctx: expr_context + +class Name(expr): + id: identifier + ctx: expr_context + +class List(expr): + elts: typing.List[expr] + ctx: expr_context + +class Tuple(expr): + elts: typing.List[expr] + ctx: expr_context + + +class expr_context(AST): + ... + +class AugLoad(expr_context): ... +class AugStore(expr_context): ... +class Del(expr_context): ... +class Load(expr_context): ... +class Param(expr_context): ... +class Store(expr_context): ... + + +class boolop(AST): + ... + +class And(boolop): ... +class Or(boolop): ... + +class operator(AST): + ... + +class Add(operator): ... +class BitAnd(operator): ... +class BitOr(operator): ... +class BitXor(operator): ... +class Div(operator): ... +class FloorDiv(operator): ... +class LShift(operator): ... +class Mod(operator): ... +class Mult(operator): ... +class MatMult(operator): ... +class Pow(operator): ... +class RShift(operator): ... +class Sub(operator): ... + +class unaryop(AST): + ... + +class Invert(unaryop): ... +class Not(unaryop): ... +class UAdd(unaryop): ... +class USub(unaryop): ... + +class cmpop(AST): + ... + +class Eq(cmpop): ... +class Gt(cmpop): ... +class GtE(cmpop): ... +class In(cmpop): ... +class Is(cmpop): ... +class IsNot(cmpop): ... +class Lt(cmpop): ... +class LtE(cmpop): ... +class NotEq(cmpop): ... +class NotIn(cmpop): ... + + +class comprehension(AST): + target: expr + iter: expr + ifs: typing.List[expr] + is_async: int + + +class ExceptHandler(AST): + type: Optional[expr] + name: Optional[identifier] + body: typing.List[stmt] + lineno: int + col_offset: int + + +class arguments(AST): + args: typing.List[arg] + vararg: Optional[arg] + kwonlyargs: typing.List[arg] + kw_defaults: typing.List[expr] + kwarg: Optional[arg] + defaults: typing.List[expr] + +class arg(AST): + arg: identifier + annotation: Optional[expr] + lineno: int + col_offset: int + type_comment: typing.Optional[str] + +class keyword(AST): + arg: Optional[identifier] + value: expr + +class alias(AST): + name: identifier + asname: Optional[identifier] + +class withitem(AST): + context_expr: expr + optional_vars: Optional[expr] + + +class TypeIgnore(AST): + lineno: int diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/typed_ast/conversions.pyi b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/typed_ast/conversions.pyi new file mode 100644 index 0000000..d5f1829 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/third_party/typeshed/third_party/3/typed_ast/conversions.pyi @@ -0,0 +1,4 @@ +from . import ast27 +from . import ast3 + +def py2to3(ast: ast27.AST) -> ast3.AST: ... diff --git a/vim/bundle/jedi-vim/pythonx/jedi/jedi/utils.py b/vim/bundle/jedi-vim/pythonx/jedi/jedi/utils.py new file mode 100644 index 0000000..a5cf84b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/jedi/utils.py @@ -0,0 +1,134 @@ +""" +Utilities for end-users. +""" + +from __future__ import absolute_import +import __main__ +from collections import namedtuple +import logging +import traceback +import re +import os +import sys + +from jedi import Interpreter + + +READLINE_DEBUG = False + + +def setup_readline(namespace_module=__main__): + """ + Install Jedi completer to :mod:`readline`. + + This function setups :mod:`readline` to use Jedi in Python interactive + shell. If you want to use a custom ``PYTHONSTARTUP`` file (typically + ``$HOME/.pythonrc.py``), you can add this piece of code:: + + try: + from jedi.utils import setup_readline + setup_readline() + except ImportError: + # Fallback to the stdlib readline completer if it is installed. + # Taken from http://docs.python.org/2/library/rlcompleter.html + print("Jedi is not installed, falling back to readline") + try: + import readline + import rlcompleter + readline.parse_and_bind("tab: complete") + except ImportError: + print("Readline is not installed either. No tab completion is enabled.") + + This will fallback to the readline completer if Jedi is not installed. + The readline completer will only complete names in the global namespace, + so for example:: + + ran + + will complete to ``range`` + + with both Jedi and readline, but:: + + range(10).cou + + will show complete to ``range(10).count`` only with Jedi. + + You'll also need to add ``export PYTHONSTARTUP=$HOME/.pythonrc.py`` to + your shell profile (usually ``.bash_profile`` or ``.profile`` if you use + bash). + + """ + if READLINE_DEBUG: + logging.basicConfig( + filename='/tmp/jedi.log', + filemode='a', + level=logging.DEBUG + ) + + class JediRL(object): + def complete(self, text, state): + """ + This complete stuff is pretty weird, a generator would make + a lot more sense, but probably due to backwards compatibility + this is still the way how it works. + + The only important part is stuff in the ``state == 0`` flow, + everything else has been copied from the ``rlcompleter`` std. + library module. + """ + if state == 0: + sys.path.insert(0, os.getcwd()) + # Calling python doesn't have a path, so add to sys.path. + try: + logging.debug("Start REPL completion: " + repr(text)) + interpreter = Interpreter(text, [namespace_module.__dict__]) + + completions = interpreter.completions() + logging.debug("REPL completions: %s", completions) + + self.matches = [ + text[:len(text) - c._like_name_length] + c.name_with_symbols + for c in completions + ] + except: + logging.error("REPL Completion error:\n" + traceback.format_exc()) + raise + finally: + sys.path.pop(0) + try: + return self.matches[state] + except IndexError: + return None + + try: + # Need to import this one as well to make sure it's executed before + # this code. This didn't use to be an issue until 3.3. Starting with + # 3.4 this is different, it always overwrites the completer if it's not + # already imported here. + import rlcompleter # noqa: F401 + import readline + except ImportError: + print("Jedi: Module readline not available.") + else: + readline.set_completer(JediRL().complete) + readline.parse_and_bind("tab: complete") + # jedi itself does the case matching + readline.parse_and_bind("set completion-ignore-case on") + # because it's easier to hit the tab just once + readline.parse_and_bind("set show-all-if-unmodified") + readline.parse_and_bind("set show-all-if-ambiguous on") + # don't repeat all the things written in the readline all the time + readline.parse_and_bind("set completion-prefix-display-length 2") + # No delimiters, Jedi handles that. + readline.set_completer_delims('') + + +def version_info(): + """ + Returns a namedtuple of Jedi's version, similar to Python's + ``sys.version_info``. + """ + Version = namedtuple('Version', 'major, minor, micro') + from jedi import __version__ + tupl = re.findall(r'[a-z]+|\d+', __version__) + return Version(*[x if i == 3 else int(x) for i, x in enumerate(tupl)]) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/pytest.ini b/vim/bundle/jedi-vim/pythonx/jedi/pytest.ini new file mode 100644 index 0000000..6bb988a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/pytest.ini @@ -0,0 +1,14 @@ +[pytest] +addopts = --doctest-modules + +# Ignore broken files in blackbox test directories +norecursedirs = .* docs completion refactor absolute_import namespace_package + scripts extensions speed static_analysis not_in_sys_path + sample_venvs init_extension_module simple_import jedi/third_party + +# Activate `clean_jedi_cache` fixture for all tests. This should be +# fine as long as we are using `clean_jedi_cache` as a session scoped +# fixture. +usefixtures = clean_jedi_cache + +testpaths = jedi test diff --git a/vim/bundle/jedi-vim/pythonx/jedi/requirements.txt b/vim/bundle/jedi-vim/pythonx/jedi/requirements.txt new file mode 100644 index 0000000..00b9166 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/requirements.txt @@ -0,0 +1 @@ +parso>=0.5.0 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/scripts/diff_parser_profile.py b/vim/bundle/jedi-vim/pythonx/jedi/scripts/diff_parser_profile.py new file mode 100755 index 0000000..a152a3e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/scripts/diff_parser_profile.py @@ -0,0 +1,50 @@ +#!/usr/bin/env python +""" +Profile a piece of Python code with ``cProfile`` that uses the diff parser. + +Usage: + profile.py [-d] [-s ] + profile.py -h | --help + +Options: + -h --help Show this screen. + -d --debug Enable Jedi internal debugging. + -s Sort the profile results, e.g. cumtime, name [default: time]. +""" + +import cProfile + +from docopt import docopt +from jedi.parser.python import load_grammar +from jedi.parser.diff import DiffParser +from jedi.parser.python import ParserWithRecovery +from jedi._compatibility import u +from jedi.common import splitlines +import jedi + + +def run(parser, lines): + diff_parser = DiffParser(parser) + diff_parser.update(lines) + # Make sure used_names is loaded + parser.module.used_names + + +def main(args): + if args['--debug']: + jedi.set_debug_function(notices=True) + + with open(args['']) as f: + code = f.read() + grammar = load_grammar() + parser = ParserWithRecovery(grammar, u(code)) + # Make sure used_names is loaded + parser.module.used_names + + code = code + '\na\n' # Add something so the diff parser needs to run. + lines = splitlines(code, keepends=True) + cProfile.runctx('run(parser, lines)', globals(), locals(), sort=args['-s']) + +if __name__ == '__main__': + args = docopt(__doc__) + main(args) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/scripts/memory_check.py b/vim/bundle/jedi-vim/pythonx/jedi/scripts/memory_check.py new file mode 100755 index 0000000..7bbcad2 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/scripts/memory_check.py @@ -0,0 +1,58 @@ +#! /usr/bin/env python +""" +This is a convenience script to test the speed and memory usage of Jedi with +large libraries. + +Each library is preloaded by jedi, recording the time and memory consumed by +each operation. + +You can provide additional libraries via command line arguments. + +Note: This requires the psutil library, available on PyPI. +""" +import time +import sys +import os +import psutil +sys.path.insert(0, os.path.abspath(os.path.dirname(__file__) + '/..')) +import jedi + + +def used_memory(): + """Return the total MB of System Memory in use.""" + return psutil.virtual_memory().used / 2 ** 20 + + +def profile_preload(mod): + """Preload a module into Jedi, recording time and memory used.""" + base = used_memory() + t0 = time.time() + jedi.preload_module(mod) + elapsed = time.time() - t0 + used = used_memory() - base + return elapsed, used + + +def main(mods): + """Preload the modules, and print the time and memory used.""" + t0 = time.time() + baseline = used_memory() + print('Time (s) | Mem (MB) | Package') + print('------------------------------') + for mod in mods: + elapsed, used = profile_preload(mod) + if used > 0: + print('%8.2f | %8d | %s' % (elapsed, used, mod)) + print('------------------------------') + elapsed = time.time() - t0 + used = used_memory() - baseline + print('%8.2f | %8d | %s' % (elapsed, used, 'Total')) + + +if __name__ == '__main__': + if sys.argv[1:]: + mods = sys.argv[1:] + else: + mods = ['re', 'numpy', 'scipy', 'scipy.sparse', 'scipy.stats', + 'wx', 'decimal', 'PyQt4.QtGui', 'PySide.QtGui', 'Tkinter'] + main(mods) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/scripts/profile_output.py b/vim/bundle/jedi-vim/pythonx/jedi/scripts/profile_output.py new file mode 100755 index 0000000..27b9e9f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/scripts/profile_output.py @@ -0,0 +1,77 @@ +#!/usr/bin/env python3.6 +# -*- coding: utf-8 -*- +""" +Profile a piece of Python code with ``profile``. Tries a completion on a +certain piece of code. + +Usage: + profile.py [] [-n ] [-d] [-o] [-s ] [-i] [--precision] + profile.py -h | --help + +Options: + -h --help Show this screen. + -n Number of passes before profiling [default: 1]. + -d --debug Enable Jedi internal debugging. + -o --omit Omit profiler, just do a normal run. + -i --infer Infer types instead of completions. + -s Sort the profile results, e.g. cum, name [default: time]. + --precision Makes profile time formatting more precise (nanoseconds) +""" + +import time +try: + # For Python 2 + import cProfile as profile +except ImportError: + import profile +import pstats + +from docopt import docopt +import jedi + + +# Monkeypatch the time formatting function of profiling to make it easier to +# understand small time differences. +def f8(x): + ret = "%7.3f " % x + if ret == ' 0.000 ': + return "%6dµs" % (x * 1e6) + if ret.startswith(' 0.00'): + return "%8.4f" % x + return ret + + +def run(code, index, infer=False): + start = time.time() + script = jedi.Script(code) + if infer: + result = script.goto_definitions() + else: + result = script.completions() + print('Used %ss for the %sth run.' % (time.time() - start, index + 1)) + return result + + +def main(args): + code = args[''] + infer = args['--infer'] + n = int(args['-n']) + + for i in range(n): + run(code, i, infer=infer) + + if args['--precision']: + pstats.f8 = f8 + + jedi.set_debug_function(notices=args['--debug']) + if args['--omit']: + run(code, n, infer=infer) + else: + profile.runctx('run(code, n, infer=infer)', globals(), locals(), sort=args['-s']) + + +if __name__ == '__main__': + args = docopt(__doc__) + if args[''] is None: + args[''] = 'import numpy; numpy.array([0]).' + main(args) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/scripts/profiled_pytest.sh b/vim/bundle/jedi-vim/pythonx/jedi/scripts/profiled_pytest.sh new file mode 100755 index 0000000..b61df1c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/scripts/profiled_pytest.sh @@ -0,0 +1 @@ +python3 -m profile -s tottime $(which pytest) $@ diff --git a/vim/bundle/jedi-vim/pythonx/jedi/scripts/wx_check.py b/vim/bundle/jedi-vim/pythonx/jedi/scripts/wx_check.py new file mode 100755 index 0000000..2692f43 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/scripts/wx_check.py @@ -0,0 +1,62 @@ +#! /usr/bin/env python +""" +Depends: ``objgraph`` (third party Python library) + +``wx._core`` is a very nice module to test Jedi's speed and memory performance +on big Python modules. Its size is ~16kLOC (one file). It also seems to look +like a typical big Python modules. A mix between a lot of different Python +things. + +You can view a markup version of it here: +https://github.com/wxWidgets/wxPython/blob/master/src/gtk/_core.py +""" + +import resource +import time +import sys +try: + import urllib.request as urllib2 +except ImportError: + import urllib2 +import gc +from os.path import abspath, dirname + +import objgraph + +sys.path.insert(0, dirname(dirname(abspath(__file__)))) +import jedi + + +def process_memory(): + """ + In kB according to + https://stackoverflow.com/questions/938733/total-memory-used-by-python-process + """ + return resource.getrusage(resource.RUSAGE_SELF).ru_maxrss + + +uri = 'https://raw.githubusercontent.com/wxWidgets/wxPython/master/src/gtk/_core.py' + +wx_core = urllib2.urlopen(uri).read() + + +def run(): + start = time.time() + print('Process Memory before: %skB' % process_memory()) + # After this the module should be cached. + # Need to invent a path so that it's really cached. + jedi.Script(wx_core, path='foobar.py').completions() + + gc.collect() # make sure that it's all fair and the gc did its job. + print('Process Memory after: %skB' % process_memory()) + + print(objgraph.most_common_types(limit=50)) + print('\nIt took %s seconds to parse the file.' % (time.time() - start)) + + +print('First pass') +run() +print('\nSecond pass') +run() +print('\nThird pass') +run() diff --git a/vim/bundle/jedi-vim/pythonx/jedi/setup.cfg b/vim/bundle/jedi-vim/pythonx/jedi/setup.cfg new file mode 100644 index 0000000..1295389 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/setup.cfg @@ -0,0 +1,12 @@ +[bdist_wheel] +universal=1 + +[flake8] +max-line-length = 100 +ignore = + # do not use bare 'except' + E722, + # don't know why this was ever even an option, 1+1 should be possible. + E226, + # line break before binary operator + W503, diff --git a/vim/bundle/jedi-vim/pythonx/jedi/setup.py b/vim/bundle/jedi-vim/pythonx/jedi/setup.py new file mode 100755 index 0000000..2be6a65 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/setup.py @@ -0,0 +1,69 @@ +#!/usr/bin/env python + +from setuptools import setup, find_packages + +import os +import ast + +__AUTHOR__ = 'David Halter' +__AUTHOR_EMAIL__ = 'davidhalter88@gmail.com' + +# Get the version from within jedi. It's defined in exactly one place now. +with open('jedi/__init__.py') as f: + tree = ast.parse(f.read()) +version = tree.body[int(not hasattr(tree, 'docstring'))].value.s + +readme = open('README.rst').read() + '\n\n' + open('CHANGELOG.rst').read() +with open('requirements.txt') as f: + install_requires = f.read().splitlines() + +assert os.path.isfile("jedi/third_party/typeshed/LICENSE"), \ + "Please download the typeshed submodule first (Hint: git submodule update --init)" + +setup(name='jedi', + version=version, + description='An autocompletion tool for Python that can be used for text editors.', + author=__AUTHOR__, + author_email=__AUTHOR_EMAIL__, + include_package_data=True, + maintainer=__AUTHOR__, + maintainer_email=__AUTHOR_EMAIL__, + url='https://github.com/davidhalter/jedi', + license='MIT', + keywords='python completion refactoring vim', + long_description=readme, + packages=find_packages(exclude=['test', 'test.*']), + python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*', + install_requires=install_requires, + extras_require={ + 'testing': [ + # Pytest 5 doesn't support Python 2 and Python 3.4 anymore. + 'pytest>=3.1.0,<5.0.0', + # docopt for sith doctests + 'docopt', + # coloroma for colored debug output + 'colorama', + ], + }, + package_data={'jedi': ['*.pyi', 'third_party/typeshed/LICENSE', + 'third_party/typeshed/README']}, + platforms=['any'], + classifiers=[ + 'Development Status :: 4 - Beta', + 'Environment :: Plugins', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: MIT License', + 'Operating System :: OS Independent', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'Topic :: Software Development :: Libraries :: Python Modules', + 'Topic :: Text Editors :: Integrated Development Environments (IDE)', + 'Topic :: Utilities', + ], + ) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/sith.py b/vim/bundle/jedi-vim/pythonx/jedi/sith.py new file mode 100755 index 0000000..17c6546 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/sith.py @@ -0,0 +1,224 @@ +#!/usr/bin/env python + +""" +Sith attacks (and helps debugging) Jedi. + +Randomly search Python files and run Jedi on it. Exception and used +arguments are recorded to ``./record.json`` (specified by --record):: + + ./sith.py random /path/to/sourcecode + +Redo recorded exception:: + + ./sith.py redo + +Show recorded exception:: + + ./sith.py show + +Run a specific operation + + ./sith.py run + +Where operation is one of completions, goto_assignments, goto_definitions, +usages, or call_signatures. + +Note: Line numbers start at 1; columns start at 0 (this is consistent with +many text editors, including Emacs). + +Usage: + sith.py [--pdb|--ipdb|--pudb] [-d] [-n=] [-f] [--record=] random [-s] [] + sith.py [--pdb|--ipdb|--pudb] [-d] [-f] [--record=] redo + sith.py [--pdb|--ipdb|--pudb] [-d] [-f] run + sith.py show [--record=] + sith.py -h | --help + +Options: + -h --help Show this screen. + --record= Exceptions are recorded in here [default: record.json]. + -f, --fs-cache By default, file system cache is off for reproducibility. + -n, --maxtries= Maximum of random tries [default: 100] + -d, --debug Jedi print debugging when an error is raised. + -s Shows the path/line numbers of every completion before it starts. + --pdb Launch pdb when error is raised. + --ipdb Launch ipdb when error is raised. + --pudb Launch pudb when error is raised. +""" + +from __future__ import print_function, division, unicode_literals +from docopt import docopt + +import json +import os +import random +import sys +import traceback + +import jedi + + +class SourceFinder(object): + _files = None + + @staticmethod + def fetch(file_path): + if not os.path.isdir(file_path): + yield file_path + return + for root, dirnames, filenames in os.walk(file_path): + for name in filenames: + if name.endswith('.py'): + yield os.path.join(root, name) + + @classmethod + def files(cls, file_path): + if cls._files is None: + cls._files = list(cls.fetch(file_path)) + return cls._files + + +class TestCase(object): + def __init__(self, operation, path, line, column, traceback=None): + if operation not in self.operations: + raise ValueError("%s is not a valid operation" % operation) + + # Set other attributes + self.operation = operation + self.path = path + self.line = line + self.column = column + self.traceback = traceback + + @classmethod + def from_cache(cls, record): + with open(record) as f: + args = json.load(f) + return cls(*args) + + operations = [ + 'completions', 'goto_assignments', 'goto_definitions', 'usages', + 'call_signatures'] + + @classmethod + def generate(cls, file_path): + operation = random.choice(cls.operations) + + path = random.choice(SourceFinder.files(file_path)) + with open(path) as f: + source = f.read() + lines = source.splitlines() + + if not lines: + lines = [''] + line = random.randint(1, len(lines)) + line_string = lines[line - 1] + line_len = len(line_string) + if line_string.endswith('\r\n'): + line_len -= 1 + if line_string.endswith('\n'): + line_len -= 1 + column = random.randint(0, line_len) + return cls(operation, path, line, column) + + def run(self, debugger, record=None, print_result=False): + try: + with open(self.path) as f: + self.script = jedi.Script(f.read(), self.line, self.column, self.path) + kwargs = {} + if self.operation == 'goto_assignments': + kwargs['follow_imports'] = random.choice([False, True]) + + self.objects = getattr(self.script, self.operation)(**kwargs) + if print_result: + print("{path}: Line {line} column {column}".format(**self.__dict__)) + self.show_location(self.line, self.column) + self.show_operation() + except Exception: + self.traceback = traceback.format_exc() + if record is not None: + call_args = (self.operation, self.path, self.line, self.column, self.traceback) + with open(record, 'w') as f: + json.dump(call_args, f) + self.show_errors() + if debugger: + einfo = sys.exc_info() + pdb = __import__(debugger) + if debugger == 'pudb': + pdb.post_mortem(einfo[2], einfo[0], einfo[1]) + else: + pdb.post_mortem(einfo[2]) + exit(1) + + def show_location(self, lineno, column, show=3): + # Three lines ought to be enough + lower = lineno - show if lineno - show > 0 else 0 + prefix = ' |' + for i, line in enumerate(self.script._source.split('\n')[lower:lineno]): + print(prefix, lower + i + 1, line) + print(prefix, ' ', ' ' * (column + len(str(lineno))), '^') + + def show_operation(self): + print("%s:\n" % self.operation.capitalize()) + if self.operation == 'completions': + self.show_completions() + else: + self.show_definitions() + + def show_completions(self): + for completion in self.objects: + print(completion.name) + + def show_definitions(self): + for completion in self.objects: + print(completion.desc_with_module) + if completion.module_path is None: + continue + if os.path.abspath(completion.module_path) == os.path.abspath(self.path): + self.show_location(completion.line, completion.column) + + def show_errors(self): + sys.stderr.write(self.traceback) + print(("Error with running Script(...).{operation}() with\n" + "\tpath: {path}\n" + "\tline: {line}\n" + "\tcolumn: {column}").format(**self.__dict__)) + + +def main(arguments): + debugger = 'pdb' if arguments['--pdb'] else \ + 'ipdb' if arguments['--ipdb'] else \ + 'pudb' if arguments['--pudb'] else None + record = arguments['--record'] + + jedi.settings.use_filesystem_cache = arguments['--fs-cache'] + if arguments['--debug']: + jedi.set_debug_function() + + if arguments['redo'] or arguments['show']: + t = TestCase.from_cache(record) + if arguments['show']: + t.show_errors() + else: + t.run(debugger) + elif arguments['run']: + TestCase( + arguments[''], arguments[''], + int(arguments['']), int(arguments['']) + ).run(debugger, print_result=True) + else: + for _ in range(int(arguments['--maxtries'])): + t = TestCase.generate(arguments[''] or '.') + if arguments['-s']: + print('%s %s %s %s ' % (t.operation, t.path, t.line, t.column)) + sys.stdout.flush() + else: + print('.', end='') + t.run(debugger, record) + + sys.stdout.flush() + print() + + +if __name__ == '__main__': + arguments = docopt(__doc__) + main(arguments) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/__init__.py b/vim/bundle/jedi-vim/pythonx/jedi/test/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/blabla_test_documentation.py b/vim/bundle/jedi-vim/pythonx/jedi/test/blabla_test_documentation.py new file mode 100644 index 0000000..7f6c478 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/blabla_test_documentation.py @@ -0,0 +1,29 @@ +def test_keyword_doc(Script): + r = list(Script("or", 1, 1).goto_definitions()) + assert len(r) == 1 + assert len(r[0].doc) > 100 + + r = list(Script("asfdasfd", 1, 1).goto_definitions()) + assert len(r) == 0 + + k = Script("fro").completions()[0] + imp_start = '\nThe ``import' + assert k.raw_doc.startswith(imp_start) + assert k.doc.startswith(imp_start) + + +def test_blablabla(Script): + defs = Script("import").goto_definitions() + assert len(defs) == 1 and [1 for d in defs if d.doc] + # unrelated to #44 + + +def test_operator_doc(Script): + r = list(Script("a == b", 1, 3).goto_definitions()) + assert len(r) == 1 + assert len(r[0].doc) > 100 + + +def test_lambda(Script): + defs = Script('lambda x: x', column=0).goto_definitions() + assert [d.type for d in defs] == ['keyword'] diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/__init__.py b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/__init__.py new file mode 100644 index 0000000..dc4d725 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/__init__.py @@ -0,0 +1,8 @@ +""" needed for some modules to test against packages. """ + +some_variable = 1 + + +from . import imports +#? int() +imports.relative() diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/arrays.py b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/arrays.py new file mode 100644 index 0000000..0a5d433 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/arrays.py @@ -0,0 +1,475 @@ +# ----------------- +# basic array lookups +# ----------------- + + +#? int() +[1,""][0] +#? str() +[1,""][1] +#? int() str() +[1,""][2] +#? int() str() +[1,""][20] +#? int() str() +[1,""][str(hello)] + +a = list() +#? list() +[a][0] + +#? list() +[[a,a,a]][2][100] + +c = [[a,""]] +#? str() +c[0][1] + +b = [6,7] + +#? int() +b[8-7] +# Something unreasonable: +#? int() +b[''] + +# ----------------- +# Slices +# ----------------- +#? list() +b[8:] + +#? list() +b[int():] + +#? list() +b[:] + +#? int() +b[:, 1] +#? int() +b[:1, 1] +#? int() +b[1:1, 1] +#? int() +b[1:1:, ...] +#? int() +b[1:1:5, ...] + +class _StrangeSlice(): + def __getitem__(self, sliced): + return sliced + +# Should not result in an error, just because the slice itself is returned. +#? slice() +_StrangeSlice()[1:2] + + +# ----------------- +# iterable multiplication +# ----------------- +a = ['']*2 +#? list() +a + +# ----------------- +# tuple assignments +# ----------------- +a1, b1 = (1, "") +#? int() +a1 +#? str() +b1 + +(a2, b2) = (1, "") +#? int() +a2 +#? str() +b2 + +# list assignment +[list1, list2] = (1, "") +#? int() +list1 +#? str() +list2 + +[list3, list4] = [1, ""] +#? int() +list3 +#? str() +list4 + +# ----------------- +# subtuple assignment +# ----------------- +(a3, (b3, c3)) = (1, ("", list)) +#? list +c3 + +a4, (b4, c4) = (1, ("", list)) +#? list +c4 +#? int() +a4 +#? str() +b4 + + +# ----------------- +# multiple assignments +# ----------------- +a = b = 1 +#? int() +a +#? int() +b + +(a, b) = (c, (e, f)) = ('2', (3, 4)) +#? str() +a +#? tuple() +b +#? str() +c +#? int() +e +#? int() +f + + +# ----------------- +# unnessecary braces +# ----------------- +a = (1) +#? int() +a +#? int() +(1) +#? int() +((1)) +#? int() +((1)+1) + +u, v = 1, "" +#? int() +u + +((u1, v1)) = 1, "" +#? int() +u1 +#? int() +(u1) + +(a), b = 1, '' +#? int() +a + +def a(): return '' +#? str() +(a)() +#? str() +(a)().title() +#? int() +(tuple).index() +#? int() +(tuple)().index() + +class C(): + def __init__(self): + self.a = (str()).upper() + +#? str() +C().a + +# ----------------- +# imbalanced sides +# ----------------- +(f, g) = (1,) +#? int() +f +#? [] +g. + +(f, g, h) = (1,'') +#? int() +f +#? str() +g +#? [] +h. + +(f1, g1) = 1 +#? [] +f1. +#? [] +g1. + +(f, g) = (1,'',1.0) +#? int() +f +#? str() +g + +# ----------------- +# dicts +# ----------------- +dic2 = {'asdf': 3, 'b': 'str'} +#? int() +dic2['asdf'] +#? None int() str() +dic2.get('asdf') + +# string literal +#? int() +dic2[r'asdf'] +#? int() +dic2[r'asdf'] +#? int() +dic2[r'as' 'd' u'f'] +#? int() str() +dic2['just_something'] + +# unpacking +a, b = dic2 +#? str() +a +a, b = {1: 'x', 2.0: 1j} +#? int() float() +a +#? int() float() +b + + +def f(): + """ github #83 """ + r = {} + r['status'] = (200, 'ok') + return r + +#? dict() +f() + +# completion within dicts +#? 9 ['str'] +{str: str} + +# iteration problem (detected with sith) +d = dict({'a':''}) +def y(a): + return a +#? +y(**d) + +# problem with more complicated casts +dic = {str(key): ''} +#? str() +dic[''] + + +for x in {1: 3.0, '': 1j}: + #? int() str() + x + +#? ['__iter__'] +dict().values().__iter__ + +d = dict(a=3, b='') +x, = d.values() +#? int() str() +x +#? int() str() +d['a'] +#? int() str() None +d.get('a') + +# ----------------- +# with variable as index +# ----------------- +a = (1, "") +index = 1 +#? str() +a[index] + +# these should just ouput the whole array +index = int +#? int() str() +a[index] +index = int() +#? int() str() +a[index] + +# dicts +index = 'asdf' + +dic2 = {'asdf': 3, 'b': 'str'} +#? int() +dic2[index] + +# ----------------- +# __getitem__ +# ----------------- + +class GetItem(): + def __getitem__(self, index): + return 1.0 + +#? float() +GetItem()[0] + +class GetItem(): + def __init__(self, el): + self.el = el + + def __getitem__(self, index): + return self.el + +#? str() +GetItem("")[1] + +class GetItemWithList(): + def __getitem__(self, index): + return [1, 1.0, 's'][index] + +#? float() +GetItemWithList()[1] + +for i in 0, 2: + #? int() str() + GetItemWithList()[i] + + +# With super +class SuperYeah(list): + def __getitem__(self, index): + return super()[index] + +#? +SuperYeah([1])[0] +#? +SuperYeah()[0] + +# ----------------- +# conversions +# ----------------- + +a = [1, ""] +#? int() str() +list(a)[1] + +#? int() str() +list(a)[0] +#? +set(a)[0] + +#? int() str() +list(set(a))[1] +#? int() str() +next(iter(set(a))) +#? int() str() +list(list(set(a)))[1] + +# does not yet work, because the recursion catching is not good enough (catches # to much) +#? int() str() +list(set(list(set(a))))[1] +#? int() str() +list(set(set(a)))[1] + +# frozenset +#? int() str() +list(frozenset(a))[1] +#? int() str() +list(set(frozenset(a)))[1] + +# iter +#? int() str() +list(iter(a))[1] +#? int() str() +list(iter(list(set(a))))[1] + +# tuple +#? int() str() +tuple(a)[1] +#? int() str() +tuple(list(set(a)))[1] + +#? int() +tuple((1,))[0] + +# implementation detail for lists, should not be visible +#? [] +list().__iterable + +# With a list comprehension. +for i in set(a for a in [1]): + #? int() + i + + +# ----------------- +# Merged Arrays +# ----------------- + +for x in [1] + ['']: + #? int() str() + x + +# ----------------- +# Potential Recursion Issues +# ----------------- +class X(): + def y(self): + self.a = [1] + + def x(self): + self.a = list(self.a) + #? int() + self.a[0] + +# ----------------- +# For loops with attribute assignment. +# ----------------- +def test_func(): + x = 'asdf' + for x.something in [6,7,8]: + pass + #? str() + x + + for x.something, b in [[6, 6.0]]: + pass + #? str() + x + + +#? int() +tuple({1})[0] + +# python >= 3.4 +# ----------------- +# PEP 3132 Extended Iterable Unpacking (star unpacking) +# ----------------- + +a, *b, c = [1, 'b', list, dict] +#? int() +a +#? +b +#? list +c + +# Not valid syntax +a, *b, *c = [1, 'd', list] +#? int() +a +#? +b +#? +c + +lc = [x for a, *x in [(1, '', 1.0)]] + +#? +lc[0][0] +#? +lc[0][1] diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/async_.py b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/async_.py new file mode 100644 index 0000000..e77a290 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/async_.py @@ -0,0 +1,109 @@ +""" +Tests for all async use cases. + +Currently we're not supporting completion of them, but they should at least not +raise errors or return extremely strange results. +""" + +# python >= 3.5 + +async def x(): + return 1 + +#? [] +x.cr_awai + +#? ['cr_await'] +x().cr_awai + +a = await x() +#? int() +a + +async def y(): + argh = await x() + #? int() + argh + #? ['__next__'] + x().__await__().__next + return 2 + +async def x2(): + async with open('asdf') as f: + #? ['readlines'] + f.readlines + +class A(): + @staticmethod + async def b(c=1, d=2): + return 1 + +#! 9 ['def b'] +await A.b() + +#! 11 ['param d=2'] +await A.b(d=3) + +class Awaitable: + def __await__(self): + yield None + return '' + +async def awaitable_test(): + foo = await Awaitable() + #? str() + foo + +# python >= 3.6 + +async def asgen(): + yield 1 + await asyncio.sleep(0) + yield 2 + +async def wrapper(): + #? int() + [x async for x in asgen()][0] + + async for y in asgen(): + #? int() + y + +#? ['__anext__'] +asgen().__ane +#? [] +asgen().mro + + +# Normal completion (#1092) +normal_var1 = 42 + +async def foo(): + normal_var2 = False + #? ['normal_var1', 'normal_var2'] + normal_var + + +class C: + @classmethod + async def async_for_classmethod(cls) -> "C": + return + + async def async_for_method(cls) -> int: + return + + +async def f(): + c = await C.async_for_method() + #? int() + c + d = await C().async_for_method() + #? int() + d + + e = await C.async_for_classmethod() + #? C() + e + f = await C().async_for_classmethod() + #? C() + f diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/basic.py b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/basic.py new file mode 100644 index 0000000..91e7f33 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/basic.py @@ -0,0 +1,328 @@ +# ----------------- +# cursor position +# ----------------- +#? 0 int +int() +#? 3 int +int() +#? 4 str +int(str) + + +# ----------------- +# should not complete +# ----------------- +#? [] +. +#? [] +str.. +#? [] +a(0):. +#? 2 [] +0x0 +#? [] +1j +#? ['and', 'or', 'if', 'is', 'in', 'not'] +1j +x = None() +#? +x + +# ----------------- +# if/else/elif +# ----------------- + +if (random.choice([0, 1])): + 1 +elif(random.choice([0, 1])): + a = 3 +else: + a = '' +#? int() str() +a +def func(): + if random.choice([0, 1]): + 1 + elif(random.choice([0, 1])): + a = 3 + else: + a = '' + #? int() str() + return a +#? int() str() +func() + +# ----------------- +# keywords +# ----------------- + +#? list() +assert [] + +def focus_return(): + #? list() + return [] + + +# ----------------- +# for loops +# ----------------- + +for a in [1,2]: + #? int() + a + +for a1 in 1,"": + #? int() str() + a1 + +for a3, b3 in (1,""), (1,""), (1,""): + #? int() + a3 + #? str() + b3 +for (a3, b3) in (1,""), (1,""), (1,""): + #? int() + a3 + #? str() + b3 + +for a4, (b4, c4) in (1,("", list)), (1,("", list)): + #? int() + a4 + #? str() + b4 + #? list + c4 + +a = [] +for i in [1,'']: + #? int() str() + i + a += [i] + +#? int() str() +a[0] + +for i in list([1,'']): + #? int() str() + i + +#? int() str() +for x in [1,'']: x + +a = [] +b = [1.0,''] +for i in b: + a += [i] + +#? float() str() +a[0] + +for i in [1,2,3]: + #? int() + i +else: + i + + +# ----------------- +# range() +# ----------------- +for i in range(10): + #? int() + i + +# ----------------- +# ternary operator +# ----------------- + +a = 3 +b = '' if a else set() +#? str() set() +b + +def ret(a): + return ['' if a else set()] + +#? str() set() +ret(1)[0] +#? str() set() +ret()[0] + +# ----------------- +# global vars +# ----------------- + +def global_define(): + #? int() + global global_var_in_func + global_var_in_func = 3 + +#? int() +global_var_in_func + +#? ['global_var_in_func'] +global_var_in_f + + +def funct1(): + # From issue #610 + global global_dict_var + global_dict_var = dict() +def funct2(): + #! ['global_dict_var', 'global_dict_var'] + global global_dict_var + #? dict() + global_dict_var + + +global_var_predefined = None + +def init_global_var_predefined(): + global global_var_predefined + if global_var_predefined is None: + global_var_predefined = 3 + +#? int() None +global_var_predefined + + +# ----------------- +# within docstrs +# ----------------- + +def a(): + """ + #? ['global_define'] + global_define + """ + pass + +#? +# str literals in comment """ upper + +def completion_in_comment(): + #? ['Exception'] + # might fail because the comment is not a leaf: Exception + pass + +some_word +#? ['Exception'] +# Very simple comment completion: Exception +# Commment after it + +# ----------------- +# magic methods +# ----------------- + +class A(object): pass +class B(): pass + +#? ['__init__'] +A.__init__ +#? ['__init__'] +B.__init__ + +#? ['__init__'] +int().__init__ + +# ----------------- +# comments +# ----------------- + +class A(): + def __init__(self): + self.hello = {} # comment shouldn't be a string +#? dict() +A().hello + +# ----------------- +# unicode +# ----------------- +a = 'smörbröd' +#? str() +a +xyz = 'smörbröd.py' +if 1: + #? str() + xyz + +#? +¹. + +# ----------------- +# exceptions +# ----------------- +try: + import math +except ImportError as i_a: + #? ['i_a'] + i_a + #? ImportError() + i_a +try: + import math +except ImportError, i_b: + # TODO check this only in Python2 + ##? ['i_b'] + i_b + ##? ImportError() + i_b + + +class MyException(Exception): + def __init__(self, my_attr): + self.my_attr = my_attr + +try: + raise MyException(1) +except MyException as e: + #? ['my_attr'] + e.my_attr + #? 22 ['my_attr'] + for x in e.my_attr: + pass + + +# ----------------- +# continuations +# ----------------- + +foo = \ +1 +#? int() +foo + +# ----------------- +# module attributes +# ----------------- + +# Don't move this to imports.py, because there's a star import. +#? str() +__file__ +#? ['__file__'] +__file__ + +#? str() +math.__file__ +# Should not lead to errors +#? +math() + +# ----------------- +# with statements +# ----------------- + +with open('') as f: + #? ['closed'] + f.closed + for line in f: + #? str() bytes() + line + +with open('') as f1, open('') as f2: + #? ['closed'] + f1.closed + #? ['closed'] + f2.closed diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/classes.py b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/classes.py new file mode 100644 index 0000000..6ab4031 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/classes.py @@ -0,0 +1,604 @@ +def find_class(): + """ This scope is special, because its in front of TestClass """ + #? ['ret'] + TestClass.ret + if 1: + #? ['ret'] + TestClass.ret + +class FindClass(): + #? [] + TestClass.ret + if a: + #? [] + TestClass.ret + + def find_class(self): + #? ['ret'] + TestClass.ret + if 1: + #? ['ret'] + TestClass.ret + +#? [] +FindClass().find_class.self +#? [] +FindClass().find_class.self.find_class + +# set variables, which should not be included, because they don't belong to the +# class +second = 1 +second = "" +class TestClass(object): + var_class = TestClass(1) + + def __init__(self2, first_param, second_param, third=1.0): + self2.var_inst = first_param + self2.second = second_param + self2.first = first_param + self2.first.var_on_argument = 5 + a = 3 + + def var_func(self): + return 1 + + def get_first(self): + # traversal + self.second_new = self.second + return self.var_inst + + def values(self): + self.var_local = 3 + #? ['var_class', 'var_func', 'var_inst', 'var_local'] + self.var_ + #? + var_local + + def ret(self, a1): + # should not know any class functions! + #? [] + values + #? + values + #? ['return'] + ret + return a1 + +# should not work +#? [] +var_local +#? [] +var_inst +#? [] +var_func + +# instance +inst = TestClass(1) + +#? ['var_class', 'var_func', 'var_inst', 'var_local'] +inst.var + +#? ['var_class', 'var_func'] +TestClass.var + +#? int() +inst.var_local +#? [] +TestClass.var_local. + +#? int() +TestClass().ret(1) +# Should not return int(), because we want the type before `.ret(1)`. +#? 11 TestClass() +TestClass().ret(1) +#? int() +inst.ret(1) + +myclass = TestClass(1, '', 3.0) +#? int() +myclass.get_first() +#? [] +myclass.get_first.real + +# too many params +#? int() +TestClass(1,1,1).var_inst + +# too few params +#? int() +TestClass(1).first +#? [] +TestClass(1).second. + +# complicated variable settings in class +#? str() +myclass.second +#? str() +myclass.second_new + +# multiple classes / ordering +ints = TestClass(1, 1.0) +strs = TestClass("", '') +#? float() +ints.second +#? str() +strs.second + +#? ['var_class'] +TestClass.var_class.var_class.var_class.var_class + +# operations (+, *, etc) shouldn't be InstanceElements - #246 +class A(): + def __init__(self): + self.addition = 1 + 2 +#? int() +A().addition + +# should also work before `=` +#? 8 int() +A().addition = None +#? 8 int() +A(1).addition = None +#? 1 A +A(1).addition = None +a = A() +#? 8 int() +a.addition = None + + +# ----------------- +# inheritance +# ----------------- + +class Base(object): + def method_base(self): + return 1 + +class SuperClass(Base): + class_super = 3 + def __init__(self): + self.var_super = '' + def method_super(self): + self.var2_super = list + +class Mixin(SuperClass): + def method_mixin(self): + return int + +#? 20 SuperClass +class SubClass(SuperClass): + class_sub = 3 + def __init__(self): + self.var_sub = '' + def method_sub(self): + self.var_sub = list + return tuple + +instance = SubClass() + +#? ['method_base', 'method_sub', 'method_super'] +instance.method_ +#? ['var2_super', 'var_sub', 'var_super'] +instance.var +#? ['class_sub', 'class_super'] +instance.class_ + +#? ['method_base', 'method_sub', 'method_super'] +SubClass.method_ +#? [] +SubClass.var +#? ['class_sub', 'class_super'] +SubClass.class_ + +# ----------------- +# inheritance of builtins +# ----------------- + +class Base(str): + pass + +#? ['upper'] +Base.upper +#? ['upper'] +Base().upper + +# ----------------- +# dynamic inheritance +# ----------------- + +class Angry(object): + def shout(self): + return 'THIS IS MALARKEY!' + +def classgetter(): + return Angry + +class Dude(classgetter()): + def react(self): + #? ['shout'] + self.s + +# ----------------- +# multiple inheritance # 1071 +# ----------------- + +class FactorMixin(object): + FACTOR_1 = 0.1 + +class Calc(object): + def sum(self, a, b): + self.xxx = 3 + return a + b + +class BetterCalc(Calc, FactorMixin): + def multiply_factor(self, a): + return a * self.FACTOR_1 + +calc = BetterCalc() +#? ['sum'] +calc.sum +#? ['multiply_factor'] +calc.multip +#? ['FACTOR_1'] +calc.FACTOR_1 +#? ['xxx'] +calc.xxx + +# ----------------- +# __call__ +# ----------------- + +class CallClass(): + def __call__(self): + return 1 + +#? int() +CallClass()() + +# ----------------- +# variable assignments +# ----------------- + +class V: + def __init__(self, a): + self.a = a + + def ret(self): + return self.a + + d = b + b = ret + if 1: + c = b + +#? int() +V(1).b() +#? int() +V(1).c() +#? +V(1).d() +# Only keywords should be possible to complete. +#? ['is', 'in', 'not', 'and', 'or', 'if'] +V(1).d() + + +# ----------------- +# ordering +# ----------------- +class A(): + def b(self): + #? int() + a_func() + #? str() + self.a_func() + return a_func() + + def a_func(self): + return "" + +def a_func(): + return 1 + +#? int() +A().b() +#? str() +A().a_func() + +# ----------------- +# nested classes +# ----------------- +class A(): + class B(): + pass + def b(self): + return 1.0 + +#? float() +A().b() + +class A(): + def b(self): + class B(): + def b(self): + return [] + return B().b() + +#? list() +A().b() + +# ----------------- +# ducktyping +# ----------------- + +def meth(self): + return self.a, self.b + +class WithoutMethod(): + a = 1 + def __init__(self): + self.b = 1.0 + def blub(self): + return self.b + m = meth + +class B(): + b = '' + +a = WithoutMethod().m() +#? int() +a[0] +#? float() +a[1] + +#? float() +WithoutMethod.blub(WithoutMethod()) +#? str() +WithoutMethod.blub(B()) + +# ----------------- +# __getattr__ / getattr() / __getattribute__ +# ----------------- + +#? str().upper +getattr(str(), 'upper') +#? str.upper +getattr(str, 'upper') + +# some strange getattr calls +#? +getattr(str, 1) +#? +getattr() +#? +getattr(str) +#? +getattr(getattr, 1) +#? +getattr(str, []) + + +class Base(): + def ret(self, b): + return b + +class Wrapper(): + def __init__(self, obj): + self.obj = obj + + def __getattr__(self, name): + return getattr(self.obj, name) + +class Wrapper2(): + def __getattribute__(self, name): + return getattr(Base(), name) + +#? int() +Wrapper(Base()).ret(3) + +#? int() +Wrapper2(Base()).ret(3) + +class GetattrArray(): + def __getattr__(self, name): + return [1] + +#? int() +GetattrArray().something[0] + + +# ----------------- +# private vars +# ----------------- +class PrivateVar(): + def __init__(self): + self.__var = 1 + #? int() + self.__var + #? ['__var'] + self.__var + + def __private_func(self): + return 1 + + #? int() + __private_func() + + def wrap_private(self): + return self.__private_func() +#? [] +PrivateVar().__var +#? +PrivateVar().__var +#? [] +PrivateVar().__private_func +#? [] +PrivateVar.__private_func +#? int() +PrivateVar().wrap_private() + + +class PrivateSub(PrivateVar): + def test(self): + #? [] + self.__var + + def wrap_private(self): + #? [] + self.__var + +#? [] +PrivateSub().__var + +# ----------------- +# super +# ----------------- +class Super(object): + a = 3 + def return_sup(self): + return 1 +SuperCopy = Super + +class TestSuper(Super): + #? + super() + def test(self): + #? SuperCopy() + super() + #? ['a'] + super().a + if 1: + #? SuperCopy() + super() + def a(): + #? + super() + + def return_sup(self): + #? int() + return super().return_sup() + +#? int() +TestSuper().return_sup() + + +Super = 3 + +class Foo(): + def foo(self): + return 1 +# Somehow overwriting the same name caused problems (#1044) +class Foo(Foo): + def foo(self): + #? int() + super().foo() + +# ----------------- +# if flow at class level +# ----------------- +class TestX(object): + def normal_method(self): + return 1 + + if True: + def conditional_method(self): + var = self.normal_method() + #? int() + var + return 2 + + def other_method(self): + var = self.conditional_method() + #? int() + var + +# ----------------- +# mro method +# ----------------- + +class A(object): + a = 3 + +#? ['mro'] +A.mro +#? [] +A().mro + + +# ----------------- +# mro resolution +# ----------------- + +class B(A()): + b = 3 + +#? +B.a +#? +B().a +#? int() +B.b +#? int() +B().b + + +# ----------------- +# With import +# ----------------- + +from import_tree.classes import Config2, BaseClass + +class Config(BaseClass): + """#884""" + +#? Config2() +Config.mode + +#? int() +Config.mode2 + + +# ----------------- +# Nested class/def/class +# ----------------- +class Foo(object): + a = 3 + def create_class(self): + class X(): + a = self.a + self.b = 3.0 + return X + +#? int() +Foo().create_class().a +#? float() +Foo().b + +class Foo(object): + def comprehension_definition(self): + return [1 for self.b in [1]] + +#? int() +Foo().b + +# ----------------- +# default arguments +# ----------------- + +default = '' +class DefaultArg(): + default = 3 + def x(self, arg=default): + #? str() + default + return arg + def y(self): + return default + +#? int() +DefaultArg().x() +#? str() +DefaultArg().y() +#? int() +DefaultArg.x() +#? str() +DefaultArg.y() diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/completion.py b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/completion.py new file mode 100644 index 0000000..6700fa6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/completion.py @@ -0,0 +1,50 @@ +""" +Special cases of completions (typically special positions that caused issues +with context parsing. +""" + +def pass_decorator(func): + return func + + +def x(): + return ( + 1, +#? ["tuple"] +tuple + ) + + # Comment just somewhere + + +class MyClass: + @pass_decorator + def x(foo, +#? 5 ["tuple"] +tuple, + ): + return 1 + + +if x: + pass +#? ['else'] +else + +try: + pass +#? ['except', 'Exception'] +except + +try: + pass +#? 6 ['except', 'Exception'] +except AttributeError: + pass +#? ['finally'] +finally + +for x in y: + pass +#? ['else'] +else diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/complex.py b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/complex.py new file mode 100644 index 0000000..e8327f8 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/complex.py @@ -0,0 +1,37 @@ +""" Mostly for stupid error reports of @dbrgn. :-) """ + +import time + +class Foo(object): + global time + asdf = time + +def asdfy(): + return Foo + +xorz = getattr(asdfy()(), 'asdf') +#? time +xorz + + + +def args_returner(*args): + return args + + +#? tuple() +args_returner(1)[:] +#? int() +args_returner(1)[:][0] + + +def kwargs_returner(**kwargs): + return kwargs + + +# TODO This is not really correct, needs correction probably at some point, but +# at least it doesn't raise an error. +#? int() +kwargs_returner(a=1)[:] +#? +kwargs_returner(b=1)[:][0] diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/comprehensions.py b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/comprehensions.py new file mode 100644 index 0000000..5a4c0a7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/comprehensions.py @@ -0,0 +1,258 @@ +# ----------------- +# list comprehensions +# ----------------- + +# basics: + +a = ['' for a in [1]] +#? str() +a[0] +#? ['insert'] +a.insert + +a = [a for a in [1]] +#? int() +a[0] + +y = 1.0 +# Should not leak. +[y for y in [3]] +#? float() +y + +a = [a for a in (1, 2)] +#? int() +a[0] + +a = [a for a,b in [(1,'')]] +#? int() +a[0] +a = [a for (a,b) in [(1,'')]] +#? int() +a[0] + +arr = [1,''] +a = [a for a in arr] +#? int() +a[0] +#? str() +a[1] +#? int() str() +a[2] + +a = [a if 1.0 else '' for a in [1] if [1.0]] +#? int() str() +a[0] + +# name resolve should be correct +left, right = 'a', 'b' +left, right = [x for x in (left, right)] +#? str() +left + +# with a dict literal +#? int() +[a for a in {1:'x'}][0] + +# list comprehensions should also work in combination with functions +def _listen(arg): + for x in arg: + #? str() + x + +_listen(['' for x in [1]]) +#? +([str for x in []])[0] + +# ----------------- +# nested list comprehensions +# ----------------- + +b = [a for arr in [[1, 1.0]] for a in arr] +#? int() +b[0] +#? float() +b[1] + +b = [arr for arr in [[1, 1.0]] for a in arr] +#? int() +b[0][0] +#? float() +b[1][1] + +b = [a for arr in [[1]] if '' for a in arr if ''] +#? int() +b[0] + +b = [b for arr in [[[1.0]]] for a in arr for b in a] +#? float() +b[0] + +#? str() +[x for x in 'chr'][0] + +# jedi issue #26 +#? list() +a = [[int(v) for v in line.strip().split() if v] for line in ["123", str(), "123"] if line] +#? list() +a[0] +#? int() +a[0][0] + +# ----------------- +# generator comprehensions +# ----------------- + +left, right = (i for i in (1, '')) + +#? int() +left +#? str() +right + +gen = (i for i in (1,)) + +#? int() +next(gen) +#? +gen[0] + +gen = (a for arr in [[1.0]] for a in arr) +#? float() +next(gen) + +#? int() +(i for i in (1,)).send() + +# issues with different formats +left, right = (i for i in + ('1', 2)) +#? str() +left +#? int() +right + +# ----------------- +# name resolution in comprehensions. +# ----------------- + +def x(): + """Should not try to resolve to the if hio, which was a bug.""" + #? 22 + [a for a in h if hio] + if hio: pass + +# ----------------- +# slices +# ----------------- + +#? list() +foo = [x for x in [1, '']][:1] +#? int() +foo[0] +#? str() +foo[1] + +# ----------------- +# In class +# ----------------- + +class X(): + def __init__(self, bar): + self.bar = bar + + def foo(self): + x = [a for a in self.bar][0] + #? int() + x + return x + +#? int() +X([1]).foo() + +# set/dict comprehensions were introduced in 2.7, therefore: +# python >= 2.7 +# ----------------- +# dict comprehensions +# ----------------- + +#? int() +list({a - 1: 3 for a in [1]})[0] + +d = {a - 1: b for a, b in {1: 'a', 3: 1.0}.items()} +#? int() +list(d)[0] +#? str() float() +d.values()[0] +#? str() +d[0] +#? float() str() +d[1] +#? float() +d[2] + +# ----------------- +# set comprehensions +# ----------------- + +#? set() +{a - 1 for a in [1]} + +#? set() +{a for a in range(10)} + +#? int() +[x for x in {a for a in range(10)}][0] + +#? int() +{a for a in range(10)}.pop() +#? float() str() +{b for a in [[3.0], ['']] for b in a}.pop() + +#? int() +next(iter({a for a in range(10)})) + + +#? int() +[a for a in {1, 2, 3}][0] + +# ----------------- +# syntax errors +# ----------------- + +# Issue #1146 + +#? ['list'] +[int(str(x.value) for x in list + +def reset_missing_bracket(): pass + + +# ----------------- +# function calls +# ----------------- + +def foo(arg): + return arg + + +x = foo(x for x in [1]) + +#? int() +next(x) +#? +x[0] + +# While it's illegal to have more than one argument, when a generator +# expression is involved, it's still a valid parse tree and Jedi should still +# work (and especially not raise Exceptions). It's debatable wheter inferring +# values for invalid statements is a good idea, but not failing is a must. + +#? int() +next(foo(x for x in [1], 1)) + +def bar(x, y): + return y + +#? str() +next(bar(x for x in [1], x for x in [''])) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/context.py b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/context.py new file mode 100644 index 0000000..d77c79c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/context.py @@ -0,0 +1,55 @@ +class Base(): + myfoobar = 3 + + +class X(Base): + def func(self, foo): + pass + + +class Y(X): + def actual_function(self): + pass + + #? [] + def actual_function + #? ['func'] + def f + + #? ['__doc__'] + __doc__ + #? [] + def __doc__ + + # This might or might not be what we wanted, currently properties are also + # used like this. IMO this is not wanted ~dave. + #? ['__class__'] + def __class__ + #? [] + __class__ + + + #? ['__repr__'] + def __repr__ + + #? [] + def mro + + #? ['myfoobar'] + myfoobar + +#? [] +myfoobar + +# ----------------- +# Inheritance +# ----------------- + +class Super(): + enabled = True + if enabled: + yo_dude = 4 + +class Sub(Super): + #? ['yo_dude'] + yo_dud diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/decorators.py b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/decorators.py new file mode 100644 index 0000000..a61487a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/decorators.py @@ -0,0 +1,332 @@ +# ----------------- +# normal decorators +# ----------------- + +def decorator(func): + def wrapper(*args): + return func(1, *args) + return wrapper + +@decorator +def decorated(a,b): + return a,b + +exe = decorated(set, '') + +#? set +exe[1] + +#? int() +exe[0] + +# more complicated with args/kwargs +def dec(func): + def wrapper(*args, **kwargs): + return func(*args, **kwargs) + return wrapper + +@dec +def fu(a, b, c, *args, **kwargs): + return a, b, c, args, kwargs + +exe = fu(list, c=set, b=3, d='') + +#? list +exe[0] +#? int() +exe[1] +#? set +exe[2] +#? [] +exe[3][0]. +#? str() +exe[4]['d'] + + +exe = fu(list, set, 3, '', d='') + +#? str() +exe[3][0] + +# ----------------- +# multiple decorators +# ----------------- +def dec2(func2): + def wrapper2(first_arg, *args2, **kwargs2): + return func2(first_arg, *args2, **kwargs2) + return wrapper2 + +@dec2 +@dec +def fu2(a, b, c, *args, **kwargs): + return a, b, c, args, kwargs + +exe = fu2(list, c=set, b=3, d='str') + +#? list +exe[0] +#? int() +exe[1] +#? set +exe[2] +#? [] +exe[3][0]. +#? str() +exe[4]['d'] + + +# ----------------- +# Decorator is a class +# ----------------- +def same_func(func): + return func + +class Decorator(object): + def __init__(self, func): + self.func = func + + def __call__(self, *args, **kwargs): + return self.func(1, *args, **kwargs) + +@Decorator +def nothing(a,b,c): + return a,b,c + +#? int() +nothing("")[0] +#? str() +nothing("")[1] + + +@same_func +@Decorator +def nothing(a,b,c): + return a,b,c + +#? int() +nothing("")[0] + +class MethodDecoratorAsClass(): + class_var = 3 + @Decorator + def func_without_self(arg, arg2): + return arg, arg2 + + @Decorator + def func_with_self(self, arg): + return self.class_var + +#? int() +MethodDecoratorAsClass().func_without_self('')[0] +#? str() +MethodDecoratorAsClass().func_without_self('')[1] +#? +MethodDecoratorAsClass().func_with_self(1) + + +class SelfVars(): + """Init decorator problem as an instance, #247""" + @Decorator + def __init__(self): + """ + __init__ decorators should be ignored when looking up variables in the + class. + """ + self.c = list + + @Decorator + def shouldnt_expose_var(not_self): + """ + Even though in real Python this shouldn't expose the variable, in this + case Jedi exposes the variable, because these kind of decorators are + normally descriptors, which SHOULD be exposed (at least 90%). + """ + not_self.b = 1.0 + + def other_method(self): + #? float() + self.b + #? list + self.c + +# ----------------- +# not found decorators (are just ignored) +# ----------------- +@not_found_decorator +def just_a_func(): + return 1 + +#? int() +just_a_func() + +#? ['__closure__'] +just_a_func.__closure__ + + +class JustAClass: + @not_found_decorator2 + def a(self): + return 1 + +#? ['__call__'] +JustAClass().a.__call__ +#? int() +JustAClass().a() +#? ['__call__'] +JustAClass.a.__call__ +#? int() +JustAClass.a() + +# ----------------- +# illegal decorators +# ----------------- + +class DecoratorWithoutCall(): + def __init__(self, func): + self.func = func + +@DecoratorWithoutCall +def f(): + return 1 + +# cannot be resolved - should be ignored +@DecoratorWithoutCall(None) +def g(): + return 1 + +#? +f() +#? int() +g() + + +class X(): + @str + def x(self): + pass + + def y(self): + #? str() + self.x + #? + self.x() + + +def decorator_var_args(function, *args): + return function(*args) + +@decorator_var_args +def function_var_args(param): + return param + +#? int() +function_var_args(1) + +# ----------------- +# method decorators +# ----------------- + +def dec(f): + def wrapper(s): + return f(s) + return wrapper + +class MethodDecorators(): + _class_var = 1 + def __init__(self): + self._method_var = '' + + @dec + def constant(self): + return 1.0 + + @dec + def class_var(self): + return self._class_var + + @dec + def method_var(self): + return self._method_var + +#? float() +MethodDecorators().constant() +#? int() +MethodDecorators().class_var() +#? str() +MethodDecorators().method_var() + + +class Base(): + @not_existing + def __init__(self): + pass + @not_existing + def b(self): + return '' + @dec + def c(self): + return 1 + +class MethodDecoratorDoesntExist(Base): + """#272 github: combination of method decorators and super()""" + def a(self): + #? + super().__init__() + #? str() + super().b() + #? int() + super().c() + #? float() + self.d() + + @doesnt_exist + def d(self): + return 1.0 + +# ----------------- +# others +# ----------------- +def memoize(function): + def wrapper(*args): + if random.choice([0, 1]): + pass + else: + rv = function(*args) + return rv + return wrapper + +@memoize +def follow_statement(stmt): + return stmt + +# here we had problems with the else clause, because the parent was not right. +#? int() +follow_statement(1) + +# ----------------- +# class decorators +# ----------------- + +# class decorators should just be ignored +@should_ignore +class A(): + x = 3 + def ret(self): + return 1 + +#? int() +A().ret() +#? int() +A().x + + +# ----------------- +# On decorator completions +# ----------------- + +import abc +#? ['abc'] +@abc + +#? ['abstractmethod'] +@abc.abstractmethod diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/definition.py b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/definition.py new file mode 100644 index 0000000..f896984 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/definition.py @@ -0,0 +1,68 @@ +""" +Fallback to callee definition when definition not found. +- https://github.com/davidhalter/jedi/issues/131 +- https://github.com/davidhalter/jedi/pull/149 +""" + +"""Parenthesis closed at next line.""" + +# Ignore these definitions for a little while, not sure if we really want them. +# python <= 2.5 + +#? isinstance +isinstance( +) + +#? isinstance +isinstance( +) + +#? isinstance +isinstance(None, +) + +#? isinstance +isinstance(None, +) + +"""Parenthesis closed at same line.""" + +# Note: len('isinstance(') == 11 +#? 11 isinstance +isinstance() + +# Note: len('isinstance(None,') == 16 +##? 16 isinstance +isinstance(None,) + +# Note: len('isinstance(None,') == 16 +##? 16 isinstance +isinstance(None, ) + +# Note: len('isinstance(None, ') == 17 +##? 17 isinstance +isinstance(None, ) + +# Note: len('isinstance( ') == 12 +##? 12 isinstance +isinstance( ) + +"""Unclosed parenthesis.""" + +#? isinstance +isinstance( + +def x(): pass # acts like EOF + +##? isinstance +isinstance( + +def x(): pass # acts like EOF + +#? isinstance +isinstance(None, + +def x(): pass # acts like EOF + +##? isinstance +isinstance(None, diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/descriptors.py b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/descriptors.py new file mode 100644 index 0000000..3cc01fa --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/descriptors.py @@ -0,0 +1,221 @@ +class RevealAccess(object): + """ + A data descriptor that sets and returns values + normally and prints a message logging their access. + """ + def __init__(self, initval=None, name='var'): + self.val = initval + self.name = name + + def __get__(self, obj, objtype): + print('Retrieving', self.name) + return self.val + + def __set__(self, obj, val): + print('Updating', self.name) + self.val = val + + def just_a_method(self): + pass + +class C(object): + x = RevealAccess(10, 'var "x"') + #? RevealAccess() + x + #? ['just_a_method'] + x.just_a_method + y = 5.0 + def __init__(self): + #? int() + self.x + + #? [] + self.just_a_method + #? [] + C.just_a_method + +m = C() +#? int() +m.x +#? float() +m.y +#? int() +C.x + +#? [] +m.just_a_method +#? [] +C.just_a_method + +# ----------------- +# properties +# ----------------- +class B(): + @property + def r(self): + return 1 + @r.setter + def r(self, value): + return '' + def t(self): + return '' + p = property(t) + +#? [] +B().r(). +#? int() +B().r + +#? str() +B().p +#? [] +B().p(). + +class PropClass(): + def __init__(self, a): + self.a = a + @property + def ret(self): + return self.a + + @ret.setter + def ret(self, value): + return 1.0 + + def ret2(self): + return self.a + ret2 = property(ret2) + + @property + def nested(self): + """ causes recusions in properties, should work """ + return self.ret + + @property + def nested2(self): + """ causes recusions in properties, should not work """ + return self.nested2 + + @property + def join1(self): + """ mutual recusion """ + return self.join2 + + @property + def join2(self): + """ mutual recusion """ + return self.join1 + +#? str() +PropClass("").ret +#? [] +PropClass().ret. + +#? str() +PropClass("").ret2 +#? +PropClass().ret2 + +#? int() +PropClass(1).nested +#? [] +PropClass().nested. + +#? +PropClass(1).nested2 +#? [] +PropClass().nested2. + +#? +PropClass(1).join1 +# ----------------- +# staticmethod/classmethod +# ----------------- + +class E(object): + a = '' + def __init__(self, a): + self.a = a + + def f(x): + return x + f = staticmethod(f) + #? + f.__func + + @staticmethod + def g(x): + return x + + def s(cls, x): + return x + s = classmethod(s) + + @classmethod + def t(cls, x): + return x + + @classmethod + def u(cls, x): + return cls.a + +e = E(1) +#? int() +e.f(1) +#? int() +E.f(1) +#? int() +e.g(1) +#? int() +E.g(1) + +#? int() +e.s(1) +#? int() +E.s(1) +#? int() +e.t(1) +#? int() +E.t(1) + +#? str() +e.u(1) +#? str() +E.u(1) + +# ----------------- +# Conditions +# ----------------- + +from functools import partial + + +class Memoize(): + def __init__(self, func): + self.func = func + + def __get__(self, obj, objtype): + if obj is None: + return self.func + + return partial(self, obj) + + def __call__(self, *args, **kwargs): + # We don't do caching here, but that's what would normally happen. + return self.func(*args, **kwargs) + + +class MemoizeTest(): + def __init__(self, x): + self.x = x + + @Memoize + def some_func(self): + return self.x + + +#? int() +MemoizeTest(10).some_func() +# Now also call the same function over the class (see if clause above). +#? float() +MemoizeTest.some_func(MemoizeTest(10.0)) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/docstring.py b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/docstring.py new file mode 100644 index 0000000..2b9f348 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/docstring.py @@ -0,0 +1,254 @@ +""" Test docstrings in functions and classes, which are used to infer types """ + +# ----------------- +# sphinx style +# ----------------- +def sphinxy(a, b, c, d, x): + """ asdfasdf + :param a: blablabla + :type a: str + :type b: (str, int) + :type c: random.Random + :type d: :class:`random.Random` + :param str x: blablabla + :rtype: dict + """ + #? str() + a + #? str() + b[0] + #? int() + b[1] + #? ['seed'] + c.seed + #? ['seed'] + d.seed + #? ['lower'] + x.lower + +#? dict() +sphinxy() + +# wrong declarations +def sphinxy2(a, b, x, y, z): + """ + :param a: Forgot type declaration + :type a: + :param b: Just something + :type b: `` + :param x: Just something without type + :param y: A function + :type y: def l(): pass + :param z: A keyword + :type z: return + :rtype: + """ + #? + a + #? + b + #? + x + #? + y + #? + z + +#? +sphinxy2() + + +def sphinxy_param_type_wrapped(a): + """ + :param str a: + Some description wrapped onto the next line with no space after the + colon. + """ + #? str() + a + + +# local classes -> github #370 +class ProgramNode(): + pass + +def local_classes(node, node2): + """ + :type node: ProgramNode + ... and the class definition after this func definition: + :type node2: ProgramNode2 + """ + #? ProgramNode() + node + #? ProgramNode2() + node2 + +class ProgramNode2(): + pass + + +def list_with_non_imports(lst): + """ + Should be able to work with tuples and lists and still import stuff. + + :type lst: (random.Random, [collections.defaultdict, ...]) + """ + #? ['seed'] + lst[0].seed + + import collections as col + # use some weird index + #? col.defaultdict() + lst[1][10] + + +def two_dots(a): + """ + :type a: json.decoder.JSONDecoder + """ + #? ['raw_decode'] + a.raw_decode + + +# sphinx returns +def return_module_object(): + """ + :rtype: :class:`random.Random` + """ + +#? ['seed'] +return_module_object().seed + + +# ----------------- +# epydoc style +# ----------------- +def epydoc(a, b): + """ asdfasdf + @type a: str + @param a: blablabla + @type b: (str, int) + @param b: blablah + @rtype: list + """ + #? str() + a + #? str() + b[0] + + #? int() + b[1] + +#? list() +epydoc() + + +# Returns with param type only +def rparam(a,b): + """ + @type a: str + """ + return a + +#? str() +rparam() + + +# Composite types +def composite(): + """ + @rtype: (str, int, dict) + """ + +x, y, z = composite() +#? str() +x +#? int() +y +#? dict() +z + + +# Both docstring and calculated return type +def both(): + """ + @rtype: str + """ + return 23 + +#? str() int() +both() + +class Test(object): + def __init__(self): + self.teststr = "" + """ + # jedi issue #210 + """ + def test(self): + #? ['teststr'] + self.teststr + +# ----------------- +# statement docstrings +# ----------------- +d = '' +""" bsdf """ +#? str() +d.upper() + +# ----------------- +# class docstrings +# ----------------- + +class InInit(): + def __init__(self, foo): + """ + :type foo: str + """ + #? str() + foo + + +class InClass(): + """ + :type foo: str + """ + def __init__(self, foo): + #? str() + foo + + +class InBoth(): + """ + :type foo: str + """ + def __init__(self, foo): + """ + :type foo: int + """ + #? str() int() + foo + + +def __init__(foo): + """ + :type foo: str + """ + #? str() + foo + + +# ----------------- +# Renamed imports (#507) +# ----------------- + +import datetime +from datetime import datetime as datetime_imported + +def import_issues(foo): + """ + @type foo: datetime_imported + """ + #? datetime.datetime() + foo diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/dynamic_arrays.py b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/dynamic_arrays.py new file mode 100644 index 0000000..0f03c8f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/dynamic_arrays.py @@ -0,0 +1,309 @@ +""" +Checking for ``list.append`` and all the other possible array modifications. +""" +# ----------------- +# list.append +# ----------------- +arr = [] +for a in [1,2]: + arr.append(a); + +arr.append # should not cause an exception +arr.append() # should not cause an exception + +#? int() +arr[10] + +arr = [tuple()] +for a in [1,2]: + arr.append(a); + +#? int() tuple() +arr[10] +#? int() +arr[10].index() + +arr = list([]) +arr.append(1) +#? int() +arr[0] + +# ----------------- +# list.insert +# ----------------- +arr = [""] +arr.insert(0, 1.0) + +# on exception due to this, please! +arr.insert(0) +arr.insert() + +#? float() str() +arr[10] + +for a in arr: + #? float() str() + a + +#? float() str() +list(arr)[10] + +# ----------------- +# list.extend / set.update +# ----------------- + +arr = [1.0] +arr.extend([1,2,3]) +arr.extend([]) +arr.extend("") +arr.extend(list) # should ignore + +#? float() int() str() +arr[100] + +a = set(arr) +a.update(list(["", 1])) + +#? float() int() str() +list(a)[0] +# ----------------- +# set/list initialized as functions +# ----------------- + +st = set() +st.add(1) + +#? int() +for s in st: s + +lst = list() +lst.append(1) + +#? int() +for i in lst: i + +# ----------------- +# renames / type changes +# ----------------- +arr = [] +arr2 = arr +arr2.append('') +#? str() +arr2[0] + + +lst = [1] +lst.append(1.0) +s = set(lst) +s.add("ahh") +lst = list(s) +lst.append({}) + +#? dict() int() float() str() +lst[0] + +# should work with tuple conversion, too. +#? dict() int() float() str() +tuple(lst)[0] + +# but not with an iterator +#? +iter(lst)[0] + +# ----------------- +# complex including += +# ----------------- +class C(): pass +class D(): pass +class E(): pass +lst = [1] +lst.append(1.0) +lst += [C] +s = set(lst) +s.add("") +s += [D] +lst = list(s) +lst.append({}) +lst += [E] + +##? dict() int() float() str() C D E +lst[0] + +# ----------------- +# functions +# ----------------- + +def arr_append(arr4, a): + arr4.append(a) + +def add_to_arr(arr2, a): + arr2.append(a) + return arr2 + +def app(a): + arr3.append(a) + +arr3 = [1.0] +res = add_to_arr(arr3, 1) +arr_append(arr3, 'str') +app(set()) + +#? float() str() int() set() +arr3[10] + +#? float() str() int() set() +res[10] + +# ----------------- +# returns, special because the module dicts are not correct here. +# ----------------- +def blub(): + a = [] + a.append(1.0) + #? float() + a[0] + return a + +#? float() +blub()[0] + +# list with default +def blub(): + a = list([1]) + a.append(1.0) + return a + +#? int() float() +blub()[0] + +# empty list +def blub(): + a = list() + a.append(1.0) + return a +#? float() +blub()[0] + +# with if +def blub(): + if 1: + a = [] + a.append(1.0) + return a + +#? float() +blub()[0] + +# with else clause +def blub(): + if random.choice([0, 1]): + 1 + else: + a = [] + a.append(1) + return a + +#? int() +blub()[0] +# ----------------- +# returns, the same for classes +# ----------------- +class C(): + def blub(self, b): + if 1: + a = [] + a.append(b) + return a + + def blub2(self): + """ mapper function """ + a = self.blub(1.0) + #? float() + a[0] + return a + + def literal_arr(self, el): + self.a = [] + self.a.append(el) + #? int() + self.a[0] + return self.a + + def list_arr(self, el): + self.b = list([]) + self.b.append(el) + #? float() + self.b[0] + return self.b + +#? int() +C().blub(1)[0] +#? float() +C().blub2(1)[0] + +#? int() +C().a[0] +#? int() +C().literal_arr(1)[0] + +#? float() +C().b[0] +#? float() +C().list_arr(1.0)[0] + +# ----------------- +# array recursions +# ----------------- + +a = set([1.0]) +a.update(a) +a.update([1]) + +#? float() int() +list(a)[0] + +def first(a): + b = [] + b.append(a) + b.extend(second(a)) + return list(b) + +def second(a): + b = [] + b.extend(first(a)) + return list(b) + +#? float() +first(1.0)[0] + +def third(): + b = [] + b.extend + extend() + b.extend(first()) + return list(b) +#? +third()[0] + + +# ----------------- +# set.add +# ----------------- +st = {1.0} +for a in [1,2]: + st.add(a) + +st.append('') # lists should not have an influence + +st.add # should not cause an exception +st.add() + +st = {1.0} +st.add(1) +lst = list(st) + +lst.append('') + +#? float() int() str() +lst[0] + diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/dynamic_params.py b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/dynamic_params.py new file mode 100644 index 0000000..1a48468 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/dynamic_params.py @@ -0,0 +1,159 @@ +""" +This is used for dynamic object completion. +Jedi tries to guess param types with a backtracking approach. +""" +def func(a, default_arg=2): + #? int() + default_arg + #? int() str() + return a + +#? int() +func(1) + +func + +int(1) + (int(2))+ func('') + +# Again the same function, but with another call. +def func(a): + #? float() + return a + +func(1.0) + +# Again the same function, but with no call. +def func(a): + #? + return a + +def func(a): + #? float() + return a +str(func(1.0)) + +# ----------------- +# *args, **args +# ----------------- +def arg(*args): + #? tuple() + args + #? int() + args[0] + +arg(1,"") +# ----------------- +# decorators +# ----------------- +def def_func(f): + def wrapper(*args, **kwargs): + return f(*args, **kwargs) + return wrapper + +@def_func +def func(c): + #? str() + return c + +#? str() +func("something") + +@def_func +def func(c=1): + #? float() + return c + +func(1.0) + +def tricky_decorator(func): + def wrapper(*args): + return func(1, *args) + + return wrapper + + +@tricky_decorator +def func(a, b): + #? int() + a + #? float() + b + +func(1.0) + +# Needs to be here, because in this case func is an import -> shouldn't lead to +# exceptions. +import sys as func +func.sys + +# ----------------- +# classes +# ----------------- + +class A(): + def __init__(self, a): + #? str() + a + +A("s") + +class A(): + def __init__(self, a): + #? int() + a + self.a = a + + def test(self, a): + #? float() + a + self.c = self.test2() + + def test2(self): + #? int() + return self.a + + def test3(self): + #? int() + self.test2() + #? int() + self.c + +A(3).test(2.0) +A(3).test2() + + +def from_class(x): + #? + x + +from UNDEFINED import from_class + +class Foo(from_class(1),): + pass + +# ----------------- +# comprehensions +# ----------------- + +def from_comprehension(foo): + #? int() float() + return foo + +[from_comprehension(1.0) for n in (1,)] +[from_comprehension(n) for n in (1,)] + +# ----------------- +# lambdas +# ----------------- + +#? int() +x_lambda = lambda x: x + +x_lambda(1) + +class X(): + #? str() + x_method = lambda self, a: a + + +X().x_method('') diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/flow_analysis.py b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/flow_analysis.py new file mode 100644 index 0000000..3eb50d5 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/flow_analysis.py @@ -0,0 +1,302 @@ +# ----------------- +# First a few name resolution things +# ----------------- + +x = 3 +if NOT_DEFINED: + x = '' +#? 6 int() +elif x: + pass +else: + #? int() + x + +x = 1 +try: + x = '' +#? 8 int() str() +except x: + #? 5 int() str() + x + x = 1.0 +else: + #? 5 int() str() + x + x = list +finally: + #? 5 int() str() float() list + x + x = tuple + +if False: + with open("") as defined_in_false: + #? ['flush'] + defined_in_false.flu + +# ----------------- +# Return checks +# ----------------- + +def foo(x): + if 1.0: + return 1 + else: + return '' + +#? int() +foo(1) + + +# Exceptions are not analyzed. So check both if branches +def try_except(x): + try: + if 0: + return 1 + else: + return '' + except AttributeError: + return 1.0 + +#? float() str() +try_except(1) + + +# Exceptions are not analyzed. So check both if branches +def try_except(x): + try: + if 0: + return 1 + else: + return '' + except AttributeError: + return 1.0 + +#? float() str() +try_except(1) + + +# ----------------- +# elif +# ----------------- + +def elif_flows1(x): + if False: + return 1 + elif True: + return 1.0 + else: + return '' + +#? float() +elif_flows1(1) + + +def elif_flows2(x): + try: + if False: + return 1 + elif 0: + return 1.0 + else: + return '' + except ValueError: + return set + +#? str() set +elif_flows2(1) + + +def elif_flows3(x): + try: + if True: + return 1 + elif 0: + return 1.0 + else: + return '' + except ValueError: + return set + +#? int() set +elif_flows3(1) + +# ----------------- +# mid-difficulty if statements +# ----------------- +def check(a): + if a is None: + return 1 + return '' + return set + +#? int() +check(None) +#? str() +check('asb') + +a = list +if 2 == True: + a = set +elif 1 == True: + a = 0 + +#? int() +a +if check != 1: + a = '' +#? str() +a +if check == check: + a = list +#? list +a +if check != check: + a = set +else: + a = dict +#? dict +a +if not (check is not check): + a = 1 +#? int() +a + + +# ----------------- +# name resolution +# ----------------- + +a = list +def elif_name(x): + try: + if True: + a = 1 + elif 0: + a = 1.0 + else: + return '' + except ValueError: + a = x + return a + +#? int() set +elif_name(set) + +if 0: + a = '' +else: + a = int + +#? int +a + +# ----------------- +# isinstance +# ----------------- + +class A(): pass + +def isinst(x): + if isinstance(x, A): + return dict + elif isinstance(x, int) and x == 1 or x is True: + return set + elif isinstance(x, (float, reversed)): + return list + elif not isinstance(x, str): + return tuple + return 1 + +#? dict +isinst(A()) +#? set +isinst(True) +#? set +isinst(1) +#? tuple +isinst(2) +#? list +isinst(1.0) +#? tuple +isinst(False) +#? int() +isinst('') + +# ----------------- +# flows that are not reachable should be able to access parent scopes. +# ----------------- + +foobar = '' + +if 0: + within_flow = 1.0 + #? float() + within_flow + #? str() + foobar + if 0: + nested = 1 + #? int() + nested + #? float() + within_flow + #? str() + foobar + #? + nested + +if False: + in_false = 1 + #? ['in_false'] + in_false + +# ----------------- +# True objects like modules +# ----------------- + +class X(): + pass +if X: + a = 1 +else: + a = '' +#? int() +a + + +# ----------------- +# Recursion issues +# ----------------- + +def possible_recursion_error(filename): + if filename == 'a': + return filename + # It seems like without the brackets there wouldn't be a RecursionError. + elif type(filename) == str: + return filename + + +if NOT_DEFINED: + s = str() +else: + s = str() +#? str() +possible_recursion_error(s) + + +# ----------------- +# In combination with imports +# ----------------- + +from import_tree import flow_import + +if 1 == flow_import.env: + a = 1 +elif 2 == flow_import.env: + a = '' +elif 3 == flow_import.env: + a = 1.0 + +#? int() str() +a diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/fstring.py b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/fstring.py new file mode 100644 index 0000000..32f29e9 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/fstring.py @@ -0,0 +1,38 @@ +# python >= 3.6 + +class Foo: + bar = 1 + +#? 10 int() +f'{Foo.bar}' +#? 10 ['bar'] +f'{Foo.bar}' +#? 10 int() +Fr'{Foo.bar' +#? 10 ['bar'] +Fr'{Foo.bar' +#? int() +Fr'{Foo.bar +#? ['bar'] +Fr'{Foo.bar +#? ['Exception'] +F"{Excepti + +#? 8 Foo +Fr'a{Foo.bar' +#? str() +Fr'sasdf' + +#? 7 str() +Fr'''sasdf''' + '' + +#? ['upper'] +f'xyz'.uppe + + +#? 3 [] +f'f' + +# Github #1248 +#? int() +{"foo": 1}[f"foo"] diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/functions.py b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/functions.py new file mode 100644 index 0000000..585b692 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/functions.py @@ -0,0 +1,498 @@ +def x(): + return + +#? None +x() + +def array(first_param): + #? ['first_param'] + first_param + return list() + +#? [] +array.first_param +#? [] +array.first_param. +func = array +#? [] +func.first_param + +#? list() +array() + +#? ['array'] +arr + + +def inputs(param): + return param + +#? list +inputs(list) + +def variable_middle(): + var = 3 + return var + +#? int() +variable_middle() + +def variable_rename(param): + var = param + return var + +#? int() +variable_rename(1) + +def multi_line_func(a, # comment blabla + + b): + return b + +#? str() +multi_line_func(1,'') + +def multi_line_call(b): + return b + + +multi_line_call( +#? int() + b=1) + + +# nothing after comma +def asdf(a): + return a + +x = asdf(a=1, + ) +#? int() +x + +# ----------------- +# double execution +# ----------------- +def double_exe(param): + return param + +#? str() +variable_rename(double_exe)("") + +# -> shouldn't work (and throw no error) +#? [] +variable_rename(list())(). +#? [] +variable_rename(1)(). + +# ----------------- +# recursions (should ignore) +# ----------------- +def recursion(a, b): + if a: + return b + else: + return recursion(a+".", b+1) + +# Does not also return int anymore, because we now support operators in simple cases. +#? float() +recursion("a", 1.0) + +def other(a): + return recursion2(a) + +def recursion2(a): + if random.choice([0, 1]): + return other(a) + else: + if random.choice([0, 1]): + return recursion2("") + else: + return a + +#? int() str() +recursion2(1) + +# ----------------- +# ordering +# ----------------- + +def a(): + #? int() + b() + return b() + +def b(): + return 1 + +#? int() +a() + +# ----------------- +# keyword arguments +# ----------------- + +def func(a=1, b=''): + return a, b + +exe = func(b=list, a=tuple) +#? tuple +exe[0] + +#? list +exe[1] + +# ----------------- +# default arguments +# ----------------- + +#? int() +func()[0] +#? str() +func()[1] +#? float() +func(1.0)[0] +#? str() +func(1.0)[1] + + +#? float() +func(a=1.0)[0] +#? str() +func(a=1.0)[1] +#? int() +func(b=1.0)[0] +#? float() +func(b=1.0)[1] +#? list +func(a=list, b=set)[0] +#? set +func(a=list, b=set)[1] + + +def func_default(a, b=1): + return a, b + + +def nested_default(**kwargs): + return func_default(**kwargs) + +#? float() +nested_default(a=1.0)[0] +#? int() +nested_default(a=1.0)[1] +#? str() +nested_default(a=1.0, b='')[1] + +# Defaults should only work if they are defined before - not after. +def default_function(a=default): + #? + return a + +#? +default_function() + +default = int() + +def default_function(a=default): + #? int() + return a + +#? int() +default_function() + +def default(a=default): + #? int() + a + +# ----------------- +# closures +# ----------------- +def a(): + l = 3 + def func_b(): + l = '' + #? str() + l + #? ['func_b'] + func_b + #? int() + l + +# ----------------- +# *args +# ----------------- + +def args_func(*args): + #? tuple() + return args + +exe = args_func(1, "") +#? int() +exe[0] +#? str() +exe[1] + +# illegal args (TypeError) +#? +args_func(*1)[0] +# iterator +#? int() +args_func(*iter([1]))[0] + +# different types +e = args_func(*[1+"", {}]) +#? int() str() +e[0] +#? dict() +e[1] + +_list = [1,""] +exe2 = args_func(_list)[0] + +#? str() +exe2[1] + +exe3 = args_func([1,""])[0] + +#? str() +exe3[1] + +def args_func(arg1, *args): + return arg1, args + +exe = args_func(1, "", list) +#? int() +exe[0] +#? tuple() +exe[1] +#? list +exe[1][1] + + +# In a dynamic search, both inputs should be given. +def simple(a): + #? int() str() + return a +def xargs(*args): + return simple(*args) + +xargs(1) +xargs('') + + +# *args without a self symbol +def memoize(func): + def wrapper(*args, **kwargs): + return func(*args, **kwargs) + return wrapper + + +class Something(): + @memoize + def x(self, a, b=1): + return a + +#? int() +Something().x(1) + + +# ----------------- +# ** kwargs +# ----------------- +def kwargs_func(**kwargs): + #? ['keys'] + kwargs.keys + #? dict() + return kwargs + +exe = kwargs_func(a=3,b=4.0) +#? dict() +exe +#? int() +exe['a'] +#? float() +exe['b'] +#? int() float() +exe['c'] + +a = 'a' +exe2 = kwargs_func(**{a:3, + 'b':4.0}) + +#? int() +exe2['a'] +#? float() +exe2['b'] +#? int() float() +exe2['c'] + +exe3 = kwargs_func(**{k: v for k, v in [(a, 3), ('b', 4.0)]}) + +# Should resolve to the same as 2 but jedi is not smart enough yet +# Here to make sure it doesn't result in crash though +#? +exe3['a'] + +#? +exe3['b'] + +#? +exe3['c'] + +# ----------------- +# *args / ** kwargs +# ----------------- + +def func_without_call(*args, **kwargs): + #? tuple() + args + #? dict() + kwargs + +def fu(a=1, b="", *args, **kwargs): + return a, b, args, kwargs + +exe = fu(list, 1, "", c=set, d="") + +#? list +exe[0] +#? int() +exe[1] +#? tuple() +exe[2] +#? str() +exe[2][0] +#? dict() +exe[3] +#? set +exe[3]['c'] + + +def kwargs_iteration(**kwargs): + return kwargs + +for x in kwargs_iteration(d=3): + #? float() + {'d': 1.0, 'c': '1'}[x] + + +# ----------------- +# nested *args +# ----------------- +def function_args(a, b, c): + return b + +def nested_args(*args): + return function_args(*args) + +def nested_args2(*args, **kwargs): + return nested_args(*args) + +#? int() +nested_args('', 1, 1.0, list) +#? [] +nested_args(''). + +#? int() +nested_args2('', 1, 1.0) +#? [] +nested_args2(''). + +# ----------------- +# nested **kwargs +# ----------------- +def nested_kw(**kwargs1): + return function_args(**kwargs1) + +def nested_kw2(**kwargs2): + return nested_kw(**kwargs2) + +# invalid command, doesn't need to return anything +#? +nested_kw(b=1, c=1.0, list) +#? int() +nested_kw(b=1) +# invalid command, doesn't need to return anything +#? +nested_kw(d=1.0, b=1, list) +#? int() +nested_kw(a=3.0, b=1) +#? int() +nested_kw(b=1, a=r"") +#? [] +nested_kw(1, ''). +#? [] +nested_kw(a=''). + +#? int() +nested_kw2(b=1) +#? int() +nested_kw2(b=1, c=1.0) +#? int() +nested_kw2(c=1.0, b=1) +#? [] +nested_kw2(''). +#? [] +nested_kw2(a=''). +#? [] +nested_kw2('', b=1). + +# ----------------- +# nested *args/**kwargs +# ----------------- +def nested_both(*args, **kwargs): + return function_args(*args, **kwargs) + +def nested_both2(*args, **kwargs): + return nested_both(*args, **kwargs) + +# invalid commands, may return whatever. +#? list +nested_both('', b=1, c=1.0, list) +#? list +nested_both('', c=1.0, b=1, list) + +#? [] +nested_both(''). + +#? int() +nested_both2('', b=1, c=1.0) +#? int() +nested_both2('', c=1.0, b=1) +#? [] +nested_both2(''). + +# ----------------- +# nested *args/**kwargs with a default arg +# ----------------- +def function_def(a, b, c): + return a, b + +def nested_def(a, *args, **kwargs): + return function_def(a, *args, **kwargs) + +def nested_def2(*args, **kwargs): + return nested_def(*args, **kwargs) + +#? str() +nested_def2('', 1, 1.0)[0] +#? str() +nested_def2('', b=1, c=1.0)[0] +#? str() +nested_def2('', c=1.0, b=1)[0] +#? int() +nested_def2('', 1, 1.0)[1] +#? int() +nested_def2('', b=1, c=1.0)[1] +#? int() +nested_def2('', c=1.0, b=1)[1] +#? [] +nested_def2('')[1]. + +# ----------------- +# magic methods +# ----------------- +def a(): pass +#? ['__closure__'] +a.__closure__ diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/generators.py b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/generators.py new file mode 100644 index 0000000..ee541df --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/generators.py @@ -0,0 +1,272 @@ +# ----------------- +# yield statement +# ----------------- +def gen(): + if random.choice([0, 1]): + yield 1 + else: + yield "" + +gen_exe = gen() +#? int() str() +next(gen_exe) + +#? int() str() list +next(gen_exe, list) + + +def gen_ret(value): + yield value + +#? int() +next(gen_ret(1)) + +#? [] +next(gen_ret()). + +# generators evaluate to true if cast by bool. +a = '' +if gen_ret(): + a = 3 +#? int() +a + + +# ----------------- +# generators should not be indexable +# ----------------- +def get(param): + if random.choice([0, 1]): + yield 1 + else: + yield "" + +#? [] +get()[0]. + +# ----------------- +# __iter__ +# ----------------- +for a in get(): + #? int() str() + a + + +class Get(): + def __iter__(self): + if random.choice([0, 1]): + yield 1 + else: + yield "" + +b = [] +for a in Get(): + #? int() str() + a + b += [a] + +#? list() +b +#? int() str() +b[0] + +g = iter(Get()) +#? int() str() +next(g) + +g = iter([1.0]) +#? float() +next(g) + + +# ----------------- +# __next__ +# ----------------- +class Counter: + def __init__(self, low, high): + self.current = low + self.high = high + + def __iter__(self): + return self + + def next(self): + """ need to have both __next__ and next, because of py2/3 testing """ + return self.__next__() + + def __next__(self): + if self.current > self.high: + raise StopIteration + else: + self.current += 1 + return self.current - 1 + + +for c in Counter(3, 8): + #? int() + print c + + +# ----------------- +# tuple assignments +# ----------------- +def gen(): + if random.choice([0,1]): + yield 1, "" + else: + yield 2, 1.0 + + +a, b = next(gen()) +#? int() +a +#? str() float() +b + + +def simple(): + if random.choice([0, 1]): + yield 1 + else: + yield "" + +a, b = simple() +#? int() str() +a +# For now this is ok. +#? +b + + +def simple2(): + yield 1 + yield "" + +a, b = simple2() +#? int() +a +#? str() +b + +a, = (a for a in [1]) +#? int() +a + +# ----------------- +# More complicated access +# ----------------- + +# `close` is a method wrapper. +#? ['__call__'] +gen().close.__call__ + +#? +gen().throw() + +#? ['co_consts'] +gen().gi_code.co_consts + +#? [] +gen.gi_code.co_consts + +# `send` is also a method wrapper. +#? ['__call__'] +gen().send.__call__ + +#? tuple() +gen().send() + +#? +gen()() + +# ----------------- +# empty yield +# ----------------- + +def x(): + yield + +#? None +next(x()) +#? gen() +x() + +def x(): + for i in range(3): + yield + +#? None +next(x()) + +# ----------------- +# yield in expression +# ----------------- + +def x(): + a= [(yield 1)] + +#? int() +next(x()) + +# ----------------- +# statements +# ----------------- +def x(): + foo = yield + #? + foo + +# ----------------- +# yield from +# ----------------- + +# python >= 3.4 + +def yield_from(): + yield from iter([1]) + +#? int() +next(yield_from()) + +def yield_from_multiple(): + yield from iter([1]) + yield str() + return 2.0 + +x, y = yield_from_multiple() +#? int() +x +#? str() +y + +def test_nested(): + x = yield from yield_from_multiple() + #? float() + x + yield x + +x, y, z = test_nested() +#? int() +x +#? str() +y +# For whatever reason this is currently empty +#? float() +z + + +def test_in_brackets(): + x = 1 + (yield from yield_from_multiple()) + #? float() + x + + generator = (1 for 1 in [1]) + x = yield from generator + #? None + x + x = yield from 1 + #? + x + x = yield from [1] + #? None + x diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/goto.py b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/goto.py new file mode 100644 index 0000000..029c59c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/goto.py @@ -0,0 +1,251 @@ +# goto_assignments command tests are different in syntax + +definition = 3 +#! 0 ['a = definition'] +a = definition + +#! [] +b +#! ['a = definition'] +a + +b = a +c = b +#! ['c = b'] +c + +cd = 1 +#! 1 ['cd = c'] +cd = c +#! 0 ['cd = e'] +cd = e + +#! ['module math'] +import math +#! ['module math'] +math + +#! ['module math'] +b = math +#! ['b = math'] +b + +#! 18 ['foo = 10'] +foo = 10;print(foo) + +# ----------------- +# classes +# ----------------- +class C(object): + def b(self): + #! ['b = math'] + b + #! ['def b'] + self.b + #! 14 ['def b'] + self.b() + #! 11 ['param self'] + self.b + return 1 + + #! ['def b'] + b + +#! ['b = math'] +b + +#! ['def b'] +C.b +#! ['def b'] +C().b +#! 0 ['class C'] +C().b +#! 0 ['class C'] +C().b + +D = C +#! ['def b'] +D.b +#! ['def b'] +D().b + +#! 0 ['D = C'] +D().b +#! 0 ['D = C'] +D().b + +def c(): + return '' + +#! ['def c'] +c +#! 0 ['def c'] +c() + + +class ClassVar(): + x = 3 + +#! ['x = 3'] +ClassVar.x +#! ['x = 3'] +ClassVar().x + +# before assignments +#! 10 ['x = 3'] +ClassVar.x = '' +#! 12 ['x = 3'] +ClassVar().x = '' + +# Recurring use of the same var name, github #315 +def f(t=None): + #! 9 ['param t=None'] + t = t or 1 + + +class X(): + pass + +#! 3 [] +X(foo=x) + + +# Multiple inheritance +class Foo: + def foo(self): + print("foo") +class Bar: + def bar(self): + print("bar") +class Baz(Foo, Bar): + def baz(self): + #! ['def foo'] + super().foo + #! ['def bar'] + super().bar + #! ['instance Foo'] + super() + +# ----------------- +# imports +# ----------------- + +#! ['module import_tree'] +import import_tree +#! ["a = ''"] +import_tree.a + +#! ['module mod1'] +import import_tree.mod1 +#! ['module mod1'] +from import_tree.mod1 +#! ['a = 1'] +import_tree.mod1.a + +#! ['module pkg'] +import import_tree.pkg +#! ['a = list'] +import_tree.pkg.a + +#! ['module mod1'] +import import_tree.pkg.mod1 +#! ['a = 1.0'] +import_tree.pkg.mod1.a +#! ["a = ''"] +import_tree.a + +#! ['module mod1'] +from import_tree.pkg import mod1 +#! ['a = 1.0'] +mod1.a + +#! ['module mod1'] +from import_tree import mod1 +#! ['a = 1'] +mod1.a + +#! ['a = 1.0'] +from import_tree.pkg.mod1 import a + +#! ['module os'] +from .imports import os + +#! ['some_variable = 1'] +from . import some_variable + +# ----------------- +# anonymous classes +# ----------------- +def func(): + class A(): + def b(self): + return 1 + return A() + +#! 8 ['def b'] +func().b() + +# ----------------- +# on itself +# ----------------- + +#! 7 ['class ClassDef'] +class ClassDef(): + """ abc """ + pass + +# ----------------- +# params +# ----------------- + +param = ClassDef +#! 8 ['param param'] +def ab1(param): pass +#! 9 ['param param'] +def ab2(param): pass +#! 11 ['param = ClassDef'] +def ab3(a=param): pass + +ab1(ClassDef);ab2(ClassDef);ab3(ClassDef) + +# ----------------- +# for loops +# ----------------- + +for i in range(1): + #! ['for i in range(1): i'] + i + +for key, value in [(1,2)]: + #! ['for key, value in [(1,2)]: key'] + key + +#! 4 ['for y in [1]: y'] +for y in [1]: + #! ['for y in [1]: y'] + y + +# ----------------- +# decorator +# ----------------- +def dec(dec_param=3): + pass + +#! 8 ['param dec_param=3'] +@dec(dec_param=5) +def y(): + pass + +class ClassDec(): + def class_func(func): + return func + +#! 14 ['def class_func'] +@ClassDec.class_func +def x(): + pass + +#! 2 ['class ClassDec'] +@ClassDec.class_func +def z(): + pass diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/import_tree/__init__.py b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/import_tree/__init__.py new file mode 100644 index 0000000..5cbbcd7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/import_tree/__init__.py @@ -0,0 +1,7 @@ +a = '' + +from . import invisible_pkg + +the_pkg = invisible_pkg + +invisible_pkg = 1 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/import_tree/classes.py b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/import_tree/classes.py new file mode 100644 index 0000000..23b088c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/import_tree/classes.py @@ -0,0 +1,10 @@ +blub = 1 + +class Config2(): + pass + + +class BaseClass(): + mode = Config2() + if isinstance(whaat, int): + mode2 = whaat diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/import_tree/flow_import.py b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/import_tree/flow_import.py new file mode 100644 index 0000000..a0a779e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/import_tree/flow_import.py @@ -0,0 +1,4 @@ +if name: + env = 1 +else: + env = 2 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/import_tree/invisible_pkg.py b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/import_tree/invisible_pkg.py new file mode 100644 index 0000000..9c78ce2 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/import_tree/invisible_pkg.py @@ -0,0 +1,7 @@ +""" +It should not be possible to import this pkg except for the import_tree itself, +because it is overwritten there. (It would be possible with a sys.path +modification, though). +""" + +foo = 1.0 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/import_tree/mod1.py b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/import_tree/mod1.py new file mode 100644 index 0000000..bd696d6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/import_tree/mod1.py @@ -0,0 +1,4 @@ +a = 1 +from import_tree.random import a as c + +foobarbaz = 3.0 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/import_tree/mod2.py b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/import_tree/mod2.py new file mode 100644 index 0000000..19914f5 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/import_tree/mod2.py @@ -0,0 +1 @@ +from . import mod1 as fake diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/import_tree/pkg/__init__.py b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/import_tree/pkg/__init__.py new file mode 100644 index 0000000..480f222 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/import_tree/pkg/__init__.py @@ -0,0 +1,3 @@ +a = list + +from math import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/import_tree/pkg/mod1.py b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/import_tree/pkg/mod1.py new file mode 100644 index 0000000..fe1d27f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/import_tree/pkg/mod1.py @@ -0,0 +1,3 @@ +a = 1.0 + +from ..random import foobar diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/import_tree/random.py b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/import_tree/random.py new file mode 100644 index 0000000..7a34c4e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/import_tree/random.py @@ -0,0 +1,6 @@ +""" +Here because random is also a builtin module. +""" +a = set + +foobar = 0 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/import_tree/recurse_class1.py b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/import_tree/recurse_class1.py new file mode 100644 index 0000000..cd1dd6a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/import_tree/recurse_class1.py @@ -0,0 +1,5 @@ +from . import recurse_class2 + +class C(recurse_class2.C): + def a(self): + pass diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/import_tree/recurse_class2.py b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/import_tree/recurse_class2.py new file mode 100644 index 0000000..c0a7df6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/import_tree/recurse_class2.py @@ -0,0 +1,4 @@ +from . import recurse_class1 + +class C(recurse_class1.C): + pass diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/import_tree/rename1.py b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/import_tree/rename1.py new file mode 100644 index 0000000..bdc3315 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/import_tree/rename1.py @@ -0,0 +1,3 @@ +""" used for renaming tests """ + +abc = 3 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/import_tree/rename2.py b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/import_tree/rename2.py new file mode 100644 index 0000000..3d1a12e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/import_tree/rename2.py @@ -0,0 +1,6 @@ +""" used for renaming tests """ + + +from import_tree.rename1 import abc + +abc diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/imports.py b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/imports.py new file mode 100644 index 0000000..150f274 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/imports.py @@ -0,0 +1,321 @@ +# ----------------- +# own structure +# ----------------- + +# do separate scopes +def scope_basic(): + from import_tree import mod1 + + #? int() + mod1.a + + #? [] + import_tree.a + + #? [] + import_tree.mod1 + + import import_tree + #? str() + import_tree.a + + +def scope_pkg(): + import import_tree.mod1 + + #? str() + import_tree.a + + #? ['mod1'] + import_tree.mod1 + + #? int() + import_tree.mod1.a + +def scope_nested(): + import import_tree.pkg.mod1 + + #? str() + import_tree.a + + #? list + import_tree.pkg.a + + #? ['sqrt'] + import_tree.pkg.sqrt + + #? ['pkg'] + import_tree.p + + #? float() + import_tree.pkg.mod1.a + #? ['a', 'foobar', '__name__', '__package__', '__file__', '__doc__'] + a = import_tree.pkg.mod1. + + import import_tree.random + #? set + import_tree.random.a + +def scope_nested2(): + """Multiple modules should be indexable, if imported""" + import import_tree.mod1 + import import_tree.pkg + #? ['mod1'] + import_tree.mod1 + #? ['pkg'] + import_tree.pkg + + # With the latest changes this completion also works, because submodules + # are always included (some nested import structures lead to this, + # typically). + #? ['rename1'] + import_tree.rename1 + +def scope_from_import_variable(): + """ + All of them shouldn't work, because "fake" imports don't work in python + without the use of ``sys.modules`` modifications (e.g. ``os.path`` see also + github issue #213 for clarification. + """ + a = 3 + #? + from import_tree.mod2.fake import a + #? + from import_tree.mod2.fake import c + + #? + a + #? + c + +def scope_from_import_variable_with_parenthesis(): + from import_tree.mod2.fake import ( + a, foobarbaz + ) + + #? + a + #? + foobarbaz + # shouldn't complete, should still list the name though. + #? ['foobarbaz'] + foobarbaz + + +def as_imports(): + from import_tree.mod1 import a as xyz + #? int() + xyz + import not_existant, import_tree.mod1 as foo + #? int() + foo.a + import import_tree.mod1 as bar + #? int() + bar.a + + +def broken_import(): + import import_tree.mod1 + #? import_tree.mod1 + from import_tree.mod1 + + #? 25 import_tree.mod1 + import import_tree.mod1. + #? 25 import_tree.mod1 + impo5t import_tree.mod1.foo + #? 25 import_tree.mod1 + import import_tree.mod1.foo. + #? 31 import_tree.mod1 + import json, import_tree.mod1.foo. + + # Cases with ; + mod1 = 3 + #? 25 int() + import import_tree; mod1. + #? 38 import_tree.mod1 + import_tree; import import_tree.mod1. + + #! ['module json'] + from json + + +def test_import_priorities(): + """ + It's possible to overwrite import paths in an ``__init__.py`` file, by + just assigining something there. + + See also #536. + """ + from import_tree import the_pkg, invisible_pkg + #? int() + invisible_pkg + # In real Python, this would be the module, but it's not, because Jedi + # doesn't care about most stateful issues such as __dict__, which it would + # need to, to do this in a correct way. + #? int() + the_pkg + # Importing foo is still possible, even though inivisible_pkg got changed. + #? float() + from import_tree.invisible_pkg import foo + + +# ----------------- +# std lib modules +# ----------------- +import tokenize +#? ['tok_name'] +tokenize.tok_name + +from pyclbr import * + +#? ['readmodule_ex'] +readmodule_ex +import os + +#? ['dirname'] +os.path.dirname + +from os.path import ( + expanduser +) + +#? os.path.expanduser +expanduser + +from itertools import (tee, + islice) +#? ['islice'] +islice + +from functools import (partial, wraps) +#? ['wraps'] +wraps + +from keyword import kwlist, \ + iskeyword +#? ['kwlist'] +kwlist + +#? [] +from keyword import not_existing1, not_existing2 + +from tokenize import io +tokenize.generate_tokens + +# ----------------- +# builtins +# ----------------- + +import sys +#? ['prefix'] +sys.prefix + +#? ['append'] +sys.path.append + +from math import * +#? ['cos', 'cosh'] +cos + +def func_with_import(): + import time + return time + +#? ['sleep'] +func_with_import().sleep + +# ----------------- +# relative imports +# ----------------- + +from .import_tree import mod1 +#? int() +mod1.a + +from ..import_tree import mod1 +#? +mod1.a + +from .......import_tree import mod1 +#? +mod1.a + +from .. import helpers +#? int() +helpers.sample_int + +from ..helpers import sample_int as f +#? int() +f + +from . import run +#? [] +run. + +from . import import_tree as imp_tree +#? str() +imp_tree.a + +from . import datetime as mod1 +#? [] +mod1. + +# self import +# this can cause recursions +from imports import * + +# ----------------- +# packages +# ----------------- + +from import_tree.mod1 import c +#? set +c + +from import_tree import recurse_class1 + +#? ['a'] +recurse_class1.C.a +# github #239 RecursionError +#? ['a'] +recurse_class1.C().a + +# ----------------- +# Jedi debugging +# ----------------- + +# memoizing issues (check git history for the fix) +import not_existing_import + +if not_existing_import: + a = not_existing_import +else: + a = not_existing_import +#? +a + +# ----------------- +# module underscore descriptors +# ----------------- + +def underscore(): + import keyword + #? ['__file__'] + keyword.__file__ + #? str() + keyword.__file__ + + # Does that also work for our own module? + #? ['__file__'] + __file__ + + +# ----------------- +# complex relative imports #784 +# ----------------- +def relative(): + #? ['foobar'] + from import_tree.pkg.mod1 import foobar + #? int() + foobar + return 1 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/invalid.py b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/invalid.py new file mode 100644 index 0000000..0b81cc9 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/invalid.py @@ -0,0 +1,214 @@ +""" +This file is less about the results and much more about the fact, that no +exception should be thrown. + +Basically this file could change depending on the current implementation. But +there should never be any errors. +""" + +# wait until keywords are out of definitions (pydoc function). +##? 5 +'s'() + +#? [] +str()).upper + +# ----------------- +# funcs +# ----------------- +def asdf(a or b): # multiple param names + return a + +#? +asdf(2) + +asdf = '' + +from a import (b +def blub(): + return 0 +def wrong_indents(): + asdf = 3 + asdf + asdf( + # TODO this seems to be wrong now? + ##? int() + asdf +def openbrace(): + asdf = 3 + asdf( + #? int() + asdf + return 1 + +#? int() +openbrace() + +blub([ +#? int() +openbrace() + +def indentfault(): + asd( + indentback + +#? [] +indentfault(). + +def openbrace2(): + asd( +def normalfunc(): + return 1 + +#? int() +normalfunc() + +# dots in param +def f(seq1...=None): + return seq1 +#? +f(1) + +@ +def test_empty_decorator(): + return 1 + +#? int() +test_empty_decorator() + +def invalid_param(param=): + #? + param +# ----------------- +# flows +# ----------------- + +# first part not complete (raised errors) +if a + a +else: + #? ['AttributeError'] + AttributeError + +try +#? ['AttributeError'] +except AttributeError + pass +finally: + pass + +#? ['isinstance'] +if isi +try: + except TypeError: + #? str() + str() + +def break(): pass +# wrong ternary expression +a = '' +a = 1 if +#? str() +a + +# No completions for for loops without the right syntax +for for_local in : + for_local +#? [] +for_local +#? +for_local + + +# ----------------- +# list comprehensions +# ----------------- + +a2 = [for a2 in [0]] +#? +a2[0] + +a3 = [for xyz in] +#? +a3[0] + +a3 = [a4 for in 'b'] +#? +a3[0] + +a3 = [a4 for a in for x in y] +#? +a3[0] + +a = [for a in +def break(): pass + +#? str() +a[0] + +a = [a for a in [1,2] +def break(): pass +#? str() +a[0] + +#? [] +int()).real + +# ----------------- +# keywords +# ----------------- + +#! [] +as + +def empty_assert(): + x = 3 + assert + #? int() + x + +import datetime as + + +# ----------------- +# statements +# ----------------- + +call = '' +invalid = .call +#? +invalid + +invalid = call?.call +#? str() +invalid + +# comma +invalid = ,call +#? str() +invalid + + +# ----------------- +# classes +# ----------------- + +class BrokenPartsOfClass(): + def foo(self): + # This construct contains two places where Jedi with Python 3 can fail. + # It should just ignore those constructs and still execute `bar`. + pass + if 2: + try: + pass + except ValueError, e: + raise TypeError, e + else: + pass + + def bar(self): + self.x = 3 + return '' + +#? str() +BrokenPartsOfClass().bar() diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/isinstance.py b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/isinstance.py new file mode 100644 index 0000000..15fb9a7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/isinstance.py @@ -0,0 +1,101 @@ +if isinstance(i, str): + #? str() + i + +if isinstance(j, (str, int)): + #? str() int() + j + +while isinstance(k, (str, int)): + #? str() int() + k + +if not isinstance(k, (str, int)): + #? + k + +while not isinstance(k, (str, int)): + #? + k + +assert isinstance(ass, int) +#? int() +ass + +assert isinstance(ass, str) +assert not isinstance(ass, int) + +if 2: + #? str() + ass + +# ----------------- +# invalid arguments +# ----------------- + +if isinstance(wrong, str()): + #? + wrong + +# ----------------- +# in functions +# ----------------- + +import datetime + + +def fooooo(obj): + if isinstance(obj, datetime.datetime): + #? datetime.datetime() + obj + + +def fooooo2(obj): + if isinstance(obj, datetime.date): + return obj + else: + return 1 + +a +# In earlier versions of Jedi, this returned both datetime and int, but now +# Jedi does flow checks and realizes that the top return isn't executed. +#? int() +fooooo2('') + + +def isinstance_func(arr): + for value in arr: + if isinstance(value, dict): + # Shouldn't fail, even with the dot. + #? 17 dict() + value. + elif isinstance(value, int): + x = value + #? int() + x + +# ----------------- +# Names with multiple indices. +# ----------------- + +class Test(): + def __init__(self, testing): + if isinstance(testing, str): + self.testing = testing + else: + self.testing = 10 + + def boo(self): + if isinstance(self.testing, str): + # TODO this is wrong, it should only be str. + #? str() int() + self.testing + #? Test() + self + +# ----------------- +# Syntax +# ----------------- + +#? +isinstance(1, int()) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/keywords.py b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/keywords.py new file mode 100644 index 0000000..fa9bf52 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/keywords.py @@ -0,0 +1,59 @@ + +#? ['raise'] +raise + +#? ['Exception'] +except + +#? [] +b + continu + +#? [] +b + continue + +#? ['continue'] +b; continue + +#? ['continue'] +b; continu + +#? [] +c + pass + +#? [] +a + pass + +#? ['pass'] +b; pass + +# ----------------- +# Keywords should not appear everywhere. +# ----------------- + +#? [] +with open() as f +#? [] +def i +#? [] +class i + +#? [] +continue i + +# More syntax details, e.g. while only after newline, but not after semicolon, +# continue also after semicolon +#? ['while'] +while +#? [] +x while +#? [] +x; while +#? ['continue'] +x; continue + +#? [] +and +#? ['and'] +x and +#? [] +x * and diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/lambdas.py b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/lambdas.py new file mode 100644 index 0000000..524df0c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/lambdas.py @@ -0,0 +1,113 @@ +# ----------------- +# lambdas +# ----------------- +a = lambda: 3 +#? int() +a() + +x = [] +a = lambda x: x +#? int() +a(0) + +#? float() +(lambda x: x)(3.0) + +arg_l = lambda x, y: y, x +#? float() +arg_l[0]('', 1.0) +#? list() +arg_l[1] + +arg_l = lambda x, y: (y, x) +args = 1,"" +result = arg_l(*args) +#? tuple() +result +#? str() +result[0] +#? int() +result[1] + +def with_lambda(callable_lambda, *args, **kwargs): + return callable_lambda(1, *args, **kwargs) + +#? int() +with_lambda(arg_l, 1.0)[1] +#? float() +with_lambda(arg_l, 1.0)[0] +#? float() +with_lambda(arg_l, y=1.0)[0] +#? int() +with_lambda(lambda x: x) +#? float() +with_lambda(lambda x, y: y, y=1.0) + +arg_func = lambda *args, **kwargs: (args[0], kwargs['a']) +#? int() +arg_func(1, 2, a='', b=10)[0] +#? list() +arg_func(1, 2, a=[], b=10)[1] + +# magic method +a = lambda: 3 +#? ['__closure__'] +a.__closure__ + +class C(): + def __init__(self, foo=1.0): + self.a = lambda: 1 + self.foo = foo + + def ret(self): + return lambda: self.foo + + def with_param(self): + return lambda x: x + self.a() + + lambd = lambda self: self.foo + +#? int() +C().a() + +#? str() +C('foo').ret()() + +index = C().with_param()(1) +#? float() +['', 1, 1.0][index] + +#? float() +C().lambd() +#? int() +C(1).lambd() + + +def xy(param): + def ret(a, b): + return a + b + + return lambda b: ret(param, b) + +#? int() +xy(1)(2) + +# ----------------- +# lambda param (#379) +# ----------------- +class Test(object): + def __init__(self, pred=lambda a, b: a): + self.a = 1 + #? int() + self.a + #? float() + pred(1.0, 2) + +# ----------------- +# test_nocond in grammar (happens in list comprehensions with `if`) +# ----------------- +# Doesn't need to do anything yet. It should just not raise an error. These +# nocond lambdas make no sense at all. + +#? int() +[a for a in [1,2] if lambda: 3][0] diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/named_expression.py b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/named_expression.py new file mode 100644 index 0000000..37c835a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/named_expression.py @@ -0,0 +1,13 @@ +# python >= 3.8 +b = (a:=1, a) + +#? int() +b[0] +#? +b[1] + +# Should not fail +b = ('':=1,) + +#? int() +b[0] diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/named_param.py b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/named_param.py new file mode 100644 index 0000000..66ba59e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/named_param.py @@ -0,0 +1,62 @@ +""" +Named Params: +>>> def a(abc): pass +... +>>> a(abc=3) # <- this stuff (abc) +""" + +def a(abc): + pass + +#? 5 ['abc'] +a(abc) + + +def a(*some_args, **some_kwargs): + pass + +#? 11 [] +a(some_args) + +#? 13 [] +a(some_kwargs) + +def multiple(foo, bar): + pass + +#? 17 ['bar'] +multiple(foo, bar) + +#? ['bar'] +multiple(foo, bar + +my_lambda = lambda lambda_param: lambda_param + 1 +#? 22 ['lambda_param'] +my_lambda(lambda_param) + +# __call__ / __init__ +class Test(object): + def __init__(self, hello_other): + pass + + def __call__(self, hello): + pass + + def test(self, blub): + pass + +#? 10 ['hello_other'] +Test(hello=) +#? 12 ['hello'] +Test()(hello=) +#? 11 [] +Test()(self=) +#? 16 [] +Test().test(self=) +#? 16 ['blub'] +Test().test(blub=) + +# builtins + +#? 12 [] +any(iterable=) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/on_import.py b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/on_import.py new file mode 100644 index 0000000..733d741 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/on_import.py @@ -0,0 +1,110 @@ +def from_names(): + #? ['mod1'] + from import_tree.pkg. + #? ['path'] + from os. + +def from_names_goto(): + from import_tree import pkg + #? pkg + from import_tree.pkg + +def builtin_test(): + #? ['math'] + import math + +# ----------------- +# completions within imports +# ----------------- + +#? ['sqlite3'] +import sqlite3 + +#? ['classes'] +import classes + +#? ['timedelta'] +from datetime import timedel +#? 21 [] +from datetime.timedel import timedel + +# should not be possible, because names can only be looked up 1 level deep. +#? [] +from datetime.timedelta import resolution +#? [] +from datetime.timedelta import + +#? ['Cursor'] +from sqlite3 import Cursor + +#? ['some_variable'] +from . import some_variable +#? ['arrays'] +from . import arrays +#? [] +from . import import_tree as ren +#? [] +import json as + +import os +#? os.path.join +from os.path import join + +# ----------------- +# special positions -> edge cases +# ----------------- +import datetime + +#? 6 datetime +from datetime.time import time + +#? [] +import datetime. +#? [] +import datetime.date + +#? 21 ['import'] +from import_tree.pkg import pkg +#? 49 ['a', 'foobar', '__name__', '__doc__', '__file__', '__package__'] +from import_tree.pkg.mod1 import not_existant, # whitespace before +#? ['a', 'foobar', '__name__', '__doc__', '__file__', '__package__'] +from import_tree.pkg.mod1 import not_existant, +#? 22 ['mod1'] +from import_tree.pkg. import mod1 +#? 17 ['mod1', 'mod2', 'random', 'pkg', 'rename1', 'rename2', 'classes', 'recurse_class1', 'recurse_class2', 'invisible_pkg', 'flow_import'] +from import_tree. import pkg + +#? 18 ['pkg'] +from import_tree.p import pkg + +#? 17 ['import_tree'] +from .import_tree import +#? 10 ['run'] +from ..run import +#? ['run'] +from ..run +#? 10 ['run'] +from ..run. +#? [] +from ..run. + +#? ['run'] +from .. import run + +#? [] +from not_a_module import + + +#137 +import json +#? 23 json.dump +from json import load, dump +#? 17 json.load +from json import load, dump +# without the from clause: +import json, datetime +#? 7 json +import json, datetime +#? 13 datetime +import json, datetime + diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/ordering.py b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/ordering.py new file mode 100644 index 0000000..61eb192 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/ordering.py @@ -0,0 +1,195 @@ +# ----------------- +# normal +# ----------------- +a = "" +a = 1 + +#? int() +a +#? [] +a.append + +a = list + +b = 1; b = "" +#? str() +b + +# temp should not be accessible before definition +#? [] +temp + +a = 1 +temp = b; +b = a +a = temp +#? int() +b +#? int() +b +#? str() +a + +a = tuple +if 1: + a = list + +#? ['append'] +a.append +#? ['index'] +a.index + +# ----------------- +# tuples exchanges +# ----------------- +a, b = 1, "" +#? int() +a +#? str() +b + +b, a = a, b +#? int() +b +#? str() +a + +b, a = a, b +#? int() +a +#? str() +b + +# ----------------- +# function +# ----------------- +def a(a=3): + #? int() + a + #? [] + a.func + return a + +#? int() +a(2) +#? [] +a(2).func + +a_param = 3 +def func(a_param): + # should not be int + #? [] + a_param. + +from os import path + + +# should not return a function, because `a` is a function above +def f(b, a): return a +#? [] +f(b=3). + +# ----------------- +# closure +# ----------------- + +def x(): + a = 0 + + def x(): + return a + + a = 3.0 + return x() + +#? float() +x() + +# ----------------- +# class +# ----------------- +class A(object): + a = "" + a = 3 + #? int() + a + a = list() + def __init__(self): + self.b = "" + + def before(self): + self.b = 3 + # TODO should this be so? include entries after cursor? + #? int() str() list + self.b + self.b = list + + self.a = 1 + #? str() int() + self.a + + #? ['after'] + self.after + + self.c = 3 + #? int() + self.c + + def after(self): + self.a = '' + + c = set() + +#? list() +A.a + +a = A() +#? ['after'] +a.after +#? [] +a.upper +#? [] +a.append +#? [] +a.real + +#? str() int() +a.a + +a = 3 +class a(): + def __init__(self, a): + self.a = a + +#? float() +a(1.0).a +#? +a().a + +# ----------------- +# imports +# ----------------- + +math = 3 +import math +#? ['cosh'] +math.cosh +#? [] +math.real + +math = 3 +#? int() +math +#? [] +math.cos + +# do the same for star imports +cosh = 3 +from math import * +# cosh doesn't work, but that's not a problem, star imports should be at the +# start of EVERY script! +cosh.real + +cosh = 3 +#? int() +cosh diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/parser.py b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/parser.py new file mode 100644 index 0000000..68793f4 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/parser.py @@ -0,0 +1,43 @@ +""" +Issues with the parser and not the type inference should be part of this file. +""" + +class IndentIssues(): + """ + issue jedi-vim#288 + Which is really a fast parser issue. It used to start a new block at the + parentheses, because it had problems with the indentation. + """ + def one_param( + self, + ): + return 1 + + def with_param( + self, + y): + return y + + + +#? int() +IndentIssues().one_param() + +#? str() +IndentIssues().with_param('') + + +""" +Just because there's a def keyword, doesn't mean it should not be able to +complete to definition. +""" +definition = 0 +#? ['definition'] +str(def + + +# It might be hard to determine the context +class Foo(object): + @property + #? ['str'] + def bar(str diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/pep0484_basic.py b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/pep0484_basic.py new file mode 100644 index 0000000..aef5437 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/pep0484_basic.py @@ -0,0 +1,183 @@ +""" Pep-0484 type hinting """ + +# python >= 3.4 + + +class A(): + pass + + +def function_parameters(a: A, b, c: str, d: int, e: str, f: str, g: int=4): + """ + :param e: if docstring and annotation agree, only one should be returned + :type e: str + :param f: if docstring and annotation disagree, both should be returned + :type f: int + """ + #? A() + a + #? + b + #? str() + c + #? int() + d + #? str() + e + #? int() str() + f + # int() + g + + +def return_unspecified(): + pass + +#? +return_unspecified() + + +def return_none() -> None: + """ + Return type None means the same as no return type as far as jedi + is concerned + """ + pass + +#? +return_none() + + +def return_str() -> str: + pass + +#? str() +return_str() + + +def return_custom_class() -> A: + pass + +#? A() +return_custom_class() + + +def return_annotation_and_docstring() -> str: + """ + :rtype: int + """ + pass + +#? str() +return_annotation_and_docstring() + + +def return_annotation_and_docstring_different() -> str: + """ + :rtype: str + """ + pass + +#? str() +return_annotation_and_docstring_different() + + +def annotation_forward_reference(b: "B") -> "B": + #? B() + b + +#? ["test_element"] +annotation_forward_reference(1).t + +class B: + test_element = 1 + pass + +#? B() +annotation_forward_reference(1) + + +class SelfReference: + test_element = 1 + def test_method(self, x: "SelfReference") -> "SelfReference": + #? SelfReference() + x + #? ["test_element", "test_method"] + self.t + #? ["test_element", "test_method"] + x.t + #? ["test_element", "test_method"] + self.test_method(1).t + +#? SelfReference() +SelfReference().test_method() + +def function_with_non_pep_0484_annotation( + x: "I can put anything here", + xx: "", + yy: "\r\n\0;+*&^564835(---^&*34", + y: 3 + 3, + zz: float) -> int("42"): + # infers int from function call + #? int() + x + # infers int from function call + #? int() + xx + # infers int from function call + #? int() + yy + # infers str from function call + #? str() + y + #? float() + zz +#? +function_with_non_pep_0484_annotation(1, 2, 3, "force string") + +def function_forward_reference_dynamic( + x: return_str_type(), + y: "return_str_type()") -> None: + #? str() + x + #? str() + y + +def return_str_type(): + return str + + +X = str +def function_with_assined_class_in_reference(x: X, y: "Y"): + #? str() + x + #? int() + y +Y = int + +def just_because_we_can(x: "flo" + "at"): + #? float() + x + + +def keyword_only(a: str, *, b: str): + #? ['startswith'] + a.startswi + #? ['startswith'] + b.startswi + + +def argskwargs(*args: int, **kwargs: float): + """ + This might be a bit confusing, but is part of the standard. + args is changed to Tuple[int] in this case and kwargs to Dict[str, float], + which makes sense if you think about it a bit. + """ + #? tuple() + args + #? int() + args[0] + #? str() + next(iter(kwargs.keys())) + #? float() + kwargs[''] diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/pep0484_comments.py b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/pep0484_comments.py new file mode 100644 index 0000000..9f0661e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/pep0484_comments.py @@ -0,0 +1,186 @@ +a = 3 # type: str +#? str() +a + +b = 3 # type: str but I write more +#? int() +b + +c = 3 # type: str # I comment more +#? str() +c + +d = "It should not read comments from the next line" +# type: int +#? str() +d + +# type: int +e = "It should not read comments from the previous line" +#? str() +e + +class BB: pass + +def test(a, b): + a = a # type: BB + c = a # type: str + d = a + # type: str + e = a # type: str # Should ignore long whitespace + + #? BB() + a + #? str() + c + #? BB() + d + #? str() + e + +a,b = 1, 2 # type: str, float +#? str() +a +#? float() +b + +class Employee: + pass + +from typing import List, Tuple +x = [] # type: List[Employee] +#? Employee() +x[1] +x, y, z = [], [], [] # type: List[int], List[int], List[str] +#? int() +y[2] +x, y, z = [], [], [] # type: (List[float], List[float], List[BB]) +for zi in z: + #? BB() + zi + +x = [ + 1, + 2, +] # type: List[str] + +#? str() +x[1] + + +for bar in foo(): # type: str + #? str() + bar + +for bar, baz in foo(): # type: int, float + #? int() + bar + #? float() + baz + +for bar, baz in foo(): + # type: str, str + """ type hinting on next line should not work """ + #? + bar + #? + baz + +with foo(): # type: int + ... + +with foo() as f: # type: str + #? str() + f + +with foo() as f: + # type: str + """ type hinting on next line should not work """ + #? + f + +aaa = some_extremely_long_function_name_that_doesnt_leave_room_for_hints() \ + # type: float # We should be able to put hints on the next line with a \ +#? float() +aaa + +# Test instance methods +class Dog: + def __init__(self, age, friends, name): + # type: (int, List[Tuple[str, Dog]], str) -> None + #? int() + self.age = age + self.friends = friends + + #? Dog() + friends[0][1] + + #? str() + self.name = name + + def friend_for_name(self, name): + # type: (str) -> Dog + for (friend_name, friend) in self.friends: + if friend_name == name: + return friend + raise ValueError() + + def bark(self): + pass + +buddy = Dog(UNKNOWN_NAME1, UNKNOWN_NAME2, UNKNOWN_NAME3) +friend = buddy.friend_for_name('buster') +# type of friend is determined by function return type +#! 9 ['def bark'] +friend.bark() + +friend = buddy.friends[0][1] +# type of friend is determined by function parameter type +#! 9 ['def bark'] +friend.bark() + +# type is determined by function parameter type following nested generics +#? str() +friend.name + +# Mypy comment describing function return type. +def annot(): + # type: () -> str + pass + +#? str() +annot() + +# Mypy variable type annotation. +x = UNKNOWN_NAME2 # type: str + +#? str() +x + +class Cat(object): + def __init__(self, age, friends, name): + # type: (int, List[Dog], str) -> None + self.age = age + self.friends = friends + self.name = name + +cat = Cat(UNKNOWN_NAME4, UNKNOWN_NAME5, UNKNOWN_NAME6) +#? str() +cat.name + + +# Check potential errors +def x(a, b): + # type: ([) -> a + #? + a +def x(a, b): + # type: (1) -> a + #? + a +def x(a, b, c): + # type: (str) -> a + #? + b + #? + c diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/pep0484_typing.py b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/pep0484_typing.py new file mode 100644 index 0000000..56c506d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/pep0484_typing.py @@ -0,0 +1,424 @@ +""" +Test the typing library, with docstrings. This is needed since annotations +are not supported in python 2.7 else then annotating by comment (and this is +still TODO at 2016-01-23) +""" +import typing +class B: + pass + +def we_can_has_sequence(p, q, r, s, t, u): + """ + :type p: typing.Sequence[int] + :type q: typing.Sequence[B] + :type r: typing.Sequence[int] + :type s: typing.Sequence["int"] + :type t: typing.MutableSequence[dict] + :type u: typing.List[float] + """ + #? ["count"] + p.c + #? int() + p[1] + #? ["count"] + q.c + #? B() + q[1] + #? ["count"] + r.c + #? int() + r[1] + #? ["count"] + s.c + #? int() + s[1] + #? [] + s.a + #? ["append"] + t.a + #? dict() + t[1] + #? ["append"] + u.a + #? float() list() + u[1.0] + #? float() + u[1] + +def iterators(ps, qs, rs, ts): + """ + :type ps: typing.Iterable[int] + :type qs: typing.Iterator[str] + :type rs: typing.Sequence["ForwardReference"] + :type ts: typing.AbstractSet["float"] + """ + for p in ps: + #? int() + p + #? + next(ps) + a, b = ps + #? int() + a + ##? int() --- TODO fix support for tuple assignment + # https://github.com/davidhalter/jedi/pull/663#issuecomment-172317854 + # test below is just to make sure that in case it gets fixed by accident + # these tests will be fixed as well the way they should be + #? + b + + for q in qs: + #? str() + q + #? str() + next(qs) + for r in rs: + #? ForwardReference() + r + #? + next(rs) + for t in ts: + #? float() + t + +def sets(p, q): + """ + :type p: typing.AbstractSet[int] + :type q: typing.MutableSet[float] + """ + #? [] + p.a + #? ["add"] + q.a + +def tuple(p, q, r): + """ + :type p: typing.Tuple[int] + :type q: typing.Tuple[int, str, float] + :type r: typing.Tuple[B, ...] + """ + #? int() + p[0] + #? int() + q[0] + #? str() + q[1] + #? float() + q[2] + #? B() + r[0] + #? B() + r[1] + #? B() + r[2] + #? B() + r[10000] + i, s, f = q + #? int() + i + #? str() + s + #? float() + f + +class Key: + pass + +class Value: + pass + +def mapping(p, q, d, dd, r, s, t): + """ + :type p: typing.Mapping[Key, Value] + :type q: typing.MutableMapping[Key, Value] + :type d: typing.Dict[Key, Value] + :type dd: typing.DefaultDict[Key, Value] + :type r: typing.KeysView[Key] + :type s: typing.ValuesView[Value] + :type t: typing.ItemsView[Key, Value] + """ + #? [] + p.setd + #? ["setdefault"] + q.setd + #? ["setdefault"] + d.setd + #? ["setdefault"] + dd.setd + #? Value() + p[1] + for key in p: + #? Key() + key + for key in p.keys(): + #? Key() + key + for value in p.values(): + #? Value() + value + for item in p.items(): + #? Key() + item[0] + #? Value() + item[1] + (key, value) = item + #? Key() + key + #? Value() + value + for key, value in p.items(): + #? Key() + key + #? Value() + value + for key, value in q.items(): + #? Key() + key + #? Value() + value + for key, value in d.items(): + #? Key() + key + #? Value() + value + for key, value in dd.items(): + #? Key() + key + #? Value() + value + for key in r: + #? Key() + key + for value in s: + #? Value() + value + for key, value in t: + #? Key() + key + #? Value() + value + +def union(p, q, r, s, t): + """ + :type p: typing.Union[int] + :type q: typing.Union[int, int] + :type r: typing.Union[int, str, "int"] + :type s: typing.Union[int, typing.Union[str, "typing.Union['float', 'dict']"]] + :type t: typing.Union[int, None] + """ + #? int() + p + #? int() + q + #? int() str() + r + #? int() str() float() dict() + s + #? int() + t + +def optional(p): + """ + :type p: typing.Optional[int] + Optional does not do anything special. However it should be recognised + as being of that type. Jedi doesn't do anything with the extra into that + it can be None as well + """ + #? int() None + p + +class ForwardReference: + pass + +class TestDict(typing.Dict[str, int]): + def setdud(self): + pass + +def testdict(x): + """ + :type x: TestDict + """ + #? ["setdud", "setdefault"] + x.setd + for key in x.keys(): + #? str() + key + for value in x.values(): + #? int() + value + +x = TestDict() +#? ["setdud", "setdefault"] +x.setd +for key in x.keys(): + #? str() + key +for value in x.values(): + #? int() + value + +WrappingType = typing.NewType('WrappingType', str) # Chosen arbitrarily +y = WrappingType(0) # Per https://github.com/davidhalter/jedi/issues/1015#issuecomment-355795929 +#? str() +y + +def testnewtype(y): + """ + :type y: WrappingType + """ + #? str() + y + #? ["upper"] + y.u + +WrappingType2 = typing.NewType() + +def testnewtype2(y): + """ + :type y: WrappingType2 + """ + #? + y + #? [] + y. +# python >= 3.4 + +class TestDefaultDict(typing.DefaultDict[str, int]): + def setdud(self): + pass + +def testdict(x): + """ + :type x: TestDefaultDict + """ + #? ["setdud", "setdefault"] + x.setd + for key in x.keys(): + #? str() + key + for value in x.values(): + #? int() + value + +x = TestDefaultDict() +#? ["setdud", "setdefault"] +x.setd +for key in x.keys(): + #? str() + key +for value in x.values(): + #? int() + value +# python >= 3.4 + + +""" +docstrings have some auto-import, annotations can use all of Python's +import logic +""" +import typing as t +def union2(x: t.Union[int, str]): + #? int() str() + x +from typing import Union +def union3(x: Union[int, str]): + #? int() str() + x + +from typing import Union as U +def union4(x: U[int, str]): + #? int() str() + x + +# ------------------------- +# Type Vars +# ------------------------- + +TYPE_VARX = typing.TypeVar('TYPE_VARX') +TYPE_VAR_CONSTRAINTSX = typing.TypeVar('TYPE_VAR_CONSTRAINTSX', str, int) +# TODO there should at least be some results. +#? [] +TYPE_VARX. +#! ["TYPE_VARX = typing.TypeVar('TYPE_VARX')"] +TYPE_VARX + + +class WithTypeVar(typing.Generic[TYPE_VARX]): + def lala(self) -> TYPE_VARX: + ... + + +def maaan(p: WithTypeVar[int]): + #? int() + p.lala() + +def in_out1(x: TYPE_VARX) -> TYPE_VARX: ... + +#? int() +in_out1(1) +#? str() +in_out1("") +#? str() +in_out1(str()) +#? +in_out1() + +def in_out2(x: TYPE_VAR_CONSTRAINTSX) -> TYPE_VAR_CONSTRAINTSX: ... + +#? int() +in_out2(1) +#? str() +in_out2("") +#? str() +in_out2(str()) +#? str() int() +in_out2() +# TODO this should actually be str() int(), because of the constraints. +#? float() +in_out2(1.0) + +# ------------------------- +# TYPE_CHECKING +# ------------------------- + +if typing.TYPE_CHECKING: + with_type_checking = 1 +else: + without_type_checking = 1.0 +#? int() +with_type_checking +#? +without_type_checking + +def foo(a: typing.List, b: typing.Dict, c: typing.MutableMapping) -> typing.Type[int]: + #? ['append'] + a.appen + #? list() + a + #? + a[0] + #? ['setdefault'] + b.setd + #? ['setdefault'] + c.setd + #? typing.MutableMapping() + c + #? + c['asdf'] +#? int +foo() + +# ------------------------- +# cast +# ------------------------- + +def cast_tests(): + x = 3.0 + y = typing.cast(int, x) + #? int() + y + return typing.cast(str, x) + + +#? str() +cast_tests() diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/pep0526_variables.py b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/pep0526_variables.py new file mode 100644 index 0000000..6af77d9 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/pep0526_variables.py @@ -0,0 +1,115 @@ +""" +PEP 526 introduced a new way of using type annotations on variables. It was +introduced in Python 3.6. +""" +# python >= 3.6 + +import typing + +asdf = '' +asdf: int +# This is not necessarily correct, but for now this is ok (at least no error). +#? int() +asdf + + +direct: int = NOT_DEFINED +#? int() +direct + +with_typing_module: typing.List[float] = NOT_DEFINED +#? float() +with_typing_module[0] + +somelist = [1, 2, 3, "A", "A"] +element : int +for element in somelist: + #? int() + element + +test_string: str = NOT_DEFINED +#? str() +test_string + + +char: str +for char in NOT_DEFINED: + #? str() + char + + +# ------------------------- +# instance/class vars +# ------------------------- + +class Foo(): + bar: int + baz: typing.ClassVar[str] + + +#? +Foo.bar +#? int() +Foo().bar +#? str() +Foo.baz +#? str() +Foo().baz + +class VarClass: + var_instance1: int = 1 + var_instance2: float + var_class1: typing.ClassVar[str] = 1 + var_class2: typing.ClassVar[bytes] + + def __init__(self): + #? int() + d.var_instance1 + #? float() + d.var_instance2 + #? str() + d.var_class1 + #? bytes() + d.var_class2 + #? [] + d.int + #? ['var_class1', 'var_class2', 'var_instance1', 'var_instance2'] + self.var_ + + +#? ['var_class1', 'var_class2'] +VarClass.var_ +#? +VarClass.var_instance1 +#? +VarClass.var_instance2 +#? str() +VarClass.var_class1 +#? bytes() +VarClass.var_class2 +#? [] +VarClass.int + +d = VarClass() +#? ['var_class1', 'var_class2', 'var_instance1', 'var_instance2'] +d.var_ +#? int() +d.var_instance1 +#? float() +d.var_instance2 +#? str() +d.var_class1 +#? bytes() +d.var_class2 +#? [] +d.int + + + +import dataclasses +@dataclasses.dataclass +class DC: + name: int = 1 + +#? int() +DC().name diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/positional_only_params.py b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/positional_only_params.py new file mode 100644 index 0000000..4126151 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/positional_only_params.py @@ -0,0 +1,29 @@ +# python >= 3.8 + +def positional_only_call(a, /, b): + #? str() + a + #? int() + b + return a + b + + +#? int() str() +positional_only_call('', 1) + + +def positional_only_call2(a, /, b=3): + return a + b + +#? int() +positional_only_call2(1) +#? int() +positional_only_call2(SOMETHING_UNDEFINED) +#? str() +positional_only_call2(SOMETHING_UNDEFINED, '') + +# Maybe change this? Because it's actually not correct +#? int() str() +positional_only_call2(a=1, b='') +#? tuple str() +positional_only_call2(b='', a=tuple) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/precedence.py b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/precedence.py new file mode 100644 index 0000000..6e9c1ea --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/precedence.py @@ -0,0 +1,143 @@ +""" +Test Jedi's operation understanding. Jedi should understand simple additions, +multiplications, etc. +""" +# ----------------- +# numbers +# ----------------- +x = [1, 'a', 1.0] + +#? int() str() float() +x[12] + +#? float() +x[1 + 1] + +index = 0 + 1 + +#? str() +x[index] + +#? int() +x[1 + (-1)] + +def calculate(number): + return number + constant + +constant = 1 + +#? float() +x[calculate(1)] + +def calculate(number): + return number + constant + +# ----------------- +# strings +# ----------------- + +x = 'upp' + 'e' + +#? str.upper +getattr(str, x + 'r') + +a = "a"*3 +#? str() +a +a = 3 * "a" +#? str() +a + +a = 3 * "a" +#? str() +a + +#? int() +(3 ** 3) +#? int() str() +(3 ** 'a') + +class X(): + foo = 2 +#? int() +(X.foo ** 3) + +# ----------------- +# assignments +# ----------------- + +x = [1, 'a', 1.0] + +i = 0 +i += 1 +i += 1 +#? float() +x[i] + +i = 1 +i += 1 +i -= 3 +i += 1 +#? int() +x[i] + +# ----------------- +# in +# ----------------- + +if 'X' in 'Y': + a = 3 +else: + a = '' +# For now don't really check for truth values. So in should return both +# results. +#? str() int() +a + +# ----------------- +# for flow assignments +# ----------------- + +class FooBar(object): + fuu = 0.1 + raboof = 'fourtytwo' + +# targets should be working +target = '' +for char in ['f', 'u', 'u']: + target += char +#? float() +getattr(FooBar, target) + +# github #24 +target = u'' +for char in reversed(['f', 'o', 'o', 'b', 'a', 'r']): + target += char + +#? str() +getattr(FooBar, target) + + +# ----------------- +# repetition problems -> could be very slow and memory expensive - shouldn't +# be. +# ----------------- + +b = [str(1)] +l = list +for x in [l(0), l(1), l(2), l(3), l(4), l(5), l(6), l(7), l(8), l(9), l(10), + l(11), l(12), l(13), l(14), l(15), l(16), l(17), l(18), l(19), l(20), + l(21), l(22), l(23), l(24), l(25), l(26), l(27), l(28), l(29)]: + b += x + +#? str() +b[1] + + +# ----------------- +# undefined names +# ----------------- +a = foobarbaz + 'hello' + +#? int() float() +{'hello': 1, 'bar': 1.0}[a] diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/recursion.py b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/recursion.py new file mode 100644 index 0000000..ebbd69e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/recursion.py @@ -0,0 +1,93 @@ +""" +Code that might cause recursion issues (or has caused in the past). +""" + +def Recursion(): + def recurse(self): + self.a = self.a + self.b = self.b.recurse() + +#? +Recursion().a + +#? +Recursion().b + + +class X(): + def __init__(self): + self.recursive = [1, 3] + + def annoying(self): + self.recursive = [self.recursive[0]] + + def recurse(self): + self.recursive = [self.recursive[1]] + +#? int() +X().recursive[0] + + +def to_list(iterable): + return list(set(iterable)) + + +def recursion1(foo): + return to_list(to_list(foo)) + recursion1(foo) + +#? int() +recursion1([1,2])[0] + + +class FooListComp(): + def __init__(self): + self.recursive = [1] + + def annoying(self): + self.recursive = [x for x in self.recursive] + + +#? int() +FooListComp().recursive[0] + + +class InstanceAttributeIfs: + def b(self): + self.a1 = 1 + self.a2 = 1 + + def c(self): + self.a2 = '' + + def x(self): + self.b() + + if self.a1 == 1: + self.a1 = self.a1 + 1 + if self.a2 == UNDEFINED: + self.a2 = self.a2 + 1 + + #? int() + self.a1 + #? int() str() + self.a2 + +#? int() +InstanceAttributeIfs().a1 +#? int() str() +InstanceAttributeIfs().a2 + + + +class A: + def a(self, b): + for x in [self.a(i) for i in b]: + #? + x + +class B: + def a(self, b): + for i in b: + for i in self.a(i): + #? + yield i diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/stdlib.py b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/stdlib.py new file mode 100644 index 0000000..423212b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/stdlib.py @@ -0,0 +1,332 @@ +""" +std library stuff +""" + +# ----------------- +# builtins +# ----------------- +arr = [''] + +#? str() +sorted(arr)[0] + +#? str() +next(reversed(arr)) +next(reversed(arr)) + +# should not fail if there's no return value. +def yielder(): + yield None + +#? None +next(reversed(yielder())) + +# empty reversed should not raise an error +#? +next(reversed()) + +#? str() bytes() +next(open('')) + +#? int() +{'a':2}.setdefault('a', 3) + +# Compiled classes should have the meta class attributes. +#? ['__itemsize__'] +tuple.__itemsize__ +#? [] +tuple().__itemsize__ + +# ----------------- +# type() calls with one parameter +# ----------------- +#? int +type(1) +#? int +type(int()) +#? type +type(int) +#? type +type(type) +#? list +type([]) + +def x(): + yield 1 +generator = type(x()) +#? generator +type(x for x in []) +#? type(x) +type(lambda: x) + +import math +import os +#? type(os) +type(math) +class X(): pass +#? type +type(X) + +# ----------------- +# type() calls with multiple parameters +# ----------------- + +X = type('X', (object,), dict(a=1)) + +# Doesn't work yet. +#? +X.a +#? +X + +if os.path.isfile(): + #? ['abspath'] + fails = os.path.abspath + +# The type vars and other underscored things from typeshed should not be +# findable. +#? +os._T + + +with open('foo') as f: + for line in f.readlines(): + #? str() bytes() + line +# ----------------- +# enumerate +# ----------------- +for i, j in enumerate(["as", "ad"]): + #? int() + i + #? str() + j + +# ----------------- +# re +# ----------------- +import re +c = re.compile(r'a') +# re.compile should not return str -> issue #68 +#? [] +c.startswith +#? int() +c.match().start() + +#? int() +re.match(r'a', 'a').start() + +for a in re.finditer('a', 'a'): + #? int() + a.start() + +# ----------------- +# ref +# ----------------- +import weakref + +#? int() +weakref.proxy(1) + +#? weakref.ref() +weakref.ref(1) +#? int() None +weakref.ref(1)() + +# ----------------- +# functools +# ----------------- +import functools + +basetwo = functools.partial(int, base=2) +#? int() +basetwo() + +def function(a, b): + return a, b +a = functools.partial(function, 0) + +#? int() +a('')[0] +#? str() +a('')[1] + +kw = functools.partial(function, b=1.0) +tup = kw(1) +#? int() +tup[0] +#? float() +tup[1] + +def my_decorator(f): + @functools.wraps(f) + def wrapper(*args, **kwds): + return f(*args, **kwds) + return wrapper + +@my_decorator +def example(a): + return a + +#? str() +example('') + + +# ----------------- +# sqlite3 (#84) +# ----------------- + +import sqlite3 +#? sqlite3.Connection() +con = sqlite3.connect() +#? sqlite3.Cursor() +c = con.cursor() + +def huhu(db): + """ + :type db: sqlite3.Connection + :param db: the db connection + """ + #? sqlite3.Connection() + db + +# ----------------- +# hashlib +# ----------------- + +import hashlib + +#? ['md5'] +hashlib.md5 + +# ----------------- +# copy +# ----------------- + +import copy +#? int() +copy.deepcopy(1) + +#? +copy.copy() + +# ----------------- +# json +# ----------------- + +# We don't want any results for json, because it depends on IO. +import json +#? +json.load('asdf') +#? +json.loads('[1]') + +# ----------------- +# random +# ----------------- + +import random +class A(object): + def say(self): pass +class B(object): + def shout(self): pass +cls = random.choice([A, B]) +#? ['say', 'shout'] +cls().s + +# ----------------- +# random +# ----------------- + +import zipfile +z = zipfile.ZipFile("foo") +# It's too slow. So we don't run it at the moment. +##? ['upper'] +z.read('name').upper + +# ----------------- +# contextlib +# ----------------- + +import contextlib +with contextlib.closing('asd') as string: + #? str() + string + +# ----------------- +# operator +# ----------------- + +import operator + +f = operator.itemgetter(1) +#? float() +f([1.0]) +#? str() +f([1, '']) + +g = operator.itemgetter(1, 2) +x1, x2 = g([1, 1.0, '']) +#? float() +x1 +#? str() +x2 + +x1, x2 = g([1, '']) +#? str() +x1 +#? int() str() +x2 + +# ----------------- +# shlex +# ----------------- + +# Github issue #929 +import shlex +qsplit = shlex.split("foo, ferwerwerw werw werw e") +for part in qsplit: + #? str() + part + +# ----------------- +# Unknown metaclass +# ----------------- + +# Github issue 1321 +class Meta(object): + pass + +class Test(metaclass=Meta): + def test_function(self): + result = super(Test, self).test_function() + #? [] + result. + +# ----------------- +# Enum +# ----------------- + +# python >= 3.4 +import enum + +class X(enum.Enum): + attr_x = 3 + attr_y = 2.0 + +#? ['mro'] +X.mro +#? ['attr_x', 'attr_y'] +X.attr_ +#? str() +X.attr_x.name +#? int() +X.attr_x.value +#? str() +X.attr_y.name +#? float() +X.attr_y.value +#? str() +X().name +#? float() +X().attr_x.attr_y.value diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/stub_folder/stub_only.pyi b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/stub_folder/stub_only.pyi new file mode 100644 index 0000000..4f2f423 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/stub_folder/stub_only.pyi @@ -0,0 +1 @@ +in_stub_only: int diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/stub_folder/stub_only_folder/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/stub_folder/stub_only_folder/__init__.pyi new file mode 100644 index 0000000..77cf246 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/stub_folder/stub_only_folder/__init__.pyi @@ -0,0 +1 @@ +in_stub_only_folder: int diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/stub_folder/stub_only_folder/nested_stub_only.pyi b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/stub_folder/stub_only_folder/nested_stub_only.pyi new file mode 100644 index 0000000..4f2f423 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/stub_folder/stub_only_folder/nested_stub_only.pyi @@ -0,0 +1 @@ +in_stub_only: int diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/stub_folder/stub_only_folder/nested_with_stub.py b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/stub_folder/stub_only_folder/nested_with_stub.py new file mode 100644 index 0000000..0f9111f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/stub_folder/stub_only_folder/nested_with_stub.py @@ -0,0 +1,2 @@ +in_python = '' +in_both = '' diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/stub_folder/stub_only_folder/nested_with_stub.pyi b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/stub_folder/stub_only_folder/nested_with_stub.pyi new file mode 100644 index 0000000..53dc265 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/stub_folder/stub_only_folder/nested_with_stub.pyi @@ -0,0 +1,2 @@ +in_stub: int +in_both: float diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/stub_folder/stub_only_folder/python_only.py b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/stub_folder/stub_only_folder/python_only.py new file mode 100644 index 0000000..23370e0 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/stub_folder/stub_only_folder/python_only.py @@ -0,0 +1 @@ +in_python = '' diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/stub_folder/with_stub.py b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/stub_folder/with_stub.py new file mode 100644 index 0000000..7f064dc --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/stub_folder/with_stub.py @@ -0,0 +1,2 @@ +in_with_stub_both = 5 +in_with_stub_python = 8 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/stub_folder/with_stub.pyi b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/stub_folder/with_stub.pyi new file mode 100644 index 0000000..7a3f3ec --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/stub_folder/with_stub.pyi @@ -0,0 +1,2 @@ +in_with_stub_both: str +in_with_stub_stub: float diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/stub_folder/with_stub_folder/__init__.py b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/stub_folder/with_stub_folder/__init__.py new file mode 100644 index 0000000..4201289 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/stub_folder/with_stub_folder/__init__.py @@ -0,0 +1,2 @@ +in_with_stub_both_folder = 5 +in_with_stub_python_folder = 8 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/stub_folder/with_stub_folder/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/stub_folder/with_stub_folder/__init__.pyi new file mode 100644 index 0000000..ea7ec38 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/stub_folder/with_stub_folder/__init__.pyi @@ -0,0 +1,2 @@ +in_with_stub_both_folder: str +in_with_stub_stub_folder: float diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/stub_folder/with_stub_folder/nested_stub_only.pyi b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/stub_folder/with_stub_folder/nested_stub_only.pyi new file mode 100644 index 0000000..4f2f423 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/stub_folder/with_stub_folder/nested_stub_only.pyi @@ -0,0 +1 @@ +in_stub_only: int diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/stub_folder/with_stub_folder/nested_with_stub.py b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/stub_folder/with_stub_folder/nested_with_stub.py new file mode 100644 index 0000000..0f9111f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/stub_folder/with_stub_folder/nested_with_stub.py @@ -0,0 +1,2 @@ +in_python = '' +in_both = '' diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/stub_folder/with_stub_folder/nested_with_stub.pyi b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/stub_folder/with_stub_folder/nested_with_stub.pyi new file mode 100644 index 0000000..53dc265 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/stub_folder/with_stub_folder/nested_with_stub.pyi @@ -0,0 +1,2 @@ +in_stub: int +in_both: float diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/stub_folder/with_stub_folder/python_only.py b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/stub_folder/with_stub_folder/python_only.py new file mode 100644 index 0000000..23370e0 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/stub_folder/with_stub_folder/python_only.py @@ -0,0 +1 @@ +in_python = '' diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/stubs.py b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/stubs.py new file mode 100644 index 0000000..8301354 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/stubs.py @@ -0,0 +1,104 @@ +# python >= 3.4 +from stub_folder import with_stub, stub_only, with_stub_folder, stub_only_folder + +# ------------------------- +# Just files +# ------------------------- + +#? int() +stub_only.in_stub_only +#? str() +with_stub.in_with_stub_both +#? int() +with_stub.in_with_stub_python +#? float() +with_stub.in_with_stub_stub + +#! ['in_stub_only: int'] +stub_only.in_stub_only +#! ['in_with_stub_both = 5'] +with_stub.in_with_stub_both +#! ['in_with_stub_python = 8'] +with_stub.in_with_stub_python +#! ['in_with_stub_stub: float'] +with_stub.in_with_stub_stub + +#? ['in_stub_only'] +stub_only.in_ +#? ['in_stub_only'] +from stub_folder.stub_only import in_ +#? ['in_with_stub_both', 'in_with_stub_python', 'in_with_stub_stub'] +with_stub.in_ +#? ['in_with_stub_both', 'in_with_stub_python', 'in_with_stub_stub'] +from stub_folder.with_stub import in_ + +#? ['with_stub', 'stub_only', 'with_stub_folder', 'stub_only_folder'] +from stub_folder. + +# ------------------------- +# Folders +# ------------------------- + +#? int() +stub_only_folder.in_stub_only_folder +#? str() +with_stub_folder.in_with_stub_both_folder +#? int() +with_stub_folder.in_with_stub_python_folder +#? float() +with_stub_folder.in_with_stub_stub_folder + +#? ['in_stub_only_folder'] +stub_only_folder.in_ +#? ['in_with_stub_both_folder', 'in_with_stub_python_folder', 'in_with_stub_stub_folder'] +with_stub_folder.in_ + +# ------------------------- +# Folders nested with stubs +# ------------------------- + +from stub_folder.with_stub_folder import nested_stub_only, nested_with_stub, \ + python_only + +#? int() +nested_stub_only.in_stub_only +#? float() +nested_with_stub.in_both +#? str() +nested_with_stub.in_python +#? int() +nested_with_stub.in_stub +#? str() +python_only.in_python + +#? ['in_stub_only_folder'] +stub_only_folder.in_ +#? ['in_with_stub_both_folder', 'in_with_stub_python_folder', 'in_with_stub_stub_folder'] +with_stub_folder.in_ +#? ['in_python'] +python_only.in_ + +# ------------------------- +# Folders nested with stubs +# ------------------------- + +from stub_folder.stub_only_folder import nested_stub_only, nested_with_stub, \ + python_only + +#? int() +nested_stub_only.in_stub_only +#? float() +nested_with_stub.in_both +#? str() +nested_with_stub.in_python +#? int() +nested_with_stub.in_stub +#? str() +python_only.in_python + +#? ['in_stub_only'] +nested_stub_only.in_ +#? ['in_both', 'in_python', 'in_stub'] +nested_with_stub.in_ +#? ['in_python'] +python_only.in_ diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/sys_path.py b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/sys_path.py new file mode 100644 index 0000000..890f2fe --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/sys_path.py @@ -0,0 +1,24 @@ + +import sys +import os +from os import dirname + +sys.path.insert(0, '../../jedi') +sys.path.append(dirname(os.path.abspath('thirdparty' + os.path.sep + 'asdf'))) + +# modifications, that should fail: +# syntax err +sys.path.append('a' +* '/thirdparty') + +#? ['evaluate'] +import evaluate + +#? ['evaluator_function_cache'] +evaluate.Evaluator_fu + +# Those don't work because dirname and abspath are not properly understood. +##? ['jedi_'] +import jedi_ + +##? ['el'] +jedi_.el diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/thirdparty/PyQt4_.py b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/thirdparty/PyQt4_.py new file mode 100644 index 0000000..f4e4183 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/thirdparty/PyQt4_.py @@ -0,0 +1,19 @@ +from PyQt4.QtCore import * +from PyQt4.QtGui import * + +#? ['QActionGroup'] +QActionGroup + +#? ['currentText'] +QStyleOptionComboBox().currentText + +#? [] +QStyleOptionComboBox().currentText. + +from PyQt4 import QtGui + +#? ['currentText'] +QtGui.QStyleOptionComboBox().currentText + +#? [] +QtGui.QStyleOptionComboBox().currentText. diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/thirdparty/django_.py b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/thirdparty/django_.py new file mode 100644 index 0000000..9914a6d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/thirdparty/django_.py @@ -0,0 +1,11 @@ +#! ['class ObjectDoesNotExist'] +from django.core.exceptions import ObjectDoesNotExist +import django + +#? ['get_version'] +django.get_version + +from django.conf import settings + +#? ['configured'] +settings.configured diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/thirdparty/jedi_.py b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/thirdparty/jedi_.py new file mode 100644 index 0000000..dc384b1 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/thirdparty/jedi_.py @@ -0,0 +1,52 @@ + +from jedi import functions, evaluate, parsing + +el = functions.completions()[0] +#? ['description'] +el.description + +#? str() +el.description + + +scopes, path, dot, like = \ + api._prepare_goto(source, row, column, path, True) + +# has problems with that (sometimes) very deep nesting. +#? set() +el = scopes + +# get_names_for_scope is also recursion stuff +#? tuple() +el = list(evaluate.get_names_for_scope())[0] + +#? int() parsing.Module() +el = list(evaluate.get_names_for_scope(1))[0][0] +#? parsing.Module() +el = list(evaluate.get_names_for_scope())[0][0] + +#? list() +el = list(evaluate.get_names_for_scope(1))[0][1] +#? list() +el = list(evaluate.get_names_for_scope())[0][1] + +#? list() +parsing.Scope((0,0)).get_set_vars() +#? parsing.Import() parsing.Name() +parsing.Scope((0,0)).get_set_vars()[0] +# TODO access parent is not possible, because that is not set in the class +## parsing.Class() +parsing.Scope((0,0)).get_set_vars()[0].parent + +#? parsing.Import() parsing.Name() +el = list(evaluate.get_names_for_scope())[0][1][0] + +#? evaluate.Array() evaluate.Class() evaluate.Function() evaluate.Instance() +list(evaluate.follow_call())[0] + +# With the right recursion settings, this should be possible (and maybe more): +# Array Class Function Generator Instance Module +# However, this was produced with the recursion settings 10/350/10000, and +# lasted 18.5 seconds. So we just have to be content with the results. +#? evaluate.Class() evaluate.Function() +evaluate.get_scopes_for_name()[0] diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/thirdparty/psycopg2_.py b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/thirdparty/psycopg2_.py new file mode 100644 index 0000000..834704b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/thirdparty/psycopg2_.py @@ -0,0 +1,11 @@ +import psycopg2 + +conn = psycopg2.connect('dbname=test') + +#? ['cursor'] +conn.cursor + +cur = conn.cursor() + +#? ['fetchall'] +cur.fetchall diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/thirdparty/pylab_.py b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/thirdparty/pylab_.py new file mode 100644 index 0000000..ab132a4 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/thirdparty/pylab_.py @@ -0,0 +1,36 @@ +import pylab + +# two gotos +#! ['module numpy'] +import numpy + +#! ['module random'] +import numpy.random + +#? ['array2string'] +numpy.array2string + +#? ['shape'] +numpy.matrix().shape + +#? ['random_integers'] +pylab.random_integers + +#? [] +numpy.random_integers + +#? ['random_integers'] +numpy.random.random_integers +#? ['sample'] +numpy.random.sample + +import numpy +na = numpy.array([1,2]) +#? ['shape'] +na.shape + +# shouldn't raise an error #29, jedi-vim +# doesn't return something, because matplotlib uses __import__ +fig = pylab.figure() +#? +fig.add_subplot diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/types.py b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/types.py new file mode 100644 index 0000000..753af6c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/types.py @@ -0,0 +1,188 @@ +# ----------------- +# non array +# ----------------- + +#? ['imag'] +int.imag + +#? [] +int.is_integer + +#? ['is_integer'] +float.is_int + +#? ['is_integer'] +1.0.is_integer + +#? ['upper'] +"".upper + +#? ['upper'] +r"".upper + +# strangely this didn't work, because the = is used for assignments +#? ['upper'] +"=".upper +a = "=" +#? ['upper'] +a.upper + + +# ----------------- +# lists +# ----------------- +arr = [] +#? ['append'] +arr.app + +#? ['append'] +list().app +#? ['append'] +[].append + +arr2 = [1,2,3] +#? ['append'] +arr2.app + +#? int() +arr.count(1) + +x = [] +#? +x.pop() +x = [3] +#? int() +x.pop() +x = [] +x.append(1.0) +#? float() +x.pop() + +# ----------------- +# dicts +# ----------------- +dic = {} + +#? ['copy', 'clear'] +dic.c + +dic2 = dict(a=1, b=2) +#? ['pop', 'popitem'] +dic2.p +#? ['popitem'] +{}.popitem + +dic2 = {'asdf': 3} +#? ['popitem'] +dic2.popitem + +#? int() +dic2['asdf'] + +d = {'a': 3, 1.0: list} + +#? int() list +d.values()[0] +##? int() list +dict(d).values()[0] + +#? str() +d.items()[0][0] +#? int() +d.items()[0][1] + +(a, b), = {a:1 for a in [1.0]}.items() +#? float() +a +#? int() +b + +# ----------------- +# tuples +# ----------------- +tup = ('',2) + +#? ['count'] +tup.c + +tup2 = tuple() +#? ['index'] +tup2.i +#? ['index'] +().i + +tup3 = 1,"" +#? ['index'] +tup3.index + +tup4 = 1,"" +#? ['index'] +tup4.index + +# ----------------- +# set +# ----------------- +set_t = {1,2} + +#? ['clear', 'copy'] +set_t.c + +set_t2 = set() + +#? ['clear', 'copy'] +set_t2.c + +# ----------------- +# pep 448 unpacking generalizations +# ----------------- +# python >= 3.5 + +d = {'a': 3} +dc = {v: 3 for v in ['a']} + +#? dict() +{**d} + +#? dict() +{**dc} + +#? str() +{**d, "b": "b"}["b"] + +#? str() +{**dc, "b": "b"}["b"] + +# Should resolve to int() but jedi is not smart enough yet +# Here to make sure it doesn't result in crash though +#? +{**d}["a"] + +# Should resolve to int() but jedi is not smart enough yet +# Here to make sure it doesn't result in crash though +#? +{**dc}["a"] + +s = {1, 2, 3} + +#? set() +{*s} + +#? set() +{*s, 4, *s} + +s = {1, 2, 3} +# Should resolve to int() but jedi is not smart enough yet +# Here to make sure it doesn't result in crash though +#? +{*s}.pop() + +#? int() +{*s, 4}.pop() + +# Should resolve to int() but jedi is not smart enough yet +# Here to make sure it doesn't result in crash though +#? +[*s][0] + +#? int() +[*s, 4][0] diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/completion/usages.py b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/usages.py new file mode 100644 index 0000000..3e05b7b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/completion/usages.py @@ -0,0 +1,317 @@ +""" +Renaming tests. This means search for usages. +I always leave a little bit of space to add room for additions, because the +results always contain position informations. +""" +#< 4 (0,4), (3,0), (5,0), (17,0), (12,4), (14,5), (15,0) +def abc(): pass + +#< 0 (-3,4), (0,0), (2,0), (14,0), (9,4), (11,5), (12,0) +abc.d.a.bsaasd.abc.d + +abc +# unicode chars shouldn't be a problem. +x['smörbröd'].abc + +# With the new parser these statements are not recognized as stateents, because +# they are not valid Python. +if 1: + abc = +else: + (abc) = +abc = +#< (-17,4), (-14,0), (-12,0), (0,0), (-2,0), (-3,5), (-5,4) +abc + +abc = 5 + + +Abc = 3 + +#< 6 (0,6), (2,4), (5,8), (17,0) +class Abc(): + #< (-2,6), (0,4), (3,8), (15,0) + Abc + + def Abc(self): + Abc; self.c = 3 + + #< 17 (0,16), (2,8) + def a(self, Abc): + #< 10 (-2,16), (0,8) + Abc + + #< 19 (0,18), (2,8) + def self_test(self): + #< 12 (-2,18), (0,8) + self.b + +Abc.d.Abc + + +#< 4 (0,4), (5,1) +def blubi(): + pass + + +#< (-5,4), (0,1) +@blubi +def a(): pass + + +#< 0 (0,0), (1,0) +set_object_var = object() +set_object_var.var = 1 + + +response = 5 +#< 0 (0,0), (1,0), (2,0), (4,0) +response = HttpResponse(mimetype='application/pdf') +response['Content-Disposition'] = 'attachment; filename=%s.pdf' % id +response.write(pdf) +#< (-4,0), (-3,0), (-2,0), (0,0) +response + + +# ----------------- +# imports +# ----------------- +#< (0,7), (3,0) +import module_not_exists + +#< (-3,7), (0,0) +module_not_exists + + +#< ('rename1', 1,0), (0,24), (3,0), (6,17), ('rename2', 4,17), (11,17), (14,17), ('imports', 72, 16) +from import_tree import rename1 + +#< (0,8), ('rename1',3,0), ('rename2',4,32), ('rename2',6,0), (3,32), (8,32), (5,0) +rename1.abc + +#< (-3,8), ('rename1', 3,0), ('rename2', 4,32), ('rename2', 6,0), (0,32), (5,32), (2,0) +from import_tree.rename1 import abc +#< (-5,8), (-2,32), ('rename1', 3,0), ('rename2', 4,32), ('rename2', 6,0), (0,0), (3,32) +abc + +#< 20 ('rename1', 1,0), ('rename2', 4,17), (-11,24), (-8,0), (-5,17), (0,17), (3,17), ('imports', 72, 16) +from import_tree.rename1 import abc + +#< (0, 32), +from import_tree.rename1 import not_existing + +# Shouldn't raise an error or do anything weird. +from not_existing import * + +# ----------------- +# classes +# ----------------- + +class TestMethods(object): + #< 8 (0,8), (2,13) + def a_method(self): + #< 13 (-2,8), (0,13) + self.a_method() + #< 13 (2,8), (0,13), (3,13) + self.b_method() + + def b_method(self): + self.b_method + + +class TestClassVar(object): + #< 4 (0,4), (5,13), (7,21) + class_v = 1 + def a(self): + class_v = 1 + + #< (-5,4), (0,13), (2,21) + self.class_v + #< (-7,4), (-2,13), (0,21) + TestClassVar.class_v + #< (0,8), (-7, 8) + class_v + +class TestInstanceVar(): + def a(self): + #< 13 (4,13), (0,13) + self._instance_var = 3 + + def b(self): + #< (-4,13), (0,13) + self._instance_var + # A call to self used to trigger an error, because it's also a trailer + # with two children. + self() + + +class NestedClass(): + def __getattr__(self, name): + return self + +# Shouldn't find a definition, because there's other `instance`. +# TODO reenable that test +##< (0, 14), +NestedClass().instance + + +# ----------------- +# inheritance +# ----------------- +class Super(object): + #< 4 (0,4), (23,18), (25,13) + base_class = 1 + #< 4 (0,4), + class_var = 1 + + #< 8 (0,8), + def base_method(self): + #< 13 (0,13), (20,13) + self.base_var = 1 + #< 13 (0,13), + self.instance_var = 1 + + #< 8 (0,8), + def just_a_method(self): pass + + +#< 20 (0,16), (-18,6) +class TestClass(Super): + #< 4 (0,4), + class_var = 1 + + def x_method(self): + + #< (0,18), (2,13), (-23,4) + TestClass.base_class + #< (-2,18), (0,13), (-25,4) + self.base_class + #< (-20,13), (0,13) + self.base_var + #< (0, 18), + TestClass.base_var + + + #< 13 (5,13), (0,13) + self.instance_var = 3 + + #< 9 (0,8), + def just_a_method(self): + #< (-5,13), (0,13) + self.instance_var + + +# ----------------- +# properties +# ----------------- +class TestProperty: + + @property + #< 10 (0,8), (5,13) + def prop(self): + return 1 + + def a(self): + #< 13 (-5,8), (0,13) + self.prop + + @property + #< 13 (0,8), (4,5) + def rw_prop(self): + return self._rw_prop + + #< 8 (-4,8), (0,5) + @rw_prop.setter + #< 8 (0,8), (5,13) + def rw_prop(self, value): + self._rw_prop = value + + def b(self): + #< 13 (-5,8), (0,13) + self.rw_prop + +# ----------------- +# *args, **kwargs +# ----------------- +#< 11 (1,11), (0,8) +def f(**kwargs): + return kwargs + + +# ----------------- +# No result +# ----------------- +if isinstance(j, int): + #< (0, 4), + j + +# ----------------- +# Dynamic Param Search +# ----------------- + +class DynamicParam(): + def foo(self): + return + +def check(instance): + #< 13 (-5,8), (0,13) + instance.foo() + +check(DynamicParam()) + +# ----------------- +# Compiled Objects +# ----------------- + +import _sre + +# TODO reenable this, it's currently not working, because of 2/3 +# inconsistencies in typeshed (_sre exists in typeshed/2, but not in +# typeshed/3). +##< 0 (-3,7), (0,0), ('_sre', None, None) +_sre + +# ----------------- +# on syntax +# ----------------- + +#< 0 +import undefined + +# ----------------- +# comprehensions +# ----------------- + +#< 0 (0,0), (2,12) +x = 32 +#< 12 (-2,0), (0,12) +[x for x in x] + +#< 0 (0,0), (2,1), (2,12) +x = 32 +#< 12 (-2,0), (0,1), (0,12) +[x for b in x] + + +#< 1 (0,1), (0,7) +[x for x in something] +#< 7 (0,1), (0,7) +[x for x in something] + +x = 3 +#< 1 (0,1), (0,10) +{x:1 for x in something} +#< 10 (0,1), (0,10) +{x:1 for x in something} + +def x(): + zzz = 3 + if UNDEFINED: + zzz = 5 + if UNDEFINED2: + #< (3, 8), (4, 4), (0, 12), (-3, 8), (-5, 4) + zzz + else: + #< (0, 8), (1, 4), (-3, 12), (-6, 8), (-8, 4) + zzz + zzz diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/conftest.py b/vim/bundle/jedi-vim/pythonx/jedi/test/conftest.py new file mode 100644 index 0000000..45bb48e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/conftest.py @@ -0,0 +1,171 @@ +import os +import re +import subprocess + +import pytest + +from . import helpers +from . import run +from . import refactor + +import jedi +from jedi.api.environment import InterpreterEnvironment +from jedi.evaluate.analysis import Warning + + +def pytest_addoption(parser): + parser.addoption( + "--integration-case-dir", + default=os.path.join(helpers.test_dir, 'completion'), + help="Directory in which integration test case files locate.") + parser.addoption( + "--refactor-case-dir", + default=os.path.join(helpers.test_dir, 'refactor'), + help="Directory in which refactoring test case files locate.") + parser.addoption( + "--test-files", "-T", default=[], action='append', + help=( + "Specify test files using FILE_NAME[:LINE[,LINE[,...]]]. " + "For example: -T generators.py:10,13,19. " + "Note that you can use -m to specify the test case by id.")) + parser.addoption( + "--thirdparty", action='store_true', + help="Include integration tests that requires third party modules.") + + +def parse_test_files_option(opt): + """ + Parse option passed to --test-files into a key-value pair. + + >>> parse_test_files_option('generators.py:10,13,19') + ('generators.py', [10, 13, 19]) + """ + opt = str(opt) + if ':' in opt: + (f_name, rest) = opt.split(':', 1) + return f_name, list(map(int, rest.split(','))) + else: + return opt, [] + + +def pytest_generate_tests(metafunc): + """ + :type metafunc: _pytest.python.Metafunc + """ + test_files = dict(map(parse_test_files_option, + metafunc.config.option.test_files)) + if 'case' in metafunc.fixturenames: + base_dir = metafunc.config.option.integration_case_dir + thirdparty = metafunc.config.option.thirdparty + cases = list(run.collect_dir_tests(base_dir, test_files)) + if thirdparty: + cases.extend(run.collect_dir_tests( + os.path.join(base_dir, 'thirdparty'), test_files, True)) + ids = ["%s:%s" % (c.module_name, c.line_nr_test) for c in cases] + metafunc.parametrize('case', cases, ids=ids) + + if 'refactor_case' in metafunc.fixturenames: + base_dir = metafunc.config.option.refactor_case_dir + metafunc.parametrize( + 'refactor_case', + refactor.collect_dir_tests(base_dir, test_files)) + + if 'static_analysis_case' in metafunc.fixturenames: + base_dir = os.path.join(os.path.dirname(__file__), 'static_analysis') + cases = list(collect_static_analysis_tests(base_dir, test_files)) + metafunc.parametrize( + 'static_analysis_case', + cases, + ids=[c.name for c in cases] + ) + + +def collect_static_analysis_tests(base_dir, test_files): + for f_name in os.listdir(base_dir): + files_to_execute = [a for a in test_files.items() if a[0] in f_name] + if f_name.endswith(".py") and (not test_files or files_to_execute): + path = os.path.join(base_dir, f_name) + yield StaticAnalysisCase(path) + + +class StaticAnalysisCase(object): + """ + Static Analysis cases lie in the static_analysis folder. + The tests also start with `#!`, like the goto_definition tests. + """ + def __init__(self, path): + self._path = path + self.name = os.path.basename(path) + with open(path) as f: + self._source = f.read() + + self.skip = False + for line in self._source.splitlines(): + self.skip = self.skip or run.skip_python_version(line) + + def collect_comparison(self): + cases = [] + for line_nr, line in enumerate(self._source.splitlines(), 1): + match = re.match(r'(\s*)#! (\d+ )?(.*)$', line) + if match is not None: + column = int(match.group(2) or 0) + len(match.group(1)) + cases.append((line_nr + 1, column, match.group(3))) + return cases + + def run(self, compare_cb, environment): + analysis = jedi.Script( + self._source, + path=self._path, + environment=environment, + )._analysis() + typ_str = lambda inst: 'warning ' if isinstance(inst, Warning) else '' + analysis = [(r.line, r.column, typ_str(r) + r.name) + for r in analysis] + compare_cb(self, analysis, self.collect_comparison()) + + def __repr__(self): + return "<%s: %s>" % (self.__class__.__name__, os.path.basename(self._path)) + + +@pytest.fixture(scope='session') +def venv_path(tmpdir_factory, environment): + if environment.version_info.major < 3: + pytest.skip("python -m venv does not exist in Python 2") + + tmpdir = tmpdir_factory.mktemp('venv_path') + dirname = os.path.join(tmpdir.dirname, 'venv') + + # We cannot use the Python from tox because tox creates virtualenvs and + # they have different site.py files that work differently than the default + # ones. Instead, we find the real Python executable by printing the value + # of sys.base_prefix or sys.real_prefix if we are in a virtualenv. + output = subprocess.check_output([ + environment.executable, "-c", + "import sys; " + "print(sys.real_prefix if hasattr(sys, 'real_prefix') else sys.base_prefix)" + ]) + prefix = output.rstrip().decode('utf8') + if os.name == 'nt': + executable_path = os.path.join(prefix, 'python') + else: + executable_name = os.path.basename(environment.executable) + executable_path = os.path.join(prefix, 'bin', executable_name) + + subprocess.call([executable_path, '-m', 'venv', dirname]) + return dirname + + +@pytest.fixture() +def cwd_tmpdir(monkeypatch, tmpdir): + with helpers.set_cwd(tmpdir.strpath): + yield tmpdir + + +@pytest.fixture +def evaluator(Script): + return Script('')._evaluator + + +@pytest.fixture +def same_process_evaluator(Script): + return Script('', environment=InterpreterEnvironment())._evaluator diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/examples/README.rst b/vim/bundle/jedi-vim/pythonx/jedi/test/examples/README.rst new file mode 100644 index 0000000..ad8c5f7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/examples/README.rst @@ -0,0 +1,5 @@ +Examples +======== + +Here you can find project structures that match other Python projects. This is +then used to check if jedi understands these structures. diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/examples/buildout_project/bin/app b/vim/bundle/jedi-vim/pythonx/jedi/test/examples/buildout_project/bin/app new file mode 100644 index 0000000..7394d2d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/examples/buildout_project/bin/app @@ -0,0 +1,12 @@ +#!/usr/bin/python + +import sys +sys.path[0:0] = [ + '/usr/lib/python3.4/site-packages', + '/tmp/.buildout/eggs/important_package.egg' +] + +import important_package + +if __name__ == '__main__': + sys.exit(important_package.main()) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/examples/buildout_project/bin/binary_file b/vim/bundle/jedi-vim/pythonx/jedi/test/examples/buildout_project/bin/binary_file new file mode 100644 index 0000000..f1ad755 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/examples/buildout_project/bin/binary_file @@ -0,0 +1 @@ +PNG diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/examples/buildout_project/bin/empty_file b/vim/bundle/jedi-vim/pythonx/jedi/test/examples/buildout_project/bin/empty_file new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/examples/buildout_project/buildout.cfg b/vim/bundle/jedi-vim/pythonx/jedi/test/examples/buildout_project/buildout.cfg new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/examples/buildout_project/src/proj_name/module_name.py b/vim/bundle/jedi-vim/pythonx/jedi/test/examples/buildout_project/src/proj_name/module_name.py new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/examples/django/app/__init__.py b/vim/bundle/jedi-vim/pythonx/jedi/test/examples/django/app/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/examples/django/app/models.py b/vim/bundle/jedi-vim/pythonx/jedi/test/examples/django/app/models.py new file mode 100644 index 0000000..7890e53 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/examples/django/app/models.py @@ -0,0 +1 @@ +SomeModel = "bar" diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/examples/django/manage.py b/vim/bundle/jedi-vim/pythonx/jedi/test/examples/django/manage.py new file mode 100644 index 0000000..8940f07 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/examples/django/manage.py @@ -0,0 +1,10 @@ +#!/usr/bin/env python +import os +import sys + +if __name__ == "__main__": + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "foobar.settings") + + from django.core.management import execute_from_command_line + + execute_from_command_line(sys.argv) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/examples/issue1209/__init__.py b/vim/bundle/jedi-vim/pythonx/jedi/test/examples/issue1209/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/examples/issue1209/api/__init__.py b/vim/bundle/jedi-vim/pythonx/jedi/test/examples/issue1209/api/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/examples/issue1209/api/whatever/__init__.py b/vim/bundle/jedi-vim/pythonx/jedi/test/examples/issue1209/api/whatever/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/examples/issue1209/api/whatever/api_test1.py b/vim/bundle/jedi-vim/pythonx/jedi/test/examples/issue1209/api/whatever/api_test1.py new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/examples/issue1209/whatever/__init__.py b/vim/bundle/jedi-vim/pythonx/jedi/test/examples/issue1209/whatever/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/examples/issue1209/whatever/test.py b/vim/bundle/jedi-vim/pythonx/jedi/test/examples/issue1209/whatever/test.py new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/examples/namespace_package_relative_import/rel1.py b/vim/bundle/jedi-vim/pythonx/jedi/test/examples/namespace_package_relative_import/rel1.py new file mode 100644 index 0000000..79b35a5 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/examples/namespace_package_relative_import/rel1.py @@ -0,0 +1 @@ +from .rel2 import name diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/examples/namespace_package_relative_import/rel2.py b/vim/bundle/jedi-vim/pythonx/jedi/test/examples/namespace_package_relative_import/rel2.py new file mode 100644 index 0000000..14a0ee4 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/examples/namespace_package_relative_import/rel2.py @@ -0,0 +1 @@ +name = 1 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/examples/stub_packages/no_python-stubs/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/test/examples/stub_packages/no_python-stubs/__init__.pyi new file mode 100644 index 0000000..18770a1 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/examples/stub_packages/no_python-stubs/__init__.pyi @@ -0,0 +1 @@ +foo: int diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/examples/stub_packages/with_python-stubs/__init__.pyi b/vim/bundle/jedi-vim/pythonx/jedi/test/examples/stub_packages/with_python-stubs/__init__.pyi new file mode 100644 index 0000000..5e7ee1b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/examples/stub_packages/with_python-stubs/__init__.pyi @@ -0,0 +1,2 @@ +both: int +stub_only: str diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/examples/stub_packages/with_python-stubs/module.pyi b/vim/bundle/jedi-vim/pythonx/jedi/test/examples/stub_packages/with_python-stubs/module.pyi new file mode 100644 index 0000000..5333149 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/examples/stub_packages/with_python-stubs/module.pyi @@ -0,0 +1 @@ +in_sub_module: int diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/examples/stub_packages/with_python/__init__.py b/vim/bundle/jedi-vim/pythonx/jedi/test/examples/stub_packages/with_python/__init__.py new file mode 100644 index 0000000..d16c270 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/examples/stub_packages/with_python/__init__.py @@ -0,0 +1,2 @@ +python_only = 1 +both = '' diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/examples/stub_packages/with_python/module.py b/vim/bundle/jedi-vim/pythonx/jedi/test/examples/stub_packages/with_python/module.py new file mode 100644 index 0000000..375009f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/examples/stub_packages/with_python/module.py @@ -0,0 +1 @@ +in_sub_module = '' diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/helpers.py b/vim/bundle/jedi-vim/pythonx/jedi/test/helpers.py new file mode 100644 index 0000000..f08af1a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/helpers.py @@ -0,0 +1,60 @@ +""" +A helper module for testing, improves compatibility for testing (as +``jedi._compatibility``) as well as introducing helper functions. +""" + +import sys +from contextlib import contextmanager + +if sys.hexversion < 0x02070000: + import unittest2 as unittest +else: + import unittest +TestCase = unittest.TestCase + +import os +import pytest +from os.path import abspath, dirname, join +from functools import partial, wraps + +test_dir = dirname(abspath(__file__)) +root_dir = dirname(test_dir) + +sample_int = 1 # This is used in completion/imports.py + +skip_if_windows = partial(pytest.param, + marks=pytest.mark.skipif("sys.platform=='win32'")) +skip_if_not_windows = partial(pytest.param, + marks=pytest.mark.skipif("sys.platform!='win32'")) + + +def get_example_dir(name): + return join(test_dir, 'examples', name) + + +def cwd_at(path): + """ + Decorator to run function at `path`. + + :type path: str + :arg path: relative path from repository root (e.g., ``'jedi'``). + """ + def decorator(func): + @wraps(func) + def wrapper(Script, **kwargs): + with set_cwd(path): + return func(Script, **kwargs) + return wrapper + return decorator + + +@contextmanager +def set_cwd(path, absolute_path=False): + repo_root = os.path.dirname(test_dir) + + oldcwd = os.getcwd() + os.chdir(os.path.join(repo_root, path)) + try: + yield + finally: + os.chdir(oldcwd) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/refactor.py b/vim/bundle/jedi-vim/pythonx/jedi/test/refactor.py new file mode 100755 index 0000000..9cc10fd --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/refactor.py @@ -0,0 +1,99 @@ +#!/usr/bin/env python +""" +Refactoring tests work a little bit similar to Black Box tests. But the idea is +here to compare two versions of code. **Note: Refactoring is currently not in +active development (and was never stable), the tests are therefore not really +valuable - just ignore them.** +""" +from __future__ import with_statement +import os +import re + +from functools import reduce +import jedi +from jedi import refactoring + + +class RefactoringCase(object): + + def __init__(self, name, source, line_nr, index, path, + new_name, start_line_test, desired): + self.name = name + self.source = source + self.line_nr = line_nr + self.index = index + self.path = path + self.new_name = new_name + self.start_line_test = start_line_test + self.desired = desired + + def refactor(self): + script = jedi.Script(self.source, self.line_nr, self.index, self.path) + f_name = os.path.basename(self.path) + refactor_func = getattr(refactoring, f_name.replace('.py', '')) + args = (self.new_name,) if self.new_name else () + return refactor_func(script, *args) + + def run(self): + refactor_object = self.refactor() + + # try to get the right excerpt of the newfile + f = refactor_object.new_files()[self.path] + lines = f.splitlines()[self.start_line_test:] + + end = self.start_line_test + len(lines) + pop_start = None + for i, l in enumerate(lines): + if l.startswith('# +++'): + end = i + break + elif '#? ' in l: + pop_start = i + lines.pop(pop_start) + self.result = '\n'.join(lines[:end - 1]).strip() + return self.result + + def check(self): + return self.run() == self.desired + + def __repr__(self): + return '<%s: %s:%s>' % (self.__class__.__name__, + self.name, self.line_nr - 1) + + +def collect_file_tests(source, path, lines_to_execute): + r = r'^# --- ?([^\n]*)\n((?:(?!\n# \+\+\+).)*)' \ + r'\n# \+\+\+((?:(?!\n# ---).)*)' + for match in re.finditer(r, source, re.DOTALL | re.MULTILINE): + name = match.group(1).strip() + first = match.group(2).strip() + second = match.group(3).strip() + start_line_test = source[:match.start()].count('\n') + 1 + + # get the line with the position of the operation + p = re.match(r'((?:(?!#\?).)*)#\? (\d*) ?([^\n]*)', first, re.DOTALL) + if p is None: + print("Please add a test start.") + continue + until = p.group(1) + index = int(p.group(2)) + new_name = p.group(3) + + line_nr = start_line_test + until.count('\n') + 2 + if lines_to_execute and line_nr - 1 not in lines_to_execute: + continue + + yield RefactoringCase(name, source, line_nr, index, path, + new_name, start_line_test, second) + + +def collect_dir_tests(base_dir, test_files): + for f_name in os.listdir(base_dir): + files_to_execute = [a for a in test_files.items() if a[0] in f_name] + lines_to_execute = reduce(lambda x, y: x + y[1], files_to_execute, []) + if f_name.endswith(".py") and (not test_files or files_to_execute): + path = os.path.join(base_dir, f_name) + with open(path) as f: + source = f.read() + for case in collect_file_tests(source, path, lines_to_execute): + yield case diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/refactor/extract.py b/vim/bundle/jedi-vim/pythonx/jedi/test/refactor/extract.py new file mode 100644 index 0000000..312aced --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/refactor/extract.py @@ -0,0 +1,47 @@ +# --- simple +def test(): + #? 35 a + return test(100, (30 + b, c) + 1) + +# +++ +def test(): + a = (30 + b, c) + 1 + return test(100, a) + + +# --- simple #2 +def test(): + #? 25 a + return test(100, (30 + b, c) + 1) + +# +++ +def test(): + a = 30 + b + return test(100, (a, c) + 1) + + +# --- multiline +def test(): + #? 30 x + return test(1, (30 + b, c) + + 1) +# +++ +def test(): + x = ((30 + b, c) + + 1) + return test(1, x +) + + +# --- multiline #2 +def test(): + #? 25 x + return test(1, (30 + b, c) + + 1) +# +++ +def test(): + x = 30 + b + return test(1, (x, c) + + 1) + + diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/refactor/inline.py b/vim/bundle/jedi-vim/pythonx/jedi/test/refactor/inline.py new file mode 100644 index 0000000..c373be2 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/refactor/inline.py @@ -0,0 +1,18 @@ +# --- simple +def test(): + #? 4 + a = (30 + b, c) + 1 + return test(100, a) +# +++ +def test(): + return test(100, (30 + b, c) + 1) + + +# --- simple +if 1: + #? 4 + a = 1, 2 + return test(100, a) +# +++ +if 1: + return test(100, (1, 2)) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/refactor/rename.py b/vim/bundle/jedi-vim/pythonx/jedi/test/refactor/rename.py new file mode 100644 index 0000000..e98c589 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/refactor/rename.py @@ -0,0 +1,17 @@ +""" +Test coverage for renaming is mostly being done by testing +`Script.usages`. +""" + +# --- simple +def test1(): + #? 7 blabla + test1() + AssertionError + return test1, test1.not_existing +# +++ +def blabla(): + blabla() + AssertionError + return blabla, blabla.not_existing + diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/run.py b/vim/bundle/jedi-vim/pythonx/jedi/test/run.py new file mode 100755 index 0000000..9e87be2 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/run.py @@ -0,0 +1,481 @@ +#!/usr/bin/env python +""" +|jedi| is mostly being tested by what I would call "Blackbox Tests". These +tests are just testing the interface and do input/output testing. This makes a +lot of sense for |jedi|. Jedi supports so many different code structures, that +it is just stupid to write 200'000 unittests in the manner of +``regression.py``. Also, it is impossible to do doctests/unittests on most of +the internal data structures. That's why |jedi| uses mostly these kind of +tests. + +There are different kind of tests: + +- completions / goto_definitions ``#?`` +- goto_assignments: ``#!`` +- usages: ``#<`` + +How to run tests? ++++++++++++++++++ + +Jedi uses pytest_ to run unit and integration tests. To run tests, +simply run ``pytest``. You can also use tox_ to run tests for +multiple Python versions. + +.. _pytest: http://pytest.org +.. _tox: http://testrun.org/tox + +Integration test cases are located in ``test/completion`` directory +and each test case is indicated by either the comment ``#?`` (completions / +definitions), ``#!`` (assignments), or ``#<`` (usages). +There is also support for third party libraries. In a normal test run they are +not being executed, you have to provide a ``--thirdparty`` option. + +In addition to standard `-k` and `-m` options in pytest, you can use the +`-T` (`--test-files`) option to specify integration test cases to run. +It takes the format of ``FILE_NAME[:LINE[,LINE[,...]]]`` where +``FILE_NAME`` is a file in ``test/completion`` and ``LINE`` is a line +number of the test comment. Here is some recipes: + +Run tests only in ``basic.py`` and ``imports.py``:: + + pytest test/test_integration.py -T basic.py -T imports.py + +Run test at line 4, 6, and 8 in ``basic.py``:: + + pytest test/test_integration.py -T basic.py:4,6,8 + +See ``pytest --help`` for more information. + +If you want to debug a test, just use the ``--pdb`` option. + +Alternate Test Runner ++++++++++++++++++++++ + +If you don't like the output of ``pytest``, there's an alternate test runner +that you can start by running ``./run.py``. The above example could be run by:: + + ./run.py basic 4 6 8 50-80 + +The advantage of this runner is simplicity and more customized error reports. +Using both runners will help you to have a quicker overview of what's +happening. + + +Auto-Completion ++++++++++++++++ + +Uses comments to specify a test in the next line. The comment says which +results are expected. The comment always begins with `#?`. The last row +symbolizes the cursor. + +For example:: + + #? ['real'] + a = 3; a.rea + +Because it follows ``a.rea`` and a is an ``int``, which has a ``real`` +property. + +Goto Definitions +++++++++++++++++ + +Definition tests use the same symbols like completion tests. This is +possible because the completion tests are defined with a list:: + + #? int() + ab = 3; ab + +Goto Assignments +++++++++++++++++ + +Tests look like this:: + + abc = 1 + #! ['abc=1'] + abc + +Additionally it is possible to specify the column by adding a number, which +describes the position of the test (otherwise it's just the end of line):: + + #! 2 ['abc=1'] + abc + +Usages +++++++ + +Tests look like this:: + + abc = 1 + #< abc@1,0 abc@3,0 + abc +""" +import os +import re +import sys +import operator +from ast import literal_eval +from io import StringIO +from functools import reduce + +import parso + +import jedi +from jedi import debug +from jedi._compatibility import unicode, is_py3 +from jedi.api.classes import Definition +from jedi.api.completion import get_user_scope +from jedi import parser_utils +from jedi.api.environment import get_default_environment, get_system_environment +from jedi.evaluate.gradual.conversion import convert_contexts + + +TEST_COMPLETIONS = 0 +TEST_DEFINITIONS = 1 +TEST_ASSIGNMENTS = 2 +TEST_USAGES = 3 + + +grammar36 = parso.load_grammar(version='3.6') + + +class IntegrationTestCase(object): + def __init__(self, test_type, correct, line_nr, column, start, line, + path=None, skip_version_info=None): + self.test_type = test_type + self.correct = correct + self.line_nr = line_nr + self.column = column + self.start = start + self.line = line + self.path = path + self._skip_version_info = skip_version_info + self._skip = None + + def set_skip(self, reason): + self._skip = reason + + def get_skip_reason(self, environment): + if self._skip is not None: + return self._skip + + if self._skip_version_info is None: + return + + comp_map = { + '==': 'eq', + '<=': 'le', + '>=': 'ge', + '<': 'lt', + '>': 'gt', + } + min_version, operator_ = self._skip_version_info + operation = getattr(operator, comp_map[operator_]) + if not operation(environment.version_info[:2], min_version): + return "Python version %s %s.%s" % ( + operator_, min_version[0], min_version[1] + ) + + @property + def module_name(self): + return os.path.splitext(os.path.basename(self.path))[0] + + @property + def line_nr_test(self): + """The test is always defined on the line before.""" + return self.line_nr - 1 + + def __repr__(self): + return '<%s: %s:%s %r>' % (self.__class__.__name__, self.path, + self.line_nr_test, self.line.rstrip()) + + def script(self, environment): + return jedi.Script( + self.source, self.line_nr, self.column, self.path, + environment=environment + ) + + def run(self, compare_cb, environment=None): + testers = { + TEST_COMPLETIONS: self.run_completion, + TEST_DEFINITIONS: self.run_goto_definitions, + TEST_ASSIGNMENTS: self.run_goto_assignments, + TEST_USAGES: self.run_usages, + } + return testers[self.test_type](compare_cb, environment) + + def run_completion(self, compare_cb, environment): + completions = self.script(environment).completions() + #import cProfile; cProfile.run('script.completions()') + + comp_str = {c.name for c in completions} + return compare_cb(self, comp_str, set(literal_eval(self.correct))) + + def run_goto_definitions(self, compare_cb, environment): + script = self.script(environment) + evaluator = script._evaluator + + def comparison(definition): + suffix = '()' if definition.type == 'instance' else '' + return definition.desc_with_module + suffix + + def definition(correct, correct_start, path): + should_be = set() + for match in re.finditer('(?:[^ ]+)', correct): + string = match.group(0) + parser = grammar36.parse(string, start_symbol='eval_input', error_recovery=False) + parser_utils.move(parser.get_root_node(), self.line_nr) + element = parser.get_root_node() + module_context = script._get_module() + # The context shouldn't matter for the test results. + user_context = get_user_scope(module_context, (self.line_nr, 0)) + if user_context.api_type == 'function': + user_context = user_context.get_function_execution() + element.parent = user_context.tree_node + results = convert_contexts( + evaluator.eval_element(user_context, element), + ) + if not results: + raise Exception('Could not resolve %s on line %s' + % (match.string, self.line_nr - 1)) + + should_be |= set(Definition(evaluator, r.name) for r in results) + debug.dbg('Finished getting types', color='YELLOW') + + # Because the objects have different ids, `repr`, then compare. + should = set(comparison(r) for r in should_be) + return should + + should = definition(self.correct, self.start, script.path) + result = script.goto_definitions() + is_str = set(comparison(r) for r in result) + return compare_cb(self, is_str, should) + + def run_goto_assignments(self, compare_cb, environment): + result = self.script(environment).goto_assignments() + comp_str = str(sorted(str(r.description) for r in result)) + return compare_cb(self, comp_str, self.correct) + + def run_usages(self, compare_cb, environment): + result = self.script(environment).usages() + self.correct = self.correct.strip() + compare = sorted((r.module_name, r.line, r.column) for r in result) + wanted = [] + if not self.correct: + positions = [] + else: + positions = literal_eval(self.correct) + for pos_tup in positions: + if type(pos_tup[0]) == str: + # this means that there is a module specified + wanted.append(pos_tup) + else: + line = pos_tup[0] + if pos_tup[0] is not None: + line += self.line_nr + wanted.append((self.module_name, line, pos_tup[1])) + + return compare_cb(self, compare, sorted(wanted)) + + +def skip_python_version(line): + # check for python minimal version number + match = re.match(r" *# *python *([<>]=?|==) *(\d+(?:\.\d+)?)$", line) + if match: + minimal_python_version = tuple(map(int, match.group(2).split("."))) + return minimal_python_version, match.group(1) + return None + + +def collect_file_tests(path, lines, lines_to_execute): + def makecase(t): + return IntegrationTestCase(t, correct, line_nr, column, + start, line, path=path, + skip_version_info=skip_version_info) + + start = None + correct = None + test_type = None + skip_version_info = None + for line_nr, line in enumerate(lines, 1): + if correct is not None: + r = re.match(r'^(\d+)\s*(.*)$', correct) + if r: + column = int(r.group(1)) + correct = r.group(2) + start += r.regs[2][0] # second group, start index + else: + column = len(line) - 1 # -1 for the \n + if test_type == '!': + yield makecase(TEST_ASSIGNMENTS) + elif test_type == '<': + yield makecase(TEST_USAGES) + elif correct.startswith('['): + yield makecase(TEST_COMPLETIONS) + else: + yield makecase(TEST_DEFINITIONS) + correct = None + else: + skip_version_info = skip_python_version(line) or skip_version_info + try: + r = re.search(r'(?:^|(?<=\s))#([?!<])\s*([^\n]*)', line) + # test_type is ? for completion and ! for goto_assignments + test_type = r.group(1) + correct = r.group(2) + # Quick hack to make everything work (not quite a bloody unicorn hack though). + if correct == '': + correct = ' ' + start = r.start() + except AttributeError: + correct = None + else: + # Skip the test, if this is not specified test. + for l in lines_to_execute: + if isinstance(l, tuple) and l[0] <= line_nr <= l[1] \ + or line_nr == l: + break + else: + if lines_to_execute: + correct = None + + +def collect_dir_tests(base_dir, test_files, check_thirdparty=False): + for f_name in os.listdir(base_dir): + files_to_execute = [a for a in test_files.items() if f_name.startswith(a[0])] + lines_to_execute = reduce(lambda x, y: x + y[1], files_to_execute, []) + if f_name.endswith(".py") and (not test_files or files_to_execute): + skip = None + if check_thirdparty: + lib = f_name.replace('_.py', '') + try: + # there is always an underline at the end. + # It looks like: completion/thirdparty/pylab_.py + __import__(lib) + except ImportError: + skip = 'Thirdparty-Library %s not found.' % lib + + path = os.path.join(base_dir, f_name) + + if is_py3: + with open(path, encoding='utf-8') as f: + source = f.read() + else: + with open(path) as f: + source = unicode(f.read(), 'UTF-8') + + for case in collect_file_tests(path, StringIO(source), + lines_to_execute): + case.source = source + if skip: + case.set_skip(skip) + yield case + + +docoptstr = """ +Using run.py to make debugging easier with integration tests. + +An alternative testing format, which is much more hacky, but very nice to +work with. + +Usage: + run.py [--pdb] [--debug] [--thirdparty] [--env ] [...] + run.py --help + +Options: + -h --help Show this screen. + --pdb Enable pdb debugging on fail. + -d, --debug Enable text output debugging (please install ``colorama``). + --thirdparty Also run thirdparty tests (in ``completion/thirdparty``). + --env A Python version, like 2.7, 3.4, etc. +""" +if __name__ == '__main__': + import docopt + arguments = docopt.docopt(docoptstr) + + import time + t_start = time.time() + + if arguments['--debug']: + jedi.set_debug_function() + + # get test list, that should be executed + test_files = {} + last = None + for arg in arguments['']: + match = re.match(r'(\d+)-(\d+)', arg) + if match: + start, end = match.groups() + test_files[last].append((int(start), int(end))) + elif arg.isdigit(): + if last is None: + continue + test_files[last].append(int(arg)) + else: + test_files[arg] = [] + last = arg + + # completion tests: + dir_ = os.path.dirname(os.path.realpath(__file__)) + completion_test_dir = os.path.join(dir_, '../test/completion') + completion_test_dir = os.path.abspath(completion_test_dir) + tests_fail = 0 + + # execute tests + cases = list(collect_dir_tests(completion_test_dir, test_files)) + if test_files or arguments['--thirdparty']: + completion_test_dir += '/thirdparty' + cases += collect_dir_tests(completion_test_dir, test_files, True) + + def file_change(current, tests, fails): + if current is None: + current = '' + else: + current = os.path.basename(current) + print('{:25} {} tests and {} fails.'.format(current, tests, fails)) + + def report(case, actual, desired): + if actual == desired: + return 0 + else: + print("\ttest fail @%d, actual = %s, desired = %s" + % (case.line_nr - 1, actual, desired)) + return 1 + + if arguments['--env']: + environment = get_system_environment(arguments['--env']) + else: + # Will be 3.6. + environment = get_default_environment() + + import traceback + current = cases[0].path if cases else None + count = fails = 0 + for c in cases: + if c.get_skip_reason(environment): + continue + if current != c.path: + file_change(current, count, fails) + current = c.path + count = fails = 0 + + try: + if c.run(report, environment): + tests_fail += 1 + fails += 1 + except Exception: + traceback.print_exc() + print("\ttest fail @%d" % (c.line_nr - 1)) + tests_fail += 1 + fails += 1 + if arguments['--pdb']: + import pdb + pdb.post_mortem() + + count += 1 + + file_change(current, count, fails) + + print('\nSummary: (%s fails of %s tests) in %.3fs' + % (tests_fail, len(cases), time.time() - t_start)) + + exit_code = 1 if tests_fail else 0 + sys.exit(exit_code) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/speed/precedence.py b/vim/bundle/jedi-vim/pythonx/jedi/test/speed/precedence.py new file mode 100644 index 0000000..afd8824 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/speed/precedence.py @@ -0,0 +1,37 @@ +def marks(code): + if '.' in code: + another(code[:code.index(',') - 1] + '!') + else: + another(code + '.') + + +def another(code2): + call(numbers(code2 + 'haha')) + +marks('start1 ') +marks('start2 ') + + +def alphabet(code4): + if 1: + if 2: + return code4 + 'a' + else: + return code4 + 'b' + else: + if 2: + return code4 + 'c' + else: + return code4 + 'd' + + +def numbers(code5): + if 2: + return alphabet(code5 + '1') + else: + return alphabet(code5 + '2') + + +def call(code3): + code3 = numbers(numbers('end')) + numbers(code3) + code3.partition diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/static_analysis/attribute_error.py b/vim/bundle/jedi-vim/pythonx/jedi/test/static_analysis/attribute_error.py new file mode 100644 index 0000000..7ceb939 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/static_analysis/attribute_error.py @@ -0,0 +1,113 @@ +class Cls(): + class_attr = '' + def __init__(self, input): + self.instance_attr = 3 + self.input = input + + def f(self): + #! 12 attribute-error + return self.not_existing + + def undefined_object(self, obj): + """ + Uses an arbitrary object and performs an operation on it, shouldn't + be a problem. + """ + obj.arbitrary_lookup + + def defined_lookup(self, obj): + """ + `obj` is defined by a call into this function. + """ + obj.upper + #! 4 attribute-error + obj.arbitrary_lookup + + #! 13 name-error + class_attr = a + +Cls(1).defined_lookup('') + +c = Cls(1) +c.class_attr +Cls.class_attr +#! 4 attribute-error +Cls.class_attr_error +c.instance_attr +#! 2 attribute-error +c.instance_attr_error + + +c.something = None + +#! 12 name-error +something = a +something + +# ----------------- +# Unused array variables should still raise attribute errors. +# ----------------- + +# should not raise anything. +for loop_variable in [1, 2]: + #! 4 name-error + x = undefined + loop_variable + +#! 28 name-error +for loop_variable in [1, 2, undefined]: + pass + +#! 7 attribute-error +[1, ''.undefined_attr] + + +def return_one(something): + return 1 + +#! 14 attribute-error +return_one(''.undefined_attribute) + +#! 12 name-error +[r for r in undefined] + +#! 1 name-error +[undefined for r in [1, 2]] + +[r for r in [1, 2]] + +# some random error that showed up +class NotCalled(): + def match_something(self, param): + seems_to_need_an_assignment = param + return [value.match_something() for value in []] + +# ----------------- +# decorators +# ----------------- + +#! 1 name-error +@undefined_decorator +def func(): + return 1 + +# ----------------- +# operators +# ----------------- + +string = '%s %s' % (1, 2) + +# Shouldn't raise an error, because `string` is really just a string, not an +# array or something. +string.upper + +# ----------------- +# imports +# ----------------- + +# Star imports and the like in modules should not cause attribute errors in +# this module. +import import_tree + +import_tree.a +import_tree.b diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/static_analysis/attribute_warnings.py b/vim/bundle/jedi-vim/pythonx/jedi/test/static_analysis/attribute_warnings.py new file mode 100644 index 0000000..0e1e5e9 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/static_analysis/attribute_warnings.py @@ -0,0 +1,46 @@ +""" +Jedi issues warnings for possible errors if ``__getattr__``, +``__getattribute__`` or ``setattr`` are used. +""" + +# ----------------- +# __getattr*__ +# ----------------- + + +class Cls(): + def __getattr__(self, name): + return getattr(str, name) + + +Cls().upper + +#! 6 warning attribute-error +Cls().undefined + + +class Inherited(Cls): + pass + +Inherited().upper + +#! 12 warning attribute-error +Inherited().undefined + +# ----------------- +# setattr +# ----------------- + + +class SetattrCls(): + def __init__(self, dct): + # Jedi doesn't even try to understand such code + for k, v in dct.items(): + setattr(self, k, v) + + self.defined = 3 + +c = SetattrCls({'a': 'b'}) +c.defined +#! 2 warning attribute-error +c.undefined diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/static_analysis/branches.py b/vim/bundle/jedi-vim/pythonx/jedi/test/static_analysis/branches.py new file mode 100644 index 0000000..458d854 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/static_analysis/branches.py @@ -0,0 +1,52 @@ +# ----------------- +# Simple tests +# ----------------- + +import random + +if random.choice([0, 1]): + x = '' +else: + x = 1 +if random.choice([0, 1]): + y = '' +else: + y = 1 + +# A simple test +if x != 1: + x.upper() +else: + #! 2 attribute-error + x.upper() + pass + +# This operation is wrong, because the types could be different. +#! 6 type-error-operation +z = x + y +# However, here we have correct types. +if x == y: + z = x + y +else: + #! 6 type-error-operation + z = x + y + + +# TODO enable this one. +#x = 3 +#if x != 1: +# x.upper() + +# ----------------- +# With a function +# ----------------- + +def addition(a, b): + if type(a) == type(b): + return a + b + else: + #! 9 type-error-operation + return a + b + +addition(1, 1) +addition(1.0, '') diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/static_analysis/builtins.py b/vim/bundle/jedi-vim/pythonx/jedi/test/static_analysis/builtins.py new file mode 100644 index 0000000..86caca6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/static_analysis/builtins.py @@ -0,0 +1,11 @@ +# ---------- +# isinstance +# ---------- + +isinstance(1, int) +isinstance(1, (int, str)) + +#! 14 type-error-isinstance +isinstance(1, 1) +#! 14 type-error-isinstance +isinstance(1, [int, str]) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/static_analysis/class_simple.py b/vim/bundle/jedi-vim/pythonx/jedi/test/static_analysis/class_simple.py new file mode 100644 index 0000000..3f84fde --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/static_analysis/class_simple.py @@ -0,0 +1,13 @@ +class Base(object): + class Nested(): + def foo(): + pass + + +class X(Base.Nested): + pass + + +X().foo() +#! 4 attribute-error +X().bar() diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/static_analysis/comprehensions.py b/vim/bundle/jedi-vim/pythonx/jedi/test/static_analysis/comprehensions.py new file mode 100644 index 0000000..8701b11 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/static_analysis/comprehensions.py @@ -0,0 +1,42 @@ +[a + 1 for a in [1, 2]] + +#! 3 type-error-operation +[a + '' for a in [1, 2]] +#! 3 type-error-operation +(a + '' for a in [1, 2]) + +#! 12 type-error-not-iterable +[a for a in 1] + +tuple(str(a) for a in [1]) + +#! 8 type-error-operation +tuple(a + 3 for a in ['']) + +# ---------- +# Some variables within are not defined +# ---------- + +abcdef = [] +#! 12 name-error +[1 for a in NOT_DEFINFED for b in abcdef if 1] + +#! 25 name-error +[1 for a in [1] for b in NOT_DEFINED if 1] + +#! 12 name-error +[1 for a in NOT_DEFINFED for b in [1] if 1] + +#! 19 name-error +(1 for a in [1] if NOT_DEFINED) + +# ---------- +# unbalanced sides. +# ---------- + +# ok +(1 for a, b in [(1, 2)]) +#! 13 value-error-too-few-values +(1 for a, b, c in [(1, 2)]) +#! 10 value-error-too-many-values +(1 for a, b in [(1, 2, 3)]) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/static_analysis/descriptors.py b/vim/bundle/jedi-vim/pythonx/jedi/test/static_analysis/descriptors.py new file mode 100644 index 0000000..0fc5d15 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/static_analysis/descriptors.py @@ -0,0 +1,13 @@ +# classmethod +class TarFile(): + @classmethod + def open(cls, name, **kwargs): + return cls.taropen(name, **kwargs) + + @classmethod + def taropen(cls, name, **kwargs): + return name + + +# should just work +TarFile.open('hallo') diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/static_analysis/generators.py b/vim/bundle/jedi-vim/pythonx/jedi/test/static_analysis/generators.py new file mode 100644 index 0000000..b941800 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/static_analysis/generators.py @@ -0,0 +1,7 @@ +def generator(): + yield 1 + +#! 11 type-error-not-subscriptable +generator()[0] + +list(generator())[0] diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/static_analysis/import_tree/__init__.py b/vim/bundle/jedi-vim/pythonx/jedi/test/static_analysis/import_tree/__init__.py new file mode 100644 index 0000000..cb485f1 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/static_analysis/import_tree/__init__.py @@ -0,0 +1,5 @@ +""" +Another import tree, this time not for completion, but static analysis. +""" + +from .a import * diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/static_analysis/import_tree/a.py b/vim/bundle/jedi-vim/pythonx/jedi/test/static_analysis/import_tree/a.py new file mode 100644 index 0000000..b02981c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/static_analysis/import_tree/a.py @@ -0,0 +1 @@ +from . import b diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/static_analysis/import_tree/b.py b/vim/bundle/jedi-vim/pythonx/jedi/test/static_analysis/import_tree/b.py new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/static_analysis/imports.py b/vim/bundle/jedi-vim/pythonx/jedi/test/static_analysis/imports.py new file mode 100644 index 0000000..0df9bac --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/static_analysis/imports.py @@ -0,0 +1,25 @@ + +#! 7 import-error +import not_existing + +import os + +from os.path import abspath +#! 20 import-error +from os.path import not_existing + +from datetime import date +date.today + +#! 5 attribute-error +date.not_existing_attribute + +#! 14 import-error +from datetime.date import today + +#! 16 import-error +import datetime.date +#! 7 import-error +import not_existing_nested.date + +import os.path diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/static_analysis/iterable.py b/vim/bundle/jedi-vim/pythonx/jedi/test/static_analysis/iterable.py new file mode 100644 index 0000000..0eae367 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/static_analysis/iterable.py @@ -0,0 +1,21 @@ + +a, b = {'asdf': 3, 'b': 'str'} +a + +x = [1] +x[0], b = {'a': 1, 'b': '2'} + +dct = {3: ''} +for x in dct: + pass + +#! 4 type-error-not-iterable +for x, y in dct: + pass + +# Shouldn't cause issues, because if there are no types (or we don't know what +# the types are, we should just ignore it. +#! 0 value-error-too-few-values +a, b = [] +#! 7 name-error +a, b = NOT_DEFINED diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/static_analysis/keywords.py b/vim/bundle/jedi-vim/pythonx/jedi/test/static_analysis/keywords.py new file mode 100644 index 0000000..e3fcaa4 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/static_analysis/keywords.py @@ -0,0 +1,7 @@ +def raises(): + raise KeyError() + + +def wrong_name(): + #! 6 name-error + raise NotExistingException() diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/static_analysis/normal_arguments.py b/vim/bundle/jedi-vim/pythonx/jedi/test/static_analysis/normal_arguments.py new file mode 100644 index 0000000..2fc8e81 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/static_analysis/normal_arguments.py @@ -0,0 +1,73 @@ +# ----------------- +# normal arguments (no keywords) +# ----------------- + + +def simple(a): + return a + +simple(1) +#! 6 type-error-too-few-arguments +simple() +#! 10 type-error-too-many-arguments +simple(1, 2) + + +#! 10 type-error-too-many-arguments +simple(1, 2, 3) + +# ----------------- +# keyword arguments +# ----------------- + +simple(a=1) +#! 7 type-error-keyword-argument +simple(b=1) +#! 10 type-error-too-many-arguments +simple(1, a=1) + + +def two_params(x, y): + return y + + +two_params(y=2, x=1) +two_params(1, y=2) + +#! 11 type-error-multiple-values +two_params(1, x=2) +#! 17 type-error-too-many-arguments +two_params(1, 2, y=3) + +# ----------------- +# default arguments +# ----------------- + +def default(x, y=1, z=2): + return x + +#! 7 type-error-too-few-arguments +default() +default(1) +default(1, 2) +default(1, 2, 3) +#! 17 type-error-too-many-arguments +default(1, 2, 3, 4) + +default(x=1) + +# ----------------- +# class arguments +# ----------------- + +class Instance(): + def __init__(self, foo): + self.foo = foo + +Instance(1).foo +Instance(foo=1).foo + +#! 12 type-error-too-many-arguments +Instance(1, 2).foo +#! 8 type-error-too-few-arguments +Instance().foo diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/static_analysis/operations.py b/vim/bundle/jedi-vim/pythonx/jedi/test/static_analysis/operations.py new file mode 100644 index 0000000..bca27c6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/static_analysis/operations.py @@ -0,0 +1,17 @@ +-1 + 1 +1 + 1.0 +#! 2 type-error-operation +1 + '1' +#! 2 type-error-operation +1 - '1' + +-1 - - 1 +# TODO uncomment +#-1 - int() +#int() - float() +float() - 3.0 + +a = 3 +b = '' +#! 2 type-error-operation +a + b diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/static_analysis/python2.py b/vim/bundle/jedi-vim/pythonx/jedi/test/static_analysis/python2.py new file mode 100644 index 0000000..4d896e3 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/static_analysis/python2.py @@ -0,0 +1,11 @@ +""" +Some special cases of Python 2. +""" +# python <= 2.7 + +# print is syntax: +print 1 +print(1) + +#! 6 name-error +print NOT_DEFINED diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/static_analysis/star_arguments.py b/vim/bundle/jedi-vim/pythonx/jedi/test/static_analysis/star_arguments.py new file mode 100644 index 0000000..34be43b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/static_analysis/star_arguments.py @@ -0,0 +1,119 @@ +# ----------------- +# *args +# ----------------- + + +def simple(a): + return a + + +def nested(*args): + return simple(*args) + +nested(1) +#! 6 type-error-too-few-arguments +nested() + + +def nested_no_call_to_function(*args): + return simple(1, *args) + + +def simple2(a, b, c): + return b +def nested(*args): + return simple2(1, *args) +def nested_twice(*args1): + return nested(*args1) + +nested_twice(2, 3) +#! 13 type-error-too-few-arguments +nested_twice(2) +#! 19 type-error-too-many-arguments +nested_twice(2, 3, 4) + + +# A named argument can be located before *args. +def star_args_with_named(*args): + return simple2(c='', *args) + +star_args_with_named(1, 2) +# ----------------- +# **kwargs +# ----------------- + + +def kwargs_test(**kwargs): + return simple2(1, **kwargs) + +kwargs_test(c=3, b=2) +#! 12 type-error-too-few-arguments +kwargs_test(c=3) +#! 12 type-error-too-few-arguments +kwargs_test(b=2) +#! 22 type-error-keyword-argument +kwargs_test(b=2, c=3, d=4) +#! 12 type-error-multiple-values +kwargs_test(b=2, c=3, a=4) + + +def kwargs_nested(**kwargs): + return kwargs_test(b=2, **kwargs) + +kwargs_nested(c=3) +#! 13 type-error-too-few-arguments +kwargs_nested() +#! 19 type-error-keyword-argument +kwargs_nested(c=2, d=4) +#! 14 type-error-multiple-values +kwargs_nested(c=2, a=4) +# TODO reenable +##! 14 type-error-multiple-values +#kwargs_nested(b=3, c=2) + +# ----------------- +# mixed *args/**kwargs +# ----------------- + +def simple_mixed(a, b, c): + return b + +def mixed(*args, **kwargs): + return simple_mixed(1, *args, **kwargs) + +mixed(1, 2) +mixed(1, c=2) +mixed(b=2, c=3) +mixed(c=4, b='') + +# need separate functions, otherwise these might swallow the errors +def mixed2(*args, **kwargs): + return simple_mixed(1, *args, **kwargs) + + +#! 7 type-error-too-few-arguments +mixed2(c=2) +#! 7 type-error-too-few-arguments +mixed2(3) +#! 13 type-error-too-many-arguments +mixed2(3, 4, 5) +# TODO reenable +##! 13 type-error-too-many-arguments +#mixed2(3, 4, c=5) +#! 7 type-error-multiple-values +mixed2(3, b=5) + +# ----------------- +# plain wrong arguments +# ----------------- + +#! 12 type-error-star-star +simple(1, **[]) +#! 12 type-error-star-star +simple(1, **1) +class A(): pass +#! 12 type-error-star-star +simple(1, **A()) + +#! 11 type-error-star +simple(1, *1) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/static_analysis/try_except.py b/vim/bundle/jedi-vim/pythonx/jedi/test/static_analysis/try_except.py new file mode 100644 index 0000000..540ba72 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/static_analysis/try_except.py @@ -0,0 +1,107 @@ +try: + #! 4 attribute-error + str.not_existing +except TypeError: + pass + +try: + str.not_existing +except AttributeError: + #! 4 attribute-error + str.not_existing + pass + +try: + import not_existing_import +except ImportError: + pass +try: + #! 7 import-error + import not_existing_import +except AttributeError: + pass + +# ----------------- +# multi except +# ----------------- +try: + str.not_existing +except (TypeError, AttributeError): pass + +try: + str.not_existing +except ImportError: + pass +except (NotImplementedError, AttributeError): pass + +try: + #! 4 attribute-error + str.not_existing +except (TypeError, NotImplementedError): pass + +# ----------------- +# detailed except +# ----------------- +try: + str.not_existing +except ((AttributeError)): pass +try: + #! 4 attribute-error + str.not_existing +except [AttributeError]: pass + +# Should be able to detect errors in except statement as well. +try: + pass +#! 7 name-error +except Undefined: + pass + +# ----------------- +# inheritance +# ----------------- + +try: + undefined +except Exception: + pass + +# should catch everything +try: + undefined +except: + pass + +# ----------------- +# kind of similar: hasattr +# ----------------- + +if hasattr(str, 'undefined'): + str.undefined + str.upper + #! 4 attribute-error + str.undefined2 + #! 4 attribute-error + int.undefined +else: + str.upper + #! 4 attribute-error + str.undefined + +# ----------------- +# arguments +# ----------------- + +def i_see(r): + return r + +def lala(): + # This weird structure checks if the error is actually resolved in the + # right place. + a = TypeError + try: + i_see() + except a: + pass + #! 5 type-error-too-few-arguments + i_see() diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_api/__init__.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_api/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_api/import_tree_for_usages/__init__.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_api/import_tree_for_usages/__init__.py new file mode 100644 index 0000000..d2ae403 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_api/import_tree_for_usages/__init__.py @@ -0,0 +1,4 @@ +""" +An import tree, for testing usages. +""" + diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_api/import_tree_for_usages/a.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_api/import_tree_for_usages/a.py new file mode 100644 index 0000000..acc8183 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_api/import_tree_for_usages/a.py @@ -0,0 +1,4 @@ +from . import b + +def foo(): + b.bar() diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_api/import_tree_for_usages/b.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_api/import_tree_for_usages/b.py new file mode 100644 index 0000000..4371a5a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_api/import_tree_for_usages/b.py @@ -0,0 +1,2 @@ +def bar(): + pass diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_api/simple_import/__init__.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_api/simple_import/__init__.py new file mode 100644 index 0000000..3a03a82 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_api/simple_import/__init__.py @@ -0,0 +1,5 @@ +from simple_import import module + + +def in_function(): + from simple_import import module2 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_api/simple_import/module.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_api/simple_import/module.py new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_api/simple_import/module2.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_api/simple_import/module2.py new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_api/test_analysis.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_api/test_analysis.py new file mode 100644 index 0000000..f0b6a44 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_api/test_analysis.py @@ -0,0 +1,11 @@ +""" +Test of keywords and ``jedi.keywords`` +""" + + +def test_issue436(Script): + code = "bar = 0\nbar += 'foo' + 4" + errors = set(repr(e) for e in Script(code)._analysis()) + assert len(errors) == 2 + assert '' in errors + assert '' in errors diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_api/test_api.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_api/test_api.py new file mode 100644 index 0000000..af7b9e7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_api/test_api.py @@ -0,0 +1,302 @@ +""" +Test all things related to the ``jedi.api`` module. +""" + +import os +from textwrap import dedent + +from pytest import raises +from parso import cache + +from jedi import preload_module +from jedi.evaluate.gradual import typeshed + + +def test_preload_modules(): + def check_loaded(*modules): + for grammar_cache in cache.parser_cache.values(): + if None in grammar_cache: + break + # Filter the typeshed parser cache. + typeshed_cache_count = sum( + 1 for path in grammar_cache + if path is not None and path.startswith(typeshed.TYPESHED_PATH) + ) + # +1 for None module (currently used) + assert len(grammar_cache) - typeshed_cache_count == len(modules) + 1 + for i in modules: + assert [i in k for k in grammar_cache.keys() if k is not None] + + old_cache = cache.parser_cache.copy() + cache.parser_cache.clear() + + try: + preload_module('sys') + check_loaded() # compiled (c_builtin) modules shouldn't be in the cache. + preload_module('types', 'token') + check_loaded('types', 'token') + finally: + cache.parser_cache.update(old_cache) + + +def test_empty_script(Script): + assert Script('') + + +def test_line_number_errors(Script): + """ + Script should raise a ValueError if line/column numbers are not in a + valid range. + """ + s = 'hello' + # lines + with raises(ValueError): + Script(s, 2, 0) + with raises(ValueError): + Script(s, 0, 0) + + # columns + with raises(ValueError): + Script(s, 1, len(s) + 1) + with raises(ValueError): + Script(s, 1, -1) + + # ok + Script(s, 1, 0) + Script(s, 1, len(s)) + + +def _check_number(Script, source, result='float'): + completions = Script(source).completions() + assert completions[0].parent().name == result + + +def test_completion_on_number_literals(Script): + # No completions on an int literal (is a float). + assert [c.name for c in Script('1. ').completions()] \ + == ['and', 'if', 'in', 'is', 'not', 'or'] + + # Multiple points after an int literal basically mean that there's a float + # and a call after that. + _check_number(Script, '1..') + _check_number(Script, '1.0.') + + # power notation + _check_number(Script, '1.e14.') + _check_number(Script, '1.e-3.') + _check_number(Script, '9e3.') + assert Script('1.e3..').completions() == [] + assert Script('1.e-13..').completions() == [] + + +def test_completion_on_hex_literals(Script): + assert Script('0x1..').completions() == [] + _check_number(Script, '0x1.', 'int') # hexdecimal + # Completing binary literals doesn't work if they are not actually binary + # (invalid statements). + assert Script('0b2.b').completions() == [] + _check_number(Script, '0b1.', 'int') # binary + + _check_number(Script, '0x2e.', 'int') + _check_number(Script, '0xE7.', 'int') + _check_number(Script, '0xEa.', 'int') + # theoretically, but people can just check for syntax errors: + #assert Script('0x.').completions() == [] + + +def test_completion_on_complex_literals(Script): + assert Script('1j..').completions() == [] + _check_number(Script, '1j.', 'complex') + _check_number(Script, '44.j.', 'complex') + _check_number(Script, '4.0j.', 'complex') + # No dot no completion - I thought, but 4j is actually a literal after + # which a keyword like or is allowed. Good times, haha! + # However this has been disabled again, because it apparently annoyed + # users. So no completion after j without a space :) + assert not Script('4j').completions() + assert ({c.name for c in Script('4j ').completions()} == + {'if', 'and', 'in', 'is', 'not', 'or'}) + + +def test_goto_assignments_on_non_name(Script, environment): + assert Script('for').goto_assignments() == [] + + assert Script('assert').goto_assignments() == [] + assert Script('True').goto_assignments() == [] + + +def test_goto_definitions_on_non_name(Script): + assert Script('import x', column=0).goto_definitions() == [] + + +def test_goto_definitions_on_generator(Script): + def_, = Script('def x(): yield 1\ny=x()\ny').goto_definitions() + assert def_.name == 'Generator' + + +def test_goto_definition_not_multiple(Script): + """ + There should be only one Definition result if it leads back to the same + origin (e.g. instance method) + """ + + s = dedent('''\ + import random + class A(): + def __init__(self, a): + self.a = 3 + + def foo(self): + pass + + if random.randint(0, 1): + a = A(2) + else: + a = A(1) + a''') + assert len(Script(s).goto_definitions()) == 1 + + +def test_usage_description(Script): + descs = [u.description for u in Script("foo = ''; foo").usages()] + assert set(descs) == {"foo = ''", 'foo'} + + +def test_get_line_code(Script): + def get_line_code(source, line=None, **kwargs): + return Script(source, line=line).completions()[0].get_line_code(**kwargs) + + # On builtin + assert get_line_code('') == '' + + # On custom code + first_line = 'def foo():\n' + line = ' foo' + code = first_line + line + assert get_line_code(code) == first_line + + # With before/after + code = code + '\nother_line' + assert get_line_code(code, line=2) == first_line + assert get_line_code(code, line=2, after=1) == first_line + line + '\n' + assert get_line_code(code, line=2, after=2, before=1) == code + # Should just be the whole thing, since there are no more lines on both + # sides. + assert get_line_code(code, line=2, after=3, before=3) == code + + +def test_goto_assignments_follow_imports(Script): + code = dedent(""" + import inspect + inspect.isfunction""") + definition, = Script(code, column=0).goto_assignments(follow_imports=True) + assert 'inspect.py' in definition.module_path + assert (definition.line, definition.column) == (1, 0) + + definition, = Script(code).goto_assignments(follow_imports=True) + assert 'inspect.py' in definition.module_path + assert (definition.line, definition.column) > (1, 0) + + code = '''def param(p): pass\nparam(1)''' + start_pos = 1, len('def param(') + + script = Script(code, *start_pos) + definition, = script.goto_assignments(follow_imports=True) + assert (definition.line, definition.column) == start_pos + assert definition.name == 'p' + result, = definition.goto_assignments() + assert result.name == 'p' + result, = definition.infer() + assert result.name == 'int' + result, = result.infer() + assert result.name == 'int' + + definition, = script.goto_assignments() + assert (definition.line, definition.column) == start_pos + + d, = Script('a = 1\na').goto_assignments(follow_imports=True) + assert d.name == 'a' + + +def test_goto_module(Script): + def check(line, expected): + script = Script(path=path, line=line) + module, = script.goto_assignments() + assert module.module_path == expected + + base_path = os.path.join(os.path.dirname(__file__), 'simple_import') + path = os.path.join(base_path, '__init__.py') + + check(1, os.path.join(base_path, 'module.py')) + check(5, os.path.join(base_path, 'module2.py')) + + +def test_goto_definition_cursor(Script): + + s = ("class A():\n" + " def _something(self):\n" + " return\n" + " def different_line(self,\n" + " b):\n" + " return\n" + "A._something\n" + "A.different_line" + ) + + in_name = 2, 9 + under_score = 2, 8 + cls = 2, 7 + should1 = 7, 10 + diff_line = 4, 10 + should2 = 8, 10 + + def get_def(pos): + return [d.description for d in Script(s, *pos).goto_definitions()] + + in_name = get_def(in_name) + under_score = get_def(under_score) + should1 = get_def(should1) + should2 = get_def(should2) + + diff_line = get_def(diff_line) + + assert should1 == in_name + assert should1 == under_score + + assert should2 == diff_line + + assert get_def(cls) == [] + + +def test_no_statement_parent(Script): + source = dedent(""" + def f(): + pass + + class C: + pass + + variable = f if random.choice([0, 1]) else C""") + defs = Script(source, column=3).goto_definitions() + defs = sorted(defs, key=lambda d: d.line) + assert [d.description for d in defs] == ['def f', 'class C'] + + +def test_backslash_continuation_and_bracket(Script): + code = dedent(r""" + x = 0 + a = \ + [1, 2, 3, (x)]""") + + lines = code.splitlines() + column = lines[-1].index('(') + def_, = Script(code, line=len(lines), column=column).goto_definitions() + assert def_.name == 'int' + + +def test_goto_follow_builtin_imports(Script): + s = Script('import sys; sys') + d, = s.goto_assignments(follow_imports=True) + assert d.in_builtin_module() is True + d, = s.goto_assignments(follow_imports=True, follow_builtin_imports=True) + assert d.in_builtin_module() is True diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_api/test_api_classes_follow_definition.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_api/test_api_classes_follow_definition.py new file mode 100644 index 0000000..6e25119 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_api/test_api_classes_follow_definition.py @@ -0,0 +1,64 @@ +from itertools import chain + +import jedi +from ..helpers import cwd_at + + +def test_import_empty(Script): + """ github #340, return the full word. """ + completion = Script("import ").completions()[0] + definition = completion.infer()[0] + assert definition + + +def check_follow_definition_types(Script, source): + # nested import + completions = Script(source, path='some_path.py').completions() + defs = chain.from_iterable(c.infer() for c in completions) + return [d.type for d in defs] + + +def test_follow_import_incomplete(Script, environment): + """ + Completion on incomplete imports should always take the full completion + to do any evaluation. + """ + datetime = check_follow_definition_types(Script, "import itertool") + assert datetime == ['module'] + + # empty `from * import` parts + itert = jedi.Script("from itertools import ").completions() + definitions = [d for d in itert if d.name == 'chain'] + assert len(definitions) == 1 + assert [d.type for d in definitions[0].infer()] == ['class'] + + # incomplete `from * import` part + datetime = check_follow_definition_types(Script, "from datetime import datetim") + if environment.version_info.major == 2: + assert datetime == ['class'] + else: + assert set(datetime) == {'class', 'instance'} # py3: builtin and pure py version + # os.path check + ospath = check_follow_definition_types(Script, "from os.path import abspat") + assert set(ospath) == {'function'} + + # alias + alias = check_follow_definition_types(Script, "import io as abcd; abcd") + assert alias == ['module'] + + +@cwd_at('test/completion/import_tree') +def test_follow_definition_nested_import(Script): + types = check_follow_definition_types(Script, "import pkg.mod1; pkg") + assert types == ['module'] + + types = check_follow_definition_types(Script, "import pkg.mod1; pkg.mod1") + assert types == ['module'] + + types = check_follow_definition_types(Script, "import pkg.mod1; pkg.mod1.a") + assert types == ['instance'] + + +def test_follow_definition_land_on_import(Script): + types = check_follow_definition_types(Script, "import datetime; datetim") + assert types == ['module'] diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_api/test_call_signatures.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_api/test_call_signatures.py new file mode 100644 index 0000000..4586d29 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_api/test_call_signatures.py @@ -0,0 +1,627 @@ +import sys +from textwrap import dedent +import inspect + +import pytest + +from ..helpers import TestCase +from jedi import cache +from jedi.parser_utils import get_call_signature +from jedi import Interpreter + + +def assert_signature(Script, source, expected_name, expected_index=0, line=None, column=None): + signatures = Script(source, line, column).call_signatures() + + assert len(signatures) <= 1 + + if not signatures: + assert expected_name is None, \ + 'There are no signatures, but `%s` expected.' % expected_name + else: + assert signatures[0].name == expected_name + assert signatures[0].index == expected_index + return signatures[0] + + +def test_valid_call(Script): + assert_signature(Script, 'bool()', 'bool', column=5) + + +class TestCallSignatures(TestCase): + @pytest.fixture(autouse=True) + def init(self, Script): + self.Script = Script + + def _run_simple(self, source, name, index=0, column=None, line=1): + assert_signature(self.Script, source, name, index, line, column) + + def test_simple(self): + run = self._run_simple + + # simple + s1 = "sorted(a, bool(" + run(s1, 'sorted', 0, 7) + run(s1, 'sorted', 1, 9) + run(s1, 'sorted', 1, 10) + run(s1, 'sorted', None, 11) + run(s1, 'bool', 0, 15) + + s2 = "abs(), " + run(s2, 'abs', 0, 4) + run(s2, None, column=5) + run(s2, None) + + s3 = "abs()." + run(s3, None, column=5) + run(s3, None) + + def test_more_complicated(self): + run = self._run_simple + + s4 = 'abs(bool(), , set,' + run(s4, None, column=3) + run(s4, 'abs', 0, 4) + run(s4, 'bool', 0, 9) + run(s4, 'abs', 0, 10) + run(s4, 'abs', None, 11) + + s5 = "sorted(1,\nif 2:\n def a():" + run(s5, 'sorted', 0, 7) + run(s5, 'sorted', 1, 9) + + s6 = "bool().__eq__(" + run(s6, '__eq__', 0) + run(s6, 'bool', 0, 5) + + s7 = "str().upper().center(" + s8 = "bool(int[abs(" + run(s7, 'center', 0) + run(s8, 'abs', 0) + run(s8, 'bool', 0, 10) + + run("import time; abc = time; abc.sleep(", 'sleep', 0) + + def test_issue_57(self): + # jedi #57 + s = "def func(alpha, beta): pass\n" \ + "func(alpha='101'," + self._run_simple(s, 'func', 0, column=13, line=2) + + def test_for(self): + # jedi-vim #11 + self._run_simple("for sorted(", 'sorted', 0) + self._run_simple("for s in sorted(", 'sorted', 0) + + +def test_with(Script): + # jedi-vim #9 + sigs = Script("with open(").call_signatures() + assert sigs + assert all(sig.name == 'open' for sig in sigs) + + +def test_call_signatures_empty_parentheses_pre_space(Script): + s = dedent("""\ + def f(a, b): + pass + f( )""") + assert_signature(Script, s, 'f', 0, line=3, column=3) + + +def test_multiple_signatures(Script): + s = dedent("""\ + if x: + def f(a, b): + pass + else: + def f(a, b): + pass + f(""") + assert len(Script(s).call_signatures()) == 2 + + +def test_call_signatures_whitespace(Script): + s = dedent("""\ + abs( + def x(): + pass + """) + assert_signature(Script, s, 'abs', 0, line=1, column=5) + + +def test_decorator_in_class(Script): + """ + There's still an implicit param, with a decorator. + Github issue #319. + """ + s = dedent("""\ + def static(func): + def wrapped(obj, *args): + return f(type(obj), *args) + return wrapped + + class C(object): + @static + def test(cls): + return 10 + + C().test(""") + + signatures = Script(s).call_signatures() + assert len(signatures) == 1 + x = [p.description for p in signatures[0].params] + assert x == ['param *args'] + + +def test_additional_brackets(Script): + assert_signature(Script, 'abs((', 'abs', 0) + + +def test_unterminated_strings(Script): + assert_signature(Script, 'abs(";', 'abs', 0) + + +def test_whitespace_before_bracket(Script): + assert_signature(Script, 'abs (', 'abs', 0) + assert_signature(Script, 'abs (";', 'abs', 0) + assert_signature(Script, 'abs\n(', None) + + +def test_brackets_in_string_literals(Script): + assert_signature(Script, 'abs (" (', 'abs', 0) + assert_signature(Script, 'abs (" )', 'abs', 0) + + +def test_function_definitions_should_break(Script): + """ + Function definitions (and other tokens that cannot exist within call + signatures) should break and not be able to return a call signature. + """ + assert_signature(Script, 'abs(\ndef x', 'abs', 0) + assert not Script('abs(\ndef x(): pass').call_signatures() + + +def test_flow_call(Script): + assert not Script('if (1').call_signatures() + + +def test_chained_calls(Script): + source = dedent(''' + class B(): + def test2(self, arg): + pass + + class A(): + def test1(self): + return B() + + A().test1().test2(''') + + assert_signature(Script, source, 'test2', 0) + + +def test_return(Script): + source = dedent(''' + def foo(): + return '.'.join()''') + + assert_signature(Script, source, 'join', 0, column=len(" return '.'.join(")) + + +def test_call_signature_on_module(Script): + """github issue #240""" + s = 'import datetime; datetime(' + # just don't throw an exception (if numpy doesn't exist, just ignore it) + assert Script(s).call_signatures() == [] + + +def test_complex(Script, environment): + s = """ + def abc(a,b): + pass + + def a(self): + abc( + + if 1: + pass + """ + assert_signature(Script, s, 'abc', 0, line=6, column=20) + s = """ + import re + def huhu(it): + re.compile( + return it * 2 + """ + sig1, sig2 = sorted(Script(s, line=4, column=27).call_signatures(), key=lambda s: s.line) + assert sig1.name == sig2.name == 'compile' + assert sig1.index == sig2.index == 0 + func1, = sig1._name.infer() + func2, = sig2._name.infer() + + if environment.version_info.major == 3: + # Do these checks just for Python 3, I'm too lazy to deal with this + # legacy stuff. ~ dave. + assert get_call_signature(func1.tree_node) \ + == 'compile(pattern: AnyStr, flags: _FlagsType = ...) -> Pattern[AnyStr]' + assert get_call_signature(func2.tree_node) \ + == 'compile(pattern: Pattern[AnyStr], flags: _FlagsType = ...) ->\nPattern[AnyStr]' + + # jedi-vim #70 + s = """def foo(""" + assert Script(s).call_signatures() == [] + + # jedi-vim #116 + s = """import itertools; test = getattr(itertools, 'chain'); test(""" + assert_signature(Script, s, 'chain', 0) + + +def _params(Script, source, line=None, column=None): + signatures = Script(source, line, column).call_signatures() + assert len(signatures) == 1 + return signatures[0].params + + +def test_int_params(Script): + sig1, sig2 = Script('int(').call_signatures() + # int is defined as: `int(x[, base])` + assert len(sig1.params) == 2 + assert sig1.params[0].name == 'x' + assert sig1.params[1].name == 'base' + assert len(sig2.params) == 1 + assert sig2.params[0].name == 'x' + + +def test_pow_params(Script): + # See Github #1357. + for sig in Script('pow(').call_signatures(): + param_names = [p.name for p in sig.params] + assert param_names in (['x', 'y'], ['x', 'y', 'z']) + + +def test_param_name(Script): + sigs = Script('open(something,').call_signatures() + for sig in sigs: + # All of the signatures (in Python the function is overloaded), + # contain the same param names. + assert sig.params[0].name in ['file', 'name'] + assert sig.params[1].name == 'mode' + assert sig.params[2].name == 'buffering' + + +def test_builtins(Script): + """ + The self keyword should be visible even for builtins, if not + instantiated. + """ + p = _params(Script, 'str.endswith(') + assert p[0].name == 'self' + assert p[1].name == 'suffix' + p = _params(Script, 'str().endswith(') + assert p[0].name == 'suffix' + + +def test_signature_is_definition(Script): + """ + Through inheritance, a call signature is a sub class of Definition. + Check if the attributes match. + """ + s = """class Spam(): pass\nSpam""" + signature = Script(s + '(').call_signatures()[0] + definition = Script(s + '(', column=0).goto_definitions()[0] + signature.line == 1 + signature.column == 6 + + # Now compare all the attributes that a CallSignature must also have. + for attr_name in dir(definition): + dont_scan = ['defined_names', 'parent', 'goto_assignments', 'infer', + 'params', 'get_signatures', 'execute'] + if attr_name.startswith('_') or attr_name in dont_scan: + continue + + attribute = getattr(definition, attr_name) + signature_attribute = getattr(signature, attr_name) + if inspect.ismethod(attribute): + assert attribute() == signature_attribute() + else: + assert attribute == signature_attribute + + +def test_no_signature(Script): + # str doesn't have a __call__ method + assert Script('str()(').call_signatures() == [] + + s = dedent("""\ + class X(): + pass + X()(""") + assert Script(s).call_signatures() == [] + assert len(Script(s, column=2).call_signatures()) == 1 + assert Script('').call_signatures() == [] + + +def test_dict_literal_in_incomplete_call(Script): + source = """\ + import json + + def foo(): + json.loads( + + json.load.return_value = {'foo': [], + 'bar': True} + + c = Foo() + """ + + script = Script(dedent(source), line=4, column=15) + assert script.call_signatures() + + +def test_completion_interference(Script): + """Seems to cause problems, see also #396.""" + cache.parser_cache.pop(None, None) + assert Script('open(').call_signatures() + + # complete something usual, before doing the same call_signatures again. + assert Script('from datetime import ').completions() + + assert Script('open(').call_signatures() + + +def test_keyword_argument_index(Script, environment): + def get(source, column=None): + return Script(source, column=column).call_signatures()[0] + + # The signature of sorted changed from 2 to 3. + py2_offset = int(environment.version_info.major == 2) + assert get('sorted([], key=a').index == 1 + py2_offset + assert get('sorted([], key=').index == 1 + py2_offset + assert get('sorted([], no_key=a').index is None + + kw_func = 'def foo(a, b): pass\nfoo(b=3, a=4)' + assert get(kw_func, column=len('foo(b')).index == 0 + assert get(kw_func, column=len('foo(b=')).index == 1 + assert get(kw_func, column=len('foo(b=3, a=')).index == 0 + + kw_func_simple = 'def foo(a, b): pass\nfoo(b=4)' + assert get(kw_func_simple, column=len('foo(b')).index == 0 + assert get(kw_func_simple, column=len('foo(b=')).index == 1 + + args_func = 'def foo(*kwargs): pass\n' + assert get(args_func + 'foo(a').index == 0 + assert get(args_func + 'foo(a, b').index == 0 + + kwargs_func = 'def foo(**kwargs): pass\n' + assert get(kwargs_func + 'foo(a=2').index == 0 + assert get(kwargs_func + 'foo(a=2, b=2').index == 0 + + both = 'def foo(*args, **kwargs): pass\n' + assert get(both + 'foo(a=2').index == 1 + assert get(both + 'foo(a=2, b=2').index == 1 + assert get(both + 'foo(a=2, b=2)', column=len('foo(b=2, a=2')).index == 1 + assert get(both + 'foo(a, b, c').index == 0 + + +code1 = 'def f(u, /, v=3, *, abc, abd, xyz): pass' +code2 = 'def g(u, /, v=3, *, abc, abd, xyz, **kwargs): pass' +code3 = 'def h(u, /, v, *args, x=1, y): pass' +code4 = 'def i(u, /, v, *args, x=1, y, **kwargs): pass' + + +_calls = [ + # No *args, **kwargs + (code1, 'f(', 0), + (code1, 'f(a', 0), + (code1, 'f(a,', 1), + (code1, 'f(a,b', 1), + (code1, 'f(a,b,', 2), + (code1, 'f(a,b,c', None), + (code1, 'f(a,b,a', 2), + (code1, 'f(a,b,a=', None), + (code1, 'f(a,b,abc', 2), + (code1, 'f(a,b,abc=(', 2), + (code1, 'f(a,b,abc=(f,1,2,3', 2), + (code1, 'f(a,b,abd', 3), + (code1, 'f(a,b,x', 4), + (code1, 'f(a,b,xy', 4), + (code1, 'f(a,b,xyz=', 4), + (code1, 'f(a,b,xy=', None), + (code1, 'f(u=', (0, None)), + (code1, 'f(v=', 1), + + # **kwargs + (code2, 'g(a,b,a', 2), + (code2, 'g(a,b,abc', 2), + (code2, 'g(a,b,abd', 3), + (code2, 'g(a,b,arr', 5), + (code2, 'g(a,b,xy', 4), + (code2, 'g(a,b,xyz=', 4), + (code2, 'g(a,b,xy=', 5), + (code2, 'g(a,b,abc=1,abd=4,', 4), + (code2, 'g(a,b,abc=1,xyz=3,abd=4,', 5), + (code2, 'g(a,b,abc=1,abd=4,lala', 5), + (code2, 'g(a,b,abc=1,abd=4,lala=', 5), + (code2, 'g(a,b,abc=1,abd=4,abd=', 5), + (code2, 'g(a,b,kw', 5), + (code2, 'g(a,b,kwargs=', 5), + (code2, 'g(u=', (0, 5)), + (code2, 'g(v=', 1), + + # *args + (code3, 'h(a,b,c', 2), + (code3, 'h(a,b,c,', 2), + (code3, 'h(a,b,c,d', 2), + (code3, 'h(a,b,c,d[', 2), + (code3, 'h(a,b,c,(3,', 2), + (code3, 'h(a,b,c,(3,)', 2), + (code3, 'h(a,b,args=', None), + (code3, 'h(u,v=', 1), + (code3, 'h(u=', (0, None)), + (code3, 'h(u,*xxx', 1), + (code3, 'h(u,*xxx,*yyy', 1), + (code3, 'h(u,*[]', 1), + (code3, 'h(u,*', 1), + (code3, 'h(u,*, *', 1), + (code3, 'h(u,1,**', 3), + (code3, 'h(u,**y', 1), + (code3, 'h(u,x=2,**', 1), + (code3, 'h(u,x=2,**y', 1), + (code3, 'h(u,v=2,**y', 3), + (code3, 'h(u,x=2,**vv', 1), + + # *args, **kwargs + (code4, 'i(a,b,c,d', 2), + (code4, 'i(a,b,c,d,e', 2), + (code4, 'i(a,b,c,d,e=', 5), + (code4, 'i(a,b,c,d,e=3', 5), + (code4, 'i(a,b,c,d=,x=', 3), + (code4, 'i(a,b,c,d=5,x=4', 3), + (code4, 'i(a,b,c,d=5,x=4,y', 4), + (code4, 'i(a,b,c,d=5,x=4,y=3,', 5), + (code4, 'i(a,b,c,d=5,y=4,x=3,', 5), + (code4, 'i(a,b,c,d=4,', 3), + (code4, 'i(a,b,c,x=1,d=,', 4), + + # Error nodes + (code4, 'i(1, [a,b', 1), + (code4, 'i(1, [a,b=,', 2), + (code4, 'i(1, [a?b,', 2), + (code4, 'i(1, [a?b,*', 2), + (code4, 'i(?b,*r,c', 1), + (code4, 'i(?*', 0), + (code4, 'i(?**', (0, 1)), +] + + +@pytest.mark.parametrize('ending', ['', ')']) +@pytest.mark.parametrize('code, call, expected_index', _calls) +def test_signature_index(skip_python2, Script, environment, code, call, expected_index, ending): + if isinstance(expected_index, tuple): + expected_index = expected_index[environment.version_info > (3, 8)] + if environment.version_info < (3, 8): + code = code.replace('/,', '') + + sig, = Script(code + '\n' + call + ending, column=len(call)).call_signatures() + index = sig.index + assert expected_index == index + + +@pytest.mark.skipif(sys.version_info[0] == 2, reason="Python 2 doesn't support __signature__") +@pytest.mark.parametrize('code', ['foo', 'instance.foo']) +def test_arg_defaults(Script, environment, code): + def foo(arg="bla", arg1=1): + pass + + class Klass: + def foo(self, arg="bla", arg1=1): + pass + + instance = Klass() + + src = dedent(""" + def foo2(arg="bla", arg1=1): + pass + + class Klass2: + def foo2(self, arg="bla", arg1=1): + pass + + instance = Klass2() + """) + + executed_locals = dict() + exec(src, None, executed_locals) + locals_ = locals() + + def iter_scripts(): + yield Interpreter(code + '(', namespaces=[locals_]) + yield Script(src + code + "2(") + yield Interpreter(code + '2(', namespaces=[executed_locals]) + + for script in iter_scripts(): + signatures = script.call_signatures() + assert signatures[0].params[0].description in ('param arg="bla"', "param arg='bla'") + assert signatures[0].params[1].description == 'param arg1=1' + + +def test_bracket_start(Script): + def bracket_start(src): + signatures = Script(src).call_signatures() + assert len(signatures) == 1 + return signatures[0].bracket_start + + assert bracket_start('abs(') == (1, 3) + + +def test_different_caller(Script): + """ + It's possible to not use names, but another function result or an array + index and then get the call signature of it. + """ + + assert_signature(Script, '[abs][0](', 'abs', 0) + assert_signature(Script, '[abs][0]()', 'abs', 0, column=len('[abs][0](')) + + assert_signature(Script, '(abs)(', 'abs', 0) + assert_signature(Script, '(abs)()', 'abs', 0, column=len('(abs)(')) + + +def test_in_function(Script): + code = dedent('''\ + class X(): + @property + def func(''') + assert not Script(code).call_signatures() + + +def test_lambda_params(Script): + code = dedent('''\ + my_lambda = lambda x: x+1 + my_lambda(1)''') + sig, = Script(code, column=11).call_signatures() + assert sig.index == 0 + assert sig.name == '' + assert [p.name for p in sig.params] == ['x'] + + +CLASS_CODE = dedent('''\ +class X(): + def __init__(self, foo, bar): + self.foo = foo +''') + + +def test_class_creation(Script): + + sig, = Script(CLASS_CODE + 'X(').call_signatures() + assert sig.index == 0 + assert sig.name == 'X' + assert [p.name for p in sig.params] == ['foo', 'bar'] + + +def test_call_init_on_class(Script): + sig, = Script(CLASS_CODE + 'X.__init__(').call_signatures() + assert [p.name for p in sig.params] == ['self', 'foo', 'bar'] + + +def test_call_init_on_instance(Script): + sig, = Script(CLASS_CODE + 'X().__init__(').call_signatures() + assert [p.name for p in sig.params] == ['foo', 'bar'] + + +def test_call_magic_method(Script): + code = dedent('''\ + class X(): + def __call__(self, baz): + pass + ''') + sig, = Script(code + 'X()(').call_signatures() + assert sig.index == 0 + assert sig.name == 'X' + assert [p.name for p in sig.params] == ['baz'] + + sig, = Script(code + 'X.__call__(').call_signatures() + assert [p.name for p in sig.params] == ['self', 'baz'] + sig, = Script(code + 'X().__call__(').call_signatures() + assert [p.name for p in sig.params] == ['baz'] diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_api/test_classes.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_api/test_classes.py new file mode 100644 index 0000000..d744971 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_api/test_classes.py @@ -0,0 +1,461 @@ +""" Test all things related to the ``jedi.api_classes`` module. +""" + +from textwrap import dedent +from inspect import cleandoc + +import pytest + +import jedi +from jedi import __doc__ as jedi_doc +from jedi.evaluate.compiled import CompiledContextName + + +def test_is_keyword(Script): + results = Script('str', 1, 1, None).goto_definitions() + assert len(results) == 1 and results[0].is_keyword is False + + +def test_basedefinition_type(Script, names): + def make_definitions(): + """ + Return a list of definitions for parametrized tests. + + :rtype: [jedi.api_classes.BaseDefinition] + """ + source = dedent(""" + import sys + + class C: + pass + + x = C() + + def f(): + pass + + def g(): + yield + + h = lambda: None + """) + + definitions = [] + definitions += names(source) + + source += dedent(""" + variable = sys or C or x or f or g or g() or h""") + lines = source.splitlines() + script = Script(source, len(lines), len('variable'), None) + definitions += script.goto_definitions() + + script2 = Script(source, 4, len('class C'), None) + definitions += script2.usages() + + source_param = "def f(a): return a" + script_param = Script(source_param, 1, len(source_param), None) + definitions += script_param.goto_assignments() + + return definitions + + for definition in make_definitions(): + assert definition.type in ('module', 'class', 'instance', 'function', + 'generator', 'statement', 'import', 'param') + + +@pytest.mark.parametrize( + ('src', 'expected_result', 'column'), [ + # import one level + ('import t', 'module', None), + ('import ', 'module', None), + ('import datetime; datetime', 'module', None), + + # from + ('from datetime import timedelta', 'class', None), + ('from datetime import timedelta; timedelta', 'class', None), + ('from json import tool', 'module', None), + ('from json import tool; tool', 'module', None), + + # import two levels + ('import json.tool; json', 'module', None), + ('import json.tool; json.tool', 'module', None), + ('import json.tool; json.tool.main', 'function', None), + ('import json.tool', 'module', None), + ('import json.tool', 'module', 9), + ] + +) +def test_basedefinition_type_import(Script, src, expected_result, column): + types = {t.type for t in Script(src, column=column).completions()} + assert types == {expected_result} + + +def test_function_call_signature_in_doc(Script): + defs = Script(""" + def f(x, y=1, z='a'): + pass + f""").goto_definitions() + doc = defs[0].docstring() + assert "f(x, y=1, z='a')" in str(doc) + + +def test_param_docstring(names): + param = names("def test(parameter): pass", all_scopes=True)[1] + assert param.name == 'parameter' + assert param.docstring() == '' + + +def test_class_call_signature(Script): + defs = Script(""" + class Foo: + def __init__(self, x, y=1, z='a'): + pass + Foo""").goto_definitions() + doc = defs[0].docstring() + assert doc == "Foo(x, y=1, z='a')" + + +def test_position_none_if_builtin(Script): + gotos = Script('import sys; sys.path').goto_assignments() + assert gotos[0].in_builtin_module() + assert gotos[0].line is not None + assert gotos[0].column is not None + + +def test_completion_docstring(Script, jedi_path): + """ + Jedi should follow imports in certain conditions + """ + def docstr(src, result): + c = Script(src, sys_path=[jedi_path]).completions()[0] + assert c.docstring(raw=True, fast=False) == cleandoc(result) + + c = Script('import jedi\njed', sys_path=[jedi_path]).completions()[0] + assert c.docstring(fast=False) == cleandoc(jedi_doc) + + docstr('import jedi\njedi.Scr', cleandoc(jedi.Script.__doc__)) + + docstr('abcd=3;abcd', '') + docstr('"hello"\nabcd=3\nabcd', '') + docstr( + dedent(''' + def x(): + "hello" + 0 + x'''), + 'hello' + ) + docstr( + dedent(''' + def x(): + "hello";0 + x'''), + 'hello' + ) + # Shouldn't work with a tuple. + docstr( + dedent(''' + def x(): + "hello",0 + x'''), + '' + ) + # Should also not work if we rename something. + docstr( + dedent(''' + def x(): + "hello" + y = x + y'''), + '' + ) + + +def test_completion_params(Script): + c = Script('import string; string.capwords').completions()[0] + assert [p.name for p in c.params] == ['s', 'sep'] + + +def test_functions_should_have_params(Script): + for c in Script('bool.').completions(): + if c.type == 'function': + assert isinstance(c.params, list) + + +def test_hashlib_params(Script, environment): + if environment.version_info < (3,): + pytest.skip() + + script = Script(source='from hashlib import sha256') + c, = script.completions() + assert [p.name for p in c.params] == ['arg'] + + +def test_signature_params(Script): + def check(defs): + params = defs[0].params + assert len(params) == 1 + assert params[0].name == 'bar' + + s = dedent(''' + def foo(bar): + pass + foo''') + + check(Script(s).goto_definitions()) + + check(Script(s).goto_assignments()) + check(Script(s + '\nbar=foo\nbar').goto_assignments()) + + +def test_param_endings(Script): + """ + Params should be represented without the comma and whitespace they have + around them. + """ + sig = Script('def x(a, b=5, c=""): pass\n x(').call_signatures()[0] + assert [p.description for p in sig.params] == ['param a', 'param b=5', 'param c=""'] + + +@pytest.mark.parametrize( + 'code, index, name, is_definition', [ + ('name', 0, 'name', False), + ('a = f(x)', 0, 'a', True), + ('a = f(x)', 1, 'f', False), + ('a = f(x)', 2, 'x', False), + ] +) +def test_is_definition(names, code, index, name, is_definition): + d = names( + dedent(code), + references=True, + all_scopes=True, + )[index] + assert d.name == name + assert d.is_definition() == is_definition + + +@pytest.mark.parametrize( + 'code, expected', ( + ('import x as a', [False, True]), + ('from x import y', [False, True]), + ('from x.z import y', [False, False, True]), + ) +) +def test_is_definition_import(names, code, expected): + ns = names(dedent(code), references=True, all_scopes=True) + # Assure that names are definitely sorted. + ns = sorted(ns, key=lambda name: (name.line, name.column)) + assert [name.is_definition() for name in ns] == expected + + +def test_parent(Script): + def _parent(source, line=None, column=None): + def_, = Script(dedent(source), line, column).goto_assignments() + return def_.parent() + + parent = _parent('foo=1\nfoo') + assert parent.type == 'module' + + parent = _parent(''' + def spam(): + if 1: + y=1 + y''') + assert parent.name == 'spam' + assert parent.parent().type == 'module' + + +def test_parent_on_function(Script): + code = 'def spam():\n pass' + def_, = Script(code, line=1, column=len('def spam')).goto_assignments() + parent = def_.parent() + assert parent.name == '' + assert parent.type == 'module' + + +def test_parent_on_completion(Script): + parent = Script(dedent('''\ + class Foo(): + def bar(): pass + Foo().bar''')).completions()[0].parent() + assert parent.name == 'Foo' + assert parent.type == 'class' + + parent = Script('str.join').completions()[0].parent() + assert parent.name == 'str' + assert parent.type == 'class' + + +def test_type(Script): + for c in Script('a = [str()]; a[0].').completions(): + if c.name == '__class__' and False: # TODO fix. + assert c.type == 'class' + else: + assert c.type in ('function', 'statement') + + for c in Script('list.').completions(): + assert c.type + + # Github issue #397, type should never raise an error. + for c in Script('import os; os.path.').completions(): + assert c.type + + +def test_type_II(Script): + """ + GitHub Issue #833, `keyword`s are seen as `module`s + """ + for c in Script('f').completions(): + if c.name == 'for': + assert c.type == 'keyword' + + +""" +This tests the BaseDefinition.goto_assignments function, not the jedi +function. They are not really different in functionality, but really +different as an implementation. +""" + + +def test_goto_assignment_repetition(names): + defs = names('a = 1; a', references=True, definitions=False) + # Repeat on the same variable. Shouldn't change once we're on a + # definition. + for _ in range(3): + assert len(defs) == 1 + ass = defs[0].goto_assignments() + assert ass[0].description == 'a = 1' + + +def test_goto_assignments_named_params(names): + src = """\ + def foo(a=1, bar=2): + pass + foo(bar=1) + """ + bar = names(dedent(src), references=True)[-1] + param = bar.goto_assignments()[0] + assert (param.line, param.column) == (1, 13) + assert param.type == 'param' + + +def test_class_call(names): + src = 'from threading import Thread; Thread(group=1)' + n = names(src, references=True)[-1] + assert n.name == 'group' + param_def = n.goto_assignments()[0] + assert param_def.name == 'group' + assert param_def.type == 'param' + + +def test_parentheses(names): + n = names('("").upper', references=True)[-1] + assert n.goto_assignments()[0].name == 'upper' + + +def test_import(names): + nms = names('from json import load', references=True) + assert nms[0].name == 'json' + assert nms[0].type == 'module' + n = nms[0].goto_assignments()[0] + assert n.name == 'json' + assert n.type == 'module' + + assert nms[1].name == 'load' + assert nms[1].type == 'function' + n = nms[1].goto_assignments()[0] + assert n.name == 'load' + assert n.type == 'function' + + nms = names('import os; os.path', references=True) + assert nms[0].name == 'os' + assert nms[0].type == 'module' + n = nms[0].goto_assignments()[0] + assert n.name == 'os' + assert n.type == 'module' + + n = nms[2].goto_assignments()[0] + assert n.name == 'path' + assert n.type == 'module' + + nms = names('import os.path', references=True) + n = nms[0].goto_assignments()[0] + assert n.name == 'os' + assert n.type == 'module' + n = nms[1].goto_assignments()[0] + # This is very special, normally the name doesn't chance, but since + # os.path is a sys.modules hack, it does. + assert n.name in ('ntpath', 'posixpath', 'os2emxpath') + assert n.type == 'module' + + +def test_import_alias(names): + nms = names('import json as foo', references=True) + assert nms[0].name == 'json' + assert nms[0].type == 'module' + assert nms[0]._name.tree_name.parent.type == 'dotted_as_name' + n = nms[0].goto_assignments()[0] + assert n.name == 'json' + assert n.type == 'module' + assert n._name._context.tree_node.type == 'file_input' + + assert nms[1].name == 'foo' + assert nms[1].type == 'module' + assert nms[1]._name.tree_name.parent.type == 'dotted_as_name' + ass = nms[1].goto_assignments() + assert len(ass) == 1 + assert ass[0].name == 'json' + assert ass[0].type == 'module' + assert ass[0]._name._context.tree_node.type == 'file_input' + + +def test_added_equals_to_params(Script): + def run(rest_source): + source = dedent(""" + def foo(bar, baz): + pass + """) + results = Script(source + rest_source).completions() + assert len(results) == 1 + return results[0] + + assert run('foo(bar').name_with_symbols == 'bar=' + assert run('foo(bar').complete == '=' + assert run('foo(bar, baz').complete == '=' + assert run(' bar').name_with_symbols == 'bar' + assert run(' bar').complete == '' + x = run('foo(bar=isins').name_with_symbols + assert x == 'isinstance' + + +def test_builtin_module_with_path(Script): + """ + This test simply tests if a module from /usr/lib/python3.8/lib-dynload/ has + a path or not. It shouldn't have a module_path, because that is just + confusing. + """ + semlock, = Script('from _multiprocessing import SemLock').goto_definitions() + assert isinstance(semlock._name, CompiledContextName) + assert semlock.module_path is None + assert semlock.in_builtin_module() is True + assert semlock.name == 'SemLock' + assert semlock.line is None + assert semlock.column is None + + +@pytest.mark.parametrize( + 'code, description', [ + ('int', 'instance int'), + ('str.index', 'instance int'), + ('1', None), + ] +) +def test_execute(Script, code, description): + definition, = Script(code).goto_assignments() + definitions = definition.execute() + if description is None: + assert not definitions + else: + d, = definitions + assert d.description == description diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_api/test_completion.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_api/test_completion.py new file mode 100644 index 0000000..178daee --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_api/test_completion.py @@ -0,0 +1,267 @@ +from os.path import join, sep as s +import sys +from textwrap import dedent + +import pytest +from ..helpers import root_dir + + +def test_in_whitespace(Script): + code = dedent(''' + def x(): + pass''') + assert len(Script(code, column=2).completions()) > 20 + + +def test_empty_init(Script): + """This was actually an issue.""" + code = dedent('''\ + class X(object): pass + X(''') + assert Script(code).completions() + + +def test_in_empty_space(Script): + code = dedent('''\ + class X(object): + def __init__(self): + hello + ''') + comps = Script(code, 3, 7).completions() + self, = [c for c in comps if c.name == 'self'] + assert self.name == 'self' + def_, = self.infer() + assert def_.name == 'X' + + +def test_indent_context(Script): + """ + If an INDENT is the next supposed token, we should still be able to + complete. + """ + code = 'if 1:\nisinstanc' + comp, = Script(code).completions() + assert comp.name == 'isinstance' + + +def test_keyword_context(Script): + def get_names(*args, **kwargs): + return [d.name for d in Script(*args, **kwargs).completions()] + + names = get_names('if 1:\n pass\n') + assert 'if' in names + assert 'elif' in names + + +def test_os_nowait(Script): + """ github issue #45 """ + s = Script("import os; os.P_").completions() + assert 'P_NOWAIT' in [i.name for i in s] + + +def test_points_in_completion(Script): + """At some point, points were inserted into the completions, this + caused problems, sometimes. + """ + c = Script("if IndentationErr").completions() + assert c[0].name == 'IndentationError' + assert c[0].complete == 'or' + + +def test_loading_unicode_files_with_bad_global_charset(Script, monkeypatch, tmpdir): + dirname = str(tmpdir.mkdir('jedi-test')) + filename1 = join(dirname, 'test1.py') + filename2 = join(dirname, 'test2.py') + if sys.version_info < (3, 0): + data = "# coding: latin-1\nfoo = 'm\xf6p'\n" + else: + data = "# coding: latin-1\nfoo = 'm\xf6p'\n".encode("latin-1") + + with open(filename1, "wb") as f: + f.write(data) + s = Script("from test1 import foo\nfoo.", + line=2, column=4, path=filename2) + s.completions() + + +def test_fake_subnodes(Script): + """ + Test the number of subnodes of a fake object. + + There was a bug where the number of child nodes would grow on every + call to :func:``jedi.evaluate.compiled.fake.get_faked``. + + See Github PR#649 and isseu #591. + """ + def get_str_completion(values): + for c in values: + if c.name == 'str': + return c + limit = None + for i in range(2): + completions = Script('').completions() + c = get_str_completion(completions) + str_context, = c._name.infer() + n = len(str_context.tree_node.children[-1].children) + if i == 0: + limit = n + else: + assert n == limit + + +def test_generator(Script): + # Did have some problems with the usage of generator completions this + # way. + s = "def abc():\n" \ + " yield 1\n" \ + "abc()." + assert Script(s).completions() + + +def test_in_comment(Script): + assert Script(" # Comment").completions() + # TODO this is a bit ugly, that the behaviors in comments are different. + assert not Script("max_attr_value = int(2) # Cast to int for spe").completions() + + +def test_async(Script, environment): + if environment.version_info < (3, 5): + pytest.skip() + + code = dedent(''' + foo = 3 + async def x(): + hey = 3 + ho''' + ) + comps = Script(code, column=4).completions() + names = [c.name for c in comps] + assert 'foo' in names + assert 'hey' in names + + +def test_with_stmt_error_recovery(Script): + assert Script('with open('') as foo: foo.\na', line=1).completions() + + +@pytest.mark.parametrize( + 'code, has_keywords', ( + ('', True), + ('x;', True), + ('1', False), + ('1 ', True), + ('1\t', True), + ('1\n', True), + ('1\\\n', True), + ) +) +def test_keyword_completion(Script, code, has_keywords): + assert has_keywords == any(x.is_keyword for x in Script(code).completions()) + + +f1 = join(root_dir, 'example.py') +f2 = join(root_dir, 'test', 'example.py') +os_path = 'from os.path import *\n' +# os.path.sep escaped +se = s * 2 if s == '\\' else s + + +@pytest.mark.parametrize( + 'file, code, column, expected', [ + # General tests / relative paths + (None, '"comp', None, ['ile', 'lex']), # No files like comp + (None, '"test', None, [s]), + (None, '"test', 4, ['t' + s]), + ('example.py', '"test%scomp' % s, None, ['letion' + s]), + ('example.py', 'r"comp"', None, "A LOT"), + ('example.py', 'r"tes"', None, "A LOT"), + ('example.py', 'r"tes"', 5, ['t' + s]), + ('example.py', 'r" tes"', 6, []), + ('test%sexample.py' % se, 'r"tes"', 5, ['t' + s]), + ('test%sexample.py' % se, 'r"test%scomp"' % s, 5, ['t' + s]), + ('test%sexample.py' % se, 'r"test%scomp"' % s, 11, ['letion' + s]), + ('test%sexample.py' % se, '"%s"' % join('test', 'completion', 'basi'), 21, ['c.py']), + ('example.py', 'rb"' + join('..', 'jedi', 'tes'), None, ['t' + s]), + + # Absolute paths + (None, '"' + join(root_dir, 'test', 'test_ca'), None, ['che.py"']), + (None, '"%s"' % join(root_dir, 'test', 'test_ca'), len(root_dir) + 14, ['che.py']), + + # Longer quotes + ('example.py', 'r"""test', None, [s]), + ('example.py', 'r"""\ntest', None, []), + ('example.py', 'u"""tes\n', (1, 7), ['t' + s]), + ('example.py', '"""test%stest_cache.p"""' % s, 20, ['y']), + ('example.py', '"""test%stest_cache.p"""' % s, 19, ['py"""']), + + # Adding + ('example.py', '"test" + "%stest_cac' % se, None, ['he.py"']), + ('example.py', '"test" + "%s" + "test_cac' % se, None, ['he.py"']), + ('example.py', 'x = 1 + "test', None, []), + ('example.py', 'x = f("te" + "st)', 16, [s]), + ('example.py', 'x = f("te" + "st', 16, [s]), + ('example.py', 'x = f("te" + "st"', 16, [s]), + ('example.py', 'x = f("te" + "st")', 16, [s]), + ('example.py', 'x = f("t" + "est")', 16, [s]), + # This is actually not correct, but for now leave it here, because of + # Python 2. + ('example.py', 'x = f(b"t" + "est")', 17, [s]), + ('example.py', '"test" + "', None, [s]), + + # __file__ + (f1, os_path + 'dirname(__file__) + "%stest' % s, None, [s]), + (f2, os_path + 'dirname(__file__) + "%stest_ca' % se, None, ['che.py"']), + (f2, os_path + 'dirname(abspath(__file__)) + sep + "test_ca', None, ['che.py"']), + (f2, os_path + 'join(dirname(__file__), "completion") + sep + "basi', None, ['c.py"']), + (f2, os_path + 'join("test", "completion") + sep + "basi', None, ['c.py"']), + + # inside join + (f2, os_path + 'join(dirname(__file__), "completion", "basi', None, ['c.py"']), + (f2, os_path + 'join(dirname(__file__), "completion", "basi)', 43, ['c.py"']), + (f2, os_path + 'join(dirname(__file__), "completion", "basi")', 43, ['c.py']), + (f2, os_path + 'join(dirname(__file__), "completion", "basi)', 35, ['']), + (f2, os_path + 'join(dirname(__file__), "completion", "basi)', 33, ['on"']), + (f2, os_path + 'join(dirname(__file__), "completion", "basi")', 33, ['on"']), + + # join with one argument. join will not get evaluated and the result is + # that directories and in a slash. This is unfortunate, but doesn't + # really matter. + (f2, os_path + 'join("tes', 9, ['t"']), + (f2, os_path + 'join(\'tes)', 9, ["t'"]), + (f2, os_path + 'join(r"tes"', 10, ['t']), + (f2, os_path + 'join("""tes""")', 11, ['t']), + + # Almost like join but not really + (f2, os_path + 'join["tes', 9, ['t' + s]), + (f2, os_path + 'join["tes"', 9, ['t' + s]), + (f2, os_path + 'join["tes"]', 9, ['t' + s]), + (f2, os_path + 'join[dirname(__file__), "completi', 33, []), + (f2, os_path + 'join[dirname(__file__), "completi"', 33, []), + (f2, os_path + 'join[dirname(__file__), "completi"]', 33, []), + + # With full paths + (f2, 'import os\nos.path.join(os.path.dirname(__file__), "completi', 49, ['on"']), + (f2, 'import os\nos.path.join(os.path.dirname(__file__), "completi"', 49, ['on']), + (f2, 'import os\nos.path.join(os.path.dirname(__file__), "completi")', 49, ['on']), + + # With alias + (f2, 'import os.path as p as p\np.join(p.dirname(__file__), "completi', None, ['on"']), + (f2, 'from os.path import dirname, join as j\nj(dirname(__file__), "completi', + None, ['on"']), + + # Trying to break it + (f2, os_path + 'join(["tes', 10, ['t' + s]), + (f2, os_path + 'join(["tes"]', 10, ['t' + s]), + (f2, os_path + 'join(["tes"])', 10, ['t' + s]), + (f2, os_path + 'join("test", "test_cac" + x,', 22, ['he.py']), + ] +) +def test_file_path_completions(Script, file, code, column, expected): + line = None + if isinstance(column, tuple): + line, column = column + comps = Script(code, path=file, line=line, column=column).completions() + if expected == "A LOT": + assert len(comps) > 100 # This is basically global completions. + else: + assert [c.complete for c in comps] == expected diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_api/test_defined_names.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_api/test_defined_names.py new file mode 100644 index 0000000..259e360 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_api/test_defined_names.py @@ -0,0 +1,169 @@ +""" +Tests for `api.names`. +""" + +from textwrap import dedent + + +def _assert_definition_names(definitions, names_): + assert [d.name for d in definitions] == names_ + + +def _check_names(names, source, names_): + definitions = names(dedent(source)) + _assert_definition_names(definitions, names_) + return definitions + + +def test_get_definitions_flat(names): + _check_names(names, """ + import module + class Class: + pass + def func(): + pass + data = None + """, ['module', 'Class', 'func', 'data']) + + +def test_dotted_assignment(names): + _check_names(names, """ + x = Class() + x.y.z = None + """, ['x', 'z']) # TODO is this behavior what we want? + + +def test_multiple_assignment(names): + _check_names(names, "x = y = None", ['x', 'y']) + + +def test_multiple_imports(names): + _check_names(names, """ + from module import a, b + from another_module import * + """, ['a', 'b']) + + +def test_nested_definitions(names): + definitions = _check_names(names, """ + class Class: + def f(): + pass + def g(): + pass + """, ['Class']) + subdefinitions = definitions[0].defined_names() + _assert_definition_names(subdefinitions, ['f', 'g']) + assert [d.full_name for d in subdefinitions] == ['__main__.Class.f', '__main__.Class.g'] + + +def test_nested_class(names): + definitions = _check_names(names, """ + class L1: + class L2: + class L3: + def f(): pass + def f(): pass + def f(): pass + def f(): pass + """, ['L1', 'f']) + subdefs = definitions[0].defined_names() + subsubdefs = subdefs[0].defined_names() + _assert_definition_names(subdefs, ['L2', 'f']) + _assert_definition_names(subsubdefs, ['L3', 'f']) + _assert_definition_names(subsubdefs[0].defined_names(), ['f']) + + +def test_class_fields_with_all_scopes_false(names): + definitions = _check_names(names, """ + from module import f + g = f(f) + class C: + h = g + + def foo(x=a): + bar = x + return bar + """, ['f', 'g', 'C', 'foo']) + C_subdefs = definitions[-2].defined_names() + foo_subdefs = definitions[-1].defined_names() + _assert_definition_names(C_subdefs, ['h']) + _assert_definition_names(foo_subdefs, ['x', 'bar']) + + +def test_async_stmt_with_all_scopes_false(names): + definitions = _check_names(names, """ + from module import f + import asyncio + + g = f(f) + class C: + h = g + def __init__(self): + pass + + async def __aenter__(self): + pass + + def foo(x=a): + bar = x + return bar + + async def async_foo(duration): + async def wait(): + await asyncio.sleep(100) + for i in range(duration//100): + await wait() + return duration//100*100 + + async with C() as cinst: + d = cinst + """, ['f', 'asyncio', 'g', 'C', 'foo', 'async_foo', 'cinst', 'd']) + C_subdefs = definitions[3].defined_names() + foo_subdefs = definitions[4].defined_names() + async_foo_subdefs = definitions[5].defined_names() + cinst_subdefs = definitions[6].defined_names() + _assert_definition_names(C_subdefs, ['h', '__init__', '__aenter__']) + _assert_definition_names(foo_subdefs, ['x', 'bar']) + _assert_definition_names(async_foo_subdefs, ['duration', 'wait', 'i']) + # We treat d as a name outside `async with` block + _assert_definition_names(cinst_subdefs, []) + + +def test_follow_imports(names): + # github issue #344 + imp = names('import datetime')[0] + assert imp.name == 'datetime' + datetime_names = [str(d.name) for d in imp.defined_names()] + assert 'timedelta' in datetime_names + + +def test_names_twice(names): + source = dedent(''' + def lol(): + pass + ''') + + defs = names(source=source) + assert defs[0].defined_names() == [] + + +def test_simple_name(names): + defs = names('foo', references=True) + assert not defs[0]._name.infer() + + +def test_no_error(names): + code = dedent(""" + def foo(a, b): + if a == 10: + if b is None: + print("foo") + a = 20 + """) + func_name, = names(code) + a, b, a20 = func_name.defined_names() + assert a.name == 'a' + assert b.name == 'b' + assert a20.name == 'a' + assert a20.goto_assignments() == [a20] diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_api/test_environment.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_api/test_environment.py new file mode 100644 index 0000000..2d774a8 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_api/test_environment.py @@ -0,0 +1,155 @@ +import os +import sys + +import pytest + +import jedi +from jedi._compatibility import py_version +from jedi.api.environment import get_default_environment, find_virtualenvs, \ + InvalidPythonEnvironment, find_system_environments, \ + get_system_environment, create_environment, InterpreterEnvironment, \ + get_cached_default_environment + + +def test_sys_path(): + assert get_default_environment().get_sys_path() + + +def test_find_system_environments(): + envs = list(find_system_environments()) + assert len(envs) + for env in envs: + assert env.version_info + assert env.get_sys_path() + parser_version = env.get_grammar().version_info + assert parser_version[:2] == env.version_info[:2] + + +@pytest.mark.parametrize( + 'version', + ['2.7', '3.3', '3.4', '3.5', '3.6', '3.7'] +) +def test_versions(version): + try: + env = get_system_environment(version) + except InvalidPythonEnvironment: + if int(version.replace('.', '')) == py_version: + # At least the current version has to work + raise + pytest.skip() + + assert version == str(env.version_info[0]) + '.' + str(env.version_info[1]) + assert env.get_sys_path() + + +def test_load_module(evaluator): + access_path = evaluator.compiled_subprocess.load_module( + dotted_name=u'math', + sys_path=evaluator.get_sys_path() + ) + name, access_handle = access_path.accesses[0] + + assert access_handle.py__bool__() is True + assert access_handle.get_api_type() == 'module' + with pytest.raises(AttributeError): + access_handle.py__mro__() + + +def test_error_in_environment(evaluator, Script, environment): + if isinstance(environment, InterpreterEnvironment): + pytest.skip("We don't catch these errors at the moment.") + + # Provoke an error to show how Jedi can recover from it. + with pytest.raises(jedi.InternalError): + evaluator.compiled_subprocess._test_raise_error(KeyboardInterrupt) + # The second time it should raise an InternalError again. + with pytest.raises(jedi.InternalError): + evaluator.compiled_subprocess._test_raise_error(KeyboardInterrupt) + # Jedi should still work. + def_, = Script('str').goto_definitions() + assert def_.name == 'str' + + +def test_stdout_in_subprocess(evaluator, Script): + evaluator.compiled_subprocess._test_print(stdout='.') + Script('1').goto_definitions() + + +def test_killed_subprocess(evaluator, Script, environment): + if isinstance(environment, InterpreterEnvironment): + pytest.skip("We cannot kill our own process") + # Just kill the subprocess. + evaluator.compiled_subprocess._compiled_subprocess._get_process().kill() + # Since the process was terminated (and nobody knows about it) the first + # Jedi call fails. + with pytest.raises(jedi.InternalError): + Script('str').goto_definitions() + + def_, = Script('str').goto_definitions() + # Jedi should now work again. + assert def_.name == 'str' + + +def test_not_existing_virtualenv(monkeypatch): + """Should not match the path that was given""" + path = '/foo/bar/jedi_baz' + monkeypatch.setenv('VIRTUAL_ENV', path) + assert get_default_environment().executable != path + + +def test_working_venv(venv_path, monkeypatch): + monkeypatch.setenv('VIRTUAL_ENV', venv_path) + assert get_default_environment().path == venv_path + + +def test_scanning_venvs(venv_path): + parent_dir = os.path.dirname(venv_path) + assert any(venv.path == venv_path + for venv in find_virtualenvs([parent_dir])) + + +def test_create_environment_venv_path(venv_path): + environment = create_environment(venv_path) + assert environment.path == venv_path + + +def test_create_environment_executable(): + environment = create_environment(sys.executable) + assert environment.executable == sys.executable + + +def test_get_default_environment_from_env_does_not_use_safe(tmpdir, monkeypatch): + fake_python = os.path.join(str(tmpdir), 'fake_python') + with open(fake_python, 'w') as f: + f.write('') + + def _get_subprocess(self): + if self._start_executable != fake_python: + raise RuntimeError('Should not get called!') + self.executable = fake_python + self.path = 'fake' + + monkeypatch.setattr('jedi.api.environment.Environment._get_subprocess', + _get_subprocess) + + monkeypatch.setenv('VIRTUAL_ENV', fake_python) + env = get_default_environment() + assert env.path == 'fake' + + +@pytest.mark.parametrize('virtualenv', ['', 'fufuuuuu', sys.prefix]) +def test_get_default_environment_when_embedded(monkeypatch, virtualenv): + # When using Python embedded, sometimes the executable is not a Python + # executable. + executable_name = 'RANDOM_EXE' + monkeypatch.setattr(sys, 'executable', executable_name) + monkeypatch.setenv('VIRTUAL_ENV', virtualenv) + env = get_default_environment() + assert env.executable != executable_name + + +def test_changing_venv(venv_path, monkeypatch): + monkeypatch.setitem(os.environ, 'VIRTUAL_ENV', venv_path) + get_cached_default_environment() + monkeypatch.setitem(os.environ, 'VIRTUAL_ENV', sys.executable) + assert get_cached_default_environment().executable == sys.executable diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_api/test_full_name.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_api/test_full_name.py new file mode 100644 index 0000000..829c124 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_api/test_full_name.py @@ -0,0 +1,114 @@ +""" +Tests for :attr:`.BaseDefinition.full_name`. + +There are three kinds of test: + +#. Test classes derived from :class:`MixinTestFullName`. + Child class defines :attr:`.operation` to alter how + the api definition instance is created. + +#. :class:`TestFullDefinedName` is to test combination of + ``obj.full_name`` and ``jedi.defined_names``. + +#. Misc single-function tests. +""" + +import textwrap + +import pytest + +import jedi +from ..helpers import TestCase + + +class MixinTestFullName(object): + operation = None + + @pytest.fixture(autouse=True) + def init(self, Script, environment): + self.Script = Script + self.environment = environment + + def check(self, source, desired): + script = self.Script(textwrap.dedent(source)) + definitions = getattr(script, type(self).operation)() + for d in definitions: + self.assertEqual(d.full_name, desired) + + def test_os_path_join(self): + self.check('import os; os.path.join', 'os.path.join') + + def test_builtin(self): + self.check('TypeError', 'builtins.TypeError') + + +class TestFullNameWithGotoDefinitions(MixinTestFullName, TestCase): + operation = 'goto_definitions' + + def test_tuple_mapping(self): + if self.environment.version_info.major == 2: + pytest.skip('Python 2 also yields None.') + + self.check(""" + import re + any_re = re.compile('.*') + any_re""", 'typing.Pattern') + + def test_from_import(self): + self.check('from os import path', 'os.path') + + +class TestFullNameWithCompletions(MixinTestFullName, TestCase): + operation = 'completions' + + +class TestFullDefinedName(TestCase): + """ + Test combination of ``obj.full_name`` and ``jedi.defined_names``. + """ + @pytest.fixture(autouse=True) + def init(self, environment): + self.environment = environment + + def check(self, source, desired): + definitions = jedi.names(textwrap.dedent(source), environment=self.environment) + full_names = [d.full_name for d in definitions] + self.assertEqual(full_names, desired) + + def test_local_names(self): + self.check(""" + def f(): pass + class C: pass + """, ['__main__.f', '__main__.C']) + + def test_imports(self): + self.check(""" + import os + from os import path + from os.path import join + from os import path as opath + """, ['os', 'os.path', 'os.path.join', 'os.path']) + + +def test_sub_module(Script, jedi_path): + """ + ``full_name needs to check sys.path to actually find it's real path module + path. + """ + sys_path = [jedi_path] + defs = Script('from jedi.api import classes; classes', sys_path=sys_path).goto_definitions() + assert [d.full_name for d in defs] == ['jedi.api.classes'] + defs = Script('import jedi.api; jedi.api', sys_path=sys_path).goto_definitions() + assert [d.full_name for d in defs] == ['jedi.api'] + + +def test_os_path(Script): + d, = Script('from os.path import join').completions() + assert d.full_name == 'os.path.join' + d, = Script('import os.p').completions() + assert d.full_name == 'os.path' + + +def test_os_issues(Script): + """Issue #873""" + assert [c.name for c in Script('import os\nos.nt''').completions()] == ['nt'] diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_api/test_interpreter.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_api/test_interpreter.py new file mode 100644 index 0000000..e97f498 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_api/test_interpreter.py @@ -0,0 +1,507 @@ +""" +Tests of ``jedi.api.Interpreter``. +""" +import sys + +import pytest + +import jedi +from jedi._compatibility import is_py3, py_version +from jedi.evaluate.compiled import mixed, context +from importlib import import_module + +if py_version > 30: + def exec_(source, global_map): + exec(source, global_map) +else: + eval(compile("""def exec_(source, global_map): + exec source in global_map """, 'blub', 'exec')) + + +class _GlobalNameSpace: + class SideEffectContainer: + pass + + +def get_completion(source, namespace): + i = jedi.Interpreter(source, [namespace]) + completions = i.completions() + assert len(completions) == 1 + return completions[0] + + +def test_builtin_details(): + import keyword + + class EmptyClass: + pass + + variable = EmptyClass() + + def func(): + pass + + cls = get_completion('EmptyClass', locals()) + var = get_completion('variable', locals()) + f = get_completion('func', locals()) + m = get_completion('keyword', locals()) + assert cls.type == 'class' + assert var.type == 'instance' + assert f.type == 'function' + assert m.type == 'module' + + +def test_numpy_like_non_zero(): + """ + Numpy-like array can't be caster to bool and need to be compacre with + `is`/`is not` and not `==`/`!=` + """ + + class NumpyNonZero: + + def __zero__(self): + raise ValueError('Numpy arrays would raise and tell you to use .any() or all()') + def __bool__(self): + raise ValueError('Numpy arrays would raise and tell you to use .any() or all()') + + class NumpyLike: + + def __eq__(self, other): + return NumpyNonZero() + + def something(self): + pass + + x = NumpyLike() + d = {'a': x} + + # just assert these do not raise. They (strangely) trigger different + # codepath + get_completion('d["a"].some', {'d':d}) + get_completion('x.some', {'x':x}) + + +def test_nested_resolve(): + class XX: + def x(): + pass + + cls = get_completion('XX', locals()) + func = get_completion('XX.x', locals()) + assert (func.line, func.column) == (cls.line + 1, 12) + + +def test_side_effect_completion(): + """ + In the repl it's possible to cause side effects that are not documented in + Python code, however we want references to Python code as well. Therefore + we need some mixed kind of magic for tests. + """ + _GlobalNameSpace.SideEffectContainer.foo = 1 + side_effect = get_completion('SideEffectContainer', _GlobalNameSpace.__dict__) + + # It's a class that contains MixedObject. + context, = side_effect._name.infer() + assert isinstance(context, mixed.MixedObject) + foo = get_completion('SideEffectContainer.foo', _GlobalNameSpace.__dict__) + assert foo.name == 'foo' + + +def _assert_interpreter_complete(source, namespace, completions, + **kwds): + script = jedi.Interpreter(source, [namespace], **kwds) + cs = script.completions() + actual = [c.name for c in cs] + assert sorted(actual) == sorted(completions) + + +def test_complete_raw_function(): + from os.path import join + _assert_interpreter_complete('join("").up', + locals(), + ['upper']) + + +def test_complete_raw_function_different_name(): + from os.path import join as pjoin + _assert_interpreter_complete('pjoin("").up', + locals(), + ['upper']) + + +def test_complete_raw_module(): + import os + _assert_interpreter_complete('os.path.join("a").up', + locals(), + ['upper']) + + +def test_complete_raw_instance(): + import datetime + dt = datetime.datetime(2013, 1, 1) + completions = ['time', 'timetz', 'timetuple'] + if is_py3: + completions += ['timestamp'] + _assert_interpreter_complete('(dt - dt).ti', + locals(), + completions) + + +def test_list(): + array = ['haha', 1] + _assert_interpreter_complete('array[0].uppe', + locals(), + ['upper']) + _assert_interpreter_complete('array[0].real', + locals(), + []) + + # something different, no index given, still just return the right + _assert_interpreter_complete('array[int].real', + locals(), + ['real']) + _assert_interpreter_complete('array[int()].real', + locals(), + ['real']) + # inexistent index + _assert_interpreter_complete('array[2].upper', + locals(), + ['upper']) + + +def test_getattr(): + class Foo1: + bar = [] + baz = 'bar' + _assert_interpreter_complete('getattr(Foo1, baz).app', locals(), ['append']) + + +def test_slice(): + class Foo1: + bar = [] + baz = 'xbarx' + _assert_interpreter_complete('getattr(Foo1, baz[1:-1]).append', + locals(), + ['append']) + + +def test_getitem_side_effects(): + class Foo2: + def __getitem__(self, index): + # Possible side effects here, should therefore not call this. + if True: + raise NotImplementedError() + return index + + foo = Foo2() + _assert_interpreter_complete('foo["asdf"].upper', locals(), ['upper']) + + +@pytest.fixture(params=[False, True]) +def allow_descriptor_access_or_not(request, monkeypatch): + monkeypatch.setattr(jedi.Interpreter, '_allow_descriptor_getattr_default', request.param) + return request.param + + +def test_property_error_oldstyle(allow_descriptor_access_or_not): + lst = [] + class Foo3: + @property + def bar(self): + lst.append(1) + raise ValueError + + foo = Foo3() + _assert_interpreter_complete('foo.bar', locals(), ['bar']) + _assert_interpreter_complete('foo.bar.baz', locals(), []) + + if allow_descriptor_access_or_not: + assert lst == [1, 1] + else: + # There should not be side effects + assert lst == [] + + +def test_property_error_newstyle(allow_descriptor_access_or_not): + lst = [] + class Foo3(object): + @property + def bar(self): + lst.append(1) + raise ValueError + + foo = Foo3() + _assert_interpreter_complete('foo.bar', locals(), ['bar']) + _assert_interpreter_complete('foo.bar.baz', locals(), []) + + if allow_descriptor_access_or_not: + assert lst == [1, 1] + else: + # There should not be side effects + assert lst == [] + + +def test_property_content(): + class Foo3(object): + @property + def bar(self): + return 1 + + foo = Foo3() + def_, = jedi.Interpreter('foo.bar', [locals()]).goto_definitions() + assert def_.name == 'int' + + +@pytest.mark.skipif(sys.version_info[0] == 2, reason="Ignore Python 2, because EOL") +def test_param_completion(): + def foo(bar): + pass + + lambd = lambda xyz: 3 + + _assert_interpreter_complete('foo(bar', locals(), ['bar']) + assert bool(jedi.Interpreter('lambd(xyz', [locals()]).completions()) == is_py3 + + +def test_endless_yield(): + lst = [1] * 10000 + # If iterating over lists it should not be possible to take an extremely + # long time. + _assert_interpreter_complete('list(lst)[9000].rea', locals(), ['real']) + + +@pytest.mark.skipif('py_version < 33', reason='inspect.signature was created in 3.3.') +def test_completion_params(): + foo = lambda a, b=3: None + + script = jedi.Interpreter('foo', [locals()]) + c, = script.completions() + assert [p.name for p in c.params] == ['a', 'b'] + assert c.params[0].infer() == [] + t, = c.params[1].infer() + assert t.name == 'int' + + +@pytest.mark.skipif('py_version < 33', reason='inspect.signature was created in 3.3.') +def test_completion_param_annotations(): + # Need to define this function not directly in Python. Otherwise Jedi is to + # clever and uses the Python code instead of the signature object. + code = 'def foo(a: 1, b: str, c: int = 1.0) -> bytes: pass' + exec_(code, locals()) + script = jedi.Interpreter('foo', [locals()]) + c, = script.completions() + a, b, c = c.params + assert a.infer() == [] + assert [d.name for d in b.infer()] == ['str'] + assert {d.name for d in c.infer()} == {'int', 'float'} + + d, = jedi.Interpreter('foo()', [locals()]).goto_definitions() + assert d.name == 'bytes' + + +@pytest.mark.skipif(sys.version_info[0] == 2, reason="Ignore Python 2, because EOL") +def test_keyword_argument(): + def f(some_keyword_argument): + pass + + c, = jedi.Interpreter("f(some_keyw", [{'f': f}]).completions() + assert c.name == 'some_keyword_argument' + assert c.complete == 'ord_argument=' + + # This needs inspect.signature to work. + if is_py3: + # Make it impossible for jedi to find the source of the function. + f.__name__ = 'xSOMETHING' + c, = jedi.Interpreter("x(some_keyw", [{'x': f}]).completions() + assert c.name == 'some_keyword_argument' + + +def test_more_complex_instances(): + class Something: + def foo(self, other): + return self + + class Base: + def wow(self): + return Something() + + #script = jedi.Interpreter('Base().wow().foo', [locals()]) + #c, = script.completions() + #assert c.name == 'foo' + + x = Base() + script = jedi.Interpreter('x.wow().foo', [locals()]) + c, = script.completions() + assert c.name == 'foo' + + +def test_repr_execution_issue(): + """ + Anticipate inspect.getfile executing a __repr__ of all kinds of objects. + See also #919. + """ + class ErrorRepr: + def __repr__(self): + raise Exception('xyz') + + er = ErrorRepr() + + script = jedi.Interpreter('er', [locals()]) + d, = script.goto_definitions() + assert d.name == 'ErrorRepr' + assert d.type == 'instance' + + +def test_dir_magic_method(): + class CompleteAttrs(object): + def __getattr__(self, name): + if name == 'foo': + return 1 + if name == 'bar': + return 2 + raise AttributeError(name) + + def __dir__(self): + if is_py3: + names = object.__dir__(self) + else: + names = dir(object()) + return ['foo', 'bar'] + names + + itp = jedi.Interpreter("ca.", [{'ca': CompleteAttrs()}]) + completions = itp.completions() + names = [c.name for c in completions] + assert ('__dir__' in names) == is_py3 + assert '__class__' in names + assert 'foo' in names + assert 'bar' in names + + foo = [c for c in completions if c.name == 'foo'][0] + assert foo.infer() == [] + + +def test_name_not_findable(): + class X(): + if 0: + NOT_FINDABLE + + def hidden(self): + return + + hidden.__name__ = 'NOT_FINDABLE' + + setattr(X, 'NOT_FINDABLE', X.hidden) + + assert jedi.Interpreter("X.NOT_FINDA", [locals()]).completions() + + +def test_stubs_working(): + from multiprocessing import cpu_count + defs = jedi.Interpreter("cpu_count()", [locals()]).goto_definitions() + assert [d.name for d in defs] == ['int'] + + +def test_sys_path_docstring(): # Was an issue in #1298 + import jedi + s = jedi.Interpreter("from sys import path\npath", line=2, column=4, namespaces=[locals()]) + s.completions()[0].docstring() + + +@pytest.mark.skipif(sys.version_info[0] == 2, reason="Ignore Python 2, because EOL") +@pytest.mark.parametrize( + 'code, completions', [ + ('x[0].uppe', ['upper']), + ('x[1337].uppe', ['upper']), + ('x[""].uppe', ['upper']), + ('x.appen', ['append']), + + ('y.add', ['add']), + ('y[0].', []), + ('list(y)[0].', []), # TODO use stubs properly to improve this. + + ('z[0].uppe', ['upper']), + ('z[0].append', ['append']), + ('z[1].uppe', ['upper']), + ('z[1].append', []), + + ('collections.deque().app', ['append', 'appendleft']), + ('deq.app', ['append', 'appendleft']), + ('deq.pop', ['pop', 'popleft']), + ('deq.pop().', []), + + ('collections.Counter("asdf").setdef', ['setdefault']), + ('collections.Counter("asdf").pop().imag', ['imag']), + ('list(collections.Counter("asdf").keys())[0].uppe', ['upper']), + ('counter.setdefa', ['setdefault']), + ('counter.pop().imag', []), # TODO stubs could make this better + ('counter.keys())[0].uppe', []), + + ('string.upper().uppe', ['upper']), + ('"".upper().uppe', ['upper']), + ] +) +def test_simple_completions(code, completions): + x = [str] + y = {1} + z = {1: str, 2: list} + import collections + deq = collections.deque([1]) + counter = collections.Counter(['asdf']) + string = '' + + defs = jedi.Interpreter(code, [locals()]).completions() + assert [d.name for d in defs] == completions + + +@pytest.mark.skipif(sys.version_info[0] == 2, reason="Python 2 doesn't have lru_cache") +def test__wrapped__(): + from functools import lru_cache + + @lru_cache(maxsize=128) + def syslogs_to_df(): + pass + + c, = jedi.Interpreter('syslogs_to_df', [locals()]).completions() + # Apparently the function starts on the line where the decorator starts. + assert c.line == syslogs_to_df.__wrapped__.__code__.co_firstlineno + 1 + + +@pytest.mark.parametrize('module_name', ['sys', 'time']) +def test_core_module_completes(module_name): + module = import_module(module_name) + assert jedi.Interpreter(module_name + '.\n', [locals()]).completions() + + +@pytest.mark.skipif(sys.version_info[0] == 2, reason="Ignore Python 2, because EOL") +@pytest.mark.parametrize( + 'code, expected, index', [ + ('a(', ['a', 'b', 'c'], 0), + ('b(', ['b', 'c'], 0), + # Might or might not be correct, because c is given as a keyword + # argument as well, but that is just what inspect.signature returns. + ('c(', ['b', 'c'], 0), + ] +) +def test_partial_signatures(code, expected, index): + import functools + + def func(a, b, c): + pass + + a = functools.partial(func) + b = functools.partial(func, 1) + c = functools.partial(func, 1, c=2) + + sig, = jedi.Interpreter(code, [locals()]).call_signatures() + assert sig.name == 'partial' + assert [p.name for p in sig.params] == expected + assert index == sig.index + + +@pytest.mark.skipif(sys.version_info[0] == 2, reason="Ignore Python 2, because EOL") +def test_type_var(): + """This was an issue before, see Github #1369""" + import typing + x = typing.TypeVar('myvar') + def_, = jedi.Interpreter('x', [locals()]).goto_definitions() + assert def_.name == 'TypeVar' diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_api/test_keyword.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_api/test_keyword.py new file mode 100644 index 0000000..219e3ff --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_api/test_keyword.py @@ -0,0 +1,60 @@ +""" +Test of keywords and ``jedi.keywords`` +""" + +import pytest + + +def test_goto_assignments_keyword(Script): + """ + Bug: goto assignments on ``in`` used to raise AttributeError:: + + 'unicode' object has no attribute 'generate_call_path' + """ + Script('in').goto_assignments() + + +def test_keyword(Script, environment): + """ github jedi-vim issue #44 """ + defs = Script("print").goto_definitions() + if environment.version_info.major < 3: + assert defs == [] + else: + assert [d.docstring() for d in defs] + + assert Script("import").goto_assignments() == [] + + completions = Script("import", 1, 1).completions() + assert len(completions) > 10 and 'if' in [c.name for c in completions] + assert Script("assert").goto_definitions() == [] + + +def test_keyword_attributes(Script): + def_, = Script('def').completions() + assert def_.name == 'def' + assert def_.complete == '' + assert def_.is_keyword is True + assert def_.is_stub() is False + assert def_.goto_assignments(only_stubs=True) == [] + assert def_.goto_assignments() == [] + assert def_.infer() == [] + assert def_.parent() is None + assert def_.docstring() + assert def_.description == 'keyword def' + assert def_.get_line_code() == '' + assert def_.full_name is None + assert def_.line is def_.column is None + assert def_.in_builtin_module() is True + assert def_.module_name in ('builtins', '__builtin__') + assert 'typeshed' in def_.module_path + assert def_.type == 'keyword' + + +def test_none_keyword(Script, environment): + if environment.version_info.major == 2: + # Just don't care about Python 2 anymore, it's almost gone. + pytest.skip() + + none, = Script('None').completions() + assert not none.docstring() + assert none.name == 'None' diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_api/test_project.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_api/test_project.py new file mode 100644 index 0000000..a9fccb0 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_api/test_project.py @@ -0,0 +1,24 @@ +import os + +from ..helpers import get_example_dir, set_cwd, root_dir +from jedi import Interpreter + + +def test_django_default_project(Script): + dir = get_example_dir('django') + + script = Script( + "from app import models\nmodels.SomeMo", + path=os.path.join(dir, 'models/x.py') + ) + c, = script.completions() + assert c.name == "SomeModel" + assert script._evaluator.project._django is True + + +def test_interpreter_project_path(): + # Run from anywhere it should be the cwd. + dir = os.path.join(root_dir, 'test') + with set_cwd(dir): + project = Interpreter('', [locals()])._evaluator.project + assert project._path == dir diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_api/test_settings.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_api/test_settings.py new file mode 100644 index 0000000..24ae05f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_api/test_settings.py @@ -0,0 +1,34 @@ +import os + +import pytest + +from jedi import api +from jedi.evaluate import imports +from ..helpers import cwd_at + + +@pytest.mark.skipif('True', reason='Skip for now, test case is not really supported.') +@cwd_at('jedi') +def test_add_dynamic_mods(Script): + fname = '__main__.py' + api.settings.additional_dynamic_modules = [fname] + # Fictional module that defines a function. + src1 = "def r(a): return a" + # Other fictional modules in another place in the fs. + src2 = 'from .. import setup; setup.r(1)' + script = Script(src1, path='../setup.py') + imports.load_module(script._evaluator, os.path.abspath(fname), src2) + result = script.goto_definitions() + assert len(result) == 1 + assert result[0].description == 'class int' + + +def test_add_bracket_after_function(monkeypatch, Script): + settings = api.settings + monkeypatch.setattr(settings, 'add_bracket_after_function', True) + script = Script('''\ +def foo(): + pass +foo''') + completions = script.completions() + assert completions[0].complete == '(' diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_api/test_signatures.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_api/test_signatures.py new file mode 100644 index 0000000..7264cee --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_api/test_signatures.py @@ -0,0 +1,74 @@ +import sys + +import pytest + +_tuple_code = 'from typing import Tuple\ndef f(x: Tuple[int]): ...\nf' + + +@pytest.mark.parametrize( + 'code, expected_params, execute_annotation', [ + ('def f(x: 1, y): ...\nf', [None, None], True), + ('def f(x: 1, y): ...\nf', ['instance int', None], False), + ('def f(x: int): ...\nf', ['instance int'], True), + ('from typing import List\ndef f(x: List[int]): ...\nf', ['instance list'], True), + ('from typing import List\ndef f(x: List[int]): ...\nf', ['class list'], False), + (_tuple_code, ['Tuple: _SpecialForm = ...'], True), + (_tuple_code, ['Tuple: _SpecialForm = ...'], False), + ('x=str\ndef f(p: x): ...\nx=int\nf', ['instance int'], True), + + ('def f(*args, **kwargs): ...\nf', [None, None], False), + ('def f(*args: int, **kwargs: str): ...\nf', ['class int', 'class str'], False), + ] +) +def test_param_annotation(Script, code, expected_params, execute_annotation, skip_python2): + func, = Script(code).goto_assignments() + sig, = func.get_signatures() + for p, expected in zip(sig.params, expected_params): + annotations = p.infer_annotation(execute_annotation=execute_annotation) + if expected is None: + assert not annotations + else: + annotation, = annotations + assert annotation.description == expected + + +@pytest.mark.parametrize( + 'code, expected_params', [ + ('def f(x=1, y=int, z): pass\nf', ['instance int', 'class int', None]), + ('def f(*args, **kwargs): pass\nf', [None, None]), + ('x=1\ndef f(p=x): pass\nx=""\nf', ['instance int']), + ] +) +def test_param_default(Script, code, expected_params): + func, = Script(code).goto_assignments() + sig, = func.get_signatures() + for p, expected in zip(sig.params, expected_params): + annotations = p.infer_default() + if expected is None: + assert not annotations + else: + annotation, = annotations + assert annotation.description == expected + + +@pytest.mark.skipif(sys.version_info < (3, 5), reason="Python <3.5 doesn't support __signature__") +@pytest.mark.parametrize( + 'code, index, param_code, kind', [ + ('def f(x=1): pass\nf', 0, 'x=1', 'POSITIONAL_OR_KEYWORD'), + ('def f(*args:int): pass\nf', 0, '*args: int', 'VAR_POSITIONAL'), + ('def f(**kwargs: List[x]): pass\nf', 0, '**kwargs: List[x]', 'VAR_KEYWORD'), + ('def f(*, x:int=5): pass\nf', 0, 'x: int=5', 'KEYWORD_ONLY'), + ('def f(*args, x): pass\nf', 1, 'x', 'KEYWORD_ONLY'), + ] +) +def test_param_kind_and_name(code, index, param_code, kind, Script, skip_python2): + func, = Script(code).goto_assignments() + sig, = func.get_signatures() + param = sig.params[index] + assert param.to_string() == param_code + assert param.kind.name == kind + + +def test_staticmethod(Script): + s, = Script('staticmethod(').call_signatures() + assert s.to_string() == 'staticmethod(f: Callable)' diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_api/test_unicode.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_api/test_unicode.py new file mode 100644 index 0000000..7fd28bb --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_api/test_unicode.py @@ -0,0 +1,80 @@ +# -*- coding: utf-8 -*- +""" +All character set and unicode related tests. +""" +from jedi._compatibility import u, unicode + + +def test_unicode_script(Script): + """ normally no unicode objects are being used. (<=2.7) """ + s = unicode("import datetime; datetime.timedelta") + completions = Script(s).completions() + assert len(completions) + assert type(completions[0].description) is unicode + + s = u("author='öä'; author") + completions = Script(s).completions() + x = completions[0].description + assert type(x) is unicode + + s = u("#-*- coding: iso-8859-1 -*-\nauthor='öä'; author") + s = s.encode('latin-1') + completions = Script(s).completions() + assert type(completions[0].description) is unicode + + +def test_unicode_attribute(Script): + """ github jedi-vim issue #94 """ + s1 = u('#-*- coding: utf-8 -*-\nclass Person():\n' + ' name = "e"\n\nPerson().name.') + completions1 = Script(s1).completions() + assert 'strip' in [c.name for c in completions1] + s2 = u('#-*- coding: utf-8 -*-\nclass Person():\n' + ' name = "é"\n\nPerson().name.') + completions2 = Script(s2).completions() + assert 'strip' in [c.name for c in completions2] + + +def test_multibyte_script(Script): + """ `jedi.Script` must accept multi-byte string source. """ + try: + code = u("import datetime; datetime.d") + comment = u("# multi-byte comment あいうえおä") + s = (u('%s\n%s') % (code, comment)).encode('utf-8') + except NameError: + pass # python 3 has no unicode method + else: + assert len(Script(s, 1, len(code)).completions()) + + +def test_goto_definition_at_zero(Script): + """At zero usually sometimes raises unicode issues.""" + assert Script("a", 1, 1).goto_definitions() == [] + s = Script("str", 1, 1).goto_definitions() + assert len(s) == 1 + assert list(s)[0].description == 'class str' + assert Script("", 1, 0).goto_definitions() == [] + + +def test_complete_at_zero(Script): + s = Script("str", 1, 3).completions() + assert len(s) == 1 + assert list(s)[0].name == 'str' + + s = Script("", 1, 0).completions() + assert len(s) > 0 + + +def test_wrong_encoding(Script, tmpdir): + x = tmpdir.join('x.py') + # Use both latin-1 and utf-8 (a really broken file). + x.write_binary(u'foobar = 1\nä'.encode('latin-1') + u'ä'.encode('utf-8')) + + c, = Script('import x; x.foo', sys_path=[tmpdir.strpath]).completions() + assert c.name == 'foobar' + + +def test_encoding_parameter(Script): + name = u('hö') + s = Script(name.encode('latin-1'), encoding='latin-1') + assert s._module_node.get_code() == name diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_api/test_usages.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_api/test_usages.py new file mode 100644 index 0000000..245951b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_api/test_usages.py @@ -0,0 +1,14 @@ +def test_import_usage(Script): + s = Script("from .. import foo", line=1, column=18, path="foo.py") + assert [usage.line for usage in s.usages()] == [1] + + +def test_exclude_builtin_modules(Script): + def get(include): + return [(d.line, d.column) for d in Script(source, column=8).usages(include_builtins=include)] + source = '''import sys\nprint(sys.path)''' + places = get(include=True) + assert len(places) > 2 # Includes stubs + + places = get(include=False) + assert places == [(1, 7), (2, 6)] diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_cache.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_cache.py new file mode 100644 index 0000000..79bdefc --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_cache.py @@ -0,0 +1,29 @@ +""" +Test all things related to the ``jedi.cache`` module. +""" + + +def test_cache_call_signatures(Script): + """ + See github issue #390. + """ + def check(column, call_name, path=None): + assert Script(s, 1, column, path).call_signatures()[0].name == call_name + + s = 'str(int())' + + for i in range(3): + check(8, 'int') + check(4, 'str') + # Can keep doing these calls and always get the right result. + + # Now lets specify a source_path of boo and alternate these calls, it + # should still work. + for i in range(3): + check(8, 'int', 'boo') + check(4, 'str', 'boo') + + +def test_cache_line_split_issues(Script): + """Should still work even if there's a newline.""" + assert Script('int(\n').call_signatures()[0].name == 'int' diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_compatibility.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_compatibility.py new file mode 100644 index 0000000..01c9dae --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_compatibility.py @@ -0,0 +1,26 @@ +from collections import namedtuple +from jedi._compatibility import highest_pickle_protocol + + +def test_highest_pickle_protocol(): + v = namedtuple('version', 'major, minor') + assert highest_pickle_protocol([v(2, 7), v(2, 7)]) == 2 + assert highest_pickle_protocol([v(2, 7), v(3, 3)]) == 2 + assert highest_pickle_protocol([v(2, 7), v(3, 4)]) == 2 + assert highest_pickle_protocol([v(2, 7), v(3, 5)]) == 2 + assert highest_pickle_protocol([v(2, 7), v(3, 6)]) == 2 + assert highest_pickle_protocol([v(3, 3), v(2, 7)]) == 2 + assert highest_pickle_protocol([v(3, 3), v(3, 3)]) == 3 + assert highest_pickle_protocol([v(3, 3), v(3, 4)]) == 3 + assert highest_pickle_protocol([v(3, 3), v(3, 5)]) == 3 + assert highest_pickle_protocol([v(3, 3), v(3, 6)]) == 3 + assert highest_pickle_protocol([v(3, 4), v(2, 7)]) == 2 + assert highest_pickle_protocol([v(3, 4), v(3, 3)]) == 3 + assert highest_pickle_protocol([v(3, 4), v(3, 4)]) == 4 + assert highest_pickle_protocol([v(3, 4), v(3, 5)]) == 4 + assert highest_pickle_protocol([v(3, 4), v(3, 6)]) == 4 + assert highest_pickle_protocol([v(3, 6), v(2, 7)]) == 2 + assert highest_pickle_protocol([v(3, 6), v(3, 3)]) == 3 + assert highest_pickle_protocol([v(3, 6), v(3, 4)]) == 4 + assert highest_pickle_protocol([v(3, 6), v(3, 5)]) == 4 + assert highest_pickle_protocol([v(3, 6), v(3, 6)]) == 4 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_debug.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_debug.py new file mode 100644 index 0000000..0033107 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_debug.py @@ -0,0 +1,9 @@ +import jedi +from jedi import debug + +def test_simple(): + jedi.set_debug_function() + debug.speed('foo') + debug.dbg('bar') + debug.warning('baz') + jedi.set_debug_function(None, False, False, False) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/__init__.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/absolute_import/local_module.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/absolute_import/local_module.py new file mode 100644 index 0000000..aa4bf00 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/absolute_import/local_module.py @@ -0,0 +1,14 @@ +""" +This is a module that imports the *standard library* unittest, +despite there being a local "unittest" module. It specifies that it +wants the stdlib one with the ``absolute_import`` __future__ import. + +The twisted equivalent of this module is ``twisted.trial._synctest``. +""" +from __future__ import absolute_import + +import unittest + + +class Assertions(unittest.TestCase): + pass diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/absolute_import/unittest.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/absolute_import/unittest.py new file mode 100644 index 0000000..eee1e93 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/absolute_import/unittest.py @@ -0,0 +1,14 @@ +""" +This is a module that shadows a builtin (intentionally). + +It imports a local module, which in turn imports stdlib unittest (the +name shadowed by this module). If that is properly resolved, there's +no problem. However, if jedi doesn't understand absolute_imports, it +will get this module again, causing infinite recursion. +""" +from local_module import Assertions + + +class TestCase(Assertions): + def test(self): + self.assertT diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/flask-site-packages/flask/__init__.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/flask-site-packages/flask/__init__.py new file mode 100644 index 0000000..e876bc1 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/flask-site-packages/flask/__init__.py @@ -0,0 +1 @@ + diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/flask-site-packages/flask/ext/__init__.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/flask-site-packages/flask/ext/__init__.py new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/flask-site-packages/flask/ext/__init__.py @@ -0,0 +1 @@ + diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/flask-site-packages/flask_baz/__init__.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/flask-site-packages/flask_baz/__init__.py new file mode 100644 index 0000000..e9b3fff --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/flask-site-packages/flask_baz/__init__.py @@ -0,0 +1 @@ +Baz = 1 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/flask-site-packages/flask_foo.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/flask-site-packages/flask_foo.py new file mode 100644 index 0000000..0b910b8 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/flask-site-packages/flask_foo.py @@ -0,0 +1,2 @@ +class Foo(object): + pass diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/flask-site-packages/flaskext/__init__.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/flask-site-packages/flaskext/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/flask-site-packages/flaskext/bar.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/flask-site-packages/flaskext/bar.py new file mode 100644 index 0000000..6629f9a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/flask-site-packages/flaskext/bar.py @@ -0,0 +1,2 @@ +class Bar(object): + pass diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/flask-site-packages/flaskext/moo/__init__.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/flask-site-packages/flaskext/moo/__init__.py new file mode 100644 index 0000000..266e809 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/flask-site-packages/flaskext/moo/__init__.py @@ -0,0 +1 @@ +Moo = 1 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/implicit_namespace_package/ns1/pkg/ns1_file.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/implicit_namespace_package/ns1/pkg/ns1_file.py new file mode 100644 index 0000000..940279f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/implicit_namespace_package/ns1/pkg/ns1_file.py @@ -0,0 +1 @@ +foo = 'ns1_file!' diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/implicit_namespace_package/ns2/pkg/ns2_file.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/implicit_namespace_package/ns2/pkg/ns2_file.py new file mode 100644 index 0000000..e87d7d8 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/implicit_namespace_package/ns2/pkg/ns2_file.py @@ -0,0 +1 @@ +foo = 'ns2_file!' diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/implicit_nested_namespaces/namespace/pkg/module.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/implicit_nested_namespaces/namespace/pkg/module.py new file mode 100644 index 0000000..3c37820 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/implicit_nested_namespaces/namespace/pkg/module.py @@ -0,0 +1 @@ +CONST = 1 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/init_extension_module/__init__.cpython-34m.so b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/init_extension_module/__init__.cpython-34m.so new file mode 100755 index 0000000..abfadc3 Binary files /dev/null and b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/init_extension_module/__init__.cpython-34m.so differ diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/init_extension_module/module.c b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/init_extension_module/module.c new file mode 100644 index 0000000..bfa06f6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/init_extension_module/module.c @@ -0,0 +1,15 @@ +#include "Python.h" + +static struct PyModuleDef module = { + PyModuleDef_HEAD_INIT, + "init_extension_module", + NULL, + -1, + NULL +}; + +PyMODINIT_FUNC PyInit_init_extension_module(void){ + PyObject *m = PyModule_Create(&module); + PyModule_AddObject(m, "foo", Py_None); + return m; +} diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/init_extension_module/setup.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/init_extension_module/setup.py new file mode 100644 index 0000000..5ce0517 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/init_extension_module/setup.py @@ -0,0 +1,10 @@ +from distutils.core import setup, Extension + +setup(name='init_extension_module', + version='0.0', + description='', + ext_modules=[ + Extension('init_extension_module.__init__', + sources=['module.c']) + ] +) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/namespace_package/ns1/pkg/__init__.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/namespace_package/ns1/pkg/__init__.py new file mode 100644 index 0000000..bc10ee2 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/namespace_package/ns1/pkg/__init__.py @@ -0,0 +1,9 @@ +foo = 'ns1!' + +# this is a namespace package +try: + import pkg_resources + pkg_resources.declare_namespace(__name__) +except ImportError: + import pkgutil + __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/namespace_package/ns1/pkg/ns1_file.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/namespace_package/ns1/pkg/ns1_file.py new file mode 100644 index 0000000..940279f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/namespace_package/ns1/pkg/ns1_file.py @@ -0,0 +1 @@ +foo = 'ns1_file!' diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/namespace_package/ns1/pkg/ns1_folder/__init__.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/namespace_package/ns1/pkg/ns1_folder/__init__.py new file mode 100644 index 0000000..9eeeb29 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/namespace_package/ns1/pkg/ns1_folder/__init__.py @@ -0,0 +1 @@ +foo = 'ns1_folder!' diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/namespace_package/ns2/pkg/ns2_file.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/namespace_package/ns2/pkg/ns2_file.py new file mode 100644 index 0000000..e87d7d8 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/namespace_package/ns2/pkg/ns2_file.py @@ -0,0 +1 @@ +foo = 'ns2_file!' diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/namespace_package/ns2/pkg/ns2_folder/__init__.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/namespace_package/ns2/pkg/ns2_folder/__init__.py new file mode 100644 index 0000000..70b24ae --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/namespace_package/ns2/pkg/ns2_folder/__init__.py @@ -0,0 +1 @@ +foo = 'ns2_folder!' diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/namespace_package/ns2/pkg/ns2_folder/nested/__init__.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/namespace_package/ns2/pkg/ns2_folder/nested/__init__.py new file mode 100644 index 0000000..fbba1db --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/namespace_package/ns2/pkg/ns2_folder/nested/__init__.py @@ -0,0 +1 @@ +foo = 'nested!' diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/nested_namespaces/__init__.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/nested_namespaces/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/nested_namespaces/namespace/__init__.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/nested_namespaces/namespace/__init__.py new file mode 100644 index 0000000..42e33a7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/nested_namespaces/namespace/__init__.py @@ -0,0 +1,4 @@ +try: + __import__('pkg_resources').declare_namespace(__name__) +except ImportError: + pass diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/nested_namespaces/namespace/pkg/__init__.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/nested_namespaces/namespace/pkg/__init__.py new file mode 100644 index 0000000..3c37820 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/nested_namespaces/namespace/pkg/__init__.py @@ -0,0 +1 @@ +CONST = 1 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/not_in_sys_path/__init__.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/not_in_sys_path/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/not_in_sys_path/not_in_sys_path.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/not_in_sys_path/not_in_sys_path.py new file mode 100644 index 0000000..8943d8d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/not_in_sys_path/not_in_sys_path.py @@ -0,0 +1 @@ +value = 3 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/not_in_sys_path/not_in_sys_path_package/__init__.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/not_in_sys_path/not_in_sys_path_package/__init__.py new file mode 100644 index 0000000..5ef1a74 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/not_in_sys_path/not_in_sys_path_package/__init__.py @@ -0,0 +1 @@ +value = 'package' diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/not_in_sys_path/not_in_sys_path_package/module.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/not_in_sys_path/not_in_sys_path_package/module.py new file mode 100644 index 0000000..364dd03 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/not_in_sys_path/not_in_sys_path_package/module.py @@ -0,0 +1 @@ +value = 'package.module' diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/not_in_sys_path/pkg/__init__.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/not_in_sys_path/pkg/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/not_in_sys_path/pkg/module.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/not_in_sys_path/pkg/module.py new file mode 100644 index 0000000..53c44ca --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/not_in_sys_path/pkg/module.py @@ -0,0 +1,7 @@ +from not_in_sys_path import not_in_sys_path +from not_in_sys_path import not_in_sys_path_package +from not_in_sys_path.not_in_sys_path_package import module + +not_in_sys_path.value +not_in_sys_path_package.value +module.value diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/sample_venvs/pth_directory/dir-from-foo-pth/__init__.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/sample_venvs/pth_directory/dir-from-foo-pth/__init__.py new file mode 100644 index 0000000..2a1d870 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/sample_venvs/pth_directory/dir-from-foo-pth/__init__.py @@ -0,0 +1,2 @@ +# This file is here to force git to create the directory, as *.pth files only +# add existing directories. diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/sample_venvs/pth_directory/egg_link.egg-link b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/sample_venvs/pth_directory/egg_link.egg-link new file mode 100644 index 0000000..dde9b7d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/sample_venvs/pth_directory/egg_link.egg-link @@ -0,0 +1 @@ +/path/from/egg-link diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/sample_venvs/pth_directory/foo.pth b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/sample_venvs/pth_directory/foo.pth new file mode 100644 index 0000000..8850168 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/sample_venvs/pth_directory/foo.pth @@ -0,0 +1 @@ +./dir-from-foo-pth diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/sample_venvs/pth_directory/import_smth.pth b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/sample_venvs/pth_directory/import_smth.pth new file mode 100644 index 0000000..0a978a8 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/sample_venvs/pth_directory/import_smth.pth @@ -0,0 +1 @@ +import smth; smth.extend_path_foo() diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/sample_venvs/pth_directory/relative.egg-link b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/sample_venvs/pth_directory/relative.egg-link new file mode 100644 index 0000000..7a9a615 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/sample_venvs/pth_directory/relative.egg-link @@ -0,0 +1 @@ +./relative/egg-link/path diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/sample_venvs/pth_directory/smth.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/sample_venvs/pth_directory/smth.py new file mode 100644 index 0000000..6d1eefe --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/sample_venvs/pth_directory/smth.py @@ -0,0 +1,6 @@ +import sys +sys.path.append('/foo/smth.py:module') + + +def extend_path_foo(): + sys.path.append('/foo/smth.py:from_func') diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/test_absolute_import.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/test_absolute_import.py new file mode 100644 index 0000000..bc2bdb0 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/test_absolute_import.py @@ -0,0 +1,11 @@ +""" +Tests ``from __future__ import absolute_import`` (only important for +Python 2.X) +""" +from .. import helpers + + +@helpers.cwd_at("test/test_evaluate/absolute_import") +def test_can_complete_when_shadowing(Script): + script = Script(path="unittest.py") + assert script.completions() diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/test_annotations.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/test_annotations.py new file mode 100644 index 0000000..dc2d3d7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/test_annotations.py @@ -0,0 +1,64 @@ +from textwrap import dedent + +import pytest + + +def test_simple_annotations(Script, environment): + """ + Annotations only exist in Python 3. + If annotations adhere to PEP-0484, we use them (they override inference), + else they are parsed but ignored + """ + if environment.version_info.major == 2: + pytest.skip() + + source = dedent("""\ + def annot(a:3): + return a + + annot('')""") + + assert [d.name for d in Script(source).goto_definitions()] == ['str'] + + source = dedent("""\ + + def annot_ret(a:3) -> 3: + return a + + annot_ret('')""") + assert [d.name for d in Script(source).goto_definitions()] == ['str'] + + source = dedent("""\ + def annot(a:int): + return a + + annot('')""") + + assert [d.name for d in Script(source).goto_definitions()] == ['int'] + + +@pytest.mark.parametrize('reference', [ + 'assert 1', + '1', + 'def x(): pass', + '1, 2', + r'1\n' +]) +def test_illegal_forward_references(Script, environment, reference): + if environment.version_info.major == 2: + pytest.skip() + + source = 'def foo(bar: "%s"): bar' % reference + + assert not Script(source).goto_definitions() + + +def test_lambda_forward_references(Script, environment): + if environment.version_info.major == 2: + pytest.skip() + + source = 'def foo(bar: "lambda: 3"): bar' + + # For now just receiving the 3 is ok. I'm doubting that this is what we + # want. We also execute functions. Should we only execute classes? + assert Script(source).goto_definitions() diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/test_buildout_detection.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/test_buildout_detection.py new file mode 100644 index 0000000..622ded2 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/test_buildout_detection.py @@ -0,0 +1,91 @@ +import os +from textwrap import dedent + +from jedi._compatibility import force_unicode +from jedi.evaluate.sys_path import (_get_parent_dir_with_file, + _get_buildout_script_paths, + check_sys_path_modifications) + +from ..helpers import cwd_at + + +def check_module_test(Script, code): + module_context = Script(code)._get_module() + return check_sys_path_modifications(module_context) + + +@cwd_at('test/examples/buildout_project/src/proj_name') +def test_parent_dir_with_file(Script): + parent = _get_parent_dir_with_file( + os.path.abspath(os.curdir), 'buildout.cfg') + assert parent is not None + assert parent.endswith(os.path.join('test', 'examples', 'buildout_project')) + + +@cwd_at('test/examples/buildout_project/src/proj_name') +def test_buildout_detection(Script): + scripts = list(_get_buildout_script_paths(os.path.abspath('./module_name.py'))) + assert len(scripts) == 1 + curdir = os.path.abspath(os.curdir) + appdir_path = os.path.normpath(os.path.join(curdir, '../../bin/app')) + assert scripts[0] == appdir_path + + +def test_append_on_non_sys_path(Script): + code = dedent(""" + class Dummy(object): + path = [] + + d = Dummy() + d.path.append('foo')""" + ) + + paths = check_module_test(Script, code) + assert not paths + assert 'foo' not in paths + + +def test_path_from_invalid_sys_path_assignment(Script): + code = dedent(""" + import sys + sys.path = 'invalid'""" + ) + + paths = check_module_test(Script, code) + assert not paths + assert 'invalid' not in paths + + +@cwd_at('test/examples/buildout_project/src/proj_name/') +def test_sys_path_with_modifications(Script): + code = dedent(""" + import os + """) + + path = os.path.abspath(os.path.join(os.curdir, 'module_name.py')) + paths = Script(code, path=path)._evaluator.get_sys_path() + assert '/tmp/.buildout/eggs/important_package.egg' in paths + + +def test_path_from_sys_path_assignment(Script): + code = dedent(""" + #!/usr/bin/python + + import sys + sys.path[0:0] = [ + '/usr/lib/python3.4/site-packages', + '/home/test/.buildout/eggs/important_package.egg' + ] + + path[0:0] = [1] + + import important_package + + if __name__ == '__main__': + sys.exit(important_package.main())""" + ) + + paths = check_module_test(Script, code) + paths = list(map(force_unicode, paths)) + assert 1 not in paths + assert '/home/test/.buildout/eggs/important_package.egg' in paths diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/test_compiled.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/test_compiled.py new file mode 100644 index 0000000..00bda1e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/test_compiled.py @@ -0,0 +1,171 @@ +from textwrap import dedent +import math +import sys +from collections import Counter +from datetime import datetime + +import pytest + +from jedi.evaluate import compiled +from jedi.evaluate.compiled.access import DirectObjectAccess +from jedi.evaluate.gradual.conversion import _stub_to_python_context_set + + +def test_simple(evaluator, environment): + obj = compiled.create_simple_object(evaluator, u'_str_') + upper, = obj.py__getattribute__(u'upper') + objs = list(upper.execute_evaluated()) + assert len(objs) == 1 + if environment.version_info.major == 2: + expected = 'unicode' + else: + expected = 'str' + assert objs[0].name.string_name == expected + + +def test_builtin_loading(evaluator): + string, = evaluator.builtins_module.py__getattribute__(u'str') + from_name, = string.py__getattribute__(u'__init__') + assert from_name.tree_node + assert not from_name.py__doc__() # It's a stub + + +def test_next_docstr(evaluator): + next_ = compiled.builtin_from_name(evaluator, u'next') + assert next_.tree_node is not None + assert next_.py__doc__() == '' # It's a stub + for non_stub in _stub_to_python_context_set(next_): + assert non_stub.py__doc__() == next.__doc__ + + +def test_parse_function_doc_illegal_docstr(): + docstr = """ + test_func(o + + doesn't have a closing bracket. + """ + assert ('', '') == compiled.context._parse_function_doc(docstr) + + +def test_doc(evaluator): + """ + Even CompiledObject docs always return empty docstrings - not None, that's + just a Jedi API definition. + """ + str_ = compiled.create_simple_object(evaluator, u'') + # Equals `''.__getnewargs__` + obj, = str_.py__getattribute__(u'__getnewargs__') + assert obj.py__doc__() == '' + + +def test_string_literals(Script, environment): + def typ(string): + d = Script("a = %s; a" % string).goto_definitions()[0] + return d.name + + assert typ('""') == 'str' + assert typ('r""') == 'str' + if environment.version_info.major > 2: + assert typ('br""') == 'bytes' + assert typ('b""') == 'bytes' + assert typ('u""') == 'str' + else: + assert typ('b""') == 'str' + assert typ('u""') == 'unicode' + + +def test_method_completion(Script, environment): + code = dedent(''' + class Foo: + def bar(self): + pass + + foo = Foo() + foo.bar.__func__''') + assert [c.name for c in Script(code).completions()] == ['__func__'] + + +def test_time_docstring(Script): + import time + comp, = Script('import time\ntime.sleep').completions() + assert comp.docstring(raw=True) == time.sleep.__doc__ + expected = 'sleep(secs: float) -> None\n\n' + time.sleep.__doc__ + assert comp.docstring() == expected + + +def test_dict_values(Script, environment): + if environment.version_info.major == 2: + # It looks like typeshed for Python 2 returns Any. + pytest.skip() + assert Script('import sys\nsys.modules["alshdb;lasdhf"]').goto_definitions() + + +def test_getitem_on_none(Script): + script = Script('None[1j]') + assert not script.goto_definitions() + issue, = script._evaluator.analysis + assert issue.name == 'type-error-not-subscriptable' + + +def _return_int(): + return 1 + + +@pytest.mark.parametrize( + 'attribute, expected_name, expected_parent', [ + ('x', 'int', 'builtins'), + ('y', 'int', 'builtins'), + ('z', 'bool', 'builtins'), + ('cos', 'cos', 'math'), + ('dec', 'Decimal', 'decimal'), + ('dt', 'datetime', 'datetime'), + ('ret_int', '_return_int', 'test.test_evaluate.test_compiled'), + ] +) +def test_parent_context(same_process_evaluator, attribute, expected_name, expected_parent): + import decimal + + class C: + x = 1 + y = int + z = True + cos = math.cos + dec = decimal.Decimal(1) + dt = datetime(2000, 1, 1) + ret_int = _return_int + + o = compiled.CompiledObject( + same_process_evaluator, + DirectObjectAccess(same_process_evaluator, C) + ) + x, = o.py__getattribute__(attribute) + assert x.py__name__() == expected_name + module_name = x.parent_context.py__name__() + if module_name == '__builtin__': + module_name = 'builtins' # Python 2 + assert module_name == expected_parent + assert x.parent_context.parent_context is None + + +@pytest.mark.skipif(sys.version_info[0] == 2, reason="Ignore Python 2, because EOL") +@pytest.mark.parametrize( + 'obj, expected_names', [ + ('', ['str']), + (str, ['str']), + (''.upper, ['str', 'upper']), + (str.upper, ['str', 'upper']), + + (math.cos, ['cos']), + + (Counter, ['Counter']), + (Counter(""), ['Counter']), + (Counter.most_common, ['Counter', 'most_common']), + (Counter("").most_common, ['Counter', 'most_common']), + ] +) +def test_qualified_names(same_process_evaluator, obj, expected_names): + o = compiled.CompiledObject( + same_process_evaluator, + DirectObjectAccess(same_process_evaluator, obj) + ) + assert o.get_qualified_names() == tuple(expected_names) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/test_context.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/test_context.py new file mode 100644 index 0000000..a5ed8ce --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/test_context.py @@ -0,0 +1,21 @@ +from jedi._compatibility import force_unicode + + +def test_module_attributes(Script): + def_, = Script('__name__').completions() + assert def_.name == '__name__' + assert def_.line is None + assert def_.column is None + str_, = def_.infer() + assert str_.name == 'str' + + +def test_module__file__(Script, environment): + assert not Script('__file__').goto_definitions() + def_, = Script('__file__', path='example.py').goto_definitions() + value = force_unicode(def_._name._context.get_safe_value()) + assert value.endswith('example.py') + + def_, = Script('import antigravity; antigravity.__file__').goto_definitions() + value = force_unicode(def_._name._context.get_safe_value()) + assert value.endswith('.py') diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/test_docstring.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/test_docstring.py new file mode 100644 index 0000000..269a54c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/test_docstring.py @@ -0,0 +1,416 @@ +""" +Testing of docstring related issues and especially ``jedi.docstrings``. +""" + +from textwrap import dedent +import jedi +import pytest +from ..helpers import unittest +import sys + +try: + import numpydoc # NOQA +except ImportError: + numpydoc_unavailable = True +else: + numpydoc_unavailable = False + +try: + import numpy # NOQA +except ImportError: + numpy_unavailable = True +else: + numpy_unavailable = False + +if sys.version_info.major == 2: + # In Python 2 there's an issue with tox/docutils that makes the tests fail, + # Python 2 is soon end-of-life, so just don't support numpydoc for it anymore. + numpydoc_unavailable = True + + +def test_function_doc(Script): + defs = Script(""" + def func(): + '''Docstring of `func`.''' + func""").goto_definitions() + assert defs[0].docstring() == 'func()\n\nDocstring of `func`.' + + +def test_class_doc(Script): + defs = Script(""" + class TestClass(): + '''Docstring of `TestClass`.''' + TestClass""").goto_definitions() + + expected = 'Docstring of `TestClass`.' + assert defs[0].docstring(raw=True) == expected + assert defs[0].docstring() == 'TestClass()\n\n' + expected + + +def test_class_doc_with_init(Script): + d, = Script(""" + class TestClass(): + '''Docstring''' + def __init__(self, foo, bar=3): pass + TestClass""").goto_definitions() + + assert d.docstring() == 'TestClass(foo, bar=3)\n\nDocstring' + + +def test_instance_doc(Script): + defs = Script(""" + class TestClass(): + '''Docstring of `TestClass`.''' + tc = TestClass() + tc""").goto_definitions() + assert defs[0].docstring() == 'Docstring of `TestClass`.' + + +@unittest.skip('need evaluator class for that') +def test_attribute_docstring(Script): + defs = Script(""" + x = None + '''Docstring of `x`.''' + x""").goto_definitions() + assert defs[0].docstring() == 'Docstring of `x`.' + + +@unittest.skip('need evaluator class for that') +def test_multiple_docstrings(Script): + defs = Script(""" + def func(): + '''Original docstring.''' + x = func + '''Docstring of `x`.''' + x""").goto_definitions() + docs = [d.docstring() for d in defs] + assert docs == ['Original docstring.', 'Docstring of `x`.'] + + +def test_completion(Script): + assert Script(''' + class DocstringCompletion(): + #? [] + """ asdfas """''').completions() + + +def test_docstrings_type_dotted_import(Script): + s = """ + def func(arg): + ''' + :type arg: random.Random + ''' + arg.""" + names = [c.name for c in Script(s).completions()] + assert 'seed' in names + + +def test_docstrings_param_type(Script): + s = """ + def func(arg): + ''' + :param str arg: some description + ''' + arg.""" + names = [c.name for c in Script(s).completions()] + assert 'join' in names + + +def test_docstrings_type_str(Script): + s = """ + def func(arg): + ''' + :type arg: str + ''' + arg.""" + + names = [c.name for c in Script(s).completions()] + assert 'join' in names + + +def test_docstring_instance(Script): + # The types hint that it's a certain kind + s = dedent(""" + class A: + def __init__(self,a): + ''' + :type a: threading.Thread + ''' + + if a is not None: + a.start() + + self.a = a + + + def method_b(c): + ''' + :type c: A + ''' + + c.""") + + names = [c.name for c in Script(s).completions()] + assert 'a' in names + assert '__init__' in names + assert 'mro' not in names # Exists only for types. + + +def test_docstring_keyword(Script): + completions = Script('assert').completions() + assert 'assert' in completions[0].docstring() + + +def test_docstring_params_formatting(Script): + defs = Script(""" + def func(param1, + param2, + param3): + pass + func""").goto_definitions() + assert defs[0].docstring() == 'func(param1, param2, param3)' + + +# ---- Numpy Style Tests --- + +@pytest.mark.skipif(numpydoc_unavailable, + reason='numpydoc module is unavailable') +def test_numpydoc_parameters(): + s = dedent(''' + def foobar(x, y): + """ + Parameters + ---------- + x : int + y : str + """ + y.''') + names = [c.name for c in jedi.Script(s).completions()] + assert 'isupper' in names + assert 'capitalize' in names + + +@pytest.mark.skipif(numpydoc_unavailable, + reason='numpydoc module is unavailable') +def test_numpydoc_parameters_set_of_values(): + s = dedent(''' + def foobar(x, y): + """ + Parameters + ---------- + x : {'foo', 'bar', 100500}, optional + """ + x.''') + names = [c.name for c in jedi.Script(s).completions()] + assert 'isupper' in names + assert 'capitalize' in names + assert 'numerator' in names + + +@pytest.mark.skipif(numpydoc_unavailable, + reason='numpydoc module is unavailable') +def test_numpydoc_parameters_alternative_types(): + s = dedent(''' + def foobar(x, y): + """ + Parameters + ---------- + x : int or str or list + """ + x.''') + names = [c.name for c in jedi.Script(s).completions()] + assert 'isupper' in names + assert 'capitalize' in names + assert 'numerator' in names + assert 'append' in names + + +@pytest.mark.skipif(numpydoc_unavailable, + reason='numpydoc module is unavailable') +def test_numpydoc_invalid(): + s = dedent(''' + def foobar(x, y): + """ + Parameters + ---------- + x : int (str, py.path.local + """ + x.''') + + assert not jedi.Script(s).completions() + + +@pytest.mark.skipif(numpydoc_unavailable, + reason='numpydoc module is unavailable') +def test_numpydoc_returns(): + s = dedent(''' + def foobar(): + """ + Returns + ---------- + x : int + y : str + """ + return x + + def bazbiz(): + z = foobar() + z.''') + names = [c.name for c in jedi.Script(s).completions()] + assert 'isupper' in names + assert 'capitalize' in names + assert 'numerator' in names + + +@pytest.mark.skipif(numpydoc_unavailable, + reason='numpydoc module is unavailable') +def test_numpydoc_returns_set_of_values(): + s = dedent(''' + def foobar(): + """ + Returns + ---------- + x : {'foo', 'bar', 100500} + """ + return x + + def bazbiz(): + z = foobar() + z.''') + names = [c.name for c in jedi.Script(s).completions()] + assert 'isupper' in names + assert 'capitalize' in names + assert 'numerator' in names + + +@pytest.mark.skipif(numpydoc_unavailable, + reason='numpydoc module is unavailable') +def test_numpydoc_returns_alternative_types(): + s = dedent(''' + def foobar(): + """ + Returns + ---------- + int or list of str + """ + return x + + def bazbiz(): + z = foobar() + z.''') + names = [c.name for c in jedi.Script(s).completions()] + assert 'isupper' not in names + assert 'capitalize' not in names + assert 'numerator' in names + assert 'append' in names + + +@pytest.mark.skipif(numpydoc_unavailable, + reason='numpydoc module is unavailable') +def test_numpydoc_returns_list_of(): + s = dedent(''' + def foobar(): + """ + Returns + ---------- + list of str + """ + return x + + def bazbiz(): + z = foobar() + z.''') + names = [c.name for c in jedi.Script(s).completions()] + assert 'append' in names + assert 'isupper' not in names + assert 'capitalize' not in names + + +@pytest.mark.skipif(numpydoc_unavailable, + reason='numpydoc module is unavailable') +def test_numpydoc_returns_obj(): + s = dedent(''' + def foobar(x, y): + """ + Returns + ---------- + int or random.Random + """ + return x + y + + def bazbiz(): + z = foobar(x, y) + z.''') + script = jedi.Script(s) + names = [c.name for c in script.completions()] + assert 'numerator' in names + assert 'seed' in names + + +@pytest.mark.skipif(numpydoc_unavailable, + reason='numpydoc module is unavailable') +def test_numpydoc_yields(): + s = dedent(''' + def foobar(): + """ + Yields + ---------- + x : int + y : str + """ + return x + + def bazbiz(): + z = foobar(): + z.''') + names = [c.name for c in jedi.Script(s).completions()] + assert 'isupper' in names + assert 'capitalize' in names + assert 'numerator' in names + + +@pytest.mark.skipif(numpydoc_unavailable or numpy_unavailable, + reason='numpydoc or numpy module is unavailable') +def test_numpy_returns(): + s = dedent(''' + import numpy + x = numpy.asarray([]) + x.d''' + ) + names = [c.name for c in jedi.Script(s).completions()] + assert 'diagonal' in names + + +@pytest.mark.skipif(numpydoc_unavailable or numpy_unavailable, + reason='numpydoc or numpy module is unavailable') +def test_numpy_comp_returns(): + s = dedent(''' + import numpy + x = numpy.array([]) + x.d''' + ) + names = [c.name for c in jedi.Script(s).completions()] + assert 'diagonal' in names + + +def test_decorator(Script): + code = dedent(''' + def decorator(name=None): + def _decorate(func): + @wraps(func) + def wrapper(*args, **kwargs): + """wrapper docstring""" + return func(*args, **kwargs) + return wrapper + return _decorate + + + @decorator('testing') + def check_user(f): + """Nice docstring""" + pass + + check_user''') + + d, = Script(code).goto_definitions() + assert d.docstring(raw=True) == 'Nice docstring' diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/test_extension.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/test_extension.py new file mode 100644 index 0000000..7dfcfd0 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/test_extension.py @@ -0,0 +1,57 @@ +""" +Test compiled module +""" +import os + +import jedi +from ..helpers import cwd_at +import pytest + + +def test_completions(Script): + s = Script('import _ctypes; _ctypes.') + assert len(s.completions()) >= 15 + + +def test_call_signatures_extension(Script): + if os.name == 'nt': + func = 'LoadLibrary' + params = 1 + else: + func = 'dlopen' + params = 2 + s = Script('import _ctypes; _ctypes.%s(' % (func,)) + sigs = s.call_signatures() + assert len(sigs) == 1 + assert len(sigs[0].params) == params + + +def test_call_signatures_stdlib(Script): + s = Script('import math; math.cos(') + sigs = s.call_signatures() + assert len(sigs) == 1 + assert len(sigs[0].params) == 1 + + +# Check only on linux 64 bit platform and Python3.4. +@pytest.mark.skipif('sys.platform != "linux" or sys.maxsize <= 2**32 or sys.version_info[:2] != (3, 4)') +@cwd_at('test/test_evaluate') +def test_init_extension_module(Script): + """ + ``__init__`` extension modules are also packages and Jedi should understand + that. + + Originally coming from #472. + + This test was built by the module.c and setup.py combination you can find + in the init_extension_module folder. You can easily build the + `__init__.cpython-34m.so` by compiling it (create a virtualenv and run + `setup.py install`. + + This is also why this test only runs on certain systems (and Python 3.4). + """ + s = jedi.Script('import init_extension_module as i\ni.', path='not_existing.py') + assert 'foo' in [c.name for c in s.completions()] + + s = jedi.Script('from init_extension_module import foo\nfoo', path='not_existing.py') + assert ['foo'] == [c.name for c in s.completions()] diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/test_fstring.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/test_fstring.py new file mode 100644 index 0000000..2805e44 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/test_fstring.py @@ -0,0 +1,19 @@ +import pytest +from textwrap import dedent + + +@pytest.fixture(autouse=True) +def skip_not_supported(environment): + if environment.version_info < (3, 6): + pytest.skip() + + +def test_fstring_multiline(Script): + code = dedent("""\ + '' f'''s{ + str.uppe + ''' + """ + ) + c, = Script(code, line=2, column=9).completions() + assert c.name == 'upper' diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/test_gradual/test_stub_loading.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/test_gradual/test_stub_loading.py new file mode 100644 index 0000000..40dcffa --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/test_gradual/test_stub_loading.py @@ -0,0 +1,27 @@ +from functools import partial +from test.helpers import get_example_dir +from jedi.api.project import Project + +import pytest + + +@pytest.fixture +def ScriptInStubFolder(Script): + path = get_example_dir('stub_packages') + project = Project(path, sys_path=[path], smart_sys_path=False) + return partial(Script, _project=project) + + +@pytest.mark.parametrize( + ('code', 'expected'), [ + ('from no_python import foo', ['int']), + ('from with_python import stub_only', ['str']), + ('from with_python import python_only', ['int']), + ('from with_python import both', ['int']), + ('from with_python import something_random', []), + ('from with_python.module import in_sub_module', ['int']), + ] +) +def test_find_stubs_infer(ScriptInStubFolder, code, expected): + defs = ScriptInStubFolder(code).goto_definitions() + assert [d.name for d in defs] == expected diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/test_gradual/test_stubs.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/test_gradual/test_stubs.py new file mode 100644 index 0000000..0782469 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/test_gradual/test_stubs.py @@ -0,0 +1,94 @@ +import os + +import pytest + +from jedi.api.project import Project +from test.helpers import root_dir + + +@pytest.mark.parametrize('type_', ['goto', 'infer']) +@pytest.mark.parametrize('way', ['direct', 'indirect']) +@pytest.mark.parametrize( + 'kwargs', [ + dict(only_stubs=False, prefer_stubs=False), + dict(only_stubs=False, prefer_stubs=True), + dict(only_stubs=True, prefer_stubs=False), + ] +) +@pytest.mark.parametrize( + ('code', 'full_name', 'has_stub', 'has_python', 'goto_changes'), [ + ['import os; os.walk', 'os.walk', True, True, {}], + ['from collections import Counter', 'collections.Counter', True, True, {}], + ['from collections', 'collections', True, True, {}], + ['from collections import Counter; Counter', 'collections.Counter', True, True, {}], + ['from collections import Counter; Counter()', 'collections.Counter', True, True, {}], + ['from collections import Counter; Counter.most_common', + 'collections.Counter.most_common', True, True, {}], + ['from collections import deque', 'collections.deque', True, False, {'has_python': True}], + + ['from keyword import kwlist; kwlist', 'typing.Sequence', True, True, + {'full_name': 'keyword.kwlist'}], + ['from keyword import kwlist', 'typing.Sequence', True, True, + {'full_name': 'keyword.kwlist'}], + + ['from socket import AF_INET', 'socket.AddressFamily', True, False, + {'full_name': 'socket.AF_INET'}], + ['from socket import socket', 'socket.socket', True, True, {}], + + ['import with_stub', 'with_stub', True, True, {}], + ['import with_stub', 'with_stub', True, True, {}], + ['import with_stub_folder.python_only', 'with_stub_folder.python_only', False, True, {}], + ['import stub_only', 'stub_only', True, False, {}], + ]) +def test_infer_and_goto(Script, code, full_name, has_stub, has_python, way, + kwargs, type_, goto_changes, environment): + if environment.version_info < (3, 5): + # We just don't care about much of the detailed Python 2 failures + # anymore, because its end-of-life soon. (same for 3.4) + pytest.skip() + + if type_ == 'infer' and full_name == 'typing.Sequence' and environment.version_info >= (3, 7): + # In Python 3.7+ there's not really a sequence definition, there's just + # a name that leads nowhere. + has_python = False + + project = Project(os.path.join(root_dir, 'test', 'completion', 'stub_folder')) + s = Script(code, _project=project) + prefer_stubs = kwargs['prefer_stubs'] + only_stubs = kwargs['only_stubs'] + + if type_ == 'goto': + full_name = goto_changes.get('full_name', full_name) + has_python = goto_changes.get('has_python', has_python) + + if way == 'direct': + if type_ == 'goto': + defs = s.goto_assignments(follow_imports=True, **kwargs) + else: + defs = s.goto_definitions(**kwargs) + else: + goto_defs = s.goto_assignments( + # Prefering stubs when we want to go to python and vice versa + prefer_stubs=not (prefer_stubs or only_stubs), + follow_imports=True, + ) + if type_ == 'goto': + defs = [d for goto_def in goto_defs for d in goto_def.goto_assignments(**kwargs)] + else: + defs = [d for goto_def in goto_defs for d in goto_def.infer(**kwargs)] + + if not has_stub and only_stubs: + assert not defs + else: + assert defs + + for d in defs: + if prefer_stubs and has_stub: + assert d.is_stub() + elif only_stubs: + assert d.is_stub() + else: + assert has_python == (not d.is_stub()) + assert d.full_name == full_name + + assert d.is_stub() == d.module_path.endswith('.pyi') diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/test_gradual/test_typeshed.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/test_gradual/test_typeshed.py new file mode 100644 index 0000000..4cd485a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/test_gradual/test_typeshed.py @@ -0,0 +1,236 @@ +import os + +import pytest +from parso.utils import PythonVersionInfo + +from jedi.evaluate.gradual import typeshed, stub_context +from jedi.evaluate.context import TreeInstance, BoundMethod, FunctionContext, \ + MethodContext, ClassContext + +TYPESHED_PYTHON3 = os.path.join(typeshed.TYPESHED_PATH, 'stdlib', '3') + + +def test_get_typeshed_directories(): + def get_dirs(version_info): + return { + d.replace(typeshed.TYPESHED_PATH, '').lstrip(os.path.sep) + for d in typeshed._get_typeshed_directories(version_info) + } + + def transform(set_): + return {x.replace('/', os.path.sep) for x in set_} + + dirs = get_dirs(PythonVersionInfo(2, 7)) + assert dirs == transform({'stdlib/2and3', 'stdlib/2', 'third_party/2and3', 'third_party/2'}) + + dirs = get_dirs(PythonVersionInfo(3, 4)) + assert dirs == transform({'stdlib/2and3', 'stdlib/3', 'third_party/2and3', 'third_party/3'}) + + dirs = get_dirs(PythonVersionInfo(3, 5)) + assert dirs == transform({'stdlib/2and3', 'stdlib/3', 'stdlib/3.5', + 'third_party/2and3', 'third_party/3', 'third_party/3.5'}) + + dirs = get_dirs(PythonVersionInfo(3, 6)) + assert dirs == transform({'stdlib/2and3', 'stdlib/3', 'stdlib/3.5', + 'stdlib/3.6', 'third_party/2and3', + 'third_party/3', 'third_party/3.5', 'third_party/3.6'}) + + +def test_get_stub_files(): + def get_map(version_info): + return typeshed._create_stub_map(version_info) + + map_ = typeshed._create_stub_map(TYPESHED_PYTHON3) + assert map_['functools'] == os.path.join(TYPESHED_PYTHON3, 'functools.pyi') + + +def test_function(Script, environment): + code = 'import threading; threading.current_thread' + def_, = Script(code).goto_definitions() + context = def_._name._context + assert isinstance(context, FunctionContext), context + + def_, = Script(code + '()').goto_definitions() + context = def_._name._context + assert isinstance(context, TreeInstance) + + def_, = Script('import threading; threading.Thread').goto_definitions() + assert isinstance(def_._name._context, ClassContext), def_ + + +def test_keywords_variable(Script): + code = 'import keyword; keyword.kwlist' + for seq in Script(code).goto_definitions(): + assert seq.name == 'Sequence' + # This points towards the typeshed implementation + stub_seq, = seq.goto_assignments(only_stubs=True) + assert typeshed.TYPESHED_PATH in stub_seq.module_path + + +def test_class(Script): + def_, = Script('import threading; threading.Thread').goto_definitions() + context = def_._name._context + assert isinstance(context, ClassContext), context + + +def test_instance(Script): + def_, = Script('import threading; threading.Thread()').goto_definitions() + context = def_._name._context + assert isinstance(context, TreeInstance) + + +def test_class_function(Script): + def_, = Script('import threading; threading.Thread.getName').goto_definitions() + context = def_._name._context + assert isinstance(context, MethodContext), context + + +def test_method(Script): + code = 'import threading; threading.Thread().getName' + def_, = Script(code).goto_definitions() + context = def_._name._context + assert isinstance(context, BoundMethod), context + assert isinstance(context._wrapped_context, MethodContext), context + + def_, = Script(code + '()').goto_definitions() + context = def_._name._context + assert isinstance(context, TreeInstance) + assert context.class_context.py__name__() == 'str' + + +def test_sys_exc_info(Script): + code = 'import sys; sys.exc_info()' + none, def_ = Script(code + '[1]').goto_definitions() + # It's an optional. + assert def_.name == 'BaseException' + assert def_.type == 'instance' + assert none.name == 'NoneType' + + none, def_ = Script(code + '[0]').goto_definitions() + assert def_.name == 'BaseException' + assert def_.type == 'class' + + +def test_sys_getwindowsversion(Script, environment): + # This should only exist on Windows, but type inference should happen + # everywhere. + definitions = Script('import sys; sys.getwindowsversion().major').goto_definitions() + if environment.version_info.major == 2: + assert not definitions + else: + def_, = definitions + assert def_.name == 'int' + + +def test_sys_hexversion(Script): + script = Script('import sys; sys.hexversion') + def_, = script.completions() + assert isinstance(def_._name, stub_context._StubName), def_._name + assert typeshed.TYPESHED_PATH in def_.module_path + def_, = script.goto_definitions() + assert def_.name == 'int' + + +def test_math(Script): + def_, = Script('import math; math.acos()').goto_definitions() + assert def_.name == 'float' + context = def_._name._context + assert context + + +def test_type_var(Script): + def_, = Script('import typing; T = typing.TypeVar("T1")').goto_definitions() + assert def_.name == 'TypeVar' + assert def_.description == 'TypeVar = object()' + + +@pytest.mark.parametrize( + 'code, full_name', ( + ('import math', 'math'), + ('from math import cos', 'math.cos') + ) +) +def test_math_is_stub(Script, code, full_name): + s = Script(code) + cos, = s.goto_definitions() + wanted = os.path.join('typeshed', 'stdlib', '2and3', 'math.pyi') + assert cos.module_path.endswith(wanted) + assert cos.is_stub() is True + assert cos.goto_assignments(only_stubs=True) == [cos] + assert cos.full_name == full_name + + cos, = s.goto_assignments() + assert cos.module_path.endswith(wanted) + assert cos.goto_assignments(only_stubs=True) == [cos] + assert cos.is_stub() is True + assert cos.full_name == full_name + + +def test_goto_stubs(Script): + s = Script('import os; os') + os_module, = s.goto_definitions() + assert os_module.full_name == 'os' + assert os_module.is_stub() is False + stub, = os_module.goto_assignments(only_stubs=True) + assert stub.is_stub() is True + + os_module, = s.goto_assignments() + + +def _assert_is_same(d1, d2): + assert d1.name == d2.name + assert d1.module_path == d2.module_path + assert d1.line == d2.line + assert d1.column == d2.column + + +@pytest.mark.parametrize('type_', ['goto', 'infer']) +@pytest.mark.parametrize( + 'code', [ + 'import os; os.walk', + 'from collections import Counter; Counter', + 'from collections import Counter; Counter()', + 'from collections import Counter; Counter.most_common', + ]) +def test_goto_stubs_on_itself(Script, code, type_): + """ + If goto_stubs is used on an identifier in e.g. the stdlib, we should goto + the stub of it. + """ + s = Script(code) + if type_ == 'infer': + def_, = s.goto_definitions() + else: + def_, = s.goto_assignments(follow_imports=True) + stub, = def_.goto_assignments(only_stubs=True) + + script_on_source = Script( + path=def_.module_path, + line=def_.line, + column=def_.column + ) + if type_ == 'infer': + definition, = script_on_source.goto_definitions() + else: + definition, = script_on_source.goto_assignments() + same_stub, = definition.goto_assignments(only_stubs=True) + _assert_is_same(same_stub, stub) + _assert_is_same(definition, def_) + assert same_stub.module_path != def_.module_path + + # And the reverse. + script_on_stub = Script( + path=same_stub.module_path, + line=same_stub.line, + column=same_stub.column + ) + + if type_ == 'infer': + same_definition, = script_on_stub.goto_definitions() + same_definition2, = same_stub.infer() + else: + same_definition, = script_on_stub.goto_assignments() + same_definition2, = same_stub.goto_assignments() + + _assert_is_same(same_definition, definition) + _assert_is_same(same_definition, same_definition2) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/test_helpers.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/test_helpers.py new file mode 100644 index 0000000..65dd01c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/test_helpers.py @@ -0,0 +1,16 @@ +from textwrap import dedent + +from jedi import names +from jedi.evaluate import helpers + + +def test_call_of_leaf_in_brackets(environment): + s = dedent(""" + x = 1 + type(x) + """) + last_x = names(s, references=True, definitions=False, environment=environment)[-1] + name = last_x._name.tree_name + + call = helpers.call_of_leaf(name) + assert call == name diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/test_implicit_namespace_package.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/test_implicit_namespace_package.py new file mode 100644 index 0000000..9dd5044 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/test_implicit_namespace_package.py @@ -0,0 +1,105 @@ +from os.path import dirname, join + +import pytest + + +@pytest.fixture(autouse=True) +def skip_not_supported_versions(environment): + if environment.version_info < (3, 4): + pytest.skip() + + +def test_implicit_namespace_package(Script): + sys_path = [join(dirname(__file__), d) + for d in ['implicit_namespace_package/ns1', 'implicit_namespace_package/ns2']] + + def script_with_path(*args, **kwargs): + return Script(sys_path=sys_path, *args, **kwargs) + + # goto definition + assert script_with_path('from pkg import ns1_file').goto_definitions() + assert script_with_path('from pkg import ns2_file').goto_definitions() + assert not script_with_path('from pkg import ns3_file').goto_definitions() + + # goto assignment + tests = { + 'from pkg.ns2_file import foo': 'ns2_file!', + 'from pkg.ns1_file import foo': 'ns1_file!', + } + for source, solution in tests.items(): + ass = script_with_path(source).goto_assignments() + assert len(ass) == 1 + assert ass[0].description == "foo = '%s'" % solution + + # completion + completions = script_with_path('from pkg import ').completions() + names = [c.name for c in completions] + compare = ['ns1_file', 'ns2_file'] + # must at least contain these items, other items are not important + assert set(compare) == set(names) + + tests = { + 'from pkg import ns2_file as x': 'ns2_file!', + 'from pkg import ns1_file as x': 'ns1_file!' + } + for source, solution in tests.items(): + for c in script_with_path(source + '; x.').completions(): + if c.name == 'foo': + completion = c + solution = "foo = '%s'" % solution + assert completion.description == solution + + +def test_implicit_nested_namespace_package(Script): + code = 'from implicit_nested_namespaces.namespace.pkg.module import CONST' + + sys_path = [dirname(__file__)] + + script = Script(sys_path=sys_path, source=code, line=1, column=61) + + result = script.goto_definitions() + + assert len(result) == 1 + + implicit_pkg, = Script(code, column=10, sys_path=sys_path).goto_definitions() + assert implicit_pkg.type == 'module' + assert implicit_pkg.module_path is None + + +def test_implicit_namespace_package_import_autocomplete(Script): + CODE = 'from implicit_name' + + sys_path = [dirname(__file__)] + + script = Script(sys_path=sys_path, source=CODE) + compl = script.completions() + assert [c.name for c in compl] == ['implicit_namespace_package'] + + +def test_namespace_package_in_multiple_directories_autocompletion(Script): + CODE = 'from pkg.' + sys_path = [join(dirname(__file__), d) + for d in ['implicit_namespace_package/ns1', 'implicit_namespace_package/ns2']] + + script = Script(sys_path=sys_path, source=CODE) + compl = script.completions() + assert set(c.name for c in compl) == set(['ns1_file', 'ns2_file']) + + +def test_namespace_package_in_multiple_directories_goto_definition(Script): + CODE = 'from pkg import ns1_file' + sys_path = [join(dirname(__file__), d) + for d in ['implicit_namespace_package/ns1', 'implicit_namespace_package/ns2']] + script = Script(sys_path=sys_path, source=CODE) + result = script.goto_definitions() + assert len(result) == 1 + + +def test_namespace_name_autocompletion_full_name(Script): + CODE = 'from pk' + sys_path = [join(dirname(__file__), d) + for d in ['implicit_namespace_package/ns1', 'implicit_namespace_package/ns2']] + + script = Script(sys_path=sys_path, source=CODE) + compl = script.completions() + assert set(c.full_name for c in compl) == set(['pkg']) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/test_imports.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/test_imports.py new file mode 100644 index 0000000..0edc3a8 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/test_imports.py @@ -0,0 +1,477 @@ +""" +Tests of various import related things that could not be tested with "Black Box +Tests". +""" + +import os + +import pytest +from jedi.file_io import FileIO, KnownContentFileIO + +from jedi._compatibility import find_module_py33, find_module +from jedi.evaluate import compiled +from jedi.evaluate import imports +from jedi.api.project import Project +from jedi.evaluate.gradual.conversion import _stub_to_python_context_set +from ..helpers import cwd_at, get_example_dir, test_dir, root_dir + +THIS_DIR = os.path.dirname(__file__) + + +@pytest.mark.skipif('sys.version_info < (3,3)') +def test_find_module_py33(): + """Needs to work like the old find_module.""" + assert find_module_py33('_io') == (None, False) + with pytest.raises(ImportError): + assert find_module_py33('_DOESNTEXIST_') == (None, None) + + +def test_find_module_package(): + file_io, is_package = find_module('json') + assert file_io.path.endswith(os.path.join('json', '__init__.py')) + assert is_package is True + + +def test_find_module_not_package(): + file_io, is_package = find_module('io') + assert file_io.path.endswith('io.py') + assert is_package is False + + +pkg_zip_path = os.path.join(os.path.dirname(__file__), + 'zipped_imports', + 'pkg.zip') + + +def test_find_module_package_zipped(Script, evaluator, environment): + sys_path = environment.get_sys_path() + [pkg_zip_path] + script = Script('import pkg; pkg.mod', sys_path=sys_path) + assert len(script.completions()) == 1 + + file_io, is_package = evaluator.compiled_subprocess.get_module_info( + sys_path=sys_path, + string=u'pkg', + full_name=u'pkg' + ) + assert file_io is not None + assert file_io.path.endswith(os.path.join('pkg.zip', 'pkg', '__init__.py')) + assert file_io._zip_path.endswith('pkg.zip') + assert is_package is True + + +@pytest.mark.parametrize( + 'code, file, package, path', [ + ('import pkg', '__init__.py', 'pkg', 'pkg'), + ('import pkg', '__init__.py', 'pkg', 'pkg'), + + ('from pkg import module', 'module.py', 'pkg', None), + ('from pkg.module', 'module.py', 'pkg', None), + + ('from pkg import nested', os.path.join('nested', '__init__.py'), + 'pkg.nested', os.path.join('pkg', 'nested')), + ('from pkg.nested', os.path.join('nested', '__init__.py'), + 'pkg.nested', os.path.join('pkg', 'nested')), + + ('from pkg.nested import nested_module', + os.path.join('nested', 'nested_module.py'), 'pkg.nested', None), + ('from pkg.nested.nested_module', + os.path.join('nested', 'nested_module.py'), 'pkg.nested', None), + + ('from pkg.namespace import namespace_module', + os.path.join('namespace', 'namespace_module.py'), 'pkg.namespace', None), + ('from pkg.namespace.namespace_module', + os.path.join('namespace', 'namespace_module.py'), 'pkg.namespace', None), + ] + +) +def test_correct_zip_package_behavior(Script, evaluator, environment, code, + file, package, path, skip_python2): + sys_path = environment.get_sys_path() + [pkg_zip_path] + pkg, = Script(code, sys_path=sys_path).goto_definitions() + context, = pkg._name.infer() + assert context.py__file__() == os.path.join(pkg_zip_path, 'pkg', file) + assert '.'.join(context.py__package__()) == package + assert context.is_package is (path is not None) + if path is not None: + assert context.py__path__() == [os.path.join(pkg_zip_path, path)] + + +def test_find_module_not_package_zipped(Script, evaluator, environment): + path = os.path.join(os.path.dirname(__file__), 'zipped_imports/not_pkg.zip') + sys_path = environment.get_sys_path() + [path] + script = Script('import not_pkg; not_pkg.val', sys_path=sys_path) + assert len(script.completions()) == 1 + + file_io, is_package = evaluator.compiled_subprocess.get_module_info( + sys_path=sys_path, + string=u'not_pkg', + full_name=u'not_pkg' + ) + assert file_io.path.endswith(os.path.join('not_pkg.zip', 'not_pkg.py')) + assert is_package is False + + +@cwd_at('test/test_evaluate/not_in_sys_path/pkg') +def test_import_not_in_sys_path(Script): + """ + non-direct imports (not in sys.path) + """ + a = Script(path='module.py', line=5).goto_definitions() + assert a[0].name == 'int' + + a = Script(path='module.py', line=6).goto_definitions() + assert a[0].name == 'str' + a = Script(path='module.py', line=7).goto_definitions() + assert a[0].name == 'str' + + +@pytest.mark.parametrize("code,name", [ + ("from flask.ext import foo; foo.", "Foo"), # flask_foo.py + ("from flask.ext import bar; bar.", "Bar"), # flaskext/bar.py + ("from flask.ext import baz; baz.", "Baz"), # flask_baz/__init__.py + ("from flask.ext import moo; moo.", "Moo"), # flaskext/moo/__init__.py + ("from flask.ext.", "foo"), + ("from flask.ext.", "bar"), + ("from flask.ext.", "baz"), + ("from flask.ext.", "moo"), + pytest.param("import flask.ext.foo; flask.ext.foo.", "Foo", marks=pytest.mark.xfail), + pytest.param("import flask.ext.bar; flask.ext.bar.", "Foo", marks=pytest.mark.xfail), + pytest.param("import flask.ext.baz; flask.ext.baz.", "Foo", marks=pytest.mark.xfail), + pytest.param("import flask.ext.moo; flask.ext.moo.", "Foo", marks=pytest.mark.xfail), +]) +def test_flask_ext(Script, code, name): + """flask.ext.foo is really imported from flaskext.foo or flask_foo. + """ + path = os.path.join(os.path.dirname(__file__), 'flask-site-packages') + completions = Script(code, sys_path=[path]).completions() + assert name in [c.name for c in completions] + + +@cwd_at('test/test_evaluate/') +def test_not_importable_file(Script): + src = 'import not_importable_file as x; x.' + assert not Script(src, path='example.py').completions() + + +def test_import_unique(Script): + src = "import os; os.path" + defs = Script(src, path='example.py').goto_definitions() + parent_contexts = [d._name._context for d in defs] + assert len(parent_contexts) == len(set(parent_contexts)) + + +def test_cache_works_with_sys_path_param(Script, tmpdir): + foo_path = tmpdir.join('foo') + bar_path = tmpdir.join('bar') + foo_path.join('module.py').write('foo = 123', ensure=True) + bar_path.join('module.py').write('bar = 123', ensure=True) + foo_completions = Script('import module; module.', + sys_path=[foo_path.strpath]).completions() + bar_completions = Script('import module; module.', + sys_path=[bar_path.strpath]).completions() + assert 'foo' in [c.name for c in foo_completions] + assert 'bar' not in [c.name for c in foo_completions] + + assert 'bar' in [c.name for c in bar_completions] + assert 'foo' not in [c.name for c in bar_completions] + + +def test_import_completion_docstring(Script): + import abc + s = Script('"""test"""\nimport ab') + abc_completions = [c for c in s.completions() if c.name == 'abc'] + assert len(abc_completions) == 1 + assert abc_completions[0].docstring(fast=False) == abc.__doc__ + + # However for performance reasons not all modules are loaded and the + # docstring is empty in this case. + assert abc_completions[0].docstring() == '' + + +def test_goto_definition_on_import(Script): + assert Script("import sys_blabla", 1, 8).goto_definitions() == [] + assert len(Script("import sys", 1, 8).goto_definitions()) == 1 + + +@cwd_at('jedi') +def test_complete_on_empty_import(Script): + assert Script("from datetime import").completions()[0].name == 'import' + # should just list the files in the directory + assert 10 < len(Script("from .", path='whatever.py').completions()) < 30 + + # Global import + assert len(Script("from . import", 1, 5, 'whatever.py').completions()) > 30 + # relative import + assert 10 < len(Script("from . import", 1, 6, 'whatever.py').completions()) < 30 + + # Global import + assert len(Script("from . import classes", 1, 5, 'whatever.py').completions()) > 30 + # relative import + assert 10 < len(Script("from . import classes", 1, 6, 'whatever.py').completions()) < 30 + + wanted = {'ImportError', 'import', 'ImportWarning'} + assert {c.name for c in Script("import").completions()} == wanted + assert len(Script("import import", path='').completions()) > 0 + + # 111 + assert Script("from datetime import").completions()[0].name == 'import' + assert Script("from datetime import ").completions() + + +def test_imports_on_global_namespace_without_path(Script): + """If the path is None, there shouldn't be any import problem""" + completions = Script("import operator").completions() + assert [c.name for c in completions] == ['operator'] + completions = Script("import operator", path='example.py').completions() + assert [c.name for c in completions] == ['operator'] + + # the first one has a path the second doesn't + completions = Script("import keyword", path='example.py').completions() + assert [c.name for c in completions] == ['keyword'] + completions = Script("import keyword").completions() + assert [c.name for c in completions] == ['keyword'] + + +def test_named_import(Script): + """named import - jedi-vim issue #8""" + s = "import time as dt" + assert len(Script(s, 1, 15, '/').goto_definitions()) == 1 + assert len(Script(s, 1, 10, '/').goto_definitions()) == 1 + + +@pytest.mark.skipif('True', reason='The nested import stuff is still very messy.') +def test_goto_following_on_imports(Script): + s = "import multiprocessing.dummy; multiprocessing.dummy" + g = Script(s).goto_assignments() + assert len(g) == 1 + assert (g[0].line, g[0].column) != (0, 0) + + +def test_goto_assignments(Script): + sys, = Script("import sys", 1, 10).goto_assignments(follow_imports=True) + assert sys.type == 'module' + + +def test_os_after_from(Script): + def check(source, result, column=None): + completions = Script(source, column=column).completions() + assert [c.name for c in completions] == result + + check('\nfrom os. ', ['path']) + check('\nfrom os ', ['import']) + check('from os ', ['import']) + check('\nfrom os import whatever', ['import'], len('from os im')) + + check('from os\\\n', ['import']) + check('from os \\\n', ['import']) + + +def test_os_issues(Script): + def import_names(*args, **kwargs): + return [d.name for d in Script(*args, **kwargs).completions()] + + # Github issue #759 + s = 'import os, s' + assert 'sys' in import_names(s) + assert 'path' not in import_names(s, column=len(s) - 1) + assert 'os' in import_names(s, column=len(s) - 3) + + # Some more checks + s = 'from os import path, e' + assert 'environ' in import_names(s) + assert 'json' not in import_names(s, column=len(s) - 1) + assert 'environ' in import_names(s, column=len(s) - 1) + assert 'path' in import_names(s, column=len(s) - 3) + + +def test_path_issues(Script): + """ + See pull request #684 for details. + """ + source = '''from datetime import ''' + assert Script(source).completions() + + +def test_compiled_import_none(monkeypatch, Script): + """ + Related to #1079. An import might somehow fail and return None. + """ + script = Script('import sys') + monkeypatch.setattr(compiled, 'load_module', lambda *args, **kwargs: None) + def_, = script.goto_definitions() + assert def_.type == 'module' + context, = def_._name.infer() + assert not _stub_to_python_context_set(context) + + +@pytest.mark.parametrize( + ('path', 'is_package', 'goal'), [ + (os.path.join(THIS_DIR, 'test_docstring.py'), False, ('ok', 'lala', 'test_imports')), + (os.path.join(THIS_DIR, '__init__.py'), True, ('ok', 'lala', 'x', 'test_imports')), + ] +) +def test_get_modules_containing_name(evaluator, path, goal, is_package): + module = imports._load_python_module( + evaluator, + FileIO(path), + import_names=('ok', 'lala', 'x'), + is_package=is_package, + ) + assert module + input_module, found_module = imports.get_modules_containing_name( + evaluator, + [module], + 'string_that_only_exists_here' + ) + assert input_module is module + assert found_module.string_names == goal + + +@pytest.mark.parametrize( + ('path', 'base_names', 'is_package', 'names'), [ + ('/foo/bar.py', ('foo',), False, ('foo', 'bar')), + ('/foo/bar.py', ('foo', 'baz'), False, ('foo', 'baz', 'bar')), + ('/foo/__init__.py', ('foo',), True, ('foo',)), + ('/__init__.py', ('foo',), True, ('foo',)), + ('/foo/bar/__init__.py', ('foo',), True, ('foo',)), + ('/foo/bar/__init__.py', ('foo', 'bar'), True, ('foo', 'bar')), + ] +) +def test_load_module_from_path(evaluator, path, base_names, is_package, names): + file_io = KnownContentFileIO(path, '') + m = imports._load_module_from_path(evaluator, file_io, base_names) + assert m.is_package == is_package + assert m.string_names == names + + +@pytest.mark.parametrize( + 'path', ('api/whatever/test_this.py', 'api/whatever/file')) +@pytest.mark.parametrize('empty_sys_path', (False, True)) +def test_relative_imports_with_multiple_similar_directories(Script, path, empty_sys_path): + dir = get_example_dir('issue1209') + if empty_sys_path: + project = Project(dir, sys_path=(), smart_sys_path=False) + else: + project = Project(dir) + script = Script( + "from . ", + path=os.path.join(dir, path), + _project=project, + ) + name, import_ = script.completions() + assert import_.name == 'import' + assert name.name == 'api_test1' + + +def test_relative_imports_with_outside_paths(Script): + dir = get_example_dir('issue1209') + project = Project(dir, sys_path=[], smart_sys_path=False) + script = Script( + "from ...", + path=os.path.join(dir, 'api/whatever/test_this.py'), + _project=project, + ) + assert [c.name for c in script.completions()] == ['api', 'import', 'whatever'] + + script = Script( + "from " + '.' * 100, + path=os.path.join(dir, 'api/whatever/test_this.py'), + _project=project, + ) + assert [c.name for c in script.completions()] == ['import'] + + +@cwd_at('test/examples/issue1209/api/whatever/') +def test_relative_imports_without_path(Script): + project = Project('.', sys_path=[], smart_sys_path=False) + script = Script("from . ", _project=project) + assert [c.name for c in script.completions()] == ['api_test1', 'import'] + + script = Script("from .. ", _project=project) + assert [c.name for c in script.completions()] == ['import', 'whatever'] + + script = Script("from ... ", _project=project) + assert [c.name for c in script.completions()] == ['api', 'import', 'whatever'] + + +def test_relative_import_out_of_file_system(Script): + script = Script("from " + '.' * 100) + import_, = script.completions() + assert import_.name == 'import' + + script = Script("from " + '.' * 100 + 'abc import ABCMeta') + assert not script.goto_definitions() + assert not script.completions() + + +@pytest.mark.parametrize( + 'level, directory, project_path, result', [ + (1, '/a/b/c', '/a', (['b', 'c'], '/a')), + (2, '/a/b/c', '/a', (['b'], '/a')), + (3, '/a/b/c', '/a', ([], '/a')), + (4, '/a/b/c', '/a', (None, '/')), + (5, '/a/b/c', '/a', (None, None)), + (1, '/', '/', ([], '/')), + (2, '/', '/', (None, None)), + (1, '/a/b', '/a/b/c', (None, '/a/b')), + (2, '/a/b', '/a/b/c', (None, '/a')), + (3, '/a/b', '/a/b/c', (None, '/')), + ] +) +def test_level_to_import_path(level, directory, project_path, result): + assert imports._level_to_base_import_path(project_path, directory, level) == result + + +def test_import_name_calculation(Script): + s = Script(path=os.path.join(test_dir, 'completion', 'isinstance.py')) + m = s._get_module() + assert m.string_names == ('test', 'completion', 'isinstance') + + +@pytest.mark.parametrize('name', ('builtins', 'typing')) +def test_pre_defined_imports_module(Script, environment, name): + if environment.version_info.major < 3 and name == 'builtins': + name = '__builtin__' + + path = os.path.join(root_dir, name + '.py') + module = Script('', path=path)._get_module() + assert module.string_names == (name,) + + assert module.evaluator.builtins_module.py__file__() != path + assert module.evaluator.typing_module.py__file__() != path + + +@pytest.mark.parametrize('name', ('builtins', 'typing')) +def test_import_needed_modules_by_jedi(Script, environment, tmpdir, name): + if environment.version_info.major < 3 and name == 'builtins': + name = '__builtin__' + + module_path = tmpdir.join(name + '.py') + module_path.write('int = ...') + script = Script( + 'import ' + name, + path=tmpdir.join('something.py').strpath, + sys_path=[tmpdir.strpath] + environment.get_sys_path(), + ) + module, = script.goto_definitions() + assert module._evaluator.builtins_module.py__file__() != module_path + assert module._evaluator.typing_module.py__file__() != module_path + + +def test_import_with_semicolon(Script): + names = [c.name for c in Script('xzy; from abc import ').completions()] + assert 'ABCMeta' in names + assert 'abc' not in names + + +def test_relative_import_star(Script): + # Coming from github #1235 + import jedi + + source = """ + from . import * + furl.c + """ + script = jedi.Script(source, 3, len("furl.c"), 'export.py') + + assert script.completions() diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/test_literals.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/test_literals.py new file mode 100644 index 0000000..dd72f8e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/test_literals.py @@ -0,0 +1,46 @@ +import pytest +from jedi.evaluate.context import TreeInstance + + +def _eval_literal(Script, code, is_fstring=False): + def_, = Script(code).goto_definitions() + if is_fstring: + assert def_.name == 'str' + assert isinstance(def_._name._context, TreeInstance) + return '' + else: + return def_._name._context.get_safe_value() + + +def test_f_strings(Script, environment): + """ + f literals are not really supported in Jedi. They just get ignored and an + empty string is returned. + """ + if environment.version_info < (3, 6): + pytest.skip() + + assert _eval_literal(Script, 'f"asdf"', is_fstring=True) == '' + assert _eval_literal(Script, 'f"{asdf} "', is_fstring=True) == '' + assert _eval_literal(Script, 'F"{asdf} "', is_fstring=True) == '' + assert _eval_literal(Script, 'rF"{asdf} "', is_fstring=True) == '' + + +def test_rb_strings(Script, environment): + assert _eval_literal(Script, 'br"asdf"') == b'asdf' + obj = _eval_literal(Script, 'rb"asdf"') + + # rb is not valid in Python 2. Due to error recovery we just get a + # string. + assert obj == b'asdf' + + +def test_thousand_separators(Script, environment): + if environment.version_info < (3, 6): + pytest.skip() + + assert _eval_literal(Script, '1_2_3') == 123 + assert _eval_literal(Script, '123_456_789') == 123456789 + assert _eval_literal(Script, '0x3_4') == 52 + assert _eval_literal(Script, '0b1_0') == 2 + assert _eval_literal(Script, '0o1_0') == 8 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/test_mixed.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/test_mixed.py new file mode 100644 index 0000000..5940fe6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/test_mixed.py @@ -0,0 +1,7 @@ +import jedi + + +def test_on_code(): + from functools import wraps + i = jedi.Interpreter("wraps.__code__", [{'wraps':wraps}]) + assert i.goto_definitions() diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/test_namespace_package.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/test_namespace_package.py new file mode 100644 index 0000000..1b15658 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/test_namespace_package.py @@ -0,0 +1,96 @@ +from os.path import dirname, join + +import pytest +import py + +from ..helpers import get_example_dir + + +SYS_PATH = [join(dirname(__file__), d) + for d in ['namespace_package/ns1', 'namespace_package/ns2']] + + +def script_with_path(Script, *args, **kwargs): + return Script(sys_path=SYS_PATH, *args, **kwargs) + + +def test_goto_definition(Script): + assert script_with_path(Script, 'from pkg import ns1_file').goto_definitions() + assert script_with_path(Script, 'from pkg import ns2_file').goto_definitions() + assert not script_with_path(Script, 'from pkg import ns3_file').goto_definitions() + + +@pytest.mark.parametrize( + ('source', 'solution'), [ + ('from pkg.ns2_folder.nested import foo', 'nested!'), + ('from pkg.ns2_folder import foo', 'ns2_folder!'), + ('from pkg.ns2_file import foo', 'ns2_file!'), + ('from pkg.ns1_folder import foo', 'ns1_folder!'), + ('from pkg.ns1_file import foo', 'ns1_file!'), + ('from pkg import foo', 'ns1!'), + ] +) +def test_goto_assignment(Script, source, solution): + ass = script_with_path(Script, source).goto_assignments() + assert len(ass) == 1 + assert ass[0].description == "foo = '%s'" % solution + + +def test_simple_completions(Script): + # completion + completions = script_with_path(Script, 'from pkg import ').completions() + names = [str(c.name) for c in completions] # str because of unicode + compare = ['foo', 'ns1_file', 'ns1_folder', 'ns2_folder', 'ns2_file', + 'pkg_resources', 'pkgutil', '__name__', '__path__', + '__package__', '__file__', '__doc__'] + # must at least contain these items, other items are not important + assert set(compare) == set(names) + + +@pytest.mark.parametrize( + ('source', 'solution'), [ + ('from pkg import ns2_folder as x', 'ns2_folder!'), + ('from pkg import ns2_file as x', 'ns2_file!'), + ('from pkg.ns2_folder import nested as x', 'nested!'), + ('from pkg import ns1_folder as x', 'ns1_folder!'), + ('from pkg import ns1_file as x', 'ns1_file!'), + ('import pkg as x', 'ns1!'), + ] +) +def test_completions(Script, source, solution): + for c in script_with_path(Script, source + '; x.').completions(): + if c.name == 'foo': + completion = c + solution = "foo = '%s'" % solution + assert completion.description == solution + + +def test_nested_namespace_package(Script): + code = 'from nested_namespaces.namespace.pkg import CONST' + + sys_path = [dirname(__file__)] + + script = Script(sys_path=sys_path, source=code, line=1, column=45) + + result = script.goto_definitions() + + assert len(result) == 1 + + +def test_relative_import(Script, environment, tmpdir): + """ + Attempt a relative import in a very simple namespace package. + """ + if environment.version_info < (3, 4): + pytest.skip() + + directory = get_example_dir('namespace_package_relative_import') + # Need to copy the content in a directory where there's no __init__.py. + py.path.local(directory).copy(tmpdir) + file_path = join(tmpdir.strpath, "rel1.py") + script = Script(path=file_path, line=1) + d, = script.goto_definitions() + assert d.name == 'int' + d, = script.goto_assignments() + assert d.name == 'name' + assert d.module_name == 'rel2' diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/test_precedence.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/test_precedence.py new file mode 100644 index 0000000..2e97119 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/test_precedence.py @@ -0,0 +1,18 @@ +from jedi.evaluate.compiled import CompiledObject + +import pytest + + +@pytest.mark.parametrize('source', [ + pytest.param('1 == 1'), + pytest.param('1.0 == 1'), + # Unfortunately for now not possible, because it's a typeshed object. + pytest.param('... == ...', marks=pytest.mark.xfail), +]) +def test_equals(Script, environment, source): + if environment.version_info.major < 3: + pytest.skip("Ellipsis does not exists in 2") + script = Script(source) + node = script._module_node.children[0] + first, = script._get_module().eval_node(node) + assert isinstance(first, CompiledObject) and first.get_safe_value() is True diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/test_pyc.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/test_pyc.py new file mode 100644 index 0000000..3744957 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/test_pyc.py @@ -0,0 +1,73 @@ +""" +Test completions from *.pyc files: + + - generate a dummy python module + - compile the dummy module to generate a *.pyc + - delete the pure python dummy module + - try jedi on the generated *.pyc +""" +import os +import shutil +import sys + +import pytest + +import jedi +from jedi.api.environment import SameEnvironment, InterpreterEnvironment + + +SRC = """class Foo: + pass + +class Bar: + pass +""" + + +@pytest.fixture +def pyc_project_path(tmpdir): + path = tmpdir.strpath + dummy_package_path = os.path.join(path, "dummy_package") + os.mkdir(dummy_package_path) + with open(os.path.join(dummy_package_path, "__init__.py"), 'w'): + pass + + dummy_path = os.path.join(dummy_package_path, 'dummy.py') + with open(dummy_path, 'w') as f: + f.write(SRC) + import compileall + compileall.compile_file(dummy_path) + os.remove(dummy_path) + + if sys.version_info.major == 3: + # Python3 specific: + # To import pyc modules, we must move them out of the __pycache__ + # directory and rename them to remove ".cpython-%s%d" + # see: http://stackoverflow.com/questions/11648440/python-does-not-detect-pyc-files + pycache = os.path.join(dummy_package_path, "__pycache__") + for f in os.listdir(pycache): + dst = f.replace('.cpython-%s%s' % sys.version_info[:2], "") + dst = os.path.join(dummy_package_path, dst) + shutil.copy(os.path.join(pycache, f), dst) + try: + yield path + finally: + shutil.rmtree(path) + + +def test_pyc(pyc_project_path, environment): + """ + The list of completion must be greater than 2. + """ + path = os.path.join(pyc_project_path, 'blub.py') + if not isinstance(environment, InterpreterEnvironment): + # We are using the same version for pyc completions here, because it + # was compiled in that version. However with interpreter environments + # we also have the same version and it's easier to debug. + environment = SameEnvironment() + environment = environment + s = jedi.Script( + "from dummy_package import dummy; dummy.", + path=path, + environment=environment) + assert len(s.completions()) >= 2 diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/test_representation.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/test_representation.py new file mode 100644 index 0000000..6113023 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/test_representation.py @@ -0,0 +1,34 @@ +from textwrap import dedent + + +def get_definition_and_evaluator(Script, source): + first, = Script(dedent(source)).goto_definitions() + return first._name._context, first._evaluator + + +def test_function_execution(Script): + """ + We've been having an issue of a mutable list that was changed inside the + function execution. Test if an execution always returns the same result. + """ + + s = """ + def x(): + return str() + x""" + func, evaluator = get_definition_and_evaluator(Script, s) + # Now just use the internals of the result (easiest way to get a fully + # usable function). + # Should return the same result both times. + assert len(func.execute_evaluated()) == 1 + assert len(func.execute_evaluated()) == 1 + + +def test_class_mro(Script): + s = """ + class X(object): + pass + X""" + cls, evaluator = get_definition_and_evaluator(Script, s) + mro = cls.py__mro__() + assert [c.name.string_name for c in mro] == ['X', 'object'] diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/test_signature.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/test_signature.py new file mode 100644 index 0000000..0bb5cba --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/test_signature.py @@ -0,0 +1,268 @@ +from textwrap import dedent +from operator import ge, lt +import re + +import pytest + +from jedi.evaluate.gradual.conversion import _stub_to_python_context_set + + +@pytest.mark.parametrize( + 'code, sig, names, op, version', [ + ('import math; math.cos', 'cos(x, /)', ['x'], ge, (2, 7)), + + ('next', 'next(iterator, default=None, /)', ['iterator', 'default'], ge, (2, 7)), + + ('str', "str(object='', /) -> str", ['object'], ge, (2, 7)), + + ('pow', 'pow(x, y, z=None, /) -> number', ['x', 'y', 'z'], lt, (3, 5)), + ('pow', 'pow(x, y, z=None, /)', ['x', 'y', 'z'], ge, (3, 5)), + + ('bytes.partition', 'partition(self, sep, /) -> (head, sep, tail)', ['self', 'sep'], lt, (3, 5)), + ('bytes.partition', 'partition(self, sep, /)', ['self', 'sep'], ge, (3, 5)), + + ('bytes().partition', 'partition(sep, /) -> (head, sep, tail)', ['sep'], lt, (3, 5)), + ('bytes().partition', 'partition(sep, /)', ['sep'], ge, (3, 5)), + ] +) +def test_compiled_signature(Script, environment, code, sig, names, op, version): + if not op(environment.version_info, version): + return # The test right next to it should take over. + + d, = Script(code).goto_definitions() + context, = d._name.infer() + compiled, = _stub_to_python_context_set(context) + signature, = compiled.get_signatures() + assert signature.to_string() == sig + assert [n.string_name for n in signature.get_param_names()] == names + + +classmethod_code = ''' +class X: + @classmethod + def x(cls, a, b): + pass + + @staticmethod + def static(a, b): + pass +''' + + +partial_code = ''' +import functools + +def func(a, b, c): + pass + +a = functools.partial(func) +b = functools.partial(func, 1) +c = functools.partial(func, 1, c=2) +d = functools.partial() +''' + + +@pytest.mark.parametrize( + 'code, expected', [ + ('def f(a, * args, x): pass\n f(', 'f(a, *args, x)'), + ('def f(a, *, x): pass\n f(', 'f(a, *, x)'), + ('def f(*, x= 3,**kwargs): pass\n f(', 'f(*, x=3, **kwargs)'), + ('def f(x,/,y,* ,z): pass\n f(', 'f(x, /, y, *, z)'), + ('def f(a, /, *, x=3, **kwargs): pass\n f(', 'f(a, /, *, x=3, **kwargs)'), + + (classmethod_code + 'X.x(', 'x(cls, a, b)'), + (classmethod_code + 'X().x(', 'x(cls, a, b)'), + (classmethod_code + 'X.static(', 'static(a, b)'), + (classmethod_code + 'X().static(', 'static(a, b)'), + + (partial_code + 'a(', 'func(a, b, c)'), + (partial_code + 'b(', 'func(b, c)'), + (partial_code + 'c(', 'func(b)'), + (partial_code + 'd(', None), + ] +) +def test_tree_signature(Script, environment, code, expected): + # Only test this in the latest version, because of / + if environment.version_info < (3, 8): + pytest.skip() + + if expected is None: + assert not Script(code).call_signatures() + else: + sig, = Script(code).call_signatures() + assert expected == sig.to_string() + + +@pytest.mark.parametrize( + 'combination, expected', [ + # Functions + ('full_redirect(simple)', 'b, *, c'), + ('full_redirect(simple4)', 'b, x: int'), + ('full_redirect(a)', 'b, *args'), + ('full_redirect(kw)', 'b, *, c, **kwargs'), + ('full_redirect(akw)', 'c, *args, **kwargs'), + + # Non functions + ('full_redirect(lambda x, y: ...)', 'y'), + ('full_redirect()', '*args, **kwargs'), + ('full_redirect(1)', '*args, **kwargs'), + + # Classes / inheritance + ('full_redirect(C)', 'z, *, c'), + ('full_redirect(C())', 'y'), + ('D', 'D(a, z, /)'), + ('D()', 'D(x, y)'), + ('D().foo', 'foo(a, *, bar, z, **kwargs)'), + + # Merging + ('two_redirects(simple, simple)', 'a, b, *, c'), + ('two_redirects(simple2, simple2)', 'x'), + ('two_redirects(akw, kw)', 'a, c, *args, **kwargs'), + ('two_redirects(kw, akw)', 'a, b, *args, c, **kwargs'), + + ('combined_redirect(simple, simple2)', 'a, b, /, *, x'), + ('combined_redirect(simple, simple3)', 'a, b, /, *, a, x: int'), + ('combined_redirect(simple2, simple)', 'x, /, *, a, b, c'), + ('combined_redirect(simple3, simple)', 'a, x: int, /, *, a, b, c'), + + ('combined_redirect(simple, kw)', 'a, b, /, *, a, b, c, **kwargs'), + ('combined_redirect(kw, simple)', 'a, b, /, *, a, b, c'), + + ('combined_lot_of_args(kw, simple4)', '*, b'), + ('combined_lot_of_args(simple4, kw)', '*, b, c, **kwargs'), + + ('combined_redirect(combined_redirect(simple2, simple4), combined_redirect(kw, simple5))', + 'x, /, *, y'), + ('combined_redirect(combined_redirect(simple4, simple2), combined_redirect(simple5, kw))', + 'a, b, x: int, /, *, a, b, c, **kwargs'), + ('combined_redirect(combined_redirect(a, kw), combined_redirect(kw, simple5))', + 'a, b, /, *args, y'), + + ('no_redirect(kw)', '*args, **kwargs'), + ('no_redirect(akw)', '*args, **kwargs'), + ('no_redirect(simple)', '*args, **kwargs'), + ] +) +def test_nested_signatures(Script, environment, combination, expected, skip_pre_python35): + code = dedent(''' + def simple(a, b, *, c): ... + def simple2(x): ... + def simple3(a, x: int): ... + def simple4(a, b, x: int): ... + def simple5(y): ... + def a(a, b, *args): ... + def kw(a, b, *, c, **kwargs): ... + def akw(a, c, *args, **kwargs): ... + + def no_redirect(func): + return lambda *args, **kwargs: func(1) + def full_redirect(func): + return lambda *args, **kwargs: func(1, *args, **kwargs) + def two_redirects(func1, func2): + return lambda *args, **kwargs: func1(*args, **kwargs) + func2(1, *args, **kwargs) + def combined_redirect(func1, func2): + return lambda *args, **kwargs: func1(*args) + func2(**kwargs) + def combined_lot_of_args(func1, func2): + return lambda *args, **kwargs: func1(1, 2, 3, 4, *args) + func2(a=3, x=1, y=1, **kwargs) + + class C: + def __init__(self, a, z, *, c): ... + def __call__(self, x, y): ... + + def foo(self, bar, z, **kwargs): ... + + class D(C): + def __init__(self, *args): + super().__init__(*args) + + def foo(self, a, **kwargs): + super().foo(**kwargs) + ''') + code += 'z = ' + combination + '\nz(' + sig, = Script(code).call_signatures() + computed = sig.to_string() + if not re.match(r'\w+\(', expected): + expected = '(' + expected + ')' + assert expected == computed + + +def test_pow_signature(Script): + # See github #1357 + sigs = Script('pow(').call_signatures() + strings = {sig.to_string() for sig in sigs} + assert strings == {'pow(x: float, y: float, z: float, /) -> float', + 'pow(x: float, y: float, /) -> float', + 'pow(x: int, y: int, z: int, /) -> Any', + 'pow(x: int, y: int, /) -> Any'} + + +@pytest.mark.parametrize( + 'code, signature', [ + [dedent(''' + import functools + def f(x): + pass + def x(f): + @functools.wraps(f) + def wrapper(*args): + # Have no arguments here, but because of wraps, the signature + # should still be f's. + return f(*args) + return wrapper + + x(f)('''), 'f(x, /)'], + [dedent(''' + import functools + def f(x): + pass + def x(f): + @functools.wraps(f) + def wrapper(): + # Have no arguments here, but because of wraps, the signature + # should still be f's. + return 1 + return wrapper + + x(f)('''), 'f()'], + ] +) +def test_wraps_signature(Script, code, signature, skip_pre_python35): + sigs = Script(code).call_signatures() + assert {sig.to_string() for sig in sigs} == {signature} + + +@pytest.mark.parametrize( + 'start, start_params', [ + ['@dataclass\nclass X:', []], + ['@dataclass(eq=True)\nclass X:', []], + [dedent(''' + class Y(): + y: int + @dataclass + class X(Y):'''), []], + [dedent(''' + @dataclass + class Y(): + y: int + z = 5 + @dataclass + class X(Y):'''), ['y']], + ] +) +def test_dataclass_signature(Script, skip_pre_python37, start, start_params): + code = dedent(''' + name: str + foo = 3 + price: float + quantity: int = 0.0 + + X(''') + + code = 'from dataclasses import dataclass\n' + start + code + + sig, = Script(code).call_signatures() + assert [p.name for p in sig.params] == start_params + ['name', 'price', 'quantity'] + quantity, = sig.params[-1].infer() + assert quantity.name == 'int' + price, = sig.params[-2].infer() + assert price.name == 'float' diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/test_stdlib.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/test_stdlib.py new file mode 100644 index 0000000..fb98d8a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/test_stdlib.py @@ -0,0 +1,103 @@ +""" +Tests of various stdlib related things that could not be tested +with "Black Box Tests". +""" +from textwrap import dedent + +import pytest + + +@pytest.mark.parametrize(['letter', 'expected'], [ + ('n', ['name']), + ('s', ['smart']), +]) +def test_namedtuple_str(letter, expected, Script): + source = dedent("""\ + import collections + Person = collections.namedtuple('Person', 'name smart') + dave = Person('Dave', False) + dave.%s""") % letter + result = Script(source).completions() + completions = set(r.name for r in result) + assert completions == set(expected) + + +def test_namedtuple_list(Script): + source = dedent("""\ + import collections + Cat = collections.namedtuple('Person', ['legs', u'length', 'large']) + garfield = Cat(4, '85cm', True) + garfield.l""") + result = Script(source).completions() + completions = set(r.name for r in result) + assert completions == {'legs', 'length', 'large'} + + +def test_namedtuple_content(Script): + source = dedent("""\ + import collections + Foo = collections.namedtuple('Foo', ['bar', 'baz']) + named = Foo(baz=4, bar=3.0) + unnamed = Foo(4, '') + """) + + def d(source): + x, = Script(source).goto_definitions() + return x.name + + assert d(source + 'unnamed.bar') == 'int' + assert d(source + 'unnamed.baz') == 'str' + assert d(source + 'named.bar') == 'float' + assert d(source + 'named.baz') == 'int' + + +def test_nested_namedtuples(Script): + """ + From issue #730. + """ + s = Script(dedent(''' + import collections + Dataset = collections.namedtuple('Dataset', ['data']) + Datasets = collections.namedtuple('Datasets', ['train']) + train_x = Datasets(train=Dataset('data_value')) + train_x.train.''' + )) + assert 'data' in [c.name for c in s.completions()] + + +def test_namedtuple_goto_definitions(Script): + source = dedent(""" + from collections import namedtuple + + Foo = namedtuple('Foo', 'id timestamp gps_timestamp attributes') + Foo""") + + from jedi.api import Script + + d1, = Script(source).goto_definitions() + + assert d1.get_line_code() == "class Foo(tuple):\n" + assert d1.module_path is None + + +def test_re_sub(Script, environment): + """ + This whole test was taken out of completion/stdlib.py, because of the + version differences. + """ + def run(code): + defs = Script(code).goto_definitions() + return {d.name for d in defs} + + names = run("import re; re.sub('a', 'a', 'f')") + if environment.version_info.major == 2: + assert names == {'str'} + else: + assert names == {'str'} + + # This param is missing because of overloading. + names = run("import re; re.sub('a', 'a')") + if environment.version_info.major == 2: + assert names == {'str', 'unicode'} + else: + assert names == {'str', 'bytes'} diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/test_sys_path.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/test_sys_path.py new file mode 100644 index 0000000..deaa64c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/test_sys_path.py @@ -0,0 +1,110 @@ +import os +from glob import glob +import sys +import shutil + +import pytest +from ..helpers import skip_if_windows, skip_if_not_windows + +from jedi.evaluate import sys_path +from jedi.api.environment import create_environment + + +def test_paths_from_assignment(Script): + def paths(src): + script = Script(src, path='/foo/bar.py') + expr_stmt = script._module_node.children[0] + return set(sys_path._paths_from_assignment(script._get_module(), expr_stmt)) + + # Normalize paths for Windows. + path_a = os.path.abspath('/foo/a') + path_b = os.path.abspath('/foo/b') + path_c = os.path.abspath('/foo/c') + + assert paths('sys.path[0:0] = ["a"]') == {path_a} + assert paths('sys.path = ["b", 1, x + 3, y, "c"]') == {path_b, path_c} + assert paths('sys.path = a = ["a"]') == {path_a} + + # Fail for complicated examples. + assert paths('sys.path, other = ["a"], 2') == set() + + +def test_venv_and_pths(venv_path): + pjoin = os.path.join + + CUR_DIR = os.path.dirname(__file__) + site_pkg_path = pjoin(venv_path, 'lib') + if os.name == 'nt': + site_pkg_path = pjoin(site_pkg_path, 'site-packages') + else: + site_pkg_path = glob(pjoin(site_pkg_path, 'python*', 'site-packages'))[0] + shutil.rmtree(site_pkg_path) + shutil.copytree(pjoin(CUR_DIR, 'sample_venvs', 'pth_directory'), site_pkg_path) + + virtualenv = create_environment(venv_path) + venv_paths = virtualenv.get_sys_path() + + ETALON = [ + # For now disable egg-links. I have no idea how they work... ~ dave + #pjoin('/path', 'from', 'egg-link'), + #pjoin(site_pkg_path, '.', 'relative', 'egg-link', 'path'), + site_pkg_path, + pjoin(site_pkg_path, 'dir-from-foo-pth'), + '/foo/smth.py:module', + # Not sure why it's added twice. It has to do with site.py which is not + # something we can change. However this obviously also doesn't matter. + '/foo/smth.py:from_func', + '/foo/smth.py:from_func', + ] + + # Ensure that pth and egg-link paths were added. + assert venv_paths[-len(ETALON):] == ETALON + + # Ensure that none of venv dirs leaked to the interpreter. + assert not set(sys.path).intersection(ETALON) + + +_s = ['/a', '/b', '/c/d/'] + + +@pytest.mark.parametrize( + 'sys_path_, module_path, expected, is_package', [ + (_s, '/a/b', ('b',), False), + (_s, '/a/b/c', ('b', 'c'), False), + (_s, '/a/b.py', ('b',), False), + (_s, '/a/b/c.py', ('b', 'c'), False), + (_s, '/x/b.py', None, False), + (_s, '/c/d/x.py', ('x',), False), + (_s, '/c/d/x.py', ('x',), False), + (_s, '/c/d/x/y.py', ('x', 'y'), False), + # If dots are in there they also resolve. These are obviously illegal + # in Python, but Jedi can handle them. Give the user a bit more freedom + # that he will have to correct eventually. + (_s, '/a/b.c.py', ('b.c',), False), + (_s, '/a/b.d/foo.bar.py', ('b.d', 'foo.bar'), False), + + (_s, '/a/.py', None, False), + (_s, '/a/c/.py', None, False), + + (['/foo'], '/foo/bar/__init__.py', ('bar',), True), + (['/foo'], '/foo/bar/baz/__init__.py', ('bar', 'baz'), True), + + skip_if_windows(['/foo'], '/foo/bar.so', ('bar',), False), + skip_if_windows(['/foo'], '/foo/bar/__init__.so', ('bar',), True), + skip_if_not_windows(['/foo'], '/foo/bar.pyd', ('bar',), False), + skip_if_not_windows(['/foo'], '/foo/bar/__init__.pyd', ('bar',), True), + + (['/foo'], '/x/bar.py', None, False), + (['/foo'], '/foo/bar.xyz', ('bar.xyz',), False), + + (['/foo', '/foo/bar'], '/foo/bar/baz', ('baz',), False), + (['/foo/bar', '/foo'], '/foo/bar/baz', ('baz',), False), + + (['/'], '/bar/baz.py', ('bar', 'baz',), False), + ]) +def test_transform_path_to_dotted(sys_path_, module_path, expected, is_package): + # transform_path_to_dotted expects normalized absolute paths. + sys_path_ = [os.path.abspath(path) for path in sys_path_] + module_path = os.path.abspath(module_path) + assert sys_path.transform_path_to_dotted(sys_path_, module_path) \ + == (expected, is_package) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/zipped_imports/not_pkg.zip b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/zipped_imports/not_pkg.zip new file mode 100644 index 0000000..f1516a6 Binary files /dev/null and b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/zipped_imports/not_pkg.zip differ diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/zipped_imports/pkg.zip b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/zipped_imports/pkg.zip new file mode 100644 index 0000000..0344f74 Binary files /dev/null and b/vim/bundle/jedi-vim/pythonx/jedi/test/test_evaluate/zipped_imports/pkg.zip differ diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_integration.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_integration.py new file mode 100644 index 0000000..04fbd48 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_integration.py @@ -0,0 +1,65 @@ +import os + +import pytest + +from . import helpers + + +def assert_case_equal(case, actual, desired): + """ + Assert ``actual == desired`` with formatted message. + + This is not needed for typical pytest use case, but as we need + ``--assert=plain`` (see ../pytest.ini) to workaround some issue + due to pytest magic, let's format the message by hand. + """ + assert actual == desired, """ +Test %r failed. +actual = %s +desired = %s +""" % (case, actual, desired) + + +def assert_static_analysis(case, actual, desired): + """A nicer formatting for static analysis tests.""" + a = set(actual) + d = set(desired) + assert actual == desired, """ +Test %r failed. +not raised = %s +unspecified = %s +""" % (case, sorted(d - a), sorted(a - d)) + + +def test_completion(case, monkeypatch, environment, has_typing): + skip_reason = case.get_skip_reason(environment) + if skip_reason is not None: + pytest.skip(skip_reason) + + _CONTAINS_TYPING = ('pep0484_typing', 'pep0484_comments', 'pep0526_variables') + if not has_typing and any(x in case.path for x in _CONTAINS_TYPING): + pytest.skip('Needs the typing module installed to run this test.') + repo_root = helpers.root_dir + monkeypatch.chdir(os.path.join(repo_root, 'jedi')) + case.run(assert_case_equal, environment) + + +def test_static_analysis(static_analysis_case, environment): + if static_analysis_case.skip is not None: + pytest.skip(static_analysis_case.skip) + else: + static_analysis_case.run(assert_static_analysis, environment) + + +def test_refactor(refactor_case): + """ + Run refactoring test case. + + :type refactor_case: :class:`.refactor.RefactoringCase` + """ + if 0: + # TODO Refactoring is not relevant at the moment, it will be changed + # significantly in the future, but maybe we can use these tests: + refactor_case.run() + assert_case_equal(refactor_case, + refactor_case.result, refactor_case.desired) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_parso_integration/test_basic.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_parso_integration/test_basic.py new file mode 100644 index 0000000..d1c6daf --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_parso_integration/test_basic.py @@ -0,0 +1,95 @@ +from textwrap import dedent + +import pytest +from parso import parse + + +def test_form_feed_characters(Script): + s = "\f\nclass Test(object):\n pass" + Script(s, line=2, column=18).call_signatures() + + +def check_p(src): + module_node = parse(src) + assert src == module_node.get_code() + return module_node + + +def test_if(Script): + src = dedent('''\ + def func(): + x = 3 + if x: + def y(): + return x + return y() + + func() + ''') + + # Two parsers needed, one for pass and one for the function. + check_p(src) + assert [d.name for d in Script(src, 8, 6).goto_definitions()] == ['int'] + + +def test_class_and_if(Script): + src = dedent("""\ + class V: + def __init__(self): + pass + + if 1: + c = 3 + + def a_func(): + return 1 + + # COMMENT + a_func()""") + check_p(src) + assert [d.name for d in Script(src).goto_definitions()] == ['int'] + + +def test_add_to_end(Script): + """ + The diff parser doesn't parse everything again. It just updates with the + help of caches, this is an example that didn't work. + """ + + a = dedent("""\ + class Abc(): + def abc(self): + self.x = 3 + + class Two(Abc): + def g(self): + self + """) # ^ here is the first completion + + b = " def h(self):\n" \ + " self." + + def complete(code, line=None, column=None): + script = Script(code, line, column, 'example.py') + assert script.completions() + + complete(a, 7, 12) + complete(a + b) + + a = a[:-1] + '.\n' + complete(a, 7, 13) + complete(a + b) + + +def test_tokenizer_with_string_literal_backslash(Script): + c = Script("statement = u'foo\\\n'; statement").goto_definitions() + assert c[0]._name._context.get_safe_value() == 'foo' + + +def test_ellipsis_without_getitem(Script, environment): + if environment.version_info.major == 2: + pytest.skip('In 2.7 Ellipsis can only be used like x[...]') + + def_, = Script('x=...;x').goto_definitions() + + assert def_.name == 'ellipsis' diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_parso_integration/test_error_correction.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_parso_integration/test_error_correction.py new file mode 100644 index 0000000..6ab1697 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_parso_integration/test_error_correction.py @@ -0,0 +1,50 @@ +from textwrap import dedent + + +def test_error_correction_with(Script): + source = """ + with open() as f: + try: + f.""" + comps = Script(source).completions() + assert len(comps) > 30 + # `open` completions have a closed attribute. + assert [1 for c in comps if c.name == 'closed'] + + +def test_string_literals(Script): + """Simplified case of jedi-vim#377.""" + source = dedent(""" + x = ur''' + + def foo(): + pass + """) + + script = Script(dedent(source)) + assert script._get_module().tree_node.end_pos == (6, 0) + assert script.completions() + + +def test_incomplete_function(Script): + source = '''return ImportErr''' + + script = Script(dedent(source), 1, 3) + assert script.completions() + + +def test_decorator_string_issue(Script): + """ + Test case from #589 + """ + source = dedent('''\ + """ + @""" + def bla(): + pass + + bla.''') + + s = Script(source) + assert s.completions() + assert s._get_module().tree_node.get_code() == source diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_parso_integration/test_parser_utils.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_parso_integration/test_parser_utils.py new file mode 100644 index 0000000..c085710 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_parso_integration/test_parser_utils.py @@ -0,0 +1,86 @@ +# -*- coding: utf-8 -*- +from jedi._compatibility import is_py3 +from jedi import parser_utils +from parso import parse +from parso.python import tree + +import pytest + + +class TestCallAndName: + def get_call(self, source): + # Get the simple_stmt and then the first one. + node = parse(source).children[0] + if node.type == 'simple_stmt': + return node.children[0] + return node + + def test_name_and_call_positions(self): + name = self.get_call('name\nsomething_else') + assert name.value == 'name' + assert name.start_pos == (1, 0) + assert name.end_pos == (1, 4) + + leaf = self.get_call('1.0\n') + assert leaf.value == '1.0' + assert parser_utils.safe_literal_eval(leaf.value) == 1.0 + assert leaf.start_pos == (1, 0) + assert leaf.end_pos == (1, 3) + + def test_call_type(self): + call = self.get_call('hello') + assert isinstance(call, tree.Name) + + def test_literal_type(self): + literal = self.get_call('1.0') + assert isinstance(literal, tree.Literal) + assert type(parser_utils.safe_literal_eval(literal.value)) == float + + literal = self.get_call('1') + assert isinstance(literal, tree.Literal) + assert type(parser_utils.safe_literal_eval(literal.value)) == int + + literal = self.get_call('"hello"') + assert isinstance(literal, tree.Literal) + assert parser_utils.safe_literal_eval(literal.value) == 'hello' + + +def test_user_statement_on_import(): + """github #285""" + s = "from datetime import (\n" \ + " time)" + + for pos in [(2, 1), (2, 4)]: + p = parse(s) + stmt = parser_utils.get_statement_of_position(p, pos) + assert isinstance(stmt, tree.Import) + assert [n.value for n in stmt.get_defined_names()] == ['time'] + + +def test_hex_values_in_docstring(): + source = r''' + def foo(object): + """ + \xff + """ + return 1 + ''' + + doc = parser_utils.clean_scope_docstring(next(parse(source).iter_funcdefs())) + if is_py3: + assert doc == '\xff' + else: + assert doc == u'�' + + +@pytest.mark.parametrize( + 'code,call_signature', [ + ('def my_function(x, typed: Type, z):\n return', 'my_function(x, typed: Type, z)'), + ('def my_function(x, y, z) -> str:\n return', 'my_function(x, y, z) -> str'), + ('lambda x, y, z: x + y * z\n', '(x, y, z)') + ]) +def test_get_call_signature(code, call_signature): + node = parse(code, version='3.5').children[0] + if node.type == 'simple_stmt': + node = node.children[0] + assert parser_utils.get_call_signature(node) == call_signature diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_settings.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_settings.py new file mode 100644 index 0000000..e97b2fa --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_settings.py @@ -0,0 +1,34 @@ +import pytest + +from jedi import settings +from jedi.evaluate.names import ContextName +from jedi.evaluate.compiled import CompiledContextName +from jedi.evaluate.gradual.typeshed import StubModuleContext + + +@pytest.fixture() +def auto_import_json(monkeypatch): + monkeypatch.setattr(settings, 'auto_import_modules', ['json']) + + +def test_base_auto_import_modules(auto_import_json, Script): + loads, = Script('import json; json.loads').goto_definitions() + assert isinstance(loads._name, ContextName) + context, = loads._name.infer() + assert isinstance(context.parent_context, StubModuleContext) + + +def test_auto_import_modules_imports(auto_import_json, Script): + main, = Script('from json import tool; tool.main').goto_definitions() + assert isinstance(main._name, CompiledContextName) + + +def test_additional_dynamic_modules(monkeypatch, Script): + # We could add further tests, but for now it's even more important that + # this doesn't fail. + monkeypatch.setattr( + settings, + 'additional_dynamic_modules', + ['/foo/bar/jedi_not_existing_file.py'] + ) + assert not Script('def some_func(f):\n f.').completions() diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_speed.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_speed.py new file mode 100644 index 0000000..ba5784a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_speed.py @@ -0,0 +1,73 @@ +""" +Speed tests of Jedi. To prove that certain things don't take longer than they +should. +""" + +import time +import functools + +from .helpers import cwd_at +import jedi + + +def _check_speed(time_per_run, number=4, run_warm=True): + """ Speed checks should typically be very tolerant. Some machines are + faster than others, but the tests should still pass. These tests are + here to assure that certain effects that kill jedi performance are not + reintroduced to Jedi.""" + def decorated(func): + @functools.wraps(func) + def wrapper(Script, **kwargs): + if run_warm: + func(Script=Script, **kwargs) + first = time.time() + for i in range(number): + func(Script=Script, **kwargs) + single_time = (time.time() - first) / number + message = 'speed issue %s, %s' % (func, single_time) + assert single_time < time_per_run, message + return wrapper + return decorated + + +@_check_speed(0.5) +def test_os_path_join(Script): + s = "from posixpath import join; join('', '')." + assert len(Script(s).completions()) > 10 # is a str completion + + +@_check_speed(0.15) +def test_scipy_speed(Script): + s = 'import scipy.weave; scipy.weave.inline(' + script = Script(s, 1, len(s), '') + script.call_signatures() + + +@_check_speed(0.8) +@cwd_at('test') +def test_precedence_slowdown(Script): + """ + Precedence calculation can slow down things significantly in edge + cases. Having strange recursion structures increases the problem. + """ + with open('speed/precedence.py') as f: + line = len(f.read().splitlines()) + assert Script(line=line, path='speed/precedence.py').goto_definitions() + + +@_check_speed(0.1) +def test_no_repr_computation(Script): + """ + For Interpreter completion aquisition of sourcefile can trigger + unwanted computation of repr(). Exemple : big pandas data. + See issue #919. + """ + class SlowRepr: + "class to test what happens if __repr__ is very slow." + def some_method(self): + pass + + def __repr__(self): + time.sleep(0.2) + test = SlowRepr() + jedi.Interpreter('test.som', [locals()]).completions() diff --git a/vim/bundle/jedi-vim/pythonx/jedi/test/test_utils.py b/vim/bundle/jedi-vim/pythonx/jedi/test/test_utils.py new file mode 100644 index 0000000..17328a3 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/test/test_utils.py @@ -0,0 +1,115 @@ +try: + import readline +except ImportError: + readline = False + +from jedi import utils + +from .helpers import unittest, cwd_at + + +@unittest.skipIf(not readline, "readline not found") +class TestSetupReadline(unittest.TestCase): + class NameSpace(object): + pass + + def __init__(self, *args, **kwargs): + super(type(self), self).__init__(*args, **kwargs) + + self.namespace = self.NameSpace() + utils.setup_readline(self.namespace) + + def completions(self, text): + completer = readline.get_completer() + i = 0 + completions = [] + while True: + completion = completer(text, i) + if completion is None: + break + completions.append(completion) + i += 1 + return completions + + def test_simple(self): + assert self.completions('list') == ['list'] + assert self.completions('importerror') == ['ImportError'] + s = "print(BaseE" + assert self.completions(s) == [s + 'xception'] + + def test_nested(self): + assert self.completions('list.Insert') == ['list.insert'] + assert self.completions('list().Insert') == ['list().insert'] + + def test_magic_methods(self): + assert self.completions('list.__getitem__') == ['list.__getitem__'] + assert self.completions('list().__getitem__') == ['list().__getitem__'] + + def test_modules(self): + import sys + import os + self.namespace.sys = sys + self.namespace.os = os + + try: + assert self.completions('os.path.join') == ['os.path.join'] + string = 'os.path.join("a").upper' + assert self.completions(string) == [string] + + c = {'os.' + d for d in dir(os) if d.startswith('ch')} + assert set(self.completions('os.ch')) == set(c) + finally: + del self.namespace.sys + del self.namespace.os + + def test_calls(self): + s = 'str(bytes' + assert self.completions(s) == [s, 'str(BytesWarning'] + + def test_import(self): + s = 'from os.path import a' + assert set(self.completions(s)) == {s + 'ltsep', s + 'bspath'} + assert self.completions('import keyword') == ['import keyword'] + + import os + s = 'from os import ' + goal = {s + el for el in dir(os)} + # There are minor differences, e.g. the dir doesn't include deleted + # items as well as items that are not only available on linux. + difference = set(self.completions(s)).symmetric_difference(goal) + difference = {x for x in difference if not x.startswith('from os import _')} + # There are quite a few differences, because both Windows and Linux + # (posix and nt) libraries are included. + assert len(difference) < 38 + + @cwd_at('test') + def test_local_import(self): + s = 'import test_utils' + assert self.completions(s) == [s] + + def test_preexisting_values(self): + self.namespace.a = range(10) + assert set(self.completions('a.')) == {'a.' + n for n in dir(range(1))} + del self.namespace.a + + def test_colorama(self): + """ + Only test it if colorama library is available. + + This module is being tested because it uses ``setattr`` at some point, + which Jedi doesn't understand, but it should still work in the REPL. + """ + try: + # if colorama is installed + import colorama + except ImportError: + pass + else: + self.namespace.colorama = colorama + assert self.completions('colorama') + assert self.completions('colorama.Fore.BLACK') == ['colorama.Fore.BLACK'] + del self.namespace.colorama + + +def test_version_info(): + assert utils.version_info()[:2] > (0, 7) diff --git a/vim/bundle/jedi-vim/pythonx/jedi/tox.ini b/vim/bundle/jedi-vim/pythonx/jedi/tox.ini new file mode 100644 index 0000000..e5cac2e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/jedi/tox.ini @@ -0,0 +1,39 @@ +[tox] +envlist = py27, py34, py35, py36, py37 +[testenv] +extras = testing +deps = +# for testing the typing module + py27: typing + py34: typing +# numpydoc for typing scipy stack + numpydoc +# sphinx, a dependency of numpydoc, dropped Python 2 support in version 2.0 + sphinx < 2.0 + cov: coverage +# Overwrite the parso version (only used sometimes). + git+https://github.com/davidhalter/parso.git +passenv = JEDI_TEST_ENVIRONMENT +setenv = +# https://github.com/tomchristie/django-rest-framework/issues/1957 +# tox corrupts __pycache__, solution from here: + PYTHONDONTWRITEBYTECODE=1 +# Enable all warnings. + PYTHONWARNINGS=always +# To test Jedi in different versions than the same Python version, set a +# different test environment. + env27: JEDI_TEST_ENVIRONMENT=27 + env34: JEDI_TEST_ENVIRONMENT=34 + env35: JEDI_TEST_ENVIRONMENT=35 + env36: JEDI_TEST_ENVIRONMENT=36 + env37: JEDI_TEST_ENVIRONMENT=37 +commands = + pytest {posargs} +[testenv:cov] +commands = + coverage run --source jedi -m pytest + coverage report +[testenv:sith] +commands = + {envpython} -c "import os; a='{envtmpdir}'; os.path.exists(a) or os.makedirs(a)" + {envpython} sith.py --record {envtmpdir}/record.json random {posargs:jedi} diff --git a/vim/bundle/jedi-vim/pythonx/parso/.coveragerc b/vim/bundle/jedi-vim/pythonx/parso/.coveragerc new file mode 100644 index 0000000..c022851 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/.coveragerc @@ -0,0 +1,11 @@ +[run] +source = parso + +[report] +# Regexes for lines to exclude from consideration +exclude_lines = + # Don't complain about missing debug-only code: + def __repr__ + + # Don't complain if non-runnable code isn't run: + if __name__ == .__main__.: diff --git a/vim/bundle/jedi-vim/pythonx/parso/.travis.yml b/vim/bundle/jedi-vim/pythonx/parso/.travis.yml new file mode 100644 index 0000000..9be70c4 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/.travis.yml @@ -0,0 +1,25 @@ +dist: xenial +language: python +python: + - 2.7 + - 3.4 + - 3.5 + - 3.6 + - 3.7 + - 3.8-dev + - pypy2.7-6.0 + - pypy3.5-6.0 +matrix: + include: + - python: 3.5 + env: TOXENV=py35-coverage +install: + - pip install --quiet tox-travis +script: + - tox +after_script: + - | + if [ "${TOXENV%-coverage}" == "$TOXENV" ]; then + pip install --quiet coveralls; + coveralls; + fi diff --git a/vim/bundle/jedi-vim/pythonx/parso/AUTHORS.txt b/vim/bundle/jedi-vim/pythonx/parso/AUTHORS.txt new file mode 100644 index 0000000..e16c04c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/AUTHORS.txt @@ -0,0 +1,54 @@ +Main Authors +============ + +David Halter (@davidhalter) + +Code Contributors +================= +Alisdair Robertson (@robodair) + + +Code Contributors (to Jedi and therefore possibly to this library) +================================================================== + +Takafumi Arakaki (@tkf) +Danilo Bargen (@dbrgn) +Laurens Van Houtven (@lvh) <_@lvh.cc> +Aldo Stracquadanio (@Astrac) +Jean-Louis Fuchs (@ganwell) +tek (@tek) +Yasha Borevich (@jjay) +Aaron Griffin +andviro (@andviro) +Mike Gilbert (@floppym) +Aaron Meurer (@asmeurer) +Lubos Trilety +Akinori Hattori (@hattya) +srusskih (@srusskih) +Steven Silvester (@blink1073) +Colin Duquesnoy (@ColinDuquesnoy) +Jorgen Schaefer (@jorgenschaefer) +Fredrik Bergroth (@fbergroth) +Mathias Fußenegger (@mfussenegger) +Syohei Yoshida (@syohex) +ppalucky (@ppalucky) +immerrr (@immerrr) immerrr@gmail.com +Albertas Agejevas (@alga) +Savor d'Isavano (@KenetJervet) +Phillip Berndt (@phillipberndt) +Ian Lee (@IanLee1521) +Farkhad Khatamov (@hatamov) +Kevin Kelley (@kelleyk) +Sid Shanker (@squidarth) +Reinoud Elhorst (@reinhrst) +Guido van Rossum (@gvanrossum) +Dmytro Sadovnychyi (@sadovnychyi) +Cristi Burcă (@scribu) +bstaint (@bstaint) +Mathias Rav (@Mortal) +Daniel Fiterman (@dfit99) +Simon Ruggier (@sruggier) +Élie Gouzien (@ElieGouzien) + + +Note: (@user) means a github user name. diff --git a/vim/bundle/jedi-vim/pythonx/parso/CHANGELOG.rst b/vim/bundle/jedi-vim/pythonx/parso/CHANGELOG.rst new file mode 100644 index 0000000..a02b191 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/CHANGELOG.rst @@ -0,0 +1,77 @@ +.. :changelog: + +Changelog +--------- + +0.5.1 (2019-07-13) +++++++++++++++++++ + +- Fix: Some unicode identifiers were not correctly tokenized +- Fix: Line continuations in f-strings are now working + +0.5.0 (2019-06-20) +++++++++++++++++++ + +- **Breaking Change** comp_for is now called sync_comp_for for all Python + versions to be compatible with the Python 3.8 Grammar +- Added .pyi stubs for a lot of the parso API +- Small FileIO changes + +0.4.0 (2019-04-05) +++++++++++++++++++ + +- Python 3.8 support +- FileIO support, it's now possible to use abstract file IO, support is alpha + +0.3.4 (2019-02-13) ++++++++++++++++++++ + +- Fix an f-string tokenizer error + +0.3.3 (2019-02-06) ++++++++++++++++++++ + +- Fix async errors in the diff parser +- A fix in iter_errors +- This is a very small bugfix release + +0.3.2 (2019-01-24) ++++++++++++++++++++ + +- 20+ bugfixes in the diff parser and 3 in the tokenizer +- A fuzzer for the diff parser, to give confidence that the diff parser is in a + good shape. +- Some bugfixes for f-string + +0.3.1 (2018-07-09) ++++++++++++++++++++ + +- Bugfixes in the diff parser and keyword-only arguments + +0.3.0 (2018-06-30) ++++++++++++++++++++ + +- Rewrote the pgen2 parser generator. + +0.2.1 (2018-05-21) ++++++++++++++++++++ + +- A bugfix for the diff parser. +- Grammar files can now be loaded from a specific path. + +0.2.0 (2018-04-15) ++++++++++++++++++++ + +- f-strings are now parsed as a part of the normal Python grammar. This makes + it way easier to deal with them. + +0.1.1 (2017-11-05) ++++++++++++++++++++ + +- Fixed a few bugs in the caching layer +- Added support for Python 3.7 + +0.1.0 (2017-09-04) ++++++++++++++++++++ + +- Pulling the library out of Jedi. Some APIs will definitely change. diff --git a/vim/bundle/jedi-vim/pythonx/parso/CONTRIBUTING.md b/vim/bundle/jedi-vim/pythonx/parso/CONTRIBUTING.md new file mode 100644 index 0000000..60aa841 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/CONTRIBUTING.md @@ -0,0 +1,8 @@ +We <3 Pull Requests! Three core things: + + 1. If you are adding functionality or fixing a bug, please add a test! + 2. Add your name to AUTHORS.txt + 3. Use the PEP8 style guide. + + If you want to add methods to the parser tree, we will need to discuss this in + an issue first. diff --git a/vim/bundle/jedi-vim/pythonx/parso/LICENSE.txt b/vim/bundle/jedi-vim/pythonx/parso/LICENSE.txt new file mode 100644 index 0000000..08c41db --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/LICENSE.txt @@ -0,0 +1,86 @@ +All contributions towards parso are MIT licensed. + +Some Python files have been taken from the standard library and are therefore +PSF licensed. Modifications on these files are dual licensed (both MIT and +PSF). These files are: + +- parso/pgen2/* +- parso/tokenize.py +- parso/token.py +- test/test_pgen2.py + +Also some test files under test/normalizer_issue_files have been copied from +https://github.com/PyCQA/pycodestyle (Expat License == MIT License). + +------------------------------------------------------------------------------- +The MIT License (MIT) + +Copyright (c) <2013-2017> + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +------------------------------------------------------------------------------- + +PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2 +-------------------------------------------- + +1. This LICENSE AGREEMENT is between the Python Software Foundation +("PSF"), and the Individual or Organization ("Licensee") accessing and +otherwise using this software ("Python") in source or binary form and +its associated documentation. + +2. Subject to the terms and conditions of this License Agreement, PSF hereby +grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, +analyze, test, perform and/or display publicly, prepare derivative works, +distribute, and otherwise use Python alone or in any derivative version, +provided, however, that PSF's License Agreement and PSF's notice of copyright, +i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +2011, 2012, 2013, 2014, 2015 Python Software Foundation; All Rights Reserved" +are retained in Python alone or in any derivative version prepared by Licensee. + +3. In the event Licensee prepares a derivative work that is based on +or incorporates Python or any part thereof, and wants to make +the derivative work available to others as provided herein, then +Licensee hereby agrees to include in any such work a brief summary of +the changes made to Python. + +4. PSF is making Python available to Licensee on an "AS IS" +basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. + +5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON +FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS +A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON, +OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +6. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +7. Nothing in this License Agreement shall be deemed to create any +relationship of agency, partnership, or joint venture between PSF and +Licensee. This License Agreement does not grant permission to use PSF +trademarks or trade name in a trademark sense to endorse or promote +products or services of Licensee, or any third party. + +8. By copying, installing or otherwise using Python, Licensee +agrees to be bound by the terms and conditions of this License +Agreement. diff --git a/vim/bundle/jedi-vim/pythonx/parso/MANIFEST.in b/vim/bundle/jedi-vim/pythonx/parso/MANIFEST.in new file mode 100644 index 0000000..fb90b35 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/MANIFEST.in @@ -0,0 +1,12 @@ +include README.rst +include CHANGELOG.rst +include LICENSE.txt +include AUTHORS.txt +include .coveragerc +include conftest.py +include pytest.ini +include tox.ini +include parso/python/grammar*.txt +recursive-include test * +recursive-include docs * +recursive-exclude * *.pyc diff --git a/vim/bundle/jedi-vim/pythonx/parso/README.rst b/vim/bundle/jedi-vim/pythonx/parso/README.rst new file mode 100644 index 0000000..1056ea6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/README.rst @@ -0,0 +1,91 @@ +################################################################### +parso - A Python Parser +################################################################### + + +.. image:: https://travis-ci.org/davidhalter/parso.svg?branch=master + :target: https://travis-ci.org/davidhalter/parso + :alt: Travis CI build status + +.. image:: https://coveralls.io/repos/github/davidhalter/parso/badge.svg?branch=master + :target: https://coveralls.io/github/davidhalter/parso?branch=master + :alt: Coverage Status + +.. image:: https://raw.githubusercontent.com/davidhalter/parso/master/docs/_static/logo_characters.png + +Parso is a Python parser that supports error recovery and round-trip parsing +for different Python versions (in multiple Python versions). Parso is also able +to list multiple syntax errors in your python file. + +Parso has been battle-tested by jedi_. It was pulled out of jedi to be useful +for other projects as well. + +Parso consists of a small API to parse Python and analyse the syntax tree. + +A simple example: + +.. code-block:: python + + >>> import parso + >>> module = parso.parse('hello + 1', version="3.6") + >>> expr = module.children[0] + >>> expr + PythonNode(arith_expr, [, , ]) + >>> print(expr.get_code()) + hello + 1 + >>> name = expr.children[0] + >>> name + + >>> name.end_pos + (1, 5) + >>> expr.end_pos + (1, 9) + +To list multiple issues: + +.. code-block:: python + + >>> grammar = parso.load_grammar() + >>> module = grammar.parse('foo +\nbar\ncontinue') + >>> error1, error2 = grammar.iter_errors(module) + >>> error1.message + 'SyntaxError: invalid syntax' + >>> error2.message + "SyntaxError: 'continue' not properly in loop" + +Resources +========= + +- `Testing `_ +- `PyPI `_ +- `Docs `_ +- Uses `semantic versioning `_ + +Installation +============ + + pip install parso + +Future +====== + +- There will be better support for refactoring and comments. Stay tuned. +- There's a WIP PEP8 validator. It's however not in a good shape, yet. + +Known Issues +============ + +- `async`/`await` are already used as keywords in Python3.6. +- `from __future__ import print_function` is not ignored. + + +Acknowledgements +================ + +- Guido van Rossum (@gvanrossum) for creating the parser generator pgen2 + (originally used in lib2to3). +- `Salome Schneider `_ + for the extremely awesome parso logo. + + +.. _jedi: https://github.com/davidhalter/jedi diff --git a/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/__init__.py b/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/__init__.py new file mode 100644 index 0000000..a16a72f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/__init__.py @@ -0,0 +1,58 @@ +r""" +Parso is a Python parser that supports error recovery and round-trip parsing +for different Python versions (in multiple Python versions). Parso is also able +to list multiple syntax errors in your python file. + +Parso has been battle-tested by jedi_. It was pulled out of jedi to be useful +for other projects as well. + +Parso consists of a small API to parse Python and analyse the syntax tree. + +.. _jedi: https://github.com/davidhalter/jedi + +A simple example: + +>>> import parso +>>> module = parso.parse('hello + 1', version="3.6") +>>> expr = module.children[0] +>>> expr +PythonNode(arith_expr, [, , ]) +>>> print(expr.get_code()) +hello + 1 +>>> name = expr.children[0] +>>> name + +>>> name.end_pos +(1, 5) +>>> expr.end_pos +(1, 9) + +To list multiple issues: + +>>> grammar = parso.load_grammar() +>>> module = grammar.parse('foo +\nbar\ncontinue') +>>> error1, error2 = grammar.iter_errors(module) +>>> error1.message +'SyntaxError: invalid syntax' +>>> error2.message +"SyntaxError: 'continue' not properly in loop" +""" + +from parso.parser import ParserSyntaxError +from parso.grammar import Grammar, load_grammar +from parso.utils import split_lines, python_bytes_to_unicode + + +__version__ = '0.5.1' + + +def parse(code=None, **kwargs): + """ + A utility function to avoid loading grammars. + Params are documented in :py:meth:`parso.Grammar.parse`. + + :param str version: The version used by :py:func:`parso.load_grammar`. + """ + version = kwargs.pop('version', None) + grammar = load_grammar(version=version) + return grammar.parse(code, **kwargs) diff --git a/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/_compatibility.py b/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/_compatibility.py new file mode 100644 index 0000000..db411ee --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/_compatibility.py @@ -0,0 +1,103 @@ +""" +To ensure compatibility from Python ``2.6`` - ``3.3``, a module has been +created. Clearly there is huge need to use conforming syntax. +""" +import sys +import platform + +# Cannot use sys.version.major and minor names, because in Python 2.6 it's not +# a namedtuple. +py_version = int(str(sys.version_info[0]) + str(sys.version_info[1])) + +# unicode function +try: + unicode = unicode +except NameError: + unicode = str + +is_pypy = platform.python_implementation() == 'PyPy' + + +def use_metaclass(meta, *bases): + """ Create a class with a metaclass. """ + if not bases: + bases = (object,) + return meta("HackClass", bases, {}) + + +try: + encoding = sys.stdout.encoding + if encoding is None: + encoding = 'utf-8' +except AttributeError: + encoding = 'ascii' + + +def u(string): + """Cast to unicode DAMMIT! + Written because Python2 repr always implicitly casts to a string, so we + have to cast back to a unicode (and we know that we always deal with valid + unicode, because we check that in the beginning). + """ + if py_version >= 30: + return str(string) + + if not isinstance(string, unicode): + return unicode(str(string), 'UTF-8') + return string + + +try: + FileNotFoundError = FileNotFoundError +except NameError: + FileNotFoundError = IOError + + +def utf8_repr(func): + """ + ``__repr__`` methods in Python 2 don't allow unicode objects to be + returned. Therefore cast them to utf-8 bytes in this decorator. + """ + def wrapper(self): + result = func(self) + if isinstance(result, unicode): + return result.encode('utf-8') + else: + return result + + if py_version >= 30: + return func + else: + return wrapper + + +try: + from functools import total_ordering +except ImportError: + # Python 2.6 + def total_ordering(cls): + """Class decorator that fills in missing ordering methods""" + convert = { + '__lt__': [('__gt__', lambda self, other: not (self < other or self == other)), + ('__le__', lambda self, other: self < other or self == other), + ('__ge__', lambda self, other: not self < other)], + '__le__': [('__ge__', lambda self, other: not self <= other or self == other), + ('__lt__', lambda self, other: self <= other and not self == other), + ('__gt__', lambda self, other: not self <= other)], + '__gt__': [('__lt__', lambda self, other: not (self > other or self == other)), + ('__ge__', lambda self, other: self > other or self == other), + ('__le__', lambda self, other: not self > other)], + '__ge__': [('__le__', lambda self, other: (not self >= other) or self == other), + ('__gt__', lambda self, other: self >= other and not self == other), + ('__lt__', lambda self, other: not self >= other)] + } + roots = set(dir(cls)) & set(convert) + if not roots: + raise ValueError('must define at least one ordering operation: < > <= >=') + root = max(roots) # prefer __lt__ to __le__ to __gt__ to __ge__ + for opname, opfunc in convert[root]: + if opname not in roots: + opfunc.__name__ = opname + opfunc.__doc__ = getattr(int, opname).__doc__ + setattr(cls, opname, opfunc) + return cls diff --git a/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/cache.py b/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/cache.py new file mode 100644 index 0000000..1f8d886 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/cache.py @@ -0,0 +1,169 @@ +import time +import os +import sys +import hashlib +import gc +import shutil +import platform +import errno +import logging + +try: + import cPickle as pickle +except: + import pickle + +from parso._compatibility import FileNotFoundError + +LOG = logging.getLogger(__name__) + + +_PICKLE_VERSION = 32 +""" +Version number (integer) for file system cache. + +Increment this number when there are any incompatible changes in +the parser tree classes. For example, the following changes +are regarded as incompatible. + +- A class name is changed. +- A class is moved to another module. +- A __slot__ of a class is changed. +""" + +_VERSION_TAG = '%s-%s%s-%s' % ( + platform.python_implementation(), + sys.version_info[0], + sys.version_info[1], + _PICKLE_VERSION +) +""" +Short name for distinguish Python implementations and versions. + +It's like `sys.implementation.cache_tag` but for Python < 3.3 +we generate something similar. See: +http://docs.python.org/3/library/sys.html#sys.implementation +""" + + +def _get_default_cache_path(): + if platform.system().lower() == 'windows': + dir_ = os.path.join(os.getenv('LOCALAPPDATA') or '~', 'Parso', 'Parso') + elif platform.system().lower() == 'darwin': + dir_ = os.path.join('~', 'Library', 'Caches', 'Parso') + else: + dir_ = os.path.join(os.getenv('XDG_CACHE_HOME') or '~/.cache', 'parso') + return os.path.expanduser(dir_) + + +_default_cache_path = _get_default_cache_path() +""" +The path where the cache is stored. + +On Linux, this defaults to ``~/.cache/parso/``, on OS X to +``~/Library/Caches/Parso/`` and on Windows to ``%LOCALAPPDATA%\\Parso\\Parso\\``. +On Linux, if environment variable ``$XDG_CACHE_HOME`` is set, +``$XDG_CACHE_HOME/parso`` is used instead of the default one. +""" + +parser_cache = {} + + +class _NodeCacheItem(object): + def __init__(self, node, lines, change_time=None): + self.node = node + self.lines = lines + if change_time is None: + change_time = time.time() + self.change_time = change_time + + +def load_module(hashed_grammar, file_io, cache_path=None): + """ + Returns a module or None, if it fails. + """ + p_time = file_io.get_last_modified() + if p_time is None: + return None + + try: + module_cache_item = parser_cache[hashed_grammar][file_io.path] + if p_time <= module_cache_item.change_time: + return module_cache_item.node + except KeyError: + return _load_from_file_system( + hashed_grammar, + file_io.path, + p_time, + cache_path=cache_path + ) + + +def _load_from_file_system(hashed_grammar, path, p_time, cache_path=None): + cache_path = _get_hashed_path(hashed_grammar, path, cache_path=cache_path) + try: + try: + if p_time > os.path.getmtime(cache_path): + # Cache is outdated + return None + except OSError as e: + if e.errno == errno.ENOENT: + # In Python 2 instead of an IOError here we get an OSError. + raise FileNotFoundError + else: + raise + + with open(cache_path, 'rb') as f: + gc.disable() + try: + module_cache_item = pickle.load(f) + finally: + gc.enable() + except FileNotFoundError: + return None + else: + parser_cache.setdefault(hashed_grammar, {})[path] = module_cache_item + LOG.debug('pickle loaded: %s', path) + return module_cache_item.node + + +def save_module(hashed_grammar, file_io, module, lines, pickling=True, cache_path=None): + path = file_io.path + try: + p_time = None if path is None else file_io.get_last_modified() + except OSError: + p_time = None + pickling = False + + item = _NodeCacheItem(module, lines, p_time) + parser_cache.setdefault(hashed_grammar, {})[path] = item + if pickling and path is not None: + _save_to_file_system(hashed_grammar, path, item, cache_path=cache_path) + + +def _save_to_file_system(hashed_grammar, path, item, cache_path=None): + with open(_get_hashed_path(hashed_grammar, path, cache_path=cache_path), 'wb') as f: + pickle.dump(item, f, pickle.HIGHEST_PROTOCOL) + + +def clear_cache(cache_path=None): + if cache_path is None: + cache_path = _default_cache_path + shutil.rmtree(cache_path) + parser_cache.clear() + + +def _get_hashed_path(hashed_grammar, path, cache_path=None): + directory = _get_cache_directory_path(cache_path=cache_path) + + file_hash = hashlib.sha256(path.encode("utf-8")).hexdigest() + return os.path.join(directory, '%s-%s.pkl' % (hashed_grammar, file_hash)) + + +def _get_cache_directory_path(cache_path=None): + if cache_path is None: + cache_path = _default_cache_path + directory = os.path.join(cache_path, _VERSION_TAG) + if not os.path.exists(directory): + os.makedirs(directory) + return directory diff --git a/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/file_io.py b/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/file_io.py new file mode 100644 index 0000000..94fe08e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/file_io.py @@ -0,0 +1,35 @@ +import os + + +class FileIO(object): + def __init__(self, path): + self.path = path + + def read(self): # Returns bytes/str + # We would like to read unicode here, but we cannot, because we are not + # sure if it is a valid unicode file. Therefore just read whatever is + # here. + with open(self.path, 'rb') as f: + return f.read() + + def get_last_modified(self): + """ + Returns float - timestamp or None, if path doesn't exist. + """ + try: + return os.path.getmtime(self.path) + except OSError: + # Might raise FileNotFoundError, OSError for Python 2 + return None + + def __repr__(self): + return '%s(%s)' % (self.__class__.__name__, self.path) + + +class KnownContentFileIO(FileIO): + def __init__(self, path, content): + super(KnownContentFileIO, self).__init__(path) + self._content = content + + def read(self): + return self._content diff --git a/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/grammar.py b/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/grammar.py new file mode 100644 index 0000000..41bbe20 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/grammar.py @@ -0,0 +1,256 @@ +import hashlib +import os + +from parso._compatibility import FileNotFoundError, is_pypy +from parso.pgen2 import generate_grammar +from parso.utils import split_lines, python_bytes_to_unicode, parse_version_string +from parso.python.diff import DiffParser +from parso.python.tokenize import tokenize_lines, tokenize +from parso.python.token import PythonTokenTypes +from parso.cache import parser_cache, load_module, save_module +from parso.parser import BaseParser +from parso.python.parser import Parser as PythonParser +from parso.python.errors import ErrorFinderConfig +from parso.python import pep8 +from parso.file_io import FileIO, KnownContentFileIO + +_loaded_grammars = {} + + +class Grammar(object): + """ + :py:func:`parso.load_grammar` returns instances of this class. + + Creating custom none-python grammars by calling this is not supported, yet. + """ + #:param text: A BNF representation of your grammar. + _error_normalizer_config = None + _token_namespace = None + _default_normalizer_config = pep8.PEP8NormalizerConfig() + + def __init__(self, text, tokenizer, parser=BaseParser, diff_parser=None): + self._pgen_grammar = generate_grammar( + text, + token_namespace=self._get_token_namespace() + ) + self._parser = parser + self._tokenizer = tokenizer + self._diff_parser = diff_parser + self._hashed = hashlib.sha256(text.encode("utf-8")).hexdigest() + + def parse(self, code=None, **kwargs): + """ + If you want to parse a Python file you want to start here, most likely. + + If you need finer grained control over the parsed instance, there will be + other ways to access it. + + :param str code: A unicode or bytes string. When it's not possible to + decode bytes to a string, returns a + :py:class:`UnicodeDecodeError`. + :param bool error_recovery: If enabled, any code will be returned. If + it is invalid, it will be returned as an error node. If disabled, + you will get a ParseError when encountering syntax errors in your + code. + :param str start_symbol: The grammar rule (nonterminal) that you want + to parse. Only allowed to be used when error_recovery is False. + :param str path: The path to the file you want to open. Only needed for caching. + :param bool cache: Keeps a copy of the parser tree in RAM and on disk + if a path is given. Returns the cached trees if the corresponding + files on disk have not changed. Note that this stores pickle files + on your file system (e.g. for Linux in ``~/.cache/parso/``). + :param bool diff_cache: Diffs the cached python module against the new + code and tries to parse only the parts that have changed. Returns + the same (changed) module that is found in cache. Using this option + requires you to not do anything anymore with the cached modules + under that path, because the contents of it might change. This + option is still somewhat experimental. If you want stability, + please don't use it. + :param bool cache_path: If given saves the parso cache in this + directory. If not given, defaults to the default cache places on + each platform. + + :return: A subclass of :py:class:`parso.tree.NodeOrLeaf`. Typically a + :py:class:`parso.python.tree.Module`. + """ + if 'start_pos' in kwargs: + raise TypeError("parse() got an unexpected keyword argument.") + return self._parse(code=code, **kwargs) + + def _parse(self, code=None, error_recovery=True, path=None, + start_symbol=None, cache=False, diff_cache=False, + cache_path=None, file_io=None, start_pos=(1, 0)): + """ + Wanted python3.5 * operator and keyword only arguments. Therefore just + wrap it all. + start_pos here is just a parameter internally used. Might be public + sometime in the future. + """ + if code is None and path is None and file_io is None: + raise TypeError("Please provide either code or a path.") + + if start_symbol is None: + start_symbol = self._start_nonterminal + + if error_recovery and start_symbol != 'file_input': + raise NotImplementedError("This is currently not implemented.") + + if file_io is None: + if code is None: + file_io = FileIO(path) + else: + file_io = KnownContentFileIO(path, code) + + if cache and file_io.path is not None: + module_node = load_module(self._hashed, file_io, cache_path=cache_path) + if module_node is not None: + return module_node + + if code is None: + code = file_io.read() + code = python_bytes_to_unicode(code) + + lines = split_lines(code, keepends=True) + if diff_cache: + if self._diff_parser is None: + raise TypeError("You have to define a diff parser to be able " + "to use this option.") + try: + module_cache_item = parser_cache[self._hashed][file_io.path] + except KeyError: + pass + else: + module_node = module_cache_item.node + old_lines = module_cache_item.lines + if old_lines == lines: + return module_node + + new_node = self._diff_parser( + self._pgen_grammar, self._tokenizer, module_node + ).update( + old_lines=old_lines, + new_lines=lines + ) + save_module(self._hashed, file_io, new_node, lines, + # Never pickle in pypy, it's slow as hell. + pickling=cache and not is_pypy, + cache_path=cache_path) + return new_node + + tokens = self._tokenizer(lines, start_pos) + + p = self._parser( + self._pgen_grammar, + error_recovery=error_recovery, + start_nonterminal=start_symbol + ) + root_node = p.parse(tokens=tokens) + + if cache or diff_cache: + save_module(self._hashed, file_io, root_node, lines, + # Never pickle in pypy, it's slow as hell. + pickling=cache and not is_pypy, + cache_path=cache_path) + return root_node + + def _get_token_namespace(self): + ns = self._token_namespace + if ns is None: + raise ValueError("The token namespace should be set.") + return ns + + def iter_errors(self, node): + """ + Given a :py:class:`parso.tree.NodeOrLeaf` returns a generator of + :py:class:`parso.normalizer.Issue` objects. For Python this is + a list of syntax/indentation errors. + """ + if self._error_normalizer_config is None: + raise ValueError("No error normalizer specified for this grammar.") + + return self._get_normalizer_issues(node, self._error_normalizer_config) + + def _get_normalizer(self, normalizer_config): + if normalizer_config is None: + normalizer_config = self._default_normalizer_config + if normalizer_config is None: + raise ValueError("You need to specify a normalizer, because " + "there's no default normalizer for this tree.") + return normalizer_config.create_normalizer(self) + + def _normalize(self, node, normalizer_config=None): + """ + TODO this is not public, yet. + The returned code will be normalized, e.g. PEP8 for Python. + """ + normalizer = self._get_normalizer(normalizer_config) + return normalizer.walk(node) + + def _get_normalizer_issues(self, node, normalizer_config=None): + normalizer = self._get_normalizer(normalizer_config) + normalizer.walk(node) + return normalizer.issues + + def __repr__(self): + nonterminals = self._pgen_grammar.nonterminal_to_dfas.keys() + txt = ' '.join(list(nonterminals)[:3]) + ' ...' + return '<%s:%s>' % (self.__class__.__name__, txt) + + +class PythonGrammar(Grammar): + _error_normalizer_config = ErrorFinderConfig() + _token_namespace = PythonTokenTypes + _start_nonterminal = 'file_input' + + def __init__(self, version_info, bnf_text): + super(PythonGrammar, self).__init__( + bnf_text, + tokenizer=self._tokenize_lines, + parser=PythonParser, + diff_parser=DiffParser + ) + self.version_info = version_info + + def _tokenize_lines(self, lines, start_pos): + return tokenize_lines(lines, self.version_info, start_pos=start_pos) + + def _tokenize(self, code): + # Used by Jedi. + return tokenize(code, self.version_info) + + +def load_grammar(**kwargs): + """ + Loads a :py:class:`parso.Grammar`. The default version is the current Python + version. + + :param str version: A python version string, e.g. ``version='3.3'``. + :param str path: A path to a grammar file + """ + def load_grammar(language='python', version=None, path=None): + if language == 'python': + version_info = parse_version_string(version) + + file = path or os.path.join( + 'python', + 'grammar%s%s.txt' % (version_info.major, version_info.minor) + ) + + global _loaded_grammars + path = os.path.join(os.path.dirname(__file__), file) + try: + return _loaded_grammars[path] + except KeyError: + try: + with open(path) as f: + bnf_text = f.read() + + grammar = PythonGrammar(version_info, bnf_text) + return _loaded_grammars.setdefault(path, grammar) + except FileNotFoundError: + message = "Python version %s is currently not supported." % version + raise NotImplementedError(message) + else: + raise NotImplementedError("No support for language %s." % language) + + return load_grammar(**kwargs) diff --git a/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/normalizer.py b/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/normalizer.py new file mode 100644 index 0000000..b076fe5 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/normalizer.py @@ -0,0 +1,183 @@ +from contextlib import contextmanager + +from parso._compatibility import use_metaclass + + +class _NormalizerMeta(type): + def __new__(cls, name, bases, dct): + new_cls = type.__new__(cls, name, bases, dct) + new_cls.rule_value_classes = {} + new_cls.rule_type_classes = {} + return new_cls + + +class Normalizer(use_metaclass(_NormalizerMeta)): + def __init__(self, grammar, config): + self.grammar = grammar + self._config = config + self.issues = [] + + self._rule_type_instances = self._instantiate_rules('rule_type_classes') + self._rule_value_instances = self._instantiate_rules('rule_value_classes') + + def _instantiate_rules(self, attr): + dct = {} + for base in type(self).mro(): + rules_map = getattr(base, attr, {}) + for type_, rule_classes in rules_map.items(): + new = [rule_cls(self) for rule_cls in rule_classes] + dct.setdefault(type_, []).extend(new) + return dct + + def walk(self, node): + self.initialize(node) + value = self.visit(node) + self.finalize() + return value + + def visit(self, node): + try: + children = node.children + except AttributeError: + return self.visit_leaf(node) + else: + with self.visit_node(node): + return ''.join(self.visit(child) for child in children) + + @contextmanager + def visit_node(self, node): + self._check_type_rules(node) + yield + + def _check_type_rules(self, node): + for rule in self._rule_type_instances.get(node.type, []): + rule.feed_node(node) + + def visit_leaf(self, leaf): + self._check_type_rules(leaf) + + for rule in self._rule_value_instances.get(leaf.value, []): + rule.feed_node(leaf) + + return leaf.prefix + leaf.value + + def initialize(self, node): + pass + + def finalize(self): + pass + + def add_issue(self, node, code, message): + issue = Issue(node, code, message) + if issue not in self.issues: + self.issues.append(issue) + return True + + @classmethod + def register_rule(cls, **kwargs): + """ + Use it as a class decorator:: + + normalizer = Normalizer('grammar', 'config') + @normalizer.register_rule(value='foo') + class MyRule(Rule): + error_code = 42 + """ + return cls._register_rule(**kwargs) + + @classmethod + def _register_rule(cls, value=None, values=(), type=None, types=()): + values = list(values) + types = list(types) + if value is not None: + values.append(value) + if type is not None: + types.append(type) + + if not values and not types: + raise ValueError("You must register at least something.") + + def decorator(rule_cls): + for v in values: + cls.rule_value_classes.setdefault(v, []).append(rule_cls) + for t in types: + cls.rule_type_classes.setdefault(t, []).append(rule_cls) + return rule_cls + + return decorator + + +class NormalizerConfig(object): + normalizer_class = Normalizer + + def create_normalizer(self, grammar): + if self.normalizer_class is None: + return None + + return self.normalizer_class(grammar, self) + + +class Issue(object): + def __init__(self, node, code, message): + self._node = node + self.code = code + """ + An integer code that stands for the type of error. + """ + self.message = message + """ + A message (string) for the issue. + """ + self.start_pos = node.start_pos + """ + The start position position of the error as a tuple (line, column). As + always in |parso| the first line is 1 and the first column 0. + """ + + def __eq__(self, other): + return self.start_pos == other.start_pos and self.code == other.code + + def __ne__(self, other): + return not self.__eq__(other) + + def __hash__(self): + return hash((self.code, self.start_pos)) + + def __repr__(self): + return '<%s: %s>' % (self.__class__.__name__, self.code) + + +class Rule(object): + code = None + message = None + + def __init__(self, normalizer): + self._normalizer = normalizer + + def is_issue(self, node): + raise NotImplementedError() + + def get_node(self, node): + return node + + def _get_message(self, message): + if message is None: + message = self.message + if message is None: + raise ValueError("The message on the class is not set.") + return message + + def add_issue(self, node, code=None, message=None): + if code is None: + code = self.code + if code is None: + raise ValueError("The error code on the class is not set.") + + message = self._get_message(message) + + self._normalizer.add_issue(node, code, message) + + def feed_node(self, node): + if self.is_issue(node): + issue_node = self.get_node(node) + self.add_issue(issue_node) diff --git a/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/parser.py b/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/parser.py new file mode 100644 index 0000000..859e3f8 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/parser.py @@ -0,0 +1,211 @@ +# Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved. +# Licensed to PSF under a Contributor Agreement. + +# Modifications: +# Copyright David Halter and Contributors +# Modifications are dual-licensed: MIT and PSF. +# 99% of the code is different from pgen2, now. + +""" +The ``Parser`` tries to convert the available Python code in an easy to read +format, something like an abstract syntax tree. The classes who represent this +tree, are sitting in the :mod:`parso.tree` module. + +The Python module ``tokenize`` is a very important part in the ``Parser``, +because it splits the code into different words (tokens). Sometimes it looks a +bit messy. Sorry for that! You might ask now: "Why didn't you use the ``ast`` +module for this? Well, ``ast`` does a very good job understanding proper Python +code, but fails to work as soon as there's a single line of broken code. + +There's one important optimization that needs to be known: Statements are not +being parsed completely. ``Statement`` is just a representation of the tokens +within the statement. This lowers memory usage and cpu time and reduces the +complexity of the ``Parser`` (there's another parser sitting inside +``Statement``, which produces ``Array`` and ``Call``). +""" +from parso import tree +from parso.pgen2.generator import ReservedString + + +class ParserSyntaxError(Exception): + """ + Contains error information about the parser tree. + + May be raised as an exception. + """ + def __init__(self, message, error_leaf): + self.message = message + self.error_leaf = error_leaf + + +class InternalParseError(Exception): + """ + Exception to signal the parser is stuck and error recovery didn't help. + Basically this shouldn't happen. It's a sign that something is really + wrong. + """ + + def __init__(self, msg, type_, value, start_pos): + Exception.__init__(self, "%s: type=%r, value=%r, start_pos=%r" % + (msg, type_.name, value, start_pos)) + self.msg = msg + self.type = type + self.value = value + self.start_pos = start_pos + + +class Stack(list): + def _allowed_transition_names_and_token_types(self): + def iterate(): + # An API just for Jedi. + for stack_node in reversed(self): + for transition in stack_node.dfa.transitions: + if isinstance(transition, ReservedString): + yield transition.value + else: + yield transition # A token type + + if not stack_node.dfa.is_final: + break + + return list(iterate()) + + +class StackNode(object): + def __init__(self, dfa): + self.dfa = dfa + self.nodes = [] + + @property + def nonterminal(self): + return self.dfa.from_rule + + def __repr__(self): + return '%s(%s, %s)' % (self.__class__.__name__, self.dfa, self.nodes) + + +def _token_to_transition(grammar, type_, value): + # Map from token to label + if type_.contains_syntax: + # Check for reserved words (keywords) + try: + return grammar.reserved_syntax_strings[value] + except KeyError: + pass + + return type_ + + +class BaseParser(object): + """Parser engine. + + A Parser instance contains state pertaining to the current token + sequence, and should not be used concurrently by different threads + to parse separate token sequences. + + See python/tokenize.py for how to get input tokens by a string. + + When a syntax error occurs, error_recovery() is called. + """ + + node_map = {} + default_node = tree.Node + + leaf_map = { + } + default_leaf = tree.Leaf + + def __init__(self, pgen_grammar, start_nonterminal='file_input', error_recovery=False): + self._pgen_grammar = pgen_grammar + self._start_nonterminal = start_nonterminal + self._error_recovery = error_recovery + + def parse(self, tokens): + first_dfa = self._pgen_grammar.nonterminal_to_dfas[self._start_nonterminal][0] + self.stack = Stack([StackNode(first_dfa)]) + + for token in tokens: + self._add_token(token) + + while True: + tos = self.stack[-1] + if not tos.dfa.is_final: + # We never broke out -- EOF is too soon -- Unfinished statement. + # However, the error recovery might have added the token again, if + # the stack is empty, we're fine. + raise InternalParseError( + "incomplete input", token.type, token.value, token.start_pos + ) + + if len(self.stack) > 1: + self._pop() + else: + return self.convert_node(tos.nonterminal, tos.nodes) + + def error_recovery(self, token): + if self._error_recovery: + raise NotImplementedError("Error Recovery is not implemented") + else: + type_, value, start_pos, prefix = token + error_leaf = tree.ErrorLeaf(type_, value, start_pos, prefix) + raise ParserSyntaxError('SyntaxError: invalid syntax', error_leaf) + + def convert_node(self, nonterminal, children): + try: + node = self.node_map[nonterminal](children) + except KeyError: + node = self.default_node(nonterminal, children) + for c in children: + c.parent = node + return node + + def convert_leaf(self, type_, value, prefix, start_pos): + try: + return self.leaf_map[type_](value, start_pos, prefix) + except KeyError: + return self.default_leaf(value, start_pos, prefix) + + def _add_token(self, token): + """ + This is the only core function for parsing. Here happens basically + everything. Everything is well prepared by the parser generator and we + only apply the necessary steps here. + """ + grammar = self._pgen_grammar + stack = self.stack + type_, value, start_pos, prefix = token + transition = _token_to_transition(grammar, type_, value) + + while True: + try: + plan = stack[-1].dfa.transitions[transition] + break + except KeyError: + if stack[-1].dfa.is_final: + self._pop() + else: + self.error_recovery(token) + return + except IndexError: + raise InternalParseError("too much input", type_, value, start_pos) + + stack[-1].dfa = plan.next_dfa + + for push in plan.dfa_pushes: + stack.append(StackNode(push)) + + leaf = self.convert_leaf(type_, value, prefix, start_pos) + stack[-1].nodes.append(leaf) + + def _pop(self): + tos = self.stack.pop() + # If there's exactly one child, return that child instead of + # creating a new node. We still create expr_stmt and + # file_input though, because a lot of Jedi depends on its + # logic. + if len(tos.nodes) == 1: + new_node = tos.nodes[0] + else: + new_node = self.convert_node(tos.dfa.from_rule, tos.nodes) + + self.stack[-1].nodes.append(new_node) diff --git a/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/pgen2/__init__.py b/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/pgen2/__init__.py new file mode 100644 index 0000000..d4d9dcd --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/pgen2/__init__.py @@ -0,0 +1,10 @@ +# Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved. +# Licensed to PSF under a Contributor Agreement. + +# Modifications: +# Copyright 2006 Google, Inc. All Rights Reserved. +# Licensed to PSF under a Contributor Agreement. +# Copyright 2014 David Halter and Contributors +# Modifications are dual-licensed: MIT and PSF. + +from parso.pgen2.generator import generate_grammar diff --git a/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/pgen2/generator.py b/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/pgen2/generator.py new file mode 100644 index 0000000..184afb3 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/pgen2/generator.py @@ -0,0 +1,358 @@ +# Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved. +# Licensed to PSF under a Contributor Agreement. + +# Modifications: +# Copyright David Halter and Contributors +# Modifications are dual-licensed: MIT and PSF. + +""" +This module defines the data structures used to represent a grammar. + +Specifying grammars in pgen is possible with this grammar:: + + grammar: (NEWLINE | rule)* ENDMARKER + rule: NAME ':' rhs NEWLINE + rhs: items ('|' items)* + items: item+ + item: '[' rhs ']' | atom ['+' | '*'] + atom: '(' rhs ')' | NAME | STRING + +This grammar is self-referencing. + +This parser generator (pgen2) was created by Guido Rossum and used for lib2to3. +Most of the code has been refactored to make it more Pythonic. Since this was a +"copy" of the CPython Parser parser "pgen", there was some work needed to make +it more readable. It should also be slightly faster than the original pgen2, +because we made some optimizations. +""" + +from ast import literal_eval + +from parso.pgen2.grammar_parser import GrammarParser, NFAState + + +class Grammar(object): + """ + Once initialized, this class supplies the grammar tables for the + parsing engine implemented by parse.py. The parsing engine + accesses the instance variables directly. + + The only important part in this parsers are dfas and transitions between + dfas. + """ + + def __init__(self, start_nonterminal, rule_to_dfas, reserved_syntax_strings): + self.nonterminal_to_dfas = rule_to_dfas # Dict[str, List[DFAState]] + self.reserved_syntax_strings = reserved_syntax_strings + self.start_nonterminal = start_nonterminal + + +class DFAPlan(object): + """ + Plans are used for the parser to create stack nodes and do the proper + DFA state transitions. + """ + def __init__(self, next_dfa, dfa_pushes=[]): + self.next_dfa = next_dfa + self.dfa_pushes = dfa_pushes + + def __repr__(self): + return '%s(%s, %s)' % (self.__class__.__name__, self.next_dfa, self.dfa_pushes) + + +class DFAState(object): + """ + The DFAState object is the core class for pretty much anything. DFAState + are the vertices of an ordered graph while arcs and transitions are the + edges. + + Arcs are the initial edges, where most DFAStates are not connected and + transitions are then calculated to connect the DFA state machines that have + different nonterminals. + """ + def __init__(self, from_rule, nfa_set, final): + assert isinstance(nfa_set, set) + assert isinstance(next(iter(nfa_set)), NFAState) + assert isinstance(final, NFAState) + self.from_rule = from_rule + self.nfa_set = nfa_set + self.arcs = {} # map from terminals/nonterminals to DFAState + # In an intermediary step we set these nonterminal arcs (which has the + # same structure as arcs). These don't contain terminals anymore. + self.nonterminal_arcs = {} + + # Transitions are basically the only thing that the parser is using + # with is_final. Everyting else is purely here to create a parser. + self.transitions = {} #: Dict[Union[TokenType, ReservedString], DFAPlan] + self.is_final = final in nfa_set + + def add_arc(self, next_, label): + assert isinstance(label, str) + assert label not in self.arcs + assert isinstance(next_, DFAState) + self.arcs[label] = next_ + + def unifystate(self, old, new): + for label, next_ in self.arcs.items(): + if next_ is old: + self.arcs[label] = new + + def __eq__(self, other): + # Equality test -- ignore the nfa_set instance variable + assert isinstance(other, DFAState) + if self.is_final != other.is_final: + return False + # Can't just return self.arcs == other.arcs, because that + # would invoke this method recursively, with cycles... + if len(self.arcs) != len(other.arcs): + return False + for label, next_ in self.arcs.items(): + if next_ is not other.arcs.get(label): + return False + return True + + __hash__ = None # For Py3 compatibility. + + def __repr__(self): + return '<%s: %s is_final=%s>' % ( + self.__class__.__name__, self.from_rule, self.is_final + ) + + +class ReservedString(object): + """ + Most grammars will have certain keywords and operators that are mentioned + in the grammar as strings (e.g. "if") and not token types (e.g. NUMBER). + This class basically is the former. + """ + + def __init__(self, value): + self.value = value + + def __repr__(self): + return '%s(%s)' % (self.__class__.__name__, self.value) + + +def _simplify_dfas(dfas): + """ + This is not theoretically optimal, but works well enough. + Algorithm: repeatedly look for two states that have the same + set of arcs (same labels pointing to the same nodes) and + unify them, until things stop changing. + + dfas is a list of DFAState instances + """ + changes = True + while changes: + changes = False + for i, state_i in enumerate(dfas): + for j in range(i + 1, len(dfas)): + state_j = dfas[j] + if state_i == state_j: + #print " unify", i, j + del dfas[j] + for state in dfas: + state.unifystate(state_j, state_i) + changes = True + break + + +def _make_dfas(start, finish): + """ + Uses the powerset construction algorithm to create DFA states from sets of + NFA states. + + Also does state reduction if some states are not needed. + """ + # To turn an NFA into a DFA, we define the states of the DFA + # to correspond to *sets* of states of the NFA. Then do some + # state reduction. + assert isinstance(start, NFAState) + assert isinstance(finish, NFAState) + + def addclosure(nfa_state, base_nfa_set): + assert isinstance(nfa_state, NFAState) + if nfa_state in base_nfa_set: + return + base_nfa_set.add(nfa_state) + for nfa_arc in nfa_state.arcs: + if nfa_arc.nonterminal_or_string is None: + addclosure(nfa_arc.next, base_nfa_set) + + base_nfa_set = set() + addclosure(start, base_nfa_set) + states = [DFAState(start.from_rule, base_nfa_set, finish)] + for state in states: # NB states grows while we're iterating + arcs = {} + # Find state transitions and store them in arcs. + for nfa_state in state.nfa_set: + for nfa_arc in nfa_state.arcs: + if nfa_arc.nonterminal_or_string is not None: + nfa_set = arcs.setdefault(nfa_arc.nonterminal_or_string, set()) + addclosure(nfa_arc.next, nfa_set) + + # Now create the dfa's with no None's in arcs anymore. All Nones have + # been eliminated and state transitions (arcs) are properly defined, we + # just need to create the dfa's. + for nonterminal_or_string, nfa_set in arcs.items(): + for nested_state in states: + if nested_state.nfa_set == nfa_set: + # The DFA state already exists for this rule. + break + else: + nested_state = DFAState(start.from_rule, nfa_set, finish) + states.append(nested_state) + + state.add_arc(nested_state, nonterminal_or_string) + return states # List of DFAState instances; first one is start + + +def _dump_nfa(start, finish): + print("Dump of NFA for", start.from_rule) + todo = [start] + for i, state in enumerate(todo): + print(" State", i, state is finish and "(final)" or "") + for label, next_ in state.arcs: + if next_ in todo: + j = todo.index(next_) + else: + j = len(todo) + todo.append(next_) + if label is None: + print(" -> %d" % j) + else: + print(" %s -> %d" % (label, j)) + + +def _dump_dfas(dfas): + print("Dump of DFA for", dfas[0].from_rule) + for i, state in enumerate(dfas): + print(" State", i, state.is_final and "(final)" or "") + for nonterminal, next_ in state.arcs.items(): + print(" %s -> %d" % (nonterminal, dfas.index(next_))) + + +def generate_grammar(bnf_grammar, token_namespace): + """ + ``bnf_text`` is a grammar in extended BNF (using * for repetition, + for + at-least-once repetition, [] for optional parts, | for alternatives and () + for grouping). + + It's not EBNF according to ISO/IEC 14977. It's a dialect Python uses in its + own parser. + """ + rule_to_dfas = {} + start_nonterminal = None + for nfa_a, nfa_z in GrammarParser(bnf_grammar).parse(): + #_dump_nfa(a, z) + dfas = _make_dfas(nfa_a, nfa_z) + #_dump_dfas(dfas) + # oldlen = len(dfas) + _simplify_dfas(dfas) + # newlen = len(dfas) + rule_to_dfas[nfa_a.from_rule] = dfas + #print(nfa_a.from_rule, oldlen, newlen) + + if start_nonterminal is None: + start_nonterminal = nfa_a.from_rule + + reserved_strings = {} + for nonterminal, dfas in rule_to_dfas.items(): + for dfa_state in dfas: + for terminal_or_nonterminal, next_dfa in dfa_state.arcs.items(): + if terminal_or_nonterminal in rule_to_dfas: + dfa_state.nonterminal_arcs[terminal_or_nonterminal] = next_dfa + else: + transition = _make_transition( + token_namespace, + reserved_strings, + terminal_or_nonterminal + ) + dfa_state.transitions[transition] = DFAPlan(next_dfa) + + _calculate_tree_traversal(rule_to_dfas) + return Grammar(start_nonterminal, rule_to_dfas, reserved_strings) + + +def _make_transition(token_namespace, reserved_syntax_strings, label): + """ + Creates a reserved string ("if", "for", "*", ...) or returns the token type + (NUMBER, STRING, ...) for a given grammar terminal. + """ + if label[0].isalpha(): + # A named token (e.g. NAME, NUMBER, STRING) + return getattr(token_namespace, label) + else: + # Either a keyword or an operator + assert label[0] in ('"', "'"), label + assert not label.startswith('"""') and not label.startswith("'''") + value = literal_eval(label) + try: + return reserved_syntax_strings[value] + except KeyError: + r = reserved_syntax_strings[value] = ReservedString(value) + return r + + +def _calculate_tree_traversal(nonterminal_to_dfas): + """ + By this point we know how dfas can move around within a stack node, but we + don't know how we can add a new stack node (nonterminal transitions). + """ + # Map from grammar rule (nonterminal) name to a set of tokens. + first_plans = {} + + nonterminals = list(nonterminal_to_dfas.keys()) + nonterminals.sort() + for nonterminal in nonterminals: + if nonterminal not in first_plans: + _calculate_first_plans(nonterminal_to_dfas, first_plans, nonterminal) + + # Now that we have calculated the first terminals, we are sure that + # there is no left recursion or ambiguities. + + for dfas in nonterminal_to_dfas.values(): + for dfa_state in dfas: + for nonterminal, next_dfa in dfa_state.nonterminal_arcs.items(): + for transition, pushes in first_plans[nonterminal].items(): + dfa_state.transitions[transition] = DFAPlan(next_dfa, pushes) + + +def _calculate_first_plans(nonterminal_to_dfas, first_plans, nonterminal): + """ + Calculates the first plan in the first_plans dictionary for every given + nonterminal. This is going to be used to know when to create stack nodes. + """ + dfas = nonterminal_to_dfas[nonterminal] + new_first_plans = {} + first_plans[nonterminal] = None # dummy to detect left recursion + # We only need to check the first dfa. All the following ones are not + # interesting to find first terminals. + state = dfas[0] + for transition, next_ in state.transitions.items(): + # It's a string. We have finally found a possible first token. + new_first_plans[transition] = [next_.next_dfa] + + for nonterminal2, next_ in state.nonterminal_arcs.items(): + # It's a nonterminal and we have either a left recursion issue + # in the grammar or we have to recurse. + try: + first_plans2 = first_plans[nonterminal2] + except KeyError: + first_plans2 = _calculate_first_plans(nonterminal_to_dfas, first_plans, nonterminal2) + else: + if first_plans2 is None: + raise ValueError("left recursion for rule %r" % nonterminal) + + for t, pushes in first_plans2.items(): + check = new_first_plans.get(t) + if check is not None: + raise ValueError( + "Rule %s is ambiguous; %s is the" + " start of the rule %s as well as %s." + % (nonterminal, t, nonterminal2, check[-1].from_rule) + ) + new_first_plans[t] = [next_] + pushes + + first_plans[nonterminal] = new_first_plans + return new_first_plans diff --git a/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/pgen2/grammar_parser.py b/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/pgen2/grammar_parser.py new file mode 100644 index 0000000..623a455 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/pgen2/grammar_parser.py @@ -0,0 +1,156 @@ +# Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved. +# Licensed to PSF under a Contributor Agreement. + +# Modifications: +# Copyright David Halter and Contributors +# Modifications are dual-licensed: MIT and PSF. + +from parso.python.tokenize import tokenize +from parso.utils import parse_version_string +from parso.python.token import PythonTokenTypes + + +class GrammarParser(): + """ + The parser for Python grammar files. + """ + def __init__(self, bnf_grammar): + self._bnf_grammar = bnf_grammar + self.generator = tokenize( + bnf_grammar, + version_info=parse_version_string('3.6') + ) + self._gettoken() # Initialize lookahead + + def parse(self): + # grammar: (NEWLINE | rule)* ENDMARKER + while self.type != PythonTokenTypes.ENDMARKER: + while self.type == PythonTokenTypes.NEWLINE: + self._gettoken() + + # rule: NAME ':' rhs NEWLINE + self._current_rule_name = self._expect(PythonTokenTypes.NAME) + self._expect(PythonTokenTypes.OP, ':') + + a, z = self._parse_rhs() + self._expect(PythonTokenTypes.NEWLINE) + + yield a, z + + def _parse_rhs(self): + # rhs: items ('|' items)* + a, z = self._parse_items() + if self.value != "|": + return a, z + else: + aa = NFAState(self._current_rule_name) + zz = NFAState(self._current_rule_name) + while True: + # Add the possibility to go into the state of a and come back + # to finish. + aa.add_arc(a) + z.add_arc(zz) + if self.value != "|": + break + + self._gettoken() + a, z = self._parse_items() + return aa, zz + + def _parse_items(self): + # items: item+ + a, b = self._parse_item() + while self.type in (PythonTokenTypes.NAME, PythonTokenTypes.STRING) \ + or self.value in ('(', '['): + c, d = self._parse_item() + # Need to end on the next item. + b.add_arc(c) + b = d + return a, b + + def _parse_item(self): + # item: '[' rhs ']' | atom ['+' | '*'] + if self.value == "[": + self._gettoken() + a, z = self._parse_rhs() + self._expect(PythonTokenTypes.OP, ']') + # Make it also possible that there is no token and change the + # state. + a.add_arc(z) + return a, z + else: + a, z = self._parse_atom() + value = self.value + if value not in ("+", "*"): + return a, z + self._gettoken() + # Make it clear that we can go back to the old state and repeat. + z.add_arc(a) + if value == "+": + return a, z + else: + # The end state is the same as the beginning, nothing must + # change. + return a, a + + def _parse_atom(self): + # atom: '(' rhs ')' | NAME | STRING + if self.value == "(": + self._gettoken() + a, z = self._parse_rhs() + self._expect(PythonTokenTypes.OP, ')') + return a, z + elif self.type in (PythonTokenTypes.NAME, PythonTokenTypes.STRING): + a = NFAState(self._current_rule_name) + z = NFAState(self._current_rule_name) + # Make it clear that the state transition requires that value. + a.add_arc(z, self.value) + self._gettoken() + return a, z + else: + self._raise_error("expected (...) or NAME or STRING, got %s/%s", + self.type, self.value) + + def _expect(self, type_, value=None): + if self.type != type_: + self._raise_error("expected %s, got %s [%s]", + type_, self.type, self.value) + if value is not None and self.value != value: + self._raise_error("expected %s, got %s", value, self.value) + value = self.value + self._gettoken() + return value + + def _gettoken(self): + tup = next(self.generator) + self.type, self.value, self.begin, prefix = tup + + def _raise_error(self, msg, *args): + if args: + try: + msg = msg % args + except: + msg = " ".join([msg] + list(map(str, args))) + line = self._bnf_grammar.splitlines()[self.begin[0] - 1] + raise SyntaxError(msg, ('', self.begin[0], + self.begin[1], line)) + + +class NFAArc(object): + def __init__(self, next_, nonterminal_or_string): + self.next = next_ + self.nonterminal_or_string = nonterminal_or_string + + +class NFAState(object): + def __init__(self, from_rule): + self.from_rule = from_rule + self.arcs = [] # List[nonterminal (str), NFAState] + + def add_arc(self, next_, nonterminal_or_string=None): + assert nonterminal_or_string is None or isinstance(nonterminal_or_string, str) + assert isinstance(next_, NFAState) + self.arcs.append(NFAArc(next_, nonterminal_or_string)) + + def __repr__(self): + return '<%s: from %s>' % (self.__class__.__name__, self.from_rule) diff --git a/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/python/__init__.py b/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/python/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/python/diff.py b/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/python/diff.py new file mode 100644 index 0000000..2dcf027 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/python/diff.py @@ -0,0 +1,718 @@ +""" +Basically a contains parser that is faster, because it tries to parse only +parts and if anything changes, it only reparses the changed parts. + +It works with a simple diff in the beginning and will try to reuse old parser +fragments. +""" +import re +import difflib +from collections import namedtuple +import logging + +from parso.utils import split_lines +from parso.python.parser import Parser +from parso.python.tree import EndMarker +from parso.python.tokenize import PythonToken +from parso.python.token import PythonTokenTypes + +LOG = logging.getLogger(__name__) +DEBUG_DIFF_PARSER = False + +_INDENTATION_TOKENS = 'INDENT', 'ERROR_DEDENT', 'DEDENT' + + +def _get_previous_leaf_if_indentation(leaf): + while leaf and leaf.type == 'error_leaf' \ + and leaf.token_type in _INDENTATION_TOKENS: + leaf = leaf.get_previous_leaf() + return leaf + + +def _get_next_leaf_if_indentation(leaf): + while leaf and leaf.type == 'error_leaf' \ + and leaf.token_type in _INDENTATION_TOKENS: + leaf = leaf.get_previous_leaf() + return leaf + + +def _assert_valid_graph(node): + """ + Checks if the parent/children relationship is correct. + + This is a check that only runs during debugging/testing. + """ + try: + children = node.children + except AttributeError: + # Ignore INDENT is necessary, because indent/dedent tokens don't + # contain value/prefix and are just around, because of the tokenizer. + if node.type == 'error_leaf' and node.token_type in _INDENTATION_TOKENS: + assert not node.value + assert not node.prefix + return + + # Calculate the content between two start positions. + previous_leaf = _get_previous_leaf_if_indentation(node.get_previous_leaf()) + if previous_leaf is None: + content = node.prefix + previous_start_pos = 1, 0 + else: + assert previous_leaf.end_pos <= node.start_pos, \ + (previous_leaf, node) + + content = previous_leaf.value + node.prefix + previous_start_pos = previous_leaf.start_pos + + if '\n' in content or '\r' in content: + splitted = split_lines(content) + line = previous_start_pos[0] + len(splitted) - 1 + actual = line, len(splitted[-1]) + else: + actual = previous_start_pos[0], previous_start_pos[1] + len(content) + + assert node.start_pos == actual, (node.start_pos, actual) + else: + for child in children: + assert child.parent == node, (node, child) + _assert_valid_graph(child) + + +def _get_debug_error_message(module, old_lines, new_lines): + current_lines = split_lines(module.get_code(), keepends=True) + current_diff = difflib.unified_diff(new_lines, current_lines) + old_new_diff = difflib.unified_diff(old_lines, new_lines) + import parso + return ( + "There's an issue with the diff parser. Please " + "report (parso v%s) - Old/New:\n%s\nActual Diff (May be empty):\n%s" + % (parso.__version__, ''.join(old_new_diff), ''.join(current_diff)) + ) + + +def _get_last_line(node_or_leaf): + last_leaf = node_or_leaf.get_last_leaf() + if _ends_with_newline(last_leaf): + return last_leaf.start_pos[0] + else: + return last_leaf.end_pos[0] + + +def _skip_dedent_error_leaves(leaf): + while leaf is not None and leaf.type == 'error_leaf' and leaf.token_type == 'DEDENT': + leaf = leaf.get_previous_leaf() + return leaf + + +def _ends_with_newline(leaf, suffix=''): + leaf = _skip_dedent_error_leaves(leaf) + + if leaf.type == 'error_leaf': + typ = leaf.token_type.lower() + else: + typ = leaf.type + + return typ == 'newline' or suffix.endswith('\n') or suffix.endswith('\r') + + +def _flows_finished(pgen_grammar, stack): + """ + if, while, for and try might not be finished, because another part might + still be parsed. + """ + for stack_node in stack: + if stack_node.nonterminal in ('if_stmt', 'while_stmt', 'for_stmt', 'try_stmt'): + return False + return True + + +def _func_or_class_has_suite(node): + if node.type == 'decorated': + node = node.children[-1] + if node.type in ('async_funcdef', 'async_stmt'): + node = node.children[-1] + return node.type in ('classdef', 'funcdef') and node.children[-1].type == 'suite' + + +def _suite_or_file_input_is_valid(pgen_grammar, stack): + if not _flows_finished(pgen_grammar, stack): + return False + + for stack_node in reversed(stack): + if stack_node.nonterminal == 'decorator': + # A decorator is only valid with the upcoming function. + return False + + if stack_node.nonterminal == 'suite': + # If only newline is in the suite, the suite is not valid, yet. + return len(stack_node.nodes) > 1 + # Not reaching a suite means that we're dealing with file_input levels + # where there's no need for a valid statement in it. It can also be empty. + return True + + +def _is_flow_node(node): + if node.type == 'async_stmt': + node = node.children[1] + try: + value = node.children[0].value + except AttributeError: + return False + return value in ('if', 'for', 'while', 'try', 'with') + + +class _PositionUpdatingFinished(Exception): + pass + + +def _update_positions(nodes, line_offset, last_leaf): + for node in nodes: + try: + children = node.children + except AttributeError: + # Is a leaf + node.line += line_offset + if node is last_leaf: + raise _PositionUpdatingFinished + else: + _update_positions(children, line_offset, last_leaf) + + +class DiffParser(object): + """ + An advanced form of parsing a file faster. Unfortunately comes with huge + side effects. It changes the given module. + """ + def __init__(self, pgen_grammar, tokenizer, module): + self._pgen_grammar = pgen_grammar + self._tokenizer = tokenizer + self._module = module + + def _reset(self): + self._copy_count = 0 + self._parser_count = 0 + + self._nodes_tree = _NodesTree(self._module) + + def update(self, old_lines, new_lines): + ''' + The algorithm works as follows: + + Equal: + - Assure that the start is a newline, otherwise parse until we get + one. + - Copy from parsed_until_line + 1 to max(i2 + 1) + - Make sure that the indentation is correct (e.g. add DEDENT) + - Add old and change positions + Insert: + - Parse from parsed_until_line + 1 to min(j2 + 1), hopefully not + much more. + + Returns the new module node. + ''' + LOG.debug('diff parser start') + # Reset the used names cache so they get regenerated. + self._module._used_names = None + + self._parser_lines_new = new_lines + + self._reset() + + line_length = len(new_lines) + sm = difflib.SequenceMatcher(None, old_lines, self._parser_lines_new) + opcodes = sm.get_opcodes() + LOG.debug('line_lengths old: %s; new: %s' % (len(old_lines), line_length)) + + for operation, i1, i2, j1, j2 in opcodes: + LOG.debug('-> code[%s] old[%s:%s] new[%s:%s]', + operation, i1 + 1, i2, j1 + 1, j2) + + if j2 == line_length and new_lines[-1] == '': + # The empty part after the last newline is not relevant. + j2 -= 1 + + if operation == 'equal': + line_offset = j1 - i1 + self._copy_from_old_parser(line_offset, i2, j2) + elif operation == 'replace': + self._parse(until_line=j2) + elif operation == 'insert': + self._parse(until_line=j2) + else: + assert operation == 'delete' + + # With this action all change will finally be applied and we have a + # changed module. + self._nodes_tree.close() + + if DEBUG_DIFF_PARSER: + # If there is reasonable suspicion that the diff parser is not + # behaving well, this should be enabled. + try: + assert self._module.get_code() == ''.join(new_lines) + _assert_valid_graph(self._module) + except AssertionError: + print(_get_debug_error_message(self._module, old_lines, new_lines)) + raise + + last_pos = self._module.end_pos[0] + if last_pos != line_length: + raise Exception( + ('(%s != %s) ' % (last_pos, line_length)) + + _get_debug_error_message(self._module, old_lines, new_lines) + ) + LOG.debug('diff parser end') + return self._module + + def _enabled_debugging(self, old_lines, lines_new): + if self._module.get_code() != ''.join(lines_new): + LOG.warning('parser issue:\n%s\n%s', ''.join(old_lines), ''.join(lines_new)) + + def _copy_from_old_parser(self, line_offset, until_line_old, until_line_new): + last_until_line = -1 + while until_line_new > self._nodes_tree.parsed_until_line: + parsed_until_line_old = self._nodes_tree.parsed_until_line - line_offset + line_stmt = self._get_old_line_stmt(parsed_until_line_old + 1) + if line_stmt is None: + # Parse 1 line at least. We don't need more, because we just + # want to get into a state where the old parser has statements + # again that can be copied (e.g. not lines within parentheses). + self._parse(self._nodes_tree.parsed_until_line + 1) + else: + p_children = line_stmt.parent.children + index = p_children.index(line_stmt) + + from_ = self._nodes_tree.parsed_until_line + 1 + copied_nodes = self._nodes_tree.copy_nodes( + p_children[index:], + until_line_old, + line_offset + ) + # Match all the nodes that are in the wanted range. + if copied_nodes: + self._copy_count += 1 + + to = self._nodes_tree.parsed_until_line + + LOG.debug('copy old[%s:%s] new[%s:%s]', + copied_nodes[0].start_pos[0], + copied_nodes[-1].end_pos[0] - 1, from_, to) + else: + # We have copied as much as possible (but definitely not too + # much). Therefore we just parse a bit more. + self._parse(self._nodes_tree.parsed_until_line + 1) + # Since there are potential bugs that might loop here endlessly, we + # just stop here. + assert last_until_line != self._nodes_tree.parsed_until_line, last_until_line + last_until_line = self._nodes_tree.parsed_until_line + + def _get_old_line_stmt(self, old_line): + leaf = self._module.get_leaf_for_position((old_line, 0), include_prefixes=True) + + if _ends_with_newline(leaf): + leaf = leaf.get_next_leaf() + if leaf.get_start_pos_of_prefix()[0] == old_line: + node = leaf + while node.parent.type not in ('file_input', 'suite'): + node = node.parent + + # Make sure that if only the `else:` line of an if statement is + # copied that not the whole thing is going to be copied. + if node.start_pos[0] >= old_line: + return node + # Must be on the same line. Otherwise we need to parse that bit. + return None + + def _parse(self, until_line): + """ + Parses at least until the given line, but might just parse more until a + valid state is reached. + """ + last_until_line = 0 + while until_line > self._nodes_tree.parsed_until_line: + node = self._try_parse_part(until_line) + nodes = node.children + + self._nodes_tree.add_parsed_nodes(nodes) + LOG.debug( + 'parse_part from %s to %s (to %s in part parser)', + nodes[0].get_start_pos_of_prefix()[0], + self._nodes_tree.parsed_until_line, + node.end_pos[0] - 1 + ) + # Since the tokenizer sometimes has bugs, we cannot be sure that + # this loop terminates. Therefore assert that there's always a + # change. + assert last_until_line != self._nodes_tree.parsed_until_line, last_until_line + last_until_line = self._nodes_tree.parsed_until_line + + def _try_parse_part(self, until_line): + """ + Sets up a normal parser that uses a spezialized tokenizer to only parse + until a certain position (or a bit longer if the statement hasn't + ended. + """ + self._parser_count += 1 + # TODO speed up, shouldn't copy the whole list all the time. + # memoryview? + parsed_until_line = self._nodes_tree.parsed_until_line + lines_after = self._parser_lines_new[parsed_until_line:] + tokens = self._diff_tokenize( + lines_after, + until_line, + line_offset=parsed_until_line + ) + self._active_parser = Parser( + self._pgen_grammar, + error_recovery=True + ) + return self._active_parser.parse(tokens=tokens) + + def _diff_tokenize(self, lines, until_line, line_offset=0): + is_first_token = True + omitted_first_indent = False + indents = [] + tokens = self._tokenizer(lines, (1, 0)) + stack = self._active_parser.stack + for typ, string, start_pos, prefix in tokens: + start_pos = start_pos[0] + line_offset, start_pos[1] + if typ == PythonTokenTypes.INDENT: + indents.append(start_pos[1]) + if is_first_token: + omitted_first_indent = True + # We want to get rid of indents that are only here because + # we only parse part of the file. These indents would only + # get parsed as error leafs, which doesn't make any sense. + is_first_token = False + continue + is_first_token = False + + # In case of omitted_first_indent, it might not be dedented fully. + # However this is a sign for us that a dedent happened. + if typ == PythonTokenTypes.DEDENT \ + or typ == PythonTokenTypes.ERROR_DEDENT \ + and omitted_first_indent and len(indents) == 1: + indents.pop() + if omitted_first_indent and not indents: + # We are done here, only thing that can come now is an + # endmarker or another dedented code block. + typ, string, start_pos, prefix = next(tokens) + if '\n' in prefix or '\r' in prefix: + prefix = re.sub(r'[^\n\r]+\Z', '', prefix) + else: + assert start_pos[1] >= len(prefix), repr(prefix) + if start_pos[1] - len(prefix) == 0: + prefix = '' + yield PythonToken( + PythonTokenTypes.ENDMARKER, '', + (start_pos[0] + line_offset, 0), + prefix + ) + break + elif typ == PythonTokenTypes.NEWLINE and start_pos[0] >= until_line: + yield PythonToken(typ, string, start_pos, prefix) + # Check if the parser is actually in a valid suite state. + if _suite_or_file_input_is_valid(self._pgen_grammar, stack): + start_pos = start_pos[0] + 1, 0 + while len(indents) > int(omitted_first_indent): + indents.pop() + yield PythonToken(PythonTokenTypes.DEDENT, '', start_pos, '') + + yield PythonToken(PythonTokenTypes.ENDMARKER, '', start_pos, '') + break + else: + continue + + yield PythonToken(typ, string, start_pos, prefix) + + +class _NodesTreeNode(object): + _ChildrenGroup = namedtuple('_ChildrenGroup', 'prefix children line_offset last_line_offset_leaf') + + def __init__(self, tree_node, parent=None): + self.tree_node = tree_node + self._children_groups = [] + self.parent = parent + self._node_children = [] + + def finish(self): + children = [] + for prefix, children_part, line_offset, last_line_offset_leaf in self._children_groups: + first_leaf = _get_next_leaf_if_indentation( + children_part[0].get_first_leaf() + ) + + first_leaf.prefix = prefix + first_leaf.prefix + if line_offset != 0: + try: + _update_positions( + children_part, line_offset, last_line_offset_leaf) + except _PositionUpdatingFinished: + pass + children += children_part + self.tree_node.children = children + # Reset the parents + for node in children: + node.parent = self.tree_node + + for node_child in self._node_children: + node_child.finish() + + def add_child_node(self, child_node): + self._node_children.append(child_node) + + def add_tree_nodes(self, prefix, children, line_offset=0, last_line_offset_leaf=None): + if last_line_offset_leaf is None: + last_line_offset_leaf = children[-1].get_last_leaf() + group = self._ChildrenGroup(prefix, children, line_offset, last_line_offset_leaf) + self._children_groups.append(group) + + def get_last_line(self, suffix): + line = 0 + if self._children_groups: + children_group = self._children_groups[-1] + last_leaf = _get_previous_leaf_if_indentation( + children_group.last_line_offset_leaf + ) + + line = last_leaf.end_pos[0] + children_group.line_offset + + # Newlines end on the next line, which means that they would cover + # the next line. That line is not fully parsed at this point. + if _ends_with_newline(last_leaf, suffix): + line -= 1 + line += len(split_lines(suffix)) - 1 + + if suffix and not suffix.endswith('\n') and not suffix.endswith('\r'): + # This is the end of a file (that doesn't end with a newline). + line += 1 + + if self._node_children: + return max(line, self._node_children[-1].get_last_line(suffix)) + return line + + +class _NodesTree(object): + def __init__(self, module): + self._base_node = _NodesTreeNode(module) + self._working_stack = [self._base_node] + self._module = module + self._prefix_remainder = '' + self.prefix = '' + + @property + def parsed_until_line(self): + return self._working_stack[-1].get_last_line(self.prefix) + + def _get_insertion_node(self, indentation_node): + indentation = indentation_node.start_pos[1] + + # find insertion node + while True: + node = self._working_stack[-1] + tree_node = node.tree_node + if tree_node.type == 'suite': + # A suite starts with NEWLINE, ... + node_indentation = tree_node.children[1].start_pos[1] + + if indentation >= node_indentation: # Not a Dedent + # We might be at the most outer layer: modules. We + # don't want to depend on the first statement + # having the right indentation. + return node + + elif tree_node.type == 'file_input': + return node + + self._working_stack.pop() + + def add_parsed_nodes(self, tree_nodes): + old_prefix = self.prefix + tree_nodes = self._remove_endmarker(tree_nodes) + if not tree_nodes: + self.prefix = old_prefix + self.prefix + return + + assert tree_nodes[0].type != 'newline' + + node = self._get_insertion_node(tree_nodes[0]) + assert node.tree_node.type in ('suite', 'file_input') + node.add_tree_nodes(old_prefix, tree_nodes) + # tos = Top of stack + self._update_tos(tree_nodes[-1]) + + def _update_tos(self, tree_node): + if tree_node.type in ('suite', 'file_input'): + new_tos = _NodesTreeNode(tree_node) + new_tos.add_tree_nodes('', list(tree_node.children)) + + self._working_stack[-1].add_child_node(new_tos) + self._working_stack.append(new_tos) + + self._update_tos(tree_node.children[-1]) + elif _func_or_class_has_suite(tree_node): + self._update_tos(tree_node.children[-1]) + + def _remove_endmarker(self, tree_nodes): + """ + Helps cleaning up the tree nodes that get inserted. + """ + last_leaf = tree_nodes[-1].get_last_leaf() + is_endmarker = last_leaf.type == 'endmarker' + self._prefix_remainder = '' + if is_endmarker: + separation = max(last_leaf.prefix.rfind('\n'), last_leaf.prefix.rfind('\r')) + if separation > -1: + # Remove the whitespace part of the prefix after a newline. + # That is not relevant if parentheses were opened. Always parse + # until the end of a line. + last_leaf.prefix, self._prefix_remainder = \ + last_leaf.prefix[:separation + 1], last_leaf.prefix[separation + 1:] + + self.prefix = '' + + if is_endmarker: + self.prefix = last_leaf.prefix + + tree_nodes = tree_nodes[:-1] + return tree_nodes + + def copy_nodes(self, tree_nodes, until_line, line_offset): + """ + Copies tree nodes from the old parser tree. + + Returns the number of tree nodes that were copied. + """ + if tree_nodes[0].type in ('error_leaf', 'error_node'): + # Avoid copying errors in the beginning. Can lead to a lot of + # issues. + return [] + + self._get_insertion_node(tree_nodes[0]) + + new_nodes, self._working_stack, self.prefix = self._copy_nodes( + list(self._working_stack), + tree_nodes, + until_line, + line_offset, + self.prefix, + ) + return new_nodes + + def _copy_nodes(self, working_stack, nodes, until_line, line_offset, prefix=''): + new_nodes = [] + + new_prefix = '' + for node in nodes: + if node.start_pos[0] > until_line: + break + + if node.type == 'endmarker': + break + + if node.type == 'error_leaf' and node.token_type in ('DEDENT', 'ERROR_DEDENT'): + break + # TODO this check might take a bit of time for large files. We + # might want to change this to do more intelligent guessing or + # binary search. + if _get_last_line(node) > until_line: + # We can split up functions and classes later. + if _func_or_class_has_suite(node): + new_nodes.append(node) + break + + new_nodes.append(node) + + if not new_nodes: + return [], working_stack, prefix + + tos = working_stack[-1] + last_node = new_nodes[-1] + had_valid_suite_last = False + if _func_or_class_has_suite(last_node): + suite = last_node + while suite.type != 'suite': + suite = suite.children[-1] + + suite_tos = _NodesTreeNode(suite) + # Don't need to pass line_offset here, it's already done by the + # parent. + suite_nodes, new_working_stack, new_prefix = self._copy_nodes( + working_stack + [suite_tos], suite.children, until_line, line_offset + ) + if len(suite_nodes) < 2: + # A suite only with newline is not valid. + new_nodes.pop() + new_prefix = '' + else: + assert new_nodes + tos.add_child_node(suite_tos) + working_stack = new_working_stack + had_valid_suite_last = True + + if new_nodes: + last_node = new_nodes[-1] + if (last_node.type in ('error_leaf', 'error_node') or + _is_flow_node(new_nodes[-1])): + # Error leafs/nodes don't have a defined start/end. Error + # nodes might not end with a newline (e.g. if there's an + # open `(`). Therefore ignore all of them unless they are + # succeeded with valid parser state. + # If we copy flows at the end, they might be continued + # after the copy limit (in the new parser). + # In this while loop we try to remove until we find a newline. + new_prefix = '' + new_nodes.pop() + while new_nodes: + last_node = new_nodes[-1] + if last_node.get_last_leaf().type == 'newline': + break + new_nodes.pop() + + if new_nodes: + if not _ends_with_newline(new_nodes[-1].get_last_leaf()) and not had_valid_suite_last: + p = new_nodes[-1].get_next_leaf().prefix + # We are not allowed to remove the newline at the end of the + # line, otherwise it's going to be missing. This happens e.g. + # if a bracket is around before that moves newlines to + # prefixes. + new_prefix = split_lines(p, keepends=True)[0] + + if had_valid_suite_last: + last = new_nodes[-1] + if last.type == 'decorated': + last = last.children[-1] + if last.type in ('async_funcdef', 'async_stmt'): + last = last.children[-1] + last_line_offset_leaf = last.children[-2].get_last_leaf() + assert last_line_offset_leaf == ':' + else: + last_line_offset_leaf = new_nodes[-1].get_last_leaf() + tos.add_tree_nodes(prefix, new_nodes, line_offset, last_line_offset_leaf) + prefix = new_prefix + self._prefix_remainder = '' + + return new_nodes, working_stack, prefix + + def close(self): + self._base_node.finish() + + # Add an endmarker. + try: + last_leaf = self._module.get_last_leaf() + except IndexError: + end_pos = [1, 0] + else: + last_leaf = _skip_dedent_error_leaves(last_leaf) + end_pos = list(last_leaf.end_pos) + lines = split_lines(self.prefix) + assert len(lines) > 0 + if len(lines) == 1: + end_pos[1] += len(lines[0]) + else: + end_pos[0] += len(lines) - 1 + end_pos[1] = len(lines[-1]) + + endmarker = EndMarker('', tuple(end_pos), self.prefix + self._prefix_remainder) + endmarker.parent = self._module + self._module.children.append(endmarker) diff --git a/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/python/errors.py b/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/python/errors.py new file mode 100644 index 0000000..b6e6e5e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/python/errors.py @@ -0,0 +1,1011 @@ +# -*- coding: utf-8 -*- +import codecs +import warnings +import re +from contextlib import contextmanager + +from parso.normalizer import Normalizer, NormalizerConfig, Issue, Rule +from parso.python.tree import search_ancestor + +_BLOCK_STMTS = ('if_stmt', 'while_stmt', 'for_stmt', 'try_stmt', 'with_stmt') +_STAR_EXPR_PARENTS = ('testlist_star_expr', 'testlist_comp', 'exprlist') +# This is the maximal block size given by python. +_MAX_BLOCK_SIZE = 20 +_MAX_INDENT_COUNT = 100 +ALLOWED_FUTURES = ( + 'all_feature_names', 'nested_scopes', 'generators', 'division', + 'absolute_import', 'with_statement', 'print_function', 'unicode_literals', +) +_COMP_FOR_TYPES = ('comp_for', 'sync_comp_for') + + +def _iter_stmts(scope): + """ + Iterates over all statements and splits up simple_stmt. + """ + for child in scope.children: + if child.type == 'simple_stmt': + for child2 in child.children: + if child2.type == 'newline' or child2 == ';': + continue + yield child2 + else: + yield child + + +def _get_comprehension_type(atom): + first, second = atom.children[:2] + if second.type == 'testlist_comp' and second.children[1].type in _COMP_FOR_TYPES: + if first == '[': + return 'list comprehension' + else: + return 'generator expression' + elif second.type == 'dictorsetmaker' and second.children[-1].type in _COMP_FOR_TYPES: + if second.children[1] == ':': + return 'dict comprehension' + else: + return 'set comprehension' + return None + + +def _is_future_import(import_from): + # It looks like a __future__ import that is relative is still a future + # import. That feels kind of odd, but whatever. + # if import_from.level != 0: + # return False + from_names = import_from.get_from_names() + return [n.value for n in from_names] == ['__future__'] + + +def _remove_parens(atom): + """ + Returns the inner part of an expression like `(foo)`. Also removes nested + parens. + """ + try: + children = atom.children + except AttributeError: + pass + else: + if len(children) == 3 and children[0] == '(': + return _remove_parens(atom.children[1]) + return atom + + +def _iter_params(parent_node): + return (n for n in parent_node.children if n.type == 'param') + + +def _is_future_import_first(import_from): + """ + Checks if the import is the first statement of a file. + """ + found_docstring = False + for stmt in _iter_stmts(import_from.get_root_node()): + if stmt.type == 'string' and not found_docstring: + continue + found_docstring = True + + if stmt == import_from: + return True + if stmt.type == 'import_from' and _is_future_import(stmt): + continue + return False + + +def _iter_definition_exprs_from_lists(exprlist): + for child in exprlist.children[::2]: + if child.type == 'atom' and child.children[0] in ('(', '['): + testlist_comp = child.children[0] + if testlist_comp.type == 'testlist_comp': + for expr in _iter_definition_exprs_from_lists(testlist_comp): + yield expr + continue + elif child.children[0] == '[': + yield testlist_comp + continue + + yield child + + +def _get_expr_stmt_definition_exprs(expr_stmt): + exprs = [] + for list_ in expr_stmt.children[:-2:2]: + if list_.type in ('testlist_star_expr', 'testlist'): + exprs += _iter_definition_exprs_from_lists(list_) + else: + exprs.append(list_) + return exprs + + +def _get_for_stmt_definition_exprs(for_stmt): + exprlist = for_stmt.children[1] + if exprlist.type != 'exprlist': + return [exprlist] + return list(_iter_definition_exprs_from_lists(exprlist)) + + +class _Context(object): + def __init__(self, node, add_syntax_error, parent_context=None): + self.node = node + self.blocks = [] + self.parent_context = parent_context + self._used_name_dict = {} + self._global_names = [] + self._nonlocal_names = [] + self._nonlocal_names_in_subscopes = [] + self._add_syntax_error = add_syntax_error + + def is_async_funcdef(self): + # Stupidly enough async funcdefs can have two different forms, + # depending if a decorator is used or not. + return self.is_function() \ + and self.node.parent.type in ('async_funcdef', 'async_stmt') + + def is_function(self): + return self.node.type == 'funcdef' + + def add_name(self, name): + parent_type = name.parent.type + if parent_type == 'trailer': + # We are only interested in first level names. + return + + if parent_type == 'global_stmt': + self._global_names.append(name) + elif parent_type == 'nonlocal_stmt': + self._nonlocal_names.append(name) + else: + self._used_name_dict.setdefault(name.value, []).append(name) + + def finalize(self): + """ + Returns a list of nonlocal names that need to be part of that scope. + """ + self._analyze_names(self._global_names, 'global') + self._analyze_names(self._nonlocal_names, 'nonlocal') + + # Python2.6 doesn't have dict comprehensions. + global_name_strs = dict((n.value, n) for n in self._global_names) + for nonlocal_name in self._nonlocal_names: + try: + global_name = global_name_strs[nonlocal_name.value] + except KeyError: + continue + + message = "name '%s' is nonlocal and global" % global_name.value + if global_name.start_pos < nonlocal_name.start_pos: + error_name = global_name + else: + error_name = nonlocal_name + self._add_syntax_error(error_name, message) + + nonlocals_not_handled = [] + for nonlocal_name in self._nonlocal_names_in_subscopes: + search = nonlocal_name.value + if search in global_name_strs or self.parent_context is None: + message = "no binding for nonlocal '%s' found" % nonlocal_name.value + self._add_syntax_error(nonlocal_name, message) + elif not self.is_function() or \ + nonlocal_name.value not in self._used_name_dict: + nonlocals_not_handled.append(nonlocal_name) + return self._nonlocal_names + nonlocals_not_handled + + def _analyze_names(self, globals_or_nonlocals, type_): + def raise_(message): + self._add_syntax_error(base_name, message % (base_name.value, type_)) + + params = [] + if self.node.type == 'funcdef': + params = self.node.get_params() + + for base_name in globals_or_nonlocals: + found_global_or_nonlocal = False + # Somehow Python does it the reversed way. + for name in reversed(self._used_name_dict.get(base_name.value, [])): + if name.start_pos > base_name.start_pos: + # All following names don't have to be checked. + found_global_or_nonlocal = True + + parent = name.parent + if parent.type == 'param' and parent.name == name: + # Skip those here, these definitions belong to the next + # scope. + continue + + if name.is_definition(): + if parent.type == 'expr_stmt' \ + and parent.children[1].type == 'annassign': + if found_global_or_nonlocal: + # If it's after the global the error seems to be + # placed there. + base_name = name + raise_("annotated name '%s' can't be %s") + break + else: + message = "name '%s' is assigned to before %s declaration" + else: + message = "name '%s' is used prior to %s declaration" + + if not found_global_or_nonlocal: + raise_(message) + # Only add an error for the first occurence. + break + + for param in params: + if param.name.value == base_name.value: + raise_("name '%s' is parameter and %s"), + + @contextmanager + def add_block(self, node): + self.blocks.append(node) + yield + self.blocks.pop() + + def add_context(self, node): + return _Context(node, self._add_syntax_error, parent_context=self) + + def close_child_context(self, child_context): + self._nonlocal_names_in_subscopes += child_context.finalize() + + +class ErrorFinder(Normalizer): + """ + Searches for errors in the syntax tree. + """ + def __init__(self, *args, **kwargs): + super(ErrorFinder, self).__init__(*args, **kwargs) + self._error_dict = {} + self.version = self.grammar.version_info + + def initialize(self, node): + def create_context(node): + if node is None: + return None + + parent_context = create_context(node.parent) + if node.type in ('classdef', 'funcdef', 'file_input'): + return _Context(node, self._add_syntax_error, parent_context) + return parent_context + + self.context = create_context(node) or _Context(node, self._add_syntax_error) + self._indentation_count = 0 + + def visit(self, node): + if node.type == 'error_node': + with self.visit_node(node): + # Don't need to investigate the inners of an error node. We + # might find errors in there that should be ignored, because + # the error node itself already shows that there's an issue. + return '' + return super(ErrorFinder, self).visit(node) + + @contextmanager + def visit_node(self, node): + self._check_type_rules(node) + + if node.type in _BLOCK_STMTS: + with self.context.add_block(node): + if len(self.context.blocks) == _MAX_BLOCK_SIZE: + self._add_syntax_error(node, "too many statically nested blocks") + yield + return + elif node.type == 'suite': + self._indentation_count += 1 + if self._indentation_count == _MAX_INDENT_COUNT: + self._add_indentation_error(node.children[1], "too many levels of indentation") + + yield + + if node.type == 'suite': + self._indentation_count -= 1 + elif node.type in ('classdef', 'funcdef'): + context = self.context + self.context = context.parent_context + self.context.close_child_context(context) + + def visit_leaf(self, leaf): + if leaf.type == 'error_leaf': + if leaf.token_type in ('INDENT', 'ERROR_DEDENT'): + # Indents/Dedents itself never have a prefix. They are just + # "pseudo" tokens that get removed by the syntax tree later. + # Therefore in case of an error we also have to check for this. + spacing = list(leaf.get_next_leaf()._split_prefix())[-1] + if leaf.token_type == 'INDENT': + message = 'unexpected indent' + else: + message = 'unindent does not match any outer indentation level' + self._add_indentation_error(spacing, message) + else: + if leaf.value.startswith('\\'): + message = 'unexpected character after line continuation character' + else: + match = re.match('\\w{,2}("{1,3}|\'{1,3})', leaf.value) + if match is None: + message = 'invalid syntax' + else: + if len(match.group(1)) == 1: + message = 'EOL while scanning string literal' + else: + message = 'EOF while scanning triple-quoted string literal' + self._add_syntax_error(leaf, message) + return '' + elif leaf.value == ':': + parent = leaf.parent + if parent.type in ('classdef', 'funcdef'): + self.context = self.context.add_context(parent) + + # The rest is rule based. + return super(ErrorFinder, self).visit_leaf(leaf) + + def _add_indentation_error(self, spacing, message): + self.add_issue(spacing, 903, "IndentationError: " + message) + + def _add_syntax_error(self, node, message): + self.add_issue(node, 901, "SyntaxError: " + message) + + def add_issue(self, node, code, message): + # Overwrite the default behavior. + # Check if the issues are on the same line. + line = node.start_pos[0] + args = (code, message, node) + self._error_dict.setdefault(line, args) + + def finalize(self): + self.context.finalize() + + for code, message, node in self._error_dict.values(): + self.issues.append(Issue(node, code, message)) + + +class IndentationRule(Rule): + code = 903 + + def _get_message(self, message): + message = super(IndentationRule, self)._get_message(message) + return "IndentationError: " + message + + +@ErrorFinder.register_rule(type='error_node') +class _ExpectIndentedBlock(IndentationRule): + message = 'expected an indented block' + + def get_node(self, node): + leaf = node.get_next_leaf() + return list(leaf._split_prefix())[-1] + + def is_issue(self, node): + # This is the beginning of a suite that is not indented. + return node.children[-1].type == 'newline' + + +class ErrorFinderConfig(NormalizerConfig): + normalizer_class = ErrorFinder + + +class SyntaxRule(Rule): + code = 901 + + def _get_message(self, message): + message = super(SyntaxRule, self)._get_message(message) + return "SyntaxError: " + message + + +@ErrorFinder.register_rule(type='error_node') +class _InvalidSyntaxRule(SyntaxRule): + message = "invalid syntax" + + def get_node(self, node): + return node.get_next_leaf() + + def is_issue(self, node): + # Error leafs will be added later as an error. + return node.get_next_leaf().type != 'error_leaf' + + +@ErrorFinder.register_rule(value='await') +class _AwaitOutsideAsync(SyntaxRule): + message = "'await' outside async function" + + def is_issue(self, leaf): + return not self._normalizer.context.is_async_funcdef() + + def get_error_node(self, node): + # Return the whole await statement. + return node.parent + + +@ErrorFinder.register_rule(value='break') +class _BreakOutsideLoop(SyntaxRule): + message = "'break' outside loop" + + def is_issue(self, leaf): + in_loop = False + for block in self._normalizer.context.blocks: + if block.type in ('for_stmt', 'while_stmt'): + in_loop = True + return not in_loop + + +@ErrorFinder.register_rule(value='continue') +class _ContinueChecks(SyntaxRule): + message = "'continue' not properly in loop" + message_in_finally = "'continue' not supported inside 'finally' clause" + + def is_issue(self, leaf): + in_loop = False + for block in self._normalizer.context.blocks: + if block.type in ('for_stmt', 'while_stmt'): + in_loop = True + if block.type == 'try_stmt': + last_block = block.children[-3] + if last_block == 'finally' and leaf.start_pos > last_block.start_pos: + self.add_issue(leaf, message=self.message_in_finally) + return False # Error already added + if not in_loop: + return True + + +@ErrorFinder.register_rule(value='from') +class _YieldFromCheck(SyntaxRule): + message = "'yield from' inside async function" + + def get_node(self, leaf): + return leaf.parent.parent # This is the actual yield statement. + + def is_issue(self, leaf): + return leaf.parent.type == 'yield_arg' \ + and self._normalizer.context.is_async_funcdef() + + +@ErrorFinder.register_rule(type='name') +class _NameChecks(SyntaxRule): + message = 'cannot assign to __debug__' + message_none = 'cannot assign to None' + + def is_issue(self, leaf): + self._normalizer.context.add_name(leaf) + + if leaf.value == '__debug__' and leaf.is_definition(): + return True + if leaf.value == 'None' and self._normalizer.version < (3, 0) \ + and leaf.is_definition(): + self.add_issue(leaf, message=self.message_none) + + +@ErrorFinder.register_rule(type='string') +class _StringChecks(SyntaxRule): + message = "bytes can only contain ASCII literal characters." + + def is_issue(self, leaf): + string_prefix = leaf.string_prefix.lower() + if 'b' in string_prefix \ + and self._normalizer.version >= (3, 0) \ + and any(c for c in leaf.value if ord(c) > 127): + # b'ä' + return True + + if 'r' not in string_prefix: + # Raw strings don't need to be checked if they have proper + # escaping. + is_bytes = self._normalizer.version < (3, 0) + if 'b' in string_prefix: + is_bytes = True + if 'u' in string_prefix: + is_bytes = False + + payload = leaf._get_payload() + if is_bytes: + payload = payload.encode('utf-8') + func = codecs.escape_decode + else: + func = codecs.unicode_escape_decode + + try: + with warnings.catch_warnings(): + # The warnings from parsing strings are not relevant. + warnings.filterwarnings('ignore') + func(payload) + except UnicodeDecodeError as e: + self.add_issue(leaf, message='(unicode error) ' + str(e)) + except ValueError as e: + self.add_issue(leaf, message='(value error) ' + str(e)) + + +@ErrorFinder.register_rule(value='*') +class _StarCheck(SyntaxRule): + message = "named arguments must follow bare *" + + def is_issue(self, leaf): + params = leaf.parent + if params.type == 'parameters' and params: + after = params.children[params.children.index(leaf) + 1:] + after = [child for child in after + if child not in (',', ')') and not child.star_count] + return len(after) == 0 + + +@ErrorFinder.register_rule(value='**') +class _StarStarCheck(SyntaxRule): + # e.g. {**{} for a in [1]} + # TODO this should probably get a better end_pos including + # the next sibling of leaf. + message = "dict unpacking cannot be used in dict comprehension" + + def is_issue(self, leaf): + if leaf.parent.type == 'dictorsetmaker': + comp_for = leaf.get_next_sibling().get_next_sibling() + return comp_for is not None and comp_for.type in _COMP_FOR_TYPES + + +@ErrorFinder.register_rule(value='yield') +@ErrorFinder.register_rule(value='return') +class _ReturnAndYieldChecks(SyntaxRule): + message = "'return' with value in async generator" + message_async_yield = "'yield' inside async function" + + def get_node(self, leaf): + return leaf.parent + + def is_issue(self, leaf): + if self._normalizer.context.node.type != 'funcdef': + self.add_issue(self.get_node(leaf), message="'%s' outside function" % leaf.value) + elif self._normalizer.context.is_async_funcdef() \ + and any(self._normalizer.context.node.iter_yield_exprs()): + if leaf.value == 'return' and leaf.parent.type == 'return_stmt': + return True + elif leaf.value == 'yield' \ + and leaf.get_next_leaf() != 'from' \ + and self._normalizer.version == (3, 5): + self.add_issue(self.get_node(leaf), message=self.message_async_yield) + + +@ErrorFinder.register_rule(type='strings') +class _BytesAndStringMix(SyntaxRule): + # e.g. 's' b'' + message = "cannot mix bytes and nonbytes literals" + + def _is_bytes_literal(self, string): + if string.type == 'fstring': + return False + return 'b' in string.string_prefix.lower() + + def is_issue(self, node): + first = node.children[0] + # In Python 2 it's allowed to mix bytes and unicode. + if self._normalizer.version >= (3, 0): + first_is_bytes = self._is_bytes_literal(first) + for string in node.children[1:]: + if first_is_bytes != self._is_bytes_literal(string): + return True + + +@ErrorFinder.register_rule(type='import_as_names') +class _TrailingImportComma(SyntaxRule): + # e.g. from foo import a, + message = "trailing comma not allowed without surrounding parentheses" + + def is_issue(self, node): + if node.children[-1] == ',': + return True + + +@ErrorFinder.register_rule(type='import_from') +class _ImportStarInFunction(SyntaxRule): + message = "import * only allowed at module level" + + def is_issue(self, node): + return node.is_star_import() and self._normalizer.context.parent_context is not None + + +@ErrorFinder.register_rule(type='import_from') +class _FutureImportRule(SyntaxRule): + message = "from __future__ imports must occur at the beginning of the file" + + def is_issue(self, node): + if _is_future_import(node): + if not _is_future_import_first(node): + return True + + for from_name, future_name in node.get_paths(): + name = future_name.value + allowed_futures = list(ALLOWED_FUTURES) + if self._normalizer.version >= (3, 5): + allowed_futures.append('generator_stop') + + if name == 'braces': + self.add_issue(node, message="not a chance") + elif name == 'barry_as_FLUFL': + m = "Seriously I'm not implementing this :) ~ Dave" + self.add_issue(node, message=m) + elif name not in ALLOWED_FUTURES: + message = "future feature %s is not defined" % name + self.add_issue(node, message=message) + + +@ErrorFinder.register_rule(type='star_expr') +class _StarExprRule(SyntaxRule): + message = "starred assignment target must be in a list or tuple" + message_iterable_unpacking = "iterable unpacking cannot be used in comprehension" + message_assignment = "can use starred expression only as assignment target" + + def is_issue(self, node): + if node.parent.type not in _STAR_EXPR_PARENTS: + return True + if node.parent.type == 'testlist_comp': + # [*[] for a in [1]] + if node.parent.children[1].type in _COMP_FOR_TYPES: + self.add_issue(node, message=self.message_iterable_unpacking) + if self._normalizer.version <= (3, 4): + n = search_ancestor(node, 'for_stmt', 'expr_stmt') + found_definition = False + if n is not None: + if n.type == 'expr_stmt': + exprs = _get_expr_stmt_definition_exprs(n) + else: + exprs = _get_for_stmt_definition_exprs(n) + if node in exprs: + found_definition = True + + if not found_definition: + self.add_issue(node, message=self.message_assignment) + + +@ErrorFinder.register_rule(types=_STAR_EXPR_PARENTS) +class _StarExprParentRule(SyntaxRule): + def is_issue(self, node): + if node.parent.type == 'del_stmt': + self.add_issue(node.parent, message="can't use starred expression here") + else: + def is_definition(node, ancestor): + if ancestor is None: + return False + + type_ = ancestor.type + if type_ == 'trailer': + return False + + if type_ == 'expr_stmt': + return node.start_pos < ancestor.children[-1].start_pos + + return is_definition(node, ancestor.parent) + + if is_definition(node, node.parent): + args = [c for c in node.children if c != ','] + starred = [c for c in args if c.type == 'star_expr'] + if len(starred) > 1: + message = "two starred expressions in assignment" + self.add_issue(starred[1], message=message) + elif starred: + count = args.index(starred[0]) + if count >= 256: + message = "too many expressions in star-unpacking assignment" + self.add_issue(starred[0], message=message) + + +@ErrorFinder.register_rule(type='annassign') +class _AnnotatorRule(SyntaxRule): + # True: int + # {}: float + message = "illegal target for annotation" + + def get_node(self, node): + return node.parent + + def is_issue(self, node): + type_ = None + lhs = node.parent.children[0] + lhs = _remove_parens(lhs) + try: + children = lhs.children + except AttributeError: + pass + else: + if ',' in children or lhs.type == 'atom' and children[0] == '(': + type_ = 'tuple' + elif lhs.type == 'atom' and children[0] == '[': + type_ = 'list' + trailer = children[-1] + + if type_ is None: + if not (lhs.type == 'name' + # subscript/attributes are allowed + or lhs.type in ('atom_expr', 'power') + and trailer.type == 'trailer' + and trailer.children[0] != '('): + return True + else: + # x, y: str + message = "only single target (not %s) can be annotated" + self.add_issue(lhs.parent, message=message % type_) + + +@ErrorFinder.register_rule(type='argument') +class _ArgumentRule(SyntaxRule): + def is_issue(self, node): + first = node.children[0] + if node.children[1] == '=' and first.type != 'name': + if first.type == 'lambdef': + # f(lambda: 1=1) + if self._normalizer.version < (3, 8): + message = "lambda cannot contain assignment" + else: + message = 'expression cannot contain assignment, perhaps you meant "=="?' + else: + # f(+x=1) + if self._normalizer.version < (3, 8): + message = "keyword can't be an expression" + else: + message = 'expression cannot contain assignment, perhaps you meant "=="?' + self.add_issue(first, message=message) + + +@ErrorFinder.register_rule(type='nonlocal_stmt') +class _NonlocalModuleLevelRule(SyntaxRule): + message = "nonlocal declaration not allowed at module level" + + def is_issue(self, node): + return self._normalizer.context.parent_context is None + + +@ErrorFinder.register_rule(type='arglist') +class _ArglistRule(SyntaxRule): + @property + def message(self): + if self._normalizer.version < (3, 7): + return "Generator expression must be parenthesized if not sole argument" + else: + return "Generator expression must be parenthesized" + + def is_issue(self, node): + first_arg = node.children[0] + if first_arg.type == 'argument' \ + and first_arg.children[1].type in _COMP_FOR_TYPES: + # e.g. foo(x for x in [], b) + return len(node.children) >= 2 + else: + arg_set = set() + kw_only = False + kw_unpacking_only = False + is_old_starred = False + # In python 3 this would be a bit easier (stars are part of + # argument), but we have to understand both. + for argument in node.children: + if argument == ',': + continue + + if argument in ('*', '**'): + # Python < 3.5 has the order engraved in the grammar + # file. No need to do anything here. + is_old_starred = True + continue + if is_old_starred: + is_old_starred = False + continue + + if argument.type == 'argument': + first = argument.children[0] + if first in ('*', '**'): + if first == '*': + if kw_unpacking_only: + # foo(**kwargs, *args) + message = "iterable argument unpacking " \ + "follows keyword argument unpacking" + self.add_issue(argument, message=message) + else: + kw_unpacking_only = True + else: # Is a keyword argument. + kw_only = True + if first.type == 'name': + if first.value in arg_set: + # f(x=1, x=2) + self.add_issue(first, message="keyword argument repeated") + else: + arg_set.add(first.value) + else: + if kw_unpacking_only: + # f(**x, y) + message = "positional argument follows keyword argument unpacking" + self.add_issue(argument, message=message) + elif kw_only: + # f(x=2, y) + message = "positional argument follows keyword argument" + self.add_issue(argument, message=message) + + +@ErrorFinder.register_rule(type='parameters') +@ErrorFinder.register_rule(type='lambdef') +class _ParameterRule(SyntaxRule): + # def f(x=3, y): pass + message = "non-default argument follows default argument" + + def is_issue(self, node): + param_names = set() + default_only = False + for p in _iter_params(node): + if p.name.value in param_names: + message = "duplicate argument '%s' in function definition" + self.add_issue(p.name, message=message % p.name.value) + param_names.add(p.name.value) + + if p.default is None and not p.star_count: + if default_only: + return True + else: + default_only = True + + +@ErrorFinder.register_rule(type='try_stmt') +class _TryStmtRule(SyntaxRule): + message = "default 'except:' must be last" + + def is_issue(self, try_stmt): + default_except = None + for except_clause in try_stmt.children[3::3]: + if except_clause in ('else', 'finally'): + break + if except_clause == 'except': + default_except = except_clause + elif default_except is not None: + self.add_issue(default_except, message=self.message) + + +@ErrorFinder.register_rule(type='fstring') +class _FStringRule(SyntaxRule): + _fstring_grammar = None + message_nested = "f-string: expressions nested too deeply" + message_conversion = "f-string: invalid conversion character: expected 's', 'r', or 'a'" + + def _check_format_spec(self, format_spec, depth): + self._check_fstring_contents(format_spec.children[1:], depth) + + def _check_fstring_expr(self, fstring_expr, depth): + if depth >= 2: + self.add_issue(fstring_expr, message=self.message_nested) + + conversion = fstring_expr.children[2] + if conversion.type == 'fstring_conversion': + name = conversion.children[1] + if name.value not in ('s', 'r', 'a'): + self.add_issue(name, message=self.message_conversion) + + format_spec = fstring_expr.children[-2] + if format_spec.type == 'fstring_format_spec': + self._check_format_spec(format_spec, depth + 1) + + def is_issue(self, fstring): + self._check_fstring_contents(fstring.children[1:-1]) + + def _check_fstring_contents(self, children, depth=0): + for fstring_content in children: + if fstring_content.type == 'fstring_expr': + self._check_fstring_expr(fstring_content, depth) + + +class _CheckAssignmentRule(SyntaxRule): + def _check_assignment(self, node, is_deletion=False): + error = None + type_ = node.type + if type_ == 'lambdef': + error = 'lambda' + elif type_ == 'atom': + first, second = node.children[:2] + error = _get_comprehension_type(node) + if error is None: + if second.type == 'dictorsetmaker': + if self._normalizer.version < (3, 8): + error = 'literal' + else: + if second.children[1] == ':': + error = 'dict display' + else: + error = 'set display' + elif first in ('(', '['): + if second.type == 'yield_expr': + error = 'yield expression' + elif second.type == 'testlist_comp': + # This is not a comprehension, they were handled + # further above. + for child in second.children[::2]: + self._check_assignment(child, is_deletion) + else: # Everything handled, must be useless brackets. + self._check_assignment(second, is_deletion) + elif type_ == 'keyword': + if self._normalizer.version < (3, 8): + error = 'keyword' + else: + error = str(node.value) + elif type_ == 'operator': + if node.value == '...': + error = 'Ellipsis' + elif type_ == 'comparison': + error = 'comparison' + elif type_ in ('string', 'number', 'strings'): + error = 'literal' + elif type_ == 'yield_expr': + # This one seems to be a slightly different warning in Python. + message = 'assignment to yield expression not possible' + self.add_issue(node, message=message) + elif type_ == 'test': + error = 'conditional expression' + elif type_ in ('atom_expr', 'power'): + if node.children[0] == 'await': + error = 'await expression' + elif node.children[-2] == '**': + error = 'operator' + else: + # Has a trailer + trailer = node.children[-1] + assert trailer.type == 'trailer' + if trailer.children[0] == '(': + error = 'function call' + elif type_ in ('testlist_star_expr', 'exprlist', 'testlist'): + for child in node.children[::2]: + self._check_assignment(child, is_deletion) + elif ('expr' in type_ and type_ != 'star_expr' # is a substring + or '_test' in type_ + or type_ in ('term', 'factor')): + error = 'operator' + + if error is not None: + cannot = "can't" if self._normalizer.version < (3, 8) else "cannot" + message = ' '.join([cannot, "delete" if is_deletion else "assign to", error]) + self.add_issue(node, message=message) + + +@ErrorFinder.register_rule(type='sync_comp_for') +class _CompForRule(_CheckAssignmentRule): + message = "asynchronous comprehension outside of an asynchronous function" + + def is_issue(self, node): + expr_list = node.children[1] + print(expr_list) + if expr_list.type != 'expr_list': # Already handled. + self._check_assignment(expr_list) + + return node.parent.children[0] == 'async' \ + and not self._normalizer.context.is_async_funcdef() + + +@ErrorFinder.register_rule(type='expr_stmt') +class _ExprStmtRule(_CheckAssignmentRule): + message = "illegal expression for augmented assignment" + + def is_issue(self, node): + for before_equal in node.children[:-2:2]: + self._check_assignment(before_equal) + + augassign = node.children[1] + if augassign != '=' and augassign.type != 'annassign': # Is augassign. + return node.children[0].type in ('testlist_star_expr', 'atom', 'testlist') + + +@ErrorFinder.register_rule(type='with_item') +class _WithItemRule(_CheckAssignmentRule): + def is_issue(self, with_item): + self._check_assignment(with_item.children[2]) + + +@ErrorFinder.register_rule(type='del_stmt') +class _DelStmtRule(_CheckAssignmentRule): + def is_issue(self, del_stmt): + child = del_stmt.children[1] + + if child.type != 'expr_list': # Already handled. + self._check_assignment(child, is_deletion=True) + + +@ErrorFinder.register_rule(type='expr_list') +class _ExprListRule(_CheckAssignmentRule): + def is_issue(self, expr_list): + for expr in expr_list.children[::2]: + self._check_assignment(expr) + + +@ErrorFinder.register_rule(type='for_stmt') +class _ForStmtRule(_CheckAssignmentRule): + def is_issue(self, for_stmt): + # Some of the nodes here are already used, so no else if + expr_list = for_stmt.children[1] + if expr_list.type != 'expr_list': # Already handled. + self._check_assignment(expr_list) diff --git a/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/python/grammar26.txt b/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/python/grammar26.txt new file mode 100644 index 0000000..d9cede2 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/python/grammar26.txt @@ -0,0 +1,159 @@ +# Grammar for Python + +# Note: Changing the grammar specified in this file will most likely +# require corresponding changes in the parser module +# (../Modules/parsermodule.c). If you can't make the changes to +# that module yourself, please co-ordinate the required changes +# with someone who can; ask around on python-dev for help. Fred +# Drake will probably be listening there. + +# NOTE WELL: You should also follow all the steps listed in PEP 306, +# "How to Change Python's Grammar" + +# Commands for Kees Blom's railroad program +#diagram:token NAME +#diagram:token NUMBER +#diagram:token STRING +#diagram:token NEWLINE +#diagram:token ENDMARKER +#diagram:token INDENT +#diagram:output\input python.bla +#diagram:token DEDENT +#diagram:output\textwidth 20.04cm\oddsidemargin 0.0cm\evensidemargin 0.0cm +#diagram:rules + +# Start symbols for the grammar: +# single_input is a single interactive statement; +# file_input is a module or sequence of commands read from an input file; +# eval_input is the input for the eval() and input() functions. +# NB: compound_stmt in single_input is followed by extra NEWLINE! +single_input: NEWLINE | simple_stmt | compound_stmt NEWLINE +file_input: (NEWLINE | stmt)* ENDMARKER +eval_input: testlist NEWLINE* ENDMARKER + +decorator: '@' dotted_name [ '(' [arglist] ')' ] NEWLINE +decorators: decorator+ +decorated: decorators (classdef | funcdef) +funcdef: 'def' NAME parameters ':' suite +parameters: '(' [varargslist] ')' +varargslist: ((fpdef ['=' test] ',')* + ('*' NAME [',' '**' NAME] | '**' NAME) | + fpdef ['=' test] (',' fpdef ['=' test])* [',']) +fpdef: NAME | '(' fplist ')' +fplist: fpdef (',' fpdef)* [','] + +stmt: simple_stmt | compound_stmt +simple_stmt: small_stmt (';' small_stmt)* [';'] NEWLINE +small_stmt: (expr_stmt | print_stmt | del_stmt | pass_stmt | flow_stmt | + import_stmt | global_stmt | exec_stmt | assert_stmt) +expr_stmt: testlist (augassign (yield_expr|testlist) | + ('=' (yield_expr|testlist))*) +augassign: ('+=' | '-=' | '*=' | '/=' | '%=' | '&=' | '|=' | '^=' | + '<<=' | '>>=' | '**=' | '//=') +# For normal assignments, additional restrictions enforced by the interpreter +print_stmt: 'print' ( [ test (',' test)* [','] ] | + '>>' test [ (',' test)+ [','] ] ) +del_stmt: 'del' exprlist +pass_stmt: 'pass' +flow_stmt: break_stmt | continue_stmt | return_stmt | raise_stmt | yield_stmt +break_stmt: 'break' +continue_stmt: 'continue' +return_stmt: 'return' [testlist] +yield_stmt: yield_expr +raise_stmt: 'raise' [test [',' test [',' test]]] +import_stmt: import_name | import_from +import_name: 'import' dotted_as_names +import_from: ('from' ('.'* dotted_name | '.'+) + 'import' ('*' | '(' import_as_names ')' | import_as_names)) +import_as_name: NAME ['as' NAME] +dotted_as_name: dotted_name ['as' NAME] +import_as_names: import_as_name (',' import_as_name)* [','] +dotted_as_names: dotted_as_name (',' dotted_as_name)* +dotted_name: NAME ('.' NAME)* +global_stmt: 'global' NAME (',' NAME)* +exec_stmt: 'exec' expr ['in' test [',' test]] +assert_stmt: 'assert' test [',' test] + +compound_stmt: if_stmt | while_stmt | for_stmt | try_stmt | with_stmt | funcdef | classdef | decorated +if_stmt: 'if' test ':' suite ('elif' test ':' suite)* ['else' ':' suite] +while_stmt: 'while' test ':' suite ['else' ':' suite] +for_stmt: 'for' exprlist 'in' testlist ':' suite ['else' ':' suite] +try_stmt: ('try' ':' suite + ((except_clause ':' suite)+ + ['else' ':' suite] + ['finally' ':' suite] | + 'finally' ':' suite)) +with_stmt: 'with' with_item ':' suite +# Dave: Python2.6 actually defines a little bit of a different label called +# 'with_var'. However in 2.7+ this is the default. Apply it for +# consistency reasons. +with_item: test ['as' expr] +# NB compile.c makes sure that the default except clause is last +except_clause: 'except' [test [('as' | ',') test]] +suite: simple_stmt | NEWLINE INDENT stmt+ DEDENT + +# Backward compatibility cruft to support: +# [ x for x in lambda: True, lambda: False if x() ] +# even while also allowing: +# lambda x: 5 if x else 2 +# (But not a mix of the two) +testlist_safe: old_test [(',' old_test)+ [',']] +old_test: or_test | old_lambdef +old_lambdef: 'lambda' [varargslist] ':' old_test + +test: or_test ['if' or_test 'else' test] | lambdef +or_test: and_test ('or' and_test)* +and_test: not_test ('and' not_test)* +not_test: 'not' not_test | comparison +comparison: expr (comp_op expr)* +comp_op: '<'|'>'|'=='|'>='|'<='|'<>'|'!='|'in'|'not' 'in'|'is'|'is' 'not' +expr: xor_expr ('|' xor_expr)* +xor_expr: and_expr ('^' and_expr)* +and_expr: shift_expr ('&' shift_expr)* +shift_expr: arith_expr (('<<'|'>>') arith_expr)* +arith_expr: term (('+'|'-') term)* +term: factor (('*'|'/'|'%'|'//') factor)* +factor: ('+'|'-'|'~') factor | power +power: atom trailer* ['**' factor] +atom: ('(' [yield_expr|testlist_comp] ')' | + '[' [listmaker] ']' | + '{' [dictorsetmaker] '}' | + '`' testlist1 '`' | + NAME | NUMBER | strings) +strings: STRING+ +listmaker: test ( list_for | (',' test)* [','] ) +# Dave: Renamed testlist_gexpr to testlist_comp, because in 2.7+ this is the +# default. It's more consistent like this. +testlist_comp: test ( gen_for | (',' test)* [','] ) +lambdef: 'lambda' [varargslist] ':' test +trailer: '(' [arglist] ')' | '[' subscriptlist ']' | '.' NAME +subscriptlist: subscript (',' subscript)* [','] +subscript: '.' '.' '.' | test | [test] ':' [test] [sliceop] +sliceop: ':' [test] +exprlist: expr (',' expr)* [','] +testlist: test (',' test)* [','] +# Dave: Rename from dictmaker to dictorsetmaker, because this is more +# consistent with the following grammars. +dictorsetmaker: test ':' test (',' test ':' test)* [','] + +classdef: 'class' NAME ['(' [testlist] ')'] ':' suite + +arglist: (argument ',')* (argument [','] + |'*' test (',' argument)* [',' '**' test] + |'**' test) +argument: test [gen_for] | test '=' test # Really [keyword '='] test + +list_iter: list_for | list_if +list_for: 'for' exprlist 'in' testlist_safe [list_iter] +list_if: 'if' old_test [list_iter] + +gen_iter: gen_for | gen_if +gen_for: 'for' exprlist 'in' or_test [gen_iter] +gen_if: 'if' old_test [gen_iter] + +testlist1: test (',' test)* + +# not used in grammar, but may appear in "node" passed from Parser to Compiler +encoding_decl: NAME + +yield_expr: 'yield' [testlist] diff --git a/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/python/grammar27.txt b/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/python/grammar27.txt new file mode 100644 index 0000000..ddb6847 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/python/grammar27.txt @@ -0,0 +1,143 @@ +# Grammar for Python + +# Note: Changing the grammar specified in this file will most likely +# require corresponding changes in the parser module +# (../Modules/parsermodule.c). If you can't make the changes to +# that module yourself, please co-ordinate the required changes +# with someone who can; ask around on python-dev for help. Fred +# Drake will probably be listening there. + +# NOTE WELL: You should also follow all the steps listed in PEP 306, +# "How to Change Python's Grammar" + +# Start symbols for the grammar: +# single_input is a single interactive statement; +# file_input is a module or sequence of commands read from an input file; +# eval_input is the input for the eval() and input() functions. +# NB: compound_stmt in single_input is followed by extra NEWLINE! +single_input: NEWLINE | simple_stmt | compound_stmt NEWLINE +file_input: (NEWLINE | stmt)* ENDMARKER +eval_input: testlist NEWLINE* ENDMARKER + +decorator: '@' dotted_name [ '(' [arglist] ')' ] NEWLINE +decorators: decorator+ +decorated: decorators (classdef | funcdef) +funcdef: 'def' NAME parameters ':' suite +parameters: '(' [varargslist] ')' +varargslist: ((fpdef ['=' test] ',')* + ('*' NAME [',' '**' NAME] | '**' NAME) | + fpdef ['=' test] (',' fpdef ['=' test])* [',']) +fpdef: NAME | '(' fplist ')' +fplist: fpdef (',' fpdef)* [','] + +stmt: simple_stmt | compound_stmt +simple_stmt: small_stmt (';' small_stmt)* [';'] NEWLINE +small_stmt: (expr_stmt | print_stmt | del_stmt | pass_stmt | flow_stmt | + import_stmt | global_stmt | exec_stmt | assert_stmt) +expr_stmt: testlist (augassign (yield_expr|testlist) | + ('=' (yield_expr|testlist))*) +augassign: ('+=' | '-=' | '*=' | '/=' | '%=' | '&=' | '|=' | '^=' | + '<<=' | '>>=' | '**=' | '//=') +# For normal assignments, additional restrictions enforced by the interpreter +print_stmt: 'print' ( [ test (',' test)* [','] ] | + '>>' test [ (',' test)+ [','] ] ) +del_stmt: 'del' exprlist +pass_stmt: 'pass' +flow_stmt: break_stmt | continue_stmt | return_stmt | raise_stmt | yield_stmt +break_stmt: 'break' +continue_stmt: 'continue' +return_stmt: 'return' [testlist] +yield_stmt: yield_expr +raise_stmt: 'raise' [test [',' test [',' test]]] +import_stmt: import_name | import_from +import_name: 'import' dotted_as_names +import_from: ('from' ('.'* dotted_name | '.'+) + 'import' ('*' | '(' import_as_names ')' | import_as_names)) +import_as_name: NAME ['as' NAME] +dotted_as_name: dotted_name ['as' NAME] +import_as_names: import_as_name (',' import_as_name)* [','] +dotted_as_names: dotted_as_name (',' dotted_as_name)* +dotted_name: NAME ('.' NAME)* +global_stmt: 'global' NAME (',' NAME)* +exec_stmt: 'exec' expr ['in' test [',' test]] +assert_stmt: 'assert' test [',' test] + +compound_stmt: if_stmt | while_stmt | for_stmt | try_stmt | with_stmt | funcdef | classdef | decorated +if_stmt: 'if' test ':' suite ('elif' test ':' suite)* ['else' ':' suite] +while_stmt: 'while' test ':' suite ['else' ':' suite] +for_stmt: 'for' exprlist 'in' testlist ':' suite ['else' ':' suite] +try_stmt: ('try' ':' suite + ((except_clause ':' suite)+ + ['else' ':' suite] + ['finally' ':' suite] | + 'finally' ':' suite)) +with_stmt: 'with' with_item (',' with_item)* ':' suite +with_item: test ['as' expr] +# NB compile.c makes sure that the default except clause is last +except_clause: 'except' [test [('as' | ',') test]] +suite: simple_stmt | NEWLINE INDENT stmt+ DEDENT + +# Backward compatibility cruft to support: +# [ x for x in lambda: True, lambda: False if x() ] +# even while also allowing: +# lambda x: 5 if x else 2 +# (But not a mix of the two) +testlist_safe: old_test [(',' old_test)+ [',']] +old_test: or_test | old_lambdef +old_lambdef: 'lambda' [varargslist] ':' old_test + +test: or_test ['if' or_test 'else' test] | lambdef +or_test: and_test ('or' and_test)* +and_test: not_test ('and' not_test)* +not_test: 'not' not_test | comparison +comparison: expr (comp_op expr)* +comp_op: '<'|'>'|'=='|'>='|'<='|'<>'|'!='|'in'|'not' 'in'|'is'|'is' 'not' +expr: xor_expr ('|' xor_expr)* +xor_expr: and_expr ('^' and_expr)* +and_expr: shift_expr ('&' shift_expr)* +shift_expr: arith_expr (('<<'|'>>') arith_expr)* +arith_expr: term (('+'|'-') term)* +term: factor (('*'|'/'|'%'|'//') factor)* +factor: ('+'|'-'|'~') factor | power +power: atom trailer* ['**' factor] +atom: ('(' [yield_expr|testlist_comp] ')' | + '[' [listmaker] ']' | + '{' [dictorsetmaker] '}' | + '`' testlist1 '`' | + NAME | NUMBER | strings) +strings: STRING+ +listmaker: test ( list_for | (',' test)* [','] ) +testlist_comp: test ( sync_comp_for | (',' test)* [','] ) +lambdef: 'lambda' [varargslist] ':' test +trailer: '(' [arglist] ')' | '[' subscriptlist ']' | '.' NAME +subscriptlist: subscript (',' subscript)* [','] +subscript: '.' '.' '.' | test | [test] ':' [test] [sliceop] +sliceop: ':' [test] +exprlist: expr (',' expr)* [','] +testlist: test (',' test)* [','] +dictorsetmaker: ( (test ':' test (sync_comp_for | (',' test ':' test)* [','])) | + (test (sync_comp_for | (',' test)* [','])) ) + +classdef: 'class' NAME ['(' [testlist] ')'] ':' suite + +arglist: (argument ',')* (argument [','] + |'*' test (',' argument)* [',' '**' test] + |'**' test) +# The reason that keywords are test nodes instead of NAME is that using NAME +# results in an ambiguity. ast.c makes sure it's a NAME. +argument: test [sync_comp_for] | test '=' test + +list_iter: list_for | list_if +list_for: 'for' exprlist 'in' testlist_safe [list_iter] +list_if: 'if' old_test [list_iter] + +comp_iter: sync_comp_for | comp_if +sync_comp_for: 'for' exprlist 'in' or_test [comp_iter] +comp_if: 'if' old_test [comp_iter] + +testlist1: test (',' test)* + +# not used in grammar, but may appear in "node" passed from Parser to Compiler +encoding_decl: NAME + +yield_expr: 'yield' [testlist] diff --git a/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/python/grammar33.txt b/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/python/grammar33.txt new file mode 100644 index 0000000..787a166 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/python/grammar33.txt @@ -0,0 +1,134 @@ +# Grammar for Python + +# Note: Changing the grammar specified in this file will most likely +# require corresponding changes in the parser module +# (../Modules/parsermodule.c). If you can't make the changes to +# that module yourself, please co-ordinate the required changes +# with someone who can; ask around on python-dev for help. Fred +# Drake will probably be listening there. + +# NOTE WELL: You should also follow all the steps listed in PEP 306, +# "How to Change Python's Grammar" + +# Start symbols for the grammar: +# single_input is a single interactive statement; +# file_input is a module or sequence of commands read from an input file; +# eval_input is the input for the eval() functions. +# NB: compound_stmt in single_input is followed by extra NEWLINE! +single_input: NEWLINE | simple_stmt | compound_stmt NEWLINE +file_input: (NEWLINE | stmt)* ENDMARKER +eval_input: testlist NEWLINE* ENDMARKER + +decorator: '@' dotted_name [ '(' [arglist] ')' ] NEWLINE +decorators: decorator+ +decorated: decorators (classdef | funcdef) +funcdef: 'def' NAME parameters ['->' test] ':' suite +parameters: '(' [typedargslist] ')' +typedargslist: (tfpdef ['=' test] (',' tfpdef ['=' test])* [',' + ['*' [tfpdef] (',' tfpdef ['=' test])* [',' '**' tfpdef] | '**' tfpdef]] + | '*' [tfpdef] (',' tfpdef ['=' test])* [',' '**' tfpdef] | '**' tfpdef) +tfpdef: NAME [':' test] +varargslist: (vfpdef ['=' test] (',' vfpdef ['=' test])* [',' + ['*' [vfpdef] (',' vfpdef ['=' test])* [',' '**' vfpdef] | '**' vfpdef]] + | '*' [vfpdef] (',' vfpdef ['=' test])* [',' '**' vfpdef] | '**' vfpdef) +vfpdef: NAME + +stmt: simple_stmt | compound_stmt +simple_stmt: small_stmt (';' small_stmt)* [';'] NEWLINE +small_stmt: (expr_stmt | del_stmt | pass_stmt | flow_stmt | + import_stmt | global_stmt | nonlocal_stmt | assert_stmt) +expr_stmt: testlist_star_expr (augassign (yield_expr|testlist) | + ('=' (yield_expr|testlist_star_expr))*) +testlist_star_expr: (test|star_expr) (',' (test|star_expr))* [','] +augassign: ('+=' | '-=' | '*=' | '/=' | '%=' | '&=' | '|=' | '^=' | + '<<=' | '>>=' | '**=' | '//=') +# For normal assignments, additional restrictions enforced by the interpreter +del_stmt: 'del' exprlist +pass_stmt: 'pass' +flow_stmt: break_stmt | continue_stmt | return_stmt | raise_stmt | yield_stmt +break_stmt: 'break' +continue_stmt: 'continue' +return_stmt: 'return' [testlist] +yield_stmt: yield_expr +raise_stmt: 'raise' [test ['from' test]] +import_stmt: import_name | import_from +import_name: 'import' dotted_as_names +# note below: the ('.' | '...') is necessary because '...' is tokenized as ELLIPSIS +import_from: ('from' (('.' | '...')* dotted_name | ('.' | '...')+) + 'import' ('*' | '(' import_as_names ')' | import_as_names)) +import_as_name: NAME ['as' NAME] +dotted_as_name: dotted_name ['as' NAME] +import_as_names: import_as_name (',' import_as_name)* [','] +dotted_as_names: dotted_as_name (',' dotted_as_name)* +dotted_name: NAME ('.' NAME)* +global_stmt: 'global' NAME (',' NAME)* +nonlocal_stmt: 'nonlocal' NAME (',' NAME)* +assert_stmt: 'assert' test [',' test] + +compound_stmt: if_stmt | while_stmt | for_stmt | try_stmt | with_stmt | funcdef | classdef | decorated +if_stmt: 'if' test ':' suite ('elif' test ':' suite)* ['else' ':' suite] +while_stmt: 'while' test ':' suite ['else' ':' suite] +for_stmt: 'for' exprlist 'in' testlist ':' suite ['else' ':' suite] +try_stmt: ('try' ':' suite + ((except_clause ':' suite)+ + ['else' ':' suite] + ['finally' ':' suite] | + 'finally' ':' suite)) +with_stmt: 'with' with_item (',' with_item)* ':' suite +with_item: test ['as' expr] +# NB compile.c makes sure that the default except clause is last +except_clause: 'except' [test ['as' NAME]] +suite: simple_stmt | NEWLINE INDENT stmt+ DEDENT + +test: or_test ['if' or_test 'else' test] | lambdef +test_nocond: or_test | lambdef_nocond +lambdef: 'lambda' [varargslist] ':' test +lambdef_nocond: 'lambda' [varargslist] ':' test_nocond +or_test: and_test ('or' and_test)* +and_test: not_test ('and' not_test)* +not_test: 'not' not_test | comparison +comparison: expr (comp_op expr)* +# <> isn't actually a valid comparison operator in Python. It's here for the +# sake of a __future__ import described in PEP 401 +comp_op: '<'|'>'|'=='|'>='|'<='|'<>'|'!='|'in'|'not' 'in'|'is'|'is' 'not' +star_expr: '*' expr +expr: xor_expr ('|' xor_expr)* +xor_expr: and_expr ('^' and_expr)* +and_expr: shift_expr ('&' shift_expr)* +shift_expr: arith_expr (('<<'|'>>') arith_expr)* +arith_expr: term (('+'|'-') term)* +term: factor (('*'|'/'|'%'|'//') factor)* +factor: ('+'|'-'|'~') factor | power +power: atom trailer* ['**' factor] +atom: ('(' [yield_expr|testlist_comp] ')' | + '[' [testlist_comp] ']' | + '{' [dictorsetmaker] '}' | + NAME | NUMBER | strings | '...' | 'None' | 'True' | 'False') +strings: STRING+ +testlist_comp: (test|star_expr) ( sync_comp_for | (',' (test|star_expr))* [','] ) +trailer: '(' [arglist] ')' | '[' subscriptlist ']' | '.' NAME +subscriptlist: subscript (',' subscript)* [','] +subscript: test | [test] ':' [test] [sliceop] +sliceop: ':' [test] +exprlist: (expr|star_expr) (',' (expr|star_expr))* [','] +testlist: test (',' test)* [','] +dictorsetmaker: ( (test ':' test (sync_comp_for | (',' test ':' test)* [','])) | + (test (sync_comp_for | (',' test)* [','])) ) + +classdef: 'class' NAME ['(' [arglist] ')'] ':' suite + +arglist: (argument ',')* (argument [','] + |'*' test (',' argument)* [',' '**' test] + |'**' test) +# The reason that keywords are test nodes instead of NAME is that using NAME +# results in an ambiguity. ast.c makes sure it's a NAME. +argument: test [sync_comp_for] | test '=' test # Really [keyword '='] test +comp_iter: sync_comp_for | comp_if +sync_comp_for: 'for' exprlist 'in' or_test [comp_iter] +comp_if: 'if' test_nocond [comp_iter] + +# not used in grammar, but may appear in "node" passed from Parser to Compiler +encoding_decl: NAME + +yield_expr: 'yield' [yield_arg] +yield_arg: 'from' test | testlist diff --git a/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/python/grammar34.txt b/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/python/grammar34.txt new file mode 100644 index 0000000..2b497d5 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/python/grammar34.txt @@ -0,0 +1,134 @@ +# Grammar for Python + +# Note: Changing the grammar specified in this file will most likely +# require corresponding changes in the parser module +# (../Modules/parsermodule.c). If you can't make the changes to +# that module yourself, please co-ordinate the required changes +# with someone who can; ask around on python-dev for help. Fred +# Drake will probably be listening there. + +# NOTE WELL: You should also follow all the steps listed at +# https://docs.python.org/devguide/grammar.html + +# Start symbols for the grammar: +# single_input is a single interactive statement; +# file_input is a module or sequence of commands read from an input file; +# eval_input is the input for the eval() functions. +# NB: compound_stmt in single_input is followed by extra NEWLINE! +single_input: NEWLINE | simple_stmt | compound_stmt NEWLINE +file_input: (NEWLINE | stmt)* ENDMARKER +eval_input: testlist NEWLINE* ENDMARKER + +decorator: '@' dotted_name [ '(' [arglist] ')' ] NEWLINE +decorators: decorator+ +decorated: decorators (classdef | funcdef) +funcdef: 'def' NAME parameters ['->' test] ':' suite +parameters: '(' [typedargslist] ')' +typedargslist: (tfpdef ['=' test] (',' tfpdef ['=' test])* [',' + ['*' [tfpdef] (',' tfpdef ['=' test])* [',' '**' tfpdef] | '**' tfpdef]] + | '*' [tfpdef] (',' tfpdef ['=' test])* [',' '**' tfpdef] | '**' tfpdef) +tfpdef: NAME [':' test] +varargslist: (vfpdef ['=' test] (',' vfpdef ['=' test])* [',' + ['*' [vfpdef] (',' vfpdef ['=' test])* [',' '**' vfpdef] | '**' vfpdef]] + | '*' [vfpdef] (',' vfpdef ['=' test])* [',' '**' vfpdef] | '**' vfpdef) +vfpdef: NAME + +stmt: simple_stmt | compound_stmt +simple_stmt: small_stmt (';' small_stmt)* [';'] NEWLINE +small_stmt: (expr_stmt | del_stmt | pass_stmt | flow_stmt | + import_stmt | global_stmt | nonlocal_stmt | assert_stmt) +expr_stmt: testlist_star_expr (augassign (yield_expr|testlist) | + ('=' (yield_expr|testlist_star_expr))*) +testlist_star_expr: (test|star_expr) (',' (test|star_expr))* [','] +augassign: ('+=' | '-=' | '*=' | '/=' | '%=' | '&=' | '|=' | '^=' | + '<<=' | '>>=' | '**=' | '//=') +# For normal assignments, additional restrictions enforced by the interpreter +del_stmt: 'del' exprlist +pass_stmt: 'pass' +flow_stmt: break_stmt | continue_stmt | return_stmt | raise_stmt | yield_stmt +break_stmt: 'break' +continue_stmt: 'continue' +return_stmt: 'return' [testlist] +yield_stmt: yield_expr +raise_stmt: 'raise' [test ['from' test]] +import_stmt: import_name | import_from +import_name: 'import' dotted_as_names +# note below: the ('.' | '...') is necessary because '...' is tokenized as ELLIPSIS +import_from: ('from' (('.' | '...')* dotted_name | ('.' | '...')+) + 'import' ('*' | '(' import_as_names ')' | import_as_names)) +import_as_name: NAME ['as' NAME] +dotted_as_name: dotted_name ['as' NAME] +import_as_names: import_as_name (',' import_as_name)* [','] +dotted_as_names: dotted_as_name (',' dotted_as_name)* +dotted_name: NAME ('.' NAME)* +global_stmt: 'global' NAME (',' NAME)* +nonlocal_stmt: 'nonlocal' NAME (',' NAME)* +assert_stmt: 'assert' test [',' test] + +compound_stmt: if_stmt | while_stmt | for_stmt | try_stmt | with_stmt | funcdef | classdef | decorated +if_stmt: 'if' test ':' suite ('elif' test ':' suite)* ['else' ':' suite] +while_stmt: 'while' test ':' suite ['else' ':' suite] +for_stmt: 'for' exprlist 'in' testlist ':' suite ['else' ':' suite] +try_stmt: ('try' ':' suite + ((except_clause ':' suite)+ + ['else' ':' suite] + ['finally' ':' suite] | + 'finally' ':' suite)) +with_stmt: 'with' with_item (',' with_item)* ':' suite +with_item: test ['as' expr] +# NB compile.c makes sure that the default except clause is last +except_clause: 'except' [test ['as' NAME]] +suite: simple_stmt | NEWLINE INDENT stmt+ DEDENT + +test: or_test ['if' or_test 'else' test] | lambdef +test_nocond: or_test | lambdef_nocond +lambdef: 'lambda' [varargslist] ':' test +lambdef_nocond: 'lambda' [varargslist] ':' test_nocond +or_test: and_test ('or' and_test)* +and_test: not_test ('and' not_test)* +not_test: 'not' not_test | comparison +comparison: expr (comp_op expr)* +# <> isn't actually a valid comparison operator in Python. It's here for the +# sake of a __future__ import described in PEP 401 +comp_op: '<'|'>'|'=='|'>='|'<='|'<>'|'!='|'in'|'not' 'in'|'is'|'is' 'not' +star_expr: '*' expr +expr: xor_expr ('|' xor_expr)* +xor_expr: and_expr ('^' and_expr)* +and_expr: shift_expr ('&' shift_expr)* +shift_expr: arith_expr (('<<'|'>>') arith_expr)* +arith_expr: term (('+'|'-') term)* +term: factor (('*'|'/'|'%'|'//') factor)* +factor: ('+'|'-'|'~') factor | power +power: atom trailer* ['**' factor] +atom: ('(' [yield_expr|testlist_comp] ')' | + '[' [testlist_comp] ']' | + '{' [dictorsetmaker] '}' | + NAME | NUMBER | strings | '...' | 'None' | 'True' | 'False') +strings: STRING+ +testlist_comp: (test|star_expr) ( sync_comp_for | (',' (test|star_expr))* [','] ) +trailer: '(' [arglist] ')' | '[' subscriptlist ']' | '.' NAME +subscriptlist: subscript (',' subscript)* [','] +subscript: test | [test] ':' [test] [sliceop] +sliceop: ':' [test] +exprlist: (expr|star_expr) (',' (expr|star_expr))* [','] +testlist: test (',' test)* [','] +dictorsetmaker: ( (test ':' test (sync_comp_for | (',' test ':' test)* [','])) | + (test (sync_comp_for | (',' test)* [','])) ) + +classdef: 'class' NAME ['(' [arglist] ')'] ':' suite + +arglist: (argument ',')* (argument [','] + |'*' test (',' argument)* [',' '**' test] + |'**' test) +# The reason that keywords are test nodes instead of NAME is that using NAME +# results in an ambiguity. ast.c makes sure it's a NAME. +argument: test [sync_comp_for] | test '=' test # Really [keyword '='] test +comp_iter: sync_comp_for | comp_if +sync_comp_for: 'for' exprlist 'in' or_test [comp_iter] +comp_if: 'if' test_nocond [comp_iter] + +# not used in grammar, but may appear in "node" passed from Parser to Compiler +encoding_decl: NAME + +yield_expr: 'yield' [yield_arg] +yield_arg: 'from' test | testlist diff --git a/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/python/grammar35.txt b/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/python/grammar35.txt new file mode 100644 index 0000000..e2ee9c7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/python/grammar35.txt @@ -0,0 +1,153 @@ +# Grammar for Python + +# Note: Changing the grammar specified in this file will most likely +# require corresponding changes in the parser module +# (../Modules/parsermodule.c). If you can't make the changes to +# that module yourself, please co-ordinate the required changes +# with someone who can; ask around on python-dev for help. Fred +# Drake will probably be listening there. + +# NOTE WELL: You should also follow all the steps listed at +# https://docs.python.org/devguide/grammar.html + +# Start symbols for the grammar: +# single_input is a single interactive statement; +# file_input is a module or sequence of commands read from an input file; +# eval_input is the input for the eval() functions. +# NB: compound_stmt in single_input is followed by extra NEWLINE! +single_input: NEWLINE | simple_stmt | compound_stmt NEWLINE +file_input: (NEWLINE | stmt)* ENDMARKER +eval_input: testlist NEWLINE* ENDMARKER + +decorator: '@' dotted_name [ '(' [arglist] ')' ] NEWLINE +decorators: decorator+ +decorated: decorators (classdef | funcdef | async_funcdef) + +# NOTE: Reinoud Elhorst, using ASYNC/AWAIT keywords instead of tokens +# skipping python3.5 compatibility, in favour of 3.7 solution +async_funcdef: 'async' funcdef +funcdef: 'def' NAME parameters ['->' test] ':' suite + +parameters: '(' [typedargslist] ')' +typedargslist: (tfpdef ['=' test] (',' tfpdef ['=' test])* [',' + ['*' [tfpdef] (',' tfpdef ['=' test])* [',' '**' tfpdef] | '**' tfpdef]] + | '*' [tfpdef] (',' tfpdef ['=' test])* [',' '**' tfpdef] | '**' tfpdef) +tfpdef: NAME [':' test] +varargslist: (vfpdef ['=' test] (',' vfpdef ['=' test])* [',' + ['*' [vfpdef] (',' vfpdef ['=' test])* [',' '**' vfpdef] | '**' vfpdef]] + | '*' [vfpdef] (',' vfpdef ['=' test])* [',' '**' vfpdef] | '**' vfpdef) +vfpdef: NAME + +stmt: simple_stmt | compound_stmt +simple_stmt: small_stmt (';' small_stmt)* [';'] NEWLINE +small_stmt: (expr_stmt | del_stmt | pass_stmt | flow_stmt | + import_stmt | global_stmt | nonlocal_stmt | assert_stmt) +expr_stmt: testlist_star_expr (augassign (yield_expr|testlist) | + ('=' (yield_expr|testlist_star_expr))*) +testlist_star_expr: (test|star_expr) (',' (test|star_expr))* [','] +augassign: ('+=' | '-=' | '*=' | '@=' | '/=' | '%=' | '&=' | '|=' | '^=' | + '<<=' | '>>=' | '**=' | '//=') +# For normal assignments, additional restrictions enforced by the interpreter +del_stmt: 'del' exprlist +pass_stmt: 'pass' +flow_stmt: break_stmt | continue_stmt | return_stmt | raise_stmt | yield_stmt +break_stmt: 'break' +continue_stmt: 'continue' +return_stmt: 'return' [testlist] +yield_stmt: yield_expr +raise_stmt: 'raise' [test ['from' test]] +import_stmt: import_name | import_from +import_name: 'import' dotted_as_names +# note below: the ('.' | '...') is necessary because '...' is tokenized as ELLIPSIS +import_from: ('from' (('.' | '...')* dotted_name | ('.' | '...')+) + 'import' ('*' | '(' import_as_names ')' | import_as_names)) +import_as_name: NAME ['as' NAME] +dotted_as_name: dotted_name ['as' NAME] +import_as_names: import_as_name (',' import_as_name)* [','] +dotted_as_names: dotted_as_name (',' dotted_as_name)* +dotted_name: NAME ('.' NAME)* +global_stmt: 'global' NAME (',' NAME)* +nonlocal_stmt: 'nonlocal' NAME (',' NAME)* +assert_stmt: 'assert' test [',' test] + +compound_stmt: if_stmt | while_stmt | for_stmt | try_stmt | with_stmt | funcdef | classdef | decorated | async_stmt +async_stmt: 'async' (funcdef | with_stmt | for_stmt) +if_stmt: 'if' test ':' suite ('elif' test ':' suite)* ['else' ':' suite] +while_stmt: 'while' test ':' suite ['else' ':' suite] +for_stmt: 'for' exprlist 'in' testlist ':' suite ['else' ':' suite] +try_stmt: ('try' ':' suite + ((except_clause ':' suite)+ + ['else' ':' suite] + ['finally' ':' suite] | + 'finally' ':' suite)) +with_stmt: 'with' with_item (',' with_item)* ':' suite +with_item: test ['as' expr] +# NB compile.c makes sure that the default except clause is last +except_clause: 'except' [test ['as' NAME]] +suite: simple_stmt | NEWLINE INDENT stmt+ DEDENT + +test: or_test ['if' or_test 'else' test] | lambdef +test_nocond: or_test | lambdef_nocond +lambdef: 'lambda' [varargslist] ':' test +lambdef_nocond: 'lambda' [varargslist] ':' test_nocond +or_test: and_test ('or' and_test)* +and_test: not_test ('and' not_test)* +not_test: 'not' not_test | comparison +comparison: expr (comp_op expr)* +# <> isn't actually a valid comparison operator in Python. It's here for the +# sake of a __future__ import described in PEP 401 (which really works :-) +comp_op: '<'|'>'|'=='|'>='|'<='|'<>'|'!='|'in'|'not' 'in'|'is'|'is' 'not' +star_expr: '*' expr +expr: xor_expr ('|' xor_expr)* +xor_expr: and_expr ('^' and_expr)* +and_expr: shift_expr ('&' shift_expr)* +shift_expr: arith_expr (('<<'|'>>') arith_expr)* +arith_expr: term (('+'|'-') term)* +term: factor (('*'|'@'|'/'|'%'|'//') factor)* +factor: ('+'|'-'|'~') factor | power +power: atom_expr ['**' factor] +atom_expr: ['await'] atom trailer* +atom: ('(' [yield_expr|testlist_comp] ')' | + '[' [testlist_comp] ']' | + '{' [dictorsetmaker] '}' | + NAME | NUMBER | strings | '...' | 'None' | 'True' | 'False') +strings: STRING+ +testlist_comp: (test|star_expr) ( sync_comp_for | (',' (test|star_expr))* [','] ) +trailer: '(' [arglist] ')' | '[' subscriptlist ']' | '.' NAME +subscriptlist: subscript (',' subscript)* [','] +subscript: test | [test] ':' [test] [sliceop] +sliceop: ':' [test] +exprlist: (expr|star_expr) (',' (expr|star_expr))* [','] +testlist: test (',' test)* [','] +dictorsetmaker: ( ((test ':' test | '**' expr) + (sync_comp_for | (',' (test ':' test | '**' expr))* [','])) | + ((test | star_expr) + (sync_comp_for | (',' (test | star_expr))* [','])) ) + +classdef: 'class' NAME ['(' [arglist] ')'] ':' suite + +arglist: argument (',' argument)* [','] + +# The reason that keywords are test nodes instead of NAME is that using NAME +# results in an ambiguity. ast.c makes sure it's a NAME. +# "test '=' test" is really "keyword '=' test", but we have no such token. +# These need to be in a single rule to avoid grammar that is ambiguous +# to our LL(1) parser. Even though 'test' includes '*expr' in star_expr, +# we explicitly match '*' here, too, to give it proper precedence. +# Illegal combinations and orderings are blocked in ast.c: +# multiple (test comp_for) arguments are blocked; keyword unpackings +# that precede iterable unpackings are blocked; etc. +argument: ( test [sync_comp_for] | + test '=' test | + '**' test | + '*' test ) + +comp_iter: sync_comp_for | comp_if +sync_comp_for: 'for' exprlist 'in' or_test [comp_iter] +comp_if: 'if' test_nocond [comp_iter] + +# not used in grammar, but may appear in "node" passed from Parser to Compiler +encoding_decl: NAME + +yield_expr: 'yield' [yield_arg] +yield_arg: 'from' test | testlist diff --git a/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/python/grammar36.txt b/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/python/grammar36.txt new file mode 100644 index 0000000..3e1e3e2 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/python/grammar36.txt @@ -0,0 +1,158 @@ +# Grammar for Python + +# NOTE WELL: You should also follow all the steps listed at +# https://docs.python.org/devguide/grammar.html + +# Start symbols for the grammar: +# single_input is a single interactive statement; +# file_input is a module or sequence of commands read from an input file; +# eval_input is the input for the eval() functions. +# NB: compound_stmt in single_input is followed by extra NEWLINE! +single_input: NEWLINE | simple_stmt | compound_stmt NEWLINE +file_input: (NEWLINE | stmt)* ENDMARKER +eval_input: testlist NEWLINE* ENDMARKER +decorator: '@' dotted_name [ '(' [arglist] ')' ] NEWLINE +decorators: decorator+ +decorated: decorators (classdef | funcdef | async_funcdef) + +# NOTE: Francisco Souza/Reinoud Elhorst, using ASYNC/'await' keywords instead of +# skipping python3.5+ compatibility, in favour of 3.7 solution +async_funcdef: 'async' funcdef +funcdef: 'def' NAME parameters ['->' test] ':' suite + +parameters: '(' [typedargslist] ')' +typedargslist: (tfpdef ['=' test] (',' tfpdef ['=' test])* [',' [ + '*' [tfpdef] (',' tfpdef ['=' test])* [',' ['**' tfpdef [',']]] + | '**' tfpdef [',']]] + | '*' [tfpdef] (',' tfpdef ['=' test])* [',' ['**' tfpdef [',']]] + | '**' tfpdef [',']) +tfpdef: NAME [':' test] +varargslist: (vfpdef ['=' test] (',' vfpdef ['=' test])* [',' [ + '*' [vfpdef] (',' vfpdef ['=' test])* [',' ['**' vfpdef [',']]] + | '**' vfpdef [',']]] + | '*' [vfpdef] (',' vfpdef ['=' test])* [',' ['**' vfpdef [',']]] + | '**' vfpdef [','] +) +vfpdef: NAME + +stmt: simple_stmt | compound_stmt +simple_stmt: small_stmt (';' small_stmt)* [';'] NEWLINE +small_stmt: (expr_stmt | del_stmt | pass_stmt | flow_stmt | + import_stmt | global_stmt | nonlocal_stmt | assert_stmt) +expr_stmt: testlist_star_expr (annassign | augassign (yield_expr|testlist) | + ('=' (yield_expr|testlist_star_expr))*) +annassign: ':' test ['=' test] +testlist_star_expr: (test|star_expr) (',' (test|star_expr))* [','] +augassign: ('+=' | '-=' | '*=' | '@=' | '/=' | '%=' | '&=' | '|=' | '^=' | + '<<=' | '>>=' | '**=' | '//=') +# For normal and annotated assignments, additional restrictions enforced by the interpreter +del_stmt: 'del' exprlist +pass_stmt: 'pass' +flow_stmt: break_stmt | continue_stmt | return_stmt | raise_stmt | yield_stmt +break_stmt: 'break' +continue_stmt: 'continue' +return_stmt: 'return' [testlist] +yield_stmt: yield_expr +raise_stmt: 'raise' [test ['from' test]] +import_stmt: import_name | import_from +import_name: 'import' dotted_as_names +# note below: the ('.' | '...') is necessary because '...' is tokenized as ELLIPSIS +import_from: ('from' (('.' | '...')* dotted_name | ('.' | '...')+) + 'import' ('*' | '(' import_as_names ')' | import_as_names)) +import_as_name: NAME ['as' NAME] +dotted_as_name: dotted_name ['as' NAME] +import_as_names: import_as_name (',' import_as_name)* [','] +dotted_as_names: dotted_as_name (',' dotted_as_name)* +dotted_name: NAME ('.' NAME)* +global_stmt: 'global' NAME (',' NAME)* +nonlocal_stmt: 'nonlocal' NAME (',' NAME)* +assert_stmt: 'assert' test [',' test] + +compound_stmt: if_stmt | while_stmt | for_stmt | try_stmt | with_stmt | funcdef | classdef | decorated | async_stmt +async_stmt: 'async' (funcdef | with_stmt | for_stmt) +if_stmt: 'if' test ':' suite ('elif' test ':' suite)* ['else' ':' suite] +while_stmt: 'while' test ':' suite ['else' ':' suite] +for_stmt: 'for' exprlist 'in' testlist ':' suite ['else' ':' suite] +try_stmt: ('try' ':' suite + ((except_clause ':' suite)+ + ['else' ':' suite] + ['finally' ':' suite] | + 'finally' ':' suite)) +with_stmt: 'with' with_item (',' with_item)* ':' suite +with_item: test ['as' expr] +# NB compile.c makes sure that the default except clause is last +except_clause: 'except' [test ['as' NAME]] +suite: simple_stmt | NEWLINE INDENT stmt+ DEDENT + +test: or_test ['if' or_test 'else' test] | lambdef +test_nocond: or_test | lambdef_nocond +lambdef: 'lambda' [varargslist] ':' test +lambdef_nocond: 'lambda' [varargslist] ':' test_nocond +or_test: and_test ('or' and_test)* +and_test: not_test ('and' not_test)* +not_test: 'not' not_test | comparison +comparison: expr (comp_op expr)* +# <> isn't actually a valid comparison operator in Python. It's here for the +# sake of a __future__ import described in PEP 401 (which really works :-) +comp_op: '<'|'>'|'=='|'>='|'<='|'<>'|'!='|'in'|'not' 'in'|'is'|'is' 'not' +star_expr: '*' expr +expr: xor_expr ('|' xor_expr)* +xor_expr: and_expr ('^' and_expr)* +and_expr: shift_expr ('&' shift_expr)* +shift_expr: arith_expr (('<<'|'>>') arith_expr)* +arith_expr: term (('+'|'-') term)* +term: factor (('*'|'@'|'/'|'%'|'//') factor)* +factor: ('+'|'-'|'~') factor | power +power: atom_expr ['**' factor] +atom_expr: ['await'] atom trailer* +atom: ('(' [yield_expr|testlist_comp] ')' | + '[' [testlist_comp] ']' | + '{' [dictorsetmaker] '}' | + NAME | NUMBER | strings | '...' | 'None' | 'True' | 'False') +testlist_comp: (test|star_expr) ( comp_for | (',' (test|star_expr))* [','] ) +trailer: '(' [arglist] ')' | '[' subscriptlist ']' | '.' NAME +subscriptlist: subscript (',' subscript)* [','] +subscript: test | [test] ':' [test] [sliceop] +sliceop: ':' [test] +exprlist: (expr|star_expr) (',' (expr|star_expr))* [','] +testlist: test (',' test)* [','] +dictorsetmaker: ( ((test ':' test | '**' expr) + (comp_for | (',' (test ':' test | '**' expr))* [','])) | + ((test | star_expr) + (comp_for | (',' (test | star_expr))* [','])) ) + +classdef: 'class' NAME ['(' [arglist] ')'] ':' suite + +arglist: argument (',' argument)* [','] + +# The reason that keywords are test nodes instead of NAME is that using NAME +# results in an ambiguity. ast.c makes sure it's a NAME. +# "test '=' test" is really "keyword '=' test", but we have no such token. +# These need to be in a single rule to avoid grammar that is ambiguous +# to our LL(1) parser. Even though 'test' includes '*expr' in star_expr, +# we explicitly match '*' here, too, to give it proper precedence. +# Illegal combinations and orderings are blocked in ast.c: +# multiple (test comp_for) arguments are blocked; keyword unpackings +# that precede iterable unpackings are blocked; etc. +argument: ( test [comp_for] | + test '=' test | + '**' test | + '*' test ) + +comp_iter: comp_for | comp_if +sync_comp_for: 'for' exprlist 'in' or_test [comp_iter] +comp_for: ['async'] sync_comp_for +comp_if: 'if' test_nocond [comp_iter] + +# not used in grammar, but may appear in "node" passed from Parser to Compiler +encoding_decl: NAME + +yield_expr: 'yield' [yield_arg] +yield_arg: 'from' test | testlist + +strings: (STRING | fstring)+ +fstring: FSTRING_START fstring_content* FSTRING_END +fstring_content: FSTRING_STRING | fstring_expr +fstring_conversion: '!' NAME +fstring_expr: '{' testlist_comp [ fstring_conversion ] [ fstring_format_spec ] '}' +fstring_format_spec: ':' fstring_content* diff --git a/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/python/grammar37.txt b/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/python/grammar37.txt new file mode 100644 index 0000000..3090b93 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/python/grammar37.txt @@ -0,0 +1,156 @@ +# Grammar for Python + +# NOTE WELL: You should also follow all the steps listed at +# https://docs.python.org/devguide/grammar.html + +# Start symbols for the grammar: +# single_input is a single interactive statement; +# file_input is a module or sequence of commands read from an input file; +# eval_input is the input for the eval() functions. +# NB: compound_stmt in single_input is followed by extra NEWLINE! +single_input: NEWLINE | simple_stmt | compound_stmt NEWLINE +file_input: (NEWLINE | stmt)* ENDMARKER +eval_input: testlist NEWLINE* ENDMARKER +decorator: '@' dotted_name [ '(' [arglist] ')' ] NEWLINE +decorators: decorator+ +decorated: decorators (classdef | funcdef | async_funcdef) + +async_funcdef: 'async' funcdef +funcdef: 'def' NAME parameters ['->' test] ':' suite + +parameters: '(' [typedargslist] ')' +typedargslist: (tfpdef ['=' test] (',' tfpdef ['=' test])* [',' [ + '*' [tfpdef] (',' tfpdef ['=' test])* [',' ['**' tfpdef [',']]] + | '**' tfpdef [',']]] + | '*' [tfpdef] (',' tfpdef ['=' test])* [',' ['**' tfpdef [',']]] + | '**' tfpdef [',']) +tfpdef: NAME [':' test] +varargslist: (vfpdef ['=' test] (',' vfpdef ['=' test])* [',' [ + '*' [vfpdef] (',' vfpdef ['=' test])* [',' ['**' vfpdef [',']]] + | '**' vfpdef [',']]] + | '*' [vfpdef] (',' vfpdef ['=' test])* [',' ['**' vfpdef [',']]] + | '**' vfpdef [','] +) +vfpdef: NAME + +stmt: simple_stmt | compound_stmt +simple_stmt: small_stmt (';' small_stmt)* [';'] NEWLINE +small_stmt: (expr_stmt | del_stmt | pass_stmt | flow_stmt | + import_stmt | global_stmt | nonlocal_stmt | assert_stmt) +expr_stmt: testlist_star_expr (annassign | augassign (yield_expr|testlist) | + ('=' (yield_expr|testlist_star_expr))*) +annassign: ':' test ['=' test] +testlist_star_expr: (test|star_expr) (',' (test|star_expr))* [','] +augassign: ('+=' | '-=' | '*=' | '@=' | '/=' | '%=' | '&=' | '|=' | '^=' | + '<<=' | '>>=' | '**=' | '//=') +# For normal and annotated assignments, additional restrictions enforced by the interpreter +del_stmt: 'del' exprlist +pass_stmt: 'pass' +flow_stmt: break_stmt | continue_stmt | return_stmt | raise_stmt | yield_stmt +break_stmt: 'break' +continue_stmt: 'continue' +return_stmt: 'return' [testlist] +yield_stmt: yield_expr +raise_stmt: 'raise' [test ['from' test]] +import_stmt: import_name | import_from +import_name: 'import' dotted_as_names +# note below: the ('.' | '...') is necessary because '...' is tokenized as ELLIPSIS +import_from: ('from' (('.' | '...')* dotted_name | ('.' | '...')+) + 'import' ('*' | '(' import_as_names ')' | import_as_names)) +import_as_name: NAME ['as' NAME] +dotted_as_name: dotted_name ['as' NAME] +import_as_names: import_as_name (',' import_as_name)* [','] +dotted_as_names: dotted_as_name (',' dotted_as_name)* +dotted_name: NAME ('.' NAME)* +global_stmt: 'global' NAME (',' NAME)* +nonlocal_stmt: 'nonlocal' NAME (',' NAME)* +assert_stmt: 'assert' test [',' test] + +compound_stmt: if_stmt | while_stmt | for_stmt | try_stmt | with_stmt | funcdef | classdef | decorated | async_stmt +async_stmt: 'async' (funcdef | with_stmt | for_stmt) +if_stmt: 'if' test ':' suite ('elif' test ':' suite)* ['else' ':' suite] +while_stmt: 'while' test ':' suite ['else' ':' suite] +for_stmt: 'for' exprlist 'in' testlist ':' suite ['else' ':' suite] +try_stmt: ('try' ':' suite + ((except_clause ':' suite)+ + ['else' ':' suite] + ['finally' ':' suite] | + 'finally' ':' suite)) +with_stmt: 'with' with_item (',' with_item)* ':' suite +with_item: test ['as' expr] +# NB compile.c makes sure that the default except clause is last +except_clause: 'except' [test ['as' NAME]] +suite: simple_stmt | NEWLINE INDENT stmt+ DEDENT + +test: or_test ['if' or_test 'else' test] | lambdef +test_nocond: or_test | lambdef_nocond +lambdef: 'lambda' [varargslist] ':' test +lambdef_nocond: 'lambda' [varargslist] ':' test_nocond +or_test: and_test ('or' and_test)* +and_test: not_test ('and' not_test)* +not_test: 'not' not_test | comparison +comparison: expr (comp_op expr)* +# <> isn't actually a valid comparison operator in Python. It's here for the +# sake of a __future__ import described in PEP 401 (which really works :-) +comp_op: '<'|'>'|'=='|'>='|'<='|'<>'|'!='|'in'|'not' 'in'|'is'|'is' 'not' +star_expr: '*' expr +expr: xor_expr ('|' xor_expr)* +xor_expr: and_expr ('^' and_expr)* +and_expr: shift_expr ('&' shift_expr)* +shift_expr: arith_expr (('<<'|'>>') arith_expr)* +arith_expr: term (('+'|'-') term)* +term: factor (('*'|'@'|'/'|'%'|'//') factor)* +factor: ('+'|'-'|'~') factor | power +power: atom_expr ['**' factor] +atom_expr: ['await'] atom trailer* +atom: ('(' [yield_expr|testlist_comp] ')' | + '[' [testlist_comp] ']' | + '{' [dictorsetmaker] '}' | + NAME | NUMBER | strings | '...' | 'None' | 'True' | 'False') +testlist_comp: (test|star_expr) ( comp_for | (',' (test|star_expr))* [','] ) +trailer: '(' [arglist] ')' | '[' subscriptlist ']' | '.' NAME +subscriptlist: subscript (',' subscript)* [','] +subscript: test | [test] ':' [test] [sliceop] +sliceop: ':' [test] +exprlist: (expr|star_expr) (',' (expr|star_expr))* [','] +testlist: test (',' test)* [','] +dictorsetmaker: ( ((test ':' test | '**' expr) + (comp_for | (',' (test ':' test | '**' expr))* [','])) | + ((test | star_expr) + (comp_for | (',' (test | star_expr))* [','])) ) + +classdef: 'class' NAME ['(' [arglist] ')'] ':' suite + +arglist: argument (',' argument)* [','] + +# The reason that keywords are test nodes instead of NAME is that using NAME +# results in an ambiguity. ast.c makes sure it's a NAME. +# "test '=' test" is really "keyword '=' test", but we have no such token. +# These need to be in a single rule to avoid grammar that is ambiguous +# to our LL(1) parser. Even though 'test' includes '*expr' in star_expr, +# we explicitly match '*' here, too, to give it proper precedence. +# Illegal combinations and orderings are blocked in ast.c: +# multiple (test comp_for) arguments are blocked; keyword unpackings +# that precede iterable unpackings are blocked; etc. +argument: ( test [comp_for] | + test '=' test | + '**' test | + '*' test ) + +comp_iter: comp_for | comp_if +sync_comp_for: 'for' exprlist 'in' or_test [comp_iter] +comp_for: ['async'] sync_comp_for +comp_if: 'if' test_nocond [comp_iter] + +# not used in grammar, but may appear in "node" passed from Parser to Compiler +encoding_decl: NAME + +yield_expr: 'yield' [yield_arg] +yield_arg: 'from' test | testlist + +strings: (STRING | fstring)+ +fstring: FSTRING_START fstring_content* FSTRING_END +fstring_content: FSTRING_STRING | fstring_expr +fstring_conversion: '!' NAME +fstring_expr: '{' testlist [ fstring_conversion ] [ fstring_format_spec ] '}' +fstring_format_spec: ':' fstring_content* diff --git a/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/python/grammar38.txt b/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/python/grammar38.txt new file mode 100644 index 0000000..1cea0fa --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/python/grammar38.txt @@ -0,0 +1,171 @@ +# Grammar for Python + +# NOTE WELL: You should also follow all the steps listed at +# https://devguide.python.org/grammar/ + +# Start symbols for the grammar: +# single_input is a single interactive statement; +# file_input is a module or sequence of commands read from an input file; +# eval_input is the input for the eval() functions. +# NB: compound_stmt in single_input is followed by extra NEWLINE! +single_input: NEWLINE | simple_stmt | compound_stmt NEWLINE +file_input: (NEWLINE | stmt)* ENDMARKER +eval_input: testlist NEWLINE* ENDMARKER + +decorator: '@' dotted_name [ '(' [arglist] ')' ] NEWLINE +decorators: decorator+ +decorated: decorators (classdef | funcdef | async_funcdef) + +async_funcdef: 'async' funcdef +funcdef: 'def' NAME parameters ['->' test] ':' suite + +parameters: '(' [typedargslist] ')' +typedargslist: ( + (tfpdef ['=' test] (',' tfpdef ['=' test])* ',' '/' [',' [ tfpdef ['=' test] ( + ',' tfpdef ['=' test])* ([',' [ + '*' [tfpdef] (',' tfpdef ['=' test])* [',' ['**' tfpdef [',']]] + | '**' tfpdef [',']]]) + | '*' [tfpdef] (',' tfpdef ['=' test])* ([',' ['**' tfpdef [',']]]) + | '**' tfpdef [',']]] ) +| (tfpdef ['=' test] (',' tfpdef ['=' test])* [',' [ + '*' [tfpdef] (',' tfpdef ['=' test])* [',' ['**' tfpdef [',']]] + | '**' tfpdef [',']]] + | '*' [tfpdef] (',' tfpdef ['=' test])* [',' ['**' tfpdef [',']]] + | '**' tfpdef [',']) +) +tfpdef: NAME [':' test] +varargslist: vfpdef ['=' test ](',' vfpdef ['=' test])* ',' '/' [',' [ (vfpdef ['=' test] (',' vfpdef ['=' test])* [',' [ + '*' [vfpdef] (',' vfpdef ['=' test])* [',' ['**' vfpdef [',']]] + | '**' vfpdef [',']]] + | '*' [vfpdef] (',' vfpdef ['=' test])* [',' ['**' vfpdef [',']]] + | '**' vfpdef [',']) ]] | (vfpdef ['=' test] (',' vfpdef ['=' test])* [',' [ + '*' [vfpdef] (',' vfpdef ['=' test])* [',' ['**' vfpdef [',']]] + | '**' vfpdef [',']]] + | '*' [vfpdef] (',' vfpdef ['=' test])* [',' ['**' vfpdef [',']]] + | '**' vfpdef [','] +) +vfpdef: NAME + +stmt: simple_stmt | compound_stmt +simple_stmt: small_stmt (';' small_stmt)* [';'] NEWLINE +small_stmt: (expr_stmt | del_stmt | pass_stmt | flow_stmt | + import_stmt | global_stmt | nonlocal_stmt | assert_stmt) +expr_stmt: testlist_star_expr (annassign | augassign (yield_expr|testlist) | + ('=' (yield_expr|testlist_star_expr))*) +annassign: ':' test ['=' test] +testlist_star_expr: (test|star_expr) (',' (test|star_expr))* [','] +augassign: ('+=' | '-=' | '*=' | '@=' | '/=' | '%=' | '&=' | '|=' | '^=' | + '<<=' | '>>=' | '**=' | '//=') +# For normal and annotated assignments, additional restrictions enforced by the interpreter +del_stmt: 'del' exprlist +pass_stmt: 'pass' +flow_stmt: break_stmt | continue_stmt | return_stmt | raise_stmt | yield_stmt +break_stmt: 'break' +continue_stmt: 'continue' +return_stmt: 'return' [testlist_star_expr] +yield_stmt: yield_expr +raise_stmt: 'raise' [test ['from' test]] +import_stmt: import_name | import_from +import_name: 'import' dotted_as_names +# note below: the ('.' | '...') is necessary because '...' is tokenized as ELLIPSIS +import_from: ('from' (('.' | '...')* dotted_name | ('.' | '...')+) + 'import' ('*' | '(' import_as_names ')' | import_as_names)) +import_as_name: NAME ['as' NAME] +dotted_as_name: dotted_name ['as' NAME] +import_as_names: import_as_name (',' import_as_name)* [','] +dotted_as_names: dotted_as_name (',' dotted_as_name)* +dotted_name: NAME ('.' NAME)* +global_stmt: 'global' NAME (',' NAME)* +nonlocal_stmt: 'nonlocal' NAME (',' NAME)* +assert_stmt: 'assert' test [',' test] + +compound_stmt: if_stmt | while_stmt | for_stmt | try_stmt | with_stmt | funcdef | classdef | decorated | async_stmt +async_stmt: 'async' (funcdef | with_stmt | for_stmt) +if_stmt: 'if' namedexpr_test ':' suite ('elif' namedexpr_test ':' suite)* ['else' ':' suite] +while_stmt: 'while' namedexpr_test ':' suite ['else' ':' suite] +for_stmt: 'for' exprlist 'in' testlist ':' suite ['else' ':' suite] +try_stmt: ('try' ':' suite + ((except_clause ':' suite)+ + ['else' ':' suite] + ['finally' ':' suite] | + 'finally' ':' suite)) +with_stmt: 'with' with_item (',' with_item)* ':' suite +with_item: test ['as' expr] +# NB compile.c makes sure that the default except clause is last +except_clause: 'except' [test ['as' NAME]] +suite: simple_stmt | NEWLINE INDENT stmt+ DEDENT + +namedexpr_test: test [':=' test] +test: or_test ['if' or_test 'else' test] | lambdef +test_nocond: or_test | lambdef_nocond +lambdef: 'lambda' [varargslist] ':' test +lambdef_nocond: 'lambda' [varargslist] ':' test_nocond +or_test: and_test ('or' and_test)* +and_test: not_test ('and' not_test)* +not_test: 'not' not_test | comparison +comparison: expr (comp_op expr)* +# <> isn't actually a valid comparison operator in Python. It's here for the +# sake of a __future__ import described in PEP 401 (which really works :-) +comp_op: '<'|'>'|'=='|'>='|'<='|'<>'|'!='|'in'|'not' 'in'|'is'|'is' 'not' +star_expr: '*' expr +expr: xor_expr ('|' xor_expr)* +xor_expr: and_expr ('^' and_expr)* +and_expr: shift_expr ('&' shift_expr)* +shift_expr: arith_expr (('<<'|'>>') arith_expr)* +arith_expr: term (('+'|'-') term)* +term: factor (('*'|'@'|'/'|'%'|'//') factor)* +factor: ('+'|'-'|'~') factor | power +power: atom_expr ['**' factor] +atom_expr: ['await'] atom trailer* +atom: ('(' [yield_expr|testlist_comp] ')' | + '[' [testlist_comp] ']' | + '{' [dictorsetmaker] '}' | + NAME | NUMBER | strings | '...' | 'None' | 'True' | 'False') +testlist_comp: (namedexpr_test|star_expr) ( comp_for | (',' (namedexpr_test|star_expr))* [','] ) +trailer: '(' [arglist] ')' | '[' subscriptlist ']' | '.' NAME +subscriptlist: subscript (',' subscript)* [','] +subscript: test | [test] ':' [test] [sliceop] +sliceop: ':' [test] +exprlist: (expr|star_expr) (',' (expr|star_expr))* [','] +testlist: test (',' test)* [','] +dictorsetmaker: ( ((test ':' test | '**' expr) + (comp_for | (',' (test ':' test | '**' expr))* [','])) | + ((test | star_expr) + (comp_for | (',' (test | star_expr))* [','])) ) + +classdef: 'class' NAME ['(' [arglist] ')'] ':' suite + +arglist: argument (',' argument)* [','] + +# The reason that keywords are test nodes instead of NAME is that using NAME +# results in an ambiguity. ast.c makes sure it's a NAME. +# "test '=' test" is really "keyword '=' test", but we have no such token. +# These need to be in a single rule to avoid grammar that is ambiguous +# to our LL(1) parser. Even though 'test' includes '*expr' in star_expr, +# we explicitly match '*' here, too, to give it proper precedence. +# Illegal combinations and orderings are blocked in ast.c: +# multiple (test comp_for) arguments are blocked; keyword unpackings +# that precede iterable unpackings are blocked; etc. +argument: ( test [comp_for] | + test ':=' test | + test '=' test | + '**' test | + '*' test ) + +comp_iter: comp_for | comp_if +sync_comp_for: 'for' exprlist 'in' or_test [comp_iter] +comp_for: ['async'] sync_comp_for +comp_if: 'if' test_nocond [comp_iter] + +# not used in grammar, but may appear in "node" passed from Parser to Compiler +encoding_decl: NAME + +yield_expr: 'yield' [yield_arg] +yield_arg: 'from' test | testlist_star_expr + +strings: (STRING | fstring)+ +fstring: FSTRING_START fstring_content* FSTRING_END +fstring_content: FSTRING_STRING | fstring_expr +fstring_conversion: '!' NAME +fstring_expr: '{' testlist ['='] [ fstring_conversion ] [ fstring_format_spec ] '}' +fstring_format_spec: ':' fstring_content* diff --git a/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/python/parser.py b/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/python/parser.py new file mode 100644 index 0000000..46bdc77 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/python/parser.py @@ -0,0 +1,218 @@ +from parso.python import tree +from parso.python.token import PythonTokenTypes +from parso.parser import BaseParser + + +NAME = PythonTokenTypes.NAME +INDENT = PythonTokenTypes.INDENT +DEDENT = PythonTokenTypes.DEDENT + + +class Parser(BaseParser): + """ + This class is used to parse a Python file, it then divides them into a + class structure of different scopes. + + :param pgen_grammar: The grammar object of pgen2. Loaded by load_grammar. + """ + + node_map = { + 'expr_stmt': tree.ExprStmt, + 'classdef': tree.Class, + 'funcdef': tree.Function, + 'file_input': tree.Module, + 'import_name': tree.ImportName, + 'import_from': tree.ImportFrom, + 'break_stmt': tree.KeywordStatement, + 'continue_stmt': tree.KeywordStatement, + 'return_stmt': tree.ReturnStmt, + 'raise_stmt': tree.KeywordStatement, + 'yield_expr': tree.YieldExpr, + 'del_stmt': tree.KeywordStatement, + 'pass_stmt': tree.KeywordStatement, + 'global_stmt': tree.GlobalStmt, + 'nonlocal_stmt': tree.KeywordStatement, + 'print_stmt': tree.KeywordStatement, + 'assert_stmt': tree.AssertStmt, + 'if_stmt': tree.IfStmt, + 'with_stmt': tree.WithStmt, + 'for_stmt': tree.ForStmt, + 'while_stmt': tree.WhileStmt, + 'try_stmt': tree.TryStmt, + 'sync_comp_for': tree.SyncCompFor, + # Not sure if this is the best idea, but IMO it's the easiest way to + # avoid extreme amounts of work around the subtle difference of 2/3 + # grammar in list comoprehensions. + 'list_for': tree.SyncCompFor, + # Same here. This just exists in Python 2.6. + 'gen_for': tree.SyncCompFor, + 'decorator': tree.Decorator, + 'lambdef': tree.Lambda, + 'old_lambdef': tree.Lambda, + 'lambdef_nocond': tree.Lambda, + } + default_node = tree.PythonNode + + # Names/Keywords are handled separately + _leaf_map = { + PythonTokenTypes.STRING: tree.String, + PythonTokenTypes.NUMBER: tree.Number, + PythonTokenTypes.NEWLINE: tree.Newline, + PythonTokenTypes.ENDMARKER: tree.EndMarker, + PythonTokenTypes.FSTRING_STRING: tree.FStringString, + PythonTokenTypes.FSTRING_START: tree.FStringStart, + PythonTokenTypes.FSTRING_END: tree.FStringEnd, + } + + def __init__(self, pgen_grammar, error_recovery=True, start_nonterminal='file_input'): + super(Parser, self).__init__(pgen_grammar, start_nonterminal, + error_recovery=error_recovery) + + self.syntax_errors = [] + self._omit_dedent_list = [] + self._indent_counter = 0 + + def parse(self, tokens): + if self._error_recovery: + if self._start_nonterminal != 'file_input': + raise NotImplementedError + + tokens = self._recovery_tokenize(tokens) + + return super(Parser, self).parse(tokens) + + def convert_node(self, nonterminal, children): + """ + Convert raw node information to a PythonBaseNode instance. + + This is passed to the parser driver which calls it whenever a reduction of a + grammar rule produces a new complete node, so that the tree is build + strictly bottom-up. + """ + try: + node = self.node_map[nonterminal](children) + except KeyError: + if nonterminal == 'suite': + # We don't want the INDENT/DEDENT in our parser tree. Those + # leaves are just cancer. They are virtual leaves and not real + # ones and therefore have pseudo start/end positions and no + # prefixes. Just ignore them. + children = [children[0]] + children[2:-1] + elif nonterminal == 'list_if': + # Make transitioning from 2 to 3 easier. + nonterminal = 'comp_if' + elif nonterminal == 'listmaker': + # Same as list_if above. + nonterminal = 'testlist_comp' + node = self.default_node(nonterminal, children) + for c in children: + c.parent = node + return node + + def convert_leaf(self, type, value, prefix, start_pos): + # print('leaf', repr(value), token.tok_name[type]) + if type == NAME: + if value in self._pgen_grammar.reserved_syntax_strings: + return tree.Keyword(value, start_pos, prefix) + else: + return tree.Name(value, start_pos, prefix) + + return self._leaf_map.get(type, tree.Operator)(value, start_pos, prefix) + + def error_recovery(self, token): + tos_nodes = self.stack[-1].nodes + if tos_nodes: + last_leaf = tos_nodes[-1].get_last_leaf() + else: + last_leaf = None + + if self._start_nonterminal == 'file_input' and \ + (token.type == PythonTokenTypes.ENDMARKER + or token.type == DEDENT and '\n' not in last_leaf.value + and '\r' not in last_leaf.value): + # In Python statements need to end with a newline. But since it's + # possible (and valid in Python ) that there's no newline at the + # end of a file, we have to recover even if the user doesn't want + # error recovery. + if self.stack[-1].dfa.from_rule == 'simple_stmt': + try: + plan = self.stack[-1].dfa.transitions[PythonTokenTypes.NEWLINE] + except KeyError: + pass + else: + if plan.next_dfa.is_final and not plan.dfa_pushes: + # We are ignoring here that the newline would be + # required for a simple_stmt. + self.stack[-1].dfa = plan.next_dfa + self._add_token(token) + return + + if not self._error_recovery: + return super(Parser, self).error_recovery(token) + + def current_suite(stack): + # For now just discard everything that is not a suite or + # file_input, if we detect an error. + for until_index, stack_node in reversed(list(enumerate(stack))): + # `suite` can sometimes be only simple_stmt, not stmt. + if stack_node.nonterminal == 'file_input': + break + elif stack_node.nonterminal == 'suite': + # In the case where we just have a newline we don't want to + # do error recovery here. In all other cases, we want to do + # error recovery. + if len(stack_node.nodes) != 1: + break + return until_index + + until_index = current_suite(self.stack) + + if self._stack_removal(until_index + 1): + self._add_token(token) + else: + typ, value, start_pos, prefix = token + if typ == INDENT: + # For every deleted INDENT we have to delete a DEDENT as well. + # Otherwise the parser will get into trouble and DEDENT too early. + self._omit_dedent_list.append(self._indent_counter) + + error_leaf = tree.PythonErrorLeaf(typ.name, value, start_pos, prefix) + self.stack[-1].nodes.append(error_leaf) + + tos = self.stack[-1] + if tos.nonterminal == 'suite': + # Need at least one statement in the suite. This happend with the + # error recovery above. + try: + tos.dfa = tos.dfa.arcs['stmt'] + except KeyError: + # We're already in a final state. + pass + + def _stack_removal(self, start_index): + all_nodes = [node for stack_node in self.stack[start_index:] for node in stack_node.nodes] + + if all_nodes: + node = tree.PythonErrorNode(all_nodes) + for n in all_nodes: + n.parent = node + self.stack[start_index - 1].nodes.append(node) + + self.stack[start_index:] = [] + return bool(all_nodes) + + def _recovery_tokenize(self, tokens): + for token in tokens: + typ = token[0] + if typ == DEDENT: + # We need to count indents, because if we just omit any DEDENT, + # we might omit them in the wrong place. + o = self._omit_dedent_list + if o and o[-1] == self._indent_counter: + o.pop() + continue + + self._indent_counter -= 1 + elif typ == INDENT: + self._indent_counter += 1 + yield token diff --git a/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/python/pep8.py b/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/python/pep8.py new file mode 100644 index 0000000..2a037f9 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/python/pep8.py @@ -0,0 +1,727 @@ +import re +from contextlib import contextmanager + +from parso.python.errors import ErrorFinder, ErrorFinderConfig +from parso.normalizer import Rule +from parso.python.tree import search_ancestor, Flow, Scope + + +_IMPORT_TYPES = ('import_name', 'import_from') +_SUITE_INTRODUCERS = ('classdef', 'funcdef', 'if_stmt', 'while_stmt', + 'for_stmt', 'try_stmt', 'with_stmt') +_NON_STAR_TYPES = ('term', 'import_from', 'power') +_OPENING_BRACKETS = '(', '[', '{' +_CLOSING_BRACKETS = ')', ']', '}' +_FACTOR = '+', '-', '~' +_ALLOW_SPACE = '*', '+', '-', '**', '/', '//', '@' +_BITWISE_OPERATOR = '<<', '>>', '|', '&', '^' +_NEEDS_SPACE = ('=', '%', '->', + '<', '>', '==', '>=', '<=', '<>', '!=', + '+=', '-=', '*=', '@=', '/=', '%=', '&=', '|=', '^=', '<<=', + '>>=', '**=', '//=') +_NEEDS_SPACE += _BITWISE_OPERATOR +_IMPLICIT_INDENTATION_TYPES = ('dictorsetmaker', 'argument') +_POSSIBLE_SLICE_PARENTS = ('subscript', 'subscriptlist', 'sliceop') + + +class IndentationTypes(object): + VERTICAL_BRACKET = object() + HANGING_BRACKET = object() + BACKSLASH = object() + SUITE = object() + IMPLICIT = object() + + +class IndentationNode(object): + type = IndentationTypes.SUITE + + def __init__(self, config, indentation, parent=None): + self.bracket_indentation = self.indentation = indentation + self.parent = parent + + def __repr__(self): + return '<%s>' % self.__class__.__name__ + + def get_latest_suite_node(self): + n = self + while n is not None: + if n.type == IndentationTypes.SUITE: + return n + + n = n.parent + + +class BracketNode(IndentationNode): + def __init__(self, config, leaf, parent, in_suite_introducer=False): + self.leaf = leaf + + # Figure out here what the indentation is. For chained brackets + # we can basically use the previous indentation. + previous_leaf = leaf + n = parent + if n.type == IndentationTypes.IMPLICIT: + n = n.parent + while True: + if hasattr(n, 'leaf') and previous_leaf.line != n.leaf.line: + break + + previous_leaf = previous_leaf.get_previous_leaf() + if not isinstance(n, BracketNode) or previous_leaf != n.leaf: + break + n = n.parent + parent_indentation = n.indentation + + + next_leaf = leaf.get_next_leaf() + if '\n' in next_leaf.prefix: + # This implies code like: + # foobarbaz( + # a, + # b, + # ) + self.bracket_indentation = parent_indentation \ + + config.closing_bracket_hanging_indentation + self.indentation = parent_indentation + config.indentation + self.type = IndentationTypes.HANGING_BRACKET + else: + # Implies code like: + # foobarbaz( + # a, + # b, + # ) + expected_end_indent = leaf.end_pos[1] + if '\t' in config.indentation: + self.indentation = None + else: + self.indentation = ' ' * expected_end_indent + self.bracket_indentation = self.indentation + self.type = IndentationTypes.VERTICAL_BRACKET + + if in_suite_introducer and parent.type == IndentationTypes.SUITE \ + and self.indentation == parent_indentation + config.indentation: + self.indentation += config.indentation + # The closing bracket should have the same indentation. + self.bracket_indentation = self.indentation + self.parent = parent + + +class ImplicitNode(BracketNode): + """ + Implicit indentation after keyword arguments, default arguments, + annotations and dict values. + """ + def __init__(self, config, leaf, parent): + super(ImplicitNode, self).__init__(config, leaf, parent) + self.type = IndentationTypes.IMPLICIT + + next_leaf = leaf.get_next_leaf() + if leaf == ':' and '\n' not in next_leaf.prefix: + self.indentation += ' ' + + +class BackslashNode(IndentationNode): + type = IndentationTypes.BACKSLASH + + def __init__(self, config, parent_indentation, containing_leaf, spacing, parent=None): + expr_stmt = search_ancestor(containing_leaf, 'expr_stmt') + if expr_stmt is not None: + equals = expr_stmt.children[-2] + + if '\t' in config.indentation: + # TODO unite with the code of BracketNode + self.indentation = None + else: + # If the backslash follows the equals, use normal indentation + # otherwise it should align with the equals. + if equals.end_pos == spacing.start_pos: + self.indentation = parent_indentation + config.indentation + else: + # +1 because there is a space. + self.indentation = ' ' * (equals.end_pos[1] + 1) + else: + self.indentation = parent_indentation + config.indentation + self.bracket_indentation = self.indentation + self.parent = parent + + +def _is_magic_name(name): + return name.value.startswith('__') and name.value.endswith('__') + + +class PEP8Normalizer(ErrorFinder): + def __init__(self, *args, **kwargs): + super(PEP8Normalizer, self).__init__(*args, **kwargs) + self._previous_part = None + self._previous_leaf = None + self._on_newline = True + self._newline_count = 0 + self._wanted_newline_count = None + self._max_new_lines_in_prefix = 0 + self._new_statement = True + self._implicit_indentation_possible = False + # The top of stack of the indentation nodes. + self._indentation_tos = self._last_indentation_tos = \ + IndentationNode(self._config, indentation='') + self._in_suite_introducer = False + + if ' ' in self._config.indentation: + self._indentation_type = 'spaces' + self._wrong_indentation_char = '\t' + else: + self._indentation_type = 'tabs' + self._wrong_indentation_char = ' ' + + @contextmanager + def visit_node(self, node): + with super(PEP8Normalizer, self).visit_node(node): + with self._visit_node(node): + yield + + @contextmanager + def _visit_node(self, node): + typ = node.type + + if typ in 'import_name': + names = node.get_defined_names() + if len(names) > 1: + for name in names[:1]: + self.add_issue(name, 401, 'Multiple imports on one line') + elif typ == 'lambdef': + expr_stmt = node.parent + # Check if it's simply defining a single name, not something like + # foo.bar or x[1], where using a lambda could make more sense. + if expr_stmt.type == 'expr_stmt' and any(n.type == 'name' for n in expr_stmt.children[:-2:2]): + self.add_issue(node, 731, 'Do not assign a lambda expression, use a def') + elif typ == 'try_stmt': + for child in node.children: + # Here we can simply check if it's an except, because otherwise + # it would be an except_clause. + if child.type == 'keyword' and child.value == 'except': + self.add_issue(child, 722, 'Do not use bare except, specify exception instead') + elif typ == 'comparison': + for child in node.children: + if child.type not in ('atom_expr', 'power'): + continue + if len(child.children) > 2: + continue + trailer = child.children[1] + atom = child.children[0] + if trailer.type == 'trailer' and atom.type == 'name' \ + and atom.value == 'type': + self.add_issue(node, 721, "Do not compare types, use 'isinstance()") + break + elif typ == 'file_input': + endmarker = node.children[-1] + prev = endmarker.get_previous_leaf() + prefix = endmarker.prefix + if (not prefix.endswith('\n') and ( + prefix or prev is None or prev.value != '\n')): + self.add_issue(endmarker, 292, "No newline at end of file") + + if typ in _IMPORT_TYPES: + simple_stmt = node.parent + module = simple_stmt.parent + #if module.type == 'simple_stmt': + if module.type == 'file_input': + index = module.children.index(simple_stmt) + for child in module.children[:index]: + children = [child] + if child.type == 'simple_stmt': + # Remove the newline. + children = child.children[:-1] + + found_docstring = False + for c in children: + if c.type == 'string' and not found_docstring: + continue + found_docstring = True + + if c.type == 'expr_stmt' and \ + all(_is_magic_name(n) for n in c.get_defined_names()): + continue + + if c.type in _IMPORT_TYPES or isinstance(c, Flow): + continue + + self.add_issue(node, 402, 'Module level import not at top of file') + break + else: + continue + break + + implicit_indentation_possible = typ in _IMPLICIT_INDENTATION_TYPES + in_introducer = typ in _SUITE_INTRODUCERS + if in_introducer: + self._in_suite_introducer = True + elif typ == 'suite': + if self._indentation_tos.type == IndentationTypes.BACKSLASH: + self._indentation_tos = self._indentation_tos.parent + + self._indentation_tos = IndentationNode( + self._config, + self._indentation_tos.indentation + self._config.indentation, + parent=self._indentation_tos + ) + elif implicit_indentation_possible: + self._implicit_indentation_possible = True + yield + if typ == 'suite': + assert self._indentation_tos.type == IndentationTypes.SUITE + self._indentation_tos = self._indentation_tos.parent + # If we dedent, no lines are needed anymore. + self._wanted_newline_count = None + elif implicit_indentation_possible: + self._implicit_indentation_possible = False + if self._indentation_tos.type == IndentationTypes.IMPLICIT: + self._indentation_tos = self._indentation_tos.parent + elif in_introducer: + self._in_suite_introducer = False + if typ in ('classdef', 'funcdef'): + self._wanted_newline_count = self._get_wanted_blank_lines_count() + + def _check_tabs_spaces(self, spacing): + if self._wrong_indentation_char in spacing.value: + self.add_issue(spacing, 101, 'Indentation contains ' + self._indentation_type) + return True + return False + + def _get_wanted_blank_lines_count(self): + suite_node = self._indentation_tos.get_latest_suite_node() + return int(suite_node.parent is None) + 1 + + def _reset_newlines(self, spacing, leaf, is_comment=False): + self._max_new_lines_in_prefix = \ + max(self._max_new_lines_in_prefix, self._newline_count) + + wanted = self._wanted_newline_count + if wanted is not None: + # Need to substract one + blank_lines = self._newline_count - 1 + if wanted > blank_lines and leaf.type != 'endmarker': + # In case of a comment we don't need to add the issue, yet. + if not is_comment: + # TODO end_pos wrong. + code = 302 if wanted == 2 else 301 + message = "expected %s blank line, found %s" \ + % (wanted, blank_lines) + self.add_issue(spacing, code, message) + self._wanted_newline_count = None + else: + self._wanted_newline_count = None + + if not is_comment: + wanted = self._get_wanted_blank_lines_count() + actual = self._max_new_lines_in_prefix - 1 + + val = leaf.value + needs_lines = ( + val == '@' and leaf.parent.type == 'decorator' + or ( + val == 'class' + or val == 'async' and leaf.get_next_leaf() == 'def' + or val == 'def' and self._previous_leaf != 'async' + ) and leaf.parent.parent.type != 'decorated' + ) + if needs_lines and actual < wanted: + func_or_cls = leaf.parent + suite = func_or_cls.parent + if suite.type == 'decorated': + suite = suite.parent + + # The first leaf of a file or a suite should not need blank + # lines. + if suite.children[int(suite.type == 'suite')] != func_or_cls: + code = 302 if wanted == 2 else 301 + message = "expected %s blank line, found %s" \ + % (wanted, actual) + self.add_issue(spacing, code, message) + + self._max_new_lines_in_prefix = 0 + + self._newline_count = 0 + + def visit_leaf(self, leaf): + super(PEP8Normalizer, self).visit_leaf(leaf) + for part in leaf._split_prefix(): + if part.type == 'spacing': + # This part is used for the part call after for. + break + self._visit_part(part, part.create_spacing_part(), leaf) + + self._analyse_non_prefix(leaf) + self._visit_part(leaf, part, leaf) + + # Cleanup + self._last_indentation_tos = self._indentation_tos + + self._new_statement = leaf.type == 'newline' + + # TODO does this work? with brackets and stuff? + if leaf.type == 'newline' and \ + self._indentation_tos.type == IndentationTypes.BACKSLASH: + self._indentation_tos = self._indentation_tos.parent + + if leaf.value == ':' and leaf.parent.type in _SUITE_INTRODUCERS: + self._in_suite_introducer = False + elif leaf.value == 'elif': + self._in_suite_introducer = True + + if not self._new_statement: + self._reset_newlines(part, leaf) + self._max_blank_lines = 0 + + self._previous_leaf = leaf + + return leaf.value + + def _visit_part(self, part, spacing, leaf): + value = part.value + type_ = part.type + if type_ == 'error_leaf': + return + + if value == ',' and part.parent.type == 'dictorsetmaker': + self._indentation_tos = self._indentation_tos.parent + + node = self._indentation_tos + + if type_ == 'comment': + if value.startswith('##'): + # Whole blocks of # should not raise an error. + if value.lstrip('#'): + self.add_issue(part, 266, "Too many leading '#' for block comment.") + elif self._on_newline: + if not re.match(r'#:? ', value) and not value == '#' \ + and not (value.startswith('#!') and part.start_pos == (1, 0)): + self.add_issue(part, 265, "Block comment should start with '# '") + else: + if not re.match(r'#:? [^ ]', value): + self.add_issue(part, 262, "Inline comment should start with '# '") + + self._reset_newlines(spacing, leaf, is_comment=True) + elif type_ == 'newline': + if self._newline_count > self._get_wanted_blank_lines_count(): + self.add_issue(part, 303, "Too many blank lines (%s)" % self._newline_count) + elif leaf in ('def', 'class') \ + and leaf.parent.parent.type == 'decorated': + self.add_issue(part, 304, "Blank lines found after function decorator") + + + self._newline_count += 1 + + if type_ == 'backslash': + # TODO is this enough checking? What about ==? + if node.type != IndentationTypes.BACKSLASH: + if node.type != IndentationTypes.SUITE: + self.add_issue(part, 502, 'The backslash is redundant between brackets') + else: + indentation = node.indentation + if self._in_suite_introducer and node.type == IndentationTypes.SUITE: + indentation += self._config.indentation + + self._indentation_tos = BackslashNode( + self._config, + indentation, + part, + spacing, + parent=self._indentation_tos + ) + elif self._on_newline: + indentation = spacing.value + if node.type == IndentationTypes.BACKSLASH \ + and self._previous_part.type == 'newline': + self._indentation_tos = self._indentation_tos.parent + + if not self._check_tabs_spaces(spacing): + should_be_indentation = node.indentation + if type_ == 'comment': + # Comments can be dedented. So we have to care for that. + n = self._last_indentation_tos + while True: + if len(indentation) > len(n.indentation): + break + + should_be_indentation = n.indentation + + self._last_indentation_tos = n + if n == node: + break + n = n.parent + + if self._new_statement: + if type_ == 'newline': + if indentation: + self.add_issue(spacing, 291, 'Trailing whitespace') + elif indentation != should_be_indentation: + s = '%s %s' % (len(self._config.indentation), self._indentation_type) + self.add_issue(part, 111, 'Indentation is not a multiple of ' + s) + else: + if value in '])}': + should_be_indentation = node.bracket_indentation + else: + should_be_indentation = node.indentation + if self._in_suite_introducer and indentation == \ + node.get_latest_suite_node().indentation \ + + self._config.indentation: + self.add_issue(part, 129, "Line with same indent as next logical block") + elif indentation != should_be_indentation: + if not self._check_tabs_spaces(spacing) and part.value != '\n': + if value in '])}': + if node.type == IndentationTypes.VERTICAL_BRACKET: + self.add_issue(part, 124, "Closing bracket does not match visual indentation") + else: + self.add_issue(part, 123, "Losing bracket does not match indentation of opening bracket's line") + else: + if len(indentation) < len(should_be_indentation): + if node.type == IndentationTypes.VERTICAL_BRACKET: + self.add_issue(part, 128, 'Continuation line under-indented for visual indent') + elif node.type == IndentationTypes.BACKSLASH: + self.add_issue(part, 122, 'Continuation line missing indentation or outdented') + elif node.type == IndentationTypes.IMPLICIT: + self.add_issue(part, 135, 'xxx') + else: + self.add_issue(part, 121, 'Continuation line under-indented for hanging indent') + else: + if node.type == IndentationTypes.VERTICAL_BRACKET: + self.add_issue(part, 127, 'Continuation line over-indented for visual indent') + elif node.type == IndentationTypes.IMPLICIT: + self.add_issue(part, 136, 'xxx') + else: + self.add_issue(part, 126, 'Continuation line over-indented for hanging indent') + else: + self._check_spacing(part, spacing) + + self._check_line_length(part, spacing) + # ------------------------------- + # Finalizing. Updating the state. + # ------------------------------- + if value and value in '()[]{}' and type_ != 'error_leaf' \ + and part.parent.type != 'error_node': + if value in _OPENING_BRACKETS: + self._indentation_tos = BracketNode( + self._config, part, + parent=self._indentation_tos, + in_suite_introducer=self._in_suite_introducer + ) + else: + assert node.type != IndentationTypes.IMPLICIT + self._indentation_tos = self._indentation_tos.parent + elif value in ('=', ':') and self._implicit_indentation_possible \ + and part.parent.type in _IMPLICIT_INDENTATION_TYPES: + indentation = node.indentation + self._indentation_tos = ImplicitNode( + self._config, part, parent=self._indentation_tos + ) + + self._on_newline = type_ in ('newline', 'backslash', 'bom') + + self._previous_part = part + self._previous_spacing = spacing + + def _check_line_length(self, part, spacing): + if part.type == 'backslash': + last_column = part.start_pos[1] + 1 + else: + last_column = part.end_pos[1] + if last_column > self._config.max_characters \ + and spacing.start_pos[1] <= self._config.max_characters : + # Special case for long URLs in multi-line docstrings or comments, + # but still report the error when the 72 first chars are whitespaces. + report = True + if part.type == 'comment': + splitted = part.value[1:].split() + if len(splitted) == 1 \ + and (part.end_pos[1] - len(splitted[0])) < 72: + report = False + if report: + self.add_issue( + part, + 501, + 'Line too long (%s > %s characters)' % + (last_column, self._config.max_characters), + ) + + def _check_spacing(self, part, spacing): + def add_if_spaces(*args): + if spaces: + return self.add_issue(*args) + + def add_not_spaces(*args): + if not spaces: + return self.add_issue(*args) + + spaces = spacing.value + prev = self._previous_part + if prev is not None and prev.type == 'error_leaf' or part.type == 'error_leaf': + return + + type_ = part.type + if '\t' in spaces: + self.add_issue(spacing, 223, 'Used tab to separate tokens') + elif type_ == 'comment': + if len(spaces) < self._config.spaces_before_comment: + self.add_issue(spacing, 261, 'At least two spaces before inline comment') + elif type_ == 'newline': + add_if_spaces(spacing, 291, 'Trailing whitespace') + elif len(spaces) > 1: + self.add_issue(spacing, 221, 'Multiple spaces used') + else: + if prev in _OPENING_BRACKETS: + message = "Whitespace after '%s'" % part.value + add_if_spaces(spacing, 201, message) + elif part in _CLOSING_BRACKETS: + message = "Whitespace before '%s'" % part.value + add_if_spaces(spacing, 202, message) + elif part in (',', ';') or part == ':' \ + and part.parent.type not in _POSSIBLE_SLICE_PARENTS: + message = "Whitespace before '%s'" % part.value + add_if_spaces(spacing, 203, message) + elif prev == ':' and prev.parent.type in _POSSIBLE_SLICE_PARENTS: + pass # TODO + elif prev in (',', ';', ':'): + add_not_spaces(spacing, 231, "missing whitespace after '%s'") + elif part == ':': # Is a subscript + # TODO + pass + elif part in ('*', '**') and part.parent.type not in _NON_STAR_TYPES \ + or prev in ('*', '**') \ + and prev.parent.type not in _NON_STAR_TYPES: + # TODO + pass + elif prev in _FACTOR and prev.parent.type == 'factor': + pass + elif prev == '@' and prev.parent.type == 'decorator': + pass # TODO should probably raise an error if there's a space here + elif part in _NEEDS_SPACE or prev in _NEEDS_SPACE: + if part == '=' and part.parent.type in ('argument', 'param') \ + or prev == '=' and prev.parent.type in ('argument', 'param'): + if part == '=': + param = part.parent + else: + param = prev.parent + if param.type == 'param' and param.annotation: + add_not_spaces(spacing, 252, 'Expected spaces around annotation equals') + else: + add_if_spaces(spacing, 251, 'Unexpected spaces around keyword / parameter equals') + elif part in _BITWISE_OPERATOR or prev in _BITWISE_OPERATOR: + add_not_spaces(spacing, 227, 'Missing whitespace around bitwise or shift operator') + elif part == '%' or prev == '%': + add_not_spaces(spacing, 228, 'Missing whitespace around modulo operator') + else: + message_225 = 'Missing whitespace between tokens' + add_not_spaces(spacing, 225, message_225) + elif type_ == 'keyword' or prev.type == 'keyword': + add_not_spaces(spacing, 275, 'Missing whitespace around keyword') + else: + prev_spacing = self._previous_spacing + if prev in _ALLOW_SPACE and spaces != prev_spacing.value \ + and '\n' not in self._previous_leaf.prefix: + message = "Whitespace before operator doesn't match with whitespace after" + self.add_issue(spacing, 229, message) + + if spaces and part not in _ALLOW_SPACE and prev not in _ALLOW_SPACE: + message_225 = 'Missing whitespace between tokens' + #print('xy', spacing) + #self.add_issue(spacing, 225, message_225) + # TODO why only brackets? + if part in _OPENING_BRACKETS: + message = "Whitespace before '%s'" % part.value + add_if_spaces(spacing, 211, message) + + def _analyse_non_prefix(self, leaf): + typ = leaf.type + if typ == 'name' and leaf.value in ('l', 'O', 'I'): + if leaf.is_definition(): + message = "Do not define %s named 'l', 'O', or 'I' one line" + if leaf.parent.type == 'class' and leaf.parent.name == leaf: + self.add_issue(leaf, 742, message % 'classes') + elif leaf.parent.type == 'function' and leaf.parent.name == leaf: + self.add_issue(leaf, 743, message % 'function') + else: + self.add_issuadd_issue(741, message % 'variables', leaf) + elif leaf.value == ':': + if isinstance(leaf.parent, (Flow, Scope)) and leaf.parent.type != 'lambdef': + next_leaf = leaf.get_next_leaf() + if next_leaf.type != 'newline': + if leaf.parent.type == 'funcdef': + self.add_issue(next_leaf, 704, 'Multiple statements on one line (def)') + else: + self.add_issue(next_leaf, 701, 'Multiple statements on one line (colon)') + elif leaf.value == ';': + if leaf.get_next_leaf().type in ('newline', 'endmarker'): + self.add_issue(leaf, 703, 'Statement ends with a semicolon') + else: + self.add_issue(leaf, 702, 'Multiple statements on one line (semicolon)') + elif leaf.value in ('==', '!='): + comparison = leaf.parent + index = comparison.children.index(leaf) + left = comparison.children[index - 1] + right = comparison.children[index + 1] + for node in left, right: + if node.type == 'keyword' or node.type == 'name': + if node.value == 'None': + message = "comparison to None should be 'if cond is None:'" + self.add_issue(leaf, 711, message) + break + elif node.value in ('True', 'False'): + message = "comparison to False/True should be 'if cond is True:' or 'if cond:'" + self.add_issue(leaf, 712, message) + break + elif leaf.value in ('in', 'is'): + comparison = leaf.parent + if comparison.type == 'comparison' and comparison.parent.type == 'not_test': + if leaf.value == 'in': + self.add_issue(leaf, 713, "test for membership should be 'not in'") + else: + self.add_issue(leaf, 714, "test for object identity should be 'is not'") + elif typ == 'string': + # Checking multiline strings + for i, line in enumerate(leaf.value.splitlines()[1:]): + indentation = re.match(r'[ \t]*', line).group(0) + start_pos = leaf.line + i, len(indentation) + # TODO check multiline indentation. + elif typ == 'endmarker': + if self._newline_count >= 2: + self.add_issue(leaf, 391, 'Blank line at end of file') + + def add_issue(self, node, code, message): + if self._previous_leaf is not None: + if search_ancestor(self._previous_leaf, 'error_node') is not None: + return + if self._previous_leaf.type == 'error_leaf': + return + if search_ancestor(node, 'error_node') is not None: + return + if code in (901, 903): + # 901 and 903 are raised by the ErrorFinder. + super(PEP8Normalizer, self).add_issue(node, code, message) + else: + # Skip ErrorFinder here, because it has custom behavior. + super(ErrorFinder, self).add_issue(node, code, message) + + +class PEP8NormalizerConfig(ErrorFinderConfig): + normalizer_class = PEP8Normalizer + """ + Normalizing to PEP8. Not really implemented, yet. + """ + def __init__(self, indentation=' ' * 4, hanging_indentation=None, + max_characters=79, spaces_before_comment=2): + self.indentation = indentation + if hanging_indentation is None: + hanging_indentation = indentation + self.hanging_indentation = hanging_indentation + self.closing_bracket_hanging_indentation = '' + self.break_after_binary = False + self.max_characters = max_characters + self.spaces_before_comment = spaces_before_comment + + +# TODO this is not yet ready. +#@PEP8Normalizer.register_rule(type='endmarker') +class BlankLineAtEnd(Rule): + code = 392 + message = 'Blank line at end of file' + + def is_issue(self, leaf): + return self._newline_count >= 2 diff --git a/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/python/prefix.py b/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/python/prefix.py new file mode 100644 index 0000000..b7f1e1b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/python/prefix.py @@ -0,0 +1,97 @@ +import re +from codecs import BOM_UTF8 + +from parso.python.tokenize import group + +unicode_bom = BOM_UTF8.decode('utf-8') + + +class PrefixPart(object): + def __init__(self, leaf, typ, value, spacing='', start_pos=None): + assert start_pos is not None + self.parent = leaf + self.type = typ + self.value = value + self.spacing = spacing + self.start_pos = start_pos + + @property + def end_pos(self): + if self.value.endswith('\n'): + return self.start_pos[0] + 1, 0 + if self.value == unicode_bom: + # The bom doesn't have a length at the start of a Python file. + return self.start_pos + return self.start_pos[0], self.start_pos[1] + len(self.value) + + def create_spacing_part(self): + column = self.start_pos[1] - len(self.spacing) + return PrefixPart( + self.parent, 'spacing', self.spacing, + start_pos=(self.start_pos[0], column) + ) + + def __repr__(self): + return '%s(%s, %s, %s)' % ( + self.__class__.__name__, + self.type, + repr(self.value), + self.start_pos + ) + + +_comment = r'#[^\n\r\f]*' +_backslash = r'\\\r?\n' +_newline = r'\r?\n' +_form_feed = r'\f' +_only_spacing = '$' +_spacing = r'[ \t]*' +_bom = unicode_bom + +_regex = group( + _comment, _backslash, _newline, _form_feed, _only_spacing, _bom, + capture=True +) +_regex = re.compile(group(_spacing, capture=True) + _regex) + + +_types = { + '#': 'comment', + '\\': 'backslash', + '\f': 'formfeed', + '\n': 'newline', + '\r': 'newline', + unicode_bom: 'bom' +} + + +def split_prefix(leaf, start_pos): + line, column = start_pos + start = 0 + value = spacing = '' + bom = False + while start != len(leaf.prefix): + match =_regex.match(leaf.prefix, start) + spacing = match.group(1) + value = match.group(2) + if not value: + break + type_ = _types[value[0]] + yield PrefixPart( + leaf, type_, value, spacing, + start_pos=(line, column + start - int(bom) + len(spacing)) + ) + if type_ == 'bom': + bom = True + + start = match.end(0) + if value.endswith('\n'): + line += 1 + column = -start + + if value: + spacing = '' + yield PrefixPart( + leaf, 'spacing', spacing, + start_pos=(line, column + start) + ) diff --git a/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/python/token.py b/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/python/token.py new file mode 100644 index 0000000..bb86ec9 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/python/token.py @@ -0,0 +1,27 @@ +from __future__ import absolute_import + + +class TokenType(object): + def __init__(self, name, contains_syntax=False): + self.name = name + self.contains_syntax = contains_syntax + + def __repr__(self): + return '%s(%s)' % (self.__class__.__name__, self.name) + + +class TokenTypes(object): + """ + Basically an enum, but Python 2 doesn't have enums in the standard library. + """ + def __init__(self, names, contains_syntax): + for name in names: + setattr(self, name, TokenType(name, contains_syntax=name in contains_syntax)) + + +PythonTokenTypes = TokenTypes(( + 'STRING', 'NUMBER', 'NAME', 'ERRORTOKEN', 'NEWLINE', 'INDENT', 'DEDENT', + 'ERROR_DEDENT', 'FSTRING_STRING', 'FSTRING_START', 'FSTRING_END', 'OP', + 'ENDMARKER'), + contains_syntax=('NAME', 'OP'), +) diff --git a/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/python/tokenize.py b/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/python/tokenize.py new file mode 100644 index 0000000..48d128b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/python/tokenize.py @@ -0,0 +1,686 @@ +# -*- coding: utf-8 -*- +""" +This tokenizer has been copied from the ``tokenize.py`` standard library +tokenizer. The reason was simple: The standard library tokenizer fails +if the indentation is not right. To make it possible to do error recovery the + tokenizer needed to be rewritten. + +Basically this is a stripped down version of the standard library module, so +you can read the documentation there. Additionally we included some speed and +memory optimizations here. +""" +from __future__ import absolute_import + +import sys +import string +import re +from collections import namedtuple +import itertools as _itertools +from codecs import BOM_UTF8 + +from parso.python.token import PythonTokenTypes +from parso._compatibility import py_version +from parso.utils import split_lines + + +# Maximum code point of Unicode 6.0: 0x10ffff (1,114,111) +MAX_UNICODE = '\U0010ffff' + +STRING = PythonTokenTypes.STRING +NAME = PythonTokenTypes.NAME +NUMBER = PythonTokenTypes.NUMBER +OP = PythonTokenTypes.OP +NEWLINE = PythonTokenTypes.NEWLINE +INDENT = PythonTokenTypes.INDENT +DEDENT = PythonTokenTypes.DEDENT +ENDMARKER = PythonTokenTypes.ENDMARKER +ERRORTOKEN = PythonTokenTypes.ERRORTOKEN +ERROR_DEDENT = PythonTokenTypes.ERROR_DEDENT +FSTRING_START = PythonTokenTypes.FSTRING_START +FSTRING_STRING = PythonTokenTypes.FSTRING_STRING +FSTRING_END = PythonTokenTypes.FSTRING_END + +TokenCollection = namedtuple( + 'TokenCollection', + 'pseudo_token single_quoted triple_quoted endpats whitespace ' + 'fstring_pattern_map always_break_tokens', +) + +BOM_UTF8_STRING = BOM_UTF8.decode('utf-8') + +_token_collection_cache = {} + +if py_version >= 30: + # Python 3 has str.isidentifier() to check if a char is a valid identifier + is_identifier = str.isidentifier +else: + # Python 2 doesn't, but it's not that important anymore and if you tokenize + # Python 2 code with this, it's still ok. It's just that parsing Python 3 + # code with this function is not 100% correct. + # This just means that Python 2 code matches a few identifiers too much, + # but that doesn't really matter. + def is_identifier(s): + return True + + +def group(*choices, **kwargs): + capture = kwargs.pop('capture', False) # Python 2, arrghhhhh :( + assert not kwargs + + start = '(' + if not capture: + start += '?:' + return start + '|'.join(choices) + ')' + + +def maybe(*choices): + return group(*choices) + '?' + + +# Return the empty string, plus all of the valid string prefixes. +def _all_string_prefixes(version_info, include_fstring=False, only_fstring=False): + def different_case_versions(prefix): + for s in _itertools.product(*[(c, c.upper()) for c in prefix]): + yield ''.join(s) + # The valid string prefixes. Only contain the lower case versions, + # and don't contain any permuations (include 'fr', but not + # 'rf'). The various permutations will be generated. + valid_string_prefixes = ['b', 'r', 'u'] + if version_info >= (3, 0): + valid_string_prefixes.append('br') + + result = set(['']) + if version_info >= (3, 6) and include_fstring: + f = ['f', 'fr'] + if only_fstring: + valid_string_prefixes = f + result = set() + else: + valid_string_prefixes += f + elif only_fstring: + return set() + + # if we add binary f-strings, add: ['fb', 'fbr'] + for prefix in valid_string_prefixes: + for t in _itertools.permutations(prefix): + # create a list with upper and lower versions of each + # character + result.update(different_case_versions(t)) + if version_info <= (2, 7): + # In Python 2 the order cannot just be random. + result.update(different_case_versions('ur')) + result.update(different_case_versions('br')) + return result + + +def _compile(expr): + return re.compile(expr, re.UNICODE) + + +def _get_token_collection(version_info): + try: + return _token_collection_cache[tuple(version_info)] + except KeyError: + _token_collection_cache[tuple(version_info)] = result = \ + _create_token_collection(version_info) + return result + + +fstring_string_single_line = _compile(r'(?:\{\{|\}\}|\\(?:\r\n?|\n)|[^{}\r\n])+') +fstring_string_multi_line = _compile(r'(?:[^{}]+|\{\{|\}\})+') +fstring_format_spec_single_line = _compile(r'(?:\\(?:\r\n?|\n)|[^{}\r\n])+') +fstring_format_spec_multi_line = _compile(r'[^{}]+') + + +def _create_token_collection(version_info): + # Note: we use unicode matching for names ("\w") but ascii matching for + # number literals. + Whitespace = r'[ \f\t]*' + whitespace = _compile(Whitespace) + Comment = r'#[^\r\n]*' + # Python 2 is pretty much not working properly anymore, we just ignore + # parsing unicode properly, which is fine, I guess. + if version_info[0] == 2: + Name = r'([A-Za-z_0-9]+)' + elif sys.version_info[0] == 2: + # Unfortunately the regex engine cannot deal with the regex below, so + # just use this one. + Name = r'(\w+)' + else: + Name = u'([A-Za-z_0-9\u0080-' + MAX_UNICODE + ']+)' + + if version_info >= (3, 6): + Hexnumber = r'0[xX](?:_?[0-9a-fA-F])+' + Binnumber = r'0[bB](?:_?[01])+' + Octnumber = r'0[oO](?:_?[0-7])+' + Decnumber = r'(?:0(?:_?0)*|[1-9](?:_?[0-9])*)' + Intnumber = group(Hexnumber, Binnumber, Octnumber, Decnumber) + Exponent = r'[eE][-+]?[0-9](?:_?[0-9])*' + Pointfloat = group(r'[0-9](?:_?[0-9])*\.(?:[0-9](?:_?[0-9])*)?', + r'\.[0-9](?:_?[0-9])*') + maybe(Exponent) + Expfloat = r'[0-9](?:_?[0-9])*' + Exponent + Floatnumber = group(Pointfloat, Expfloat) + Imagnumber = group(r'[0-9](?:_?[0-9])*[jJ]', Floatnumber + r'[jJ]') + else: + Hexnumber = r'0[xX][0-9a-fA-F]+' + Binnumber = r'0[bB][01]+' + if version_info >= (3, 0): + Octnumber = r'0[oO][0-7]+' + else: + Octnumber = '0[oO]?[0-7]+' + Decnumber = r'(?:0+|[1-9][0-9]*)' + Intnumber = group(Hexnumber, Binnumber, Octnumber, Decnumber) + if version_info[0] < 3: + Intnumber += '[lL]?' + Exponent = r'[eE][-+]?[0-9]+' + Pointfloat = group(r'[0-9]+\.[0-9]*', r'\.[0-9]+') + maybe(Exponent) + Expfloat = r'[0-9]+' + Exponent + Floatnumber = group(Pointfloat, Expfloat) + Imagnumber = group(r'[0-9]+[jJ]', Floatnumber + r'[jJ]') + Number = group(Imagnumber, Floatnumber, Intnumber) + + # Note that since _all_string_prefixes includes the empty string, + # StringPrefix can be the empty string (making it optional). + possible_prefixes = _all_string_prefixes(version_info) + StringPrefix = group(*possible_prefixes) + StringPrefixWithF = group(*_all_string_prefixes(version_info, include_fstring=True)) + fstring_prefixes = _all_string_prefixes(version_info, include_fstring=True, only_fstring=True) + FStringStart = group(*fstring_prefixes) + + # Tail end of ' string. + Single = r"(?:\\.|[^'\\])*'" + # Tail end of " string. + Double = r'(?:\\.|[^"\\])*"' + # Tail end of ''' string. + Single3 = r"(?:\\.|'(?!'')|[^'\\])*'''" + # Tail end of """ string. + Double3 = r'(?:\\.|"(?!"")|[^"\\])*"""' + Triple = group(StringPrefixWithF + "'''", StringPrefixWithF + '"""') + + # Because of leftmost-then-longest match semantics, be sure to put the + # longest operators first (e.g., if = came before ==, == would get + # recognized as two instances of =). + Operator = group(r"\*\*=?", r">>=?", r"<<=?", + r"//=?", r"->", + r"[+\-*/%&@`|^!=<>]=?", + r"~") + + Bracket = '[][(){}]' + + special_args = [r'\r\n?', r'\n', r'[;.,@]'] + if version_info >= (3, 0): + special_args.insert(0, r'\.\.\.') + if version_info >= (3, 8): + special_args.insert(0, ":=?") + else: + special_args.insert(0, ":") + Special = group(*special_args) + + Funny = group(Operator, Bracket, Special) + + # First (or only) line of ' or " string. + ContStr = group(StringPrefix + r"'[^\r\n'\\]*(?:\\.[^\r\n'\\]*)*" + + group("'", r'\\(?:\r\n?|\n)'), + StringPrefix + r'"[^\r\n"\\]*(?:\\.[^\r\n"\\]*)*' + + group('"', r'\\(?:\r\n?|\n)')) + pseudo_extra_pool = [Comment, Triple] + all_quotes = '"', "'", '"""', "'''" + if fstring_prefixes: + pseudo_extra_pool.append(FStringStart + group(*all_quotes)) + + PseudoExtras = group(r'\\(?:\r\n?|\n)|\Z', *pseudo_extra_pool) + PseudoToken = group(Whitespace, capture=True) + \ + group(PseudoExtras, Number, Funny, ContStr, Name, capture=True) + + # For a given string prefix plus quotes, endpats maps it to a regex + # to match the remainder of that string. _prefix can be empty, for + # a normal single or triple quoted string (with no prefix). + endpats = {} + for _prefix in possible_prefixes: + endpats[_prefix + "'"] = _compile(Single) + endpats[_prefix + '"'] = _compile(Double) + endpats[_prefix + "'''"] = _compile(Single3) + endpats[_prefix + '"""'] = _compile(Double3) + + # A set of all of the single and triple quoted string prefixes, + # including the opening quotes. + single_quoted = set() + triple_quoted = set() + fstring_pattern_map = {} + for t in possible_prefixes: + for quote in '"', "'": + single_quoted.add(t + quote) + + for quote in '"""', "'''": + triple_quoted.add(t + quote) + + for t in fstring_prefixes: + for quote in all_quotes: + fstring_pattern_map[t + quote] = quote + + ALWAYS_BREAK_TOKENS = (';', 'import', 'class', 'def', 'try', 'except', + 'finally', 'while', 'with', 'return') + pseudo_token_compiled = _compile(PseudoToken) + return TokenCollection( + pseudo_token_compiled, single_quoted, triple_quoted, endpats, + whitespace, fstring_pattern_map, ALWAYS_BREAK_TOKENS + ) + + +class Token(namedtuple('Token', ['type', 'string', 'start_pos', 'prefix'])): + @property + def end_pos(self): + lines = split_lines(self.string) + if len(lines) > 1: + return self.start_pos[0] + len(lines) - 1, 0 + else: + return self.start_pos[0], self.start_pos[1] + len(self.string) + + +class PythonToken(Token): + def __repr__(self): + return ('TokenInfo(type=%s, string=%r, start_pos=%r, prefix=%r)' % + self._replace(type=self.type.name)) + + +class FStringNode(object): + def __init__(self, quote): + self.quote = quote + self.parentheses_count = 0 + self.previous_lines = '' + self.last_string_start_pos = None + # In the syntax there can be multiple format_spec's nested: + # {x:{y:3}} + self.format_spec_count = 0 + + def open_parentheses(self, character): + self.parentheses_count += 1 + + def close_parentheses(self, character): + self.parentheses_count -= 1 + if self.parentheses_count == 0: + # No parentheses means that the format spec is also finished. + self.format_spec_count = 0 + + def allow_multiline(self): + return len(self.quote) == 3 + + def is_in_expr(self): + return self.parentheses_count > self.format_spec_count + + def is_in_format_spec(self): + return not self.is_in_expr() and self.format_spec_count + + +def _close_fstring_if_necessary(fstring_stack, string, start_pos, additional_prefix): + for fstring_stack_index, node in enumerate(fstring_stack): + if string.startswith(node.quote): + token = PythonToken( + FSTRING_END, + node.quote, + start_pos, + prefix=additional_prefix, + ) + additional_prefix = '' + assert not node.previous_lines + del fstring_stack[fstring_stack_index:] + return token, '', len(node.quote) + return None, additional_prefix, 0 + + +def _find_fstring_string(endpats, fstring_stack, line, lnum, pos): + tos = fstring_stack[-1] + allow_multiline = tos.allow_multiline() + if tos.is_in_format_spec(): + if allow_multiline: + regex = fstring_format_spec_multi_line + else: + regex = fstring_format_spec_single_line + else: + if allow_multiline: + regex = fstring_string_multi_line + else: + regex = fstring_string_single_line + + match = regex.match(line, pos) + if match is None: + return tos.previous_lines, pos + + if not tos.previous_lines: + tos.last_string_start_pos = (lnum, pos) + + string = match.group(0) + for fstring_stack_node in fstring_stack: + end_match = endpats[fstring_stack_node.quote].match(string) + if end_match is not None: + string = end_match.group(0)[:-len(fstring_stack_node.quote)] + + new_pos = pos + new_pos += len(string) + # even if allow_multiline is False, we still need to check for trailing + # newlines, because a single-line f-string can contain line continuations + if string.endswith('\n') or string.endswith('\r'): + tos.previous_lines += string + string = '' + else: + string = tos.previous_lines + string + + return string, new_pos + + +def tokenize(code, version_info, start_pos=(1, 0)): + """Generate tokens from a the source code (string).""" + lines = split_lines(code, keepends=True) + return tokenize_lines(lines, version_info, start_pos=start_pos) + + +def _print_tokens(func): + """ + A small helper function to help debug the tokenize_lines function. + """ + def wrapper(*args, **kwargs): + for token in func(*args, **kwargs): + yield token + + return wrapper + + +# @_print_tokens +def tokenize_lines(lines, version_info, start_pos=(1, 0)): + """ + A heavily modified Python standard library tokenizer. + + Additionally to the default information, yields also the prefix of each + token. This idea comes from lib2to3. The prefix contains all information + that is irrelevant for the parser like newlines in parentheses or comments. + """ + def dedent_if_necessary(start): + while start < indents[-1]: + if start > indents[-2]: + yield PythonToken(ERROR_DEDENT, '', (lnum, 0), '') + break + yield PythonToken(DEDENT, '', spos, '') + indents.pop() + + pseudo_token, single_quoted, triple_quoted, endpats, whitespace, \ + fstring_pattern_map, always_break_tokens, = \ + _get_token_collection(version_info) + paren_level = 0 # count parentheses + indents = [0] + max = 0 + numchars = '0123456789' + contstr = '' + contline = None + # We start with a newline. This makes indent at the first position + # possible. It's not valid Python, but still better than an INDENT in the + # second line (and not in the first). This makes quite a few things in + # Jedi's fast parser possible. + new_line = True + prefix = '' # Should never be required, but here for safety + additional_prefix = '' + first = True + lnum = start_pos[0] - 1 + fstring_stack = [] + for line in lines: # loop over lines in stream + lnum += 1 + pos = 0 + max = len(line) + if first: + if line.startswith(BOM_UTF8_STRING): + additional_prefix = BOM_UTF8_STRING + line = line[1:] + max = len(line) + + # Fake that the part before was already parsed. + line = '^' * start_pos[1] + line + pos = start_pos[1] + max += start_pos[1] + + first = False + + if contstr: # continued string + endmatch = endprog.match(line) + if endmatch: + pos = endmatch.end(0) + yield PythonToken( + STRING, contstr + line[:pos], + contstr_start, prefix) + contstr = '' + contline = None + else: + contstr = contstr + line + contline = contline + line + continue + + while pos < max: + if fstring_stack: + tos = fstring_stack[-1] + if not tos.is_in_expr(): + string, pos = _find_fstring_string(endpats, fstring_stack, line, lnum, pos) + if string: + yield PythonToken( + FSTRING_STRING, string, + tos.last_string_start_pos, + # Never has a prefix because it can start anywhere and + # include whitespace. + prefix='' + ) + tos.previous_lines = '' + continue + if pos == max: + break + + rest = line[pos:] + fstring_end_token, additional_prefix, quote_length = _close_fstring_if_necessary( + fstring_stack, + rest, + (lnum, pos), + additional_prefix, + ) + pos += quote_length + if fstring_end_token is not None: + yield fstring_end_token + continue + + pseudomatch = pseudo_token.match(line, pos) + if not pseudomatch: # scan for tokens + match = whitespace.match(line, pos) + if pos == 0: + for t in dedent_if_necessary(match.end()): + yield t + pos = match.end() + new_line = False + yield PythonToken( + ERRORTOKEN, line[pos], (lnum, pos), + additional_prefix + match.group(0) + ) + additional_prefix = '' + pos += 1 + continue + + prefix = additional_prefix + pseudomatch.group(1) + additional_prefix = '' + start, pos = pseudomatch.span(2) + spos = (lnum, start) + token = pseudomatch.group(2) + if token == '': + assert prefix + additional_prefix = prefix + # This means that we have a line with whitespace/comments at + # the end, which just results in an endmarker. + break + initial = token[0] + + if new_line and initial not in '\r\n\\#': + new_line = False + if paren_level == 0 and not fstring_stack: + i = 0 + indent_start = start + while line[i] == '\f': + i += 1 + # TODO don't we need to change spos as well? + indent_start -= 1 + if indent_start > indents[-1]: + yield PythonToken(INDENT, '', spos, '') + indents.append(indent_start) + for t in dedent_if_necessary(indent_start): + yield t + + if (initial in numchars or # ordinary number + (initial == '.' and token != '.' and token != '...')): + yield PythonToken(NUMBER, token, spos, prefix) + elif pseudomatch.group(3) is not None: # ordinary name + if token in always_break_tokens: + fstring_stack[:] = [] + paren_level = 0 + # We only want to dedent if the token is on a new line. + if re.match(r'[ \f\t]*$', line[:start]): + while True: + indent = indents.pop() + if indent > start: + yield PythonToken(DEDENT, '', spos, '') + else: + indents.append(indent) + break + if is_identifier(token): + yield PythonToken(NAME, token, spos, prefix) + else: + for t in _split_illegal_unicode_name(token, spos, prefix): + yield t # yield from Python 2 + elif initial in '\r\n': + if any(not f.allow_multiline() for f in fstring_stack): + # Would use fstring_stack.clear, but that's not available + # in Python 2. + fstring_stack[:] = [] + + if not new_line and paren_level == 0 and not fstring_stack: + yield PythonToken(NEWLINE, token, spos, prefix) + else: + additional_prefix = prefix + token + new_line = True + elif initial == '#': # Comments + assert not token.endswith("\n") + additional_prefix = prefix + token + elif token in triple_quoted: + endprog = endpats[token] + endmatch = endprog.match(line, pos) + if endmatch: # all on one line + pos = endmatch.end(0) + token = line[start:pos] + yield PythonToken(STRING, token, spos, prefix) + else: + contstr_start = (lnum, start) # multiple lines + contstr = line[start:] + contline = line + break + + # Check up to the first 3 chars of the token to see if + # they're in the single_quoted set. If so, they start + # a string. + # We're using the first 3, because we're looking for + # "rb'" (for example) at the start of the token. If + # we switch to longer prefixes, this needs to be + # adjusted. + # Note that initial == token[:1]. + # Also note that single quote checking must come after + # triple quote checking (above). + elif initial in single_quoted or \ + token[:2] in single_quoted or \ + token[:3] in single_quoted: + if token[-1] in '\r\n': # continued string + # This means that a single quoted string ends with a + # backslash and is continued. + contstr_start = lnum, start + endprog = (endpats.get(initial) or endpats.get(token[1]) + or endpats.get(token[2])) + contstr = line[start:] + contline = line + break + else: # ordinary string + yield PythonToken(STRING, token, spos, prefix) + elif token in fstring_pattern_map: # The start of an fstring. + fstring_stack.append(FStringNode(fstring_pattern_map[token])) + yield PythonToken(FSTRING_START, token, spos, prefix) + elif initial == '\\' and line[start:] in ('\\\n', '\\\r\n', '\\\r'): # continued stmt + additional_prefix += prefix + line[start:] + break + else: + if token in '([{': + if fstring_stack: + fstring_stack[-1].open_parentheses(token) + else: + paren_level += 1 + elif token in ')]}': + if fstring_stack: + fstring_stack[-1].close_parentheses(token) + else: + if paren_level: + paren_level -= 1 + elif token == ':' and fstring_stack \ + and fstring_stack[-1].parentheses_count \ + - fstring_stack[-1].format_spec_count == 1: + fstring_stack[-1].format_spec_count += 1 + + yield PythonToken(OP, token, spos, prefix) + + if contstr: + yield PythonToken(ERRORTOKEN, contstr, contstr_start, prefix) + if contstr.endswith('\n') or contstr.endswith('\r'): + new_line = True + + end_pos = lnum, max + # As the last position we just take the maximally possible position. We + # remove -1 for the last new line. + for indent in indents[1:]: + yield PythonToken(DEDENT, '', end_pos, '') + yield PythonToken(ENDMARKER, '', end_pos, additional_prefix) + + +def _split_illegal_unicode_name(token, start_pos, prefix): + def create_token(): + return PythonToken(ERRORTOKEN if is_illegal else NAME, found, pos, prefix) + + found = '' + is_illegal = False + pos = start_pos + for i, char in enumerate(token): + if is_illegal: + if is_identifier(char): + yield create_token() + found = char + is_illegal = False + prefix = '' + pos = start_pos[0], start_pos[1] + i + else: + found += char + else: + new_found = found + char + if is_identifier(new_found): + found = new_found + else: + if found: + yield create_token() + prefix = '' + pos = start_pos[0], start_pos[1] + i + found = char + is_illegal = True + + if found: + yield create_token() + + +if __name__ == "__main__": + if len(sys.argv) >= 2: + path = sys.argv[1] + with open(path) as f: + code = f.read() + else: + code = sys.stdin.read() + + from parso.utils import python_bytes_to_unicode, parse_version_string + + if isinstance(code, bytes): + code = python_bytes_to_unicode(code) + + for token in tokenize(code, parse_version_string()): + print(token) diff --git a/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/python/tree.py b/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/python/tree.py new file mode 100644 index 0000000..7d4a490 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/python/tree.py @@ -0,0 +1,1245 @@ +""" +This is the syntax tree for Python syntaxes (2 & 3). The classes represent +syntax elements like functions and imports. + +All of the nodes can be traced back to the `Python grammar file +`_. If you want to know how +a tree is structured, just analyse that file (for each Python version it's a +bit different). + +There's a lot of logic here that makes it easier for Jedi (and other libraries) +to deal with a Python syntax tree. + +By using :py:meth:`parso.tree.NodeOrLeaf.get_code` on a module, you can get +back the 1-to-1 representation of the input given to the parser. This is +important if you want to refactor a parser tree. + +>>> from parso import parse +>>> parser = parse('import os') +>>> module = parser.get_root_node() +>>> module + + +Any subclasses of :class:`Scope`, including :class:`Module` has an attribute +:attr:`iter_imports `: + +>>> list(module.iter_imports()) +[] + +Changes to the Python Grammar +----------------------------- + +A few things have changed when looking at Python grammar files: + +- :class:`Param` does not exist in Python grammar files. It is essentially a + part of a ``parameters`` node. |parso| splits it up to make it easier to + analyse parameters. However this just makes it easier to deal with the syntax + tree, it doesn't actually change the valid syntax. +- A few nodes like `lambdef` and `lambdef_nocond` have been merged in the + syntax tree to make it easier to do deal with them. + +Parser Tree Classes +------------------- +""" + +import re +try: + from collections.abc import Mapping +except ImportError: + from collections import Mapping + +from parso._compatibility import utf8_repr, unicode +from parso.tree import Node, BaseNode, Leaf, ErrorNode, ErrorLeaf, \ + search_ancestor +from parso.python.prefix import split_prefix +from parso.utils import split_lines + +_FLOW_CONTAINERS = set(['if_stmt', 'while_stmt', 'for_stmt', 'try_stmt', + 'with_stmt', 'async_stmt', 'suite']) +_RETURN_STMT_CONTAINERS = set(['suite', 'simple_stmt']) | _FLOW_CONTAINERS +_FUNC_CONTAINERS = set(['suite', 'simple_stmt', 'decorated']) | _FLOW_CONTAINERS +_GET_DEFINITION_TYPES = set([ + 'expr_stmt', 'sync_comp_for', 'with_stmt', 'for_stmt', 'import_name', + 'import_from', 'param' +]) +_IMPORTS = set(['import_name', 'import_from']) + + +class DocstringMixin(object): + __slots__ = () + + def get_doc_node(self): + """ + Returns the string leaf of a docstring. e.g. ``r'''foo'''``. + """ + if self.type == 'file_input': + node = self.children[0] + elif self.type in ('funcdef', 'classdef'): + node = self.children[self.children.index(':') + 1] + if node.type == 'suite': # Normally a suite + node = node.children[1] # -> NEWLINE stmt + else: # ExprStmt + simple_stmt = self.parent + c = simple_stmt.parent.children + index = c.index(simple_stmt) + if not index: + return None + node = c[index - 1] + + if node.type == 'simple_stmt': + node = node.children[0] + if node.type == 'string': + return node + return None + + +class PythonMixin(object): + """ + Some Python specific utitilies. + """ + __slots__ = () + + def get_name_of_position(self, position): + """ + Given a (line, column) tuple, returns a :py:class:`Name` or ``None`` if + there is no name at that position. + """ + for c in self.children: + if isinstance(c, Leaf): + if c.type == 'name' and c.start_pos <= position <= c.end_pos: + return c + else: + result = c.get_name_of_position(position) + if result is not None: + return result + return None + + +class PythonLeaf(PythonMixin, Leaf): + __slots__ = () + + def _split_prefix(self): + return split_prefix(self, self.get_start_pos_of_prefix()) + + def get_start_pos_of_prefix(self): + """ + Basically calls :py:meth:`parso.tree.NodeOrLeaf.get_start_pos_of_prefix`. + """ + # TODO it is really ugly that we have to override it. Maybe change + # indent error leafs somehow? No idea how, though. + previous_leaf = self.get_previous_leaf() + if previous_leaf is not None and previous_leaf.type == 'error_leaf' \ + and previous_leaf.token_type in ('INDENT', 'DEDENT', 'ERROR_DEDENT'): + previous_leaf = previous_leaf.get_previous_leaf() + + if previous_leaf is None: # It's the first leaf. + lines = split_lines(self.prefix) + # + 1 is needed because split_lines always returns at least ['']. + return self.line - len(lines) + 1, 0 # It's the first leaf. + return previous_leaf.end_pos + + +class _LeafWithoutNewlines(PythonLeaf): + """ + Simply here to optimize performance. + """ + __slots__ = () + + @property + def end_pos(self): + return self.line, self.column + len(self.value) + + +# Python base classes +class PythonBaseNode(PythonMixin, BaseNode): + __slots__ = () + + +class PythonNode(PythonMixin, Node): + __slots__ = () + + +class PythonErrorNode(PythonMixin, ErrorNode): + __slots__ = () + + +class PythonErrorLeaf(ErrorLeaf, PythonLeaf): + __slots__ = () + + +class EndMarker(_LeafWithoutNewlines): + __slots__ = () + type = 'endmarker' + + @utf8_repr + def __repr__(self): + return "<%s: prefix=%s end_pos=%s>" % ( + type(self).__name__, repr(self.prefix), self.end_pos + ) + + +class Newline(PythonLeaf): + """Contains NEWLINE and ENDMARKER tokens.""" + __slots__ = () + type = 'newline' + + @utf8_repr + def __repr__(self): + return "<%s: %s>" % (type(self).__name__, repr(self.value)) + + +class Name(_LeafWithoutNewlines): + """ + A string. Sometimes it is important to know if the string belongs to a name + or not. + """ + type = 'name' + __slots__ = () + + def __repr__(self): + return "<%s: %s@%s,%s>" % (type(self).__name__, self.value, + self.line, self.column) + + def is_definition(self): + """ + Returns True if the name is being defined. + """ + return self.get_definition() is not None + + def get_definition(self, import_name_always=False): + """ + Returns None if there's on definition for a name. + + :param import_name_alway: Specifies if an import name is always a + definition. Normally foo in `from foo import bar` is not a + definition. + """ + node = self.parent + type_ = node.type + if type_ in ('power', 'atom_expr'): + # In `self.x = 3` self is not a definition, but x is. + return None + + if type_ in ('funcdef', 'classdef'): + if self == node.name: + return node + return None + + if type_ == 'except_clause': + # TODO in Python 2 this doesn't work correctly. See grammar file. + # I think we'll just let it be. Python 2 will be gone in a few + # years. + if self.get_previous_sibling() == 'as': + return node.parent # The try_stmt. + return None + + while node is not None: + if node.type == 'suite': + return None + if node.type in _GET_DEFINITION_TYPES: + if self in node.get_defined_names(): + return node + if import_name_always and node.type in _IMPORTS: + return node + return None + node = node.parent + return None + + +class Literal(PythonLeaf): + __slots__ = () + + +class Number(Literal): + type = 'number' + __slots__ = () + + +class String(Literal): + type = 'string' + __slots__ = () + + @property + def string_prefix(self): + return re.match(r'\w*(?=[\'"])', self.value).group(0) + + def _get_payload(self): + match = re.search( + r'''('{3}|"{3}|'|")(.*)$''', + self.value, + flags=re.DOTALL + ) + return match.group(2)[:-len(match.group(1))] + + +class FStringString(PythonLeaf): + """ + f-strings contain f-string expressions and normal python strings. These are + the string parts of f-strings. + """ + type = 'fstring_string' + __slots__ = () + + +class FStringStart(PythonLeaf): + """ + f-strings contain f-string expressions and normal python strings. These are + the string parts of f-strings. + """ + type = 'fstring_start' + __slots__ = () + + +class FStringEnd(PythonLeaf): + """ + f-strings contain f-string expressions and normal python strings. These are + the string parts of f-strings. + """ + type = 'fstring_end' + __slots__ = () + + +class _StringComparisonMixin(object): + def __eq__(self, other): + """ + Make comparisons with strings easy. + Improves the readability of the parser. + """ + if isinstance(other, (str, unicode)): + return self.value == other + + return self is other + + def __ne__(self, other): + """Python 2 compatibility.""" + return not self.__eq__(other) + + def __hash__(self): + return hash(self.value) + + +class Operator(_LeafWithoutNewlines, _StringComparisonMixin): + type = 'operator' + __slots__ = () + + +class Keyword(_LeafWithoutNewlines, _StringComparisonMixin): + type = 'keyword' + __slots__ = () + + +class Scope(PythonBaseNode, DocstringMixin): + """ + Super class for the parser tree, which represents the state of a python + text file. + A Scope is either a function, class or lambda. + """ + __slots__ = () + + def __init__(self, children): + super(Scope, self).__init__(children) + + def iter_funcdefs(self): + """ + Returns a generator of `funcdef` nodes. + """ + return self._search_in_scope('funcdef') + + def iter_classdefs(self): + """ + Returns a generator of `classdef` nodes. + """ + return self._search_in_scope('classdef') + + def iter_imports(self): + """ + Returns a generator of `import_name` and `import_from` nodes. + """ + return self._search_in_scope('import_name', 'import_from') + + def _search_in_scope(self, *names): + def scan(children): + for element in children: + if element.type in names: + yield element + if element.type in _FUNC_CONTAINERS: + for e in scan(element.children): + yield e + + return scan(self.children) + + def get_suite(self): + """ + Returns the part that is executed by the function. + """ + return self.children[-1] + + def __repr__(self): + try: + name = self.name.value + except AttributeError: + name = '' + + return "<%s: %s@%s-%s>" % (type(self).__name__, name, + self.start_pos[0], self.end_pos[0]) + + +class Module(Scope): + """ + The top scope, which is always a module. + Depending on the underlying parser this may be a full module or just a part + of a module. + """ + __slots__ = ('_used_names',) + type = 'file_input' + + def __init__(self, children): + super(Module, self).__init__(children) + self._used_names = None + + def _iter_future_import_names(self): + """ + :return: A list of future import names. + :rtype: list of str + """ + # In Python it's not allowed to use future imports after the first + # actual (non-future) statement. However this is not a linter here, + # just return all future imports. If people want to scan for issues + # they should use the API. + for imp in self.iter_imports(): + if imp.type == 'import_from' and imp.level == 0: + for path in imp.get_paths(): + names = [name.value for name in path] + if len(names) == 2 and names[0] == '__future__': + yield names[1] + + def _has_explicit_absolute_import(self): + """ + Checks if imports in this module are explicitly absolute, i.e. there + is a ``__future__`` import. + Currently not public, might be in the future. + :return bool: + """ + for name in self._iter_future_import_names(): + if name == 'absolute_import': + return True + return False + + def get_used_names(self): + """ + Returns all the :class:`Name` leafs that exist in this module. This + includes both definitions and references of names. + """ + if self._used_names is None: + # Don't directly use self._used_names to eliminate a lookup. + dct = {} + + def recurse(node): + try: + children = node.children + except AttributeError: + if node.type == 'name': + arr = dct.setdefault(node.value, []) + arr.append(node) + else: + for child in children: + recurse(child) + + recurse(self) + self._used_names = UsedNamesMapping(dct) + return self._used_names + + +class Decorator(PythonBaseNode): + type = 'decorator' + __slots__ = () + + +class ClassOrFunc(Scope): + __slots__ = () + + @property + def name(self): + """ + Returns the `Name` leaf that defines the function or class name. + """ + return self.children[1] + + def get_decorators(self): + """ + :rtype: list of :class:`Decorator` + """ + decorated = self.parent + if decorated.type == 'async_funcdef': + decorated = decorated.parent + + if decorated.type == 'decorated': + if decorated.children[0].type == 'decorators': + return decorated.children[0].children + else: + return decorated.children[:1] + else: + return [] + + +class Class(ClassOrFunc): + """ + Used to store the parsed contents of a python class. + """ + type = 'classdef' + __slots__ = () + + def __init__(self, children): + super(Class, self).__init__(children) + + def get_super_arglist(self): + """ + Returns the `arglist` node that defines the super classes. It returns + None if there are no arguments. + """ + if self.children[2] != '(': # Has no parentheses + return None + else: + if self.children[3] == ')': # Empty parentheses + return None + else: + return self.children[3] + + +def _create_params(parent, argslist_list): + """ + `argslist_list` is a list that can contain an argslist as a first item, but + most not. It's basically the items between the parameter brackets (which is + at most one item). + This function modifies the parser structure. It generates `Param` objects + from the normal ast. Those param objects do not exist in a normal ast, but + make the evaluation of the ast tree so much easier. + You could also say that this function replaces the argslist node with a + list of Param objects. + """ + def check_python2_nested_param(node): + """ + Python 2 allows params to look like ``def x(a, (b, c))``, which is + basically a way of unpacking tuples in params. Python 3 has ditched + this behavior. Jedi currently just ignores those constructs. + """ + return node.type == 'fpdef' and node.children[0] == '(' + + try: + first = argslist_list[0] + except IndexError: + return [] + + if first.type in ('name', 'fpdef'): + if check_python2_nested_param(first): + return [first] + else: + return [Param([first], parent)] + elif first == '*': + return [first] + else: # argslist is a `typedargslist` or a `varargslist`. + if first.type == 'tfpdef': + children = [first] + else: + children = first.children + new_children = [] + start = 0 + # Start with offset 1, because the end is higher. + for end, child in enumerate(children + [None], 1): + if child is None or child == ',': + param_children = children[start:end] + if param_children: # Could as well be comma and then end. + if param_children[0] == '*' \ + and (len(param_children) == 1 + or param_children[1] == ',') \ + or check_python2_nested_param(param_children[0]) \ + or param_children[0] == '/': + for p in param_children: + p.parent = parent + new_children += param_children + else: + new_children.append(Param(param_children, parent)) + start = end + return new_children + + +class Function(ClassOrFunc): + """ + Used to store the parsed contents of a python function. + + Children:: + + 0. + 1. + 2. parameter list (including open-paren and close-paren s) + 3. or 5. + 4. or 6. Node() representing function body + 3. -> (if annotation is also present) + 4. annotation (if present) + """ + type = 'funcdef' + + def __init__(self, children): + super(Function, self).__init__(children) + parameters = self.children[2] # After `def foo` + parameters.children[1:-1] = _create_params(parameters, parameters.children[1:-1]) + + def _get_param_nodes(self): + return self.children[2].children + + def get_params(self): + """ + Returns a list of `Param()`. + """ + return [p for p in self._get_param_nodes() if p.type == 'param'] + + @property + def name(self): + return self.children[1] # First token after `def` + + def iter_yield_exprs(self): + """ + Returns a generator of `yield_expr`. + """ + def scan(children): + for element in children: + if element.type in ('classdef', 'funcdef', 'lambdef'): + continue + + try: + nested_children = element.children + except AttributeError: + if element.value == 'yield': + if element.parent.type == 'yield_expr': + yield element.parent + else: + yield element + else: + for result in scan(nested_children): + yield result + + return scan(self.children) + + def iter_return_stmts(self): + """ + Returns a generator of `return_stmt`. + """ + def scan(children): + for element in children: + if element.type == 'return_stmt' \ + or element.type == 'keyword' and element.value == 'return': + yield element + if element.type in _RETURN_STMT_CONTAINERS: + for e in scan(element.children): + yield e + + return scan(self.children) + + def iter_raise_stmts(self): + """ + Returns a generator of `raise_stmt`. Includes raise statements inside try-except blocks + """ + def scan(children): + for element in children: + if element.type == 'raise_stmt' \ + or element.type == 'keyword' and element.value == 'raise': + yield element + if element.type in _RETURN_STMT_CONTAINERS: + for e in scan(element.children): + yield e + + return scan(self.children) + + def is_generator(self): + """ + :return bool: Checks if a function is a generator or not. + """ + return next(self.iter_yield_exprs(), None) is not None + + @property + def annotation(self): + """ + Returns the test node after `->` or `None` if there is no annotation. + """ + try: + if self.children[3] == "->": + return self.children[4] + assert self.children[3] == ":" + return None + except IndexError: + return None + + +class Lambda(Function): + """ + Lambdas are basically trimmed functions, so give it the same interface. + + Children:: + + 0. + *. for each argument x + -2. + -1. Node() representing body + """ + type = 'lambdef' + __slots__ = () + + def __init__(self, children): + # We don't want to call the Function constructor, call its parent. + super(Function, self).__init__(children) + # Everything between `lambda` and the `:` operator is a parameter. + self.children[1:-2] = _create_params(self, self.children[1:-2]) + + @property + def name(self): + """ + Raises an AttributeError. Lambdas don't have a defined name. + """ + raise AttributeError("lambda is not named.") + + def _get_param_nodes(self): + return self.children[1:-2] + + @property + def annotation(self): + """ + Returns `None`, lambdas don't have annotations. + """ + return None + + def __repr__(self): + return "<%s@%s>" % (self.__class__.__name__, self.start_pos) + + +class Flow(PythonBaseNode): + __slots__ = () + + +class IfStmt(Flow): + type = 'if_stmt' + __slots__ = () + + def get_test_nodes(self): + """ + E.g. returns all the `test` nodes that are named as x, below: + + if x: + pass + elif x: + pass + """ + for i, c in enumerate(self.children): + if c in ('elif', 'if'): + yield self.children[i + 1] + + def get_corresponding_test_node(self, node): + """ + Searches for the branch in which the node is and returns the + corresponding test node (see function above). However if the node is in + the test node itself and not in the suite return None. + """ + start_pos = node.start_pos + for check_node in reversed(list(self.get_test_nodes())): + if check_node.start_pos < start_pos: + if start_pos < check_node.end_pos: + return None + # In this case the node is within the check_node itself, + # not in the suite + else: + return check_node + + def is_node_after_else(self, node): + """ + Checks if a node is defined after `else`. + """ + for c in self.children: + if c == 'else': + if node.start_pos > c.start_pos: + return True + else: + return False + + +class WhileStmt(Flow): + type = 'while_stmt' + __slots__ = () + + +class ForStmt(Flow): + type = 'for_stmt' + __slots__ = () + + def get_testlist(self): + """ + Returns the input node ``y`` from: ``for x in y:``. + """ + return self.children[3] + + def get_defined_names(self): + return _defined_names(self.children[1]) + + +class TryStmt(Flow): + type = 'try_stmt' + __slots__ = () + + def get_except_clause_tests(self): + """ + Returns the ``test`` nodes found in ``except_clause`` nodes. + Returns ``[None]`` for except clauses without an exception given. + """ + for node in self.children: + if node.type == 'except_clause': + yield node.children[1] + elif node == 'except': + yield None + + +class WithStmt(Flow): + type = 'with_stmt' + __slots__ = () + + def get_defined_names(self): + """ + Returns the a list of `Name` that the with statement defines. The + defined names are set after `as`. + """ + names = [] + for with_item in self.children[1:-2:2]: + # Check with items for 'as' names. + if with_item.type == 'with_item': + names += _defined_names(with_item.children[2]) + return names + + def get_test_node_from_name(self, name): + node = name.parent + if node.type != 'with_item': + raise ValueError('The name is not actually part of a with statement.') + return node.children[0] + + +class Import(PythonBaseNode): + __slots__ = () + + def get_path_for_name(self, name): + """ + The path is the list of names that leads to the searched name. + + :return list of Name: + """ + try: + # The name may be an alias. If it is, just map it back to the name. + name = self._aliases()[name] + except KeyError: + pass + + for path in self.get_paths(): + if name in path: + return path[:path.index(name) + 1] + raise ValueError('Name should be defined in the import itself') + + def is_nested(self): + return False # By default, sub classes may overwrite this behavior + + def is_star_import(self): + return self.children[-1] == '*' + + +class ImportFrom(Import): + type = 'import_from' + __slots__ = () + + def get_defined_names(self): + """ + Returns the a list of `Name` that the import defines. The + defined names are set after `import` or in case an alias - `as` - is + present that name is returned. + """ + return [alias or name for name, alias in self._as_name_tuples()] + + def _aliases(self): + """Mapping from alias to its corresponding name.""" + return dict((alias, name) for name, alias in self._as_name_tuples() + if alias is not None) + + def get_from_names(self): + for n in self.children[1:]: + if n not in ('.', '...'): + break + if n.type == 'dotted_name': # from x.y import + return n.children[::2] + elif n == 'import': # from . import + return [] + else: # from x import + return [n] + + @property + def level(self): + """The level parameter of ``__import__``.""" + level = 0 + for n in self.children[1:]: + if n in ('.', '...'): + level += len(n.value) + else: + break + return level + + def _as_name_tuples(self): + last = self.children[-1] + if last == ')': + last = self.children[-2] + elif last == '*': + return # No names defined directly. + + if last.type == 'import_as_names': + as_names = last.children[::2] + else: + as_names = [last] + for as_name in as_names: + if as_name.type == 'name': + yield as_name, None + else: + yield as_name.children[::2] # yields x, y -> ``x as y`` + + def get_paths(self): + """ + The import paths defined in an import statement. Typically an array + like this: ``[, ]``. + + :return list of list of Name: + """ + dotted = self.get_from_names() + + if self.children[-1] == '*': + return [dotted] + return [dotted + [name] for name, alias in self._as_name_tuples()] + + +class ImportName(Import): + """For ``import_name`` nodes. Covers normal imports without ``from``.""" + type = 'import_name' + __slots__ = () + + def get_defined_names(self): + """ + Returns the a list of `Name` that the import defines. The defined names + is always the first name after `import` or in case an alias - `as` - is + present that name is returned. + """ + return [alias or path[0] for path, alias in self._dotted_as_names()] + + @property + def level(self): + """The level parameter of ``__import__``.""" + return 0 # Obviously 0 for imports without from. + + def get_paths(self): + return [path for path, alias in self._dotted_as_names()] + + def _dotted_as_names(self): + """Generator of (list(path), alias) where alias may be None.""" + dotted_as_names = self.children[1] + if dotted_as_names.type == 'dotted_as_names': + as_names = dotted_as_names.children[::2] + else: + as_names = [dotted_as_names] + + for as_name in as_names: + if as_name.type == 'dotted_as_name': + alias = as_name.children[2] + as_name = as_name.children[0] + else: + alias = None + if as_name.type == 'name': + yield [as_name], alias + else: + # dotted_names + yield as_name.children[::2], alias + + def is_nested(self): + """ + This checks for the special case of nested imports, without aliases and + from statement:: + + import foo.bar + """ + return bool([1 for path, alias in self._dotted_as_names() + if alias is None and len(path) > 1]) + + def _aliases(self): + """ + :return list of Name: Returns all the alias + """ + return dict((alias, path[-1]) for path, alias in self._dotted_as_names() + if alias is not None) + + +class KeywordStatement(PythonBaseNode): + """ + For the following statements: `assert`, `del`, `global`, `nonlocal`, + `raise`, `return`, `yield`. + + `pass`, `continue` and `break` are not in there, because they are just + simple keywords and the parser reduces it to a keyword. + """ + __slots__ = () + + @property + def type(self): + """ + Keyword statements start with the keyword and end with `_stmt`. You can + crosscheck this with the Python grammar. + """ + return '%s_stmt' % self.keyword + + @property + def keyword(self): + return self.children[0].value + + +class AssertStmt(KeywordStatement): + __slots__ = () + + @property + def assertion(self): + return self.children[1] + + +class GlobalStmt(KeywordStatement): + __slots__ = () + + def get_global_names(self): + return self.children[1::2] + + +class ReturnStmt(KeywordStatement): + __slots__ = () + + +class YieldExpr(PythonBaseNode): + type = 'yield_expr' + __slots__ = () + + +def _defined_names(current): + """ + A helper function to find the defined names in statements, for loops and + list comprehensions. + """ + names = [] + if current.type in ('testlist_star_expr', 'testlist_comp', 'exprlist', 'testlist'): + for child in current.children[::2]: + names += _defined_names(child) + elif current.type in ('atom', 'star_expr'): + names += _defined_names(current.children[1]) + elif current.type in ('power', 'atom_expr'): + if current.children[-2] != '**': # Just if there's no operation + trailer = current.children[-1] + if trailer.children[0] == '.': + names.append(trailer.children[1]) + else: + names.append(current) + return names + + +class ExprStmt(PythonBaseNode, DocstringMixin): + type = 'expr_stmt' + __slots__ = () + + def get_defined_names(self): + """ + Returns a list of `Name` defined before the `=` sign. + """ + names = [] + if self.children[1].type == 'annassign': + names = _defined_names(self.children[0]) + return [ + name + for i in range(0, len(self.children) - 2, 2) + if '=' in self.children[i + 1].value + for name in _defined_names(self.children[i]) + ] + names + + def get_rhs(self): + """Returns the right-hand-side of the equals.""" + return self.children[-1] + + def yield_operators(self): + """ + Returns a generator of `+=`, `=`, etc. or None if there is no operation. + """ + first = self.children[1] + if first.type == 'annassign': + if len(first.children) <= 2: + return # No operator is available, it's just PEP 484. + + first = first.children[2] + yield first + + for operator in self.children[3::2]: + yield operator + + +class Param(PythonBaseNode): + """ + It's a helper class that makes business logic with params much easier. The + Python grammar defines no ``param`` node. It defines it in a different way + that is not really suited to working with parameters. + """ + type = 'param' + + def __init__(self, children, parent): + super(Param, self).__init__(children) + self.parent = parent + for child in children: + child.parent = self + + @property + def star_count(self): + """ + Is `0` in case of `foo`, `1` in case of `*foo` or `2` in case of + `**foo`. + """ + first = self.children[0] + if first in ('*', '**'): + return len(first.value) + return 0 + + @property + def default(self): + """ + The default is the test node that appears after the `=`. Is `None` in + case no default is present. + """ + has_comma = self.children[-1] == ',' + try: + if self.children[-2 - int(has_comma)] == '=': + return self.children[-1 - int(has_comma)] + except IndexError: + return None + + @property + def annotation(self): + """ + The default is the test node that appears after `:`. Is `None` in case + no annotation is present. + """ + tfpdef = self._tfpdef() + if tfpdef.type == 'tfpdef': + assert tfpdef.children[1] == ":" + assert len(tfpdef.children) == 3 + annotation = tfpdef.children[2] + return annotation + else: + return None + + def _tfpdef(self): + """ + tfpdef: see e.g. grammar36.txt. + """ + offset = int(self.children[0] in ('*', '**')) + return self.children[offset] + + @property + def name(self): + """ + The `Name` leaf of the param. + """ + if self._tfpdef().type == 'tfpdef': + return self._tfpdef().children[0] + else: + return self._tfpdef() + + def get_defined_names(self): + return [self.name] + + @property + def position_index(self): + """ + Property for the positional index of a paramter. + """ + index = self.parent.children.index(self) + try: + keyword_only_index = self.parent.children.index('*') + if index > keyword_only_index: + # Skip the ` *, ` + index -= 2 + except ValueError: + pass + try: + keyword_only_index = self.parent.children.index('/') + if index > keyword_only_index: + # Skip the ` /, ` + index -= 2 + except ValueError: + pass + return index - 1 + + def get_parent_function(self): + """ + Returns the function/lambda of a parameter. + """ + return search_ancestor(self, 'funcdef', 'lambdef') + + def get_code(self, include_prefix=True, include_comma=True): + """ + Like all the other get_code functions, but includes the param + `include_comma`. + + :param include_comma bool: If enabled includes the comma in the string output. + """ + if include_comma: + return super(Param, self).get_code(include_prefix) + + children = self.children + if children[-1] == ',': + children = children[:-1] + return self._get_code_for_children( + children, + include_prefix=include_prefix + ) + + def __repr__(self): + default = '' if self.default is None else '=%s' % self.default.get_code() + return '<%s: %s>' % (type(self).__name__, str(self._tfpdef()) + default) + + +class SyncCompFor(PythonBaseNode): + type = 'sync_comp_for' + __slots__ = () + + def get_defined_names(self): + """ + Returns the a list of `Name` that the comprehension defines. + """ + # allow async for + return _defined_names(self.children[1]) + + +# This is simply here so an older Jedi version can work with this new parso +# version. Can be deleted in the next release. +CompFor = SyncCompFor + + +class UsedNamesMapping(Mapping): + """ + This class exists for the sole purpose of creating an immutable dict. + """ + def __init__(self, dct): + self._dict = dct + + def __getitem__(self, key): + return self._dict[key] + + def __len__(self): + return len(self._dict) + + def __iter__(self): + return iter(self._dict) + + def __hash__(self): + return id(self) + + def __eq__(self, other): + # Comparing these dicts does not make sense. + return self is other diff --git a/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/tree.py b/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/tree.py new file mode 100644 index 0000000..f5871a6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/tree.py @@ -0,0 +1,366 @@ +from abc import abstractmethod, abstractproperty + +from parso._compatibility import utf8_repr, encoding, py_version +from parso.utils import split_lines + + +def search_ancestor(node, *node_types): + """ + Recursively looks at the parents of a node and returns the first found node + that matches node_types. Returns ``None`` if no matching node is found. + + :param node: The ancestors of this node will be checked. + :param node_types: type names that are searched for. + :type node_types: tuple of str + """ + while True: + node = node.parent + if node is None or node.type in node_types: + return node + + +class NodeOrLeaf(object): + """ + The base class for nodes and leaves. + """ + __slots__ = () + type = None + ''' + The type is a string that typically matches the types of the grammar file. + ''' + + def get_root_node(self): + """ + Returns the root node of a parser tree. The returned node doesn't have + a parent node like all the other nodes/leaves. + """ + scope = self + while scope.parent is not None: + scope = scope.parent + return scope + + def get_next_sibling(self): + """ + Returns the node immediately following this node in this parent's + children list. If this node does not have a next sibling, it is None + """ + # Can't use index(); we need to test by identity + for i, child in enumerate(self.parent.children): + if child is self: + try: + return self.parent.children[i + 1] + except IndexError: + return None + + def get_previous_sibling(self): + """ + Returns the node immediately preceding this node in this parent's + children list. If this node does not have a previous sibling, it is + None. + """ + # Can't use index(); we need to test by identity + for i, child in enumerate(self.parent.children): + if child is self: + if i == 0: + return None + return self.parent.children[i - 1] + + def get_previous_leaf(self): + """ + Returns the previous leaf in the parser tree. + Returns `None` if this is the first element in the parser tree. + """ + node = self + while True: + c = node.parent.children + i = c.index(node) + if i == 0: + node = node.parent + if node.parent is None: + return None + else: + node = c[i - 1] + break + + while True: + try: + node = node.children[-1] + except AttributeError: # A Leaf doesn't have children. + return node + + def get_next_leaf(self): + """ + Returns the next leaf in the parser tree. + Returns None if this is the last element in the parser tree. + """ + node = self + while True: + c = node.parent.children + i = c.index(node) + if i == len(c) - 1: + node = node.parent + if node.parent is None: + return None + else: + node = c[i + 1] + break + + while True: + try: + node = node.children[0] + except AttributeError: # A Leaf doesn't have children. + return node + + @abstractproperty + def start_pos(self): + """ + Returns the starting position of the prefix as a tuple, e.g. `(3, 4)`. + + :return tuple of int: (line, column) + """ + + @abstractproperty + def end_pos(self): + """ + Returns the end position of the prefix as a tuple, e.g. `(3, 4)`. + + :return tuple of int: (line, column) + """ + + @abstractmethod + def get_start_pos_of_prefix(self): + """ + Returns the start_pos of the prefix. This means basically it returns + the end_pos of the last prefix. The `get_start_pos_of_prefix()` of the + prefix `+` in `2 + 1` would be `(1, 1)`, while the start_pos is + `(1, 2)`. + + :return tuple of int: (line, column) + """ + + @abstractmethod + def get_first_leaf(self): + """ + Returns the first leaf of a node or itself if this is a leaf. + """ + + @abstractmethod + def get_last_leaf(self): + """ + Returns the last leaf of a node or itself if this is a leaf. + """ + + @abstractmethod + def get_code(self, include_prefix=True): + """ + Returns the code that was input the input for the parser for this node. + + :param include_prefix: Removes the prefix (whitespace and comments) of + e.g. a statement. + """ + + +class Leaf(NodeOrLeaf): + ''' + Leafs are basically tokens with a better API. Leafs exactly know where they + were defined and what text preceeds them. + ''' + __slots__ = ('value', 'parent', 'line', 'column', 'prefix') + + def __init__(self, value, start_pos, prefix=''): + self.value = value + ''' + :py:func:`str` The value of the current token. + ''' + self.start_pos = start_pos + self.prefix = prefix + ''' + :py:func:`str` Typically a mixture of whitespace and comments. Stuff + that is syntactically irrelevant for the syntax tree. + ''' + self.parent = None + ''' + The parent :class:`BaseNode` of this leaf. + ''' + + @property + def start_pos(self): + return self.line, self.column + + @start_pos.setter + def start_pos(self, value): + self.line = value[0] + self.column = value[1] + + def get_start_pos_of_prefix(self): + previous_leaf = self.get_previous_leaf() + if previous_leaf is None: + lines = split_lines(self.prefix) + # + 1 is needed because split_lines always returns at least ['']. + return self.line - len(lines) + 1, 0 # It's the first leaf. + return previous_leaf.end_pos + + def get_first_leaf(self): + return self + + def get_last_leaf(self): + return self + + def get_code(self, include_prefix=True): + if include_prefix: + return self.prefix + self.value + else: + return self.value + + @property + def end_pos(self): + lines = split_lines(self.value) + end_pos_line = self.line + len(lines) - 1 + # Check for multiline token + if self.line == end_pos_line: + end_pos_column = self.column + len(lines[-1]) + else: + end_pos_column = len(lines[-1]) + return end_pos_line, end_pos_column + + @utf8_repr + def __repr__(self): + value = self.value + if not value: + value = self.type + return "<%s: %s>" % (type(self).__name__, value) + + +class TypedLeaf(Leaf): + __slots__ = ('type',) + + def __init__(self, type, value, start_pos, prefix=''): + super(TypedLeaf, self).__init__(value, start_pos, prefix) + self.type = type + + +class BaseNode(NodeOrLeaf): + """ + The super class for all nodes. + A node has children, a type and possibly a parent node. + """ + __slots__ = ('children', 'parent') + type = None + + def __init__(self, children): + self.children = children + """ + A list of :class:`NodeOrLeaf` child nodes. + """ + self.parent = None + ''' + The parent :class:`BaseNode` of this leaf. + None if this is the root node. + ''' + + @property + def start_pos(self): + return self.children[0].start_pos + + def get_start_pos_of_prefix(self): + return self.children[0].get_start_pos_of_prefix() + + @property + def end_pos(self): + return self.children[-1].end_pos + + def _get_code_for_children(self, children, include_prefix): + if include_prefix: + return "".join(c.get_code() for c in children) + else: + first = children[0].get_code(include_prefix=False) + return first + "".join(c.get_code() for c in children[1:]) + + def get_code(self, include_prefix=True): + return self._get_code_for_children(self.children, include_prefix) + + def get_leaf_for_position(self, position, include_prefixes=False): + """ + Get the :py:class:`parso.tree.Leaf` at ``position`` + + :param tuple position: A position tuple, row, column. Rows start from 1 + :param bool include_prefixes: If ``False``, ``None`` will be returned if ``position`` falls + on whitespace or comments before a leaf + :return: :py:class:`parso.tree.Leaf` at ``position``, or ``None`` + """ + def binary_search(lower, upper): + if lower == upper: + element = self.children[lower] + if not include_prefixes and position < element.start_pos: + # We're on a prefix. + return None + # In case we have prefixes, a leaf always matches + try: + return element.get_leaf_for_position(position, include_prefixes) + except AttributeError: + return element + + + index = int((lower + upper) / 2) + element = self.children[index] + if position <= element.end_pos: + return binary_search(lower, index) + else: + return binary_search(index + 1, upper) + + if not ((1, 0) <= position <= self.children[-1].end_pos): + raise ValueError('Please provide a position that exists within this node.') + return binary_search(0, len(self.children) - 1) + + def get_first_leaf(self): + return self.children[0].get_first_leaf() + + def get_last_leaf(self): + return self.children[-1].get_last_leaf() + + @utf8_repr + def __repr__(self): + code = self.get_code().replace('\n', ' ').replace('\r', ' ').strip() + if not py_version >= 30: + code = code.encode(encoding, 'replace') + return "<%s: %s@%s,%s>" % \ + (type(self).__name__, code, self.start_pos[0], self.start_pos[1]) + + +class Node(BaseNode): + """Concrete implementation for interior nodes.""" + __slots__ = ('type',) + + def __init__(self, type, children): + super(Node, self).__init__(children) + self.type = type + + def __repr__(self): + return "%s(%s, %r)" % (self.__class__.__name__, self.type, self.children) + + +class ErrorNode(BaseNode): + """ + A node that contains valid nodes/leaves that we're follow by a token that + was invalid. This basically means that the leaf after this node is where + Python would mark a syntax error. + """ + __slots__ = () + type = 'error_node' + + +class ErrorLeaf(Leaf): + """ + A leaf that is either completely invalid in a language (like `$` in Python) + or is invalid at that position. Like the star in `1 +* 1`. + """ + __slots__ = ('token_type',) + type = 'error_leaf' + + def __init__(self, token_type, value, start_pos, prefix=''): + super(ErrorLeaf, self).__init__(value, start_pos, prefix) + self.token_type = token_type + + def __repr__(self): + return "<%s: %s:%s, %s>" % \ + (type(self).__name__, self.token_type, repr(self.value), self.start_pos) diff --git a/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/utils.py b/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/utils.py new file mode 100644 index 0000000..579c4cc --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/build/lib/parso/utils.py @@ -0,0 +1,175 @@ +from collections import namedtuple +import re +import sys +from ast import literal_eval + +from parso._compatibility import unicode, total_ordering + +# The following is a list in Python that are line breaks in str.splitlines, but +# not in Python. In Python only \r (Carriage Return, 0xD) and \n (Line Feed, +# 0xA) are allowed to split lines. +_NON_LINE_BREAKS = ( + u'\v', # Vertical Tabulation 0xB + u'\f', # Form Feed 0xC + u'\x1C', # File Separator + u'\x1D', # Group Separator + u'\x1E', # Record Separator + u'\x85', # Next Line (NEL - Equivalent to CR+LF. + # Used to mark end-of-line on some IBM mainframes.) + u'\u2028', # Line Separator + u'\u2029', # Paragraph Separator +) + +Version = namedtuple('Version', 'major, minor, micro') + + +def split_lines(string, keepends=False): + r""" + Intended for Python code. In contrast to Python's :py:meth:`str.splitlines`, + looks at form feeds and other special characters as normal text. Just + splits ``\n`` and ``\r\n``. + Also different: Returns ``[""]`` for an empty string input. + + In Python 2.7 form feeds are used as normal characters when using + str.splitlines. However in Python 3 somewhere there was a decision to split + also on form feeds. + """ + if keepends: + lst = string.splitlines(True) + + # We have to merge lines that were broken by form feed characters. + merge = [] + for i, line in enumerate(lst): + try: + last_chr = line[-1] + except IndexError: + pass + else: + if last_chr in _NON_LINE_BREAKS: + merge.append(i) + + for index in reversed(merge): + try: + lst[index] = lst[index] + lst[index + 1] + del lst[index + 1] + except IndexError: + # index + 1 can be empty and therefore there's no need to + # merge. + pass + + # The stdlib's implementation of the end is inconsistent when calling + # it with/without keepends. One time there's an empty string in the + # end, one time there's none. + if string.endswith('\n') or string.endswith('\r') or string == '': + lst.append('') + return lst + else: + return re.split(r'\n|\r\n|\r', string) + + +def python_bytes_to_unicode(source, encoding='utf-8', errors='strict'): + """ + Checks for unicode BOMs and PEP 263 encoding declarations. Then returns a + unicode object like in :py:meth:`bytes.decode`. + + :param encoding: See :py:meth:`bytes.decode` documentation. + :param errors: See :py:meth:`bytes.decode` documentation. ``errors`` can be + ``'strict'``, ``'replace'`` or ``'ignore'``. + """ + def detect_encoding(): + """ + For the implementation of encoding definitions in Python, look at: + - http://www.python.org/dev/peps/pep-0263/ + - http://docs.python.org/2/reference/lexical_analysis.html#encoding-declarations + """ + byte_mark = literal_eval(r"b'\xef\xbb\xbf'") + if source.startswith(byte_mark): + # UTF-8 byte-order mark + return 'utf-8' + + first_two_lines = re.match(br'(?:[^\n]*\n){0,2}', source).group(0) + possible_encoding = re.search(br"coding[=:]\s*([-\w.]+)", + first_two_lines) + if possible_encoding: + return possible_encoding.group(1) + else: + # the default if nothing else has been set -> PEP 263 + return encoding + + if isinstance(source, unicode): + # only cast str/bytes + return source + + encoding = detect_encoding() + if not isinstance(encoding, unicode): + encoding = unicode(encoding, 'utf-8', 'replace') + + # Cast to unicode + return unicode(source, encoding, errors) + + +def version_info(): + """ + Returns a namedtuple of parso's version, similar to Python's + ``sys.version_info``. + """ + from parso import __version__ + tupl = re.findall(r'[a-z]+|\d+', __version__) + return Version(*[x if i == 3 else int(x) for i, x in enumerate(tupl)]) + + +def _parse_version(version): + match = re.match(r'(\d+)(?:\.(\d)(?:\.\d+)?)?$', version) + if match is None: + raise ValueError('The given version is not in the right format. ' + 'Use something like "3.2" or "3".') + + major = int(match.group(1)) + minor = match.group(2) + if minor is None: + # Use the latest Python in case it's not exactly defined, because the + # grammars are typically backwards compatible? + if major == 2: + minor = "7" + elif major == 3: + minor = "6" + else: + raise NotImplementedError("Sorry, no support yet for those fancy new/old versions.") + minor = int(minor) + return PythonVersionInfo(major, minor) + + +@total_ordering +class PythonVersionInfo(namedtuple('Version', 'major, minor')): + def __gt__(self, other): + if isinstance(other, tuple): + if len(other) != 2: + raise ValueError("Can only compare to tuples of length 2.") + return (self.major, self.minor) > other + super(PythonVersionInfo, self).__gt__(other) + + return (self.major, self.minor) + + def __eq__(self, other): + if isinstance(other, tuple): + if len(other) != 2: + raise ValueError("Can only compare to tuples of length 2.") + return (self.major, self.minor) == other + super(PythonVersionInfo, self).__eq__(other) + + def __ne__(self, other): + return not self.__eq__(other) + + +def parse_version_string(version=None): + """ + Checks for a valid version number (e.g. `3.2` or `2.7.1` or `3`) and + returns a corresponding version info that is always two characters long in + decimal. + """ + if version is None: + version = '%s.%s' % sys.version_info[:2] + if not isinstance(version, (unicode, str)): + raise TypeError("version must be a string like 3.2.") + + return _parse_version(version) diff --git a/vim/bundle/jedi-vim/pythonx/parso/conftest.py b/vim/bundle/jedi-vim/pythonx/parso/conftest.py new file mode 100644 index 0000000..f69ad9e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/conftest.py @@ -0,0 +1,163 @@ +import re +import tempfile +import shutil +import logging +import sys +import os + +import pytest + +import parso +from parso import cache +from parso.utils import parse_version_string + +collect_ignore = ["setup.py"] + +VERSIONS_2 = '2.6', '2.7' +VERSIONS_3 = '3.3', '3.4', '3.5', '3.6', '3.7', '3.8' + + +@pytest.fixture(scope='session') +def clean_parso_cache(): + """ + Set the default cache directory to a temporary directory during tests. + + Note that you can't use built-in `tmpdir` and `monkeypatch` + fixture here because their scope is 'function', which is not used + in 'session' scope fixture. + + This fixture is activated in ../pytest.ini. + """ + old = cache._default_cache_path + tmp = tempfile.mkdtemp(prefix='parso-test-') + cache._default_cache_path = tmp + yield + cache._default_cache_path = old + shutil.rmtree(tmp) + + +def pytest_addoption(parser): + parser.addoption("--logging", "-L", action='store_true', + help="Enables the logging output.") + + +def pytest_generate_tests(metafunc): + if 'normalizer_issue_case' in metafunc.fixturenames: + base_dir = os.path.join(os.path.dirname(__file__), 'test', 'normalizer_issue_files') + + cases = list(colllect_normalizer_tests(base_dir)) + metafunc.parametrize( + 'normalizer_issue_case', + cases, + ids=[c.name for c in cases] + ) + elif 'each_version' in metafunc.fixturenames: + metafunc.parametrize('each_version', VERSIONS_2 + VERSIONS_3) + elif 'each_py2_version' in metafunc.fixturenames: + metafunc.parametrize('each_py2_version', VERSIONS_2) + elif 'each_py3_version' in metafunc.fixturenames: + metafunc.parametrize('each_py3_version', VERSIONS_3) + elif 'version_ge_py36' in metafunc.fixturenames: + metafunc.parametrize('version_ge_py36', ['3.6', '3.7']) + + +class NormalizerIssueCase(object): + """ + Static Analysis cases lie in the static_analysis folder. + The tests also start with `#!`, like the goto_definition tests. + """ + def __init__(self, path): + self.path = path + self.name = os.path.basename(path) + match = re.search(r'python([\d.]+)\.py', self.name) + self.python_version = match and match.group(1) + + +def colllect_normalizer_tests(base_dir): + for f_name in os.listdir(base_dir): + if f_name.endswith(".py"): + path = os.path.join(base_dir, f_name) + yield NormalizerIssueCase(path) + + +def pytest_configure(config): + if config.option.logging: + root = logging.getLogger() + root.setLevel(logging.DEBUG) + + ch = logging.StreamHandler(sys.stdout) + ch.setLevel(logging.DEBUG) + #formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s') + #ch.setFormatter(formatter) + + root.addHandler(ch) + + +class Checker(): + def __init__(self, version, is_passing): + self.version = version + self._is_passing = is_passing + self.grammar = parso.load_grammar(version=self.version) + + def parse(self, code): + if self._is_passing: + return parso.parse(code, version=self.version, error_recovery=False) + else: + self._invalid_syntax(code) + + def _invalid_syntax(self, code): + with pytest.raises(parso.ParserSyntaxError): + module = parso.parse(code, version=self.version, error_recovery=False) + # For debugging + print(module.children) + + def get_error(self, code): + errors = list(self.grammar.iter_errors(self.grammar.parse(code))) + assert bool(errors) != self._is_passing + if errors: + return errors[0] + + def get_error_message(self, code): + error = self.get_error(code) + if error is None: + return + return error.message + + def assert_no_error_in_passing(self, code): + if self._is_passing: + module = self.grammar.parse(code) + assert not list(self.grammar.iter_errors(module)) + + +@pytest.fixture +def works_not_in_py(each_version): + return Checker(each_version, False) + + +@pytest.fixture +def works_in_py2(each_version): + return Checker(each_version, each_version.startswith('2')) + + +@pytest.fixture +def works_ge_py27(each_version): + version_info = parse_version_string(each_version) + return Checker(each_version, version_info >= (2, 7)) + + +@pytest.fixture +def works_ge_py3(each_version): + version_info = parse_version_string(each_version) + return Checker(each_version, version_info >= (3, 0)) + + +@pytest.fixture +def works_ge_py35(each_version): + version_info = parse_version_string(each_version) + return Checker(each_version, version_info >= (3, 5)) + + +@pytest.fixture +def works_ge_py38(each_version): + version_info = parse_version_string(each_version) + return Checker(each_version, version_info >= (3, 8)) diff --git a/vim/bundle/jedi-vim/pythonx/parso/deploy-master.sh b/vim/bundle/jedi-vim/pythonx/parso/deploy-master.sh new file mode 100755 index 0000000..8179d01 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/deploy-master.sh @@ -0,0 +1,52 @@ +#!/usr/bin/env bash +# The script creates a separate folder in build/ and creates tags there, pushes +# them and then uploads the package to PyPI. + +set -eu -o pipefail + +BASE_DIR=$(dirname $(readlink -f "$0")) +cd $BASE_DIR + +git fetch --tags + +PROJECT_NAME=parso +BRANCH=master +BUILD_FOLDER=build + +[ -d $BUILD_FOLDER ] || mkdir $BUILD_FOLDER +# Remove the previous deployment first. +# Checkout the right branch +cd $BUILD_FOLDER +rm -rf $PROJECT_NAME +git clone .. $PROJECT_NAME +cd $PROJECT_NAME +git checkout $BRANCH + +# Test first. +tox + +# Create tag +tag=v$(python -c "import $PROJECT_NAME; print($PROJECT_NAME.__version__)") + +master_ref=$(git show-ref -s heads/$BRANCH) +tag_ref=$(git show-ref -s $tag || true) +if [[ $tag_ref ]]; then + if [[ $tag_ref != $master_ref ]]; then + echo 'Cannot tag something that has already been tagged with another commit.' + exit 1 + fi +else + git tag -a $tag + git push --tags +fi + +# Package and upload to PyPI +#rm -rf dist/ - Not needed anymore, because the folder is never reused. +echo `pwd` +python setup.py sdist bdist_wheel +# Maybe do a pip install twine before. +twine upload dist/* + +cd $BASE_DIR +# The tags have been pushed to this repo. Push the tags to github, now. +git push --tags diff --git a/vim/bundle/jedi-vim/pythonx/parso/dist/parso-0.5.1-py3.6.egg b/vim/bundle/jedi-vim/pythonx/parso/dist/parso-0.5.1-py3.6.egg new file mode 100644 index 0000000..0bd5259 Binary files /dev/null and b/vim/bundle/jedi-vim/pythonx/parso/dist/parso-0.5.1-py3.6.egg differ diff --git a/vim/bundle/jedi-vim/pythonx/parso/docs/Makefile b/vim/bundle/jedi-vim/pythonx/parso/docs/Makefile new file mode 100644 index 0000000..1348ee3 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/docs/Makefile @@ -0,0 +1,153 @@ +# Makefile for Sphinx documentation +# + +# You can set these variables from the command line. +SPHINXOPTS = +SPHINXBUILD = sphinx-build +PAPER = +BUILDDIR = _build + +# Internal variables. +PAPEROPT_a4 = -D latex_paper_size=a4 +PAPEROPT_letter = -D latex_paper_size=letter +ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . +# the i18n builder cannot share the environment and doctrees with the others +I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . + +.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext + +help: + @echo "Please use \`make ' where is one of" + @echo " html to make standalone HTML files" + @echo " dirhtml to make HTML files named index.html in directories" + @echo " singlehtml to make a single large HTML file" + @echo " pickle to make pickle files" + @echo " json to make JSON files" + @echo " htmlhelp to make HTML files and a HTML help project" + @echo " qthelp to make HTML files and a qthelp project" + @echo " devhelp to make HTML files and a Devhelp project" + @echo " epub to make an epub" + @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" + @echo " latexpdf to make LaTeX files and run them through pdflatex" + @echo " text to make text files" + @echo " man to make manual pages" + @echo " texinfo to make Texinfo files" + @echo " info to make Texinfo files and run them through makeinfo" + @echo " gettext to make PO message catalogs" + @echo " changes to make an overview of all changed/added/deprecated items" + @echo " linkcheck to check all external links for integrity" + @echo " doctest to run all doctests embedded in the documentation (if enabled)" + +clean: + -rm -rf $(BUILDDIR)/* + +html: + $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." + +dirhtml: + $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." + +singlehtml: + $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml + @echo + @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." + +pickle: + $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle + @echo + @echo "Build finished; now you can process the pickle files." + +json: + $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json + @echo + @echo "Build finished; now you can process the JSON files." + +htmlhelp: + $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp + @echo + @echo "Build finished; now you can run HTML Help Workshop with the" \ + ".hhp project file in $(BUILDDIR)/htmlhelp." + +qthelp: + $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp + @echo + @echo "Build finished; now you can run "qcollectiongenerator" with the" \ + ".qhcp project file in $(BUILDDIR)/qthelp, like this:" + @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/parso.qhcp" + @echo "To view the help file:" + @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/parso.qhc" + +devhelp: + $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp + @echo + @echo "Build finished." + @echo "To view the help file:" + @echo "# mkdir -p $$HOME/.local/share/devhelp/parso" + @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/parso" + @echo "# devhelp" + +epub: + $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub + @echo + @echo "Build finished. The epub file is in $(BUILDDIR)/epub." + +latex: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo + @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." + @echo "Run \`make' in that directory to run these through (pdf)latex" \ + "(use \`make latexpdf' here to do that automatically)." + +latexpdf: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo "Running LaTeX files through pdflatex..." + $(MAKE) -C $(BUILDDIR)/latex all-pdf + @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." + +text: + $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text + @echo + @echo "Build finished. The text files are in $(BUILDDIR)/text." + +man: + $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man + @echo + @echo "Build finished. The manual pages are in $(BUILDDIR)/man." + +texinfo: + $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo + @echo + @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." + @echo "Run \`make' in that directory to run these through makeinfo" \ + "(use \`make info' here to do that automatically)." + +info: + $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo + @echo "Running Texinfo files through makeinfo..." + make -C $(BUILDDIR)/texinfo info + @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." + +gettext: + $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale + @echo + @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." + +changes: + $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes + @echo + @echo "The overview file is in $(BUILDDIR)/changes." + +linkcheck: + $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck + @echo + @echo "Link check complete; look for any errors in the above output " \ + "or in $(BUILDDIR)/linkcheck/output.txt." + +doctest: + $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest + @echo "Testing of doctests in the sources finished, look at the " \ + "results in $(BUILDDIR)/doctest/output.txt." diff --git a/vim/bundle/jedi-vim/pythonx/parso/docs/README.md b/vim/bundle/jedi-vim/pythonx/parso/docs/README.md new file mode 100644 index 0000000..d931ca3 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/docs/README.md @@ -0,0 +1,6 @@ +Installation +------------ + +Install sphinx:: + + sudo pip install sphinx diff --git a/vim/bundle/jedi-vim/pythonx/parso/docs/_static/logo.png b/vim/bundle/jedi-vim/pythonx/parso/docs/_static/logo.png new file mode 100644 index 0000000..5c3e47a Binary files /dev/null and b/vim/bundle/jedi-vim/pythonx/parso/docs/_static/logo.png differ diff --git a/vim/bundle/jedi-vim/pythonx/parso/docs/_static/logo_characters.png b/vim/bundle/jedi-vim/pythonx/parso/docs/_static/logo_characters.png new file mode 100644 index 0000000..c2387ec Binary files /dev/null and b/vim/bundle/jedi-vim/pythonx/parso/docs/_static/logo_characters.png differ diff --git a/vim/bundle/jedi-vim/pythonx/parso/docs/_templates/ghbuttons.html b/vim/bundle/jedi-vim/pythonx/parso/docs/_templates/ghbuttons.html new file mode 100644 index 0000000..75d98a2 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/docs/_templates/ghbuttons.html @@ -0,0 +1,4 @@ +

Github

+ +

diff --git a/vim/bundle/jedi-vim/pythonx/parso/docs/_templates/sidebarlogo.html b/vim/bundle/jedi-vim/pythonx/parso/docs/_templates/sidebarlogo.html new file mode 100644 index 0000000..d9243c4 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/docs/_templates/sidebarlogo.html @@ -0,0 +1,3 @@ + diff --git a/vim/bundle/jedi-vim/pythonx/parso/docs/_themes/flask/LICENSE b/vim/bundle/jedi-vim/pythonx/parso/docs/_themes/flask/LICENSE new file mode 100644 index 0000000..8daab7e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/docs/_themes/flask/LICENSE @@ -0,0 +1,37 @@ +Copyright (c) 2010 by Armin Ronacher. + +Some rights reserved. + +Redistribution and use in source and binary forms of the theme, with or +without modification, are permitted provided that the following conditions +are met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + +* The names of the contributors may not be used to endorse or + promote products derived from this software without specific + prior written permission. + +We kindly ask you to only use these themes in an unmodified manner just +for Flask and Flask-related products, not for unrelated projects. If you +like the visual style and want to use it for your own projects, please +consider making some larger changes to the themes (such as changing +font faces, sizes, colors or margins). + +THIS THEME IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS THEME, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/vim/bundle/jedi-vim/pythonx/parso/docs/_themes/flask/layout.html b/vim/bundle/jedi-vim/pythonx/parso/docs/_themes/flask/layout.html new file mode 100644 index 0000000..bcd9dde --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/docs/_themes/flask/layout.html @@ -0,0 +1,27 @@ +{%- extends "basic/layout.html" %} +{%- block extrahead %} + {{ super() }} + {% if theme_touch_icon %} + + {% endif %} + + + Fork me + +{% endblock %} +{%- block relbar2 %}{% endblock %} +{% block header %} + {{ super() }} + {% if pagename == 'index' %} +
+ {% endif %} +{% endblock %} +{%- block footer %} + + {% if pagename == 'index' %} +
+ {% endif %} +{%- endblock %} diff --git a/vim/bundle/jedi-vim/pythonx/parso/docs/_themes/flask/relations.html b/vim/bundle/jedi-vim/pythonx/parso/docs/_themes/flask/relations.html new file mode 100644 index 0000000..3bbcde8 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/docs/_themes/flask/relations.html @@ -0,0 +1,19 @@ +

Related Topics

+ diff --git a/vim/bundle/jedi-vim/pythonx/parso/docs/_themes/flask/static/flasky.css_t b/vim/bundle/jedi-vim/pythonx/parso/docs/_themes/flask/static/flasky.css_t new file mode 100644 index 0000000..79ab478 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/docs/_themes/flask/static/flasky.css_t @@ -0,0 +1,394 @@ +/* + * flasky.css_t + * ~~~~~~~~~~~~ + * + * :copyright: Copyright 2010 by Armin Ronacher. + * :license: Flask Design License, see LICENSE for details. + */ + +{% set page_width = '940px' %} +{% set sidebar_width = '220px' %} + +@import url("basic.css"); + +/* -- page layout ----------------------------------------------------------- */ + +body { + font-family: 'Georgia', serif; + font-size: 17px; + background-color: white; + color: #000; + margin: 0; + padding: 0; +} + +div.document { + width: {{ page_width }}; + margin: 30px auto 0 auto; +} + +div.documentwrapper { + float: left; + width: 100%; +} + +div.bodywrapper { + margin: 0 0 0 {{ sidebar_width }}; +} + +div.sphinxsidebar { + width: {{ sidebar_width }}; +} + +hr { + border: 1px solid #B1B4B6; +} + +div.body { + background-color: #ffffff; + color: #3E4349; + padding: 0 30px 0 30px; +} + +img.floatingflask { + padding: 0 0 10px 10px; + float: right; +} + +div.footer { + width: {{ page_width }}; + margin: 20px auto 30px auto; + font-size: 14px; + color: #888; + text-align: right; +} + +div.footer a { + color: #888; +} + +div.related { + display: none; +} + +div.sphinxsidebar a { + color: #444; + text-decoration: none; + border-bottom: 1px dotted #999; +} + +div.sphinxsidebar a:hover { + border-bottom: 1px solid #999; +} + +div.sphinxsidebar { + font-size: 14px; + line-height: 1.5; +} + +div.sphinxsidebarwrapper { + padding: 18px 10px; +} + +div.sphinxsidebarwrapper p.logo { + padding: 0 0 20px 0; + margin: 0; + text-align: center; +} + +div.sphinxsidebar h3, +div.sphinxsidebar h4 { + font-family: 'Garamond', 'Georgia', serif; + color: #444; + font-size: 24px; + font-weight: normal; + margin: 0 0 5px 0; + padding: 0; +} + +div.sphinxsidebar h4 { + font-size: 20px; +} + +div.sphinxsidebar h3 a { + color: #444; +} + +div.sphinxsidebar p.logo a, +div.sphinxsidebar h3 a, +div.sphinxsidebar p.logo a:hover, +div.sphinxsidebar h3 a:hover { + border: none; +} + +div.sphinxsidebar p { + color: #555; + margin: 10px 0; +} + +div.sphinxsidebar ul { + margin: 10px 0; + padding: 0; + color: #000; +} + +div.sphinxsidebar input { + border: 1px solid #ccc; + font-family: 'Georgia', serif; + font-size: 1em; +} + +/* -- body styles ----------------------------------------------------------- */ + +a { + color: #004B6B; + text-decoration: underline; +} + +a:hover { + color: #6D4100; + text-decoration: underline; +} + +div.body h1, +div.body h2, +div.body h3, +div.body h4, +div.body h5, +div.body h6 { + font-family: 'Garamond', 'Georgia', serif; + font-weight: normal; + margin: 30px 0px 10px 0px; + padding: 0; +} + +{% if theme_index_logo %} +div.indexwrapper h1 { + text-indent: -999999px; + background: url({{ theme_index_logo }}) no-repeat center center; + height: {{ theme_index_logo_height }}; +} +{% endif %} + +div.body h1 { margin-top: 0; padding-top: 0; font-size: 240%; } +div.body h2 { font-size: 180%; } +div.body h3 { font-size: 150%; } +div.body h4 { font-size: 130%; } +div.body h5 { font-size: 100%; } +div.body h6 { font-size: 100%; } + +a.headerlink { + color: #ddd; + padding: 0 4px; + text-decoration: none; +} + +a.headerlink:hover { + color: #444; +} + +div.body p, div.body dd, div.body li { + line-height: 1.4em; +} + +div.admonition { + background: #fafafa; + margin: 20px -30px; + padding: 10px 30px; + border-top: 1px solid #ccc; + border-bottom: 1px solid #ccc; +} + +div.admonition tt.xref, div.admonition a tt { + border-bottom: 1px solid #fafafa; +} + +dd div.admonition { + margin-left: -60px; + padding-left: 60px; +} + +div.admonition p.admonition-title { + font-family: 'Garamond', 'Georgia', serif; + font-weight: normal; + font-size: 24px; + margin: 0 0 10px 0; + padding: 0; + line-height: 1; +} + +div.admonition p.last { + margin-bottom: 0; +} + +div.highlight { + background-color: white; +} + +dt:target, .highlight { + background: #FAF3E8; +} + +div.note { + background-color: #eee; + border: 1px solid #ccc; +} + +div.seealso { + background-color: #ffc; + border: 1px solid #ff6; +} + +div.topic { + background-color: #eee; +} + +p.admonition-title { + display: inline; +} + +p.admonition-title:after { + content: ":"; +} + +pre, tt { + font-family: 'Consolas', 'Menlo', 'Deja Vu Sans Mono', 'Bitstream Vera Sans Mono', monospace; + font-size: 0.9em; +} + +img.screenshot { +} + +tt.descname, tt.descclassname { + font-size: 0.95em; +} + +tt.descname { + padding-right: 0.08em; +} + +img.screenshot { + -moz-box-shadow: 2px 2px 4px #eee; + -webkit-box-shadow: 2px 2px 4px #eee; + box-shadow: 2px 2px 4px #eee; +} + +table.docutils { + border: 1px solid #888; + -moz-box-shadow: 2px 2px 4px #eee; + -webkit-box-shadow: 2px 2px 4px #eee; + box-shadow: 2px 2px 4px #eee; +} + +table.docutils td, table.docutils th { + border: 1px solid #888; + padding: 0.25em 0.7em; +} + +table.field-list, table.footnote { + border: none; + -moz-box-shadow: none; + -webkit-box-shadow: none; + box-shadow: none; +} + +table.footnote { + margin: 15px 0; + width: 100%; + border: 1px solid #eee; + background: #fdfdfd; + font-size: 0.9em; +} + +table.footnote + table.footnote { + margin-top: -15px; + border-top: none; +} + +table.field-list th { + padding: 0 0.8em 0 0; +} + +table.field-list td { + padding: 0; +} + +table.footnote td.label { + width: 0px; + padding: 0.3em 0 0.3em 0.5em; +} + +table.footnote td { + padding: 0.3em 0.5em; +} + +dl { + margin: 0; + padding: 0; +} + +dl dd { + margin-left: 30px; +} + +blockquote { + margin: 0 0 0 30px; + padding: 0; +} + +ul, ol { + margin: 10px 0 10px 30px; + padding: 0; +} + +pre { + background: #eee; + padding: 7px 30px; + margin: 15px -30px; + line-height: 1.3em; +} + +dl pre, blockquote pre, li pre { + margin-left: -60px; + padding-left: 60px; +} + +dl dl pre { + margin-left: -90px; + padding-left: 90px; +} + +tt { + background-color: #ecf0f3; + color: #222; + /* padding: 1px 2px; */ +} + +tt.xref, a tt { + background-color: #FBFBFB; + border-bottom: 1px solid white; +} + +a.reference { + text-decoration: none; + border-bottom: 1px dotted #004B6B; +} + +a.reference:hover { + border-bottom: 1px solid #6D4100; +} + +a.footnote-reference { + text-decoration: none; + font-size: 0.7em; + vertical-align: top; + border-bottom: 1px dotted #004B6B; +} + +a.footnote-reference:hover { + border-bottom: 1px solid #6D4100; +} + +a:hover tt { + background: #EEE; +} diff --git a/vim/bundle/jedi-vim/pythonx/parso/docs/_themes/flask/static/small_flask.css b/vim/bundle/jedi-vim/pythonx/parso/docs/_themes/flask/static/small_flask.css new file mode 100644 index 0000000..1c6df30 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/docs/_themes/flask/static/small_flask.css @@ -0,0 +1,70 @@ +/* + * small_flask.css_t + * ~~~~~~~~~~~~~~~~~ + * + * :copyright: Copyright 2010 by Armin Ronacher. + * :license: Flask Design License, see LICENSE for details. + */ + +body { + margin: 0; + padding: 20px 30px; +} + +div.documentwrapper { + float: none; + background: white; +} + +div.sphinxsidebar { + display: block; + float: none; + width: 102.5%; + margin: 50px -30px -20px -30px; + padding: 10px 20px; + background: #333; + color: white; +} + +div.sphinxsidebar h3, div.sphinxsidebar h4, div.sphinxsidebar p, +div.sphinxsidebar h3 a { + color: white; +} + +div.sphinxsidebar a { + color: #aaa; +} + +div.sphinxsidebar p.logo { + display: none; +} + +div.document { + width: 100%; + margin: 0; +} + +div.related { + display: block; + margin: 0; + padding: 10px 0 20px 0; +} + +div.related ul, +div.related ul li { + margin: 0; + padding: 0; +} + +div.footer { + display: none; +} + +div.bodywrapper { + margin: 0; +} + +div.body { + min-height: 0; + padding: 0; +} diff --git a/vim/bundle/jedi-vim/pythonx/parso/docs/_themes/flask/theme.conf b/vim/bundle/jedi-vim/pythonx/parso/docs/_themes/flask/theme.conf new file mode 100644 index 0000000..1d5657f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/docs/_themes/flask/theme.conf @@ -0,0 +1,9 @@ +[theme] +inherit = basic +stylesheet = flasky.css +pygments_style = flask_theme_support.FlaskyStyle + +[options] +index_logo = +index_logo_height = 120px +touch_icon = diff --git a/vim/bundle/jedi-vim/pythonx/parso/docs/_themes/flask_theme_support.py b/vim/bundle/jedi-vim/pythonx/parso/docs/_themes/flask_theme_support.py new file mode 100644 index 0000000..d3e33c0 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/docs/_themes/flask_theme_support.py @@ -0,0 +1,125 @@ +""" +Copyright (c) 2010 by Armin Ronacher. + +Some rights reserved. + +Redistribution and use in source and binary forms of the theme, with or +without modification, are permitted provided that the following conditions +are met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + +* The names of the contributors may not be used to endorse or + promote products derived from this software without specific + prior written permission. + +We kindly ask you to only use these themes in an unmodified manner just +for Flask and Flask-related products, not for unrelated projects. If you +like the visual style and want to use it for your own projects, please +consider making some larger changes to the themes (such as changing +font faces, sizes, colors or margins). + +THIS THEME IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS THEME, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +""" +# flasky extensions. flasky pygments style based on tango style +from pygments.style import Style +from pygments.token import Keyword, Name, Comment, String, Error, \ + Number, Operator, Generic, Whitespace, Punctuation, Other, Literal + + +class FlaskyStyle(Style): + background_color = "#f8f8f8" + default_style = "" + + styles = { + # No corresponding class for the following: + #Text: "", # class: '' + Whitespace: "underline #f8f8f8", # class: 'w' + Error: "#a40000 border:#ef2929", # class: 'err' + Other: "#000000", # class 'x' + + Comment: "italic #8f5902", # class: 'c' + Comment.Preproc: "noitalic", # class: 'cp' + + Keyword: "bold #004461", # class: 'k' + Keyword.Constant: "bold #004461", # class: 'kc' + Keyword.Declaration: "bold #004461", # class: 'kd' + Keyword.Namespace: "bold #004461", # class: 'kn' + Keyword.Pseudo: "bold #004461", # class: 'kp' + Keyword.Reserved: "bold #004461", # class: 'kr' + Keyword.Type: "bold #004461", # class: 'kt' + + Operator: "#582800", # class: 'o' + Operator.Word: "bold #004461", # class: 'ow' - like keywords + + Punctuation: "bold #000000", # class: 'p' + + # because special names such as Name.Class, Name.Function, etc. + # are not recognized as such later in the parsing, we choose them + # to look the same as ordinary variables. + Name: "#000000", # class: 'n' + Name.Attribute: "#c4a000", # class: 'na' - to be revised + Name.Builtin: "#004461", # class: 'nb' + Name.Builtin.Pseudo: "#3465a4", # class: 'bp' + Name.Class: "#000000", # class: 'nc' - to be revised + Name.Constant: "#000000", # class: 'no' - to be revised + Name.Decorator: "#888", # class: 'nd' - to be revised + Name.Entity: "#ce5c00", # class: 'ni' + Name.Exception: "bold #cc0000", # class: 'ne' + Name.Function: "#000000", # class: 'nf' + Name.Property: "#000000", # class: 'py' + Name.Label: "#f57900", # class: 'nl' + Name.Namespace: "#000000", # class: 'nn' - to be revised + Name.Other: "#000000", # class: 'nx' + Name.Tag: "bold #004461", # class: 'nt' - like a keyword + Name.Variable: "#000000", # class: 'nv' - to be revised + Name.Variable.Class: "#000000", # class: 'vc' - to be revised + Name.Variable.Global: "#000000", # class: 'vg' - to be revised + Name.Variable.Instance: "#000000", # class: 'vi' - to be revised + + Number: "#990000", # class: 'm' + + Literal: "#000000", # class: 'l' + Literal.Date: "#000000", # class: 'ld' + + String: "#4e9a06", # class: 's' + String.Backtick: "#4e9a06", # class: 'sb' + String.Char: "#4e9a06", # class: 'sc' + String.Doc: "italic #8f5902", # class: 'sd' - like a comment + String.Double: "#4e9a06", # class: 's2' + String.Escape: "#4e9a06", # class: 'se' + String.Heredoc: "#4e9a06", # class: 'sh' + String.Interpol: "#4e9a06", # class: 'si' + String.Other: "#4e9a06", # class: 'sx' + String.Regex: "#4e9a06", # class: 'sr' + String.Single: "#4e9a06", # class: 's1' + String.Symbol: "#4e9a06", # class: 'ss' + + Generic: "#000000", # class: 'g' + Generic.Deleted: "#a40000", # class: 'gd' + Generic.Emph: "italic #000000", # class: 'ge' + Generic.Error: "#ef2929", # class: 'gr' + Generic.Heading: "bold #000080", # class: 'gh' + Generic.Inserted: "#00A000", # class: 'gi' + Generic.Output: "#888", # class: 'go' + Generic.Prompt: "#745334", # class: 'gp' + Generic.Strong: "bold #000000", # class: 'gs' + Generic.Subheading: "bold #800080", # class: 'gu' + Generic.Traceback: "bold #a40000", # class: 'gt' + } diff --git a/vim/bundle/jedi-vim/pythonx/parso/docs/conf.py b/vim/bundle/jedi-vim/pythonx/parso/docs/conf.py new file mode 100644 index 0000000..f1d0d59 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/docs/conf.py @@ -0,0 +1,290 @@ +# -*- coding: utf-8 -*- +# +# parso documentation build configuration file, created by +# sphinx-quickstart on Wed Dec 26 00:11:34 2012. +# +# This file is execfile()d with the current directory set to its containing dir. +# +# Note that not all possible configuration values are present in this +# autogenerated file. +# +# All configuration values have a default; values that are commented out +# serve to show the default. + +import sys +import os + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +sys.path.insert(0, os.path.abspath('..')) +sys.path.append(os.path.abspath('_themes')) + +# -- General configuration ----------------------------------------------------- + +# If your documentation needs a minimal Sphinx version, state it here. +#needs_sphinx = '1.0' + +# Add any Sphinx extension module names here, as strings. They can be extensions +# coming with Sphinx (named 'sphinx.ext.*') or your custom ones. +extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode', 'sphinx.ext.todo', + 'sphinx.ext.intersphinx', 'sphinx.ext.inheritance_diagram'] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# The suffix of source filenames. +source_suffix = '.rst' + +# The encoding of source files. +source_encoding = 'utf-8' + +# The master toctree document. +master_doc = 'index' + +# General information about the project. +project = u'parso' +copyright = u'parso contributors' + +import parso +from parso.utils import version_info + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. +# +# The short X.Y version. +version = '.'.join(str(x) for x in version_info()[:2]) +# The full version, including alpha/beta/rc tags. +release = parso.__version__ + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +#language = None + +# There are two options for replacing |today|: either, you set today to some +# non-false value, then it is used: +#today = '' +# Else, today_fmt is used as the format for a strftime call. +#today_fmt = '%B %d, %Y' + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +exclude_patterns = [] + +# The reST default role (used for this markup: `text`) to use for all documents. +#default_role = None + +# If true, '()' will be appended to :func: etc. cross-reference text. +#add_function_parentheses = True + +# If true, the current module name will be prepended to all description +# unit titles (such as .. function::). +#add_module_names = True + +# If true, sectionauthor and moduleauthor directives will be shown in the +# output. They are ignored by default. +#show_authors = False + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'sphinx' + +# A list of ignored prefixes for module index sorting. +#modindex_common_prefix = [] + + +# -- Options for HTML output --------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +html_theme = 'flask' + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +#html_theme_options = {} + +# Add any paths that contain custom themes here, relative to this directory. +html_theme_path = ['_themes'] + +# The name for this set of Sphinx documents. If None, it defaults to +# " v documentation". +#html_title = None + +# A shorter title for the navigation bar. Default is the same as html_title. +#html_short_title = None + +# The name of an image file (relative to this directory) to place at the top +# of the sidebar. +#html_logo = None + +# The name of an image file (within the static path) to use as favicon of the +# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 +# pixels large. +#html_favicon = None + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['_static'] + +# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, +# using the given strftime format. +#html_last_updated_fmt = '%b %d, %Y' + +# If true, SmartyPants will be used to convert quotes and dashes to +# typographically correct entities. +#html_use_smartypants = True + +# Custom sidebar templates, maps document names to template names. +html_sidebars = { + '**': [ + 'sidebarlogo.html', + 'localtoc.html', + #'relations.html', + 'ghbuttons.html', + #'sourcelink.html', + 'searchbox.html' + ] +} + +# Additional templates that should be rendered to pages, maps page names to +# template names. +#html_additional_pages = {} + +# If false, no module index is generated. +#html_domain_indices = True + +# If false, no index is generated. +#html_use_index = True + +# If true, the index is split into individual pages for each letter. +#html_split_index = False + +# If true, links to the reST sources are added to the pages. +#html_show_sourcelink = True + +# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. +#html_show_sphinx = True + +# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. +#html_show_copyright = True + +# If true, an OpenSearch description file will be output, and all pages will +# contain a tag referring to it. The value of this option must be the +# base URL from which the finished HTML is served. +#html_use_opensearch = '' + +# This is the file name suffix for HTML files (e.g. ".xhtml"). +#html_file_suffix = None + +# Output file base name for HTML help builder. +htmlhelp_basename = 'parsodoc' + +#html_style = 'default.css' # Force usage of default template on RTD + + +# -- Options for LaTeX output -------------------------------------------------- + +latex_elements = { + # The paper size ('letterpaper' or 'a4paper'). + #'papersize': 'letterpaper', + + # The font size ('10pt', '11pt' or '12pt'). + #'pointsize': '10pt', + + # Additional stuff for the LaTeX preamble. + #'preamble': '', +} + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, author, documentclass [howto/manual]). +latex_documents = [ + ('index', 'parso.tex', u'parso documentation', + u'parso contributors', 'manual'), +] + +# The name of an image file (relative to this directory) to place at the top of +# the title page. +#latex_logo = None + +# For "manual" documents, if this is true, then toplevel headings are parts, +# not chapters. +#latex_use_parts = False + +# If true, show page references after internal links. +#latex_show_pagerefs = False + +# If true, show URL addresses after external links. +#latex_show_urls = False + +# Documents to append as an appendix to all manuals. +#latex_appendices = [] + +# If false, no module index is generated. +#latex_domain_indices = True + + +# -- Options for manual page output -------------------------------------------- + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + ('index', 'parso', u'parso Documentation', + [u'parso contributors'], 1) +] + +# If true, show URL addresses after external links. +#man_show_urls = False + + +# -- Options for Texinfo output ------------------------------------------------ + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + ('index', 'parso', u'parso documentation', + u'parso contributors', 'parso', 'Awesome Python autocompletion library.', + 'Miscellaneous'), +] + +# Documents to append as an appendix to all manuals. +#texinfo_appendices = [] + +# If false, no module index is generated. +#texinfo_domain_indices = True + +# How to display URL addresses: 'footnote', 'no', or 'inline'. +#texinfo_show_urls = 'footnote' + +# -- Options for todo module --------------------------------------------------- + +todo_include_todos = False + +# -- Options for autodoc module ------------------------------------------------ + +autoclass_content = 'both' +autodoc_member_order = 'bysource' +autodoc_default_flags = [] +#autodoc_default_flags = ['members', 'undoc-members'] + + +# -- Options for intersphinx module -------------------------------------------- + +intersphinx_mapping = { + 'http://docs.python.org/': ('https://docs.python.org/3.6', None), +} + + +def skip_deprecated(app, what, name, obj, skip, options): + """ + All attributes containing a deprecated note shouldn't be documented + anymore. This makes it even clearer that they are not supported anymore. + """ + doc = obj.__doc__ + return skip or doc and '.. deprecated::' in doc + + +def setup(app): + app.connect('autodoc-skip-member', skip_deprecated) diff --git a/vim/bundle/jedi-vim/pythonx/parso/docs/docs/development.rst b/vim/bundle/jedi-vim/pythonx/parso/docs/docs/development.rst new file mode 100644 index 0000000..f723162 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/docs/docs/development.rst @@ -0,0 +1,38 @@ +.. include:: ../global.rst + +Development +=========== + +If you want to contribute anything to |parso|, just open an issue or pull +request to discuss it. We welcome changes! Please check the ``CONTRIBUTING.md`` +file in the repository, first. + + +Deprecations Process +-------------------- + +The deprecation process is as follows: + +1. A deprecation is announced in the next major/minor release. +2. We wait either at least a year & at least two minor releases until we remove + the deprecated functionality. + + +Testing +------- + +The test suite depends on ``tox`` and ``pytest``:: + + pip install tox pytest + +To run the tests for all supported Python versions:: + + tox + +If you want to test only a specific Python version (e.g. Python 2.7), it's as +easy as:: + + tox -e py27 + +Tests are also run automatically on `Travis CI +`_. diff --git a/vim/bundle/jedi-vim/pythonx/parso/docs/docs/installation.rst b/vim/bundle/jedi-vim/pythonx/parso/docs/docs/installation.rst new file mode 100644 index 0000000..a2de258 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/docs/docs/installation.rst @@ -0,0 +1,32 @@ +.. include:: ../global.rst + +Installation and Configuration +============================== + +The preferred way (pip) +----------------------- + +On any system you can install |parso| directly from the Python package index +using pip:: + + sudo pip install parso + + +From git +-------- +If you want to install the current development version (master branch):: + + sudo pip install -e git://github.com/davidhalter/parso.git#egg=parso + + +Manual installation from a downloaded package (not recommended) +--------------------------------------------------------------- + +If you prefer not to use an automated package installer, you can `download +`__ a current copy of +|parso| and install it manually. + +To install it, navigate to the directory containing `setup.py` on your console +and type:: + + sudo python setup.py install diff --git a/vim/bundle/jedi-vim/pythonx/parso/docs/docs/parser-tree.rst b/vim/bundle/jedi-vim/pythonx/parso/docs/docs/parser-tree.rst new file mode 100644 index 0000000..6eb2006 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/docs/docs/parser-tree.rst @@ -0,0 +1,49 @@ +.. include:: ../global.rst + +.. _parser-tree: + +Parser Tree +=========== + +The parser tree is returned by calling :py:meth:`parso.Grammar.parse`. + +.. note:: Note that parso positions are always 1 based for lines and zero + based for columns. This means the first position in a file is (1, 0). + +Parser Tree Base Classes +------------------------ + +Generally there are two types of classes you will deal with: +:py:class:`parso.tree.Leaf` and :py:class:`parso.tree.BaseNode`. + +.. autoclass:: parso.tree.BaseNode + :show-inheritance: + :members: + +.. autoclass:: parso.tree.Leaf + :show-inheritance: + :members: + +All nodes and leaves have these methods/properties: + +.. autoclass:: parso.tree.NodeOrLeaf + :members: + :undoc-members: + :show-inheritance: + + +Python Parser Tree +------------------ + +.. currentmodule:: parso.python.tree + +.. automodule:: parso.python.tree + :members: + :undoc-members: + :show-inheritance: + + +Utility +------- + +.. autofunction:: parso.tree.search_ancestor diff --git a/vim/bundle/jedi-vim/pythonx/parso/docs/docs/usage.rst b/vim/bundle/jedi-vim/pythonx/parso/docs/docs/usage.rst new file mode 100644 index 0000000..072d2e5 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/docs/docs/usage.rst @@ -0,0 +1,68 @@ +.. include:: ../global.rst + +Usage +===== + +|parso| works around grammars. You can simply create Python grammars by calling +:py:func:`parso.load_grammar`. Grammars (with a custom tokenizer and custom parser trees) +can also be created by directly instantiating :py:func:`parso.Grammar`. More information +about the resulting objects can be found in the :ref:`parser tree documentation +`. + +The simplest way of using parso is without even loading a grammar +(:py:func:`parso.parse`): + +.. sourcecode:: python + + >>> import parso + >>> parso.parse('foo + bar') + + +Loading a Grammar +----------------- + +Typically if you want to work with one specific Python version, use: + +.. autofunction:: parso.load_grammar + +Grammar methods +--------------- + +You will get back a grammar object that you can use to parse code and find +issues in it: + +.. autoclass:: parso.Grammar + :members: + :undoc-members: + + +Error Retrieval +--------------- + +|parso| is able to find multiple errors in your source code. Iterating through +those errors yields the following instances: + +.. autoclass:: parso.normalizer.Issue + :members: + :undoc-members: + + +Utility +------- + +|parso| also offers some utility functions that can be really useful: + +.. autofunction:: parso.parse +.. autofunction:: parso.split_lines +.. autofunction:: parso.python_bytes_to_unicode + + +Used By +------- + +- jedi_ (which is used by IPython and a lot of editor plugins). +- mutmut_ (mutation tester) + + +.. _jedi: https://github.com/davidhalter/jedi +.. _mutmut: https://github.com/boxed/mutmut diff --git a/vim/bundle/jedi-vim/pythonx/parso/docs/global.rst b/vim/bundle/jedi-vim/pythonx/parso/docs/global.rst new file mode 100644 index 0000000..ec50aaf --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/docs/global.rst @@ -0,0 +1,4 @@ +:orphan: + +.. |jedi| replace:: *jedi* +.. |parso| replace:: *parso* diff --git a/vim/bundle/jedi-vim/pythonx/parso/docs/index.rst b/vim/bundle/jedi-vim/pythonx/parso/docs/index.rst new file mode 100644 index 0000000..50fb0a8 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/docs/index.rst @@ -0,0 +1,31 @@ +.. include global.rst + +parso - A Python Parser +======================= + +Release v\ |release|. (:doc:`Installation `) + +.. automodule:: parso + +.. _toc: + +Docs +---- + +.. toctree:: + :maxdepth: 2 + + docs/installation + docs/usage + docs/parser-tree + docs/development + + +.. _resources: + +Resources +--------- + +- `Source Code on Github `_ +- `Travis Testing `_ +- `Python Package Index `_ diff --git a/vim/bundle/jedi-vim/pythonx/parso/parso.egg-info/PKG-INFO b/vim/bundle/jedi-vim/pythonx/parso/parso.egg-info/PKG-INFO new file mode 100644 index 0000000..6320eff --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/parso.egg-info/PKG-INFO @@ -0,0 +1,201 @@ +Metadata-Version: 2.1 +Name: parso +Version: 0.5.1 +Summary: A Python Parser +Home-page: https://github.com/davidhalter/parso +Author: David Halter +Author-email: davidhalter88@gmail.com +Maintainer: David Halter +Maintainer-email: davidhalter88@gmail.com +License: MIT +Description: ################################################################### + parso - A Python Parser + ################################################################### + + + .. image:: https://travis-ci.org/davidhalter/parso.svg?branch=master + :target: https://travis-ci.org/davidhalter/parso + :alt: Travis CI build status + + .. image:: https://coveralls.io/repos/github/davidhalter/parso/badge.svg?branch=master + :target: https://coveralls.io/github/davidhalter/parso?branch=master + :alt: Coverage Status + + .. image:: https://raw.githubusercontent.com/davidhalter/parso/master/docs/_static/logo_characters.png + + Parso is a Python parser that supports error recovery and round-trip parsing + for different Python versions (in multiple Python versions). Parso is also able + to list multiple syntax errors in your python file. + + Parso has been battle-tested by jedi_. It was pulled out of jedi to be useful + for other projects as well. + + Parso consists of a small API to parse Python and analyse the syntax tree. + + A simple example: + + .. code-block:: python + + >>> import parso + >>> module = parso.parse('hello + 1', version="3.6") + >>> expr = module.children[0] + >>> expr + PythonNode(arith_expr, [, , ]) + >>> print(expr.get_code()) + hello + 1 + >>> name = expr.children[0] + >>> name + + >>> name.end_pos + (1, 5) + >>> expr.end_pos + (1, 9) + + To list multiple issues: + + .. code-block:: python + + >>> grammar = parso.load_grammar() + >>> module = grammar.parse('foo +\nbar\ncontinue') + >>> error1, error2 = grammar.iter_errors(module) + >>> error1.message + 'SyntaxError: invalid syntax' + >>> error2.message + "SyntaxError: 'continue' not properly in loop" + + Resources + ========= + + - `Testing `_ + - `PyPI `_ + - `Docs `_ + - Uses `semantic versioning `_ + + Installation + ============ + + pip install parso + + Future + ====== + + - There will be better support for refactoring and comments. Stay tuned. + - There's a WIP PEP8 validator. It's however not in a good shape, yet. + + Known Issues + ============ + + - `async`/`await` are already used as keywords in Python3.6. + - `from __future__ import print_function` is not ignored. + + + Acknowledgements + ================ + + - Guido van Rossum (@gvanrossum) for creating the parser generator pgen2 + (originally used in lib2to3). + - `Salome Schneider `_ + for the extremely awesome parso logo. + + + .. _jedi: https://github.com/davidhalter/jedi + + + .. :changelog: + + Changelog + --------- + + 0.5.1 (2019-07-13) + ++++++++++++++++++ + + - Fix: Some unicode identifiers were not correctly tokenized + - Fix: Line continuations in f-strings are now working + + 0.5.0 (2019-06-20) + ++++++++++++++++++ + + - **Breaking Change** comp_for is now called sync_comp_for for all Python + versions to be compatible with the Python 3.8 Grammar + - Added .pyi stubs for a lot of the parso API + - Small FileIO changes + + 0.4.0 (2019-04-05) + ++++++++++++++++++ + + - Python 3.8 support + - FileIO support, it's now possible to use abstract file IO, support is alpha + + 0.3.4 (2019-02-13) + +++++++++++++++++++ + + - Fix an f-string tokenizer error + + 0.3.3 (2019-02-06) + +++++++++++++++++++ + + - Fix async errors in the diff parser + - A fix in iter_errors + - This is a very small bugfix release + + 0.3.2 (2019-01-24) + +++++++++++++++++++ + + - 20+ bugfixes in the diff parser and 3 in the tokenizer + - A fuzzer for the diff parser, to give confidence that the diff parser is in a + good shape. + - Some bugfixes for f-string + + 0.3.1 (2018-07-09) + +++++++++++++++++++ + + - Bugfixes in the diff parser and keyword-only arguments + + 0.3.0 (2018-06-30) + +++++++++++++++++++ + + - Rewrote the pgen2 parser generator. + + 0.2.1 (2018-05-21) + +++++++++++++++++++ + + - A bugfix for the diff parser. + - Grammar files can now be loaded from a specific path. + + 0.2.0 (2018-04-15) + +++++++++++++++++++ + + - f-strings are now parsed as a part of the normal Python grammar. This makes + it way easier to deal with them. + + 0.1.1 (2017-11-05) + +++++++++++++++++++ + + - Fixed a few bugs in the caching layer + - Added support for Python 3.7 + + 0.1.0 (2017-09-04) + +++++++++++++++++++ + + - Pulling the library out of Jedi. Some APIs will definitely change. + +Keywords: python parser parsing +Platform: any +Classifier: Development Status :: 4 - Beta +Classifier: Environment :: Plugins +Classifier: Intended Audience :: Developers +Classifier: License :: OSI Approved :: MIT License +Classifier: Operating System :: OS Independent +Classifier: Programming Language :: Python :: 2 +Classifier: Programming Language :: Python :: 2.6 +Classifier: Programming Language :: Python :: 2.7 +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3.3 +Classifier: Programming Language :: Python :: 3.4 +Classifier: Programming Language :: Python :: 3.5 +Classifier: Programming Language :: Python :: 3.6 +Classifier: Programming Language :: Python :: 3.7 +Classifier: Topic :: Software Development :: Libraries :: Python Modules +Classifier: Topic :: Text Editors :: Integrated Development Environments (IDE) +Classifier: Topic :: Utilities +Provides-Extra: testing diff --git a/vim/bundle/jedi-vim/pythonx/parso/parso.egg-info/SOURCES.txt b/vim/bundle/jedi-vim/pythonx/parso/parso.egg-info/SOURCES.txt new file mode 100644 index 0000000..fb8cd88 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/parso.egg-info/SOURCES.txt @@ -0,0 +1,123 @@ +.coveragerc +AUTHORS.txt +CHANGELOG.rst +LICENSE.txt +MANIFEST.in +README.rst +conftest.py +pytest.ini +setup.cfg +setup.py +tox.ini +docs/Makefile +docs/README.md +docs/conf.py +docs/global.rst +docs/index.rst +docs/_static/logo.png +docs/_static/logo_characters.png +docs/_templates/ghbuttons.html +docs/_templates/sidebarlogo.html +docs/_themes/flask_theme_support.py +docs/_themes/flask/LICENSE +docs/_themes/flask/layout.html +docs/_themes/flask/relations.html +docs/_themes/flask/theme.conf +docs/_themes/flask/static/flasky.css_t +docs/_themes/flask/static/small_flask.css +docs/docs/development.rst +docs/docs/installation.rst +docs/docs/parser-tree.rst +docs/docs/usage.rst +parso/__init__.py +parso/_compatibility.py +parso/cache.py +parso/file_io.py +parso/grammar.py +parso/normalizer.py +parso/parser.py +parso/tree.py +parso/utils.py +parso.egg-info/PKG-INFO +parso.egg-info/SOURCES.txt +parso.egg-info/dependency_links.txt +parso.egg-info/requires.txt +parso.egg-info/top_level.txt +parso/pgen2/__init__.py +parso/pgen2/generator.py +parso/pgen2/grammar_parser.py +parso/python/__init__.py +parso/python/diff.py +parso/python/errors.py +parso/python/grammar26.txt +parso/python/grammar27.txt +parso/python/grammar33.txt +parso/python/grammar34.txt +parso/python/grammar35.txt +parso/python/grammar36.txt +parso/python/grammar37.txt +parso/python/grammar38.txt +parso/python/parser.py +parso/python/pep8.py +parso/python/prefix.py +parso/python/token.py +parso/python/tokenize.py +parso/python/tree.py +test/__init__.py +test/failing_examples.py +test/fuzz_diff_parser.py +test/test_absolute_import.py +test/test_cache.py +test/test_diff_parser.py +test/test_error_recovery.py +test/test_file_python_errors.py +test/test_fstring.py +test/test_get_code.py +test/test_grammar.py +test/test_load_grammar.py +test/test_normalizer_issues_files.py +test/test_old_fast_parser.py +test/test_param_splitting.py +test/test_parser.py +test/test_parser_tree.py +test/test_pep8.py +test/test_pgen2.py +test/test_prefix.py +test/test_python_errors.py +test/test_tokenize.py +test/test_utils.py +test/normalizer_issue_files/E10.py +test/normalizer_issue_files/E101.py +test/normalizer_issue_files/E11.py +test/normalizer_issue_files/E12_first.py +test/normalizer_issue_files/E12_not_first.py +test/normalizer_issue_files/E12_not_second.py +test/normalizer_issue_files/E12_second.py +test/normalizer_issue_files/E12_third.py +test/normalizer_issue_files/E20.py +test/normalizer_issue_files/E21.py +test/normalizer_issue_files/E22.py +test/normalizer_issue_files/E23.py +test/normalizer_issue_files/E25.py +test/normalizer_issue_files/E26.py +test/normalizer_issue_files/E27.py +test/normalizer_issue_files/E29.py +test/normalizer_issue_files/E30.py +test/normalizer_issue_files/E30not.py +test/normalizer_issue_files/E40.py +test/normalizer_issue_files/E50.py +test/normalizer_issue_files/E70.py +test/normalizer_issue_files/E71.py +test/normalizer_issue_files/E72.py +test/normalizer_issue_files/E73.py +test/normalizer_issue_files/LICENSE +test/normalizer_issue_files/allowed_syntax.py +test/normalizer_issue_files/allowed_syntax_python2.py +test/normalizer_issue_files/allowed_syntax_python3.4.py +test/normalizer_issue_files/allowed_syntax_python3.5.py +test/normalizer_issue_files/allowed_syntax_python3.6.py +test/normalizer_issue_files/latin-1.py +test/normalizer_issue_files/python2.7.py +test/normalizer_issue_files/python3.py +test/normalizer_issue_files/utf-8-bom.py +test/normalizer_issue_files/utf-8.py \ No newline at end of file diff --git a/vim/bundle/jedi-vim/pythonx/parso/parso.egg-info/dependency_links.txt b/vim/bundle/jedi-vim/pythonx/parso/parso.egg-info/dependency_links.txt new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/parso.egg-info/dependency_links.txt @@ -0,0 +1 @@ + diff --git a/vim/bundle/jedi-vim/pythonx/parso/parso.egg-info/requires.txt b/vim/bundle/jedi-vim/pythonx/parso/parso.egg-info/requires.txt new file mode 100644 index 0000000..05fa46b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/parso.egg-info/requires.txt @@ -0,0 +1,4 @@ + +[testing] +pytest>=3.0.7 +docopt diff --git a/vim/bundle/jedi-vim/pythonx/parso/parso.egg-info/top_level.txt b/vim/bundle/jedi-vim/pythonx/parso/parso.egg-info/top_level.txt new file mode 100644 index 0000000..0e23344 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/parso.egg-info/top_level.txt @@ -0,0 +1 @@ +parso diff --git a/vim/bundle/jedi-vim/pythonx/parso/parso/__init__.py b/vim/bundle/jedi-vim/pythonx/parso/parso/__init__.py new file mode 100644 index 0000000..a16a72f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/parso/__init__.py @@ -0,0 +1,58 @@ +r""" +Parso is a Python parser that supports error recovery and round-trip parsing +for different Python versions (in multiple Python versions). Parso is also able +to list multiple syntax errors in your python file. + +Parso has been battle-tested by jedi_. It was pulled out of jedi to be useful +for other projects as well. + +Parso consists of a small API to parse Python and analyse the syntax tree. + +.. _jedi: https://github.com/davidhalter/jedi + +A simple example: + +>>> import parso +>>> module = parso.parse('hello + 1', version="3.6") +>>> expr = module.children[0] +>>> expr +PythonNode(arith_expr, [, , ]) +>>> print(expr.get_code()) +hello + 1 +>>> name = expr.children[0] +>>> name + +>>> name.end_pos +(1, 5) +>>> expr.end_pos +(1, 9) + +To list multiple issues: + +>>> grammar = parso.load_grammar() +>>> module = grammar.parse('foo +\nbar\ncontinue') +>>> error1, error2 = grammar.iter_errors(module) +>>> error1.message +'SyntaxError: invalid syntax' +>>> error2.message +"SyntaxError: 'continue' not properly in loop" +""" + +from parso.parser import ParserSyntaxError +from parso.grammar import Grammar, load_grammar +from parso.utils import split_lines, python_bytes_to_unicode + + +__version__ = '0.5.1' + + +def parse(code=None, **kwargs): + """ + A utility function to avoid loading grammars. + Params are documented in :py:meth:`parso.Grammar.parse`. + + :param str version: The version used by :py:func:`parso.load_grammar`. + """ + version = kwargs.pop('version', None) + grammar = load_grammar(version=version) + return grammar.parse(code, **kwargs) diff --git a/vim/bundle/jedi-vim/pythonx/parso/parso/__init__.pyi b/vim/bundle/jedi-vim/pythonx/parso/parso/__init__.pyi new file mode 100644 index 0000000..5f72f07 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/parso/__init__.pyi @@ -0,0 +1,19 @@ +from typing import Any, Optional, Union + +from parso.grammar import Grammar as Grammar, load_grammar as load_grammar +from parso.parser import ParserSyntaxError as ParserSyntaxError +from parso.utils import python_bytes_to_unicode as python_bytes_to_unicode, split_lines as split_lines + +__version__: str = ... + +def parse( + code: Optional[Union[str, bytes]], + *, + version: Optional[str] = None, + error_recovery: bool = True, + path: Optional[str] = None, + start_symbol: Optional[str] = None, + cache: bool = False, + diff_cache: bool = False, + cache_path: Optional[str] = None, +) -> Any: ... diff --git a/vim/bundle/jedi-vim/pythonx/parso/parso/__pycache__/__init__.cpython-36.pyc b/vim/bundle/jedi-vim/pythonx/parso/parso/__pycache__/__init__.cpython-36.pyc new file mode 100644 index 0000000..c3a6925 Binary files /dev/null and b/vim/bundle/jedi-vim/pythonx/parso/parso/__pycache__/__init__.cpython-36.pyc differ diff --git a/vim/bundle/jedi-vim/pythonx/parso/parso/__pycache__/_compatibility.cpython-36.pyc b/vim/bundle/jedi-vim/pythonx/parso/parso/__pycache__/_compatibility.cpython-36.pyc new file mode 100644 index 0000000..d4e4141 Binary files /dev/null and b/vim/bundle/jedi-vim/pythonx/parso/parso/__pycache__/_compatibility.cpython-36.pyc differ diff --git a/vim/bundle/jedi-vim/pythonx/parso/parso/__pycache__/cache.cpython-36.pyc b/vim/bundle/jedi-vim/pythonx/parso/parso/__pycache__/cache.cpython-36.pyc new file mode 100644 index 0000000..7869560 Binary files /dev/null and b/vim/bundle/jedi-vim/pythonx/parso/parso/__pycache__/cache.cpython-36.pyc differ diff --git a/vim/bundle/jedi-vim/pythonx/parso/parso/__pycache__/file_io.cpython-36.pyc b/vim/bundle/jedi-vim/pythonx/parso/parso/__pycache__/file_io.cpython-36.pyc new file mode 100644 index 0000000..739a392 Binary files /dev/null and b/vim/bundle/jedi-vim/pythonx/parso/parso/__pycache__/file_io.cpython-36.pyc differ diff --git a/vim/bundle/jedi-vim/pythonx/parso/parso/__pycache__/grammar.cpython-36.pyc b/vim/bundle/jedi-vim/pythonx/parso/parso/__pycache__/grammar.cpython-36.pyc new file mode 100644 index 0000000..85a9e5b Binary files /dev/null and b/vim/bundle/jedi-vim/pythonx/parso/parso/__pycache__/grammar.cpython-36.pyc differ diff --git a/vim/bundle/jedi-vim/pythonx/parso/parso/__pycache__/normalizer.cpython-36.pyc b/vim/bundle/jedi-vim/pythonx/parso/parso/__pycache__/normalizer.cpython-36.pyc new file mode 100644 index 0000000..c2c71ad Binary files /dev/null and b/vim/bundle/jedi-vim/pythonx/parso/parso/__pycache__/normalizer.cpython-36.pyc differ diff --git a/vim/bundle/jedi-vim/pythonx/parso/parso/__pycache__/parser.cpython-36.pyc b/vim/bundle/jedi-vim/pythonx/parso/parso/__pycache__/parser.cpython-36.pyc new file mode 100644 index 0000000..b1edd0c Binary files /dev/null and b/vim/bundle/jedi-vim/pythonx/parso/parso/__pycache__/parser.cpython-36.pyc differ diff --git a/vim/bundle/jedi-vim/pythonx/parso/parso/__pycache__/tree.cpython-36.pyc b/vim/bundle/jedi-vim/pythonx/parso/parso/__pycache__/tree.cpython-36.pyc new file mode 100644 index 0000000..556fc24 Binary files /dev/null and b/vim/bundle/jedi-vim/pythonx/parso/parso/__pycache__/tree.cpython-36.pyc differ diff --git a/vim/bundle/jedi-vim/pythonx/parso/parso/__pycache__/utils.cpython-36.pyc b/vim/bundle/jedi-vim/pythonx/parso/parso/__pycache__/utils.cpython-36.pyc new file mode 100644 index 0000000..12f4743 Binary files /dev/null and b/vim/bundle/jedi-vim/pythonx/parso/parso/__pycache__/utils.cpython-36.pyc differ diff --git a/vim/bundle/jedi-vim/pythonx/parso/parso/_compatibility.py b/vim/bundle/jedi-vim/pythonx/parso/parso/_compatibility.py new file mode 100644 index 0000000..db411ee --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/parso/_compatibility.py @@ -0,0 +1,103 @@ +""" +To ensure compatibility from Python ``2.6`` - ``3.3``, a module has been +created. Clearly there is huge need to use conforming syntax. +""" +import sys +import platform + +# Cannot use sys.version.major and minor names, because in Python 2.6 it's not +# a namedtuple. +py_version = int(str(sys.version_info[0]) + str(sys.version_info[1])) + +# unicode function +try: + unicode = unicode +except NameError: + unicode = str + +is_pypy = platform.python_implementation() == 'PyPy' + + +def use_metaclass(meta, *bases): + """ Create a class with a metaclass. """ + if not bases: + bases = (object,) + return meta("HackClass", bases, {}) + + +try: + encoding = sys.stdout.encoding + if encoding is None: + encoding = 'utf-8' +except AttributeError: + encoding = 'ascii' + + +def u(string): + """Cast to unicode DAMMIT! + Written because Python2 repr always implicitly casts to a string, so we + have to cast back to a unicode (and we know that we always deal with valid + unicode, because we check that in the beginning). + """ + if py_version >= 30: + return str(string) + + if not isinstance(string, unicode): + return unicode(str(string), 'UTF-8') + return string + + +try: + FileNotFoundError = FileNotFoundError +except NameError: + FileNotFoundError = IOError + + +def utf8_repr(func): + """ + ``__repr__`` methods in Python 2 don't allow unicode objects to be + returned. Therefore cast them to utf-8 bytes in this decorator. + """ + def wrapper(self): + result = func(self) + if isinstance(result, unicode): + return result.encode('utf-8') + else: + return result + + if py_version >= 30: + return func + else: + return wrapper + + +try: + from functools import total_ordering +except ImportError: + # Python 2.6 + def total_ordering(cls): + """Class decorator that fills in missing ordering methods""" + convert = { + '__lt__': [('__gt__', lambda self, other: not (self < other or self == other)), + ('__le__', lambda self, other: self < other or self == other), + ('__ge__', lambda self, other: not self < other)], + '__le__': [('__ge__', lambda self, other: not self <= other or self == other), + ('__lt__', lambda self, other: self <= other and not self == other), + ('__gt__', lambda self, other: not self <= other)], + '__gt__': [('__lt__', lambda self, other: not (self > other or self == other)), + ('__ge__', lambda self, other: self > other or self == other), + ('__le__', lambda self, other: not self > other)], + '__ge__': [('__le__', lambda self, other: (not self >= other) or self == other), + ('__gt__', lambda self, other: self >= other and not self == other), + ('__lt__', lambda self, other: not self >= other)] + } + roots = set(dir(cls)) & set(convert) + if not roots: + raise ValueError('must define at least one ordering operation: < > <= >=') + root = max(roots) # prefer __lt__ to __le__ to __gt__ to __ge__ + for opname, opfunc in convert[root]: + if opname not in roots: + opfunc.__name__ = opname + opfunc.__doc__ = getattr(int, opname).__doc__ + setattr(cls, opname, opfunc) + return cls diff --git a/vim/bundle/jedi-vim/pythonx/parso/parso/cache.py b/vim/bundle/jedi-vim/pythonx/parso/parso/cache.py new file mode 100644 index 0000000..1f8d886 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/parso/cache.py @@ -0,0 +1,169 @@ +import time +import os +import sys +import hashlib +import gc +import shutil +import platform +import errno +import logging + +try: + import cPickle as pickle +except: + import pickle + +from parso._compatibility import FileNotFoundError + +LOG = logging.getLogger(__name__) + + +_PICKLE_VERSION = 32 +""" +Version number (integer) for file system cache. + +Increment this number when there are any incompatible changes in +the parser tree classes. For example, the following changes +are regarded as incompatible. + +- A class name is changed. +- A class is moved to another module. +- A __slot__ of a class is changed. +""" + +_VERSION_TAG = '%s-%s%s-%s' % ( + platform.python_implementation(), + sys.version_info[0], + sys.version_info[1], + _PICKLE_VERSION +) +""" +Short name for distinguish Python implementations and versions. + +It's like `sys.implementation.cache_tag` but for Python < 3.3 +we generate something similar. See: +http://docs.python.org/3/library/sys.html#sys.implementation +""" + + +def _get_default_cache_path(): + if platform.system().lower() == 'windows': + dir_ = os.path.join(os.getenv('LOCALAPPDATA') or '~', 'Parso', 'Parso') + elif platform.system().lower() == 'darwin': + dir_ = os.path.join('~', 'Library', 'Caches', 'Parso') + else: + dir_ = os.path.join(os.getenv('XDG_CACHE_HOME') or '~/.cache', 'parso') + return os.path.expanduser(dir_) + + +_default_cache_path = _get_default_cache_path() +""" +The path where the cache is stored. + +On Linux, this defaults to ``~/.cache/parso/``, on OS X to +``~/Library/Caches/Parso/`` and on Windows to ``%LOCALAPPDATA%\\Parso\\Parso\\``. +On Linux, if environment variable ``$XDG_CACHE_HOME`` is set, +``$XDG_CACHE_HOME/parso`` is used instead of the default one. +""" + +parser_cache = {} + + +class _NodeCacheItem(object): + def __init__(self, node, lines, change_time=None): + self.node = node + self.lines = lines + if change_time is None: + change_time = time.time() + self.change_time = change_time + + +def load_module(hashed_grammar, file_io, cache_path=None): + """ + Returns a module or None, if it fails. + """ + p_time = file_io.get_last_modified() + if p_time is None: + return None + + try: + module_cache_item = parser_cache[hashed_grammar][file_io.path] + if p_time <= module_cache_item.change_time: + return module_cache_item.node + except KeyError: + return _load_from_file_system( + hashed_grammar, + file_io.path, + p_time, + cache_path=cache_path + ) + + +def _load_from_file_system(hashed_grammar, path, p_time, cache_path=None): + cache_path = _get_hashed_path(hashed_grammar, path, cache_path=cache_path) + try: + try: + if p_time > os.path.getmtime(cache_path): + # Cache is outdated + return None + except OSError as e: + if e.errno == errno.ENOENT: + # In Python 2 instead of an IOError here we get an OSError. + raise FileNotFoundError + else: + raise + + with open(cache_path, 'rb') as f: + gc.disable() + try: + module_cache_item = pickle.load(f) + finally: + gc.enable() + except FileNotFoundError: + return None + else: + parser_cache.setdefault(hashed_grammar, {})[path] = module_cache_item + LOG.debug('pickle loaded: %s', path) + return module_cache_item.node + + +def save_module(hashed_grammar, file_io, module, lines, pickling=True, cache_path=None): + path = file_io.path + try: + p_time = None if path is None else file_io.get_last_modified() + except OSError: + p_time = None + pickling = False + + item = _NodeCacheItem(module, lines, p_time) + parser_cache.setdefault(hashed_grammar, {})[path] = item + if pickling and path is not None: + _save_to_file_system(hashed_grammar, path, item, cache_path=cache_path) + + +def _save_to_file_system(hashed_grammar, path, item, cache_path=None): + with open(_get_hashed_path(hashed_grammar, path, cache_path=cache_path), 'wb') as f: + pickle.dump(item, f, pickle.HIGHEST_PROTOCOL) + + +def clear_cache(cache_path=None): + if cache_path is None: + cache_path = _default_cache_path + shutil.rmtree(cache_path) + parser_cache.clear() + + +def _get_hashed_path(hashed_grammar, path, cache_path=None): + directory = _get_cache_directory_path(cache_path=cache_path) + + file_hash = hashlib.sha256(path.encode("utf-8")).hexdigest() + return os.path.join(directory, '%s-%s.pkl' % (hashed_grammar, file_hash)) + + +def _get_cache_directory_path(cache_path=None): + if cache_path is None: + cache_path = _default_cache_path + directory = os.path.join(cache_path, _VERSION_TAG) + if not os.path.exists(directory): + os.makedirs(directory) + return directory diff --git a/vim/bundle/jedi-vim/pythonx/parso/parso/file_io.py b/vim/bundle/jedi-vim/pythonx/parso/parso/file_io.py new file mode 100644 index 0000000..94fe08e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/parso/file_io.py @@ -0,0 +1,35 @@ +import os + + +class FileIO(object): + def __init__(self, path): + self.path = path + + def read(self): # Returns bytes/str + # We would like to read unicode here, but we cannot, because we are not + # sure if it is a valid unicode file. Therefore just read whatever is + # here. + with open(self.path, 'rb') as f: + return f.read() + + def get_last_modified(self): + """ + Returns float - timestamp or None, if path doesn't exist. + """ + try: + return os.path.getmtime(self.path) + except OSError: + # Might raise FileNotFoundError, OSError for Python 2 + return None + + def __repr__(self): + return '%s(%s)' % (self.__class__.__name__, self.path) + + +class KnownContentFileIO(FileIO): + def __init__(self, path, content): + super(KnownContentFileIO, self).__init__(path) + self._content = content + + def read(self): + return self._content diff --git a/vim/bundle/jedi-vim/pythonx/parso/parso/grammar.py b/vim/bundle/jedi-vim/pythonx/parso/parso/grammar.py new file mode 100644 index 0000000..41bbe20 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/parso/grammar.py @@ -0,0 +1,256 @@ +import hashlib +import os + +from parso._compatibility import FileNotFoundError, is_pypy +from parso.pgen2 import generate_grammar +from parso.utils import split_lines, python_bytes_to_unicode, parse_version_string +from parso.python.diff import DiffParser +from parso.python.tokenize import tokenize_lines, tokenize +from parso.python.token import PythonTokenTypes +from parso.cache import parser_cache, load_module, save_module +from parso.parser import BaseParser +from parso.python.parser import Parser as PythonParser +from parso.python.errors import ErrorFinderConfig +from parso.python import pep8 +from parso.file_io import FileIO, KnownContentFileIO + +_loaded_grammars = {} + + +class Grammar(object): + """ + :py:func:`parso.load_grammar` returns instances of this class. + + Creating custom none-python grammars by calling this is not supported, yet. + """ + #:param text: A BNF representation of your grammar. + _error_normalizer_config = None + _token_namespace = None + _default_normalizer_config = pep8.PEP8NormalizerConfig() + + def __init__(self, text, tokenizer, parser=BaseParser, diff_parser=None): + self._pgen_grammar = generate_grammar( + text, + token_namespace=self._get_token_namespace() + ) + self._parser = parser + self._tokenizer = tokenizer + self._diff_parser = diff_parser + self._hashed = hashlib.sha256(text.encode("utf-8")).hexdigest() + + def parse(self, code=None, **kwargs): + """ + If you want to parse a Python file you want to start here, most likely. + + If you need finer grained control over the parsed instance, there will be + other ways to access it. + + :param str code: A unicode or bytes string. When it's not possible to + decode bytes to a string, returns a + :py:class:`UnicodeDecodeError`. + :param bool error_recovery: If enabled, any code will be returned. If + it is invalid, it will be returned as an error node. If disabled, + you will get a ParseError when encountering syntax errors in your + code. + :param str start_symbol: The grammar rule (nonterminal) that you want + to parse. Only allowed to be used when error_recovery is False. + :param str path: The path to the file you want to open. Only needed for caching. + :param bool cache: Keeps a copy of the parser tree in RAM and on disk + if a path is given. Returns the cached trees if the corresponding + files on disk have not changed. Note that this stores pickle files + on your file system (e.g. for Linux in ``~/.cache/parso/``). + :param bool diff_cache: Diffs the cached python module against the new + code and tries to parse only the parts that have changed. Returns + the same (changed) module that is found in cache. Using this option + requires you to not do anything anymore with the cached modules + under that path, because the contents of it might change. This + option is still somewhat experimental. If you want stability, + please don't use it. + :param bool cache_path: If given saves the parso cache in this + directory. If not given, defaults to the default cache places on + each platform. + + :return: A subclass of :py:class:`parso.tree.NodeOrLeaf`. Typically a + :py:class:`parso.python.tree.Module`. + """ + if 'start_pos' in kwargs: + raise TypeError("parse() got an unexpected keyword argument.") + return self._parse(code=code, **kwargs) + + def _parse(self, code=None, error_recovery=True, path=None, + start_symbol=None, cache=False, diff_cache=False, + cache_path=None, file_io=None, start_pos=(1, 0)): + """ + Wanted python3.5 * operator and keyword only arguments. Therefore just + wrap it all. + start_pos here is just a parameter internally used. Might be public + sometime in the future. + """ + if code is None and path is None and file_io is None: + raise TypeError("Please provide either code or a path.") + + if start_symbol is None: + start_symbol = self._start_nonterminal + + if error_recovery and start_symbol != 'file_input': + raise NotImplementedError("This is currently not implemented.") + + if file_io is None: + if code is None: + file_io = FileIO(path) + else: + file_io = KnownContentFileIO(path, code) + + if cache and file_io.path is not None: + module_node = load_module(self._hashed, file_io, cache_path=cache_path) + if module_node is not None: + return module_node + + if code is None: + code = file_io.read() + code = python_bytes_to_unicode(code) + + lines = split_lines(code, keepends=True) + if diff_cache: + if self._diff_parser is None: + raise TypeError("You have to define a diff parser to be able " + "to use this option.") + try: + module_cache_item = parser_cache[self._hashed][file_io.path] + except KeyError: + pass + else: + module_node = module_cache_item.node + old_lines = module_cache_item.lines + if old_lines == lines: + return module_node + + new_node = self._diff_parser( + self._pgen_grammar, self._tokenizer, module_node + ).update( + old_lines=old_lines, + new_lines=lines + ) + save_module(self._hashed, file_io, new_node, lines, + # Never pickle in pypy, it's slow as hell. + pickling=cache and not is_pypy, + cache_path=cache_path) + return new_node + + tokens = self._tokenizer(lines, start_pos) + + p = self._parser( + self._pgen_grammar, + error_recovery=error_recovery, + start_nonterminal=start_symbol + ) + root_node = p.parse(tokens=tokens) + + if cache or diff_cache: + save_module(self._hashed, file_io, root_node, lines, + # Never pickle in pypy, it's slow as hell. + pickling=cache and not is_pypy, + cache_path=cache_path) + return root_node + + def _get_token_namespace(self): + ns = self._token_namespace + if ns is None: + raise ValueError("The token namespace should be set.") + return ns + + def iter_errors(self, node): + """ + Given a :py:class:`parso.tree.NodeOrLeaf` returns a generator of + :py:class:`parso.normalizer.Issue` objects. For Python this is + a list of syntax/indentation errors. + """ + if self._error_normalizer_config is None: + raise ValueError("No error normalizer specified for this grammar.") + + return self._get_normalizer_issues(node, self._error_normalizer_config) + + def _get_normalizer(self, normalizer_config): + if normalizer_config is None: + normalizer_config = self._default_normalizer_config + if normalizer_config is None: + raise ValueError("You need to specify a normalizer, because " + "there's no default normalizer for this tree.") + return normalizer_config.create_normalizer(self) + + def _normalize(self, node, normalizer_config=None): + """ + TODO this is not public, yet. + The returned code will be normalized, e.g. PEP8 for Python. + """ + normalizer = self._get_normalizer(normalizer_config) + return normalizer.walk(node) + + def _get_normalizer_issues(self, node, normalizer_config=None): + normalizer = self._get_normalizer(normalizer_config) + normalizer.walk(node) + return normalizer.issues + + def __repr__(self): + nonterminals = self._pgen_grammar.nonterminal_to_dfas.keys() + txt = ' '.join(list(nonterminals)[:3]) + ' ...' + return '<%s:%s>' % (self.__class__.__name__, txt) + + +class PythonGrammar(Grammar): + _error_normalizer_config = ErrorFinderConfig() + _token_namespace = PythonTokenTypes + _start_nonterminal = 'file_input' + + def __init__(self, version_info, bnf_text): + super(PythonGrammar, self).__init__( + bnf_text, + tokenizer=self._tokenize_lines, + parser=PythonParser, + diff_parser=DiffParser + ) + self.version_info = version_info + + def _tokenize_lines(self, lines, start_pos): + return tokenize_lines(lines, self.version_info, start_pos=start_pos) + + def _tokenize(self, code): + # Used by Jedi. + return tokenize(code, self.version_info) + + +def load_grammar(**kwargs): + """ + Loads a :py:class:`parso.Grammar`. The default version is the current Python + version. + + :param str version: A python version string, e.g. ``version='3.3'``. + :param str path: A path to a grammar file + """ + def load_grammar(language='python', version=None, path=None): + if language == 'python': + version_info = parse_version_string(version) + + file = path or os.path.join( + 'python', + 'grammar%s%s.txt' % (version_info.major, version_info.minor) + ) + + global _loaded_grammars + path = os.path.join(os.path.dirname(__file__), file) + try: + return _loaded_grammars[path] + except KeyError: + try: + with open(path) as f: + bnf_text = f.read() + + grammar = PythonGrammar(version_info, bnf_text) + return _loaded_grammars.setdefault(path, grammar) + except FileNotFoundError: + message = "Python version %s is currently not supported." % version + raise NotImplementedError(message) + else: + raise NotImplementedError("No support for language %s." % language) + + return load_grammar(**kwargs) diff --git a/vim/bundle/jedi-vim/pythonx/parso/parso/grammar.pyi b/vim/bundle/jedi-vim/pythonx/parso/parso/grammar.pyi new file mode 100644 index 0000000..e5cd2ea --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/parso/grammar.pyi @@ -0,0 +1,38 @@ +from typing import Any, Callable, Generic, Optional, Sequence, TypeVar, Union +from typing_extensions import Literal + +from parso.utils import PythonVersionInfo + +_Token = Any +_NodeT = TypeVar("_NodeT") + +class Grammar(Generic[_NodeT]): + _default_normalizer_config: Optional[Any] = ... + _error_normalizer_config: Optional[Any] = None + _start_nonterminal: str = ... + _token_namespace: Optional[str] = None + def __init__( + self, + text: str, + tokenizer: Callable[[Sequence[str], int], Sequence[_Token]], + parser: Any = ..., + diff_parser: Any = ..., + ) -> None: ... + def parse( + self, + code: Union[str, bytes] = ..., + error_recovery: bool = ..., + path: Optional[str] = ..., + start_symbol: Optional[str] = ..., + cache: bool = ..., + diff_cache: bool = ..., + cache_path: Optional[str] = ..., + ) -> _NodeT: ... + +class PythonGrammar(Grammar): + version_info: PythonVersionInfo + def __init__(self, version_info: PythonVersionInfo, bnf_text: str) -> None: ... + +def load_grammar( + language: Literal["python"] = "python", version: Optional[str] = ..., path: str = ... +) -> Grammar: ... diff --git a/vim/bundle/jedi-vim/pythonx/parso/parso/normalizer.py b/vim/bundle/jedi-vim/pythonx/parso/parso/normalizer.py new file mode 100644 index 0000000..b076fe5 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/parso/normalizer.py @@ -0,0 +1,183 @@ +from contextlib import contextmanager + +from parso._compatibility import use_metaclass + + +class _NormalizerMeta(type): + def __new__(cls, name, bases, dct): + new_cls = type.__new__(cls, name, bases, dct) + new_cls.rule_value_classes = {} + new_cls.rule_type_classes = {} + return new_cls + + +class Normalizer(use_metaclass(_NormalizerMeta)): + def __init__(self, grammar, config): + self.grammar = grammar + self._config = config + self.issues = [] + + self._rule_type_instances = self._instantiate_rules('rule_type_classes') + self._rule_value_instances = self._instantiate_rules('rule_value_classes') + + def _instantiate_rules(self, attr): + dct = {} + for base in type(self).mro(): + rules_map = getattr(base, attr, {}) + for type_, rule_classes in rules_map.items(): + new = [rule_cls(self) for rule_cls in rule_classes] + dct.setdefault(type_, []).extend(new) + return dct + + def walk(self, node): + self.initialize(node) + value = self.visit(node) + self.finalize() + return value + + def visit(self, node): + try: + children = node.children + except AttributeError: + return self.visit_leaf(node) + else: + with self.visit_node(node): + return ''.join(self.visit(child) for child in children) + + @contextmanager + def visit_node(self, node): + self._check_type_rules(node) + yield + + def _check_type_rules(self, node): + for rule in self._rule_type_instances.get(node.type, []): + rule.feed_node(node) + + def visit_leaf(self, leaf): + self._check_type_rules(leaf) + + for rule in self._rule_value_instances.get(leaf.value, []): + rule.feed_node(leaf) + + return leaf.prefix + leaf.value + + def initialize(self, node): + pass + + def finalize(self): + pass + + def add_issue(self, node, code, message): + issue = Issue(node, code, message) + if issue not in self.issues: + self.issues.append(issue) + return True + + @classmethod + def register_rule(cls, **kwargs): + """ + Use it as a class decorator:: + + normalizer = Normalizer('grammar', 'config') + @normalizer.register_rule(value='foo') + class MyRule(Rule): + error_code = 42 + """ + return cls._register_rule(**kwargs) + + @classmethod + def _register_rule(cls, value=None, values=(), type=None, types=()): + values = list(values) + types = list(types) + if value is not None: + values.append(value) + if type is not None: + types.append(type) + + if not values and not types: + raise ValueError("You must register at least something.") + + def decorator(rule_cls): + for v in values: + cls.rule_value_classes.setdefault(v, []).append(rule_cls) + for t in types: + cls.rule_type_classes.setdefault(t, []).append(rule_cls) + return rule_cls + + return decorator + + +class NormalizerConfig(object): + normalizer_class = Normalizer + + def create_normalizer(self, grammar): + if self.normalizer_class is None: + return None + + return self.normalizer_class(grammar, self) + + +class Issue(object): + def __init__(self, node, code, message): + self._node = node + self.code = code + """ + An integer code that stands for the type of error. + """ + self.message = message + """ + A message (string) for the issue. + """ + self.start_pos = node.start_pos + """ + The start position position of the error as a tuple (line, column). As + always in |parso| the first line is 1 and the first column 0. + """ + + def __eq__(self, other): + return self.start_pos == other.start_pos and self.code == other.code + + def __ne__(self, other): + return not self.__eq__(other) + + def __hash__(self): + return hash((self.code, self.start_pos)) + + def __repr__(self): + return '<%s: %s>' % (self.__class__.__name__, self.code) + + +class Rule(object): + code = None + message = None + + def __init__(self, normalizer): + self._normalizer = normalizer + + def is_issue(self, node): + raise NotImplementedError() + + def get_node(self, node): + return node + + def _get_message(self, message): + if message is None: + message = self.message + if message is None: + raise ValueError("The message on the class is not set.") + return message + + def add_issue(self, node, code=None, message=None): + if code is None: + code = self.code + if code is None: + raise ValueError("The error code on the class is not set.") + + message = self._get_message(message) + + self._normalizer.add_issue(node, code, message) + + def feed_node(self, node): + if self.is_issue(node): + issue_node = self.get_node(node) + self.add_issue(issue_node) diff --git a/vim/bundle/jedi-vim/pythonx/parso/parso/parser.py b/vim/bundle/jedi-vim/pythonx/parso/parso/parser.py new file mode 100644 index 0000000..859e3f8 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/parso/parser.py @@ -0,0 +1,211 @@ +# Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved. +# Licensed to PSF under a Contributor Agreement. + +# Modifications: +# Copyright David Halter and Contributors +# Modifications are dual-licensed: MIT and PSF. +# 99% of the code is different from pgen2, now. + +""" +The ``Parser`` tries to convert the available Python code in an easy to read +format, something like an abstract syntax tree. The classes who represent this +tree, are sitting in the :mod:`parso.tree` module. + +The Python module ``tokenize`` is a very important part in the ``Parser``, +because it splits the code into different words (tokens). Sometimes it looks a +bit messy. Sorry for that! You might ask now: "Why didn't you use the ``ast`` +module for this? Well, ``ast`` does a very good job understanding proper Python +code, but fails to work as soon as there's a single line of broken code. + +There's one important optimization that needs to be known: Statements are not +being parsed completely. ``Statement`` is just a representation of the tokens +within the statement. This lowers memory usage and cpu time and reduces the +complexity of the ``Parser`` (there's another parser sitting inside +``Statement``, which produces ``Array`` and ``Call``). +""" +from parso import tree +from parso.pgen2.generator import ReservedString + + +class ParserSyntaxError(Exception): + """ + Contains error information about the parser tree. + + May be raised as an exception. + """ + def __init__(self, message, error_leaf): + self.message = message + self.error_leaf = error_leaf + + +class InternalParseError(Exception): + """ + Exception to signal the parser is stuck and error recovery didn't help. + Basically this shouldn't happen. It's a sign that something is really + wrong. + """ + + def __init__(self, msg, type_, value, start_pos): + Exception.__init__(self, "%s: type=%r, value=%r, start_pos=%r" % + (msg, type_.name, value, start_pos)) + self.msg = msg + self.type = type + self.value = value + self.start_pos = start_pos + + +class Stack(list): + def _allowed_transition_names_and_token_types(self): + def iterate(): + # An API just for Jedi. + for stack_node in reversed(self): + for transition in stack_node.dfa.transitions: + if isinstance(transition, ReservedString): + yield transition.value + else: + yield transition # A token type + + if not stack_node.dfa.is_final: + break + + return list(iterate()) + + +class StackNode(object): + def __init__(self, dfa): + self.dfa = dfa + self.nodes = [] + + @property + def nonterminal(self): + return self.dfa.from_rule + + def __repr__(self): + return '%s(%s, %s)' % (self.__class__.__name__, self.dfa, self.nodes) + + +def _token_to_transition(grammar, type_, value): + # Map from token to label + if type_.contains_syntax: + # Check for reserved words (keywords) + try: + return grammar.reserved_syntax_strings[value] + except KeyError: + pass + + return type_ + + +class BaseParser(object): + """Parser engine. + + A Parser instance contains state pertaining to the current token + sequence, and should not be used concurrently by different threads + to parse separate token sequences. + + See python/tokenize.py for how to get input tokens by a string. + + When a syntax error occurs, error_recovery() is called. + """ + + node_map = {} + default_node = tree.Node + + leaf_map = { + } + default_leaf = tree.Leaf + + def __init__(self, pgen_grammar, start_nonterminal='file_input', error_recovery=False): + self._pgen_grammar = pgen_grammar + self._start_nonterminal = start_nonterminal + self._error_recovery = error_recovery + + def parse(self, tokens): + first_dfa = self._pgen_grammar.nonterminal_to_dfas[self._start_nonterminal][0] + self.stack = Stack([StackNode(first_dfa)]) + + for token in tokens: + self._add_token(token) + + while True: + tos = self.stack[-1] + if not tos.dfa.is_final: + # We never broke out -- EOF is too soon -- Unfinished statement. + # However, the error recovery might have added the token again, if + # the stack is empty, we're fine. + raise InternalParseError( + "incomplete input", token.type, token.value, token.start_pos + ) + + if len(self.stack) > 1: + self._pop() + else: + return self.convert_node(tos.nonterminal, tos.nodes) + + def error_recovery(self, token): + if self._error_recovery: + raise NotImplementedError("Error Recovery is not implemented") + else: + type_, value, start_pos, prefix = token + error_leaf = tree.ErrorLeaf(type_, value, start_pos, prefix) + raise ParserSyntaxError('SyntaxError: invalid syntax', error_leaf) + + def convert_node(self, nonterminal, children): + try: + node = self.node_map[nonterminal](children) + except KeyError: + node = self.default_node(nonterminal, children) + for c in children: + c.parent = node + return node + + def convert_leaf(self, type_, value, prefix, start_pos): + try: + return self.leaf_map[type_](value, start_pos, prefix) + except KeyError: + return self.default_leaf(value, start_pos, prefix) + + def _add_token(self, token): + """ + This is the only core function for parsing. Here happens basically + everything. Everything is well prepared by the parser generator and we + only apply the necessary steps here. + """ + grammar = self._pgen_grammar + stack = self.stack + type_, value, start_pos, prefix = token + transition = _token_to_transition(grammar, type_, value) + + while True: + try: + plan = stack[-1].dfa.transitions[transition] + break + except KeyError: + if stack[-1].dfa.is_final: + self._pop() + else: + self.error_recovery(token) + return + except IndexError: + raise InternalParseError("too much input", type_, value, start_pos) + + stack[-1].dfa = plan.next_dfa + + for push in plan.dfa_pushes: + stack.append(StackNode(push)) + + leaf = self.convert_leaf(type_, value, prefix, start_pos) + stack[-1].nodes.append(leaf) + + def _pop(self): + tos = self.stack.pop() + # If there's exactly one child, return that child instead of + # creating a new node. We still create expr_stmt and + # file_input though, because a lot of Jedi depends on its + # logic. + if len(tos.nodes) == 1: + new_node = tos.nodes[0] + else: + new_node = self.convert_node(tos.dfa.from_rule, tos.nodes) + + self.stack[-1].nodes.append(new_node) diff --git a/vim/bundle/jedi-vim/pythonx/parso/parso/pgen2/__init__.py b/vim/bundle/jedi-vim/pythonx/parso/parso/pgen2/__init__.py new file mode 100644 index 0000000..d4d9dcd --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/parso/pgen2/__init__.py @@ -0,0 +1,10 @@ +# Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved. +# Licensed to PSF under a Contributor Agreement. + +# Modifications: +# Copyright 2006 Google, Inc. All Rights Reserved. +# Licensed to PSF under a Contributor Agreement. +# Copyright 2014 David Halter and Contributors +# Modifications are dual-licensed: MIT and PSF. + +from parso.pgen2.generator import generate_grammar diff --git a/vim/bundle/jedi-vim/pythonx/parso/parso/pgen2/__init__.pyi b/vim/bundle/jedi-vim/pythonx/parso/parso/pgen2/__init__.pyi new file mode 100644 index 0000000..46c149f --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/parso/pgen2/__init__.pyi @@ -0,0 +1 @@ +from parso.pgen2.generator import generate_grammar as generate_grammar diff --git a/vim/bundle/jedi-vim/pythonx/parso/parso/pgen2/__pycache__/__init__.cpython-36.pyc b/vim/bundle/jedi-vim/pythonx/parso/parso/pgen2/__pycache__/__init__.cpython-36.pyc new file mode 100644 index 0000000..9ed5a3b Binary files /dev/null and b/vim/bundle/jedi-vim/pythonx/parso/parso/pgen2/__pycache__/__init__.cpython-36.pyc differ diff --git a/vim/bundle/jedi-vim/pythonx/parso/parso/pgen2/__pycache__/generator.cpython-36.pyc b/vim/bundle/jedi-vim/pythonx/parso/parso/pgen2/__pycache__/generator.cpython-36.pyc new file mode 100644 index 0000000..65935fb Binary files /dev/null and b/vim/bundle/jedi-vim/pythonx/parso/parso/pgen2/__pycache__/generator.cpython-36.pyc differ diff --git a/vim/bundle/jedi-vim/pythonx/parso/parso/pgen2/__pycache__/grammar_parser.cpython-36.pyc b/vim/bundle/jedi-vim/pythonx/parso/parso/pgen2/__pycache__/grammar_parser.cpython-36.pyc new file mode 100644 index 0000000..2e3f3b3 Binary files /dev/null and b/vim/bundle/jedi-vim/pythonx/parso/parso/pgen2/__pycache__/grammar_parser.cpython-36.pyc differ diff --git a/vim/bundle/jedi-vim/pythonx/parso/parso/pgen2/generator.py b/vim/bundle/jedi-vim/pythonx/parso/parso/pgen2/generator.py new file mode 100644 index 0000000..184afb3 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/parso/pgen2/generator.py @@ -0,0 +1,358 @@ +# Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved. +# Licensed to PSF under a Contributor Agreement. + +# Modifications: +# Copyright David Halter and Contributors +# Modifications are dual-licensed: MIT and PSF. + +""" +This module defines the data structures used to represent a grammar. + +Specifying grammars in pgen is possible with this grammar:: + + grammar: (NEWLINE | rule)* ENDMARKER + rule: NAME ':' rhs NEWLINE + rhs: items ('|' items)* + items: item+ + item: '[' rhs ']' | atom ['+' | '*'] + atom: '(' rhs ')' | NAME | STRING + +This grammar is self-referencing. + +This parser generator (pgen2) was created by Guido Rossum and used for lib2to3. +Most of the code has been refactored to make it more Pythonic. Since this was a +"copy" of the CPython Parser parser "pgen", there was some work needed to make +it more readable. It should also be slightly faster than the original pgen2, +because we made some optimizations. +""" + +from ast import literal_eval + +from parso.pgen2.grammar_parser import GrammarParser, NFAState + + +class Grammar(object): + """ + Once initialized, this class supplies the grammar tables for the + parsing engine implemented by parse.py. The parsing engine + accesses the instance variables directly. + + The only important part in this parsers are dfas and transitions between + dfas. + """ + + def __init__(self, start_nonterminal, rule_to_dfas, reserved_syntax_strings): + self.nonterminal_to_dfas = rule_to_dfas # Dict[str, List[DFAState]] + self.reserved_syntax_strings = reserved_syntax_strings + self.start_nonterminal = start_nonterminal + + +class DFAPlan(object): + """ + Plans are used for the parser to create stack nodes and do the proper + DFA state transitions. + """ + def __init__(self, next_dfa, dfa_pushes=[]): + self.next_dfa = next_dfa + self.dfa_pushes = dfa_pushes + + def __repr__(self): + return '%s(%s, %s)' % (self.__class__.__name__, self.next_dfa, self.dfa_pushes) + + +class DFAState(object): + """ + The DFAState object is the core class for pretty much anything. DFAState + are the vertices of an ordered graph while arcs and transitions are the + edges. + + Arcs are the initial edges, where most DFAStates are not connected and + transitions are then calculated to connect the DFA state machines that have + different nonterminals. + """ + def __init__(self, from_rule, nfa_set, final): + assert isinstance(nfa_set, set) + assert isinstance(next(iter(nfa_set)), NFAState) + assert isinstance(final, NFAState) + self.from_rule = from_rule + self.nfa_set = nfa_set + self.arcs = {} # map from terminals/nonterminals to DFAState + # In an intermediary step we set these nonterminal arcs (which has the + # same structure as arcs). These don't contain terminals anymore. + self.nonterminal_arcs = {} + + # Transitions are basically the only thing that the parser is using + # with is_final. Everyting else is purely here to create a parser. + self.transitions = {} #: Dict[Union[TokenType, ReservedString], DFAPlan] + self.is_final = final in nfa_set + + def add_arc(self, next_, label): + assert isinstance(label, str) + assert label not in self.arcs + assert isinstance(next_, DFAState) + self.arcs[label] = next_ + + def unifystate(self, old, new): + for label, next_ in self.arcs.items(): + if next_ is old: + self.arcs[label] = new + + def __eq__(self, other): + # Equality test -- ignore the nfa_set instance variable + assert isinstance(other, DFAState) + if self.is_final != other.is_final: + return False + # Can't just return self.arcs == other.arcs, because that + # would invoke this method recursively, with cycles... + if len(self.arcs) != len(other.arcs): + return False + for label, next_ in self.arcs.items(): + if next_ is not other.arcs.get(label): + return False + return True + + __hash__ = None # For Py3 compatibility. + + def __repr__(self): + return '<%s: %s is_final=%s>' % ( + self.__class__.__name__, self.from_rule, self.is_final + ) + + +class ReservedString(object): + """ + Most grammars will have certain keywords and operators that are mentioned + in the grammar as strings (e.g. "if") and not token types (e.g. NUMBER). + This class basically is the former. + """ + + def __init__(self, value): + self.value = value + + def __repr__(self): + return '%s(%s)' % (self.__class__.__name__, self.value) + + +def _simplify_dfas(dfas): + """ + This is not theoretically optimal, but works well enough. + Algorithm: repeatedly look for two states that have the same + set of arcs (same labels pointing to the same nodes) and + unify them, until things stop changing. + + dfas is a list of DFAState instances + """ + changes = True + while changes: + changes = False + for i, state_i in enumerate(dfas): + for j in range(i + 1, len(dfas)): + state_j = dfas[j] + if state_i == state_j: + #print " unify", i, j + del dfas[j] + for state in dfas: + state.unifystate(state_j, state_i) + changes = True + break + + +def _make_dfas(start, finish): + """ + Uses the powerset construction algorithm to create DFA states from sets of + NFA states. + + Also does state reduction if some states are not needed. + """ + # To turn an NFA into a DFA, we define the states of the DFA + # to correspond to *sets* of states of the NFA. Then do some + # state reduction. + assert isinstance(start, NFAState) + assert isinstance(finish, NFAState) + + def addclosure(nfa_state, base_nfa_set): + assert isinstance(nfa_state, NFAState) + if nfa_state in base_nfa_set: + return + base_nfa_set.add(nfa_state) + for nfa_arc in nfa_state.arcs: + if nfa_arc.nonterminal_or_string is None: + addclosure(nfa_arc.next, base_nfa_set) + + base_nfa_set = set() + addclosure(start, base_nfa_set) + states = [DFAState(start.from_rule, base_nfa_set, finish)] + for state in states: # NB states grows while we're iterating + arcs = {} + # Find state transitions and store them in arcs. + for nfa_state in state.nfa_set: + for nfa_arc in nfa_state.arcs: + if nfa_arc.nonterminal_or_string is not None: + nfa_set = arcs.setdefault(nfa_arc.nonterminal_or_string, set()) + addclosure(nfa_arc.next, nfa_set) + + # Now create the dfa's with no None's in arcs anymore. All Nones have + # been eliminated and state transitions (arcs) are properly defined, we + # just need to create the dfa's. + for nonterminal_or_string, nfa_set in arcs.items(): + for nested_state in states: + if nested_state.nfa_set == nfa_set: + # The DFA state already exists for this rule. + break + else: + nested_state = DFAState(start.from_rule, nfa_set, finish) + states.append(nested_state) + + state.add_arc(nested_state, nonterminal_or_string) + return states # List of DFAState instances; first one is start + + +def _dump_nfa(start, finish): + print("Dump of NFA for", start.from_rule) + todo = [start] + for i, state in enumerate(todo): + print(" State", i, state is finish and "(final)" or "") + for label, next_ in state.arcs: + if next_ in todo: + j = todo.index(next_) + else: + j = len(todo) + todo.append(next_) + if label is None: + print(" -> %d" % j) + else: + print(" %s -> %d" % (label, j)) + + +def _dump_dfas(dfas): + print("Dump of DFA for", dfas[0].from_rule) + for i, state in enumerate(dfas): + print(" State", i, state.is_final and "(final)" or "") + for nonterminal, next_ in state.arcs.items(): + print(" %s -> %d" % (nonterminal, dfas.index(next_))) + + +def generate_grammar(bnf_grammar, token_namespace): + """ + ``bnf_text`` is a grammar in extended BNF (using * for repetition, + for + at-least-once repetition, [] for optional parts, | for alternatives and () + for grouping). + + It's not EBNF according to ISO/IEC 14977. It's a dialect Python uses in its + own parser. + """ + rule_to_dfas = {} + start_nonterminal = None + for nfa_a, nfa_z in GrammarParser(bnf_grammar).parse(): + #_dump_nfa(a, z) + dfas = _make_dfas(nfa_a, nfa_z) + #_dump_dfas(dfas) + # oldlen = len(dfas) + _simplify_dfas(dfas) + # newlen = len(dfas) + rule_to_dfas[nfa_a.from_rule] = dfas + #print(nfa_a.from_rule, oldlen, newlen) + + if start_nonterminal is None: + start_nonterminal = nfa_a.from_rule + + reserved_strings = {} + for nonterminal, dfas in rule_to_dfas.items(): + for dfa_state in dfas: + for terminal_or_nonterminal, next_dfa in dfa_state.arcs.items(): + if terminal_or_nonterminal in rule_to_dfas: + dfa_state.nonterminal_arcs[terminal_or_nonterminal] = next_dfa + else: + transition = _make_transition( + token_namespace, + reserved_strings, + terminal_or_nonterminal + ) + dfa_state.transitions[transition] = DFAPlan(next_dfa) + + _calculate_tree_traversal(rule_to_dfas) + return Grammar(start_nonterminal, rule_to_dfas, reserved_strings) + + +def _make_transition(token_namespace, reserved_syntax_strings, label): + """ + Creates a reserved string ("if", "for", "*", ...) or returns the token type + (NUMBER, STRING, ...) for a given grammar terminal. + """ + if label[0].isalpha(): + # A named token (e.g. NAME, NUMBER, STRING) + return getattr(token_namespace, label) + else: + # Either a keyword or an operator + assert label[0] in ('"', "'"), label + assert not label.startswith('"""') and not label.startswith("'''") + value = literal_eval(label) + try: + return reserved_syntax_strings[value] + except KeyError: + r = reserved_syntax_strings[value] = ReservedString(value) + return r + + +def _calculate_tree_traversal(nonterminal_to_dfas): + """ + By this point we know how dfas can move around within a stack node, but we + don't know how we can add a new stack node (nonterminal transitions). + """ + # Map from grammar rule (nonterminal) name to a set of tokens. + first_plans = {} + + nonterminals = list(nonterminal_to_dfas.keys()) + nonterminals.sort() + for nonterminal in nonterminals: + if nonterminal not in first_plans: + _calculate_first_plans(nonterminal_to_dfas, first_plans, nonterminal) + + # Now that we have calculated the first terminals, we are sure that + # there is no left recursion or ambiguities. + + for dfas in nonterminal_to_dfas.values(): + for dfa_state in dfas: + for nonterminal, next_dfa in dfa_state.nonterminal_arcs.items(): + for transition, pushes in first_plans[nonterminal].items(): + dfa_state.transitions[transition] = DFAPlan(next_dfa, pushes) + + +def _calculate_first_plans(nonterminal_to_dfas, first_plans, nonterminal): + """ + Calculates the first plan in the first_plans dictionary for every given + nonterminal. This is going to be used to know when to create stack nodes. + """ + dfas = nonterminal_to_dfas[nonterminal] + new_first_plans = {} + first_plans[nonterminal] = None # dummy to detect left recursion + # We only need to check the first dfa. All the following ones are not + # interesting to find first terminals. + state = dfas[0] + for transition, next_ in state.transitions.items(): + # It's a string. We have finally found a possible first token. + new_first_plans[transition] = [next_.next_dfa] + + for nonterminal2, next_ in state.nonterminal_arcs.items(): + # It's a nonterminal and we have either a left recursion issue + # in the grammar or we have to recurse. + try: + first_plans2 = first_plans[nonterminal2] + except KeyError: + first_plans2 = _calculate_first_plans(nonterminal_to_dfas, first_plans, nonterminal2) + else: + if first_plans2 is None: + raise ValueError("left recursion for rule %r" % nonterminal) + + for t, pushes in first_plans2.items(): + check = new_first_plans.get(t) + if check is not None: + raise ValueError( + "Rule %s is ambiguous; %s is the" + " start of the rule %s as well as %s." + % (nonterminal, t, nonterminal2, check[-1].from_rule) + ) + new_first_plans[t] = [next_] + pushes + + first_plans[nonterminal] = new_first_plans + return new_first_plans diff --git a/vim/bundle/jedi-vim/pythonx/parso/parso/pgen2/generator.pyi b/vim/bundle/jedi-vim/pythonx/parso/parso/pgen2/generator.pyi new file mode 100644 index 0000000..0d67a18 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/parso/pgen2/generator.pyi @@ -0,0 +1,38 @@ +from typing import Any, Generic, Mapping, Sequence, Set, TypeVar, Union + +from parso.pgen2.grammar_parser import NFAState + +_TokenTypeT = TypeVar("_TokenTypeT") + +class Grammar(Generic[_TokenTypeT]): + nonterminal_to_dfas: Mapping[str, Sequence[DFAState[_TokenTypeT]]] + reserved_syntax_strings: Mapping[str, ReservedString] + start_nonterminal: str + def __init__( + self, + start_nonterminal: str, + rule_to_dfas: Mapping[str, Sequence[DFAState]], + reserved_syntax_strings: Mapping[str, ReservedString], + ) -> None: ... + +class DFAPlan: + next_dfa: DFAState + dfa_pushes: Sequence[DFAState] + +class DFAState(Generic[_TokenTypeT]): + from_rule: str + nfa_set: Set[NFAState] + is_final: bool + arcs: Mapping[str, DFAState] # map from all terminals/nonterminals to DFAState + nonterminal_arcs: Mapping[str, DFAState] + transitions: Mapping[Union[_TokenTypeT, ReservedString], DFAPlan] + def __init__( + self, from_rule: str, nfa_set: Set[NFAState], final: NFAState + ) -> None: ... + +class ReservedString: + value: str + def __init__(self, value: str) -> None: ... + def __repr__(self) -> str: ... + +def generate_grammar(bnf_grammar: str, token_namespace: Any) -> Grammar[Any]: ... diff --git a/vim/bundle/jedi-vim/pythonx/parso/parso/pgen2/grammar_parser.py b/vim/bundle/jedi-vim/pythonx/parso/parso/pgen2/grammar_parser.py new file mode 100644 index 0000000..623a455 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/parso/pgen2/grammar_parser.py @@ -0,0 +1,156 @@ +# Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved. +# Licensed to PSF under a Contributor Agreement. + +# Modifications: +# Copyright David Halter and Contributors +# Modifications are dual-licensed: MIT and PSF. + +from parso.python.tokenize import tokenize +from parso.utils import parse_version_string +from parso.python.token import PythonTokenTypes + + +class GrammarParser(): + """ + The parser for Python grammar files. + """ + def __init__(self, bnf_grammar): + self._bnf_grammar = bnf_grammar + self.generator = tokenize( + bnf_grammar, + version_info=parse_version_string('3.6') + ) + self._gettoken() # Initialize lookahead + + def parse(self): + # grammar: (NEWLINE | rule)* ENDMARKER + while self.type != PythonTokenTypes.ENDMARKER: + while self.type == PythonTokenTypes.NEWLINE: + self._gettoken() + + # rule: NAME ':' rhs NEWLINE + self._current_rule_name = self._expect(PythonTokenTypes.NAME) + self._expect(PythonTokenTypes.OP, ':') + + a, z = self._parse_rhs() + self._expect(PythonTokenTypes.NEWLINE) + + yield a, z + + def _parse_rhs(self): + # rhs: items ('|' items)* + a, z = self._parse_items() + if self.value != "|": + return a, z + else: + aa = NFAState(self._current_rule_name) + zz = NFAState(self._current_rule_name) + while True: + # Add the possibility to go into the state of a and come back + # to finish. + aa.add_arc(a) + z.add_arc(zz) + if self.value != "|": + break + + self._gettoken() + a, z = self._parse_items() + return aa, zz + + def _parse_items(self): + # items: item+ + a, b = self._parse_item() + while self.type in (PythonTokenTypes.NAME, PythonTokenTypes.STRING) \ + or self.value in ('(', '['): + c, d = self._parse_item() + # Need to end on the next item. + b.add_arc(c) + b = d + return a, b + + def _parse_item(self): + # item: '[' rhs ']' | atom ['+' | '*'] + if self.value == "[": + self._gettoken() + a, z = self._parse_rhs() + self._expect(PythonTokenTypes.OP, ']') + # Make it also possible that there is no token and change the + # state. + a.add_arc(z) + return a, z + else: + a, z = self._parse_atom() + value = self.value + if value not in ("+", "*"): + return a, z + self._gettoken() + # Make it clear that we can go back to the old state and repeat. + z.add_arc(a) + if value == "+": + return a, z + else: + # The end state is the same as the beginning, nothing must + # change. + return a, a + + def _parse_atom(self): + # atom: '(' rhs ')' | NAME | STRING + if self.value == "(": + self._gettoken() + a, z = self._parse_rhs() + self._expect(PythonTokenTypes.OP, ')') + return a, z + elif self.type in (PythonTokenTypes.NAME, PythonTokenTypes.STRING): + a = NFAState(self._current_rule_name) + z = NFAState(self._current_rule_name) + # Make it clear that the state transition requires that value. + a.add_arc(z, self.value) + self._gettoken() + return a, z + else: + self._raise_error("expected (...) or NAME or STRING, got %s/%s", + self.type, self.value) + + def _expect(self, type_, value=None): + if self.type != type_: + self._raise_error("expected %s, got %s [%s]", + type_, self.type, self.value) + if value is not None and self.value != value: + self._raise_error("expected %s, got %s", value, self.value) + value = self.value + self._gettoken() + return value + + def _gettoken(self): + tup = next(self.generator) + self.type, self.value, self.begin, prefix = tup + + def _raise_error(self, msg, *args): + if args: + try: + msg = msg % args + except: + msg = " ".join([msg] + list(map(str, args))) + line = self._bnf_grammar.splitlines()[self.begin[0] - 1] + raise SyntaxError(msg, ('', self.begin[0], + self.begin[1], line)) + + +class NFAArc(object): + def __init__(self, next_, nonterminal_or_string): + self.next = next_ + self.nonterminal_or_string = nonterminal_or_string + + +class NFAState(object): + def __init__(self, from_rule): + self.from_rule = from_rule + self.arcs = [] # List[nonterminal (str), NFAState] + + def add_arc(self, next_, nonterminal_or_string=None): + assert nonterminal_or_string is None or isinstance(nonterminal_or_string, str) + assert isinstance(next_, NFAState) + self.arcs.append(NFAArc(next_, nonterminal_or_string)) + + def __repr__(self): + return '<%s: from %s>' % (self.__class__.__name__, self.from_rule) diff --git a/vim/bundle/jedi-vim/pythonx/parso/parso/pgen2/grammar_parser.pyi b/vim/bundle/jedi-vim/pythonx/parso/parso/pgen2/grammar_parser.pyi new file mode 100644 index 0000000..b73a5a6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/parso/pgen2/grammar_parser.pyi @@ -0,0 +1,20 @@ +from typing import Generator, List, Optional, Tuple + +from parso.python.token import TokenType + +class GrammarParser: + generator: Generator[TokenType, None, None] + def __init__(self, bnf_grammar: str) -> None: ... + def parse(self) -> Generator[Tuple[NFAState, NFAState], None, None]: ... + +class NFAArc: + next: NFAState + nonterminal_or_string: Optional[str] + def __init__( + self, next_: NFAState, nonterminal_or_string: Optional[str] + ) -> None: ... + +class NFAState: + from_rule: str + arcs: List[NFAArc] + def __init__(self, from_rule: str) -> None: ... diff --git a/vim/bundle/jedi-vim/pythonx/parso/parso/python/__init__.py b/vim/bundle/jedi-vim/pythonx/parso/parso/python/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/parso/parso/python/__pycache__/__init__.cpython-36.pyc b/vim/bundle/jedi-vim/pythonx/parso/parso/python/__pycache__/__init__.cpython-36.pyc new file mode 100644 index 0000000..9d776aa Binary files /dev/null and b/vim/bundle/jedi-vim/pythonx/parso/parso/python/__pycache__/__init__.cpython-36.pyc differ diff --git a/vim/bundle/jedi-vim/pythonx/parso/parso/python/__pycache__/diff.cpython-36.pyc b/vim/bundle/jedi-vim/pythonx/parso/parso/python/__pycache__/diff.cpython-36.pyc new file mode 100644 index 0000000..7436046 Binary files /dev/null and b/vim/bundle/jedi-vim/pythonx/parso/parso/python/__pycache__/diff.cpython-36.pyc differ diff --git a/vim/bundle/jedi-vim/pythonx/parso/parso/python/__pycache__/errors.cpython-36.pyc b/vim/bundle/jedi-vim/pythonx/parso/parso/python/__pycache__/errors.cpython-36.pyc new file mode 100644 index 0000000..3f4b029 Binary files /dev/null and b/vim/bundle/jedi-vim/pythonx/parso/parso/python/__pycache__/errors.cpython-36.pyc differ diff --git a/vim/bundle/jedi-vim/pythonx/parso/parso/python/__pycache__/parser.cpython-36.pyc b/vim/bundle/jedi-vim/pythonx/parso/parso/python/__pycache__/parser.cpython-36.pyc new file mode 100644 index 0000000..e56803b Binary files /dev/null and b/vim/bundle/jedi-vim/pythonx/parso/parso/python/__pycache__/parser.cpython-36.pyc differ diff --git a/vim/bundle/jedi-vim/pythonx/parso/parso/python/__pycache__/pep8.cpython-36.pyc b/vim/bundle/jedi-vim/pythonx/parso/parso/python/__pycache__/pep8.cpython-36.pyc new file mode 100644 index 0000000..65ef608 Binary files /dev/null and b/vim/bundle/jedi-vim/pythonx/parso/parso/python/__pycache__/pep8.cpython-36.pyc differ diff --git a/vim/bundle/jedi-vim/pythonx/parso/parso/python/__pycache__/prefix.cpython-36.pyc b/vim/bundle/jedi-vim/pythonx/parso/parso/python/__pycache__/prefix.cpython-36.pyc new file mode 100644 index 0000000..3dca1dd Binary files /dev/null and b/vim/bundle/jedi-vim/pythonx/parso/parso/python/__pycache__/prefix.cpython-36.pyc differ diff --git a/vim/bundle/jedi-vim/pythonx/parso/parso/python/__pycache__/token.cpython-36.pyc b/vim/bundle/jedi-vim/pythonx/parso/parso/python/__pycache__/token.cpython-36.pyc new file mode 100644 index 0000000..b2bc3ce Binary files /dev/null and b/vim/bundle/jedi-vim/pythonx/parso/parso/python/__pycache__/token.cpython-36.pyc differ diff --git a/vim/bundle/jedi-vim/pythonx/parso/parso/python/__pycache__/tokenize.cpython-36.pyc b/vim/bundle/jedi-vim/pythonx/parso/parso/python/__pycache__/tokenize.cpython-36.pyc new file mode 100644 index 0000000..40c39f9 Binary files /dev/null and b/vim/bundle/jedi-vim/pythonx/parso/parso/python/__pycache__/tokenize.cpython-36.pyc differ diff --git a/vim/bundle/jedi-vim/pythonx/parso/parso/python/__pycache__/tree.cpython-36.pyc b/vim/bundle/jedi-vim/pythonx/parso/parso/python/__pycache__/tree.cpython-36.pyc new file mode 100644 index 0000000..f989229 Binary files /dev/null and b/vim/bundle/jedi-vim/pythonx/parso/parso/python/__pycache__/tree.cpython-36.pyc differ diff --git a/vim/bundle/jedi-vim/pythonx/parso/parso/python/diff.py b/vim/bundle/jedi-vim/pythonx/parso/parso/python/diff.py new file mode 100644 index 0000000..2dcf027 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/parso/python/diff.py @@ -0,0 +1,718 @@ +""" +Basically a contains parser that is faster, because it tries to parse only +parts and if anything changes, it only reparses the changed parts. + +It works with a simple diff in the beginning and will try to reuse old parser +fragments. +""" +import re +import difflib +from collections import namedtuple +import logging + +from parso.utils import split_lines +from parso.python.parser import Parser +from parso.python.tree import EndMarker +from parso.python.tokenize import PythonToken +from parso.python.token import PythonTokenTypes + +LOG = logging.getLogger(__name__) +DEBUG_DIFF_PARSER = False + +_INDENTATION_TOKENS = 'INDENT', 'ERROR_DEDENT', 'DEDENT' + + +def _get_previous_leaf_if_indentation(leaf): + while leaf and leaf.type == 'error_leaf' \ + and leaf.token_type in _INDENTATION_TOKENS: + leaf = leaf.get_previous_leaf() + return leaf + + +def _get_next_leaf_if_indentation(leaf): + while leaf and leaf.type == 'error_leaf' \ + and leaf.token_type in _INDENTATION_TOKENS: + leaf = leaf.get_previous_leaf() + return leaf + + +def _assert_valid_graph(node): + """ + Checks if the parent/children relationship is correct. + + This is a check that only runs during debugging/testing. + """ + try: + children = node.children + except AttributeError: + # Ignore INDENT is necessary, because indent/dedent tokens don't + # contain value/prefix and are just around, because of the tokenizer. + if node.type == 'error_leaf' and node.token_type in _INDENTATION_TOKENS: + assert not node.value + assert not node.prefix + return + + # Calculate the content between two start positions. + previous_leaf = _get_previous_leaf_if_indentation(node.get_previous_leaf()) + if previous_leaf is None: + content = node.prefix + previous_start_pos = 1, 0 + else: + assert previous_leaf.end_pos <= node.start_pos, \ + (previous_leaf, node) + + content = previous_leaf.value + node.prefix + previous_start_pos = previous_leaf.start_pos + + if '\n' in content or '\r' in content: + splitted = split_lines(content) + line = previous_start_pos[0] + len(splitted) - 1 + actual = line, len(splitted[-1]) + else: + actual = previous_start_pos[0], previous_start_pos[1] + len(content) + + assert node.start_pos == actual, (node.start_pos, actual) + else: + for child in children: + assert child.parent == node, (node, child) + _assert_valid_graph(child) + + +def _get_debug_error_message(module, old_lines, new_lines): + current_lines = split_lines(module.get_code(), keepends=True) + current_diff = difflib.unified_diff(new_lines, current_lines) + old_new_diff = difflib.unified_diff(old_lines, new_lines) + import parso + return ( + "There's an issue with the diff parser. Please " + "report (parso v%s) - Old/New:\n%s\nActual Diff (May be empty):\n%s" + % (parso.__version__, ''.join(old_new_diff), ''.join(current_diff)) + ) + + +def _get_last_line(node_or_leaf): + last_leaf = node_or_leaf.get_last_leaf() + if _ends_with_newline(last_leaf): + return last_leaf.start_pos[0] + else: + return last_leaf.end_pos[0] + + +def _skip_dedent_error_leaves(leaf): + while leaf is not None and leaf.type == 'error_leaf' and leaf.token_type == 'DEDENT': + leaf = leaf.get_previous_leaf() + return leaf + + +def _ends_with_newline(leaf, suffix=''): + leaf = _skip_dedent_error_leaves(leaf) + + if leaf.type == 'error_leaf': + typ = leaf.token_type.lower() + else: + typ = leaf.type + + return typ == 'newline' or suffix.endswith('\n') or suffix.endswith('\r') + + +def _flows_finished(pgen_grammar, stack): + """ + if, while, for and try might not be finished, because another part might + still be parsed. + """ + for stack_node in stack: + if stack_node.nonterminal in ('if_stmt', 'while_stmt', 'for_stmt', 'try_stmt'): + return False + return True + + +def _func_or_class_has_suite(node): + if node.type == 'decorated': + node = node.children[-1] + if node.type in ('async_funcdef', 'async_stmt'): + node = node.children[-1] + return node.type in ('classdef', 'funcdef') and node.children[-1].type == 'suite' + + +def _suite_or_file_input_is_valid(pgen_grammar, stack): + if not _flows_finished(pgen_grammar, stack): + return False + + for stack_node in reversed(stack): + if stack_node.nonterminal == 'decorator': + # A decorator is only valid with the upcoming function. + return False + + if stack_node.nonterminal == 'suite': + # If only newline is in the suite, the suite is not valid, yet. + return len(stack_node.nodes) > 1 + # Not reaching a suite means that we're dealing with file_input levels + # where there's no need for a valid statement in it. It can also be empty. + return True + + +def _is_flow_node(node): + if node.type == 'async_stmt': + node = node.children[1] + try: + value = node.children[0].value + except AttributeError: + return False + return value in ('if', 'for', 'while', 'try', 'with') + + +class _PositionUpdatingFinished(Exception): + pass + + +def _update_positions(nodes, line_offset, last_leaf): + for node in nodes: + try: + children = node.children + except AttributeError: + # Is a leaf + node.line += line_offset + if node is last_leaf: + raise _PositionUpdatingFinished + else: + _update_positions(children, line_offset, last_leaf) + + +class DiffParser(object): + """ + An advanced form of parsing a file faster. Unfortunately comes with huge + side effects. It changes the given module. + """ + def __init__(self, pgen_grammar, tokenizer, module): + self._pgen_grammar = pgen_grammar + self._tokenizer = tokenizer + self._module = module + + def _reset(self): + self._copy_count = 0 + self._parser_count = 0 + + self._nodes_tree = _NodesTree(self._module) + + def update(self, old_lines, new_lines): + ''' + The algorithm works as follows: + + Equal: + - Assure that the start is a newline, otherwise parse until we get + one. + - Copy from parsed_until_line + 1 to max(i2 + 1) + - Make sure that the indentation is correct (e.g. add DEDENT) + - Add old and change positions + Insert: + - Parse from parsed_until_line + 1 to min(j2 + 1), hopefully not + much more. + + Returns the new module node. + ''' + LOG.debug('diff parser start') + # Reset the used names cache so they get regenerated. + self._module._used_names = None + + self._parser_lines_new = new_lines + + self._reset() + + line_length = len(new_lines) + sm = difflib.SequenceMatcher(None, old_lines, self._parser_lines_new) + opcodes = sm.get_opcodes() + LOG.debug('line_lengths old: %s; new: %s' % (len(old_lines), line_length)) + + for operation, i1, i2, j1, j2 in opcodes: + LOG.debug('-> code[%s] old[%s:%s] new[%s:%s]', + operation, i1 + 1, i2, j1 + 1, j2) + + if j2 == line_length and new_lines[-1] == '': + # The empty part after the last newline is not relevant. + j2 -= 1 + + if operation == 'equal': + line_offset = j1 - i1 + self._copy_from_old_parser(line_offset, i2, j2) + elif operation == 'replace': + self._parse(until_line=j2) + elif operation == 'insert': + self._parse(until_line=j2) + else: + assert operation == 'delete' + + # With this action all change will finally be applied and we have a + # changed module. + self._nodes_tree.close() + + if DEBUG_DIFF_PARSER: + # If there is reasonable suspicion that the diff parser is not + # behaving well, this should be enabled. + try: + assert self._module.get_code() == ''.join(new_lines) + _assert_valid_graph(self._module) + except AssertionError: + print(_get_debug_error_message(self._module, old_lines, new_lines)) + raise + + last_pos = self._module.end_pos[0] + if last_pos != line_length: + raise Exception( + ('(%s != %s) ' % (last_pos, line_length)) + + _get_debug_error_message(self._module, old_lines, new_lines) + ) + LOG.debug('diff parser end') + return self._module + + def _enabled_debugging(self, old_lines, lines_new): + if self._module.get_code() != ''.join(lines_new): + LOG.warning('parser issue:\n%s\n%s', ''.join(old_lines), ''.join(lines_new)) + + def _copy_from_old_parser(self, line_offset, until_line_old, until_line_new): + last_until_line = -1 + while until_line_new > self._nodes_tree.parsed_until_line: + parsed_until_line_old = self._nodes_tree.parsed_until_line - line_offset + line_stmt = self._get_old_line_stmt(parsed_until_line_old + 1) + if line_stmt is None: + # Parse 1 line at least. We don't need more, because we just + # want to get into a state where the old parser has statements + # again that can be copied (e.g. not lines within parentheses). + self._parse(self._nodes_tree.parsed_until_line + 1) + else: + p_children = line_stmt.parent.children + index = p_children.index(line_stmt) + + from_ = self._nodes_tree.parsed_until_line + 1 + copied_nodes = self._nodes_tree.copy_nodes( + p_children[index:], + until_line_old, + line_offset + ) + # Match all the nodes that are in the wanted range. + if copied_nodes: + self._copy_count += 1 + + to = self._nodes_tree.parsed_until_line + + LOG.debug('copy old[%s:%s] new[%s:%s]', + copied_nodes[0].start_pos[0], + copied_nodes[-1].end_pos[0] - 1, from_, to) + else: + # We have copied as much as possible (but definitely not too + # much). Therefore we just parse a bit more. + self._parse(self._nodes_tree.parsed_until_line + 1) + # Since there are potential bugs that might loop here endlessly, we + # just stop here. + assert last_until_line != self._nodes_tree.parsed_until_line, last_until_line + last_until_line = self._nodes_tree.parsed_until_line + + def _get_old_line_stmt(self, old_line): + leaf = self._module.get_leaf_for_position((old_line, 0), include_prefixes=True) + + if _ends_with_newline(leaf): + leaf = leaf.get_next_leaf() + if leaf.get_start_pos_of_prefix()[0] == old_line: + node = leaf + while node.parent.type not in ('file_input', 'suite'): + node = node.parent + + # Make sure that if only the `else:` line of an if statement is + # copied that not the whole thing is going to be copied. + if node.start_pos[0] >= old_line: + return node + # Must be on the same line. Otherwise we need to parse that bit. + return None + + def _parse(self, until_line): + """ + Parses at least until the given line, but might just parse more until a + valid state is reached. + """ + last_until_line = 0 + while until_line > self._nodes_tree.parsed_until_line: + node = self._try_parse_part(until_line) + nodes = node.children + + self._nodes_tree.add_parsed_nodes(nodes) + LOG.debug( + 'parse_part from %s to %s (to %s in part parser)', + nodes[0].get_start_pos_of_prefix()[0], + self._nodes_tree.parsed_until_line, + node.end_pos[0] - 1 + ) + # Since the tokenizer sometimes has bugs, we cannot be sure that + # this loop terminates. Therefore assert that there's always a + # change. + assert last_until_line != self._nodes_tree.parsed_until_line, last_until_line + last_until_line = self._nodes_tree.parsed_until_line + + def _try_parse_part(self, until_line): + """ + Sets up a normal parser that uses a spezialized tokenizer to only parse + until a certain position (or a bit longer if the statement hasn't + ended. + """ + self._parser_count += 1 + # TODO speed up, shouldn't copy the whole list all the time. + # memoryview? + parsed_until_line = self._nodes_tree.parsed_until_line + lines_after = self._parser_lines_new[parsed_until_line:] + tokens = self._diff_tokenize( + lines_after, + until_line, + line_offset=parsed_until_line + ) + self._active_parser = Parser( + self._pgen_grammar, + error_recovery=True + ) + return self._active_parser.parse(tokens=tokens) + + def _diff_tokenize(self, lines, until_line, line_offset=0): + is_first_token = True + omitted_first_indent = False + indents = [] + tokens = self._tokenizer(lines, (1, 0)) + stack = self._active_parser.stack + for typ, string, start_pos, prefix in tokens: + start_pos = start_pos[0] + line_offset, start_pos[1] + if typ == PythonTokenTypes.INDENT: + indents.append(start_pos[1]) + if is_first_token: + omitted_first_indent = True + # We want to get rid of indents that are only here because + # we only parse part of the file. These indents would only + # get parsed as error leafs, which doesn't make any sense. + is_first_token = False + continue + is_first_token = False + + # In case of omitted_first_indent, it might not be dedented fully. + # However this is a sign for us that a dedent happened. + if typ == PythonTokenTypes.DEDENT \ + or typ == PythonTokenTypes.ERROR_DEDENT \ + and omitted_first_indent and len(indents) == 1: + indents.pop() + if omitted_first_indent and not indents: + # We are done here, only thing that can come now is an + # endmarker or another dedented code block. + typ, string, start_pos, prefix = next(tokens) + if '\n' in prefix or '\r' in prefix: + prefix = re.sub(r'[^\n\r]+\Z', '', prefix) + else: + assert start_pos[1] >= len(prefix), repr(prefix) + if start_pos[1] - len(prefix) == 0: + prefix = '' + yield PythonToken( + PythonTokenTypes.ENDMARKER, '', + (start_pos[0] + line_offset, 0), + prefix + ) + break + elif typ == PythonTokenTypes.NEWLINE and start_pos[0] >= until_line: + yield PythonToken(typ, string, start_pos, prefix) + # Check if the parser is actually in a valid suite state. + if _suite_or_file_input_is_valid(self._pgen_grammar, stack): + start_pos = start_pos[0] + 1, 0 + while len(indents) > int(omitted_first_indent): + indents.pop() + yield PythonToken(PythonTokenTypes.DEDENT, '', start_pos, '') + + yield PythonToken(PythonTokenTypes.ENDMARKER, '', start_pos, '') + break + else: + continue + + yield PythonToken(typ, string, start_pos, prefix) + + +class _NodesTreeNode(object): + _ChildrenGroup = namedtuple('_ChildrenGroup', 'prefix children line_offset last_line_offset_leaf') + + def __init__(self, tree_node, parent=None): + self.tree_node = tree_node + self._children_groups = [] + self.parent = parent + self._node_children = [] + + def finish(self): + children = [] + for prefix, children_part, line_offset, last_line_offset_leaf in self._children_groups: + first_leaf = _get_next_leaf_if_indentation( + children_part[0].get_first_leaf() + ) + + first_leaf.prefix = prefix + first_leaf.prefix + if line_offset != 0: + try: + _update_positions( + children_part, line_offset, last_line_offset_leaf) + except _PositionUpdatingFinished: + pass + children += children_part + self.tree_node.children = children + # Reset the parents + for node in children: + node.parent = self.tree_node + + for node_child in self._node_children: + node_child.finish() + + def add_child_node(self, child_node): + self._node_children.append(child_node) + + def add_tree_nodes(self, prefix, children, line_offset=0, last_line_offset_leaf=None): + if last_line_offset_leaf is None: + last_line_offset_leaf = children[-1].get_last_leaf() + group = self._ChildrenGroup(prefix, children, line_offset, last_line_offset_leaf) + self._children_groups.append(group) + + def get_last_line(self, suffix): + line = 0 + if self._children_groups: + children_group = self._children_groups[-1] + last_leaf = _get_previous_leaf_if_indentation( + children_group.last_line_offset_leaf + ) + + line = last_leaf.end_pos[0] + children_group.line_offset + + # Newlines end on the next line, which means that they would cover + # the next line. That line is not fully parsed at this point. + if _ends_with_newline(last_leaf, suffix): + line -= 1 + line += len(split_lines(suffix)) - 1 + + if suffix and not suffix.endswith('\n') and not suffix.endswith('\r'): + # This is the end of a file (that doesn't end with a newline). + line += 1 + + if self._node_children: + return max(line, self._node_children[-1].get_last_line(suffix)) + return line + + +class _NodesTree(object): + def __init__(self, module): + self._base_node = _NodesTreeNode(module) + self._working_stack = [self._base_node] + self._module = module + self._prefix_remainder = '' + self.prefix = '' + + @property + def parsed_until_line(self): + return self._working_stack[-1].get_last_line(self.prefix) + + def _get_insertion_node(self, indentation_node): + indentation = indentation_node.start_pos[1] + + # find insertion node + while True: + node = self._working_stack[-1] + tree_node = node.tree_node + if tree_node.type == 'suite': + # A suite starts with NEWLINE, ... + node_indentation = tree_node.children[1].start_pos[1] + + if indentation >= node_indentation: # Not a Dedent + # We might be at the most outer layer: modules. We + # don't want to depend on the first statement + # having the right indentation. + return node + + elif tree_node.type == 'file_input': + return node + + self._working_stack.pop() + + def add_parsed_nodes(self, tree_nodes): + old_prefix = self.prefix + tree_nodes = self._remove_endmarker(tree_nodes) + if not tree_nodes: + self.prefix = old_prefix + self.prefix + return + + assert tree_nodes[0].type != 'newline' + + node = self._get_insertion_node(tree_nodes[0]) + assert node.tree_node.type in ('suite', 'file_input') + node.add_tree_nodes(old_prefix, tree_nodes) + # tos = Top of stack + self._update_tos(tree_nodes[-1]) + + def _update_tos(self, tree_node): + if tree_node.type in ('suite', 'file_input'): + new_tos = _NodesTreeNode(tree_node) + new_tos.add_tree_nodes('', list(tree_node.children)) + + self._working_stack[-1].add_child_node(new_tos) + self._working_stack.append(new_tos) + + self._update_tos(tree_node.children[-1]) + elif _func_or_class_has_suite(tree_node): + self._update_tos(tree_node.children[-1]) + + def _remove_endmarker(self, tree_nodes): + """ + Helps cleaning up the tree nodes that get inserted. + """ + last_leaf = tree_nodes[-1].get_last_leaf() + is_endmarker = last_leaf.type == 'endmarker' + self._prefix_remainder = '' + if is_endmarker: + separation = max(last_leaf.prefix.rfind('\n'), last_leaf.prefix.rfind('\r')) + if separation > -1: + # Remove the whitespace part of the prefix after a newline. + # That is not relevant if parentheses were opened. Always parse + # until the end of a line. + last_leaf.prefix, self._prefix_remainder = \ + last_leaf.prefix[:separation + 1], last_leaf.prefix[separation + 1:] + + self.prefix = '' + + if is_endmarker: + self.prefix = last_leaf.prefix + + tree_nodes = tree_nodes[:-1] + return tree_nodes + + def copy_nodes(self, tree_nodes, until_line, line_offset): + """ + Copies tree nodes from the old parser tree. + + Returns the number of tree nodes that were copied. + """ + if tree_nodes[0].type in ('error_leaf', 'error_node'): + # Avoid copying errors in the beginning. Can lead to a lot of + # issues. + return [] + + self._get_insertion_node(tree_nodes[0]) + + new_nodes, self._working_stack, self.prefix = self._copy_nodes( + list(self._working_stack), + tree_nodes, + until_line, + line_offset, + self.prefix, + ) + return new_nodes + + def _copy_nodes(self, working_stack, nodes, until_line, line_offset, prefix=''): + new_nodes = [] + + new_prefix = '' + for node in nodes: + if node.start_pos[0] > until_line: + break + + if node.type == 'endmarker': + break + + if node.type == 'error_leaf' and node.token_type in ('DEDENT', 'ERROR_DEDENT'): + break + # TODO this check might take a bit of time for large files. We + # might want to change this to do more intelligent guessing or + # binary search. + if _get_last_line(node) > until_line: + # We can split up functions and classes later. + if _func_or_class_has_suite(node): + new_nodes.append(node) + break + + new_nodes.append(node) + + if not new_nodes: + return [], working_stack, prefix + + tos = working_stack[-1] + last_node = new_nodes[-1] + had_valid_suite_last = False + if _func_or_class_has_suite(last_node): + suite = last_node + while suite.type != 'suite': + suite = suite.children[-1] + + suite_tos = _NodesTreeNode(suite) + # Don't need to pass line_offset here, it's already done by the + # parent. + suite_nodes, new_working_stack, new_prefix = self._copy_nodes( + working_stack + [suite_tos], suite.children, until_line, line_offset + ) + if len(suite_nodes) < 2: + # A suite only with newline is not valid. + new_nodes.pop() + new_prefix = '' + else: + assert new_nodes + tos.add_child_node(suite_tos) + working_stack = new_working_stack + had_valid_suite_last = True + + if new_nodes: + last_node = new_nodes[-1] + if (last_node.type in ('error_leaf', 'error_node') or + _is_flow_node(new_nodes[-1])): + # Error leafs/nodes don't have a defined start/end. Error + # nodes might not end with a newline (e.g. if there's an + # open `(`). Therefore ignore all of them unless they are + # succeeded with valid parser state. + # If we copy flows at the end, they might be continued + # after the copy limit (in the new parser). + # In this while loop we try to remove until we find a newline. + new_prefix = '' + new_nodes.pop() + while new_nodes: + last_node = new_nodes[-1] + if last_node.get_last_leaf().type == 'newline': + break + new_nodes.pop() + + if new_nodes: + if not _ends_with_newline(new_nodes[-1].get_last_leaf()) and not had_valid_suite_last: + p = new_nodes[-1].get_next_leaf().prefix + # We are not allowed to remove the newline at the end of the + # line, otherwise it's going to be missing. This happens e.g. + # if a bracket is around before that moves newlines to + # prefixes. + new_prefix = split_lines(p, keepends=True)[0] + + if had_valid_suite_last: + last = new_nodes[-1] + if last.type == 'decorated': + last = last.children[-1] + if last.type in ('async_funcdef', 'async_stmt'): + last = last.children[-1] + last_line_offset_leaf = last.children[-2].get_last_leaf() + assert last_line_offset_leaf == ':' + else: + last_line_offset_leaf = new_nodes[-1].get_last_leaf() + tos.add_tree_nodes(prefix, new_nodes, line_offset, last_line_offset_leaf) + prefix = new_prefix + self._prefix_remainder = '' + + return new_nodes, working_stack, prefix + + def close(self): + self._base_node.finish() + + # Add an endmarker. + try: + last_leaf = self._module.get_last_leaf() + except IndexError: + end_pos = [1, 0] + else: + last_leaf = _skip_dedent_error_leaves(last_leaf) + end_pos = list(last_leaf.end_pos) + lines = split_lines(self.prefix) + assert len(lines) > 0 + if len(lines) == 1: + end_pos[1] += len(lines[0]) + else: + end_pos[0] += len(lines) - 1 + end_pos[1] = len(lines[-1]) + + endmarker = EndMarker('', tuple(end_pos), self.prefix + self._prefix_remainder) + endmarker.parent = self._module + self._module.children.append(endmarker) diff --git a/vim/bundle/jedi-vim/pythonx/parso/parso/python/errors.py b/vim/bundle/jedi-vim/pythonx/parso/parso/python/errors.py new file mode 100644 index 0000000..b6e6e5e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/parso/python/errors.py @@ -0,0 +1,1011 @@ +# -*- coding: utf-8 -*- +import codecs +import warnings +import re +from contextlib import contextmanager + +from parso.normalizer import Normalizer, NormalizerConfig, Issue, Rule +from parso.python.tree import search_ancestor + +_BLOCK_STMTS = ('if_stmt', 'while_stmt', 'for_stmt', 'try_stmt', 'with_stmt') +_STAR_EXPR_PARENTS = ('testlist_star_expr', 'testlist_comp', 'exprlist') +# This is the maximal block size given by python. +_MAX_BLOCK_SIZE = 20 +_MAX_INDENT_COUNT = 100 +ALLOWED_FUTURES = ( + 'all_feature_names', 'nested_scopes', 'generators', 'division', + 'absolute_import', 'with_statement', 'print_function', 'unicode_literals', +) +_COMP_FOR_TYPES = ('comp_for', 'sync_comp_for') + + +def _iter_stmts(scope): + """ + Iterates over all statements and splits up simple_stmt. + """ + for child in scope.children: + if child.type == 'simple_stmt': + for child2 in child.children: + if child2.type == 'newline' or child2 == ';': + continue + yield child2 + else: + yield child + + +def _get_comprehension_type(atom): + first, second = atom.children[:2] + if second.type == 'testlist_comp' and second.children[1].type in _COMP_FOR_TYPES: + if first == '[': + return 'list comprehension' + else: + return 'generator expression' + elif second.type == 'dictorsetmaker' and second.children[-1].type in _COMP_FOR_TYPES: + if second.children[1] == ':': + return 'dict comprehension' + else: + return 'set comprehension' + return None + + +def _is_future_import(import_from): + # It looks like a __future__ import that is relative is still a future + # import. That feels kind of odd, but whatever. + # if import_from.level != 0: + # return False + from_names = import_from.get_from_names() + return [n.value for n in from_names] == ['__future__'] + + +def _remove_parens(atom): + """ + Returns the inner part of an expression like `(foo)`. Also removes nested + parens. + """ + try: + children = atom.children + except AttributeError: + pass + else: + if len(children) == 3 and children[0] == '(': + return _remove_parens(atom.children[1]) + return atom + + +def _iter_params(parent_node): + return (n for n in parent_node.children if n.type == 'param') + + +def _is_future_import_first(import_from): + """ + Checks if the import is the first statement of a file. + """ + found_docstring = False + for stmt in _iter_stmts(import_from.get_root_node()): + if stmt.type == 'string' and not found_docstring: + continue + found_docstring = True + + if stmt == import_from: + return True + if stmt.type == 'import_from' and _is_future_import(stmt): + continue + return False + + +def _iter_definition_exprs_from_lists(exprlist): + for child in exprlist.children[::2]: + if child.type == 'atom' and child.children[0] in ('(', '['): + testlist_comp = child.children[0] + if testlist_comp.type == 'testlist_comp': + for expr in _iter_definition_exprs_from_lists(testlist_comp): + yield expr + continue + elif child.children[0] == '[': + yield testlist_comp + continue + + yield child + + +def _get_expr_stmt_definition_exprs(expr_stmt): + exprs = [] + for list_ in expr_stmt.children[:-2:2]: + if list_.type in ('testlist_star_expr', 'testlist'): + exprs += _iter_definition_exprs_from_lists(list_) + else: + exprs.append(list_) + return exprs + + +def _get_for_stmt_definition_exprs(for_stmt): + exprlist = for_stmt.children[1] + if exprlist.type != 'exprlist': + return [exprlist] + return list(_iter_definition_exprs_from_lists(exprlist)) + + +class _Context(object): + def __init__(self, node, add_syntax_error, parent_context=None): + self.node = node + self.blocks = [] + self.parent_context = parent_context + self._used_name_dict = {} + self._global_names = [] + self._nonlocal_names = [] + self._nonlocal_names_in_subscopes = [] + self._add_syntax_error = add_syntax_error + + def is_async_funcdef(self): + # Stupidly enough async funcdefs can have two different forms, + # depending if a decorator is used or not. + return self.is_function() \ + and self.node.parent.type in ('async_funcdef', 'async_stmt') + + def is_function(self): + return self.node.type == 'funcdef' + + def add_name(self, name): + parent_type = name.parent.type + if parent_type == 'trailer': + # We are only interested in first level names. + return + + if parent_type == 'global_stmt': + self._global_names.append(name) + elif parent_type == 'nonlocal_stmt': + self._nonlocal_names.append(name) + else: + self._used_name_dict.setdefault(name.value, []).append(name) + + def finalize(self): + """ + Returns a list of nonlocal names that need to be part of that scope. + """ + self._analyze_names(self._global_names, 'global') + self._analyze_names(self._nonlocal_names, 'nonlocal') + + # Python2.6 doesn't have dict comprehensions. + global_name_strs = dict((n.value, n) for n in self._global_names) + for nonlocal_name in self._nonlocal_names: + try: + global_name = global_name_strs[nonlocal_name.value] + except KeyError: + continue + + message = "name '%s' is nonlocal and global" % global_name.value + if global_name.start_pos < nonlocal_name.start_pos: + error_name = global_name + else: + error_name = nonlocal_name + self._add_syntax_error(error_name, message) + + nonlocals_not_handled = [] + for nonlocal_name in self._nonlocal_names_in_subscopes: + search = nonlocal_name.value + if search in global_name_strs or self.parent_context is None: + message = "no binding for nonlocal '%s' found" % nonlocal_name.value + self._add_syntax_error(nonlocal_name, message) + elif not self.is_function() or \ + nonlocal_name.value not in self._used_name_dict: + nonlocals_not_handled.append(nonlocal_name) + return self._nonlocal_names + nonlocals_not_handled + + def _analyze_names(self, globals_or_nonlocals, type_): + def raise_(message): + self._add_syntax_error(base_name, message % (base_name.value, type_)) + + params = [] + if self.node.type == 'funcdef': + params = self.node.get_params() + + for base_name in globals_or_nonlocals: + found_global_or_nonlocal = False + # Somehow Python does it the reversed way. + for name in reversed(self._used_name_dict.get(base_name.value, [])): + if name.start_pos > base_name.start_pos: + # All following names don't have to be checked. + found_global_or_nonlocal = True + + parent = name.parent + if parent.type == 'param' and parent.name == name: + # Skip those here, these definitions belong to the next + # scope. + continue + + if name.is_definition(): + if parent.type == 'expr_stmt' \ + and parent.children[1].type == 'annassign': + if found_global_or_nonlocal: + # If it's after the global the error seems to be + # placed there. + base_name = name + raise_("annotated name '%s' can't be %s") + break + else: + message = "name '%s' is assigned to before %s declaration" + else: + message = "name '%s' is used prior to %s declaration" + + if not found_global_or_nonlocal: + raise_(message) + # Only add an error for the first occurence. + break + + for param in params: + if param.name.value == base_name.value: + raise_("name '%s' is parameter and %s"), + + @contextmanager + def add_block(self, node): + self.blocks.append(node) + yield + self.blocks.pop() + + def add_context(self, node): + return _Context(node, self._add_syntax_error, parent_context=self) + + def close_child_context(self, child_context): + self._nonlocal_names_in_subscopes += child_context.finalize() + + +class ErrorFinder(Normalizer): + """ + Searches for errors in the syntax tree. + """ + def __init__(self, *args, **kwargs): + super(ErrorFinder, self).__init__(*args, **kwargs) + self._error_dict = {} + self.version = self.grammar.version_info + + def initialize(self, node): + def create_context(node): + if node is None: + return None + + parent_context = create_context(node.parent) + if node.type in ('classdef', 'funcdef', 'file_input'): + return _Context(node, self._add_syntax_error, parent_context) + return parent_context + + self.context = create_context(node) or _Context(node, self._add_syntax_error) + self._indentation_count = 0 + + def visit(self, node): + if node.type == 'error_node': + with self.visit_node(node): + # Don't need to investigate the inners of an error node. We + # might find errors in there that should be ignored, because + # the error node itself already shows that there's an issue. + return '' + return super(ErrorFinder, self).visit(node) + + @contextmanager + def visit_node(self, node): + self._check_type_rules(node) + + if node.type in _BLOCK_STMTS: + with self.context.add_block(node): + if len(self.context.blocks) == _MAX_BLOCK_SIZE: + self._add_syntax_error(node, "too many statically nested blocks") + yield + return + elif node.type == 'suite': + self._indentation_count += 1 + if self._indentation_count == _MAX_INDENT_COUNT: + self._add_indentation_error(node.children[1], "too many levels of indentation") + + yield + + if node.type == 'suite': + self._indentation_count -= 1 + elif node.type in ('classdef', 'funcdef'): + context = self.context + self.context = context.parent_context + self.context.close_child_context(context) + + def visit_leaf(self, leaf): + if leaf.type == 'error_leaf': + if leaf.token_type in ('INDENT', 'ERROR_DEDENT'): + # Indents/Dedents itself never have a prefix. They are just + # "pseudo" tokens that get removed by the syntax tree later. + # Therefore in case of an error we also have to check for this. + spacing = list(leaf.get_next_leaf()._split_prefix())[-1] + if leaf.token_type == 'INDENT': + message = 'unexpected indent' + else: + message = 'unindent does not match any outer indentation level' + self._add_indentation_error(spacing, message) + else: + if leaf.value.startswith('\\'): + message = 'unexpected character after line continuation character' + else: + match = re.match('\\w{,2}("{1,3}|\'{1,3})', leaf.value) + if match is None: + message = 'invalid syntax' + else: + if len(match.group(1)) == 1: + message = 'EOL while scanning string literal' + else: + message = 'EOF while scanning triple-quoted string literal' + self._add_syntax_error(leaf, message) + return '' + elif leaf.value == ':': + parent = leaf.parent + if parent.type in ('classdef', 'funcdef'): + self.context = self.context.add_context(parent) + + # The rest is rule based. + return super(ErrorFinder, self).visit_leaf(leaf) + + def _add_indentation_error(self, spacing, message): + self.add_issue(spacing, 903, "IndentationError: " + message) + + def _add_syntax_error(self, node, message): + self.add_issue(node, 901, "SyntaxError: " + message) + + def add_issue(self, node, code, message): + # Overwrite the default behavior. + # Check if the issues are on the same line. + line = node.start_pos[0] + args = (code, message, node) + self._error_dict.setdefault(line, args) + + def finalize(self): + self.context.finalize() + + for code, message, node in self._error_dict.values(): + self.issues.append(Issue(node, code, message)) + + +class IndentationRule(Rule): + code = 903 + + def _get_message(self, message): + message = super(IndentationRule, self)._get_message(message) + return "IndentationError: " + message + + +@ErrorFinder.register_rule(type='error_node') +class _ExpectIndentedBlock(IndentationRule): + message = 'expected an indented block' + + def get_node(self, node): + leaf = node.get_next_leaf() + return list(leaf._split_prefix())[-1] + + def is_issue(self, node): + # This is the beginning of a suite that is not indented. + return node.children[-1].type == 'newline' + + +class ErrorFinderConfig(NormalizerConfig): + normalizer_class = ErrorFinder + + +class SyntaxRule(Rule): + code = 901 + + def _get_message(self, message): + message = super(SyntaxRule, self)._get_message(message) + return "SyntaxError: " + message + + +@ErrorFinder.register_rule(type='error_node') +class _InvalidSyntaxRule(SyntaxRule): + message = "invalid syntax" + + def get_node(self, node): + return node.get_next_leaf() + + def is_issue(self, node): + # Error leafs will be added later as an error. + return node.get_next_leaf().type != 'error_leaf' + + +@ErrorFinder.register_rule(value='await') +class _AwaitOutsideAsync(SyntaxRule): + message = "'await' outside async function" + + def is_issue(self, leaf): + return not self._normalizer.context.is_async_funcdef() + + def get_error_node(self, node): + # Return the whole await statement. + return node.parent + + +@ErrorFinder.register_rule(value='break') +class _BreakOutsideLoop(SyntaxRule): + message = "'break' outside loop" + + def is_issue(self, leaf): + in_loop = False + for block in self._normalizer.context.blocks: + if block.type in ('for_stmt', 'while_stmt'): + in_loop = True + return not in_loop + + +@ErrorFinder.register_rule(value='continue') +class _ContinueChecks(SyntaxRule): + message = "'continue' not properly in loop" + message_in_finally = "'continue' not supported inside 'finally' clause" + + def is_issue(self, leaf): + in_loop = False + for block in self._normalizer.context.blocks: + if block.type in ('for_stmt', 'while_stmt'): + in_loop = True + if block.type == 'try_stmt': + last_block = block.children[-3] + if last_block == 'finally' and leaf.start_pos > last_block.start_pos: + self.add_issue(leaf, message=self.message_in_finally) + return False # Error already added + if not in_loop: + return True + + +@ErrorFinder.register_rule(value='from') +class _YieldFromCheck(SyntaxRule): + message = "'yield from' inside async function" + + def get_node(self, leaf): + return leaf.parent.parent # This is the actual yield statement. + + def is_issue(self, leaf): + return leaf.parent.type == 'yield_arg' \ + and self._normalizer.context.is_async_funcdef() + + +@ErrorFinder.register_rule(type='name') +class _NameChecks(SyntaxRule): + message = 'cannot assign to __debug__' + message_none = 'cannot assign to None' + + def is_issue(self, leaf): + self._normalizer.context.add_name(leaf) + + if leaf.value == '__debug__' and leaf.is_definition(): + return True + if leaf.value == 'None' and self._normalizer.version < (3, 0) \ + and leaf.is_definition(): + self.add_issue(leaf, message=self.message_none) + + +@ErrorFinder.register_rule(type='string') +class _StringChecks(SyntaxRule): + message = "bytes can only contain ASCII literal characters." + + def is_issue(self, leaf): + string_prefix = leaf.string_prefix.lower() + if 'b' in string_prefix \ + and self._normalizer.version >= (3, 0) \ + and any(c for c in leaf.value if ord(c) > 127): + # b'ä' + return True + + if 'r' not in string_prefix: + # Raw strings don't need to be checked if they have proper + # escaping. + is_bytes = self._normalizer.version < (3, 0) + if 'b' in string_prefix: + is_bytes = True + if 'u' in string_prefix: + is_bytes = False + + payload = leaf._get_payload() + if is_bytes: + payload = payload.encode('utf-8') + func = codecs.escape_decode + else: + func = codecs.unicode_escape_decode + + try: + with warnings.catch_warnings(): + # The warnings from parsing strings are not relevant. + warnings.filterwarnings('ignore') + func(payload) + except UnicodeDecodeError as e: + self.add_issue(leaf, message='(unicode error) ' + str(e)) + except ValueError as e: + self.add_issue(leaf, message='(value error) ' + str(e)) + + +@ErrorFinder.register_rule(value='*') +class _StarCheck(SyntaxRule): + message = "named arguments must follow bare *" + + def is_issue(self, leaf): + params = leaf.parent + if params.type == 'parameters' and params: + after = params.children[params.children.index(leaf) + 1:] + after = [child for child in after + if child not in (',', ')') and not child.star_count] + return len(after) == 0 + + +@ErrorFinder.register_rule(value='**') +class _StarStarCheck(SyntaxRule): + # e.g. {**{} for a in [1]} + # TODO this should probably get a better end_pos including + # the next sibling of leaf. + message = "dict unpacking cannot be used in dict comprehension" + + def is_issue(self, leaf): + if leaf.parent.type == 'dictorsetmaker': + comp_for = leaf.get_next_sibling().get_next_sibling() + return comp_for is not None and comp_for.type in _COMP_FOR_TYPES + + +@ErrorFinder.register_rule(value='yield') +@ErrorFinder.register_rule(value='return') +class _ReturnAndYieldChecks(SyntaxRule): + message = "'return' with value in async generator" + message_async_yield = "'yield' inside async function" + + def get_node(self, leaf): + return leaf.parent + + def is_issue(self, leaf): + if self._normalizer.context.node.type != 'funcdef': + self.add_issue(self.get_node(leaf), message="'%s' outside function" % leaf.value) + elif self._normalizer.context.is_async_funcdef() \ + and any(self._normalizer.context.node.iter_yield_exprs()): + if leaf.value == 'return' and leaf.parent.type == 'return_stmt': + return True + elif leaf.value == 'yield' \ + and leaf.get_next_leaf() != 'from' \ + and self._normalizer.version == (3, 5): + self.add_issue(self.get_node(leaf), message=self.message_async_yield) + + +@ErrorFinder.register_rule(type='strings') +class _BytesAndStringMix(SyntaxRule): + # e.g. 's' b'' + message = "cannot mix bytes and nonbytes literals" + + def _is_bytes_literal(self, string): + if string.type == 'fstring': + return False + return 'b' in string.string_prefix.lower() + + def is_issue(self, node): + first = node.children[0] + # In Python 2 it's allowed to mix bytes and unicode. + if self._normalizer.version >= (3, 0): + first_is_bytes = self._is_bytes_literal(first) + for string in node.children[1:]: + if first_is_bytes != self._is_bytes_literal(string): + return True + + +@ErrorFinder.register_rule(type='import_as_names') +class _TrailingImportComma(SyntaxRule): + # e.g. from foo import a, + message = "trailing comma not allowed without surrounding parentheses" + + def is_issue(self, node): + if node.children[-1] == ',': + return True + + +@ErrorFinder.register_rule(type='import_from') +class _ImportStarInFunction(SyntaxRule): + message = "import * only allowed at module level" + + def is_issue(self, node): + return node.is_star_import() and self._normalizer.context.parent_context is not None + + +@ErrorFinder.register_rule(type='import_from') +class _FutureImportRule(SyntaxRule): + message = "from __future__ imports must occur at the beginning of the file" + + def is_issue(self, node): + if _is_future_import(node): + if not _is_future_import_first(node): + return True + + for from_name, future_name in node.get_paths(): + name = future_name.value + allowed_futures = list(ALLOWED_FUTURES) + if self._normalizer.version >= (3, 5): + allowed_futures.append('generator_stop') + + if name == 'braces': + self.add_issue(node, message="not a chance") + elif name == 'barry_as_FLUFL': + m = "Seriously I'm not implementing this :) ~ Dave" + self.add_issue(node, message=m) + elif name not in ALLOWED_FUTURES: + message = "future feature %s is not defined" % name + self.add_issue(node, message=message) + + +@ErrorFinder.register_rule(type='star_expr') +class _StarExprRule(SyntaxRule): + message = "starred assignment target must be in a list or tuple" + message_iterable_unpacking = "iterable unpacking cannot be used in comprehension" + message_assignment = "can use starred expression only as assignment target" + + def is_issue(self, node): + if node.parent.type not in _STAR_EXPR_PARENTS: + return True + if node.parent.type == 'testlist_comp': + # [*[] for a in [1]] + if node.parent.children[1].type in _COMP_FOR_TYPES: + self.add_issue(node, message=self.message_iterable_unpacking) + if self._normalizer.version <= (3, 4): + n = search_ancestor(node, 'for_stmt', 'expr_stmt') + found_definition = False + if n is not None: + if n.type == 'expr_stmt': + exprs = _get_expr_stmt_definition_exprs(n) + else: + exprs = _get_for_stmt_definition_exprs(n) + if node in exprs: + found_definition = True + + if not found_definition: + self.add_issue(node, message=self.message_assignment) + + +@ErrorFinder.register_rule(types=_STAR_EXPR_PARENTS) +class _StarExprParentRule(SyntaxRule): + def is_issue(self, node): + if node.parent.type == 'del_stmt': + self.add_issue(node.parent, message="can't use starred expression here") + else: + def is_definition(node, ancestor): + if ancestor is None: + return False + + type_ = ancestor.type + if type_ == 'trailer': + return False + + if type_ == 'expr_stmt': + return node.start_pos < ancestor.children[-1].start_pos + + return is_definition(node, ancestor.parent) + + if is_definition(node, node.parent): + args = [c for c in node.children if c != ','] + starred = [c for c in args if c.type == 'star_expr'] + if len(starred) > 1: + message = "two starred expressions in assignment" + self.add_issue(starred[1], message=message) + elif starred: + count = args.index(starred[0]) + if count >= 256: + message = "too many expressions in star-unpacking assignment" + self.add_issue(starred[0], message=message) + + +@ErrorFinder.register_rule(type='annassign') +class _AnnotatorRule(SyntaxRule): + # True: int + # {}: float + message = "illegal target for annotation" + + def get_node(self, node): + return node.parent + + def is_issue(self, node): + type_ = None + lhs = node.parent.children[0] + lhs = _remove_parens(lhs) + try: + children = lhs.children + except AttributeError: + pass + else: + if ',' in children or lhs.type == 'atom' and children[0] == '(': + type_ = 'tuple' + elif lhs.type == 'atom' and children[0] == '[': + type_ = 'list' + trailer = children[-1] + + if type_ is None: + if not (lhs.type == 'name' + # subscript/attributes are allowed + or lhs.type in ('atom_expr', 'power') + and trailer.type == 'trailer' + and trailer.children[0] != '('): + return True + else: + # x, y: str + message = "only single target (not %s) can be annotated" + self.add_issue(lhs.parent, message=message % type_) + + +@ErrorFinder.register_rule(type='argument') +class _ArgumentRule(SyntaxRule): + def is_issue(self, node): + first = node.children[0] + if node.children[1] == '=' and first.type != 'name': + if first.type == 'lambdef': + # f(lambda: 1=1) + if self._normalizer.version < (3, 8): + message = "lambda cannot contain assignment" + else: + message = 'expression cannot contain assignment, perhaps you meant "=="?' + else: + # f(+x=1) + if self._normalizer.version < (3, 8): + message = "keyword can't be an expression" + else: + message = 'expression cannot contain assignment, perhaps you meant "=="?' + self.add_issue(first, message=message) + + +@ErrorFinder.register_rule(type='nonlocal_stmt') +class _NonlocalModuleLevelRule(SyntaxRule): + message = "nonlocal declaration not allowed at module level" + + def is_issue(self, node): + return self._normalizer.context.parent_context is None + + +@ErrorFinder.register_rule(type='arglist') +class _ArglistRule(SyntaxRule): + @property + def message(self): + if self._normalizer.version < (3, 7): + return "Generator expression must be parenthesized if not sole argument" + else: + return "Generator expression must be parenthesized" + + def is_issue(self, node): + first_arg = node.children[0] + if first_arg.type == 'argument' \ + and first_arg.children[1].type in _COMP_FOR_TYPES: + # e.g. foo(x for x in [], b) + return len(node.children) >= 2 + else: + arg_set = set() + kw_only = False + kw_unpacking_only = False + is_old_starred = False + # In python 3 this would be a bit easier (stars are part of + # argument), but we have to understand both. + for argument in node.children: + if argument == ',': + continue + + if argument in ('*', '**'): + # Python < 3.5 has the order engraved in the grammar + # file. No need to do anything here. + is_old_starred = True + continue + if is_old_starred: + is_old_starred = False + continue + + if argument.type == 'argument': + first = argument.children[0] + if first in ('*', '**'): + if first == '*': + if kw_unpacking_only: + # foo(**kwargs, *args) + message = "iterable argument unpacking " \ + "follows keyword argument unpacking" + self.add_issue(argument, message=message) + else: + kw_unpacking_only = True + else: # Is a keyword argument. + kw_only = True + if first.type == 'name': + if first.value in arg_set: + # f(x=1, x=2) + self.add_issue(first, message="keyword argument repeated") + else: + arg_set.add(first.value) + else: + if kw_unpacking_only: + # f(**x, y) + message = "positional argument follows keyword argument unpacking" + self.add_issue(argument, message=message) + elif kw_only: + # f(x=2, y) + message = "positional argument follows keyword argument" + self.add_issue(argument, message=message) + + +@ErrorFinder.register_rule(type='parameters') +@ErrorFinder.register_rule(type='lambdef') +class _ParameterRule(SyntaxRule): + # def f(x=3, y): pass + message = "non-default argument follows default argument" + + def is_issue(self, node): + param_names = set() + default_only = False + for p in _iter_params(node): + if p.name.value in param_names: + message = "duplicate argument '%s' in function definition" + self.add_issue(p.name, message=message % p.name.value) + param_names.add(p.name.value) + + if p.default is None and not p.star_count: + if default_only: + return True + else: + default_only = True + + +@ErrorFinder.register_rule(type='try_stmt') +class _TryStmtRule(SyntaxRule): + message = "default 'except:' must be last" + + def is_issue(self, try_stmt): + default_except = None + for except_clause in try_stmt.children[3::3]: + if except_clause in ('else', 'finally'): + break + if except_clause == 'except': + default_except = except_clause + elif default_except is not None: + self.add_issue(default_except, message=self.message) + + +@ErrorFinder.register_rule(type='fstring') +class _FStringRule(SyntaxRule): + _fstring_grammar = None + message_nested = "f-string: expressions nested too deeply" + message_conversion = "f-string: invalid conversion character: expected 's', 'r', or 'a'" + + def _check_format_spec(self, format_spec, depth): + self._check_fstring_contents(format_spec.children[1:], depth) + + def _check_fstring_expr(self, fstring_expr, depth): + if depth >= 2: + self.add_issue(fstring_expr, message=self.message_nested) + + conversion = fstring_expr.children[2] + if conversion.type == 'fstring_conversion': + name = conversion.children[1] + if name.value not in ('s', 'r', 'a'): + self.add_issue(name, message=self.message_conversion) + + format_spec = fstring_expr.children[-2] + if format_spec.type == 'fstring_format_spec': + self._check_format_spec(format_spec, depth + 1) + + def is_issue(self, fstring): + self._check_fstring_contents(fstring.children[1:-1]) + + def _check_fstring_contents(self, children, depth=0): + for fstring_content in children: + if fstring_content.type == 'fstring_expr': + self._check_fstring_expr(fstring_content, depth) + + +class _CheckAssignmentRule(SyntaxRule): + def _check_assignment(self, node, is_deletion=False): + error = None + type_ = node.type + if type_ == 'lambdef': + error = 'lambda' + elif type_ == 'atom': + first, second = node.children[:2] + error = _get_comprehension_type(node) + if error is None: + if second.type == 'dictorsetmaker': + if self._normalizer.version < (3, 8): + error = 'literal' + else: + if second.children[1] == ':': + error = 'dict display' + else: + error = 'set display' + elif first in ('(', '['): + if second.type == 'yield_expr': + error = 'yield expression' + elif second.type == 'testlist_comp': + # This is not a comprehension, they were handled + # further above. + for child in second.children[::2]: + self._check_assignment(child, is_deletion) + else: # Everything handled, must be useless brackets. + self._check_assignment(second, is_deletion) + elif type_ == 'keyword': + if self._normalizer.version < (3, 8): + error = 'keyword' + else: + error = str(node.value) + elif type_ == 'operator': + if node.value == '...': + error = 'Ellipsis' + elif type_ == 'comparison': + error = 'comparison' + elif type_ in ('string', 'number', 'strings'): + error = 'literal' + elif type_ == 'yield_expr': + # This one seems to be a slightly different warning in Python. + message = 'assignment to yield expression not possible' + self.add_issue(node, message=message) + elif type_ == 'test': + error = 'conditional expression' + elif type_ in ('atom_expr', 'power'): + if node.children[0] == 'await': + error = 'await expression' + elif node.children[-2] == '**': + error = 'operator' + else: + # Has a trailer + trailer = node.children[-1] + assert trailer.type == 'trailer' + if trailer.children[0] == '(': + error = 'function call' + elif type_ in ('testlist_star_expr', 'exprlist', 'testlist'): + for child in node.children[::2]: + self._check_assignment(child, is_deletion) + elif ('expr' in type_ and type_ != 'star_expr' # is a substring + or '_test' in type_ + or type_ in ('term', 'factor')): + error = 'operator' + + if error is not None: + cannot = "can't" if self._normalizer.version < (3, 8) else "cannot" + message = ' '.join([cannot, "delete" if is_deletion else "assign to", error]) + self.add_issue(node, message=message) + + +@ErrorFinder.register_rule(type='sync_comp_for') +class _CompForRule(_CheckAssignmentRule): + message = "asynchronous comprehension outside of an asynchronous function" + + def is_issue(self, node): + expr_list = node.children[1] + print(expr_list) + if expr_list.type != 'expr_list': # Already handled. + self._check_assignment(expr_list) + + return node.parent.children[0] == 'async' \ + and not self._normalizer.context.is_async_funcdef() + + +@ErrorFinder.register_rule(type='expr_stmt') +class _ExprStmtRule(_CheckAssignmentRule): + message = "illegal expression for augmented assignment" + + def is_issue(self, node): + for before_equal in node.children[:-2:2]: + self._check_assignment(before_equal) + + augassign = node.children[1] + if augassign != '=' and augassign.type != 'annassign': # Is augassign. + return node.children[0].type in ('testlist_star_expr', 'atom', 'testlist') + + +@ErrorFinder.register_rule(type='with_item') +class _WithItemRule(_CheckAssignmentRule): + def is_issue(self, with_item): + self._check_assignment(with_item.children[2]) + + +@ErrorFinder.register_rule(type='del_stmt') +class _DelStmtRule(_CheckAssignmentRule): + def is_issue(self, del_stmt): + child = del_stmt.children[1] + + if child.type != 'expr_list': # Already handled. + self._check_assignment(child, is_deletion=True) + + +@ErrorFinder.register_rule(type='expr_list') +class _ExprListRule(_CheckAssignmentRule): + def is_issue(self, expr_list): + for expr in expr_list.children[::2]: + self._check_assignment(expr) + + +@ErrorFinder.register_rule(type='for_stmt') +class _ForStmtRule(_CheckAssignmentRule): + def is_issue(self, for_stmt): + # Some of the nodes here are already used, so no else if + expr_list = for_stmt.children[1] + if expr_list.type != 'expr_list': # Already handled. + self._check_assignment(expr_list) diff --git a/vim/bundle/jedi-vim/pythonx/parso/parso/python/grammar26.txt b/vim/bundle/jedi-vim/pythonx/parso/parso/python/grammar26.txt new file mode 100644 index 0000000..d9cede2 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/parso/python/grammar26.txt @@ -0,0 +1,159 @@ +# Grammar for Python + +# Note: Changing the grammar specified in this file will most likely +# require corresponding changes in the parser module +# (../Modules/parsermodule.c). If you can't make the changes to +# that module yourself, please co-ordinate the required changes +# with someone who can; ask around on python-dev for help. Fred +# Drake will probably be listening there. + +# NOTE WELL: You should also follow all the steps listed in PEP 306, +# "How to Change Python's Grammar" + +# Commands for Kees Blom's railroad program +#diagram:token NAME +#diagram:token NUMBER +#diagram:token STRING +#diagram:token NEWLINE +#diagram:token ENDMARKER +#diagram:token INDENT +#diagram:output\input python.bla +#diagram:token DEDENT +#diagram:output\textwidth 20.04cm\oddsidemargin 0.0cm\evensidemargin 0.0cm +#diagram:rules + +# Start symbols for the grammar: +# single_input is a single interactive statement; +# file_input is a module or sequence of commands read from an input file; +# eval_input is the input for the eval() and input() functions. +# NB: compound_stmt in single_input is followed by extra NEWLINE! +single_input: NEWLINE | simple_stmt | compound_stmt NEWLINE +file_input: (NEWLINE | stmt)* ENDMARKER +eval_input: testlist NEWLINE* ENDMARKER + +decorator: '@' dotted_name [ '(' [arglist] ')' ] NEWLINE +decorators: decorator+ +decorated: decorators (classdef | funcdef) +funcdef: 'def' NAME parameters ':' suite +parameters: '(' [varargslist] ')' +varargslist: ((fpdef ['=' test] ',')* + ('*' NAME [',' '**' NAME] | '**' NAME) | + fpdef ['=' test] (',' fpdef ['=' test])* [',']) +fpdef: NAME | '(' fplist ')' +fplist: fpdef (',' fpdef)* [','] + +stmt: simple_stmt | compound_stmt +simple_stmt: small_stmt (';' small_stmt)* [';'] NEWLINE +small_stmt: (expr_stmt | print_stmt | del_stmt | pass_stmt | flow_stmt | + import_stmt | global_stmt | exec_stmt | assert_stmt) +expr_stmt: testlist (augassign (yield_expr|testlist) | + ('=' (yield_expr|testlist))*) +augassign: ('+=' | '-=' | '*=' | '/=' | '%=' | '&=' | '|=' | '^=' | + '<<=' | '>>=' | '**=' | '//=') +# For normal assignments, additional restrictions enforced by the interpreter +print_stmt: 'print' ( [ test (',' test)* [','] ] | + '>>' test [ (',' test)+ [','] ] ) +del_stmt: 'del' exprlist +pass_stmt: 'pass' +flow_stmt: break_stmt | continue_stmt | return_stmt | raise_stmt | yield_stmt +break_stmt: 'break' +continue_stmt: 'continue' +return_stmt: 'return' [testlist] +yield_stmt: yield_expr +raise_stmt: 'raise' [test [',' test [',' test]]] +import_stmt: import_name | import_from +import_name: 'import' dotted_as_names +import_from: ('from' ('.'* dotted_name | '.'+) + 'import' ('*' | '(' import_as_names ')' | import_as_names)) +import_as_name: NAME ['as' NAME] +dotted_as_name: dotted_name ['as' NAME] +import_as_names: import_as_name (',' import_as_name)* [','] +dotted_as_names: dotted_as_name (',' dotted_as_name)* +dotted_name: NAME ('.' NAME)* +global_stmt: 'global' NAME (',' NAME)* +exec_stmt: 'exec' expr ['in' test [',' test]] +assert_stmt: 'assert' test [',' test] + +compound_stmt: if_stmt | while_stmt | for_stmt | try_stmt | with_stmt | funcdef | classdef | decorated +if_stmt: 'if' test ':' suite ('elif' test ':' suite)* ['else' ':' suite] +while_stmt: 'while' test ':' suite ['else' ':' suite] +for_stmt: 'for' exprlist 'in' testlist ':' suite ['else' ':' suite] +try_stmt: ('try' ':' suite + ((except_clause ':' suite)+ + ['else' ':' suite] + ['finally' ':' suite] | + 'finally' ':' suite)) +with_stmt: 'with' with_item ':' suite +# Dave: Python2.6 actually defines a little bit of a different label called +# 'with_var'. However in 2.7+ this is the default. Apply it for +# consistency reasons. +with_item: test ['as' expr] +# NB compile.c makes sure that the default except clause is last +except_clause: 'except' [test [('as' | ',') test]] +suite: simple_stmt | NEWLINE INDENT stmt+ DEDENT + +# Backward compatibility cruft to support: +# [ x for x in lambda: True, lambda: False if x() ] +# even while also allowing: +# lambda x: 5 if x else 2 +# (But not a mix of the two) +testlist_safe: old_test [(',' old_test)+ [',']] +old_test: or_test | old_lambdef +old_lambdef: 'lambda' [varargslist] ':' old_test + +test: or_test ['if' or_test 'else' test] | lambdef +or_test: and_test ('or' and_test)* +and_test: not_test ('and' not_test)* +not_test: 'not' not_test | comparison +comparison: expr (comp_op expr)* +comp_op: '<'|'>'|'=='|'>='|'<='|'<>'|'!='|'in'|'not' 'in'|'is'|'is' 'not' +expr: xor_expr ('|' xor_expr)* +xor_expr: and_expr ('^' and_expr)* +and_expr: shift_expr ('&' shift_expr)* +shift_expr: arith_expr (('<<'|'>>') arith_expr)* +arith_expr: term (('+'|'-') term)* +term: factor (('*'|'/'|'%'|'//') factor)* +factor: ('+'|'-'|'~') factor | power +power: atom trailer* ['**' factor] +atom: ('(' [yield_expr|testlist_comp] ')' | + '[' [listmaker] ']' | + '{' [dictorsetmaker] '}' | + '`' testlist1 '`' | + NAME | NUMBER | strings) +strings: STRING+ +listmaker: test ( list_for | (',' test)* [','] ) +# Dave: Renamed testlist_gexpr to testlist_comp, because in 2.7+ this is the +# default. It's more consistent like this. +testlist_comp: test ( gen_for | (',' test)* [','] ) +lambdef: 'lambda' [varargslist] ':' test +trailer: '(' [arglist] ')' | '[' subscriptlist ']' | '.' NAME +subscriptlist: subscript (',' subscript)* [','] +subscript: '.' '.' '.' | test | [test] ':' [test] [sliceop] +sliceop: ':' [test] +exprlist: expr (',' expr)* [','] +testlist: test (',' test)* [','] +# Dave: Rename from dictmaker to dictorsetmaker, because this is more +# consistent with the following grammars. +dictorsetmaker: test ':' test (',' test ':' test)* [','] + +classdef: 'class' NAME ['(' [testlist] ')'] ':' suite + +arglist: (argument ',')* (argument [','] + |'*' test (',' argument)* [',' '**' test] + |'**' test) +argument: test [gen_for] | test '=' test # Really [keyword '='] test + +list_iter: list_for | list_if +list_for: 'for' exprlist 'in' testlist_safe [list_iter] +list_if: 'if' old_test [list_iter] + +gen_iter: gen_for | gen_if +gen_for: 'for' exprlist 'in' or_test [gen_iter] +gen_if: 'if' old_test [gen_iter] + +testlist1: test (',' test)* + +# not used in grammar, but may appear in "node" passed from Parser to Compiler +encoding_decl: NAME + +yield_expr: 'yield' [testlist] diff --git a/vim/bundle/jedi-vim/pythonx/parso/parso/python/grammar27.txt b/vim/bundle/jedi-vim/pythonx/parso/parso/python/grammar27.txt new file mode 100644 index 0000000..ddb6847 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/parso/python/grammar27.txt @@ -0,0 +1,143 @@ +# Grammar for Python + +# Note: Changing the grammar specified in this file will most likely +# require corresponding changes in the parser module +# (../Modules/parsermodule.c). If you can't make the changes to +# that module yourself, please co-ordinate the required changes +# with someone who can; ask around on python-dev for help. Fred +# Drake will probably be listening there. + +# NOTE WELL: You should also follow all the steps listed in PEP 306, +# "How to Change Python's Grammar" + +# Start symbols for the grammar: +# single_input is a single interactive statement; +# file_input is a module or sequence of commands read from an input file; +# eval_input is the input for the eval() and input() functions. +# NB: compound_stmt in single_input is followed by extra NEWLINE! +single_input: NEWLINE | simple_stmt | compound_stmt NEWLINE +file_input: (NEWLINE | stmt)* ENDMARKER +eval_input: testlist NEWLINE* ENDMARKER + +decorator: '@' dotted_name [ '(' [arglist] ')' ] NEWLINE +decorators: decorator+ +decorated: decorators (classdef | funcdef) +funcdef: 'def' NAME parameters ':' suite +parameters: '(' [varargslist] ')' +varargslist: ((fpdef ['=' test] ',')* + ('*' NAME [',' '**' NAME] | '**' NAME) | + fpdef ['=' test] (',' fpdef ['=' test])* [',']) +fpdef: NAME | '(' fplist ')' +fplist: fpdef (',' fpdef)* [','] + +stmt: simple_stmt | compound_stmt +simple_stmt: small_stmt (';' small_stmt)* [';'] NEWLINE +small_stmt: (expr_stmt | print_stmt | del_stmt | pass_stmt | flow_stmt | + import_stmt | global_stmt | exec_stmt | assert_stmt) +expr_stmt: testlist (augassign (yield_expr|testlist) | + ('=' (yield_expr|testlist))*) +augassign: ('+=' | '-=' | '*=' | '/=' | '%=' | '&=' | '|=' | '^=' | + '<<=' | '>>=' | '**=' | '//=') +# For normal assignments, additional restrictions enforced by the interpreter +print_stmt: 'print' ( [ test (',' test)* [','] ] | + '>>' test [ (',' test)+ [','] ] ) +del_stmt: 'del' exprlist +pass_stmt: 'pass' +flow_stmt: break_stmt | continue_stmt | return_stmt | raise_stmt | yield_stmt +break_stmt: 'break' +continue_stmt: 'continue' +return_stmt: 'return' [testlist] +yield_stmt: yield_expr +raise_stmt: 'raise' [test [',' test [',' test]]] +import_stmt: import_name | import_from +import_name: 'import' dotted_as_names +import_from: ('from' ('.'* dotted_name | '.'+) + 'import' ('*' | '(' import_as_names ')' | import_as_names)) +import_as_name: NAME ['as' NAME] +dotted_as_name: dotted_name ['as' NAME] +import_as_names: import_as_name (',' import_as_name)* [','] +dotted_as_names: dotted_as_name (',' dotted_as_name)* +dotted_name: NAME ('.' NAME)* +global_stmt: 'global' NAME (',' NAME)* +exec_stmt: 'exec' expr ['in' test [',' test]] +assert_stmt: 'assert' test [',' test] + +compound_stmt: if_stmt | while_stmt | for_stmt | try_stmt | with_stmt | funcdef | classdef | decorated +if_stmt: 'if' test ':' suite ('elif' test ':' suite)* ['else' ':' suite] +while_stmt: 'while' test ':' suite ['else' ':' suite] +for_stmt: 'for' exprlist 'in' testlist ':' suite ['else' ':' suite] +try_stmt: ('try' ':' suite + ((except_clause ':' suite)+ + ['else' ':' suite] + ['finally' ':' suite] | + 'finally' ':' suite)) +with_stmt: 'with' with_item (',' with_item)* ':' suite +with_item: test ['as' expr] +# NB compile.c makes sure that the default except clause is last +except_clause: 'except' [test [('as' | ',') test]] +suite: simple_stmt | NEWLINE INDENT stmt+ DEDENT + +# Backward compatibility cruft to support: +# [ x for x in lambda: True, lambda: False if x() ] +# even while also allowing: +# lambda x: 5 if x else 2 +# (But not a mix of the two) +testlist_safe: old_test [(',' old_test)+ [',']] +old_test: or_test | old_lambdef +old_lambdef: 'lambda' [varargslist] ':' old_test + +test: or_test ['if' or_test 'else' test] | lambdef +or_test: and_test ('or' and_test)* +and_test: not_test ('and' not_test)* +not_test: 'not' not_test | comparison +comparison: expr (comp_op expr)* +comp_op: '<'|'>'|'=='|'>='|'<='|'<>'|'!='|'in'|'not' 'in'|'is'|'is' 'not' +expr: xor_expr ('|' xor_expr)* +xor_expr: and_expr ('^' and_expr)* +and_expr: shift_expr ('&' shift_expr)* +shift_expr: arith_expr (('<<'|'>>') arith_expr)* +arith_expr: term (('+'|'-') term)* +term: factor (('*'|'/'|'%'|'//') factor)* +factor: ('+'|'-'|'~') factor | power +power: atom trailer* ['**' factor] +atom: ('(' [yield_expr|testlist_comp] ')' | + '[' [listmaker] ']' | + '{' [dictorsetmaker] '}' | + '`' testlist1 '`' | + NAME | NUMBER | strings) +strings: STRING+ +listmaker: test ( list_for | (',' test)* [','] ) +testlist_comp: test ( sync_comp_for | (',' test)* [','] ) +lambdef: 'lambda' [varargslist] ':' test +trailer: '(' [arglist] ')' | '[' subscriptlist ']' | '.' NAME +subscriptlist: subscript (',' subscript)* [','] +subscript: '.' '.' '.' | test | [test] ':' [test] [sliceop] +sliceop: ':' [test] +exprlist: expr (',' expr)* [','] +testlist: test (',' test)* [','] +dictorsetmaker: ( (test ':' test (sync_comp_for | (',' test ':' test)* [','])) | + (test (sync_comp_for | (',' test)* [','])) ) + +classdef: 'class' NAME ['(' [testlist] ')'] ':' suite + +arglist: (argument ',')* (argument [','] + |'*' test (',' argument)* [',' '**' test] + |'**' test) +# The reason that keywords are test nodes instead of NAME is that using NAME +# results in an ambiguity. ast.c makes sure it's a NAME. +argument: test [sync_comp_for] | test '=' test + +list_iter: list_for | list_if +list_for: 'for' exprlist 'in' testlist_safe [list_iter] +list_if: 'if' old_test [list_iter] + +comp_iter: sync_comp_for | comp_if +sync_comp_for: 'for' exprlist 'in' or_test [comp_iter] +comp_if: 'if' old_test [comp_iter] + +testlist1: test (',' test)* + +# not used in grammar, but may appear in "node" passed from Parser to Compiler +encoding_decl: NAME + +yield_expr: 'yield' [testlist] diff --git a/vim/bundle/jedi-vim/pythonx/parso/parso/python/grammar33.txt b/vim/bundle/jedi-vim/pythonx/parso/parso/python/grammar33.txt new file mode 100644 index 0000000..787a166 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/parso/python/grammar33.txt @@ -0,0 +1,134 @@ +# Grammar for Python + +# Note: Changing the grammar specified in this file will most likely +# require corresponding changes in the parser module +# (../Modules/parsermodule.c). If you can't make the changes to +# that module yourself, please co-ordinate the required changes +# with someone who can; ask around on python-dev for help. Fred +# Drake will probably be listening there. + +# NOTE WELL: You should also follow all the steps listed in PEP 306, +# "How to Change Python's Grammar" + +# Start symbols for the grammar: +# single_input is a single interactive statement; +# file_input is a module or sequence of commands read from an input file; +# eval_input is the input for the eval() functions. +# NB: compound_stmt in single_input is followed by extra NEWLINE! +single_input: NEWLINE | simple_stmt | compound_stmt NEWLINE +file_input: (NEWLINE | stmt)* ENDMARKER +eval_input: testlist NEWLINE* ENDMARKER + +decorator: '@' dotted_name [ '(' [arglist] ')' ] NEWLINE +decorators: decorator+ +decorated: decorators (classdef | funcdef) +funcdef: 'def' NAME parameters ['->' test] ':' suite +parameters: '(' [typedargslist] ')' +typedargslist: (tfpdef ['=' test] (',' tfpdef ['=' test])* [',' + ['*' [tfpdef] (',' tfpdef ['=' test])* [',' '**' tfpdef] | '**' tfpdef]] + | '*' [tfpdef] (',' tfpdef ['=' test])* [',' '**' tfpdef] | '**' tfpdef) +tfpdef: NAME [':' test] +varargslist: (vfpdef ['=' test] (',' vfpdef ['=' test])* [',' + ['*' [vfpdef] (',' vfpdef ['=' test])* [',' '**' vfpdef] | '**' vfpdef]] + | '*' [vfpdef] (',' vfpdef ['=' test])* [',' '**' vfpdef] | '**' vfpdef) +vfpdef: NAME + +stmt: simple_stmt | compound_stmt +simple_stmt: small_stmt (';' small_stmt)* [';'] NEWLINE +small_stmt: (expr_stmt | del_stmt | pass_stmt | flow_stmt | + import_stmt | global_stmt | nonlocal_stmt | assert_stmt) +expr_stmt: testlist_star_expr (augassign (yield_expr|testlist) | + ('=' (yield_expr|testlist_star_expr))*) +testlist_star_expr: (test|star_expr) (',' (test|star_expr))* [','] +augassign: ('+=' | '-=' | '*=' | '/=' | '%=' | '&=' | '|=' | '^=' | + '<<=' | '>>=' | '**=' | '//=') +# For normal assignments, additional restrictions enforced by the interpreter +del_stmt: 'del' exprlist +pass_stmt: 'pass' +flow_stmt: break_stmt | continue_stmt | return_stmt | raise_stmt | yield_stmt +break_stmt: 'break' +continue_stmt: 'continue' +return_stmt: 'return' [testlist] +yield_stmt: yield_expr +raise_stmt: 'raise' [test ['from' test]] +import_stmt: import_name | import_from +import_name: 'import' dotted_as_names +# note below: the ('.' | '...') is necessary because '...' is tokenized as ELLIPSIS +import_from: ('from' (('.' | '...')* dotted_name | ('.' | '...')+) + 'import' ('*' | '(' import_as_names ')' | import_as_names)) +import_as_name: NAME ['as' NAME] +dotted_as_name: dotted_name ['as' NAME] +import_as_names: import_as_name (',' import_as_name)* [','] +dotted_as_names: dotted_as_name (',' dotted_as_name)* +dotted_name: NAME ('.' NAME)* +global_stmt: 'global' NAME (',' NAME)* +nonlocal_stmt: 'nonlocal' NAME (',' NAME)* +assert_stmt: 'assert' test [',' test] + +compound_stmt: if_stmt | while_stmt | for_stmt | try_stmt | with_stmt | funcdef | classdef | decorated +if_stmt: 'if' test ':' suite ('elif' test ':' suite)* ['else' ':' suite] +while_stmt: 'while' test ':' suite ['else' ':' suite] +for_stmt: 'for' exprlist 'in' testlist ':' suite ['else' ':' suite] +try_stmt: ('try' ':' suite + ((except_clause ':' suite)+ + ['else' ':' suite] + ['finally' ':' suite] | + 'finally' ':' suite)) +with_stmt: 'with' with_item (',' with_item)* ':' suite +with_item: test ['as' expr] +# NB compile.c makes sure that the default except clause is last +except_clause: 'except' [test ['as' NAME]] +suite: simple_stmt | NEWLINE INDENT stmt+ DEDENT + +test: or_test ['if' or_test 'else' test] | lambdef +test_nocond: or_test | lambdef_nocond +lambdef: 'lambda' [varargslist] ':' test +lambdef_nocond: 'lambda' [varargslist] ':' test_nocond +or_test: and_test ('or' and_test)* +and_test: not_test ('and' not_test)* +not_test: 'not' not_test | comparison +comparison: expr (comp_op expr)* +# <> isn't actually a valid comparison operator in Python. It's here for the +# sake of a __future__ import described in PEP 401 +comp_op: '<'|'>'|'=='|'>='|'<='|'<>'|'!='|'in'|'not' 'in'|'is'|'is' 'not' +star_expr: '*' expr +expr: xor_expr ('|' xor_expr)* +xor_expr: and_expr ('^' and_expr)* +and_expr: shift_expr ('&' shift_expr)* +shift_expr: arith_expr (('<<'|'>>') arith_expr)* +arith_expr: term (('+'|'-') term)* +term: factor (('*'|'/'|'%'|'//') factor)* +factor: ('+'|'-'|'~') factor | power +power: atom trailer* ['**' factor] +atom: ('(' [yield_expr|testlist_comp] ')' | + '[' [testlist_comp] ']' | + '{' [dictorsetmaker] '}' | + NAME | NUMBER | strings | '...' | 'None' | 'True' | 'False') +strings: STRING+ +testlist_comp: (test|star_expr) ( sync_comp_for | (',' (test|star_expr))* [','] ) +trailer: '(' [arglist] ')' | '[' subscriptlist ']' | '.' NAME +subscriptlist: subscript (',' subscript)* [','] +subscript: test | [test] ':' [test] [sliceop] +sliceop: ':' [test] +exprlist: (expr|star_expr) (',' (expr|star_expr))* [','] +testlist: test (',' test)* [','] +dictorsetmaker: ( (test ':' test (sync_comp_for | (',' test ':' test)* [','])) | + (test (sync_comp_for | (',' test)* [','])) ) + +classdef: 'class' NAME ['(' [arglist] ')'] ':' suite + +arglist: (argument ',')* (argument [','] + |'*' test (',' argument)* [',' '**' test] + |'**' test) +# The reason that keywords are test nodes instead of NAME is that using NAME +# results in an ambiguity. ast.c makes sure it's a NAME. +argument: test [sync_comp_for] | test '=' test # Really [keyword '='] test +comp_iter: sync_comp_for | comp_if +sync_comp_for: 'for' exprlist 'in' or_test [comp_iter] +comp_if: 'if' test_nocond [comp_iter] + +# not used in grammar, but may appear in "node" passed from Parser to Compiler +encoding_decl: NAME + +yield_expr: 'yield' [yield_arg] +yield_arg: 'from' test | testlist diff --git a/vim/bundle/jedi-vim/pythonx/parso/parso/python/grammar34.txt b/vim/bundle/jedi-vim/pythonx/parso/parso/python/grammar34.txt new file mode 100644 index 0000000..2b497d5 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/parso/python/grammar34.txt @@ -0,0 +1,134 @@ +# Grammar for Python + +# Note: Changing the grammar specified in this file will most likely +# require corresponding changes in the parser module +# (../Modules/parsermodule.c). If you can't make the changes to +# that module yourself, please co-ordinate the required changes +# with someone who can; ask around on python-dev for help. Fred +# Drake will probably be listening there. + +# NOTE WELL: You should also follow all the steps listed at +# https://docs.python.org/devguide/grammar.html + +# Start symbols for the grammar: +# single_input is a single interactive statement; +# file_input is a module or sequence of commands read from an input file; +# eval_input is the input for the eval() functions. +# NB: compound_stmt in single_input is followed by extra NEWLINE! +single_input: NEWLINE | simple_stmt | compound_stmt NEWLINE +file_input: (NEWLINE | stmt)* ENDMARKER +eval_input: testlist NEWLINE* ENDMARKER + +decorator: '@' dotted_name [ '(' [arglist] ')' ] NEWLINE +decorators: decorator+ +decorated: decorators (classdef | funcdef) +funcdef: 'def' NAME parameters ['->' test] ':' suite +parameters: '(' [typedargslist] ')' +typedargslist: (tfpdef ['=' test] (',' tfpdef ['=' test])* [',' + ['*' [tfpdef] (',' tfpdef ['=' test])* [',' '**' tfpdef] | '**' tfpdef]] + | '*' [tfpdef] (',' tfpdef ['=' test])* [',' '**' tfpdef] | '**' tfpdef) +tfpdef: NAME [':' test] +varargslist: (vfpdef ['=' test] (',' vfpdef ['=' test])* [',' + ['*' [vfpdef] (',' vfpdef ['=' test])* [',' '**' vfpdef] | '**' vfpdef]] + | '*' [vfpdef] (',' vfpdef ['=' test])* [',' '**' vfpdef] | '**' vfpdef) +vfpdef: NAME + +stmt: simple_stmt | compound_stmt +simple_stmt: small_stmt (';' small_stmt)* [';'] NEWLINE +small_stmt: (expr_stmt | del_stmt | pass_stmt | flow_stmt | + import_stmt | global_stmt | nonlocal_stmt | assert_stmt) +expr_stmt: testlist_star_expr (augassign (yield_expr|testlist) | + ('=' (yield_expr|testlist_star_expr))*) +testlist_star_expr: (test|star_expr) (',' (test|star_expr))* [','] +augassign: ('+=' | '-=' | '*=' | '/=' | '%=' | '&=' | '|=' | '^=' | + '<<=' | '>>=' | '**=' | '//=') +# For normal assignments, additional restrictions enforced by the interpreter +del_stmt: 'del' exprlist +pass_stmt: 'pass' +flow_stmt: break_stmt | continue_stmt | return_stmt | raise_stmt | yield_stmt +break_stmt: 'break' +continue_stmt: 'continue' +return_stmt: 'return' [testlist] +yield_stmt: yield_expr +raise_stmt: 'raise' [test ['from' test]] +import_stmt: import_name | import_from +import_name: 'import' dotted_as_names +# note below: the ('.' | '...') is necessary because '...' is tokenized as ELLIPSIS +import_from: ('from' (('.' | '...')* dotted_name | ('.' | '...')+) + 'import' ('*' | '(' import_as_names ')' | import_as_names)) +import_as_name: NAME ['as' NAME] +dotted_as_name: dotted_name ['as' NAME] +import_as_names: import_as_name (',' import_as_name)* [','] +dotted_as_names: dotted_as_name (',' dotted_as_name)* +dotted_name: NAME ('.' NAME)* +global_stmt: 'global' NAME (',' NAME)* +nonlocal_stmt: 'nonlocal' NAME (',' NAME)* +assert_stmt: 'assert' test [',' test] + +compound_stmt: if_stmt | while_stmt | for_stmt | try_stmt | with_stmt | funcdef | classdef | decorated +if_stmt: 'if' test ':' suite ('elif' test ':' suite)* ['else' ':' suite] +while_stmt: 'while' test ':' suite ['else' ':' suite] +for_stmt: 'for' exprlist 'in' testlist ':' suite ['else' ':' suite] +try_stmt: ('try' ':' suite + ((except_clause ':' suite)+ + ['else' ':' suite] + ['finally' ':' suite] | + 'finally' ':' suite)) +with_stmt: 'with' with_item (',' with_item)* ':' suite +with_item: test ['as' expr] +# NB compile.c makes sure that the default except clause is last +except_clause: 'except' [test ['as' NAME]] +suite: simple_stmt | NEWLINE INDENT stmt+ DEDENT + +test: or_test ['if' or_test 'else' test] | lambdef +test_nocond: or_test | lambdef_nocond +lambdef: 'lambda' [varargslist] ':' test +lambdef_nocond: 'lambda' [varargslist] ':' test_nocond +or_test: and_test ('or' and_test)* +and_test: not_test ('and' not_test)* +not_test: 'not' not_test | comparison +comparison: expr (comp_op expr)* +# <> isn't actually a valid comparison operator in Python. It's here for the +# sake of a __future__ import described in PEP 401 +comp_op: '<'|'>'|'=='|'>='|'<='|'<>'|'!='|'in'|'not' 'in'|'is'|'is' 'not' +star_expr: '*' expr +expr: xor_expr ('|' xor_expr)* +xor_expr: and_expr ('^' and_expr)* +and_expr: shift_expr ('&' shift_expr)* +shift_expr: arith_expr (('<<'|'>>') arith_expr)* +arith_expr: term (('+'|'-') term)* +term: factor (('*'|'/'|'%'|'//') factor)* +factor: ('+'|'-'|'~') factor | power +power: atom trailer* ['**' factor] +atom: ('(' [yield_expr|testlist_comp] ')' | + '[' [testlist_comp] ']' | + '{' [dictorsetmaker] '}' | + NAME | NUMBER | strings | '...' | 'None' | 'True' | 'False') +strings: STRING+ +testlist_comp: (test|star_expr) ( sync_comp_for | (',' (test|star_expr))* [','] ) +trailer: '(' [arglist] ')' | '[' subscriptlist ']' | '.' NAME +subscriptlist: subscript (',' subscript)* [','] +subscript: test | [test] ':' [test] [sliceop] +sliceop: ':' [test] +exprlist: (expr|star_expr) (',' (expr|star_expr))* [','] +testlist: test (',' test)* [','] +dictorsetmaker: ( (test ':' test (sync_comp_for | (',' test ':' test)* [','])) | + (test (sync_comp_for | (',' test)* [','])) ) + +classdef: 'class' NAME ['(' [arglist] ')'] ':' suite + +arglist: (argument ',')* (argument [','] + |'*' test (',' argument)* [',' '**' test] + |'**' test) +# The reason that keywords are test nodes instead of NAME is that using NAME +# results in an ambiguity. ast.c makes sure it's a NAME. +argument: test [sync_comp_for] | test '=' test # Really [keyword '='] test +comp_iter: sync_comp_for | comp_if +sync_comp_for: 'for' exprlist 'in' or_test [comp_iter] +comp_if: 'if' test_nocond [comp_iter] + +# not used in grammar, but may appear in "node" passed from Parser to Compiler +encoding_decl: NAME + +yield_expr: 'yield' [yield_arg] +yield_arg: 'from' test | testlist diff --git a/vim/bundle/jedi-vim/pythonx/parso/parso/python/grammar35.txt b/vim/bundle/jedi-vim/pythonx/parso/parso/python/grammar35.txt new file mode 100644 index 0000000..e2ee9c7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/parso/python/grammar35.txt @@ -0,0 +1,153 @@ +# Grammar for Python + +# Note: Changing the grammar specified in this file will most likely +# require corresponding changes in the parser module +# (../Modules/parsermodule.c). If you can't make the changes to +# that module yourself, please co-ordinate the required changes +# with someone who can; ask around on python-dev for help. Fred +# Drake will probably be listening there. + +# NOTE WELL: You should also follow all the steps listed at +# https://docs.python.org/devguide/grammar.html + +# Start symbols for the grammar: +# single_input is a single interactive statement; +# file_input is a module or sequence of commands read from an input file; +# eval_input is the input for the eval() functions. +# NB: compound_stmt in single_input is followed by extra NEWLINE! +single_input: NEWLINE | simple_stmt | compound_stmt NEWLINE +file_input: (NEWLINE | stmt)* ENDMARKER +eval_input: testlist NEWLINE* ENDMARKER + +decorator: '@' dotted_name [ '(' [arglist] ')' ] NEWLINE +decorators: decorator+ +decorated: decorators (classdef | funcdef | async_funcdef) + +# NOTE: Reinoud Elhorst, using ASYNC/AWAIT keywords instead of tokens +# skipping python3.5 compatibility, in favour of 3.7 solution +async_funcdef: 'async' funcdef +funcdef: 'def' NAME parameters ['->' test] ':' suite + +parameters: '(' [typedargslist] ')' +typedargslist: (tfpdef ['=' test] (',' tfpdef ['=' test])* [',' + ['*' [tfpdef] (',' tfpdef ['=' test])* [',' '**' tfpdef] | '**' tfpdef]] + | '*' [tfpdef] (',' tfpdef ['=' test])* [',' '**' tfpdef] | '**' tfpdef) +tfpdef: NAME [':' test] +varargslist: (vfpdef ['=' test] (',' vfpdef ['=' test])* [',' + ['*' [vfpdef] (',' vfpdef ['=' test])* [',' '**' vfpdef] | '**' vfpdef]] + | '*' [vfpdef] (',' vfpdef ['=' test])* [',' '**' vfpdef] | '**' vfpdef) +vfpdef: NAME + +stmt: simple_stmt | compound_stmt +simple_stmt: small_stmt (';' small_stmt)* [';'] NEWLINE +small_stmt: (expr_stmt | del_stmt | pass_stmt | flow_stmt | + import_stmt | global_stmt | nonlocal_stmt | assert_stmt) +expr_stmt: testlist_star_expr (augassign (yield_expr|testlist) | + ('=' (yield_expr|testlist_star_expr))*) +testlist_star_expr: (test|star_expr) (',' (test|star_expr))* [','] +augassign: ('+=' | '-=' | '*=' | '@=' | '/=' | '%=' | '&=' | '|=' | '^=' | + '<<=' | '>>=' | '**=' | '//=') +# For normal assignments, additional restrictions enforced by the interpreter +del_stmt: 'del' exprlist +pass_stmt: 'pass' +flow_stmt: break_stmt | continue_stmt | return_stmt | raise_stmt | yield_stmt +break_stmt: 'break' +continue_stmt: 'continue' +return_stmt: 'return' [testlist] +yield_stmt: yield_expr +raise_stmt: 'raise' [test ['from' test]] +import_stmt: import_name | import_from +import_name: 'import' dotted_as_names +# note below: the ('.' | '...') is necessary because '...' is tokenized as ELLIPSIS +import_from: ('from' (('.' | '...')* dotted_name | ('.' | '...')+) + 'import' ('*' | '(' import_as_names ')' | import_as_names)) +import_as_name: NAME ['as' NAME] +dotted_as_name: dotted_name ['as' NAME] +import_as_names: import_as_name (',' import_as_name)* [','] +dotted_as_names: dotted_as_name (',' dotted_as_name)* +dotted_name: NAME ('.' NAME)* +global_stmt: 'global' NAME (',' NAME)* +nonlocal_stmt: 'nonlocal' NAME (',' NAME)* +assert_stmt: 'assert' test [',' test] + +compound_stmt: if_stmt | while_stmt | for_stmt | try_stmt | with_stmt | funcdef | classdef | decorated | async_stmt +async_stmt: 'async' (funcdef | with_stmt | for_stmt) +if_stmt: 'if' test ':' suite ('elif' test ':' suite)* ['else' ':' suite] +while_stmt: 'while' test ':' suite ['else' ':' suite] +for_stmt: 'for' exprlist 'in' testlist ':' suite ['else' ':' suite] +try_stmt: ('try' ':' suite + ((except_clause ':' suite)+ + ['else' ':' suite] + ['finally' ':' suite] | + 'finally' ':' suite)) +with_stmt: 'with' with_item (',' with_item)* ':' suite +with_item: test ['as' expr] +# NB compile.c makes sure that the default except clause is last +except_clause: 'except' [test ['as' NAME]] +suite: simple_stmt | NEWLINE INDENT stmt+ DEDENT + +test: or_test ['if' or_test 'else' test] | lambdef +test_nocond: or_test | lambdef_nocond +lambdef: 'lambda' [varargslist] ':' test +lambdef_nocond: 'lambda' [varargslist] ':' test_nocond +or_test: and_test ('or' and_test)* +and_test: not_test ('and' not_test)* +not_test: 'not' not_test | comparison +comparison: expr (comp_op expr)* +# <> isn't actually a valid comparison operator in Python. It's here for the +# sake of a __future__ import described in PEP 401 (which really works :-) +comp_op: '<'|'>'|'=='|'>='|'<='|'<>'|'!='|'in'|'not' 'in'|'is'|'is' 'not' +star_expr: '*' expr +expr: xor_expr ('|' xor_expr)* +xor_expr: and_expr ('^' and_expr)* +and_expr: shift_expr ('&' shift_expr)* +shift_expr: arith_expr (('<<'|'>>') arith_expr)* +arith_expr: term (('+'|'-') term)* +term: factor (('*'|'@'|'/'|'%'|'//') factor)* +factor: ('+'|'-'|'~') factor | power +power: atom_expr ['**' factor] +atom_expr: ['await'] atom trailer* +atom: ('(' [yield_expr|testlist_comp] ')' | + '[' [testlist_comp] ']' | + '{' [dictorsetmaker] '}' | + NAME | NUMBER | strings | '...' | 'None' | 'True' | 'False') +strings: STRING+ +testlist_comp: (test|star_expr) ( sync_comp_for | (',' (test|star_expr))* [','] ) +trailer: '(' [arglist] ')' | '[' subscriptlist ']' | '.' NAME +subscriptlist: subscript (',' subscript)* [','] +subscript: test | [test] ':' [test] [sliceop] +sliceop: ':' [test] +exprlist: (expr|star_expr) (',' (expr|star_expr))* [','] +testlist: test (',' test)* [','] +dictorsetmaker: ( ((test ':' test | '**' expr) + (sync_comp_for | (',' (test ':' test | '**' expr))* [','])) | + ((test | star_expr) + (sync_comp_for | (',' (test | star_expr))* [','])) ) + +classdef: 'class' NAME ['(' [arglist] ')'] ':' suite + +arglist: argument (',' argument)* [','] + +# The reason that keywords are test nodes instead of NAME is that using NAME +# results in an ambiguity. ast.c makes sure it's a NAME. +# "test '=' test" is really "keyword '=' test", but we have no such token. +# These need to be in a single rule to avoid grammar that is ambiguous +# to our LL(1) parser. Even though 'test' includes '*expr' in star_expr, +# we explicitly match '*' here, too, to give it proper precedence. +# Illegal combinations and orderings are blocked in ast.c: +# multiple (test comp_for) arguments are blocked; keyword unpackings +# that precede iterable unpackings are blocked; etc. +argument: ( test [sync_comp_for] | + test '=' test | + '**' test | + '*' test ) + +comp_iter: sync_comp_for | comp_if +sync_comp_for: 'for' exprlist 'in' or_test [comp_iter] +comp_if: 'if' test_nocond [comp_iter] + +# not used in grammar, but may appear in "node" passed from Parser to Compiler +encoding_decl: NAME + +yield_expr: 'yield' [yield_arg] +yield_arg: 'from' test | testlist diff --git a/vim/bundle/jedi-vim/pythonx/parso/parso/python/grammar36.txt b/vim/bundle/jedi-vim/pythonx/parso/parso/python/grammar36.txt new file mode 100644 index 0000000..3e1e3e2 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/parso/python/grammar36.txt @@ -0,0 +1,158 @@ +# Grammar for Python + +# NOTE WELL: You should also follow all the steps listed at +# https://docs.python.org/devguide/grammar.html + +# Start symbols for the grammar: +# single_input is a single interactive statement; +# file_input is a module or sequence of commands read from an input file; +# eval_input is the input for the eval() functions. +# NB: compound_stmt in single_input is followed by extra NEWLINE! +single_input: NEWLINE | simple_stmt | compound_stmt NEWLINE +file_input: (NEWLINE | stmt)* ENDMARKER +eval_input: testlist NEWLINE* ENDMARKER +decorator: '@' dotted_name [ '(' [arglist] ')' ] NEWLINE +decorators: decorator+ +decorated: decorators (classdef | funcdef | async_funcdef) + +# NOTE: Francisco Souza/Reinoud Elhorst, using ASYNC/'await' keywords instead of +# skipping python3.5+ compatibility, in favour of 3.7 solution +async_funcdef: 'async' funcdef +funcdef: 'def' NAME parameters ['->' test] ':' suite + +parameters: '(' [typedargslist] ')' +typedargslist: (tfpdef ['=' test] (',' tfpdef ['=' test])* [',' [ + '*' [tfpdef] (',' tfpdef ['=' test])* [',' ['**' tfpdef [',']]] + | '**' tfpdef [',']]] + | '*' [tfpdef] (',' tfpdef ['=' test])* [',' ['**' tfpdef [',']]] + | '**' tfpdef [',']) +tfpdef: NAME [':' test] +varargslist: (vfpdef ['=' test] (',' vfpdef ['=' test])* [',' [ + '*' [vfpdef] (',' vfpdef ['=' test])* [',' ['**' vfpdef [',']]] + | '**' vfpdef [',']]] + | '*' [vfpdef] (',' vfpdef ['=' test])* [',' ['**' vfpdef [',']]] + | '**' vfpdef [','] +) +vfpdef: NAME + +stmt: simple_stmt | compound_stmt +simple_stmt: small_stmt (';' small_stmt)* [';'] NEWLINE +small_stmt: (expr_stmt | del_stmt | pass_stmt | flow_stmt | + import_stmt | global_stmt | nonlocal_stmt | assert_stmt) +expr_stmt: testlist_star_expr (annassign | augassign (yield_expr|testlist) | + ('=' (yield_expr|testlist_star_expr))*) +annassign: ':' test ['=' test] +testlist_star_expr: (test|star_expr) (',' (test|star_expr))* [','] +augassign: ('+=' | '-=' | '*=' | '@=' | '/=' | '%=' | '&=' | '|=' | '^=' | + '<<=' | '>>=' | '**=' | '//=') +# For normal and annotated assignments, additional restrictions enforced by the interpreter +del_stmt: 'del' exprlist +pass_stmt: 'pass' +flow_stmt: break_stmt | continue_stmt | return_stmt | raise_stmt | yield_stmt +break_stmt: 'break' +continue_stmt: 'continue' +return_stmt: 'return' [testlist] +yield_stmt: yield_expr +raise_stmt: 'raise' [test ['from' test]] +import_stmt: import_name | import_from +import_name: 'import' dotted_as_names +# note below: the ('.' | '...') is necessary because '...' is tokenized as ELLIPSIS +import_from: ('from' (('.' | '...')* dotted_name | ('.' | '...')+) + 'import' ('*' | '(' import_as_names ')' | import_as_names)) +import_as_name: NAME ['as' NAME] +dotted_as_name: dotted_name ['as' NAME] +import_as_names: import_as_name (',' import_as_name)* [','] +dotted_as_names: dotted_as_name (',' dotted_as_name)* +dotted_name: NAME ('.' NAME)* +global_stmt: 'global' NAME (',' NAME)* +nonlocal_stmt: 'nonlocal' NAME (',' NAME)* +assert_stmt: 'assert' test [',' test] + +compound_stmt: if_stmt | while_stmt | for_stmt | try_stmt | with_stmt | funcdef | classdef | decorated | async_stmt +async_stmt: 'async' (funcdef | with_stmt | for_stmt) +if_stmt: 'if' test ':' suite ('elif' test ':' suite)* ['else' ':' suite] +while_stmt: 'while' test ':' suite ['else' ':' suite] +for_stmt: 'for' exprlist 'in' testlist ':' suite ['else' ':' suite] +try_stmt: ('try' ':' suite + ((except_clause ':' suite)+ + ['else' ':' suite] + ['finally' ':' suite] | + 'finally' ':' suite)) +with_stmt: 'with' with_item (',' with_item)* ':' suite +with_item: test ['as' expr] +# NB compile.c makes sure that the default except clause is last +except_clause: 'except' [test ['as' NAME]] +suite: simple_stmt | NEWLINE INDENT stmt+ DEDENT + +test: or_test ['if' or_test 'else' test] | lambdef +test_nocond: or_test | lambdef_nocond +lambdef: 'lambda' [varargslist] ':' test +lambdef_nocond: 'lambda' [varargslist] ':' test_nocond +or_test: and_test ('or' and_test)* +and_test: not_test ('and' not_test)* +not_test: 'not' not_test | comparison +comparison: expr (comp_op expr)* +# <> isn't actually a valid comparison operator in Python. It's here for the +# sake of a __future__ import described in PEP 401 (which really works :-) +comp_op: '<'|'>'|'=='|'>='|'<='|'<>'|'!='|'in'|'not' 'in'|'is'|'is' 'not' +star_expr: '*' expr +expr: xor_expr ('|' xor_expr)* +xor_expr: and_expr ('^' and_expr)* +and_expr: shift_expr ('&' shift_expr)* +shift_expr: arith_expr (('<<'|'>>') arith_expr)* +arith_expr: term (('+'|'-') term)* +term: factor (('*'|'@'|'/'|'%'|'//') factor)* +factor: ('+'|'-'|'~') factor | power +power: atom_expr ['**' factor] +atom_expr: ['await'] atom trailer* +atom: ('(' [yield_expr|testlist_comp] ')' | + '[' [testlist_comp] ']' | + '{' [dictorsetmaker] '}' | + NAME | NUMBER | strings | '...' | 'None' | 'True' | 'False') +testlist_comp: (test|star_expr) ( comp_for | (',' (test|star_expr))* [','] ) +trailer: '(' [arglist] ')' | '[' subscriptlist ']' | '.' NAME +subscriptlist: subscript (',' subscript)* [','] +subscript: test | [test] ':' [test] [sliceop] +sliceop: ':' [test] +exprlist: (expr|star_expr) (',' (expr|star_expr))* [','] +testlist: test (',' test)* [','] +dictorsetmaker: ( ((test ':' test | '**' expr) + (comp_for | (',' (test ':' test | '**' expr))* [','])) | + ((test | star_expr) + (comp_for | (',' (test | star_expr))* [','])) ) + +classdef: 'class' NAME ['(' [arglist] ')'] ':' suite + +arglist: argument (',' argument)* [','] + +# The reason that keywords are test nodes instead of NAME is that using NAME +# results in an ambiguity. ast.c makes sure it's a NAME. +# "test '=' test" is really "keyword '=' test", but we have no such token. +# These need to be in a single rule to avoid grammar that is ambiguous +# to our LL(1) parser. Even though 'test' includes '*expr' in star_expr, +# we explicitly match '*' here, too, to give it proper precedence. +# Illegal combinations and orderings are blocked in ast.c: +# multiple (test comp_for) arguments are blocked; keyword unpackings +# that precede iterable unpackings are blocked; etc. +argument: ( test [comp_for] | + test '=' test | + '**' test | + '*' test ) + +comp_iter: comp_for | comp_if +sync_comp_for: 'for' exprlist 'in' or_test [comp_iter] +comp_for: ['async'] sync_comp_for +comp_if: 'if' test_nocond [comp_iter] + +# not used in grammar, but may appear in "node" passed from Parser to Compiler +encoding_decl: NAME + +yield_expr: 'yield' [yield_arg] +yield_arg: 'from' test | testlist + +strings: (STRING | fstring)+ +fstring: FSTRING_START fstring_content* FSTRING_END +fstring_content: FSTRING_STRING | fstring_expr +fstring_conversion: '!' NAME +fstring_expr: '{' testlist_comp [ fstring_conversion ] [ fstring_format_spec ] '}' +fstring_format_spec: ':' fstring_content* diff --git a/vim/bundle/jedi-vim/pythonx/parso/parso/python/grammar37.txt b/vim/bundle/jedi-vim/pythonx/parso/parso/python/grammar37.txt new file mode 100644 index 0000000..3090b93 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/parso/python/grammar37.txt @@ -0,0 +1,156 @@ +# Grammar for Python + +# NOTE WELL: You should also follow all the steps listed at +# https://docs.python.org/devguide/grammar.html + +# Start symbols for the grammar: +# single_input is a single interactive statement; +# file_input is a module or sequence of commands read from an input file; +# eval_input is the input for the eval() functions. +# NB: compound_stmt in single_input is followed by extra NEWLINE! +single_input: NEWLINE | simple_stmt | compound_stmt NEWLINE +file_input: (NEWLINE | stmt)* ENDMARKER +eval_input: testlist NEWLINE* ENDMARKER +decorator: '@' dotted_name [ '(' [arglist] ')' ] NEWLINE +decorators: decorator+ +decorated: decorators (classdef | funcdef | async_funcdef) + +async_funcdef: 'async' funcdef +funcdef: 'def' NAME parameters ['->' test] ':' suite + +parameters: '(' [typedargslist] ')' +typedargslist: (tfpdef ['=' test] (',' tfpdef ['=' test])* [',' [ + '*' [tfpdef] (',' tfpdef ['=' test])* [',' ['**' tfpdef [',']]] + | '**' tfpdef [',']]] + | '*' [tfpdef] (',' tfpdef ['=' test])* [',' ['**' tfpdef [',']]] + | '**' tfpdef [',']) +tfpdef: NAME [':' test] +varargslist: (vfpdef ['=' test] (',' vfpdef ['=' test])* [',' [ + '*' [vfpdef] (',' vfpdef ['=' test])* [',' ['**' vfpdef [',']]] + | '**' vfpdef [',']]] + | '*' [vfpdef] (',' vfpdef ['=' test])* [',' ['**' vfpdef [',']]] + | '**' vfpdef [','] +) +vfpdef: NAME + +stmt: simple_stmt | compound_stmt +simple_stmt: small_stmt (';' small_stmt)* [';'] NEWLINE +small_stmt: (expr_stmt | del_stmt | pass_stmt | flow_stmt | + import_stmt | global_stmt | nonlocal_stmt | assert_stmt) +expr_stmt: testlist_star_expr (annassign | augassign (yield_expr|testlist) | + ('=' (yield_expr|testlist_star_expr))*) +annassign: ':' test ['=' test] +testlist_star_expr: (test|star_expr) (',' (test|star_expr))* [','] +augassign: ('+=' | '-=' | '*=' | '@=' | '/=' | '%=' | '&=' | '|=' | '^=' | + '<<=' | '>>=' | '**=' | '//=') +# For normal and annotated assignments, additional restrictions enforced by the interpreter +del_stmt: 'del' exprlist +pass_stmt: 'pass' +flow_stmt: break_stmt | continue_stmt | return_stmt | raise_stmt | yield_stmt +break_stmt: 'break' +continue_stmt: 'continue' +return_stmt: 'return' [testlist] +yield_stmt: yield_expr +raise_stmt: 'raise' [test ['from' test]] +import_stmt: import_name | import_from +import_name: 'import' dotted_as_names +# note below: the ('.' | '...') is necessary because '...' is tokenized as ELLIPSIS +import_from: ('from' (('.' | '...')* dotted_name | ('.' | '...')+) + 'import' ('*' | '(' import_as_names ')' | import_as_names)) +import_as_name: NAME ['as' NAME] +dotted_as_name: dotted_name ['as' NAME] +import_as_names: import_as_name (',' import_as_name)* [','] +dotted_as_names: dotted_as_name (',' dotted_as_name)* +dotted_name: NAME ('.' NAME)* +global_stmt: 'global' NAME (',' NAME)* +nonlocal_stmt: 'nonlocal' NAME (',' NAME)* +assert_stmt: 'assert' test [',' test] + +compound_stmt: if_stmt | while_stmt | for_stmt | try_stmt | with_stmt | funcdef | classdef | decorated | async_stmt +async_stmt: 'async' (funcdef | with_stmt | for_stmt) +if_stmt: 'if' test ':' suite ('elif' test ':' suite)* ['else' ':' suite] +while_stmt: 'while' test ':' suite ['else' ':' suite] +for_stmt: 'for' exprlist 'in' testlist ':' suite ['else' ':' suite] +try_stmt: ('try' ':' suite + ((except_clause ':' suite)+ + ['else' ':' suite] + ['finally' ':' suite] | + 'finally' ':' suite)) +with_stmt: 'with' with_item (',' with_item)* ':' suite +with_item: test ['as' expr] +# NB compile.c makes sure that the default except clause is last +except_clause: 'except' [test ['as' NAME]] +suite: simple_stmt | NEWLINE INDENT stmt+ DEDENT + +test: or_test ['if' or_test 'else' test] | lambdef +test_nocond: or_test | lambdef_nocond +lambdef: 'lambda' [varargslist] ':' test +lambdef_nocond: 'lambda' [varargslist] ':' test_nocond +or_test: and_test ('or' and_test)* +and_test: not_test ('and' not_test)* +not_test: 'not' not_test | comparison +comparison: expr (comp_op expr)* +# <> isn't actually a valid comparison operator in Python. It's here for the +# sake of a __future__ import described in PEP 401 (which really works :-) +comp_op: '<'|'>'|'=='|'>='|'<='|'<>'|'!='|'in'|'not' 'in'|'is'|'is' 'not' +star_expr: '*' expr +expr: xor_expr ('|' xor_expr)* +xor_expr: and_expr ('^' and_expr)* +and_expr: shift_expr ('&' shift_expr)* +shift_expr: arith_expr (('<<'|'>>') arith_expr)* +arith_expr: term (('+'|'-') term)* +term: factor (('*'|'@'|'/'|'%'|'//') factor)* +factor: ('+'|'-'|'~') factor | power +power: atom_expr ['**' factor] +atom_expr: ['await'] atom trailer* +atom: ('(' [yield_expr|testlist_comp] ')' | + '[' [testlist_comp] ']' | + '{' [dictorsetmaker] '}' | + NAME | NUMBER | strings | '...' | 'None' | 'True' | 'False') +testlist_comp: (test|star_expr) ( comp_for | (',' (test|star_expr))* [','] ) +trailer: '(' [arglist] ')' | '[' subscriptlist ']' | '.' NAME +subscriptlist: subscript (',' subscript)* [','] +subscript: test | [test] ':' [test] [sliceop] +sliceop: ':' [test] +exprlist: (expr|star_expr) (',' (expr|star_expr))* [','] +testlist: test (',' test)* [','] +dictorsetmaker: ( ((test ':' test | '**' expr) + (comp_for | (',' (test ':' test | '**' expr))* [','])) | + ((test | star_expr) + (comp_for | (',' (test | star_expr))* [','])) ) + +classdef: 'class' NAME ['(' [arglist] ')'] ':' suite + +arglist: argument (',' argument)* [','] + +# The reason that keywords are test nodes instead of NAME is that using NAME +# results in an ambiguity. ast.c makes sure it's a NAME. +# "test '=' test" is really "keyword '=' test", but we have no such token. +# These need to be in a single rule to avoid grammar that is ambiguous +# to our LL(1) parser. Even though 'test' includes '*expr' in star_expr, +# we explicitly match '*' here, too, to give it proper precedence. +# Illegal combinations and orderings are blocked in ast.c: +# multiple (test comp_for) arguments are blocked; keyword unpackings +# that precede iterable unpackings are blocked; etc. +argument: ( test [comp_for] | + test '=' test | + '**' test | + '*' test ) + +comp_iter: comp_for | comp_if +sync_comp_for: 'for' exprlist 'in' or_test [comp_iter] +comp_for: ['async'] sync_comp_for +comp_if: 'if' test_nocond [comp_iter] + +# not used in grammar, but may appear in "node" passed from Parser to Compiler +encoding_decl: NAME + +yield_expr: 'yield' [yield_arg] +yield_arg: 'from' test | testlist + +strings: (STRING | fstring)+ +fstring: FSTRING_START fstring_content* FSTRING_END +fstring_content: FSTRING_STRING | fstring_expr +fstring_conversion: '!' NAME +fstring_expr: '{' testlist [ fstring_conversion ] [ fstring_format_spec ] '}' +fstring_format_spec: ':' fstring_content* diff --git a/vim/bundle/jedi-vim/pythonx/parso/parso/python/grammar38.txt b/vim/bundle/jedi-vim/pythonx/parso/parso/python/grammar38.txt new file mode 100644 index 0000000..1cea0fa --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/parso/python/grammar38.txt @@ -0,0 +1,171 @@ +# Grammar for Python + +# NOTE WELL: You should also follow all the steps listed at +# https://devguide.python.org/grammar/ + +# Start symbols for the grammar: +# single_input is a single interactive statement; +# file_input is a module or sequence of commands read from an input file; +# eval_input is the input for the eval() functions. +# NB: compound_stmt in single_input is followed by extra NEWLINE! +single_input: NEWLINE | simple_stmt | compound_stmt NEWLINE +file_input: (NEWLINE | stmt)* ENDMARKER +eval_input: testlist NEWLINE* ENDMARKER + +decorator: '@' dotted_name [ '(' [arglist] ')' ] NEWLINE +decorators: decorator+ +decorated: decorators (classdef | funcdef | async_funcdef) + +async_funcdef: 'async' funcdef +funcdef: 'def' NAME parameters ['->' test] ':' suite + +parameters: '(' [typedargslist] ')' +typedargslist: ( + (tfpdef ['=' test] (',' tfpdef ['=' test])* ',' '/' [',' [ tfpdef ['=' test] ( + ',' tfpdef ['=' test])* ([',' [ + '*' [tfpdef] (',' tfpdef ['=' test])* [',' ['**' tfpdef [',']]] + | '**' tfpdef [',']]]) + | '*' [tfpdef] (',' tfpdef ['=' test])* ([',' ['**' tfpdef [',']]]) + | '**' tfpdef [',']]] ) +| (tfpdef ['=' test] (',' tfpdef ['=' test])* [',' [ + '*' [tfpdef] (',' tfpdef ['=' test])* [',' ['**' tfpdef [',']]] + | '**' tfpdef [',']]] + | '*' [tfpdef] (',' tfpdef ['=' test])* [',' ['**' tfpdef [',']]] + | '**' tfpdef [',']) +) +tfpdef: NAME [':' test] +varargslist: vfpdef ['=' test ](',' vfpdef ['=' test])* ',' '/' [',' [ (vfpdef ['=' test] (',' vfpdef ['=' test])* [',' [ + '*' [vfpdef] (',' vfpdef ['=' test])* [',' ['**' vfpdef [',']]] + | '**' vfpdef [',']]] + | '*' [vfpdef] (',' vfpdef ['=' test])* [',' ['**' vfpdef [',']]] + | '**' vfpdef [',']) ]] | (vfpdef ['=' test] (',' vfpdef ['=' test])* [',' [ + '*' [vfpdef] (',' vfpdef ['=' test])* [',' ['**' vfpdef [',']]] + | '**' vfpdef [',']]] + | '*' [vfpdef] (',' vfpdef ['=' test])* [',' ['**' vfpdef [',']]] + | '**' vfpdef [','] +) +vfpdef: NAME + +stmt: simple_stmt | compound_stmt +simple_stmt: small_stmt (';' small_stmt)* [';'] NEWLINE +small_stmt: (expr_stmt | del_stmt | pass_stmt | flow_stmt | + import_stmt | global_stmt | nonlocal_stmt | assert_stmt) +expr_stmt: testlist_star_expr (annassign | augassign (yield_expr|testlist) | + ('=' (yield_expr|testlist_star_expr))*) +annassign: ':' test ['=' test] +testlist_star_expr: (test|star_expr) (',' (test|star_expr))* [','] +augassign: ('+=' | '-=' | '*=' | '@=' | '/=' | '%=' | '&=' | '|=' | '^=' | + '<<=' | '>>=' | '**=' | '//=') +# For normal and annotated assignments, additional restrictions enforced by the interpreter +del_stmt: 'del' exprlist +pass_stmt: 'pass' +flow_stmt: break_stmt | continue_stmt | return_stmt | raise_stmt | yield_stmt +break_stmt: 'break' +continue_stmt: 'continue' +return_stmt: 'return' [testlist_star_expr] +yield_stmt: yield_expr +raise_stmt: 'raise' [test ['from' test]] +import_stmt: import_name | import_from +import_name: 'import' dotted_as_names +# note below: the ('.' | '...') is necessary because '...' is tokenized as ELLIPSIS +import_from: ('from' (('.' | '...')* dotted_name | ('.' | '...')+) + 'import' ('*' | '(' import_as_names ')' | import_as_names)) +import_as_name: NAME ['as' NAME] +dotted_as_name: dotted_name ['as' NAME] +import_as_names: import_as_name (',' import_as_name)* [','] +dotted_as_names: dotted_as_name (',' dotted_as_name)* +dotted_name: NAME ('.' NAME)* +global_stmt: 'global' NAME (',' NAME)* +nonlocal_stmt: 'nonlocal' NAME (',' NAME)* +assert_stmt: 'assert' test [',' test] + +compound_stmt: if_stmt | while_stmt | for_stmt | try_stmt | with_stmt | funcdef | classdef | decorated | async_stmt +async_stmt: 'async' (funcdef | with_stmt | for_stmt) +if_stmt: 'if' namedexpr_test ':' suite ('elif' namedexpr_test ':' suite)* ['else' ':' suite] +while_stmt: 'while' namedexpr_test ':' suite ['else' ':' suite] +for_stmt: 'for' exprlist 'in' testlist ':' suite ['else' ':' suite] +try_stmt: ('try' ':' suite + ((except_clause ':' suite)+ + ['else' ':' suite] + ['finally' ':' suite] | + 'finally' ':' suite)) +with_stmt: 'with' with_item (',' with_item)* ':' suite +with_item: test ['as' expr] +# NB compile.c makes sure that the default except clause is last +except_clause: 'except' [test ['as' NAME]] +suite: simple_stmt | NEWLINE INDENT stmt+ DEDENT + +namedexpr_test: test [':=' test] +test: or_test ['if' or_test 'else' test] | lambdef +test_nocond: or_test | lambdef_nocond +lambdef: 'lambda' [varargslist] ':' test +lambdef_nocond: 'lambda' [varargslist] ':' test_nocond +or_test: and_test ('or' and_test)* +and_test: not_test ('and' not_test)* +not_test: 'not' not_test | comparison +comparison: expr (comp_op expr)* +# <> isn't actually a valid comparison operator in Python. It's here for the +# sake of a __future__ import described in PEP 401 (which really works :-) +comp_op: '<'|'>'|'=='|'>='|'<='|'<>'|'!='|'in'|'not' 'in'|'is'|'is' 'not' +star_expr: '*' expr +expr: xor_expr ('|' xor_expr)* +xor_expr: and_expr ('^' and_expr)* +and_expr: shift_expr ('&' shift_expr)* +shift_expr: arith_expr (('<<'|'>>') arith_expr)* +arith_expr: term (('+'|'-') term)* +term: factor (('*'|'@'|'/'|'%'|'//') factor)* +factor: ('+'|'-'|'~') factor | power +power: atom_expr ['**' factor] +atom_expr: ['await'] atom trailer* +atom: ('(' [yield_expr|testlist_comp] ')' | + '[' [testlist_comp] ']' | + '{' [dictorsetmaker] '}' | + NAME | NUMBER | strings | '...' | 'None' | 'True' | 'False') +testlist_comp: (namedexpr_test|star_expr) ( comp_for | (',' (namedexpr_test|star_expr))* [','] ) +trailer: '(' [arglist] ')' | '[' subscriptlist ']' | '.' NAME +subscriptlist: subscript (',' subscript)* [','] +subscript: test | [test] ':' [test] [sliceop] +sliceop: ':' [test] +exprlist: (expr|star_expr) (',' (expr|star_expr))* [','] +testlist: test (',' test)* [','] +dictorsetmaker: ( ((test ':' test | '**' expr) + (comp_for | (',' (test ':' test | '**' expr))* [','])) | + ((test | star_expr) + (comp_for | (',' (test | star_expr))* [','])) ) + +classdef: 'class' NAME ['(' [arglist] ')'] ':' suite + +arglist: argument (',' argument)* [','] + +# The reason that keywords are test nodes instead of NAME is that using NAME +# results in an ambiguity. ast.c makes sure it's a NAME. +# "test '=' test" is really "keyword '=' test", but we have no such token. +# These need to be in a single rule to avoid grammar that is ambiguous +# to our LL(1) parser. Even though 'test' includes '*expr' in star_expr, +# we explicitly match '*' here, too, to give it proper precedence. +# Illegal combinations and orderings are blocked in ast.c: +# multiple (test comp_for) arguments are blocked; keyword unpackings +# that precede iterable unpackings are blocked; etc. +argument: ( test [comp_for] | + test ':=' test | + test '=' test | + '**' test | + '*' test ) + +comp_iter: comp_for | comp_if +sync_comp_for: 'for' exprlist 'in' or_test [comp_iter] +comp_for: ['async'] sync_comp_for +comp_if: 'if' test_nocond [comp_iter] + +# not used in grammar, but may appear in "node" passed from Parser to Compiler +encoding_decl: NAME + +yield_expr: 'yield' [yield_arg] +yield_arg: 'from' test | testlist_star_expr + +strings: (STRING | fstring)+ +fstring: FSTRING_START fstring_content* FSTRING_END +fstring_content: FSTRING_STRING | fstring_expr +fstring_conversion: '!' NAME +fstring_expr: '{' testlist ['='] [ fstring_conversion ] [ fstring_format_spec ] '}' +fstring_format_spec: ':' fstring_content* diff --git a/vim/bundle/jedi-vim/pythonx/parso/parso/python/issue_list.txt b/vim/bundle/jedi-vim/pythonx/parso/parso/python/issue_list.txt new file mode 100644 index 0000000..e5e2c9d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/parso/python/issue_list.txt @@ -0,0 +1,176 @@ +A list of syntax/indentation errors I've encountered in CPython. + +# Python/compile.c + "'continue' not properly in loop" + "'continue' not supported inside 'finally' clause" # Until loop + "default 'except:' must be last" + "from __future__ imports must occur at the beginning of the file" + "'return' outside function" + "'return' with value in async generator" + "'break' outside loop" + "two starred expressions in assignment" + "asynchronous comprehension outside of an asynchronous function" + "'yield' outside function" # For both yield and yield from + "'yield from' inside async function" + "'await' outside function" + "'await' outside async function" + "starred assignment target must be in a list or tuple" + "can't use starred expression here" + "too many statically nested blocks" # Max. 20 + # This is one of the few places in the cpython code base that I really + # don't understand. It feels a bit hacky if you look at the implementation + # of UNPACK_EX. + "too many expressions in star-unpacking assignment" + + # Just ignore this one, newer versions will not be affected anymore and + # it's a limit of 2^16 - 1. + "too many annotations" # Only python 3.0 - 3.5, 3.6 is not affected. + +# Python/ast.c + # used with_item exprlist expr_stmt + "can't %s %s" % ("assign to" or "delete", + "lambda" + "function call" # foo() + "generator expression" + "list comprehension" + "set comprehension" + "dict comprehension" + "keyword" + "Ellipsis" + "comparison" + Dict: Set: Num: Str: Bytes: JoinedStr: FormattedValue: + "literal" + BoolOp: BinOp: UnaryOp: + "operator" + Yield: YieldFrom: + "yield expression" + Await: + "await expression" + IfExp: + "conditional expression" + "assignment to keyword" # (keywords + __debug__) # None = 2 + "named arguments must follow bare *" # def foo(*): pass + "non-default argument follows default argument" # def f(x=3, y): pass + "iterable unpacking cannot be used in comprehension" # [*[] for a in [1]] + "dict unpacking cannot be used in dict comprehension" # {**{} for a in [1]} + "Generator expression must be parenthesized if not sole argument" # foo(x for x in [], b) + "positional argument follows keyword argument unpacking" # f(**x, y) >= 3.5 + "positional argument follows keyword argument" # f(x=2, y) >= 3.5 + "iterable argument unpacking follows keyword argument unpacking" # foo(**kwargs, *args) + "lambda cannot contain assignment" # f(lambda: 1=1) + "keyword can't be an expression" # f(+x=1) + "keyword argument repeated" # f(x=1, x=2) + "illegal expression for augmented assignment" # x, y += 1 + "only single target (not list) can be annotated" # [x, y]: int + "only single target (not tuple) can be annotated" # x, y: str + "illegal target for annotation" # True: 1` + "trailing comma not allowed without surrounding parentheses" # from foo import a, + "bytes can only contain ASCII literal characters." # b'ä' # prob. only python 3 + "cannot mix bytes and nonbytes literals" # 's' b'' + "assignment to yield expression not possible" # x = yield 1 = 3 + + "f-string: empty expression not allowed" # f'{}' + "f-string: single '}' is not allowed" # f'}' + "f-string: expressions nested too deeply" # f'{1:{5:{3}}}' + "f-string expression part cannot include a backslash" # f'{"\"}' or f'{"\\"}' + "f-string expression part cannot include '#'" # f'{#}' + "f-string: unterminated string" # f'{"}' + "f-string: mismatched '(', '{', or '['" + "f-string: invalid conversion character: expected 's', 'r', or 'a'" # f'{1!b}' + "f-string: unexpected end of string" # Doesn't really happen?! + "f-string: expecting '}'" # f'{' + "(unicode error) unknown error + "(value error) unknown error + "(unicode error) MESSAGE + MESSAGES = { + "\\ at end of string" + "truncated \\xXX escape" + "truncated \\uXXXX escape" + "truncated \\UXXXXXXXX escape" + "illegal Unicode character" # '\Uffffffff' + "malformed \\N character escape" # '\N{}' + "unknown Unicode character name" # '\N{foo}' + } + "(value error) MESSAGE # bytes + MESSAGES = { + "Trailing \\ in string" + "invalid \\x escape at position %d" + } + + "invalid escape sequence \\%c" # Only happens when used in `python -W error` + "unexpected node" # Probably irrelevant + "Unexpected node-type in from-import" # Irrelevant, doesn't happen. + "malformed 'try' statement" # Irrelevant, doesn't happen. + +# Python/symtable.c + "duplicate argument '%U' in function definition" + "name '%U' is assigned to before global declaration" + "name '%U' is assigned to before nonlocal declaration" + "name '%U' is used prior to global declaration" + "name '%U' is used prior to nonlocal declaration" + "annotated name '%U' can't be global" + "annotated name '%U' can't be nonlocal" + "import * only allowed at module level" + + "name '%U' is parameter and global", + "name '%U' is nonlocal and global", + "name '%U' is parameter and nonlocal", + + "nonlocal declaration not allowed at module level"); + "no binding for nonlocal '%U' found", + # RecursionError. Not handled. For all human written code, this is probably + # not an issue. eval("()"*x) with x>=2998 for example fails, but that's + # more than 2000 executions on one line. + "maximum recursion depth exceeded during compilation"); + +# Python/future.c + "not a chance" + "future feature %.100s is not defined" + "from __future__ imports must occur at the beginning of the file" # Also in compile.c + +# Parser/tokenizer.c + # All the following issues seem to be irrelevant for parso, because the + # encoding stuff is done before it reaches the tokenizer. It's already + # unicode at that point. + "encoding problem: %s" + "encoding problem: %s with BOM" + "Non-UTF-8 code starting with '\\x%.2x' in file %U on line %i, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details" + +# Parser/pythonrun.c + E_SYNTAX: "invalid syntax" + E_LINECONT: "unexpected character after line continuation character" + E_IDENTIFIER: "invalid character in identifier" + # Also just use 'invalid syntax'. Happens mostly with stuff like `(`. This + # message doesn't really help the user, because it only appears very + # randomly, e.g. `(or` wouldn't yield this error. + E_EOF: "unexpected EOF while parsing" + # Even in 3.6 this is implemented kind of shaky. Not implemented, I think + # cPython needs to fix this one first. + # e.g. `ast.parse('def x():\n\t if 1:\n \t \tpass')` works :/ + E_TABSPACE: "inconsistent use of tabs and spaces in indentation" + # Ignored, just shown as "invalid syntax". The error has mostly to do with + # numbers like 0b2 everywhere or 1.6_ in Python3.6. + E_TOKEN: "invalid token" + E_EOFS: "EOF while scanning triple-quoted string literal" + E_EOLS: "EOL while scanning string literal" + + # IndentationError + E_DEDENT: "unindent does not match any outer indentation level" + E_TOODEEP: "too many levels of indentation" # 100 levels + E_SYNTAX: "expected an indented block" + "unexpected indent" + # I don't think this actually ever happens. + "unexpected unindent" + + + # Irrelevant for parso for now. + E_OVERFLOW: "expression too long" + E_DECODE: "unknown decode error" + E_BADSINGLE: "multiple statements found while compiling a single statement" + + +Version specific: +Python 3.5: + 'yield' inside async function +Python 3.3/3.4: + can use starred expression only as assignment target diff --git a/vim/bundle/jedi-vim/pythonx/parso/parso/python/parser.py b/vim/bundle/jedi-vim/pythonx/parso/parso/python/parser.py new file mode 100644 index 0000000..46bdc77 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/parso/python/parser.py @@ -0,0 +1,218 @@ +from parso.python import tree +from parso.python.token import PythonTokenTypes +from parso.parser import BaseParser + + +NAME = PythonTokenTypes.NAME +INDENT = PythonTokenTypes.INDENT +DEDENT = PythonTokenTypes.DEDENT + + +class Parser(BaseParser): + """ + This class is used to parse a Python file, it then divides them into a + class structure of different scopes. + + :param pgen_grammar: The grammar object of pgen2. Loaded by load_grammar. + """ + + node_map = { + 'expr_stmt': tree.ExprStmt, + 'classdef': tree.Class, + 'funcdef': tree.Function, + 'file_input': tree.Module, + 'import_name': tree.ImportName, + 'import_from': tree.ImportFrom, + 'break_stmt': tree.KeywordStatement, + 'continue_stmt': tree.KeywordStatement, + 'return_stmt': tree.ReturnStmt, + 'raise_stmt': tree.KeywordStatement, + 'yield_expr': tree.YieldExpr, + 'del_stmt': tree.KeywordStatement, + 'pass_stmt': tree.KeywordStatement, + 'global_stmt': tree.GlobalStmt, + 'nonlocal_stmt': tree.KeywordStatement, + 'print_stmt': tree.KeywordStatement, + 'assert_stmt': tree.AssertStmt, + 'if_stmt': tree.IfStmt, + 'with_stmt': tree.WithStmt, + 'for_stmt': tree.ForStmt, + 'while_stmt': tree.WhileStmt, + 'try_stmt': tree.TryStmt, + 'sync_comp_for': tree.SyncCompFor, + # Not sure if this is the best idea, but IMO it's the easiest way to + # avoid extreme amounts of work around the subtle difference of 2/3 + # grammar in list comoprehensions. + 'list_for': tree.SyncCompFor, + # Same here. This just exists in Python 2.6. + 'gen_for': tree.SyncCompFor, + 'decorator': tree.Decorator, + 'lambdef': tree.Lambda, + 'old_lambdef': tree.Lambda, + 'lambdef_nocond': tree.Lambda, + } + default_node = tree.PythonNode + + # Names/Keywords are handled separately + _leaf_map = { + PythonTokenTypes.STRING: tree.String, + PythonTokenTypes.NUMBER: tree.Number, + PythonTokenTypes.NEWLINE: tree.Newline, + PythonTokenTypes.ENDMARKER: tree.EndMarker, + PythonTokenTypes.FSTRING_STRING: tree.FStringString, + PythonTokenTypes.FSTRING_START: tree.FStringStart, + PythonTokenTypes.FSTRING_END: tree.FStringEnd, + } + + def __init__(self, pgen_grammar, error_recovery=True, start_nonterminal='file_input'): + super(Parser, self).__init__(pgen_grammar, start_nonterminal, + error_recovery=error_recovery) + + self.syntax_errors = [] + self._omit_dedent_list = [] + self._indent_counter = 0 + + def parse(self, tokens): + if self._error_recovery: + if self._start_nonterminal != 'file_input': + raise NotImplementedError + + tokens = self._recovery_tokenize(tokens) + + return super(Parser, self).parse(tokens) + + def convert_node(self, nonterminal, children): + """ + Convert raw node information to a PythonBaseNode instance. + + This is passed to the parser driver which calls it whenever a reduction of a + grammar rule produces a new complete node, so that the tree is build + strictly bottom-up. + """ + try: + node = self.node_map[nonterminal](children) + except KeyError: + if nonterminal == 'suite': + # We don't want the INDENT/DEDENT in our parser tree. Those + # leaves are just cancer. They are virtual leaves and not real + # ones and therefore have pseudo start/end positions and no + # prefixes. Just ignore them. + children = [children[0]] + children[2:-1] + elif nonterminal == 'list_if': + # Make transitioning from 2 to 3 easier. + nonterminal = 'comp_if' + elif nonterminal == 'listmaker': + # Same as list_if above. + nonterminal = 'testlist_comp' + node = self.default_node(nonterminal, children) + for c in children: + c.parent = node + return node + + def convert_leaf(self, type, value, prefix, start_pos): + # print('leaf', repr(value), token.tok_name[type]) + if type == NAME: + if value in self._pgen_grammar.reserved_syntax_strings: + return tree.Keyword(value, start_pos, prefix) + else: + return tree.Name(value, start_pos, prefix) + + return self._leaf_map.get(type, tree.Operator)(value, start_pos, prefix) + + def error_recovery(self, token): + tos_nodes = self.stack[-1].nodes + if tos_nodes: + last_leaf = tos_nodes[-1].get_last_leaf() + else: + last_leaf = None + + if self._start_nonterminal == 'file_input' and \ + (token.type == PythonTokenTypes.ENDMARKER + or token.type == DEDENT and '\n' not in last_leaf.value + and '\r' not in last_leaf.value): + # In Python statements need to end with a newline. But since it's + # possible (and valid in Python ) that there's no newline at the + # end of a file, we have to recover even if the user doesn't want + # error recovery. + if self.stack[-1].dfa.from_rule == 'simple_stmt': + try: + plan = self.stack[-1].dfa.transitions[PythonTokenTypes.NEWLINE] + except KeyError: + pass + else: + if plan.next_dfa.is_final and not plan.dfa_pushes: + # We are ignoring here that the newline would be + # required for a simple_stmt. + self.stack[-1].dfa = plan.next_dfa + self._add_token(token) + return + + if not self._error_recovery: + return super(Parser, self).error_recovery(token) + + def current_suite(stack): + # For now just discard everything that is not a suite or + # file_input, if we detect an error. + for until_index, stack_node in reversed(list(enumerate(stack))): + # `suite` can sometimes be only simple_stmt, not stmt. + if stack_node.nonterminal == 'file_input': + break + elif stack_node.nonterminal == 'suite': + # In the case where we just have a newline we don't want to + # do error recovery here. In all other cases, we want to do + # error recovery. + if len(stack_node.nodes) != 1: + break + return until_index + + until_index = current_suite(self.stack) + + if self._stack_removal(until_index + 1): + self._add_token(token) + else: + typ, value, start_pos, prefix = token + if typ == INDENT: + # For every deleted INDENT we have to delete a DEDENT as well. + # Otherwise the parser will get into trouble and DEDENT too early. + self._omit_dedent_list.append(self._indent_counter) + + error_leaf = tree.PythonErrorLeaf(typ.name, value, start_pos, prefix) + self.stack[-1].nodes.append(error_leaf) + + tos = self.stack[-1] + if tos.nonterminal == 'suite': + # Need at least one statement in the suite. This happend with the + # error recovery above. + try: + tos.dfa = tos.dfa.arcs['stmt'] + except KeyError: + # We're already in a final state. + pass + + def _stack_removal(self, start_index): + all_nodes = [node for stack_node in self.stack[start_index:] for node in stack_node.nodes] + + if all_nodes: + node = tree.PythonErrorNode(all_nodes) + for n in all_nodes: + n.parent = node + self.stack[start_index - 1].nodes.append(node) + + self.stack[start_index:] = [] + return bool(all_nodes) + + def _recovery_tokenize(self, tokens): + for token in tokens: + typ = token[0] + if typ == DEDENT: + # We need to count indents, because if we just omit any DEDENT, + # we might omit them in the wrong place. + o = self._omit_dedent_list + if o and o[-1] == self._indent_counter: + o.pop() + continue + + self._indent_counter -= 1 + elif typ == INDENT: + self._indent_counter += 1 + yield token diff --git a/vim/bundle/jedi-vim/pythonx/parso/parso/python/pep8.py b/vim/bundle/jedi-vim/pythonx/parso/parso/python/pep8.py new file mode 100644 index 0000000..2a037f9 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/parso/python/pep8.py @@ -0,0 +1,727 @@ +import re +from contextlib import contextmanager + +from parso.python.errors import ErrorFinder, ErrorFinderConfig +from parso.normalizer import Rule +from parso.python.tree import search_ancestor, Flow, Scope + + +_IMPORT_TYPES = ('import_name', 'import_from') +_SUITE_INTRODUCERS = ('classdef', 'funcdef', 'if_stmt', 'while_stmt', + 'for_stmt', 'try_stmt', 'with_stmt') +_NON_STAR_TYPES = ('term', 'import_from', 'power') +_OPENING_BRACKETS = '(', '[', '{' +_CLOSING_BRACKETS = ')', ']', '}' +_FACTOR = '+', '-', '~' +_ALLOW_SPACE = '*', '+', '-', '**', '/', '//', '@' +_BITWISE_OPERATOR = '<<', '>>', '|', '&', '^' +_NEEDS_SPACE = ('=', '%', '->', + '<', '>', '==', '>=', '<=', '<>', '!=', + '+=', '-=', '*=', '@=', '/=', '%=', '&=', '|=', '^=', '<<=', + '>>=', '**=', '//=') +_NEEDS_SPACE += _BITWISE_OPERATOR +_IMPLICIT_INDENTATION_TYPES = ('dictorsetmaker', 'argument') +_POSSIBLE_SLICE_PARENTS = ('subscript', 'subscriptlist', 'sliceop') + + +class IndentationTypes(object): + VERTICAL_BRACKET = object() + HANGING_BRACKET = object() + BACKSLASH = object() + SUITE = object() + IMPLICIT = object() + + +class IndentationNode(object): + type = IndentationTypes.SUITE + + def __init__(self, config, indentation, parent=None): + self.bracket_indentation = self.indentation = indentation + self.parent = parent + + def __repr__(self): + return '<%s>' % self.__class__.__name__ + + def get_latest_suite_node(self): + n = self + while n is not None: + if n.type == IndentationTypes.SUITE: + return n + + n = n.parent + + +class BracketNode(IndentationNode): + def __init__(self, config, leaf, parent, in_suite_introducer=False): + self.leaf = leaf + + # Figure out here what the indentation is. For chained brackets + # we can basically use the previous indentation. + previous_leaf = leaf + n = parent + if n.type == IndentationTypes.IMPLICIT: + n = n.parent + while True: + if hasattr(n, 'leaf') and previous_leaf.line != n.leaf.line: + break + + previous_leaf = previous_leaf.get_previous_leaf() + if not isinstance(n, BracketNode) or previous_leaf != n.leaf: + break + n = n.parent + parent_indentation = n.indentation + + + next_leaf = leaf.get_next_leaf() + if '\n' in next_leaf.prefix: + # This implies code like: + # foobarbaz( + # a, + # b, + # ) + self.bracket_indentation = parent_indentation \ + + config.closing_bracket_hanging_indentation + self.indentation = parent_indentation + config.indentation + self.type = IndentationTypes.HANGING_BRACKET + else: + # Implies code like: + # foobarbaz( + # a, + # b, + # ) + expected_end_indent = leaf.end_pos[1] + if '\t' in config.indentation: + self.indentation = None + else: + self.indentation = ' ' * expected_end_indent + self.bracket_indentation = self.indentation + self.type = IndentationTypes.VERTICAL_BRACKET + + if in_suite_introducer and parent.type == IndentationTypes.SUITE \ + and self.indentation == parent_indentation + config.indentation: + self.indentation += config.indentation + # The closing bracket should have the same indentation. + self.bracket_indentation = self.indentation + self.parent = parent + + +class ImplicitNode(BracketNode): + """ + Implicit indentation after keyword arguments, default arguments, + annotations and dict values. + """ + def __init__(self, config, leaf, parent): + super(ImplicitNode, self).__init__(config, leaf, parent) + self.type = IndentationTypes.IMPLICIT + + next_leaf = leaf.get_next_leaf() + if leaf == ':' and '\n' not in next_leaf.prefix: + self.indentation += ' ' + + +class BackslashNode(IndentationNode): + type = IndentationTypes.BACKSLASH + + def __init__(self, config, parent_indentation, containing_leaf, spacing, parent=None): + expr_stmt = search_ancestor(containing_leaf, 'expr_stmt') + if expr_stmt is not None: + equals = expr_stmt.children[-2] + + if '\t' in config.indentation: + # TODO unite with the code of BracketNode + self.indentation = None + else: + # If the backslash follows the equals, use normal indentation + # otherwise it should align with the equals. + if equals.end_pos == spacing.start_pos: + self.indentation = parent_indentation + config.indentation + else: + # +1 because there is a space. + self.indentation = ' ' * (equals.end_pos[1] + 1) + else: + self.indentation = parent_indentation + config.indentation + self.bracket_indentation = self.indentation + self.parent = parent + + +def _is_magic_name(name): + return name.value.startswith('__') and name.value.endswith('__') + + +class PEP8Normalizer(ErrorFinder): + def __init__(self, *args, **kwargs): + super(PEP8Normalizer, self).__init__(*args, **kwargs) + self._previous_part = None + self._previous_leaf = None + self._on_newline = True + self._newline_count = 0 + self._wanted_newline_count = None + self._max_new_lines_in_prefix = 0 + self._new_statement = True + self._implicit_indentation_possible = False + # The top of stack of the indentation nodes. + self._indentation_tos = self._last_indentation_tos = \ + IndentationNode(self._config, indentation='') + self._in_suite_introducer = False + + if ' ' in self._config.indentation: + self._indentation_type = 'spaces' + self._wrong_indentation_char = '\t' + else: + self._indentation_type = 'tabs' + self._wrong_indentation_char = ' ' + + @contextmanager + def visit_node(self, node): + with super(PEP8Normalizer, self).visit_node(node): + with self._visit_node(node): + yield + + @contextmanager + def _visit_node(self, node): + typ = node.type + + if typ in 'import_name': + names = node.get_defined_names() + if len(names) > 1: + for name in names[:1]: + self.add_issue(name, 401, 'Multiple imports on one line') + elif typ == 'lambdef': + expr_stmt = node.parent + # Check if it's simply defining a single name, not something like + # foo.bar or x[1], where using a lambda could make more sense. + if expr_stmt.type == 'expr_stmt' and any(n.type == 'name' for n in expr_stmt.children[:-2:2]): + self.add_issue(node, 731, 'Do not assign a lambda expression, use a def') + elif typ == 'try_stmt': + for child in node.children: + # Here we can simply check if it's an except, because otherwise + # it would be an except_clause. + if child.type == 'keyword' and child.value == 'except': + self.add_issue(child, 722, 'Do not use bare except, specify exception instead') + elif typ == 'comparison': + for child in node.children: + if child.type not in ('atom_expr', 'power'): + continue + if len(child.children) > 2: + continue + trailer = child.children[1] + atom = child.children[0] + if trailer.type == 'trailer' and atom.type == 'name' \ + and atom.value == 'type': + self.add_issue(node, 721, "Do not compare types, use 'isinstance()") + break + elif typ == 'file_input': + endmarker = node.children[-1] + prev = endmarker.get_previous_leaf() + prefix = endmarker.prefix + if (not prefix.endswith('\n') and ( + prefix or prev is None or prev.value != '\n')): + self.add_issue(endmarker, 292, "No newline at end of file") + + if typ in _IMPORT_TYPES: + simple_stmt = node.parent + module = simple_stmt.parent + #if module.type == 'simple_stmt': + if module.type == 'file_input': + index = module.children.index(simple_stmt) + for child in module.children[:index]: + children = [child] + if child.type == 'simple_stmt': + # Remove the newline. + children = child.children[:-1] + + found_docstring = False + for c in children: + if c.type == 'string' and not found_docstring: + continue + found_docstring = True + + if c.type == 'expr_stmt' and \ + all(_is_magic_name(n) for n in c.get_defined_names()): + continue + + if c.type in _IMPORT_TYPES or isinstance(c, Flow): + continue + + self.add_issue(node, 402, 'Module level import not at top of file') + break + else: + continue + break + + implicit_indentation_possible = typ in _IMPLICIT_INDENTATION_TYPES + in_introducer = typ in _SUITE_INTRODUCERS + if in_introducer: + self._in_suite_introducer = True + elif typ == 'suite': + if self._indentation_tos.type == IndentationTypes.BACKSLASH: + self._indentation_tos = self._indentation_tos.parent + + self._indentation_tos = IndentationNode( + self._config, + self._indentation_tos.indentation + self._config.indentation, + parent=self._indentation_tos + ) + elif implicit_indentation_possible: + self._implicit_indentation_possible = True + yield + if typ == 'suite': + assert self._indentation_tos.type == IndentationTypes.SUITE + self._indentation_tos = self._indentation_tos.parent + # If we dedent, no lines are needed anymore. + self._wanted_newline_count = None + elif implicit_indentation_possible: + self._implicit_indentation_possible = False + if self._indentation_tos.type == IndentationTypes.IMPLICIT: + self._indentation_tos = self._indentation_tos.parent + elif in_introducer: + self._in_suite_introducer = False + if typ in ('classdef', 'funcdef'): + self._wanted_newline_count = self._get_wanted_blank_lines_count() + + def _check_tabs_spaces(self, spacing): + if self._wrong_indentation_char in spacing.value: + self.add_issue(spacing, 101, 'Indentation contains ' + self._indentation_type) + return True + return False + + def _get_wanted_blank_lines_count(self): + suite_node = self._indentation_tos.get_latest_suite_node() + return int(suite_node.parent is None) + 1 + + def _reset_newlines(self, spacing, leaf, is_comment=False): + self._max_new_lines_in_prefix = \ + max(self._max_new_lines_in_prefix, self._newline_count) + + wanted = self._wanted_newline_count + if wanted is not None: + # Need to substract one + blank_lines = self._newline_count - 1 + if wanted > blank_lines and leaf.type != 'endmarker': + # In case of a comment we don't need to add the issue, yet. + if not is_comment: + # TODO end_pos wrong. + code = 302 if wanted == 2 else 301 + message = "expected %s blank line, found %s" \ + % (wanted, blank_lines) + self.add_issue(spacing, code, message) + self._wanted_newline_count = None + else: + self._wanted_newline_count = None + + if not is_comment: + wanted = self._get_wanted_blank_lines_count() + actual = self._max_new_lines_in_prefix - 1 + + val = leaf.value + needs_lines = ( + val == '@' and leaf.parent.type == 'decorator' + or ( + val == 'class' + or val == 'async' and leaf.get_next_leaf() == 'def' + or val == 'def' and self._previous_leaf != 'async' + ) and leaf.parent.parent.type != 'decorated' + ) + if needs_lines and actual < wanted: + func_or_cls = leaf.parent + suite = func_or_cls.parent + if suite.type == 'decorated': + suite = suite.parent + + # The first leaf of a file or a suite should not need blank + # lines. + if suite.children[int(suite.type == 'suite')] != func_or_cls: + code = 302 if wanted == 2 else 301 + message = "expected %s blank line, found %s" \ + % (wanted, actual) + self.add_issue(spacing, code, message) + + self._max_new_lines_in_prefix = 0 + + self._newline_count = 0 + + def visit_leaf(self, leaf): + super(PEP8Normalizer, self).visit_leaf(leaf) + for part in leaf._split_prefix(): + if part.type == 'spacing': + # This part is used for the part call after for. + break + self._visit_part(part, part.create_spacing_part(), leaf) + + self._analyse_non_prefix(leaf) + self._visit_part(leaf, part, leaf) + + # Cleanup + self._last_indentation_tos = self._indentation_tos + + self._new_statement = leaf.type == 'newline' + + # TODO does this work? with brackets and stuff? + if leaf.type == 'newline' and \ + self._indentation_tos.type == IndentationTypes.BACKSLASH: + self._indentation_tos = self._indentation_tos.parent + + if leaf.value == ':' and leaf.parent.type in _SUITE_INTRODUCERS: + self._in_suite_introducer = False + elif leaf.value == 'elif': + self._in_suite_introducer = True + + if not self._new_statement: + self._reset_newlines(part, leaf) + self._max_blank_lines = 0 + + self._previous_leaf = leaf + + return leaf.value + + def _visit_part(self, part, spacing, leaf): + value = part.value + type_ = part.type + if type_ == 'error_leaf': + return + + if value == ',' and part.parent.type == 'dictorsetmaker': + self._indentation_tos = self._indentation_tos.parent + + node = self._indentation_tos + + if type_ == 'comment': + if value.startswith('##'): + # Whole blocks of # should not raise an error. + if value.lstrip('#'): + self.add_issue(part, 266, "Too many leading '#' for block comment.") + elif self._on_newline: + if not re.match(r'#:? ', value) and not value == '#' \ + and not (value.startswith('#!') and part.start_pos == (1, 0)): + self.add_issue(part, 265, "Block comment should start with '# '") + else: + if not re.match(r'#:? [^ ]', value): + self.add_issue(part, 262, "Inline comment should start with '# '") + + self._reset_newlines(spacing, leaf, is_comment=True) + elif type_ == 'newline': + if self._newline_count > self._get_wanted_blank_lines_count(): + self.add_issue(part, 303, "Too many blank lines (%s)" % self._newline_count) + elif leaf in ('def', 'class') \ + and leaf.parent.parent.type == 'decorated': + self.add_issue(part, 304, "Blank lines found after function decorator") + + + self._newline_count += 1 + + if type_ == 'backslash': + # TODO is this enough checking? What about ==? + if node.type != IndentationTypes.BACKSLASH: + if node.type != IndentationTypes.SUITE: + self.add_issue(part, 502, 'The backslash is redundant between brackets') + else: + indentation = node.indentation + if self._in_suite_introducer and node.type == IndentationTypes.SUITE: + indentation += self._config.indentation + + self._indentation_tos = BackslashNode( + self._config, + indentation, + part, + spacing, + parent=self._indentation_tos + ) + elif self._on_newline: + indentation = spacing.value + if node.type == IndentationTypes.BACKSLASH \ + and self._previous_part.type == 'newline': + self._indentation_tos = self._indentation_tos.parent + + if not self._check_tabs_spaces(spacing): + should_be_indentation = node.indentation + if type_ == 'comment': + # Comments can be dedented. So we have to care for that. + n = self._last_indentation_tos + while True: + if len(indentation) > len(n.indentation): + break + + should_be_indentation = n.indentation + + self._last_indentation_tos = n + if n == node: + break + n = n.parent + + if self._new_statement: + if type_ == 'newline': + if indentation: + self.add_issue(spacing, 291, 'Trailing whitespace') + elif indentation != should_be_indentation: + s = '%s %s' % (len(self._config.indentation), self._indentation_type) + self.add_issue(part, 111, 'Indentation is not a multiple of ' + s) + else: + if value in '])}': + should_be_indentation = node.bracket_indentation + else: + should_be_indentation = node.indentation + if self._in_suite_introducer and indentation == \ + node.get_latest_suite_node().indentation \ + + self._config.indentation: + self.add_issue(part, 129, "Line with same indent as next logical block") + elif indentation != should_be_indentation: + if not self._check_tabs_spaces(spacing) and part.value != '\n': + if value in '])}': + if node.type == IndentationTypes.VERTICAL_BRACKET: + self.add_issue(part, 124, "Closing bracket does not match visual indentation") + else: + self.add_issue(part, 123, "Losing bracket does not match indentation of opening bracket's line") + else: + if len(indentation) < len(should_be_indentation): + if node.type == IndentationTypes.VERTICAL_BRACKET: + self.add_issue(part, 128, 'Continuation line under-indented for visual indent') + elif node.type == IndentationTypes.BACKSLASH: + self.add_issue(part, 122, 'Continuation line missing indentation or outdented') + elif node.type == IndentationTypes.IMPLICIT: + self.add_issue(part, 135, 'xxx') + else: + self.add_issue(part, 121, 'Continuation line under-indented for hanging indent') + else: + if node.type == IndentationTypes.VERTICAL_BRACKET: + self.add_issue(part, 127, 'Continuation line over-indented for visual indent') + elif node.type == IndentationTypes.IMPLICIT: + self.add_issue(part, 136, 'xxx') + else: + self.add_issue(part, 126, 'Continuation line over-indented for hanging indent') + else: + self._check_spacing(part, spacing) + + self._check_line_length(part, spacing) + # ------------------------------- + # Finalizing. Updating the state. + # ------------------------------- + if value and value in '()[]{}' and type_ != 'error_leaf' \ + and part.parent.type != 'error_node': + if value in _OPENING_BRACKETS: + self._indentation_tos = BracketNode( + self._config, part, + parent=self._indentation_tos, + in_suite_introducer=self._in_suite_introducer + ) + else: + assert node.type != IndentationTypes.IMPLICIT + self._indentation_tos = self._indentation_tos.parent + elif value in ('=', ':') and self._implicit_indentation_possible \ + and part.parent.type in _IMPLICIT_INDENTATION_TYPES: + indentation = node.indentation + self._indentation_tos = ImplicitNode( + self._config, part, parent=self._indentation_tos + ) + + self._on_newline = type_ in ('newline', 'backslash', 'bom') + + self._previous_part = part + self._previous_spacing = spacing + + def _check_line_length(self, part, spacing): + if part.type == 'backslash': + last_column = part.start_pos[1] + 1 + else: + last_column = part.end_pos[1] + if last_column > self._config.max_characters \ + and spacing.start_pos[1] <= self._config.max_characters : + # Special case for long URLs in multi-line docstrings or comments, + # but still report the error when the 72 first chars are whitespaces. + report = True + if part.type == 'comment': + splitted = part.value[1:].split() + if len(splitted) == 1 \ + and (part.end_pos[1] - len(splitted[0])) < 72: + report = False + if report: + self.add_issue( + part, + 501, + 'Line too long (%s > %s characters)' % + (last_column, self._config.max_characters), + ) + + def _check_spacing(self, part, spacing): + def add_if_spaces(*args): + if spaces: + return self.add_issue(*args) + + def add_not_spaces(*args): + if not spaces: + return self.add_issue(*args) + + spaces = spacing.value + prev = self._previous_part + if prev is not None and prev.type == 'error_leaf' or part.type == 'error_leaf': + return + + type_ = part.type + if '\t' in spaces: + self.add_issue(spacing, 223, 'Used tab to separate tokens') + elif type_ == 'comment': + if len(spaces) < self._config.spaces_before_comment: + self.add_issue(spacing, 261, 'At least two spaces before inline comment') + elif type_ == 'newline': + add_if_spaces(spacing, 291, 'Trailing whitespace') + elif len(spaces) > 1: + self.add_issue(spacing, 221, 'Multiple spaces used') + else: + if prev in _OPENING_BRACKETS: + message = "Whitespace after '%s'" % part.value + add_if_spaces(spacing, 201, message) + elif part in _CLOSING_BRACKETS: + message = "Whitespace before '%s'" % part.value + add_if_spaces(spacing, 202, message) + elif part in (',', ';') or part == ':' \ + and part.parent.type not in _POSSIBLE_SLICE_PARENTS: + message = "Whitespace before '%s'" % part.value + add_if_spaces(spacing, 203, message) + elif prev == ':' and prev.parent.type in _POSSIBLE_SLICE_PARENTS: + pass # TODO + elif prev in (',', ';', ':'): + add_not_spaces(spacing, 231, "missing whitespace after '%s'") + elif part == ':': # Is a subscript + # TODO + pass + elif part in ('*', '**') and part.parent.type not in _NON_STAR_TYPES \ + or prev in ('*', '**') \ + and prev.parent.type not in _NON_STAR_TYPES: + # TODO + pass + elif prev in _FACTOR and prev.parent.type == 'factor': + pass + elif prev == '@' and prev.parent.type == 'decorator': + pass # TODO should probably raise an error if there's a space here + elif part in _NEEDS_SPACE or prev in _NEEDS_SPACE: + if part == '=' and part.parent.type in ('argument', 'param') \ + or prev == '=' and prev.parent.type in ('argument', 'param'): + if part == '=': + param = part.parent + else: + param = prev.parent + if param.type == 'param' and param.annotation: + add_not_spaces(spacing, 252, 'Expected spaces around annotation equals') + else: + add_if_spaces(spacing, 251, 'Unexpected spaces around keyword / parameter equals') + elif part in _BITWISE_OPERATOR or prev in _BITWISE_OPERATOR: + add_not_spaces(spacing, 227, 'Missing whitespace around bitwise or shift operator') + elif part == '%' or prev == '%': + add_not_spaces(spacing, 228, 'Missing whitespace around modulo operator') + else: + message_225 = 'Missing whitespace between tokens' + add_not_spaces(spacing, 225, message_225) + elif type_ == 'keyword' or prev.type == 'keyword': + add_not_spaces(spacing, 275, 'Missing whitespace around keyword') + else: + prev_spacing = self._previous_spacing + if prev in _ALLOW_SPACE and spaces != prev_spacing.value \ + and '\n' not in self._previous_leaf.prefix: + message = "Whitespace before operator doesn't match with whitespace after" + self.add_issue(spacing, 229, message) + + if spaces and part not in _ALLOW_SPACE and prev not in _ALLOW_SPACE: + message_225 = 'Missing whitespace between tokens' + #print('xy', spacing) + #self.add_issue(spacing, 225, message_225) + # TODO why only brackets? + if part in _OPENING_BRACKETS: + message = "Whitespace before '%s'" % part.value + add_if_spaces(spacing, 211, message) + + def _analyse_non_prefix(self, leaf): + typ = leaf.type + if typ == 'name' and leaf.value in ('l', 'O', 'I'): + if leaf.is_definition(): + message = "Do not define %s named 'l', 'O', or 'I' one line" + if leaf.parent.type == 'class' and leaf.parent.name == leaf: + self.add_issue(leaf, 742, message % 'classes') + elif leaf.parent.type == 'function' and leaf.parent.name == leaf: + self.add_issue(leaf, 743, message % 'function') + else: + self.add_issuadd_issue(741, message % 'variables', leaf) + elif leaf.value == ':': + if isinstance(leaf.parent, (Flow, Scope)) and leaf.parent.type != 'lambdef': + next_leaf = leaf.get_next_leaf() + if next_leaf.type != 'newline': + if leaf.parent.type == 'funcdef': + self.add_issue(next_leaf, 704, 'Multiple statements on one line (def)') + else: + self.add_issue(next_leaf, 701, 'Multiple statements on one line (colon)') + elif leaf.value == ';': + if leaf.get_next_leaf().type in ('newline', 'endmarker'): + self.add_issue(leaf, 703, 'Statement ends with a semicolon') + else: + self.add_issue(leaf, 702, 'Multiple statements on one line (semicolon)') + elif leaf.value in ('==', '!='): + comparison = leaf.parent + index = comparison.children.index(leaf) + left = comparison.children[index - 1] + right = comparison.children[index + 1] + for node in left, right: + if node.type == 'keyword' or node.type == 'name': + if node.value == 'None': + message = "comparison to None should be 'if cond is None:'" + self.add_issue(leaf, 711, message) + break + elif node.value in ('True', 'False'): + message = "comparison to False/True should be 'if cond is True:' or 'if cond:'" + self.add_issue(leaf, 712, message) + break + elif leaf.value in ('in', 'is'): + comparison = leaf.parent + if comparison.type == 'comparison' and comparison.parent.type == 'not_test': + if leaf.value == 'in': + self.add_issue(leaf, 713, "test for membership should be 'not in'") + else: + self.add_issue(leaf, 714, "test for object identity should be 'is not'") + elif typ == 'string': + # Checking multiline strings + for i, line in enumerate(leaf.value.splitlines()[1:]): + indentation = re.match(r'[ \t]*', line).group(0) + start_pos = leaf.line + i, len(indentation) + # TODO check multiline indentation. + elif typ == 'endmarker': + if self._newline_count >= 2: + self.add_issue(leaf, 391, 'Blank line at end of file') + + def add_issue(self, node, code, message): + if self._previous_leaf is not None: + if search_ancestor(self._previous_leaf, 'error_node') is not None: + return + if self._previous_leaf.type == 'error_leaf': + return + if search_ancestor(node, 'error_node') is not None: + return + if code in (901, 903): + # 901 and 903 are raised by the ErrorFinder. + super(PEP8Normalizer, self).add_issue(node, code, message) + else: + # Skip ErrorFinder here, because it has custom behavior. + super(ErrorFinder, self).add_issue(node, code, message) + + +class PEP8NormalizerConfig(ErrorFinderConfig): + normalizer_class = PEP8Normalizer + """ + Normalizing to PEP8. Not really implemented, yet. + """ + def __init__(self, indentation=' ' * 4, hanging_indentation=None, + max_characters=79, spaces_before_comment=2): + self.indentation = indentation + if hanging_indentation is None: + hanging_indentation = indentation + self.hanging_indentation = hanging_indentation + self.closing_bracket_hanging_indentation = '' + self.break_after_binary = False + self.max_characters = max_characters + self.spaces_before_comment = spaces_before_comment + + +# TODO this is not yet ready. +#@PEP8Normalizer.register_rule(type='endmarker') +class BlankLineAtEnd(Rule): + code = 392 + message = 'Blank line at end of file' + + def is_issue(self, leaf): + return self._newline_count >= 2 diff --git a/vim/bundle/jedi-vim/pythonx/parso/parso/python/prefix.py b/vim/bundle/jedi-vim/pythonx/parso/parso/python/prefix.py new file mode 100644 index 0000000..b7f1e1b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/parso/python/prefix.py @@ -0,0 +1,97 @@ +import re +from codecs import BOM_UTF8 + +from parso.python.tokenize import group + +unicode_bom = BOM_UTF8.decode('utf-8') + + +class PrefixPart(object): + def __init__(self, leaf, typ, value, spacing='', start_pos=None): + assert start_pos is not None + self.parent = leaf + self.type = typ + self.value = value + self.spacing = spacing + self.start_pos = start_pos + + @property + def end_pos(self): + if self.value.endswith('\n'): + return self.start_pos[0] + 1, 0 + if self.value == unicode_bom: + # The bom doesn't have a length at the start of a Python file. + return self.start_pos + return self.start_pos[0], self.start_pos[1] + len(self.value) + + def create_spacing_part(self): + column = self.start_pos[1] - len(self.spacing) + return PrefixPart( + self.parent, 'spacing', self.spacing, + start_pos=(self.start_pos[0], column) + ) + + def __repr__(self): + return '%s(%s, %s, %s)' % ( + self.__class__.__name__, + self.type, + repr(self.value), + self.start_pos + ) + + +_comment = r'#[^\n\r\f]*' +_backslash = r'\\\r?\n' +_newline = r'\r?\n' +_form_feed = r'\f' +_only_spacing = '$' +_spacing = r'[ \t]*' +_bom = unicode_bom + +_regex = group( + _comment, _backslash, _newline, _form_feed, _only_spacing, _bom, + capture=True +) +_regex = re.compile(group(_spacing, capture=True) + _regex) + + +_types = { + '#': 'comment', + '\\': 'backslash', + '\f': 'formfeed', + '\n': 'newline', + '\r': 'newline', + unicode_bom: 'bom' +} + + +def split_prefix(leaf, start_pos): + line, column = start_pos + start = 0 + value = spacing = '' + bom = False + while start != len(leaf.prefix): + match =_regex.match(leaf.prefix, start) + spacing = match.group(1) + value = match.group(2) + if not value: + break + type_ = _types[value[0]] + yield PrefixPart( + leaf, type_, value, spacing, + start_pos=(line, column + start - int(bom) + len(spacing)) + ) + if type_ == 'bom': + bom = True + + start = match.end(0) + if value.endswith('\n'): + line += 1 + column = -start + + if value: + spacing = '' + yield PrefixPart( + leaf, 'spacing', spacing, + start_pos=(line, column + start) + ) diff --git a/vim/bundle/jedi-vim/pythonx/parso/parso/python/token.py b/vim/bundle/jedi-vim/pythonx/parso/parso/python/token.py new file mode 100644 index 0000000..bb86ec9 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/parso/python/token.py @@ -0,0 +1,27 @@ +from __future__ import absolute_import + + +class TokenType(object): + def __init__(self, name, contains_syntax=False): + self.name = name + self.contains_syntax = contains_syntax + + def __repr__(self): + return '%s(%s)' % (self.__class__.__name__, self.name) + + +class TokenTypes(object): + """ + Basically an enum, but Python 2 doesn't have enums in the standard library. + """ + def __init__(self, names, contains_syntax): + for name in names: + setattr(self, name, TokenType(name, contains_syntax=name in contains_syntax)) + + +PythonTokenTypes = TokenTypes(( + 'STRING', 'NUMBER', 'NAME', 'ERRORTOKEN', 'NEWLINE', 'INDENT', 'DEDENT', + 'ERROR_DEDENT', 'FSTRING_STRING', 'FSTRING_START', 'FSTRING_END', 'OP', + 'ENDMARKER'), + contains_syntax=('NAME', 'OP'), +) diff --git a/vim/bundle/jedi-vim/pythonx/parso/parso/python/token.pyi b/vim/bundle/jedi-vim/pythonx/parso/parso/python/token.pyi new file mode 100644 index 0000000..48e8dac --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/parso/python/token.pyi @@ -0,0 +1,30 @@ +from typing import Container, Iterable + +class TokenType: + name: str + contains_syntax: bool + def __init__(self, name: str, contains_syntax: bool) -> None: ... + +class TokenTypes: + def __init__( + self, names: Iterable[str], contains_syntax: Container[str] + ) -> None: ... + +# not an actual class in the source code, but we need this class to type the fields of +# PythonTokenTypes +class _FakePythonTokenTypesClass(TokenTypes): + STRING: TokenType + NUMBER: TokenType + NAME: TokenType + ERRORTOKEN: TokenType + NEWLINE: TokenType + INDENT: TokenType + DEDENT: TokenType + ERROR_DEDENT: TokenType + FSTRING_STRING: TokenType + FSTRING_START: TokenType + FSTRING_END: TokenType + OP: TokenType + ENDMARKER: TokenType + +PythonTokenTypes: _FakePythonTokenTypesClass = ... diff --git a/vim/bundle/jedi-vim/pythonx/parso/parso/python/tokenize.py b/vim/bundle/jedi-vim/pythonx/parso/parso/python/tokenize.py new file mode 100644 index 0000000..48d128b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/parso/python/tokenize.py @@ -0,0 +1,686 @@ +# -*- coding: utf-8 -*- +""" +This tokenizer has been copied from the ``tokenize.py`` standard library +tokenizer. The reason was simple: The standard library tokenizer fails +if the indentation is not right. To make it possible to do error recovery the + tokenizer needed to be rewritten. + +Basically this is a stripped down version of the standard library module, so +you can read the documentation there. Additionally we included some speed and +memory optimizations here. +""" +from __future__ import absolute_import + +import sys +import string +import re +from collections import namedtuple +import itertools as _itertools +from codecs import BOM_UTF8 + +from parso.python.token import PythonTokenTypes +from parso._compatibility import py_version +from parso.utils import split_lines + + +# Maximum code point of Unicode 6.0: 0x10ffff (1,114,111) +MAX_UNICODE = '\U0010ffff' + +STRING = PythonTokenTypes.STRING +NAME = PythonTokenTypes.NAME +NUMBER = PythonTokenTypes.NUMBER +OP = PythonTokenTypes.OP +NEWLINE = PythonTokenTypes.NEWLINE +INDENT = PythonTokenTypes.INDENT +DEDENT = PythonTokenTypes.DEDENT +ENDMARKER = PythonTokenTypes.ENDMARKER +ERRORTOKEN = PythonTokenTypes.ERRORTOKEN +ERROR_DEDENT = PythonTokenTypes.ERROR_DEDENT +FSTRING_START = PythonTokenTypes.FSTRING_START +FSTRING_STRING = PythonTokenTypes.FSTRING_STRING +FSTRING_END = PythonTokenTypes.FSTRING_END + +TokenCollection = namedtuple( + 'TokenCollection', + 'pseudo_token single_quoted triple_quoted endpats whitespace ' + 'fstring_pattern_map always_break_tokens', +) + +BOM_UTF8_STRING = BOM_UTF8.decode('utf-8') + +_token_collection_cache = {} + +if py_version >= 30: + # Python 3 has str.isidentifier() to check if a char is a valid identifier + is_identifier = str.isidentifier +else: + # Python 2 doesn't, but it's not that important anymore and if you tokenize + # Python 2 code with this, it's still ok. It's just that parsing Python 3 + # code with this function is not 100% correct. + # This just means that Python 2 code matches a few identifiers too much, + # but that doesn't really matter. + def is_identifier(s): + return True + + +def group(*choices, **kwargs): + capture = kwargs.pop('capture', False) # Python 2, arrghhhhh :( + assert not kwargs + + start = '(' + if not capture: + start += '?:' + return start + '|'.join(choices) + ')' + + +def maybe(*choices): + return group(*choices) + '?' + + +# Return the empty string, plus all of the valid string prefixes. +def _all_string_prefixes(version_info, include_fstring=False, only_fstring=False): + def different_case_versions(prefix): + for s in _itertools.product(*[(c, c.upper()) for c in prefix]): + yield ''.join(s) + # The valid string prefixes. Only contain the lower case versions, + # and don't contain any permuations (include 'fr', but not + # 'rf'). The various permutations will be generated. + valid_string_prefixes = ['b', 'r', 'u'] + if version_info >= (3, 0): + valid_string_prefixes.append('br') + + result = set(['']) + if version_info >= (3, 6) and include_fstring: + f = ['f', 'fr'] + if only_fstring: + valid_string_prefixes = f + result = set() + else: + valid_string_prefixes += f + elif only_fstring: + return set() + + # if we add binary f-strings, add: ['fb', 'fbr'] + for prefix in valid_string_prefixes: + for t in _itertools.permutations(prefix): + # create a list with upper and lower versions of each + # character + result.update(different_case_versions(t)) + if version_info <= (2, 7): + # In Python 2 the order cannot just be random. + result.update(different_case_versions('ur')) + result.update(different_case_versions('br')) + return result + + +def _compile(expr): + return re.compile(expr, re.UNICODE) + + +def _get_token_collection(version_info): + try: + return _token_collection_cache[tuple(version_info)] + except KeyError: + _token_collection_cache[tuple(version_info)] = result = \ + _create_token_collection(version_info) + return result + + +fstring_string_single_line = _compile(r'(?:\{\{|\}\}|\\(?:\r\n?|\n)|[^{}\r\n])+') +fstring_string_multi_line = _compile(r'(?:[^{}]+|\{\{|\}\})+') +fstring_format_spec_single_line = _compile(r'(?:\\(?:\r\n?|\n)|[^{}\r\n])+') +fstring_format_spec_multi_line = _compile(r'[^{}]+') + + +def _create_token_collection(version_info): + # Note: we use unicode matching for names ("\w") but ascii matching for + # number literals. + Whitespace = r'[ \f\t]*' + whitespace = _compile(Whitespace) + Comment = r'#[^\r\n]*' + # Python 2 is pretty much not working properly anymore, we just ignore + # parsing unicode properly, which is fine, I guess. + if version_info[0] == 2: + Name = r'([A-Za-z_0-9]+)' + elif sys.version_info[0] == 2: + # Unfortunately the regex engine cannot deal with the regex below, so + # just use this one. + Name = r'(\w+)' + else: + Name = u'([A-Za-z_0-9\u0080-' + MAX_UNICODE + ']+)' + + if version_info >= (3, 6): + Hexnumber = r'0[xX](?:_?[0-9a-fA-F])+' + Binnumber = r'0[bB](?:_?[01])+' + Octnumber = r'0[oO](?:_?[0-7])+' + Decnumber = r'(?:0(?:_?0)*|[1-9](?:_?[0-9])*)' + Intnumber = group(Hexnumber, Binnumber, Octnumber, Decnumber) + Exponent = r'[eE][-+]?[0-9](?:_?[0-9])*' + Pointfloat = group(r'[0-9](?:_?[0-9])*\.(?:[0-9](?:_?[0-9])*)?', + r'\.[0-9](?:_?[0-9])*') + maybe(Exponent) + Expfloat = r'[0-9](?:_?[0-9])*' + Exponent + Floatnumber = group(Pointfloat, Expfloat) + Imagnumber = group(r'[0-9](?:_?[0-9])*[jJ]', Floatnumber + r'[jJ]') + else: + Hexnumber = r'0[xX][0-9a-fA-F]+' + Binnumber = r'0[bB][01]+' + if version_info >= (3, 0): + Octnumber = r'0[oO][0-7]+' + else: + Octnumber = '0[oO]?[0-7]+' + Decnumber = r'(?:0+|[1-9][0-9]*)' + Intnumber = group(Hexnumber, Binnumber, Octnumber, Decnumber) + if version_info[0] < 3: + Intnumber += '[lL]?' + Exponent = r'[eE][-+]?[0-9]+' + Pointfloat = group(r'[0-9]+\.[0-9]*', r'\.[0-9]+') + maybe(Exponent) + Expfloat = r'[0-9]+' + Exponent + Floatnumber = group(Pointfloat, Expfloat) + Imagnumber = group(r'[0-9]+[jJ]', Floatnumber + r'[jJ]') + Number = group(Imagnumber, Floatnumber, Intnumber) + + # Note that since _all_string_prefixes includes the empty string, + # StringPrefix can be the empty string (making it optional). + possible_prefixes = _all_string_prefixes(version_info) + StringPrefix = group(*possible_prefixes) + StringPrefixWithF = group(*_all_string_prefixes(version_info, include_fstring=True)) + fstring_prefixes = _all_string_prefixes(version_info, include_fstring=True, only_fstring=True) + FStringStart = group(*fstring_prefixes) + + # Tail end of ' string. + Single = r"(?:\\.|[^'\\])*'" + # Tail end of " string. + Double = r'(?:\\.|[^"\\])*"' + # Tail end of ''' string. + Single3 = r"(?:\\.|'(?!'')|[^'\\])*'''" + # Tail end of """ string. + Double3 = r'(?:\\.|"(?!"")|[^"\\])*"""' + Triple = group(StringPrefixWithF + "'''", StringPrefixWithF + '"""') + + # Because of leftmost-then-longest match semantics, be sure to put the + # longest operators first (e.g., if = came before ==, == would get + # recognized as two instances of =). + Operator = group(r"\*\*=?", r">>=?", r"<<=?", + r"//=?", r"->", + r"[+\-*/%&@`|^!=<>]=?", + r"~") + + Bracket = '[][(){}]' + + special_args = [r'\r\n?', r'\n', r'[;.,@]'] + if version_info >= (3, 0): + special_args.insert(0, r'\.\.\.') + if version_info >= (3, 8): + special_args.insert(0, ":=?") + else: + special_args.insert(0, ":") + Special = group(*special_args) + + Funny = group(Operator, Bracket, Special) + + # First (or only) line of ' or " string. + ContStr = group(StringPrefix + r"'[^\r\n'\\]*(?:\\.[^\r\n'\\]*)*" + + group("'", r'\\(?:\r\n?|\n)'), + StringPrefix + r'"[^\r\n"\\]*(?:\\.[^\r\n"\\]*)*' + + group('"', r'\\(?:\r\n?|\n)')) + pseudo_extra_pool = [Comment, Triple] + all_quotes = '"', "'", '"""', "'''" + if fstring_prefixes: + pseudo_extra_pool.append(FStringStart + group(*all_quotes)) + + PseudoExtras = group(r'\\(?:\r\n?|\n)|\Z', *pseudo_extra_pool) + PseudoToken = group(Whitespace, capture=True) + \ + group(PseudoExtras, Number, Funny, ContStr, Name, capture=True) + + # For a given string prefix plus quotes, endpats maps it to a regex + # to match the remainder of that string. _prefix can be empty, for + # a normal single or triple quoted string (with no prefix). + endpats = {} + for _prefix in possible_prefixes: + endpats[_prefix + "'"] = _compile(Single) + endpats[_prefix + '"'] = _compile(Double) + endpats[_prefix + "'''"] = _compile(Single3) + endpats[_prefix + '"""'] = _compile(Double3) + + # A set of all of the single and triple quoted string prefixes, + # including the opening quotes. + single_quoted = set() + triple_quoted = set() + fstring_pattern_map = {} + for t in possible_prefixes: + for quote in '"', "'": + single_quoted.add(t + quote) + + for quote in '"""', "'''": + triple_quoted.add(t + quote) + + for t in fstring_prefixes: + for quote in all_quotes: + fstring_pattern_map[t + quote] = quote + + ALWAYS_BREAK_TOKENS = (';', 'import', 'class', 'def', 'try', 'except', + 'finally', 'while', 'with', 'return') + pseudo_token_compiled = _compile(PseudoToken) + return TokenCollection( + pseudo_token_compiled, single_quoted, triple_quoted, endpats, + whitespace, fstring_pattern_map, ALWAYS_BREAK_TOKENS + ) + + +class Token(namedtuple('Token', ['type', 'string', 'start_pos', 'prefix'])): + @property + def end_pos(self): + lines = split_lines(self.string) + if len(lines) > 1: + return self.start_pos[0] + len(lines) - 1, 0 + else: + return self.start_pos[0], self.start_pos[1] + len(self.string) + + +class PythonToken(Token): + def __repr__(self): + return ('TokenInfo(type=%s, string=%r, start_pos=%r, prefix=%r)' % + self._replace(type=self.type.name)) + + +class FStringNode(object): + def __init__(self, quote): + self.quote = quote + self.parentheses_count = 0 + self.previous_lines = '' + self.last_string_start_pos = None + # In the syntax there can be multiple format_spec's nested: + # {x:{y:3}} + self.format_spec_count = 0 + + def open_parentheses(self, character): + self.parentheses_count += 1 + + def close_parentheses(self, character): + self.parentheses_count -= 1 + if self.parentheses_count == 0: + # No parentheses means that the format spec is also finished. + self.format_spec_count = 0 + + def allow_multiline(self): + return len(self.quote) == 3 + + def is_in_expr(self): + return self.parentheses_count > self.format_spec_count + + def is_in_format_spec(self): + return not self.is_in_expr() and self.format_spec_count + + +def _close_fstring_if_necessary(fstring_stack, string, start_pos, additional_prefix): + for fstring_stack_index, node in enumerate(fstring_stack): + if string.startswith(node.quote): + token = PythonToken( + FSTRING_END, + node.quote, + start_pos, + prefix=additional_prefix, + ) + additional_prefix = '' + assert not node.previous_lines + del fstring_stack[fstring_stack_index:] + return token, '', len(node.quote) + return None, additional_prefix, 0 + + +def _find_fstring_string(endpats, fstring_stack, line, lnum, pos): + tos = fstring_stack[-1] + allow_multiline = tos.allow_multiline() + if tos.is_in_format_spec(): + if allow_multiline: + regex = fstring_format_spec_multi_line + else: + regex = fstring_format_spec_single_line + else: + if allow_multiline: + regex = fstring_string_multi_line + else: + regex = fstring_string_single_line + + match = regex.match(line, pos) + if match is None: + return tos.previous_lines, pos + + if not tos.previous_lines: + tos.last_string_start_pos = (lnum, pos) + + string = match.group(0) + for fstring_stack_node in fstring_stack: + end_match = endpats[fstring_stack_node.quote].match(string) + if end_match is not None: + string = end_match.group(0)[:-len(fstring_stack_node.quote)] + + new_pos = pos + new_pos += len(string) + # even if allow_multiline is False, we still need to check for trailing + # newlines, because a single-line f-string can contain line continuations + if string.endswith('\n') or string.endswith('\r'): + tos.previous_lines += string + string = '' + else: + string = tos.previous_lines + string + + return string, new_pos + + +def tokenize(code, version_info, start_pos=(1, 0)): + """Generate tokens from a the source code (string).""" + lines = split_lines(code, keepends=True) + return tokenize_lines(lines, version_info, start_pos=start_pos) + + +def _print_tokens(func): + """ + A small helper function to help debug the tokenize_lines function. + """ + def wrapper(*args, **kwargs): + for token in func(*args, **kwargs): + yield token + + return wrapper + + +# @_print_tokens +def tokenize_lines(lines, version_info, start_pos=(1, 0)): + """ + A heavily modified Python standard library tokenizer. + + Additionally to the default information, yields also the prefix of each + token. This idea comes from lib2to3. The prefix contains all information + that is irrelevant for the parser like newlines in parentheses or comments. + """ + def dedent_if_necessary(start): + while start < indents[-1]: + if start > indents[-2]: + yield PythonToken(ERROR_DEDENT, '', (lnum, 0), '') + break + yield PythonToken(DEDENT, '', spos, '') + indents.pop() + + pseudo_token, single_quoted, triple_quoted, endpats, whitespace, \ + fstring_pattern_map, always_break_tokens, = \ + _get_token_collection(version_info) + paren_level = 0 # count parentheses + indents = [0] + max = 0 + numchars = '0123456789' + contstr = '' + contline = None + # We start with a newline. This makes indent at the first position + # possible. It's not valid Python, but still better than an INDENT in the + # second line (and not in the first). This makes quite a few things in + # Jedi's fast parser possible. + new_line = True + prefix = '' # Should never be required, but here for safety + additional_prefix = '' + first = True + lnum = start_pos[0] - 1 + fstring_stack = [] + for line in lines: # loop over lines in stream + lnum += 1 + pos = 0 + max = len(line) + if first: + if line.startswith(BOM_UTF8_STRING): + additional_prefix = BOM_UTF8_STRING + line = line[1:] + max = len(line) + + # Fake that the part before was already parsed. + line = '^' * start_pos[1] + line + pos = start_pos[1] + max += start_pos[1] + + first = False + + if contstr: # continued string + endmatch = endprog.match(line) + if endmatch: + pos = endmatch.end(0) + yield PythonToken( + STRING, contstr + line[:pos], + contstr_start, prefix) + contstr = '' + contline = None + else: + contstr = contstr + line + contline = contline + line + continue + + while pos < max: + if fstring_stack: + tos = fstring_stack[-1] + if not tos.is_in_expr(): + string, pos = _find_fstring_string(endpats, fstring_stack, line, lnum, pos) + if string: + yield PythonToken( + FSTRING_STRING, string, + tos.last_string_start_pos, + # Never has a prefix because it can start anywhere and + # include whitespace. + prefix='' + ) + tos.previous_lines = '' + continue + if pos == max: + break + + rest = line[pos:] + fstring_end_token, additional_prefix, quote_length = _close_fstring_if_necessary( + fstring_stack, + rest, + (lnum, pos), + additional_prefix, + ) + pos += quote_length + if fstring_end_token is not None: + yield fstring_end_token + continue + + pseudomatch = pseudo_token.match(line, pos) + if not pseudomatch: # scan for tokens + match = whitespace.match(line, pos) + if pos == 0: + for t in dedent_if_necessary(match.end()): + yield t + pos = match.end() + new_line = False + yield PythonToken( + ERRORTOKEN, line[pos], (lnum, pos), + additional_prefix + match.group(0) + ) + additional_prefix = '' + pos += 1 + continue + + prefix = additional_prefix + pseudomatch.group(1) + additional_prefix = '' + start, pos = pseudomatch.span(2) + spos = (lnum, start) + token = pseudomatch.group(2) + if token == '': + assert prefix + additional_prefix = prefix + # This means that we have a line with whitespace/comments at + # the end, which just results in an endmarker. + break + initial = token[0] + + if new_line and initial not in '\r\n\\#': + new_line = False + if paren_level == 0 and not fstring_stack: + i = 0 + indent_start = start + while line[i] == '\f': + i += 1 + # TODO don't we need to change spos as well? + indent_start -= 1 + if indent_start > indents[-1]: + yield PythonToken(INDENT, '', spos, '') + indents.append(indent_start) + for t in dedent_if_necessary(indent_start): + yield t + + if (initial in numchars or # ordinary number + (initial == '.' and token != '.' and token != '...')): + yield PythonToken(NUMBER, token, spos, prefix) + elif pseudomatch.group(3) is not None: # ordinary name + if token in always_break_tokens: + fstring_stack[:] = [] + paren_level = 0 + # We only want to dedent if the token is on a new line. + if re.match(r'[ \f\t]*$', line[:start]): + while True: + indent = indents.pop() + if indent > start: + yield PythonToken(DEDENT, '', spos, '') + else: + indents.append(indent) + break + if is_identifier(token): + yield PythonToken(NAME, token, spos, prefix) + else: + for t in _split_illegal_unicode_name(token, spos, prefix): + yield t # yield from Python 2 + elif initial in '\r\n': + if any(not f.allow_multiline() for f in fstring_stack): + # Would use fstring_stack.clear, but that's not available + # in Python 2. + fstring_stack[:] = [] + + if not new_line and paren_level == 0 and not fstring_stack: + yield PythonToken(NEWLINE, token, spos, prefix) + else: + additional_prefix = prefix + token + new_line = True + elif initial == '#': # Comments + assert not token.endswith("\n") + additional_prefix = prefix + token + elif token in triple_quoted: + endprog = endpats[token] + endmatch = endprog.match(line, pos) + if endmatch: # all on one line + pos = endmatch.end(0) + token = line[start:pos] + yield PythonToken(STRING, token, spos, prefix) + else: + contstr_start = (lnum, start) # multiple lines + contstr = line[start:] + contline = line + break + + # Check up to the first 3 chars of the token to see if + # they're in the single_quoted set. If so, they start + # a string. + # We're using the first 3, because we're looking for + # "rb'" (for example) at the start of the token. If + # we switch to longer prefixes, this needs to be + # adjusted. + # Note that initial == token[:1]. + # Also note that single quote checking must come after + # triple quote checking (above). + elif initial in single_quoted or \ + token[:2] in single_quoted or \ + token[:3] in single_quoted: + if token[-1] in '\r\n': # continued string + # This means that a single quoted string ends with a + # backslash and is continued. + contstr_start = lnum, start + endprog = (endpats.get(initial) or endpats.get(token[1]) + or endpats.get(token[2])) + contstr = line[start:] + contline = line + break + else: # ordinary string + yield PythonToken(STRING, token, spos, prefix) + elif token in fstring_pattern_map: # The start of an fstring. + fstring_stack.append(FStringNode(fstring_pattern_map[token])) + yield PythonToken(FSTRING_START, token, spos, prefix) + elif initial == '\\' and line[start:] in ('\\\n', '\\\r\n', '\\\r'): # continued stmt + additional_prefix += prefix + line[start:] + break + else: + if token in '([{': + if fstring_stack: + fstring_stack[-1].open_parentheses(token) + else: + paren_level += 1 + elif token in ')]}': + if fstring_stack: + fstring_stack[-1].close_parentheses(token) + else: + if paren_level: + paren_level -= 1 + elif token == ':' and fstring_stack \ + and fstring_stack[-1].parentheses_count \ + - fstring_stack[-1].format_spec_count == 1: + fstring_stack[-1].format_spec_count += 1 + + yield PythonToken(OP, token, spos, prefix) + + if contstr: + yield PythonToken(ERRORTOKEN, contstr, contstr_start, prefix) + if contstr.endswith('\n') or contstr.endswith('\r'): + new_line = True + + end_pos = lnum, max + # As the last position we just take the maximally possible position. We + # remove -1 for the last new line. + for indent in indents[1:]: + yield PythonToken(DEDENT, '', end_pos, '') + yield PythonToken(ENDMARKER, '', end_pos, additional_prefix) + + +def _split_illegal_unicode_name(token, start_pos, prefix): + def create_token(): + return PythonToken(ERRORTOKEN if is_illegal else NAME, found, pos, prefix) + + found = '' + is_illegal = False + pos = start_pos + for i, char in enumerate(token): + if is_illegal: + if is_identifier(char): + yield create_token() + found = char + is_illegal = False + prefix = '' + pos = start_pos[0], start_pos[1] + i + else: + found += char + else: + new_found = found + char + if is_identifier(new_found): + found = new_found + else: + if found: + yield create_token() + prefix = '' + pos = start_pos[0], start_pos[1] + i + found = char + is_illegal = True + + if found: + yield create_token() + + +if __name__ == "__main__": + if len(sys.argv) >= 2: + path = sys.argv[1] + with open(path) as f: + code = f.read() + else: + code = sys.stdin.read() + + from parso.utils import python_bytes_to_unicode, parse_version_string + + if isinstance(code, bytes): + code = python_bytes_to_unicode(code) + + for token in tokenize(code, parse_version_string()): + print(token) diff --git a/vim/bundle/jedi-vim/pythonx/parso/parso/python/tokenize.pyi b/vim/bundle/jedi-vim/pythonx/parso/parso/python/tokenize.pyi new file mode 100644 index 0000000..1870bc2 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/parso/python/tokenize.pyi @@ -0,0 +1,24 @@ +from typing import Generator, Iterable, NamedTuple, Tuple + +from parso.python.token import TokenType +from parso.utils import PythonVersionInfo + +class Token(NamedTuple): + type: TokenType + string: str + start_pos: Tuple[int, int] + prefix: str + @property + def end_pos(self) -> Tuple[int, int]: ... + +class PythonToken(Token): + def __repr__(self) -> str: ... + +def tokenize( + code: str, version_info: PythonVersionInfo, start_pos: Tuple[int, int] = (1, 0) +) -> Generator[PythonToken, None, None]: ... +def tokenize_lines( + lines: Iterable[str], + version_info: PythonVersionInfo, + start_pos: Tuple[int, int] = (1, 0), +) -> Generator[PythonToken, None, None]: ... diff --git a/vim/bundle/jedi-vim/pythonx/parso/parso/python/tree.py b/vim/bundle/jedi-vim/pythonx/parso/parso/python/tree.py new file mode 100644 index 0000000..7d4a490 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/parso/python/tree.py @@ -0,0 +1,1245 @@ +""" +This is the syntax tree for Python syntaxes (2 & 3). The classes represent +syntax elements like functions and imports. + +All of the nodes can be traced back to the `Python grammar file +`_. If you want to know how +a tree is structured, just analyse that file (for each Python version it's a +bit different). + +There's a lot of logic here that makes it easier for Jedi (and other libraries) +to deal with a Python syntax tree. + +By using :py:meth:`parso.tree.NodeOrLeaf.get_code` on a module, you can get +back the 1-to-1 representation of the input given to the parser. This is +important if you want to refactor a parser tree. + +>>> from parso import parse +>>> parser = parse('import os') +>>> module = parser.get_root_node() +>>> module + + +Any subclasses of :class:`Scope`, including :class:`Module` has an attribute +:attr:`iter_imports `: + +>>> list(module.iter_imports()) +[] + +Changes to the Python Grammar +----------------------------- + +A few things have changed when looking at Python grammar files: + +- :class:`Param` does not exist in Python grammar files. It is essentially a + part of a ``parameters`` node. |parso| splits it up to make it easier to + analyse parameters. However this just makes it easier to deal with the syntax + tree, it doesn't actually change the valid syntax. +- A few nodes like `lambdef` and `lambdef_nocond` have been merged in the + syntax tree to make it easier to do deal with them. + +Parser Tree Classes +------------------- +""" + +import re +try: + from collections.abc import Mapping +except ImportError: + from collections import Mapping + +from parso._compatibility import utf8_repr, unicode +from parso.tree import Node, BaseNode, Leaf, ErrorNode, ErrorLeaf, \ + search_ancestor +from parso.python.prefix import split_prefix +from parso.utils import split_lines + +_FLOW_CONTAINERS = set(['if_stmt', 'while_stmt', 'for_stmt', 'try_stmt', + 'with_stmt', 'async_stmt', 'suite']) +_RETURN_STMT_CONTAINERS = set(['suite', 'simple_stmt']) | _FLOW_CONTAINERS +_FUNC_CONTAINERS = set(['suite', 'simple_stmt', 'decorated']) | _FLOW_CONTAINERS +_GET_DEFINITION_TYPES = set([ + 'expr_stmt', 'sync_comp_for', 'with_stmt', 'for_stmt', 'import_name', + 'import_from', 'param' +]) +_IMPORTS = set(['import_name', 'import_from']) + + +class DocstringMixin(object): + __slots__ = () + + def get_doc_node(self): + """ + Returns the string leaf of a docstring. e.g. ``r'''foo'''``. + """ + if self.type == 'file_input': + node = self.children[0] + elif self.type in ('funcdef', 'classdef'): + node = self.children[self.children.index(':') + 1] + if node.type == 'suite': # Normally a suite + node = node.children[1] # -> NEWLINE stmt + else: # ExprStmt + simple_stmt = self.parent + c = simple_stmt.parent.children + index = c.index(simple_stmt) + if not index: + return None + node = c[index - 1] + + if node.type == 'simple_stmt': + node = node.children[0] + if node.type == 'string': + return node + return None + + +class PythonMixin(object): + """ + Some Python specific utitilies. + """ + __slots__ = () + + def get_name_of_position(self, position): + """ + Given a (line, column) tuple, returns a :py:class:`Name` or ``None`` if + there is no name at that position. + """ + for c in self.children: + if isinstance(c, Leaf): + if c.type == 'name' and c.start_pos <= position <= c.end_pos: + return c + else: + result = c.get_name_of_position(position) + if result is not None: + return result + return None + + +class PythonLeaf(PythonMixin, Leaf): + __slots__ = () + + def _split_prefix(self): + return split_prefix(self, self.get_start_pos_of_prefix()) + + def get_start_pos_of_prefix(self): + """ + Basically calls :py:meth:`parso.tree.NodeOrLeaf.get_start_pos_of_prefix`. + """ + # TODO it is really ugly that we have to override it. Maybe change + # indent error leafs somehow? No idea how, though. + previous_leaf = self.get_previous_leaf() + if previous_leaf is not None and previous_leaf.type == 'error_leaf' \ + and previous_leaf.token_type in ('INDENT', 'DEDENT', 'ERROR_DEDENT'): + previous_leaf = previous_leaf.get_previous_leaf() + + if previous_leaf is None: # It's the first leaf. + lines = split_lines(self.prefix) + # + 1 is needed because split_lines always returns at least ['']. + return self.line - len(lines) + 1, 0 # It's the first leaf. + return previous_leaf.end_pos + + +class _LeafWithoutNewlines(PythonLeaf): + """ + Simply here to optimize performance. + """ + __slots__ = () + + @property + def end_pos(self): + return self.line, self.column + len(self.value) + + +# Python base classes +class PythonBaseNode(PythonMixin, BaseNode): + __slots__ = () + + +class PythonNode(PythonMixin, Node): + __slots__ = () + + +class PythonErrorNode(PythonMixin, ErrorNode): + __slots__ = () + + +class PythonErrorLeaf(ErrorLeaf, PythonLeaf): + __slots__ = () + + +class EndMarker(_LeafWithoutNewlines): + __slots__ = () + type = 'endmarker' + + @utf8_repr + def __repr__(self): + return "<%s: prefix=%s end_pos=%s>" % ( + type(self).__name__, repr(self.prefix), self.end_pos + ) + + +class Newline(PythonLeaf): + """Contains NEWLINE and ENDMARKER tokens.""" + __slots__ = () + type = 'newline' + + @utf8_repr + def __repr__(self): + return "<%s: %s>" % (type(self).__name__, repr(self.value)) + + +class Name(_LeafWithoutNewlines): + """ + A string. Sometimes it is important to know if the string belongs to a name + or not. + """ + type = 'name' + __slots__ = () + + def __repr__(self): + return "<%s: %s@%s,%s>" % (type(self).__name__, self.value, + self.line, self.column) + + def is_definition(self): + """ + Returns True if the name is being defined. + """ + return self.get_definition() is not None + + def get_definition(self, import_name_always=False): + """ + Returns None if there's on definition for a name. + + :param import_name_alway: Specifies if an import name is always a + definition. Normally foo in `from foo import bar` is not a + definition. + """ + node = self.parent + type_ = node.type + if type_ in ('power', 'atom_expr'): + # In `self.x = 3` self is not a definition, but x is. + return None + + if type_ in ('funcdef', 'classdef'): + if self == node.name: + return node + return None + + if type_ == 'except_clause': + # TODO in Python 2 this doesn't work correctly. See grammar file. + # I think we'll just let it be. Python 2 will be gone in a few + # years. + if self.get_previous_sibling() == 'as': + return node.parent # The try_stmt. + return None + + while node is not None: + if node.type == 'suite': + return None + if node.type in _GET_DEFINITION_TYPES: + if self in node.get_defined_names(): + return node + if import_name_always and node.type in _IMPORTS: + return node + return None + node = node.parent + return None + + +class Literal(PythonLeaf): + __slots__ = () + + +class Number(Literal): + type = 'number' + __slots__ = () + + +class String(Literal): + type = 'string' + __slots__ = () + + @property + def string_prefix(self): + return re.match(r'\w*(?=[\'"])', self.value).group(0) + + def _get_payload(self): + match = re.search( + r'''('{3}|"{3}|'|")(.*)$''', + self.value, + flags=re.DOTALL + ) + return match.group(2)[:-len(match.group(1))] + + +class FStringString(PythonLeaf): + """ + f-strings contain f-string expressions and normal python strings. These are + the string parts of f-strings. + """ + type = 'fstring_string' + __slots__ = () + + +class FStringStart(PythonLeaf): + """ + f-strings contain f-string expressions and normal python strings. These are + the string parts of f-strings. + """ + type = 'fstring_start' + __slots__ = () + + +class FStringEnd(PythonLeaf): + """ + f-strings contain f-string expressions and normal python strings. These are + the string parts of f-strings. + """ + type = 'fstring_end' + __slots__ = () + + +class _StringComparisonMixin(object): + def __eq__(self, other): + """ + Make comparisons with strings easy. + Improves the readability of the parser. + """ + if isinstance(other, (str, unicode)): + return self.value == other + + return self is other + + def __ne__(self, other): + """Python 2 compatibility.""" + return not self.__eq__(other) + + def __hash__(self): + return hash(self.value) + + +class Operator(_LeafWithoutNewlines, _StringComparisonMixin): + type = 'operator' + __slots__ = () + + +class Keyword(_LeafWithoutNewlines, _StringComparisonMixin): + type = 'keyword' + __slots__ = () + + +class Scope(PythonBaseNode, DocstringMixin): + """ + Super class for the parser tree, which represents the state of a python + text file. + A Scope is either a function, class or lambda. + """ + __slots__ = () + + def __init__(self, children): + super(Scope, self).__init__(children) + + def iter_funcdefs(self): + """ + Returns a generator of `funcdef` nodes. + """ + return self._search_in_scope('funcdef') + + def iter_classdefs(self): + """ + Returns a generator of `classdef` nodes. + """ + return self._search_in_scope('classdef') + + def iter_imports(self): + """ + Returns a generator of `import_name` and `import_from` nodes. + """ + return self._search_in_scope('import_name', 'import_from') + + def _search_in_scope(self, *names): + def scan(children): + for element in children: + if element.type in names: + yield element + if element.type in _FUNC_CONTAINERS: + for e in scan(element.children): + yield e + + return scan(self.children) + + def get_suite(self): + """ + Returns the part that is executed by the function. + """ + return self.children[-1] + + def __repr__(self): + try: + name = self.name.value + except AttributeError: + name = '' + + return "<%s: %s@%s-%s>" % (type(self).__name__, name, + self.start_pos[0], self.end_pos[0]) + + +class Module(Scope): + """ + The top scope, which is always a module. + Depending on the underlying parser this may be a full module or just a part + of a module. + """ + __slots__ = ('_used_names',) + type = 'file_input' + + def __init__(self, children): + super(Module, self).__init__(children) + self._used_names = None + + def _iter_future_import_names(self): + """ + :return: A list of future import names. + :rtype: list of str + """ + # In Python it's not allowed to use future imports after the first + # actual (non-future) statement. However this is not a linter here, + # just return all future imports. If people want to scan for issues + # they should use the API. + for imp in self.iter_imports(): + if imp.type == 'import_from' and imp.level == 0: + for path in imp.get_paths(): + names = [name.value for name in path] + if len(names) == 2 and names[0] == '__future__': + yield names[1] + + def _has_explicit_absolute_import(self): + """ + Checks if imports in this module are explicitly absolute, i.e. there + is a ``__future__`` import. + Currently not public, might be in the future. + :return bool: + """ + for name in self._iter_future_import_names(): + if name == 'absolute_import': + return True + return False + + def get_used_names(self): + """ + Returns all the :class:`Name` leafs that exist in this module. This + includes both definitions and references of names. + """ + if self._used_names is None: + # Don't directly use self._used_names to eliminate a lookup. + dct = {} + + def recurse(node): + try: + children = node.children + except AttributeError: + if node.type == 'name': + arr = dct.setdefault(node.value, []) + arr.append(node) + else: + for child in children: + recurse(child) + + recurse(self) + self._used_names = UsedNamesMapping(dct) + return self._used_names + + +class Decorator(PythonBaseNode): + type = 'decorator' + __slots__ = () + + +class ClassOrFunc(Scope): + __slots__ = () + + @property + def name(self): + """ + Returns the `Name` leaf that defines the function or class name. + """ + return self.children[1] + + def get_decorators(self): + """ + :rtype: list of :class:`Decorator` + """ + decorated = self.parent + if decorated.type == 'async_funcdef': + decorated = decorated.parent + + if decorated.type == 'decorated': + if decorated.children[0].type == 'decorators': + return decorated.children[0].children + else: + return decorated.children[:1] + else: + return [] + + +class Class(ClassOrFunc): + """ + Used to store the parsed contents of a python class. + """ + type = 'classdef' + __slots__ = () + + def __init__(self, children): + super(Class, self).__init__(children) + + def get_super_arglist(self): + """ + Returns the `arglist` node that defines the super classes. It returns + None if there are no arguments. + """ + if self.children[2] != '(': # Has no parentheses + return None + else: + if self.children[3] == ')': # Empty parentheses + return None + else: + return self.children[3] + + +def _create_params(parent, argslist_list): + """ + `argslist_list` is a list that can contain an argslist as a first item, but + most not. It's basically the items between the parameter brackets (which is + at most one item). + This function modifies the parser structure. It generates `Param` objects + from the normal ast. Those param objects do not exist in a normal ast, but + make the evaluation of the ast tree so much easier. + You could also say that this function replaces the argslist node with a + list of Param objects. + """ + def check_python2_nested_param(node): + """ + Python 2 allows params to look like ``def x(a, (b, c))``, which is + basically a way of unpacking tuples in params. Python 3 has ditched + this behavior. Jedi currently just ignores those constructs. + """ + return node.type == 'fpdef' and node.children[0] == '(' + + try: + first = argslist_list[0] + except IndexError: + return [] + + if first.type in ('name', 'fpdef'): + if check_python2_nested_param(first): + return [first] + else: + return [Param([first], parent)] + elif first == '*': + return [first] + else: # argslist is a `typedargslist` or a `varargslist`. + if first.type == 'tfpdef': + children = [first] + else: + children = first.children + new_children = [] + start = 0 + # Start with offset 1, because the end is higher. + for end, child in enumerate(children + [None], 1): + if child is None or child == ',': + param_children = children[start:end] + if param_children: # Could as well be comma and then end. + if param_children[0] == '*' \ + and (len(param_children) == 1 + or param_children[1] == ',') \ + or check_python2_nested_param(param_children[0]) \ + or param_children[0] == '/': + for p in param_children: + p.parent = parent + new_children += param_children + else: + new_children.append(Param(param_children, parent)) + start = end + return new_children + + +class Function(ClassOrFunc): + """ + Used to store the parsed contents of a python function. + + Children:: + + 0. + 1. + 2. parameter list (including open-paren and close-paren s) + 3. or 5. + 4. or 6. Node() representing function body + 3. -> (if annotation is also present) + 4. annotation (if present) + """ + type = 'funcdef' + + def __init__(self, children): + super(Function, self).__init__(children) + parameters = self.children[2] # After `def foo` + parameters.children[1:-1] = _create_params(parameters, parameters.children[1:-1]) + + def _get_param_nodes(self): + return self.children[2].children + + def get_params(self): + """ + Returns a list of `Param()`. + """ + return [p for p in self._get_param_nodes() if p.type == 'param'] + + @property + def name(self): + return self.children[1] # First token after `def` + + def iter_yield_exprs(self): + """ + Returns a generator of `yield_expr`. + """ + def scan(children): + for element in children: + if element.type in ('classdef', 'funcdef', 'lambdef'): + continue + + try: + nested_children = element.children + except AttributeError: + if element.value == 'yield': + if element.parent.type == 'yield_expr': + yield element.parent + else: + yield element + else: + for result in scan(nested_children): + yield result + + return scan(self.children) + + def iter_return_stmts(self): + """ + Returns a generator of `return_stmt`. + """ + def scan(children): + for element in children: + if element.type == 'return_stmt' \ + or element.type == 'keyword' and element.value == 'return': + yield element + if element.type in _RETURN_STMT_CONTAINERS: + for e in scan(element.children): + yield e + + return scan(self.children) + + def iter_raise_stmts(self): + """ + Returns a generator of `raise_stmt`. Includes raise statements inside try-except blocks + """ + def scan(children): + for element in children: + if element.type == 'raise_stmt' \ + or element.type == 'keyword' and element.value == 'raise': + yield element + if element.type in _RETURN_STMT_CONTAINERS: + for e in scan(element.children): + yield e + + return scan(self.children) + + def is_generator(self): + """ + :return bool: Checks if a function is a generator or not. + """ + return next(self.iter_yield_exprs(), None) is not None + + @property + def annotation(self): + """ + Returns the test node after `->` or `None` if there is no annotation. + """ + try: + if self.children[3] == "->": + return self.children[4] + assert self.children[3] == ":" + return None + except IndexError: + return None + + +class Lambda(Function): + """ + Lambdas are basically trimmed functions, so give it the same interface. + + Children:: + + 0. + *. for each argument x + -2. + -1. Node() representing body + """ + type = 'lambdef' + __slots__ = () + + def __init__(self, children): + # We don't want to call the Function constructor, call its parent. + super(Function, self).__init__(children) + # Everything between `lambda` and the `:` operator is a parameter. + self.children[1:-2] = _create_params(self, self.children[1:-2]) + + @property + def name(self): + """ + Raises an AttributeError. Lambdas don't have a defined name. + """ + raise AttributeError("lambda is not named.") + + def _get_param_nodes(self): + return self.children[1:-2] + + @property + def annotation(self): + """ + Returns `None`, lambdas don't have annotations. + """ + return None + + def __repr__(self): + return "<%s@%s>" % (self.__class__.__name__, self.start_pos) + + +class Flow(PythonBaseNode): + __slots__ = () + + +class IfStmt(Flow): + type = 'if_stmt' + __slots__ = () + + def get_test_nodes(self): + """ + E.g. returns all the `test` nodes that are named as x, below: + + if x: + pass + elif x: + pass + """ + for i, c in enumerate(self.children): + if c in ('elif', 'if'): + yield self.children[i + 1] + + def get_corresponding_test_node(self, node): + """ + Searches for the branch in which the node is and returns the + corresponding test node (see function above). However if the node is in + the test node itself and not in the suite return None. + """ + start_pos = node.start_pos + for check_node in reversed(list(self.get_test_nodes())): + if check_node.start_pos < start_pos: + if start_pos < check_node.end_pos: + return None + # In this case the node is within the check_node itself, + # not in the suite + else: + return check_node + + def is_node_after_else(self, node): + """ + Checks if a node is defined after `else`. + """ + for c in self.children: + if c == 'else': + if node.start_pos > c.start_pos: + return True + else: + return False + + +class WhileStmt(Flow): + type = 'while_stmt' + __slots__ = () + + +class ForStmt(Flow): + type = 'for_stmt' + __slots__ = () + + def get_testlist(self): + """ + Returns the input node ``y`` from: ``for x in y:``. + """ + return self.children[3] + + def get_defined_names(self): + return _defined_names(self.children[1]) + + +class TryStmt(Flow): + type = 'try_stmt' + __slots__ = () + + def get_except_clause_tests(self): + """ + Returns the ``test`` nodes found in ``except_clause`` nodes. + Returns ``[None]`` for except clauses without an exception given. + """ + for node in self.children: + if node.type == 'except_clause': + yield node.children[1] + elif node == 'except': + yield None + + +class WithStmt(Flow): + type = 'with_stmt' + __slots__ = () + + def get_defined_names(self): + """ + Returns the a list of `Name` that the with statement defines. The + defined names are set after `as`. + """ + names = [] + for with_item in self.children[1:-2:2]: + # Check with items for 'as' names. + if with_item.type == 'with_item': + names += _defined_names(with_item.children[2]) + return names + + def get_test_node_from_name(self, name): + node = name.parent + if node.type != 'with_item': + raise ValueError('The name is not actually part of a with statement.') + return node.children[0] + + +class Import(PythonBaseNode): + __slots__ = () + + def get_path_for_name(self, name): + """ + The path is the list of names that leads to the searched name. + + :return list of Name: + """ + try: + # The name may be an alias. If it is, just map it back to the name. + name = self._aliases()[name] + except KeyError: + pass + + for path in self.get_paths(): + if name in path: + return path[:path.index(name) + 1] + raise ValueError('Name should be defined in the import itself') + + def is_nested(self): + return False # By default, sub classes may overwrite this behavior + + def is_star_import(self): + return self.children[-1] == '*' + + +class ImportFrom(Import): + type = 'import_from' + __slots__ = () + + def get_defined_names(self): + """ + Returns the a list of `Name` that the import defines. The + defined names are set after `import` or in case an alias - `as` - is + present that name is returned. + """ + return [alias or name for name, alias in self._as_name_tuples()] + + def _aliases(self): + """Mapping from alias to its corresponding name.""" + return dict((alias, name) for name, alias in self._as_name_tuples() + if alias is not None) + + def get_from_names(self): + for n in self.children[1:]: + if n not in ('.', '...'): + break + if n.type == 'dotted_name': # from x.y import + return n.children[::2] + elif n == 'import': # from . import + return [] + else: # from x import + return [n] + + @property + def level(self): + """The level parameter of ``__import__``.""" + level = 0 + for n in self.children[1:]: + if n in ('.', '...'): + level += len(n.value) + else: + break + return level + + def _as_name_tuples(self): + last = self.children[-1] + if last == ')': + last = self.children[-2] + elif last == '*': + return # No names defined directly. + + if last.type == 'import_as_names': + as_names = last.children[::2] + else: + as_names = [last] + for as_name in as_names: + if as_name.type == 'name': + yield as_name, None + else: + yield as_name.children[::2] # yields x, y -> ``x as y`` + + def get_paths(self): + """ + The import paths defined in an import statement. Typically an array + like this: ``[, ]``. + + :return list of list of Name: + """ + dotted = self.get_from_names() + + if self.children[-1] == '*': + return [dotted] + return [dotted + [name] for name, alias in self._as_name_tuples()] + + +class ImportName(Import): + """For ``import_name`` nodes. Covers normal imports without ``from``.""" + type = 'import_name' + __slots__ = () + + def get_defined_names(self): + """ + Returns the a list of `Name` that the import defines. The defined names + is always the first name after `import` or in case an alias - `as` - is + present that name is returned. + """ + return [alias or path[0] for path, alias in self._dotted_as_names()] + + @property + def level(self): + """The level parameter of ``__import__``.""" + return 0 # Obviously 0 for imports without from. + + def get_paths(self): + return [path for path, alias in self._dotted_as_names()] + + def _dotted_as_names(self): + """Generator of (list(path), alias) where alias may be None.""" + dotted_as_names = self.children[1] + if dotted_as_names.type == 'dotted_as_names': + as_names = dotted_as_names.children[::2] + else: + as_names = [dotted_as_names] + + for as_name in as_names: + if as_name.type == 'dotted_as_name': + alias = as_name.children[2] + as_name = as_name.children[0] + else: + alias = None + if as_name.type == 'name': + yield [as_name], alias + else: + # dotted_names + yield as_name.children[::2], alias + + def is_nested(self): + """ + This checks for the special case of nested imports, without aliases and + from statement:: + + import foo.bar + """ + return bool([1 for path, alias in self._dotted_as_names() + if alias is None and len(path) > 1]) + + def _aliases(self): + """ + :return list of Name: Returns all the alias + """ + return dict((alias, path[-1]) for path, alias in self._dotted_as_names() + if alias is not None) + + +class KeywordStatement(PythonBaseNode): + """ + For the following statements: `assert`, `del`, `global`, `nonlocal`, + `raise`, `return`, `yield`. + + `pass`, `continue` and `break` are not in there, because they are just + simple keywords and the parser reduces it to a keyword. + """ + __slots__ = () + + @property + def type(self): + """ + Keyword statements start with the keyword and end with `_stmt`. You can + crosscheck this with the Python grammar. + """ + return '%s_stmt' % self.keyword + + @property + def keyword(self): + return self.children[0].value + + +class AssertStmt(KeywordStatement): + __slots__ = () + + @property + def assertion(self): + return self.children[1] + + +class GlobalStmt(KeywordStatement): + __slots__ = () + + def get_global_names(self): + return self.children[1::2] + + +class ReturnStmt(KeywordStatement): + __slots__ = () + + +class YieldExpr(PythonBaseNode): + type = 'yield_expr' + __slots__ = () + + +def _defined_names(current): + """ + A helper function to find the defined names in statements, for loops and + list comprehensions. + """ + names = [] + if current.type in ('testlist_star_expr', 'testlist_comp', 'exprlist', 'testlist'): + for child in current.children[::2]: + names += _defined_names(child) + elif current.type in ('atom', 'star_expr'): + names += _defined_names(current.children[1]) + elif current.type in ('power', 'atom_expr'): + if current.children[-2] != '**': # Just if there's no operation + trailer = current.children[-1] + if trailer.children[0] == '.': + names.append(trailer.children[1]) + else: + names.append(current) + return names + + +class ExprStmt(PythonBaseNode, DocstringMixin): + type = 'expr_stmt' + __slots__ = () + + def get_defined_names(self): + """ + Returns a list of `Name` defined before the `=` sign. + """ + names = [] + if self.children[1].type == 'annassign': + names = _defined_names(self.children[0]) + return [ + name + for i in range(0, len(self.children) - 2, 2) + if '=' in self.children[i + 1].value + for name in _defined_names(self.children[i]) + ] + names + + def get_rhs(self): + """Returns the right-hand-side of the equals.""" + return self.children[-1] + + def yield_operators(self): + """ + Returns a generator of `+=`, `=`, etc. or None if there is no operation. + """ + first = self.children[1] + if first.type == 'annassign': + if len(first.children) <= 2: + return # No operator is available, it's just PEP 484. + + first = first.children[2] + yield first + + for operator in self.children[3::2]: + yield operator + + +class Param(PythonBaseNode): + """ + It's a helper class that makes business logic with params much easier. The + Python grammar defines no ``param`` node. It defines it in a different way + that is not really suited to working with parameters. + """ + type = 'param' + + def __init__(self, children, parent): + super(Param, self).__init__(children) + self.parent = parent + for child in children: + child.parent = self + + @property + def star_count(self): + """ + Is `0` in case of `foo`, `1` in case of `*foo` or `2` in case of + `**foo`. + """ + first = self.children[0] + if first in ('*', '**'): + return len(first.value) + return 0 + + @property + def default(self): + """ + The default is the test node that appears after the `=`. Is `None` in + case no default is present. + """ + has_comma = self.children[-1] == ',' + try: + if self.children[-2 - int(has_comma)] == '=': + return self.children[-1 - int(has_comma)] + except IndexError: + return None + + @property + def annotation(self): + """ + The default is the test node that appears after `:`. Is `None` in case + no annotation is present. + """ + tfpdef = self._tfpdef() + if tfpdef.type == 'tfpdef': + assert tfpdef.children[1] == ":" + assert len(tfpdef.children) == 3 + annotation = tfpdef.children[2] + return annotation + else: + return None + + def _tfpdef(self): + """ + tfpdef: see e.g. grammar36.txt. + """ + offset = int(self.children[0] in ('*', '**')) + return self.children[offset] + + @property + def name(self): + """ + The `Name` leaf of the param. + """ + if self._tfpdef().type == 'tfpdef': + return self._tfpdef().children[0] + else: + return self._tfpdef() + + def get_defined_names(self): + return [self.name] + + @property + def position_index(self): + """ + Property for the positional index of a paramter. + """ + index = self.parent.children.index(self) + try: + keyword_only_index = self.parent.children.index('*') + if index > keyword_only_index: + # Skip the ` *, ` + index -= 2 + except ValueError: + pass + try: + keyword_only_index = self.parent.children.index('/') + if index > keyword_only_index: + # Skip the ` /, ` + index -= 2 + except ValueError: + pass + return index - 1 + + def get_parent_function(self): + """ + Returns the function/lambda of a parameter. + """ + return search_ancestor(self, 'funcdef', 'lambdef') + + def get_code(self, include_prefix=True, include_comma=True): + """ + Like all the other get_code functions, but includes the param + `include_comma`. + + :param include_comma bool: If enabled includes the comma in the string output. + """ + if include_comma: + return super(Param, self).get_code(include_prefix) + + children = self.children + if children[-1] == ',': + children = children[:-1] + return self._get_code_for_children( + children, + include_prefix=include_prefix + ) + + def __repr__(self): + default = '' if self.default is None else '=%s' % self.default.get_code() + return '<%s: %s>' % (type(self).__name__, str(self._tfpdef()) + default) + + +class SyncCompFor(PythonBaseNode): + type = 'sync_comp_for' + __slots__ = () + + def get_defined_names(self): + """ + Returns the a list of `Name` that the comprehension defines. + """ + # allow async for + return _defined_names(self.children[1]) + + +# This is simply here so an older Jedi version can work with this new parso +# version. Can be deleted in the next release. +CompFor = SyncCompFor + + +class UsedNamesMapping(Mapping): + """ + This class exists for the sole purpose of creating an immutable dict. + """ + def __init__(self, dct): + self._dict = dct + + def __getitem__(self, key): + return self._dict[key] + + def __len__(self): + return len(self._dict) + + def __iter__(self): + return iter(self._dict) + + def __hash__(self): + return id(self) + + def __eq__(self, other): + # Comparing these dicts does not make sense. + return self is other diff --git a/vim/bundle/jedi-vim/pythonx/parso/parso/tree.py b/vim/bundle/jedi-vim/pythonx/parso/parso/tree.py new file mode 100644 index 0000000..f5871a6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/parso/tree.py @@ -0,0 +1,366 @@ +from abc import abstractmethod, abstractproperty + +from parso._compatibility import utf8_repr, encoding, py_version +from parso.utils import split_lines + + +def search_ancestor(node, *node_types): + """ + Recursively looks at the parents of a node and returns the first found node + that matches node_types. Returns ``None`` if no matching node is found. + + :param node: The ancestors of this node will be checked. + :param node_types: type names that are searched for. + :type node_types: tuple of str + """ + while True: + node = node.parent + if node is None or node.type in node_types: + return node + + +class NodeOrLeaf(object): + """ + The base class for nodes and leaves. + """ + __slots__ = () + type = None + ''' + The type is a string that typically matches the types of the grammar file. + ''' + + def get_root_node(self): + """ + Returns the root node of a parser tree. The returned node doesn't have + a parent node like all the other nodes/leaves. + """ + scope = self + while scope.parent is not None: + scope = scope.parent + return scope + + def get_next_sibling(self): + """ + Returns the node immediately following this node in this parent's + children list. If this node does not have a next sibling, it is None + """ + # Can't use index(); we need to test by identity + for i, child in enumerate(self.parent.children): + if child is self: + try: + return self.parent.children[i + 1] + except IndexError: + return None + + def get_previous_sibling(self): + """ + Returns the node immediately preceding this node in this parent's + children list. If this node does not have a previous sibling, it is + None. + """ + # Can't use index(); we need to test by identity + for i, child in enumerate(self.parent.children): + if child is self: + if i == 0: + return None + return self.parent.children[i - 1] + + def get_previous_leaf(self): + """ + Returns the previous leaf in the parser tree. + Returns `None` if this is the first element in the parser tree. + """ + node = self + while True: + c = node.parent.children + i = c.index(node) + if i == 0: + node = node.parent + if node.parent is None: + return None + else: + node = c[i - 1] + break + + while True: + try: + node = node.children[-1] + except AttributeError: # A Leaf doesn't have children. + return node + + def get_next_leaf(self): + """ + Returns the next leaf in the parser tree. + Returns None if this is the last element in the parser tree. + """ + node = self + while True: + c = node.parent.children + i = c.index(node) + if i == len(c) - 1: + node = node.parent + if node.parent is None: + return None + else: + node = c[i + 1] + break + + while True: + try: + node = node.children[0] + except AttributeError: # A Leaf doesn't have children. + return node + + @abstractproperty + def start_pos(self): + """ + Returns the starting position of the prefix as a tuple, e.g. `(3, 4)`. + + :return tuple of int: (line, column) + """ + + @abstractproperty + def end_pos(self): + """ + Returns the end position of the prefix as a tuple, e.g. `(3, 4)`. + + :return tuple of int: (line, column) + """ + + @abstractmethod + def get_start_pos_of_prefix(self): + """ + Returns the start_pos of the prefix. This means basically it returns + the end_pos of the last prefix. The `get_start_pos_of_prefix()` of the + prefix `+` in `2 + 1` would be `(1, 1)`, while the start_pos is + `(1, 2)`. + + :return tuple of int: (line, column) + """ + + @abstractmethod + def get_first_leaf(self): + """ + Returns the first leaf of a node or itself if this is a leaf. + """ + + @abstractmethod + def get_last_leaf(self): + """ + Returns the last leaf of a node or itself if this is a leaf. + """ + + @abstractmethod + def get_code(self, include_prefix=True): + """ + Returns the code that was input the input for the parser for this node. + + :param include_prefix: Removes the prefix (whitespace and comments) of + e.g. a statement. + """ + + +class Leaf(NodeOrLeaf): + ''' + Leafs are basically tokens with a better API. Leafs exactly know where they + were defined and what text preceeds them. + ''' + __slots__ = ('value', 'parent', 'line', 'column', 'prefix') + + def __init__(self, value, start_pos, prefix=''): + self.value = value + ''' + :py:func:`str` The value of the current token. + ''' + self.start_pos = start_pos + self.prefix = prefix + ''' + :py:func:`str` Typically a mixture of whitespace and comments. Stuff + that is syntactically irrelevant for the syntax tree. + ''' + self.parent = None + ''' + The parent :class:`BaseNode` of this leaf. + ''' + + @property + def start_pos(self): + return self.line, self.column + + @start_pos.setter + def start_pos(self, value): + self.line = value[0] + self.column = value[1] + + def get_start_pos_of_prefix(self): + previous_leaf = self.get_previous_leaf() + if previous_leaf is None: + lines = split_lines(self.prefix) + # + 1 is needed because split_lines always returns at least ['']. + return self.line - len(lines) + 1, 0 # It's the first leaf. + return previous_leaf.end_pos + + def get_first_leaf(self): + return self + + def get_last_leaf(self): + return self + + def get_code(self, include_prefix=True): + if include_prefix: + return self.prefix + self.value + else: + return self.value + + @property + def end_pos(self): + lines = split_lines(self.value) + end_pos_line = self.line + len(lines) - 1 + # Check for multiline token + if self.line == end_pos_line: + end_pos_column = self.column + len(lines[-1]) + else: + end_pos_column = len(lines[-1]) + return end_pos_line, end_pos_column + + @utf8_repr + def __repr__(self): + value = self.value + if not value: + value = self.type + return "<%s: %s>" % (type(self).__name__, value) + + +class TypedLeaf(Leaf): + __slots__ = ('type',) + + def __init__(self, type, value, start_pos, prefix=''): + super(TypedLeaf, self).__init__(value, start_pos, prefix) + self.type = type + + +class BaseNode(NodeOrLeaf): + """ + The super class for all nodes. + A node has children, a type and possibly a parent node. + """ + __slots__ = ('children', 'parent') + type = None + + def __init__(self, children): + self.children = children + """ + A list of :class:`NodeOrLeaf` child nodes. + """ + self.parent = None + ''' + The parent :class:`BaseNode` of this leaf. + None if this is the root node. + ''' + + @property + def start_pos(self): + return self.children[0].start_pos + + def get_start_pos_of_prefix(self): + return self.children[0].get_start_pos_of_prefix() + + @property + def end_pos(self): + return self.children[-1].end_pos + + def _get_code_for_children(self, children, include_prefix): + if include_prefix: + return "".join(c.get_code() for c in children) + else: + first = children[0].get_code(include_prefix=False) + return first + "".join(c.get_code() for c in children[1:]) + + def get_code(self, include_prefix=True): + return self._get_code_for_children(self.children, include_prefix) + + def get_leaf_for_position(self, position, include_prefixes=False): + """ + Get the :py:class:`parso.tree.Leaf` at ``position`` + + :param tuple position: A position tuple, row, column. Rows start from 1 + :param bool include_prefixes: If ``False``, ``None`` will be returned if ``position`` falls + on whitespace or comments before a leaf + :return: :py:class:`parso.tree.Leaf` at ``position``, or ``None`` + """ + def binary_search(lower, upper): + if lower == upper: + element = self.children[lower] + if not include_prefixes and position < element.start_pos: + # We're on a prefix. + return None + # In case we have prefixes, a leaf always matches + try: + return element.get_leaf_for_position(position, include_prefixes) + except AttributeError: + return element + + + index = int((lower + upper) / 2) + element = self.children[index] + if position <= element.end_pos: + return binary_search(lower, index) + else: + return binary_search(index + 1, upper) + + if not ((1, 0) <= position <= self.children[-1].end_pos): + raise ValueError('Please provide a position that exists within this node.') + return binary_search(0, len(self.children) - 1) + + def get_first_leaf(self): + return self.children[0].get_first_leaf() + + def get_last_leaf(self): + return self.children[-1].get_last_leaf() + + @utf8_repr + def __repr__(self): + code = self.get_code().replace('\n', ' ').replace('\r', ' ').strip() + if not py_version >= 30: + code = code.encode(encoding, 'replace') + return "<%s: %s@%s,%s>" % \ + (type(self).__name__, code, self.start_pos[0], self.start_pos[1]) + + +class Node(BaseNode): + """Concrete implementation for interior nodes.""" + __slots__ = ('type',) + + def __init__(self, type, children): + super(Node, self).__init__(children) + self.type = type + + def __repr__(self): + return "%s(%s, %r)" % (self.__class__.__name__, self.type, self.children) + + +class ErrorNode(BaseNode): + """ + A node that contains valid nodes/leaves that we're follow by a token that + was invalid. This basically means that the leaf after this node is where + Python would mark a syntax error. + """ + __slots__ = () + type = 'error_node' + + +class ErrorLeaf(Leaf): + """ + A leaf that is either completely invalid in a language (like `$` in Python) + or is invalid at that position. Like the star in `1 +* 1`. + """ + __slots__ = ('token_type',) + type = 'error_leaf' + + def __init__(self, token_type, value, start_pos, prefix=''): + super(ErrorLeaf, self).__init__(value, start_pos, prefix) + self.token_type = token_type + + def __repr__(self): + return "<%s: %s:%s, %s>" % \ + (type(self).__name__, self.token_type, repr(self.value), self.start_pos) diff --git a/vim/bundle/jedi-vim/pythonx/parso/parso/utils.py b/vim/bundle/jedi-vim/pythonx/parso/parso/utils.py new file mode 100644 index 0000000..579c4cc --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/parso/utils.py @@ -0,0 +1,175 @@ +from collections import namedtuple +import re +import sys +from ast import literal_eval + +from parso._compatibility import unicode, total_ordering + +# The following is a list in Python that are line breaks in str.splitlines, but +# not in Python. In Python only \r (Carriage Return, 0xD) and \n (Line Feed, +# 0xA) are allowed to split lines. +_NON_LINE_BREAKS = ( + u'\v', # Vertical Tabulation 0xB + u'\f', # Form Feed 0xC + u'\x1C', # File Separator + u'\x1D', # Group Separator + u'\x1E', # Record Separator + u'\x85', # Next Line (NEL - Equivalent to CR+LF. + # Used to mark end-of-line on some IBM mainframes.) + u'\u2028', # Line Separator + u'\u2029', # Paragraph Separator +) + +Version = namedtuple('Version', 'major, minor, micro') + + +def split_lines(string, keepends=False): + r""" + Intended for Python code. In contrast to Python's :py:meth:`str.splitlines`, + looks at form feeds and other special characters as normal text. Just + splits ``\n`` and ``\r\n``. + Also different: Returns ``[""]`` for an empty string input. + + In Python 2.7 form feeds are used as normal characters when using + str.splitlines. However in Python 3 somewhere there was a decision to split + also on form feeds. + """ + if keepends: + lst = string.splitlines(True) + + # We have to merge lines that were broken by form feed characters. + merge = [] + for i, line in enumerate(lst): + try: + last_chr = line[-1] + except IndexError: + pass + else: + if last_chr in _NON_LINE_BREAKS: + merge.append(i) + + for index in reversed(merge): + try: + lst[index] = lst[index] + lst[index + 1] + del lst[index + 1] + except IndexError: + # index + 1 can be empty and therefore there's no need to + # merge. + pass + + # The stdlib's implementation of the end is inconsistent when calling + # it with/without keepends. One time there's an empty string in the + # end, one time there's none. + if string.endswith('\n') or string.endswith('\r') or string == '': + lst.append('') + return lst + else: + return re.split(r'\n|\r\n|\r', string) + + +def python_bytes_to_unicode(source, encoding='utf-8', errors='strict'): + """ + Checks for unicode BOMs and PEP 263 encoding declarations. Then returns a + unicode object like in :py:meth:`bytes.decode`. + + :param encoding: See :py:meth:`bytes.decode` documentation. + :param errors: See :py:meth:`bytes.decode` documentation. ``errors`` can be + ``'strict'``, ``'replace'`` or ``'ignore'``. + """ + def detect_encoding(): + """ + For the implementation of encoding definitions in Python, look at: + - http://www.python.org/dev/peps/pep-0263/ + - http://docs.python.org/2/reference/lexical_analysis.html#encoding-declarations + """ + byte_mark = literal_eval(r"b'\xef\xbb\xbf'") + if source.startswith(byte_mark): + # UTF-8 byte-order mark + return 'utf-8' + + first_two_lines = re.match(br'(?:[^\n]*\n){0,2}', source).group(0) + possible_encoding = re.search(br"coding[=:]\s*([-\w.]+)", + first_two_lines) + if possible_encoding: + return possible_encoding.group(1) + else: + # the default if nothing else has been set -> PEP 263 + return encoding + + if isinstance(source, unicode): + # only cast str/bytes + return source + + encoding = detect_encoding() + if not isinstance(encoding, unicode): + encoding = unicode(encoding, 'utf-8', 'replace') + + # Cast to unicode + return unicode(source, encoding, errors) + + +def version_info(): + """ + Returns a namedtuple of parso's version, similar to Python's + ``sys.version_info``. + """ + from parso import __version__ + tupl = re.findall(r'[a-z]+|\d+', __version__) + return Version(*[x if i == 3 else int(x) for i, x in enumerate(tupl)]) + + +def _parse_version(version): + match = re.match(r'(\d+)(?:\.(\d)(?:\.\d+)?)?$', version) + if match is None: + raise ValueError('The given version is not in the right format. ' + 'Use something like "3.2" or "3".') + + major = int(match.group(1)) + minor = match.group(2) + if minor is None: + # Use the latest Python in case it's not exactly defined, because the + # grammars are typically backwards compatible? + if major == 2: + minor = "7" + elif major == 3: + minor = "6" + else: + raise NotImplementedError("Sorry, no support yet for those fancy new/old versions.") + minor = int(minor) + return PythonVersionInfo(major, minor) + + +@total_ordering +class PythonVersionInfo(namedtuple('Version', 'major, minor')): + def __gt__(self, other): + if isinstance(other, tuple): + if len(other) != 2: + raise ValueError("Can only compare to tuples of length 2.") + return (self.major, self.minor) > other + super(PythonVersionInfo, self).__gt__(other) + + return (self.major, self.minor) + + def __eq__(self, other): + if isinstance(other, tuple): + if len(other) != 2: + raise ValueError("Can only compare to tuples of length 2.") + return (self.major, self.minor) == other + super(PythonVersionInfo, self).__eq__(other) + + def __ne__(self, other): + return not self.__eq__(other) + + +def parse_version_string(version=None): + """ + Checks for a valid version number (e.g. `3.2` or `2.7.1` or `3`) and + returns a corresponding version info that is always two characters long in + decimal. + """ + if version is None: + version = '%s.%s' % sys.version_info[:2] + if not isinstance(version, (unicode, str)): + raise TypeError("version must be a string like 3.2.") + + return _parse_version(version) diff --git a/vim/bundle/jedi-vim/pythonx/parso/parso/utils.pyi b/vim/bundle/jedi-vim/pythonx/parso/parso/utils.pyi new file mode 100644 index 0000000..12c77da --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/parso/utils.pyi @@ -0,0 +1,29 @@ +from typing import NamedTuple, Optional, Sequence, Union + +class Version(NamedTuple): + major: int + minor: int + micro: int + +def split_lines(string: str, keepends: bool = ...) -> Sequence[str]: ... +def python_bytes_to_unicode( + source: Union[str, bytes], encoding: str = ..., errors: str = ... +) -> str: ... +def version_info() -> Version: + """ + Returns a namedtuple of parso's version, similar to Python's + ``sys.version_info``. + """ + ... + +class PythonVersionInfo(NamedTuple): + major: int + minor: int + +def parse_version_string(version: Optional[str]) -> PythonVersionInfo: + """ + Checks for a valid version number (e.g. `3.2` or `2.7.1` or `3`) and + returns a corresponding version info that is always two characters long in + decimal. + """ + ... diff --git a/vim/bundle/jedi-vim/pythonx/parso/pytest.ini b/vim/bundle/jedi-vim/pythonx/parso/pytest.ini new file mode 100644 index 0000000..cd6a4af --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/pytest.ini @@ -0,0 +1,12 @@ +[pytest] +addopts = --doctest-modules + +testpaths = parso test + +# Ignore broken files inblackbox test directories +norecursedirs = .* docs scripts normalizer_issue_files build + +# Activate `clean_jedi_cache` fixture for all tests. This should be +# fine as long as we are using `clean_jedi_cache` as a session scoped +# fixture. +usefixtures = clean_parso_cache diff --git a/vim/bundle/jedi-vim/pythonx/parso/scripts/diff_parser_profile.py b/vim/bundle/jedi-vim/pythonx/parso/scripts/diff_parser_profile.py new file mode 100755 index 0000000..a152a3e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/scripts/diff_parser_profile.py @@ -0,0 +1,50 @@ +#!/usr/bin/env python +""" +Profile a piece of Python code with ``cProfile`` that uses the diff parser. + +Usage: + profile.py [-d] [-s ] + profile.py -h | --help + +Options: + -h --help Show this screen. + -d --debug Enable Jedi internal debugging. + -s Sort the profile results, e.g. cumtime, name [default: time]. +""" + +import cProfile + +from docopt import docopt +from jedi.parser.python import load_grammar +from jedi.parser.diff import DiffParser +from jedi.parser.python import ParserWithRecovery +from jedi._compatibility import u +from jedi.common import splitlines +import jedi + + +def run(parser, lines): + diff_parser = DiffParser(parser) + diff_parser.update(lines) + # Make sure used_names is loaded + parser.module.used_names + + +def main(args): + if args['--debug']: + jedi.set_debug_function(notices=True) + + with open(args['']) as f: + code = f.read() + grammar = load_grammar() + parser = ParserWithRecovery(grammar, u(code)) + # Make sure used_names is loaded + parser.module.used_names + + code = code + '\na\n' # Add something so the diff parser needs to run. + lines = splitlines(code, keepends=True) + cProfile.runctx('run(parser, lines)', globals(), locals(), sort=args['-s']) + +if __name__ == '__main__': + args = docopt(__doc__) + main(args) diff --git a/vim/bundle/jedi-vim/pythonx/parso/setup.cfg b/vim/bundle/jedi-vim/pythonx/parso/setup.cfg new file mode 100644 index 0000000..1295389 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/setup.cfg @@ -0,0 +1,12 @@ +[bdist_wheel] +universal=1 + +[flake8] +max-line-length = 100 +ignore = + # do not use bare 'except' + E722, + # don't know why this was ever even an option, 1+1 should be possible. + E226, + # line break before binary operator + W503, diff --git a/vim/bundle/jedi-vim/pythonx/parso/setup.py b/vim/bundle/jedi-vim/pythonx/parso/setup.py new file mode 100755 index 0000000..0d70dbc --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/setup.py @@ -0,0 +1,55 @@ +#!/usr/bin/env python + +from __future__ import with_statement + +from setuptools import setup, find_packages + +import parso + + +__AUTHOR__ = 'David Halter' +__AUTHOR_EMAIL__ = 'davidhalter88@gmail.com' + +readme = open('README.rst').read() + '\n\n' + open('CHANGELOG.rst').read() + +setup(name='parso', + version=parso.__version__, + description='A Python Parser', + author=__AUTHOR__, + author_email=__AUTHOR_EMAIL__, + include_package_data=True, + maintainer=__AUTHOR__, + maintainer_email=__AUTHOR_EMAIL__, + url='https://github.com/davidhalter/parso', + license='MIT', + keywords='python parser parsing', + long_description=readme, + packages=find_packages(exclude=['test']), + package_data={'parso': ['python/grammar*.txt']}, + platforms=['any'], + classifiers=[ + 'Development Status :: 4 - Beta', + 'Environment :: Plugins', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: MIT License', + 'Operating System :: OS Independent', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.6', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Topic :: Software Development :: Libraries :: Python Modules', + 'Topic :: Text Editors :: Integrated Development Environments (IDE)', + 'Topic :: Utilities', + ], + extras_require={ + 'testing': [ + 'pytest>=3.0.7', + 'docopt', + ], + }, + ) diff --git a/vim/bundle/jedi-vim/pythonx/parso/test/__init__.py b/vim/bundle/jedi-vim/pythonx/parso/test/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/vim/bundle/jedi-vim/pythonx/parso/test/failing_examples.py b/vim/bundle/jedi-vim/pythonx/parso/test/failing_examples.py new file mode 100644 index 0000000..c15cbf8 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/test/failing_examples.py @@ -0,0 +1,321 @@ +# -*- coding: utf-8 -*- +import sys +from textwrap import dedent + + +def indent(code): + lines = code.splitlines(True) + return ''.join([' ' * 2 + line for line in lines]) + + +def build_nested(code, depth, base='def f():\n'): + if depth == 0: + return code + + new_code = base + indent(code) + return build_nested(new_code, depth - 1, base=base) + + +FAILING_EXAMPLES = [ + '1 +', + '?', + 'continue', + 'break', + 'return', + 'yield', + + # SyntaxError from Python/ast.c + 'f(x for x in bar, 1)', + 'from foo import a,', + 'from __future__ import whatever', + 'from __future__ import braces', + 'from .__future__ import whatever', + 'def f(x=3, y): pass', + 'lambda x=3, y: x', + '__debug__ = 1', + 'with x() as __debug__: pass', + # Mostly 3.6 relevant + '[]: int', + '[a, b]: int', + '(): int', + '(()): int', + '((())): int', + '{}: int', + 'True: int', + '(a, b): int', + '*star,: int', + 'a, b: int = 3', + 'foo(+a=3)', + 'f(lambda: 1=1)', + 'f(x=1, x=2)', + 'f(**x, y)', + 'f(x=2, y)', + 'f(**x, *y)', + 'f(**x, y=3, z)', + 'a, b += 3', + '(a, b) += 3', + '[a, b] += 3', + # All assignment tests + 'lambda a: 1 = 1', + '[x for x in y] = 1', + '{x for x in y} = 1', + '{x:x for x in y} = 1', + '(x for x in y) = 1', + 'None = 1', + '... = 1', + 'a == b = 1', + '{a, b} = 1', + '{a: b} = 1', + '1 = 1', + '"" = 1', + 'b"" = 1', + 'b"" = 1', + '"" "" = 1', + '1 | 1 = 3', + '1**1 = 3', + '~ 1 = 3', + 'not 1 = 3', + '1 and 1 = 3', + 'def foo(): (yield 1) = 3', + 'def foo(): x = yield 1 = 3', + 'async def foo(): await x = 3', + '(a if a else a) = a', + 'a, 1 = x', + 'foo() = 1', + # Cases without the equals but other assignments. + 'with x as foo(): pass', + 'del bar, 1', + 'for x, 1 in []: pass', + 'for (not 1) in []: pass', + '[x for 1 in y]', + '[x for a, 3 in y]', + '(x for 1 in y)', + '{x for 1 in y}', + '{x:x for 1 in y}', + # Unicode/Bytes issues. + r'u"\x"', + r'u"\"', + r'u"\u"', + r'u"""\U"""', + r'u"\Uffffffff"', + r"u'''\N{}'''", + r"u'\N{foo}'", + r'b"\x"', + r'b"\"', + '*a, *b = 3, 3', + 'async def foo(): yield from []', + 'yield from []', + '*a = 3', + 'del *a, b', + 'def x(*): pass', + '(%s *d) = x' % ('a,' * 256), + '{**{} for a in [1]}', + + # Parser/tokenize.c + r'"""', + r'"', + r"'''", + r"'", + r"\blub", + # IndentationError: too many levels of indentation + build_nested('pass', 100), + + # SyntaxErrors from Python/symtable.c + 'def f(x, x): pass', + 'nonlocal a', + + # IndentationError + ' foo', + 'def x():\n 1\n 2', + 'def x():\n 1\n 2', + 'if 1:\nfoo', + 'if 1: blubb\nif 1:\npass\nTrue and False', + + # f-strings + 'f"{}"', + r'f"{\}"', + 'f"{\'\\\'}"', + 'f"{#}"', + "f'{1!b}'", + "f'{1:{5:{3}}}'", + "f'{'", + "f'{'", + "f'}'", + "f'{\"}'", + "f'{\"}'", + # Now nested parsing + "f'{continue}'", + "f'{1;1}'", + "f'{a;}'", + "f'{b\"\" \"\"}'", +] + +GLOBAL_NONLOCAL_ERROR = [ + dedent(''' + def glob(): + x = 3 + x.z + global x'''), + dedent(''' + def glob(): + x = 3 + global x'''), + dedent(''' + def glob(): + x + global x'''), + dedent(''' + def glob(): + x = 3 + x.z + nonlocal x'''), + dedent(''' + def glob(): + x = 3 + nonlocal x'''), + dedent(''' + def glob(): + x + nonlocal x'''), + # Annotation issues + dedent(''' + def glob(): + x[0]: foo + global x'''), + dedent(''' + def glob(): + x.a: foo + global x'''), + dedent(''' + def glob(): + x: foo + global x'''), + dedent(''' + def glob(): + x: foo = 5 + global x'''), + dedent(''' + def glob(): + x: foo = 5 + x + global x'''), + dedent(''' + def glob(): + global x + x: foo = 3 + '''), + # global/nonlocal + param + dedent(''' + def glob(x): + global x + '''), + dedent(''' + def glob(x): + nonlocal x + '''), + dedent(''' + def x(): + a =3 + def z(): + nonlocal a + a = 3 + nonlocal a + '''), + dedent(''' + def x(): + a = 4 + def y(): + global a + nonlocal a + '''), + # Missing binding of nonlocal + dedent(''' + def x(): + nonlocal a + '''), + dedent(''' + def x(): + def y(): + nonlocal a + '''), + dedent(''' + def x(): + a = 4 + def y(): + global a + print(a) + def z(): + nonlocal a + '''), +] + +if sys.version_info >= (3, 6): + FAILING_EXAMPLES += GLOBAL_NONLOCAL_ERROR +if sys.version_info >= (3, 5): + FAILING_EXAMPLES += [ + # Raises different errors so just ignore them for now. + '[*[] for a in [1]]', + # Raises multiple errors in previous versions. + 'async def bla():\n def x(): await bla()', + ] +if sys.version_info >= (3, 4): + # Before that del None works like del list, it gives a NameError. + FAILING_EXAMPLES.append('del None') +if sys.version_info >= (3,): + FAILING_EXAMPLES += [ + # Unfortunately assigning to False and True do not raise an error in + # 2.x. + '(True,) = x', + '([False], a) = x', + # A symtable error that raises only a SyntaxWarning in Python 2. + 'def x(): from math import *', + # unicode chars in bytes are allowed in python 2 + 'b"ä"', + # combining strings and unicode is allowed in Python 2. + '"s" b""', + '"s" b"" ""', + 'b"" "" b"" ""', + ] +if sys.version_info >= (3, 6): + FAILING_EXAMPLES += [ + # Same as above, but for f-strings. + 'f"s" b""', + 'b"s" f""', + ] +if sys.version_info >= (2, 7): + # This is something that raises a different error in 2.6 than in the other + # versions. Just skip it for 2.6. + FAILING_EXAMPLES.append('[a, 1] += 3') + +if sys.version_info[:2] == (3, 5): + # yields are not allowed in 3.5 async functions. Therefore test them + # separately, here. + FAILING_EXAMPLES += [ + 'async def foo():\n yield x', + 'async def foo():\n yield x', + ] +else: + FAILING_EXAMPLES += [ + 'async def foo():\n yield x\n return 1', + 'async def foo():\n yield x\n return 1', + ] + + +if sys.version_info[:2] <= (3, 4): + # Python > 3.4 this is valid code. + FAILING_EXAMPLES += [ + 'a = *[1], 2', + '(*[1], 2)', + ] + +if sys.version_info[:2] < (3, 8): + FAILING_EXAMPLES += [ + # Python/compile.c + dedent('''\ + for a in [1]: + try: + pass + finally: + continue + '''), # 'continue' not supported inside 'finally' clause" + ] diff --git a/vim/bundle/jedi-vim/pythonx/parso/test/fuzz_diff_parser.py b/vim/bundle/jedi-vim/pythonx/parso/test/fuzz_diff_parser.py new file mode 100644 index 0000000..7e7098a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/test/fuzz_diff_parser.py @@ -0,0 +1,290 @@ +""" +A script to find bugs in the diff parser. + +This script is extremely useful if changes are made to the diff parser. By +running a few thousand iterations, we can assure that the diff parser is in +good shape. + +Usage: + fuzz_diff_parser.py [--pdb|--ipdb] [-l] [-n=] [-x=] random [] + fuzz_diff_parser.py [--pdb|--ipdb] [-l] redo [-o=] [-p] + fuzz_diff_parser.py -h | --help + +Options: + -h --help Show this screen + -n, --maxtries= Maximum of random tries [default: 1000] + -x, --changes= Amount of changes to be done to a file per try [default: 5] + -l, --logging Prints all the logs + -o, --only-last= Only runs the last n iterations; Defaults to running all + -p, --print-code Print all test diffs + --pdb Launch pdb when error is raised + --ipdb Launch ipdb when error is raised +""" + +from __future__ import print_function +import logging +import sys +import os +import random +import pickle + +import parso +from parso.utils import split_lines +from test.test_diff_parser import _check_error_leaves_nodes + +_latest_grammar = parso.load_grammar(version='3.8') +_python_reserved_strings = tuple( + # Keywords are ususally only interesting in combination with spaces after + # them. We don't put a space before keywords, to avoid indentation errors. + s + (' ' if s.isalpha() else '') + for s in _latest_grammar._pgen_grammar.reserved_syntax_strings.keys() +) +_random_python_fragments = _python_reserved_strings + ( + ' ', '\t', '\n', '\r', '\f', 'f"', 'F"""', "fr'", "RF'''", '"', '"""', "'", + "'''", ';', ' some_random_word ', '\\', '#', +) + + +def find_python_files_in_tree(file_path): + if not os.path.isdir(file_path): + yield file_path + return + for root, dirnames, filenames in os.walk(file_path): + for name in filenames: + if name.endswith('.py'): + yield os.path.join(root, name) + + +def _print_copyable_lines(lines): + for line in lines: + line = repr(line)[1:-1] + if line.endswith(r'\n'): + line = line[:-2] + '\n' + print(line, end='') + + +def _get_first_error_start_pos_or_none(module): + error_leaf = _check_error_leaves_nodes(module) + return None if error_leaf is None else error_leaf.start_pos + + +class LineReplacement: + def __init__(self, line_nr, new_line): + self._line_nr = line_nr + self._new_line = new_line + + def apply(self, code_lines): + # print(repr(self._new_line)) + code_lines[self._line_nr] = self._new_line + + +class LineDeletion: + def __init__(self, line_nr): + self.line_nr = line_nr + + def apply(self, code_lines): + del code_lines[self.line_nr] + + +class LineCopy: + def __init__(self, copy_line, insertion_line): + self._copy_line = copy_line + self._insertion_line = insertion_line + + def apply(self, code_lines): + code_lines.insert( + self._insertion_line, + # Use some line from the file. This doesn't feel totally + # random, but for the diff parser it will feel like it. + code_lines[self._copy_line] + ) + + +class FileModification: + @classmethod + def generate(cls, code_lines, change_count): + return cls( + list(cls._generate_line_modifications(code_lines, change_count)), + # work with changed trees more than with normal ones. + check_original=random.random() > 0.8, + ) + + @staticmethod + def _generate_line_modifications(lines, change_count): + def random_line(include_end=False): + return random.randint(0, len(lines) - (not include_end)) + + lines = list(lines) + for _ in range(change_count): + rand = random.randint(1, 4) + if rand == 1: + if len(lines) == 1: + # We cannot delete every line, that doesn't make sense to + # fuzz and it would be annoying to rewrite everything here. + continue + l = LineDeletion(random_line()) + elif rand == 2: + # Copy / Insertion + # Make it possible to insert into the first and the last line + l = LineCopy(random_line(), random_line(include_end=True)) + elif rand in (3, 4): + # Modify a line in some weird random ways. + line_nr = random_line() + line = lines[line_nr] + column = random.randint(0, len(line)) + random_string = '' + for _ in range(random.randint(1, 3)): + if random.random() > 0.8: + # The lower characters cause way more issues. + unicode_range = 0x1f if random.randint(0, 1) else 0x3000 + random_string += chr(random.randint(0, unicode_range)) + else: + # These insertions let us understand how random + # keyword/operator insertions work. Theoretically this + # could also be done with unicode insertions, but the + # fuzzer is just way more effective here. + random_string += random.choice(_random_python_fragments) + if random.random() > 0.5: + # In this case we insert at a very random place that + # probably breaks syntax. + line = line[:column] + random_string + line[column:] + else: + # Here we have better chances to not break syntax, because + # we really replace the line with something that has + # indentation. + line = ' ' * random.randint(0, 12) + random_string + '\n' + l = LineReplacement(line_nr, line) + l.apply(lines) + yield l + + def __init__(self, modification_list, check_original): + self._modification_list = modification_list + self._check_original = check_original + + def _apply(self, code_lines): + changed_lines = list(code_lines) + for modification in self._modification_list: + modification.apply(changed_lines) + return changed_lines + + def run(self, grammar, code_lines, print_code): + code = ''.join(code_lines) + modified_lines = self._apply(code_lines) + modified_code = ''.join(modified_lines) + + if print_code: + if self._check_original: + print('Original:') + _print_copyable_lines(code_lines) + + print('\nModified:') + _print_copyable_lines(modified_lines) + print() + + if self._check_original: + m = grammar.parse(code, diff_cache=True) + start1 = _get_first_error_start_pos_or_none(m) + + grammar.parse(modified_code, diff_cache=True) + + if self._check_original: + # Also check if it's possible to "revert" the changes. + m = grammar.parse(code, diff_cache=True) + start2 = _get_first_error_start_pos_or_none(m) + assert start1 == start2, (start1, start2) + + +class FileTests: + def __init__(self, file_path, test_count, change_count): + self._path = file_path + with open(file_path) as f: + code = f.read() + self._code_lines = split_lines(code, keepends=True) + self._test_count = test_count + self._code_lines = self._code_lines + self._change_count = change_count + self._file_modifications = [] + + def _run(self, grammar, file_modifications, debugger, print_code=False): + try: + for i, fm in enumerate(file_modifications, 1): + fm.run(grammar, self._code_lines, print_code=print_code) + print('.', end='') + sys.stdout.flush() + print() + except Exception: + print("Issue in file: %s" % self._path) + if debugger: + einfo = sys.exc_info() + pdb = __import__(debugger) + pdb.post_mortem(einfo[2]) + raise + + def redo(self, grammar, debugger, only_last, print_code): + mods = self._file_modifications + if only_last is not None: + mods = mods[-only_last:] + self._run(grammar, mods, debugger, print_code=print_code) + + def run(self, grammar, debugger): + def iterate(): + for _ in range(self._test_count): + fm = FileModification.generate(self._code_lines, self._change_count) + self._file_modifications.append(fm) + yield fm + + self._run(grammar, iterate(), debugger) + + +def main(arguments): + debugger = 'pdb' if arguments['--pdb'] else \ + 'ipdb' if arguments['--ipdb'] else None + redo_file = os.path.join(os.path.dirname(__file__), 'fuzz-redo.pickle') + + if arguments['--logging']: + root = logging.getLogger() + root.setLevel(logging.DEBUG) + + ch = logging.StreamHandler(sys.stdout) + ch.setLevel(logging.DEBUG) + root.addHandler(ch) + + grammar = parso.load_grammar() + parso.python.diff.DEBUG_DIFF_PARSER = True + if arguments['redo']: + with open(redo_file, 'rb') as f: + file_tests_obj = pickle.load(f) + only_last = arguments['--only-last'] and int(arguments['--only-last']) + file_tests_obj.redo( + grammar, + debugger, + only_last=only_last, + print_code=arguments['--print-code'] + ) + elif arguments['random']: + # A random file is used to do diff parser checks if no file is given. + # This helps us to find errors in a lot of different files. + file_paths = list(find_python_files_in_tree(arguments[''] or '.')) + max_tries = int(arguments['--maxtries']) + tries = 0 + try: + while tries < max_tries: + path = random.choice(file_paths) + print("Checking %s: %s tries" % (path, tries)) + now_tries = min(1000, max_tries - tries) + file_tests_obj = FileTests(path, now_tries, int(arguments['--changes'])) + file_tests_obj.run(grammar, debugger) + tries += now_tries + except Exception: + with open(redo_file, 'wb') as f: + pickle.dump(file_tests_obj, f) + raise + else: + raise NotImplementedError('Command is not implemented') + + +if __name__ == '__main__': + from docopt import docopt + + arguments = docopt(__doc__) + main(arguments) diff --git a/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E10.py b/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E10.py new file mode 100644 index 0000000..38d7a19 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E10.py @@ -0,0 +1,51 @@ +for a in 'abc': + for b in 'xyz': + hello(a) # indented with 8 spaces + #: E903:0 + hello(b) # indented with 1 tab +if True: + #: E101:0 + pass + +#: E122+1 +change_2_log = \ +"""Change 2 by slamb@testclient on 2006/04/13 21:46:23 + + creation +""" + +p4change = { + 2: change_2_log, +} + + +class TestP4Poller(unittest.TestCase): + def setUp(self): + self.setUpGetProcessOutput() + return self.setUpChangeSource() + + def tearDown(self): + pass + + +# +if True: + #: E101:0 E101+1:0 + foo(1, + 2) + + +def test_keys(self): + """areas.json - All regions are accounted for.""" + expected = set([ + #: E101:0 + u'Norrbotten', + #: E101:0 + u'V\xe4sterbotten', + ]) + + +if True: + hello(""" + tab at start of this line +""") diff --git a/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E101.py b/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E101.py new file mode 100644 index 0000000..cc24719 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E101.py @@ -0,0 +1,137 @@ +# Used to be the file for W191 + +#: E101+1 +if False: + print # indented with 1 tab + +#: E101+1 +y = x == 2 \ + or x == 3 +#: E101+5 +if ( + x == ( + 3 + ) or + y == 4): + pass +#: E101+3 +if x == 2 \ + or y > 1 \ + or x == 3: + pass +#: E101+3 +if x == 2 \ + or y > 1 \ + or x == 3: + pass + +#: E101+1 +if (foo == bar and baz == frop): + pass +#: E101+1 +if (foo == bar and baz == frop): + pass + +#: E101+2 E101+3 +if start[1] > end_col and not ( + over_indent == 4 and indent_next): + assert (0, "E121 continuation line over-" + "indented for visual indent") + + +#: E101+3 +def long_function_name( + var_one, var_two, var_three, + var_four): + hello(var_one) + + +#: E101+2 +if ((row < 0 or self.moduleCount <= row or + col < 0 or self.moduleCount <= col)): + raise Exception("%s,%s - %s" % (row, col, self.moduleCount)) +#: E101+1 E101+2 E101+3 E101+4 E101+5 E101+6 +if bar: + assert ( + start, 'E121 lines starting with a ' + 'closing bracket should be indented ' + "to match that of the opening " + "bracket's line" + ) + +# you want vertical alignment, so use a parens +#: E101+3 +if ((foo.bar("baz") and + foo.bar("frop") + )): + hello("yes") +#: E101+3 +# also ok, but starting to look like LISP +if ((foo.bar("baz") and + foo.bar("frop"))): + hello("yes") +#: E101+1 +if (a == 2 or b == "abc def ghi" "jkl mno"): + assert True +#: E101+2 +if (a == 2 or b == """abc def ghi +jkl mno"""): + assert True +#: E101+1 E101+2 +if length > options.max_line_length: + assert options.max_line_length, \ + "E501 line too long (%d characters)" % length + + +#: E101+1 E101+2 +if os.path.exists(os.path.join(path, PEP8_BIN)): + cmd = ([os.path.join(path, PEP8_BIN)] + + self._pep8_options(targetfile)) +# TODO Tabs in docstrings shouldn't be there, use \t. +''' + multiline string with tab in it''' +# Same here. +'''multiline string + with tabs + and spaces +''' +# Okay +'''sometimes, you just need to go nuts in a multiline string + and allow all sorts of crap + like mixed tabs and spaces + +or trailing whitespace +or long long long long long long long long long long long long long long long long long lines +''' # noqa +# Okay +'''this one + will get no warning +even though the noqa comment is not immediately after the string +''' + foo # noqa + +#: E101+2 +if foo is None and bar is "frop" and \ + blah == 'yeah': + blah = 'yeahnah' + + +#: E101+1 E101+2 E101+3 +if True: + foo( + 1, + 2) + + +#: E101+1 E101+2 E101+3 E101+4 E101+5 +def test_keys(self): + """areas.json - All regions are accounted for.""" + expected = set([ + u'Norrbotten', + u'V\xe4sterbotten', + ]) + + +#: E101+1 +x = [ + 'abc' +] diff --git a/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E11.py b/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E11.py new file mode 100644 index 0000000..9b97f39 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E11.py @@ -0,0 +1,60 @@ +if x > 2: + #: E111:2 + hello(x) +if True: + #: E111:5 + print + #: E111:6 + # + #: E111:2 + # what + # Comment is fine +# Comment is also fine + +if False: + pass +print +print +#: E903:0 + print +mimetype = 'application/x-directory' +#: E111:5 + # 'httpd/unix-directory' +create_date = False + + +def start(self): + # foo + #: E111:8 + # bar + if True: # Hello + self.master.start() # Comment + # try: + #: E111:12 + # self.master.start() + # except MasterExit: + #: E111:12 + # self.shutdown() + # finally: + #: E111:12 + # sys.exit() + # Dedent to the first level + #: E111:6 + # error +# Dedent to the base level +#: E111:2 + # Also wrongly indented. +# Indent is correct. + + +def start(self): # Correct comment + if True: + #: E111:0 +# try: + #: E111:0 +# self.master.start() + #: E111:0 +# except MasterExit: + #: E111:0 +# self.shutdown() + self.master.start() # comment diff --git a/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E12_first.py b/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E12_first.py new file mode 100644 index 0000000..8dc65a5 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E12_first.py @@ -0,0 +1,78 @@ +abc = "E121", ( + #: E121:2 + "dent") +abc = "E122", ( + #: E121:0 +"dent") +my_list = [ + 1, 2, 3, + 4, 5, 6, + #: E123 + ] +abc = "E124", ("visual", + "indent_two" + #: E124:14 + ) +abc = "E124", ("visual", + "indent_five" + #: E124:0 +) +a = (123, + #: E124:0 +) +#: E129+1:4 +if (row < 0 or self.moduleCount <= row or + col < 0 or self.moduleCount <= col): + raise Exception("%s,%s - %s" % (row, col, self.moduleCount)) + +abc = "E126", ( + #: E126:12 + "dent") +abc = "E126", ( + #: E126:8 + "dent") +abc = "E127", ("over-", + #: E127:18 + "over-indent") +abc = "E128", ("visual", + #: E128:4 + "hanging") +abc = "E128", ("under-", + #: E128:14 + "under-indent") + + +my_list = [ + 1, 2, 3, + 4, 5, 6, + #: E123:5 + ] +result = { + #: E121:3 + 'key1': 'value', + #: E121:3 + 'key2': 'value', +} +rv.update(dict.fromkeys(( + 'qualif_nr', 'reasonComment_en', 'reasonComment_fr', + 'reasonComment_de', 'reasonComment_it'), + #: E128:10 + '?'), + "foo") + +abricot = 3 + \ + 4 + \ + 5 + 6 +abc = "hello", ( + + "there", + #: E126:5 + # "john", + "dude") +part = set_mimetype(( + a.get('mime_type', 'text')), + 'default') +part = set_mimetype(( + a.get('mime_type', 'text')), + #: E127:21 + 'default') diff --git a/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E12_not_first.py b/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E12_not_first.py new file mode 100644 index 0000000..fc3b5f9 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E12_not_first.py @@ -0,0 +1,356 @@ +# The issue numbers described in this file are part of the pycodestyle tracker +# and not of parso. +# Originally there were no issues in here, I (dave) added the ones that were +# necessary and IMO useful. +if ( + x == ( + 3 + ) or + y == 4): + pass + +y = x == 2 \ + or x == 3 + +#: E129+1:4 +if x == 2 \ + or y > 1 \ + or x == 3: + pass + +if x == 2 \ + or y > 1 \ + or x == 3: + pass + + +if (foo == bar and + baz == frop): + pass + +#: E129+1:4 E129+2:4 E123+3 +if ( + foo == bar and + baz == frop +): + pass + +if ( + foo == bar and + baz == frop + #: E129:4 + ): + pass + +a = ( +) + +a = (123, + ) + + +if start[1] > end_col and not ( + over_indent == 4 and indent_next): + assert (0, "E121 continuation line over-" + "indented for visual indent") + + +abc = "OK", ("visual", + "indent") + +abc = "Okay", ("visual", + "indent_three" + ) + +abc = "a-ok", ( + "there", + "dude", +) + +abc = "hello", ( + "there", + "dude") + +abc = "hello", ( + + "there", + # "john", + "dude") + +abc = "hello", ( + "there", "dude") + +abc = "hello", ( + "there", "dude", +) + +# Aligned with opening delimiter +foo = long_function_name(var_one, var_two, + var_three, var_four) + +# Extra indentation is not necessary. +foo = long_function_name( + var_one, var_two, + var_three, var_four) + + +arm = 'AAA' \ + 'BBB' \ + 'CCC' + +bbb = 'AAA' \ + 'BBB' \ + 'CCC' + +cc = ('AAA' + 'BBB' + 'CCC') + +cc = {'text': 'AAA' + 'BBB' + 'CCC'} + +cc = dict(text='AAA' + 'BBB') + +sat = 'AAA' \ + 'BBB' \ + 'iii' \ + 'CCC' + +abricot = (3 + + 4 + + 5 + 6) + +#: E122+1:4 +abricot = 3 + \ + 4 + \ + 5 + 6 + +part = [-1, 2, 3, + 4, 5, 6] + +#: E128+1:8 +part = [-1, (2, 3, + 4, 5, 6), 7, + 8, 9, 0] + +fnct(1, 2, 3, + 4, 5, 6) + +fnct(1, 2, 3, + 4, 5, 6, + 7, 8, 9, + 10, 11) + + +def long_function_name( + var_one, var_two, var_three, + var_four): + hello(var_one) + + +if ((row < 0 or self.moduleCount <= row or + col < 0 or self.moduleCount <= col)): + raise Exception("%s,%s - %s" % (row, col, self.moduleCount)) + + +result = { + 'foo': [ + 'bar', { + 'baz': 'frop', + } + ] +} + + +foo = my.func({ + "foo": "bar", +}, "baz") + + +fooff(aaaa, + cca( + vvv, + dadd + ), fff, + ggg) + +fooff(aaaa, + abbb, + cca( + vvv, + aaa, + dadd), + "visual indentation is not a multiple of four",) + +if bar: + assert ( + start, 'E121 lines starting with a ' + 'closing bracket should be indented ' + "to match that of the opening " + "bracket's line" + ) + +# you want vertical alignment, so use a parens +if ((foo.bar("baz") and + foo.bar("frop") + )): + hello("yes") + +# also ok, but starting to look like LISP +if ((foo.bar("baz") and + foo.bar("frop"))): + hello("yes") + +#: E129+1:4 E127+2:9 +if (a == 2 or + b == "abc def ghi" + "jkl mno"): + assert True + +#: E129+1:4 +if (a == 2 or + b == """abc def ghi +jkl mno"""): + assert True + +if length > options.max_line_length: + assert options.max_line_length, \ + "E501 line too long (%d characters)" % length + + +# blub + + +asd = 'l.{line}\t{pos}\t{name}\t{text}'.format( + line=token[2][0], + pos=pos, + name=tokenize.tok_name[token[0]], + text=repr(token[1]), +) + +#: E121+1:6 E121+2:6 +hello('%-7d %s per second (%d total)' % ( + options.counters[key] / elapsed, key, + options.counters[key])) + + +if os.path.exists(os.path.join(path, PEP8_BIN)): + cmd = ([os.path.join(path, PEP8_BIN)] + + self._pep8_options(targetfile)) + + +fixed = (re.sub(r'\t+', ' ', target[c::-1], 1)[::-1] + + target[c + 1:]) + +fixed = ( + re.sub(r'\t+', ' ', target[c::-1], 1)[::-1] + + target[c + 1:] +) + + +if foo is None and bar is "frop" and \ + blah == 'yeah': + blah = 'yeahnah' + + +"""This is a multi-line + docstring.""" + + +if blah: + # is this actually readable? :) + multiline_literal = """ +while True: + if True: + 1 +""".lstrip() + multiline_literal = ( + """ +while True: + if True: + 1 +""".lstrip() + ) + multiline_literal = ( + """ +while True: + if True: + 1 +""" + .lstrip() + ) + + +if blah: + multiline_visual = (""" +while True: + if True: + 1 +""" + .lstrip()) + + +rv = {'aaa': 42} +rv.update(dict.fromkeys(( + #: E121:4 E121+1:4 + 'qualif_nr', 'reasonComment_en', 'reasonComment_fr', + 'reasonComment_de', 'reasonComment_it'), '?')) + +rv.update(dict.fromkeys(('qualif_nr', 'reasonComment_en', + 'reasonComment_fr', 'reasonComment_de', + 'reasonComment_it'), '?')) + +#: E128+1:10 +rv.update(dict.fromkeys(('qualif_nr', 'reasonComment_en', 'reasonComment_fr', + 'reasonComment_de', 'reasonComment_it'), '?')) + + +rv.update(dict.fromkeys( + ('qualif_nr', 'reasonComment_en', 'reasonComment_fr', + 'reasonComment_de', 'reasonComment_it'), '?' + ), "foo", context={ + 'alpha': 4, 'beta': 53242234, 'gamma': 17, + }) + + +rv.update( + dict.fromkeys(( + 'qualif_nr', 'reasonComment_en', 'reasonComment_fr', + 'reasonComment_de', 'reasonComment_it'), '?'), + "foo", + context={ + 'alpha': 4, 'beta': 53242234, 'gamma': 17, + }, +) + + +event_obj.write(cursor, user_id, { + 'user': user, + 'summary': text, + 'data': data, + }) + +event_obj.write(cursor, user_id, { + 'user': user, + 'summary': text, + 'data': {'aaa': 1, 'bbb': 2}, + }) + +event_obj.write(cursor, user_id, { + 'user': user, + 'summary': text, + 'data': { + 'aaa': 1, + 'bbb': 2}, + }) + +event_obj.write(cursor, user_id, { + 'user': user, + 'summary': text, + 'data': {'timestamp': now, 'content': { + 'aaa': 1, + 'bbb': 2 + }}, + }) diff --git a/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E12_not_second.py b/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E12_not_second.py new file mode 100644 index 0000000..e7c18e0 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E12_not_second.py @@ -0,0 +1,294 @@ + +def qualify_by_address( + self, cr, uid, ids, context=None, + params_to_check=frozenset(QUALIF_BY_ADDRESS_PARAM)): + """ This gets called by the web server """ + + +def qualify_by_address(self, cr, uid, ids, context=None, + params_to_check=frozenset(QUALIF_BY_ADDRESS_PARAM)): + """ This gets called by the web server """ + + +_ipv4_re = re.compile('^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.' + '(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.' + '(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.' + '(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$') + + +fct(""" + AAA """ + status_2_string) + + +if context: + msg = """\ +action: GET-CONFIG +payload: + ip_address: "%(ip)s" + username: "%(username)s" +""" % context + + +if context: + msg = """\ +action: \ +GET-CONFIG +""" % context + + +if context: + #: E122+2:0 + msg = """\ +action: """\ +"""GET-CONFIG +""" % context + + +def unicode2html(s): + """Convert the characters &<>'" in string s to HTML-safe sequences. + Convert newline to
too.""" + #: E127+1:28 + return unicode((s or '').replace('&', '&') + .replace('\n', '
\n')) + + +parser.add_option('--count', action='store_true', + help="print total number of errors and warnings " + "to standard error and set exit code to 1 if " + "total is not null") + +parser.add_option('--exclude', metavar='patterns', default=DEFAULT_EXCLUDE, + help="exclude files or directories which match these " + "comma separated patterns (default: %s)" % + DEFAULT_EXCLUDE) + +add_option('--count', + #: E135+1 + help="print total number of errors " + "to standard error total is not null") + +add_option('--count', + #: E135+2:11 + help="print total number of errors " + "to standard error " + "total is not null") + + +help = ("print total number of errors " + + "to standard error") + +help = "print total number of errors " \ + "to standard error" + +help = u"print total number of errors " \ + u"to standard error" + +help = b"print total number of errors " \ + b"to standard error" + +#: E122+1:5 +help = br"print total number of errors " \ + br"to standard error" + +d = dict('foo', help="exclude files or directories which match these " + #: E135:9 + "comma separated patterns (default: %s)" % DEFAULT_EXCLUDE) + +d = dict('foo', help=u"exclude files or directories which match these " + u"comma separated patterns (default: %s)" + % DEFAULT_EXCLUDE) + +#: E135+1:9 E135+2:9 +d = dict('foo', help=b"exclude files or directories which match these " + b"comma separated patterns (default: %s)" + % DEFAULT_EXCLUDE) + +d = dict('foo', help=br"exclude files or directories which match these " + br"comma separated patterns (default: %s)" % + DEFAULT_EXCLUDE) + +d = dict('foo', + help="exclude files or directories which match these " + "comma separated patterns (default: %s)" % + DEFAULT_EXCLUDE) + +d = dict('foo', + help="exclude files or directories which match these " + "comma separated patterns (default: %s, %s)" % + (DEFAULT_EXCLUDE, DEFAULT_IGNORE) + ) + +d = dict('foo', + help="exclude files or directories which match these " + "comma separated patterns (default: %s, %s)" % + # who knows what might happen here? + (DEFAULT_EXCLUDE, DEFAULT_IGNORE) + ) + +# parens used to allow the indenting. +troublefree_hash = { + "hash": "value", + "long": ("the quick brown fox jumps over the lazy dog before doing a " + "somersault"), + "long key that tends to happen more when you're indented": ( + "stringwithalongtoken you don't want to break" + ), +} + +# another accepted form +troublefree_hash = { + "hash": "value", + "long": "the quick brown fox jumps over the lazy dog before doing " + "a somersault", + ("long key that tends to happen more " + "when you're indented"): "stringwithalongtoken you don't want to break", +} +# confusing but accepted... don't do that +troublesome_hash = { + "hash": "value", + "long": "the quick brown fox jumps over the lazy dog before doing a " + #: E135:4 + "somersault", + "longer": + "the quick brown fox jumps over the lazy dog before doing a " + "somersaulty", + "long key that tends to happen more " + "when you're indented": "stringwithalongtoken you don't want to break", +} + +d = dict('foo', + help="exclude files or directories which match these " + "comma separated patterns (default: %s)" % + DEFAULT_EXCLUDE + ) +d = dict('foo', + help="exclude files or directories which match these " + "comma separated patterns (default: %s)" % DEFAULT_EXCLUDE, + foobar="this clearly should work, because it is at " + "the right indent level", + ) + +rv.update(dict.fromkeys( + ('qualif_nr', 'reasonComment_en', 'reasonComment_fr', + 'reasonComment_de', 'reasonComment_it'), + '?'), "foo", + context={'alpha': 4, 'beta': 53242234, 'gamma': 17}) + + +def f(): + try: + if not Debug: + hello(''' +If you would like to see debugging output, +try: %s -d5 +''' % sys.argv[0]) + + +# The try statement above was not finished. +#: E901 +d = { # comment + 1: 2 +} + +# issue 138 (we won't allow this in parso) +#: E126+2:9 +[ + 12, # this is a multi-line inline + # comment +] +# issue 151 +#: E122+1:3 +if a > b and \ + c > d: + moo_like_a_cow() + +my_list = [ + 1, 2, 3, + 4, 5, 6, +] + +my_list = [1, 2, 3, + 4, 5, 6, + ] + +result = some_function_that_takes_arguments( + 'a', 'b', 'c', + 'd', 'e', 'f', +) + +result = some_function_that_takes_arguments('a', 'b', 'c', + 'd', 'e', 'f', + ) + +# issue 203 +dica = { + ('abc' + 'def'): ( + 'abc'), +} + +(abcdef[0] + [1]) = ( + 'abc') + +('abc' + 'def') == ( + 'abc') + +# issue 214 +bar( + 1).zap( + 2) + +bar( + 1).zap( + 2) + +if True: + + def example_issue254(): + return [node.copy( + ( + replacement + # First, look at all the node's current children. + for child in node.children + # Replace them. + for replacement in replace(child) + ), + dict(name=token.undefined) + )] + + +def valid_example(): + return [node.copy(properties=dict( + (key, val if val is not None else token.undefined) + for key, val in node.items() + ))] + + +foo([ + 'bug' +]) + +# issue 144, finally! +some_hash = { + "long key that tends to happen more when you're indented": + "stringwithalongtoken you don't want to break", +} + +{ + 1: + 999999 if True + else 0, +} + + +abc = dedent( + ''' + mkdir -p ./{build}/ + mv ./build/ ./{build}/%(revision)s/ + '''.format( + build='build', + # more stuff + ) +) diff --git a/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E12_second.py b/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E12_second.py new file mode 100644 index 0000000..5488ea4 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E12_second.py @@ -0,0 +1,195 @@ +if True: + result = some_function_that_takes_arguments( + 'a', 'b', 'c', + 'd', 'e', 'f', + #: E123:0 +) +#: E122+1 +if some_very_very_very_long_variable_name or var \ +or another_very_long_variable_name: + raise Exception() +#: E122+1 +if some_very_very_very_long_variable_name or var[0] \ +or another_very_long_variable_name: + raise Exception() +if True: + #: E122+1 + if some_very_very_very_long_variable_name or var \ + or another_very_long_variable_name: + raise Exception() +if True: + #: E122+1 + if some_very_very_very_long_variable_name or var[0] \ + or another_very_long_variable_name: + raise Exception() + +#: E901+1:8 +dictionary = [ + "is": { + # Might be a E122:4, but is not because the code is invalid Python. + "nested": yes(), + }, +] +setup('', + scripts=[''], + classifiers=[ + #: E121:6 + 'Development Status :: 4 - Beta', + 'Environment :: Console', + 'Intended Audience :: Developers', + ]) + + +#: E123+2:4 E291:15 +abc = "E123", ( + "bad", "hanging", "close" + ) + +result = { + 'foo': [ + 'bar', { + 'baz': 'frop', + #: E123 + } + #: E123 + ] + #: E123 + } +result = some_function_that_takes_arguments( + 'a', 'b', 'c', + 'd', 'e', 'f', + #: E123 + ) +my_list = [1, 2, 3, + 4, 5, 6, + #: E124:0 +] +my_list = [1, 2, 3, + 4, 5, 6, + #: E124:19 + ] +#: E124+2 +result = some_function_that_takes_arguments('a', 'b', 'c', + 'd', 'e', 'f', +) +fooff(aaaa, + cca( + vvv, + dadd + ), fff, + #: E124:0 +) +fooff(aaaa, + ccaaa( + vvv, + dadd + ), + fff, + #: E124:0 +) +d = dict('foo', + help="exclude files or directories which match these " + "comma separated patterns (default: %s)" % DEFAULT_EXCLUDE + #: E124:14 + ) + +if line_removed: + self.event(cr, uid, + #: E128:8 + name="Removing the option for contract", + #: E128:8 + description="contract line has been removed", + #: E124:8 + ) + +#: E129+1:4 +if foo is None and bar is "frop" and \ + blah == 'yeah': + blah = 'yeahnah' + + +#: E129+1:4 E129+2:4 +def long_function_name( + var_one, var_two, var_three, + var_four): + hello(var_one) + + +def qualify_by_address( + #: E129:4 E129+1:4 + self, cr, uid, ids, context=None, + params_to_check=frozenset(QUALIF_BY_ADDRESS_PARAM)): + """ This gets called by the web server """ + + +#: E129+1:4 E129+2:4 +if (a == 2 or + b == "abc def ghi" + "jkl mno"): + True + +my_list = [ + 1, 2, 3, + 4, 5, 6, + #: E123:8 + ] + +abris = 3 + \ + 4 + \ + 5 + 6 + +fixed = re.sub(r'\t+', ' ', target[c::-1], 1)[::-1] + \ + target[c + 1:] + +rv.update(dict.fromkeys(( + 'qualif_nr', 'reasonComment_en', 'reasonComment_fr', + #: E121:12 + 'reasonComment_de', 'reasonComment_it'), + '?'), + #: E128:4 + "foo") +#: E126+1:8 +eat_a_dict_a_day({ + "foo": "bar", +}) +#: E129+1:4 +if ( + x == ( + 3 + #: E129:4 + ) or + y == 4): + pass +#: E129+1:4 E121+2:8 E129+3:4 +if ( + x == ( + 3 + ) or + x == ( + # This one has correct indentation. + 3 + #: E129:4 + ) or + y == 4): + pass +troublesome_hash = { + "hash": "value", + #: E135+1:8 + "long": "the quick brown fox jumps over the lazy dog before doing a " + "somersault", +} + +# Arguments on first line forbidden when not using vertical alignment +#: E128+1:4 +foo = long_function_name(var_one, var_two, + var_three, var_four) + +#: E128+1:4 +hello('l.%s\t%s\t%s\t%r' % + (token[2][0], pos, tokenize.tok_name[token[0]], token[1])) + + +def qualify_by_address(self, cr, uid, ids, context=None, + #: E128:8 + params_to_check=frozenset(QUALIF_BY_ADDRESS_PARAM)): + """ This gets called by the web server """ diff --git a/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E12_third.py b/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E12_third.py new file mode 100644 index 0000000..26697fe --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E12_third.py @@ -0,0 +1,116 @@ +#: E128+1 +foo(1, 2, 3, +4, 5, 6) +#: E128+1:1 +foo(1, 2, 3, + 4, 5, 6) +#: E128+1:2 +foo(1, 2, 3, + 4, 5, 6) +#: E128+1:3 +foo(1, 2, 3, + 4, 5, 6) +foo(1, 2, 3, + 4, 5, 6) +#: E127+1:5 +foo(1, 2, 3, + 4, 5, 6) +#: E127+1:6 +foo(1, 2, 3, + 4, 5, 6) +#: E127+1:7 +foo(1, 2, 3, + 4, 5, 6) +#: E127+1:8 +foo(1, 2, 3, + 4, 5, 6) +#: E127+1:9 +foo(1, 2, 3, + 4, 5, 6) +#: E127+1:10 +foo(1, 2, 3, + 4, 5, 6) +#: E127+1:11 +foo(1, 2, 3, + 4, 5, 6) +#: E127+1:12 +foo(1, 2, 3, + 4, 5, 6) +#: E127+1:13 +foo(1, 2, 3, + 4, 5, 6) +if line_removed: + #: E128+1:14 E128+2:14 + self.event(cr, uid, + name="Removing the option for contract", + description="contract line has been removed", + ) + +if line_removed: + self.event(cr, uid, + #: E127:16 + name="Removing the option for contract", + #: E127:16 + description="contract line has been removed", + #: E124:16 + ) +rv.update(d=('a', 'b', 'c'), + #: E127:13 + e=42) + +#: E135+2:17 +rv.update(d=('a' + 'b', 'c'), + e=42, f=42 + + 42) +rv.update(d=('a' + 'b', 'c'), + e=42, f=42 + + 42) +#: E127+1:26 +input1 = {'a': {'calc': 1 + 2}, 'b': 1 + + 42} +#: E128+2:17 +rv.update(d=('a' + 'b', 'c'), + e=42, f=(42 + + 42)) + +if True: + def example_issue254(): + #: + return [node.copy( + ( + #: E121:16 E121+3:20 + replacement + # First, look at all the node's current children. + for child in node.children + for replacement in replace(child) + ), + dict(name=token.undefined) + )] +# TODO multiline docstring are currently not handled. E125+1:4? +if (""" + """): + pass + +# TODO same +for foo in """ + abc + 123 + """.strip().split(): + hello(foo) +abc = dedent( + ''' + mkdir -p ./{build}/ + mv ./build/ ./{build}/%(revision)s/ + '''.format( + #: E121:4 E121+1:4 E123+2:0 + build='build', + # more stuff +) +) +#: E701+1: E122+1 +if True:\ +hello(True) + +#: E128+1 +foobar(a +, end=' ') diff --git a/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E20.py b/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E20.py new file mode 100644 index 0000000..44986fa --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E20.py @@ -0,0 +1,52 @@ +#: E201:5 +spam( ham[1], {eggs: 2}) +#: E201:9 +spam(ham[ 1], {eggs: 2}) +#: E201:14 +spam(ham[1], { eggs: 2}) + +# Okay +spam(ham[1], {eggs: 2}) + + +#: E202:22 +spam(ham[1], {eggs: 2} ) +#: E202:21 +spam(ham[1], {eggs: 2 }) +#: E202:10 +spam(ham[1 ], {eggs: 2}) +# Okay +spam(ham[1], {eggs: 2}) + +result = func( + arg1='some value', + arg2='another value', +) + +result = func( + arg1='some value', + arg2='another value' +) + +result = [ + item for item in items + if item > 5 +] + +#: E203:9 +if x == 4 : + foo(x, y) + x, y = y, x +if x == 4: + #: E203:12 E702:13 + a = x, y ; x, y = y, x +if x == 4: + foo(x, y) + #: E203:12 + x, y = y , x +# Okay +if x == 4: + foo(x, y) + x, y = y, x +a[b1, :1] == 3 +b = a[:, b1] diff --git a/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E21.py b/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E21.py new file mode 100644 index 0000000..f65616e --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E21.py @@ -0,0 +1,16 @@ +#: E211:4 +spam (1) +#: E211:4 E211:19 +dict ['key'] = list [index] +#: E211:11 +dict['key'] ['subkey'] = list[index] +# Okay +spam(1) +dict['key'] = list[index] + + +# This is not prohibited by PEP8, but avoid it. +# Dave: I think this is extremely stupid. Use the same convention everywhere. +#: E211:9 +class Foo (Bar, Baz): + pass diff --git a/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E22.py b/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E22.py new file mode 100644 index 0000000..82ff6a4 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E22.py @@ -0,0 +1,156 @@ +a = 12 + 3 +#: E221:5 E229:8 +b = 4 + 5 +#: E221:1 +x = 1 +#: E221:1 +y = 2 +long_variable = 3 +#: E221:4 +x[0] = 1 +#: E221:4 +x[1] = 2 +long_variable = 3 +#: E221:8 E229:19 +x = f(x) + 1 +y = long_variable + 2 +#: E221:8 E229:19 +z = x[0] + 3 +#: E221+2:13 +text = """ + bar + foo %s""" % rofl +# Okay +x = 1 +y = 2 +long_variable = 3 + + +#: E221:7 +a = a + 1 +b = b + 10 +#: E221:3 +x = -1 +#: E221:3 +y = -2 +long_variable = 3 +#: E221:6 +x[0] = 1 +#: E221:6 +x[1] = 2 +long_variable = 3 + + +#: E223+1:1 +foobart = 4 +a = 3 # aligned with tab + + +#: E223:4 +a += 1 +b += 1000 + + +#: E225:12 +submitted +=1 +#: E225:9 +submitted+= 1 +#: E225:3 +c =-1 +#: E229:7 +x = x /2 - 1 +#: E229:11 +c = alpha -4 +#: E229:10 +c = alpha- 4 +#: E229:8 +z = x **y +#: E229:14 +z = (x + 1) **y +#: E229:13 +z = (x + 1)** y +#: E227:14 +_1kB = _1MB >>10 +#: E227:11 +_1kB = _1MB>> 10 +#: E225:1 E225:2 E229:4 +i=i+ 1 +#: E225:1 E225:2 E229:5 +i=i +1 +#: E225:1 E225:2 +i=i+1 +#: E225:3 +i =i+1 +#: E225:1 +i= i+1 +#: E229:8 +c = (a +b)*(a - b) +#: E229:7 +c = (a+ b)*(a - b) + +z = 2//30 +c = (a+b) * (a-b) +x = x*2 - 1 +x = x/2 - 1 +# TODO whitespace should be the other way around according to pep8. +x = x / 2-1 + +hypot2 = x*x + y*y +c = (a + b)*(a - b) + + +def halves(n): + return (i//2 for i in range(n)) + + +#: E227:11 E227:13 +_1kB = _1MB>>10 +#: E227:11 E227:13 +_1MB = _1kB<<10 +#: E227:5 E227:6 +a = b|c +#: E227:5 E227:6 +b = c&a +#: E227:5 E227:6 +c = b^a +#: E228:5 E228:6 +a = b%c +#: E228:9 E228:10 +msg = fmt%(errno, errmsg) +#: E228:25 E228:26 +msg = "Error %d occurred"%errno + +#: E228:7 +a = b %c +a = b % c + +# Okay +i = i + 1 +submitted += 1 +x = x * 2 - 1 +hypot2 = x * x + y * y +c = (a + b) * (a - b) +_1MiB = 2 ** 20 +_1TiB = 2**30 +foo(bar, key='word', *args, **kwargs) +baz(**kwargs) +negative = -1 +spam(-1) +-negative +func1(lambda *args, **kw: (args, kw)) +func2(lambda a, b=h[:], c=0: (a, b, c)) +if not -5 < x < +5: + #: E227:12 + print >>sys.stderr, "x is out of range." +print >> sys.stdout, "x is an integer." +x = x / 2 - 1 + + +def squares(n): + return (i**2 for i in range(n)) + + +ENG_PREFIXES = { + -6: "\u03bc", # Greek letter mu + -3: "m", +} diff --git a/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E23.py b/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E23.py new file mode 100644 index 0000000..47f1447 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E23.py @@ -0,0 +1,16 @@ +#: E231:7 +a = (1,2) +#: E231:5 +a[b1,:] +#: E231:10 +a = [{'a':''}] +# Okay +a = (4,) +#: E202:7 +b = (5, ) +c = {'text': text[5:]} + +result = { + 'key1': 'value', + 'key2': 'value', +} diff --git a/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E25.py b/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E25.py new file mode 100644 index 0000000..8cf5314 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E25.py @@ -0,0 +1,36 @@ +#: E251:11 E251:13 +def foo(bar = False): + '''Test function with an error in declaration''' + pass + + +#: E251:8 +foo(bar= True) +#: E251:7 +foo(bar =True) +#: E251:7 E251:9 +foo(bar = True) +#: E251:13 +y = bar(root= "sdasd") +parser.add_argument('--long-option', + #: E135+1:20 + default= + "/rather/long/filesystem/path/here/blah/blah/blah") +parser.add_argument('--long-option', + default= + "/rather/long/filesystem") +# TODO this looks so stupid. +parser.add_argument('--long-option', default + ="/rather/long/filesystem/path/here/blah/blah/blah") +#: E251+2:7 E251+2:9 +foo(True, + baz=(1, 2), + biz = 'foo' + ) +# Okay +foo(bar=(1 == 1)) +foo(bar=(1 != 1)) +foo(bar=(1 >= 1)) +foo(bar=(1 <= 1)) +(options, args) = parser.parse_args() +d[type(None)] = _deepcopy_atomic diff --git a/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E26.py b/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E26.py new file mode 100644 index 0000000..4774852 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E26.py @@ -0,0 +1,78 @@ +#: E261:4 +pass # an inline comment +#: E261:4 +pass# an inline comment + +# Okay +pass # an inline comment +pass # an inline comment +#: E262:11 +x = x + 1 #Increment x +#: E262:11 +x = x + 1 # Increment x +#: E262:11 +x = y + 1 #: Increment x +#: E265 +#Block comment +a = 1 +#: E265+1 +m = 42 +#! This is important +mx = 42 - 42 + +# Comment without anything is not an issue. +# +# However if there are comments at the end without anything it obviously +# doesn't make too much sense. +#: E262:9 +foo = 1 # + + +#: E266+2:4 E266+5:4 +def how_it_feel(r): + + ### This is a variable ### + a = 42 + + ### Of course it is unused + return + + +#: E266 E266+1 +##if DEBUG: +## logging.error() +#: E266 +######################################### + +# Not at the beginning of a file +#: E265 +#!/usr/bin/env python + +# Okay + +pass # an inline comment +x = x + 1 # Increment x +y = y + 1 #: Increment x + +# Block comment +a = 1 + +# Block comment1 + +# Block comment2 +aaa = 1 + + +# example of docstring (not parsed) +def oof(): + """ + #foo not parsed + """ + + ########################################################################### + # A SEPARATOR # + ########################################################################### + + # ####################################################################### # + # ########################## another separator ########################## # + # ####################################################################### # diff --git a/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E27.py b/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E27.py new file mode 100644 index 0000000..9149f0a --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E27.py @@ -0,0 +1,49 @@ +# Okay +from u import (a, b) +from v import c, d +#: E221:13 +from w import (e, f) +#: E275:13 +from w import(e, f) +#: E275:29 +from importable.module import(e, f) +try: + #: E275:33 + from importable.module import(e, f) +except ImportError: + pass +# Okay +True and False +#: E221:8 +True and False +#: E221:4 +True and False +#: E221:2 +if 1: + pass +# Syntax Error, no indentation +#: E903+1 +if 1: +pass +#: E223:8 +True and False +#: E223:4 E223:9 +True and False +#: E221:5 +a and b +#: E221:5 +1 and b +#: E221:5 +a and 2 +#: E221:1 E221:6 +1 and b +#: E221:1 E221:6 +a and 2 +#: E221:4 +this and False +#: E223:5 +a and b +#: E223:1 +a and b +#: E223:4 E223:9 +this and False diff --git a/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E29.py b/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E29.py new file mode 100644 index 0000000..cebbb7b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E29.py @@ -0,0 +1,15 @@ +# Okay +# 情 +#: W291:5 +print + + +#: W291+1 +class Foo(object): + + bang = 12 + + +#: W291+1:34 +'''multiline +string with trailing whitespace''' diff --git a/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E30.py b/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E30.py new file mode 100644 index 0000000..31e241c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E30.py @@ -0,0 +1,177 @@ +#: E301+4 +class X: + + def a(): + pass + def b(): + pass + + +#: E301+5 +class X: + + def a(): + pass + # comment + def b(): + pass + + +# -*- coding: utf-8 -*- +def a(): + pass + + +#: E302+1:0 +"""Main module.""" +def _main(): + pass + + +#: E302+1:0 +foo = 1 +def get_sys_path(): + return sys.path + + +#: E302+3:0 +def a(): + pass + +def b(): + pass + + +#: E302+5:0 +def a(): + pass + +# comment + +def b(): + pass + + +#: E303+3:0 +print + + + +#: E303+3:0 E303+4:0 +print + + + + +print +#: E303+3:0 +print + + + +# comment + +print + + +#: E303+3 E303+6 +def a(): + print + + + # comment + + + # another comment + + print + + +#: E302+2 +a = 3 +#: E304+1 +@decorator + +def function(): + pass + + +#: E303+3 +# something + + + +"""This class docstring comes on line 5. +It gives error E303: too many blank lines (3) +""" + + +#: E302+6 +def a(): + print + + # comment + + # another comment +a() + + +#: E302+7 +def a(): + print + + # comment + + # another comment + +try: + a() +except Exception: + pass + + +#: E302+4 +def a(): + print + +# Two spaces before comments, too. +if a(): + a() + + +#: E301+2 +def a(): + x = 1 + def b(): + pass + + +#: E301+2 E301+4 +def a(): + x = 2 + def b(): + x = 1 + def c(): + pass + + +#: E301+2 E301+4 E301+5 +def a(): + x = 1 + class C: + pass + x = 2 + def b(): + pass + + +#: E302+7 +# Example from https://github.com/PyCQA/pycodestyle/issues/400 +foo = 2 + + +def main(): + blah, blah + +if __name__ == '__main__': + main() diff --git a/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E30not.py b/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E30not.py new file mode 100644 index 0000000..c0c005c --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E30not.py @@ -0,0 +1,175 @@ +# Okay +class X: + pass +# Okay + + +def foo(): + pass + + +# Okay +# -*- coding: utf-8 -*- +class X: + pass + + +# Okay +# -*- coding: utf-8 -*- +def foo(): + pass + + +# Okay +class X: + + def a(): + pass + + # comment + def b(): + pass + + # This is a + # ... multi-line comment + + def c(): + pass + + +# This is a +# ... multi-line comment + +@some_decorator +class Y: + + def a(): + pass + + # comment + + def b(): + pass + + @property + def c(): + pass + + +try: + from nonexistent import Bar +except ImportError: + class Bar(object): + """This is a Bar replacement""" + + +def with_feature(f): + """Some decorator""" + wrapper = f + if has_this_feature(f): + def wrapper(*args): + call_feature(args[0]) + return f(*args) + return wrapper + + +try: + next +except NameError: + def next(iterator, default): + for item in iterator: + return item + return default + + +def a(): + pass + + +class Foo(): + """Class Foo""" + + def b(): + + pass + + +# comment +def c(): + pass + + +# comment + + +def d(): + pass + +# This is a +# ... multi-line comment + +# And this one is +# ... a second paragraph +# ... which spans on 3 lines + + +# Function `e` is below +# NOTE: Hey this is a testcase + +def e(): + pass + + +def a(): + print + + # comment + + print + + print + +# Comment 1 + +# Comment 2 + + +# Comment 3 + +def b(): + + pass + + +# Okay +def foo(): + pass + + +def bar(): + pass + + +class Foo(object): + pass + + +class Bar(object): + pass + + +if __name__ == '__main__': + foo() +# Okay +classification_errors = None +# Okay +defined_properly = True +# Okay +defaults = {} +defaults.update({}) + + +# Okay +def foo(x): + classification = x + definitely = not classification diff --git a/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E40.py b/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E40.py new file mode 100644 index 0000000..93a2ccf --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E40.py @@ -0,0 +1,39 @@ +#: E401:7 +import os, sys +# Okay +import os +import sys + +from subprocess import Popen, PIPE + +from myclass import MyClass +from foo.bar.yourclass import YourClass + +import myclass +import foo.bar.yourclass +# All Okay from here until the definition of VERSION +__all__ = ['abc'] + +import foo +__version__ = "42" + +import foo +__author__ = "Simon Gomizelj" + +import foo +try: + import foo +except ImportError: + pass +else: + hello('imported foo') +finally: + hello('made attempt to import foo') + +import bar +VERSION = '1.2.3' + +#: E402 +import foo +#: E402 +import foo diff --git a/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E50.py b/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E50.py new file mode 100644 index 0000000..67fd558 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E50.py @@ -0,0 +1,126 @@ +#: E501:4 +a = '12345678901234567890123456789012345678901234567890123456789012345678901234567890' +#: E501:80 +a = '1234567890123456789012345678901234567890123456789012345678901234567890' or \ + 6 +#: E501+1:80 +a = 7 or \ + '1234567890123456789012345678901234567890123456789012345678901234567890' or \ + 6 +#: E501+1:80 E501+2:80 +a = 7 or \ + '1234567890123456789012345678901234567890123456789012345678901234567890' or \ + '1234567890123456789012345678901234567890123456789012345678901234567890' or \ + 6 +#: E501:78 +a = '1234567890123456789012345678901234567890123456789012345678901234567890' # \ +#: E502:78 +a = ('123456789012345678901234567890123456789012345678901234567890123456789' \ + '01234567890') +#: E502+1:11 +a = ('AAA \ + BBB' \ + 'CCC') +#: E502:38 +if (foo is None and bar is "e000" and \ + blah == 'yeah'): + blah = 'yeahnah' +# +# Okay +a = ('AAA' + 'BBB') + +a = ('AAA \ + BBB' + 'CCC') + +a = 'AAA' \ + 'BBB' \ + 'CCC' + +a = ('AAA\ +BBBBBBBBB\ +CCCCCCCCC\ +DDDDDDDDD') +# +# Okay +if aaa: + pass +elif bbb or \ + ccc: + pass + +ddd = \ + ccc + +('\ + ' + ' \ +') +(''' + ''' + ' \ +') +#: E501:67 E225:21 E225:22 +very_long_identifiers=and_terrible_whitespace_habits(are_no_excuse+for_long_lines) +# +# TODO Long multiline strings are not handled. E501? +'''multiline string +with a long long long long long long long long long long long long long long long long line +''' +#: E501 +'''same thing, but this time without a terminal newline in the string +long long long long long long long long long long long long long long long long line''' +# +# issue 224 (unavoidable long lines in docstrings) +# Okay +""" +I'm some great documentation. Because I'm some great documentation, I'm +going to give you a reference to some valuable information about some API +that I'm calling: + + http://msdn.microsoft.com/en-us/library/windows/desktop/aa363858(v=vs.85).aspx +""" +#: E501 +""" +longnospaceslongnospaceslongnospaceslongnospaceslongnospaceslongnospaceslongnospaceslongnospaces""" + + +# Regression test for #622 +def foo(): + """Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis pulvinar vitae + """ + + +# Okay +""" +This + almost_empty_line +""" + +""" +This + almost_empty_line +""" +# A basic comment +#: E501 +# with a long long long long long long long long long long long long long long long long line + +# +# Okay +# I'm some great comment. Because I'm so great, I'm going to give you a +# reference to some valuable information about some API that I'm calling: +# +# http://msdn.microsoft.com/en-us/library/windows/desktop/aa363858(v=vs.85).aspx + +x = 3 + +# longnospaceslongnospaceslongnospaceslongnospaceslongnospaceslongnospaceslongnospaceslongnospaces + +# +# Okay +# This +# almost_empty_line + +# +#: E501+1 +# This +# almost_empty_line diff --git a/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E70.py b/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E70.py new file mode 100644 index 0000000..be11fb1 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E70.py @@ -0,0 +1,25 @@ +#: E701:6 +if a: a = False +#: E701:41 +if not header or header[:6] != 'bytes=': pass +#: E702:9 +a = False; b = True +#: E702:16 E402 +import bdist_egg; bdist_egg.write_safety_flag(cmd.egg_info, safe) +#: E703:12 E402 +import shlex; +#: E702:8 E703:22 +del a[:]; a.append(42); + + +#: E704:10 +def f(x): return 2 + + +#: E704:10 +def f(x): return 2 * x + + +while all is round: + #: E704:14 + def f(x): return 2 * x diff --git a/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E71.py b/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E71.py new file mode 100644 index 0000000..109dcd6 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E71.py @@ -0,0 +1,93 @@ +#: E711:7 +if res == None: + pass +#: E711:7 +if res != None: + pass +#: E711:8 +if None == res: + pass +#: E711:8 +if None != res: + pass +#: E711:10 +if res[1] == None: + pass +#: E711:10 +if res[1] != None: + pass +#: E711:8 +if None != res[1]: + pass +#: E711:8 +if None == res[1]: + pass + +# +#: E712:7 +if res == True: + pass +#: E712:7 +if res != False: + pass +#: E712:8 +if True != res: + pass +#: E712:9 +if False == res: + pass +#: E712:10 +if res[1] == True: + pass +#: E712:10 +if res[1] != False: + pass + +if x is False: + pass + +# +#: E713:9 +if not X in Y: + pass +#: E713:11 +if not X.B in Y: + pass +#: E713:9 +if not X in Y and Z == "zero": + pass +#: E713:24 +if X == "zero" or not Y in Z: + pass + +# +#: E714:9 +if not X is Y: + pass +#: E714:11 +if not X.B is Y: + pass + +# +# Okay +if x not in y: + pass + +if not (X in Y or X is Z): + pass + +if not (X in Y): + pass + +if x is not y: + pass + +if TrueElement.get_element(True) == TrueElement.get_element(False): + pass + +if (True) == TrueElement or x == TrueElement: + pass + +assert (not foo) in bar +assert {'x': not foo} in bar +assert [42, not foo] in bar diff --git a/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E72.py b/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E72.py new file mode 100644 index 0000000..2e9ef91 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E72.py @@ -0,0 +1,79 @@ +#: E721:3 +if type(res) == type(42): + pass +#: E721:3 +if type(res) != type(""): + pass + +import types + +if res == types.IntType: + pass + +import types + +#: E721:3 +if type(res) is not types.ListType: + pass +#: E721:7 E721:35 +assert type(res) == type(False) or type(res) == type(None) +#: E721:7 +assert type(res) == type([]) +#: E721:7 +assert type(res) == type(()) +#: E721:7 +assert type(res) == type((0,)) +#: E721:7 +assert type(res) == type((0)) +#: E721:7 +assert type(res) != type((1,)) +#: E721:7 +assert type(res) is type((1,)) +#: E721:7 +assert type(res) is not type((1,)) + +# Okay +#: E402 +import types + +if isinstance(res, int): + pass +if isinstance(res, str): + pass +if isinstance(res, types.MethodType): + pass + +#: E721:3 E721:25 +if type(a) != type(b) or type(a) == type(ccc): + pass +#: E721 +type(a) != type(b) +#: E721 +1 != type(b) +#: E721 +type(b) != 1 +1 != 1 + +try: + pass +#: E722 +except: + pass +try: + pass +except Exception: + pass +#: E722 +except: + pass +# Okay +fake_code = """" +try: + do_something() +except: + pass +""" +try: + pass +except Exception: + pass diff --git a/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E73.py b/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E73.py new file mode 100644 index 0000000..77e2e90 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E73.py @@ -0,0 +1,16 @@ +#: E731:4 +f = lambda x: 2 * x +while False: + #: E731:10 + foo = lambda y, z: 2 * x +# Okay +f = object() +f.method = lambda: 'Method' + +f = {} +f['a'] = lambda x: x ** 2 + +f = [] +f.append(lambda x: x ** 2) + +lambda: 'no-op' diff --git a/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/LICENSE b/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/LICENSE new file mode 100644 index 0000000..142a508 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/LICENSE @@ -0,0 +1,29 @@ +Copyright © 2006-2009 Johann C. Rocholl +Copyright © 2009-2014 Florent Xicluna +Copyright © 2014-2016 Ian Lee +Copyright © 2017-???? Dave Halter + +Dave: The files in this folder were ported from pydocstyle and some +modifications where made. + +Licensed under the terms of the Expat License + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation files +(the "Software"), to deal in the Software without restriction, +including without limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of the Software, +and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS +BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/allowed_syntax.py b/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/allowed_syntax.py new file mode 100644 index 0000000..9ac0a6d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/allowed_syntax.py @@ -0,0 +1,53 @@ +""" +Some syntax errors are a bit complicated and need exact checking. Here we +gather some of the potentially dangerous ones. +""" + +from __future__ import division + +# With a dot it's not a future import anymore. +from .__future__ import absolute_import + +'' '' +''r''u'' +b'' BR'' + +for x in [1]: + try: + continue # Only the other continue and pass is an error. + finally: + #: E901 + continue + + +for x in [1]: + break + continue + +try: + pass +except ZeroDivisionError: + pass + #: E722:0 +except: + pass + +try: + pass + #: E722:0 E901:0 +except: + pass +except ZeroDivisionError: + pass + + +r'\n' +r'\x' +b'\n' + + +a = 3 + + +def x(b=a): + global a diff --git a/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/allowed_syntax_python2.py b/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/allowed_syntax_python2.py new file mode 100644 index 0000000..81736bc --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/allowed_syntax_python2.py @@ -0,0 +1,2 @@ +'s' b'' +u's' b'ä' diff --git a/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/allowed_syntax_python3.4.py b/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/allowed_syntax_python3.4.py new file mode 100644 index 0000000..1759575 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/allowed_syntax_python3.4.py @@ -0,0 +1,3 @@ +*foo, a = (1,) +*foo[0], a = (1,) +*[], a = (1,) diff --git a/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/allowed_syntax_python3.5.py b/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/allowed_syntax_python3.5.py new file mode 100644 index 0000000..cc0385b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/allowed_syntax_python3.5.py @@ -0,0 +1,23 @@ +""" +Mostly allowed syntax in Python 3.5. +""" + + +async def foo(): + await bar() + #: E901 + yield from [] + return + #: E901 + return '' + + +# With decorator it's a different statement. +@bla +async def foo(): + await bar() + #: E901 + yield from [] + return + #: E901 + return '' diff --git a/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/allowed_syntax_python3.6.py b/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/allowed_syntax_python3.6.py new file mode 100644 index 0000000..1bbe071 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/allowed_syntax_python3.6.py @@ -0,0 +1,45 @@ +foo: int = 4 +(foo): int = 3 +((foo)): int = 3 +foo.bar: int +foo[3]: int + + +def glob(): + global x + y: foo = x + + +def c(): + a = 3 + + def d(): + class X(): + nonlocal a + + +def x(): + a = 3 + + def y(): + nonlocal a + + +def x(): + def y(): + nonlocal a + + a = 3 + + +def x(): + a = 3 + + def y(): + class z(): + nonlocal a + + +a = *args, *args +error[(*args, *args)] = 3 +*args, *args diff --git a/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/latin-1.py b/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/latin-1.py new file mode 100644 index 0000000..8328cfb --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/latin-1.py @@ -0,0 +1,6 @@ +# -*- coding: latin-1 -*- +# Test non-UTF8 encoding +latin1 = ('' + '') + +c = ("w") diff --git a/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/python2.7.py b/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/python2.7.py new file mode 100644 index 0000000..5d10739 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/python2.7.py @@ -0,0 +1,14 @@ +import sys + +print 1, 2 >> sys.stdout + + +foo = ur'This is not possible in Python 3.' + +# This is actually printing a tuple. +#: E275:5 +print(1, 2) + +# True and False are not keywords in Python 2 and therefore there's no need for +# a space. +norman = True+False diff --git a/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/python3.py b/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/python3.py new file mode 100644 index 0000000..566e903 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/python3.py @@ -0,0 +1,90 @@ +#!/usr/bin/env python3 +from typing import ClassVar, List + +print(1, 2) + + +# Annotated function (Issue #29) +def foo(x: int) -> int: + return x + 1 + + +# Annotated variables #575 +CONST: int = 42 + + +class Class: + cls_var: ClassVar[str] + + def m(self): + xs: List[int] = [] + + +# True and False are keywords in Python 3 and therefore need a space. +#: E275:13 E275:14 +norman = True+False + + +#: E302+3:0 +def a(): + pass + +async def b(): + pass + + +# Okay +async def add(a: int = 0, b: int = 0) -> int: + return a + b + + +# Previously E251 four times +#: E221:5 +async def add(a: int = 0, b: int = 0) -> int: + return a + b + + +# Previously just E272+1:5 E272+4:5 +#: E302+3 E221:5 E221+3:5 +async def x(): + pass + +async def x(y: int = 1): + pass + + +#: E704:16 +async def f(x): return 2 + + +a[b1, :] == a[b1, ...] + + +# Annotated Function Definitions +# Okay +def munge(input: AnyStr, sep: AnyStr = None, limit=1000, + extra: Union[str, dict] = None) -> AnyStr: + pass + + +#: E225:24 E225:26 +def x(b: tuple = (1, 2))->int: + return a + b + + +#: E252:11 E252:12 E231:8 +def b(a:int=1): + pass + + +if alpha[:-i]: + *a, b = (1, 2, 3) + + +# Named only arguments +def foo(*, asdf): + pass + + +def foo2(bar, *, asdf=2): + pass diff --git a/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/utf-8-bom.py b/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/utf-8-bom.py new file mode 100644 index 0000000..9c065c9 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/utf-8-bom.py @@ -0,0 +1,6 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +hello = 'こんにちわ' + +# EOF diff --git a/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/utf-8.py b/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/utf-8.py new file mode 100644 index 0000000..73ea9a2 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/utf-8.py @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- + +# Some random text with multi-byte characters (utf-8 encoded) +# +# Εδώ μάτσο κειμένων τη, τρόπο πιθανό διευθυντές ώρα μη. Νέων απλό παράγει ροή +# κι, το επί δεδομένη καθορίζουν. Πάντως ζητήσεις περιβάλλοντος ένα με, τη +# ξέχασε αρπάζεις φαινόμενο όλη. Τρέξει εσφαλμένη χρησιμοποίησέ νέα τι. Θα όρο +# πετάνε φακέλους, άρα με διακοπής λαμβάνουν εφαμοργής. Λες κι μειώσει +# καθυστερεί. + +# 79 narrow chars +# 01 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 [79] + +# 78 narrow chars (Na) + 1 wide char (W) +# 01 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8情 + +# 3 narrow chars (Na) + 40 wide chars (W) +# 情 情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情 + +# 3 narrow chars (Na) + 76 wide chars (W) +# 情 情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情 + +# +# 80 narrow chars (Na) +#: E501 +# 01 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 [80] +# +# 78 narrow chars (Na) + 2 wide char (W) +#: E501 +# 01 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8情情 +# +# 3 narrow chars (Na) + 77 wide chars (W) +#: E501 +# 情 情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情情 +# diff --git a/vim/bundle/jedi-vim/pythonx/parso/test/test_absolute_import.py b/vim/bundle/jedi-vim/pythonx/parso/test/test_absolute_import.py new file mode 100644 index 0000000..c959ea5 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/test/test_absolute_import.py @@ -0,0 +1,29 @@ +""" +Tests ``from __future__ import absolute_import`` (only important for +Python 2.X) +""" +from parso import parse + + +def test_explicit_absolute_imports(): + """ + Detect modules with ``from __future__ import absolute_import``. + """ + module = parse("from __future__ import absolute_import") + assert module._has_explicit_absolute_import() + + +def test_no_explicit_absolute_imports(): + """ + Detect modules without ``from __future__ import absolute_import``. + """ + assert not parse("1")._has_explicit_absolute_import() + + +def test_dont_break_imports_without_namespaces(): + """ + The code checking for ``from __future__ import absolute_import`` shouldn't + assume that all imports have non-``None`` namespaces. + """ + src = "from __future__ import absolute_import\nimport xyzzy" + assert parse(src)._has_explicit_absolute_import() diff --git a/vim/bundle/jedi-vim/pythonx/parso/test/test_cache.py b/vim/bundle/jedi-vim/pythonx/parso/test/test_cache.py new file mode 100644 index 0000000..7fef203 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/test/test_cache.py @@ -0,0 +1,89 @@ +""" +Test all things related to the ``jedi.cache`` module. +""" + +from os import unlink + +import pytest + +from parso.cache import _NodeCacheItem, save_module, load_module, \ + _get_hashed_path, parser_cache, _load_from_file_system, _save_to_file_system +from parso import load_grammar +from parso import cache +from parso import file_io + + +@pytest.fixture() +def isolated_jedi_cache(monkeypatch, tmpdir): + """ + Set `jedi.settings.cache_directory` to a temporary directory during test. + + Same as `clean_jedi_cache`, but create the temporary directory for + each test case (scope='function'). + """ + monkeypatch.setattr(cache, '_default_cache_path', str(tmpdir)) + + +def test_modulepickling_change_cache_dir(tmpdir): + """ + ParserPickling should not save old cache when cache_directory is changed. + + See: `#168 `_ + """ + dir_1 = str(tmpdir.mkdir('first')) + dir_2 = str(tmpdir.mkdir('second')) + + item_1 = _NodeCacheItem('bla', []) + item_2 = _NodeCacheItem('bla', []) + path_1 = 'fake path 1' + path_2 = 'fake path 2' + + hashed_grammar = load_grammar()._hashed + _save_to_file_system(hashed_grammar, path_1, item_1, cache_path=dir_1) + parser_cache.clear() + cached = load_stored_item(hashed_grammar, path_1, item_1, cache_path=dir_1) + assert cached == item_1.node + + _save_to_file_system(hashed_grammar, path_2, item_2, cache_path=dir_2) + cached = load_stored_item(hashed_grammar, path_1, item_1, cache_path=dir_2) + assert cached is None + + +def load_stored_item(hashed_grammar, path, item, cache_path): + """Load `item` stored at `path` in `cache`.""" + item = _load_from_file_system(hashed_grammar, path, item.change_time - 1, cache_path) + return item + + +@pytest.mark.usefixtures("isolated_jedi_cache") +def test_modulepickling_simulate_deleted_cache(tmpdir): + """ + Tests loading from a cache file after it is deleted. + According to macOS `dev docs`__, + + Note that the system may delete the Caches/ directory to free up disk + space, so your app must be able to re-create or download these files as + needed. + + It is possible that other supported platforms treat cache files the same + way. + + __ https://developer.apple.com/library/content/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/FileSystemOverview/FileSystemOverview.html + """ + grammar = load_grammar() + module = 'fake parser' + + # Create the file + path = tmpdir.dirname + '/some_path' + with open(path, 'w'): + pass + io = file_io.FileIO(path) + + save_module(grammar._hashed, io, module, lines=[]) + assert load_module(grammar._hashed, io) == module + + unlink(_get_hashed_path(grammar._hashed, path)) + parser_cache.clear() + + cached2 = load_module(grammar._hashed, io) + assert cached2 is None diff --git a/vim/bundle/jedi-vim/pythonx/parso/test/test_diff_parser.py b/vim/bundle/jedi-vim/pythonx/parso/test/test_diff_parser.py new file mode 100644 index 0000000..04e1ca0 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/test/test_diff_parser.py @@ -0,0 +1,1288 @@ +# -*- coding: utf-8 -*- +from textwrap import dedent +import logging +import sys + +import pytest + +from parso.utils import split_lines +from parso import cache +from parso import load_grammar +from parso.python.diff import DiffParser, _assert_valid_graph +from parso import parse + +ANY = object() + + +def test_simple(): + """ + The diff parser reuses modules. So check for that. + """ + grammar = load_grammar() + module_a = grammar.parse('a', diff_cache=True) + assert grammar.parse('b', diff_cache=True) == module_a + + +def _check_error_leaves_nodes(node): + if node.type in ('error_leaf', 'error_node'): + return node + + try: + children = node.children + except AttributeError: + pass + else: + for child in children: + x_node = _check_error_leaves_nodes(child) + if x_node is not None: + return x_node + return None + + +class Differ(object): + grammar = load_grammar() + + def initialize(self, code): + logging.debug('differ: initialize') + try: + del cache.parser_cache[self.grammar._hashed][None] + except KeyError: + pass + + self.lines = split_lines(code, keepends=True) + self.module = parse(code, diff_cache=True, cache=True) + assert code == self.module.get_code() + _assert_valid_graph(self.module) + return self.module + + def parse(self, code, copies=0, parsers=0, expect_error_leaves=False): + logging.debug('differ: parse copies=%s parsers=%s', copies, parsers) + lines = split_lines(code, keepends=True) + diff_parser = DiffParser( + self.grammar._pgen_grammar, + self.grammar._tokenizer, + self.module, + ) + new_module = diff_parser.update(self.lines, lines) + self.lines = lines + assert code == new_module.get_code() + + _assert_valid_graph(new_module) + + error_node = _check_error_leaves_nodes(new_module) + assert expect_error_leaves == (error_node is not None), error_node + if parsers is not ANY: + assert diff_parser._parser_count == parsers + if copies is not ANY: + assert diff_parser._copy_count == copies + return new_module + + +@pytest.fixture() +def differ(): + return Differ() + + +def test_change_and_undo(differ): + func_before = 'def func():\n pass\n' + # Parse the function and a. + differ.initialize(func_before + 'a') + # Parse just b. + differ.parse(func_before + 'b', copies=1, parsers=1) + # b has changed to a again, so parse that. + differ.parse(func_before + 'a', copies=1, parsers=1) + # Same as before parsers should not be used. Just a simple copy. + differ.parse(func_before + 'a', copies=1) + + # Now that we have a newline at the end, everything is easier in Python + # syntax, we can parse once and then get a copy. + differ.parse(func_before + 'a\n', copies=1, parsers=1) + differ.parse(func_before + 'a\n', copies=1) + + # Getting rid of an old parser: Still no parsers used. + differ.parse('a\n', copies=1) + # Now the file has completely changed and we need to parse. + differ.parse('b\n', parsers=1) + # And again. + differ.parse('a\n', parsers=1) + + +def test_positions(differ): + func_before = 'class A:\n pass\n' + m = differ.initialize(func_before + 'a') + assert m.start_pos == (1, 0) + assert m.end_pos == (3, 1) + + m = differ.parse('a', copies=1) + assert m.start_pos == (1, 0) + assert m.end_pos == (1, 1) + + m = differ.parse('a\n\n', parsers=1) + assert m.end_pos == (3, 0) + m = differ.parse('a\n\n ', copies=1, parsers=2) + assert m.end_pos == (3, 1) + m = differ.parse('a ', parsers=1) + assert m.end_pos == (1, 2) + + +def test_if_simple(differ): + src = dedent('''\ + if 1: + a = 3 + ''') + else_ = "else:\n a = ''\n" + + differ.initialize(src + 'a') + differ.parse(src + else_ + "a", copies=0, parsers=1) + + differ.parse(else_, parsers=1, copies=1, expect_error_leaves=True) + differ.parse(src + else_, parsers=1) + + +def test_func_with_for_and_comment(differ): + # The first newline is important, leave it. It should not trigger another + # parser split. + src = dedent("""\ + + def func(): + pass + + + for a in [1]: + # COMMENT + a""") + differ.initialize(src) + differ.parse('a\n' + src, copies=1, parsers=2) + + +def test_one_statement_func(differ): + src = dedent("""\ + first + def func(): a + """) + differ.initialize(src + 'second') + differ.parse(src + 'def second():\n a', parsers=1, copies=1) + + +def test_for_on_one_line(differ): + src = dedent("""\ + foo = 1 + for x in foo: pass + + def hi(): + pass + """) + differ.initialize(src) + + src = dedent("""\ + def hi(): + for x in foo: pass + pass + + pass + """) + differ.parse(src, parsers=2) + + src = dedent("""\ + def hi(): + for x in foo: pass + pass + + def nested(): + pass + """) + # The second parser is for parsing the `def nested()` which is an `equal` + # operation in the SequenceMatcher. + differ.parse(src, parsers=1, copies=1) + + +def test_open_parentheses(differ): + func = 'def func():\n a\n' + code = 'isinstance(\n\n' + func + new_code = 'isinstance(\n' + func + differ.initialize(code) + + differ.parse(new_code, parsers=1, expect_error_leaves=True) + + new_code = 'a = 1\n' + new_code + differ.parse(new_code, parsers=2, expect_error_leaves=True) + + func += 'def other_func():\n pass\n' + differ.initialize('isinstance(\n' + func) + # Cannot copy all, because the prefix of the function is once a newline and + # once not. + differ.parse('isinstance()\n' + func, parsers=2, copies=1) + + +def test_open_parentheses_at_end(differ): + code = "a['" + differ.initialize(code) + differ.parse(code, parsers=1, expect_error_leaves=True) + + +def test_backslash(differ): + src = dedent(r""" + a = 1\ + if 1 else 2 + def x(): + pass + """) + differ.initialize(src) + + src = dedent(r""" + def x(): + a = 1\ + if 1 else 2 + def y(): + pass + """) + differ.parse(src, parsers=2) + + src = dedent(r""" + def first(): + if foo \ + and bar \ + or baz: + pass + def second(): + pass + """) + differ.parse(src, parsers=1) + + +def test_full_copy(differ): + code = 'def foo(bar, baz):\n pass\n bar' + differ.initialize(code) + differ.parse(code, copies=1) + + +def test_wrong_whitespace(differ): + code = ''' + hello + ''' + differ.initialize(code) + differ.parse(code + 'bar\n ', parsers=3) + + code += """abc(\npass\n """ + differ.parse(code, parsers=2, copies=1, expect_error_leaves=True) + + +def test_issues_with_error_leaves(differ): + code = dedent(''' + def ints(): + str.. + str + ''') + code2 = dedent(''' + def ints(): + str. + str + ''') + differ.initialize(code) + differ.parse(code2, parsers=1, copies=1, expect_error_leaves=True) + + +def test_unfinished_nodes(differ): + code = dedent(''' + class a(): + def __init__(self, a): + self.a = a + def p(self): + a(1) + ''') + code2 = dedent(''' + class a(): + def __init__(self, a): + self.a = a + def p(self): + self + a(1) + ''') + differ.initialize(code) + differ.parse(code2, parsers=1, copies=2) + + +def test_nested_if_and_scopes(differ): + code = dedent(''' + class a(): + if 1: + def b(): + 2 + ''') + code2 = code + ' else:\n 3' + differ.initialize(code) + differ.parse(code2, parsers=1, copies=0) + + +def test_word_before_def(differ): + code1 = 'blub def x():\n' + code2 = code1 + ' s' + differ.initialize(code1) + differ.parse(code2, parsers=1, copies=0, expect_error_leaves=True) + + +def test_classes_with_error_leaves(differ): + code1 = dedent(''' + class X(): + def x(self): + blablabla + assert 3 + self. + + class Y(): + pass + ''') + code2 = dedent(''' + class X(): + def x(self): + blablabla + assert 3 + str( + + class Y(): + pass + ''') + + differ.initialize(code1) + differ.parse(code2, parsers=2, copies=1, expect_error_leaves=True) + + +def test_totally_wrong_whitespace(differ): + code1 = ''' + class X(): + raise n + + class Y(): + pass + ''' + code2 = ''' + class X(): + raise n + str( + + class Y(): + pass + ''' + + differ.initialize(code1) + differ.parse(code2, parsers=4, copies=0, expect_error_leaves=True) + + +def test_node_insertion(differ): + code1 = dedent(''' + class X(): + def y(self): + a = 1 + b = 2 + + c = 3 + d = 4 + ''') + code2 = dedent(''' + class X(): + def y(self): + a = 1 + b = 2 + str + + c = 3 + d = 4 + ''') + + differ.initialize(code1) + differ.parse(code2, parsers=1, copies=2) + + +def test_whitespace_at_end(differ): + code = dedent('str\n\n') + + differ.initialize(code) + differ.parse(code + '\n', parsers=1, copies=1) + + +def test_endless_while_loop(differ): + """ + This was a bug in Jedi #878. + """ + code = '#dead' + differ.initialize(code) + module = differ.parse(code, parsers=1) + assert module.end_pos == (1, 5) + + code = '#dead\n' + differ.initialize(code) + module = differ.parse(code + '\n', parsers=1) + assert module.end_pos == (3, 0) + + +def test_in_class_movements(differ): + code1 = dedent("""\ + class PlaybookExecutor: + p + b + def run(self): + 1 + try: + x + except: + pass + """) + code2 = dedent("""\ + class PlaybookExecutor: + b + def run(self): + 1 + try: + x + except: + pass + """) + + differ.initialize(code1) + differ.parse(code2, parsers=2, copies=1) + + +def test_in_parentheses_newlines(differ): + code1 = dedent(""" + x = str( + True) + + a = 1 + + def foo(): + pass + + b = 2""") + + code2 = dedent(""" + x = str(True) + + a = 1 + + def foo(): + pass + + b = 2""") + + differ.initialize(code1) + differ.parse(code2, parsers=1, copies=1) + + +def test_indentation_issue(differ): + code1 = dedent(""" + import module + """) + + code2 = dedent(""" + class L1: + class L2: + class L3: + def f(): pass + def f(): pass + def f(): pass + def f(): pass + """) + + differ.initialize(code1) + differ.parse(code2, parsers=1) + + +def test_endmarker_newline(differ): + code1 = dedent('''\ + docu = None + # some comment + result = codet + incomplete_dctassign = { + "module" + + if "a": + x = 3 # asdf + ''') + + code2 = code1.replace('codet', 'coded') + + differ.initialize(code1) + differ.parse(code2, parsers=2, copies=1, expect_error_leaves=True) + + +def test_newlines_at_end(differ): + differ.initialize('a\n\n') + differ.parse('a\n', copies=1) + + +def test_end_newline_with_decorator(differ): + code = dedent('''\ + @staticmethod + def spam(): + import json + json.l''') + + differ.initialize(code) + module = differ.parse(code + '\n', copies=1, parsers=1) + decorated, endmarker = module.children + assert decorated.type == 'decorated' + decorator, func = decorated.children + suite = func.children[-1] + assert suite.type == 'suite' + newline, first_stmt, second_stmt = suite.children + assert first_stmt.get_code() == ' import json\n' + assert second_stmt.get_code() == ' json.l\n' + + +def test_invalid_to_valid_nodes(differ): + code1 = dedent('''\ + def a(): + foo = 3 + def b(): + la = 3 + else: + la + return + foo + base + ''') + code2 = dedent('''\ + def a(): + foo = 3 + def b(): + la = 3 + if foo: + latte = 3 + else: + la + return + foo + base + ''') + + differ.initialize(code1) + differ.parse(code2, parsers=1, copies=3) + + +def test_if_removal_and_reappearence(differ): + code1 = dedent('''\ + la = 3 + if foo: + latte = 3 + else: + la + pass + ''') + + code2 = dedent('''\ + la = 3 + latte = 3 + else: + la + pass + ''') + + code3 = dedent('''\ + la = 3 + if foo: + latte = 3 + else: + la + ''') + differ.initialize(code1) + differ.parse(code2, parsers=1, copies=4, expect_error_leaves=True) + differ.parse(code1, parsers=1, copies=1) + differ.parse(code3, parsers=1, copies=1) + + +def test_add_error_indentation(differ): + code = 'if x:\n 1\n' + differ.initialize(code) + differ.parse(code + ' 2\n', parsers=1, copies=0, expect_error_leaves=True) + + +def test_differing_docstrings(differ): + code1 = dedent('''\ + def foobar(x, y): + 1 + return x + + def bazbiz(): + foobar() + lala + ''') + + code2 = dedent('''\ + def foobar(x, y): + 2 + return x + y + + def bazbiz(): + z = foobar() + lala + ''') + + differ.initialize(code1) + differ.parse(code2, parsers=3, copies=1) + differ.parse(code1, parsers=3, copies=1) + + +def test_one_call_in_function_change(differ): + code1 = dedent('''\ + def f(self): + mro = [self] + for a in something: + yield a + + def g(self): + return C( + a=str, + b=self, + ) + ''') + + code2 = dedent('''\ + def f(self): + mro = [self] + + def g(self): + return C( + a=str, + t + b=self, + ) + ''') + + differ.initialize(code1) + differ.parse(code2, parsers=1, copies=1, expect_error_leaves=True) + differ.parse(code1, parsers=2, copies=1) + + +def test_function_deletion(differ): + code1 = dedent('''\ + class C(list): + def f(self): + def iterate(): + for x in b: + break + + return list(iterate()) + ''') + + code2 = dedent('''\ + class C(): + def f(self): + for x in b: + break + + return list(iterate()) + ''') + + differ.initialize(code1) + differ.parse(code2, parsers=1, copies=0, expect_error_leaves=True) + differ.parse(code1, parsers=1, copies=0) + + +def test_docstring_removal(differ): + code1 = dedent('''\ + class E(Exception): + """ + 1 + 2 + 3 + """ + + class S(object): + @property + def f(self): + return cmd + def __repr__(self): + return cmd2 + ''') + + code2 = dedent('''\ + class E(Exception): + """ + 1 + 3 + """ + + class S(object): + @property + def f(self): + return cmd + return cmd2 + ''') + + differ.initialize(code1) + differ.parse(code2, parsers=1, copies=2) + differ.parse(code1, parsers=2, copies=1) + + +def test_paren_in_strange_position(differ): + code1 = dedent('''\ + class C: + """ ha """ + def __init__(self, message): + self.message = message + ''') + + code2 = dedent('''\ + class C: + """ ha """ + ) + def __init__(self, message): + self.message = message + ''') + + differ.initialize(code1) + differ.parse(code2, parsers=1, copies=2, expect_error_leaves=True) + differ.parse(code1, parsers=0, copies=2) + + +def insert_line_into_code(code, index, line): + lines = split_lines(code, keepends=True) + lines.insert(index, line) + return ''.join(lines) + + +def test_paren_before_docstring(differ): + code1 = dedent('''\ + # comment + """ + The + """ + from parso import tree + from parso import python + ''') + + code2 = insert_line_into_code(code1, 1, ' ' * 16 + 'raise InternalParseError(\n') + + differ.initialize(code1) + differ.parse(code2, parsers=1, copies=1, expect_error_leaves=True) + differ.parse(code1, parsers=2, copies=1) + + +def test_parentheses_before_method(differ): + code1 = dedent('''\ + class A: + def a(self): + pass + + class B: + def b(self): + if 1: + pass + ''') + + code2 = dedent('''\ + class A: + def a(self): + pass + Exception.__init__(self, "x" % + + def b(self): + if 1: + pass + ''') + + differ.initialize(code1) + differ.parse(code2, parsers=2, copies=1, expect_error_leaves=True) + differ.parse(code1, parsers=1, copies=1) + + +def test_indentation_issues(differ): + code1 = dedent('''\ + class C: + def f(): + 1 + if 2: + return 3 + + def g(): + to_be_removed + pass + ''') + + code2 = dedent('''\ + class C: + def f(): + 1 + ``something``, very ``weird``). + if 2: + return 3 + + def g(): + to_be_removed + pass + ''') + + code3 = dedent('''\ + class C: + def f(): + 1 + if 2: + return 3 + + def g(): + pass + ''') + + differ.initialize(code1) + differ.parse(code2, parsers=2, copies=2, expect_error_leaves=True) + differ.parse(code1, copies=2) + differ.parse(code3, parsers=2, copies=1) + differ.parse(code1, parsers=1, copies=2) + + +def test_error_dedent_issues(differ): + code1 = dedent('''\ + while True: + try: + 1 + except KeyError: + if 2: + 3 + except IndexError: + 4 + + 5 + ''') + + code2 = dedent('''\ + while True: + try: + except KeyError: + 1 + except KeyError: + if 2: + 3 + except IndexError: + 4 + + something_inserted + 5 + ''') + + differ.initialize(code1) + differ.parse(code2, parsers=6, copies=2, expect_error_leaves=True) + differ.parse(code1, parsers=1, copies=0) + + +def test_random_text_insertion(differ): + code1 = dedent('''\ +class C: + def f(): + return node + + def g(): + try: + 1 + except KeyError: + 2 + ''') + + code2 = dedent('''\ +class C: + def f(): + return node +Some'random text: yeah + for push in plan.dfa_pushes: + + def g(): + try: + 1 + except KeyError: + 2 + ''') + + differ.initialize(code1) + differ.parse(code2, parsers=1, copies=1, expect_error_leaves=True) + differ.parse(code1, parsers=1, copies=1) + + +def test_many_nested_ifs(differ): + code1 = dedent('''\ + class C: + def f(self): + def iterate(): + if 1: + yield t + else: + yield + return + + def g(): + 3 + ''') + + code2 = dedent('''\ + def f(self): + def iterate(): + if 1: + yield t + hahahaha + if 2: + else: + yield + return + + def g(): + 3 + ''') + + differ.initialize(code1) + differ.parse(code2, parsers=2, copies=1, expect_error_leaves=True) + differ.parse(code1, parsers=1, copies=1) + + +@pytest.mark.skipif(sys.version_info < (3, 5), reason="Async starts working in 3.5") +@pytest.mark.parametrize('prefix', ['', 'async ']) +def test_with_and_funcdef_in_call(differ, prefix): + code1 = prefix + dedent('''\ + with x: + la = C( + a=1, + b=2, + c=3, + ) + ''') + + code2 = insert_line_into_code(code1, 3, 'def y(self, args):\n') + + differ.initialize(code1) + differ.parse(code2, parsers=3, expect_error_leaves=True) + differ.parse(code1, parsers=1) + + +def test_wrong_backslash(differ): + code1 = dedent('''\ + def y(): + 1 + for x in y: + continue + ''') + + code2 = insert_line_into_code(code1, 3, '\\.whl$\n') + + differ.initialize(code1) + differ.parse(code2, parsers=2, copies=2, expect_error_leaves=True) + differ.parse(code1, parsers=1, copies=1) + + +def test_comment_change(differ): + differ.initialize('') + + +def test_random_unicode_characters(differ): + """ + Those issues were all found with the fuzzer. + """ + differ.initialize('') + differ.parse(u'\x1dĔBϞɛˁşʑ˳˻ȣſéÎ\x90̕ȟòwʘ\x1dĔBϞɛˁşʑ˳˻ȣſéÎ', parsers=1, + expect_error_leaves=True) + differ.parse(u'\r\r', parsers=1) + differ.parse(u"˟Ę\x05À\r rúƣ@\x8a\x15r()\n", parsers=1, expect_error_leaves=True) + differ.parse(u'a\ntaǁ\rGĒōns__\n\nb', parsers=1, + expect_error_leaves=sys.version_info[0] == 2) + s = ' if not (self, "_fi\x02\x0e\x08\n\nle"):' + differ.parse(s, parsers=1, expect_error_leaves=True) + differ.parse('') + differ.parse(s + '\n', parsers=1, expect_error_leaves=True) + differ.parse(u' result = (\r\f\x17\t\x11res)', parsers=2, expect_error_leaves=True) + differ.parse('') + differ.parse(' a( # xx\ndef', parsers=2, expect_error_leaves=True) + + +@pytest.mark.skipif(sys.version_info < (2, 7), reason="No set literals in Python 2.6") +def test_dedent_end_positions(differ): + code1 = dedent('''\ + if 1: + if b: + 2 + c = { + 5} + ''') + code2 = dedent('''\ + if 1: + if ⌟ഒᜈྡྷṭb: + 2 + 'l': ''} + c = { + 5} + ''') + differ.initialize(code1) + differ.parse(code2, parsers=1, expect_error_leaves=True) + differ.parse(code1, parsers=1) + + +def test_special_no_newline_ending(differ): + code1 = dedent('''\ + 1 + ''') + code2 = dedent('''\ + 1 + is ''') + differ.initialize(code1) + differ.parse(code2, copies=1, parsers=1, expect_error_leaves=True) + differ.parse(code1, copies=1, parsers=0) + + +def test_random_character_insertion(differ): + code1 = dedent('''\ + def create(self): + 1 + if self.path is not None: + return + # 3 + # 4 + ''') + code2 = dedent('''\ + def create(self): + 1 + if 2: + x return + # 3 + # 4 + ''') + differ.initialize(code1) + differ.parse(code2, copies=1, parsers=3, expect_error_leaves=True) + differ.parse(code1, copies=1, parsers=1) + + +def test_import_opening_bracket(differ): + code1 = dedent('''\ + 1 + 2 + from bubu import (X, + ''') + code2 = dedent('''\ + 11 + 2 + from bubu import (X, + ''') + differ.initialize(code1) + differ.parse(code2, copies=1, parsers=2, expect_error_leaves=True) + differ.parse(code1, copies=1, parsers=2, expect_error_leaves=True) + + +def test_opening_bracket_at_end(differ): + code1 = dedent('''\ + class C: + 1 + [ + ''') + code2 = dedent('''\ + 3 + class C: + 1 + [ + ''') + differ.initialize(code1) + differ.parse(code2, copies=1, parsers=2, expect_error_leaves=True) + differ.parse(code1, copies=1, parsers=1, expect_error_leaves=True) + + +def test_all_sorts_of_indentation(differ): + code1 = dedent('''\ + class C: + 1 + def f(): + 'same' + + if foo: + a = b + end + ''') + code2 = dedent('''\ + class C: + 1 + def f(yield await %|( + 'same' + + \x02\x06\x0f\x1c\x11 + if foo: + a = b + + end + ''') + differ.initialize(code1) + differ.parse(code2, copies=1, parsers=4, expect_error_leaves=True) + differ.parse(code1, copies=1, parsers=3) + + code3 = dedent('''\ + if 1: + a + b + c + d + \x00 + ''') + differ.parse(code3, parsers=2, expect_error_leaves=True) + differ.parse('') + + +def test_dont_copy_dedents_in_beginning(differ): + code1 = dedent('''\ + a + 4 + ''') + code2 = dedent('''\ + 1 + 2 + 3 + 4 + ''') + differ.initialize(code1) + differ.parse(code2, copies=1, parsers=1, expect_error_leaves=True) + differ.parse(code1, parsers=2) + + +def test_dont_copy_error_leaves(differ): + code1 = dedent('''\ + def f(n): + x + if 2: + 3 + ''') + code2 = dedent('''\ + def f(n): + def if 1: + indent + x + if 2: + 3 + ''') + differ.initialize(code1) + differ.parse(code2, parsers=1, expect_error_leaves=True) + differ.parse(code1, parsers=2) + + +def test_error_dedent_in_between(differ): + code1 = dedent('''\ + class C: + def f(): + a + if something: + x + z + ''') + code2 = dedent('''\ + class C: + def f(): + a + dedent + if other_thing: + b + if something: + x + z + ''') + differ.initialize(code1) + differ.parse(code2, copies=1, parsers=1, expect_error_leaves=True) + differ.parse(code1, copies=1, parsers=2) + + +def test_some_other_indentation_issues(differ): + code1 = dedent('''\ + class C: + x + def f(): + "" + copied + a + ''') + code2 = dedent('''\ + try: + de + a + b + c + d + def f(): + "" + copied + a + ''') + differ.initialize(code1) + differ.parse(code2, copies=2, parsers=1, expect_error_leaves=True) + differ.parse(code1, copies=2, parsers=2) + + +def test_open_bracket_case1(differ): + code1 = dedent('''\ + class C: + 1 + 2 # ha + ''') + code2 = insert_line_into_code(code1, 2, ' [str\n') + code3 = insert_line_into_code(code2, 4, ' str\n') + differ.initialize(code1) + differ.parse(code2, copies=1, parsers=1, expect_error_leaves=True) + differ.parse(code3, copies=1, parsers=1, expect_error_leaves=True) + differ.parse(code1, copies=1, parsers=1) + + +def test_open_bracket_case2(differ): + code1 = dedent('''\ + class C: + def f(self): + ( + b + c + + def g(self): + d + ''') + code2 = dedent('''\ + class C: + def f(self): + ( + b + c + self. + + def g(self): + d + ''') + differ.initialize(code1) + differ.parse(code2, copies=1, parsers=2, expect_error_leaves=True) + differ.parse(code1, copies=2, parsers=0, expect_error_leaves=True) + + +def test_some_weird_removals(differ): + code1 = dedent('''\ + class C: + 1 + ''') + code2 = dedent('''\ + class C: + 1 + @property + A + return + # x + omega + ''') + code3 = dedent('''\ + class C: + 1 + ; + omega + ''') + differ.initialize(code1) + differ.parse(code2, copies=1, parsers=1, expect_error_leaves=True) + differ.parse(code3, copies=1, parsers=2, expect_error_leaves=True) + differ.parse(code1, copies=1) + + +@pytest.mark.skipif(sys.version_info < (3, 5), reason="Async starts working in 3.5") +def test_async_copy(differ): + code1 = dedent('''\ + async def main(): + x = 3 + print( + ''') + code2 = dedent('''\ + async def main(): + x = 3 + print() + ''') + differ.initialize(code1) + differ.parse(code2, copies=1, parsers=1) + differ.parse(code1, copies=1, parsers=1, expect_error_leaves=True) diff --git a/vim/bundle/jedi-vim/pythonx/parso/test/test_error_recovery.py b/vim/bundle/jedi-vim/pythonx/parso/test/test_error_recovery.py new file mode 100644 index 0000000..b7d897d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/test/test_error_recovery.py @@ -0,0 +1,85 @@ +from parso import parse, load_grammar + + +def test_with_stmt(): + module = parse('with x: f.\na') + assert module.children[0].type == 'with_stmt' + w, with_item, colon, f = module.children[0].children + assert f.type == 'error_node' + assert f.get_code(include_prefix=False) == 'f.' + + assert module.children[2].type == 'name' + + +def test_one_line_function(each_version): + module = parse('def x(): f.', version=each_version) + assert module.children[0].type == 'funcdef' + def_, name, parameters, colon, f = module.children[0].children + assert f.type == 'error_node' + + module = parse('def x(a:', version=each_version) + func = module.children[0] + assert func.type == 'error_node' + if each_version.startswith('2'): + assert func.children[-1].value == 'a' + else: + assert func.children[-1] == ':' + + +def test_if_else(): + module = parse('if x:\n f.\nelse:\n g(') + if_stmt = module.children[0] + if_, test, colon, suite1, else_, colon, suite2 = if_stmt.children + f = suite1.children[1] + assert f.type == 'error_node' + assert f.children[0].value == 'f' + assert f.children[1].value == '.' + g = suite2.children[1] + assert g.children[0].value == 'g' + assert g.children[1].value == '(' + + +def test_if_stmt(): + module = parse('if x: f.\nelse: g(') + if_stmt = module.children[0] + assert if_stmt.type == 'if_stmt' + if_, test, colon, f = if_stmt.children + assert f.type == 'error_node' + assert f.children[0].value == 'f' + assert f.children[1].value == '.' + + assert module.children[1].type == 'newline' + assert module.children[1].value == '\n' + assert module.children[2].type == 'error_leaf' + assert module.children[2].value == 'else' + assert module.children[3].type == 'error_leaf' + assert module.children[3].value == ':' + + in_else_stmt = module.children[4] + assert in_else_stmt.type == 'error_node' + assert in_else_stmt.children[0].value == 'g' + assert in_else_stmt.children[1].value == '(' + + +def test_invalid_token(): + module = parse('a + ? + b') + error_node, q, plus_b, endmarker = module.children + assert error_node.get_code() == 'a +' + assert q.value == '?' + assert q.type == 'error_leaf' + assert plus_b.type == 'factor' + assert plus_b.get_code() == ' + b' + + +def test_invalid_token_in_fstr(): + module = load_grammar(version='3.6').parse('f"{a + ? + b}"') + error_node, q, plus_b, error1, error2, endmarker = module.children + assert error_node.get_code() == 'f"{a +' + assert q.value == '?' + assert q.type == 'error_leaf' + assert plus_b.type == 'error_node' + assert plus_b.get_code() == ' + b' + assert error1.value == '}' + assert error1.type == 'error_leaf' + assert error2.value == '"' + assert error2.type == 'error_leaf' diff --git a/vim/bundle/jedi-vim/pythonx/parso/test/test_file_python_errors.py b/vim/bundle/jedi-vim/pythonx/parso/test/test_file_python_errors.py new file mode 100644 index 0000000..7083dfe --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/test/test_file_python_errors.py @@ -0,0 +1,23 @@ +import os + +import parso + + +def get_python_files(path): + for dir_path, dir_names, file_names in os.walk(path): + for file_name in file_names: + if file_name.endswith('.py'): + yield os.path.join(dir_path, file_name) + + +def test_on_itself(each_version): + """ + There are obviously no syntax erros in the Python code of parso. However + parso should output the same for all versions. + """ + grammar = parso.load_grammar(version=each_version) + path = os.path.dirname(os.path.dirname(__file__)) + '/parso' + for file in get_python_files(path): + tree = grammar.parse(path=file) + errors = list(grammar.iter_errors(tree)) + assert not errors diff --git a/vim/bundle/jedi-vim/pythonx/parso/test/test_fstring.py b/vim/bundle/jedi-vim/pythonx/parso/test/test_fstring.py new file mode 100644 index 0000000..2a07ce7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/test/test_fstring.py @@ -0,0 +1,138 @@ +import pytest +from textwrap import dedent + +from parso import load_grammar, ParserSyntaxError +from parso.python.tokenize import tokenize + + +@pytest.fixture +def grammar(): + return load_grammar(version='3.8') + + +@pytest.mark.parametrize( + 'code', [ + # simple cases + 'f"{1}"', + 'f"""{1}"""', + 'f"{foo} {bar}"', + + # empty string + 'f""', + 'f""""""', + + # empty format specifier is okay + 'f"{1:}"', + + # use of conversion options + 'f"{1!a}"', + 'f"{1!a:1}"', + + # format specifiers + 'f"{1:1}"', + 'f"{1:1.{32}}"', + 'f"{1::>4}"', + 'f"{x:{y}}"', + 'f"{x:{y:}}"', + 'f"{x:{y:1}}"', + + # Escapes + 'f"{{}}"', + 'f"{{{1}}}"', + 'f"{{{1}"', + 'f"1{{2{{3"', + 'f"}}"', + + # New Python 3.8 syntax f'{a=}' + 'f"{a=}"', + 'f"{a()=}"', + + # multiline f-string + 'f"""abc\ndef"""', + 'f"""abc{\n123}def"""', + + # a line continuation inside of an fstring_string + 'f"abc\\\ndef"', + 'f"\\\n{123}\\\n"', + + # a line continuation inside of an fstring_expr + 'f"{\\\n123}"', + + # a line continuation inside of an format spec + 'f"{123:.2\\\nf}"', + ] +) +def test_valid(code, grammar): + module = grammar.parse(code, error_recovery=False) + fstring = module.children[0] + assert fstring.type == 'fstring' + assert fstring.get_code() == code + + +@pytest.mark.parametrize( + 'code', [ + # an f-string can't contain unmatched curly braces + 'f"}"', + 'f"{"', + 'f"""}"""', + 'f"""{"""', + + # invalid conversion characters + 'f"{1!{a}}"', + 'f"{!{a}}"', + + # The curly braces must contain an expression + 'f"{}"', + 'f"{:}"', + 'f"{:}}}"', + 'f"{:1}"', + 'f"{!:}"', + 'f"{!}"', + 'f"{!a}"', + + # invalid (empty) format specifiers + 'f"{1:{}}"', + 'f"{1:{:}}"', + + # a newline without a line continuation inside a single-line string + 'f"abc\ndef"', + ] +) +def test_invalid(code, grammar): + with pytest.raises(ParserSyntaxError): + grammar.parse(code, error_recovery=False) + + # It should work with error recovery. + grammar.parse(code, error_recovery=True) + + +@pytest.mark.parametrize( + ('code', 'positions'), [ + # 2 times 2, 5 because python expr and endmarker. + ('f"}{"', [(1, 0), (1, 2), (1, 3), (1, 4), (1, 5)]), + ('f" :{ 1 : } "', [(1, 0), (1, 2), (1, 4), (1, 6), (1, 8), (1, 9), + (1, 10), (1, 11), (1, 12), (1, 13)]), + ('f"""\n {\nfoo\n }"""', [(1, 0), (1, 4), (2, 1), (3, 0), (4, 1), + (4, 2), (4, 5)]), + ] +) +def test_tokenize_start_pos(code, positions): + tokens = list(tokenize(code, version_info=(3, 6))) + assert positions == [p.start_pos for p in tokens] + + +@pytest.mark.parametrize( + 'code', [ + dedent("""\ + f'''s{ + str.uppe + ''' + """), + 'f"foo', + 'f"""foo', + 'f"abc\ndef"', + ] +) +def test_roundtrip(grammar, code): + tree = grammar.parse(code) + assert tree.get_code() == code diff --git a/vim/bundle/jedi-vim/pythonx/parso/test/test_get_code.py b/vim/bundle/jedi-vim/pythonx/parso/test/test_get_code.py new file mode 100644 index 0000000..2f2260d --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/test/test_get_code.py @@ -0,0 +1,120 @@ +import difflib + +import pytest + +from parso import parse + +code_basic_features = ''' +"""A mod docstring""" + +def a_function(a_argument, a_default = "default"): + """A func docstring""" + + a_result = 3 * a_argument + print(a_result) # a comment + b = """ +from +to""" + "huhu" + + + if a_default == "default": + return str(a_result) + else + return None +''' + + +def diff_code_assert(a, b, n=4): + if a != b: + diff = "\n".join(difflib.unified_diff( + a.splitlines(), + b.splitlines(), + n=n, + lineterm="" + )) + assert False, "Code does not match:\n%s\n\ncreated code:\n%s" % ( + diff, + b + ) + pass + + +def test_basic_parsing(): + """Validate the parsing features""" + + m = parse(code_basic_features) + diff_code_assert( + code_basic_features, + m.get_code() + ) + + +def test_operators(): + src = '5 * 3' + module = parse(src) + diff_code_assert(src, module.get_code()) + + +def test_get_code(): + """Use the same code that the parser also generates, to compare""" + s = '''"""a docstring""" +class SomeClass(object, mixin): + def __init__(self): + self.xy = 3.0 + """statement docstr""" + def some_method(self): + return 1 + def yield_method(self): + while hasattr(self, 'xy'): + yield True + for x in [1, 2]: + yield x + def empty(self): + pass +class Empty: + pass +class WithDocstring: + """class docstr""" + pass +def method_with_docstring(): + """class docstr""" + pass +''' + assert parse(s).get_code() == s + + +def test_end_newlines(): + """ + The Python grammar explicitly needs a newline at the end. Jedi though still + wants to be able, to return the exact same code without the additional new + line the parser needs. + """ + def test(source, end_pos): + module = parse(source) + assert module.get_code() == source + assert module.end_pos == end_pos + + test('a', (1, 1)) + test('a\n', (2, 0)) + test('a\nb', (2, 1)) + test('a\n#comment\n', (3, 0)) + test('a\n#comment', (2, 8)) + test('a#comment', (1, 9)) + test('def a():\n pass', (2, 5)) + + test('def a(', (1, 6)) + + +@pytest.mark.parametrize(('code', 'types'), [ + ('\r', ['endmarker']), + ('\n\r', ['endmarker']) +]) +def test_carriage_return_at_end(code, types): + """ + By adding an artificial newline this created weird side effects for + \r at the end of files. + """ + tree = parse(code) + assert tree.get_code() == code + assert [c.type for c in tree.children] == types + assert tree.end_pos == (len(code) + 1, 0) diff --git a/vim/bundle/jedi-vim/pythonx/parso/test/test_grammar.py b/vim/bundle/jedi-vim/pythonx/parso/test/test_grammar.py new file mode 100644 index 0000000..60a249b --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/test/test_grammar.py @@ -0,0 +1,8 @@ +import parso + +import pytest + + +def test_non_unicode(): + with pytest.raises(UnicodeDecodeError): + parso.parse(b'\xe4') diff --git a/vim/bundle/jedi-vim/pythonx/parso/test/test_load_grammar.py b/vim/bundle/jedi-vim/pythonx/parso/test/test_load_grammar.py new file mode 100644 index 0000000..70dd807 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/test/test_load_grammar.py @@ -0,0 +1,31 @@ +import pytest +from parso.grammar import load_grammar +from parso import utils + + +def test_load_inexisting_grammar(): + # This version shouldn't be out for a while, but if we ever do, wow! + with pytest.raises(NotImplementedError): + load_grammar(version='15.8') + # The same is true for very old grammars (even though this is probably not + # going to be an issue. + with pytest.raises(NotImplementedError): + load_grammar(version='1.5') + + +@pytest.mark.parametrize(('string', 'result'), [ + ('2', (2, 7)), ('3', (3, 6)), ('1.1', (1, 1)), ('1.1.1', (1, 1)), ('300.1.31', (300, 1)) +]) +def test_parse_version(string, result): + assert utils._parse_version(string) == result + + +@pytest.mark.parametrize('string', ['1.', 'a', '#', '1.3.4.5', '1.12']) +def test_invalid_grammar_version(string): + with pytest.raises(ValueError): + load_grammar(version=string) + + +def test_grammar_int_version(): + with pytest.raises(TypeError): + load_grammar(version=3.2) diff --git a/vim/bundle/jedi-vim/pythonx/parso/test/test_normalizer_issues_files.py b/vim/bundle/jedi-vim/pythonx/parso/test/test_normalizer_issues_files.py new file mode 100644 index 0000000..7f692d1 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/test/test_normalizer_issues_files.py @@ -0,0 +1,70 @@ +""" +To easily verify if our normalizer raises the right error codes, just use the +tests of pydocstyle. +""" + +import difflib +import re + +import parso +from parso._compatibility import total_ordering +from parso.utils import python_bytes_to_unicode + + +@total_ordering +class WantedIssue(object): + def __init__(self, code, line, column): + self.code = code + self._line = line + self._column = column + + def __eq__(self, other): + return self.code == other.code and self.start_pos == other.start_pos + + def __lt__(self, other): + return self.start_pos < other.start_pos or self.code < other.code + + def __hash__(self): + return hash(str(self.code) + str(self._line) + str(self._column)) + + @property + def start_pos(self): + return self._line, self._column + + +def collect_errors(code): + for line_nr, line in enumerate(code.splitlines(), 1): + match = re.match(r'(\s*)#: (.*)$', line) + if match is not None: + codes = match.group(2) + for code in codes.split(): + code, _, add_indent = code.partition(':') + column = int(add_indent or len(match.group(1))) + + code, _, add_line = code.partition('+') + l = line_nr + 1 + int(add_line or 0) + + yield WantedIssue(code[1:], l, column) + + +def test_normalizer_issue(normalizer_issue_case): + def sort(issues): + issues = sorted(issues, key=lambda i: (i.start_pos, i.code)) + return ["(%s, %s): %s" % (i.start_pos[0], i.start_pos[1], i.code) + for i in issues] + + with open(normalizer_issue_case.path, 'rb') as f: + code = python_bytes_to_unicode(f.read()) + + desired = sort(collect_errors(code)) + + grammar = parso.load_grammar(version=normalizer_issue_case.python_version) + module = grammar.parse(code) + issues = grammar._get_normalizer_issues(module) + actual = sort(issues) + + diff = '\n'.join(difflib.ndiff(desired, actual)) + # To make the pytest -v diff a bit prettier, stop pytest to rewrite assert + # statements by executing the comparison earlier. + _bool = desired == actual + assert _bool, '\n' + diff diff --git a/vim/bundle/jedi-vim/pythonx/parso/test/test_old_fast_parser.py b/vim/bundle/jedi-vim/pythonx/parso/test/test_old_fast_parser.py new file mode 100644 index 0000000..7e12a03 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/test/test_old_fast_parser.py @@ -0,0 +1,210 @@ +""" +These tests test the cases that the old fast parser tested with the normal +parser. + +The old fast parser doesn't exist anymore and was replaced with a diff parser. +However the tests might still be relevant for the parser. +""" + +from textwrap import dedent + +from parso._compatibility import u +from parso import parse + + +def test_carriage_return_splitting(): + source = u(dedent(''' + + + + "string" + + class Foo(): + pass + ''')) + source = source.replace('\n', '\r\n') + module = parse(source) + assert [n.value for lst in module.get_used_names().values() for n in lst] == ['Foo'] + + +def check_p(src, number_parsers_used, number_of_splits=None, number_of_misses=0): + if number_of_splits is None: + number_of_splits = number_parsers_used + + module_node = parse(src) + + assert src == module_node.get_code() + return module_node + + +def test_for(): + src = dedent("""\ + for a in [1,2]: + a + + for a1 in 1,"": + a1 + """) + check_p(src, 1) + + +def test_class_with_class_var(): + src = dedent("""\ + class SuperClass: + class_super = 3 + def __init__(self): + self.foo = 4 + pass + """) + check_p(src, 3) + + +def test_func_with_if(): + src = dedent("""\ + def recursion(a): + if foo: + return recursion(a) + else: + if bar: + return inexistent + else: + return a + """) + check_p(src, 1) + + +def test_decorator(): + src = dedent("""\ + class Decorator(): + @memoize + def dec(self, a): + return a + """) + check_p(src, 2) + + +def test_nested_funcs(): + src = dedent("""\ + def memoize(func): + def wrapper(*args, **kwargs): + return func(*args, **kwargs) + return wrapper + """) + check_p(src, 3) + + +def test_multi_line_params(): + src = dedent("""\ + def x(a, + b): + pass + + foo = 1 + """) + check_p(src, 2) + + +def test_class_func_if(): + src = dedent("""\ + class Class: + def func(self): + if 1: + a + else: + b + + pass + """) + check_p(src, 3) + + +def test_multi_line_for(): + src = dedent("""\ + for x in [1, + 2]: + pass + + pass + """) + check_p(src, 1) + + +def test_wrong_indentation(): + src = dedent("""\ + def func(): + a + b + a + """) + #check_p(src, 1) + + src = dedent("""\ + def complex(): + def nested(): + a + b + a + + def other(): + pass + """) + check_p(src, 3) + + +def test_strange_parentheses(): + src = dedent(""" + class X(): + a = (1 + if 1 else 2) + def x(): + pass + """) + check_p(src, 2) + + +def test_fake_parentheses(): + """ + The fast parser splitting counts parentheses, but not as correct tokens. + Therefore parentheses in string tokens are included as well. This needs to + be accounted for. + """ + src = dedent(r""" + def x(): + a = (')' + if 1 else 2) + def y(): + pass + def z(): + pass + """) + check_p(src, 3, 2, 1) + + +def test_additional_indent(): + source = dedent('''\ + int( + def x(): + pass + ''') + + check_p(source, 2) + + +def test_round_trip(): + code = dedent(''' + def x(): + """hahaha""" + func''') + + assert parse(code).get_code() == code + + +def test_parentheses_in_string(): + code = dedent(''' + def x(): + '(' + + import abc + + abc.''') + check_p(code, 2, 1, 1) diff --git a/vim/bundle/jedi-vim/pythonx/parso/test/test_param_splitting.py b/vim/bundle/jedi-vim/pythonx/parso/test/test_param_splitting.py new file mode 100644 index 0000000..f04fea7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/test/test_param_splitting.py @@ -0,0 +1,47 @@ +''' +To make the life of any analysis easier, we are generating Param objects +instead of simple parser objects. +''' + +from textwrap import dedent + +from parso import parse + + +def assert_params(param_string, version=None, **wanted_dct): + source = dedent(''' + def x(%s): + pass + ''') % param_string + + module = parse(source, version=version) + funcdef = next(module.iter_funcdefs()) + dct = dict((p.name.value, p.default and p.default.get_code()) + for p in funcdef.get_params()) + assert dct == wanted_dct + assert module.get_code() == source + + +def test_split_params_with_separation_star(): + assert_params(u'x, y=1, *, z=3', x=None, y='1', z='3', version='3.5') + assert_params(u'*, x', x=None, version='3.5') + assert_params(u'*', version='3.5') + + +def test_split_params_with_stars(): + assert_params(u'x, *args', x=None, args=None) + assert_params(u'**kwargs', kwargs=None) + assert_params(u'*args, **kwargs', args=None, kwargs=None) + + +def test_kw_only_no_kw(works_ge_py3): + """ + Parsing this should be working. In CPython the parser also parses this and + in a later step the AST complains. + """ + module = works_ge_py3.parse('def test(arg, *):\n pass') + if module is not None: + func = module.children[0] + open_, p1, asterisk, close = func._get_param_nodes() + assert p1.get_code('arg,') + assert asterisk.value == '*' diff --git a/vim/bundle/jedi-vim/pythonx/parso/test/test_parser.py b/vim/bundle/jedi-vim/pythonx/parso/test/test_parser.py new file mode 100644 index 0000000..e36ad50 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/test/test_parser.py @@ -0,0 +1,210 @@ +# -*- coding: utf-8 -*- +from textwrap import dedent + +import pytest + +from parso._compatibility import u +from parso import parse +from parso.python import tree +from parso.utils import split_lines + + +def test_basic_parsing(each_version): + def compare(string): + """Generates the AST object and then regenerates the code.""" + assert parse(string, version=each_version).get_code() == string + + compare('\na #pass\n') + compare('wblabla* 1\t\n') + compare('def x(a, b:3): pass\n') + compare('assert foo\n') + + +def test_subscope_names(each_version): + def get_sub(source): + return parse(source, version=each_version).children[0] + + name = get_sub('class Foo: pass').name + assert name.start_pos == (1, len('class ')) + assert name.end_pos == (1, len('class Foo')) + assert name.value == 'Foo' + + name = get_sub('def foo(): pass').name + assert name.start_pos == (1, len('def ')) + assert name.end_pos == (1, len('def foo')) + assert name.value == 'foo' + + +def test_import_names(each_version): + def get_import(source): + return next(parse(source, version=each_version).iter_imports()) + + imp = get_import('import math\n') + names = imp.get_defined_names() + assert len(names) == 1 + assert names[0].value == 'math' + assert names[0].start_pos == (1, len('import ')) + assert names[0].end_pos == (1, len('import math')) + + assert imp.start_pos == (1, 0) + assert imp.end_pos == (1, len('import math')) + + +def test_end_pos(each_version): + s = dedent(''' + x = ['a', 'b', 'c'] + def func(): + y = None + ''') + parser = parse(s, version=each_version) + scope = next(parser.iter_funcdefs()) + assert scope.start_pos == (3, 0) + assert scope.end_pos == (5, 0) + + +def test_carriage_return_statements(each_version): + source = dedent(''' + foo = 'ns1!' + + # this is a namespace package + ''') + source = source.replace('\n', '\r\n') + stmt = parse(source, version=each_version).children[0] + assert '#' not in stmt.get_code() + + +def test_incomplete_list_comprehension(each_version): + """ Shouldn't raise an error, same bug as #418. """ + # With the old parser this actually returned a statement. With the new + # parser only valid statements generate one. + children = parse('(1 for def', version=each_version).children + assert [c.type for c in children] == \ + ['error_node', 'error_node', 'endmarker'] + + +def test_newline_positions(each_version): + endmarker = parse('a\n', version=each_version).children[-1] + assert endmarker.end_pos == (2, 0) + new_line = endmarker.get_previous_leaf() + assert new_line.start_pos == (1, 1) + assert new_line.end_pos == (2, 0) + + +def test_end_pos_error_correction(each_version): + """ + Source code without ending newline are given one, because the Python + grammar needs it. However, they are removed again. We still want the right + end_pos, even if something breaks in the parser (error correction). + """ + s = 'def x():\n .' + m = parse(s, version=each_version) + func = m.children[0] + assert func.type == 'funcdef' + assert func.end_pos == (2, 2) + assert m.end_pos == (2, 2) + + +def test_param_splitting(each_version): + """ + Jedi splits parameters into params, this is not what the grammar does, + but Jedi does this to simplify argument parsing. + """ + def check(src, result): + # Python 2 tuple params should be ignored for now. + m = parse(src, version=each_version) + if each_version.startswith('2'): + # We don't want b and c to be a part of the param enumeration. Just + # ignore them, because it's not what we want to support in the + # future. + func = next(m.iter_funcdefs()) + assert [param.name.value for param in func.get_params()] == result + else: + assert not list(m.iter_funcdefs()) + + check('def x(a, (b, c)):\n pass', ['a']) + check('def x((b, c)):\n pass', []) + + +def test_unicode_string(): + s = tree.String(None, u('bö'), (0, 0)) + assert repr(s) # Should not raise an Error! + + +def test_backslash_dos_style(each_version): + assert parse('\\\r\n', version=each_version) + + +def test_started_lambda_stmt(each_version): + m = parse(u'lambda a, b: a i', version=each_version) + assert m.children[0].type == 'error_node' + + +def test_python2_octal(each_version): + module = parse('0660', version=each_version) + first = module.children[0] + if each_version.startswith('2'): + assert first.type == 'number' + else: + assert first.type == 'error_node' + + +@pytest.mark.parametrize('code', ['foo "', 'foo """\n', 'foo """\nbar']) +def test_open_string_literal(each_version, code): + """ + Testing mostly if removing the last newline works. + """ + lines = split_lines(code, keepends=True) + end_pos = (len(lines), len(lines[-1])) + module = parse(code, version=each_version) + assert module.get_code() == code + assert module.end_pos == end_pos == module.children[1].end_pos + + +def test_too_many_params(): + with pytest.raises(TypeError): + parse('asdf', hello=3) + + +def test_dedent_at_end(each_version): + code = dedent(''' + for foobar in [1]: + foobar''') + module = parse(code, version=each_version) + assert module.get_code() == code + suite = module.children[0].children[-1] + foobar = suite.children[-1] + assert foobar.type == 'name' + + +def test_no_error_nodes(each_version): + def check(node): + assert node.type not in ('error_leaf', 'error_node') + + try: + children = node.children + except AttributeError: + pass + else: + for child in children: + check(child) + + check(parse("if foo:\n bar", version=each_version)) + + +def test_named_expression(works_ge_py38): + works_ge_py38.parse("(a := 1, a + 1)") + + +@pytest.mark.parametrize( + 'param_code', [ + 'a=1, /', + 'a, /', + 'a=1, /, b=3', + 'a, /, b', + 'a, /, b', + 'a, /, *, b', + 'a, /, **kwargs', + ] +) +def test_positional_only_arguments(works_ge_py38, param_code): + works_ge_py38.parse("def x(%s): pass" % param_code) diff --git a/vim/bundle/jedi-vim/pythonx/parso/test/test_parser_tree.py b/vim/bundle/jedi-vim/pythonx/parso/test/test_parser_tree.py new file mode 100644 index 0000000..69cfe76 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/test/test_parser_tree.py @@ -0,0 +1,182 @@ +# -*- coding: utf-8 # This file contains Unicode characters. + +from textwrap import dedent + +import pytest + +from parso import parse +from parso.python import tree + + +class TestsFunctionAndLambdaParsing(object): + + FIXTURES = [ + ('def my_function(x, y, z) -> str:\n return x + y * z\n', { + 'name': 'my_function', + 'call_sig': 'my_function(x, y, z)', + 'params': ['x', 'y', 'z'], + 'annotation': "str", + }), + ('lambda x, y, z: x + y * z\n', { + 'name': '', + 'call_sig': '(x, y, z)', + 'params': ['x', 'y', 'z'], + }), + ] + + @pytest.fixture(params=FIXTURES) + def node(self, request): + parsed = parse(dedent(request.param[0]), version='3.5') + request.keywords['expected'] = request.param[1] + child = parsed.children[0] + if child.type == 'simple_stmt': + child = child.children[0] + return child + + @pytest.fixture() + def expected(self, request, node): + return request.keywords['expected'] + + def test_name(self, node, expected): + if node.type != 'lambdef': + assert isinstance(node.name, tree.Name) + assert node.name.value == expected['name'] + + def test_params(self, node, expected): + assert isinstance(node.get_params(), list) + assert all(isinstance(x, tree.Param) for x in node.get_params()) + assert [str(x.name.value) for x in node.get_params()] == [x for x in expected['params']] + + def test_is_generator(self, node, expected): + assert node.is_generator() is expected.get('is_generator', False) + + def test_yields(self, node, expected): + assert node.is_generator() == expected.get('yields', False) + + def test_annotation(self, node, expected): + expected_annotation = expected.get('annotation', None) + if expected_annotation is None: + assert node.annotation is None + else: + assert node.annotation.value == expected_annotation + + +def test_end_pos_line(each_version): + # jedi issue #150 + s = "x()\nx( )\nx( )\nx ( )\n" + + module = parse(s, version=each_version) + for i, simple_stmt in enumerate(module.children[:-1]): + expr_stmt = simple_stmt.children[0] + assert expr_stmt.end_pos == (i + 1, i + 3) + + +def test_default_param(each_version): + func = parse('def x(foo=42): pass', version=each_version).children[0] + param, = func.get_params() + assert param.default.value == '42' + assert param.annotation is None + assert not param.star_count + + +def test_annotation_param(each_py3_version): + func = parse('def x(foo: 3): pass', version=each_py3_version).children[0] + param, = func.get_params() + assert param.default is None + assert param.annotation.value == '3' + assert not param.star_count + + +def test_annotation_params(each_py3_version): + func = parse('def x(foo: 3, bar: 4): pass', version=each_py3_version).children[0] + param1, param2 = func.get_params() + + assert param1.default is None + assert param1.annotation.value == '3' + assert not param1.star_count + + assert param2.default is None + assert param2.annotation.value == '4' + assert not param2.star_count + + +def test_default_and_annotation_param(each_py3_version): + func = parse('def x(foo:3=42): pass', version=each_py3_version).children[0] + param, = func.get_params() + assert param.default.value == '42' + assert param.annotation.value == '3' + assert not param.star_count + + +def test_ellipsis_py2(each_py2_version): + module = parse('[0][...]', version=each_py2_version, error_recovery=False) + expr = module.children[0] + trailer = expr.children[-1] + subscript = trailer.children[1] + assert subscript.type == 'subscript' + assert [leaf.value for leaf in subscript.children] == ['.', '.', '.'] + + +def get_yield_exprs(code, version): + return list(parse(code, version=version).children[0].iter_yield_exprs()) + + +def get_return_stmts(code): + return list(parse(code).children[0].iter_return_stmts()) + + +def get_raise_stmts(code, child): + return list(parse(code).children[child].iter_raise_stmts()) + + +def test_yields(each_version): + y, = get_yield_exprs('def x(): yield', each_version) + assert y.value == 'yield' + assert y.type == 'keyword' + + y, = get_yield_exprs('def x(): (yield 1)', each_version) + assert y.type == 'yield_expr' + + y, = get_yield_exprs('def x(): [1, (yield)]', each_version) + assert y.type == 'keyword' + + +def test_yield_from(): + y, = get_yield_exprs('def x(): (yield from 1)', '3.3') + assert y.type == 'yield_expr' + + +def test_returns(): + r, = get_return_stmts('def x(): return') + assert r.value == 'return' + assert r.type == 'keyword' + + r, = get_return_stmts('def x(): return 1') + assert r.type == 'return_stmt' + + +def test_raises(): + code = """ +def single_function(): + raise Exception +def top_function(): + def inner_function(): + raise NotImplementedError() + inner_function() + raise Exception +def top_function_three(): + try: + raise NotImplementedError() + except NotImplementedError: + pass + raise Exception + """ + + r = get_raise_stmts(code, 0) # Lists in a simple Function + assert len(list(r)) == 1 + + r = get_raise_stmts(code, 1) # Doesn't Exceptions list in closures + assert len(list(r)) == 1 + + r = get_raise_stmts(code, 2) # Lists inside try-catch + assert len(list(r)) == 2 diff --git a/vim/bundle/jedi-vim/pythonx/parso/test/test_pep8.py b/vim/bundle/jedi-vim/pythonx/parso/test/test_pep8.py new file mode 100644 index 0000000..44c11f4 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/test/test_pep8.py @@ -0,0 +1,39 @@ +import parso + + +def issues(code): + grammar = parso.load_grammar() + module = parso.parse(code) + return grammar._get_normalizer_issues(module) + + +def test_eof_newline(): + def assert_issue(code): + found = issues(code) + assert len(found) == 1 + issue, = found + assert issue.code == 292 + + assert not issues('asdf = 1\n') + assert_issue('asdf = 1') + assert_issue('asdf = 1\n# foo') + assert_issue('# foobar') + assert_issue('') + assert_issue('foo = 1 # comment') + + +def test_eof_blankline(): + def assert_issue(code): + found = issues(code) + assert len(found) == 1 + issue, = found + assert issue.code == 391 + + assert_issue('asdf = 1\n\n') + assert_issue('# foobar\n\n') + assert_issue('\n\n') + +def test_shebang(): + assert not issues('#!\n') + assert not issues('#!/foo\n') + assert not issues('#! python\n') diff --git a/vim/bundle/jedi-vim/pythonx/parso/test/test_pgen2.py b/vim/bundle/jedi-vim/pythonx/parso/test/test_pgen2.py new file mode 100644 index 0000000..c83dff7 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/test/test_pgen2.py @@ -0,0 +1,303 @@ +"""Test suite for 2to3's parser and grammar files. + +This is the place to add tests for changes to 2to3's grammar, such as those +merging the grammars for Python 2 and 3. In addition to specific tests for +parts of the grammar we've changed, we also make sure we can parse the +test_grammar.py files from both Python 2 and Python 3. +""" + +from textwrap import dedent + +import pytest + +from parso import load_grammar +from parso import ParserSyntaxError +from parso.pgen2 import generate_grammar +from parso.python import tokenize + + +def _parse(code, version=None): + code = dedent(code) + "\n\n" + grammar = load_grammar(version=version) + return grammar.parse(code, error_recovery=False) + + +def _invalid_syntax(code, version=None, **kwargs): + with pytest.raises(ParserSyntaxError): + module = _parse(code, version=version, **kwargs) + # For debugging + print(module.children) + + +def test_formfeed(each_py2_version): + s = u"""print 1\n\x0Cprint 2\n""" + t = _parse(s, each_py2_version) + assert t.children[0].children[0].type == 'print_stmt' + assert t.children[1].children[0].type == 'print_stmt' + s = u"""1\n\x0C\x0C2\n""" + t = _parse(s, each_py2_version) + + +def test_matrix_multiplication_operator(works_ge_py35): + works_ge_py35.parse("a @ b") + works_ge_py35.parse("a @= b") + + +def test_yield_from(works_ge_py3, each_version): + works_ge_py3.parse("yield from x") + works_ge_py3.parse("(yield from x) + y") + _invalid_syntax("yield from", each_version) + + +def test_await_expr(works_ge_py35): + works_ge_py35.parse("""async def foo(): + await x + """) + + works_ge_py35.parse("""async def foo(): + + def foo(): pass + + def foo(): pass + + await x + """) + + works_ge_py35.parse("""async def foo(): return await a""") + + works_ge_py35.parse("""def foo(): + def foo(): pass + async def foo(): await x + """) + + +@pytest.mark.skipif('sys.version_info[:2] < (3, 5)') +@pytest.mark.xfail(reason="acting like python 3.7") +def test_async_var(): + _parse("""async = 1""", "3.5") + _parse("""await = 1""", "3.5") + _parse("""def async(): pass""", "3.5") + + +def test_async_for(works_ge_py35): + works_ge_py35.parse("async def foo():\n async for a in b: pass") + + +def test_async_with(works_ge_py35): + works_ge_py35.parse("async def foo():\n async with a: pass") + + @pytest.mark.skipif('sys.version_info[:2] < (3, 5)') + @pytest.mark.xfail(reason="acting like python 3.7") + def test_async_with_invalid(): + _invalid_syntax("""def foo(): + async with a: pass""", version="3.5") + + +def test_raise_3x_style_1(each_version): + _parse("raise", each_version) + + +def test_raise_2x_style_2(works_in_py2): + works_in_py2.parse("raise E, V") + +def test_raise_2x_style_3(works_in_py2): + works_in_py2.parse("raise E, V, T") + +def test_raise_2x_style_invalid_1(each_version): + _invalid_syntax("raise E, V, T, Z", version=each_version) + +def test_raise_3x_style(works_ge_py3): + works_ge_py3.parse("raise E1 from E2") + +def test_raise_3x_style_invalid_1(each_version): + _invalid_syntax("raise E, V from E1", each_version) + +def test_raise_3x_style_invalid_2(each_version): + _invalid_syntax("raise E from E1, E2", each_version) + +def test_raise_3x_style_invalid_3(each_version): + _invalid_syntax("raise from E1, E2", each_version) + +def test_raise_3x_style_invalid_4(each_version): + _invalid_syntax("raise E from", each_version) + + +# Adapted from Python 3's Lib/test/test_grammar.py:GrammarTests.testFuncdef +def test_annotation_1(works_ge_py3): + works_ge_py3.parse("""def f(x) -> list: pass""") + +def test_annotation_2(works_ge_py3): + works_ge_py3.parse("""def f(x:int): pass""") + +def test_annotation_3(works_ge_py3): + works_ge_py3.parse("""def f(*x:str): pass""") + +def test_annotation_4(works_ge_py3): + works_ge_py3.parse("""def f(**x:float): pass""") + +def test_annotation_5(works_ge_py3): + works_ge_py3.parse("""def f(x, y:1+2): pass""") + +def test_annotation_6(each_py3_version): + _invalid_syntax("""def f(a, (b:1, c:2, d)): pass""", each_py3_version) + +def test_annotation_7(each_py3_version): + _invalid_syntax("""def f(a, (b:1, c:2, d), e:3=4, f=5, *g:6): pass""", each_py3_version) + +def test_annotation_8(each_py3_version): + s = """def f(a, (b:1, c:2, d), e:3=4, f=5, + *g:6, h:7, i=8, j:9=10, **k:11) -> 12: pass""" + _invalid_syntax(s, each_py3_version) + + +def test_except_new(each_version): + s = dedent(""" + try: + x + except E as N: + y""") + _parse(s, each_version) + +def test_except_old(works_in_py2): + s = dedent(""" + try: + x + except E, N: + y""") + works_in_py2.parse(s) + + +# Adapted from Python 3's Lib/test/test_grammar.py:GrammarTests.testAtoms +def test_set_literal_1(works_ge_py27): + works_ge_py27.parse("""x = {'one'}""") + +def test_set_literal_2(works_ge_py27): + works_ge_py27.parse("""x = {'one', 1,}""") + +def test_set_literal_3(works_ge_py27): + works_ge_py27.parse("""x = {'one', 'two', 'three'}""") + +def test_set_literal_4(works_ge_py27): + works_ge_py27.parse("""x = {2, 3, 4,}""") + + +def test_new_octal_notation(each_version): + _parse("""0o7777777777777""", each_version) + _invalid_syntax("""0o7324528887""", each_version) + + +def test_old_octal_notation(works_in_py2): + works_in_py2.parse("07") + + +def test_long_notation(works_in_py2): + works_in_py2.parse("0xFl") + works_in_py2.parse("0xFL") + works_in_py2.parse("0b1l") + works_in_py2.parse("0B1L") + works_in_py2.parse("0o7l") + works_in_py2.parse("0O7L") + works_in_py2.parse("0l") + works_in_py2.parse("0L") + works_in_py2.parse("10l") + works_in_py2.parse("10L") + + +def test_new_binary_notation(each_version): + _parse("""0b101010""", each_version) + _invalid_syntax("""0b0101021""", each_version) + + +def test_class_new_syntax(works_ge_py3): + works_ge_py3.parse("class B(t=7): pass") + works_ge_py3.parse("class B(t, *args): pass") + works_ge_py3.parse("class B(t, **kwargs): pass") + works_ge_py3.parse("class B(t, *args, **kwargs): pass") + works_ge_py3.parse("class B(t, y=9, *args, **kwargs): pass") + + +def test_parser_idempotency_extended_unpacking(works_ge_py3): + """A cut-down version of pytree_idempotency.py.""" + works_ge_py3.parse("a, *b, c = x\n") + works_ge_py3.parse("[*a, b] = x\n") + works_ge_py3.parse("(z, *y, w) = m\n") + works_ge_py3.parse("for *z, m in d: pass\n") + + +def test_multiline_bytes_literals(each_version): + """ + It's not possible to get the same result when using \xaa in Python 2/3, + because it's treated differently. + """ + s = u""" + md5test(b"\xaa" * 80, + (b"Test Using Larger Than Block-Size Key " + b"and Larger Than One Block-Size Data"), + "6f630fad67cda0ee1fb1f562db3aa53e") + """ + _parse(s, each_version) + + +def test_multiline_bytes_tripquote_literals(each_version): + s = ''' + b""" + + + """ + ''' + _parse(s, each_version) + + +def test_ellipsis(works_ge_py3, each_version): + works_ge_py3.parse("...") + _parse("[0][...]", version=each_version) + + +def test_dict_unpacking(works_ge_py35): + works_ge_py35.parse("{**dict(a=3), foo:2}") + + +def test_multiline_str_literals(each_version): + s = u""" + md5test("\xaa" * 80, + ("Test Using Larger Than Block-Size Key " + "and Larger Than One Block-Size Data"), + "6f630fad67cda0ee1fb1f562db3aa53e") + """ + _parse(s, each_version) + + +def test_py2_backticks(works_in_py2): + works_in_py2.parse("`1`") + + +def test_py2_string_prefixes(works_in_py2): + works_in_py2.parse("ur'1'") + works_in_py2.parse("Ur'1'") + works_in_py2.parse("UR'1'") + _invalid_syntax("ru'1'", works_in_py2.version) + + +def py_br(each_version): + _parse('br""', each_version) + + +def test_py3_rb(works_ge_py3): + works_ge_py3.parse("rb'1'") + works_ge_py3.parse("RB'1'") + + +def test_left_recursion(): + with pytest.raises(ValueError, match='left recursion'): + generate_grammar('foo: foo NAME\n', tokenize.PythonTokenTypes) + + +def test_ambiguities(): + with pytest.raises(ValueError, match='ambiguous'): + generate_grammar('foo: bar | baz\nbar: NAME\nbaz: NAME\n', tokenize.PythonTokenTypes) + + with pytest.raises(ValueError, match='ambiguous'): + generate_grammar('''foo: bar | baz\nbar: 'x'\nbaz: "x"\n''', tokenize.PythonTokenTypes) + + with pytest.raises(ValueError, match='ambiguous'): + generate_grammar('''foo: bar | 'x'\nbar: 'x'\n''', tokenize.PythonTokenTypes) diff --git a/vim/bundle/jedi-vim/pythonx/parso/test/test_prefix.py b/vim/bundle/jedi-vim/pythonx/parso/test/test_prefix.py new file mode 100644 index 0000000..0c79958 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/test/test_prefix.py @@ -0,0 +1,79 @@ +try: + from itertools import zip_longest +except ImportError: + # Python 2 + from itertools import izip_longest as zip_longest + +from codecs import BOM_UTF8 + +import pytest + +import parso + +unicode_bom = BOM_UTF8.decode('utf-8') + + +@pytest.mark.parametrize(('string', 'tokens'), [ + ('', ['']), + ('#', ['#', '']), + (' # ', ['# ', '']), + (' # \n', ['# ', '\n', '']), + (' # \f\n', ['# ', '\f', '\n', '']), + (' \n', ['\n', '']), + (' \n ', ['\n', ' ']), + (' \f ', ['\f', ' ']), + (' \f ', ['\f', ' ']), + (' \r\n', ['\r\n', '']), + ('\\\n', ['\\\n', '']), + ('\\\r\n', ['\\\r\n', '']), + ('\t\t\n\t', ['\n', '\t']), +]) +def test_simple_prefix_splitting(string, tokens): + tree = parso.parse(string) + leaf = tree.children[0] + assert leaf.type == 'endmarker' + + parsed_tokens = list(leaf._split_prefix()) + start_pos = (1, 0) + for pt, expected in zip_longest(parsed_tokens, tokens): + assert pt.value == expected + + # Calculate the estimated end_pos + if expected.endswith('\n'): + end_pos = start_pos[0] + 1, 0 + else: + end_pos = start_pos[0], start_pos[1] + len(expected) + len(pt.spacing) + + #assert start_pos == pt.start_pos + assert end_pos == pt.end_pos + start_pos = end_pos + + +@pytest.mark.parametrize(('string', 'types'), [ + ('# ', ['comment', 'spacing']), + ('\r\n', ['newline', 'spacing']), + ('\f', ['formfeed', 'spacing']), + ('\\\n', ['backslash', 'spacing']), + (' \t', ['spacing']), + (' \t ', ['spacing']), + (unicode_bom + ' # ', ['bom', 'comment', 'spacing']), +]) +def test_prefix_splitting_types(string, types): + tree = parso.parse(string) + leaf = tree.children[0] + assert leaf.type == 'endmarker' + parsed_tokens = list(leaf._split_prefix()) + assert [t.type for t in parsed_tokens] == types + + +def test_utf8_bom(): + tree = parso.parse(unicode_bom + 'a = 1') + expr_stmt = tree.children[0] + assert expr_stmt.start_pos == (1, 0) + + tree = parso.parse(unicode_bom + '\n') + endmarker = tree.children[0] + parts = list(endmarker._split_prefix()) + assert [p.type for p in parts] == ['bom', 'newline', 'spacing'] + assert [p.start_pos for p in parts] == [(1, 0), (1, 0), (2, 0)] + assert [p.end_pos for p in parts] == [(1, 0), (2, 0), (2, 0)] diff --git a/vim/bundle/jedi-vim/pythonx/parso/test/test_python_errors.py b/vim/bundle/jedi-vim/pythonx/parso/test/test_python_errors.py new file mode 100644 index 0000000..71a67eb --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/test/test_python_errors.py @@ -0,0 +1,309 @@ +""" +Testing if parso finds syntax errors and indentation errors. +""" +import sys +import warnings + +import pytest + +import parso +from parso._compatibility import is_pypy +from .failing_examples import FAILING_EXAMPLES, indent, build_nested + + +if is_pypy: + # The errors in PyPy might be different. Just skip the module for now. + pytestmark = pytest.mark.skip() + + +def _get_error_list(code, version=None): + grammar = parso.load_grammar(version=version) + tree = grammar.parse(code) + return list(grammar.iter_errors(tree)) + + +def assert_comparison(code, error_code, positions): + errors = [(error.start_pos, error.code) for error in _get_error_list(code)] + assert [(pos, error_code) for pos in positions] == errors + + +@pytest.mark.parametrize('code', FAILING_EXAMPLES) +def test_python_exception_matches(code): + wanted, line_nr = _get_actual_exception(code) + + errors = _get_error_list(code) + actual = None + if errors: + error, = errors + actual = error.message + assert actual in wanted + # Somehow in Python3.3 the SyntaxError().lineno is sometimes None + assert line_nr is None or line_nr == error.start_pos[0] + + +def test_non_async_in_async(): + """ + This example doesn't work with FAILING_EXAMPLES, because the line numbers + are not always the same / incorrect in Python 3.8. + """ + if sys.version_info[:2] < (3, 5): + pytest.skip() + + # Raises multiple errors in previous versions. + code = 'async def foo():\n def nofoo():[x async for x in []]' + wanted, line_nr = _get_actual_exception(code) + + errors = _get_error_list(code) + if errors: + error, = errors + actual = error.message + assert actual in wanted + if sys.version_info[:2] < (3, 8): + assert line_nr == error.start_pos[0] + else: + assert line_nr == 0 # For whatever reason this is zero in Python 3.8+ + + +@pytest.mark.parametrize( + ('code', 'positions'), [ + ('1 +', [(1, 3)]), + ('1 +\n', [(1, 3)]), + ('1 +\n2 +', [(1, 3), (2, 3)]), + ('x + 2', []), + ('[\n', [(2, 0)]), + ('[\ndef x(): pass', [(2, 0)]), + ('[\nif 1: pass', [(2, 0)]), + ('1+?', [(1, 2)]), + ('?', [(1, 0)]), + ('??', [(1, 0)]), + ('? ?', [(1, 0)]), + ('?\n?', [(1, 0), (2, 0)]), + ('? * ?', [(1, 0)]), + ('1 + * * 2', [(1, 4)]), + ('?\n1\n?', [(1, 0), (3, 0)]), + ] +) +def test_syntax_errors(code, positions): + assert_comparison(code, 901, positions) + + +@pytest.mark.parametrize( + ('code', 'positions'), [ + (' 1', [(1, 0)]), + ('def x():\n 1\n 2', [(3, 0)]), + ('def x():\n 1\n 2', [(3, 0)]), + ('def x():\n1', [(2, 0)]), + ] +) +def test_indentation_errors(code, positions): + assert_comparison(code, 903, positions) + + +def _get_actual_exception(code): + with warnings.catch_warnings(): + # We don't care about warnings where locals/globals misbehave here. + # It's as simple as either an error or not. + warnings.filterwarnings('ignore', category=SyntaxWarning) + try: + compile(code, '', 'exec') + except (SyntaxError, IndentationError) as e: + wanted = e.__class__.__name__ + ': ' + e.msg + line_nr = e.lineno + except ValueError as e: + # The ValueError comes from byte literals in Python 2 like '\x' + # that are oddly enough not SyntaxErrors. + wanted = 'SyntaxError: (value error) ' + str(e) + line_nr = None + else: + assert False, "The piece of code should raise an exception." + + # SyntaxError + # Python 2.6 has a bit different error messages here, so skip it. + if sys.version_info[:2] == (2, 6) and wanted == 'SyntaxError: unexpected EOF while parsing': + wanted = 'SyntaxError: invalid syntax' + + if wanted == 'SyntaxError: non-keyword arg after keyword arg': + # The python 3.5+ way, a bit nicer. + wanted = 'SyntaxError: positional argument follows keyword argument' + elif wanted == 'SyntaxError: assignment to keyword': + return [wanted, "SyntaxError: can't assign to keyword", + 'SyntaxError: cannot assign to __debug__'], line_nr + elif wanted == 'SyntaxError: assignment to None': + # Python 2.6 does has a slightly different error. + wanted = 'SyntaxError: cannot assign to None' + elif wanted == 'SyntaxError: can not assign to __debug__': + # Python 2.6 does has a slightly different error. + wanted = 'SyntaxError: cannot assign to __debug__' + elif wanted == 'SyntaxError: can use starred expression only as assignment target': + # Python 3.4/3.4 have a bit of a different warning than 3.5/3.6 in + # certain places. But in others this error makes sense. + return [wanted, "SyntaxError: can't use starred expression here"], line_nr + elif wanted == 'SyntaxError: f-string: unterminated string': + wanted = 'SyntaxError: EOL while scanning string literal' + elif wanted == 'SyntaxError: f-string expression part cannot include a backslash': + return [ + wanted, + "SyntaxError: EOL while scanning string literal", + "SyntaxError: unexpected character after line continuation character", + ], line_nr + elif wanted == "SyntaxError: f-string: expecting '}'": + wanted = 'SyntaxError: EOL while scanning string literal' + elif wanted == 'SyntaxError: f-string: empty expression not allowed': + wanted = 'SyntaxError: invalid syntax' + elif wanted == "SyntaxError: f-string expression part cannot include '#'": + wanted = 'SyntaxError: invalid syntax' + elif wanted == "SyntaxError: f-string: single '}' is not allowed": + wanted = 'SyntaxError: invalid syntax' + return [wanted], line_nr + + +def test_default_except_error_postition(): + # For this error the position seemed to be one line off, but that doesn't + # really matter. + code = 'try: pass\nexcept: pass\nexcept X: pass' + wanted, line_nr = _get_actual_exception(code) + error, = _get_error_list(code) + assert error.message in wanted + assert line_nr != error.start_pos[0] + # I think this is the better position. + assert error.start_pos[0] == 2 + + +def test_statically_nested_blocks(): + def build(code, depth): + if depth == 0: + return code + + new_code = 'if 1:\n' + indent(code) + return build(new_code, depth - 1) + + def get_error(depth, add_func=False): + code = build('foo', depth) + if add_func: + code = 'def bar():\n' + indent(code) + errors = _get_error_list(code) + if errors: + assert errors[0].message == 'SyntaxError: too many statically nested blocks' + return errors[0] + return None + + assert get_error(19) is None + assert get_error(19, add_func=True) is None + + assert get_error(20) + assert get_error(20, add_func=True) + + +def test_future_import_first(): + def is_issue(code, *args): + code = code % args + return bool(_get_error_list(code)) + + i1 = 'from __future__ import division' + i2 = 'from __future__ import absolute_import' + assert not is_issue(i1) + assert not is_issue(i1 + ';' + i2) + assert not is_issue(i1 + '\n' + i2) + assert not is_issue('"";' + i1) + assert not is_issue('"";' + i1) + assert not is_issue('""\n' + i1) + assert not is_issue('""\n%s\n%s', i1, i2) + assert not is_issue('""\n%s;%s', i1, i2) + assert not is_issue('"";%s;%s ', i1, i2) + assert not is_issue('"";%s\n%s ', i1, i2) + assert is_issue('1;' + i1) + assert is_issue('1\n' + i1) + assert is_issue('"";1\n' + i1) + assert is_issue('""\n%s\nfrom x import a\n%s', i1, i2) + assert is_issue('%s\n""\n%s', i1, i2) + + +def test_named_argument_issues(works_not_in_py): + message = works_not_in_py.get_error_message('def foo(*, **dict): pass') + message = works_not_in_py.get_error_message('def foo(*): pass') + if works_not_in_py.version.startswith('2'): + assert message == 'SyntaxError: invalid syntax' + else: + assert message == 'SyntaxError: named arguments must follow bare *' + + works_not_in_py.assert_no_error_in_passing('def foo(*, name): pass') + works_not_in_py.assert_no_error_in_passing('def foo(bar, *, name=1): pass') + works_not_in_py.assert_no_error_in_passing('def foo(bar, *, name=1, **dct): pass') + + +def test_escape_decode_literals(each_version): + """ + We are using internal functions to assure that unicode/bytes escaping is + without syntax errors. Here we make a bit of quality assurance that this + works through versions, because the internal function might change over + time. + """ + def get_msg(end, to=1): + base = "SyntaxError: (unicode error) 'unicodeescape' " \ + "codec can't decode bytes in position 0-%s: " % to + return base + end + + def get_msgs(escape): + return (get_msg('end of string in escape sequence'), + get_msg(r"truncated %s escape" % escape)) + + error, = _get_error_list(r'u"\x"', version=each_version) + assert error.message in get_msgs(r'\xXX') + + error, = _get_error_list(r'u"\u"', version=each_version) + assert error.message in get_msgs(r'\uXXXX') + + error, = _get_error_list(r'u"\U"', version=each_version) + assert error.message in get_msgs(r'\UXXXXXXXX') + + error, = _get_error_list(r'u"\N{}"', version=each_version) + assert error.message == get_msg(r'malformed \N character escape', to=2) + + error, = _get_error_list(r'u"\N{foo}"', version=each_version) + assert error.message == get_msg(r'unknown Unicode character name', to=6) + + # Finally bytes. + error, = _get_error_list(r'b"\x"', version=each_version) + wanted = r'SyntaxError: (value error) invalid \x escape' + if sys.version_info >= (3, 0): + # The positioning information is only available in Python 3. + wanted += ' at position 0' + assert error.message == wanted + + +def test_too_many_levels_of_indentation(): + assert not _get_error_list(build_nested('pass', 99)) + assert _get_error_list(build_nested('pass', 100)) + base = 'def x():\n if x:\n' + assert not _get_error_list(build_nested('pass', 49, base=base)) + assert _get_error_list(build_nested('pass', 50, base=base)) + + +@pytest.mark.parametrize( + 'code', [ + "f'{*args,}'", + r'f"\""', + r'f"\\\""', + r'fr"\""', + r'fr"\\\""', + r"print(f'Some {x:.2f} and some {y}')", + ] +) +def test_valid_fstrings(code): + assert not _get_error_list(code, version='3.6') + + +@pytest.mark.parametrize( + ('code', 'message'), [ + ("f'{1+}'", ('invalid syntax')), + (r'f"\"', ('invalid syntax')), + (r'fr"\"', ('invalid syntax')), + ] +) +def test_invalid_fstrings(code, message): + """ + Some fstring errors are handled differntly in 3.6 and other versions. + Therefore check specifically for these errors here. + """ + error, = _get_error_list(code, version='3.6') + assert message in error.message diff --git a/vim/bundle/jedi-vim/pythonx/parso/test/test_tokenize.py b/vim/bundle/jedi-vim/pythonx/parso/test/test_tokenize.py new file mode 100644 index 0000000..bf703dc --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/test/test_tokenize.py @@ -0,0 +1,392 @@ +# -*- coding: utf-8 # This file contains Unicode characters. + +import sys +from textwrap import dedent + +import pytest + +from parso._compatibility import py_version +from parso.utils import split_lines, parse_version_string +from parso.python.token import PythonTokenTypes +from parso.python import tokenize +from parso import parse +from parso.python.tokenize import PythonToken + + +# To make it easier to access some of the token types, just put them here. +NAME = PythonTokenTypes.NAME +NEWLINE = PythonTokenTypes.NEWLINE +STRING = PythonTokenTypes.STRING +NUMBER = PythonTokenTypes.NUMBER +INDENT = PythonTokenTypes.INDENT +DEDENT = PythonTokenTypes.DEDENT +ERRORTOKEN = PythonTokenTypes.ERRORTOKEN +OP = PythonTokenTypes.OP +ENDMARKER = PythonTokenTypes.ENDMARKER +ERROR_DEDENT = PythonTokenTypes.ERROR_DEDENT +FSTRING_START = PythonTokenTypes.FSTRING_START +FSTRING_STRING = PythonTokenTypes.FSTRING_STRING +FSTRING_END = PythonTokenTypes.FSTRING_END + + +def _get_token_list(string, version=None): + # Load the current version. + version_info = parse_version_string(version) + return list(tokenize.tokenize(string, version_info)) + + +def test_end_pos_one_line(): + parsed = parse(dedent(''' + def testit(): + a = "huhu" + ''')) + simple_stmt = next(parsed.iter_funcdefs()).get_suite().children[-1] + string = simple_stmt.children[0].get_rhs() + assert string.end_pos == (3, 14) + + +def test_end_pos_multi_line(): + parsed = parse(dedent(''' + def testit(): + a = """huhu + asdfasdf""" + "h" + ''')) + expr_stmt = next(parsed.iter_funcdefs()).get_suite().children[1].children[0] + string_leaf = expr_stmt.get_rhs().children[0] + assert string_leaf.end_pos == (4, 11) + + +def test_simple_no_whitespace(): + # Test a simple one line string, no preceding whitespace + simple_docstring = '"""simple one line docstring"""' + token_list = _get_token_list(simple_docstring) + _, value, _, prefix = token_list[0] + assert prefix == '' + assert value == '"""simple one line docstring"""' + + +def test_simple_with_whitespace(): + # Test a simple one line string with preceding whitespace and newline + simple_docstring = ' """simple one line docstring""" \r\n' + token_list = _get_token_list(simple_docstring) + assert token_list[0][0] == INDENT + typ, value, start_pos, prefix = token_list[1] + assert prefix == ' ' + assert value == '"""simple one line docstring"""' + assert typ == STRING + typ, value, start_pos, prefix = token_list[2] + assert prefix == ' ' + assert typ == NEWLINE + + +def test_function_whitespace(): + # Test function definition whitespace identification + fundef = dedent(''' + def test_whitespace(*args, **kwargs): + x = 1 + if x > 0: + print(True) + ''') + token_list = _get_token_list(fundef) + for _, value, _, prefix in token_list: + if value == 'test_whitespace': + assert prefix == ' ' + if value == '(': + assert prefix == '' + if value == '*': + assert prefix == '' + if value == '**': + assert prefix == ' ' + if value == 'print': + assert prefix == ' ' + if value == 'if': + assert prefix == ' ' + + +def test_tokenize_multiline_I(): + # Make sure multiline string having newlines have the end marker on the + # next line + fundef = '''""""\n''' + token_list = _get_token_list(fundef) + assert token_list == [PythonToken(ERRORTOKEN, '""""\n', (1, 0), ''), + PythonToken(ENDMARKER , '', (2, 0), '')] + + +def test_tokenize_multiline_II(): + # Make sure multiline string having no newlines have the end marker on + # same line + fundef = '''""""''' + token_list = _get_token_list(fundef) + assert token_list == [PythonToken(ERRORTOKEN, '""""', (1, 0), ''), + PythonToken(ENDMARKER, '', (1, 4), '')] + + +def test_tokenize_multiline_III(): + # Make sure multiline string having newlines have the end marker on the + # next line even if several newline + fundef = '''""""\n\n''' + token_list = _get_token_list(fundef) + assert token_list == [PythonToken(ERRORTOKEN, '""""\n\n', (1, 0), ''), + PythonToken(ENDMARKER, '', (3, 0), '')] + + +def test_identifier_contains_unicode(): + fundef = dedent(''' + def 我あφ(): + pass + ''') + token_list = _get_token_list(fundef) + unicode_token = token_list[1] + if py_version >= 30: + assert unicode_token[0] == NAME + else: + # Unicode tokens in Python 2 seem to be identified as operators. + # They will be ignored in the parser, that's ok. + assert unicode_token[0] == ERRORTOKEN + + +def test_quoted_strings(): + string_tokens = [ + 'u"test"', + 'u"""test"""', + 'U"""test"""', + "u'''test'''", + "U'''test'''", + ] + + for s in string_tokens: + module = parse('''a = %s\n''' % s) + simple_stmt = module.children[0] + expr_stmt = simple_stmt.children[0] + assert len(expr_stmt.children) == 3 + string_tok = expr_stmt.children[2] + assert string_tok.type == 'string' + assert string_tok.value == s + + +def test_ur_literals(): + """ + Decided to parse `u''` literals regardless of Python version. This makes + probably sense: + + - Python 3+ doesn't support it, but it doesn't hurt + not be. While this is incorrect, it's just incorrect for one "old" and in + the future not very important version. + - All the other Python versions work very well with it. + """ + def check(literal, is_literal=True): + token_list = _get_token_list(literal) + typ, result_literal, _, _ = token_list[0] + if is_literal: + if typ != FSTRING_START: + assert typ == STRING + assert result_literal == literal + else: + assert typ == NAME + + check('u""') + check('ur""', is_literal=not py_version >= 30) + check('Ur""', is_literal=not py_version >= 30) + check('UR""', is_literal=not py_version >= 30) + check('bR""') + # Starting with Python 3.3 this ordering is also possible. + if py_version >= 33: + check('Rb""') + + # Starting with Python 3.6 format strings where introduced. + check('fr""', is_literal=py_version >= 36) + check('rF""', is_literal=py_version >= 36) + check('f""', is_literal=py_version >= 36) + check('F""', is_literal=py_version >= 36) + + +def test_error_literal(): + error_token, newline, endmarker = _get_token_list('"\n') + assert error_token.type == ERRORTOKEN + assert error_token.string == '"' + assert newline.type == NEWLINE + assert endmarker.type == ENDMARKER + assert endmarker.prefix == '' + + bracket, error_token, endmarker = _get_token_list('( """') + assert error_token.type == ERRORTOKEN + assert error_token.prefix == ' ' + assert error_token.string == '"""' + assert endmarker.type == ENDMARKER + assert endmarker.prefix == '' + + +def test_endmarker_end_pos(): + def check(code): + tokens = _get_token_list(code) + lines = split_lines(code) + assert tokens[-1].end_pos == (len(lines), len(lines[-1])) + + check('#c') + check('#c\n') + check('a\n') + check('a') + check(r'a\\n') + check('a\\') + + +xfail_py2 = dict(marks=[pytest.mark.xfail(sys.version_info[0] == 2, reason='Python 2')]) + + +@pytest.mark.parametrize( + ('code', 'types'), [ + # Indentation + (' foo', [INDENT, NAME, DEDENT]), + (' foo\n bar', [INDENT, NAME, NEWLINE, ERROR_DEDENT, NAME, DEDENT]), + (' foo\n bar \n baz', [INDENT, NAME, NEWLINE, ERROR_DEDENT, NAME, + NEWLINE, ERROR_DEDENT, NAME, DEDENT]), + (' foo\nbar', [INDENT, NAME, NEWLINE, DEDENT, NAME]), + + # Name stuff + ('1foo1', [NUMBER, NAME]), + pytest.param( + u'மெல்லினம்', [NAME], + **xfail_py2), + pytest.param(u'²', [ERRORTOKEN], **xfail_py2), + pytest.param(u'ä²ö', [NAME, ERRORTOKEN, NAME], **xfail_py2), + pytest.param(u'ää²¹öö', [NAME, ERRORTOKEN, NAME], **xfail_py2), + ] +) +def test_token_types(code, types): + actual_types = [t.type for t in _get_token_list(code)] + assert actual_types == types + [ENDMARKER] + + +def test_error_string(): + t1, newline, endmarker = _get_token_list(' "\n') + assert t1.type == ERRORTOKEN + assert t1.prefix == ' ' + assert t1.string == '"' + assert newline.type == NEWLINE + assert endmarker.prefix == '' + assert endmarker.string == '' + + +def test_indent_error_recovery(): + code = dedent("""\ + str( + from x import a + def + """) + lst = _get_token_list(code) + expected = [ + # `str(` + INDENT, NAME, OP, + # `from parso` + NAME, NAME, + # `import a` on same line as the previous from parso + NAME, NAME, NEWLINE, + # Dedent happens, because there's an import now and the import + # statement "breaks" out of the opening paren on the first line. + DEDENT, + # `b` + NAME, NEWLINE, ENDMARKER] + assert [t.type for t in lst] == expected + + +def test_error_token_after_dedent(): + code = dedent("""\ + class C: + pass + $foo + """) + lst = _get_token_list(code) + expected = [ + NAME, NAME, OP, NEWLINE, INDENT, NAME, NEWLINE, DEDENT, + # $foo\n + ERRORTOKEN, NAME, NEWLINE, ENDMARKER + ] + assert [t.type for t in lst] == expected + + +def test_brackets_no_indentation(): + """ + There used to be an issue that the parentheses counting would go below + zero. This should not happen. + """ + code = dedent("""\ + } + { + } + """) + lst = _get_token_list(code) + assert [t.type for t in lst] == [OP, NEWLINE, OP, OP, NEWLINE, ENDMARKER] + + +def test_form_feed(): + error_token, endmarker = _get_token_list(dedent('''\ + \f"""''')) + assert error_token.prefix == '\f' + assert error_token.string == '"""' + assert endmarker.prefix == '' + + +def test_carriage_return(): + lst = _get_token_list(' =\\\rclass') + assert [t.type for t in lst] == [INDENT, OP, DEDENT, NAME, ENDMARKER] + + +def test_backslash(): + code = '\\\n# 1 \n' + endmarker, = _get_token_list(code) + assert endmarker.prefix == code + + +@pytest.mark.parametrize( + ('code', 'types'), [ + ('f"', [FSTRING_START]), + ('f""', [FSTRING_START, FSTRING_END]), + ('f" {}"', [FSTRING_START, FSTRING_STRING, OP, OP, FSTRING_END]), + ('f" "{}', [FSTRING_START, FSTRING_STRING, FSTRING_END, OP, OP]), + (r'f"\""', [FSTRING_START, FSTRING_STRING, FSTRING_END]), + (r'f"\""', [FSTRING_START, FSTRING_STRING, FSTRING_END]), + + # format spec + (r'f"Some {x:.2f}{y}"', [FSTRING_START, FSTRING_STRING, OP, NAME, OP, + FSTRING_STRING, OP, OP, NAME, OP, FSTRING_END]), + + # multiline f-string + ('f"""abc\ndef"""', [FSTRING_START, FSTRING_STRING, FSTRING_END]), + ('f"""abc{\n123}def"""', [ + FSTRING_START, FSTRING_STRING, OP, NUMBER, OP, FSTRING_STRING, + FSTRING_END + ]), + + # a line continuation inside of an fstring_string + ('f"abc\\\ndef"', [ + FSTRING_START, FSTRING_STRING, FSTRING_END + ]), + ('f"\\\n{123}\\\n"', [ + FSTRING_START, FSTRING_STRING, OP, NUMBER, OP, FSTRING_STRING, + FSTRING_END + ]), + + # a line continuation inside of an fstring_expr + ('f"{\\\n123}"', [FSTRING_START, OP, NUMBER, OP, FSTRING_END]), + + # a line continuation inside of an format spec + ('f"{123:.2\\\nf}"', [ + FSTRING_START, OP, NUMBER, OP, FSTRING_STRING, OP, FSTRING_END + ]), + + # a newline without a line continuation inside a single-line string is + # wrong, and will generate an ERRORTOKEN + ('f"abc\ndef"', [ + FSTRING_START, FSTRING_STRING, NEWLINE, NAME, ERRORTOKEN + ]), + + # a more complex example + (r'print(f"Some {x:.2f}a{y}")', [ + NAME, OP, FSTRING_START, FSTRING_STRING, OP, NAME, OP, + FSTRING_STRING, OP, FSTRING_STRING, OP, NAME, OP, FSTRING_END, OP + ]), + ] +) +def test_fstring(code, types, version_ge_py36): + actual_types = [t.type for t in _get_token_list(code, version_ge_py36)] + assert types + [ENDMARKER] == actual_types diff --git a/vim/bundle/jedi-vim/pythonx/parso/test/test_utils.py b/vim/bundle/jedi-vim/pythonx/parso/test/test_utils.py new file mode 100644 index 0000000..3078151 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/test/test_utils.py @@ -0,0 +1,65 @@ +from codecs import BOM_UTF8 + +from parso.utils import split_lines, python_bytes_to_unicode +import parso + +import pytest + + +@pytest.mark.parametrize( + ('string', 'expected_result', 'keepends'), [ + ('asd\r\n', ['asd', ''], False), + ('asd\r\n', ['asd\r\n', ''], True), + ('asd\r', ['asd', ''], False), + ('asd\r', ['asd\r', ''], True), + ('asd\n', ['asd', ''], False), + ('asd\n', ['asd\n', ''], True), + + ('asd\r\n\f', ['asd', '\f'], False), + ('asd\r\n\f', ['asd\r\n', '\f'], True), + + ('\fasd\r\n', ['\fasd', ''], False), + ('\fasd\r\n', ['\fasd\r\n', ''], True), + + ('', [''], False), + ('', [''], True), + + ('\n', ['', ''], False), + ('\n', ['\n', ''], True), + + ('\r', ['', ''], False), + ('\r', ['\r', ''], True), + + # Invalid line breaks + ('a\vb', ['a\vb'], False), + ('a\vb', ['a\vb'], True), + ('\x1C', ['\x1C'], False), + ('\x1C', ['\x1C'], True), + ] +) +def test_split_lines(string, expected_result, keepends): + assert split_lines(string, keepends=keepends) == expected_result + + +def test_python_bytes_to_unicode_unicode_text(): + source = ( + b"# vim: fileencoding=utf-8\n" + b"# \xe3\x81\x82\xe3\x81\x84\xe3\x81\x86\xe3\x81\x88\xe3\x81\x8a\n" + ) + actual = python_bytes_to_unicode(source) + expected = source.decode('utf-8') + assert actual == expected + + +def test_utf8_bom(): + unicode_bom = BOM_UTF8.decode('utf-8') + + module = parso.parse(unicode_bom) + endmarker = module.children[0] + assert endmarker.type == 'endmarker' + assert unicode_bom == endmarker.prefix + + module = parso.parse(unicode_bom + 'foo = 1') + expr_stmt = module.children[0] + assert expr_stmt.type == 'expr_stmt' + assert unicode_bom == expr_stmt.get_first_leaf().prefix diff --git a/vim/bundle/jedi-vim/pythonx/parso/tox.ini b/vim/bundle/jedi-vim/pythonx/parso/tox.ini new file mode 100644 index 0000000..3df09d5 --- /dev/null +++ b/vim/bundle/jedi-vim/pythonx/parso/tox.ini @@ -0,0 +1,17 @@ +[tox] +envlist = {py26,py27,py33,py34,py35,py36,py37} +[testenv] +extras = testing +deps = + py26,py33: pytest>=3.0.7,<3.3 + py27,py34: pytest<5 + py26,py33: setuptools<37 + coverage: coverage +setenv = +# https://github.com/tomchristie/django-rest-framework/issues/1957 +# tox corrupts __pycache__, solution from here: + PYTHONDONTWRITEBYTECODE=1 + coverage: TOX_TESTENV_COMMAND=coverage run -m pytest +commands = + {env:TOX_TESTENV_COMMAND:pytest} {posargs} + coverage: coverage report